aldehyde 0.2.154 → 0.2.156
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.01a0b7dbabd823a67a31.js +2 -0
- package/dist/bundle.01a0b7dbabd823a67a31.js.LICENSE.txt +30 -0
- package/dist/bundle.01a0b7dbabd823a67a31.js.gz +0 -0
- package/dist/bundle.021f784b1c84781461d2.js +1 -0
- package/dist/bundle.03c542ca824e205fe307.js +2 -0
- package/dist/bundle.03c542ca824e205fe307.js.LICENSE.txt +27 -0
- package/dist/bundle.03c542ca824e205fe307.js.gz +0 -0
- package/dist/bundle.15cb660c34802f6cccf5.js +1 -0
- package/dist/bundle.15cb660c34802f6cccf5.js.gz +0 -0
- package/dist/bundle.1efe3c525f7cb5289934.js +1 -0
- package/dist/bundle.1efe3c525f7cb5289934.js.gz +0 -0
- package/dist/bundle.23c961ccfebfb418bb3f.js +1 -0
- package/dist/bundle.23c961ccfebfb418bb3f.js.gz +0 -0
- package/dist/bundle.2465eaaa7b912bcdfa45.js +2 -0
- package/dist/bundle.2465eaaa7b912bcdfa45.js.LICENSE.txt +32 -0
- package/dist/bundle.2465eaaa7b912bcdfa45.js.gz +0 -0
- package/dist/bundle.320c02187dd135005102.js +2 -0
- package/dist/bundle.320c02187dd135005102.js.LICENSE.txt +6 -0
- package/dist/bundle.320c02187dd135005102.js.gz +0 -0
- package/dist/bundle.35a4af7e2d0da1942d79.js +10 -0
- package/dist/bundle.35a4af7e2d0da1942d79.js.gz +0 -0
- package/dist/bundle.3b2c7bdbe61a4cf963e4.js +1 -0
- package/dist/bundle.3b2c7bdbe61a4cf963e4.js.gz +0 -0
- package/dist/bundle.3f9072b1629cdb384b46.js +2 -0
- package/dist/bundle.3f9072b1629cdb384b46.js.LICENSE.txt +5 -0
- package/dist/bundle.3f9072b1629cdb384b46.js.gz +0 -0
- package/dist/bundle.46e2295b5360a725bcd5.js +1 -0
- package/dist/bundle.46e2295b5360a725bcd5.js.gz +0 -0
- package/dist/bundle.492530b9d526ae515db6.js +2 -0
- package/dist/bundle.492530b9d526ae515db6.js.LICENSE.txt +7 -0
- package/dist/bundle.492530b9d526ae515db6.js.gz +0 -0
- package/dist/bundle.4c3c988531c3cf360b87.js +1 -0
- package/dist/bundle.4c3c988531c3cf360b87.js.gz +0 -0
- package/dist/bundle.4da1a8a32161584fc0af.js +1 -0
- package/dist/bundle.5a9afb9ee6cceca506fa.js +5 -0
- package/dist/bundle.5a9afb9ee6cceca506fa.js.LICENSE.txt +10 -0
- package/dist/bundle.5a9afb9ee6cceca506fa.js.gz +0 -0
- package/dist/bundle.5e6cccd06b34a0e3a2ff.js +1 -0
- package/dist/bundle.5e6cccd06b34a0e3a2ff.js.gz +0 -0
- package/dist/bundle.61cf0615267bbaa0da3d.js +2 -0
- package/dist/bundle.61cf0615267bbaa0da3d.js.LICENSE.txt +16 -0
- package/dist/bundle.61cf0615267bbaa0da3d.js.gz +0 -0
- package/dist/bundle.66521244df6a9af1f8d7.js +1 -0
- package/dist/bundle.66521244df6a9af1f8d7.js.gz +0 -0
- package/dist/bundle.6fd2dadd29083268c5a6.js +2 -0
- package/dist/bundle.6fd2dadd29083268c5a6.js.LICENSE.txt +17 -0
- package/dist/bundle.6fd2dadd29083268c5a6.js.gz +0 -0
- package/dist/bundle.7fd0f10501de7fdda584.js +1 -0
- package/dist/bundle.7fd0f10501de7fdda584.js.gz +0 -0
- package/dist/bundle.8241d8d05e35988dd480.js +1 -0
- package/dist/bundle.8241d8d05e35988dd480.js.gz +0 -0
- package/dist/bundle.840e28984e710e12f467.js +75 -0
- package/dist/bundle.840e28984e710e12f467.js.LICENSE.txt +8 -0
- package/dist/bundle.840e28984e710e12f467.js.gz +0 -0
- package/dist/bundle.a049dc8814bbbf59160f.js +1 -0
- package/dist/bundle.a049dc8814bbbf59160f.js.gz +0 -0
- package/dist/bundle.a40e498a0d3d2ac8fb3c.js +1 -0
- package/dist/bundle.a40e498a0d3d2ac8fb3c.js.gz +0 -0
- package/dist/bundle.b7b86a025aa95dea0e19.js +2 -0
- package/dist/bundle.b7b86a025aa95dea0e19.js.LICENSE.txt +8 -0
- package/dist/bundle.b7b86a025aa95dea0e19.js.gz +0 -0
- package/dist/bundle.b7e3eb480b649b3de67b.js +2 -0
- package/dist/bundle.b7e3eb480b649b3de67b.js.LICENSE.txt +5 -0
- package/dist/bundle.b7e3eb480b649b3de67b.js.gz +0 -0
- package/dist/bundle.c1c6028fd703ebf78c2e.js +2 -0
- package/dist/bundle.c1c6028fd703ebf78c2e.js.LICENSE.txt +5 -0
- package/dist/bundle.c1c6028fd703ebf78c2e.js.gz +0 -0
- package/dist/bundle.cd10ae07e0e0c36d0dee.js +2 -0
- package/dist/bundle.cd10ae07e0e0c36d0dee.js.LICENSE.txt +22 -0
- package/dist/bundle.cd10ae07e0e0c36d0dee.js.gz +0 -0
- package/dist/bundle.cf6a1933769c2aee4e6e.js +1 -0
- package/dist/bundle.cf6a1933769c2aee4e6e.js.gz +0 -0
- package/dist/bundle.e760a70171cf0ae4567b.js +1 -0
- package/dist/bundle.e760a70171cf0ae4567b.js.gz +0 -0
- package/dist/bundle.f2b373e87dc8616576e5.js +2 -0
- package/dist/bundle.f2b373e87dc8616576e5.js.LICENSE.txt +1 -0
- package/dist/bundle.f2b373e87dc8616576e5.js.gz +0 -0
- package/dist/bundle.f6e1c4fda58154810fe2.js +2 -0
- package/dist/bundle.f6e1c4fda58154810fe2.js.LICENSE.txt +41 -0
- package/dist/bundle.f6e1c4fda58154810fe2.js.gz +0 -0
- package/dist/bundle.fa1e5bf8d58b99ef68e5.js +2 -0
- package/dist/bundle.fa1e5bf8d58b99ef68e5.js.LICENSE.txt +1 -0
- package/dist/bundle.fa1e5bf8d58b99ef68e5.js.gz +0 -0
- package/dist/bundle.fe9c09b8ace9c3117b0a.js +1 -0
- package/dist/bundle.fe9c09b8ace9c3117b0a.js.gz +0 -0
- package/dist/bundle.feaa17bec2057a4ee54f.js +1 -0
- package/dist/bundle.feaa17bec2057a4ee54f.js.gz +0 -0
- package/dist/css/chemstruc-graph-6437e59640f8b99b774f.css +12 -0
- package/dist/css/chemstruc-graph-6437e59640f8b99b774f.css.gz +0 -0
- package/dist/css/common-901df6b21f13391f2a53.css +56 -0
- package/dist/css/html-editor-draft-5e8e152675ab7d201c00.css +886 -0
- package/dist/css/html-editor-draft-5e8e152675ab7d201c00.css.gz +0 -0
- package/dist/css/main-d450a9a253ac65933d37.css +1071 -0
- package/dist/css/main-d450a9a253ac65933d37.css.gz +0 -0
- package/dist/images/logo-54b328b7.png +0 -0
- package/dist/index.html +4 -0
- package/lib/controls/entry-control.d.ts.map +1 -1
- package/lib/controls/entry-control.js +7 -42
- package/lib/controls/entry-control.js.map +1 -1
- package/lib/controls/rfield/index.d.ts.map +1 -1
- package/lib/controls/rfield/index.js.map +1 -1
- package/lib/controls/select/index.d.ts +30 -0
- package/lib/controls/select/index.d.ts.map +1 -0
- package/lib/controls/select/index.js +145 -0
- package/lib/controls/select/index.js.map +1 -0
- package/lib/form/criteria-form.d.ts.map +1 -1
- package/lib/form/criteria-form.js +6 -3
- package/lib/form/criteria-form.js.map +1 -1
- package/lib/tmpl/hc-data-source.d.ts +1 -0
- package/lib/tmpl/hc-data-source.d.ts.map +1 -1
- package/lib/tmpl/hc-data-source.js +28 -3
- package/lib/tmpl/hc-data-source.js.map +1 -1
- package/lib/tmpl/hcservice-v3.js +7 -7
- package/lib/tmpl/hcservice-v3.js.map +1 -1
- package/lib/tmpl/interface.d.ts +2 -1
- package/lib/tmpl/interface.d.ts.map +1 -1
- package/lib/tmpl/superagent.d.ts.map +1 -1
- package/lib/tmpl/superagent.js +21 -9
- package/lib/tmpl/superagent.js.map +1 -1
- package/lib/units/index.d.ts.map +1 -1
- package/lib/units/index.js +5 -3
- package/lib/units/index.js.map +1 -1
- package/package.json +1 -1
- package/src/aldehyde/controls/entry-control.tsx +10 -91
- package/src/aldehyde/controls/rfield/index.tsx +1 -0
- package/src/aldehyde/controls/select/index.tsx +215 -0
- package/src/aldehyde/form/criteria-form.tsx +7 -2
- package/src/aldehyde/tmpl/hc-data-source.tsx +357 -349
- package/src/aldehyde/tmpl/hcservice-v3.tsx +7 -7
- package/src/aldehyde/tmpl/interface.tsx +3 -2
- package/src/aldehyde/tmpl/superagent.js +18 -10
- package/src/aldehyde/units/index.tsx +5 -4
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see bundle.2465eaaa7b912bcdfa45.js.LICENSE.txt */
|
|
2
|
+
(self.webpackChunkaldehyde=self.webpackChunkaldehyde||[]).push([[449],{86319:function(e,t,r){"use strict";r.d(t,{A:function(){return g}});var n=function(){function e(e){var t=this;this._insertTag=function(e){var r;r=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,r),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var r=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{r.insertRule(e,r.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){return e.parentNode&&e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0},e}(),i=r(40390),a=r(19735),o=r(24534),s=r(50483),u=r(49503),l=r(73716),c=function(e,t,r){for(var n=0,a=0;n=a,a=(0,i.se)(),38===n&&12===a&&(t[r]=1),!(0,i.Sh)(a);)(0,i.K2)();return(0,i.di)(e,i.G1)},d=new WeakMap,f=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||d.get(r))&&!n){d.set(e,!0);for(var o=[],s=function(e,t){return(0,i.VF)(function(e,t){var r=-1,n=44;do{switch((0,i.Sh)(n)){case 0:38===n&&12===(0,i.se)()&&(t[r]=1),e[r]+=c(i.G1-1,t,r);break;case 2:e[r]+=(0,i.Tb)(n);break;case 4:if(44===n){e[++r]=58===(0,i.se)()?"&\f":"",t[r]=e[r].length;break}default:e[r]+=(0,a.HT)(n)}}while(n=(0,i.K2)());return e}((0,i.c4)(e),t))}(t,o),u=r.props,l=0,f=0;l<s.length;l++)for(var h=0;h<u.length;h++,f++)e.props[f]=o[l]?s[l].replace(/&\f/g,u[h]):u[h]+" "+s[l]}}},h=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function p(e,t){switch((0,a.tW)(e,t)){case 5103:return o.j+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return o.j+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return o.j+e+o.vd+e+o.MS+e+e;case 6828:case 4268:return o.j+e+o.MS+e+e;case 6165:return o.j+e+o.MS+"flex-"+e+e;case 5187:return o.j+e+(0,a.HC)(e,/(\w+).+(:[^]+)/,o.j+"box-$1$2"+o.MS+"flex-$1$2")+e;case 5443:return o.j+e+o.MS+"flex-item-"+(0,a.HC)(e,/flex-|-self/,"")+e;case 4675:return o.j+e+o.MS+"flex-line-pack"+(0,a.HC)(e,/align-content|flex-|-self/,"")+e;case 5548:return o.j+e+o.MS+(0,a.HC)(e,"shrink","negative")+e;case 5292:return o.j+e+o.MS+(0,a.HC)(e,"basis","preferred-size")+e;case 6060:return o.j+"box-"+(0,a.HC)(e,"-grow","")+o.j+e+o.MS+(0,a.HC)(e,"grow","positive")+e;case 4554:return o.j+(0,a.HC)(e,/([^-])(transform)/g,"$1"+o.j+"$2")+e;case 6187:return(0,a.HC)((0,a.HC)((0,a.HC)(e,/(zoom-|grab)/,o.j+"$1"),/(image-set)/,o.j+"$1"),e,"")+e;case 5495:case 3959:return(0,a.HC)(e,/(image-set\([^]*)/,o.j+"$1$`$1");case 4968:return(0,a.HC)((0,a.HC)(e,/(.+:)(flex-)?(.*)/,o.j+"box-pack:$3"+o.MS+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+o.j+e+e;case 4095:case 3583:case 4068:case 2532:return(0,a.HC)(e,/(.+)-inline(.+)/,o.j+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if((0,a.b2)(e)-1-t>6)switch((0,a.wN)(e,t+1)){case 109:if(45!==(0,a.wN)(e,t+4))break;case 102:return(0,a.HC)(e,/(.+:)(.+)-([^]+)/,"$1"+o.j+"$2-$3$1"+o.vd+(108==(0,a.wN)(e,t+3)?"$3":"$2-$3"))+e;case 115:return~(0,a.K5)(e,"stretch")?p((0,a.HC)(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==(0,a.wN)(e,t+1))break;case 6444:switch((0,a.wN)(e,(0,a.b2)(e)-3-(~(0,a.K5)(e,"!important")&&10))){case 107:return(0,a.HC)(e,":",":"+o.j)+e;case 101:return(0,a.HC)(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+o.j+(45===(0,a.wN)(e,14)?"inline-":"")+"box$3$1"+o.j+"$2$3$1"+o.MS+"$2box$3")+e}break;case 5936:switch((0,a.wN)(e,t+11)){case 114:return o.j+e+o.MS+(0,a.HC)(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return o.j+e+o.MS+(0,a.HC)(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return o.j+e+o.MS+(0,a.HC)(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return o.j+e+o.MS+e+e}return e}var v=[function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case o.LU:e.return=p(e.value,e.length);break;case o.Sv:return(0,s.l)([(0,i.C)(e,{value:(0,a.HC)(e.value,"@","@"+o.j)})],n);case o.XZ:if(e.length)return(0,a.kg)(e.props,(function(t){switch((0,a.YW)(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return(0,s.l)([(0,i.C)(e,{props:[(0,a.HC)(t,/:(read-\w+)/,":"+o.vd+"$1")]})],n);case"::placeholder":return(0,s.l)([(0,i.C)(e,{props:[(0,a.HC)(t,/:(plac\w+)/,":"+o.j+"input-$1")]}),(0,i.C)(e,{props:[(0,a.HC)(t,/:(plac\w+)/,":"+o.vd+"$1")]}),(0,i.C)(e,{props:[(0,a.HC)(t,/:(plac\w+)/,o.MS+"input-$1")]})],n)}return""}))}}],g=function(e){var t=e.key;if("css"===t){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var i,a,o=e.stylisPlugins||v,c={},d=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),r=1;r<t.length;r++)c[t[r]]=!0;d.push(e)}));var p,g=[f,h],m=[s.A,(0,u.MY)((function(e){p.insert(e)}))],y=(0,u.r1)(g.concat(o,m));a=function(e,t,r,n){var i;p=r,i=e?e+"{"+t.styles+"}":t.styles,(0,s.l)((0,l.wE)(i),y),n&&(b.inserted[t.name]=!0)};var b={key:t,sheet:new n({key:t,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:c,registered:{},insert:a};return b.sheet.hydrate(d),b}},36289:function(e,t,r){"use strict";function n(e){var t=Object.create(null);return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}r.d(t,{A:function(){return n}})},62977:function(e,t,r){"use strict";r.d(t,{C:function(){return h},E:function(){return S},T:function(){return v},a:function(){return m},c:function(){return b},h:function(){return d},i:function(){return c},w:function(){return p}});var n=r(96540),i=r(86319),a=r(58168),o=function(e){var t=new WeakMap;return function(r){if(t.has(r))return t.get(r);var n=e(r);return t.set(r,n),n}},s=r(30041),u=r(16899),l=r(71287),c=!0,d={}.hasOwnProperty,f=n.createContext("undefined"!=typeof HTMLElement?(0,i.A)({key:"css"}):null),h=f.Provider,p=function(e){return(0,n.forwardRef)((function(t,r){var i=(0,n.useContext)(f);return e(t,i,r)}))};c||(p=function(e){return function(t){var r=(0,n.useContext)(f);return null===r?(r=(0,i.A)({key:"css"}),n.createElement(f.Provider,{value:r},e(t,r))):e(t,r)}});var v=n.createContext({}),g=o((function(e){return o((function(t){return function(e,t){return"function"==typeof t?t(e):(0,a.A)({},e,t)}(e,t)}))})),m=function(e){var t=n.useContext(v);return e.theme!==t&&(t=g(t)(e.theme)),n.createElement(v.Provider,{value:t},e.children)},y="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",b=function(e,t){var r={};for(var n in t)d.call(t,n)&&(r[n]=t[n]);return r[y]=e,r},E=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return(0,s.SF)(t,r,n),(0,l.s)((function(){return(0,s.sk)(t,r,n)})),null},S=p((function(e,t,r){var i=e.css;"string"==typeof i&&void 0!==t.registered[i]&&(i=t.registered[i]);var a=e[y],o=[i],l="";"string"==typeof e.className?l=(0,s.Rk)(t.registered,o,e.className):null!=e.className&&(l=e.className+" ");var c=(0,u.J)(o,void 0,n.useContext(v));l+=t.key+"-"+c.name;var f={};for(var h in e)d.call(e,h)&&"css"!==h&&h!==y&&(f[h]=e[h]);return f.ref=r,f.className=l,n.createElement(n.Fragment,null,n.createElement(E,{cache:t,serialized:c,isStringTag:"string"==typeof a}),n.createElement(a,f))}))},17437:function(e,t,r){"use strict";r.d(t,{AH:function(){return c},Y:function(){return u},i7:function(){return d},mL:function(){return l}});var n=r(62977),i=r(96540),a=r(30041),o=r(71287),s=r(16899),u=(r(86319),r(4146),function(e,t){var r=arguments;if(null==t||!n.h.call(t,"css"))return i.createElement.apply(void 0,r);var a=r.length,o=new Array(a);o[0]=n.E,o[1]=(0,n.c)(e,t);for(var s=2;s<a;s++)o[s]=r[s];return i.createElement.apply(null,o)}),l=(0,n.w)((function(e,t){var r=e.styles,u=(0,s.J)([r],void 0,i.useContext(n.T));if(!n.i){for(var l,c=u.name,d=u.styles,f=u.next;void 0!==f;)c+=" "+f.name,d+=f.styles,f=f.next;var h=!0===t.compat,p=t.insert("",{name:c,styles:d},t.sheet,h);return h?null:i.createElement("style",((l={})["data-emotion"]=t.key+"-global "+c,l.dangerouslySetInnerHTML={__html:p},l.nonce=t.sheet.nonce,l))}var v=i.useRef();return(0,o.i)((function(){var e=t.key+"-global",r=new t.sheet.constructor({key:e,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),n=!1,i=document.querySelector('style[data-emotion="'+e+" "+u.name+'"]');return t.sheet.tags.length&&(r.before=t.sheet.tags[0]),null!==i&&(n=!0,i.setAttribute("data-emotion",e),r.hydrate([i])),v.current=[r,n],function(){r.flush()}}),[t]),(0,o.i)((function(){var e=v.current,r=e[0];if(e[1])e[1]=!1;else{if(void 0!==u.next&&(0,a.sk)(t,u.next,!0),r.tags.length){var n=r.tags[r.tags.length-1].nextElementSibling;r.before=n,r.flush()}t.insert("",u,r,!1)}}),[t,u.name]),null}));function c(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,s.J)(t)}var d=function(){var e=c.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}},16899:function(e,t,r){"use strict";r.d(t,{J:function(){return p}});var n={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},i=r(36289),a=/[A-Z]|^ms/g,o=/_EMO_([^_]+?)_([^]*?)_EMO_/g,s=function(e){return 45===e.charCodeAt(1)},u=function(e){return null!=e&&"boolean"!=typeof e},l=(0,i.A)((function(e){return s(e)?e:e.replace(a,"-$&").toLowerCase()})),c=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(o,(function(e,t,r){return f={name:t,styles:r,next:f},t}))}return 1===n[e]||s(e)||"number"!=typeof t||0===t?t:t+"px"};function d(e,t,r){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return f={name:r.name,styles:r.styles,next:f},r.name;if(void 0!==r.styles){var n=r.next;if(void 0!==n)for(;void 0!==n;)f={name:n.name,styles:n.styles,next:f},n=n.next;return r.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=d(e,t,r[i])+";";else for(var a in r){var o=r[a];if("object"!=typeof o)null!=t&&void 0!==t[o]?n+=a+"{"+t[o]+"}":u(o)&&(n+=l(a)+":"+c(a,o)+";");else if(!Array.isArray(o)||"string"!=typeof o[0]||null!=t&&void 0!==t[o[0]]){var s=d(e,t,o);switch(a){case"animation":case"animationName":n+=l(a)+":"+s+";";break;default:n+=a+"{"+s+"}"}}else for(var f=0;f<o.length;f++)u(o[f])&&(n+=l(a)+":"+c(a,o[f])+";")}return n}(e,t,r);case"function":if(void 0!==e){var i=f,a=r(e);return f=i,d(e,t,a)}}if(null==t)return r;var o=t[r];return void 0!==o?o:r}var f,h=/label:\s*([^\s;\n{]+)\s*(;|$)/g,p=function(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n=!0,i="";f=void 0;var a=e[0];null==a||void 0===a.raw?(n=!1,i+=d(r,t,a)):i+=a[0];for(var o=1;o<e.length;o++)i+=d(r,t,e[o]),n&&(i+=a[o]);h.lastIndex=0;for(var s,u="";null!==(s=h.exec(i));)u+="-"+s[1];var l=function(e){for(var t,r=0,n=0,i=e.length;i>=4;++n,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(i){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(i)+u;return{name:l,styles:i,next:f}}},17103:function(e,t){"use strict";t.A={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1}},71287:function(e,t,r){"use strict";var n;r.d(t,{i:function(){return s},s:function(){return o}});var i=r(96540),a=!!(n||(n=r.t(i,2))).useInsertionEffect&&(n||(n=r.t(i,2))).useInsertionEffect,o=a||function(e){return e()},s=a||i.useLayoutEffect},30041:function(e,t,r){"use strict";function n(e,t,r){var n="";return r.split(" ").forEach((function(r){void 0!==e[r]?t.push(e[r]+";"):n+=r+" "})),n}r.d(t,{Rk:function(){return n},SF:function(){return i},sk:function(){return a}});var i=function(e,t,r){var n=e.key+"-"+t.name;!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles)},a=function(e,t,r){i(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var a=t;do{e.insert(t===a?"."+n:"",a,e.sheet,!0),a=a.next}while(void 0!==a)}}},64849:function(e,t,r){var n=r(62785),i=r(78978),a={float:"cssFloat"},o=r(79887);function s(e,t,r){var s=a[t];if(void 0===s&&(s=function(e){var t=i(e),r=n(t);return a[t]=a[e]=a[r]=r,r}(t)),s){if(void 0===r)return e.style[s];e.style[s]=o(s,r)}}function u(){2===arguments.length?"string"==typeof arguments[1]?arguments[0].style.cssText=arguments[1]:function(e,t){for(var r in t)t.hasOwnProperty(r)&&s(e,r,t[r])}(arguments[0],arguments[1]):s(arguments[0],arguments[1],arguments[2])}e.exports=u,e.exports.set=u,e.exports.get=function(e,t){return Array.isArray(t)?t.reduce((function(t,r){return t[r]=s(e,r||""),t}),{}):s(e,t||"")}},30228:function(e){"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function a(e,t,n,a,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new i(n,a||e,o),u=r?r+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function s(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),s.prototype.eventNames=function(){var e,n,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},s.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=new Array(a);i<a;i++)o[i]=n[i].fn;return o},s.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},s.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var u,l,c=this._events[s],d=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),d){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(l=1,u=new Array(d-1);l<d;l++)u[l-1]=arguments[l];c.fn.apply(c.context,u)}else{var f,h=c.length;for(l=0;l<h;l++)switch(c[l].once&&this.removeListener(e,c[l].fn,void 0,!0),d){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,t);break;case 3:c[l].fn.call(c[l].context,t,n);break;case 4:c[l].fn.call(c[l].context,t,n,i);break;default:if(!u)for(f=1,u=new Array(d-1);f<d;f++)u[f-1]=arguments[f];c[l].fn.apply(c[l].context,u)}}return!0},s.prototype.on=function(e,t,r){return a(this,e,t,r,!1)},s.prototype.once=function(e,t,r){return a(this,e,t,r,!0)},s.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return o(this,a),this;var s=this._events[a];if(s.fn)s.fn!==t||i&&!s.once||n&&s.context!==n||o(this,a);else{for(var u=0,l=[],c=s.length;u<c;u++)(s[u].fn!==t||i&&!s[u].once||n&&s[u].context!==n)&&l.push(s[u]);l.length?this._events[a]=1===l.length?l[0]:l:o(this,a)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&o(this,t)):(this._events=new n,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=r,s.EventEmitter=s,e.exports=s},77004:function(e,t,r){"use strict";var n,i;r.d(t,{Ay:function(){return Nr}}),function(e){e.PLAY="event/dom/play",e.PLAYING="event/dom/playing",e.PAUSE="event/dom/pause",e.ENDED="event/dom/ended",e.TIMEUPDATE="event/dom/timeupdate",e.ERROR="event/dom/error",e.WAITING="event/dom/waiting",e.CANPLAY="event/dom/canplay",e.LOADEDDATA="event/dom/loadeddata",e.PROGRESS="event/dom/progress"}(n||(n={})),function(e){e.QUALITY_CHANGE="event/player/quality-change",e.CHANGE_QUALITY_START="event/player/quality-change-start",e.CHANGE_QUALITY_SUCCESS="event/player/quality-change-success",e.CHANGE_QUALITY_FAIL="event/player/quality-change-fail",e.PLAYBACK_RATE_CHANGE="event/player/rate-change",e.REQUEST_PLAY="event/player/request-play",e.PLAY_REJECTED="event/player/play-rejected",e.REQUEST_PAUSE="event/player/request-pause",e.PLAY_COUNT="event/player/play-count",e.PLAY_FAILED="event/player/play-failed",e.ENTER_FULLSCREEN="event/player/enter-fullscreen",e.EXIT_FULLSCREEN="event/player/exit-fullscreen",e.ENTER_PAGE_FULLSCREEN="event/player/enter-page-fullscreen",e.EXIT_PAGE_FULLSCREEN="event/player/exit-page-fullscreen",e.ENTER_PIP="event/player/enter-pip",e.EXIT_PIP="event/player/exit-pip",e.SHOW_CONTROLLER="event/player/show-controller",e.HIDE_CONTROLLER="event/player/hide-controller",e.HOVER_PROGRESS_DOT="event/player/hover-progress-dot",e.LEAVE_PROGRESS_DOT="event/player/leave-progress-dot",e.SUBSCRIPTION_READY="event/player/subscription-ready"}(i||(i={}));const a=Object.assign(Object.assign(Object.assign({},n),i),{DOM:n,PLAYER:i});var o;!function(e){e.PLAY="action/player/play",e.PAUSE="action/player/pause",e.SET_VOLUME="action/player/set-volume",e.ENTER_FULLSCREEN="action/player/enter-fullscreen",e.EXIT_FULLSCREEN="action/player/exit-fullscreen",e.ENTER_PAGE_FULLSCREEN="event/player/enter-page-fullscreen",e.EXIT_PAGE_FULLSCREEN="event/player/exit-page-fullscreen",e.ENTER_PIP="action/player/enter-pip",e.EXIT_PIP="action/player/exit-pip",e.TIME_UPDATE="action/player/time-update",e.SHOW_CONTROLLER="action/player/show-controller"}(o||(o={}));const s=Object.assign(Object.assign({},o),{PLAYER:o}),u="griffith";var l,c=r(16215);!function(e){e.LOG="log",e.DEBUG="debug",e.INFO="info",e.WARN="warn",e.ERROR="error"}(l||(l={}));const d={log(e,...t){const r=console[e]?e:"log";console[r]("[griffith]",...t)},debug(...e){this.log(l.DEBUG,...e)},info(...e){this.log(l.INFO,...e)},warn(...e){this.log(l.WARN,...e)},error(...e){this.log(l.ERROR,...e)}};var f,h=(f="undefined"!=typeof navigator?navigator.userAgent:"",{isIE:/MSIE|Trident/i.test(f),isMobile:/iPhone|iPad|iPod|Android/i.test(f),isAndroid:/(android)/i.test(f),isSafari:/^((?!chrome|android).)*safari/i.test(f)});function p(){const e=function(){if("undefined"!=typeof window)return window.MediaSource||window.WebKitMediaSource}(),t=window.SourceBuffer||window.WebKitSourceBuffer,r=e&&"function"==typeof e.isTypeSupported&&e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),n=!t||t.prototype&&"function"==typeof t.prototype.appendBuffer&&"function"==typeof t.prototype.remove;return!!r&&!!n}var v=r(50849),g=r.n(v),m=r(96540),y=r(30228),b=r.n(y),E=r(38221),S=r.n(E),T=r(50104),w=r.n(T),_=r(78659),L=r.n(_),A=r(63950),R=r.n(A),x=r(89917),k=r.n(x);function D(e){const t=[];return t.push("#EXTM3U"),e.forEach((e=>{const r={"PROGRAM-ID":"1",BANDWIDTH:String(e.bandwidth)};if(e.resolution){const{width:t,height:n}=e.resolution;r.RESOLUTION=`${t}x${n}`}t.push(`#EXT-X-STREAM-INF:${Object.entries(r).map((([e,t])=>`${e}=${t}`)).join(",")}`),t.push(e.source)})),t.join("\n")}class C extends m.Component{constructor(){super(...arguments),this.video=null,this.manuallyBuildAdaptiveM3U8Blob=!1,this.hasLoadStarted=!1}componentDidMount(){const{src:e,sources:t,useAutoQuality:r}=this.props;this.hls=new(k())({autoStartLoad:!1}),this.hls.attachMedia(this.video);const n=Boolean(t.find((e=>"auto"===e.quality)));if(r&&!n){const e=(e=>{const t=e.map((e=>({source:e.source,bandwidth:1024*e.bitrate,resolution:{width:e.width,height:e.height}})));return new Blob([D(t)],{type:"application/vnd.apple.mpegURL"})})(t);this.src=URL.createObjectURL(e),this.manuallyBuildAdaptiveM3U8Blob=!0}else this.src=e;this.hls.loadSource(this.src)}componentDidUpdate(e){const{currentQuality:t,sources:r,paused:n,src:i}=this.props;if(this.hls){if(t!==e.currentQuality||e.src!==i){const e=r.find((e=>e.quality===t));if(e)if(this.manuallyBuildAdaptiveM3U8Blob){const t=this.hls.levels.findIndex((t=>t.url.includes(e.source)));this.hls.nextLevel=t}else{const t=this.video.currentTime;this.hls.destroy(),this.hls=new(k())({autoStartLoad:!1}),this.hls.attachMedia(this.video),this.hls.loadSource(e.source),this.video.currentTime=t,this.hls.startLoad(),n||this.video.play()}else this.hls.nextLevel=-1}n||!e.paused||this.hasLoadStarted||(this.hls.startLoad(),this.hasLoadStarted=!0)}}componentWillUnmount(){this.hls.destroy(),this.manuallyBuildAdaptiveM3U8Blob&&URL.revokeObjectURL(this.src)}render(){const e=this.props,{onRef:t,currentQuality:r,useAutoQuality:n,src:i,sources:a,paused:o}=e,s=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(e,["onRef","currentQuality","useAutoQuality","src","sources","paused"]);return m.createElement("video",Object.assign({ref:e=>{t&&t(e),this.video=e}},s))}}var O={pluginName:"griffith-hls",VideoComponent:C,willHandleSrcChange:!0},P=r(88055),M=r.n(P);class B{constructor(e,t,r,n){this.remove=()=>{B.queue=B.queue.filter((e=>e.start!==this.start))},this.start=t,B.queue.push(this);const i=new XMLHttpRequest;this.xhr=i,i.open("get",e),i.responseType="arraybuffer",i.setRequestHeader("Range",`bytes=${t}-${r}`),i.onload=()=>{200!==i.status&&206!==i.status||n(i.response),this.remove()},i.send(),i.onerror=()=>{this.remove()},i.onabort=()=>{this.remove()}}static clear(){for(;B.queue.length;)B.queue.shift().xhr.abort()}}B.queue=[];class I{constructor(e){this.buffer=e,this.position=0}readType(e=4){const t=[];for(let r=0;r<e;r++)t.push(this.buffer[this.position++]);return String.fromCharCode.apply(null,t)}readByte(e){switch(e){case 1:return this.readOneByte();case 2:return this.readTwoByte();case 3:return this.readThreeByte();case 4:return this.readFourByte();default:return 0}}readOneByte(){return this.buffer[this.position++]>>>0}readTwoByte(){return(this.buffer[this.position++]<<8|this.buffer[this.position++])>>>0}readThreeByte(){return(this.buffer[this.position++]<<16|this.buffer[this.position++]<<8|this.buffer[this.position++])>>>0}readFourByte(){return(this.buffer[this.position++]<<24|this.buffer[this.position++]<<16|this.buffer[this.position++]<<8|this.buffer[this.position++])>>>0}}const N=[null,null,null,"ESDescrTag","DecoderConfigDescrTag","DecSpecificDescrTag"];function F(e){const t={};let r=e.readByte(1);return 128===r?(e.readByte(2),r=e.readByte(1)+5):r+=2,t.size=r,t.ESID=e.readByte(2),t.streamPriority=e.readByte(1),t[N[e.readByte(1)]]=function(e){const t={};let r=e.readByte(1);128===r?(e.readByte(2),r=e.readByte(1)+5):r+=2,t.size=r,t.objectTypeIndication=e.readByte(1);const n=e.readByte(1);return t.streamType=127&n,t.upStream=2&n,t.bufferSize=e.readByte(3),t.maxBitrate=e.readByte(4),t.avgBitrate=e.readByte(4),t}(e),t[N[e.readByte(1)]]=function(e){const t={};let r=e.readByte(1),n=r;128===r?(e.readByte(2),r=e.readByte(1)+5,n=r-5):r+=2,t.size=r;const i=[];for(let t=0;t<n;t++)i.push(Number(e.readByte(1)).toString(16).padStart(2,"0"));return t.audioConfig=i.map((e=>Number(`0x${e}`))),t}(e),t}var U={ftyp:function(e){const t=new I(e),r=t.readType(),n=t.readByte(4),i=[];for(let r=t.position;r<e.length;r+=4)i.push(t.readType(4));return{majorBrand:r,minorVersion:n,compatibleBrands:i}},mvhd:function(e){const t=new I(e),r=t.readByte(1),n=t.readByte(3),i=t.readByte(4),a=t.readByte(4),o=t.readByte(4),s=t.readByte(4),u=t.readByte(4),l=t.readByte(1);t.readByte(3),t.readByte(4),t.readByte(4);const c=[];for(let e=0;e<36;e+=4)c.push(t.readByte(4));for(let e=0;e<24;e+=4)t.readByte(4);return{version:r,flags:n,creationTime:i,modificationTime:a,timescale:o,duration:s,rate:u,volume:l,matrix:c,nextTrackID:t.readByte(4)}},tkhd:function(e){const t=new I(e),r=t.readByte(1),n=t.readByte(3),i=t.readByte(4),a=t.readByte(4),o=t.readByte(4);t.readByte(4);const s=t.readByte(4);t.readByte(4),t.readByte(4);const u=t.readByte(2),l=t.readByte(2),c=t.readByte(2);t.readByte(2);const d=[];for(let e=0;e<36;e+=4)d.push(t.readByte(4));return{version:r,flags:n,creationTime:i,modificationTime:a,trackID:o,duration:s,layer:u,alternateGroup:l,volume:c,matrix:d,width:Number(`${t.readByte(2)}.${t.readByte(2)}`),height:Number(`${t.readByte(2)}.${t.readByte(2)}`)}},elst:function(e){const t=new I(e),r=t.readByte(1),n=t.readByte(3),i=t.readByte(4),a=[];for(let e=0;e<i;++e){const e=t.readByte(4);let r=t.readByte(4);4294967295===r&&(r=-1);const n=t.readByte(2),i=t.readByte(2);a.push({segmentDuration:e,mediaTime:r,mediaRateInteger:n,mediaRateFraction:i})}return{version:r,flags:n,entries:a}},mdhd:function(e){const t=new I(e),r=t.readByte(1),n=t.readByte(3),i=t.readByte(4),a=t.readByte(4),o=t.readByte(4),s=t.readByte(4),u=t.readByte(2),l=[];l[0]=u>>10&31,l[1]=u>>5&31,l[2]=31&u;const c=String.fromCharCode(96+l[0],96+l[1],96+l[2]);return t.readByte(2),{version:r,flags:n,creationTime:i,modificationTime:a,timescale:o,duration:s,languageString:c}},hdlr:function(e){const t=new I(e),r=t.readByte(1),n=t.readByte(3);t.readByte(4);const i=t.readType().toString(),a=t.readType().toString();t.readByte(4),t.readByte(4);const o=[];let s;for(;0!==(s=t.readByte(1));)o.push(String.fromCharCode(s));return{version:r,flags:n,handlerType:i,handlerType2:a||0,name:o.join("")}},vmhd:function(e){const t=new I(e);return{version:t.readByte(1),flags:t.readByte(3),graphicsmode:t.readByte(2),opcolor:new Array(3).fill(t.readByte(2))}},dref:function(e){const t=new I(e),r=t.readByte(1),n=t.readByte(3),i=t.readByte(4),a=[],o=t.buffer.slice(8),s=new I(o),u=new G;for(let e=0;e<i;e++)u.readSize(s),u.readType(s),u.readBody(s),a.push(u.box);return{version:r,flags:n,url:a}},"url ":function(e){const t=new I(e);return{version:t.readByte(1),flags:t.readByte(3)}},stsd:function(e){const t=new I(e),r=t.readByte(1),n=t.readByte(3),i=t.readByte(4),a=[],o=t.buffer.slice(8),s=new I(o),u=new G;let l="avc1";for(let e=0;e<i;e++)u.readSize(s),u.readType(s),u.readBody(s),a.push(u.box),l=u.type;return{version:r,flags:n,[l]:a}},avc1:function(e){const t=new I(e);t.readByte(4),t.readByte(2);const r=t.readByte(2);t.readByte(2),t.readByte(2),t.readByte(4),t.readByte(4),t.readByte(4);const n=t.readByte(2),i=t.readByte(2),a=t.readByte(4),o=t.readByte(4);t.readByte(4);const s=t.readByte(2),u=t.readType(32),l=t.readByte(2);t.readByte(2);const c=t.buffer.slice(78),d=new I(c),f=new G;return f.readSize(d),f.readType(d),f.readBody(d),{dataReferenceIndex:r,width:n,height:i,horizresolution:a,vertresolution:o,frameCount:s,compressorname:u,depth:l,avcC:f.box}},avcC:function(e){const t=new I(e),r=t.readByte(1),n=t.readByte(1),i=t.readByte(1),a=t.readByte(1),o=3&t.readByte(1),s=31&t.readByte(1),u=[];for(let e=0;e<s;e++){const e=t.readByte(2);u.push(...t.buffer.slice(t.position,t.position+e)),t.position+=e}const l=t.readByte(1),c=[];for(let e=0;e<l;e++){const e=t.readByte(2);c.push(...t.buffer.slice(t.position,t.position+e)),t.position+=e}return{configurationVersion:r,AVCProfileIndication:n,profileCompatibility:i,AVCLevelIndication:a,lengthSizeMinusOne:o,SPS:u,PPS:c}},stts:function(e){const t=new I(e),r=t.readByte(1),n=t.readByte(3),i=t.readByte(4),a=[];for(let e=0;e<i;e++){const e=t.readByte(4),r=t.readByte(4);a.push({sampleCount:e,sampleDelta:r})}return{version:r,flags:n,samples:a}},stss:function(e){const t=new I(e),r=t.readByte(1),n=t.readByte(3),i=t.readByte(4),a=[];for(let e=0;e<i;e++)a.push({sampleNumber:t.readByte(4)});return{version:r,flags:n,samples:a}},ctts:function(e){const t=new I(e),r=t.readByte(1),n=t.readByte(3),i=t.readByte(4),a=[];for(let e=0;e<i;e++)a.push({sampleCount:t.readByte(4),sampleOffset:t.readByte(4)});return{version:r,flags:n,samples:a}},stsc:function(e){const t=new I(e),r=t.readByte(1),n=t.readByte(3),i=t.readByte(4),a=[];for(let e=0;e<i;e++)a.push({firstChunk:t.readByte(4),samplesPerChunk:t.readByte(4),sampleDescriptionIndex:t.readByte(4)});return{version:r,flags:n,samples:a}},stsz:function(e){const t=new I(e),r=t.readByte(1),n=t.readByte(3),i=t.readByte(4),a=t.readByte(4),o=[];for(let e=0;e<a;e++)o.push({entrySize:t.readByte(4)});return{version:r,flags:n,sampleSize:i,samples:o}},stco:function(e){const t=new I(e),r=t.readByte(1),n=t.readByte(3),i=t.readByte(4),a=[];for(let e=0;e<i;e++)a.push({chunkOffset:t.readByte(4)});return{version:r,flags:n,samples:a}},smhd:function(e){const t=new I(e),r=t.readByte(1),n=t.readByte(3),i=[];for(let e=0;e<4;e++)i.push(t.readByte(1));return{version:r,flags:n,data:i}},mp4a:function(e){const t=new I(e);t.readByte(4),t.readByte(2);const r=t.readByte(2);t.readByte(2),t.readByte(2),t.readByte(4);const n=t.readByte(2),i=t.readByte(2);t.readByte(4);const a=t.readByte(4)/65536,o=t.buffer.slice(28),s=new I(o),u=new G;return u.readSize(s),u.readType(s),u.readBody(s),{dataReferenceIndex:r,channelCount:n,sampleSize:i,sampleRate:a,esds:u.box}},esds:function(e){const t=new I(e),r=t.readByte(1),n=t.readByte(3),i=N[t.readByte(1)];return{version:r,flags:n,[i]:F(t)}},meta:function(e){const t=new I(e);return{version:t.readByte(1),flags:t.readByte(3)}},mdat:function(e){const t=new I(e);return{data:t.buffer.subarray(t.position,t.buffer.length)}},sdtp:function(e){const t=new I(e),r=t.readByte(1),n=t.readByte(3),i=[];for(let r=t.position;r<e.length;r++){const e=t.readByte(1);i.push({isLeading:e>>6,dependsOn:e>>4&3,isDepended:e>>2&3,hasRedundancy:3&e})}return{version:r,flags:n,samplesFlag:i}},thmb:function(e){return{data:new I(e).readByte(e.length)}}};const j=["moov","trak","edts","mdia","minf","dinf","stbl"],V=["udta","free"];class G{constructor(){this.size=0,this.type="",this.start=0,this.box={}}readSize(e){this.start=e.position,this.size=e.readByte(4)}readType(e){this.type=e.readType(),1===this.size&&(this.size=e.readByte(4)<<32,this.size|=e.readByte(4))}readBody(e){this.data=e.buffer.slice(e.position,this.size+this.start),j.find((e=>e===this.type))||V.find((e=>e===this.type))?this.parserContainerBox():U[this.type]?this.box=Object.assign(Object.assign({},this.box),U[this.type](this.data)):this.box={},e.position+=this.data.length}parserContainerBox(){const e=new I(this.data),t=e.buffer.length;for(;e.position<t;){const t=new G;if(t.readSize(e),t.readType(e),t.readBody(e),"trak"===t.type&&t.box.mdia&&t.box.mdia.hdlr){const e=t.box.mdia.hdlr.handlerType;"vide"===e?this.box.videoTrak=t.box:"soun"===e?this.box.audioTrak=t.box:this.box[`${e}Trak`]=t.box}else this.box[t.type]=t.box}}}class H{constructor(e){this.buffer=e,this.stream=new I(e),this.mp4BoxTreeObject={},this.init()}init(){this.parse()}parse(){for(;this.stream.position<this.buffer.length;){const e=new G;e.readSize(this.stream),e.readType(this.stream),e.readBody(this.stream),this.mp4BoxTreeObject[e.type]=e.box,this.mp4BoxTreeObject[e.type].size=e.size}}}const z={moov:K,mvhd:function(e){return K(e).mvhd},videoTrak:W,audioTrak:Y,videoTkhd:function(e){return W(e).tkhd},audioTkhd:function(e){return Y(e).tkhd},videoStbl:$,audioStbl:Q,videoStsc:function(e){return $(e).stsc},audioStsc:function(e){return Q(e).stsc},avcC:function(e){return $(e).stsd.avc1[0].avcC},esds:function(e){return X(e).esds},videoStco:function(e){return $(e).stco},audioStco:function(e){return Q(e).stco},videoStts:function(e){return $(e).stts},audioStts:function(e){return Q(e).stts},audioMdhd:function(e){return Y(e).mdia.mdhd},videoMdhd:function(e){return W(e).mdia.mdhd},videoStss:function(e){return $(e).stss},videoStsz:function(e){return $(e).stsz},videoCtts:function(e){return $(e).ctts},audioStsz:function(e){return Q(e).stsz},mp4a:X,audioElst:function(e){return Y(e).edts.elst},videoElst:function(e){return Y(e).edts.elst}};function q(e,t){const r=z[t];return r?r(e):{}}function K(e){return e.moov}function W(e){return K(e).videoTrak}function $(e){return W(e).mdia.minf.stbl}function Y(e){return K(e).audioTrak}function Q(e){return Y(e).mdia.minf.stbl}function X(e){return Q(e).stsd.mp4a[0]}function Z(e,t){const r=[],n=e.samples.length;for(let i=0;i<t;i++)0!==i&&i<n&&e.samples[i].firstChunk-1!==e.samples[i-1].firstChunk&&(i--,e.samples[i].firstChunk++),i>=n?(1!==e.samples[n-1]&&(i=i+e.samples[n-1].samplesPerChunk-1),r.push(e.samples[n-1].samplesPerChunk)):r.push(e.samples[i].samplesPerChunk);return r}function J(e,t,r){let n=0;const i=Z(M()(q(e,"video"===r?"videoStsc":"audioStsc")),t);let a=0;for(let e=0;t>0&&e<=i.length;e++){if(n+=i[e],n===t){a=e+1;break}if(n>t){n-=i[e],a=e;break}}const o=[n,t];let s=0;const u=q(e,"video"===r?"videoStsz":"audioStsz").samples.slice(o[0],o[1]);for(let e=0;e<u.length;e++)s+=u[e].entrySize;const l=q(e,"video"===r?"videoStco":"audioStco");return a>=l.samples.length?Number.MAX_SAFE_INTEGER:l.samples[a].chunkOffset+s}function ee(e,t,[r,n],i){const a=[],o=q(e,i?"videoStts":"audioStts"),s=q(e,i?"videoStsz":"audioStsz"),u=q(e,i?"videoStco":"audioStco"),l=Z(M()(q(e,i?"videoStsc":"audioStsc")),n),c=function(e,t){const r=[];for(let n=0,i=0;n<t.length&&!(n+i>=e.samples.length);n++)if(r.push(e.samples[n+i].entrySize),1!==t[n]){for(let a=1;a<t[n];a++){const t=e.samples[n+a+i].entrySize+r[n+a-1+i];r.push(t)}i=i+t[n]-1}return r}(s,l),d=[];for(let e=0;e<o.samples.length;e++){const{sampleCount:t,sampleDelta:r}=o.samples[e];d.push({sampleCount:t+(d[e-1]?d[e-1].sampleCount:0),sampleDelta:r})}const f=[];for(let e=0;e<l.length;e++)for(let t=0;t<l[e];t++){const t=u.samples[e];f.push(t?t.chunkOffset:u.samples[u.samples.length-1].chunkOffset)}for(let e=r;e<n;e++){const{entrySize:r}=s.samples[e],n=f[e]-t+c[e],o=n-r,u=d.find(((t,r)=>d[r-1]?e+1<=t.sampleCount&&e+1>d[r-1].sampleCount:e+1<=t.sampleCount)).sampleDelta;a.push(Object.assign(Object.assign({},i&&{compositionTimeOffset:i.length?i[e]:0}),{duration:u,size:r,start:o,end:n,bufferStart:t}))}return a}function te(e,t){let r=0,n=0;for(let i=0;i<e.samples.length;i++){const{sampleCount:a,sampleDelta:o}=e.samples[i];for(let e=0;e<a;e++){if(!(r<t&&0!==t))return n;n+=o,r++}}return n}function re(e,t){let r=[];if(e)r=e.samples.map((e=>e.sampleNumber-1));else for(let e=0;e<=Math.floor(t.samples.length/5);e++)r.push(5*e);return r}class ne{constructor(e){this.updateInterval=e=>{const{videoTimescale:t,audioTimescale:r}=this.mp4Data;this.videoInterval="number"==typeof e?function(e,t=0){const r=M()(q(e,"videoStss")),n=M()(q(e,"videoStts")),i=q(e,"videoStsz"),a=te(n,i.samples.length),o=re(r,i),s=o.map((e=>te(n,e))),u={offsetInterVal:[],timeInterVal:[]};for(let e=0;e<s.length;e++){const r=s[e],n=s[e+1]?s[e+1]:a;if(r<=t&&t<n){const t=o[e],a=void 0!==o[e+1]?o[e+1]:i.samples.length;u.offsetInterVal.push(t,a),u.timeInterVal.push(r,n);break}}return u}(this.mp4BoxTree,e*t):function(e,t){const r=M()(q(e,"videoStss")),n=M()(q(e,"videoStts")),i=q(e,"videoStsz"),a=i.samples.length,o=te(n,a),s=re(r,i),u=s.map((e=>te(n,e)));let l=[];t+1>s[s.length-1]&&(l={offsetInterVal:[s[s.length-1],a],timeInterVal:[u[s.length-1],o]});for(let e=0;e<s.length;e++)if(s[e]<t+1&&s[e+1]>=t+1){l={offsetInterVal:[s[e],s[e+1]],timeInterVal:[u[e],u[e+1]]};break}return l}(this.mp4BoxTree,this.videoInterval.offsetInterVal[1]),this.audioInterval=function(e,t){const{timeInterVal:[r,n],offsetInterVal:i}=t,a=M()(q(e,"audioStts")),{timescale:o}=q(e,"audioMdhd"),{timescale:s}=q(e,"videoMdhd"),u=q(e,"videoStsz"),l=q(e,"audioStsz"),c=q(e,"audioElst"),d=r/s*o,f=n/s*o;let h=0,p=0;const{mediaTime:v,segmentDuration:g}=c.entries[0];let m,y=-1!==v?v:g,b=0;for(let e=0;e<a.samples.length;e++){const{sampleCount:t,sampleDelta:r}=a.samples[e];for(let e=0;e<t;e++)y<=d&&0!==d&&(y+=r,h++),b<=f&&(b+=r,p++)}return i[1]===u.samples.length&&(m=l.samples.length),{offsetInterVal:[h,m||p],timeInterVal:[y,b]}}(this.mp4BoxTree,this.videoInterval);const n=this.videoInterval.timeInterVal.map((e=>e/t)),i=this.audioInterval.timeInterVal.map((e=>e/r));this.timeRange=[Math.min(n[0],i[0]),Math.max(n[1],i[1])]},this.isDraining=e=>e>(this.timeRange[1]-this.timeRange[0])/4+this.timeRange[0],this.getFragmentPosition=e=>{this.updateInterval(e),this.bufferStart=function(e,t=0,r=0){return Math.min(J(e,t,"video"),J(e,r,"audio"))}(this.mp4BoxTree,this.videoInterval.offsetInterVal[0],this.audioInterval.offsetInterVal[0]);const{videoSamples:t,audioSamples:r}=this.getSamples(),n=q(this.mp4BoxTree,"videoStco");let i=0;t.length>0&&(i=t[t.length-1].start);const a=i+t[t.length-1].bufferStart===n.samples[n.samples.length-1].chunkOffset;return function(e,t,r,n){const i=e[e.length-1].end;let a=0;e.length>0&&(a=e[0].start);let o=0,s=Number.MAX_SAFE_INTEGER;0!==t.length&&(o=t[t.length-1].end,s=t[0].start);const u=n?"":Math.max(i,o)+r;return[Math.min(a,s)+r,u]}(t,r,this.bufferStart,a)},this.getSamples=()=>{const e=function(e,t,r){const n=M()(q(e,"videoCtts")),i=[];if(n)for(let e=0;e<n.samples.length;e++)i.push(n.samples[e].sampleOffset),1!==n.samples[e].sampleCount&&(n.samples[e].sampleCount--,e--);return ee(e,t,r,i)}(this.mp4BoxTree,this.bufferStart,this.videoInterval.offsetInterVal),t=function(e,t,r){return ee(e,t,r)}(this.mp4BoxTree,this.bufferStart,this.audioInterval.offsetInterVal);return{videoSamples:e,audioSamples:t}},this.getTrackInfo=e=>{const{videoSamples:t,audioSamples:r}=this.getSamples(),n=function(e,t){return{samples:e.map((e=>Object.assign(Object.assign({},e),{buffer:t.slice(e.start,e.end)}))),trackId:1}}(t,e),i=function(e,t){return{samples:e.map((e=>Object.assign(Object.assign({},e),{buffer:t.slice(e.start,e.end)}))),trackId:2}}(r,e);return{videoTrackInfo:n,audioTrackInfo:i}},this.mp4BoxTree=e,this.mp4Data={},this.init()}init(){this.getMP4Data()}getMP4Data(){const{duration:e,timescale:t}=q(this.mp4BoxTree,"mvhd"),{channelCount:r,sampleRate:n}=q(this.mp4BoxTree,"mp4a"),{timescale:i,duration:a}=q(this.mp4BoxTree,"audioMdhd"),{ESDescrTag:{DecSpecificDescrTag:{audioConfig:o}}}=q(this.mp4BoxTree,"esds");if(this.mp4Data={duration:e,timescale:t,channelCount:r,sampleRate:n,audioConfig:o,audioDuration:a,audioTimescale:i},q(this.mp4BoxTree,"videoTrak")){const{width:e,height:t}=q(this.mp4BoxTree,"videoTkhd"),{samples:r}=q(this.mp4BoxTree,"videoStsz"),{SPS:n,PPS:i}=q(this.mp4BoxTree,"avcC"),{timescale:a,duration:o}=q(this.mp4BoxTree,"videoMdhd");this.mp4Data=Object.assign(Object.assign({},this.mp4Data),{width:e,height:t,SPS:n,PPS:i,videoDuration:o,videoTimescale:a,videoSamplesLength:r.length})}}}function ie(e,t){return new Uint8Array([255&e,t>>16&255,t>>8&255,255&t])}function ae(...e){let t=0;for(const r of e)t+=r.length;const r=new Uint8Array(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return r}function oe(e){return new Uint8Array([e>>>24&255,e>>>16&255,e>>>8&255,255&e])}function se(e){const t=e/Math.pow(2,32),r=e%Math.pow(2,32);return new Uint8Array([t>>>24&255,t>>>16&255,t>>>8&255,255&t,r>>>24&255,r>>>16&255,r>>>8&255,255&r])}const ue=e=>e.charCodeAt(0),le=e=>new Uint8Array(Array.prototype.map.call(e,ue));function ce(e,t){return ae(oe(t.length+8),le(e),t)}function de(e){return he(e)}function fe(e){return he(e)}function he(e){return new Uint8Array(e)}const pe=new Uint8Array([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]);function ve(e){const t=ae(function(e){const{type:t}=e;let r;return"video"===t?r=function(e){const{width:t,height:r}=e;let n=new Uint8Array([...fe(6),0,1,...de(16),t>>8&255,255&t,r>>8&255,255&r,0,72,0,0,0,72,0,0,...fe(4),0,1,11,87,65,78,71,76,117,118,68,65,78,71,...de(20),0,24,255,255]);return n=ae(n,function(e){const{SPS:t,PPS:r}=e;return ce("avcC",new Uint8Array([1,t[1],t[2],t[3],255,225,t.length>>8&255,255&t.length,...t,1,r.length>>8&255,255&r.length,...r]))}(e)),ce("avc1",n)}(e):"audio"===t&&(r=function(e){const{channelCount:t,sampleRate:r}=e;let n=new Uint8Array([...fe(6),0,1,...fe(8),0,t,0,16,...fe(4),r>>8&255,255&r,0,0]);return n=ae(n,function(e){const{audioConfig:t=[43,146,8,0]}=e;return ce("esds",new Uint8Array([...ie(0,0),3,23+t.length,0,1,0,4,15+t.length,64,21,0,0,0,0,0,0,0,0,0,0,0,5,t.length,...t,6,1,2]))}(e)),ce("mp4a",n)}(e)),r=ae(new Uint8Array([...ie(0,0),0,0,0,1]),r),ce("stsd",r)}(e),ye(),me(),ge(),be());return ce("stbl",t)}const ge=()=>ce("stsz",new Uint8Array([...ie(0,0),0,0,0,0,0,0,0,0])),me=()=>ce("stsc",new Uint8Array([...ie(0,0),0,0,0,0])),ye=()=>ce("stts",new Uint8Array([...ie(0,0),0,0,0,0])),be=()=>ce("stco",new Uint8Array([...ie(0,0),0,0,0,0]));function Ee(e){const{type:t}=e;let r="";switch(t){case"video":r=ce("vmhd",new Uint8Array([...ie(0,1),0,0,0,0,0,0,0,0]));break;case"audio":r=ce("smhd",[...ie(0,0),0,0,0,0])}return ce("minf",ae(r,ce("dinf",ce("dref",ae(new Uint8Array([...ie(0,0),0,0,0,1]),ce("url ",[0,0,0,1])))),ve(e)))}function Se(e){const t=ae(function(e){const{type:t,duration:r,width:n,height:i}=e;return ce("tkhd",new Uint8Array([...ie(1,7),0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,...oe("video"===t?1:2),...fe(4),...se(r),...fe(8),0,0,0,0,0,0,0,0,...pe,n>>8&255,255&n,0,0,i>>8&255,255&i,0,0]))}(e),function(e){const t=ae(function(e){const{type:t}=e;let r,n;return"video"===t?(r=e.videoDuration,n=e.videoTimescale):(r=e.audioDuration,n=e.audioTimescale),ce("mdhd",new Uint8Array([...ie(1,0),0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,...oe(n),...se(r),85,196,0,0]))}(e),function(e){let t="",r="";switch(e){case"video":t="vide",r="VideoHandler";break;case"audio":t="soun",r="SoundHandler"}return ce("hdlr",new Uint8Array([...ie(0,0),...de(4),...le(t),...fe(12),...le(r),0]))}(e.type),Ee(e));return ce("mdia",t)}(e));return ce("trak",t)}function Te(e){return ce("trex",new Uint8Array([...ie(0,0),...oe(e),0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}function we(e,t){const r=ae(function(e){const{duration:t,timescale:r}=e;return ce("mvhd",new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,...oe(r),...se(t),0,1,0,0,1,0,...fe(10),...pe,...de(24),255,255,255,255]))}(e),Se(Object.assign(Object.assign({},e),{type:t})),function(e){const t=ae(function(e){const{duration:t}=e;return ce("mehd",new Uint8Array([...ie(0,0),...oe(t)]))}(e),Te(1),Te(2));return ce("mvex",t)}(e));return ce("moov",r)}function _e(e){const t=ae(function(e){const{sequenceNumber:t}=e;return ce("mfhd",new Uint8Array([...ie(0,0),...oe(t)]))}(e),function(e){const t=ae(function(e){const{trackId:t}=e;return ce("tfhd",new Uint8Array([...ie(0,0),...oe(t)]))}(e),function(e){const{baseMediaDecodeTime:t}=e;return ce("tfdt",new Uint8Array([...ie(1,0),0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t]))}(e),function(e){const{samples:t}=e;return ce("sdtp",ae([0,0,0,0],...t.map((()=>new Uint8Array([16])))))}(e),function(e){const{samples:t,trackId:r}=e,n=108+(1===r?16:12)*t.length+t.length,i=new Uint8Array([0,0,1===r?15:7,1,...oe(t.length),...oe(n),...ae(...t.map(((e,t)=>{const{duration:n,size:i,compositionTimeOffset:a}=e;return ae(oe(n),oe(i),1===r?0===t?[2,0,0,0]:[1,1,0,0]:[1,0,0,0],1===r?oe(a):[])})))]);return ce("trun",i)}(e));return ce("traf",t)}(e));return ce("moof",t)}class Le{static ftyp(){return ce("ftyp",new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]))}static moov(e,t){return we(e,t)}static moof(e,t){return _e(Object.assign({},e,{sequenceNumber:Le.sequenceNumber++,baseMediaDecodeTime:t}))}static mdat(e){return ce("mdat",ae(...e.samples.map((e=>new Uint8Array(e.buffer)))))}}Le.sequenceNumber=1;class Ae{constructor(e,t){this.installSrc=()=>{this.mediaSource=new MediaSource,this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen),this.video.src=URL.createObjectURL(this.mediaSource)},this.handleSourceOpen=()=>{this.sourceBuffers.video=this.mediaSource.addSourceBuffer(this.mimeTypes.video),this.sourceBuffers.audio=this.mediaSource.addSourceBuffer(this.mimeTypes.audio),this.sourceBuffers.video.addEventListener("updateend",(()=>{const e=this.videoQueue.shift();e&&"open"===this.mediaSource.readyState&&this.handleAppendBuffer(e,"video"),this.needUpdateTime&&(this.needUpdateTime=!1,this.handleTimeUpdate())})),this.sourceBuffers.audio.addEventListener("updateend",(()=>{const e=this.audioQueue.shift();e&&"open"===this.mediaSource.readyState&&this.handleAppendBuffer(e,"audio")}))},this.handleAppendBuffer=(e,t)=>{if("open"===this.mediaSource.readyState)try{this.sourceBuffers[t]&&this.sourceBuffers[t].appendBuffer(e)}catch(r){if(22!==r.code)throw r;this.handleQuotaExceededError(e,t)}else this[`${t}Queue`].push(e)},this.hasBufferedCache=e=>{const{timeRange:[t,r]}=this.mp4Probe,n=e?this.video.currentTime:Math.floor((t+r)/2),i=this.video.buffered;if(i&&i.length>0)for(let e=0;e<i.length;e++)if(n>=i.start(e)&&n<=i.end(e))return!0;return!1},this.seek=e=>{B.clear();const[t,r]=this.mp4Probe.getFragmentPosition(e);this.hasBufferedCache(e)&&!this.qualityChangeFlag||(this.handleReplayCase(),this.loadData(t,r).then((t=>{if(!t)return;const{videoTrackInfo:r,audioTrackInfo:n}=this.mp4Probe.getTrackInfo(t),{videoInterval:i,audioInterval:a}=this.mp4Probe,o=i.timeInterVal[0],s=a.timeInterVal[0],u=ae(Le.moof(r,o),Le.mdat(r));if(0!==n.samples.length){const e=ae(Le.moof(n,s),Le.mdat(n));this.handleAppendBuffer(e,"audio")}this.handleAppendBuffer(u,"video"),e&&(this.needUpdateTime=!0),this.qualityChangeFlag=!1})))},this.handleTimeUpdate=()=>{if(!this.mp4Probe)return;const{videoInterval:{offsetInterVal:e=[]}=[],mp4Data:{videoSamplesLength:t},timeRange:r=[]}=this.mp4Probe;"closed"!==this.mediaSource.readyState&&(e[1]===t&&this.video.currentTime>r[0]?this.destroy():this.shouldFetchNextSegment()&&this.seek())},this.handleReplayCase=()=>{"ended"===this.mediaSource.readyState&&(this.sourceBuffers.video.timestampOffset=0)},this.shouldFetchNextSegment=()=>(this.handleReplayCase(),!!this.mp4Probe.isDraining(this.video.currentTime)),this.destroy=()=>{this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen),URL.revokeObjectURL(this.video.src),"open"!==this.mediaSource.readyState||this.sourceBuffers.video.updating||this.sourceBuffers.audio.updating||this.mediaSource.endOfStream()},this.handleQuotaExceededError=(e,t)=>{for(const e in this.sourceBuffers){const t=this.sourceBuffers[e],r=this.video.currentTime;let n=0;t.buffered.length>0&&(n=t.buffered.start(0)+10),this.removeBuffer(n,r-10,e)}this.handleAppendBuffer(e,t)},this.video=e,this.src=t,this.qualityChangeFlag=!1,this.videoQueue=[],this.audioQueue=[],this.sourceBuffers={video:null,audio:null},this.mimeTypes={video:'video/mp4; codecs="avc1.42E01E"',audio:'audio/mp4; codecs="mp4a.40.2"'},this.installSrc()}init(){return this.loadData().then((e=>new H(new Uint8Array(e)).mp4BoxTreeObject)).then((e=>{const{moov:t,ftyp:r}=e;if(!t){let t=0;for(const r in e)t+=e[r].size;return this.loadData(t,"").then((t=>{const{moov:r}=new H(new Uint8Array(t)).mp4BoxTreeObject;if(r)return e.moov=r,e}))}{const n=t.size+r.size;if(n>2e4)return this.loadData(r.size,n).then((t=>{const{moov:r}=new H(new Uint8Array(t)).mp4BoxTreeObject;if(r)return e.moov=r,e}))}return e})).then((e=>{this.mp4Probe=new ne(e),this.mp4BoxTreeObject=e;const t=ae(Le.ftyp(),Le.moov(this.mp4Probe.mp4Data,"video")),r=ae(Le.ftyp(),Le.moov(this.mp4Probe.mp4Data,"audio"));this.qualityChangeFlag?(this.handleAppendBuffer(t,"video"),this.handleAppendBuffer(r,"audio")):this.mediaSource.addEventListener("sourceopen",(()=>{this.handleAppendBuffer(t,"video"),this.handleAppendBuffer(r,"audio")}))}))}changeQuality(e){this.src=e,this.qualityChangeFlag=!0;for(const e in this.sourceBuffers){const t=this.sourceBuffers[e],r=t.buffered.length;r>0&&this.removeBuffer(t.buffered.start(0),t.buffered.end(r-1),e)}this.init().then((()=>{this.video.currentTime=this.video.currentTime}))}removeBuffer(e,t,r){const n=this.sourceBuffers[r];if(n.updating){const{isSafari:e}=h;e&&function(){const e=MediaSource.prototype.addSourceBuffer;MediaSource.prototype.addSourceBuffer=function(...t){const r=e.apply(this,t);return r.abort=function(){},r}}(),n.abort()}n.remove(e,t)}loadData(e=0,t=2e4){return new Promise((r=>{new B(this.src,e,t,r)})).catch((()=>{}))}}const{isSafari:Re}=h;class xe extends m.Component{constructor(){super(...arguments),this.video=null,this.useMSE=!0,this.handleTimeUpdate=e=>{var t,r;this.useMSE&&this.mse.handleTimeUpdate(),null===(r=(t=this.props).onTimeUpdate)||void 0===r||r.call(t,e)},this.handleVideoSeeking=e=>{var t,r;if(!this.video)return;const n=this.video.currentTime,i=this.video.buffered;if(Re&&i&&i.length>0){if(n-.1>i.start(0))this.useMSE&&this.mse.seek(this.video.currentTime);else if(n<i.start(0))return void this.handleSafariBug()}else this.useMSE&&this.mse.seek(this.video.currentTime);null===(r=(t=this.props).onSeeking)||void 0===r||r.call(t,e)},this.handlePlay=e=>{if(!this.video)return;const{currentTime:t}=this.video;0===t&&this.useMSE&&this.mse.seek(0);const{onPlay:r}=this.props;r&&r(e)},this.handleVideoProgress=e=>{var t,r;if(!this.video)return;const n=this.video.buffered,i=this.video.currentTime;Re&&n&&n.length>0&&i<n.start(0)&&this.handleVideoSeeking(e),null===(r=(t=this.props).onProgress)||void 0===r||r.call(t,e)},this.handleSafariBug=()=>{if(!this.video)return;let e=0;this.video.buffered.length>0&&(e=this.video.buffered.start(0)),this.video.currentTime=e+.1}}componentDidMount(){this.mse=new Ae(this.video,this.props.src),this.mse.init().then((()=>{this.mse.mp4Probe.mp4Data.videoDuration||(this.useMSE=!1,this.video.src=this.props.src)}))}componentDidUpdate(e){this.props.src!==e.src&&this.useMSE&&this.mse.changeQuality(this.props.src)}componentWillUnmount(){this.useMSE&&this.mse.destroy()}render(){const e=this.props,{src:t,onRef:r,currentQuality:n,useAutoQuality:i,onSeeking:a,onPlay:o,paused:s,onTimeUpdate:u,onProgress:l}=e,c=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(e,["src","onRef","currentQuality","useAutoQuality","onSeeking","onPlay","paused","onTimeUpdate","onProgress"]);return m.createElement("video",Object.assign({ref:e=>{this.video=e,r(e)}},c,{onSeeking:this.handleVideoSeeking,onTimeUpdate:this.handleTimeUpdate,onPlay:this.handlePlay,onProgress:this.handleVideoProgress}))}}var ke={pluginName:"griffith-mp4",VideoComponent:xe,willHandleSrcChange:!0};function De(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}const Ce="en",Oe={en:{"quality-auto":"Auto","quality-ld":"LD","quality-sd":"SD","quality-hd":"HD","quality-fhd":"FHD","action-enter-fullscreen":"Fullscreen","action-exit-fullscreen":"Exit Fullscreen","action-enter-page-fullscreen":"Page Fullscreen","action-exit-page-fullscreen":"Exit Page Fullscreen","action-enter-pip":"Picture in Picture","action-exit-pip":"Exit Picture in Picture","playback-rate":"Speed",replay:"Replay",play:"Play",pause:"Pause",mute:"Mute",unmute:"Unmute"},ja:{"quality-auto":"自動","quality-ld":"低画質","quality-sd":"標準画質","quality-hd":"高画質","quality-fhd":"超高画質","action-enter-fullscreen":"全画面","action-exit-fullscreen":"全画面終了","action-enter-page-fullscreen":"全画面ページ","action-exit-page-fullscreen":"全画面から撤退する","action-enter-pip":"ピクチャーインピクチャー","action-exit-pip":"ピクチャーインピクチャー終了","playback-rate":"再生速度",replay:"もう一回見る",play:"再生",pause:"一時停止",mute:"ミュート(消音)",unmute:"ミュート解除"},"zh-Hans":{"quality-auto":"自动","quality-ld":"低清","quality-sd":"标清","quality-hd":"高清","quality-fhd":"超清","action-enter-fullscreen":"全屏","action-exit-fullscreen":"退出全屏","action-enter-page-fullscreen":"网页全屏","action-exit-page-fullscreen":"退出网页全屏","action-enter-pip":"画中画","action-exit-pip":"退出画中画","playback-rate":"倍速",replay:"重新播放",play:"播放",pause:"暂停",mute:"静音",unmute:"取消静音"},"zh-Hant":{"quality-auto":"自動","quality-ld":"低畫質","quality-sd":"標準畫質","quality-hd":"高畫質","quality-fhd":"超高畫質","action-enter-fullscreen":"全螢幕","action-exit-fullscreen":"結束全螢幕","action-enter-page-fullscreen":"網頁全屏","action-exit-page-fullscreen":"退出網頁全屏","action-enter-pip":"子母畫面","action-exit-pip":"關閉子母畫面","playback-rate":"倍速",replay:"重新播放",play:"播放",pause:"暫停",mute:"静音",unmute:"解除静音"}},Pe=m.createContext(Oe[Ce]);Pe.displayName="LocaleContext";const Me=(e,t="text")=>{const r=(0,m.useContext)(Pe);return"object"==typeof r[e]?r[e][t]:r[e]},Be=({locale:e,localeConfig:t,children:r})=>{const n=(0,m.useMemo)((()=>((e,t)=>{const r=Oe[e],n=null==t?void 0:t[e];return n?Object.assign({},r,n):r})(e,t)),[e,t]);return m.createElement(Pe.Provider,{value:n},r)},Ie=e=>{const t=(0,m.useRef)(e);return t.current=e,(0,m.useRef)(((...e)=>t.current(...e))).current},Ne="event",Fe="action",Ue=m.createContext({});Ue.displayName="InternalMessageContext";const je=m.createContext(null);je.displayName="MessageContext";class Ve extends m.PureComponent{constructor(e){super(e),this.emitEvent=(e,t)=>{var r,n;this.emitter.emit(e,{__type__:Ne,data:t}),null===(n=(r=this.props).onEvent)||void 0===n||n.call(r,e,t),this.props.enableCrossWindow&&this.crossWindowMessager.dispatchMessage(window.parent,e,t)},this.subscribeEvent=(e,t)=>{const r=({__type__:e,data:r}={})=>{e===Ne&&t(r)};return this.emitter.on(e,r),{unsubscribe:()=>this.emitter.off(e,r)}},this.dispatchAction=(e,t)=>{this.emitter.emit(e,{__type__:Fe,data:t})},this.subscribeAction=(e,t)=>{const r=({__type__:e,data:r})=>{e===Fe&&t(r)};return this.emitter.on(e,r),{unsubscribe:()=>this.emitter.off(e,r)}},this.internalContextValue={emitEvent:this.emitEvent,subscribeAction:this.subscribeAction},this.externalContextValue={dispatchAction:this.dispatchAction,subscribeEvent:this.subscribeEvent},this.emitter=new(b());const{id:t,targetOrigin:r}=this.props;this.crossWindowMessager=function(e,t="*",r=!1){const n=new Set;return{subscribeMessage:function(i,a){const o="function"==typeof i,s=o?i:a,l=o?void 0:i;function c(n){const i=n.origin,a="*"===t||t===i,{from:c,id:d,payload:f}=n.data||{};if(a&&c===u&&(!r||e===d)&&f){const{name:e,data:t}=f;if(!e||"function"!=typeof s)return;o?s(e,t,n.source):l===e&&s(t,n.source)}}window.addEventListener("message",c);const d={unsubscribe:()=>{window.removeEventListener("message",c),n.delete(d)}};return n.add(d),d},dispatchMessage:(r,n,...i)=>{var a;null===(a=null==r?void 0:r.postMessage)||void 0===a||a.call(r,{from:u,id:e,payload:{name:n,data:i[0]}},t||"*")},dispose:()=>{n.forEach((e=>e.unsubscribe()))}}}(t,r),this.props.dispatchRef&&(this.props.dispatchRef.current=this.externalContextValue.dispatchAction),this.props.messageContextRef&&(this.props.messageContextRef.current=this.externalContextValue),Promise.resolve().then((()=>{this.emitEvent(a.SUBSCRIPTION_READY)}))}componentDidMount(){this.props.enableCrossWindow&&this.crossWindowMessager.subscribeMessage(((e,t)=>{this.dispatchAction(e,t)}))}componentWillUnmount(){this.props.dispatchRef&&(this.props.dispatchRef.current=void 0),this.props.messageContextRef&&(this.props.messageContextRef.current=void 0),this.crossWindowMessager.dispose(),this.emitter.removeAllListeners()}render(){return m.createElement(Ue.Provider,{value:this.internalContextValue},m.createElement(je.Provider,{value:this.externalContextValue},this.props.children))}}Ve.defaultProps={targetOrigin:"*"};const Ge=m.createContext({});Ge.displayName="ObjectFitContext";const He=({initialObjectFit:e="contain",children:t})=>{const[r,n]=(0,m.useState)(e),i=(0,m.useMemo)((()=>({objectFit:r,setObjectFit:n})),[r,n]);return(0,m.useEffect)((()=>{n(e)}),[e]),m.createElement(Ge.Provider,{value:i},t)};function ze(e){const t=(0,m.useRef)();return(0,m.useEffect)((()=>{t.current=e}),[e]),t.current}const qe="function"==typeof ResizeObserver?(e,t)=>{const r=new ResizeObserver((e=>t(e[0].contentRect)));return r.observe(e),()=>{r.disconnect()}}:(e,t)=>{const r=window.MutationObserver||window.WebKitMutationObserver;let n;const i=()=>{const r=e.getBoundingClientRect();(!n||!["left","top","width","height"].every((e=>n[e]===r[e])))&&(n=r,t(r))},a=new r(S()(i,100));return a.observe(e,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),i(),window.addEventListener("resize",i),()=>{a.disconnect(),window.removeEventListener("resize",i)}},Ke=m.createContext({isFullWidth:!1,updateVideoSize(){}});Ke.displayName="PositionContext";var We=c.StyleSheet.create({root:{position:"relative",width:"100%",height:"100%"}});const $e=({children:e})=>{const t=(0,m.useRef)(null),[r,n]=(0,m.useState)(null),[i,a]=(0,m.useState)(!1),[o,s]=(0,m.useState)({videoWidth:0,videoHeight:0}),u=Ie((()=>{const{videoWidth:e,videoHeight:t}=o;e&&t&&n(`data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${t}'></svg>`)})),l=Ie((()=>{const{videoWidth:e,videoHeight:r}=o;if(!e||!r)return;if(!t.current)return;const{width:n,height:s}=t.current.getBoundingClientRect(),u=n/s-e/r<=.01;u!==i&&a(u)}));(0,m.useEffect)((()=>{if(t.current)return qe(t.current,l)}),[t,l]),(0,m.useEffect)((()=>{u()}),[u]);const d=ze(o);(0,m.useEffect)((()=>{if(!d)return;const{videoWidth:e,videoHeight:t}=d,{videoWidth:r,videoHeight:n}=o;e===r&&t===n||(requestAnimationFrame(l),u())}),[d,u,l,o]);const f=(0,m.useMemo)((()=>({isFullWidth:i,helperImageSrc:r,updateVideoSize:s})),[r,i]);return m.createElement(Ke.Provider,{value:f},m.createElement("div",{className:(0,c.css)(We.root),ref:t},e))},Ye=m.createContext({});Ye.displayName="VideoSourceContext";const Qe=["auto","ld","sd","hd","fhd"];var Xe=e=>e.slice().reverse();const{isMobile:Ze}=h,Je=({sources:e,useAutoQuality:t,playbackRates:r,defaultPlaybackRate:n,defaultQuality:i,defaultQualityOrder:o,children:s})=>{const{emitEvent:u}=(0,m.useContext)(Ue),l=(e=>{const t=(0,m.useRef)(e);return e!==t.current&&JSON.stringify(e)!==JSON.stringify(t.current)&&(t.current=e),t.current})(e),{qualities:c,sources:d,format:f,isDescOrder:h}=(0,m.useMemo)((()=>{if(!l)return{qualities:[],sources:[]};const{format:e}=Object.values(l)[0],r="desc"===o,n=((e,t,r)=>{const n=Object.keys(e).sort(((e,t)=>r?Qe.indexOf(t)-Qe.indexOf(e):Qe.indexOf(e)-Qe.indexOf(t)));return n.length>1?t?n.slice(0,1):n.filter((e=>"ld"!==e)):n})(l,Ze,r),i=((e,t)=>e.map((e=>{const r=t[e],{play_url:n}=r,i=De(r,["play_url"]);return Object.assign(Object.assign({},i),{source:n,quality:e})})))(n,l);return!t||Ze||"m3u8"!==e||n.includes("auto")||n.unshift("auto"),{qualities:n,sources:i,format:e,isDescOrder:r}}),[t,l,o]),[p,v]=(0,m.useState)(i&&c.includes(i)?i:c[0]),[g,y]=(0,m.useState)(n),b=Ie((e=>{p!==e&&(v(e),u(a.QUALITY_CHANGE,{prevQuality:p,quality:e}))})),E=ze(c);(0,m.useEffect)((()=>{E&&E!==c&&b(i||c[0])}),[E,c,i,b]);const S=Ie((e=>{g!==e&&(y(e),u(a.PLAYBACK_RATE_CHANGE,{prevRate:g,rate:e}))})),T=(0,m.useMemo)((()=>{if(0!==d.length)return(d.find((e=>e.quality===p))||d[0]).source}),[p,d]),w=(0,m.useMemo)((()=>({qualities:h?c:Xe(c),playbackRates:r,format:f,sources:d,currentQuality:p,currentPlaybackRate:g,currentSrc:T,setCurrentQuality:b,setCurrentPlaybackRate:S})),[g,p,T,f,r,c,h,S,b,d]);return m.createElement(Ye.Provider,{value:w},s)},et=(e=!1)=>{const[t,r]=(0,m.useState)(e);return[t,(0,m.useRef)({on:(0,m.useCallback)((()=>r(!0)),[]),off:(0,m.useCallback)((()=>r(!1)),[]),toggle:(0,m.useCallback)((()=>r((e=>!e))),[])}).current]};function tt(e){let t=String(e);return t.length<2&&(t="0"+t),t}function rt(e){if(!Number.isFinite(e))return"";const t=(e=Math.floor(e))%60;return`${tt(Math.floor(e/60))}:${tt(t)}`}class nt{constructor(){this.inited=!1}init(e,t,r){this.inited=!0,this.element=e,this.onEnter=t,this.onExit=r,this.element.addEventListener("enterpictureinpicture",this.handleEnter.bind(this)),this.element.addEventListener("leavepictureinpicture",this.handleExit.bind(this))}handleEnter(e){this.onEnter&&this.onEnter(e)}handleExit(e){this.onExit&&this.onExit(e)}get supported(){return!!this.inited&&document.pictureInPictureEnabled}get pictureInPictureElement(){return document.pictureInPictureElement}request(){this.element&&this.element.requestPictureInPicture()}exit(){document.exitPictureInPicture()}toggle(){this.pictureInPictureElement?this.exit():this.request()}}const it={store:{},setItem(e,t){this.store[e]=t},removeItem(e){return delete this.store[e]},getItem(e){return this.store[e]}},at={isSupported:w()((()=>{try{const e={key:"__test_support_key__",value:"__test_support_value__"},t=Boolean(r.g.localStorage);return localStorage.setItem(e.key,e.value),localStorage.removeItem(e.key),t}catch(e){return!1}})),getStorage:w()((()=>at.isSupported()?localStorage:it)),set(e,t){at.getStorage().setItem(e,JSON.stringify(t))},get(e){try{const t=at.getStorage().getItem(e);return JSON.parse(t)}catch(e){return null}},delete(e){at.getStorage().removeItem(e)}},ot={mobile:"26em"};var st=c.StyleSheet.create({root:{position:"relative",overflow:"hidden",userSelect:"none",width:"100%",height:"100%",fontSize:16,backgroundColor:"#000",":focus":{outline:"none"}},fullScreened:{fontSize:24},pageFullScreen:{position:"fixed",top:0,left:0,zIndex:1e5},actionButton:{color:"#fff",width:"4.5em",height:"4.5em"},actionButtonAnimated:{animationName:{"0%":{opacity:0,transform:"scale(0)"},"50%":{opacity:.6,transform:"scale(0.8)"},"100%":{opacity:0,transform:"scale(1)"}},animationDuration:"600ms",animationFillMode:"both"},actionLabelAnimation:{animationName:{"90%":{opacity:1},"100%":{opacity:0}},animationDuration:"600ms",animationFillMode:"both"},actionIcon:{width:"4.5em",height:"4.5em",[(e=>`@media screen and (max-width: ${ot.mobile})`)()]:{transform:"scale(0.75)"}},actionLabel:{marginTop:".5em",padding:".3em .5em",textAlign:"center",color:"#fff",background:"rgba(0,0,0,0.5)",borderRadius:5},video:{width:"100%",height:"100%"},overlay:{position:"absolute",left:0,right:0,top:0,bottom:0,overflow:"hidden"},overlayMask:{background:"rgba(0, 0, 0, 0.08)"},loader:{position:"absolute",left:"50%",top:"50%",color:"#0f88eb",transform:"translate(-50%, -50%)"},action:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)"},actionToast:{pointerEvents:"none"},backdrop:{position:"absolute",left:0,right:0,top:0,bottom:0},title:{position:"absolute",left:0,right:0,top:0,overflow:"hidden",padding:"0 1em",lineHeight:2.5,textOverflow:"ellipsis",whiteSpace:"nowrap",color:"#fff",backgroundImage:"linear-gradient(to top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.3))",transform:"translateY(-100%)",transition:"transform 300ms"},titleShown:{transform:"translateY(0)"},controller:{position:"absolute",left:0,right:0,bottom:0,backgroundImage:"linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.3))"},volumeButton:{position:"absolute",bottom:0,right:8},cover:{position:"absolute",left:0,right:0,top:0,bottom:0,overflow:"hidden",backgroundColor:"#000",cursor:"pointer",visibility:"hidden",opacity:0,transition:"visibility 300ms, opacity 300ms"},coverShown:{visibility:"visible",opacity:1},coverImage:{position:"absolute",left:0,top:0,width:"100%",height:"100%"},coverTime:{position:"absolute",right:"0.5em",bottom:"0.5em",padding:"0.375em",fontSize:"0.875em",lineHeight:1,color:"rgba(255, 255, 255, 0.9)",backgroundColor:"transparent",textShadow:"0 0 6px rgba(0, 0, 0, 0.4)"},coverTimeMobile:{padding:0},coverAction:{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)"},coverReplayAction:{position:"absolute",left:"0",right:"0",top:"0",bottom:"0",backgroundColor:"rgba(0, 0, 0, 0.16)",animationName:{"0%":{opacity:0},"100%":{opacity:1}},animationDuration:"600ms",animationFillMode:"both"},coverReplayButton:{position:"absolute",left:"0",right:"0",top:"0",bottom:"0",height:"40px",width:"116px",margin:"auto",backgroundColor:"rgba(0, 0, 0, 0.5)",borderRadius:"4px",color:"#fff",fontSize:"16px",lineHeight:"24px",padding:"8px",boxSizing:"border-box",textAlign:"center",whiteSpace:"nowrap",transition:"transform 200ms, opacity 200ms",willChange:"transform"},coverReplayButtonHovered:{transform:"scale(1.1)"},coverReplayButtonPressed:{opacity:.7},replayIcon:{verticalAlign:"top",marginRight:"4px"},error:{position:"absolute",left:0,right:0,top:0,bottom:0,overflow:"hidden",display:"flex",flexDirection:"column",justifyContent:"center",color:"#fff",backgroundColor:"#000"},errorIcon:{width:"2.5em",height:"2.5em",margin:"0 auto",fill:"currentColor"},errorMessage:{marginTop:"1em",fontSize:"1.25em",lineHeight:1,textAlign:"center"}});const ut=c.StyleSheet.create({base:{transition:"opacity .5s ease-in-out, visibility .5s ease-in-out"},hidden:{opacity:0,visibility:"hidden"},shown:{opacity:1,visibility:"visible"}});var lt=c.StyleSheet.create({root:{display:"inline-block",width:"1.5em",height:"1.5em"},svg:{display:"block",width:"100%",height:"100%",fill:"currentColor"}});function ct({icon:e,styles:t}){const r=(0,m.cloneElement)(e,{className:(0,c.css)(lt.svg)});return m.createElement("span",{className:(0,c.css)(lt.root,t)},r)}const dt=(0,m.createContext)(void 0),ft=(0,m.createContext)((()=>{})),ht=()=>(0,m.useContext)(ft),pt=({children:e})=>{const[t,r]=(0,m.useState)(),n=(0,m.useRef)(0),i=(0,m.useCallback)((e=>{n.current+=1,r(Object.assign(Object.assign({},e),{key:String(n.current)}))}),[]);return m.createElement(dt.Provider,{value:t},m.createElement(ft.Provider,{value:i},e))},vt=m.memo((()=>{const e=(0,m.useContext)(dt);if(!e)return null;const{key:t,icon:r,label:n}=e;return m.createElement("div",{className:(0,c.css)(st.action,st.actionToast),key:t},m.createElement("div",{className:(0,c.css)(st.actionButton,st.actionButtonAnimated)},r&&m.createElement(ct,{icon:r,styles:st.actionIcon})),n&&m.createElement("div",{className:(0,c.css)(st.actionLabel,st.actionLabelAnimation)},n))}));var gt=m.createElement("svg",{viewBox:"0 0 24 24"},m.createElement("path",{d:"M19.7180574,15 C20.1638168,15 20.3254599,15.0464128 20.4884229,15.1335664 C20.6513858,15.2207199 20.7792801,15.3486142 20.8664336,15.5115771 C20.9535872,15.6745401 21,15.8361832 21,16.2819426 L21,19.7180574 C21,20.1638168 20.9535872,20.3254599 20.8664336,20.4884229 C20.7792801,20.6513858 20.6513858,20.7792801 20.4884229,20.8664336 C20.3254599,20.9535872 20.1638168,21 19.7180574,21 L16.2819426,21 C15.8361832,21 15.6745401,20.9535872 15.5115771,20.8664336 C15.3486142,20.7792801 15.2207199,20.6513858 15.1335664,20.4884229 C15.0464128,20.3254599 15,20.1638168 15,19.7180574 L15,16.2819426 C15,15.8361832 15.0464128,15.6745401 15.1335664,15.5115771 C15.2207199,15.3486142 15.3486142,15.2207199 15.5115771,15.1335664 C15.6745401,15.0464128 15.8361832,15 16.2819426,15 L19.7180574,15 Z M18.5,4 C19.3284271,4 20,4.67157288 20,5.5 L20,11.75 C20,11.8880712 19.8880712,12 19.75,12 L18.25,12 C18.1119288,12 18,11.8880712 18,11.75 L18,6.5 C18,6.24358208 17.8069799,6.03224642 17.5583106,6.00336387 L17.5,6 L6.5,6 C6.24358208,6 6.03224642,6.1930201 6.00336387,6.44168944 L6,6.5 L6,17.5 C6,17.7564179 6.1930201,17.9677536 6.44168944,17.9966361 L6.5,18 L11.75,18 C11.8880712,18 12,18.1119288 12,18.25 L12,19.75 C12,19.8880712 11.8880712,20 11.75,20 L5.5,20 C4.67157288,20 4,19.3284271 4,18.5 L4,5.5 C4,4.67157288 4.67157288,4 5.5,4 L18.5,4 Z M12.263324,13.6777091 L9.53508966,10.956021 L9.55615206,13.2225752 C9.55502994,13.3470231 9.46566931,13.4482773 9.34885743,13.4683645 L9.30388492,13.4719793 L7.79658322,13.4583417 C7.67542934,13.4572455 7.57490537,13.3702653 7.5531943,13.2554476 L7.54886064,13.2111995 L7.49923911,7.74790313 C7.50035209,7.62546574 7.5897117,7.52443494 7.70652348,7.50437256 L7.75149597,7.50076089 L13.2230869,7.55026617 C13.3442408,7.55136234 13.4447648,7.6383426 13.4664758,7.75316028 L13.4708095,7.79740841 L13.4844791,9.30570263 C13.4833661,9.42814002 13.3940065,9.52917082 13.2771947,9.5492332 L13.2322222,9.55284487 L10.9362217,9.53206969 L13.6775376,12.2668086 C13.7751687,12.364211 13.7751687,12.5221314 13.6775376,12.6195338 L12.6168774,13.6777091 C12.5192463,13.7751115 12.3609551,13.7751115 12.263324,13.6777091 Z"})),mt=m.createElement("svg",{viewBox:"0 0 24 24"},m.createElement("path",{d:"M20,10 L20,5 C20,4.44771525 19.5490248,4 19.009222,4 L14,4 L14,6 L18,6 L18,10 L20,10 Z M19.7115371,19.7068284 C19.8902571,19.5277733 20,19.2813055 20,19.009222 L20,14 L18,14 L18,18 L14,18 L14,20 L19.009222,20 C19.2776249,20 19.5240668,19.8893106 19.7040291,19.7101145 L19.7115371,19.7068284 Z M6,18 L6,14 L4,14 L4,19.009222 C4,19.2813055 4.10974288,19.5277733 4.28846285,19.7068284 C4.47593315,19.8893106 4.72237506,20 4.99077797,20 L10,20 L10,18 L6,18 Z M4.28846285,4.29317155 C4.10974288,4.47222673 4,4.71869448 4,4.99077797 L4,10 L6,10 L6,6 L10,6 L10,4 L4.99077797,4 C4.72237506,4 4.47593315,4.11068941 4.29597088,4.28988548 L4.28846285,4.29317155 Z"})),yt=m.createElement("svg",{viewBox:"0 0 24 24"},m.createElement("path",{d:"M7.38001507,9.5 L5,9.5 L5,12.0119396 L5,14.5238791 L8.33098415,14.5238791 L8.33098415,14.5238791 C8.39017333,14.520451 8.4497727,14.5223174 8.50904598,14.5296109 C8.72475585,14.5524598 8.91816198,14.6424266 9.06920843,14.7779841 L13,17.4293365 L13,15.1199849 L7.38001507,9.5 Z M15,17.1199849 L15,19.251289 C15,19.8045373 14.5522847,20.25 14,20.25 C13.98423,20.25 13.9685502,20.2496405 13.9529683,20.2489292 C13.7472793,20.2584936 13.5372091,20.2041245 13.3535806,20.0802655 L8.08102098,16.5238791 L4.00000001,16.5238791 C3.71994909,16.5238791 3.46994918,16.4119504 3.29196292,16.2310404 C3.11117675,16.0497507 3,15.7991447 3,15.5223056 L3,12.0119396 L3,8.50157356 C3,8.2247344 3.11117675,7.97412842 3.29196292,7.79283868 C3.46994918,7.61192872 3.71994909,7.5 4.00000001,7.5 L5.38001507,7.5 L3.38382011,5.50380504 C2.99233448,5.1123194 2.98883249,4.48109777 3.38207944,4.08785081 C3.77260374,3.69732652 4.3999302,3.691488 4.79803367,4.08959148 L18.936688,18.2282458 C19.3281736,18.6197314 19.3316756,19.250953 18.9384286,19.6442 C18.5479043,20.0347243 17.9205779,20.0405628 17.5224744,19.6424593 L15,17.1199849 Z M10.792179,8.08373676 L9.35149599,6.64305379 L13.3535806,3.94361361 C13.5372091,3.81975463 13.7472793,3.76538554 13.9529683,3.77494994 C13.9685502,3.77423867 13.98423,3.77387913 14,3.77387913 C14.5522847,3.77387913 15,4.21934183 15,4.77259008 L15,12.0119396 L15,12.2915578 L13,10.2915578 L13,6.59454265 L10.792179,8.08373676 Z M18.0173138,15.3088716 C18.8917509,14.408489 19.4301566,13.1799808 19.4301566,11.8257212 C19.4301566,10.2214787 18.6746368,8.79369726 17.5,7.87877967 L17.5067574,7.87009164 C17.2041341,7.69816923 17,7.37292366 17,7 C17,6.44771525 17.4477153,6 18,6 C18.2836948,6 18.5397977,6.11813499 18.721799,6.30789526 L18.7279374,6.30000305 C20.3724289,7.58088767 21.4301566,9.57978168 21.4301566,11.8257212 C21.4301566,13.7322659 20.6679517,15.4607882 19.431636,16.7231938 L18.0173138,15.3088716 Z"})),bt=m.createElement("svg",{viewBox:"0 0 24 24"},m.createElement("path",{d:"M9,5 C10,5 10,6 10,6 C10,6 10,17 10,18 C10,19 9,19 9,19 L7,19 C6,19 6,18 6,18 L6,6 C6,5 7,5 7,5 C7,5 8,5 9,5 Z M17,5 C18,5 18,6 18,6 C18,6 18,17 18,18 C18,19 17,19 17,19 L15,19 C14,19 14,18 14,18 L14,6 C14,5 15,5 15,5 C15,5 16,5 17,5 Z"})),Et=m.createElement("svg",{viewBox:"0 0 24 24"},m.createElement("path",{d:"M19.7180574,15 C20.1638168,15 20.3254599,15.0464128 20.4884229,15.1335664 C20.6513858,15.2207199 20.7792801,15.3486142 20.8664336,15.5115771 C20.9535872,15.6745401 21,15.8361832 21,16.2819426 L21,19.7180574 C21,20.1638168 20.9535872,20.3254599 20.8664336,20.4884229 C20.7792801,20.6513858 20.6513858,20.7792801 20.4884229,20.8664336 C20.3254599,20.9535872 20.1638168,21 19.7180574,21 L16.2819426,21 C15.8361832,21 15.6745401,20.9535872 15.5115771,20.8664336 C15.3486142,20.7792801 15.2207199,20.6513858 15.1335664,20.4884229 C15.0464128,20.3254599 15,20.1638168 15,19.7180574 L15,16.2819426 C15,15.8361832 15.0464128,15.6745401 15.1335664,15.5115771 C15.2207199,15.3486142 15.3486142,15.2207199 15.5115771,15.1335664 C15.6745401,15.0464128 15.8361832,15 16.2819426,15 L19.7180574,15 Z M18.5,4 C19.3284271,4 20,4.67157288 20,5.5 L20,11.75 C20,11.8880712 19.8880712,12 19.75,12 L18.25,12 C18.1119288,12 18,11.8880712 18,11.75 L18,6.5 C18,6.24358208 17.8069799,6.03224642 17.5583106,6.00336387 L17.5,6 L6.5,6 C6.24358208,6 6.03224642,6.1930201 6.00336387,6.44168944 L6,6.5 L6,17.5 C6,17.7564179 6.1930201,17.9677536 6.44168944,17.9966361 L6.5,18 L11.75,18 C11.8880712,18 12,18.1119288 12,18.25 L12,19.75 C12,19.8880712 11.8880712,20 11.75,20 L5.5,20 C4.67157288,20 4,19.3284271 4,18.5 L4,5.5 C4,4.67157288 4.67157288,4 5.5,4 L18.5,4 Z M8.98667598,7.57381266 L11.7149103,10.2955008 L11.6938479,8.02894655 C11.6949701,7.90449864 11.7843307,7.80324445 11.9011426,7.78315725 L11.9461151,7.77954248 L13.4534168,7.79318008 C13.5745707,7.79427625 13.6750946,7.88125651 13.6968057,7.99607419 L13.7011394,8.04032232 L13.7507609,13.5036187 C13.7496479,13.626056 13.6602883,13.7270868 13.5434765,13.7471492 L13.498504,13.7507609 L8.0269131,13.7012556 C7.90575922,13.7001594 7.80523525,13.6131792 7.78352418,13.4983615 L7.77919052,13.4541134 L7.76552089,11.9458192 C7.76663388,11.8233818 7.85599349,11.722351 7.97280526,11.7022886 L8.01777775,11.6986769 L10.3137783,11.7194521 L7.57246241,8.98471315 C7.47483134,8.8873108 7.47483134,8.72939038 7.57246241,8.63198803 L8.63312259,7.57381266 C8.73075366,7.4764103 8.8890449,7.4764103 8.98667598,7.57381266 Z"})),St=m.createElement("svg",{viewBox:"0 0 24 24"},m.createElement("path",{d:"M8.03610236,19.7012935 C6.93281899,20.3993842 6,19.8347521 6,18.4154722 L6,5.59575582 C6,4.14567779 6.91151094,3.59901121 8.03610236,4.30993442 L18.1645278,10.7185093 C19.2678112,11.4166 19.2891193,12.5817954 18.1645278,13.2927186 L8.03610236,19.7012935 Z"})),Tt=m.createElement("svg",{viewBox:"0 0 24 24"},m.createElement("path",{d:"M14.2884629,14.2931716 C14.1097429,14.4722267 14,14.7186945 14,14.990778 L14,20 L16,20 L16,16 L20,16 L20,14 L14.990778,14 C14.7223751,14 14.4759332,14.1106894 14.2959709,14.2898855 L14.2884629,14.2931716 Z M16,8 L16,4 L14,4 L14,9.00922203 C14,9.28130552 14.1097429,9.52777327 14.2884629,9.70682845 C14.4759332,9.88931059 14.7223751,10 14.990778,10 L20,10 L20,8 L16,8 Z M8,16 L8,20 L10,20 L10,14.990778 C10,14.7186945 9.89025712,14.4722267 9.71153715,14.2931716 C9.52406685,14.1106894 9.27762494,14 9.00922203,14 L4,14 L4,16 L8,16 L8,16 Z M9.71153715,9.70682845 C9.89025712,9.52777327 10,9.28130552 10,9.00922203 L10,4 L8,4 L8,8 L4,8 L4,10 L9.00922203,10 C9.27762494,10 9.52406685,9.88931059 9.70402912,9.71011452 L9.71153715,9.70682845 Z"})),wt=m.createElement("svg",{viewBox:"0 0 24 24"},m.createElement("path",{d:"M5,12.0119396 L5,14.5238791 L8.33098415,14.5238791 L8.33098415,14.5238791 C8.39017333,14.520451 8.4497727,14.5223174 8.50904598,14.5296109 C8.72475585,14.5524598 8.91816198,14.6424266 9.06920843,14.7779841 L13,17.4293365 L13,12.0119396 L13,6.59454265 L9.06920843,9.24589504 C8.91816198,9.38145255 8.72475585,9.47141933 8.50904598,9.49426822 C8.4497727,9.50156175 8.39017333,9.5034281 8.33098415,9.5 L8.33098415,9.5 L5,9.5 L5,12.0119396 Z M3,12.0119396 L3,8.50157356 C3,8.2247344 3.11117675,7.97412842 3.29196292,7.79283868 C3.46994918,7.61192872 3.71994909,7.5 4.00000001,7.5 L8.08102098,7.5 L13.3535806,3.94361361 C13.5372091,3.81975463 13.7472793,3.76538554 13.9529683,3.77494994 C13.9685502,3.77423867 13.98423,3.77387913 14,3.77387913 C14.5522847,3.77387913 15,4.21934183 15,4.77259008 L15,12.0119396 L15,19.251289 C15,19.8045373 14.5522847,20.25 14,20.25 C13.98423,20.25 13.9685502,20.2496405 13.9529683,20.2489292 C13.7472793,20.2584936 13.5372091,20.2041245 13.3535806,20.0802655 L8.08102098,16.5238791 L4.00000001,16.5238791 C3.71994909,16.5238791 3.46994918,16.4119504 3.29196292,16.2310404 C3.11117675,16.0497507 3,15.7991447 3,15.5223056 L3,12.0119396 Z M17.5059844,15.7803571 L17.5,15.7726628 C18.6746368,14.8577452 19.4301566,13.4299638 19.4301566,11.8257212 C19.4301566,10.2214787 18.6746368,8.79369726 17.5,7.87877967 L17.5067574,7.87009164 C17.2041341,7.69816923 17,7.37292366 17,7 C17,6.44771525 17.4477153,6 18,6 C18.2836948,6 18.5397977,6.11813499 18.721799,6.30789526 L18.7279374,6.30000305 C20.3724289,7.58088767 21.4301566,9.57978168 21.4301566,11.8257212 C21.4301566,14.0716608 20.3724289,16.0705548 18.7279374,17.3514394 L18.7211832,17.3427554 C18.5392202,17.5321404 18.283375,17.6500092 18,17.6500092 C17.4477153,17.6500092 17,17.2022939 17,16.6500092 C17,16.2774031 17.2037866,15.9523939 17.5059844,15.7803571 L17.5059844,15.7803571 Z"})),_t=m.createElement("svg",{viewBox:"0 -4 16 24"},m.createElement("path",{d:"M15.9964 0.207284C15.9763 0.0904726 15.8753 0.00111298 15.7529 0L10.2896 0.0496215L10.2453 0.0539552C10.1305 0.0756663 10.0435 0.17619 10.0424 0.297344L10.0288 1.80465L10.0324 1.84962C10.0525 1.96643 10.1537 2.05579 10.2782 2.05691L12.5447 2.03585L9.82305 4.76408C9.72565 4.86172 9.72565 5.02001 9.82305 5.11764L10.8812 6.1783C10.9786 6.27593 11.1365 6.27593 11.234 6.1783L13.9687 3.43698L13.9479 5.73298L13.9515 5.77796C13.9716 5.89477 14.0726 5.98413 14.1951 5.98524L15.7034 5.97157L15.7476 5.96724C15.8624 5.94553 15.9494 5.845 15.9505 5.72385L16 0.252257L15.9964 0.207284ZM0.00361156 15.7942C0.0236739 15.911 0.124705 16.0004 0.247142 16.0015L5.71044 15.9519L5.75469 15.9476C5.8695 15.9259 5.95648 15.8253 5.95758 15.7042L5.97122 14.1969L5.9676 14.1519C5.94752 14.0351 5.84626 13.9457 5.72181 13.9446L3.45526 13.9657L6.17695 11.2374C6.27435 11.1398 6.27435 10.9815 6.17695 10.8839L5.11877 9.82322C5.02137 9.72559 4.86345 9.72559 4.76605 9.82322L2.03131 12.5645L2.05208 10.2685L2.04847 10.2236C2.02841 10.1068 1.92738 10.0174 1.80494 10.0163L0.296648 10.03L0.252399 10.0343C0.137582 10.056 0.0506014 10.1565 0.0495052 10.2777L0 15.7493L0.00361156 15.7942Z"})),Lt=m.createElement("svg",{viewBox:"0 -4 16 24"},m.createElement("path",{d:"M9.75361 6.04424C9.77367 6.16105 9.87471 6.25041 9.99714 6.25152L15.4604 6.2019L15.5047 6.19757C15.6195 6.17586 15.7065 6.07533 15.7076 5.95418L15.7212 4.44688L15.7176 4.4019C15.6975 4.28509 15.5963 4.19573 15.4718 4.19461L13.2053 4.21567L15.9269 1.48744C16.0244 1.38981 16.0244 1.23151 15.9269 1.13388L14.8688 0.0732233C14.7714 -0.0244078 14.6135 -0.0244078 14.516 0.0732233L11.7813 2.81454L11.8021 0.518539L11.7985 0.473566C11.7784 0.356754 11.6774 0.267395 11.5549 0.266282L10.0466 0.279951L10.0024 0.284285C9.88758 0.305996 9.8006 0.40652 9.79951 0.527674L9.75 5.99926L9.75361 6.04424ZM6.24639 9.95728C6.22633 9.84047 6.1253 9.75111 6.00286 9.75L0.539561 9.79962L0.495313 9.80396C0.380496 9.82567 0.293515 9.92619 0.292419 10.0473L0.278782 11.5546L0.282396 11.5996C0.302484 11.7164 0.403738 11.8058 0.528186 11.8069L2.79474 11.7859L0.0730518 14.5141C-0.0243506 14.6117 -0.0243506 14.77 0.0730518 14.8676L1.13123 15.9283C1.22863 16.0259 1.38655 16.0259 1.48395 15.9283L4.21869 13.187L4.19792 15.483L4.20153 15.528C4.22159 15.6448 4.32262 15.7341 4.44506 15.7352L5.95335 15.7216L5.9976 15.7172C6.11242 15.6955 6.1994 15.595 6.20049 15.4738L6.25 10.0023L6.24639 9.95728Z"})),At=c.StyleSheet.create({root:{padding:"0 0.5em"},rootTop:{height:"2em"},rootBottom:{height:"2.5em",display:"flex",alignItems:"center",justifyContent:"space-between"},rootBottomLeft:{display:"flex"},rootBottomRight:{display:"flex"},button:{display:"block",width:"2.5em",height:"2.5em",margin:0,padding:"0.5em",border:"none",borderRadius:0,fontSize:"inherit",color:"rgba(255, 255, 255, 0.7)",background:"none",cursor:"pointer",transition:"color 300ms",":hover":{color:"#fff"},":focus":{outline:"none"}},menuContainer:{position:"relative"},menu:{position:"absolute",left:"50%",bottom:"100%",visibility:"hidden",opacity:0,transform:"translateX(-50%)",transition:"visibility 300ms, opacity 300ms",backgroundColor:"rgba(0, 0, 0, 0.5)",borderRadius:"4px"},menuShown:{visibility:"visible",opacity:1},timeline:{flex:1},timelineHolder:{flex:1},time:{display:"flex",alignItems:"center",justifyContent:"center",padding:"0 0.5em",minWidth:"100px",fontSize:"0.875em",color:"rgba(255, 255, 255, 0.9)",boxSizing:"content-box",fontVariantNumeric:"tabular-nums"},labelButton:{width:"auto",lineHeight:1.5},labelButtonText:{fontSize:"0.875em"},qualityMenu:{padding:"0.25em 0"},qualityMenuItem:{display:"block",width:"100%",boxSizing:"border-box",height:"2em",margin:0,padding:"0 0.75em",border:"none",borderRadius:0,fontSize:"0.875em",lineHeight:2,whiteSpace:"nowrap",color:"rgba(255, 255, 255, 0.5)",background:"none",cursor:"pointer",transition:"color 300ms, background-color 300ms",":hover":{backgroundColor:"rgba(255, 255, 255, 0.2)"},":focus":{outline:"none"}},qualityMenuActiveItem:{color:"#fff"},fullScreenedTime:{width:"150px"},tooltipContent:{pointerEvents:"none",padding:"0.25em 0.5em",fontSize:"0.875em",whiteSpace:"nowrap",color:"#fff"}});const Rt=e=>{var{icon:t,label:r}=e,n=De(e,["icon","label"]);return m.createElement("button",Object.assign({},n,{className:(0,c.css)(At.button,r?At.labelButton:null),type:"button"}),t&&m.createElement(ct,{icon:t}),r&&m.createElement("span",{className:(0,c.css)(At.labelButtonText)},r))},xt="undefined"!=typeof document&&"ontouchstart"in document.documentElement,kt=({localeKey:e,hotkey:t,children:r})=>{const n=Me(e),[i,a]=et();return m.createElement("div",{className:(0,c.css)(At.menuContainer),onMouseEnter:a.on,onMouseLeave:a.off},(0,m.cloneElement)(r,{"aria-label":n}),!xt&&m.createElement("div",{className:(0,c.css)(At.menu,i&&At.menuShown,At.tooltipContent)},n,t&&` (${t})`))},Dt=({isPlaying:e,onClick:t})=>m.createElement(kt,{localeKey:e?"pause":"play",hotkey:"k"},m.createElement(Rt,{icon:e?bt:St,onClick:t}));function Ct(e,t){return t?100*L()(e/t,0,1)+"%":"0%"}var Ot=c.StyleSheet.create({root:{position:"absolute",display:"flex",top:0,bottom:0,width:"100%"},item:{position:"absolute",width:12,height:"100%",transform:"translate(-50%)",":hover":{height:6,top:-1}},innerItem:{width:6,backgroundColor:"#ff9607",height:"100%",margin:"0 auto"}});const Pt=({startTime:e,total:t,onProgressDotHover:r,onProgressDotLeave:n})=>{const i=(0,m.useRef)(null);return m.createElement("div",{className:(0,c.css)(Ot.item),style:{left:Ct(e,t)},onMouseEnter:()=>{if(!i.current)return;const{left:t,top:n}=i.current.getBoundingClientRect();null==r||r({startTime:e,left:t,top:n})},onMouseLeave:n},m.createElement("div",{ref:i,className:(0,c.css)(Ot.innerItem)}))},Mt=({progressDots:e=[],total:t,onProgressDotHover:r,onProgressDotLeave:n})=>m.createElement("div",{className:(0,c.css)(Ot.root)},e.map(((e,i)=>m.createElement(Pt,{key:i,startTime:e.startTime,total:t,onProgressDotHover:r,onProgressDotLeave:n}))));var Bt=c.StyleSheet.create({root:{overflow:"hidden",userSelect:"none",cursor:"pointer",touchAction:"none",WebkitTapHighlightColor:"transparent",":focus":{outline:"none"}},inner:{position:"relative",display:"flex",alignItems:"center",width:"100%",height:"100%"},track:{position:"relative",flex:1,overflow:"hidden",backgroundColor:"rgba(255, 255, 255, 0.3)",borderRadius:"2px"},bar:{position:"absolute",backgroundColor:"#fff",borderRadius:"2px 0 0 2px"},thumbWrapper:{position:"absolute"},thumb:{width:"1em",height:"1em",margin:"-0.5em",borderRadius:"50%",backgroundColor:"#fff"}});const It=c.StyleSheet.create({root:{height:"1em",padding:"0 0.5em"},inner:{flexDirection:"row"},track:{height:4},bar:{top:0,bottom:0},thumbWrapper:{top:"50%"}}),Nt=c.StyleSheet.create({root:{width:"1em",padding:"0.5em 0"},inner:{flexDirection:"column"},track:{width:4},bar:{left:0,right:0},thumbWrapper:{left:"50%"}}),Ft=(e,t)=>t?L()(e/t,0,1):0,Ut=e=>100*e+"%";function jt(e){const{orientation:t,reverse:r,onFocus:n,onBlur:i,onChange:a,onDragStart:o,onDragEnd:s,noInteraction:u,progressDots:l,value:d=0,buffered:f=0,total:h=0,step:p=1,onProgressDotHover:v,onProgressDotLeave:g}=e,[{isSlideActive:y,isSliding:b,slidingValue:E},S]=((e={})=>{const[t,r]=(0,m.useState)(e);return[t,(0,m.useCallback)((e=>r((t=>Object.assign(Object.assign({},t),e)))),[])]})({isSlideActive:!1,isSliding:!1,slidingValue:null}),T="horizontal"===t,w=(0,m.useRef)(null),_=(...t)=>(0,c.css)(...t.map((t=>(t=>{const r=T?It:Nt;let n=e.styles;return Array.isArray(n)||(n=[n]),n=n.filter(Boolean),[Bt[t],r[t],...n.map((e=>e[t]))]})(t)))),A=T?r?"right":"left":r?"top":"bottom",R=T?"width":"height",x=e=>{const t=T?"scaleX":"scaleY";return{[R]:"100%",transform:`${t}(${e})`,transformOrigin:A}},k=e=>{const t=w.current;if(!t)return 0;const n=t.getBoundingClientRect();let i;return i=T?(e.clientX-n.left)/n.width:(n.bottom-e.clientY)/n.height,i=L()(i,0,1),r&&(i=1-i),i*h},D=Ie((e=>{const t=k(e);S({slidingValue:t,isSliding:!0}),O(t)})),C=Ie((e=>{null==s||s(),b&&O(k(e)),S({isSlideActive:!1,slidingValue:null,isSliding:!1})}));(0,m.useEffect)((()=>{if(y)return document.addEventListener("mousemove",D),document.addEventListener("mouseup",C),()=>{document.removeEventListener("mousemove",D),document.removeEventListener("mouseup",C)}}),[C,D,y]);const O=e=>{null==a||a(e)},P=u?{}:{tabIndex:0,onFocus:n,onBlur:i,onKeyDown:e=>{let t=0,n=!1;if("ArrowLeft"===e.key||"ArrowDown"===e.key?(n=!0,t=-1):"ArrowRight"!==e.key&&"ArrowUp"!==e.key||(n=!0,t=1),n){e.preventDefault(),r&&(t=-t);const n=L()(d+p*t,0,h);n!==d&&O(n)}},onMouseDown:e=>{if(0!==e.button)return;const t=k(e);S({isSlideActive:!0,slidingValue:t}),null==o||o(),O(t)}},M=Ft(y?E:d,h),B=Ft(f,h);return m.createElement("div",Object.assign({className:_("root")},P,{role:"slider"}),m.createElement("div",{className:_("inner")},m.createElement("div",{ref:w,className:_("track")},Boolean(f)&&m.createElement("div",{className:_("bar","buffered"),style:x(B)}),m.createElement("div",{className:_("bar"),style:x(M)}),Boolean(null==l?void 0:l.length)&&m.createElement(Mt,{progressDots:l,total:h,onProgressDotHover:v,onProgressDotLeave:g})),!u&&m.createElement("div",{className:_("thumbWrapper"),style:(e=>{const t=T?"translateX":"translateY";return{[R]:"100%",transform:`${t}(${Ut(T?e:1-e)})`,transformOrigin:A}})(M)},m.createElement("div",{className:_("thumb",y&&"thumbSliding")}))))}jt.defaultProps={orientation:"horizontal",reverse:!1,progressDots:[]};var Vt=c.StyleSheet.create({root:{}});const Gt=c.StyleSheet.create({root:{},track:{transition:"transform 300ms"},bar:{backgroundColor:"#0f88eb"},thumb:{transform:"scale(0)",transition:"transform 300ms"},buffered:{backgroundColor:"rgba(255, 255, 255, 0.6)",borderRadius:"2px 0 0 2px"}}),Ht=c.StyleSheet.create({thumb:{transform:"scale(1)"}}),zt=c.StyleSheet.create({track:{overflow:"visible"}}),qt=c.StyleSheet.create({root:{position:"absolute",bottom:0,left:0,right:0,padding:0,height:"3px"},track:{borderRadius:0},thumb:{display:"none"},buffered:{backgroundColor:"rgba(255, 255, 255, 0.3)",borderRadius:"2px 0 0 2px"}}),Kt=(...e)=>(0,m.useCallback)(((...t)=>e.forEach((e=>e(...t)))),[]),Wt=e=>{var{value:t,onDragStart:r,onDragEnd:n,onSeek:i,onChange:a,onProgressDotHover:o,onProgressDotLeave:s}=e,u=De(e,["value","onDragStart","onDragEnd","onSeek","onChange","onProgressDotHover","onProgressDotLeave"]);const[l,d]=et(),[f,h]=et(),[p,v]=et(),[g,y]=et(),b=Ie((e=>{e!==t&&(null==a||a(e)),p||null==i||i(e)}));return m.createElement("div",{className:(0,c.css)(Vt.root),onMouseEnter:h.on,onMouseLeave:Kt(h.off,d.off)},m.createElement(jt,Object.assign({},u,{styles:[Gt,(f||l||p)&&Ht,g&&zt].filter(Boolean),value:t,onChange:b,onFocus:d.on,onBlur:d.off,onDragStart:Kt(v.on,Ie(r||R())),onDragEnd:Kt(v.off,Ie(n||R())),onProgressDotHover:Kt(y.on,Ie(o||R())),onProgressDotLeave:Kt(y.off,Ie(s||R()))})))},$t=e=>m.createElement("div",{className:(0,c.css)(At.timeline)},m.createElement(Wt,Object.assign({},e))),Yt=({isFullScreen:e,currentTime:t,duration:r})=>m.createElement("div",{className:(0,c.css)(At.time,e&&At.fullScreenedTime)},`${rt(t)} / ${rt(r)}`),Qt=({name:e,style:t="text"})=>m.createElement(m.Fragment,null,Me(e,t)),Xt={auto:"quality-auto",ld:"quality-ld",sd:"quality-sd",hd:"quality-hd",fhd:"quality-fhd"};class Zt extends m.PureComponent{constructor(){super(...arguments),this.state={isQualityHovered:!1},this.handleQualityPointerEnter=()=>{this.setState({isQualityHovered:!0})},this.handleQualityPointerLeave=()=>{this.setState({isQualityHovered:!1})}}render(){const{isQualityHovered:e}=this.state;return m.createElement(Ye.Consumer,null,(({qualities:t,setCurrentQuality:r,currentQuality:n})=>(null==t?void 0:t.length)>1&&m.createElement("div",{className:(0,c.css)(At.menuContainer),onMouseEnter:this.handleQualityPointerEnter,onMouseLeave:this.handleQualityPointerLeave},m.createElement(Rt,{label:m.createElement(Qt,{style:"narrow",name:Xt[n]})}),m.createElement("div",{className:(0,c.css)(At.menu,e&&At.menuShown)},m.createElement("div",{className:(0,c.css)(At.qualityMenu)},t.map((e=>m.createElement("button",{key:e,className:(0,c.css)(At.qualityMenuItem,n===e&&At.qualityMenuActiveItem),onClick:()=>{this.handleQualityPointerLeave(),r(e)}},m.createElement(Qt,{name:Xt[e]})))))))))}}var Jt=c.StyleSheet.create({root:{padding:"0.375em 0"}});const er=c.StyleSheet.create({root:{width:"2.5em",height:"4em"},track:{margin:"-0.4em 0",transform:"translate3d(0, 0, 0)"},thumb:{transform:"scale(0.8)",transition:"transform 300ms",":hover":{transform:"scale(1)"}},thumbSliding:{transform:"scale(1)"}}),tr=e=>m.createElement("div",{className:(0,c.css)(Jt.root)},m.createElement(jt,Object.assign({},e,{styles:er,orientation:"vertical",step:.1}))),rr=({volume:e,menuShown:t,onMouseEnter:r,onMouseLeave:n,onDragStart:i,onDragEnd:a,onChange:o,onToggleMuted:s})=>m.createElement("div",{className:(0,c.css)(At.menuContainer),onMouseEnter:r,onMouseLeave:n},m.createElement(Rt,{"aria-label":Me(0===e?"unmute":"mute"),icon:0===e?yt:wt,onClick:()=>null==s?void 0:s()}),m.createElement("div",{className:(0,c.css)(At.menu,t&&At.menuShown)},m.createElement(tr,{value:e,total:1,onDragStart:i,onDragEnd:a,onChange:o}))),nr=({isFullScreen:e,onClick:t})=>m.createElement(kt,{localeKey:e?"action-exit-fullscreen":"action-enter-fullscreen",hotkey:"f"},m.createElement(Rt,{icon:e?Tt:mt,onClick:t})),ir=({isPip:e,onClick:t})=>m.createElement(kt,{localeKey:e?"action-exit-pip":"action-enter-pip",hotkey:"p"},m.createElement(Rt,{icon:e?gt:Et,onClick:t}));class ar extends m.PureComponent{constructor(){super(...arguments),this.state={isPlaybackRateHovered:!1},this.handlePlaybackRatePointerEnter=()=>{this.setState({isPlaybackRateHovered:!0})},this.handlePlaybackRatePointerLeave=()=>{this.setState({isPlaybackRateHovered:!1})}}render(){const{isPlaybackRateHovered:e}=this.state;return m.createElement(Ye.Consumer,null,(({playbackRates:t,setCurrentPlaybackRate:r,currentPlaybackRate:n})=>(null==t?void 0:t.length)>1&&m.createElement("div",{className:(0,c.css)(At.menuContainer),onMouseEnter:this.handlePlaybackRatePointerEnter,onMouseLeave:this.handlePlaybackRatePointerLeave},m.createElement(Rt,{label:1===n.value?m.createElement(Qt,{name:"playback-rate"}):`${n.text}`}),m.createElement("div",{className:(0,c.css)(At.menu,e&&At.menuShown)},m.createElement("div",{className:(0,c.css)(At.qualityMenu)},Xe(t).map((e=>m.createElement("button",{key:e.value,className:(0,c.css)(At.qualityMenuItem,n.value===e.value&&At.qualityMenuActiveItem),onClick:()=>{this.handlePlaybackRatePointerLeave(),r(e)}},e.text))))))))}}const or=({isFullScreen:e,onClick:t})=>m.createElement(kt,{localeKey:e?"action-exit-page-fullscreen":"action-enter-page-fullscreen",hotkey:"t"},m.createElement(Rt,{icon:e?Lt:_t,onClick:t}));function sr(e){const{isPlaying:t=!1,buffered:r,duration:n,currentTime:i,volume:a,isFullScreen:o=!1,isPageFullScreen:s,isPip:u,onDragStart:l,onDragEnd:d,onToggleFullScreen:f,onTogglePageFullScreen:h,onTogglePip:p,showPip:v,progressDots:g,hiddenPlayButton:y,hiddenTimeline:b,hiddenTime:E,hiddenQualityMenu:S,hiddenVolumeItem:T,hiddenPlaybackRateItem:w,hiddenFullScreenButton:_,shouldShowPageFullScreenButton:A,onProgressDotHover:R,onProgressDotLeave:x,onTogglePlay:k,onSeek:D,onToggleMuted:C,onVolumeChange:O}=e,[P,M]=et(),[B,I]=(0,m.useState)(),N=Ie((e=>{I(L()(e,0,n))})),F=Ie((e=>{null==D||D(L()(e,0,n)),I(void 0)})),U=B||i;return m.createElement("div",{className:(0,c.css)(At.root)},!b&&m.createElement($t,{value:i,total:n,buffered:r,progressDots:g,onDragStart:l,onDragEnd:d,onChange:N,onSeek:F,onProgressDotHover:R,onProgressDotLeave:x}),m.createElement("div",{className:(0,c.css)(At.rootBottom)},m.createElement("div",{className:(0,c.css)(At.rootBottomLeft)},!y&&m.createElement(Dt,{isPlaying:t,onClick:()=>null==k?void 0:k()}),b&&m.createElement("div",{className:(0,c.css)(At.timelineHolder)}),!E&&m.createElement(Yt,{isFullScreen:o,currentTime:U,duration:n})),m.createElement("div",{className:(0,c.css)(At.rootBottomRight)},!w&&m.createElement(ar,null),!S&&m.createElement(Zt,null),v&&m.createElement(ir,{isPip:u,onClick:p}),A&&m.createElement(or,{isFullScreen:s,onClick:h}),!_&&m.createElement(nr,{isFullScreen:o,onClick:f}),!T&&m.createElement(rr,{volume:a,menuShown:P,onMouseEnter:M.on,onMouseLeave:M.off,onToggleMuted:C,onChange:O}))))}sr.defaultProps={show:!1,standalone:!1,duration:0,currentTime:0,volume:.5,buffered:0,isPageFullScreen:!1,showPip:!1,hiddenPlayButton:!1,hiddenTimeline:!1,hiddenTime:!1,hiddenQualityMenu:!1,hiddenPlaybackRateItem:!1,hiddenVolumeItem:!1,hiddenFullScreenButton:!1,progressDots:[]};var ur=m.memo(sr),lr=m.createElement("svg",{viewBox:"0 0 20 20"},m.createElement("path",{d:"M10 0C4.477 0 0 4.477 0 10s4.477 10 10 10 10-4.477 10-10S15.523 0 10 0zm-.034 2.966c1.95 0 1.485 1.807 1.485 2.21 0 .116-.784 7.79-.784 7.79h-1.4S8.48 5.344 8.48 5.23c0-.417-.462-2.264 1.486-2.264zm1.057 13.522c-.294.287-.647.43-1.056.43-.41 0-.762-.142-1.058-.43-.296-.286-.444-.643-.444-1.07 0-.41.148-.762.443-1.057.294-.294.647-.44 1.057-.44.41 0 .762.142 1.056.43.296.286.443.643.443 1.07 0 .426-.147.782-.443 1.068z"})),cr=m.createElement("svg",{viewBox:"0 0 72 72"},m.createElement("g",{fill:"none",fillRule:"evenodd"},m.createElement("circle",{cx:"36",cy:"36",r:"36",fill:"#FFF",fillOpacity:".95"}),m.createElement("path",{fill:"#444",fillRule:"nonzero",d:"M41.143 22.5h5.786v27h-5.786zM25.071 22.5h5.786v27h-5.786z"}))),dr=m.createElement("svg",{viewBox:"0 0 72 72"},m.createElement("g",{fill:"none",fillRule:"evenodd"},m.createElement("circle",{cx:"36",cy:"36",r:"36",fill:"#FFF",fillOpacity:".95"}),m.createElement("path",{fill:"#444",fillRule:"nonzero",d:"M50.8350169,37.0602664 L29.4767217,49.9693832 C28.900608,50.3175908 28.1558807,50.1251285 27.8133266,49.5395068 C27.701749,49.3487566 27.6428571,49.1309436 27.6428571,48.9090213 L27.6428571,23.0907876 C27.6428571,22.4094644 28.1862113,21.8571429 28.8564727,21.8571429 C29.0747919,21.8571429 29.2890685,21.9170066 29.4767217,22.0304257 L50.8350169,34.9395425 C51.4111306,35.28775 51.6004681,36.0447682 51.257914,36.6303899 C51.154433,36.8072984 51.0090531,36.9550776 50.8350169,37.0602664 Z"}))),fr=m.createElement("svg",{viewBox:"0 0 24 24"},m.createElement("g",{fill:"none",fillRule:"evenodd"},m.createElement("rect",{width:"24",height:"24"}),m.createElement("path",{fill:"#FFF",d:"M12.4049973,3.62840003 C17.1876069,3.84468032 21,7.87252205 21,12.8096305 C21,17.8853314 16.9705627,22 12,22 C7.02943725,22 3,17.8853314 3,12.8096305 C3,12.0229797 3.624497,11.3852732 4.39485308,11.3852732 C5.16520917,11.3852732 5.78970616,12.0229797 5.78970616,12.8096305 C5.78970616,16.3120298 8.57014942,19.1512855 12,19.1512855 C15.4298506,19.1512855 18.2102938,16.3120298 18.2102938,12.8096305 C18.2102938,9.44617464 15.6460805,6.69429107 12.4049973,6.4812447 L12.4049973,8.30324795 C12.4049973,8.71101381 12.0954942,9.04157334 11.7137028,9.04157334 C11.5841406,9.04157334 11.457186,9.00268616 11.3473174,8.92934663 L6.42999892,5.64693477 C6.10624047,5.4308193 6.00781868,4.97530916 6.21016772,4.62952441 C6.26580359,4.53445089 6.34098153,4.45415835 6.42999892,4.3947374 L11.3473174,1.11232554 C11.6710759,0.896210069 12.0975703,1.00132779 12.2999193,1.34711255 C12.3685872,1.46445578 12.4049973,1.60004749 12.4049973,1.73842422 L12.4049973,3.62840003 Z"}))),hr=c.StyleSheet.create({container:{position:"absolute",pointerEvents:"none",overflow:"hidden"},containerFullWidth:{width:"100%",height:"auto",top:"50%",left:0,transform:"translate(0, -50%)"},containerFullHeight:{width:"auto",height:"100%",top:0,left:"50%",transform:"translate(-50%)"},image:{display:"block",visibility:"hidden"},imageFullWidth:{width:"100%",height:"auto"},imageFullHeight:{width:"auto",height:"100%"},layer:{position:"absolute",top:0,left:0,right:0,bottom:0,overflow:"hidden",pointerEvents:"none"}});const pr=e=>(0,c.css)(hr.container,e?hr.containerFullWidth:hr.containerFullHeight),vr=e=>(0,c.css)(hr.image,e?hr.imageFullWidth:hr.imageFullHeight),gr=({children:e})=>{const{isFullWidth:t,helperImageSrc:r}=(0,m.useContext)(Ke);return r?m.createElement("div",{className:pr(t)},m.createElement("img",{src:r,className:vr(t)}),e):null},mr=({children:e})=>{const{objectFit:t}=(0,m.useContext)(Ge);if(e){const r=m.createElement("div",{className:(0,c.css)(hr.layer)},e);return"cover"===t?r:m.createElement(gr,null,r)}return null},yr=2*Math.PI*30.5,br={"0%":{strokeDashoffset:yr,transform:"rotate(0deg)"},"50%":{strokeDashoffset:yr/4,transform:"rotate(90deg)"},"100%":{strokeDashoffset:yr,transform:"rotate(360deg)"}};var Er=c.StyleSheet.create({root:{width:"4em",height:"4em"},svg:{display:"block",width:"100%",height:"100%",animationName:{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}},animationDuration:"2s",animationIterationCount:"infinite",animationTimingFunction:"linear"},circle:{cx:"50%",cy:"50%",r:30.5,strokeDasharray:yr,stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",fill:"none",transformOrigin:"center",animationName:br,animationDuration:"1.5s",animationIterationCount:"infinite",animationTimingFunction:"ease-in-out"}});const Sr=()=>m.createElement("div",{className:(0,c.css)(Er.root)},m.createElement("svg",{viewBox:"0 0 64 64",className:(0,c.css)(Er.svg)},m.createElement("circle",{className:(0,c.css)(Er.circle)})));class Tr extends m.Component{shouldComponentUpdate(e){return this.props.show||e.show}render(){const{duration:e,currentTime:t,buffered:r,progressDots:n}=this.props;return m.createElement(jt,{value:t,total:e,buffered:r,progressDots:n,styles:[Gt,qt],noInteraction:!0})}}Tr.defaultProps={show:!1,duration:0,currentTime:0,buffered:0,progressDots:[]};const wr=({root:e,prevVolumeRef:t,isPlaying:r,isPageFullScreen:n,volume:i,duration:a,currentTime:o,standalone:s,onVolumeChange:u,onTogglePlay:l,onTogglePip:c,onToggleFullScreen:d,onTogglePageFullScreen:f,onSeek:h})=>{const p=ht(),{playbackRates:v,currentPlaybackRate:g,setCurrentPlaybackRate:y}=(0,m.useContext)(Ye),b=e=>{const t=null==v?void 0:v.findIndex((e=>e.value===g.value));if(t>=0){const r=v[t+("next"===e?1:-1)];p({icon:dr,label:(r||g).text}),r&&y(r)}},E=Ie(((e,t=!1)=>{e=L()(e,0,1),t&&p({icon:e?wt:yt,label:`${(100*e).toFixed(0)}%`}),null==u||u(e)})),S=Ie((e=>{h(L()(e,0,a))})),T=Ie((e=>{if(e.defaultPrevented)return;if(e.altKey||e.ctrlKey||e.metaKey)return;if(e.target&&(s=e.target,/^(input|textarea|select)$/i.test(s.tagName)||s.isContentEditable))return;var s;let u=!0;switch(e.key){case" ":case"k":case"K":p({icon:r?cr:dr}),l();break;case"p":case"P":c();break;case"t":case"T":f();break;case"f":case"F":d();break;case"Escape":n&&f();break;case"ArrowLeft":S(o-5);break;case"ArrowRight":S(o+5);break;case"ArrowUp":E(i+.05,!0);break;case"ArrowDown":E(i-.05,!0);break;case"j":case"J":S(o-10);break;case"l":case"L":S(o+10);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":S(a/10*Number(e.key));break;case"m":case"M":E(i?0:t.current,!0);break;case"<":b("prev");break;case">":b("next");break;default:u=!1}u&&e.preventDefault()}));(0,m.useEffect)((()=>s?(document.addEventListener("keydown",T),()=>{document.removeEventListener("keydown",T)}):e?(e.addEventListener("keydown",T),()=>{e.removeEventListener("keydown",T)}):void 0),[T,e,s])},_r=[[a.PLAY,"onPlay"],[a.PLAYING,"onPlaying"],[a.PAUSE,"onPause"],[a.ENDED,"onEnded"],[a.TIMEUPDATE,"onTimeUpdate"],[a.ERROR,"onError"],[a.WAITING,"onWaiting"],[a.CANPLAY,"onCanPlay"],[a.LOADEDDATA,"onLoadedData"],[a.PROGRESS,"onProgress"]];function Lr(e){if(!e)return null;const{code:t,message:r}=e;return{code:t,message:r,name:e.name}}const Ar=m.forwardRef(((e,t)=>{const{updateVideoSize:r}=(0,m.useContext)(Ke),{objectFit:n}=(0,m.useContext)(Ge),{emitEvent:i}=(0,m.useContext)(Ue),a=(0,m.useRef)(e);(0,m.useEffect)((()=>{a.current=e}),[e]);const o=(0,m.useMemo)((()=>{const e={};return _r.forEach((([t,r])=>{e[r]=(e,...n)=>{var o,s;i(t,function(e){const{currentTime:t,duration:r,error:n,videoWidth:i,videoHeight:a}=e.currentTarget;return{currentTime:t,duration:r,videoWidth:i,videoHeight:a,error:Lr(n)}}(e));const u=a.current[r];return null===(s=(o=a.current).onNativeEvent)||void 0===s||s.call(o,e),null==u?void 0:u(e,...n)}})),e}),[i]),s=(0,m.useCallback)((e=>{var t,n;const i=e.currentTarget;if(i){const{videoWidth:e,videoHeight:t}=i;r({videoWidth:e,videoHeight:t})}null===(n=(t=a.current).onLoadedMetadata)||void 0===n||n.call(t,e)}),[r]),{Video:u,onNativeEvent:l}=e,c=De(e,["Video","onNativeEvent"]);return m.createElement(u,Object.assign({},c,o,{ref:t,style:{objectFit:n},onLoadedMetadata:s}))}));var Rr={pluginName:"native",VideoComponent:e=>{const{onRef:t,paused:r,currentQuality:n,useAutoQuality:i,sources:a}=e,o=De(e,["onRef","paused","currentQuality","useAutoQuality","sources"]);return m.createElement("video",Object.assign({},o,{ref:t}))},willHandleSrcChange:!1},xr=w()((function(e,t){return"m3u8"===e&&(null==O?void 0:O.VideoComponent)&&p()&&!function(){const e=document.createElement("video");return Boolean(e.canPlayType("application/vnd.apple.mpegURL"))}()?O:"mp4"===e&&(null==ke?void 0:ke.VideoComponent)&&p()&&t?ke:Rr}),((...e)=>String(e))),kr=c.StyleSheet.create({root:{display:"block",width:"100%",height:"100%"}});const{isMobile:Dr}=h;class Cr extends m.Component{constructor(){super(...arguments),this.isMetadataLoaded=!1,this.pendingAction=null,this.loading=!1,this.isSwitchDefinition=!1,this.root=null,this.safeExecute=e=>{void 0!==this.playPromise?this.playPromise.then((()=>{e()})):e()},this.handleMetadataLoaded=()=>{this.isMetadataLoaded=!0,this.applyPendingAction(),this.isSwitchDefinition&&(this.isSwitchDefinition=!1,this.setRate(this.props.currentPlaybackRate),this.props.onEvent(a.CHANGE_QUALITY_SUCCESS,this.props.currentQuality))},this.handleDurationChange=()=>{const{onDurationUpdate:e}=this.props;e&&e(this.root.duration)},this.prevLoadingEvent=void 0,this.handleNativeEvent=e=>{var t,r,n,i;const a=e.type;"waiting"!==a&&"canplay"!==a&&"playing"!==a&&"error"!==a||("waiting"===a?(this.loading=!0,null===(r=(t=this.props).onLoadingChange)||void 0===r||r.call(t,this.loading)):("canplay"===a&&"waiting"===this.prevLoadingEvent||"playing"===a||"error"===a)&&(this.loading=!1,null===(i=(n=this.props).onLoadingChange)||void 0===i||i.call(n,this.loading)),this.prevLoadingEvent=a)},this.handleTimeUpdate=()=>{this.notifyTimeUpdate(!1)},this.notifyTimeUpdate=e=>{var t;const{onCurrentTimeUpdate:r,paused:n}=this.props;if(void 0!==this._timeUpdateRafId&&window.cancelAnimationFrame(this._timeUpdateRafId),n||this.loading)return;const i=null===(t=this.root)||void 0===t?void 0:t.currentTime;r&&i&&(r(i,e),Dr||(this._timeUpdateRafId=window.requestAnimationFrame((()=>this.notifyTimeUpdate(!0)))))},this.handleProgress=()=>{const{onProgressUpdate:e}=this.props,t=this.root.buffered,r=[];for(let e=0;e<t.length;e++)r.push({start:t.start(e),end:t.end(e)});e&&e(r)},this.handleError=()=>{const{error:e,currentTime:t}=this.root||{};if(!e)return;const{code:r,message:n}=e;d.debug("Error: %o",{code:r,message:n,name:e.name});const i=(e=>e&&"NotAllowedError"===e.name)(e)||(e=>e&&"AbortError"===e.name||e instanceof MediaError&&e.code===MediaError.MEDIA_ERR_ABORTED)(e);i||this.props.onEvent(a.PLAY_FAILED,{currentTime:t}),this.isSwitchDefinition&&(this.isSwitchDefinition=!1,this.setRate(this.props.currentPlaybackRate),this.props.onEvent(a.CHANGE_QUALITY_FAIL,this.props.currentQuality)),this.props.onError(e)}}componentDidMount(){this.root.volume=Math.pow(this.props.volume,2)}getSnapshotBeforeUpdate(){return{paused:this.root.paused,currentTime:this.root.currentTime}}componentDidUpdate(e,t,r){const{src:n,paused:i,volume:o,format:s,useMSE:u,currentPlaybackRate:l,currentQuality:c,onEvent:d}=this.props;if(e.src&&n!==e.src){this.isSwitchDefinition=!0,d(a.CHANGE_QUALITY_START,c);const{willHandleSrcChange:e}=xr(s,u);e||this.safeExecute((()=>{this.isMetadataLoaded=!1,this.seek(r.currentTime),r.paused||this.play()}))}i!==e.paused&&this.root&&i!==this.root.paused&&(i?this.pause():this.play()),this.root&&this.root.volume!==Math.pow(o,2)&&!Dr&&(this.root.volume=Math.pow(o,2)),e.currentPlaybackRate.value!==l.value&&this.setRate(l)}pending(e){this.pendingAction=Object.assign(Object.assign({},this.pendingAction),e)}applyPendingAction(){if(!this.pendingAction)return;const e=this.pendingAction;this.pendingAction=null,void 0!==e.currentTime&&this.seek(e.currentTime),void 0!==e.paused&&this.root&&e.paused!==this.root.paused&&(e.paused?this.pause():this.play())}setRate(e){Dr||this.isMetadataLoaded?this.safeExecute((()=>this.root.playbackRate=Number(e.value))):this.pending({paused:!0})}play(){var e;if(!Dr&&!this.isMetadataLoaded)return this.pending({paused:!1}),void((null===(e=this.root)||void 0===e?void 0:e.load)&&this.safeExecute((()=>this.root.load())));this.playPromise=Promise.resolve(this.root.play()).catch((e=>{const{onError:t}=this.props;t&&t(e)}))}pause(){Dr||this.isMetadataLoaded?this.safeExecute((()=>this.root.pause())):this.pending({paused:!0})}seek(e){var t;Number.isFinite(e)&&(this.isMetadataLoaded?(null===(t=this.root)||void 0===t?void 0:t.duration)&&(this.root.currentTime=e):this.pending({currentTime:e}))}render(){const{src:e,controls:t,loop:r,paused:n,volume:i,onPlay:a,onPause:o,onEnded:s,onLoadedData:u,onSeeking:l,onSeeked:d,format:f,useMSE:h,sources:p,currentQuality:v,crossOrigin:g}=this.props,{VideoComponent:y}=xr(f,h);return m.createElement(Ar,{onRef:e=>{this.root=e},className:(0,c.css)(kr.root),preload:"metadata",playsInline:!0,crossOrigin:g,"webkit-playsinline":"","x-webkit-airplay":"deny",muted:!i,controls:t,loop:r,src:e,onPlay:a,onPause:o,onEnded:s,onLoadedData:u,onSeeking:l,onSeeked:d,onClick:this.handleClick,onLoadedMetadata:this.handleMetadataLoaded,onError:this.handleError,onDurationChange:this.handleDurationChange,onTimeUpdate:this.handleTimeUpdate,onProgress:this.handleProgress,onNativeEvent:this.handleNativeEvent,paused:n,sources:p,currentQuality:v,Video:y})}}Cr.defaultProps={paused:!0,volume:.5};var Or=m.forwardRef(((e,t)=>m.createElement(Ye.Consumer,null,(({currentSrc:r,sources:n,currentQuality:i,format:a,currentPlaybackRate:o})=>m.createElement(Cr,Object.assign({ref:t},e,{src:r,format:a,sources:n,currentQuality:i,currentPlaybackRate:o}))))));const Pr=[],Mr=({autoplay:e,muted:t,error:r,title:n,cover:i,standalone:o,loop:u,duration:l=0,onBeforePlay:d,useMSE:f,useAutoQuality:p,alwaysShowVolumeButton:v,disablePictureInPicture:y,progressDots:b=Pr,hiddenPlayButton:E,hiddenTimeline:S,hiddenTime:T,hiddenQualityMenu:w,hiddenVolume:_,hiddenFullScreenButton:L,shouldShowPageFullScreenButton:A,children:R,hiddenPlaybackRateItem:x,hideMobileControls:k,hideCover:D,noWriteDocTitle:C,layerContent:O,crossOrigin:P})=>{var M,B;const{emitEvent:I,subscribeAction:N}=(0,m.useContext)(Ue),{currentSrc:F,sources:U}=(0,m.useContext)(Ye),[j,V]=(0,m.useState)(null),G=(0,m.useRef)(),H=ht(),[z,q]=(0,m.useState)([]),[K,W]=(0,m.useState)(.5),[$,Y]=(0,m.useState)(l),[Q,X]=(0,m.useState)(0),[Z,J]=et(),[ee,te]=et(),[re,ne]=et(),[ie,ae]=et(!0),[oe,se]=et(),[ue,le]=et(),[ce,de]=et(),[fe,he]=et(),[pe,ve]=et(),[ge,me]=et(),[ye,be]=et(),Ee=(0,m.useRef)();var Se;(0,m.useEffect)((()=>{l&&!$&&Y(l)}),[$,l]),Se=()=>{const r=at.get("@griffith/history-volume");r&&W(r);const n=[N(s.PLAY,_e),N(s.PAUSE,we),N(s.TIME_UPDATE,(({currentTime:e})=>Re(e))),N(s.SHOW_CONTROLLER,Pe),N(s.SET_VOLUME,(({volume:e})=>Ae(e)))];return G.current.root&&(t&&Ae(0),e&&_e()),()=>{n.forEach((e=>e.unsubscribe()))}},(0,m.useEffect)(Se,[]);const Te=re?!ee||oe||ue||ce:0!==Q;(0,m.useEffect)((()=>{I(Te?a.SHOW_CONTROLLER:a.HIDE_CONTROLLER)}),[I,Te]),(0,m.useEffect)((()=>{o&&"string"==typeof n&&n!==document.title&&!C&&(document.title=n)}),[C,o,n]),(0,m.useEffect)((()=>{y||!G.current.root||Ee.current||(Ee.current=new nt,Ee.current.init(G.current.root,(()=>I(a.ENTER_PIP)),(()=>I(a.EXIT_PIP))))}),[y,I]);const we=Ie((({dontApplyOnFullScreen:e}={})=>{ee&&(e&&Boolean(g().element)||Le())})),_e=Ie((()=>{I(a.REQUEST_PLAY),Promise.resolve(null==d?void 0:d(F)).then((()=>{re||(I(a.PLAY_COUNT),ne.on(),Z||be.on(),h.isIE&&0!==Q&&Re(0)),te.on(),ae.off()})).catch((()=>{I(a.PLAY_REJECTED)}))})),Le=Ie((()=>{I(a.REQUEST_PAUSE),te.off()})),Ae=Ie((e=>{e=Math.round(100*e)/100,W(e),at.set("@griffith/history-volume",e)})),Re=Ie((e=>{var t;X(e),null===(t=G.current)||void 0===t||t.seek(e)})),xe=(0,m.useRef)(!1),ke=Ie((()=>{if(g().enabled){const e=()=>I(a.ENTER_FULLSCREEN),t=()=>I(a.EXIT_FULLSCREEN);null===g()||void 0===g()||g().toggle(j,e,t)}})),De=Ie((()=>{var e;Boolean(g().element)&&!(null===(e=Ee.current)||void 0===e?void 0:e.pictureInPictureElement)&&ke(),ge?(me.off(),I(a.EXIT_PAGE_FULLSCREEN)):(me.on(),I(a.ENTER_PAGE_FULLSCREEN))})),Ce=Ie((()=>{var e;ge&&(me.off(),I(a.EXIT_PAGE_FULLSCREEN)),null===(e=Ee.current)||void 0===e||e.toggle()})),Oe=(0,m.useRef)(null),Pe=Ie((()=>{oe||se.on(),null!==Oe.current&&clearTimeout(Oe.current),Oe.current=setTimeout((()=>{Oe.current=null,se.off()}),3e3)})),Me=Ie((()=>{ee?Le():_e()})),Be=(0,m.useRef)(K),Ne=Ie((()=>{K&&(Be.current=K),Ae(K?0:Be.current)}));wr({root:j,prevVolumeRef:Be,isPlaying:ee,volume:K,currentTime:Q,duration:$,standalone:o,isPageFullScreen:ge,onTogglePlay:Me,onToggleFullScreen:ke,onTogglePageFullScreen:De,onTogglePip:Ce,onVolumeChange:Ae,onSeek:Re});const Fe=ze(U);(0,m.useEffect)((()=>{Fe&&Fe!==U&&(Re(0),Le(),e&&_e())}),[e,_e,Re,Le,Fe,U]);const je=Boolean(null===(M=Ee.current)||void 0===M?void 0:M.pictureInPictureElement),Ve=Boolean(g().element)&&!je,He=(0,m.useMemo)((()=>function(e,t){const r=t.find((t=>t.start<=e&&e<=t.end));return r?r.end:0}(Q,z)),[z,Q]),qe=!ye||0!==Q,Ke=qe&&re,We=!h.isMobile&&m.createElement("div",{className:(0,c.css)(st.overlay,ie&&st.overlayMask)},re&&ye&&m.createElement("div",{className:(0,c.css)(st.loader)},m.createElement(Sr,null)),m.createElement("div",{className:(0,c.css)(st.backdrop),onTouchStart:e=>{e.preventDefault()},onClick:()=>{H({icon:ee?cr:dr}),Me()}}),n&&Ve&&m.createElement("div",{className:(0,c.css)(st.title,Te&&st.titleShown)},n),!S&&ee&&qe&&m.createElement("div",{className:(0,c.css)(ut.base,Te?ut.hidden:ut.shown)},m.createElement(Tr,{progressDots:b,buffered:He,duration:$,currentTime:Q,show:!Te})),v&&Ke&&m.createElement("div",{className:(0,c.css)(st.volumeButton,ut.base,Te?ut.hidden:ut.shown)},m.createElement(rr,{volume:K})),Ke&&m.createElement("div",{className:(0,c.css)(st.controller,ut.base,Te?ut.shown:ut.hidden),onMouseEnter:le.on,onMouseLeave:le.off},m.createElement(ur,{standalone:o,isPlaying:ee,duration:$,currentTime:Q,volume:K,progressDots:b,buffered:He,isFullScreen:Ve,isPageFullScreen:ge,isPip:je,onDragStart:de.on,onDragEnd:de.off,onTogglePlay:Me,onToggleMuted:Ne,onSeek:Re,onVolumeChange:Ae,onToggleFullScreen:ke,onTogglePageFullScreen:De,onTogglePip:Ce,onProgressDotHover:e=>{I(a.HOVER_PROGRESS_DOT,e)},onProgressDotLeave:()=>{I(a.LEAVE_PROGRESS_DOT)},show:Te,showPip:!y&&(null===(B=Ee.current)||void 0===B?void 0:B.supported),hiddenPlayButton:E,hiddenTimeline:S,hiddenTime:T,hiddenQualityMenu:w,hiddenVolumeItem:_,hiddenPlaybackRateItem:x,hiddenFullScreenButton:L,shouldShowPageFullScreenButton:A})));return m.createElement("div",{className:(0,c.css)(st.root,Ve&&st.fullScreened,ge&&st.pageFullScreen),onMouseLeave:()=>{he.off(),null!==Oe.current&&(clearTimeout(Oe.current),Oe.current=null),se.off()},onMouseEnter:()=>{he.on(),Pe()},onMouseDown:()=>{ve.on(),Pe()},onMouseUp:()=>{ve.off(),Pe()},onMouseMove:Pe,ref:V,tabIndex:-1,"aria-label":n},m.createElement("div",{className:(0,c.css)(st.video)},m.createElement(Or,{ref:G,crossOrigin:P,controls:h.isMobile&&re&&!k,paused:!ee,volume:K,loop:u,onPlay:()=>{ee||te.on()},onPause:()=>{ee&&te.off()},onEnded:()=>{ne.off(),te.off(),be.off()},onLoadedData:()=>{J.on(),be.off()},onError:()=>{te.off()},onLoadingChange:e=>{e?be.on():be.off()},onDurationUpdate:e=>{Y(e)},onCurrentTimeUpdate:e=>{ye||xe.current||X(e)},onSeeking:()=>{xe.current=!0},onSeeked:()=>{xe.current=!1},onProgressUpdate:e=>{q(e)},onEvent:I,useMSE:f,useAutoQuality:p})),k&&re&&ye&&m.createElement("div",{className:(0,c.css)(st.loader)},m.createElement(Sr,null)),!D&&m.createElement("div",{className:(0,c.css)(st.cover,!re&&st.coverShown),onClick:()=>_e()},i&&m.createElement(Ge.Consumer,null,(({objectFit:e})=>m.createElement("img",{className:(0,c.css)(st.coverImage),src:i,style:{objectFit:e}}))),$&&0===Q&&m.createElement("div",{className:(0,c.css)(st.coverTime,h.isMobile&&st.coverTimeMobile)},rt($)),ie&&m.createElement("div",{className:(0,c.css)(st.coverAction)},m.createElement("div",{className:(0,c.css)(st.actionButton)},m.createElement(ct,{icon:dr,styles:st.actionIcon}))),!ie&&0!==Q&&m.createElement("div",{className:(0,c.css)(st.coverReplayAction)},m.createElement("div",{className:(0,c.css)(st.coverReplayButton,fe&&st.coverReplayButtonHovered,pe&&st.coverReplayButtonPressed)},m.createElement(ct,{icon:fr,styles:st.replayIcon}),m.createElement(Qt,{name:"replay"})))),We,m.createElement(vt,null),O&&m.createElement(mr,null,O),r&&m.createElement("div",{className:(0,c.css)(st.error)},m.createElement(ct,{icon:lr,styles:st.errorIcon}),r.message&&m.createElement("div",{className:(0,c.css)(st.errorMessage)},r.message)),R)},Br={value:1,text:"1.0x"},Ir=[{value:.5,text:"0.5x"},{value:.75,text:"0.75x"},{value:1,text:"1.0x"},{value:1.25,text:"1.25x"},{value:1.5,text:"1.5x"},{value:2,text:"2.0x"}];var Nr=m.memo((e=>{var{standalone:t,id:r,sources:n,onEvent:i,dispatchRef:a,enableCrossWindowMessage:o,messageContextRef:s,shouldObserveResize:u,initialObjectFit:l,locale:c=Ce,localeConfig:d,defaultQuality:f,defaultQualityOrder:h="asc",defaultPlaybackRate:p=Br,playbackRates:v=Ir,useAutoQuality:g=!1}=e,y=De(e,["standalone","id","sources","onEvent","dispatchRef","enableCrossWindowMessage","messageContextRef","shouldObserveResize","initialObjectFit","locale","localeConfig","defaultQuality","defaultQualityOrder","defaultPlaybackRate","playbackRates","useAutoQuality"]);return m.createElement(He,{initialObjectFit:l},m.createElement($e,{shouldObserveResize:u},m.createElement(Ve,{id:r,enableCrossWindow:void 0!==o?o:t,onEvent:i,dispatchRef:a,messageContextRef:s},m.createElement(Je,{sources:n,defaultQuality:f,useAutoQuality:g,defaultPlaybackRate:p,defaultQualityOrder:h,playbackRates:v},m.createElement(Be,{locale:c,localeConfig:d},m.createElement(pt,null,m.createElement(Mr,Object.assign({},y,{useAutoQuality:g,standalone:t}))))))))}))},89917:function(e){e.exports=function e(t,r,n){function i(o,s){if(!r[o]){if(!t[o]){if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[o]={exports:{}};t[o][0].call(l.exports,(function(e){return i(t[o][1][e]||e)}),l,l.exports,e,t,r,n)}return r[o].exports}for(var a=void 0,o=0;o<n.length;o++)i(n[o]);return i}({1:[function(e,t,r){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(e){return"function"==typeof e}function a(e){return"object"==typeof e&&null!==e}function o(e){return void 0===e}t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!function(e){return"number"==typeof e}(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,r,n,s,u,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(o(r=this._events[e]))return!1;if(i(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(a(r))for(s=Array.prototype.slice.call(arguments,1),n=(l=r.slice()).length,u=0;u<n;u++)l[u].apply(this,s);return!0},n.prototype.addListener=function(e,t){var r;if(!i(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,i(t.listener)?t.listener:t),this._events[e]?a(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,a(this._events[e])&&!this._events[e].warned&&(r=o(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&r>0&&this._events[e].length>r&&(this._events[e].warned=!0,console.trace),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function r(){this.removeListener(e,r),n||(n=!0,t.apply(this,arguments))}if(!i(t))throw TypeError("listener must be a function");var n=!1;return r.listener=t,this.on(e,r),this},n.prototype.removeListener=function(e,t){var r,n,o,s;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(o=(r=this._events[e]).length,n=-1,r===t||i(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(a(r)){for(s=o;s-- >0;)if(r[s]===t||r[s].listener&&r[s].listener===t){n=s;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[e]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(i(r=this._events[e]))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){return this._events&&this._events[e]?i(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(i(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},{}],2:[function(e,t,r){!function(e){var n=/^((?:[^\/;?#]+:)?)(\/\/[^\/\;?#]*)?(.*?)??(;.*?)?(\?.*?)?(#.*?)?$/,i=/^([^\/;?#]*)(.*)$/,a=/(?:\/|^)\.(?=\/)/g,o=/(?:\/|^)\.\.\/(?!\.\.\/).*?(?=\/)/g,s={buildAbsoluteURL:function(e,t,r){if(r=r||{},e=e.trim(),!(t=t.trim())){if(!r.alwaysNormalize)return e;var n=this.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");return n.path=s.normalizePath(n.path),s.buildURLFromParts(n)}var a=this.parseURL(t);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return r.alwaysNormalize?(a.path=s.normalizePath(a.path),s.buildURLFromParts(a)):t;var o=this.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var u=i.exec(o.path);o.netLoc=u[1],o.path=u[2]}o.netLoc&&!o.path&&(o.path="/");var l={scheme:o.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(l.netLoc=o.netLoc,"/"!==a.path[0]))if(a.path){var c=o.path,d=c.substring(0,c.lastIndexOf("/")+1)+a.path;l.path=s.normalizePath(d)}else l.path=o.path,a.params||(l.params=o.params,a.query||(l.query=o.query));return null===l.path&&(l.path=r.alwaysNormalize?s.normalizePath(a.path):a.path),s.buildURLFromParts(l)},parseURL:function(e){var t=n.exec(e);return t?{scheme:t[1]||"",netLoc:t[2]||"",path:t[3]||"",params:t[4]||"",query:t[5]||"",fragment:t[6]||""}:null},normalizePath:function(e){for(e=e.split("").reverse().join("").replace(a,"");e.length!==(e=e.replace(o,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}};"object"==typeof r&&"object"==typeof t?t.exports=s:"object"==typeof r?r.URLToolkit=s:e.URLToolkit=s}(this)},{}],3:[function(e,t,r){var n=arguments[3],i=arguments[4],a=arguments[5],o=JSON.stringify;t.exports=function(e,t){for(var r,s=Object.keys(a),u=0,l=s.length;u<l;u++){var c=s[u],d=a[c].exports;if(d===e||d&&d.default===e){r=c;break}}if(!r){r=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var f={};for(u=0,l=s.length;u<l;u++)f[c=s[u]]=c;i[r]=[Function(["require","module","exports"],"("+e+")(self)"),f]}var h=Math.floor(Math.pow(16,8)*Math.random()).toString(16),p={};p[r]=r,i[h]=[Function(["require"],"var f = require("+o(r)+");(f.default ? f.default : f)(self);"),p];var v={};!function e(t){for(var r in v[t]=!0,i[t][1]){var n=i[t][1][r];v[n]||e(n)}}(h);var g="("+n+")({"+Object.keys(v).map((function(e){return o(e)+":["+i[e][0]+","+o(i[e][1])+"]"})).join(",")+"},{},["+o(h)+"])",m=window.URL||window.webkitURL||window.mozURL||window.msURL,y=new Blob([g],{type:"text/javascript"});if(t&&t.bare)return y;var b=m.createObjectURL(y),E=new Worker(b);return E.objectURL=b,E}},{}],4:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0}),r.hlsDefaultConfig=void 0;var i=n(e(5)),a=n(e(6)),o=n(e(7)),s=n(e(8)),u=n(e(48));r.hlsDefaultConfig={autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,maxBufferSize:6e7,maxBufferHole:.5,maxSeekHole:2,lowBufferWatchdogPeriod:.5,highBufferWatchdogPeriod:3,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,fragLoadingLoopThreshold:3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:u.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,fetchSetup:void 0,abrController:i.default,bufferController:a.default,capLevelController:o.default,fpsController:s.default,stretchShortVideoTrack:!1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0}},{48:48,5:5,6:6,7:7,8:8}],5:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=n(e(30)),o=n(e(29)),s=n(e(32)),u=e(28),l=e(46),c=n(e(44)),d=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a.default.FRAG_LOADING,a.default.FRAG_LOADED,a.default.FRAG_BUFFERED,a.default.ERROR));return r.lastLoadedFragLevel=0,r._nextAutoLevel=-1,r.hls=e,r.timer=null,r._bwEstimator=null,r.onCheck=r._abandonRulesCheck.bind(r),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"destroy",value:function(){this.clearTimer(),o.default.prototype.destroy.call(this)}},{key:"onFragLoading",value:function(e){var t=e.frag;if("main"===t.type){if(this.timer||(this.timer=setInterval(this.onCheck,100)),!this._bwEstimator){var r=this.hls,n=e.frag.level,i=r.levels[n].details.live,a=r.config,o=void 0,s=void 0;i?(o=a.abrEwmaFastLive,s=a.abrEwmaSlowLive):(o=a.abrEwmaFastVoD,s=a.abrEwmaSlowVoD),this._bwEstimator=new c.default(r,s,o,a.abrEwmaDefaultEstimate)}this.fragCurrent=t}}},{key:"_abandonRulesCheck",value:function(){var e=this.hls,t=e.media,r=this.fragCurrent,n=r.loader,i=e.minAutoLevel;if(!n||n.stats&&n.stats.aborted)return l.logger.warn("frag loader destroy or aborted, disarm abandonRules"),void this.clearTimer();var o=n.stats;if(t&&o&&(!t.paused&&0!==t.playbackRate||!t.readyState)&&r.autoLevel&&r.level){var u=performance.now()-o.trequest,c=Math.abs(t.playbackRate);if(u>500*r.duration/c){var d=e.levels,f=Math.max(1,o.bw?o.bw/8:1e3*o.loaded/u),h=d[r.level],p=h.realBitrate?Math.max(h.realBitrate,h.bitrate):h.bitrate,v=o.total?o.total:Math.max(o.loaded,Math.round(r.duration*p/8)),g=t.currentTime,m=(v-o.loaded)/f,y=(s.default.bufferInfo(t,g,e.config.maxBufferHole).end-g)/c;if(y<2*r.duration/c&&m>y){var b=void 0,E=void 0;for(E=r.level-1;E>i;E--){var S=d[E].realBitrate?Math.max(d[E].realBitrate,d[E].bitrate):d[E].bitrate;if((b=r.duration*S/(6.4*f))<y)break}b<m&&(l.logger.warn("loading too slow, abort fragment loading and switch to level "+E+":fragLoadedDelay["+E+"]<fragLoadedDelay["+(r.level-1)+"];bufferStarvationDelay:"+b.toFixed(1)+"<"+m.toFixed(1)+":"+y.toFixed(1)),e.nextLoadLevel=E,this._bwEstimator.sample(u,o.loaded),n.abort(),this.clearTimer(),e.trigger(a.default.FRAG_LOAD_EMERGENCY_ABORTED,{frag:r,stats:o}))}}}}},{key:"onFragLoaded",value:function(e){var t=e.frag;if("main"===t.type&&!isNaN(t.sn)){if(this.clearTimer(),this.lastLoadedFragLevel=t.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var r=this.hls.levels[t.level],n=(r.loaded?r.loaded.bytes:0)+e.stats.loaded,i=(r.loaded?r.loaded.duration:0)+e.frag.duration;r.loaded={bytes:n,duration:i},r.realBitrate=Math.round(8*n/i)}if(e.frag.bitrateTest){var a=e.stats;a.tparsed=a.tbuffered=a.tload,this.onFragBuffered(e)}}}},{key:"onFragBuffered",value:function(e){var t=e.stats,r=e.frag;if(!(!0===t.aborted||1!==r.loadCounter||"main"!==r.type||isNaN(r.sn)||r.bitrateTest&&t.tload!==t.tbuffered)){var n=t.tparsed-t.trequest;l.logger.log("latency/loading/parsing/append/kbps:"+Math.round(t.tfirst-t.trequest)+"/"+Math.round(t.tload-t.tfirst)+"/"+Math.round(t.tparsed-t.tload)+"/"+Math.round(t.tbuffered-t.tparsed)+"/"+Math.round(8*t.loaded/(t.tbuffered-t.trequest))),this._bwEstimator.sample(n,t.loaded),t.bwEstimate=this._bwEstimator.getEstimate(),r.bitrateTest?this.bitrateTestDelay=n/1e3:this.bitrateTestDelay=0}}},{key:"onError",value:function(e){switch(e.details){case u.ErrorDetails.FRAG_LOAD_ERROR:case u.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer()}}},{key:"clearTimer",value:function(){clearInterval(this.timer),this.timer=null}},{key:"_findBestLevel",value:function(e,t,r,n,i,a,o,s,u){for(var c=i;c>=n;c--){var d,f=u[c].details,h=f?f.totalduration/f.fragments.length:t,p=!!f&&f.live;d=c<=e?o*r:s*r;var v=u[c].realBitrate?Math.max(u[c].realBitrate,u[c].bitrate):u[c].bitrate,g=v*h/d;if(l.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+c+"/"+Math.round(d)+"/"+v+"/"+h+"/"+a+"/"+g),d>v&&(!g||p&&!this.bitrateTestDelay||g<a))return c}return-1}},{key:"nextAutoLevel",get:function(){var e=this._nextAutoLevel,t=this._bwEstimator;if(!(-1===e||t&&t.canEstimate()))return e;var r=this._nextABRAutoLevel;return-1!==e&&(r=Math.min(e,r)),r},set:function(e){this._nextAutoLevel=e}},{key:"_nextABRAutoLevel",get:function(){var e=this.hls,t=e.maxAutoLevel,r=e.levels,n=e.config,i=e.minAutoLevel,a=e.media,o=this.lastLoadedFragLevel,u=this.fragCurrent?this.fragCurrent.duration:0,c=a?a.currentTime:0,d=a&&0!==a.playbackRate?Math.abs(a.playbackRate):1,f=this._bwEstimator?this._bwEstimator.getEstimate():n.abrEwmaDefaultEstimate,h=(s.default.bufferInfo(a,c,n.maxBufferHole).end-c)/d,p=this._findBestLevel(o,u,f,i,t,h,n.abrBandWidthFactor,n.abrBandWidthUpFactor,r);if(p>=0)return p;l.logger.trace("rebuffering expected to happen, lets try to find a quality level minimizing the rebuffering");var v=u?Math.min(u,n.maxStarvationDelay):n.maxStarvationDelay,g=n.abrBandWidthFactor,m=n.abrBandWidthUpFactor;if(0===h){var y=this.bitrateTestDelay;y&&(v=(u?Math.min(u,n.maxLoadingDelay):n.maxLoadingDelay)-y,l.logger.trace("bitrate test took "+Math.round(1e3*y)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*v)+" ms"),g=m=1)}return p=this._findBestLevel(o,u,f,i,t,h+v,g,m,r),Math.max(p,0)}}]),t}(o.default);r.default=d},{28:28,29:29,30:30,32:32,44:44,46:46}],6:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=n(e(30)),o=n(e(29)),s=e(46),u=e(28),l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a.default.MEDIA_ATTACHING,a.default.MEDIA_DETACHING,a.default.MANIFEST_PARSED,a.default.BUFFER_RESET,a.default.BUFFER_APPENDING,a.default.BUFFER_CODECS,a.default.BUFFER_EOS,a.default.BUFFER_FLUSHING,a.default.LEVEL_PTS_UPDATED,a.default.LEVEL_UPDATED));return r._msDuration=null,r._levelDuration=null,r.onsbue=r.onSBUpdateEnd.bind(r),r.onsbe=r.onSBUpdateError.bind(r),r.pendingTracks={},r.tracks={},r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"destroy",value:function(){o.default.prototype.destroy.call(this)}},{key:"onLevelPtsUpdated",value:function(e){var t=e.type,r=this.tracks.audio;if("audio"===t&&r&&"audio/mpeg"===r.container){var n=this.sourceBuffer.audio;if(Math.abs(n.timestampOffset-e.start)>.1){var i=n.updating;try{n.abort()}catch(e){i=!0,s.logger.warn("can not abort audio buffer: "+e)}i?this.audioTimestampOffset=e.start:(s.logger.warn("change mpeg audio timestamp offset from "+n.timestampOffset+" to "+e.start),n.timestampOffset=e.start)}}}},{key:"onManifestParsed",value:function(e){var t=e.audio,r=e.video||e.levels.length&&e.audio,n=0;e.altAudio&&(t||r)&&(n=(t?1:0)+(r?1:0),s.logger.log(n+" sourceBuffer(s) expected")),this.sourceBufferNb=n}},{key:"onMediaAttaching",value:function(e){var t=this.media=e.media;if(t){var r=this.mediaSource=new MediaSource;this.onmso=this.onMediaSourceOpen.bind(this),this.onmse=this.onMediaSourceEnded.bind(this),this.onmsc=this.onMediaSourceClose.bind(this),r.addEventListener("sourceopen",this.onmso),r.addEventListener("sourceended",this.onmse),r.addEventListener("sourceclose",this.onmsc),t.src=URL.createObjectURL(r)}}},{key:"onMediaDetaching",value:function(){s.logger.log("media source detaching");var e=this.mediaSource;if(e){if("open"===e.readyState)try{e.endOfStream()}catch(e){s.logger.warn("onMediaDetaching:"+e.message+" while calling endOfStream")}e.removeEventListener("sourceopen",this.onmso),e.removeEventListener("sourceended",this.onmse),e.removeEventListener("sourceclose",this.onmsc),this.media&&(URL.revokeObjectURL(this.media.src),this.media.removeAttribute("src"),this.media.load()),this.mediaSource=null,this.media=null,this.pendingTracks={},this.tracks={},this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}this.onmso=this.onmse=this.onmsc=null,this.hls.trigger(a.default.MEDIA_DETACHED)}},{key:"onMediaSourceOpen",value:function(){s.logger.log("media source opened"),this.hls.trigger(a.default.MEDIA_ATTACHED,{media:this.media});var e=this.mediaSource;e&&e.removeEventListener("sourceopen",this.onmso),this.checkPendingTracks()}},{key:"checkPendingTracks",value:function(){var e=this.pendingTracks,t=Object.keys(e).length;t&&(this.sourceBufferNb<=t||0===this.sourceBufferNb)&&(this.createSourceBuffers(e),this.pendingTracks={},this.doAppending())}},{key:"onMediaSourceClose",value:function(){s.logger.log("media source closed")}},{key:"onMediaSourceEnded",value:function(){s.logger.log("media source ended")}},{key:"onSBUpdateEnd",value:function(){if(this.audioTimestampOffset){var e=this.sourceBuffer.audio;s.logger.warn("change mpeg audio timestamp offset from "+e.timestampOffset+" to "+this.audioTimestampOffset),e.timestampOffset=this.audioTimestampOffset,delete this.audioTimestampOffset}this._needsFlush&&this.doFlush(),this._needsEos&&this.checkEos(),this.appending=!1;var t=this.parent,r=this.segments.reduce((function(e,r){return r.parent===t?e+1:e}),0);this.hls.trigger(a.default.BUFFER_APPENDED,{parent:t,pending:r}),this._needsFlush||this.doAppending(),this.updateMediaElementDuration()}},{key:"onSBUpdateError",value:function(e){s.logger.error("sourceBuffer error:",e),this.hls.trigger(a.default.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})}},{key:"onBufferReset",value:function(){var e=this.sourceBuffer;for(var t in e){var r=e[t];try{this.mediaSource.removeSourceBuffer(r),r.removeEventListener("updateend",this.onsbue),r.removeEventListener("error",this.onsbe)}catch(e){}}this.sourceBuffer={},this.flushRange=[],this.segments=[],this.appended=0}},{key:"onBufferCodecs",value:function(e){if(0===Object.keys(this.sourceBuffer).length){for(var t in e)this.pendingTracks[t]=e[t];var r=this.mediaSource;r&&"open"===r.readyState&&this.checkPendingTracks()}}},{key:"createSourceBuffers",value:function(e){var t=this.sourceBuffer,r=this.mediaSource;for(var n in e)if(!t[n]){var i=e[n],o=i.levelCodec||i.codec,l=i.container+";codecs="+o;s.logger.log("creating sourceBuffer("+l+")");try{var c=t[n]=r.addSourceBuffer(l);c.addEventListener("updateend",this.onsbue),c.addEventListener("error",this.onsbe),this.tracks[n]={codec:o,container:i.container},i.buffer=c}catch(e){s.logger.error("error while trying to add sourceBuffer:"+e.message),this.hls.trigger(a.default.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,err:e,mimeType:l})}}this.hls.trigger(a.default.BUFFER_CREATED,{tracks:e})}},{key:"onBufferAppending",value:function(e){this._needsFlush||(this.segments?this.segments.push(e):this.segments=[e],this.doAppending())}},{key:"onBufferAppendFail",value:function(e){s.logger.error("sourceBuffer error:",e.event),this.hls.trigger(a.default.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1})}},{key:"onBufferEos",value:function(e){var t=this.sourceBuffer,r=e.type;for(var n in t)r&&n!==r||t[n].ended||(t[n].ended=!0,s.logger.log(n+" sourceBuffer now EOS"));this.checkEos()}},{key:"checkEos",value:function(){var e=this.sourceBuffer,t=this.mediaSource;if(t&&"open"===t.readyState){for(var r in e){var n=e[r];if(!n.ended)return;if(n.updating)return void(this._needsEos=!0)}s.logger.log("all media data available, signal endOfStream() to MediaSource and stop loading fragment");try{t.endOfStream()}catch(e){s.logger.warn("exception while calling mediaSource.endOfStream()")}this._needsEos=!1}else this._needsEos=!1}},{key:"onBufferFlushing",value:function(e){this.flushRange.push({start:e.startOffset,end:e.endOffset,type:e.type}),this.flushBufferCounter=0,this.doFlush()}},{key:"onLevelUpdated",value:function(e){var t=e.details;0!==t.fragments.length&&(this._levelDuration=t.totalduration+t.fragments[0].start,this.updateMediaElementDuration())}},{key:"updateMediaElementDuration",value:function(){var e=this.media,t=this.mediaSource,r=this.sourceBuffer,n=this._levelDuration;if(null!==n&&e&&t&&r&&0!==e.readyState&&"open"===t.readyState){for(var i in r)if(r[i].updating)return;null===this._msDuration&&(this._msDuration=t.duration);var a=e.duration;(n>this._msDuration&&n>a||a===1/0||isNaN(a))&&(s.logger.log("Updating mediasource duration to "+n.toFixed(3)),this._msDuration=t.duration=n)}}},{key:"doFlush",value:function(){for(;this.flushRange.length;){var e=this.flushRange[0];if(!this.flushBuffer(e.start,e.end,e.type))return void(this._needsFlush=!0);this.flushRange.shift(),this.flushBufferCounter=0}if(0===this.flushRange.length){this._needsFlush=!1;var t=0,r=this.sourceBuffer;try{for(var n in r)t+=r[n].buffered.length}catch(e){s.logger.error("error while accessing sourceBuffer.buffered")}this.appended=t,this.hls.trigger(a.default.BUFFER_FLUSHED)}}},{key:"doAppending",value:function(){var e=this.hls,t=this.sourceBuffer,r=this.segments;if(Object.keys(t).length){if(this.media.error)return this.segments=[],void s.logger.error("trying to append although a media error occured, flush segment and abort");if(this.appending)return;if(r&&r.length){var n=r.shift();try{var i=t[n.type];i?i.updating?r.unshift(n):(i.ended=!1,this.parent=n.parent,i.appendBuffer(n.data),this.appendError=0,this.appended++,this.appending=!0):this.onSBUpdateEnd()}catch(t){s.logger.error("error while trying to append buffer:"+t.message),r.unshift(n);var o={type:u.ErrorTypes.MEDIA_ERROR,parent:n.parent};if(22===t.code)return this.segments=[],o.details=u.ErrorDetails.BUFFER_FULL_ERROR,o.fatal=!1,void e.trigger(a.default.ERROR,o);if(this.appendError?this.appendError++:this.appendError=1,o.details=u.ErrorDetails.BUFFER_APPEND_ERROR,this.appendError>e.config.appendErrorMaxRetry)return s.logger.log("fail "+e.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),r=[],o.fatal=!0,void e.trigger(a.default.ERROR,o);o.fatal=!1,e.trigger(a.default.ERROR,o)}}}}},{key:"flushBuffer",value:function(e,t,r){var n,i,a,o,u,l,c=this.sourceBuffer;if(Object.keys(c).length){if(s.logger.log("flushBuffer,pos/start/end: "+this.media.currentTime.toFixed(3)+"/"+e+"/"+t),this.flushBufferCounter<this.appended){for(var d in c)if(!r||d===r){if((n=c[d]).ended=!1,n.updating)return s.logger.warn("cannot flush, sb updating in progress"),!1;try{for(i=0;i<n.buffered.length;i++)if(a=n.buffered.start(i),o=n.buffered.end(i),-1!==navigator.userAgent.toLowerCase().indexOf("firefox")&&t===Number.POSITIVE_INFINITY?(u=e,l=t):(u=Math.max(a,e),l=Math.min(o,t)),Math.min(l,o)-u>.5)return this.flushBufferCounter++,s.logger.log("flush "+d+" ["+u+","+l+"], of ["+a+","+o+"], pos:"+this.media.currentTime),n.remove(u,l),!1}catch(e){s.logger.warn("exception while accessing sourcebuffer, it might have been removed from MediaSource")}}}else s.logger.warn("abort flushing too many retries");s.logger.log("buffer flushed")}return!0}}]),t}(o.default);r.default=l},{28:28,29:29,30:30,46:46}],7:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=n(e(30)),o=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a.default.FPS_DROP_LEVEL_CAPPING,a.default.MEDIA_ATTACHING,a.default.MANIFEST_PARSED))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"destroy",value:function(){this.hls.config.capLevelToPlayerSize&&(this.media=this.restrictedLevels=null,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(this.timer=clearInterval(this.timer)))}},{key:"onFpsDropLevelCapping",value:function(e){t.isLevelAllowed(e.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(e.droppedLevel)}},{key:"onMediaAttaching",value:function(e){this.media=e.media instanceof HTMLVideoElement?e.media:null}},{key:"onManifestParsed",value:function(e){var t=this.hls;this.restrictedLevels=[],t.config.capLevelToPlayerSize&&(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.levels=e.levels,t.firstLevel=this.getMaxLevel(e.firstLevel),clearInterval(this.timer),this.timer=setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}},{key:"detectPlayerSize",value:function(){if(this.media){var e=this.levels?this.levels.length:0;if(e){var t=this.hls;t.autoLevelCapping=this.getMaxLevel(e-1),t.autoLevelCapping>this.autoLevelCapping&&t.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}},{key:"getMaxLevel",value:function(e){var r=this;if(!this.levels)return-1;var n=this.levels.filter((function(n,i){return t.isLevelAllowed(i,r.restrictedLevels)&&i<=e}));return t.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)}},{key:"mediaWidth",get:function(){var e=void 0,r=this.media;return r&&(e=r.width||r.clientWidth||r.offsetWidth,e*=t.contentScaleFactor),e}},{key:"mediaHeight",get:function(){var e=void 0,r=this.media;return r&&(e=r.height||r.clientHeight||r.offsetHeight,e*=t.contentScaleFactor),e}}],[{key:"isLevelAllowed",value:function(e){return-1===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).indexOf(e)}},{key:"getMaxLevelByMediaSize",value:function(e,t,r){if(!e||e&&!e.length)return-1;for(var n=e.length-1,i=0;i<e.length;i+=1){var a=e[i];if((a.width>=t||a.height>=r)&&function(e,t){return!t||e.width!==t.width||e.height!==t.height}(a,e[i+1])){n=i;break}}return n}},{key:"contentScaleFactor",get:function(){var e=1;try{e=window.devicePixelRatio}catch(e){}return e}}]),t}(n(e(29)).default);r.default=o},{29:29,30:30}],8:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=n(e(30)),o=n(e(29)),s=e(46),u=function(e){function t(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a.default.MEDIA_ATTACHING))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"destroy",value:function(){this.timer&&clearInterval(this.timer),this.isVideoPlaybackQualityAvailable=!1}},{key:"onMediaAttaching",value:function(e){var t=this.hls.config;t.capLevelOnFPSDrop&&("function"==typeof(this.video=e.media instanceof HTMLVideoElement?e.media:null).getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),clearInterval(this.timer),this.timer=setInterval(this.checkFPSInterval.bind(this),t.fpsDroppedMonitoringPeriod))}},{key:"checkFPS",value:function(e,t,r){var n=performance.now();if(t){if(this.lastTime){var i=n-this.lastTime,o=r-this.lastDroppedFrames,u=t-this.lastDecodedFrames,l=1e3*o/i,c=this.hls;if(c.trigger(a.default.FPS_DROP,{currentDropped:o,currentDecoded:u,totalDroppedFrames:r}),l>0&&o>c.config.fpsDroppedMonitoringThreshold*u){var d=c.currentLevel;s.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+d),d>0&&(-1===c.autoLevelCapping||c.autoLevelCapping>=d)&&(d-=1,c.trigger(a.default.FPS_DROP_LEVEL_CAPPING,{level:d,droppedLevel:c.currentLevel}),c.autoLevelCapping=d,c.streamController.nextLevelSwitch())}}this.lastTime=n,this.lastDroppedFrames=r,this.lastDecodedFrames=t}}},{key:"checkFPSInterval",value:function(){var e=this.video;if(e)if(this.isVideoPlaybackQualityAvailable){var t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}]),t}(o.default);r.default=u},{29:29,30:30,46:46}],9:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=n(e(30)),o=n(e(29)),s=n(e(22)),u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a.default.MEDIA_ATTACHED,a.default.MEDIA_DETACHING,a.default.FRAG_PARSING_METADATA));return r.id3Track=void 0,r.media=void 0,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"destroy",value:function(){o.default.prototype.destroy.call(this)}},{key:"onMediaAttached",value:function(e){this.media=e.media,this.media&&(this.id3Track=this.media.addTextTrack("metadata","id3"),this.id3Track.mode="hidden")}},{key:"onMediaDetaching",value:function(){this.media=void 0}},{key:"onFragParsingMetadata",value:function(e){for(var t=e.frag,r=e.samples,n=window.WebKitDataCue||window.VTTCue||window.TextTrackCue,i=0;i<r.length;i++){var a=s.default.getID3Frames(r[i].data);if(a){var o=r[i].pts,u=i<r.length-1?r[i+1].pts:t.endPTS;o===u&&(u+=1e-4);for(var l=0;l<a.length;l++){var c=a[l];if(!s.default.isTimeStampFrame(c)){var d=new n(o,u,"");d.value=c,this.id3Track.addCue(d)}}}}}}]),t}(o.default);r.default=u},{22:22,29:29,30:30}],10:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=n(e(30)),o=n(e(29)),s=e(46),u=e(28),l=n(e(32)),c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a.default.MANIFEST_LOADED,a.default.LEVEL_LOADED,a.default.FRAG_LOADED,a.default.ERROR));return r.ontick=r.tick.bind(r),r._manualLevel=-1,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"destroy",value:function(){this.cleanTimer(),this._manualLevel=-1}},{key:"cleanTimer",value:function(){this.timer&&(clearTimeout(this.timer),this.timer=null)}},{key:"startLoad",value:function(){this.canload=!0;var e=this._levels;e&&e.forEach((function(e){e.loadError=0;var t=e.details;t&&t.live&&(e.details=void 0)})),this.timer&&this.tick()}},{key:"stopLoad",value:function(){this.canload=!1}},{key:"onManifestLoaded",value:function(e){var t,r=[],n=[],i={},o=!1,l=!1,c=this.hls,d=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),f=function(e,t){return MediaSource.isTypeSupported(e+"/mp4;codecs="+t)};if(e.levels.forEach((function(e){e.videoCodec&&(o=!0),d&&e.audioCodec&&-1!==e.audioCodec.indexOf("mp4a.40.34")&&(e.audioCodec=void 0),(e.audioCodec||e.attrs&&e.attrs.AUDIO)&&(l=!0);var t=i[e.bitrate];void 0===t?(i[e.bitrate]=r.length,e.url=[e.url],e.urlId=0,r.push(e)):r[t].url.push(e.url)})),o&&l?r.forEach((function(e){e.videoCodec&&n.push(e)})):n=r,(n=n.filter((function(e){var t=e.audioCodec,r=e.videoCodec;return(!t||f("audio",t))&&(!r||f("video",r))}))).length){t=n[0].bitrate,n.sort((function(e,t){return e.bitrate-t.bitrate})),this._levels=n;for(var h=0;h<n.length;h++)if(n[h].bitrate===t){this._firstLevel=h,s.logger.log("manifest loaded,"+n.length+" level(s) found, first bitrate:"+t);break}c.trigger(a.default.MANIFEST_PARSED,{levels:n,firstLevel:this._firstLevel,stats:e.stats,audio:l,video:o,altAudio:e.audioTracks.length>0})}else c.trigger(a.default.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:c.url,reason:"no level with compatible codecs found in manifest"})}},{key:"setLevelInternal",value:function(e){var t=this._levels,r=this.hls;if(e>=0&&e<t.length){if(this.cleanTimer(),this._level!==e){s.logger.log("switching to level "+e),this._level=e;var n=t[e];n.level=e,r.trigger(a.default.LEVEL_SWITCH,n),r.trigger(a.default.LEVEL_SWITCHING,n)}var i=t[e],o=i.details;if(!o||!0===o.live){var l=i.urlId;r.trigger(a.default.LEVEL_LOADING,{url:i.url[l],level:e,id:l})}}else r.trigger(a.default.ERROR,{type:u.ErrorTypes.OTHER_ERROR,details:u.ErrorDetails.LEVEL_SWITCH_ERROR,level:e,fatal:!1,reason:"invalid level idx"})}},{key:"onError",value:function(e){if(e.fatal)e.type===u.ErrorTypes.NETWORK_ERROR&&this.cleanTimer();else{var t=e.details,r=this.hls,n=void 0,i=void 0,a=!1;switch(t){case u.ErrorDetails.FRAG_LOAD_ERROR:case u.ErrorDetails.FRAG_LOAD_TIMEOUT:case u.ErrorDetails.FRAG_LOOP_LOADING_ERROR:case u.ErrorDetails.KEY_LOAD_ERROR:case u.ErrorDetails.KEY_LOAD_TIMEOUT:n=e.frag.level;break;case u.ErrorDetails.LEVEL_LOAD_ERROR:case u.ErrorDetails.LEVEL_LOAD_TIMEOUT:n=e.context.level,a=!0;break;case u.ErrorDetails.REMUX_ALLOC_ERROR:n=e.level}if(void 0!==n){(i=this._levels[n]).loadError?i.loadError++:i.loadError=1;var o=i.url.length;if(o>1&&i.loadError<o)i.urlId=(i.urlId+1)%o,i.details=void 0,s.logger.warn("level controller,"+t+" for level "+n+": switching to redundant stream id "+i.urlId);else if(-1===this._manualLevel&&n)s.logger.warn("level controller,"+t+": switch-down for next fragment"),r.nextAutoLevel=Math.max(0,n-1);else if(i&&i.details&&i.details.live)s.logger.warn("level controller,"+t+" on live stream, discard"),a&&(this._level=void 0);else if(t===u.ErrorDetails.LEVEL_LOAD_ERROR||t===u.ErrorDetails.LEVEL_LOAD_TIMEOUT){var c=r.media;if(c&&l.default.isBuffered(c,c.currentTime)&&l.default.isBuffered(c,c.currentTime+.5)){var d=r.config.levelLoadingRetryDelay;s.logger.warn("level controller,"+t+", but media buffered, retry in "+d+"ms"),this.timer=setTimeout(this.ontick,d),e.levelRetry=!0}else s.logger.error("cannot recover "+t+" error"),this._level=void 0,this.cleanTimer(),e.fatal=!0}}}}},{key:"onFragLoaded",value:function(e){var t=e.frag;if(t&&"main"===t.type){var r=this._levels[t.level];r&&(r.loadError=0)}}},{key:"onLevelLoaded",value:function(e){var t=e.level;if(t===this._level){var r=this._levels[t];r.loadError=0;var n=e.details;if(n.live){var i=1e3*(n.averagetargetduration?n.averagetargetduration:n.targetduration),a=r.details;a&&n.endSN===a.endSN&&(i/=2,s.logger.log("same live playlist, reload twice faster")),i-=performance.now()-e.stats.trequest,i=Math.max(1e3,Math.round(i)),s.logger.log("live playlist, reload in "+i+" ms"),this.timer=setTimeout(this.ontick,i)}else this.timer=null}}},{key:"tick",value:function(){var e=this._level;if(void 0!==e&&this.canload){var t=this._levels[e];if(t&&t.url){var r=t.urlId;this.hls.trigger(a.default.LEVEL_LOADING,{url:t.url[r],level:e,id:r})}}}},{key:"levels",get:function(){return this._levels}},{key:"level",get:function(){return this._level},set:function(e){var t=this._levels;t&&t.length>e&&(this._level===e&&void 0!==t[e].details||this.setLevelInternal(e))}},{key:"manualLevel",get:function(){return this._manualLevel},set:function(e){this._manualLevel=e,void 0===this._startLevel&&(this._startLevel=e),-1!==e&&(this.level=e)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(e){this._firstLevel=e}},{key:"startLevel",get:function(){if(void 0===this._startLevel){var e=this.hls.config.startLevel;return void 0!==e?e:this._firstLevel}return this._startLevel},set:function(e){this._startLevel=e}},{key:"nextLoadLevel",get:function(){return-1!==this._manualLevel?this._manualLevel:this.hls.nextAutoLevel},set:function(e){this.level=e,-1===this._manualLevel&&(this.hls.nextAutoLevel=e)}}]),t}(o.default);r.default=c},{28:28,29:29,30:30,32:32,46:46}],11:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=n(e(43)),o=n(e(32)),s=n(e(20)),u=n(e(30)),l=n(e(29)),c=n(e(33)),d=n(e(47)),f=e(28),h=e(46),p="STOPPED",v="IDLE",g="KEY_LOADING",m="FRAG_LOADING",y="FRAG_LOADING_WAITING_RETRY",b="WAITING_LEVEL",E="PARSING",S="PARSED",T="BUFFER_FLUSHING",w="ENDED",_="ERROR",L=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,u.default.MEDIA_ATTACHED,u.default.MEDIA_DETACHING,u.default.MANIFEST_LOADING,u.default.MANIFEST_PARSED,u.default.LEVEL_LOADED,u.default.KEY_LOADED,u.default.FRAG_LOADED,u.default.FRAG_LOAD_EMERGENCY_ABORTED,u.default.FRAG_PARSING_INIT_SEGMENT,u.default.FRAG_PARSING_DATA,u.default.FRAG_PARSED,u.default.ERROR,u.default.AUDIO_TRACK_SWITCHING,u.default.AUDIO_TRACK_SWITCHED,u.default.BUFFER_CREATED,u.default.BUFFER_APPENDED,u.default.BUFFER_FLUSHED));return r.config=e.config,r.audioCodecSwap=!1,r.ticks=0,r._state=p,r.ontick=r.tick.bind(r),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"destroy",value:function(){this.stopLoad(),this.timer&&(clearInterval(this.timer),this.timer=null),l.default.prototype.destroy.call(this),this.state=p}},{key:"startLoad",value:function(e){if(this.levels){var t=this.lastCurrentTime,r=this.hls;if(this.stopLoad(),this.timer||(this.timer=setInterval(this.ontick,100)),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var n=r.startLevel;-1===n&&(n=0,this.bitrateTest=!0),this.level=r.nextLoadLevel=n,this.loadedmetadata=!1}t>0&&-1===e&&(h.logger.log("override startPosition with lastCurrentTime @"+t.toFixed(3)),e=t),this.state=v,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this.forceStartLoad=!0,this.state=p}},{key:"stopLoad",value:function(){var e=this.fragCurrent;e&&(e.loader&&e.loader.abort(),this.fragCurrent=null),this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=p,this.forceStartLoad=!1}},{key:"tick",value:function(){1==++this.ticks&&(this.doTick(),this.ticks>1&&setTimeout(this.tick,1),this.ticks=0)}},{key:"doTick",value:function(){switch(this.state){case _:break;case T:this.fragLoadError=0;break;case v:this._doTickIdle();break;case b:var e=this.levels[this.level];e&&e.details&&(this.state=v);break;case y:var t=performance.now(),r=this.retryDate;(!r||t>=r||this.media&&this.media.seeking)&&(h.logger.log("mediaController: retryDate reached, switch back to IDLE state"),this.state=v)}this._checkBuffer(),this._checkFragmentChanged()}},{key:"_doTickIdle",value:function(){var e=this.hls,t=e.config,r=this.media;if(void 0===this.levelLastLoaded||r||!this.startFragRequested&&t.startFragPrefetch){var n;n=this.loadedmetadata?r.currentTime:this.nextLoadPosition;var i=e.nextLoadLevel,a=this.levels[i];if(a){var s=a.bitrate,l=void 0;l=s?Math.max(8*t.maxBufferSize/s,t.maxBufferLength):t.maxBufferLength,l=Math.min(l,t.maxMaxBufferLength);var c=o.default.bufferInfo(this.mediaBuffer?this.mediaBuffer:r,n,t.maxBufferHole),d=c.len;if(!(d>=l)){h.logger.trace("buffer length of "+d.toFixed(3)+" is below max of "+l.toFixed(3)+". checking for more payload ..."),this.level=e.nextLoadLevel=i;var f=a.details;if(void 0===f||f.live&&this.levelLastLoaded!==i)this.state=b;else{var p=this.fragPrevious;if(!f.live&&p&&p.sn===f.endSN&&d&&!c.nextStart&&Math.min(r.duration,p.start+p.duration)-Math.max(c.end,p.start)<=Math.max(.2,p.duration)){var v={};return this.altAudio&&(v.type="video"),this.hls.trigger(u.default.BUFFER_EOS,v),void(this.state=w)}this._fetchPayloadOrEos(n,c,f)}}}}}},{key:"_fetchPayloadOrEos",value:function(e,t,r){var n=this.fragPrevious,i=this.level,a=r.fragments,o=a.length;if(0!==o){var s=a[0].start,u=a[o-1].start+a[o-1].duration,l=t.end,c=void 0;if(r.initSegment&&!r.initSegment.data)c=r.initSegment;else if(r.live){var d=this.config.initialLiveManifestSize;if(o<d)return void h.logger.warn("Can not start playback of a level, reason: not enough fragments "+o+" < "+d);if(null===(c=this._ensureFragmentAtLivePoint(r,l,s,u,n,a,o)))return}else l<s&&(c=a[0]);c||(c=this._findFragment(s,n,o,a,l,u,r)),c&&this._loadFragmentOrKey(c,i,r,e,l)}}},{key:"_ensureFragmentAtLivePoint",value:function(e,t,r,n,i,o,s){var u=this.hls.config,l=this.media,c=void 0,d=void 0!==u.liveMaxLatencyDuration?u.liveMaxLatencyDuration:u.liveMaxLatencyDurationCount*e.targetduration;if(t<Math.max(r-u.maxFragLookUpTolerance,n-d)){var f=this.liveSyncPosition=this.computeLivePosition(r,e);h.logger.log("buffer end: "+t.toFixed(3)+" is located too far from the end of live sliding playlist, reset currentTime to : "+f.toFixed(3)),t=f,l&&l.readyState&&l.duration>f&&(l.currentTime=f),this.nextLoadPosition=f}if(e.PTSKnown&&t>n&&l&&l.readyState)return null;if(this.startFragRequested&&!e.PTSKnown){if(i){var p=i.sn+1;if(p>=e.startSN&&p<=e.endSN){var v=o[p-e.startSN];i.cc===v.cc&&(c=v,h.logger.log("live playlist, switching playlist, load frag with next SN: "+c.sn))}c||(c=a.default.search(o,(function(e){return i.cc-e.cc})))&&h.logger.log("live playlist, switching playlist, load frag with same CC: "+c.sn)}c||(c=o[Math.min(s-1,Math.round(s/2))],h.logger.log("live playlist, switching playlist, unknown, load middle frag : "+c.sn))}return c}},{key:"_findFragment",value:function(e,t,r,n,i,o,s){var u=this.hls.config,l=void 0,c=void 0,d=u.maxFragLookUpTolerance,f=t?n[t.sn-n[0].sn+1]:void 0,p=function(e){var t=Math.min(d,e.duration);return e.start+e.duration-t<=i?1:e.start-t>i&&e.start?-1:0};if(i<o?(i>o-d&&(d=0),c=f&&!p(f)?f:a.default.search(n,p)):c=n[r-1],c){var v=(l=c).sn-s.startSN,g=t&&l.level===t.level,m=n[v-1],y=n[v+1];if(t&&l.sn===t.sn)if(g&&!l.backtracked)if(l.sn<s.endSN){var b=t.deltaPTS;b&&b>u.maxBufferHole&&t.dropped&&v?(l=m,h.logger.warn("SN just loaded, with large PTS gap between audio and video, maybe frag is not starting with a keyframe ? load previous one to try to overcome this"),t.loadCounter--):(l=y,h.logger.log("SN just loaded, load next one: "+l.sn))}else l=null;else l.backtracked&&(y&&y.backtracked?(h.logger.warn("Already backtracked from fragment "+y.sn+", will not backtrack to fragment "+l.sn+". Loading fragment "+y.sn),l=y):(h.logger.warn("Loaded fragment with dropped frames, backtracking 1 segment to find a keyframe"),l.dropped=0,m?(m.loadCounter&&m.loadCounter--,(l=m).backtracked=!0):v&&(l=null)))}return l}},{key:"_loadFragmentOrKey",value:function(e,t,r,n,i){var a=this.hls,o=a.config;if(!e.decryptdata||null==e.decryptdata.uri||null!=e.decryptdata.key){if(h.logger.log("Loading "+e.sn+" of ["+r.startSN+" ,"+r.endSN+"],level "+t+", currentTime:"+n.toFixed(3)+",bufferEnd:"+i.toFixed(3)),void 0!==this.fragLoadIdx?this.fragLoadIdx++:this.fragLoadIdx=0,e.loadCounter){e.loadCounter++;var l=o.fragLoadingLoopThreshold;if(e.loadCounter>l&&Math.abs(this.fragLoadIdx-e.loadIdx)<l)return void a.trigger(u.default.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_LOOP_LOADING_ERROR,fatal:!1,frag:e})}else e.loadCounter=1;return e.loadIdx=this.fragLoadIdx,this.fragCurrent=e,this.startFragRequested=!0,isNaN(e.sn)||(this.nextLoadPosition=e.start+e.duration),e.autoLevel=a.autoLevelEnabled,e.bitrateTest=this.bitrateTest,a.trigger(u.default.FRAG_LOADING,{frag:e}),this.demuxer||(this.demuxer=new s.default(a,"main")),void(this.state=m)}h.logger.log("Loading key for "+e.sn+" of ["+r.startSN+" ,"+r.endSN+"],level "+t),this.state=g,a.trigger(u.default.KEY_LOADING,{frag:e})}},{key:"getBufferedFrag",value:function(e){return a.default.search(this._bufferedFrags,(function(t){return e<t.startPTS?-1:e>t.endPTS?1:0}))}},{key:"followingBufferedFrag",value:function(e){return e?this.getBufferedFrag(e.endPTS+.5):null}},{key:"_checkFragmentChanged",value:function(){var e,t,r=this.media;if(r&&r.readyState&&!1===r.seeking&&((t=r.currentTime)>r.playbackRate*this.lastCurrentTime&&(this.lastCurrentTime=t),o.default.isBuffered(r,t)?e=this.getBufferedFrag(t):o.default.isBuffered(r,t+.1)&&(e=this.getBufferedFrag(t+.1)),e)){var n=e;if(n!==this.fragPlaying){this.hls.trigger(u.default.FRAG_CHANGED,{frag:n});var i=n.level;this.fragPlaying&&this.fragPlaying.level===i||this.hls.trigger(u.default.LEVEL_SWITCHED,{level:i}),this.fragPlaying=n}}}},{key:"immediateLevelSwitch",value:function(){if(h.logger.log("immediateLevelSwitch"),!this.immediateSwitch){this.immediateSwitch=!0;var e=this.media,t=void 0;e?(t=e.paused,e.pause()):t=!0,this.previouslyPaused=t}var r=this.fragCurrent;r&&r.loader&&r.loader.abort(),this.fragCurrent=null,this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}},{key:"immediateLevelSwitchEnd",value:function(){var e=this.media;e&&e.buffered.length&&(this.immediateSwitch=!1,o.default.isBuffered(e,e.currentTime)&&(e.currentTime-=1e-4),this.previouslyPaused||e.play())}},{key:"nextLevelSwitch",value:function(){var e=this.media;if(e&&e.readyState){var t,r=void 0,n=void 0;if(this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold,(t=this.getBufferedFrag(e.currentTime))&&t.startPTS>1&&this.flushMainBuffer(0,t.startPTS-1),e.paused)r=0;else{var i=this.hls.nextLoadLevel,a=this.levels[i],o=this.fragLastKbps;r=o&&this.fragCurrent?this.fragCurrent.duration*a.bitrate/(1e3*o)+1:0}if((n=this.getBufferedFrag(e.currentTime+r))&&(n=this.followingBufferedFrag(n))){var s=this.fragCurrent;s&&s.loader&&s.loader.abort(),this.fragCurrent=null,this.flushMainBuffer(n.maxStartPTS,Number.POSITIVE_INFINITY)}}}},{key:"flushMainBuffer",value:function(e,t){this.state=T;var r={startOffset:e,endOffset:t};this.altAudio&&(r.type="video"),this.hls.trigger(u.default.BUFFER_FLUSHING,r)}},{key:"onMediaAttached",value:function(e){var t=this.media=this.mediaBuffer=e.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),this.onvended=this.onMediaEnded.bind(this),t.addEventListener("seeking",this.onvseeking),t.addEventListener("seeked",this.onvseeked),t.addEventListener("ended",this.onvended);var r=this.config;this.levels&&r.autoStartLoad&&this.hls.startLoad(r.startPosition)}},{key:"onMediaDetaching",value:function(){var e=this.media;e&&e.ended&&(h.logger.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0);var t=this.levels;t&&t.forEach((function(e){e.details&&e.details.fragments.forEach((function(e){e.loadCounter=void 0,e.backtracked=void 0}))})),e&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("seeked",this.onvseeked),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvseeked=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.stopLoad()}},{key:"onMediaSeeking",value:function(){var e=this.media,t=e?e.currentTime:void 0,r=this.config;isNaN(t)||h.logger.log("media seeking to "+t.toFixed(3));var n=this.mediaBuffer?this.mediaBuffer:e,i=o.default.bufferInfo(n,t,this.config.maxBufferHole);if(this.state===m){var a=this.fragCurrent;if(0===i.len&&a){var s=r.maxFragLookUpTolerance,u=a.start-s,l=a.start+a.duration+s;t<u||t>l?(a.loader&&(h.logger.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),a.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.state=v):h.logger.log("seeking outside of buffer but within currently loaded fragment range")}}else this.state===w&&(0===i.len&&(this.fragPrevious=0),this.state=v);e&&(this.lastCurrentTime=t),this.state!==m&&void 0!==this.fragLoadIdx&&(this.fragLoadIdx+=2*r.fragLoadingLoopThreshold),this.loadedmetadata||(this.nextLoadPosition=this.startPosition=t),this.tick()}},{key:"onMediaSeeked",value:function(){var e=this.media,t=e?e.currentTime:void 0;isNaN(t)||h.logger.log("media seeked to "+t.toFixed(3)),this.tick()}},{key:"onMediaEnded",value:function(){h.logger.log("media ended"),this.startPosition=this.lastCurrentTime=0}},{key:"onManifestLoading",value:function(){h.logger.log("trigger BUFFER_RESET"),this.hls.trigger(u.default.BUFFER_RESET),this._bufferedFrags=[],this.stalled=!1,this.startPosition=this.lastCurrentTime=0}},{key:"onManifestParsed",value:function(e){var t,r=!1,n=!1;e.levels.forEach((function(e){(t=e.audioCodec)&&(-1!==t.indexOf("mp4a.40.2")&&(r=!0),-1!==t.indexOf("mp4a.40.5")&&(n=!0))})),this.audioCodecSwitch=r&&n,this.audioCodecSwitch&&h.logger.log("both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=e.levels,this.startLevelLoaded=!1,this.startFragRequested=!1;var i=this.config;(i.autoStartLoad||this.forceStartLoad)&&this.hls.startLoad(i.startPosition)}},{key:"onLevelLoaded",value:function(e){var t=e.details,r=e.level,n=this.levels[r],i=t.totalduration,a=0;if(h.logger.log("level "+r+" loaded ["+t.startSN+","+t.endSN+"],duration:"+i),this.levelLastLoaded=r,t.live){var o=n.details;o&&t.fragments.length>0?(c.default.mergeDetails(o,t),a=t.fragments[0].start,this.liveSyncPosition=this.computeLivePosition(a,o),t.PTSKnown?h.logger.log("live playlist sliding:"+a.toFixed(3)):h.logger.log("live playlist - outdated PTS, unknown sliding")):(t.PTSKnown=!1,h.logger.log("live playlist - first load, unknown sliding"))}else t.PTSKnown=!1;if(n.details=t,this.hls.trigger(u.default.LEVEL_UPDATED,{details:t,level:r}),!1===this.startFragRequested){if(-1===this.startPosition||-1===this.lastCurrentTime){var s=t.startTimeOffset;isNaN(s)?t.live?(this.startPosition=this.computeLivePosition(a,t),h.logger.log("configure startPosition to "+this.startPosition)):this.startPosition=0:(s<0&&(h.logger.log("negative start time offset "+s+", count from end of last fragment"),s=a+i+s),h.logger.log("start time offset found in playlist, adjust startPosition to "+s),this.startPosition=s),this.lastCurrentTime=this.startPosition}this.nextLoadPosition=this.startPosition}this.state===b&&(this.state=v),this.tick()}},{key:"onKeyLoaded",value:function(){this.state===g&&(this.state=v,this.tick())}},{key:"onFragLoaded",value:function(e){var t=this.fragCurrent,r=e.frag;if(this.state===m&&t&&"main"===r.type&&r.level===t.level&&r.sn===t.sn){var n=e.stats,i=this.levels[t.level],a=i.details;if(h.logger.log("Loaded "+t.sn+" of ["+a.startSN+" ,"+a.endSN+"],level "+t.level),this.bitrateTest=!1,this.stats=n,!0===r.bitrateTest&&this.hls.nextLoadLevel)this.state=v,this.startFragRequested=!1,n.tparsed=n.tbuffered=performance.now(),this.hls.trigger(u.default.FRAG_BUFFERED,{stats:n,frag:t,id:"main"}),this.tick();else if("initSegment"===r.sn)this.state=v,n.tparsed=n.tbuffered=performance.now(),a.initSegment.data=e.payload,this.hls.trigger(u.default.FRAG_BUFFERED,{stats:n,frag:t,id:"main"}),this.tick();else{this.state=E;var o=a.totalduration,l=t.level,c=t.sn,d=this.config.defaultAudioCodec||i.audioCodec;this.audioCodecSwap&&(h.logger.log("swapping playlist audio codec"),void 0===d&&(d=this.lastAudioCodec),d&&(d=-1!==d.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5")),this.pendingBuffering=!0,this.appended=!1,h.logger.log("Parsing "+c+" of ["+a.startSN+" ,"+a.endSN+"],level "+l+", cc "+t.cc);var f=this.demuxer;f||(f=this.demuxer=new s.default(this.hls,"main"));var p=this.media,g=!(p&&p.seeking)&&(a.PTSKnown||!a.live),y=a.initSegment?a.initSegment.data:[];f.push(e.payload,y,d,i.videoCodec,t,o,g,void 0)}}this.fragLoadError=0}},{key:"onFragParsingInitSegment",value:function(e){var t=this.fragCurrent,r=e.frag;if(t&&"main"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===E){var n,i,a=e.tracks;if(a.audio&&this.altAudio&&delete a.audio,i=a.audio){var o=this.levels[this.level].audioCodec,s=navigator.userAgent.toLowerCase();o&&this.audioCodecSwap&&(h.logger.log("swapping playlist audio codec"),o=-1!==o.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),this.audioCodecSwitch&&1!==i.metadata.channelCount&&-1===s.indexOf("firefox")&&(o="mp4a.40.5"),-1!==s.indexOf("android")&&"audio/mpeg"!==i.container&&(o="mp4a.40.2",h.logger.log("Android: force audio codec to "+o)),i.levelCodec=o,i.id=e.id}for(n in(i=a.video)&&(i.levelCodec=this.levels[this.level].videoCodec,i.id=e.id),this.hls.trigger(u.default.BUFFER_CODECS,a),a){i=a[n],h.logger.log("main track:"+n+",container:"+i.container+",codecs[level/parsed]=["+i.levelCodec+"/"+i.codec+"]");var l=i.initSegment;l&&(this.appended=!0,this.pendingBuffering=!0,this.hls.trigger(u.default.BUFFER_APPENDING,{type:n,data:l,parent:"main",content:"initSegment"}))}this.tick()}}},{key:"onFragParsingData",value:function(e){var t=this,r=this.fragCurrent,n=e.frag;if(r&&"main"===e.id&&n.sn===r.sn&&n.level===r.level&&("audio"!==e.type||!this.altAudio)&&this.state===E){var i=this.levels[this.level],a=r;if(isNaN(e.endPTS)&&(e.endPTS=e.startPTS+r.duration,e.endDTS=e.startDTS+r.duration),h.logger.log("Parsed "+e.type+",PTS:["+e.startPTS.toFixed(3)+","+e.endPTS.toFixed(3)+"],DTS:["+e.startDTS.toFixed(3)+"/"+e.endDTS.toFixed(3)+"],nb:"+e.nb+",dropped:"+(e.dropped||0)),"video"===e.type)if(a.dropped=e.dropped,a.dropped){if(!a.backtracked)return h.logger.warn("missing video frame(s), backtracking fragment"),a.backtracked=!0,this.nextLoadPosition=e.startPTS,this.state=v,this.fragPrevious=a,void this.tick();h.logger.warn("Already backtracked on this fragment, appending with the gap")}else a.backtracked=!1;var o=c.default.updateFragPTSDTS(i.details,a,e.startPTS,e.endPTS,e.startDTS,e.endDTS),s=this.hls;s.trigger(u.default.LEVEL_PTS_UPDATED,{details:i.details,level:this.level,drift:o,type:e.type,start:e.startPTS,end:e.endPTS}),[e.data1,e.data2].forEach((function(r){r&&r.length&&t.state===E&&(t.appended=!0,t.pendingBuffering=!0,s.trigger(u.default.BUFFER_APPENDING,{type:e.type,data:r,parent:"main",content:"data"}))})),this.tick()}}},{key:"onFragParsed",value:function(e){var t=this.fragCurrent,r=e.frag;t&&"main"===e.id&&r.sn===t.sn&&r.level===t.level&&this.state===E&&(this.stats.tparsed=performance.now(),this.state=S,this._checkAppendedParsed())}},{key:"onAudioTrackSwitching",value:function(e){var t=!!e.url,r=e.id;if(!t){if(this.mediaBuffer!==this.media){h.logger.log("switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var n=this.fragCurrent;n.loader&&(h.logger.log("switching to main audio track, cancel main fragment load"),n.loader.abort()),this.fragCurrent=null,this.fragPrevious=null,this.demuxer&&(this.demuxer.destroy(),this.demuxer=null),this.state=v}var i=this.hls;i.trigger(u.default.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),i.trigger(u.default.AUDIO_TRACK_SWITCHED,{id:r}),this.altAudio=!1}}},{key:"onAudioTrackSwitched",value:function(e){var t=e.id,r=!!this.hls.audioTracks[t].url;if(r){var n=this.videoBuffer;n&&this.mediaBuffer!==n&&(h.logger.log("switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=n)}this.altAudio=r,this.tick()}},{key:"onBufferCreated",value:function(e){var t=e.tracks,r=void 0,n=void 0,i=!1;for(var a in t){var o=t[a];"main"===o.id?(n=a,r=o,"video"===a&&(this.videoBuffer=t[a].buffer)):i=!0}i&&r?(h.logger.log("alternate track found, use "+n+".buffered to schedule main fragment loading"),this.mediaBuffer=r.buffer):this.mediaBuffer=this.media}},{key:"onBufferAppended",value:function(e){if("main"===e.parent){var t=this.state;t!==E&&t!==S||(this.pendingBuffering=e.pending>0,this._checkAppendedParsed())}}},{key:"_checkAppendedParsed",value:function(){if(!(this.state!==S||this.appended&&this.pendingBuffering)){var e=this.fragCurrent;if(e){var t=this.mediaBuffer?this.mediaBuffer:this.media;h.logger.log("main buffered : "+d.default.toString(t.buffered));var r=this._bufferedFrags.filter((function(e){return o.default.isBuffered(t,(e.startPTS+e.endPTS)/2)}));r.push(e),this._bufferedFrags=r.sort((function(e,t){return e.startPTS-t.startPTS})),this.fragPrevious=e;var n=this.stats;n.tbuffered=performance.now(),this.fragLastKbps=Math.round(8*n.total/(n.tbuffered-n.tfirst)),this.hls.trigger(u.default.FRAG_BUFFERED,{stats:n,frag:e,id:"main"}),this.state=v}this.tick()}}},{key:"onError",value:function(e){var t=e.frag||this.fragCurrent;if(!t||"main"===t.type){var r=this.media,n=r&&o.default.isBuffered(r,r.currentTime)&&o.default.isBuffered(r,r.currentTime+.5);switch(e.details){case f.ErrorDetails.FRAG_LOAD_ERROR:case f.ErrorDetails.FRAG_LOAD_TIMEOUT:case f.ErrorDetails.KEY_LOAD_ERROR:case f.ErrorDetails.KEY_LOAD_TIMEOUT:if(!e.fatal){var i=this.fragLoadError;i?i++:i=1;var a=this.config;if(i<=a.fragLoadingMaxRetry||n||t.autoLevel&&t.level){this.fragLoadError=i,t.loadCounter=0;var s=Math.min(Math.pow(2,i-1)*a.fragLoadingRetryDelay,a.fragLoadingMaxRetryTimeout);h.logger.warn("mediaController: frag loading failed, retry in "+s+" ms"),this.retryDate=performance.now()+s,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.state=y}else h.logger.error("mediaController: "+e.details+" reaches max retry, redispatch as fatal ..."),e.fatal=!0,this.state=_}break;case f.ErrorDetails.FRAG_LOOP_LOADING_ERROR:e.fatal||(n?(this._reduceMaxBufferLength(t.duration),this.state=v):t.autoLevel&&0!==t.level||(e.fatal=!0,this.state=_));break;case f.ErrorDetails.LEVEL_LOAD_ERROR:case f.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==_&&(e.fatal?(this.state=_,h.logger.warn("streamController: "+e.details+",switch to "+this.state+" state ...")):e.levelRetry||this.state!==b||(this.state=v));break;case f.ErrorDetails.BUFFER_FULL_ERROR:"main"!==e.parent||this.state!==E&&this.state!==S||(n?(this._reduceMaxBufferLength(this.config.maxBufferLength),this.state=v):(h.logger.warn("buffer full error also media.currentTime is not buffered, flush everything"),this.fragCurrent=null,this.flushMainBuffer(0,Number.POSITIVE_INFINITY)))}}}},{key:"_reduceMaxBufferLength",value:function(e){var t=this.config;t.maxMaxBufferLength>=e&&(t.maxMaxBufferLength/=2,h.logger.warn("main:reduce max buffer length to "+t.maxMaxBufferLength+"s"),this.fragLoadIdx+=2*t.fragLoadingLoopThreshold)}},{key:"_checkBuffer",value:function(){var e=this.media,t=this.config;if(e&&e.readyState){var r=e.currentTime,n=this.mediaBuffer?this.mediaBuffer:e,i=n.buffered;if(!this.loadedmetadata&&i.length){this.loadedmetadata=!0;var a=e.seeking?r:this.startPosition,s=o.default.isBuffered(n,a),l=i.start(0);(r!==a||!s&&Math.abs(a-l)<t.maxSeekHole)&&(h.logger.log("target start position:"+a),s||(a=l,h.logger.log("target start position not buffered, seek to buffered.start(0) "+a)),h.logger.log("adjust currentTime from "+r+" to "+a),e.currentTime=a)}else if(this.immediateSwitch)this.immediateLevelSwitchEnd();else{var c=o.default.bufferInfo(e,r,0),d=!(e.paused||e.ended||0===e.buffered.length);if(r!==this.lastCurrentTime)this.stallReported&&(h.logger.warn("playback not stuck anymore @"+r+", after "+Math.round(performance.now()-this.stalled)+"ms"),this.stallReported=!1),this.stalled=void 0,this.nudgeRetry=0;else if(d){var p=performance.now(),v=this.hls;if(this.stalled){var g=p-this.stalled,m=c.len,y=this.nudgeRetry||0;if(m<=.5&&g>1e3*t.lowBufferWatchdogPeriod){this.stallReported||(this.stallReported=!0,h.logger.warn("playback stalling in low buffer @"+r),v.trigger(u.default.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:m}));var b=c.nextStart,E=b-r;if(b&&E<t.maxSeekHole&&E>0){this.nudgeRetry=++y;var S=y*t.nudgeOffset;h.logger.log("adjust currentTime from "+e.currentTime+" to next buffered @ "+b+" + nudge "+S),e.currentTime=b+S,this.stalled=void 0,v.trigger(u.default.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,hole:b+S-r})}}else if(m>.5&&g>1e3*t.highBufferWatchdogPeriod)if(this.stallReported||(this.stallReported=!0,h.logger.warn("playback stalling in high buffer @"+r),v.trigger(u.default.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:m})),this.stalled=void 0,this.nudgeRetry=++y,y<t.nudgeMaxRetry){var T=e.currentTime,w=T+y*t.nudgeOffset;h.logger.log("adjust currentTime from "+T+" to "+w),e.currentTime=w,v.trigger(u.default.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else h.logger.error("still stuck in high buffer @"+r+" after "+t.nudgeMaxRetry+", raise fatal error"),v.trigger(u.default.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})}else this.stalled=p,this.stallReported=!1}}}}},{key:"onFragLoadEmergencyAborted",value:function(){this.state=v,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tick()}},{key:"onBufferFlushed",value:function(){var e=this.mediaBuffer?this.mediaBuffer:this.media;this._bufferedFrags=this._bufferedFrags.filter((function(t){return o.default.isBuffered(e,(t.startPTS+t.endPTS)/2)})),this.fragLoadIdx+=2*this.config.fragLoadingLoopThreshold,this.state=v,this.fragPrevious=null}},{key:"swapAudioCodec",value:function(){this.audioCodecSwap=!this.audioCodecSwap}},{key:"computeLivePosition",value:function(e,t){var r=void 0!==this.config.liveSyncDuration?this.config.liveSyncDuration:this.config.liveSyncDurationCount*t.targetduration;return e+Math.max(0,t.totalduration-r)}},{key:"state",set:function(e){if(this.state!==e){var t=this.state;this._state=e,h.logger.log("main stream:"+t+"->"+e),this.hls.trigger(u.default.STREAM_STATE_TRANSITION,{previousState:t,nextState:e})}},get:function(){return this._state}},{key:"currentLevel",get:function(){var e=this.media;if(e){var t=this.getBufferedFrag(e.currentTime);if(t)return t.level}return-1}},{key:"nextBufferedFrag",get:function(){var e=this.media;return e?this.followingBufferedFrag(this.getBufferedFrag(e.currentTime)):null}},{key:"nextLevel",get:function(){var e=this.nextBufferedFrag;return e?e.level:-1}},{key:"liveSyncPosition",get:function(){return this._liveSyncPosition},set:function(e){this._liveSyncPosition=e}}]),t}(l.default);r.default=L},{20:20,28:28,29:29,30:30,32:32,33:33,43:43,46:46,47:47}],12:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(){function e(t,r){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.subtle=t,this.aesIV=r}return n(e,[{key:"decrypt",value:function(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)}}]),e}();r.default=i},{}],13:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(){function e(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.initTable()}return n(e,[{key:"uint8ArrayToUint32Array_",value:function(e){for(var t=new DataView(e),r=new Uint32Array(4),n=0;n<4;n++)r[n]=t.getUint32(4*n);return r}},{key:"initTable",value:function(){var e=this.sBox,t=this.invSBox,r=this.subMix,n=r[0],i=r[1],a=r[2],o=r[3],s=this.invSubMix,u=s[0],l=s[1],c=s[2],d=s[3],f=new Uint32Array(256),h=0,p=0,v=0;for(v=0;v<256;v++)f[v]=v<128?v<<1:v<<1^283;for(v=0;v<256;v++){var g=p^p<<1^p<<2^p<<3^p<<4;g=g>>>8^255&g^99,e[h]=g,t[g]=h;var m=f[h],y=f[m],b=f[y],E=257*f[g]^16843008*g;n[h]=E<<24|E>>>8,i[h]=E<<16|E>>>16,a[h]=E<<8|E>>>24,o[h]=E,E=16843009*b^65537*y^257*m^16843008*h,u[g]=E<<24|E>>>8,l[g]=E<<16|E>>>16,c[g]=E<<8|E>>>24,d[g]=E,h?(h=m^f[f[f[b^m]]],p^=f[f[p]]):h=p=1}}},{key:"expandKey",value:function(e){for(var t=this.uint8ArrayToUint32Array_(e),r=!0,n=0;n<t.length&&r;)r=t[n]===this.key[n],n++;if(!r){this.key=t;var i=this.keySize=t.length;if(4!==i&&6!==i&&8!==i)throw new Error("Invalid aes key size="+i);var a=this.ksRows=4*(i+6+1),o=void 0,s=void 0,u=this.keySchedule=new Uint32Array(a),l=this.invKeySchedule=new Uint32Array(a),c=this.sBox,d=this.rcon,f=this.invSubMix,h=f[0],p=f[1],v=f[2],g=f[3],m=void 0,y=void 0;for(o=0;o<a;o++)o<i?m=u[o]=t[o]:(y=m,o%i==0?(y=c[(y=y<<8|y>>>24)>>>24]<<24|c[y>>>16&255]<<16|c[y>>>8&255]<<8|c[255&y],y^=d[o/i|0]<<24):i>6&&o%i==4&&(y=c[y>>>24]<<24|c[y>>>16&255]<<16|c[y>>>8&255]<<8|c[255&y]),u[o]=m=(u[o-i]^y)>>>0);for(s=0;s<a;s++)o=a-s,y=3&s?u[o]:u[o-4],l[s]=s<4||o<=4?y:h[c[y>>>24]]^p[c[y>>>16&255]]^v[c[y>>>8&255]]^g[c[255&y]],l[s]=l[s]>>>0}}},{key:"networkToHostOrderSwap",value:function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24}},{key:"decrypt",value:function(e,t,r){for(var n,i,a=this.keySize+6,o=this.invKeySchedule,s=this.invSBox,u=this.invSubMix,l=u[0],c=u[1],d=u[2],f=u[3],h=this.uint8ArrayToUint32Array_(r),p=h[0],v=h[1],g=h[2],m=h[3],y=new Int32Array(e),b=new Int32Array(y.length),E=void 0,S=void 0,T=void 0,w=void 0,_=void 0,L=void 0,A=void 0,R=void 0,x=void 0,k=void 0,D=void 0,C=void 0,O=this.networkToHostOrderSwap;t<y.length;){for(x=O(y[t]),k=O(y[t+1]),D=O(y[t+2]),C=O(y[t+3]),_=x^o[0],L=C^o[1],A=D^o[2],R=k^o[3],n=4,i=1;i<a;i++)E=l[_>>>24]^c[L>>16&255]^d[A>>8&255]^f[255&R]^o[n],S=l[L>>>24]^c[A>>16&255]^d[R>>8&255]^f[255&_]^o[n+1],T=l[A>>>24]^c[R>>16&255]^d[_>>8&255]^f[255&L]^o[n+2],w=l[R>>>24]^c[_>>16&255]^d[L>>8&255]^f[255&A]^o[n+3],_=E,L=S,A=T,R=w,n+=4;E=s[_>>>24]<<24^s[L>>16&255]<<16^s[A>>8&255]<<8^s[255&R]^o[n],S=s[L>>>24]<<24^s[A>>16&255]<<16^s[R>>8&255]<<8^s[255&_]^o[n+1],T=s[A>>>24]<<24^s[R>>16&255]<<16^s[_>>8&255]<<8^s[255&L]^o[n+2],w=s[R>>>24]<<24^s[_>>16&255]<<16^s[L>>8&255]<<8^s[255&A]^o[n+3],n+=3,b[t]=O(E^p),b[t+1]=O(w^v),b[t+2]=O(T^g),b[t+3]=O(S^m),p=x,v=k,g=D,m=C,t+=4}return b.buffer}},{key:"destroy",value:function(){this.key=void 0,this.keySize=void 0,this.ksRows=void 0,this.sBox=void 0,this.invSBox=void 0,this.subMix=void 0,this.invSubMix=void 0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.rcon=void 0}}]),e}();r.default=i},{}],14:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=n(e(12)),o=n(e(15)),s=n(e(13)),u=e(28),l=e(46),c=function(){function e(t,r){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.observer=t,this.config=r,this.logEnabled=!0;try{var n=crypto||self.crypto;this.subtle=n.subtle||n.webkitSubtle}catch(e){}this.disableWebCrypto=!this.subtle}return i(e,[{key:"isSync",value:function(){return this.disableWebCrypto&&this.config.enableSoftwareAES}},{key:"decrypt",value:function(e,t,r,n){var i=this;if(this.disableWebCrypto&&this.config.enableSoftwareAES){this.logEnabled&&(l.logger.log("JS AES decrypt"),this.logEnabled=!1);var u=this.decryptor;u||(this.decryptor=u=new s.default),u.expandKey(t),n(u.decrypt(e,0,r))}else{this.logEnabled&&(l.logger.log("WebCrypto AES decrypt"),this.logEnabled=!1);var c=this.subtle;this.key!==t&&(this.key=t,this.fastAesKey=new o.default(c,t)),this.fastAesKey.expandKey().then((function(o){new a.default(c,r).decrypt(e,o).catch((function(a){i.onWebCryptoError(a,e,t,r,n)})).then((function(e){n(e)}))})).catch((function(a){i.onWebCryptoError(a,e,t,r,n)}))}}},{key:"onWebCryptoError",value:function(e,t,r,n,i){this.config.enableSoftwareAES?(l.logger.log("WebCrypto Error, disable WebCrypto API"),this.disableWebCrypto=!0,this.logEnabled=!0,this.decrypt(t,r,n,i)):(l.logger.error("decrypting error : "+e.message),this.observer.trigger(Event.ERROR,{type:u.ErrorTypes.MEDIA_ERROR,details:u.ErrorDetails.FRAG_DECRYPT_ERROR,fatal:!0,reason:e.message}))}},{key:"destroy",value:function(){var e=this.decryptor;e&&(e.destroy(),this.decryptor=void 0)}}]),e}();r.default=c},{12:12,13:13,15:15,28:28,46:46}],15:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(){function e(t,r){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.subtle=t,this.key=r}return n(e,[{key:"expandKey",value:function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}]),e}();r.default=i},{}],16:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=n(e(17)),o=e(46),s=n(e(22)),u=function(){function e(t,r,n){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.observer=t,this.config=n,this.remuxer=r}return i(e,[{key:"resetInitSegment",value:function(e,t,r,n){this._audioTrack={container:"audio/adts",type:"audio",id:-1,sequenceNumber:0,isAAC:!0,samples:[],len:0,manifestCodec:t,duration:n,inputTimeScale:9e4}}},{key:"resetTimeStamp",value:function(){}},{key:"append",value:function(e,t,r,n){for(var i=this._audioTrack,u=s.default.getID3Data(e,0),l=90*s.default.getTimeStamp(u),c=0,d=l,f=e.length,h=u.length,p=[{pts:d,dts:d,data:u}];h<f-1;)if(a.default.isHeader(e,h)&&h+5<f){a.default.initTrackConfig(i,this.observer,e,h,i.manifestCodec);var v=a.default.appendFrame(i,e,h,l,c);if(!v){o.logger.log("Unable to parse AAC frame");break}h+=v.length,d=v.sample.pts,c++}else s.default.isHeader(e,h)?(u=s.default.getID3Data(e,h),p.push({pts:d,dts:d,data:u}),h+=u.length):h++;this.remuxer.remux(i,{samples:[]},{samples:p,inputTimeScale:9e4},{samples:[]},t,r,n)}},{key:"destroy",value:function(){}}],[{key:"probe",value:function(e){var t,r,n=s.default.getID3Data(e,0);if(n&&void 0!==s.default.getTimeStamp(n))for(t=n.length,r=Math.min(e.length-1,t+100);t<r;t++)if(a.default.probe(e,t))return o.logger.log("ADTS sync word found !"),!0;return!1}}]),e}();r.default=u},{17:17,22:22,46:46}],17:[function(e,t,r){"use strict";var n=e(46),i=e(28),a={getAudioConfig:function(e,t,r,a){var o,s,u,l,c,d=navigator.userAgent.toLowerCase(),f=a,h=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];if(o=1+((192&t[r+2])>>>6),!((s=(60&t[r+2])>>>2)>h.length-1))return l=(1&t[r+2])<<2,l|=(192&t[r+3])>>>6,n.logger.log("manifest codec:"+a+",ADTS data:type:"+o+",sampleingIndex:"+s+"["+h[s]+"Hz],channelConfig:"+l),/firefox/i.test(d)?s>=6?(o=5,c=new Array(4),u=s-3):(o=2,c=new Array(2),u=s):-1!==d.indexOf("android")?(o=2,c=new Array(2),u=s):(o=5,c=new Array(4),a&&(-1!==a.indexOf("mp4a.40.29")||-1!==a.indexOf("mp4a.40.5"))||!a&&s>=6?u=s-3:((a&&-1!==a.indexOf("mp4a.40.2")&&(s>=6&&1===l||/vivaldi/i.test(d))||!a&&1===l)&&(o=2,c=new Array(2)),u=s)),c[0]=o<<3,c[0]|=(14&s)>>1,c[1]|=(1&s)<<7,c[1]|=l<<3,5===o&&(c[1]|=(14&u)>>1,c[2]=(1&u)<<7,c[2]|=8,c[3]=0),{config:c,samplerate:h[s],channelCount:l,codec:"mp4a.40."+o,manifestCodec:f};e.trigger(Event.ERROR,{type:i.ErrorTypes.MEDIA_ERROR,details:i.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+s})},isHeaderPattern:function(e,t){return 255===e[t]&&240==(246&e[t+1])},getHeaderLength:function(e,t){return 1&e[t+1]?7:9},getFullFrameLength:function(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5},isHeader:function(e,t){return!!(t+1<e.length&&this.isHeaderPattern(e,t))},probe:function(e,t){if(t+1<e.length&&this.isHeaderPattern(e,t)){var r=this.getHeaderLength(e,t);t+5<e.length&&(r=this.getFullFrameLength(e,t));var n=t+r;if(n===e.length||n+1<e.length&&this.isHeaderPattern(e,n))return!0}return!1},initTrackConfig:function(e,t,r,i,a){if(!e.samplerate){var o=this.getAudioConfig(t,r,i,a);e.config=o.config,e.samplerate=o.samplerate,e.channelCount=o.channelCount,e.codec=o.codec,e.manifestCodec=o.manifestCodec,n.logger.log("parsed codec:"+e.codec+",rate:"+o.samplerate+",nb channel:"+o.channelCount)}},getFrameDuration:function(e){return 9216e4/e},appendFrame:function(e,t,r,n,i){var a=this.getFrameDuration(e.samplerate),o=this.parseFrameHeader(t,r,n,i,a);if(o){var s=o.stamp,u=o.headerLength,l=o.frameLength,c={unit:t.subarray(r+u,r+u+l),pts:s,dts:s};return e.samples.push(c),e.len+=l,{sample:c,length:l+u}}},parseFrameHeader:function(e,t,r,n,i){var a,o,s=e.length;if(a=this.getHeaderLength(e,t),o=this.getFullFrameLength(e,t),(o-=a)>0&&t+a+o<=s)return{headerLength:a,frameLength:o,stamp:r+n*i}}};t.exports=a},{28:28,46:46}],18:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=n(e(30)),o=e(28),s=n(e(14)),u=n(e(16)),l=n(e(24)),c=n(e(27)),d=n(e(23)),f=n(e(40)),h=n(e(41)),p=function(){function e(t,r,n,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.observer=t,this.typeSupported=r,this.config=n,this.vendor=i}return i(e,[{key:"destroy",value:function(){var e=this.demuxer;e&&e.destroy()}},{key:"push",value:function(e,t,r,n,i,o,u,l,c,d,f,h){if(e.byteLength>0&&null!=t&&null!=t.key&&"AES-128"===t.method){var p=this.decrypter;null==p&&(p=this.decrypter=new s.default(this.observer,this.config));var v,g=this;try{v=performance.now()}catch(e){v=Date.now()}p.decrypt(e,t.key.buffer,t.iv.buffer,(function(e){var s;try{s=performance.now()}catch(e){s=Date.now()}g.observer.trigger(a.default.FRAG_DECRYPTED,{stats:{tstart:v,tdecrypt:s}}),g.pushDecrypted(new Uint8Array(e),t,new Uint8Array(r),n,i,o,u,l,c,d,f,h)}))}else this.pushDecrypted(new Uint8Array(e),t,new Uint8Array(r),n,i,o,u,l,c,d,f,h)}},{key:"pushDecrypted",value:function(e,t,r,n,i,s,p,v,g,m,y,b){var E=this.demuxer;if(!E||p&&!this.probe(e)){for(var S=this.observer,T=this.typeSupported,w=this.config,_=[{demux:u.default,remux:f.default},{demux:d.default,remux:f.default},{demux:c.default,remux:f.default},{demux:l.default,remux:h.default}],L=0,A=_.length;L<A;L++){var R=_[L],x=R.demux.probe;if(x(e)){var k=this.remuxer=new R.remux(S,w,T,this.vendor);E=new R.demux(S,k,w,T),this.probe=x;break}}if(!E)return void S.trigger(a.default.ERROR,{type:o.ErrorTypes.MEDIA_ERROR,details:o.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"});this.demuxer=E}var D=this.remuxer;(p||v)&&(E.resetInitSegment(r,n,i,m),D.resetInitSegment()),p&&(E.resetTimeStamp(b),D.resetTimeStamp(b)),"function"==typeof E.setDecryptData&&E.setDecryptData(t),E.append(e,s,g,y)}}]),e}();r.default=p},{14:14,16:16,23:23,24:24,27:27,28:28,30:30,40:40,41:41}],19:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var i=n(e(18)),a=n(e(30)),o=e(46),s=n(e(1));r.default=function(e){var t=new s.default;t.trigger=function(e){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];t.emit.apply(t,[e,e].concat(n))},t.off=function(e){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];t.removeListener.apply(t,[e].concat(n))};var r=function(t,r){e.postMessage({event:t,data:r})};e.addEventListener("message",(function(n){var a=n.data;switch(a.cmd){case"init":var s=JSON.parse(a.config);e.demuxer=new i.default(t,a.typeSupported,s,a.vendor);try{(0,o.enableLogs)(!0===s.debug)}catch(e){}r("init",null);break;case"demux":e.demuxer.push(a.data,a.decryptdata,a.initSegment,a.audioCodec,a.videoCodec,a.timeOffset,a.discontinuity,a.trackSwitch,a.contiguous,a.duration,a.accurateTimeOffset,a.defaultInitPTS)}})),t.on(a.default.FRAG_DECRYPTED,r),t.on(a.default.FRAG_PARSING_INIT_SEGMENT,r),t.on(a.default.FRAG_PARSED,r),t.on(a.default.ERROR,r),t.on(a.default.FRAG_PARSING_METADATA,r),t.on(a.default.FRAG_PARSING_USERDATA,r),t.on(a.default.INIT_PTS_FOUND,r),t.on(a.default.FRAG_PARSING_DATA,(function(t,r){var n=[],i={event:t,data:r};r.data1&&(i.data1=r.data1.buffer,n.push(r.data1.buffer),delete r.data1),r.data2&&(i.data2=r.data2.buffer,n.push(r.data2.buffer),delete r.data2),e.postMessage(i,n)}))}},{1:1,18:18,30:30,46:46}],20:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=n(e(30)),o=n(e(18)),s=n(e(19)),u=e(46),l=e(28),c=n(e(1)),d=function(){function t(r,n){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,t),this.hls=r,this.id=n;var i=this.observer=new c.default,d=r.config;i.trigger=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];i.emit.apply(i,[e,e].concat(r))},i.off=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];i.removeListener.apply(i,[e].concat(r))};var f=function(e,t){(t=t||{}).frag=this.frag,t.id=this.id,r.trigger(e,t)}.bind(this);i.on(a.default.FRAG_DECRYPTED,f),i.on(a.default.FRAG_PARSING_INIT_SEGMENT,f),i.on(a.default.FRAG_PARSING_DATA,f),i.on(a.default.FRAG_PARSED,f),i.on(a.default.ERROR,f),i.on(a.default.FRAG_PARSING_METADATA,f),i.on(a.default.FRAG_PARSING_USERDATA,f),i.on(a.default.INIT_PTS_FOUND,f);var h={mp4:MediaSource.isTypeSupported("video/mp4"),mpeg:MediaSource.isTypeSupported("audio/mpeg"),mp3:MediaSource.isTypeSupported('audio/mp4; codecs="mp3"')},p=navigator.vendor;if(d.enableWorker&&"undefined"!=typeof Worker){u.logger.log("demuxing in webworker");var v=void 0;try{var g=e(3);v=this.w=g(s.default),this.onwmsg=this.onWorkerMessage.bind(this),v.addEventListener("message",this.onwmsg),v.onerror=function(e){r.trigger(a.default.ERROR,{type:l.ErrorTypes.OTHER_ERROR,details:l.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",err:{message:e.message+" ("+e.filename+":"+e.lineno+")"}})},v.postMessage({cmd:"init",typeSupported:h,vendor:p,id:n,config:JSON.stringify(d)})}catch(e){u.logger.error("error while initializing DemuxerWorker, fallback on DemuxerInline"),v&&URL.revokeObjectURL(v.objectURL),this.demuxer=new o.default(i,h,d,p),this.w=void 0}}else this.demuxer=new o.default(i,h,d,p)}return i(t,[{key:"destroy",value:function(){var e=this.w;if(e)e.removeEventListener("message",this.onwmsg),e.terminate(),this.w=null;else{var t=this.demuxer;t&&(t.destroy(),this.demuxer=null)}var r=this.observer;r&&(r.removeAllListeners(),this.observer=null)}},{key:"push",value:function(e,t,r,n,i,a,o,s){var l=this.w,c=isNaN(i.startDTS)?i.start:i.startDTS,d=i.decryptdata,f=this.frag,h=!(f&&i.cc===f.cc),p=!(f&&i.level===f.level),v=f&&i.sn===f.sn+1,g=!p&&v;if(h&&u.logger.log(this.id+":discontinuity detected"),p&&u.logger.log(this.id+":switch detected"),this.frag=i,l)l.postMessage({cmd:"demux",data:e,decryptdata:d,initSegment:t,audioCodec:r,videoCodec:n,timeOffset:c,discontinuity:h,trackSwitch:p,contiguous:g,duration:a,accurateTimeOffset:o,defaultInitPTS:s},[e]);else{var m=this.demuxer;m&&m.push(e,d,t,r,n,c,h,p,g,a,o,s)}}},{key:"onWorkerMessage",value:function(e){var t=e.data,r=this.hls;switch(t.event){case"init":URL.revokeObjectURL(this.w.objectURL);break;case a.default.FRAG_PARSING_DATA:t.data.data1=new Uint8Array(t.data1),t.data2&&(t.data.data2=new Uint8Array(t.data2));default:t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,r.trigger(t.event,t.data)}}}]),t}();r.default=d},{1:1,18:18,19:19,28:28,3:3,30:30,46:46}],21:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=e(46),a=function(){function e(t){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.data=t,this.bytesAvailable=t.byteLength,this.word=0,this.bitsAvailable=0}return n(e,[{key:"loadWord",value:function(){var e=this.data,t=this.bytesAvailable,r=e.byteLength-t,n=new Uint8Array(4),i=Math.min(4,t);if(0===i)throw new Error("no bytes available");n.set(e.subarray(r,r+i)),this.word=new DataView(n.buffer).getUint32(0),this.bitsAvailable=8*i,this.bytesAvailable-=i}},{key:"skipBits",value:function(e){var t;this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,e-=(t=e>>3)>>3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}},{key:"readBits",value:function(e){var t=Math.min(this.bitsAvailable,e),r=this.word>>>32-t;return e>32&&i.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0?this.word<<=t:this.bytesAvailable>0&&this.loadWord(),(t=e-t)>0&&this.bitsAvailable?r<<t|this.readBits(t):r}},{key:"skipLZ",value:function(){var e;for(e=0;e<this.bitsAvailable;++e)if(this.word&2147483648>>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}},{key:"skipUEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"skipEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"readUEG",value:function(){var e=this.skipLZ();return this.readBits(e+1)-1}},{key:"readEG",value:function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}},{key:"readBoolean",value:function(){return 1===this.readBits(1)}},{key:"readUByte",value:function(){return this.readBits(8)}},{key:"readUShort",value:function(){return this.readBits(16)}},{key:"readUInt",value:function(){return this.readBits(32)}},{key:"skipScalingList",value:function(e){var t,r=8,n=8;for(t=0;t<e;t++)0!==n&&(n=(r+this.readEG()+256)%256),r=0===n?r:n}},{key:"readSPS",value:function(){var e,t,r,n,i,a,o,s=0,u=0,l=0,c=0,d=this.readUByte.bind(this),f=this.readBits.bind(this),h=this.readUEG.bind(this),p=this.readBoolean.bind(this),v=this.skipBits.bind(this),g=this.skipEG.bind(this),m=this.skipUEG.bind(this),y=this.skipScalingList.bind(this);if(d(),e=d(),f(5),v(3),d(),m(),100===e||110===e||122===e||244===e||44===e||83===e||86===e||118===e||128===e){var b=h();if(3===b&&v(1),m(),m(),v(1),p())for(a=3!==b?8:12,o=0;o<a;o++)p()&&y(o<6?16:64)}m();var E=h();if(0===E)h();else if(1===E)for(v(1),g(),g(),t=h(),o=0;o<t;o++)g();m(),v(1),r=h(),n=h(),0===(i=f(1))&&v(1),v(1),p()&&(s=h(),u=h(),l=h(),c=h());var S=[1,1];if(p()&&p())switch(d()){case 1:S=[1,1];break;case 2:S=[12,11];break;case 3:S=[10,11];break;case 4:S=[16,11];break;case 5:S=[40,33];break;case 6:S=[24,11];break;case 7:S=[20,11];break;case 8:S=[32,11];break;case 9:S=[80,33];break;case 10:S=[18,11];break;case 11:S=[15,11];break;case 12:S=[64,33];break;case 13:S=[160,99];break;case 14:S=[4,3];break;case 15:S=[3,2];break;case 16:S=[2,1];break;case 255:S=[d()<<8|d(),d()<<8|d()]}return{width:Math.ceil(16*(r+1)-2*s-2*u),height:(2-i)*(n+1)*16-(i?2:4)*(l+c),pixelRatio:S}}},{key:"readSliceType",value:function(){return this.readUByte(),this.readUEG(),this.readUEG()}}]),e}();r.default=a},{46:46}],22:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return n(e,null,[{key:"isHeader",value:function(e,t){return t+10<=e.length&&73===e[t]&&68===e[t+1]&&51===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128}},{key:"isFooter",value:function(e,t){return t+10<=e.length&&51===e[t]&&68===e[t+1]&&73===e[t+2]&&e[t+3]<255&&e[t+4]<255&&e[t+6]<128&&e[t+7]<128&&e[t+8]<128&&e[t+9]<128}},{key:"getID3Data",value:function(t,r){for(var n=r,i=0;e.isHeader(t,r);)i+=10,i+=e._readSize(t,r+6),e.isFooter(t,r+10)&&(i+=10),r+=i;if(i>0)return t.subarray(n,n+i)}},{key:"_readSize",value:function(e,t){var r=0;return r=(127&e[t])<<21,r|=(127&e[t+1])<<14,(r|=(127&e[t+2])<<7)|127&e[t+3]}},{key:"getTimeStamp",value:function(t){for(var r=e.getID3Frames(t),n=0;n<r.length;n++){var i=r[n];if(e.isTimeStampFrame(i))return e._readTimeStamp(i)}}},{key:"isTimeStampFrame",value:function(e){return e&&"PRIV"===e.key&&"com.apple.streaming.transportStreamTimestamp"===e.info}},{key:"_getFrameData",value:function(t){var r=String.fromCharCode(t[0],t[1],t[2],t[3]),n=e._readSize(t,4);return{type:r,size:n,data:t.subarray(10,10+n)}}},{key:"getID3Frames",value:function(t){for(var r=0,n=[];e.isHeader(t,r);){for(var i=e._readSize(t,r+6),a=(r+=10)+i;r+8<a;){var o=e._getFrameData(t.subarray(r)),s=e._decodeFrame(o);s&&n.push(s),r+=o.size+10}e.isFooter(t,r)&&(r+=10)}return n}},{key:"_decodeFrame",value:function(t){return"PRIV"===t.type?e._decodePrivFrame(t):"T"===t.type[0]?e._decodeTextFrame(t):"W"===t.type[0]?e._decodeURLFrame(t):void 0}},{key:"_readTimeStamp",value:function(e){if(8===e.data.byteLength){var t=new Uint8Array(e.data),r=1&t[3],n=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return n/=45,r&&(n+=47721858.84),Math.round(n)}}},{key:"_decodePrivFrame",value:function(t){if(!(t.size<2)){var r=e._utf8ArrayToStr(t.data),n=new Uint8Array(t.data.subarray(r.length+1));return{key:t.type,info:r,data:n.buffer}}}},{key:"_decodeTextFrame",value:function(t){if(!(t.size<2)){if("TXXX"===t.type){var r=1,n=e._utf8ArrayToStr(t.data.subarray(r));r+=n.length+1;var i=e._utf8ArrayToStr(t.data.subarray(r));return{key:t.type,info:n,data:i}}var a=e._utf8ArrayToStr(t.data.subarray(1));return{key:t.type,data:a}}}},{key:"_decodeURLFrame",value:function(t){if("WXXX"===t.type){if(t.size<2)return;var r=1,n=e._utf8ArrayToStr(t.data.subarray(r));r+=n.length+1;var i=e._utf8ArrayToStr(t.data.subarray(r));return{key:t.type,info:n,data:i}}var a=e._utf8ArrayToStr(t.data);return{key:t.type,data:a}}},{key:"_utf8ArrayToStr",value:function(e){for(var t=void 0,r=void 0,n="",i=0,a=e.length;i<a;){var o=e[i++];switch(o>>4){case 0:return n;case 1:case 2:case 3:case 4:case 5:case 6:case 7:n+=String.fromCharCode(o);break;case 12:case 13:t=e[i++],n+=String.fromCharCode((31&o)<<6|63&t);break;case 14:t=e[i++],r=e[i++],n+=String.fromCharCode((15&o)<<12|(63&t)<<6|63&r)}}return n}}]),e}();r.default=i},{}],23:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=n(e(22)),o=e(46),s=n(e(25)),u=function(){function e(t,r,n){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.observer=t,this.config=n,this.remuxer=r}return i(e,[{key:"resetInitSegment",value:function(e,t,r,n){this._audioTrack={container:"audio/mpeg",type:"audio",id:-1,sequenceNumber:0,isAAC:!1,samples:[],len:0,manifestCodec:t,duration:n,inputTimeScale:9e4}}},{key:"resetTimeStamp",value:function(){}},{key:"append",value:function(e,t,r,n){for(var i=a.default.getID3Data(e,0),o=90*a.default.getTimeStamp(i),u=i.length,l=e.length,c=0,d=0,f=this._audioTrack,h=[{pts:o,dts:o,data:i}];u<l;)if(s.default.isHeader(e,u)){var p=s.default.appendFrame(f,e,u,o,c);if(!p)break;u+=p.length,d=p.sample.pts,c++}else a.default.isHeader(e,u)?(i=a.default.getID3Data(e,u),h.push({pts:d,dts:d,data:i}),u+=i.length):u++;this.remuxer.remux(f,{samples:[]},{samples:h,inputTimeScale:9e4},{samples:[]},t,r,n)}},{key:"destroy",value:function(){}}],[{key:"probe",value:function(e){var t,r,n=a.default.getID3Data(e,0);if(n&&void 0!==a.default.getTimeStamp(n))for(t=n.length,r=Math.min(e.length-1,t+100);t<r;t++)if(s.default.probe(e,t))return o.logger.log("MPEG Audio sync word found !"),!0;return!1}}]),e}();r.default=u},{22:22,25:25,46:46}],24:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e){return e&&e.__esModule?e:{default:e}}(e(30)),a=Math.pow(2,32)-1,o=function(){function e(t,r){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.observer=t,this.remuxer=r}return n(e,[{key:"resetTimeStamp",value:function(e){this.initPTS=e}},{key:"resetInitSegment",value:function(t,r,n,a){if(t&&t.byteLength){var o=this.initData=e.parseInitSegment(t),s={};o.audio&&(s.audio={container:"audio/mp4",codec:r,initSegment:a?t:null}),o.video&&(s.video={container:"video/mp4",codec:n,initSegment:a?t:null}),this.observer.trigger(i.default.FRAG_PARSING_INIT_SEGMENT,{tracks:s})}else r&&(this.audioCodec=r),n&&(this.videoCodec=n)}},{key:"append",value:function(t,r,n,a){var o=this.initData;o||(this.resetInitSegment(t,this.audioCodec,this.videoCodec),o=this.initData);var s,u=this.initPTS;if(void 0===u){var l=e.getStartDTS(o,t);this.initPTS=u=l-r,this.observer.trigger(i.default.INIT_PTS_FOUND,{initPTS:u})}e.offsetStartDTS(o,t,u),s=e.getStartDTS(o,t),this.remuxer.remux(o.audio,o.video,null,null,s,n,a,t)}},{key:"destroy",value:function(){}}],[{key:"probe",value:function(t){if(t.length>=8){var r=e.bin2str(t.subarray(4,8));return["moof","ftyp","styp"].indexOf(r)>=0}return!1}},{key:"bin2str",value:function(e){return String.fromCharCode.apply(null,e)}},{key:"readUint32",value:function(e,t){e.data&&(t+=e.start,e=e.data);var r=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return r<0?4294967296+r:r}},{key:"writeUint32",value:function(e,t,r){e.data&&(t+=e.start,e=e.data),e[t]=r>>24,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r}},{key:"findBox",value:function(t,r){var n,i,a,o,s,u,l=[];if(t.data?(s=t.start,a=t.end,t=t.data):(s=0,a=t.byteLength),!r.length)return null;for(n=s;n<a;)u=(i=e.readUint32(t,n))>1?n+i:a,e.bin2str(t.subarray(n+4,n+8))===r[0]&&(1===r.length?l.push({data:t,start:n+8,end:u}):(o=e.findBox({data:t,start:n+8,end:u},r.slice(1))).length&&(l=l.concat(o))),n=u;return l}},{key:"parseInitSegment",value:function(t){var r=[];return e.findBox(t,["moov","trak"]).forEach((function(t){var n=e.findBox(t,["tkhd"])[0];if(n){var i=n.data[n.start],a=0===i?12:20,o=e.readUint32(n,a),s=e.findBox(t,["mdia","mdhd"])[0];if(s){a=0===(i=s.data[s.start])?12:20;var u=e.readUint32(s,a),l=e.findBox(t,["mdia","hdlr"])[0];if(l){var c={soun:"audio",vide:"video"}[e.bin2str(l.data.subarray(l.start+8,l.start+12))];c&&(r[o]={timescale:u,type:c},r[c]={timescale:u,id:o})}}}})),r}},{key:"getStartDTS",value:function(t,r){var n,i,a;return n=e.findBox(r,["moof","traf"]),i=[].concat.apply([],n.map((function(r){return e.findBox(r,["tfhd"]).map((function(n){var i,a,o;return i=e.readUint32(n,4),a=t[i].timescale||9e4,o=e.findBox(r,["tfdt"]).map((function(t){var r,n;return r=t.data[t.start],n=e.readUint32(t,4),1===r&&(n*=Math.pow(2,32),n+=e.readUint32(t,8)),n}))[0],(o=o||1/0)/a}))}))),a=Math.min.apply(null,i),isFinite(a)?a:0}},{key:"offsetStartDTS",value:function(t,r,n){e.findBox(r,["moof","traf"]).map((function(r){return e.findBox(r,["tfhd"]).map((function(i){var o=e.readUint32(i,4),s=t[o].timescale||9e4;e.findBox(r,["tfdt"]).map((function(t){var r=t.data[t.start],i=e.readUint32(t,4);if(0===r)e.writeUint32(t,4,i-n*s);else{i*=Math.pow(2,32),i+=e.readUint32(t,8),i-=n*s;var o=Math.floor(i/(a+1)),u=Math.floor(i%(a+1));e.writeUint32(t,4,o),e.writeUint32(t,8,u)}}))}))}))}}]),e}();r.default=o},{30:30}],25:[function(e,t,r){"use strict";var n={BitratesMap:[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],SamplingRateMap:[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],appendFrame:function(e,t,r,n,i){if(!(r+24>t.length)){var a=this.parseHeader(t,r);if(a&&r+a.frameLength<=t.length){var o=n+i*(10368e4/a.sampleRate),s={unit:t.subarray(r,r+a.frameLength),pts:o,dts:o};return e.config=[],e.channelCount=a.channelCount,e.samplerate=a.sampleRate,e.samples.push(s),e.len+=a.frameLength,{sample:s,length:a.frameLength}}}},parseHeader:function(e,t){var r=e[t+1]>>3&3,i=e[t+1]>>1&3,a=e[t+2]>>4&15,o=e[t+2]>>2&3,s=!!(2&e[t+2]);if(1!==r&&0!==a&&15!==a&&3!==o){var u=3===r?3-i:3===i?3:4,l=1e3*n.BitratesMap[14*u+a-1],c=3===r?0:2===r?1:2,d=n.SamplingRateMap[3*c+o],f=s?1:0;return{sampleRate:d,channelCount:e[t+3]>>6==3?1:2,frameLength:3===i?(3===r?12:6)*l/d+f<<2:(3===r?144:72)*l/d+f|0}}},isHeaderPattern:function(e,t){return!(255!==e[t]||224&~e[t+1]||!(6&e[t+1]))},isHeader:function(e,t){return!!(t+1<e.length&&this.isHeaderPattern(e,t))},probe:function(e,t){if(t+1<e.length&&this.isHeaderPattern(e,t)){var r=this.parseHeader(e,t),n=4;r&&r.frameLength&&(n=r.frameLength);var i=t+n;if(i===e.length||i+1<e.length&&this.isHeaderPattern(e,i))return!0}return!1}};t.exports=n},{}],26:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e){return e&&e.__esModule?e:{default:e}}(e(14)),a=function(){function e(t,r,n,a){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.decryptdata=n,this.discardEPB=a,this.decrypter=new i.default(t,r)}return n(e,[{key:"decryptBuffer",value:function(e,t){this.decrypter.decrypt(e,this.decryptdata.key.buffer,this.decryptdata.iv.buffer,t)}},{key:"decryptAacSample",value:function(e,t,r,n){var i=e[t].unit,a=i.subarray(16,i.length-i.length%16),o=a.buffer.slice(a.byteOffset,a.byteOffset+a.length),s=this;this.decryptBuffer(o,(function(a){a=new Uint8Array(a),i.set(a,16),n||s.decryptAacSamples(e,t+1,r)}))}},{key:"decryptAacSamples",value:function(e,t,r){for(;;t++){if(t>=e.length)return void r();if(!(e[t].unit.length<32)){var n=this.decrypter.isSync();if(this.decryptAacSample(e,t,r,n),!n)return}}}},{key:"getAvcEncryptedData",value:function(e){for(var t=16*Math.floor((e.length-48)/160)+16,r=new Int8Array(t),n=0,i=32;i<=e.length-16;i+=160,n+=16)r.set(e.subarray(i,i+16),n);return r}},{key:"getAvcDecryptedUnit",value:function(e,t){t=new Uint8Array(t);for(var r=0,n=32;n<=e.length-16;n+=160,r+=16)e.set(t.subarray(r,r+16),n);return e}},{key:"decryptAvcSample",value:function(e,t,r,n,i,a){var o=this.discardEPB(i.data),s=this.getAvcEncryptedData(o),u=this;this.decryptBuffer(s.buffer,(function(s){i.data=u.getAvcDecryptedUnit(o,s),a||u.decryptAvcSamples(e,t,r+1,n)}))}},{key:"decryptAvcSamples",value:function(e,t,r,n){for(;;t++,r=0){if(t>=e.length)return void n();for(var i=e[t].units;!(r>=i.length);r++){var a=i[r];if(!(a.length<=48||1!==a.type&&5!==a.type)){var o=this.decrypter.isSync();if(this.decryptAvcSample(e,t,r,n,a,o),!o)return}}}}}]),e}();r.default=a},{14:14}],27:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=n(e(17)),o=n(e(25)),s=n(e(30)),u=n(e(21)),l=n(e(26)),c=e(46),d=e(28),f=function(){function e(t,r,n,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.observer=t,this.config=n,this.typeSupported=i,this.remuxer=r,this.sampleAes=null}return i(e,[{key:"setDecryptData",value:function(e){null!=e&&null!=e.key&&"SAMPLE-AES"===e.method?this.sampleAes=new l.default(this.observer,this.config,e,this.discardEPB):this.sampleAes=null}},{key:"resetInitSegment",value:function(e,t,r,n){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack={container:"video/mp2t",type:"video",id:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],len:0,dropped:0},this._audioTrack={container:"video/mp2t",type:"audio",id:-1,inputTimeScale:9e4,duration:n,sequenceNumber:0,samples:[],len:0,isAAC:!0},this._id3Track={type:"id3",id:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],len:0},this._txtTrack={type:"text",id:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],len:0},this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=t,this.videoCodec=r,this._duration=n}},{key:"resetTimeStamp",value:function(){}},{key:"append",value:function(e,t,r,n){var i,a,o,u,l,f=e.length,h=!1;this.contiguous=r;var p=this.pmtParsed,v=this._avcTrack,g=this._audioTrack,m=this._id3Track,y=v.id,b=g.id,E=m.id,S=this._pmtId,T=v.pesData,w=g.pesData,_=m.pesData,L=this._parsePAT,A=this._parsePMT,R=this._parsePES,x=this._parseAVCPES.bind(this),k=this._parseAACPES.bind(this),D=this._parseMPEGPES.bind(this),C=this._parseID3PES.bind(this);for(f-=f%188,i=0;i<f;i+=188)if(71===e[i]){if(a=!!(64&e[i+1]),o=((31&e[i+1])<<8)+e[i+2],(48&e[i+3])>>4>1){if((u=i+5+e[i+4])===i+188)continue}else u=i+4;switch(o){case y:a&&(T&&(l=R(T))&&x(l,!1),T={data:[],size:0}),T&&(T.data.push(e.subarray(u,i+188)),T.size+=i+188-u);break;case b:a&&(w&&(l=R(w))&&(g.isAAC?k(l):D(l)),w={data:[],size:0}),w&&(w.data.push(e.subarray(u,i+188)),w.size+=i+188-u);break;case E:a&&(_&&(l=R(_))&&C(l),_={data:[],size:0}),_&&(_.data.push(e.subarray(u,i+188)),_.size+=i+188-u);break;case 0:a&&(u+=e[u]+1),S=this._pmtId=L(e,u);break;case S:a&&(u+=e[u]+1);var O=A(e,u,!0===this.typeSupported.mpeg||!0===this.typeSupported.mp3,null!=this.sampleAes);(y=O.avc)>0&&(v.id=y),(b=O.audio)>0&&(g.id=b,g.isAAC=O.isAAC),(E=O.id3)>0&&(m.id=E),h&&!p&&(c.logger.log("reparse from beginning"),h=!1,i=-188),p=this.pmtParsed=!0;break;case 17:case 8191:break;default:h=!0}}else this.observer.trigger(s.default.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:d.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});T&&(l=R(T))?(x(l,!0),v.pesData=null):v.pesData=T,w&&(l=R(w))?(g.isAAC?k(l):D(l),g.pesData=null):(w&&w.size&&c.logger.log("last AAC PES packet truncated,might overlap between fragments"),g.pesData=w),_&&(l=R(_))?(C(l),m.pesData=null):m.pesData=_,null==this.sampleAes?this.remuxer.remux(g,v,m,this._txtTrack,t,r,n):this.decryptAndRemux(g,v,m,this._txtTrack,t,r,n)}},{key:"decryptAndRemux",value:function(e,t,r,n,i,a,o){if(e.samples&&e.isAAC){var s=this;this.sampleAes.decryptAacSamples(e.samples,0,(function(){s.decryptAndRemuxAvc(e,t,r,n,i,a,o)}))}else this.decryptAndRemuxAvc(e,t,r,n,i,a,o)}},{key:"decryptAndRemuxAvc",value:function(e,t,r,n,i,a,o){if(t.samples){var s=this;this.sampleAes.decryptAvcSamples(t.samples,0,0,(function(){s.remuxer.remux(e,t,r,n,i,a,o)}))}else this.remuxer.remux(e,t,r,n,i,a,o)}},{key:"destroy",value:function(){this._initPTS=this._initDTS=void 0,this._duration=0}},{key:"_parsePAT",value:function(e,t){return(31&e[t+10])<<8|e[t+11]}},{key:"_parsePMT",value:function(e,t,r,n){var i,a,o={audio:-1,avc:-1,id3:-1,isAAC:!0};for(i=t+3+((15&e[t+1])<<8|e[t+2])-4,t+=12+((15&e[t+10])<<8|e[t+11]);t<i;){switch(a=(31&e[t+1])<<8|e[t+2],e[t]){case 207:if(!n){c.logger.log("unkown stream type:"+e[t]);break}case 15:-1===o.audio&&(o.audio=a);break;case 21:-1===o.id3&&(o.id3=a);break;case 219:if(!n){c.logger.log("unkown stream type:"+e[t]);break}case 27:-1===o.avc&&(o.avc=a);break;case 3:case 4:r?-1===o.audio&&(o.audio=a,o.isAAC=!1):c.logger.log("MPEG audio found, not supported in this browser for now");break;case 36:c.logger.warn("HEVC stream type found, not supported for now");break;default:c.logger.log("unkown stream type:"+e[t])}t+=5+((15&e[t+3])<<8|e[t+4])}return o}},{key:"_parsePES",value:function(e){var t,r,n,i,a,o,s,u,l=0,d=e.data;if(!e||0===e.size)return null;for(;d[0].length<19&&d.length>1;){var f=new Uint8Array(d[0].length+d[1].length);f.set(d[0]),f.set(d[1],d[0].length),d[0]=f,d.splice(1,1)}if(1===((t=d[0])[0]<<16)+(t[1]<<8)+t[2]){if((n=(t[4]<<8)+t[5])&&n>e.size-6)return null;192&(r=t[7])&&((o=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2)>4294967295&&(o-=8589934592),64&r?((s=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2)>4294967295&&(s-=8589934592),o-s>54e5&&(c.logger.warn(Math.round((o-s)/9e4)+"s delta between PTS and DTS, align them"),o=s)):s=o),u=(i=t[8])+9,e.size-=u,a=new Uint8Array(e.size);for(var h=0,p=d.length;h<p;h++){var v=(t=d[h]).byteLength;if(u){if(u>v){u-=v;continue}t=t.subarray(u),v-=u,u=0}a.set(t,l),l+=v}return n&&(n-=i+3),{data:a,pts:o,dts:s,len:n}}return null}},{key:"pushAccesUnit",value:function(e,t){if(e.units.length&&e.frame){var r=t.samples,n=r.length;!this.config.forceKeyFrameOnDiscontinuity||!0===e.key||t.sps&&(n||this.contiguous)?(e.id=n,r.push(e)):t.dropped++}e.debug.length&&c.logger.log(e.pts+"/"+e.dts+":"+e.debug)}},{key:"_parseAVCPES",value:function(e,t){var r,n,i,a=this,o=this._avcTrack,s=this._parseAVCNALu(e.data),l=this.avcSample,c=!1,d=this.pushAccesUnit.bind(this),f=function(e,t,r,n){return{key:e,pts:t,dts:r,units:[],debug:n}};e.data=null,l&&s.length&&(d(l,o),l=this.avcSample=f(!1,e.pts,e.dts,"")),s.forEach((function(t){switch(t.type){case 1:n=!0,l.frame=!0;var s=t.data;if(c&&s.length>4){var h=new u.default(s).readSliceType();2!==h&&4!==h&&7!==h&&9!==h||(l.key=!0)}break;case 5:n=!0,l||(l=a.avcSample=f(!0,e.pts,e.dts,"")),l.key=!0,l.frame=!0;break;case 6:n=!0,(r=new u.default(a.discardEPB(t.data))).readUByte();for(var p=0,v=0,g=!1,m=0;!g&&r.bytesAvailable>1;){p=0;do{p+=m=r.readUByte()}while(255===m);v=0;do{v+=m=r.readUByte()}while(255===m);if(4===p&&0!==r.bytesAvailable){if(g=!0,181===r.readUByte()&&49===r.readUShort()&&1195456820===r.readUInt()&&3===r.readUByte()){var y=r.readUByte(),b=31&y,E=[y,r.readUByte()];for(i=0;i<b;i++)E.push(r.readUByte()),E.push(r.readUByte()),E.push(r.readUByte());a._insertSampleInOrder(a._txtTrack.samples,{type:3,pts:e.pts,bytes:E})}}else if(v<r.bytesAvailable)for(i=0;i<v;i++)r.readUByte()}break;case 7:if(n=!0,c=!0,!o.sps){var S=(r=new u.default(t.data)).readSPS();o.width=S.width,o.height=S.height,o.pixelRatio=S.pixelRatio,o.sps=[t.data],o.duration=a._duration;var T=t.data.subarray(1,4),w="avc1.";for(i=0;i<3;i++){var _=T[i].toString(16);_.length<2&&(_="0"+_),w+=_}o.codec=w}break;case 8:n=!0,o.pps||(o.pps=[t.data]);break;case 9:n=!1,l&&d(l,o),l=a.avcSample=f(!1,e.pts,e.dts,"");break;case 12:n=!1;break;default:n=!1,l&&(l.debug+="unknown NAL "+t.type+" ")}l&&n&&l.units.push(t)})),t&&l&&(d(l,o),this.avcSample=null)}},{key:"_insertSampleInOrder",value:function(e,t){var r=e.length;if(r>0){if(t.pts>=e[r-1].pts)e.push(t);else for(var n=r-1;n>=0;n--)if(t.pts<e[n].pts){e.splice(n,0,t);break}}else e.push(t)}},{key:"_getLastNalUnit",value:function(){var e=this.avcSample,t=void 0;if(!e||0===e.units.length){var r=this._avcTrack.samples;e=r[r.length-1]}if(e){var n=e.units;t=n[n.length-1]}return t}},{key:"_parseAVCNALu",value:function(e){var t,r,n,i,a=0,o=e.byteLength,s=this._avcTrack,u=s.naluState||0,l=u,c=[],d=-1;for(-1===u&&(d=0,i=31&e[0],u=0,a=1);a<o;)if(t=e[a++],u)if(1!==u)if(t)if(1===t){if(d>=0)n={data:e.subarray(d,a-u-1),type:i},c.push(n);else{var f=this._getLastNalUnit();if(f&&(l&&a<=4-l&&f.state&&(f.data=f.data.subarray(0,f.data.byteLength-l)),(r=a-u-1)>0)){var h=new Uint8Array(f.data.byteLength+r);h.set(f.data,0),h.set(e.subarray(0,r),f.data.byteLength),f.data=h}}a<o?(d=a,i=31&e[a],u=0):u=-1}else u=0;else u=3;else u=t?0:2;else u=t?0:1;if(d>=0&&u>=0&&(n={data:e.subarray(d,o),type:i,state:u},c.push(n)),0===c.length){var p=this._getLastNalUnit();if(p){var v=new Uint8Array(p.data.byteLength+e.byteLength);v.set(p.data,0),v.set(e,p.data.byteLength),p.data=v}}return s.naluState=u,c}},{key:"discardEPB",value:function(e){for(var t,r,n=e.byteLength,i=[],a=1;a<n-2;)0===e[a]&&0===e[a+1]&&3===e[a+2]?(i.push(a+2),a+=2):a++;if(0===i.length)return e;t=n-i.length,r=new Uint8Array(t);var o=0;for(a=0;a<t;o++,a++)o===i[0]&&(o++,i.shift()),r[a]=e[o];return r}},{key:"_parseAACPES",value:function(e){var t,r,n,i,o,u,l,f=this._audioTrack,h=e.data,p=e.pts,v=this.aacOverFlow,g=this.aacLastPTS;if(v){var m=new Uint8Array(v.byteLength+h.byteLength);m.set(v,0),m.set(h,v.byteLength),h=m}for(n=0,o=h.length;n<o-1&&!a.default.isHeader(h,n);n++);if(!n||(n<o-1?(u="AAC PES did not start with ADTS header,offset:"+n,l=!1):(u="no ADTS header found in AAC PES",l=!0),c.logger.warn("parsing error:"+u),this.observer.trigger(s.default.ERROR,{type:d.ErrorTypes.MEDIA_ERROR,details:d.ErrorDetails.FRAG_PARSING_ERROR,fatal:l,reason:u}),!l)){if(a.default.initTrackConfig(f,this.observer,h,n,this.audioCodec),r=0,t=a.default.getFrameDuration(f.samplerate),v&&g){var y=g+t;Math.abs(y-p)>1&&(c.logger.log("AAC: align PTS for overlapping frames by "+Math.round((y-p)/90)),p=y)}for(;n<o;)if(a.default.isHeader(h,n)&&n+5<o){var b=a.default.appendFrame(f,h,n,p,r);if(!b)break;n+=b.length,i=b.sample.pts,r++}else n++;v=n<o?h.subarray(n,o):null,this.aacOverFlow=v,this.aacLastPTS=i}}},{key:"_parseMPEGPES",value:function(e){for(var t=e.data,r=t.length,n=0,i=0,a=e.pts;i<r;)if(o.default.isHeader(t,i)){var s=o.default.appendFrame(this._audioTrack,t,i,a,n);if(!s)break;i+=s.length,n++}else i++}},{key:"_parseID3PES",value:function(e){this._id3Track.samples.push(e)}}],[{key:"probe",value:function(e){return e.length>=564&&71===e[0]&&71===e[188]&&71===e[376]}}]),e}();r.default=f},{17:17,21:21,25:25,26:26,28:28,30:30,46:46}],28:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ErrorTypes={NETWORK_ERROR:"networkError",MEDIA_ERROR:"mediaError",MUX_ERROR:"muxError",OTHER_ERROR:"otherError"},r.ErrorDetails={MANIFEST_LOAD_ERROR:"manifestLoadError",MANIFEST_LOAD_TIMEOUT:"manifestLoadTimeOut",MANIFEST_PARSING_ERROR:"manifestParsingError",MANIFEST_INCOMPATIBLE_CODECS_ERROR:"manifestIncompatibleCodecsError",LEVEL_LOAD_ERROR:"levelLoadError",LEVEL_LOAD_TIMEOUT:"levelLoadTimeOut",LEVEL_SWITCH_ERROR:"levelSwitchError",AUDIO_TRACK_LOAD_ERROR:"audioTrackLoadError",AUDIO_TRACK_LOAD_TIMEOUT:"audioTrackLoadTimeOut",FRAG_LOAD_ERROR:"fragLoadError",FRAG_LOOP_LOADING_ERROR:"fragLoopLoadingError",FRAG_LOAD_TIMEOUT:"fragLoadTimeOut",FRAG_DECRYPT_ERROR:"fragDecryptError",FRAG_PARSING_ERROR:"fragParsingError",REMUX_ALLOC_ERROR:"remuxAllocError",KEY_LOAD_ERROR:"keyLoadError",KEY_LOAD_TIMEOUT:"keyLoadTimeOut",BUFFER_ADD_CODEC_ERROR:"bufferAddCodecError",BUFFER_APPEND_ERROR:"bufferAppendError",BUFFER_APPENDING_ERROR:"bufferAppendingError",BUFFER_STALLED_ERROR:"bufferStalledError",BUFFER_FULL_ERROR:"bufferFullError",BUFFER_SEEK_OVER_HOLE:"bufferSeekOverHole",BUFFER_NUDGE_ON_STALL:"bufferNudgeOnStall",INTERNAL_EXCEPTION:"internalException",WEBVTT_EXCEPTION:"webVTTException"}},{}],29:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n="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},i=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=e(46),o=e(28),s=function(e){return e&&e.__esModule?e:{default:e}}(e(30)),u=function(){function e(t){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.hls=t,this.onEvent=this.onEvent.bind(this);for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this.handledEvents=n,this.useGenericHandler=!0,this.registerListeners()}return i(e,[{key:"destroy",value:function(){this.unregisterListeners()}},{key:"isEventHandler",value:function(){return"object"===n(this.handledEvents)&&this.handledEvents.length&&"function"==typeof this.onEvent}},{key:"registerListeners",value:function(){this.isEventHandler()&&this.handledEvents.forEach((function(e){if("hlsEventGeneric"===e)throw new Error("Forbidden event name: "+e);this.hls.on(e,this.onEvent)}),this)}},{key:"unregisterListeners",value:function(){this.isEventHandler()&&this.handledEvents.forEach((function(e){this.hls.off(e,this.onEvent)}),this)}},{key:"onEvent",value:function(e,t){this.onEventGeneric(e,t)}},{key:"onEventGeneric",value:function(e,t){try{(function(e,t){var r="on"+e.replace("hls","");if("function"!=typeof this[r])throw new Error("Event "+e+" has no generic handler in this "+this.constructor.name+" class (tried "+r+")");return this[r].bind(this,t)}).call(this,e,t).call()}catch(t){a.logger.error("internal error happened while processing "+e+":"+t.message),this.hls.trigger(s.default.ERROR,{type:o.ErrorTypes.OTHER_ERROR,details:o.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:e,err:t})}}}]),e}();r.default=u},{28:28,30:30,46:46}],30:[function(e,t,r){"use strict";t.exports={MEDIA_ATTACHING:"hlsMediaAttaching",MEDIA_ATTACHED:"hlsMediaAttached",MEDIA_DETACHING:"hlsMediaDetaching",MEDIA_DETACHED:"hlsMediaDetached",BUFFER_RESET:"hlsBufferReset",BUFFER_CODECS:"hlsBufferCodecs",BUFFER_CREATED:"hlsBufferCreated",BUFFER_APPENDING:"hlsBufferAppending",BUFFER_APPENDED:"hlsBufferAppended",BUFFER_EOS:"hlsBufferEos",BUFFER_FLUSHING:"hlsBufferFlushing",BUFFER_FLUSHED:"hlsBufferFlushed",MANIFEST_LOADING:"hlsManifestLoading",MANIFEST_LOADED:"hlsManifestLoaded",MANIFEST_PARSED:"hlsManifestParsed",LEVEL_SWITCH:"hlsLevelSwitch",LEVEL_SWITCHING:"hlsLevelSwitching",LEVEL_SWITCHED:"hlsLevelSwitched",LEVEL_LOADING:"hlsLevelLoading",LEVEL_LOADED:"hlsLevelLoaded",LEVEL_UPDATED:"hlsLevelUpdated",LEVEL_PTS_UPDATED:"hlsLevelPtsUpdated",AUDIO_TRACKS_UPDATED:"hlsAudioTracksUpdated",AUDIO_TRACK_SWITCH:"hlsAudioTrackSwitch",AUDIO_TRACK_SWITCHING:"hlsAudioTrackSwitching",AUDIO_TRACK_SWITCHED:"hlsAudioTrackSwitched",AUDIO_TRACK_LOADING:"hlsAudioTrackLoading",AUDIO_TRACK_LOADED:"hlsAudioTrackLoaded",SUBTITLE_TRACKS_UPDATED:"hlsSubtitleTracksUpdated",SUBTITLE_TRACK_SWITCH:"hlsSubtitleTrackSwitch",SUBTITLE_TRACK_LOADING:"hlsSubtitleTrackLoading",SUBTITLE_TRACK_LOADED:"hlsSubtitleTrackLoaded",SUBTITLE_FRAG_PROCESSED:"hlsSubtitleFragProcessed",INIT_PTS_FOUND:"hlsInitPtsFound",FRAG_LOADING:"hlsFragLoading",FRAG_LOAD_PROGRESS:"hlsFragLoadProgress",FRAG_LOAD_EMERGENCY_ABORTED:"hlsFragLoadEmergencyAborted",FRAG_LOADED:"hlsFragLoaded",FRAG_DECRYPTED:"hlsFragDecrypted",FRAG_PARSING_INIT_SEGMENT:"hlsFragParsingInitSegment",FRAG_PARSING_USERDATA:"hlsFragParsingUserdata",FRAG_PARSING_METADATA:"hlsFragParsingMetadata",FRAG_PARSING_DATA:"hlsFragParsingData",FRAG_PARSED:"hlsFragParsed",FRAG_BUFFERED:"hlsFragBuffered",FRAG_CHANGED:"hlsFragChanged",FPS_DROP:"hlsFpsDrop",FPS_DROP_LEVEL_CAPPING:"hlsFpsDropLevelCapping",ERROR:"hlsError",DESTROYING:"hlsDestroying",KEY_LOADING:"hlsKeyLoading",KEY_LOADED:"hlsKeyLoaded",STREAM_STATE_TRANSITION:"hlsStreamStateTransition"}},{}],31:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return n(e,null,[{key:"getSilentFrame",value:function(e,t){if("mp4a.40.2"===e){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])}else{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])}return null}}]),e}();r.default=i},{}],32:[function(e,t,r){"use strict";t.exports={isBuffered:function(e,t){if(e)for(var r=e.buffered,n=0;n<r.length;n++)if(t>=r.start(n)&&t<=r.end(n))return!0;return!1},bufferInfo:function(e,t,r){if(e){var n,i=e.buffered,a=[];for(n=0;n<i.length;n++)a.push({start:i.start(n),end:i.end(n)});return this.bufferedInfo(a,t,r)}return{len:0,start:t,end:t,nextStart:void 0}},bufferedInfo:function(e,t,r){var n,i,a,o,s,u=[];for(e.sort((function(e,t){return e.start-t.start||t.end-e.end})),s=0;s<e.length;s++){var l=u.length;if(l){var c=u[l-1].end;e[s].start-c<r?e[s].end>c&&(u[l-1].end=e[s].end):u.push(e[s])}else u.push(e[s])}for(s=0,n=0,i=a=t;s<u.length;s++){var d=u[s].start,f=u[s].end;if(t+r>=d&&t<f)i=d,n=(a=f)-t;else if(t+r<d){o=d;break}}return{len:n,start:i,end:a,nextStart:o}}}},{}],33:[function(e,t,r){"use strict";var n=e(46),i={mergeDetails:function(e,t){var r,a=Math.max(e.startSN,t.startSN)-t.startSN,o=Math.min(e.endSN,t.endSN)-t.startSN,s=t.startSN-e.startSN,u=e.fragments,l=t.fragments,c=0;if(o<a)t.PTSKnown=!1;else{for(var d=a;d<=o;d++){var f=u[s+d],h=l[d];h&&f&&(c=f.cc-h.cc,isNaN(f.startPTS)||(h.start=h.startPTS=f.startPTS,h.endPTS=f.endPTS,h.duration=f.duration,h.backtracked=f.backtracked,h.dropped=f.dropped,r=h))}if(c)for(n.logger.log("discontinuity sliding from playlist, take drift into account"),d=0;d<l.length;d++)l[d].cc+=c;if(r)i.updateFragPTSDTS(t,r,r.startPTS,r.endPTS,r.startDTS,r.endDTS);else if(s>=0&&s<u.length){var p=u[s].start;for(d=0;d<l.length;d++)l[d].start+=p}t.PTSKnown=e.PTSKnown}},updateFragPTSDTS:function(e,t,r,n,a,o){var s=r;if(!isNaN(t.startPTS)){var u=Math.abs(t.startPTS-r);isNaN(t.deltaPTS)?t.deltaPTS=u:t.deltaPTS=Math.max(u,t.deltaPTS),s=Math.max(r,t.startPTS),r=Math.min(r,t.startPTS),n=Math.max(n,t.endPTS),a=Math.min(a,t.startDTS),o=Math.max(o,t.endDTS)}var l=r-t.start;t.start=t.startPTS=r,t.maxStartPTS=s,t.endPTS=n,t.startDTS=a,t.endDTS=o,t.duration=n-r;var c,d,f,h=t.sn;if(!e||h<e.startSN||h>e.endSN)return 0;for(c=h-e.startSN,(d=e.fragments)[c]=t,f=c;f>0;f--)i.updatePTS(d,f,f-1);for(f=c;f<d.length-1;f++)i.updatePTS(d,f,f+1);return e.PTSKnown=!0,l},updatePTS:function(e,t,r){var i=e[t],a=e[r],o=a.startPTS;isNaN(o)?a.start=r>t?i.start+i.duration:Math.max(i.start-a.duration,0):r>t?(i.duration=o-i.start,i.duration<0&&n.logger.warn("negative duration computed for frag "+i.sn+",level "+i.level+", there should be some duration drift between playlist and fragment!")):(a.duration=i.start-o,a.duration<0&&n.logger.warn("negative duration computed for frag "+a.sn+",level "+a.level+", there should be some duration drift between playlist and fragment!"))}};t.exports=i},{46:46}],34:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=n(e(2)),o=n(e(30)),s=e(28),u=n(e(38)),l=n(e(36)),c=n(e(37)),d=n(e(11)),f=n(e(10)),h=n(e(9)),p=e(46),v=n(e(1)),g=e(4),m=function(){function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=e.DefaultConfig;if((r.liveSyncDurationCount||r.liveMaxLatencyDurationCount)&&(r.liveSyncDuration||r.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");for(var i in n)i in r||(r[i]=n[i]);if(void 0!==r.liveMaxLatencyDurationCount&&r.liveMaxLatencyDurationCount<=r.liveSyncDurationCount)throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be gt "liveSyncDurationCount"');if(void 0!==r.liveMaxLatencyDuration&&(r.liveMaxLatencyDuration<=r.liveSyncDuration||void 0===r.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be gt "liveSyncDuration"');(0,p.enableLogs)(r.debug),this.config=r,this._autoLevelCapping=-1;var a=this.observer=new v.default;a.trigger=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];a.emit.apply(a,[e,e].concat(r))},a.off=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];a.removeListener.apply(a,[e].concat(r))},this.on=a.on.bind(a),this.off=a.off.bind(a),this.trigger=a.trigger.bind(a);var o=this.abrController=new r.abrController(this),s=new r.bufferController(this),g=new r.capLevelController(this),m=new r.fpsController(this),y=new u.default(this),b=new l.default(this),E=new c.default(this),S=new h.default(this),T=[this.levelController=new f.default(this),this.streamController=new d.default(this)],w=r.audioStreamController;w&&T.push(new w(this)),this.networkControllers=T;var _=[y,b,E,o,s,g,m,S];if(w=r.audioTrackController){var L=new w(this);this.audioTrackController=L,_.push(L)}if(w=r.subtitleTrackController){var A=new w(this);this.subtitleTrackController=A,_.push(A)}[r.subtitleStreamController,r.timelineController].forEach((function(e){e&&_.push(new e(t))})),this.coreComponents=_}return i(e,null,[{key:"isSupported",value:function(){var e=window.MediaSource=window.MediaSource||window.WebKitMediaSource,t=window.SourceBuffer=window.SourceBuffer||window.WebKitSourceBuffer,r=e&&"function"==typeof e.isTypeSupported&&e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),n=!t||t.prototype&&"function"==typeof t.prototype.appendBuffer&&"function"==typeof t.prototype.remove;return r&&n}},{key:"version",get:function(){return"0.7.11"}},{key:"Events",get:function(){return o.default}},{key:"ErrorTypes",get:function(){return s.ErrorTypes}},{key:"ErrorDetails",get:function(){return s.ErrorDetails}},{key:"DefaultConfig",get:function(){return e.defaultConfig?e.defaultConfig:g.hlsDefaultConfig},set:function(t){e.defaultConfig=t}}]),i(e,[{key:"destroy",value:function(){p.logger.log("destroy"),this.trigger(o.default.DESTROYING),this.detachMedia(),this.coreComponents.concat(this.networkControllers).forEach((function(e){e.destroy()})),this.url=null,this.observer.removeAllListeners(),this._autoLevelCapping=-1}},{key:"attachMedia",value:function(e){p.logger.log("attachMedia"),this.media=e,this.trigger(o.default.MEDIA_ATTACHING,{media:e})}},{key:"detachMedia",value:function(){p.logger.log("detachMedia"),this.trigger(o.default.MEDIA_DETACHING),this.media=null}},{key:"loadSource",value:function(e){e=a.default.buildAbsoluteURL(window.location.href,e,{alwaysNormalize:!0}),p.logger.log("loadSource:"+e),this.url=e,this.trigger(o.default.MANIFEST_LOADING,{url:e})}},{key:"startLoad",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;p.logger.log("startLoad("+e+")"),this.networkControllers.forEach((function(t){t.startLoad(e)}))}},{key:"stopLoad",value:function(){p.logger.log("stopLoad"),this.networkControllers.forEach((function(e){e.stopLoad()}))}},{key:"swapAudioCodec",value:function(){p.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}},{key:"recoverMediaError",value:function(){p.logger.log("recoverMediaError");var e=this.media;this.detachMedia(),this.attachMedia(e)}},{key:"levels",get:function(){return this.levelController.levels}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(e){p.logger.log("set currentLevel:"+e),this.loadLevel=e,this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(e){p.logger.log("set nextLevel:"+e),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(e){p.logger.log("set loadLevel:"+e),this.levelController.manualLevel=e}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(e){this.levelController.nextLoadLevel=e}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(e){p.logger.log("set firstLevel:"+e),this.levelController.firstLevel=e}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(e){p.logger.log("set startLevel:"+e);-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(e){p.logger.log("set autoLevelCapping:"+e),this._autoLevelCapping=e}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){for(var e=this.levels,t=this.config.minAutoBitrate,r=e?e.length:0,n=0;n<r;n++)if((e[n].realBitrate?Math.max(e[n].realBitrate,e[n].bitrate):e[n].bitrate)>t)return n;return 0}},{key:"maxAutoLevel",get:function(){var e=this.levels,t=this.autoLevelCapping;return-1===t&&e&&e.length?e.length-1:t}},{key:"nextAutoLevel",get:function(){var e=this;return Math.min(Math.max(e.abrController.nextAutoLevel,e.minAutoLevel),e.maxAutoLevel)},set:function(e){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,e)}},{key:"audioTracks",get:function(){var e=this.audioTrackController;return e?e.audioTracks:[]}},{key:"audioTrack",get:function(){var e=this.audioTrackController;return e?e.audioTrack:-1},set:function(e){var t=this.audioTrackController;t&&(t.audioTrack=e)}},{key:"liveSyncPosition",get:function(){return this.streamController.liveSyncPosition}},{key:"subtitleTracks",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var e=this.subtitleTrackController;return e?e.subtitleTrack:-1},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}}]),e}();r.default=m},{1:1,10:10,11:11,2:2,28:28,30:30,36:36,37:37,38:38,4:4,46:46,9:9}],35:[function(e,t,r){"use strict";t.exports=e(34).default},{34:34}],36:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=n(e(30)),o=n(e(29)),s=e(28),u=e(46),l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a.default.FRAG_LOADING));return r.loaders={},r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"destroy",value:function(){var e=this.loaders;for(var t in e){var r=e[t];r&&r.destroy()}this.loaders={},o.default.prototype.destroy.call(this)}},{key:"onFragLoading",value:function(e){var t=e.frag,r=t.type,n=this.loaders[r],i=this.hls.config;t.loaded=0,n&&(u.logger.warn("abort previous fragment loader for type:"+r),n.abort()),n=this.loaders[r]=t.loader=void 0!==i.fLoader?new i.fLoader(i):new i.loader(i);var a,o,s=void 0;s={url:t.url,frag:t,responseType:"arraybuffer",progressData:!1};var l=t.byteRangeStartOffset,c=t.byteRangeEndOffset;isNaN(l)||isNaN(c)||(s.rangeStart=l,s.rangeEnd=c),a={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:i.fragLoadingMaxRetryTimeout},o={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this),onProgress:this.loadprogress.bind(this)},n.load(s,a,o)}},{key:"loadsuccess",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=e.data,o=r.frag;o.loader=void 0,this.loaders[o.type]=void 0,this.hls.trigger(a.default.FRAG_LOADED,{payload:i,frag:o,stats:t,networkDetails:n})}},{key:"loaderror",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=t.loader;n&&n.abort(),this.loaders[t.type]=void 0,this.hls.trigger(a.default.ERROR,{type:s.ErrorTypes.NETWORK_ERROR,details:s.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t.frag,response:e,networkDetails:r})}},{key:"loadtimeout",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=t.loader;n&&n.abort(),this.loaders[t.type]=void 0,this.hls.trigger(a.default.ERROR,{type:s.ErrorTypes.NETWORK_ERROR,details:s.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t.frag,networkDetails:r})}},{key:"loadprogress",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=t.frag;i.loaded=e.loaded,this.hls.trigger(a.default.FRAG_LOAD_PROGRESS,{frag:i,stats:e,networkDetails:n})}}]),t}(o.default);r.default=l},{28:28,29:29,30:30,46:46}],37:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=n(e(30)),o=n(e(29)),s=e(28),u=e(46),l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,a.default.KEY_LOADING));return r.loaders={},r.decryptkey=null,r.decrypturl=null,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),i(t,[{key:"destroy",value:function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy()}this.loaders={},o.default.prototype.destroy.call(this)}},{key:"onKeyLoading",value:function(e){var t=e.frag,r=t.type,n=this.loaders[r],i=t.decryptdata,o=i.uri;if(o!==this.decrypturl||null===this.decryptkey){var s=this.hls.config;n&&(u.logger.warn("abort previous key loader for type:"+r),n.abort()),t.loader=this.loaders[r]=new s.loader(s),this.decrypturl=o,this.decryptkey=null;var l,c,d;l={url:o,frag:t,responseType:"arraybuffer"},c={timeout:s.fragLoadingTimeOut,maxRetry:s.fragLoadingMaxRetry,retryDelay:s.fragLoadingRetryDelay,maxRetryDelay:s.fragLoadingMaxRetryTimeout},d={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},t.loader.load(l,c,d)}else this.decryptkey&&(i.key=this.decryptkey,this.hls.trigger(a.default.KEY_LOADED,{frag:t}))}},{key:"loadsuccess",value:function(e,t,r){var n=r.frag;this.decryptkey=n.decryptdata.key=new Uint8Array(e.data),n.loader=void 0,this.loaders[n.type]=void 0,this.hls.trigger(a.default.KEY_LOADED,{frag:n})}},{key:"loaderror",value:function(e,t){var r=t.frag,n=r.loader;n&&n.abort(),this.loaders[t.type]=void 0,this.hls.trigger(a.default.ERROR,{type:s.ErrorTypes.NETWORK_ERROR,details:s.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:r,response:e})}},{key:"loadtimeout",value:function(e,t){var r=t.frag,n=r.loader;n&&n.abort(),this.loaders[t.type]=void 0,this.hls.trigger(a.default.ERROR,{type:s.ErrorTypes.NETWORK_ERROR,details:s.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:r})}}]),t}(o.default);r.default=l},{28:28,29:29,30:30,46:46}],38:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=n(e(2)),s=n(e(30)),u=n(e(29)),l=e(28),c=n(e(42)),d=e(46),f=/#EXT-X-STREAM-INF:([^\n\r]*)[\r\n]+([^\r\n]+)/g,h=/#EXT-X-MEDIA:(.*)/g,p=new RegExp([/#EXTINF:(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/|(?!#)(\S+)/.source,/|#EXT-X-BYTERANGE:*(.+)/.source,/|#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/|#.*/.source].join(""),"g"),v=/(?:(?:#(EXTM3U))|(?:#EXT-X-(PLAYLIST-TYPE):(.+))|(?:#EXT-X-(MEDIA-SEQUENCE): *(\d+))|(?:#EXT-X-(TARGETDURATION): *(\d+))|(?:#EXT-X-(KEY):(.+))|(?:#EXT-X-(START):(.+))|(?:#EXT-X-(ENDLIST))|(?:#EXT-X-(DISCONTINUITY-SEQ)UENCE:(\d+))|(?:#EXT-X-(DIS)CONTINUITY))|(?:#EXT-X-(VERSION):(\d+))|(?:#EXT-X-(MAP):(.+))|(?:(#)(.*):(.*))|(?:(#)(.*))(?:.*)\r?\n?/,g=function(){function e(){i(this,e),this.method=null,this.key=null,this.iv=null,this._uri=null}return a(e,[{key:"uri",get:function(){return!this._uri&&this.reluri&&(this._uri=o.default.buildAbsoluteURL(this.baseuri,this.reluri,{alwaysNormalize:!0})),this._uri}}]),e}(),m=function(){function e(){i(this,e),this._url=null,this._byteRange=null,this._decryptdata=null,this.tagList=[]}return a(e,[{key:"createInitializationVector",value:function(e){for(var t=new Uint8Array(16),r=12;r<16;r++)t[r]=e>>8*(15-r)&255;return t}},{key:"fragmentDecryptdataFromLevelkey",value:function(e,t){var r=e;return e&&e.method&&e.uri&&!e.iv&&((r=new g).method=e.method,r.baseuri=e.baseuri,r.reluri=e.reluri,r.iv=this.createInitializationVector(t)),r}},{key:"cloneObj",value:function(e){return JSON.parse(JSON.stringify(e))}},{key:"url",get:function(){return!this._url&&this.relurl&&(this._url=o.default.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url},set:function(e){this._url=e}},{key:"programDateTime",get:function(){return!this._programDateTime&&this.rawProgramDateTime&&(this._programDateTime=new Date(Date.parse(this.rawProgramDateTime))),this._programDateTime}},{key:"byteRange",get:function(){if(!this._byteRange){var e=this._byteRange=[];if(this.rawByteRange){var t=this.rawByteRange.split("@",2);if(1===t.length){var r=this.lastByteRangeEndOffset;e[0]=r||0}else e[0]=parseInt(t[1]);e[1]=parseInt(t[0])+e[0]}}return this._byteRange}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"decryptdata",get:function(){return this._decryptdata||(this._decryptdata=this.fragmentDecryptdataFromLevelkey(this.levelkey,this.sn)),this._decryptdata}}]),e}(),y=function(e){function t(e){i(this,t);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,s.default.MANIFEST_LOADING,s.default.LEVEL_LOADING,s.default.AUDIO_TRACK_LOADING,s.default.SUBTITLE_TRACK_LOADING));return r.loaders={},r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),a(t,[{key:"destroy",value:function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy()}this.loaders={},u.default.prototype.destroy.call(this)}},{key:"onManifestLoading",value:function(e){this.load(e.url,{type:"manifest"})}},{key:"onLevelLoading",value:function(e){this.load(e.url,{type:"level",level:e.level,id:e.id})}},{key:"onAudioTrackLoading",value:function(e){this.load(e.url,{type:"audioTrack",id:e.id})}},{key:"onSubtitleTrackLoading",value:function(e){this.load(e.url,{type:"subtitleTrack",id:e.id})}},{key:"load",value:function(e,t){var r=this.loaders[t.type];if(r){var n=r.context;if(n&&n.url===e)return void d.logger.trace("playlist request ongoing");d.logger.warn("abort previous loader for type:"+t.type),r.abort()}var i=this.hls.config,a=void 0,o=void 0,s=void 0,u=void 0;"manifest"===t.type?(a=i.manifestLoadingMaxRetry,o=i.manifestLoadingTimeOut,s=i.manifestLoadingRetryDelay,u=i.manifestLoadingMaxRetryTimeout):(a=i.levelLoadingMaxRetry,o=i.levelLoadingTimeOut,s=i.levelLoadingRetryDelay,u=i.levelLoadingMaxRetryTimeout,d.logger.log("loading playlist for "+t.type+" "+(t.level||t.id))),r=this.loaders[t.type]=t.loader=void 0!==i.pLoader?new i.pLoader(i):new i.loader(i),t.url=e,t.responseType="";var l,c;l={timeout:o,maxRetry:a,retryDelay:s,maxRetryDelay:u},c={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)},r.load(t,l,c)}},{key:"resolve",value:function(e,t){return o.default.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}},{key:"parseMasterPlaylist",value:function(e,t){var r=[],n=void 0;for(f.lastIndex=0;null!=(n=f.exec(e));){var i={},a=i.attrs=new c.default(n[1]);i.url=this.resolve(n[2],t);var o=a.decimalResolution("RESOLUTION");o&&(i.width=o.width,i.height=o.height),i.bitrate=a.decimalInteger("AVERAGE-BANDWIDTH")||a.decimalInteger("BANDWIDTH"),i.name=a.NAME;var s=a.CODECS;if(s){s=s.split(/[ ,]+/);for(var u=0;u<s.length;u++){var l=s[u];-1!==l.indexOf("avc1")?i.videoCodec=this.avc1toavcoti(l):-1!==l.indexOf("hvc1")?i.videoCodec=l:i.audioCodec=l}}r.push(i)}return r}},{key:"parseMasterPlaylistMedia",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=void 0,a=[],o=0;for(h.lastIndex=0;null!=(i=h.exec(e));){var s={},u=new c.default(i[1]);u.TYPE===r&&(s.groupId=u["GROUP-ID"],s.name=u.NAME,s.type=r,s.default="YES"===u.DEFAULT,s.autoselect="YES"===u.AUTOSELECT,s.forced="YES"===u.FORCED,u.URI&&(s.url=this.resolve(u.URI,t)),s.lang=u.LANGUAGE,s.name||(s.name=s.lang),n&&(s.audioCodec=n),s.id=o++,a.push(s))}return a}},{key:"avc1toavcoti",value:function(e){var t,r=e.split(".");return r.length>2?(t=r.shift()+".",t+=parseInt(r.shift()).toString(16),t+=("000"+parseInt(r.shift()).toString(16)).substr(-4)):t=e,t}},{key:"parseLevelPlaylist",value:function(e,t,r,n){var i,a,o=0,s=0,u={type:null,version:null,url:t,fragments:[],live:!0,startSN:0},l=new g,f=0,h=null,y=new m;for(p.lastIndex=0;null!==(i=p.exec(e));){var b=i[1];if(b){y.duration=parseFloat(b);var E=(" "+i[2]).slice(1);y.title=E||null,y.tagList.push(E?["INF",b,E]:["INF",b])}else if(i[3]){if(!isNaN(y.duration)){var S=o++;y.type=n,y.start=s,y.levelkey=l,y.sn=S,y.level=r,y.cc=f,y.baseurl=t,y.relurl=(" "+i[3]).slice(1),u.fragments.push(y),h=y,s+=y.duration,y=new m}}else if(i[4]){if(y.rawByteRange=(" "+i[4]).slice(1),h){var T=h.byteRangeEndOffset;T&&(y.lastByteRangeEndOffset=T)}}else if(i[5])y.rawProgramDateTime=(" "+i[5]).slice(1),y.tagList.push(["PROGRAM-DATE-TIME",y.rawProgramDateTime]);else{for(i=i[0].match(v),a=1;a<i.length&&void 0===i[a];a++);var w=(" "+i[a+1]).slice(1),_=(" "+i[a+2]).slice(1);switch(i[a]){case"#":y.tagList.push(_?[w,_]:[w]);break;case"PLAYLIST-TYPE":u.type=w.toUpperCase();break;case"MEDIA-SEQUENCE":o=u.startSN=parseInt(w);break;case"TARGETDURATION":u.targetduration=parseFloat(w);break;case"VERSION":u.version=parseInt(w);break;case"EXTM3U":break;case"ENDLIST":u.live=!1;break;case"DIS":f++,y.tagList.push(["DIS"]);break;case"DISCONTINUITY-SEQ":f=parseInt(w);break;case"KEY":var L=w,A=new c.default(L),R=A.enumeratedString("METHOD"),x=A.URI,k=A.hexadecimalInteger("IV");R&&(l=new g,x&&["AES-128","SAMPLE-AES"].indexOf(R)>=0&&(l.method=R,l.baseuri=t,l.reluri=x,l.key=null,l.iv=k));break;case"START":var D=w,C=new c.default(D).decimalFloatingPoint("TIME-OFFSET");isNaN(C)||(u.startTimeOffset=C);break;case"MAP":var O=new c.default(w);y.relurl=O.URI,y.rawByteRange=O.BYTERANGE,y.baseurl=t,y.level=r,y.type=n,y.sn="initSegment",u.initSegment=y,y=new m;break;default:d.logger.warn("line parsed but not handled: "+i)}}}return(y=h)&&!y.relurl&&(u.fragments.pop(),s-=y.duration),u.totalduration=s,u.averagetargetduration=s/u.fragments.length,u.endSN=o-1,u}},{key:"loadsuccess",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=e.data,a=e.url,o=r.type,u=r.id,c=r.level,f=this.hls;if(this.loaders[o]=void 0,void 0!==a&&0!==a.indexOf("data:")||(a=r.url),t.tload=performance.now(),0===i.indexOf("#EXTM3U"))if(i.indexOf("#EXTINF:")>0){var h="audioTrack"!==o&&"subtitleTrack"!==o,p=isNaN(c)?isNaN(u)?0:u:c,v=this.parseLevelPlaylist(i,a,p,"audioTrack"===o?"audio":"subtitleTrack"===o?"subtitle":"main");v.tload=t.tload,"manifest"===o&&f.trigger(s.default.MANIFEST_LOADED,{levels:[{url:a,details:v}],audioTracks:[],url:a,stats:t,networkDetails:n}),t.tparsed=performance.now(),v.targetduration?h?f.trigger(s.default.LEVEL_LOADED,{details:v,level:c||0,id:u||0,stats:t,networkDetails:n}):"audioTrack"===o?f.trigger(s.default.AUDIO_TRACK_LOADED,{details:v,id:u,stats:t,networkDetails:n}):"subtitleTrack"===o&&f.trigger(s.default.SUBTITLE_TRACK_LOADED,{details:v,id:u,stats:t,networkDetails:n}):f.trigger(s.default.ERROR,{type:l.ErrorTypes.NETWORK_ERROR,details:l.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:a,reason:"invalid targetduration",networkDetails:n})}else{var g=this.parseMasterPlaylist(i,a);if(g.length){var m=this.parseMasterPlaylistMedia(i,a,"AUDIO",g[0].audioCodec),y=this.parseMasterPlaylistMedia(i,a,"SUBTITLES");if(m.length){var b=!1;m.forEach((function(e){e.url||(b=!0)})),!1===b&&g[0].audioCodec&&!g[0].attrs.AUDIO&&(d.logger.log("audio codec signaled in quality level, but no embedded audio track signaled, create one"),m.unshift({type:"main",name:"main"}))}f.trigger(s.default.MANIFEST_LOADED,{levels:g,audioTracks:m,subtitles:y,url:a,stats:t,networkDetails:n})}else f.trigger(s.default.ERROR,{type:l.ErrorTypes.NETWORK_ERROR,details:l.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:a,reason:"no level found in manifest",networkDetails:n})}else f.trigger(s.default.ERROR,{type:l.ErrorTypes.NETWORK_ERROR,details:l.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:!0,url:a,reason:"no EXTM3U delimiter",networkDetails:n})}},{key:"loaderror",value:function(e,t){var r,n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=t.loader;switch(t.type){case"manifest":r=l.ErrorDetails.MANIFEST_LOAD_ERROR,n=!0;break;case"level":r=l.ErrorDetails.LEVEL_LOAD_ERROR,n=!1;break;case"audioTrack":r=l.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,n=!1}a&&(a.abort(),this.loaders[t.type]=void 0),this.hls.trigger(s.default.ERROR,{type:l.ErrorTypes.NETWORK_ERROR,details:r,fatal:n,url:a.url,loader:a,response:e,context:t,networkDetails:i})}},{key:"loadtimeout",value:function(e,t){var r,n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=t.loader;switch(t.type){case"manifest":r=l.ErrorDetails.MANIFEST_LOAD_TIMEOUT,n=!0;break;case"level":r=l.ErrorDetails.LEVEL_LOAD_TIMEOUT,n=!1;break;case"audioTrack":r=l.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT,n=!1}a&&(a.abort(),this.loaders[t.type]=void 0),this.hls.trigger(s.default.ERROR,{type:l.ErrorTypes.NETWORK_ERROR,details:r,fatal:n,url:a.url,loader:a,context:t,networkDetails:i})}}]),t}(u.default);r.default=y},{2:2,28:28,29:29,30:30,42:42,46:46}],39:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=Math.pow(2,32)-1,a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return n(e,null,[{key:"init",value:function(){var t;for(t in e.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]},e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var r=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]),n=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]);e.HDLR_TYPES={video:r,audio:n};var i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),a=new Uint8Array([0,0,0,0,0,0,0,0]);e.STTS=e.STSC=e.STCO=a,e.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),e.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),e.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),e.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var o=new Uint8Array([105,115,111,109]),s=new Uint8Array([97,118,99,49]),u=new Uint8Array([0,0,0,1]);e.FTYP=e.box(e.types.ftyp,o,u,o,s),e.DINF=e.box(e.types.dinf,e.box(e.types.dref,i))}},{key:"box",value:function(e){for(var t,r=Array.prototype.slice.call(arguments,1),n=8,i=r.length,a=i;i--;)n+=r[i].byteLength;for((t=new Uint8Array(n))[0]=n>>24&255,t[1]=n>>16&255,t[2]=n>>8&255,t[3]=255&n,t.set(e,4),i=0,n=8;i<a;i++)t.set(r[i],n),n+=r[i].byteLength;return t}},{key:"hdlr",value:function(t){return e.box(e.types.hdlr,e.HDLR_TYPES[t])}},{key:"mdat",value:function(t){return e.box(e.types.mdat,t)}},{key:"mdhd",value:function(t,r){r*=t;var n=Math.floor(r/(i+1)),a=Math.floor(r%(i+1));return e.box(e.types.mdhd,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,n>>24,n>>16&255,n>>8&255,255&n,a>>24,a>>16&255,a>>8&255,255&a,85,196,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t.timescale,t.duration),e.hdlr(t.type),e.minf(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:"minf",value:function(t){return"audio"===t.type?e.box(e.types.minf,e.box(e.types.smhd,e.SMHD),e.DINF,e.stbl(t)):e.box(e.types.minf,e.box(e.types.vmhd,e.VMHD),e.DINF,e.stbl(t))}},{key:"moof",value:function(t,r,n){return e.box(e.types.moof,e.mfhd(t),e.traf(n,r))}},{key:"moov",value:function(t){for(var r=t.length,n=[];r--;)n[r]=e.trak(t[r]);return e.box.apply(null,[e.types.moov,e.mvhd(t[0].timescale,t[0].duration)].concat(n).concat(e.mvex(t)))}},{key:"mvex",value:function(t){for(var r=t.length,n=[];r--;)n[r]=e.trex(t[r]);return e.box.apply(null,[e.types.mvex].concat(n))}},{key:"mvhd",value:function(t,r){r*=t;var n=Math.floor(r/(i+1)),a=Math.floor(r%(i+1)),o=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,n>>24,n>>16&255,n>>8&255,255&n,a>>24,a>>16&255,a>>8&255,255&a,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 e.box(e.types.mvhd,o)}},{key:"sdtp",value:function(t){var r,n,i=t.samples||[],a=new Uint8Array(4+i.length);for(n=0;n<i.length;n++)r=i[n].flags,a[n+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return e.box(e.types.sdtp,a)}},{key:"stbl",value:function(t){return e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.STTS),e.box(e.types.stsc,e.STSC),e.box(e.types.stsz,e.STSZ),e.box(e.types.stco,e.STCO))}},{key:"avc1",value:function(t){var r,n,i,a=[],o=[];for(r=0;r<t.sps.length;r++)i=(n=t.sps[r]).byteLength,a.push(i>>>8&255),a.push(255&i),a=a.concat(Array.prototype.slice.call(n));for(r=0;r<t.pps.length;r++)i=(n=t.pps[r]).byteLength,o.push(i>>>8&255),o.push(255&i),o=o.concat(Array.prototype.slice.call(n));var s=e.box(e.types.avcC,new Uint8Array([1,a[3],a[4],a[5],255,224|t.sps.length].concat(a).concat([t.pps.length]).concat(o))),u=t.width,l=t.height,c=t.pixelRatio[0],d=t.pixelRatio[1];return e.box(e.types.avc1,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,u>>8&255,255&u,l>>8&255,255&l,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]),s,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp,new Uint8Array([c>>24,c>>16&255,c>>8&255,255&c,d>>24,d>>16&255,d>>8&255,255&d])))}},{key:"esds",value:function(e){var t=e.config.length;return 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.config).concat([6,1,2]))}},{key:"mp4a",value:function(t){var r=t.samplerate;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,r>>8&255,255&r,0,0]),e.box(e.types.esds,e.esds(t)))}},{key:"mp3",value:function(t){var r=t.samplerate;return e.box(e.types[".mp3"],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,r>>8&255,255&r,0,0]))}},{key:"stsd",value:function(t){return"audio"===t.type?t.isAAC||"mp3"!==t.codec?e.box(e.types.stsd,e.STSD,e.mp4a(t)):e.box(e.types.stsd,e.STSD,e.mp3(t)):e.box(e.types.stsd,e.STSD,e.avc1(t))}},{key:"tkhd",value:function(t){var r=t.id,n=t.duration*t.timescale,a=t.width,o=t.height,s=Math.floor(n/(i+1)),u=Math.floor(n%(i+1));return e.box(e.types.tkhd,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,u>>24,u>>16&255,u>>8&255,255&u,0,0,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,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,a>>8&255,255&a,0,0,o>>8&255,255&o,0,0]))}},{key:"traf",value:function(t,r){var n=e.sdtp(t),a=t.id,o=Math.floor(r/(i+1)),s=Math.floor(r%(i+1));return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,a>>24,a>>16&255,a>>8&255,255&a])),e.box(e.types.tfdt,new Uint8Array([1,0,0,0,o>>24,o>>16&255,o>>8&255,255&o,s>>24,s>>16&255,s>>8&255,255&s])),e.trun(t,n.length+16+20+8+16+8+8),n)}},{key:"trak",value:function(t){return t.duration=t.duration||4294967295,e.box(e.types.trak,e.tkhd(t),e.mdia(t))}},{key:"trex",value:function(t){var r=t.id;return e.box(e.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"trun",value:function(t,r){var n,i,a,o,s,u,l=t.samples||[],c=l.length,d=12+16*c,f=new Uint8Array(d);for(r+=8+d,f.set([0,0,15,1,c>>>24&255,c>>>16&255,c>>>8&255,255&c,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0),n=0;n<c;n++)a=(i=l[n]).duration,o=i.size,s=i.flags,u=i.cts,f.set([a>>>24&255,a>>>16&255,a>>>8&255,255&a,o>>>24&255,o>>>16&255,o>>>8&255,255&o,s.isLeading<<2|s.dependsOn,s.isDependedOn<<6|s.hasRedundancy<<4|s.paddingValue<<1|s.isNonSync,61440&s.degradPrio,15&s.degradPrio,u>>>24&255,u>>>16&255,u>>>8&255,255&u],12+16*n);return e.box(e.types.trun,f)}},{key:"initSegment",value:function(t){e.types||e.init();var r,n=e.moov(t);return(r=new Uint8Array(e.FTYP.byteLength+n.byteLength)).set(e.FTYP),r.set(n,e.FTYP.byteLength),r}}]),e}();r.default=a},{}],40:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(r,"__esModule",{value:!0});var i=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=n(e(31)),o=n(e(30)),s=e(46),u=n(e(39)),l=e(28),c=function(){function e(t,r,n,i){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.observer=t,this.config=r,this.typeSupported=n;var a=navigator.userAgent;this.isSafari=i&&i.indexOf("Apple")>-1&&a&&!a.match("CriOS"),this.ISGenerated=!1}return i(e,[{key:"destroy",value:function(){}},{key:"resetTimeStamp",value:function(e){this._initPTS=this._initDTS=e}},{key:"resetInitSegment",value:function(){this.ISGenerated=!1}},{key:"remux",value:function(e,t,r,n,i,a,u){if(this.ISGenerated){if(u){var l=this._initPTS,c=this._PTSNormalize,d=e.inputTimeScale||t.inputTimeScale,f=1/0,h=1/0,p=e.samples;if(p.length&&(f=h=c(p[0].pts-d*i,l)),(p=t.samples).length){var v=p[0];f=Math.min(f,c(v.pts-d*i,l)),h=Math.min(h,c(v.dts-d*i,l))}if(f!==1/0){var g=l-f;Math.abs(g)>10*d&&(s.logger.warn("timestamp inconsistency, "+(g/d).toFixed(3)+"s delta against expected value: missing discontinuity ? reset initPTS/initDTS"),this._initPTS=f,this._initDTS=h,this.observer.trigger(o.default.INIT_PTS_FOUND,{initPTS:f}))}}}else this.generateIS(e,t,i);if(this.ISGenerated)if(e.samples.length){e.timescale||(s.logger.warn("regenerate InitSegment as audio detected"),this.generateIS(e,t,i));var m=this.remuxAudio(e,i,a,u);if(t.samples.length){var y=void 0;m&&(y=m.endPTS-m.startPTS),t.timescale||(s.logger.warn("regenerate InitSegment as video detected"),this.generateIS(e,t,i)),this.remuxVideo(t,i,a,y,u)}}else{var b=void 0;t.samples.length&&(b=this.remuxVideo(t,i,a,u)),b&&e.codec&&this.remuxEmptyAudio(e,i,a,b)}r.samples.length&&this.remuxID3(r,i),n.samples.length&&this.remuxText(n,i),this.observer.trigger(o.default.FRAG_PARSED)}},{key:"generateIS",value:function(e,t,r){var n,i,a=this.observer,c=e.samples,d=t.samples,f=this.typeSupported,h="audio/mp4",p={},v={tracks:p},g=void 0===this._initPTS;if(g&&(n=i=1/0),e.config&&c.length&&(e.timescale=e.samplerate,s.logger.log("audio sampling rate : "+e.samplerate),e.isAAC||(f.mpeg?(h="audio/mpeg",e.codec=""):f.mp3&&(e.codec="mp3")),p.audio={container:h,codec:e.codec,initSegment:!e.isAAC&&f.mpeg?new Uint8Array:u.default.initSegment([e]),metadata:{channelCount:e.channelCount}},g&&(n=i=c[0].pts-e.inputTimeScale*r)),t.sps&&t.pps&&d.length){var m=t.inputTimeScale;t.timescale=m,p.video={container:"video/mp4",codec:t.codec,initSegment:u.default.initSegment([t]),metadata:{width:t.width,height:t.height}},g&&(n=Math.min(n,d[0].pts-m*r),i=Math.min(i,d[0].dts-m*r),this.observer.trigger(o.default.INIT_PTS_FOUND,{initPTS:n}))}Object.keys(p).length?(a.trigger(o.default.FRAG_PARSING_INIT_SEGMENT,v),this.ISGenerated=!0,g&&(this._initPTS=n,this._initDTS=i)):a.trigger(o.default.ERROR,{type:l.ErrorTypes.MEDIA_ERROR,details:l.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"no audio/video samples found"})}},{key:"remuxVideo",value:function(e,t,r,n,i){var a,c,d,f,h,p,v,g=8,m=e.timescale,y=e.samples,b=[],E=y.length,S=this._PTSNormalize,T=this._initDTS,w=this.nextAvcDts,_=this.isSafari;_&&(r|=y.length&&w&&(i&&Math.abs(t-w/m)<.1||Math.abs(y[0].pts-w-T)<m/5)),r||(w=t*m),y.forEach((function(e){e.pts=S(e.pts-T,w),e.dts=S(e.dts-T,w)})),y.sort((function(e,t){var r=e.dts-t.dts,n=e.pts-t.pts;return r||n||e.id-t.id}));var L=y.reduce((function(e,t){return Math.max(Math.min(e,t.pts-t.dts),-18e3)}),0);if(L<0){s.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Math.round(L/90)+" ms to overcome this issue");for(var A=0;A<y.length;A++)y[A].dts+=L}var R=y[0];h=Math.max(R.dts,0),f=Math.max(R.pts,0);var x=Math.round((h-w)/90);r&&x&&(x>1?s.logger.log("AVC:"+x+" ms hole between fragments detected,filling it"):x<-1&&s.logger.log("AVC:"+-x+" ms overlapping between fragments detected"),h=w,y[0].dts=h,f=Math.max(f-x,w),y[0].pts=f,s.logger.log("Video/PTS/DTS adjusted: "+Math.round(f/90)+"/"+Math.round(h/90)+",delta:"+x+" ms")),R=y[y.length-1],v=Math.max(R.dts,0),p=Math.max(R.pts,0,v),_&&(a=Math.round((v-h)/(y.length-1)));for(var k=0,D=0,C=0;C<E;C++){for(var O=y[C],P=O.units,M=P.length,B=0,I=0;I<M;I++)B+=P[I].data.length;D+=B,k+=M,O.length=B,O.dts=_?h+C*a:Math.max(O.dts,h),O.pts=Math.max(O.pts,O.dts)}var N=D+4*k+8;try{c=new Uint8Array(N)}catch(e){return void this.observer.trigger(o.default.ERROR,{type:l.ErrorTypes.MUX_ERROR,details:l.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:N,reason:"fail allocating video mdat "+N})}var F=new DataView(c.buffer);F.setUint32(0,N),c.set(u.default.types.mdat,4);for(var U=0;U<E;U++){for(var j=y[U],V=j.units,G=0,H=void 0,z=0,q=V.length;z<q;z++){var K=V[z],W=K.data,$=K.data.byteLength;F.setUint32(g,$),g+=4,c.set(W,g),g+=$,G+=4+$}if(_)H=Math.max(0,a*Math.round((j.pts-j.dts)/a));else{if(U<E-1)a=y[U+1].dts-j.dts;else{var Y=this.config,Q=j.dts-y[U>0?U-1:U].dts;if(Y.stretchShortVideoTrack){var X=Y.maxBufferHole,Z=Y.maxSeekHole,J=Math.floor(Math.min(X,Z)*m),ee=(n?f+n*m:this.nextAudioPts)-j.pts;ee>J?((a=ee-Q)<0&&(a=Q),s.logger.log("It is approximately "+ee/90+" ms to the next segment; using duration "+a/90+" ms for the last video frame.")):a=Q}else a=Q}H=Math.round(j.pts-j.dts)}b.push({size:G,duration:a,cts:H,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:j.key?2:1,isNonSync:j.key?0:1}})}this.nextAvcDts=v+a;var te=e.dropped;if(e.len=0,e.nbNalu=0,e.dropped=0,b.length&&navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var re=b[0].flags;re.dependsOn=2,re.isNonSync=0}e.samples=b,d=u.default.moof(e.sequenceNumber++,h,e),e.samples=[];var ne={data1:d,data2:c,startPTS:f/m,endPTS:(p+a)/m,startDTS:h/m,endDTS:this.nextAvcDts/m,type:"video",nb:b.length,dropped:te};return this.observer.trigger(o.default.FRAG_PARSING_DATA,ne),ne}},{key:"remuxAudio",value:function(e,t,r,n){var i,c,d,f,h,p,v,g=e.inputTimeScale,m=g/e.timescale,y=(e.isAAC?1024:1152)*m,b=this._PTSNormalize,E=this._initDTS,S=!e.isAAC&&this.typeSupported.mpeg,T=e.samples,w=[],_=this.nextAudioPts;if((r|=T.length&&_&&(n&&Math.abs(t-_/g)<.1||Math.abs(T[0].pts-_-E)<20*y))||(_=t*g),T.forEach((function(e){e.pts=e.dts=b(e.pts-E,_)})),T.sort((function(e,t){return e.pts-t.pts})),n&&e.isAAC)for(var L=0,A=_;L<T.length;){var R,x=T[L];R=x.pts-A;var k=Math.abs(1e3*R/g);if(R<=-y)s.logger.warn("Dropping 1 audio frame @ "+(A/g).toFixed(3)+"s due to "+k+" ms overlap."),T.splice(L,1),e.len-=x.unit.length;else if(R>=y&&k<1e4&&A){var D=Math.round(R/y);s.logger.warn("Injecting "+D+" audio frame @ "+(A/g).toFixed(3)+"s due to "+Math.round(1e3*R/g)+" ms gap.");for(var C=0;C<D;C++){var O=Math.max(A,0);(d=a.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount))||(s.logger.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),d=x.unit.subarray()),T.splice(L,0,{unit:d,pts:O,dts:O}),e.len+=d.length,A+=y,L++}x.pts=x.dts=A,A+=y,L++}else Math.abs(R),x.pts=x.dts=A,A+=y,L++}for(var P=0,M=T.length;P<M;P++){var B=T[P],I=B.unit,N=B.pts;if(void 0!==v)c.duration=Math.round((N-v)/m);else{var F=Math.round(1e3*(N-_)/g),U=0;if(r&&e.isAAC&&F){if(F>0&&F<1e4)U=Math.round((N-_)/y),s.logger.log(F+" ms hole between AAC samples detected,filling it"),U>0&&((d=a.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount))||(d=I.subarray()),e.len+=U*d.length);else if(F<-12){s.logger.log("drop overlapping AAC sample, expected/parsed/delta:"+(_/g).toFixed(3)+"s/"+(N/g).toFixed(3)+"s/"+-F+"ms"),e.len-=I.byteLength;continue}N=_}if(p=Math.max(0,N),!(e.len>0))return;var j=S?e.len:e.len+8;i=S?0:8;try{f=new Uint8Array(j)}catch(e){return void this.observer.trigger(o.default.ERROR,{type:l.ErrorTypes.MUX_ERROR,details:l.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:j,reason:"fail allocating audio mdat "+j})}S||(new DataView(f.buffer).setUint32(0,j),f.set(u.default.types.mdat,4));for(var V=0;V<U;V++)(d=a.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount))||(s.logger.log("Unable to get silent frame for given audio codec; duplicating this frame instead."),d=I.subarray()),f.set(d,i),i+=d.byteLength,c={size:d.byteLength,cts:0,duration:1024,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},w.push(c)}f.set(I,i);var G=I.byteLength;i+=G,c={size:G,cts:0,duration:0,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},w.push(c),v=N}var H=0,z=w.length;if(z>=2&&(H=w[z-2].duration,c.duration=H),z){this.nextAudioPts=_=v+m*H,e.len=0,e.samples=w,h=S?new Uint8Array:u.default.moof(e.sequenceNumber++,p/m,e),e.samples=[];var q=p/g,K=_/g,W={data1:h,data2:f,startPTS:q,endPTS:K,startDTS:q,endDTS:K,type:"audio",nb:z};return this.observer.trigger(o.default.FRAG_PARSING_DATA,W),W}return null}},{key:"remuxEmptyAudio",value:function(e,t,r,n){var i=e.inputTimeScale,o=i/(e.samplerate?e.samplerate:i),u=this.nextAudioPts,l=(void 0!==u?u:n.startDTS*i)+this._initDTS,c=n.endDTS*i+this._initDTS,d=1024*o,f=Math.ceil((c-l)/d),h=a.default.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(s.logger.warn("remux empty Audio"),h){for(var p=[],v=0;v<f;v++){var g=l+v*d;p.push({unit:h,pts:g,dts:g}),e.len+=h.length}e.samples=p,this.remuxAudio(e,t,r)}else s.logger.trace("Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec!")}},{key:"remuxID3",value:function(e,t){var r,n=e.samples.length,i=e.inputTimeScale,a=this._initPTS,s=this._initDTS;if(n){for(var u=0;u<n;u++)(r=e.samples[u]).pts=(r.pts-a)/i,r.dts=(r.dts-s)/i;this.observer.trigger(o.default.FRAG_PARSING_METADATA,{samples:e.samples})}e.samples=[]}},{key:"remuxText",value:function(e,t){e.samples.sort((function(e,t){return e.pts-t.pts}));var r,n=e.samples.length,i=e.inputTimeScale,a=this._initPTS;if(n){for(var s=0;s<n;s++)(r=e.samples[s]).pts=(r.pts-a)/i;this.observer.trigger(o.default.FRAG_PARSING_USERDATA,{samples:e.samples})}e.samples=[]}},{key:"_PTSNormalize",value:function(e,t){var r;if(void 0===t)return e;for(r=t<e?-8589934592:8589934592;Math.abs(e-t)>4294967296;)e+=r;return e}}]),e}();r.default=c},{28:28,30:30,31:31,39:39,46:46}],41:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e){return e&&e.__esModule?e:{default:e}}(e(30)),a=function(){function e(t){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.observer=t}return n(e,[{key:"destroy",value:function(){}},{key:"resetTimeStamp",value:function(){}},{key:"resetInitSegment",value:function(){}},{key:"remux",value:function(e,t,r,n,a,o,s,u){var l=this.observer,c="";e&&(c+="audio"),t&&(c+="video"),l.trigger(i.default.FRAG_PARSING_DATA,{data1:u,startPTS:a,startDTS:a,type:c,nb:1,dropped:0}),l.trigger(i.default.FRAG_PARSED)}}]),e}();r.default=a},{30:30}],42:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=/^(\d+)x(\d+)$/,a=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,o=function(){function e(t){for(var r in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),"string"==typeof t&&(t=e.parseAttrList(t)),t)t.hasOwnProperty(r)&&(this[r]=t[r])}return n(e,[{key:"decimalInteger",value:function(e){var t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}},{key:"hexadecimalInteger",value:function(e){if(this[e]){var t=(this[e]||"0x").slice(2);t=(1&t.length?"0":"")+t;for(var r=new Uint8Array(t.length/2),n=0;n<t.length/2;n++)r[n]=parseInt(t.slice(2*n,2*n+2),16);return r}return null}},{key:"hexadecimalIntegerAsNumber",value:function(e){var t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}},{key:"decimalFloatingPoint",value:function(e){return parseFloat(this[e])}},{key:"enumeratedString",value:function(e){return this[e]}},{key:"decimalResolution",value:function(e){var t=i.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}}],[{key:"parseAttrList",value:function(e){var t,r={};for(a.lastIndex=0;null!==(t=a.exec(e));){var n=t[2];0===n.indexOf('"')&&n.lastIndexOf('"')===n.length-1&&(n=n.slice(1,-1)),r[t[1]]=n}return r}}]),e}();r.default=o},{}],43:[function(e,t,r){"use strict";t.exports={search:function(e,t){for(var r=0,n=e.length-1,i=null,a=null;r<=n;){var o=t(a=e[i=(r+n)/2|0]);if(o>0)r=i+1;else{if(!(o<0))return a;n=i-1}}return null}}},{}],44:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e){return e&&e.__esModule?e:{default:e}}(e(45)),a=function(){function e(t,r,n,a){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.hls=t,this.defaultEstimate_=a,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new i.default(r),this.fast_=new i.default(n)}return n(e,[{key:"sample",value:function(e,t){var r=8e3*t/(e=Math.max(e,this.minDelayMs_)),n=e/1e3;this.fast_.sample(n,r),this.slow_.sample(n,r)}},{key:"canEstimate",value:function(){var e=this.fast_;return e&&e.getTotalWeight()>=this.minWeight_}},{key:"getEstimate",value:function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}},{key:"destroy",value:function(){}}]),e}();r.default=a},{45:45}],45:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(){function e(t){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.alpha_=t?Math.exp(Math.log(.5)/t):0,this.estimate_=0,this.totalWeight_=0}return n(e,[{key:"sample",value:function(e,t){var r=Math.pow(this.alpha_,e);this.estimate_=t*(1-r)+r*this.estimate_,this.totalWeight_+=e}},{key:"getTotalWeight",value:function(){return this.totalWeight_}},{key:"getEstimate",value:function(){if(this.alpha_){var e=1-Math.pow(this.alpha_,this.totalWeight_);return this.estimate_/e}return this.estimate_}}]),e}();r.default=i},{}],46:[function(e,t,r){"use strict";function n(){}function i(e){var t=self.console[e];return t?function(){for(var r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];n[0]&&(n[0]=function(e,t){return"["+e+"] > "+t}(e,n[0])),t.apply(self.console,n)}:n}Object.defineProperty(r,"__esModule",{value:!0});var a="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},o={trace:n,debug:n,log:n,warn:n,info:n,error:n},s=o;r.enableLogs=function(e){if(!0===e||"object"===(void 0===e?"undefined":a(e))){!function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];r.forEach((function(t){s[t]=e[t]?e[t].bind(e):i(t)}))}(e,"debug","log","info","warn","error");try{s.log()}catch(e){s=o}}else s=o},r.logger=s},{}],47:[function(e,t,r){"use strict";t.exports={toString:function(e){for(var t="",r=e.length,n=0;n<r;n++)t+="["+e.start(n).toFixed(3)+","+e.end(n).toFixed(3)+"]";return t}}},{}],48:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(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)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=e(46),a=function(){function e(t){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),t&&t.xhrSetup&&(this.xhrSetup=t.xhrSetup)}return n(e,[{key:"destroy",value:function(){this.abort(),this.loader=null}},{key:"abort",value:function(){var e=this.loader;e&&4!==e.readyState&&(this.stats.aborted=!0,e.abort()),window.clearTimeout(this.requestTimeout),this.requestTimeout=null,window.clearTimeout(this.retryTimeout),this.retryTimeout=null}},{key:"load",value:function(e,t,r){this.context=e,this.config=t,this.callbacks=r,this.stats={trequest:performance.now(),retry:0},this.retryDelay=t.retryDelay,this.loadInternal()}},{key:"loadInternal",value:function(){var e,t=this.context;e="undefined"!=typeof XDomainRequest?this.loader=new XDomainRequest:this.loader=new XMLHttpRequest;var r=this.stats;r.tfirst=0,r.loaded=0;var n=this.xhrSetup;try{if(n)try{n(e,t.url)}catch(r){e.open("GET",t.url,!0),n(e,t.url)}e.readyState||e.open("GET",t.url,!0)}catch(r){return void this.callbacks.onError({code:e.status,text:r.message},t,e)}t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),this.config.timeout),e.send()}},{key:"readystatechange",value:function(e){var t=e.currentTarget,r=t.readyState,n=this.stats,a=this.context,o=this.config;if(!n.aborted&&r>=2)if(window.clearTimeout(this.requestTimeout),0===n.tfirst&&(n.tfirst=Math.max(performance.now(),n.trequest)),4===r){var s=t.status;if(s>=200&&s<300){n.tload=Math.max(n.tfirst,performance.now());var u,l=void 0;u="arraybuffer"===a.responseType?(l=t.response).byteLength:(l=t.responseText).length,n.loaded=n.total=u;var c={url:t.responseURL,data:l};this.callbacks.onSuccess(c,n,a,t)}else n.retry>=o.maxRetry||s>=400&&s<499?(i.logger.error(s+" while loading "+a.url),this.callbacks.onError({code:s,text:t.statusText},a,t)):(i.logger.warn(s+" while loading "+a.url+", retrying in "+this.retryDelay+"..."),this.destroy(),this.retryTimeout=window.setTimeout(this.loadInternal.bind(this),this.retryDelay),this.retryDelay=Math.min(2*this.retryDelay,o.maxRetryDelay),n.retry++)}else this.requestTimeout=window.setTimeout(this.loadtimeout.bind(this),o.timeout)}},{key:"loadtimeout",value:function(){i.logger.warn("timeout while loading "+this.context.url),this.callbacks.onTimeout(this.stats,this.context,null)}},{key:"loadprogress",value:function(e){var t=e.currentTarget,r=this.stats;r.loaded=e.loaded,e.lengthComputable&&(r.total=e.total);var n=this.callbacks.onProgress;n&&n(r,this.context,null,t)}}]),e}();r.default=a},{46:46}]},{},[35])(35)},4146:function(e,t,r){"use strict";var n=r(73404),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function u(e){return n.isMemo(e)?o:s[e.$$typeof]||i}s[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[n.Memo]=o;var l=Object.defineProperty,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,r,n){if("string"!=typeof r){if(p){var i=h(r);i&&i!==p&&e(t,i,n)}var o=c(r);d&&(o=o.concat(d(r)));for(var s=u(t),v=u(r),g=0;g<o.length;++g){var m=o[g];if(!(a[m]||n&&n[m]||v&&v[m]||s&&s[m])){var y=f(r,m);try{l(t,m,y)}catch(e){}}}}return t}},3072:function(e,t){"use strict";var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,a=r?Symbol.for("react.fragment"):60107,o=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,l=r?Symbol.for("react.context"):60110,c=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,h=r?Symbol.for("react.suspense"):60113,p=r?Symbol.for("react.suspense_list"):60120,v=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116,m=r?Symbol.for("react.block"):60121,y=r?Symbol.for("react.fundamental"):60117,b=r?Symbol.for("react.responder"):60118,E=r?Symbol.for("react.scope"):60119;function S(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case c:case d:case a:case s:case o:case h:return e;default:switch(e=e&&e.$$typeof){case l:case f:case g:case v:case u:return e;default:return t}}case i:return t}}}function T(e){return S(e)===d}t.AsyncMode=c,t.ConcurrentMode=d,t.ContextConsumer=l,t.ContextProvider=u,t.Element=n,t.ForwardRef=f,t.Fragment=a,t.Lazy=g,t.Memo=v,t.Portal=i,t.Profiler=s,t.StrictMode=o,t.Suspense=h,t.isAsyncMode=function(e){return T(e)||S(e)===c},t.isConcurrentMode=T,t.isContextConsumer=function(e){return S(e)===l},t.isContextProvider=function(e){return S(e)===u},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return S(e)===f},t.isFragment=function(e){return S(e)===a},t.isLazy=function(e){return S(e)===g},t.isMemo=function(e){return S(e)===v},t.isPortal=function(e){return S(e)===i},t.isProfiler=function(e){return S(e)===s},t.isStrictMode=function(e){return S(e)===o},t.isSuspense=function(e){return S(e)===h},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===d||e===s||e===o||e===h||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===v||e.$$typeof===u||e.$$typeof===l||e.$$typeof===f||e.$$typeof===y||e.$$typeof===b||e.$$typeof===E||e.$$typeof===m)},t.typeOf=S},73404:function(e,t,r){"use strict";e.exports=r(3072)},20311:function(e){"use strict";e.exports=function(e,t,r,n,i,a,o,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[r,n,i,a,o,s],c=0;(u=new Error(t.replace(/%s/g,(function(){return l[c++]})))).name="Invariant Violation"}throw u.framesToPop=1,u}}},50849:function(e,t,r){e.exports=r(81925)},34572:function(e,t,r){"use strict";r.d(t,{A:function(){return se}});var n="0123456789abcdefghijklmnopqrstuvwxyz";function i(e){return n.charAt(e)}function a(e,t){return e&t}function o(e,t){return e|t}function s(e,t){return e^t}function u(e,t){return e&~t}function l(e){if(0==e)return-1;var t=0;return 65535&e||(e>>=16,t+=16),255&e||(e>>=8,t+=8),15&e||(e>>=4,t+=4),3&e||(e>>=2,t+=2),1&e||++t,t}function c(e){for(var t=0;0!=e;)e&=e-1,++t;return t}var d,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function h(e){var t,r,n="";for(t=0;t+3<=e.length;t+=3)r=parseInt(e.substring(t,t+3),16),n+=f.charAt(r>>6)+f.charAt(63&r);for(t+1==e.length?(r=parseInt(e.substring(t,t+1),16),n+=f.charAt(r<<2)):t+2==e.length&&(r=parseInt(e.substring(t,t+2),16),n+=f.charAt(r>>2)+f.charAt((3&r)<<4));(3&n.length)>0;)n+="=";return n}function p(e){var t,r="",n=0,a=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t){var o=f.indexOf(e.charAt(t));o<0||(0==n?(r+=i(o>>2),a=3&o,n=1):1==n?(r+=i(a<<2|o>>4),a=15&o,n=2):2==n?(r+=i(a),r+=i(o>>2),a=3&o,n=3):(r+=i(a<<2|o>>4),r+=i(15&o),n=0))}return 1==n&&(r+=i(a<<2)),r}var v,g={decode:function(e){var t;if(void 0===v){for(v=Object.create(null),t=0;t<64;++t)v["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;for(v["-"]=62,v._=63,t=0;t<9;++t)v["= \f\n\r\t \u2028\u2029".charAt(t)]=-1}var r=[],n=0,i=0;for(t=0;t<e.length;++t){var a=e.charAt(t);if("="==a)break;if(-1!=(a=v[a])){if(void 0===a)throw new Error("Illegal character at offset "+t);n|=a,++i>=4?(r[r.length]=n>>16,r[r.length]=n>>8&255,r[r.length]=255&n,n=0,i=0):n<<=6}}switch(i){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:r[r.length]=n>>10;break;case 3:r[r.length]=n>>16,r[r.length]=n>>8&255}return r},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(e){var t=g.re.exec(e);if(t)if(t[1])e=t[1];else{if(!t[2])throw new Error("RegExp out of sync");e=t[2]}return g.decode(e)}},m=1e13,y=function(){function e(e){this.buf=[+e||0]}return e.prototype.mulAdd=function(e,t){var r,n,i=this.buf,a=i.length;for(r=0;r<a;++r)(n=i[r]*e+t)<m?t=0:n-=(t=0|n/m)*m,i[r]=n;t>0&&(i[r]=t)},e.prototype.sub=function(e){var t,r,n=this.buf,i=n.length;for(t=0;t<i;++t)(r=n[t]-e)<0?(r+=m,e=1):e=0,n[t]=r;for(;0===n[n.length-1];)n.pop()},e.prototype.toString=function(e){if(10!=(e||10))throw new Error("only base 10 is supported");for(var t=this.buf,r=t[t.length-1].toString(),n=t.length-2;n>=0;--n)r+=(m+t[n]).toString().substring(1);return r},e.prototype.valueOf=function(){for(var e=this.buf,t=0,r=e.length-1;r>=0;--r)t=t*m+e[r];return t},e.prototype.simplify=function(){var e=this.buf;return 1==e.length?e[0]:this},e}(),b=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,E=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function S(e,t){return e.length>t&&(e=e.substring(0,t)+"…"),e}var T,w=function(){function e(t,r){this.hexDigits="0123456789ABCDEF",t instanceof e?(this.enc=t.enc,this.pos=t.pos):(this.enc=t,this.pos=r)}return e.prototype.get=function(e){if(void 0===e&&(e=this.pos++),e>=this.enc.length)throw new Error("Requesting byte offset ".concat(e," on a stream of length ").concat(this.enc.length));return"string"==typeof this.enc?this.enc.charCodeAt(e):this.enc[e]},e.prototype.hexByte=function(e){return this.hexDigits.charAt(e>>4&15)+this.hexDigits.charAt(15&e)},e.prototype.hexDump=function(e,t,r){for(var n="",i=e;i<t;++i)if(n+=this.hexByte(this.get(i)),!0!==r)switch(15&i){case 7:n+=" ";break;case 15:n+="\n";break;default:n+=" "}return n},e.prototype.isASCII=function(e,t){for(var r=e;r<t;++r){var n=this.get(r);if(n<32||n>176)return!1}return!0},e.prototype.parseStringISO=function(e,t){for(var r="",n=e;n<t;++n)r+=String.fromCharCode(this.get(n));return r},e.prototype.parseStringUTF=function(e,t){for(var r="",n=e;n<t;){var i=this.get(n++);r+=i<128?String.fromCharCode(i):i>191&&i<224?String.fromCharCode((31&i)<<6|63&this.get(n++)):String.fromCharCode((15&i)<<12|(63&this.get(n++))<<6|63&this.get(n++))}return r},e.prototype.parseStringBMP=function(e,t){for(var r,n,i="",a=e;a<t;)r=this.get(a++),n=this.get(a++),i+=String.fromCharCode(r<<8|n);return i},e.prototype.parseTime=function(e,t,r){var n=this.parseStringISO(e,t),i=(r?b:E).exec(n);return i?(r&&(i[1]=+i[1],i[1]+=+i[1]<70?2e3:1900),n=i[1]+"-"+i[2]+"-"+i[3]+" "+i[4],i[5]&&(n+=":"+i[5],i[6]&&(n+=":"+i[6],i[7]&&(n+="."+i[7]))),i[8]&&(n+=" UTC","Z"!=i[8]&&(n+=i[8],i[9]&&(n+=":"+i[9]))),n):"Unrecognized time: "+n},e.prototype.parseInteger=function(e,t){for(var r,n=this.get(e),i=n>127,a=i?255:0,o="";n==a&&++e<t;)n=this.get(e);if(0==(r=t-e))return i?-1:0;if(r>4){for(o=n,r<<=3;!(128&(+o^a));)o=+o<<1,--r;o="("+r+" bit)\n"}i&&(n-=256);for(var s=new y(n),u=e+1;u<t;++u)s.mulAdd(256,this.get(u));return o+s.toString()},e.prototype.parseBitString=function(e,t,r){for(var n=this.get(e),i="("+((t-e-1<<3)-n)+" bit)\n",a="",o=e+1;o<t;++o){for(var s=this.get(o),u=o==t-1?n:0,l=7;l>=u;--l)a+=s>>l&1?"1":"0";if(a.length>r)return i+S(a,r)}return i+a},e.prototype.parseOctetString=function(e,t,r){if(this.isASCII(e,t))return S(this.parseStringISO(e,t),r);var n=t-e,i="("+n+" byte)\n";n>(r/=2)&&(t=e+r);for(var a=e;a<t;++a)i+=this.hexByte(this.get(a));return n>r&&(i+="…"),i},e.prototype.parseOID=function(e,t,r){for(var n="",i=new y,a=0,o=e;o<t;++o){var s=this.get(o);if(i.mulAdd(128,127&s),a+=7,!(128&s)){if(""===n)if((i=i.simplify())instanceof y)i.sub(80),n="2."+i.toString();else{var u=i<80?i<40?0:1:2;n=u+"."+(i-40*u)}else n+="."+i.toString();if(n.length>r)return S(n,r);i=new y,a=0}}return a>0&&(n+=".incomplete"),n},e}(),_=function(){function e(e,t,r,n,i){if(!(n instanceof L))throw new Error("Invalid tag value.");this.stream=e,this.header=t,this.length=r,this.tag=n,this.sub=i}return e.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},e.prototype.content=function(e){if(void 0===this.tag)return null;void 0===e&&(e=1/0);var t=this.posContent(),r=Math.abs(this.length);if(!this.tag.isUniversal())return null!==this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+r,e);switch(this.tag.tagNumber){case 1:return 0===this.stream.get(t)?"false":"true";case 2:return this.stream.parseInteger(t,t+r);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(t,t+r,e);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+r,e);case 6:return this.stream.parseOID(t,t+r,e);case 16:case 17:return null!==this.sub?"("+this.sub.length+" elem)":"(no elem)";case 12:return S(this.stream.parseStringUTF(t,t+r),e);case 18:case 19:case 20:case 21:case 22:case 26:return S(this.stream.parseStringISO(t,t+r),e);case 30:return S(this.stream.parseStringBMP(t,t+r),e);case 23:case 24:return this.stream.parseTime(t,t+r,23==this.tag.tagNumber)}return null},e.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"},e.prototype.toPrettyString=function(e){void 0===e&&(e="");var t=e+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(t+="+"),t+=this.length,this.tag.tagConstructed?t+=" (constructed)":!this.tag.isUniversal()||3!=this.tag.tagNumber&&4!=this.tag.tagNumber||null===this.sub||(t+=" (encapsulates)"),t+="\n",null!==this.sub){e+=" ";for(var r=0,n=this.sub.length;r<n;++r)t+=this.sub[r].toPrettyString(e)}return t},e.prototype.posStart=function(){return this.stream.pos},e.prototype.posContent=function(){return this.stream.pos+this.header},e.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},e.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},e.decodeLength=function(e){var t=e.get(),r=127&t;if(r==t)return r;if(r>6)throw new Error("Length over 48 bits not supported at position "+(e.pos-1));if(0===r)return null;t=0;for(var n=0;n<r;++n)t=256*t+e.get();return t},e.prototype.getHexStringValue=function(){var e=this.toHexString(),t=2*this.header,r=2*this.length;return e.substr(t,r)},e.decode=function(t){var r;r=t instanceof w?t:new w(t,0);var n=new w(r),i=new L(r),a=e.decodeLength(r),o=r.pos,s=o-n.pos,u=null,l=function(){var t=[];if(null!==a){for(var n=o+a;r.pos<n;)t[t.length]=e.decode(r);if(r.pos!=n)throw new Error("Content size is not correct for container starting at offset "+o)}else try{for(;;){var i=e.decode(r);if(i.tag.isEOC())break;t[t.length]=i}a=o-r.pos}catch(e){throw new Error("Exception while decoding undefined length content: "+e)}return t};if(i.tagConstructed)u=l();else if(i.isUniversal()&&(3==i.tagNumber||4==i.tagNumber))try{if(3==i.tagNumber&&0!=r.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");u=l();for(var c=0;c<u.length;++c)if(u[c].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(e){u=null}if(null===u){if(null===a)throw new Error("We can't skip over an invalid tag with undefined length at offset "+o);r.pos=o+Math.abs(a)}return new e(n,s,a,i,u)},e}(),L=function(){function e(e){var t=e.get();if(this.tagClass=t>>6,this.tagConstructed=!!(32&t),this.tagNumber=31&t,31==this.tagNumber){var r=new y;do{t=e.get(),r.mulAdd(128,127&t)}while(128&t);this.tagNumber=r.simplify()}}return e.prototype.isUniversal=function(){return 0===this.tagClass},e.prototype.isEOC=function(){return 0===this.tagClass&&0===this.tagNumber},e}(),A=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],R=(1<<26)/A[A.length-1],x=function(){function e(e,t,r){null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}return e.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,a=!1,o="",s=this.t,u=this.DB-s*this.DB%t;if(s-- >0)for(u<this.DB&&(r=this[s]>>u)>0&&(a=!0,o=i(r));s>=0;)u<t?(r=(this[s]&(1<<u)-1)<<t-u,r|=this[--s]>>(u+=this.DB-t)):(r=this[s]>>(u-=t)&n,u<=0&&(u+=this.DB,--s)),r>0&&(a=!0),a&&(o+=i(r));return a?o:"0"},e.prototype.negate=function(){var t=P();return e.ZERO.subTo(this,t),t},e.prototype.abs=function(){return this.s<0?this.negate():this},e.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this[r]-e[r]))return t;return 0},e.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+V(this[this.t-1]^this.s&this.DM)},e.prototype.mod=function(t){var r=P();return this.abs().divRemTo(t,null,r),this.s<0&&r.compareTo(e.ZERO)>0&&t.subTo(r,r),r},e.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new D(t):new C(t),this.exp(e,r)},e.prototype.clone=function(){var e=P();return this.copyTo(e),e},e.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},e.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},e.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},e.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},e.prototype.toByteArray=function(){var e=this.t,t=[];t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n<this.DB&&(r=this[e]>>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this[e]&(1<<n)-1)<<8-n,r|=this[--e]>>(n+=this.DB-8)):(r=this[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),128&r&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},e.prototype.equals=function(e){return 0==this.compareTo(e)},e.prototype.min=function(e){return this.compareTo(e)<0?this:e},e.prototype.max=function(e){return this.compareTo(e)>0?this:e},e.prototype.and=function(e){var t=P();return this.bitwiseTo(e,a,t),t},e.prototype.or=function(e){var t=P();return this.bitwiseTo(e,o,t),t},e.prototype.xor=function(e){var t=P();return this.bitwiseTo(e,s,t),t},e.prototype.andNot=function(e){var t=P();return this.bitwiseTo(e,u,t),t},e.prototype.not=function(){for(var e=P(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},e.prototype.shiftLeft=function(e){var t=P();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},e.prototype.shiftRight=function(e){var t=P();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},e.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+l(this[e]);return this.s<0?this.t*this.DB:-1},e.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=c(this[r]^t);return e},e.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:!!(this[t]&1<<e%this.DB)},e.prototype.setBit=function(e){return this.changeBit(e,o)},e.prototype.clearBit=function(e){return this.changeBit(e,u)},e.prototype.flipBit=function(e){return this.changeBit(e,s)},e.prototype.add=function(e){var t=P();return this.addTo(e,t),t},e.prototype.subtract=function(e){var t=P();return this.subTo(e,t),t},e.prototype.multiply=function(e){var t=P();return this.multiplyTo(e,t),t},e.prototype.divide=function(e){var t=P();return this.divRemTo(e,t,null),t},e.prototype.remainder=function(e){var t=P();return this.divRemTo(e,null,t),t},e.prototype.divideAndRemainder=function(e){var t=P(),r=P();return this.divRemTo(e,t,r),[t,r]},e.prototype.modPow=function(e,t){var r,n,i=e.bitLength(),a=j(1);if(i<=0)return a;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new D(t):t.isEven()?new O(t):new C(t);var o=[],s=3,u=r-1,l=(1<<r)-1;if(o[1]=n.convert(this),r>1){var c=P();for(n.sqrTo(o[1],c);s<=l;)o[s]=P(),n.mulTo(c,o[s-2],o[s]),s+=2}var d,f,h=e.t-1,p=!0,v=P();for(i=V(e[h])-1;h>=0;){for(i>=u?d=e[h]>>i-u&l:(d=(e[h]&(1<<i+1)-1)<<u-i,h>0&&(d|=e[h-1]>>this.DB+i-u)),s=r;!(1&d);)d>>=1,--s;if((i-=s)<0&&(i+=this.DB,--h),p)o[d].copyTo(a),p=!1;else{for(;s>1;)n.sqrTo(a,v),n.sqrTo(v,a),s-=2;s>0?n.sqrTo(a,v):(f=a,a=v,v=f),n.mulTo(v,o[d],a)}for(;h>=0&&!(e[h]&1<<i);)n.sqrTo(a,v),f=a,a=v,v=f,--i<0&&(i=this.DB-1,--h)}return n.revert(a)},e.prototype.modInverse=function(t){var r=t.isEven();if(this.isEven()&&r||0==t.signum())return e.ZERO;for(var n=t.clone(),i=this.clone(),a=j(1),o=j(0),s=j(0),u=j(1);0!=n.signum();){for(;n.isEven();)n.rShiftTo(1,n),r?(a.isEven()&&o.isEven()||(a.addTo(this,a),o.subTo(t,o)),a.rShiftTo(1,a)):o.isEven()||o.subTo(t,o),o.rShiftTo(1,o);for(;i.isEven();)i.rShiftTo(1,i),r?(s.isEven()&&u.isEven()||(s.addTo(this,s),u.subTo(t,u)),s.rShiftTo(1,s)):u.isEven()||u.subTo(t,u),u.rShiftTo(1,u);n.compareTo(i)>=0?(n.subTo(i,n),r&&a.subTo(s,a),o.subTo(u,o)):(i.subTo(n,i),r&&s.subTo(a,s),u.subTo(o,u))}return 0!=i.compareTo(e.ONE)?e.ZERO:u.compareTo(t)>=0?u.subtract(t):u.signum()<0?(u.addTo(t,u),u.signum()<0?u.add(t):u):u},e.prototype.pow=function(e){return this.exp(e,new k)},e.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)return t;for(i<a&&(a=i),a>0&&(t.rShiftTo(a,t),r.rShiftTo(a,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return a>0&&r.lShiftTo(a,r),r},e.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r[0]<=A[A.length-1]){for(t=0;t<A.length;++t)if(r[0]==A[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<A.length;){for(var n=A[t],i=t+1;i<A.length&&n<R;)n*=A[i++];for(n=r.modInt(n);t<i;)if(n%A[t++]==0)return!1}return r.millerRabin(e)},e.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},e.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},e.prototype.fromString=function(t,r){var n;if(16==r)n=4;else if(8==r)n=3;else if(256==r)n=8;else if(2==r)n=1;else if(32==r)n=5;else{if(4!=r)return void this.fromRadix(t,r);n=2}this.t=0,this.s=0;for(var i=t.length,a=!1,o=0;--i>=0;){var s=8==n?255&+t[i]:U(t,i);s<0?"-"==t.charAt(i)&&(a=!0):(a=!1,0==o?this[this.t++]=s:o+n>this.DB?(this[this.t-1]|=(s&(1<<this.DB-o)-1)<<o,this[this.t++]=s>>this.DB-o):this[this.t-1]|=s<<o,(o+=n)>=this.DB&&(o-=this.DB))}8==n&&128&+t[0]&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),a&&e.ZERO.subTo(this,this)},e.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},e.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t[r+e]=this[r];for(r=e-1;r>=0;--r)t[r]=0;t.t=this.t+e,t.s=this.s},e.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t[r-e]=this[r];t.t=Math.max(this.t-e,0),t.s=this.s},e.prototype.lShiftTo=function(e,t){for(var r=e%this.DB,n=this.DB-r,i=(1<<n)-1,a=Math.floor(e/this.DB),o=this.s<<r&this.DM,s=this.t-1;s>=0;--s)t[s+a+1]=this[s]>>n|o,o=(this[s]&i)<<r;for(s=a-1;s>=0;--s)t[s]=0;t[a]=o,t.t=this.t+a+1,t.s=this.s,t.clamp()},e.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,a=(1<<n)-1;t[0]=this[r]>>n;for(var o=r+1;o<this.t;++o)t[o-r-1]|=(this[o]&a)<<i,t[o-r]=this[o]>>n;n>0&&(t[this.t-r-1]|=(this.s&a)<<i),t.t=this.t-r,t.clamp()}},e.prototype.subTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]-e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e[r],t[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t[r++]=this.DV+n:n>0&&(t[r++]=n),t.t=r,t.clamp()},e.prototype.multiplyTo=function(t,r){var n=this.abs(),i=t.abs(),a=n.t;for(r.t=a+i.t;--a>=0;)r[a]=0;for(a=0;a<i.t;++a)r[a+n.t]=n.am(0,i[a],r,a,0,n.t);r.s=0,r.clamp(),this.s!=t.s&&e.ZERO.subTo(r,r)},e.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t[r],e,2*r,0,1);(e[r+t.t]+=t.am(r+1,2*t[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e[r+t.t]-=t.DV,e[r+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(r,t[r],e,2*r,0,1)),e.s=0,e.clamp()},e.prototype.divRemTo=function(t,r,n){var i=t.abs();if(!(i.t<=0)){var a=this.abs();if(a.t<i.t)return null!=r&&r.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=P());var o=P(),s=this.s,u=t.s,l=this.DB-V(i[i.t-1]);l>0?(i.lShiftTo(l,o),a.lShiftTo(l,n)):(i.copyTo(o),a.copyTo(n));var c=o.t,d=o[c-1];if(0!=d){var f=d*(1<<this.F1)+(c>1?o[c-2]>>this.F2:0),h=this.FV/f,p=(1<<this.F1)/f,v=1<<this.F2,g=n.t,m=g-c,y=null==r?P():r;for(o.dlShiftTo(m,y),n.compareTo(y)>=0&&(n[n.t++]=1,n.subTo(y,n)),e.ONE.dlShiftTo(c,y),y.subTo(o,o);o.t<c;)o[o.t++]=0;for(;--m>=0;){var b=n[--g]==d?this.DM:Math.floor(n[g]*h+(n[g-1]+v)*p);if((n[g]+=o.am(0,b,n,m,0,c))<b)for(o.dlShiftTo(m,y),n.subTo(y,n);n[g]<--b;)n.subTo(y,n)}null!=r&&(n.drShiftTo(c,r),s!=u&&e.ZERO.subTo(r,r)),n.t=c,n.clamp(),l>0&&n.rShiftTo(l,n),s<0&&e.ZERO.subTo(n,n)}}},e.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(!(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},e.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},e.prototype.exp=function(t,r){if(t>4294967295||t<1)return e.ONE;var n=P(),i=P(),a=r.convert(this),o=V(t)-1;for(a.copyTo(n);--o>=0;)if(r.sqrTo(n,i),(t&1<<o)>0)r.mulTo(i,a,n);else{var s=n;n=i,i=s}return r.revert(n)},e.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},e.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=j(r),i=P(),a=P(),o="";for(this.divRemTo(n,i,a);i.signum()>0;)o=(r+a.intValue()).toString(e).substr(1)+o,i.divRemTo(n,i,a);return a.intValue().toString(e)+o},e.prototype.fromRadix=function(t,r){this.fromInt(0),null==r&&(r=10);for(var n=this.chunkSize(r),i=Math.pow(r,n),a=!1,o=0,s=0,u=0;u<t.length;++u){var l=U(t,u);l<0?"-"==t.charAt(u)&&0==this.signum()&&(a=!0):(s=r*s+l,++o>=n&&(this.dMultiply(i),this.dAddOffset(s,0),o=0,s=0))}o>0&&(this.dMultiply(Math.pow(r,o)),this.dAddOffset(s,0)),a&&e.ZERO.subTo(this,this)},e.prototype.fromNumber=function(t,r,n){if("number"==typeof r)if(t<2)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),o,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(r);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(e.ONE.shiftLeft(t-1),this);else{var i=[],a=7&t;i.length=1+(t>>3),r.nextBytes(i),a>0?i[0]&=(1<<a)-1:i[0]=0,this.fromString(i,256)}},e.prototype.bitwiseTo=function(e,t,r){var n,i,a=Math.min(e.t,this.t);for(n=0;n<a;++n)r[n]=t(this[n],e[n]);if(e.t<this.t){for(i=e.s&this.DM,n=a;n<this.t;++n)r[n]=t(this[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=a;n<e.t;++n)r[n]=t(i,e[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},e.prototype.changeBit=function(t,r){var n=e.ONE.shiftLeft(t);return this.bitwiseTo(n,r,n),n},e.prototype.addTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this[r]+e[r],t[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this[r],t[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e[r],t[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t[r++]=n:n<-1&&(t[r++]=this.DV+n),t.t=r,t.clamp()},e.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},e.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},e.prototype.multiplyLowerTo=function(e,t,r){var n=Math.min(this.t+e.t,t);for(r.s=0,r.t=n;n>0;)r[--n]=0;for(var i=r.t-this.t;n<i;++n)r[n+this.t]=this.am(0,e[n],r,n,0,this.t);for(i=Math.min(e.t,t);n<i;++n)this.am(0,e[n],r,n,0,t-n);r.clamp()},e.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r[this.t+n-t]=this.am(t-n,e[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},e.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this[n])%e;return r},e.prototype.millerRabin=function(t){var r=this.subtract(e.ONE),n=r.getLowestSetBit();if(n<=0)return!1;var i=r.shiftRight(n);(t=t+1>>1)>A.length&&(t=A.length);for(var a=P(),o=0;o<t;++o){a.fromInt(A[Math.floor(Math.random()*A.length)]);var s=a.modPow(i,this);if(0!=s.compareTo(e.ONE)&&0!=s.compareTo(r)){for(var u=1;u++<n&&0!=s.compareTo(r);)if(0==(s=s.modPowInt(2,this)).compareTo(e.ONE))return!1;if(0!=s.compareTo(r))return!1}}return!0},e.prototype.square=function(){var e=P();return this.squareTo(e),e},e.prototype.gcda=function(e,t){var r=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(r.compareTo(n)<0){var i=r;r=n,n=i}var a=r.getLowestSetBit(),o=n.getLowestSetBit();if(o<0)t(r);else{a<o&&(o=a),o>0&&(r.rShiftTo(o,r),n.rShiftTo(o,n));var s=function(){(a=r.getLowestSetBit())>0&&r.rShiftTo(a,r),(a=n.getLowestSetBit())>0&&n.rShiftTo(a,n),r.compareTo(n)>=0?(r.subTo(n,r),r.rShiftTo(1,r)):(n.subTo(r,n),n.rShiftTo(1,n)),r.signum()>0?setTimeout(s,0):(o>0&&n.lShiftTo(o,n),setTimeout((function(){t(n)}),0))};setTimeout(s,10)}},e.prototype.fromNumberAsync=function(t,r,n,i){if("number"==typeof r)if(t<2)this.fromInt(1);else{this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),o,this),this.isEven()&&this.dAddOffset(1,0);var a=this,s=function(){a.dAddOffset(2,0),a.bitLength()>t&&a.subTo(e.ONE.shiftLeft(t-1),a),a.isProbablePrime(r)?setTimeout((function(){i()}),0):setTimeout(s,0)};setTimeout(s,0)}else{var u=[],l=7&t;u.length=1+(t>>3),r.nextBytes(u),l>0?u[0]&=(1<<l)-1:u[0]=0,this.fromString(u,256)}},e}(),k=function(){function e(){}return e.prototype.convert=function(e){return e},e.prototype.revert=function(e){return e},e.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},e.prototype.sqrTo=function(e,t){e.squareTo(t)},e}(),D=function(){function e(e){this.m=e}return e.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},e.prototype.revert=function(e){return e},e.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},e.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}(),C=function(){function e(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}return e.prototype.convert=function(e){var t=P();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(x.ZERO)>0&&this.m.subTo(t,t),t},e.prototype.revert=function(e){var t=P();return e.copyTo(t),this.reduce(t),t},e.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e[t],n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[r=t+this.m.t]+=this.m.am(0,n,e,t,0,this.m.t);e[r]>=e.DV;)e[r]-=e.DV,e[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},e.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}(),O=function(){function e(e){this.m=e,this.r2=P(),this.q3=P(),x.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e)}return e.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=P();return e.copyTo(t),this.reduce(t),t},e.prototype.revert=function(e){return e},e.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},e.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}();function P(){return new x(null)}function M(e,t){return new x(e,t)}var B="undefined"!=typeof navigator;B&&"Microsoft Internet Explorer"==navigator.appName?(x.prototype.am=function(e,t,r,n,i,a){for(var o=32767&t,s=t>>15;--a>=0;){var u=32767&this[e],l=this[e++]>>15,c=s*u+l*o;i=((u=o*u+((32767&c)<<15)+r[n]+(1073741823&i))>>>30)+(c>>>15)+s*l+(i>>>30),r[n++]=1073741823&u}return i},T=30):B&&"Netscape"!=navigator.appName?(x.prototype.am=function(e,t,r,n,i,a){for(;--a>=0;){var o=t*this[e++]+r[n]+i;i=Math.floor(o/67108864),r[n++]=67108863&o}return i},T=26):(x.prototype.am=function(e,t,r,n,i,a){for(var o=16383&t,s=t>>14;--a>=0;){var u=16383&this[e],l=this[e++]>>14,c=s*u+l*o;i=((u=o*u+((16383&c)<<14)+r[n]+i)>>28)+(c>>14)+s*l,r[n++]=268435455&u}return i},T=28),x.prototype.DB=T,x.prototype.DM=(1<<T)-1,x.prototype.DV=1<<T,x.prototype.FV=Math.pow(2,52),x.prototype.F1=52-T,x.prototype.F2=2*T-52;var I,N,F=[];for(I="0".charCodeAt(0),N=0;N<=9;++N)F[I++]=N;for(I="a".charCodeAt(0),N=10;N<36;++N)F[I++]=N;for(I="A".charCodeAt(0),N=10;N<36;++N)F[I++]=N;function U(e,t){var r=F[e.charCodeAt(t)];return null==r?-1:r}function j(e){var t=P();return t.fromInt(e),t}function V(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}x.ZERO=j(0),x.ONE=j(1);var G,H,z=function(){function e(){this.i=0,this.j=0,this.S=[]}return e.prototype.init=function(e){var t,r,n;for(t=0;t<256;++t)this.S[t]=t;for(r=0,t=0;t<256;++t)r=r+this.S[t]+e[t%e.length]&255,n=this.S[t],this.S[t]=this.S[r],this.S[r]=n;this.i=0,this.j=0},e.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]},e}(),q=null;if(null==q){q=[],H=0;var K=void 0;if("undefined"!=typeof window&&window.crypto&&window.crypto.getRandomValues){var W=new Uint32Array(256);for(window.crypto.getRandomValues(W),K=0;K<W.length;++K)q[H++]=255&W[K]}var $=0,Y=function(e){if(($=$||0)>=256||H>=256)window.removeEventListener?window.removeEventListener("mousemove",Y,!1):window.detachEvent&&window.detachEvent("onmousemove",Y);else try{var t=e.x+e.y;q[H++]=255&t,$+=1}catch(e){}};"undefined"!=typeof window&&(window.addEventListener?window.addEventListener("mousemove",Y,!1):window.attachEvent&&window.attachEvent("onmousemove",Y))}function Q(){if(null==G){for(G=new z;H<256;){var e=Math.floor(65536*Math.random());q[H++]=255&e}for(G.init(q),H=0;H<q.length;++H)q[H]=0;H=0}return G.next()}var X=function(){function e(){}return e.prototype.nextBytes=function(e){for(var t=0;t<e.length;++t)e[t]=Q()},e}(),Z=function(){function e(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return e.prototype.doPublic=function(e){return e.modPowInt(this.e,this.n)},e.prototype.doPrivate=function(e){if(null==this.p||null==this.q)return e.modPow(this.d,this.n);for(var t=e.mod(this.p).modPow(this.dmp1,this.p),r=e.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(r)<0;)t=t.add(this.p);return t.subtract(r).multiply(this.coeff).mod(this.p).multiply(this.q).add(r)},e.prototype.setPublic=function(e,t){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=M(e,16),this.e=parseInt(t,16)):console.error("Invalid RSA public key")},e.prototype.encrypt=function(e){var t=this.n.bitLength()+7>>3,r=function(e,t){if(t<e.length+11)return console.error("Message too long for RSA"),null;for(var r=[],n=e.length-1;n>=0&&t>0;){var i=e.charCodeAt(n--);i<128?r[--t]=i:i>127&&i<2048?(r[--t]=63&i|128,r[--t]=i>>6|192):(r[--t]=63&i|128,r[--t]=i>>6&63|128,r[--t]=i>>12|224)}r[--t]=0;for(var a=new X,o=[];t>2;){for(o[0]=0;0==o[0];)a.nextBytes(o);r[--t]=o[0]}return r[--t]=2,r[--t]=0,new x(r)}(e,t);if(null==r)return null;var n=this.doPublic(r);if(null==n)return null;for(var i=n.toString(16),a=i.length,o=0;o<2*t-a;o++)i="0"+i;return i},e.prototype.setPrivate=function(e,t,r){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=M(e,16),this.e=parseInt(t,16),this.d=M(r,16)):console.error("Invalid RSA private key")},e.prototype.setPrivateEx=function(e,t,r,n,i,a,o,s){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=M(e,16),this.e=parseInt(t,16),this.d=M(r,16),this.p=M(n,16),this.q=M(i,16),this.dmp1=M(a,16),this.dmq1=M(o,16),this.coeff=M(s,16)):console.error("Invalid RSA private key")},e.prototype.generate=function(e,t){var r=new X,n=e>>1;this.e=parseInt(t,16);for(var i=new x(t,16);;){for(;this.p=new x(e-n,1,r),0!=this.p.subtract(x.ONE).gcd(i).compareTo(x.ONE)||!this.p.isProbablePrime(10););for(;this.q=new x(n,1,r),0!=this.q.subtract(x.ONE).gcd(i).compareTo(x.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var a=this.p;this.p=this.q,this.q=a}var o=this.p.subtract(x.ONE),s=this.q.subtract(x.ONE),u=o.multiply(s);if(0==u.gcd(i).compareTo(x.ONE)){this.n=this.p.multiply(this.q),this.d=i.modInverse(u),this.dmp1=this.d.mod(o),this.dmq1=this.d.mod(s),this.coeff=this.q.modInverse(this.p);break}}},e.prototype.decrypt=function(e){var t=M(e,16),r=this.doPrivate(t);return null==r?null:function(e,t){for(var r=e.toByteArray(),n=0;n<r.length&&0==r[n];)++n;if(r.length-n!=t-1||2!=r[n])return null;for(++n;0!=r[n];)if(++n>=r.length)return null;for(var i="";++n<r.length;){var a=255&r[n];a<128?i+=String.fromCharCode(a):a>191&&a<224?(i+=String.fromCharCode((31&a)<<6|63&r[n+1]),++n):(i+=String.fromCharCode((15&a)<<12|(63&r[n+1])<<6|63&r[n+2]),n+=2)}return i}(r,this.n.bitLength()+7>>3)},e.prototype.generateAsync=function(e,t,r){var n=new X,i=e>>1;this.e=parseInt(t,16);var a=new x(t,16),o=this,s=function(){var t=function(){if(o.p.compareTo(o.q)<=0){var e=o.p;o.p=o.q,o.q=e}var t=o.p.subtract(x.ONE),n=o.q.subtract(x.ONE),i=t.multiply(n);0==i.gcd(a).compareTo(x.ONE)?(o.n=o.p.multiply(o.q),o.d=a.modInverse(i),o.dmp1=o.d.mod(t),o.dmq1=o.d.mod(n),o.coeff=o.q.modInverse(o.p),setTimeout((function(){r()}),0)):setTimeout(s,0)},u=function(){o.q=P(),o.q.fromNumberAsync(i,1,n,(function(){o.q.subtract(x.ONE).gcda(a,(function(e){0==e.compareTo(x.ONE)&&o.q.isProbablePrime(10)?setTimeout(t,0):setTimeout(u,0)}))}))},l=function(){o.p=P(),o.p.fromNumberAsync(e-i,1,n,(function(){o.p.subtract(x.ONE).gcda(a,(function(e){0==e.compareTo(x.ONE)&&o.p.isProbablePrime(10)?setTimeout(u,0):setTimeout(l,0)}))}))};setTimeout(l,0)};setTimeout(s,0)},e.prototype.sign=function(e,t,r){var n=function(e,t){if(t<e.length+22)return console.error("Message too long for RSA"),null;for(var r=t-e.length-6,n="",i=0;i<r;i+=2)n+="ff";return M("0001"+n+"00"+e,16)}((J[r]||"")+t(e).toString(),this.n.bitLength()/4);if(null==n)return null;var i=this.doPrivate(n);if(null==i)return null;var a=i.toString(16);return 1&a.length?"0"+a:a},e.prototype.verify=function(e,t,r){var n=M(t,16),i=this.doPublic(n);return null==i?null:function(e){for(var t in J)if(J.hasOwnProperty(t)){var r=J[t],n=r.length;if(e.substr(0,n)==r)return e.substr(n)}return e}(i.toString(16).replace(/^1f+00/,""))==r(e).toString()},e}(),J={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"},ee={};ee.lang={extend:function(e,t,r){if(!t||!e)throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");var n=function(){};if(n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t),r){var i;for(i in r)e.prototype[i]=r[i];var a=function(){},o=["toString","valueOf"];try{/MSIE/.test(navigator.userAgent)&&(a=function(e,t){for(i=0;i<o.length;i+=1){var r=o[i],n=t[r];"function"==typeof n&&n!=Object.prototype[r]&&(e[r]=n)}})}catch(e){}a(e.prototype,r)}}};var te={};void 0!==te.asn1&&te.asn1||(te.asn1={}),te.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var r=t.substr(1).length;r%2==1?r+=1:t.match(/^[0-7]/)||(r+=2);for(var n="",i=0;i<r;i++)n+="f";t=new x(n,16).xor(e).add(x.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return hextopem(e,t)},this.newObject=function(e){var t=te.asn1,r=t.DERBoolean,n=t.DERInteger,i=t.DERBitString,a=t.DEROctetString,o=t.DERNull,s=t.DERObjectIdentifier,u=t.DEREnumerated,l=t.DERUTF8String,c=t.DERNumericString,d=t.DERPrintableString,f=t.DERTeletexString,h=t.DERIA5String,p=t.DERUTCTime,v=t.DERGeneralizedTime,g=t.DERSequence,m=t.DERSet,y=t.DERTaggedObject,b=t.ASN1Util.newObject,E=Object.keys(e);if(1!=E.length)throw"key of param shall be only one.";var S=E[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+S+":"))throw"undefined key: "+S;if("bool"==S)return new r(e[S]);if("int"==S)return new n(e[S]);if("bitstr"==S)return new i(e[S]);if("octstr"==S)return new a(e[S]);if("null"==S)return new o(e[S]);if("oid"==S)return new s(e[S]);if("enum"==S)return new u(e[S]);if("utf8str"==S)return new l(e[S]);if("numstr"==S)return new c(e[S]);if("prnstr"==S)return new d(e[S]);if("telstr"==S)return new f(e[S]);if("ia5str"==S)return new h(e[S]);if("utctime"==S)return new p(e[S]);if("gentime"==S)return new v(e[S]);if("seq"==S){for(var T=e[S],w=[],_=0;_<T.length;_++){var L=b(T[_]);w.push(L)}return new g({array:w})}if("set"==S){for(T=e[S],w=[],_=0;_<T.length;_++)L=b(T[_]),w.push(L);return new m({array:w})}if("tag"==S){var A=e[S];if("[object Array]"===Object.prototype.toString.call(A)&&3==A.length){var R=b(A[2]);return new y({tag:A[0],explicit:A[1],obj:R})}var x={};if(void 0!==A.explicit&&(x.explicit=A.explicit),void 0!==A.tag&&(x.tag=A.tag),void 0===A.obj)throw"obj shall be specified for 'tag'.";return x.obj=b(A.obj),new y(x)}},this.jsonToASN1HEX=function(e){return this.newObject(e).getEncodedHex()}},te.asn1.ASN1Util.oidHexToInt=function(e){for(var t="",r=parseInt(e.substr(0,2),16),n=(t=Math.floor(r/40)+"."+r%40,""),i=2;i<e.length;i+=2){var a=("00000000"+parseInt(e.substr(i,2),16).toString(2)).slice(-8);n+=a.substr(1,7),"0"==a.substr(0,1)&&(t=t+"."+new x(n,2).toString(10),n="")}return t},te.asn1.ASN1Util.oidIntToHex=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},r=function(e){var r="",n=new x(e,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var a="",o=0;o<i;o++)a+="0";for(n=a+n,o=0;o<n.length-1;o+=7){var s=n.substr(o,7);o!=n.length-7&&(s="1"+s),r+=t(parseInt(s,2))}return r};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var n="",i=e.split("."),a=40*parseInt(i[0])+parseInt(i[1]);n+=t(a),i.splice(0,2);for(var o=0;o<i.length;o++)n+=r(i[o]);return n},te.asn1.ASN1Object=function(){this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n=0,v="+this.hV;var e=this.hV.length/2,t=e.toString(16);if(t.length%2==1&&(t="0"+t),e<128)return t;var r=t.length/2;if(r>15)throw"ASN.1 length too long to represent by 8x: n = "+e.toString(16);return(128+r).toString(16)+t},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},te.asn1.DERAbstractString=function(e){te.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(this.s)},this.setStringHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?this.setString(e):void 0!==e.str?this.setString(e.str):void 0!==e.hex&&this.setStringHex(e.hex))},ee.lang.extend(te.asn1.DERAbstractString,te.asn1.ASN1Object),te.asn1.DERAbstractTime=function(e){te.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(e){return utc=e.getTime()+6e4*e.getTimezoneOffset(),new Date(utc)},this.formatDate=function(e,t,r){var n=this.zeroPadding,i=this.localDateToUTC(e),a=String(i.getFullYear());"utc"==t&&(a=a.substr(2,2));var o=a+n(String(i.getMonth()+1),2)+n(String(i.getDate()),2)+n(String(i.getHours()),2)+n(String(i.getMinutes()),2)+n(String(i.getSeconds()),2);if(!0===r){var s=i.getMilliseconds();if(0!=s){var u=n(String(s),3);o=o+"."+(u=u.replace(/[0]+$/,""))}}return o+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(e)},this.setByDateValue=function(e,t,r,n,i,a){var o=new Date(Date.UTC(e,t-1,r,n,i,a,0));this.setByDate(o)},this.getFreshValueHex=function(){return this.hV}},ee.lang.extend(te.asn1.DERAbstractTime,te.asn1.ASN1Object),te.asn1.DERAbstractStructured=function(e){te.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array=e},this.appendASN1Object=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array.push(e)},this.asn1Array=new Array,void 0!==e&&void 0!==e.array&&(this.asn1Array=e.array)},ee.lang.extend(te.asn1.DERAbstractStructured,te.asn1.ASN1Object),te.asn1.DERBoolean=function(){te.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},ee.lang.extend(te.asn1.DERBoolean,te.asn1.ASN1Object),te.asn1.DERInteger=function(e){te.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=te.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new x(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.bigint?this.setByBigInteger(e.bigint):void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},ee.lang.extend(te.asn1.DERInteger,te.asn1.ASN1Object),te.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=te.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}te.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var r="0"+e;this.hTLV=null,this.isModified=!0,this.hV=r+t},this.setByBinaryString=function(e){var t=8-(e=e.replace(/0+$/,"")).length%8;8==t&&(t=0);for(var r=0;r<=t;r++)e+="0";var n="";for(r=0;r<e.length-1;r+=8){var i=e.substr(r,8),a=parseInt(i,2).toString(16);1==a.length&&(a="0"+a),n+=a}this.hTLV=null,this.isModified=!0,this.hV="0"+t+n},this.setByBooleanArray=function(e){for(var t="",r=0;r<e.length;r++)1==e[r]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=!1;return t},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):void 0!==e.hex?this.setHexValueIncludingUnusedBits(e.hex):void 0!==e.bin?this.setByBinaryString(e.bin):void 0!==e.array&&this.setByBooleanArray(e.array))},ee.lang.extend(te.asn1.DERBitString,te.asn1.ASN1Object),te.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var t=te.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}te.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},ee.lang.extend(te.asn1.DEROctetString,te.asn1.DERAbstractString),te.asn1.DERNull=function(){te.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},ee.lang.extend(te.asn1.DERNull,te.asn1.ASN1Object),te.asn1.DERObjectIdentifier=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},r=function(e){var r="",n=new x(e,10).toString(2),i=7-n.length%7;7==i&&(i=0);for(var a="",o=0;o<i;o++)a+="0";for(n=a+n,o=0;o<n.length-1;o+=7){var s=n.substr(o,7);o!=n.length-7&&(s="1"+s),r+=t(parseInt(s,2))}return r};te.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueOidString=function(e){if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var n="",i=e.split("."),a=40*parseInt(i[0])+parseInt(i[1]);n+=t(a),i.splice(0,2);for(var o=0;o<i.length;o++)n+=r(i[o]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=n},this.setValueName=function(e){var t=te.asn1.x509.OID.name2oid(e);if(""===t)throw"DERObjectIdentifier oidName undefined: "+e;this.setValueOidString(t)},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?e.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(e):this.setValueName(e):void 0!==e.oid?this.setValueOidString(e.oid):void 0!==e.hex?this.setValueHex(e.hex):void 0!==e.name&&this.setValueName(e.name))},ee.lang.extend(te.asn1.DERObjectIdentifier,te.asn1.ASN1Object),te.asn1.DEREnumerated=function(e){te.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=te.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new x(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},ee.lang.extend(te.asn1.DEREnumerated,te.asn1.ASN1Object),te.asn1.DERUTF8String=function(e){te.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},ee.lang.extend(te.asn1.DERUTF8String,te.asn1.DERAbstractString),te.asn1.DERNumericString=function(e){te.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},ee.lang.extend(te.asn1.DERNumericString,te.asn1.DERAbstractString),te.asn1.DERPrintableString=function(e){te.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},ee.lang.extend(te.asn1.DERPrintableString,te.asn1.DERAbstractString),te.asn1.DERTeletexString=function(e){te.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},ee.lang.extend(te.asn1.DERTeletexString,te.asn1.DERAbstractString),te.asn1.DERIA5String=function(e){te.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},ee.lang.extend(te.asn1.DERIA5String,te.asn1.DERAbstractString),te.asn1.DERUTCTime=function(e){te.asn1.DERUTCTime.superclass.constructor.call(this,e),this.hT="17",this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{12}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date))},ee.lang.extend(te.asn1.DERUTCTime,te.asn1.DERAbstractTime),te.asn1.DERGeneralizedTime=function(e){te.asn1.DERGeneralizedTime.superclass.constructor.call(this,e),this.hT="18",this.withMillis=!1,this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{14}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date),!0===e.millis&&(this.withMillis=!0))},ee.lang.extend(te.asn1.DERGeneralizedTime,te.asn1.DERAbstractTime),te.asn1.DERSequence=function(e){te.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var e="",t=0;t<this.asn1Array.length;t++)e+=this.asn1Array[t].getEncodedHex();return this.hV=e,this.hV}},ee.lang.extend(te.asn1.DERSequence,te.asn1.DERAbstractStructured),te.asn1.DERSet=function(e){te.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var e=new Array,t=0;t<this.asn1Array.length;t++){var r=this.asn1Array[t];e.push(r.getEncodedHex())}return 1==this.sortFlag&&e.sort(),this.hV=e.join(""),this.hV},void 0!==e&&void 0!==e.sortflag&&0==e.sortflag&&(this.sortFlag=!1)},ee.lang.extend(te.asn1.DERSet,te.asn1.DERAbstractStructured),te.asn1.DERTaggedObject=function(e){te.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(e,t,r){this.hT=t,this.isExplicit=e,this.asn1Object=r,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=r.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,t),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.tag&&(this.hT=e.tag),void 0!==e.explicit&&(this.isExplicit=e.explicit),void 0!==e.obj&&(this.asn1Object=e.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},ee.lang.extend(te.asn1.DERTaggedObject,te.asn1.ASN1Object);var re,ne,ie=(re=function(e,t){return re=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},re(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}re(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),ae=function(e){function t(r){var n=e.call(this)||this;return r&&("string"==typeof r?n.parseKey(r):(t.hasPrivateKeyProperty(r)||t.hasPublicKeyProperty(r))&&n.parsePropertiesFrom(r)),n}return ie(t,e),t.prototype.parseKey=function(e){try{var t=0,r=0,n=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(e)?function(e){var t;if(void 0===d){var r="0123456789ABCDEF";for(d={},t=0;t<16;++t)d[r.charAt(t)]=t;for(r=r.toLowerCase(),t=10;t<16;++t)d[r.charAt(t)]=t;for(t=0;t<8;++t)d[" \f\n\r\t \u2028\u2029".charAt(t)]=-1}var n=[],i=0,a=0;for(t=0;t<e.length;++t){var o=e.charAt(t);if("="==o)break;if(-1!=(o=d[o])){if(void 0===o)throw new Error("Illegal character at offset "+t);i|=o,++a>=2?(n[n.length]=i,i=0,a=0):i<<=4}}if(a)throw new Error("Hex encoding incomplete: 4 bits missing");return n}(e):g.unarmor(e),i=_.decode(n);if(3===i.sub.length&&(i=i.sub[2].sub[0]),9===i.sub.length){t=i.sub[1].getHexStringValue(),this.n=M(t,16),r=i.sub[2].getHexStringValue(),this.e=parseInt(r,16);var a=i.sub[3].getHexStringValue();this.d=M(a,16);var o=i.sub[4].getHexStringValue();this.p=M(o,16);var s=i.sub[5].getHexStringValue();this.q=M(s,16);var u=i.sub[6].getHexStringValue();this.dmp1=M(u,16);var l=i.sub[7].getHexStringValue();this.dmq1=M(l,16);var c=i.sub[8].getHexStringValue();this.coeff=M(c,16)}else{if(2!==i.sub.length)return!1;if(i.sub[0].sub){var f=i.sub[1].sub[0];t=f.sub[0].getHexStringValue(),this.n=M(t,16),r=f.sub[1].getHexStringValue(),this.e=parseInt(r,16)}else t=i.sub[0].getHexStringValue(),this.n=M(t,16),r=i.sub[1].getHexStringValue(),this.e=parseInt(r,16)}return!0}catch(e){return!1}},t.prototype.getPrivateBaseKey=function(){var e={array:[new te.asn1.DERInteger({int:0}),new te.asn1.DERInteger({bigint:this.n}),new te.asn1.DERInteger({int:this.e}),new te.asn1.DERInteger({bigint:this.d}),new te.asn1.DERInteger({bigint:this.p}),new te.asn1.DERInteger({bigint:this.q}),new te.asn1.DERInteger({bigint:this.dmp1}),new te.asn1.DERInteger({bigint:this.dmq1}),new te.asn1.DERInteger({bigint:this.coeff})]};return new te.asn1.DERSequence(e).getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return h(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var e=new te.asn1.DERSequence({array:[new te.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new te.asn1.DERNull]}),t=new te.asn1.DERSequence({array:[new te.asn1.DERInteger({bigint:this.n}),new te.asn1.DERInteger({int:this.e})]}),r=new te.asn1.DERBitString({hex:"00"+t.getEncodedHex()});return new te.asn1.DERSequence({array:[e,r]}).getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return h(this.getPublicBaseKey())},t.wordwrap=function(e,t){if(!e)return e;var r="(.{1,"+(t=t||64)+"})( +|$\n?)|(.{1,"+t+"})";return e.match(RegExp(r,"g")).join("\n")},t.prototype.getPrivateKey=function(){var e="-----BEGIN RSA PRIVATE KEY-----\n";return(e+=t.wordwrap(this.getPrivateBaseKeyB64())+"\n")+"-----END RSA PRIVATE KEY-----"},t.prototype.getPublicKey=function(){var e="-----BEGIN PUBLIC KEY-----\n";return(e+=t.wordwrap(this.getPublicBaseKeyB64())+"\n")+"-----END PUBLIC KEY-----"},t.hasPublicKeyProperty=function(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")},t.hasPrivateKeyProperty=function(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")&&e.hasOwnProperty("d")&&e.hasOwnProperty("p")&&e.hasOwnProperty("q")&&e.hasOwnProperty("dmp1")&&e.hasOwnProperty("dmq1")&&e.hasOwnProperty("coeff")},t.prototype.parsePropertiesFrom=function(e){this.n=e.n,this.e=e.e,e.hasOwnProperty("d")&&(this.d=e.d,this.p=e.p,this.q=e.q,this.dmp1=e.dmp1,this.dmq1=e.dmq1,this.coeff=e.coeff)},t}(Z),oe=null===(ne={})||void 0===ne?void 0:ne.npm_package_version,se=function(){function e(e){void 0===e&&(e={}),e=e||{},this.default_key_size=e.default_key_size?parseInt(e.default_key_size,10):1024,this.default_public_exponent=e.default_public_exponent||"010001",this.log=e.log||!1,this.key=null}return e.prototype.setKey=function(e){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new ae(e)},e.prototype.setPrivateKey=function(e){this.setKey(e)},e.prototype.setPublicKey=function(e){this.setKey(e)},e.prototype.decrypt=function(e){try{return this.getKey().decrypt(p(e))}catch(e){return!1}},e.prototype.encrypt=function(e){try{return h(this.getKey().encrypt(e))}catch(e){return!1}},e.prototype.sign=function(e,t,r){try{return h(this.getKey().sign(e,t,r))}catch(e){return!1}},e.prototype.verify=function(e,t,r){try{return this.getKey().verify(e,p(t),r)}catch(e){return!1}},e.prototype.getKey=function(e){if(!this.key){if(this.key=new ae,e&&"[object Function]"==={}.toString.call(e))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,e);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},e.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},e.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},e.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},e.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},e.version=oe,e}()},55580:function(e,t,r){var n=r(56110)(r(9325),"DataView");e.exports=n},21549:function(e,t,r){var n=r(22032),i=r(63862),a=r(66721),o=r(12749),s=r(35749);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=o,u.prototype.set=s,e.exports=u},80079:function(e,t,r){var n=r(63702),i=r(70080),a=r(24739),o=r(48655),s=r(31175);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=o,u.prototype.set=s,e.exports=u},68223:function(e,t,r){var n=r(56110)(r(9325),"Map");e.exports=n},53661:function(e,t,r){var n=r(63040),i=r(17670),a=r(90289),o=r(4509),s=r(72949);function u(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}u.prototype.clear=n,u.prototype.delete=i,u.prototype.get=a,u.prototype.has=o,u.prototype.set=s,e.exports=u},32804:function(e,t,r){var n=r(56110)(r(9325),"Promise");e.exports=n},76545:function(e,t,r){var n=r(56110)(r(9325),"Set");e.exports=n},37217:function(e,t,r){var n=r(80079),i=r(51420),a=r(90938),o=r(63605),s=r(29817),u=r(80945);function l(e){var t=this.__data__=new n(e);this.size=t.size}l.prototype.clear=i,l.prototype.delete=a,l.prototype.get=o,l.prototype.has=s,l.prototype.set=u,e.exports=l},51873:function(e,t,r){var n=r(9325).Symbol;e.exports=n},37828:function(e,t,r){var n=r(9325).Uint8Array;e.exports=n},28303:function(e,t,r){var n=r(56110)(r(9325),"WeakMap");e.exports=n},83729:function(e){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}},79770:function(e){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=0,a=[];++r<n;){var o=e[r];t(o,r,e)&&(a[i++]=o)}return a}},70695:function(e,t,r){var n=r(78096),i=r(72428),a=r(56449),o=r(3656),s=r(30361),u=r(37167),l=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=a(e),c=!r&&i(e),d=!r&&!c&&o(e),f=!r&&!c&&!d&&u(e),h=r||c||d||f,p=h?n(e.length,String):[],v=p.length;for(var g in e)!t&&!l.call(e,g)||h&&("length"==g||d&&("offset"==g||"parent"==g)||f&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||s(g,v))||p.push(g);return p}},14528:function(e){e.exports=function(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}},16547:function(e,t,r){var n=r(43360),i=r(75288),a=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var o=e[t];a.call(e,t)&&i(o,r)&&(void 0!==r||t in e)||n(e,t,r)}},26025:function(e,t,r){var n=r(75288);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},74733:function(e,t,r){var n=r(21791),i=r(95950);e.exports=function(e,t){return e&&n(t,i(t),e)}},43838:function(e,t,r){var n=r(21791),i=r(37241);e.exports=function(e,t){return e&&n(t,i(t),e)}},43360:function(e,t,r){var n=r(93243);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},87133:function(e){e.exports=function(e,t,r){return e==e&&(void 0!==r&&(e=e<=r?e:r),void 0!==t&&(e=e>=t?e:t)),e}},9999:function(e,t,r){var n=r(37217),i=r(83729),a=r(16547),o=r(74733),s=r(43838),u=r(93290),l=r(23007),c=r(92271),d=r(48948),f=r(50002),h=r(83349),p=r(5861),v=r(76189),g=r(77199),m=r(35529),y=r(56449),b=r(3656),E=r(87730),S=r(23805),T=r(38440),w=r(95950),_=r(37241),L="[object Arguments]",A="[object Function]",R="[object Object]",x={};x[L]=x["[object Array]"]=x["[object ArrayBuffer]"]=x["[object DataView]"]=x["[object Boolean]"]=x["[object Date]"]=x["[object Float32Array]"]=x["[object Float64Array]"]=x["[object Int8Array]"]=x["[object Int16Array]"]=x["[object Int32Array]"]=x["[object Map]"]=x["[object Number]"]=x[R]=x["[object RegExp]"]=x["[object Set]"]=x["[object String]"]=x["[object Symbol]"]=x["[object Uint8Array]"]=x["[object Uint8ClampedArray]"]=x["[object Uint16Array]"]=x["[object Uint32Array]"]=!0,x["[object Error]"]=x[A]=x["[object WeakMap]"]=!1,e.exports=function e(t,r,k,D,C,O){var P,M=1&r,B=2&r,I=4&r;if(k&&(P=C?k(t,D,C,O):k(t)),void 0!==P)return P;if(!S(t))return t;var N=y(t);if(N){if(P=v(t),!M)return l(t,P)}else{var F=p(t),U=F==A||"[object GeneratorFunction]"==F;if(b(t))return u(t,M);if(F==R||F==L||U&&!C){if(P=B||U?{}:m(t),!M)return B?d(t,s(P,t)):c(t,o(P,t))}else{if(!x[F])return C?t:{};P=g(t,F,M)}}O||(O=new n);var j=O.get(t);if(j)return j;O.set(t,P),T(t)?t.forEach((function(n){P.add(e(n,r,k,n,t,O))})):E(t)&&t.forEach((function(n,i){P.set(i,e(n,r,k,i,t,O))}));var V=N?void 0:(I?B?h:f:B?_:w)(t);return i(V||t,(function(n,i){V&&(n=t[i=n]),a(P,i,e(n,r,k,i,t,O))})),P}},39344:function(e,t,r){var n=r(23805),i=Object.create,a=function(){function e(){}return function(t){if(!n(t))return{};if(i)return i(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=a},82199:function(e,t,r){var n=r(14528),i=r(56449);e.exports=function(e,t,r){var a=t(e);return i(e)?a:n(a,r(e))}},72552:function(e,t,r){var n=r(51873),i=r(659),a=r(59350),o=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?i(e):a(e)}},27534:function(e,t,r){var n=r(72552),i=r(40346);e.exports=function(e){return i(e)&&"[object Arguments]"==n(e)}},29172:function(e,t,r){var n=r(5861),i=r(40346);e.exports=function(e){return i(e)&&"[object Map]"==n(e)}},45083:function(e,t,r){var n=r(1882),i=r(87296),a=r(23805),o=r(47473),s=/^\[object .+?Constructor\]$/,u=Function.prototype,l=Object.prototype,c=u.toString,d=l.hasOwnProperty,f=RegExp("^"+c.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!a(e)||i(e))&&(n(e)?f:s).test(o(e))}},16038:function(e,t,r){var n=r(5861),i=r(40346);e.exports=function(e){return i(e)&&"[object Set]"==n(e)}},4901:function(e,t,r){var n=r(72552),i=r(30294),a=r(40346),o={};o["[object Float32Array]"]=o["[object Float64Array]"]=o["[object Int8Array]"]=o["[object Int16Array]"]=o["[object Int32Array]"]=o["[object Uint8Array]"]=o["[object Uint8ClampedArray]"]=o["[object Uint16Array]"]=o["[object Uint32Array]"]=!0,o["[object Arguments]"]=o["[object Array]"]=o["[object ArrayBuffer]"]=o["[object Boolean]"]=o["[object DataView]"]=o["[object Date]"]=o["[object Error]"]=o["[object Function]"]=o["[object Map]"]=o["[object Number]"]=o["[object Object]"]=o["[object RegExp]"]=o["[object Set]"]=o["[object String]"]=o["[object WeakMap]"]=!1,e.exports=function(e){return a(e)&&i(e.length)&&!!o[n(e)]}},88984:function(e,t,r){var n=r(55527),i=r(3650),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return i(e);var t=[];for(var r in Object(e))a.call(e,r)&&"constructor"!=r&&t.push(r);return t}},72903:function(e,t,r){var n=r(23805),i=r(55527),a=r(90181),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return a(e);var t=i(e),r=[];for(var s in e)("constructor"!=s||!t&&o.call(e,s))&&r.push(s);return r}},78096:function(e){e.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},54128:function(e,t,r){var n=r(31800),i=/^\s+/;e.exports=function(e){return e?e.slice(0,n(e)+1).replace(i,""):e}},27301:function(e){e.exports=function(e){return function(t){return e(t)}}},49653:function(e,t,r){var n=r(37828);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},93290:function(e,t,r){e=r.nmd(e);var n=r(9325),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,o=a&&a.exports===i?n.Buffer:void 0,s=o?o.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=s?s(r):new e.constructor(r);return e.copy(n),n}},76169:function(e,t,r){var n=r(49653);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}},73201:function(e){var t=/\w*$/;e.exports=function(e){var r=new e.constructor(e.source,t.exec(e));return r.lastIndex=e.lastIndex,r}},93736:function(e,t,r){var n=r(51873),i=n?n.prototype:void 0,a=i?i.valueOf:void 0;e.exports=function(e){return a?Object(a.call(e)):{}}},71961:function(e,t,r){var n=r(49653);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},23007:function(e){e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},21791:function(e,t,r){var n=r(16547),i=r(43360);e.exports=function(e,t,r,a){var o=!r;r||(r={});for(var s=-1,u=t.length;++s<u;){var l=t[s],c=a?a(r[l],e[l],l,r,e):void 0;void 0===c&&(c=e[l]),o?i(r,l,c):n(r,l,c)}return r}},92271:function(e,t,r){var n=r(21791),i=r(4664);e.exports=function(e,t){return n(e,i(e),t)}},48948:function(e,t,r){var n=r(21791),i=r(86375);e.exports=function(e,t){return n(e,i(e),t)}},55481:function(e,t,r){var n=r(9325)["__core-js_shared__"];e.exports=n},93243:function(e,t,r){var n=r(56110),i=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},34840:function(e,t,r){var n="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=n},50002:function(e,t,r){var n=r(82199),i=r(4664),a=r(95950);e.exports=function(e){return n(e,a,i)}},83349:function(e,t,r){var n=r(82199),i=r(86375),a=r(37241);e.exports=function(e){return n(e,a,i)}},12651:function(e,t,r){var n=r(74218);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},56110:function(e,t,r){var n=r(45083),i=r(10392);e.exports=function(e,t){var r=i(e,t);return n(r)?r:void 0}},28879:function(e,t,r){var n=r(74335)(Object.getPrototypeOf,Object);e.exports=n},659:function(e,t,r){var n=r(51873),i=Object.prototype,a=i.hasOwnProperty,o=i.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=a.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=o.call(e);return n&&(t?e[s]=r:delete e[s]),i}},4664:function(e,t,r){var n=r(79770),i=r(63345),a=Object.prototype.propertyIsEnumerable,o=Object.getOwnPropertySymbols,s=o?function(e){return null==e?[]:(e=Object(e),n(o(e),(function(t){return a.call(e,t)})))}:i;e.exports=s},86375:function(e,t,r){var n=r(14528),i=r(28879),a=r(4664),o=r(63345),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,a(e)),e=i(e);return t}:o;e.exports=s},5861:function(e,t,r){var n=r(55580),i=r(68223),a=r(32804),o=r(76545),s=r(28303),u=r(72552),l=r(47473),c="[object Map]",d="[object Promise]",f="[object Set]",h="[object WeakMap]",p="[object DataView]",v=l(n),g=l(i),m=l(a),y=l(o),b=l(s),E=u;(n&&E(new n(new ArrayBuffer(1)))!=p||i&&E(new i)!=c||a&&E(a.resolve())!=d||o&&E(new o)!=f||s&&E(new s)!=h)&&(E=function(e){var t=u(e),r="[object Object]"==t?e.constructor:void 0,n=r?l(r):"";if(n)switch(n){case v:return p;case g:return c;case m:return d;case y:return f;case b:return h}return t}),e.exports=E},10392:function(e){e.exports=function(e,t){return null==e?void 0:e[t]}},22032:function(e,t,r){var n=r(81042);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},63862:function(e){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},66721:function(e,t,r){var n=r(81042),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return i.call(t,e)?t[e]:void 0}},12749:function(e,t,r){var n=r(81042),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:i.call(t,e)}},35749:function(e,t,r){var n=r(81042);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},76189:function(e){var t=Object.prototype.hasOwnProperty;e.exports=function(e){var r=e.length,n=new e.constructor(r);return r&&"string"==typeof e[0]&&t.call(e,"index")&&(n.index=e.index,n.input=e.input),n}},77199:function(e,t,r){var n=r(49653),i=r(76169),a=r(73201),o=r(93736),s=r(71961);e.exports=function(e,t,r){var u=e.constructor;switch(t){case"[object ArrayBuffer]":return n(e);case"[object Boolean]":case"[object Date]":return new u(+e);case"[object DataView]":return i(e,r);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,r);case"[object Map]":case"[object Set]":return new u;case"[object Number]":case"[object String]":return new u(e);case"[object RegExp]":return a(e);case"[object Symbol]":return o(e)}}},35529:function(e,t,r){var n=r(39344),i=r(28879),a=r(55527);e.exports=function(e){return"function"!=typeof e.constructor||a(e)?{}:n(i(e))}},30361:function(e){var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,r){var n=typeof e;return!!(r=null==r?9007199254740991:r)&&("number"==n||"symbol"!=n&&t.test(e))&&e>-1&&e%1==0&&e<r}},74218:function(e){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},87296:function(e,t,r){var n,i=r(55481),a=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!a&&a in e}},55527:function(e){var t=Object.prototype;e.exports=function(e){var r=e&&e.constructor;return e===("function"==typeof r&&r.prototype||t)}},63702:function(e){e.exports=function(){this.__data__=[],this.size=0}},70080:function(e,t,r){var n=r(26025),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0||(r==t.length-1?t.pop():i.call(t,r,1),--this.size,0))}},24739:function(e,t,r){var n=r(26025);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},48655:function(e,t,r){var n=r(26025);e.exports=function(e){return n(this.__data__,e)>-1}},31175:function(e,t,r){var n=r(26025);e.exports=function(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}},63040:function(e,t,r){var n=r(21549),i=r(80079),a=r(68223);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(a||i),string:new n}}},17670:function(e,t,r){var n=r(12651);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},90289:function(e,t,r){var n=r(12651);e.exports=function(e){return n(this,e).get(e)}},4509:function(e,t,r){var n=r(12651);e.exports=function(e){return n(this,e).has(e)}},72949:function(e,t,r){var n=r(12651);e.exports=function(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}},81042:function(e,t,r){var n=r(56110)(Object,"create");e.exports=n},3650:function(e,t,r){var n=r(74335)(Object.keys,Object);e.exports=n},90181:function(e){e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},86009:function(e,t,r){e=r.nmd(e);var n=r(34840),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,o=a&&a.exports===i&&n.process,s=function(){try{return a&&a.require&&a.require("util").types||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=s},59350:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},74335:function(e){e.exports=function(e,t){return function(r){return e(t(r))}}},9325:function(e,t,r){var n=r(34840),i="object"==typeof self&&self&&self.Object===Object&&self,a=n||i||Function("return this")();e.exports=a},51420:function(e,t,r){var n=r(80079);e.exports=function(){this.__data__=new n,this.size=0}},90938:function(e){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},63605:function(e){e.exports=function(e){return this.__data__.get(e)}},29817:function(e){e.exports=function(e){return this.__data__.has(e)}},80945:function(e,t,r){var n=r(80079),i=r(68223),a=r(53661);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var o=r.__data__;if(!i||o.length<199)return o.push([e,t]),this.size=++r.size,this;r=this.__data__=new a(o)}return r.set(e,t),this.size=r.size,this}},47473:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},31800:function(e){var t=/\s/;e.exports=function(e){for(var r=e.length;r--&&t.test(e.charAt(r)););return r}},78659:function(e,t,r){var n=r(87133),i=r(99374);e.exports=function(e,t,r){return void 0===r&&(r=t,t=void 0),void 0!==r&&(r=(r=i(r))==r?r:0),void 0!==t&&(t=(t=i(t))==t?t:0),n(i(e),t,r)}},88055:function(e,t,r){var n=r(9999);e.exports=function(e){return n(e,5)}},38221:function(e,t,r){var n=r(23805),i=r(10124),a=r(99374),o=Math.max,s=Math.min;e.exports=function(e,t,r){var u,l,c,d,f,h,p=0,v=!1,g=!1,m=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var r=u,n=l;return u=l=void 0,p=t,d=e.apply(n,r)}function b(e){var r=e-h;return void 0===h||r>=t||r<0||g&&e-p>=c}function E(){var e=i();if(b(e))return S(e);f=setTimeout(E,function(e){var r=t-(e-h);return g?s(r,c-(e-p)):r}(e))}function S(e){return f=void 0,m&&u?y(e):(u=l=void 0,d)}function T(){var e=i(),r=b(e);if(u=arguments,l=this,h=e,r){if(void 0===f)return function(e){return p=e,f=setTimeout(E,t),v?y(e):d}(h);if(g)return clearTimeout(f),f=setTimeout(E,t),y(h)}return void 0===f&&(f=setTimeout(E,t)),d}return t=a(t)||0,n(r)&&(v=!!r.leading,c=(g="maxWait"in r)?o(a(r.maxWait)||0,t):c,m="trailing"in r?!!r.trailing:m),T.cancel=function(){void 0!==f&&clearTimeout(f),p=0,u=h=l=f=void 0},T.flush=function(){return void 0===f?d:S(i())},T}},75288:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},72428:function(e,t,r){var n=r(27534),i=r(40346),a=Object.prototype,o=a.hasOwnProperty,s=a.propertyIsEnumerable,u=n(function(){return arguments}())?n:function(e){return i(e)&&o.call(e,"callee")&&!s.call(e,"callee")};e.exports=u},56449:function(e){var t=Array.isArray;e.exports=t},64894:function(e,t,r){var n=r(1882),i=r(30294);e.exports=function(e){return null!=e&&i(e.length)&&!n(e)}},3656:function(e,t,r){e=r.nmd(e);var n=r(9325),i=r(89935),a=t&&!t.nodeType&&t,o=a&&e&&!e.nodeType&&e,s=o&&o.exports===a?n.Buffer:void 0,u=(s?s.isBuffer:void 0)||i;e.exports=u},1882:function(e,t,r){var n=r(72552),i=r(23805);e.exports=function(e){if(!i(e))return!1;var t=n(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},30294:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},87730:function(e,t,r){var n=r(29172),i=r(27301),a=r(86009),o=a&&a.isMap,s=o?i(o):n;e.exports=s},23805:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},40346:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},38440:function(e,t,r){var n=r(16038),i=r(27301),a=r(86009),o=a&&a.isSet,s=o?i(o):n;e.exports=s},44394:function(e,t,r){var n=r(72552),i=r(40346);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==n(e)}},37167:function(e,t,r){var n=r(4901),i=r(27301),a=r(86009),o=a&&a.isTypedArray,s=o?i(o):n;e.exports=s},95950:function(e,t,r){var n=r(70695),i=r(88984),a=r(64894);e.exports=function(e){return a(e)?n(e):i(e)}},37241:function(e,t,r){var n=r(70695),i=r(72903),a=r(64894);e.exports=function(e){return a(e)?n(e,!0):i(e)}},50104:function(e,t,r){var n=r(53661);function i(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(i.Cache||n),r}i.Cache=n,e.exports=i},63950:function(e){e.exports=function(){}},10124:function(e,t,r){var n=r(9325);e.exports=function(){return n.Date.now()}},63345:function(e){e.exports=function(){return[]}},89935:function(e){e.exports=function(){return!1}},99374:function(e,t,r){var n=r(54128),i=r(23805),a=r(44394),o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=n(e);var r=s.test(e);return r||u.test(e)?l(e.slice(2),r?2:8):o.test(e)?NaN:+e}},80243:function(e,t,r){"use strict";r.d(t,{ai:function(){return _}});var n=r(96540),i=r(98587),a=r(58168),o=r(9417),s=r(77387),u=r(4146);function l(e){console.warn("loadable: "+e)}var c=n.createContext(),d="__LOADABLE_REQUIRED_CHUNKS__";var f={initialChunks:{}},h="PENDING",p="REJECTED",v=function(e){return e};function g(e){var t=e.defaultResolveComponent,r=void 0===t?v:t,l=e.render,d=e.onLoad;function g(e,t){void 0===t&&(t={});var v=function(e){return"function"==typeof e?{requireAsync:e,resolve:function(){},chunkName:function(){}}:e}(e),g={};function m(e){return t.cacheKey?t.cacheKey(e):v.resolve?v.resolve(e):"static"}function y(e,n,i){var a=t.resolveComponent?t.resolveComponent(e,n):r(e);return u(i,a,{preload:!0}),a}var b,E,S=function(e){var t=m(e),r=g[t];return r&&r.status!==p||((r=v.requireAsync(e)).status=h,g[t]=r,r.then((function(){r.status="RESOLVED"}),(function(t){console.error("loadable-components: failed to asynchronously load component",{fileName:v.resolve(e),chunkName:v.chunkName(e),error:t?t.message:t}),r.status=p}))),r},T=function(e){function r(r){var n;return(n=e.call(this,r)||this).state={result:null,error:null,loading:!0,cacheKey:m(r)},function(e,t){if(!e){var r=new Error("loadable: "+t);throw r.framesToPop=1,r.name="Invariant Violation",r}}(!r.__chunkExtractor||v.requireSync,"SSR requires `@loadable/babel-plugin`, please install it"),r.__chunkExtractor?(!1===t.ssr||(v.requireAsync(r).catch((function(){return null})),n.loadSync(),r.__chunkExtractor.addChunk(v.chunkName(r))),(0,o.A)(n)):(!1!==t.ssr&&(v.isReady&&v.isReady(r)||v.chunkName&&f.initialChunks[v.chunkName(r)])&&n.loadSync(),n)}(0,s.A)(r,e),r.getDerivedStateFromProps=function(e,t){var r=m(e);return(0,a.A)({},t,{cacheKey:r,loading:t.loading||t.cacheKey!==r})};var n=r.prototype;return n.componentDidMount=function(){this.mounted=!0;var e=this.getCache();e&&e.status===p&&this.setCache(),this.state.loading&&this.loadAsync()},n.componentDidUpdate=function(e,t){t.cacheKey!==this.state.cacheKey&&this.loadAsync()},n.componentWillUnmount=function(){this.mounted=!1},n.safeSetState=function(e,t){this.mounted&&this.setState(e,t)},n.getCacheKey=function(){return m(this.props)},n.getCache=function(){return g[this.getCacheKey()]},n.setCache=function(e){void 0===e&&(e=void 0),g[this.getCacheKey()]=e},n.triggerOnLoad=function(){var e=this;d&&setTimeout((function(){d(e.state.result,e.props)}))},n.loadSync=function(){if(this.state.loading)try{var e=y(v.requireSync(this.props),this.props,_);this.state.result=e,this.state.loading=!1}catch(e){console.error("loadable-components: failed to synchronously load component, which expected to be available",{fileName:v.resolve(this.props),chunkName:v.chunkName(this.props),error:e?e.message:e}),this.state.error=e}},n.loadAsync=function(){var e=this,t=this.resolveAsync();return t.then((function(t){var r=y(t,e.props,_);e.safeSetState({result:r,loading:!1},(function(){return e.triggerOnLoad()}))})).catch((function(t){return e.safeSetState({error:t,loading:!1})})),t},n.resolveAsync=function(){var e=this.props,t=(e.__chunkExtractor,e.forwardedRef,(0,i.A)(e,["__chunkExtractor","forwardedRef"]));return S(t)},n.render=function(){var e=this.props,r=e.forwardedRef,n=e.fallback,o=(e.__chunkExtractor,(0,i.A)(e,["forwardedRef","fallback","__chunkExtractor"])),s=this.state,u=s.error,c=s.loading,d=s.result;if(t.suspense&&(this.getCache()||this.loadAsync()).status===h)throw this.loadAsync();if(u)throw u;var f=n||t.fallback||null;return c?f:l({fallback:f,result:d,options:t,props:(0,a.A)({},o,{ref:r})})},r}(n.Component),w=(E=function(e){return n.createElement(c.Consumer,null,(function(t){return n.createElement(b,Object.assign({__chunkExtractor:t},e))}))},(b=T).displayName&&(E.displayName=b.displayName+"WithChunkExtractor"),E),_=n.forwardRef((function(e,t){return n.createElement(w,Object.assign({forwardedRef:t},e))}));return _.displayName="Loadable",_.preload=function(e){_.load(e)},_.load=function(e){return S(e)},_}return{loadable:g,lazy:function(e,t){return g(e,(0,a.A)({},t,{suspense:!0}))}}}var m=g({defaultResolveComponent:function(e){return e.__esModule?e.default:e.default||e},render:function(e){var t=e.result,r=e.props;return n.createElement(t,r)}}),y=m.loadable,b=m.lazy,E=g({onLoad:function(e,t){e&&t.forwardedRef&&("function"==typeof t.forwardedRef?t.forwardedRef(e):t.forwardedRef.current=e)},render:function(e){var t=e.result,r=e.props;return r.children?r.children(t):null}}),S=E.loadable,T=E.lazy,w="undefined"!=typeof window;function _(e,t){void 0===e&&(e=function(){});var r=void 0===t?{}:t,n=r.namespace,i=void 0===n?"":n,a=r.chunkLoadingGlobal,o=void 0===a?"__LOADABLE_LOADED_CHUNKS__":a;if(!w)return l("`loadableReady()` must be called in browser only"),e(),Promise.resolve();var s=null;if(w){var u=function(e){return""+e+d}(i),c=document.getElementById(u);if(c){s=JSON.parse(c.textContent);var h=document.getElementById(u+"_ext");if(!h)throw new Error("loadable-component: @loadable/server does not match @loadable/component");JSON.parse(h.textContent).namedChunks.forEach((function(e){f.initialChunks[e]=!0}))}}if(!s)return l("`loadableReady()` requires state, please use `getScriptTags` or `getScriptElements` server-side"),e(),Promise.resolve();var p=!1;return new Promise((function(e){window[o]=window[o]||[];var t=window[o],r=t.push.bind(t);function n(){s.every((function(e){return t.some((function(t){return t[0].indexOf(e)>-1}))}))&&(p||(p=!0,e()))}t.push=function(){r.apply(void 0,arguments),n()},n()})).then(e)}var L=y;L.lib=S,b.lib=T,t.Ay=L}}]);
|