kucservice 1.1.4 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- (function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["kucservice"]=t():e["kucservice"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function i(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,i),a.l=!0,a.exports}return i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)i.d(r,a,function(t){return e[t]}.bind(null,a));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s="fb15")}({"00b4":function(e,t,i){"use strict";i("ac1f");var r=i("23e7"),a=i("da84"),n=i("c65b"),s=i("e330"),o=i("1626"),c=i("861d"),l=function(){var e=!1,t=/[ac]/;return t.exec=function(){return e=!0,/./.exec.apply(this,arguments)},!0===t.test("abc")&&e}(),u=a.Error,d=s(/./.test);r({target:"RegExp",proto:!0,forced:!l},{test:function(e){var t=this.exec;if(!o(t))return d(this,e);var i=n(t,this,e);if(null!==i&&!c(i))throw new u("RegExp exec method returned something other than an Object or null");return!!i}})},"00ee":function(e,t,i){var r=i("b622"),a=r("toStringTag"),n={};n[a]="z",e.exports="[object z]"===String(n)},"01b4":function(e,t){var i=function(){this.head=null,this.tail=null};i.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}},e.exports=i},"0366":function(e,t,i){var r=i("e330"),a=i("59ed"),n=i("40d5"),s=r(r.bind);e.exports=function(e,t){return a(e),void 0===t?e:n?s(e,t):function(){return e.apply(t,arguments)}}},"04d1":function(e,t,i){var r=i("342f"),a=r.match(/firefox\/(\d+)/i);e.exports=!!a&&+a[1]},"0538":function(e,t,i){"use strict";var r=i("da84"),a=i("e330"),n=i("59ed"),s=i("861d"),o=i("1a2d"),c=i("f36a"),l=i("40d5"),u=r.Function,d=a([].concat),h=a([].join),f={},p=function(e,t,i){if(!o(f,t)){for(var r=[],a=0;a<t;a++)r[a]="a["+a+"]";f[t]=u("C,a","return new C("+h(r,",")+")")}return f[t](e,i)};e.exports=l?u.bind:function(e){var t=n(this),i=t.prototype,r=c(arguments,1),a=function(){var i=d(r,c(arguments));return this instanceof a?p(t,i.length,i):t.apply(e,i)};return s(i)&&(a.prototype=i),a}},"057f":function(e,t,i){var r=i("c6b6"),a=i("fc6a"),n=i("241c").f,s=i("4dae"),o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],c=function(e){try{return n(e)}catch(t){return s(o)}};e.exports.f=function(e){return o&&"Window"==r(e)?c(e):n(a(e))}},"06c5":function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));i("fb6a"),i("d3b7"),i("b0c0"),i("a630"),i("3ca3"),i("ac1f"),i("00b4");var r=i("6b75");function a(e,t){if(e){if("string"===typeof e)return Object(r["a"])(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?Object(r["a"])(e,t):void 0}}},"06cf":function(e,t,i){var r=i("83ab"),a=i("c65b"),n=i("d1e7"),s=i("5c6c"),o=i("fc6a"),c=i("a04b"),l=i("1a2d"),u=i("0cfb"),d=Object.getOwnPropertyDescriptor;t.f=r?d:function(e,t){if(e=o(e),t=c(t),u)try{return d(e,t)}catch(i){}if(l(e,t))return s(!a(n.f,e,t),e[t])}},"07fa":function(e,t,i){var r=i("50c4");e.exports=function(e){return r(e.length)}},"0b25":function(e,t,i){var r=i("da84"),a=i("5926"),n=i("50c4"),s=r.RangeError;e.exports=function(e){if(void 0===e)return 0;var t=a(e),i=n(t);if(t!==i)throw s("Wrong length or index");return i}},"0b42":function(e,t,i){var r=i("da84"),a=i("e8b5"),n=i("68ee"),s=i("861d"),o=i("b622"),c=o("species"),l=r.Array;e.exports=function(e){var t;return a(e)&&(t=e.constructor,n(t)&&(t===l||a(t.prototype))?t=void 0:s(t)&&(t=t[c],null===t&&(t=void 0))),void 0===t?l:t}},"0c47":function(e,t,i){var r=i("da84"),a=i("d44e");a(r.JSON,"JSON",!0)},"0cb2":function(e,t,i){var r=i("e330"),a=i("7b0b"),n=Math.floor,s=r("".charAt),o=r("".replace),c=r("".slice),l=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,u=/\$([$&'`]|\d{1,2})/g;e.exports=function(e,t,i,r,d,h){var f=i+e.length,p=r.length,m=u;return void 0!==d&&(d=a(d),m=l),o(h,m,(function(a,o){var l;switch(s(o,0)){case"$":return"$";case"&":return e;case"`":return c(t,0,i);case"'":return c(t,f);case"<":l=d[c(o,1,-1)];break;default:var u=+o;if(0===u)return a;if(u>p){var h=n(u/10);return 0===h?a:h<=p?void 0===r[h-1]?s(o,1):r[h-1]+s(o,1):a}l=r[u-1]}return void 0===l?"":l}))}},"0ccb":function(e,t,i){var r=i("e330"),a=i("50c4"),n=i("577e"),s=i("1148"),o=i("1d80"),c=r(s),l=r("".slice),u=Math.ceil,d=function(e){return function(t,i,r){var s,d,h=n(o(t)),f=a(i),p=h.length,m=void 0===r?" ":n(r);return f<=p||""==m?h:(s=f-p,d=c(m,u(s/m.length)),d.length>s&&(d=l(d,0,s)),e?h+d:d+h)}};e.exports={start:d(!1),end:d(!0)}},"0cfb":function(e,t,i){var r=i("83ab"),a=i("d039"),n=i("cc12");e.exports=!r&&!a((function(){return 7!=Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a}))},"0d03":function(e,t,i){var r=i("e330"),a=i("6eeb"),n=Date.prototype,s="Invalid Date",o="toString",c=r(n[o]),l=r(n.getTime);String(new Date(NaN))!=s&&a(n,o,(function(){var e=l(this);return e===e?c(this):s}))},"0d3b":function(e,t,i){var r=i("d039"),a=i("b622"),n=i("c430"),s=a("iterator");e.exports=!r((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,i="";return e.pathname="c%20d",t.forEach((function(e,r){t["delete"]("b"),i+=r+e})),n&&!e.toJSON||!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[s]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==i||"x"!==new URL("http://x",void 0).host}))},"0d51":function(e,t,i){var r=i("da84"),a=r.String;e.exports=function(e){try{return a(e)}catch(t){return"Object"}}},"0eb6":function(e,t,i){"use strict";var r=i("23e7"),a=i("7c37"),n=i("d066"),s=i("d039"),o=i("7c73"),c=i("5c6c"),l=i("9bf2").f,u=i("37e8").f,d=i("6eeb"),h=i("1a2d"),f=i("19aa"),p=i("825a"),m=i("aa1f"),g=i("e391"),y=i("cf98"),v=i("c770"),b=i("69f3"),A=i("83ab"),k=i("c430"),_="DOMException",w="DATA_CLONE_ERR",S=n("Error"),T=n(_)||function(){try{var e=n("MessageChannel")||a("worker_threads").MessageChannel;(new e).port1.postMessage(new WeakMap)}catch(t){if(t.name==w&&25==t.code)return t.constructor}}(),E=T&&T.prototype,x=S.prototype,C=b.set,R=b.getterFor(_),L="stack"in S(_),D=function(e){return h(y,e)&&y[e].m?y[e].c:0},I=function(){f(this,P);var e=arguments.length,t=g(e<1?void 0:arguments[0]),i=g(e<2?void 0:arguments[1],"Error"),r=D(i);if(C(this,{type:_,name:i,message:t,code:r}),A||(this.name=i,this.message=t,this.code=r),L){var a=S(t);a.name=_,l(this,"stack",c(1,v(a.stack,1)))}},P=I.prototype=o(x),O=function(e){return{enumerable:!0,configurable:!0,get:e}},B=function(e){return O((function(){return R(this)[e]}))};A&&u(P,{name:B("name"),message:B("message"),code:B("code")}),l(P,"constructor",c(1,I));var M=s((function(){return!(new T instanceof S)})),F=M||s((function(){return x.toString!==m||"2: 1"!==String(new T(1,2))})),U=M||s((function(){return 25!==new T(1,"DataCloneError").code})),j=M||25!==T[w]||25!==E[w],N=k?F||U||j:M;r({global:!0,forced:N},{DOMException:N?I:T});var z=n(_),G=z.prototype;for(var H in F&&(k||T===z)&&d(G,"toString",m),U&&A&&T===z&&l(G,"code",O((function(){return D(p(this).name)}))),y)if(h(y,H)){var V=y[H],W=V.s,q=c(6,V.c);h(z,W)||l(z,W,q),h(G,W)||l(G,W,q)}},"107c":function(e,t,i){var r=i("d039"),a=i("da84"),n=a.RegExp;e.exports=r((function(){var e=n("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},"10d1":function(e,t,i){"use strict";var r,a=i("da84"),n=i("e330"),s=i("e2cc"),o=i("f183"),c=i("6d61"),l=i("acac"),u=i("861d"),d=i("4fad"),h=i("69f3").enforce,f=i("7f9a"),p=!a.ActiveXObject&&"ActiveXObject"in a,m=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},g=c("WeakMap",m,l);if(f&&p){r=l.getConstructor(m,"WeakMap",!0),o.enable();var y=g.prototype,v=n(y["delete"]),b=n(y.has),A=n(y.get),k=n(y.set);s(y,{delete:function(e){if(u(e)&&!d(e)){var t=h(this);return t.frozen||(t.frozen=new r),v(this,e)||t.frozen["delete"](e)}return v(this,e)},has:function(e){if(u(e)&&!d(e)){var t=h(this);return t.frozen||(t.frozen=new r),b(this,e)||t.frozen.has(e)}return b(this,e)},get:function(e){if(u(e)&&!d(e)){var t=h(this);return t.frozen||(t.frozen=new r),b(this,e)?A(this,e):t.frozen.get(e)}return A(this,e)},set:function(e,t){if(u(e)&&!d(e)){var i=h(this);i.frozen||(i.frozen=new r),b(this,e)?k(this,e,t):i.frozen.set(e,t)}else k(this,e,t);return this}})}},1148:function(e,t,i){"use strict";var r=i("da84"),a=i("5926"),n=i("577e"),s=i("1d80"),o=r.RangeError;e.exports=function(e){var t=n(s(this)),i="",r=a(e);if(r<0||r==1/0)throw o("Wrong number of repetitions");for(;r>0;(r>>>=1)&&(t+=t))1&r&&(i+=t);return i}},1276:function(e,t,i){"use strict";var r=i("2ba4"),a=i("c65b"),n=i("e330"),s=i("d784"),o=i("44e7"),c=i("825a"),l=i("1d80"),u=i("4840"),d=i("8aa5"),h=i("50c4"),f=i("577e"),p=i("dc4a"),m=i("4dae"),g=i("14c3"),y=i("9263"),v=i("9f7f"),b=i("d039"),A=v.UNSUPPORTED_Y,k=4294967295,_=Math.min,w=[].push,S=n(/./.exec),T=n(w),E=n("".slice),x=!b((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var i="ab".split(e);return 2!==i.length||"a"!==i[0]||"b"!==i[1]}));s("split",(function(e,t,i){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,i){var n=f(l(this)),s=void 0===i?k:i>>>0;if(0===s)return[];if(void 0===e)return[n];if(!o(e))return a(t,n,e,s);var c,u,d,h=[],p=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),g=0,v=new RegExp(e.source,p+"g");while(c=a(y,v,n)){if(u=v.lastIndex,u>g&&(T(h,E(n,g,c.index)),c.length>1&&c.index<n.length&&r(w,h,m(c,1)),d=c[0].length,g=u,h.length>=s))break;v.lastIndex===c.index&&v.lastIndex++}return g===n.length?!d&&S(v,"")||T(h,""):T(h,E(n,g)),h.length>s?m(h,0,s):h}:"0".split(void 0,0).length?function(e,i){return void 0===e&&0===i?[]:a(t,this,e,i)}:t,[function(t,i){var r=l(this),s=void 0==t?void 0:p(t,e);return s?a(s,t,r,i):a(n,f(r),t,i)},function(e,r){var a=c(this),s=f(e),o=i(n,a,s,r,n!==t);if(o.done)return o.value;var l=u(a,RegExp),p=a.unicode,m=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(A?"g":"y"),y=new l(A?"^(?:"+a.source+")":a,m),v=void 0===r?k:r>>>0;if(0===v)return[];if(0===s.length)return null===g(y,s)?[s]:[];var b=0,w=0,S=[];while(w<s.length){y.lastIndex=A?0:w;var x,C=g(y,A?E(s,w):s);if(null===C||(x=_(h(y.lastIndex+(A?w:0)),s.length))===b)w=d(s,w,p);else{if(T(S,E(s,b,w)),S.length===v)return S;for(var R=1;R<=C.length-1;R++)if(T(S,C[R]),S.length===v)return S;w=b=x}}return T(S,E(s,b)),S}]}),!x,A)},"129f":function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e===1/t:e!=e&&t!=t}},"131a":function(e,t,i){var r=i("23e7"),a=i("d2bb");r({target:"Object",stat:!0},{setPrototypeOf:a})},"13d5":function(e,t,i){"use strict";var r=i("23e7"),a=i("d58f").left,n=i("a640"),s=i("2d00"),o=i("605d"),c=n("reduce"),l=!o&&s>79&&s<83;r({target:"Array",proto:!0,forced:!c||l},{reduce:function(e){var t=arguments.length;return a(this,e,t,t>1?arguments[1]:void 0)}})},"143c":function(e,t,i){var r=i("74e8");r("Int32",(function(e){return function(t,i,r){return e(this,t,i,r)}}))},1448:function(e,t,i){var r=i("dfb9"),a=i("b6b7");e.exports=function(e,t){return r(a(e),t)}},"145e":function(e,t,i){"use strict";var r=i("7b0b"),a=i("23cb"),n=i("07fa"),s=Math.min;e.exports=[].copyWithin||function(e,t){var i=r(this),o=n(i),c=a(e,o),l=a(t,o),u=arguments.length>2?arguments[2]:void 0,d=s((void 0===u?o:a(u,o))-l,o-c),h=1;l<c&&c<l+d&&(h=-1,l+=d-1,c+=d-1);while(d-- >0)l in i?i[c]=i[l]:delete i[c],c+=h,l+=h;return i}},"14c3":function(e,t,i){var r=i("da84"),a=i("c65b"),n=i("825a"),s=i("1626"),o=i("c6b6"),c=i("9263"),l=r.TypeError;e.exports=function(e,t){var i=e.exec;if(s(i)){var r=a(i,e,t);return null!==r&&n(r),r}if("RegExp"===o(e))return a(c,e,t);throw l("RegExp#exec called on incompatible receiver")}},"159b":function(e,t,i){var r=i("da84"),a=i("fdbc"),n=i("785a"),s=i("17c2"),o=i("9112"),c=function(e){if(e&&e.forEach!==s)try{o(e,"forEach",s)}catch(t){e.forEach=s}};for(var l in a)a[l]&&c(r[l]&&r[l].prototype);c(n)},1626:function(e,t){e.exports=function(e){return"function"==typeof e}},"170b":function(e,t,i){"use strict";var r=i("ebb5"),a=i("50c4"),n=i("23cb"),s=i("b6b7"),o=r.aTypedArray,c=r.exportTypedArrayMethod;c("subarray",(function(e,t){var i=o(this),r=i.length,c=n(e,r),l=s(i);return new l(i.buffer,i.byteOffset+c*i.BYTES_PER_ELEMENT,a((void 0===t?r:n(t,r))-c))}))},"17c2":function(e,t,i){"use strict";var r=i("b727").forEach,a=i("a640"),n=a("forEach");e.exports=n?[].forEach:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}},"182d":function(e,t,i){var r=i("da84"),a=i("f8cd"),n=r.RangeError;e.exports=function(e,t){var i=a(e);if(i%t)throw n("Wrong offset");return i}},"19aa":function(e,t,i){var r=i("da84"),a=i("3a9b"),n=r.TypeError;e.exports=function(e,t){if(a(t,e))return e;throw n("Incorrect invocation")}},"1a2d":function(e,t,i){var r=i("e330"),a=i("7b0b"),n=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return n(a(e),t)}},"1be4":function(e,t,i){var r=i("d066");e.exports=r("document","documentElement")},"1c7e":function(e,t,i){var r=i("b622"),a=r("iterator"),n=!1;try{var s=0,o={next:function(){return{done:!!s++}},return:function(){n=!0}};o[a]=function(){return this},Array.from(o,(function(){throw 2}))}catch(c){}e.exports=function(e,t){if(!t&&!n)return!1;var i=!1;try{var r={};r[a]=function(){return{next:function(){return{done:i=!0}}}},e(r)}catch(c){}return i}},"1cdc":function(e,t,i){var r=i("342f");e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},"1d1c":function(e,t,i){var r=i("23e7"),a=i("83ab"),n=i("37e8").f;r({target:"Object",stat:!0,forced:Object.defineProperties!==n,sham:!a},{defineProperties:n})},"1d80":function(e,t,i){var r=i("da84"),a=r.TypeError;e.exports=function(e){if(void 0==e)throw a("Can't call method on "+e);return e}},"1da1":function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));i("d3b7"),i("e6cf");function r(e,t,i,r,a,n,s){try{var o=e[n](s),c=o.value}catch(l){return void i(l)}o.done?t(c):Promise.resolve(c).then(r,a)}function a(e){return function(){var t=this,i=arguments;return new Promise((function(a,n){var s=e.apply(t,i);function o(e){r(s,a,n,o,c,"next",e)}function c(e){r(s,a,n,o,c,"throw",e)}o(void 0)}))}}},"1dde":function(e,t,i){var r=i("d039"),a=i("b622"),n=i("2d00"),s=a("species");e.exports=function(e){return n>=51||!r((function(){var t=[],i=t.constructor={};return i[s]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},"20bf":function(e,t,i){"use strict";var r=i("8aa7"),a=i("ebb5").exportTypedArrayStaticMethod,n=i("a078");a("from",n,r)},"219c":function(e,t,i){"use strict";var r=i("da84"),a=i("e330"),n=i("d039"),s=i("59ed"),o=i("addb"),c=i("ebb5"),l=i("04d1"),u=i("d998"),d=i("2d00"),h=i("512c"),f=r.Array,p=c.aTypedArray,m=c.exportTypedArrayMethod,g=r.Uint16Array,y=g&&a(g.prototype.sort),v=!!y&&!(n((function(){y(new g(2),null)}))&&n((function(){y(new g(2),{})}))),b=!!y&&!n((function(){if(d)return d<74;if(l)return l<67;if(u)return!0;if(h)return h<602;var e,t,i=new g(516),r=f(516);for(e=0;e<516;e++)t=e%4,i[e]=515-e,r[e]=e-2*t+3;for(y(i,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(i[e]!==r[e])return!0})),A=function(e){return function(t,i){return void 0!==e?+e(t,i)||0:i!==i?-1:t!==t?1:0===t&&0===i?1/t>0&&1/i<0?1:-1:t>i}};m("sort",(function(e){return void 0!==e&&s(e),b?y(this,e):o(p(this),A(e))}),!b||v)},2266:function(e,t,i){var r=i("da84"),a=i("0366"),n=i("c65b"),s=i("825a"),o=i("0d51"),c=i("e95a"),l=i("07fa"),u=i("3a9b"),d=i("9a1f"),h=i("35a1"),f=i("2a62"),p=r.TypeError,m=function(e,t){this.stopped=e,this.result=t},g=m.prototype;e.exports=function(e,t,i){var r,y,v,b,A,k,_,w=i&&i.that,S=!(!i||!i.AS_ENTRIES),T=!(!i||!i.IS_ITERATOR),E=!(!i||!i.INTERRUPTED),x=a(t,w),C=function(e){return r&&f(r,"normal",e),new m(!0,e)},R=function(e){return S?(s(e),E?x(e[0],e[1],C):x(e[0],e[1])):E?x(e,C):x(e)};if(T)r=e;else{if(y=h(e),!y)throw p(o(e)+" is not iterable");if(c(y)){for(v=0,b=l(e);b>v;v++)if(A=R(e[v]),A&&u(g,A))return A;return new m(!1)}r=d(e,y)}k=r.next;while(!(_=n(k,r)).done){try{A=R(_.value)}catch(L){f(r,"throw",L)}if("object"==typeof A&&A&&u(g,A))return A}return new m(!1)}},"23cb":function(e,t,i){var r=i("5926"),a=Math.max,n=Math.min;e.exports=function(e,t){var i=r(e);return i<0?a(i+t,0):n(i,t)}},"23dc":function(e,t,i){var r=i("d44e");r(Math,"Math",!0)},"23e7":function(e,t,i){var r=i("da84"),a=i("06cf").f,n=i("9112"),s=i("6eeb"),o=i("ce4e"),c=i("e893"),l=i("94ca");e.exports=function(e,t){var i,u,d,h,f,p,m=e.target,g=e.global,y=e.stat;if(u=g?r:y?r[m]||o(m,{}):(r[m]||{}).prototype,u)for(d in t){if(f=t[d],e.noTargetGet?(p=a(u,d),h=p&&p.value):h=u[d],i=l(g?d:m+(y?".":"#")+d,e.forced),!i&&void 0!==h){if(typeof f==typeof h)continue;c(f,h)}(e.sham||h&&h.sham)&&n(f,"sham",!0),s(u,d,f,e)}}},"241c":function(e,t,i){var r=i("ca84"),a=i("7839"),n=a.concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,n)}},2532:function(e,t,i){"use strict";var r=i("23e7"),a=i("e330"),n=i("5a34"),s=i("1d80"),o=i("577e"),c=i("ab13"),l=a("".indexOf);r({target:"String",proto:!0,forced:!c("includes")},{includes:function(e){return!!~l(o(s(this)),o(n(e)),arguments.length>1?arguments[1]:void 0)}})},"257e":function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));i("d9e2"),i("d401");function r(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},"25a1":function(e,t,i){"use strict";var r=i("ebb5"),a=i("d58f").right,n=r.aTypedArray,s=r.exportTypedArrayMethod;s("reduceRight",(function(e){var t=arguments.length;return a(n(this),e,t,t>1?arguments[1]:void 0)}))},"25f0":function(e,t,i){"use strict";var r=i("e330"),a=i("5e77").PROPER,n=i("6eeb"),s=i("825a"),o=i("3a9b"),c=i("577e"),l=i("d039"),u=i("ad6d"),d="toString",h=RegExp.prototype,f=h[d],p=r(u),m=l((function(){return"/a/b"!=f.call({source:"a",flags:"b"})})),g=a&&f.name!=d;(m||g)&&n(RegExp.prototype,d,(function(){var e=s(this),t=c(e.source),i=e.flags,r=c(void 0===i&&o(h,e)&&!("flags"in h)?p(e):i);return"/"+t+"/"+r}),{unsafe:!0})},2626:function(e,t,i){"use strict";var r=i("d066"),a=i("9bf2"),n=i("b622"),s=i("83ab"),o=n("species");e.exports=function(e){var t=r(e),i=a.f;s&&t&&!t[o]&&i(t,o,{configurable:!0,get:function(){return this}})}},"262e":function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));i("d9e2"),i("d401"),i("b8bf"),i("7a82");var r=i("b380");function a(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Object(r["a"])(e,t)}},"26e9":function(e,t,i){"use strict";var r=i("23e7"),a=i("e330"),n=i("e8b5"),s=a([].reverse),o=[1,2];r({target:"Array",proto:!0,forced:String(o)===String(o.reverse())},{reverse:function(){return n(this)&&(this.length=this.length),s(this)}})},"277d":function(e,t,i){var r=i("23e7"),a=i("e8b5");r({target:"Array",stat:!0},{isArray:a})},2909:function(e,t,i){"use strict";i.d(t,"a",(function(){return c}));i("277d");var r=i("6b75");function a(e){if(Array.isArray(e))return Object(r["a"])(e)}i("a4d3"),i("e01a"),i("d3b7"),i("d28b"),i("e260"),i("3ca3"),i("ddb0"),i("a630");function n(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}var s=i("06c5");i("d9e2"),i("d401");function o(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(e){return a(e)||n(e)||Object(s["a"])(e)||o()}},2954:function(e,t,i){"use strict";var r=i("ebb5"),a=i("b6b7"),n=i("d039"),s=i("f36a"),o=r.aTypedArray,c=r.exportTypedArrayMethod,l=n((function(){new Int8Array(1).slice()}));c("slice",(function(e,t){var i=s(o(this),e,t),r=a(this),n=0,c=i.length,l=new r(c);while(c>n)l[n]=i[n++];return l}),l)},"2a62":function(e,t,i){var r=i("c65b"),a=i("825a"),n=i("dc4a");e.exports=function(e,t,i){var s,o;a(e);try{if(s=n(e,"return"),!s){if("throw"===t)throw i;return i}s=r(s,e)}catch(c){o=!0,s=c}if("throw"===t)throw i;if(o)throw s;return a(s),i}},"2b3d":function(e,t,i){"use strict";i("3ca3");var r,a=i("23e7"),n=i("83ab"),s=i("0d3b"),o=i("da84"),c=i("0366"),l=i("e330"),u=i("37e8").f,d=i("6eeb"),h=i("19aa"),f=i("1a2d"),p=i("60da"),m=i("4df4"),g=i("4dae"),y=i("6547").codeAt,v=i("5fb2"),b=i("577e"),A=i("d44e"),k=i("d6d6"),_=i("9861"),w=i("69f3"),S=w.set,T=w.getterFor("URL"),E=_.URLSearchParams,x=_.getState,C=o.URL,R=o.TypeError,L=o.parseInt,D=Math.floor,I=Math.pow,P=l("".charAt),O=l(/./.exec),B=l([].join),M=l(1..toString),F=l([].pop),U=l([].push),j=l("".replace),N=l([].shift),z=l("".split),G=l("".slice),H=l("".toLowerCase),V=l([].unshift),W="Invalid authority",q="Invalid scheme",K="Invalid host",J="Invalid port",Y=/[a-z]/i,Q=/[\d+-.a-z]/i,X=/\d/,$=/^0x/i,Z=/^[0-7]+$/,ee=/^\d+$/,te=/^[\da-f]+$/i,ie=/[\0\t\n\r #%/:<>?@[\\\]^|]/,re=/[\0\t\n\r #/:<>?@[\\\]^|]/,ae=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,ne=/[\t\n\r]/g,se=function(e){var t,i,r,a,n,s,o,c=z(e,".");if(c.length&&""==c[c.length-1]&&c.length--,t=c.length,t>4)return e;for(i=[],r=0;r<t;r++){if(a=c[r],""==a)return e;if(n=10,a.length>1&&"0"==P(a,0)&&(n=O($,a)?16:8,a=G(a,8==n?1:2)),""===a)s=0;else{if(!O(10==n?ee:8==n?Z:te,a))return e;s=L(a,n)}U(i,s)}for(r=0;r<t;r++)if(s=i[r],r==t-1){if(s>=I(256,5-t))return null}else if(s>255)return null;for(o=F(i),r=0;r<i.length;r++)o+=i[r]*I(256,3-r);return o},oe=function(e){var t,i,r,a,n,s,o,c=[0,0,0,0,0,0,0,0],l=0,u=null,d=0,h=function(){return P(e,d)};if(":"==h()){if(":"!=P(e,1))return;d+=2,l++,u=l}while(h()){if(8==l)return;if(":"!=h()){t=i=0;while(i<4&&O(te,h()))t=16*t+L(h(),16),d++,i++;if("."==h()){if(0==i)return;if(d-=i,l>6)return;r=0;while(h()){if(a=null,r>0){if(!("."==h()&&r<4))return;d++}if(!O(X,h()))return;while(O(X,h())){if(n=L(h(),10),null===a)a=n;else{if(0==a)return;a=10*a+n}if(a>255)return;d++}c[l]=256*c[l]+a,r++,2!=r&&4!=r||l++}if(4!=r)return;break}if(":"==h()){if(d++,!h())return}else if(h())return;c[l++]=t}else{if(null!==u)return;d++,l++,u=l}}if(null!==u){s=l-u,l=7;while(0!=l&&s>0)o=c[l],c[l--]=c[u+s-1],c[u+--s]=o}else if(8!=l)return;return c},ce=function(e){for(var t=null,i=1,r=null,a=0,n=0;n<8;n++)0!==e[n]?(a>i&&(t=r,i=a),r=null,a=0):(null===r&&(r=n),++a);return a>i&&(t=r,i=a),t},le=function(e){var t,i,r,a;if("number"==typeof e){for(t=[],i=0;i<4;i++)V(t,e%256),e=D(e/256);return B(t,".")}if("object"==typeof e){for(t="",r=ce(e),i=0;i<8;i++)a&&0===e[i]||(a&&(a=!1),r===i?(t+=i?":":"::",a=!0):(t+=M(e[i],16),i<7&&(t+=":")));return"["+t+"]"}return e},ue={},de=p({},ue,{" ":1,'"':1,"<":1,">":1,"`":1}),he=p({},de,{"#":1,"?":1,"{":1,"}":1}),fe=p({},he,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),pe=function(e,t){var i=y(e,0);return i>32&&i<127&&!f(t,e)?e:encodeURIComponent(e)},me={ftp:21,file:null,http:80,https:443,ws:80,wss:443},ge=function(e,t){var i;return 2==e.length&&O(Y,P(e,0))&&(":"==(i=P(e,1))||!t&&"|"==i)},ye=function(e){var t;return e.length>1&&ge(G(e,0,2))&&(2==e.length||"/"===(t=P(e,2))||"\\"===t||"?"===t||"#"===t)},ve=function(e){return"."===e||"%2e"===H(e)},be=function(e){return e=H(e),".."===e||"%2e."===e||".%2e"===e||"%2e%2e"===e},Ae={},ke={},_e={},we={},Se={},Te={},Ee={},xe={},Ce={},Re={},Le={},De={},Ie={},Pe={},Oe={},Be={},Me={},Fe={},Ue={},je={},Ne={},ze=function(e,t,i){var r,a,n,s=b(e);if(t){if(a=this.parse(s),a)throw R(a);this.searchParams=null}else{if(void 0!==i&&(r=new ze(i,!0)),a=this.parse(s,null,r),a)throw R(a);n=x(new E),n.bindURL(this),this.searchParams=n}};ze.prototype={type:"URL",parse:function(e,t,i){var a,n,s,o,c=this,l=t||Ae,u=0,d="",h=!1,p=!1,y=!1;e=b(e),t||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,e=j(e,ae,"")),e=j(e,ne,""),a=m(e);while(u<=a.length){switch(n=a[u],l){case Ae:if(!n||!O(Y,n)){if(t)return q;l=_e;continue}d+=H(n),l=ke;break;case ke:if(n&&(O(Q,n)||"+"==n||"-"==n||"."==n))d+=H(n);else{if(":"!=n){if(t)return q;d="",l=_e,u=0;continue}if(t&&(c.isSpecial()!=f(me,d)||"file"==d&&(c.includesCredentials()||null!==c.port)||"file"==c.scheme&&!c.host))return;if(c.scheme=d,t)return void(c.isSpecial()&&me[c.scheme]==c.port&&(c.port=null));d="","file"==c.scheme?l=Pe:c.isSpecial()&&i&&i.scheme==c.scheme?l=we:c.isSpecial()?l=xe:"/"==a[u+1]?(l=Se,u++):(c.cannotBeABaseURL=!0,U(c.path,""),l=Ue)}break;case _e:if(!i||i.cannotBeABaseURL&&"#"!=n)return q;if(i.cannotBeABaseURL&&"#"==n){c.scheme=i.scheme,c.path=g(i.path),c.query=i.query,c.fragment="",c.cannotBeABaseURL=!0,l=Ne;break}l="file"==i.scheme?Pe:Te;continue;case we:if("/"!=n||"/"!=a[u+1]){l=Te;continue}l=Ce,u++;break;case Se:if("/"==n){l=Re;break}l=Fe;continue;case Te:if(c.scheme=i.scheme,n==r)c.username=i.username,c.password=i.password,c.host=i.host,c.port=i.port,c.path=g(i.path),c.query=i.query;else if("/"==n||"\\"==n&&c.isSpecial())l=Ee;else if("?"==n)c.username=i.username,c.password=i.password,c.host=i.host,c.port=i.port,c.path=g(i.path),c.query="",l=je;else{if("#"!=n){c.username=i.username,c.password=i.password,c.host=i.host,c.port=i.port,c.path=g(i.path),c.path.length--,l=Fe;continue}c.username=i.username,c.password=i.password,c.host=i.host,c.port=i.port,c.path=g(i.path),c.query=i.query,c.fragment="",l=Ne}break;case Ee:if(!c.isSpecial()||"/"!=n&&"\\"!=n){if("/"!=n){c.username=i.username,c.password=i.password,c.host=i.host,c.port=i.port,l=Fe;continue}l=Re}else l=Ce;break;case xe:if(l=Ce,"/"!=n||"/"!=P(d,u+1))continue;u++;break;case Ce:if("/"!=n&&"\\"!=n){l=Re;continue}break;case Re:if("@"==n){h&&(d="%40"+d),h=!0,s=m(d);for(var v=0;v<s.length;v++){var A=s[v];if(":"!=A||y){var k=pe(A,fe);y?c.password+=k:c.username+=k}else y=!0}d=""}else if(n==r||"/"==n||"?"==n||"#"==n||"\\"==n&&c.isSpecial()){if(h&&""==d)return W;u-=m(d).length+1,d="",l=Le}else d+=n;break;case Le:case De:if(t&&"file"==c.scheme){l=Be;continue}if(":"!=n||p){if(n==r||"/"==n||"?"==n||"#"==n||"\\"==n&&c.isSpecial()){if(c.isSpecial()&&""==d)return K;if(t&&""==d&&(c.includesCredentials()||null!==c.port))return;if(o=c.parseHost(d),o)return o;if(d="",l=Me,t)return;continue}"["==n?p=!0:"]"==n&&(p=!1),d+=n}else{if(""==d)return K;if(o=c.parseHost(d),o)return o;if(d="",l=Ie,t==De)return}break;case Ie:if(!O(X,n)){if(n==r||"/"==n||"?"==n||"#"==n||"\\"==n&&c.isSpecial()||t){if(""!=d){var _=L(d,10);if(_>65535)return J;c.port=c.isSpecial()&&_===me[c.scheme]?null:_,d=""}if(t)return;l=Me;continue}return J}d+=n;break;case Pe:if(c.scheme="file","/"==n||"\\"==n)l=Oe;else{if(!i||"file"!=i.scheme){l=Fe;continue}if(n==r)c.host=i.host,c.path=g(i.path),c.query=i.query;else if("?"==n)c.host=i.host,c.path=g(i.path),c.query="",l=je;else{if("#"!=n){ye(B(g(a,u),""))||(c.host=i.host,c.path=g(i.path),c.shortenPath()),l=Fe;continue}c.host=i.host,c.path=g(i.path),c.query=i.query,c.fragment="",l=Ne}}break;case Oe:if("/"==n||"\\"==n){l=Be;break}i&&"file"==i.scheme&&!ye(B(g(a,u),""))&&(ge(i.path[0],!0)?U(c.path,i.path[0]):c.host=i.host),l=Fe;continue;case Be:if(n==r||"/"==n||"\\"==n||"?"==n||"#"==n){if(!t&&ge(d))l=Fe;else if(""==d){if(c.host="",t)return;l=Me}else{if(o=c.parseHost(d),o)return o;if("localhost"==c.host&&(c.host=""),t)return;d="",l=Me}continue}d+=n;break;case Me:if(c.isSpecial()){if(l=Fe,"/"!=n&&"\\"!=n)continue}else if(t||"?"!=n)if(t||"#"!=n){if(n!=r&&(l=Fe,"/"!=n))continue}else c.fragment="",l=Ne;else c.query="",l=je;break;case Fe:if(n==r||"/"==n||"\\"==n&&c.isSpecial()||!t&&("?"==n||"#"==n)){if(be(d)?(c.shortenPath(),"/"==n||"\\"==n&&c.isSpecial()||U(c.path,"")):ve(d)?"/"==n||"\\"==n&&c.isSpecial()||U(c.path,""):("file"==c.scheme&&!c.path.length&&ge(d)&&(c.host&&(c.host=""),d=P(d,0)+":"),U(c.path,d)),d="","file"==c.scheme&&(n==r||"?"==n||"#"==n))while(c.path.length>1&&""===c.path[0])N(c.path);"?"==n?(c.query="",l=je):"#"==n&&(c.fragment="",l=Ne)}else d+=pe(n,he);break;case Ue:"?"==n?(c.query="",l=je):"#"==n?(c.fragment="",l=Ne):n!=r&&(c.path[0]+=pe(n,ue));break;case je:t||"#"!=n?n!=r&&("'"==n&&c.isSpecial()?c.query+="%27":c.query+="#"==n?"%23":pe(n,ue)):(c.fragment="",l=Ne);break;case Ne:n!=r&&(c.fragment+=pe(n,de));break}u++}},parseHost:function(e){var t,i,r;if("["==P(e,0)){if("]"!=P(e,e.length-1))return K;if(t=oe(G(e,1,-1)),!t)return K;this.host=t}else if(this.isSpecial()){if(e=v(e),O(ie,e))return K;if(t=se(e),null===t)return K;this.host=t}else{if(O(re,e))return K;for(t="",i=m(e),r=0;r<i.length;r++)t+=pe(i[r],ue);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return f(me,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&ge(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,i=e.username,r=e.password,a=e.host,n=e.port,s=e.path,o=e.query,c=e.fragment,l=t+":";return null!==a?(l+="//",e.includesCredentials()&&(l+=i+(r?":"+r:"")+"@"),l+=le(a),null!==n&&(l+=":"+n)):"file"==t&&(l+="//"),l+=e.cannotBeABaseURL?s[0]:s.length?"/"+B(s,"/"):"",null!==o&&(l+="?"+o),null!==c&&(l+="#"+c),l},setHref:function(e){var t=this.parse(e);if(t)throw R(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new Ge(e.path[0]).origin}catch(i){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+le(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(b(e)+":",Ae)},getUsername:function(){return this.username},setUsername:function(e){var t=m(b(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var i=0;i<t.length;i++)this.username+=pe(t[i],fe)}},getPassword:function(){return this.password},setPassword:function(e){var t=m(b(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var i=0;i<t.length;i++)this.password+=pe(t[i],fe)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?le(e):le(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,Le)},getHostname:function(){var e=this.host;return null===e?"":le(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,De)},getPort:function(){var e=this.port;return null===e?"":b(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(e=b(e),""==e?this.port=null:this.parse(e,Ie))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+B(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,Me))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){e=b(e),""==e?this.query=null:("?"==P(e,0)&&(e=G(e,1)),this.query="",this.parse(e,je)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){e=b(e),""!=e?("#"==P(e,0)&&(e=G(e,1)),this.fragment="",this.parse(e,Ne)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Ge=function(e){var t=h(this,He),i=k(arguments.length,1)>1?arguments[1]:void 0,r=S(t,new ze(e,!1,i));n||(t.href=r.serialize(),t.origin=r.getOrigin(),t.protocol=r.getProtocol(),t.username=r.getUsername(),t.password=r.getPassword(),t.host=r.getHost(),t.hostname=r.getHostname(),t.port=r.getPort(),t.pathname=r.getPathname(),t.search=r.getSearch(),t.searchParams=r.getSearchParams(),t.hash=r.getHash())},He=Ge.prototype,Ve=function(e,t){return{get:function(){return T(this)[e]()},set:t&&function(e){return T(this)[t](e)},configurable:!0,enumerable:!0}};if(n&&u(He,{href:Ve("serialize","setHref"),origin:Ve("getOrigin"),protocol:Ve("getProtocol","setProtocol"),username:Ve("getUsername","setUsername"),password:Ve("getPassword","setPassword"),host:Ve("getHost","setHost"),hostname:Ve("getHostname","setHostname"),port:Ve("getPort","setPort"),pathname:Ve("getPathname","setPathname"),search:Ve("getSearch","setSearch"),searchParams:Ve("getSearchParams"),hash:Ve("getHash","setHash")}),d(He,"toJSON",(function(){return T(this).serialize()}),{enumerable:!0}),d(He,"toString",(function(){return T(this).serialize()}),{enumerable:!0}),C){var We=C.createObjectURL,qe=C.revokeObjectURL;We&&d(Ge,"createObjectURL",c(We,C)),qe&&d(Ge,"revokeObjectURL",c(qe,C))}A(Ge,"URL"),a({global:!0,forced:!s,sham:!n},{URL:Ge})},"2ba4":function(e,t,i){var r=i("40d5"),a=Function.prototype,n=a.apply,s=a.call;e.exports="object"==typeof Reflect&&Reflect.apply||(r?s.bind(n):function(){return s.apply(n,arguments)})},"2c3e":function(e,t,i){var r=i("da84"),a=i("83ab"),n=i("9f7f").MISSED_STICKY,s=i("c6b6"),o=i("9bf2").f,c=i("69f3").get,l=RegExp.prototype,u=r.TypeError;a&&n&&o(l,"sticky",{configurable:!0,get:function(){if(this!==l){if("RegExp"===s(this))return!!c(this).sticky;throw u("Incompatible receiver, RegExp required")}}})},"2ca0":function(e,t,i){"use strict";var r=i("23e7"),a=i("e330"),n=i("06cf").f,s=i("50c4"),o=i("577e"),c=i("5a34"),l=i("1d80"),u=i("ab13"),d=i("c430"),h=a("".startsWith),f=a("".slice),p=Math.min,m=u("startsWith"),g=!d&&!m&&!!function(){var e=n(String.prototype,"startsWith");return e&&!e.writable}();r({target:"String",proto:!0,forced:!g&&!m},{startsWith:function(e){var t=o(l(this));c(e);var i=s(p(arguments.length>1?arguments[1]:void 0,t.length)),r=o(e);return h?h(t,r,i):f(t,i,i+r.length)===r}})},"2caf":function(e,t,i){"use strict";i.d(t,"a",(function(){return s}));i("4ae1"),i("d3b7"),i("f8c9");var r=i("7e84"),a=i("d967"),n=i("99de");function s(e){var t=Object(a["a"])();return function(){var i,a=Object(r["a"])(e);if(t){var s=Object(r["a"])(this).constructor;i=Reflect.construct(a,arguments,s)}else i=a.apply(this,arguments);return Object(n["a"])(this,i)}}},"2cf4":function(e,t,i){var r,a,n,s,o=i("da84"),c=i("2ba4"),l=i("0366"),u=i("1626"),d=i("1a2d"),h=i("d039"),f=i("1be4"),p=i("f36a"),m=i("cc12"),g=i("d6d6"),y=i("1cdc"),v=i("605d"),b=o.setImmediate,A=o.clearImmediate,k=o.process,_=o.Dispatch,w=o.Function,S=o.MessageChannel,T=o.String,E=0,x={},C="onreadystatechange";try{r=o.location}catch(P){}var R=function(e){if(d(x,e)){var t=x[e];delete x[e],t()}},L=function(e){return function(){R(e)}},D=function(e){R(e.data)},I=function(e){o.postMessage(T(e),r.protocol+"//"+r.host)};b&&A||(b=function(e){g(arguments.length,1);var t=u(e)?e:w(e),i=p(arguments,1);return x[++E]=function(){c(t,void 0,i)},a(E),E},A=function(e){delete x[e]},v?a=function(e){k.nextTick(L(e))}:_&&_.now?a=function(e){_.now(L(e))}:S&&!y?(n=new S,s=n.port2,n.port1.onmessage=D,a=l(s.postMessage,s)):o.addEventListener&&u(o.postMessage)&&!o.importScripts&&r&&"file:"!==r.protocol&&!h(I)?(a=I,o.addEventListener("message",D,!1)):a=C in m("script")?function(e){f.appendChild(m("script"))[C]=function(){f.removeChild(this),R(e)}}:function(e){setTimeout(L(e),0)}),e.exports={set:b,clear:A}},"2d00":function(e,t,i){var r,a,n=i("da84"),s=i("342f"),o=n.process,c=n.Deno,l=o&&o.versions||c&&c.version,u=l&&l.v8;u&&(r=u.split("."),a=r[0]>0&&r[0]<4?1:+(r[0]+r[1])),!a&&s&&(r=s.match(/Edge\/(\d+)/),(!r||r[1]>=74)&&(r=s.match(/Chrome\/(\d+)/),r&&(a=+r[1]))),e.exports=a},3280:function(e,t,i){"use strict";var r=i("ebb5"),a=i("2ba4"),n=i("e58c"),s=r.aTypedArray,o=r.exportTypedArrayMethod;o("lastIndexOf",(function(e){var t=arguments.length;return a(n,s(this),t>1?[e,arguments[1]]:[e])}))},3410:function(e,t,i){var r=i("23e7"),a=i("d039"),n=i("7b0b"),s=i("e163"),o=i("e177"),c=a((function(){s(1)}));r({target:"Object",stat:!0,forced:c,sham:!o},{getPrototypeOf:function(e){return s(n(e))}})},"342f":function(e,t,i){var r=i("d066");e.exports=r("navigator","userAgent")||""},"35a1":function(e,t,i){var r=i("f5df"),a=i("dc4a"),n=i("3f8c"),s=i("b622"),o=s("iterator");e.exports=function(e){if(void 0!=e)return a(e,o)||a(e,"@@iterator")||n[r(e)]}},"37e8":function(e,t,i){var r=i("83ab"),a=i("aed9"),n=i("9bf2"),s=i("825a"),o=i("fc6a"),c=i("df75");t.f=r&&!a?Object.defineProperties:function(e,t){s(e);var i,r=o(t),a=c(t),l=a.length,u=0;while(l>u)n.f(e,i=a[u++],r[i]);return e}},"38cf":function(e,t,i){var r=i("23e7"),a=i("1148");r({target:"String",proto:!0},{repeat:a})},"3a7b":function(e,t,i){"use strict";var r=i("ebb5"),a=i("b727").findIndex,n=r.aTypedArray,s=r.exportTypedArrayMethod;s("findIndex",(function(e){return a(n(this),e,arguments.length>1?arguments[1]:void 0)}))},"3a9b":function(e,t,i){var r=i("e330");e.exports=r({}.isPrototypeOf)},"3bbe":function(e,t,i){var r=i("da84"),a=i("1626"),n=r.String,s=r.TypeError;e.exports=function(e){if("object"==typeof e||a(e))return e;throw s("Can't set "+n(e)+" as a prototype")}},"3c5d":function(e,t,i){"use strict";var r=i("da84"),a=i("c65b"),n=i("ebb5"),s=i("07fa"),o=i("182d"),c=i("7b0b"),l=i("d039"),u=r.RangeError,d=r.Int8Array,h=d&&d.prototype,f=h&&h.set,p=n.aTypedArray,m=n.exportTypedArrayMethod,g=!l((function(){var e=new Uint8ClampedArray(2);return a(f,e,{length:1,0:3},1),3!==e[1]})),y=g&&n.NATIVE_ARRAY_BUFFER_VIEWS&&l((function(){var e=new d(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));m("set",(function(e){p(this);var t=o(arguments.length>1?arguments[1]:void 0,1),i=c(e);if(g)return a(f,this,i,t);var r=this.length,n=s(i),l=0;if(n+t>r)throw u("Wrong length");while(l<n)this[t+l]=i[l++]}),!g||y)},"3ca3":function(e,t,i){"use strict";var r=i("6547").charAt,a=i("577e"),n=i("69f3"),s=i("7dd0"),o="String Iterator",c=n.set,l=n.getterFor(o);s(String,"String",(function(e){c(this,{type:o,string:a(e),index:0})}),(function(){var e,t=l(this),i=t.string,a=t.index;return a>=i.length?{value:void 0,done:!0}:(e=r(i,a),t.index+=e.length,{value:e,done:!1})}))},"3f8c":function(e,t){e.exports={}},"3fcc":function(e,t,i){"use strict";var r=i("ebb5"),a=i("b727").map,n=i("b6b7"),s=r.aTypedArray,o=r.exportTypedArrayMethod;o("map",(function(e){return a(s(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(n(e))(t)}))}))},4057:function(e,t,i){var r=i("23e7"),a=Math.hypot,n=Math.abs,s=Math.sqrt,o=!!a&&a(1/0,NaN)!==1/0;r({target:"Math",stat:!0,forced:o},{hypot:function(e,t){var i,r,a=0,o=0,c=arguments.length,l=0;while(o<c)i=n(arguments[o++]),l<i?(r=l/i,a=a*r*r+1,l=i):i>0?(r=i/l,a+=r*r):a+=i;return l===1/0?1/0:l*s(a)}})},"408a":function(e,t,i){var r=i("e330");e.exports=r(1..valueOf)},"40d5":function(e,t,i){var r=i("d039");e.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},4160:function(e,t,i){"use strict";var r=i("23e7"),a=i("17c2");r({target:"Array",proto:!0,forced:[].forEach!=a},{forEach:a})},4269:function(e,t,i){"use strict";i.r(t),i.d(t,"useSocket",(function(){return k}));var r=i("257e"),a=i("262e"),n=i("2caf"),s=i("9072"),o=i("d4ec"),c=i("bee2"),l=i("ade3"),u=i("53ca"),d=(i("d9e2"),i("d401"),i("4160"),i("d3b7"),i("159b"),i("b64b"),i("e260"),i("4ec9"),i("3ca3"),i("ddb0"),i("13d5"),i("99af"),i("cca6"),i("4795"),i("caad"),i("e9c4"),["open","close","message","error","reconnect"]),h=3e4,f=4e4,p=10,m={Type:1,Parameters:["alive"]},g=1e3;function y(e){if(!e&&"object"!==Object(u["a"])(e))throw new Error("error arguments","deepClone");var t=e.constructor===Array?[]:{};return Object.keys(e).forEach((function(i){e[i]&&"object"===Object(u["a"])(e[i])?t[i]=y(e[i]):t[i]=e[i]})),t}var v=function(){function e(){Object(o["a"])(this,e),Object(l["a"])(this,"deps",new Map)}return Object(c["a"])(e,[{key:"depend",value:function(e,t){this.deps.set(e,t)}},{key:"notify",value:function(e,t){this.deps.has(e)&&this.deps.get(e)(t)}}]),e}(),b=function(e){Object(a["a"])(i,e);var t=Object(n["a"])(i);function i(e,a){var n,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,c=arguments.length>3?arguments[3]:void 0;Object(o["a"])(this,i);var d="",f=e.url,g=e.protocols,y=e.query,v=void 0===y?{}:y,b=e.greet,A=void 0===b?null:b,k=e.customBase,_=void 0===k?null:k,w=e.checkData,S=Object.keys(v).reduce((function(e,t){return"object"!==Object(u["a"])(v[t])&&"function"!==typeof v[t]?e+(e.length>0?"&".concat(t,"=").concat(v[t]):"".concat(t,"=").concat(v[t])):e}),"");return _&&(d=_),n=t.call(this,"".concat(d).concat(f).concat(S?"?"+S:""),g),Object(l["a"])(Object(r["a"])(n),"heartCheckData",m),Object(l["a"])(Object(r["a"])(n),"heartCheckTimeout",h),Object(l["a"])(Object(r["a"])(n),"heartCheckInterval",null),Object(l["a"])(Object(r["a"])(n),"heartCheckCount",p),Object(l["a"])(Object(r["a"])(n),"firstConnect",!1),n.self=c,n._currentOptions=e,n._dep=a,n.heartCheckData=w||m,n._reconnectCount=s,A&&Object.assign(Object(r["a"])(n),{heartCheckData:A}),n.initSocket(),n}return Object(c["a"])(i,[{key:"initSocket",value:function(){this.onopen=function(e){this._dep.notify("open",e),this.firstConnect=!0,this.heartCheckStart()},this.onclose=function(e){var t=this;if(this._dep.notify("close",e),e.code!==g){this._reconnectCount++;var r=y(this._currentOptions);this.firstConnect&&(r.query.type="reconnect"),this.self.socketTimer&&clearTimeout(this.self.socketTimer),this.self.socketTimer=setTimeout((function(){var e=new i(r,t._dep,t._reconnectCount,t.self);t._dep.notify("reconnect",e)}),f)}},this.onerror=function(e){this._dep.notify("error",e)},this.onmessage=function(e){var t=this;if(e.data instanceof Blob){var i=new FileReader;i.readAsArrayBuffer(e.data),i.onload=function(e){var i;e.target.readyState===FileReader.DONE&&t._dep.notify("message",null===(i=e.target)||void 0===i?void 0:i.result)}}else try{this._dep.notify("message",e.data)}catch(r){console.log(r)}}}},{key:"subscribe",value:function(e,t){if("function"!==typeof t)throw new Error("The second param is must be a function");if(!d.includes(e))throw new Error("The first param is not supported");this._dep.depend(e,t)}},{key:"sendMessage",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.transformJSON,r=void 0===i||i,a=e;r&&(a=JSON.stringify(e)),this.send(a)}},{key:"closeSocket",value:function(e,t){this.clearHeartCheck(),this.close(e,t)}},{key:"heartCheckStart",value:function(){var e=this;this.heartCheckInterval=setInterval((function(){if(e.readyState===e.OPEN){var t="object"===Object(u["a"])(e.heartCheckData);e.sendMessage(e.heartCheckData,{transformJSON:t})}else e.clearHeartCheck()}),this.heartCheckTimeout)}},{key:"clearHeartCheck",value:function(){clearInterval(this.heartCheckInterval)}},{key:"resetHeartCheck",value:function(){clearInterval(this.heartCheckInterval),this.heartCheckStart()}}]),i}(Object(s["a"])(WebSocket)),A={url:"",protocols:"",customBase:null,query:{}},k=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:A,t=arguments.length>1?arguments[1]:void 0;if(!window.WebSocket)return console.error("您的浏览器不支持WebSocket, 请更换浏览器!");var i=new v,r=0;return new b(e,i,r,t)}},"428f":function(e,t,i){var r=i("da84");e.exports=r},"44ad":function(e,t,i){var r=i("da84"),a=i("e330"),n=i("d039"),s=i("c6b6"),o=r.Object,c=a("".split);e.exports=n((function(){return!o("z").propertyIsEnumerable(0)}))?function(e){return"String"==s(e)?c(e,""):o(e)}:o},"44d2":function(e,t,i){var r=i("b622"),a=i("7c73"),n=i("9bf2"),s=r("unscopables"),o=Array.prototype;void 0==o[s]&&n.f(o,s,{configurable:!0,value:a(null)}),e.exports=function(e){o[s][e]=!0}},"44de":function(e,t,i){var r=i("da84");e.exports=function(e,t){var i=r.console;i&&i.error&&(1==arguments.length?i.error(e):i.error(e,t))}},"44e7":function(e,t,i){var r=i("861d"),a=i("c6b6"),n=i("b622"),s=n("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[s])?!!t:"RegExp"==a(e))}},"45fc":function(e,t,i){"use strict";var r=i("23e7"),a=i("b727").some,n=i("a640"),s=n("some");r({target:"Array",proto:!0,forced:!s},{some:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}})},"466d":function(e,t,i){"use strict";var r=i("c65b"),a=i("d784"),n=i("825a"),s=i("50c4"),o=i("577e"),c=i("1d80"),l=i("dc4a"),u=i("8aa5"),d=i("14c3");a("match",(function(e,t,i){return[function(t){var i=c(this),a=void 0==t?void 0:l(t,e);return a?r(a,t,i):new RegExp(t)[e](o(i))},function(e){var r=n(this),a=o(e),c=i(t,r,a);if(c.done)return c.value;if(!r.global)return d(r,a);var l=r.unicode;r.lastIndex=0;var h,f=[],p=0;while(null!==(h=d(r,a))){var m=o(h[0]);f[p]=m,""===m&&(r.lastIndex=u(a,s(r.lastIndex),l)),p++}return 0===p?null:f}]}))},4795:function(e,t,i){var r=i("23e7"),a=i("da84"),n=i("2ba4"),s=i("1626"),o=i("342f"),c=i("f36a"),l=i("d6d6"),u=/MSIE .\./.test(o),d=a.Function,h=function(e){return function(t,i){var r=l(arguments.length,1)>2,a=s(t)?t:d(t),o=r?c(arguments,2):void 0;return e(r?function(){n(a,this,o)}:a,i)}};r({global:!0,bind:!0,forced:u},{setTimeout:h(a.setTimeout),setInterval:h(a.setInterval)})},4840:function(e,t,i){var r=i("825a"),a=i("5087"),n=i("b622"),s=n("species");e.exports=function(e,t){var i,n=r(e).constructor;return void 0===n||void 0==(i=r(n)[s])?t:a(i)}},"485a":function(e,t,i){var r=i("da84"),a=i("c65b"),n=i("1626"),s=i("861d"),o=r.TypeError;e.exports=function(e,t){var i,r;if("string"===t&&n(i=e.toString)&&!s(r=a(i,e)))return r;if(n(i=e.valueOf)&&!s(r=a(i,e)))return r;if("string"!==t&&n(i=e.toString)&&!s(r=a(i,e)))return r;throw o("Can't convert object to primitive value")}},4930:function(e,t,i){var r=i("2d00"),a=i("d039");e.exports=!!Object.getOwnPropertySymbols&&!a((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},"498a":function(e,t,i){"use strict";var r=i("23e7"),a=i("58a8").trim,n=i("c8d2");r({target:"String",proto:!0,forced:n("trim")},{trim:function(){return a(this)}})},"4a9b":function(e,t,i){var r=i("74e8");r("Float64",(function(e){return function(t,i,r){return e(this,t,i,r)}}))},"4ae1":function(e,t,i){var r=i("23e7"),a=i("d066"),n=i("2ba4"),s=i("0538"),o=i("5087"),c=i("825a"),l=i("861d"),u=i("7c73"),d=i("d039"),h=a("Reflect","construct"),f=Object.prototype,p=[].push,m=d((function(){function e(){}return!(h((function(){}),[],e)instanceof e)})),g=!d((function(){h((function(){}))})),y=m||g;r({target:"Reflect",stat:!0,forced:y,sham:y},{construct:function(e,t){o(e),c(t);var i=arguments.length<3?e:o(arguments[2]);if(g&&!m)return h(e,t,i);if(e==i){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return n(p,r,t),new(n(s,e,r))}var a=i.prototype,d=u(l(a)?a:f),y=n(e,d,t);return l(y)?y:d}})},"4d12":function(e,t,i){"use strict";var r=i("23e7"),a=i("e330"),n=i("577e"),s=a("".charAt),o=a("".charCodeAt),c=a(/./.exec),l=a(1..toString),u=a("".toUpperCase),d=/[\w*+\-./@]/,h=function(e,t){var i=l(e,16);while(i.length<t)i="0"+i;return i};r({global:!0},{escape:function(e){var t,i,r=n(e),a="",l=r.length,f=0;while(f<l)t=s(r,f++),c(d,t)?a+=t:(i=o(t,0),a+=i<256?"%"+h(i,2):"%u"+u(h(i,4)));return a}})},"4d63":function(e,t,i){var r=i("83ab"),a=i("da84"),n=i("e330"),s=i("94ca"),o=i("7156"),c=i("9112"),l=i("9bf2").f,u=i("241c").f,d=i("3a9b"),h=i("44e7"),f=i("577e"),p=i("ad6d"),m=i("9f7f"),g=i("6eeb"),y=i("d039"),v=i("1a2d"),b=i("69f3").enforce,A=i("2626"),k=i("b622"),_=i("fce3"),w=i("107c"),S=k("match"),T=a.RegExp,E=T.prototype,x=a.SyntaxError,C=n(p),R=n(E.exec),L=n("".charAt),D=n("".replace),I=n("".indexOf),P=n("".slice),O=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,B=/a/g,M=/a/g,F=new T(B)!==B,U=m.MISSED_STICKY,j=m.UNSUPPORTED_Y,N=r&&(!F||U||_||w||y((function(){return M[S]=!1,T(B)!=B||T(M)==M||"/a/i"!=T(B,"i")}))),z=function(e){for(var t,i=e.length,r=0,a="",n=!1;r<=i;r++)t=L(e,r),"\\"!==t?n||"."!==t?("["===t?n=!0:"]"===t&&(n=!1),a+=t):a+="[\\s\\S]":a+=t+L(e,++r);return a},G=function(e){for(var t,i=e.length,r=0,a="",n=[],s={},o=!1,c=!1,l=0,u="";r<=i;r++){if(t=L(e,r),"\\"===t)t+=L(e,++r);else if("]"===t)o=!1;else if(!o)switch(!0){case"["===t:o=!0;break;case"("===t:R(O,P(e,r+1))&&(r+=2,c=!0),a+=t,l++;continue;case">"===t&&c:if(""===u||v(s,u))throw new x("Invalid capture group name");s[u]=!0,n[n.length]=[u,l],c=!1,u="";continue}c?u+=t:a+=t}return[a,n]};if(s("RegExp",N)){for(var H=function(e,t){var i,r,a,n,s,l,u=d(E,this),p=h(e),m=void 0===t,g=[],y=e;if(!u&&p&&m&&e.constructor===H)return e;if((p||d(E,e))&&(e=e.source,m&&(t="flags"in y?y.flags:C(y))),e=void 0===e?"":f(e),t=void 0===t?"":f(t),y=e,_&&"dotAll"in B&&(r=!!t&&I(t,"s")>-1,r&&(t=D(t,/s/g,""))),i=t,U&&"sticky"in B&&(a=!!t&&I(t,"y")>-1,a&&j&&(t=D(t,/y/g,""))),w&&(n=G(e),e=n[0],g=n[1]),s=o(T(e,t),u?this:E,H),(r||a||g.length)&&(l=b(s),r&&(l.dotAll=!0,l.raw=H(z(e),i)),a&&(l.sticky=!0),g.length&&(l.groups=g)),e!==y)try{c(s,"source",""===y?"(?:)":y)}catch(v){}return s},V=function(e){e in H||l(H,e,{configurable:!0,get:function(){return T[e]},set:function(t){T[e]=t}})},W=u(T),q=0;W.length>q;)V(W[q++]);E.constructor=H,H.prototype=E,g(a,"RegExp",H)}A("RegExp")},"4d64":function(e,t,i){var r=i("fc6a"),a=i("23cb"),n=i("07fa"),s=function(e){return function(t,i,s){var o,c=r(t),l=n(c),u=a(s,l);if(e&&i!=i){while(l>u)if(o=c[u++],o!=o)return!0}else for(;l>u;u++)if((e||u in c)&&c[u]===i)return e||u||0;return!e&&-1}};e.exports={includes:s(!0),indexOf:s(!1)}},"4d90":function(e,t,i){"use strict";var r=i("23e7"),a=i("0ccb").start,n=i("9a0c");r({target:"String",proto:!0,forced:n},{padStart:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}})},"4dae":function(e,t,i){var r=i("da84"),a=i("23cb"),n=i("07fa"),s=i("8418"),o=r.Array,c=Math.max;e.exports=function(e,t,i){for(var r=n(e),l=a(t,r),u=a(void 0===i?r:i,r),d=o(c(u-l,0)),h=0;l<u;l++,h++)s(d,h,e[l]);return d.length=h,d}},"4de4":function(e,t,i){"use strict";var r=i("23e7"),a=i("b727").filter,n=i("1dde"),s=n("filter");r({target:"Array",proto:!0,forced:!s},{filter:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}})},"4df4":function(e,t,i){"use strict";var r=i("da84"),a=i("0366"),n=i("c65b"),s=i("7b0b"),o=i("9bdd"),c=i("e95a"),l=i("68ee"),u=i("07fa"),d=i("8418"),h=i("9a1f"),f=i("35a1"),p=r.Array;e.exports=function(e){var t=s(e),i=l(this),r=arguments.length,m=r>1?arguments[1]:void 0,g=void 0!==m;g&&(m=a(m,r>2?arguments[2]:void 0));var y,v,b,A,k,_,w=f(t),S=0;if(!w||this==p&&c(w))for(y=u(t),v=i?new this(y):p(y);y>S;S++)_=g?m(t[S],S):t[S],d(v,S,_);else for(A=h(t,w),k=A.next,v=i?new this:[];!(b=n(k,A)).done;S++)_=g?o(A,m,[b.value,S],!0):b.value,d(v,S,_);return v.length=S,v}},"4e82":function(e,t,i){"use strict";var r=i("23e7"),a=i("e330"),n=i("59ed"),s=i("7b0b"),o=i("07fa"),c=i("577e"),l=i("d039"),u=i("addb"),d=i("a640"),h=i("04d1"),f=i("d998"),p=i("2d00"),m=i("512c"),g=[],y=a(g.sort),v=a(g.push),b=l((function(){g.sort(void 0)})),A=l((function(){g.sort(null)})),k=d("sort"),_=!l((function(){if(p)return p<70;if(!(h&&h>3)){if(f)return!0;if(m)return m<603;var e,t,i,r,a="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:i=3;break;case 68:case 71:i=4;break;default:i=2}for(r=0;r<47;r++)g.push({k:t+r,v:i})}for(g.sort((function(e,t){return t.v-e.v})),r=0;r<g.length;r++)t=g[r].k.charAt(0),a.charAt(a.length-1)!==t&&(a+=t);return"DGBEFHACIJK"!==a}})),w=b||!A||!k||!_,S=function(e){return function(t,i){return void 0===i?-1:void 0===t?1:void 0!==e?+e(t,i)||0:c(t)>c(i)?1:-1}};r({target:"Array",proto:!0,forced:w},{sort:function(e){void 0!==e&&n(e);var t=s(this);if(_)return void 0===e?y(t):y(t,e);var i,r,a=[],c=o(t);for(r=0;r<c;r++)r in t&&v(a,t[r]);u(a,S(e)),i=a.length,r=0;while(r<i)t[r]=a[r++];while(r<c)delete t[r++];return t}})},"4ec9":function(e,t,i){"use strict";var r=i("6d61"),a=i("6566");r("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),a)},"4fad":function(e,t,i){var r=i("d039"),a=i("861d"),n=i("c6b6"),s=i("d86b"),o=Object.isExtensible,c=r((function(){o(1)}));e.exports=c||s?function(e){return!!a(e)&&((!s||"ArrayBuffer"!=n(e))&&(!o||o(e)))}:o},5087:function(e,t,i){var r=i("da84"),a=i("68ee"),n=i("0d51"),s=r.TypeError;e.exports=function(e){if(a(e))return e;throw s(n(e)+" is not a constructor")}},"50c4":function(e,t,i){var r=i("5926"),a=Math.min;e.exports=function(e){return e>0?a(r(e),9007199254740991):0}},"512c":function(e,t,i){var r=i("342f"),a=r.match(/AppleWebKit\/(\d+)\./);e.exports=!!a&&+a[1]},5180:function(e,t,i){var r={"./http.js":"8177","./websocket.js":"4269"};function a(e){var t=n(e);return i(t)}function n(e){if(!i.o(r,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return r[e]}a.keys=function(){return Object.keys(r)},a.resolve=n,e.exports=a,a.id="5180"},"51eb":function(e,t,i){"use strict";var r=i("da84"),a=i("825a"),n=i("485a"),s=r.TypeError;e.exports=function(e){if(a(this),"string"===e||"default"===e)e="string";else if("number"!==e)throw s("Incorrect hint");return n(this,e)}},5319:function(e,t,i){"use strict";var r=i("2ba4"),a=i("c65b"),n=i("e330"),s=i("d784"),o=i("d039"),c=i("825a"),l=i("1626"),u=i("5926"),d=i("50c4"),h=i("577e"),f=i("1d80"),p=i("8aa5"),m=i("dc4a"),g=i("0cb2"),y=i("14c3"),v=i("b622"),b=v("replace"),A=Math.max,k=Math.min,_=n([].concat),w=n([].push),S=n("".indexOf),T=n("".slice),E=function(e){return void 0===e?e:String(e)},x=function(){return"$0"==="a".replace(/./,"$0")}(),C=function(){return!!/./[b]&&""===/./[b]("a","$0")}(),R=!o((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}));s("replace",(function(e,t,i){var n=C?"$":"$0";return[function(e,i){var r=f(this),n=void 0==e?void 0:m(e,b);return n?a(n,e,r,i):a(t,h(r),e,i)},function(e,a){var s=c(this),o=h(e);if("string"==typeof a&&-1===S(a,n)&&-1===S(a,"$<")){var f=i(t,s,o,a);if(f.done)return f.value}var m=l(a);m||(a=h(a));var v=s.global;if(v){var b=s.unicode;s.lastIndex=0}var x=[];while(1){var C=y(s,o);if(null===C)break;if(w(x,C),!v)break;var R=h(C[0]);""===R&&(s.lastIndex=p(o,d(s.lastIndex),b))}for(var L="",D=0,I=0;I<x.length;I++){C=x[I];for(var P=h(C[0]),O=A(k(u(C.index),o.length),0),B=[],M=1;M<C.length;M++)w(B,E(C[M]));var F=C.groups;if(m){var U=_([P],B,O,o);void 0!==F&&w(U,F);var j=h(r(a,void 0,U))}else j=g(P,o,O,B,F,a);O>=D&&(L+=T(o,D,O)+j,D=O+P.length)}return L+T(o,D)}]}),!R||!x||C)},5377:function(e,t,i){var r=i("83ab"),a=i("9bf2"),n=i("ad6d"),s=i("d039"),o=RegExp.prototype,c=r&&s((function(){return"sy"!==Object.getOwnPropertyDescriptor(o,"flags").get.call({dotAll:!0,sticky:!0})}));c&&a.f(o,"flags",{configurable:!0,get:n})},"53ca":function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));i("a4d3"),i("e01a"),i("d3b7"),i("d28b"),i("e260"),i("3ca3"),i("ddb0");function r(e){return r="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},r(e)}},"542d":function(e,t,i){"use strict";var r=i("23e7"),a=i("e330"),n=i("d039"),s=i("408a"),o=a(1..toPrecision),c=n((function(){return"1"!==o(1,void 0)}))||!n((function(){o({})}));r({target:"Number",proto:!0,forced:c},{toPrecision:function(e){return void 0===e?o(s(this)):o(s(this),e)}})},5530:function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));i("b64b"),i("a4d3"),i("4de4"),i("d3b7"),i("e439"),i("4160"),i("159b"),i("dbb4"),i("1d1c"),i("7a82");var r=i("ade3");function a(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}function n(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?a(Object(i),!0).forEach((function(t){Object(r["a"])(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):a(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}},5692:function(e,t,i){var r=i("c430"),a=i("c6cd");(e.exports=function(e,t){return a[e]||(a[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.21.1",mode:r?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE",source:"https://github.com/zloirock/core-js"})},"56ef":function(e,t,i){var r=i("d066"),a=i("e330"),n=i("241c"),s=i("7418"),o=i("825a"),c=a([].concat);e.exports=r("Reflect","ownKeys")||function(e){var t=n.f(o(e)),i=s.f;return i?c(t,i(e)):t}},"577e":function(e,t,i){var r=i("da84"),a=i("f5df"),n=r.String;e.exports=function(e){if("Symbol"===a(e))throw TypeError("Cannot convert a Symbol value to a string");return n(e)}},"583b":function(e,t,i){var r=i("23e7"),a=i("eac5"),n=Math.abs;r({target:"Number",stat:!0},{isSafeInteger:function(e){return a(e)&&n(e)<=9007199254740991}})},5899:function(e,t){e.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},"58a8":function(e,t,i){var r=i("e330"),a=i("1d80"),n=i("577e"),s=i("5899"),o=r("".replace),c="["+s+"]",l=RegExp("^"+c+c+"*"),u=RegExp(c+c+"*$"),d=function(e){return function(t){var i=n(a(t));return 1&e&&(i=o(i,l,"")),2&e&&(i=o(i,u,"")),i}};e.exports={start:d(1),end:d(2),trim:d(3)}},5926:function(e,t){var i=Math.ceil,r=Math.floor;e.exports=function(e){var t=+e;return t!==t||0===t?0:(t>0?r:i)(t)}},"59ed":function(e,t,i){var r=i("da84"),a=i("1626"),n=i("0d51"),s=r.TypeError;e.exports=function(e){if(a(e))return e;throw s(n(e)+" is not a function")}},"5a34":function(e,t,i){var r=i("da84"),a=i("44e7"),n=r.TypeError;e.exports=function(e){if(a(e))throw n("The method doesn't accept regular expressions");return e}},"5c6c":function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},"5cc6":function(e,t,i){var r=i("74e8");r("Uint8",(function(e){return function(t,i,r){return e(this,t,i,r)}}))},"5d41":function(e,t,i){var r=i("23e7"),a=i("c65b"),n=i("861d"),s=i("825a"),o=i("c60d"),c=i("06cf"),l=i("e163");function u(e,t){var i,r,d=arguments.length<3?e:arguments[2];return s(e)===d?e[t]:(i=c.f(e,t),i?o(i)?i.value:void 0===i.get?void 0:a(i.get,d):n(r=l(e))?u(r,t,d):void 0)}r({target:"Reflect",stat:!0},{get:u})},"5e77":function(e,t,i){var r=i("83ab"),a=i("1a2d"),n=Function.prototype,s=r&&Object.getOwnPropertyDescriptor,o=a(n,"name"),c=o&&"something"===function(){}.name,l=o&&(!r||r&&s(n,"name").configurable);e.exports={EXISTS:o,PROPER:c,CONFIGURABLE:l}},"5f96":function(e,t,i){"use strict";var r=i("ebb5"),a=i("e330"),n=r.aTypedArray,s=r.exportTypedArrayMethod,o=a([].join);s("join",(function(e){return o(n(this),e)}))},"5fb2":function(e,t,i){"use strict";var r=i("da84"),a=i("e330"),n=2147483647,s=36,o=1,c=26,l=38,u=700,d=72,h=128,f="-",p=/[^\0-\u007E]/,m=/[.\u3002\uFF0E\uFF61]/g,g="Overflow: input needs wider integers to process",y=s-o,v=r.RangeError,b=a(m.exec),A=Math.floor,k=String.fromCharCode,_=a("".charCodeAt),w=a([].join),S=a([].push),T=a("".replace),E=a("".split),x=a("".toLowerCase),C=function(e){var t=[],i=0,r=e.length;while(i<r){var a=_(e,i++);if(a>=55296&&a<=56319&&i<r){var n=_(e,i++);56320==(64512&n)?S(t,((1023&a)<<10)+(1023&n)+65536):(S(t,a),i--)}else S(t,a)}return t},R=function(e){return e+22+75*(e<26)},L=function(e,t,i){var r=0;e=i?A(e/u):e>>1,e+=A(e/t);while(e>y*c>>1)e=A(e/y),r+=s;return A(r+(y+1)*e/(e+l))},D=function(e){var t=[];e=C(e);var i,r,a=e.length,l=h,u=0,p=d;for(i=0;i<e.length;i++)r=e[i],r<128&&S(t,k(r));var m=t.length,y=m;m&&S(t,f);while(y<a){var b=n;for(i=0;i<e.length;i++)r=e[i],r>=l&&r<b&&(b=r);var _=y+1;if(b-l>A((n-u)/_))throw v(g);for(u+=(b-l)*_,l=b,i=0;i<e.length;i++){if(r=e[i],r<l&&++u>n)throw v(g);if(r==l){var T=u,E=s;while(1){var x=E<=p?o:E>=p+c?c:E-p;if(T<x)break;var D=T-x,I=s-x;S(t,k(R(x+D%I))),T=A(D/I),E+=s}S(t,k(R(T))),p=L(u,_,y==m),u=0,y++}}u++,l++}return w(t,"")};e.exports=function(e){var t,i,r=[],a=E(T(x(e),m,"."),".");for(t=0;t<a.length;t++)i=a[t],S(r,b(p,i)?"xn--"+D(i):i);return w(r,".")}},"605d":function(e,t,i){var r=i("c6b6"),a=i("da84");e.exports="process"==r(a.process)},6062:function(e,t,i){"use strict";var r=i("6d61"),a=i("6566");r("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),a)},6069:function(e,t){e.exports="object"==typeof window},"60bd":function(e,t,i){"use strict";var r=i("da84"),a=i("d039"),n=i("e330"),s=i("ebb5"),o=i("e260"),c=i("b622"),l=c("iterator"),u=r.Uint8Array,d=n(o.values),h=n(o.keys),f=n(o.entries),p=s.aTypedArray,m=s.exportTypedArrayMethod,g=u&&u.prototype,y=!a((function(){g[l].call([1])})),v=!!g&&g.values&&g[l]===g.values&&"values"===g.values.name,b=function(){return d(p(this))};m("entries",(function(){return f(p(this))}),y),m("keys",(function(){return h(p(this))}),y),m("values",b,y||!v,{name:"values"}),m(l,b,y||!v,{name:"values"})},"60da":function(e,t,i){"use strict";var r=i("83ab"),a=i("e330"),n=i("c65b"),s=i("d039"),o=i("df75"),c=i("7418"),l=i("d1e7"),u=i("7b0b"),d=i("44ad"),h=Object.assign,f=Object.defineProperty,p=a([].concat);e.exports=!h||s((function(){if(r&&1!==h({b:1},h(f({},"a",{enumerable:!0,get:function(){f(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},i=Symbol(),a="abcdefghijklmnopqrst";return e[i]=7,a.split("").forEach((function(e){t[e]=e})),7!=h({},e)[i]||o(h({},t)).join("")!=a}))?function(e,t){var i=u(e),a=arguments.length,s=1,h=c.f,f=l.f;while(a>s){var m,g=d(arguments[s++]),y=h?p(o(g),h(g)):o(g),v=y.length,b=0;while(v>b)m=y[b++],r&&!n(f,g,m)||(i[m]=g[m])}return i}:h},"621a":function(e,t,i){"use strict";var r=i("da84"),a=i("e330"),n=i("83ab"),s=i("a981"),o=i("5e77"),c=i("9112"),l=i("e2cc"),u=i("d039"),d=i("19aa"),h=i("5926"),f=i("50c4"),p=i("0b25"),m=i("77a7"),g=i("e163"),y=i("d2bb"),v=i("241c").f,b=i("9bf2").f,A=i("81d5"),k=i("4dae"),_=i("d44e"),w=i("69f3"),S=o.PROPER,T=o.CONFIGURABLE,E=w.get,x=w.set,C="ArrayBuffer",R="DataView",L="prototype",D="Wrong length",I="Wrong index",P=r[C],O=P,B=O&&O[L],M=r[R],F=M&&M[L],U=Object.prototype,j=r.Array,N=r.RangeError,z=a(A),G=a([].reverse),H=m.pack,V=m.unpack,W=function(e){return[255&e]},q=function(e){return[255&e,e>>8&255]},K=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},J=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},Y=function(e){return H(e,23,4)},Q=function(e){return H(e,52,8)},X=function(e,t){b(e[L],t,{get:function(){return E(this)[t]}})},$=function(e,t,i,r){var a=p(i),n=E(e);if(a+t>n.byteLength)throw N(I);var s=E(n.buffer).bytes,o=a+n.byteOffset,c=k(s,o,o+t);return r?c:G(c)},Z=function(e,t,i,r,a,n){var s=p(i),o=E(e);if(s+t>o.byteLength)throw N(I);for(var c=E(o.buffer).bytes,l=s+o.byteOffset,u=r(+a),d=0;d<t;d++)c[l+d]=u[n?d:t-d-1]};if(s){var ee=S&&P.name!==C;if(u((function(){P(1)}))&&u((function(){new P(-1)}))&&!u((function(){return new P,new P(1.5),new P(NaN),ee&&!T})))ee&&T&&c(P,"name",C);else{O=function(e){return d(this,B),new P(p(e))},O[L]=B;for(var te,ie=v(P),re=0;ie.length>re;)(te=ie[re++])in O||c(O,te,P[te]);B.constructor=O}y&&g(F)!==U&&y(F,U);var ae=new M(new O(2)),ne=a(F.setInt8);ae.setInt8(0,2147483648),ae.setInt8(1,2147483649),!ae.getInt8(0)&&ae.getInt8(1)||l(F,{setInt8:function(e,t){ne(this,e,t<<24>>24)},setUint8:function(e,t){ne(this,e,t<<24>>24)}},{unsafe:!0})}else O=function(e){d(this,B);var t=p(e);x(this,{bytes:z(j(t),0),byteLength:t}),n||(this.byteLength=t)},B=O[L],M=function(e,t,i){d(this,F),d(e,B);var r=E(e).byteLength,a=h(t);if(a<0||a>r)throw N("Wrong offset");if(i=void 0===i?r-a:f(i),a+i>r)throw N(D);x(this,{buffer:e,byteLength:i,byteOffset:a}),n||(this.buffer=e,this.byteLength=i,this.byteOffset=a)},F=M[L],n&&(X(O,"byteLength"),X(M,"buffer"),X(M,"byteLength"),X(M,"byteOffset")),l(F,{getInt8:function(e){return $(this,1,e)[0]<<24>>24},getUint8:function(e){return $(this,1,e)[0]},getInt16:function(e){var t=$(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=$(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return J($(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return J($(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return V($(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return V($(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){Z(this,1,e,W,t)},setUint8:function(e,t){Z(this,1,e,W,t)},setInt16:function(e,t){Z(this,2,e,q,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){Z(this,2,e,q,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){Z(this,4,e,K,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){Z(this,4,e,K,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){Z(this,4,e,Y,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){Z(this,8,e,Q,t,arguments.length>2?arguments[2]:void 0)}});_(O,C),_(M,R),e.exports={ArrayBuffer:O,DataView:M}},"649e":function(e,t,i){"use strict";var r=i("ebb5"),a=i("b727").some,n=r.aTypedArray,s=r.exportTypedArrayMethod;s("some",(function(e){return a(n(this),e,arguments.length>1?arguments[1]:void 0)}))},"64e5":function(e,t,i){"use strict";var r=i("da84"),a=i("e330"),n=i("d039"),s=i("0ccb").start,o=r.RangeError,c=Math.abs,l=Date.prototype,u=l.toISOString,d=a(l.getTime),h=a(l.getUTCDate),f=a(l.getUTCFullYear),p=a(l.getUTCHours),m=a(l.getUTCMilliseconds),g=a(l.getUTCMinutes),y=a(l.getUTCMonth),v=a(l.getUTCSeconds);e.exports=n((function(){return"0385-07-25T07:06:39.999Z"!=u.call(new Date(-50000000000001))}))||!n((function(){u.call(new Date(NaN))}))?function(){if(!isFinite(d(this)))throw o("Invalid time value");var e=this,t=f(e),i=m(e),r=t<0?"-":t>9999?"+":"";return r+s(c(t),r?6:4,0)+"-"+s(y(e)+1,2,0)+"-"+s(h(e),2,0)+"T"+s(p(e),2,0)+":"+s(g(e),2,0)+":"+s(v(e),2,0)+"."+s(i,3,0)+"Z"}:u},6547:function(e,t,i){var r=i("e330"),a=i("5926"),n=i("577e"),s=i("1d80"),o=r("".charAt),c=r("".charCodeAt),l=r("".slice),u=function(e){return function(t,i){var r,u,d=n(s(t)),h=a(i),f=d.length;return h<0||h>=f?e?"":void 0:(r=c(d,h),r<55296||r>56319||h+1===f||(u=c(d,h+1))<56320||u>57343?e?o(d,h):r:e?l(d,h,h+2):u-56320+(r-55296<<10)+65536)}};e.exports={codeAt:u(!1),charAt:u(!0)}},6566:function(e,t,i){"use strict";var r=i("9bf2").f,a=i("7c73"),n=i("e2cc"),s=i("0366"),o=i("19aa"),c=i("2266"),l=i("7dd0"),u=i("2626"),d=i("83ab"),h=i("f183").fastKey,f=i("69f3"),p=f.set,m=f.getterFor;e.exports={getConstructor:function(e,t,i,l){var u=e((function(e,r){o(e,f),p(e,{type:t,index:a(null),first:void 0,last:void 0,size:0}),d||(e.size=0),void 0!=r&&c(r,e[l],{that:e,AS_ENTRIES:i})})),f=u.prototype,g=m(t),y=function(e,t,i){var r,a,n=g(e),s=v(e,t);return s?s.value=i:(n.last=s={index:a=h(t,!0),key:t,value:i,previous:r=n.last,next:void 0,removed:!1},n.first||(n.first=s),r&&(r.next=s),d?n.size++:e.size++,"F"!==a&&(n.index[a]=s)),e},v=function(e,t){var i,r=g(e),a=h(t);if("F"!==a)return r.index[a];for(i=r.first;i;i=i.next)if(i.key==t)return i};return n(f,{clear:function(){var e=this,t=g(e),i=t.index,r=t.first;while(r)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete i[r.index],r=r.next;t.first=t.last=void 0,d?t.size=0:e.size=0},delete:function(e){var t=this,i=g(t),r=v(t,e);if(r){var a=r.next,n=r.previous;delete i.index[r.index],r.removed=!0,n&&(n.next=a),a&&(a.previous=n),i.first==r&&(i.first=a),i.last==r&&(i.last=n),d?i.size--:t.size--}return!!r},forEach:function(e){var t,i=g(this),r=s(e,arguments.length>1?arguments[1]:void 0);while(t=t?t.next:i.first){r(t.value,t.key,this);while(t&&t.removed)t=t.previous}},has:function(e){return!!v(this,e)}}),n(f,i?{get:function(e){var t=v(this,e);return t&&t.value},set:function(e,t){return y(this,0===e?0:e,t)}}:{add:function(e){return y(this,e=0===e?0:e,e)}}),d&&r(f,"size",{get:function(){return g(this).size}}),u},setStrong:function(e,t,i){var r=t+" Iterator",a=m(t),n=m(r);l(e,t,(function(e,t){p(this,{type:r,target:e,state:a(e),kind:t,last:void 0})}),(function(){var e=n(this),t=e.kind,i=e.last;while(i&&i.removed)i=i.previous;return e.target&&(e.last=i=i?i.next:e.state.first)?"keys"==t?{value:i.key,done:!1}:"values"==t?{value:i.value,done:!1}:{value:[i.key,i.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),i?"entries":"values",!i,!0),u(t)}}},"65f0":function(e,t,i){var r=i("0b42");e.exports=function(e,t){return new(r(e))(0===t?0:t)}},"68ee":function(e,t,i){var r=i("e330"),a=i("d039"),n=i("1626"),s=i("f5df"),o=i("d066"),c=i("8925"),l=function(){},u=[],d=o("Reflect","construct"),h=/^\s*(?:class|function)\b/,f=r(h.exec),p=!h.exec(l),m=function(e){if(!n(e))return!1;try{return d(l,u,e),!0}catch(t){return!1}},g=function(e){if(!n(e))return!1;switch(s(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return p||!!f(h,c(e))}catch(t){return!0}};g.sham=!0,e.exports=!d||a((function(){var e;return m(m.call)||!m(Object)||!m((function(){e=!0}))||e}))?g:m},"69f3":function(e,t,i){var r,a,n,s=i("7f9a"),o=i("da84"),c=i("e330"),l=i("861d"),u=i("9112"),d=i("1a2d"),h=i("c6cd"),f=i("f772"),p=i("d012"),m="Object already initialized",g=o.TypeError,y=o.WeakMap,v=function(e){return n(e)?a(e):r(e,{})},b=function(e){return function(t){var i;if(!l(t)||(i=a(t)).type!==e)throw g("Incompatible receiver, "+e+" required");return i}};if(s||h.state){var A=h.state||(h.state=new y),k=c(A.get),_=c(A.has),w=c(A.set);r=function(e,t){if(_(A,e))throw new g(m);return t.facade=e,w(A,e,t),t},a=function(e){return k(A,e)||{}},n=function(e){return _(A,e)}}else{var S=f("state");p[S]=!0,r=function(e,t){if(d(e,S))throw new g(m);return t.facade=e,u(e,S,t),t},a=function(e){return d(e,S)?e[S]:{}},n=function(e){return d(e,S)}}e.exports={set:r,get:a,has:n,enforce:v,getterFor:b}},"6b75":function(e,t,i){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=new Array(t);i<t;i++)r[i]=e[i];return r}i.d(t,"a",(function(){return r}))},"6c57":function(e,t,i){var r=i("23e7"),a=i("da84");r({global:!0},{globalThis:a})},"6d61":function(e,t,i){"use strict";var r=i("23e7"),a=i("da84"),n=i("e330"),s=i("94ca"),o=i("6eeb"),c=i("f183"),l=i("2266"),u=i("19aa"),d=i("1626"),h=i("861d"),f=i("d039"),p=i("1c7e"),m=i("d44e"),g=i("7156");e.exports=function(e,t,i){var y=-1!==e.indexOf("Map"),v=-1!==e.indexOf("Weak"),b=y?"set":"add",A=a[e],k=A&&A.prototype,_=A,w={},S=function(e){var t=n(k[e]);o(k,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return!(v&&!h(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return v&&!h(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return!(v&&!h(e))&&t(this,0===e?0:e)}:function(e,i){return t(this,0===e?0:e,i),this})},T=s(e,!d(A)||!(v||k.forEach&&!f((function(){(new A).entries().next()}))));if(T)_=i.getConstructor(t,e,y,b),c.enable();else if(s(e,!0)){var E=new _,x=E[b](v?{}:-0,1)!=E,C=f((function(){E.has(1)})),R=p((function(e){new A(e)})),L=!v&&f((function(){var e=new A,t=5;while(t--)e[b](t,t);return!e.has(-0)}));R||(_=t((function(e,t){u(e,k);var i=g(new A,e,_);return void 0!=t&&l(t,i[b],{that:i,AS_ENTRIES:y}),i})),_.prototype=k,k.constructor=_),(C||L)&&(S("delete"),S("has"),y&&S("get")),(L||x)&&S(b),v&&k.clear&&delete k.clear}return w[e]=_,r({global:!0,forced:_!=A},w),m(_,e),v||i.setStrong(_,e,y),_}},"6eba":function(e,t,i){var r=i("23e7"),a=i("da84"),n=i("e330"),s=a.Date,o=n(s.prototype.getTime);r({target:"Date",stat:!0},{now:function(){return o(new s)}})},"6eeb":function(e,t,i){var r=i("da84"),a=i("1626"),n=i("1a2d"),s=i("9112"),o=i("ce4e"),c=i("8925"),l=i("69f3"),u=i("5e77").CONFIGURABLE,d=l.get,h=l.enforce,f=String(String).split("String");(e.exports=function(e,t,i,c){var l,d=!!c&&!!c.unsafe,p=!!c&&!!c.enumerable,m=!!c&&!!c.noTargetGet,g=c&&void 0!==c.name?c.name:t;a(i)&&("Symbol("===String(g).slice(0,7)&&(g="["+String(g).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!n(i,"name")||u&&i.name!==g)&&s(i,"name",g),l=h(i),l.source||(l.source=f.join("string"==typeof g?g:""))),e!==r?(d?!m&&e[t]&&(p=!0):delete e[t],p?e[t]=i:s(e,t,i)):p?e[t]=i:o(t,i)})(Function.prototype,"toString",(function(){return a(this)&&d(this).source||c(this)}))},7156:function(e,t,i){var r=i("1626"),a=i("861d"),n=i("d2bb");e.exports=function(e,t,i){var s,o;return n&&r(s=t.constructor)&&s!==i&&a(o=s.prototype)&&o!==i.prototype&&n(e,o),e}},"72f7":function(e,t,i){"use strict";var r=i("ebb5").exportTypedArrayMethod,a=i("d039"),n=i("da84"),s=i("e330"),o=n.Uint8Array,c=o&&o.prototype||{},l=[].toString,u=s([].join);a((function(){l.call({})}))&&(l=function(){return u(this)});var d=c.toString!=l;r("toString",l,d)},"735e":function(e,t,i){"use strict";var r=i("ebb5"),a=i("c65b"),n=i("81d5"),s=r.aTypedArray,o=r.exportTypedArrayMethod;o("fill",(function(e){var t=arguments.length;return a(n,s(this),e,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}))},7418:function(e,t){t.f=Object.getOwnPropertySymbols},"746f":function(e,t,i){var r=i("428f"),a=i("1a2d"),n=i("e538"),s=i("9bf2").f;e.exports=function(e){var t=r.Symbol||(r.Symbol={});a(t,e)||s(t,e,{value:n.f(e)})}},"74e8":function(e,t,i){"use strict";var r=i("23e7"),a=i("da84"),n=i("c65b"),s=i("83ab"),o=i("8aa7"),c=i("ebb5"),l=i("621a"),u=i("19aa"),d=i("5c6c"),h=i("9112"),f=i("eac5"),p=i("50c4"),m=i("0b25"),g=i("182d"),y=i("a04b"),v=i("1a2d"),b=i("f5df"),A=i("861d"),k=i("d9b5"),_=i("7c73"),w=i("3a9b"),S=i("d2bb"),T=i("241c").f,E=i("a078"),x=i("b727").forEach,C=i("2626"),R=i("9bf2"),L=i("06cf"),D=i("69f3"),I=i("7156"),P=D.get,O=D.set,B=R.f,M=L.f,F=Math.round,U=a.RangeError,j=l.ArrayBuffer,N=j.prototype,z=l.DataView,G=c.NATIVE_ARRAY_BUFFER_VIEWS,H=c.TYPED_ARRAY_CONSTRUCTOR,V=c.TYPED_ARRAY_TAG,W=c.TypedArray,q=c.TypedArrayPrototype,K=c.aTypedArrayConstructor,J=c.isTypedArray,Y="BYTES_PER_ELEMENT",Q="Wrong length",X=function(e,t){K(e);var i=0,r=t.length,a=new e(r);while(r>i)a[i]=t[i++];return a},$=function(e,t){B(e,t,{get:function(){return P(this)[t]}})},Z=function(e){var t;return w(N,e)||"ArrayBuffer"==(t=b(e))||"SharedArrayBuffer"==t},ee=function(e,t){return J(e)&&!k(t)&&t in e&&f(+t)&&t>=0},te=function(e,t){return t=y(t),ee(e,t)?d(2,e[t]):M(e,t)},ie=function(e,t,i){return t=y(t),!(ee(e,t)&&A(i)&&v(i,"value"))||v(i,"get")||v(i,"set")||i.configurable||v(i,"writable")&&!i.writable||v(i,"enumerable")&&!i.enumerable?B(e,t,i):(e[t]=i.value,e)};s?(G||(L.f=te,R.f=ie,$(q,"buffer"),$(q,"byteOffset"),$(q,"byteLength"),$(q,"length")),r({target:"Object",stat:!0,forced:!G},{getOwnPropertyDescriptor:te,defineProperty:ie}),e.exports=function(e,t,i){var s=e.match(/\d+$/)[0]/8,c=e+(i?"Clamped":"")+"Array",l="get"+e,d="set"+e,f=a[c],y=f,v=y&&y.prototype,b={},k=function(e,t){var i=P(e);return i.view[l](t*s+i.byteOffset,!0)},w=function(e,t,r){var a=P(e);i&&(r=(r=F(r))<0?0:r>255?255:255&r),a.view[d](t*s+a.byteOffset,r,!0)},R=function(e,t){B(e,t,{get:function(){return k(this,t)},set:function(e){return w(this,t,e)},enumerable:!0})};G?o&&(y=t((function(e,t,i,r){return u(e,v),I(function(){return A(t)?Z(t)?void 0!==r?new f(t,g(i,s),r):void 0!==i?new f(t,g(i,s)):new f(t):J(t)?X(y,t):n(E,y,t):new f(m(t))}(),e,y)})),S&&S(y,W),x(T(f),(function(e){e in y||h(y,e,f[e])})),y.prototype=v):(y=t((function(e,t,i,r){u(e,v);var a,o,c,l=0,d=0;if(A(t)){if(!Z(t))return J(t)?X(y,t):n(E,y,t);a=t,d=g(i,s);var h=t.byteLength;if(void 0===r){if(h%s)throw U(Q);if(o=h-d,o<0)throw U(Q)}else if(o=p(r)*s,o+d>h)throw U(Q);c=o/s}else c=m(t),o=c*s,a=new j(o);O(e,{buffer:a,byteOffset:d,byteLength:o,length:c,view:new z(a)});while(l<c)R(e,l++)})),S&&S(y,W),v=y.prototype=_(q)),v.constructor!==y&&h(v,"constructor",y),h(v,H,y),V&&h(v,V,c),b[c]=y,r({global:!0,forced:y!=f,sham:!G},b),Y in y||h(y,Y,s),Y in v||h(v,Y,s),C(c)}):e.exports=function(){}},"77a7":function(e,t,i){var r=i("da84"),a=r.Array,n=Math.abs,s=Math.pow,o=Math.floor,c=Math.log,l=Math.LN2,u=function(e,t,i){var r,u,d,h=a(i),f=8*i-t-1,p=(1<<f)-1,m=p>>1,g=23===t?s(2,-24)-s(2,-77):0,y=e<0||0===e&&1/e<0?1:0,v=0;e=n(e),e!=e||e===1/0?(u=e!=e?1:0,r=p):(r=o(c(e)/l),d=s(2,-r),e*d<1&&(r--,d*=2),e+=r+m>=1?g/d:g*s(2,1-m),e*d>=2&&(r++,d/=2),r+m>=p?(u=0,r=p):r+m>=1?(u=(e*d-1)*s(2,t),r+=m):(u=e*s(2,m-1)*s(2,t),r=0));while(t>=8)h[v++]=255&u,u/=256,t-=8;r=r<<t|u,f+=t;while(f>0)h[v++]=255&r,r/=256,f-=8;return h[--v]|=128*y,h},d=function(e,t){var i,r=e.length,a=8*r-t-1,n=(1<<a)-1,o=n>>1,c=a-7,l=r-1,u=e[l--],d=127&u;u>>=7;while(c>0)d=256*d+e[l--],c-=8;i=d&(1<<-c)-1,d>>=-c,c+=t;while(c>0)i=256*i+e[l--],c-=8;if(0===d)d=1-o;else{if(d===n)return i?NaN:u?-1/0:1/0;i+=s(2,t),d-=o}return(u?-1:1)*i*s(2,d-t)};e.exports={pack:u,unpack:d}},7839:function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"785a":function(e,t,i){var r=i("cc12"),a=r("span").classList,n=a&&a.constructor&&a.constructor.prototype;e.exports=n===Object.prototype?void 0:n},"7a82":function(e,t,i){var r=i("23e7"),a=i("83ab"),n=i("9bf2").f;r({target:"Object",stat:!0,forced:Object.defineProperty!==n,sham:!a},{defineProperty:n})},"7b0b":function(e,t,i){var r=i("da84"),a=i("1d80"),n=r.Object;e.exports=function(e){return n(a(e))}},"7c37":function(e,t,i){var r=i("605d");e.exports=function(e){try{if(r)return Function('return require("'+e+'")')()}catch(t){}}},"7c73":function(e,t,i){var r,a=i("825a"),n=i("37e8"),s=i("7839"),o=i("d012"),c=i("1be4"),l=i("cc12"),u=i("f772"),d=">",h="<",f="prototype",p="script",m=u("IE_PROTO"),g=function(){},y=function(e){return h+p+d+e+h+"/"+p+d},v=function(e){e.write(y("")),e.close();var t=e.parentWindow.Object;return e=null,t},b=function(){var e,t=l("iframe"),i="java"+p+":";return t.style.display="none",c.appendChild(t),t.src=String(i),e=t.contentWindow.document,e.open(),e.write(y("document.F=Object")),e.close(),e.F},A=function(){try{r=new ActiveXObject("htmlfile")}catch(t){}A="undefined"!=typeof document?document.domain&&r?v(r):b():v(r);var e=s.length;while(e--)delete A[f][s[e]];return A()};o[m]=!0,e.exports=Object.create||function(e,t){var i;return null!==e?(g[f]=a(e),i=new g,g[f]=null,i[m]=e):i=A(),void 0===t?i:n.f(i,t)}},"7db0":function(e,t,i){"use strict";var r=i("23e7"),a=i("b727").find,n=i("44d2"),s="find",o=!0;s in[]&&Array(1)[s]((function(){o=!1})),r({target:"Array",proto:!0,forced:o},{find:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}}),n(s)},"7dd0":function(e,t,i){"use strict";var r=i("23e7"),a=i("c65b"),n=i("c430"),s=i("5e77"),o=i("1626"),c=i("9ed3"),l=i("e163"),u=i("d2bb"),d=i("d44e"),h=i("9112"),f=i("6eeb"),p=i("b622"),m=i("3f8c"),g=i("ae93"),y=s.PROPER,v=s.CONFIGURABLE,b=g.IteratorPrototype,A=g.BUGGY_SAFARI_ITERATORS,k=p("iterator"),_="keys",w="values",S="entries",T=function(){return this};e.exports=function(e,t,i,s,p,g,E){c(i,t,s);var x,C,R,L=function(e){if(e===p&&B)return B;if(!A&&e in P)return P[e];switch(e){case _:return function(){return new i(this,e)};case w:return function(){return new i(this,e)};case S:return function(){return new i(this,e)}}return function(){return new i(this)}},D=t+" Iterator",I=!1,P=e.prototype,O=P[k]||P["@@iterator"]||p&&P[p],B=!A&&O||L(p),M="Array"==t&&P.entries||O;if(M&&(x=l(M.call(new e)),x!==Object.prototype&&x.next&&(n||l(x)===b||(u?u(x,b):o(x[k])||f(x,k,T)),d(x,D,!0,!0),n&&(m[D]=T))),y&&p==w&&O&&O.name!==w&&(!n&&v?h(P,"name",w):(I=!0,B=function(){return a(O,this)})),p)if(C={values:L(w),keys:g?B:L(_),entries:L(S)},E)for(R in C)(A||I||!(R in P))&&f(P,R,C[R]);else r({target:t,proto:!0,forced:A||I},C);return n&&!E||P[k]===B||f(P,k,B,{name:p}),m[t]=B,C}},"7e12":function(e,t,i){var r=i("da84"),a=i("d039"),n=i("e330"),s=i("577e"),o=i("58a8").trim,c=i("5899"),l=n("".charAt),u=r.parseFloat,d=r.Symbol,h=d&&d.iterator,f=1/u(c+"-0")!==-1/0||h&&!a((function(){u(Object(h))}));e.exports=f?function(e){var t=o(s(e)),i=u(t);return 0===i&&"-"==l(t,0)?-0:i}:u},"7e84":function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));i("131a"),i("3410");function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}},"7f9a":function(e,t,i){var r=i("da84"),a=i("1626"),n=i("8925"),s=r.WeakMap;e.exports=a(s)&&/native code/.test(n(s))},8172:function(e,t,i){var r=i("746f");r("toPrimitive")},8177:function(e,t,i){"use strict";i.r(t),i.d(t,"useHttp",(function(){return d}));var r=i("1da1"),a=i("2909"),n=i("5530"),s=i("d4ec"),o=i("bee2"),c=i("d5e4"),l=(i("96cf"),i("b64b"),i("c975"),i("99af"),i("d3b7"),i("e6cf"),i("d9e2"),i("d401"),i("e260"),i("3ca3"),i("10d1"),i("ddb0"),new WeakMap),u=function(){function e(t,i,r,o){var u=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],d=arguments.length>5?arguments[5]:void 0,h=arguments.length>6?arguments[6]:void 0;Object(s["a"])(this,e),Object(c["a"])(this,l,{writable:!0,value:null}),this.url=t,this.method=i,this.data=r,this.headers=headers,this.success=d,this.fail=h,this.abort=new AbortController;var f=[t,Object(n["a"])({method:i,body:r,signal:this.abort.signal},o)];if("GET"==i&&r&&Object.keys(r).length>0){var p="?";for(var m in t.indexOf("?")>-1&&(p="&"),r)p+="".concat(m,"=").concat(r[m],"&");t+=p,f=[t,Object(n["a"])({method:i,signal:this.abort.signal},o)]}u?fetch.apply(void 0,Object(a["a"])(f)).then((function(e){200==e.status?d&&d(e.json()):console.log("请求出错")}))["catch"]((function(e){h&&h()})):this.initAsync(f,d,h)}return Object(o["a"])(e,[{key:"initAsync",value:function(){var e=Object(r["a"])(regeneratorRuntime.mark((function e(t,i,r){var n,s;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,fetch.apply(void 0,Object(a["a"])(t));case 2:if(n=e.sent,!(n.status>=200&&n.status<300)){e.next=10;break}return e.next=6,n.text();case 6:s=e.sent,i&&i(s),e.next=12;break;case 10:throw r&&r(n),new Error(n.statusText);case 12:case"end":return e.stop()}}),e)})));function t(t,i,r){return e.apply(this,arguments)}return t}()},{key:"getAbort",value:function(){return this.abort}}]),e}(),d=function(e,t,i,r){var a=arguments.length>5?arguments[5]:void 0,n=arguments.length>6?arguments[6]:void 0;return window.fetch?new u(e,t,i,r,!0,a,n):console.error("您的浏览器不支持fetch, 请更换浏览器!")}},"81b2":function(e,t,i){var r=i("23e7"),a=i("d066"),n=i("e330"),s=i("d039"),o=i("577e"),c=i("1a2d"),l=i("d6d6"),u=i("b917").ctoi,d=/[^\d+/a-z]/i,h=/[\t\n\f\r ]+/g,f=/[=]+$/,p=a("atob"),m=String.fromCharCode,g=n("".charAt),y=n("".replace),v=n(d.exec),b=s((function(){return""!==atob(" ")})),A=!b&&!s((function(){p()}));r({global:!0,enumerable:!0,forced:b||A},{atob:function(e){if(l(arguments.length,1),A)return p(e);var t,i,r=y(o(e),h,""),n="",s=0,b=0;if(r.length%4==0&&(r=y(r,f,"")),r.length%4==1||v(d,r))throw new(a("DOMException"))("The string is not correctly encoded","InvalidCharacterError");while(t=g(r,s++))c(u,t)&&(i=b%4?64*i+u[t]:u[t],b++%4&&(n+=m(255&i>>(-2*b&6))));return n}})},"81d5":function(e,t,i){"use strict";var r=i("7b0b"),a=i("23cb"),n=i("07fa");e.exports=function(e){var t=r(this),i=n(t),s=arguments.length,o=a(s>1?arguments[1]:void 0,i),c=s>2?arguments[2]:void 0,l=void 0===c?i:a(c,i);while(l>o)t[o++]=e;return t}},"825a":function(e,t,i){var r=i("da84"),a=i("861d"),n=r.String,s=r.TypeError;e.exports=function(e){if(a(e))return e;throw s(n(e)+" is not an object")}},"82f8":function(e,t,i){"use strict";var r=i("ebb5"),a=i("4d64").includes,n=r.aTypedArray,s=r.exportTypedArrayMethod;s("includes",(function(e){return a(n(this),e,arguments.length>1?arguments[1]:void 0)}))},"83ab":function(e,t,i){var r=i("d039");e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},8418:function(e,t,i){"use strict";var r=i("a04b"),a=i("9bf2"),n=i("5c6c");e.exports=function(e,t,i){var s=r(t);s in e?a.f(e,s,n(0,i)):e[s]=i}},"841c":function(e,t,i){"use strict";var r=i("c65b"),a=i("d784"),n=i("825a"),s=i("1d80"),o=i("129f"),c=i("577e"),l=i("dc4a"),u=i("14c3");a("search",(function(e,t,i){return[function(t){var i=s(this),a=void 0==t?void 0:l(t,e);return a?r(a,t,i):new RegExp(t)[e](c(i))},function(e){var r=n(this),a=c(e),s=i(t,r,a);if(s.done)return s.value;var l=r.lastIndex;o(l,0)||(r.lastIndex=0);var d=u(r,a);return o(r.lastIndex,l)||(r.lastIndex=l),null===d?-1:d.index}]}))},"84c3":function(e,t,i){var r=i("74e8");r("Uint16",(function(e){return function(t,i,r){return e(this,t,i,r)}}))},"857a":function(e,t,i){var r=i("e330"),a=i("1d80"),n=i("577e"),s=/"/g,o=r("".replace);e.exports=function(e,t,i,r){var c=n(a(e)),l="<"+t;return""!==i&&(l+=" "+i+'="'+o(n(r),s,"&quot;")+'"'),l+">"+c+"</"+t+">"}},"861d":function(e,t,i){var r=i("1626");e.exports=function(e){return"object"==typeof e?null!==e:r(e)}},8875:function(e,t,i){var r,a,n;(function(i,s){a=[],r=s,n="function"===typeof r?r.apply(t,a):r,void 0===n||(e.exports=n)})("undefined"!==typeof self&&self,(function(){function e(){var t=Object.getOwnPropertyDescriptor(document,"currentScript");if(!t&&"currentScript"in document&&document.currentScript)return document.currentScript;if(t&&t.get!==e&&document.currentScript)return document.currentScript;try{throw new Error}catch(f){var i,r,a,n=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,s=/@([^@]*):(\d+):(\d+)\s*$/gi,o=n.exec(f.stack)||s.exec(f.stack),c=o&&o[1]||!1,l=o&&o[2]||!1,u=document.location.href.replace(document.location.hash,""),d=document.getElementsByTagName("script");c===u&&(i=document.documentElement.outerHTML,r=new RegExp("(?:[^\\n]+?\\n){0,"+(l-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),a=i.replace(r,"$1").trim());for(var h=0;h<d.length;h++){if("interactive"===d[h].readyState)return d[h];if(d[h].src===c)return d[h];if(c===u&&d[h].innerHTML&&d[h].innerHTML.trim()===a)return d[h]}return null}}return e}))},8925:function(e,t,i){var r=i("e330"),a=i("1626"),n=i("c6cd"),s=r(Function.toString);a(n.inspectSource)||(n.inspectSource=function(e){return s(e)}),e.exports=n.inspectSource},"8aa5":function(e,t,i){"use strict";var r=i("6547").charAt;e.exports=function(e,t,i){return t+(i?r(e,t).length:1)}},"8aa7":function(e,t,i){var r=i("da84"),a=i("d039"),n=i("1c7e"),s=i("ebb5").NATIVE_ARRAY_BUFFER_VIEWS,o=r.ArrayBuffer,c=r.Int8Array;e.exports=!s||!a((function(){c(1)}))||!a((function(){new c(-1)}))||!n((function(e){new c,new c(null),new c(1.5),new c(e)}),!0)||a((function(){return 1!==new c(new o(2),1,void 0).length}))},"8b09":function(e,t,i){var r=i("74e8");r("Int16",(function(e){return function(t,i,r){return e(this,t,i,r)}}))},"8bd4":function(e,t,i){var r=i("d066"),a=i("d44e"),n="DOMException";a(r(n),n)},9072:function(e,t,i){"use strict";i.d(t,"a",(function(){return c}));i("e260"),i("4ec9"),i("d3b7"),i("3ca3"),i("ddb0"),i("d9e2"),i("d401"),i("b8bf");var r=i("7e84"),a=i("b380");i("c975"),i("0d03"),i("25f0");function n(e){return-1!==Function.toString.call(e).indexOf("[native code]")}i("4ae1"),i("f8c9"),i("c0b6");var s=i("d967");function o(e,t,i){return o=Object(s["a"])()?Reflect.construct:function(e,t,i){var r=[null];r.push.apply(r,t);var n=Function.bind.apply(e,r),s=new n;return i&&Object(a["a"])(s,i.prototype),s},o.apply(null,arguments)}function c(e){var t="function"===typeof Map?new Map:void 0;return c=function(e){if(null===e||!n(e))return e;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return o(e,arguments,Object(r["a"])(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Object(a["a"])(i,e)},c(e)}},"907a":function(e,t,i){"use strict";var r=i("ebb5"),a=i("07fa"),n=i("5926"),s=r.aTypedArray,o=r.exportTypedArrayMethod;o("at",(function(e){var t=s(this),i=a(t),r=n(e),o=r>=0?r:i+r;return o<0||o>=i?void 0:t[o]}))},"90e3":function(e,t,i){var r=i("e330"),a=0,n=Math.random(),s=r(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+s(++a+n,36)}},9112:function(e,t,i){var r=i("83ab"),a=i("9bf2"),n=i("5c6c");e.exports=r?function(e,t,i){return a.f(e,t,n(1,i))}:function(e,t,i){return e[t]=i,e}},9129:function(e,t,i){var r=i("23e7");r({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})},9257:function(e,t,i){"use strict";var r=i("23e7"),a=i("e330"),n=i("577e"),s=String.fromCharCode,o=a("".charAt),c=a(/./.exec),l=a("".slice),u=/^[\da-f]{2}$/i,d=/^[\da-f]{4}$/i;r({global:!0},{unescape:function(e){var t,i,r=n(e),a="",h=r.length,f=0;while(f<h){if(t=o(r,f++),"%"===t)if("u"===o(r,f)){if(i=l(r,f+1,f+5),c(d,i)){a+=s(parseInt(i,16)),f+=5;continue}}else if(i=l(r,f,f+2),c(u,i)){a+=s(parseInt(i,16)),f+=2;continue}a+=t}return a}})},9263:function(e,t,i){"use strict";var r=i("c65b"),a=i("e330"),n=i("577e"),s=i("ad6d"),o=i("9f7f"),c=i("5692"),l=i("7c73"),u=i("69f3").get,d=i("fce3"),h=i("107c"),f=c("native-string-replace",String.prototype.replace),p=RegExp.prototype.exec,m=p,g=a("".charAt),y=a("".indexOf),v=a("".replace),b=a("".slice),A=function(){var e=/a/,t=/b*/g;return r(p,e,"a"),r(p,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),k=o.BROKEN_CARET,_=void 0!==/()??/.exec("")[1],w=A||_||k||d||h;w&&(m=function(e){var t,i,a,o,c,d,h,w=this,S=u(w),T=n(e),E=S.raw;if(E)return E.lastIndex=w.lastIndex,t=r(m,E,T),w.lastIndex=E.lastIndex,t;var x=S.groups,C=k&&w.sticky,R=r(s,w),L=w.source,D=0,I=T;if(C&&(R=v(R,"y",""),-1===y(R,"g")&&(R+="g"),I=b(T,w.lastIndex),w.lastIndex>0&&(!w.multiline||w.multiline&&"\n"!==g(T,w.lastIndex-1))&&(L="(?: "+L+")",I=" "+I,D++),i=new RegExp("^(?:"+L+")",R)),_&&(i=new RegExp("^"+L+"$(?!\\s)",R)),A&&(a=w.lastIndex),o=r(p,C?i:w,I),C?o?(o.input=b(o.input,D),o[0]=b(o[0],D),o.index=w.lastIndex,w.lastIndex+=o[0].length):w.lastIndex=0:A&&o&&(w.lastIndex=w.global?o.index+o[0].length:a),_&&o&&o.length>1&&r(f,o[0],i,(function(){for(c=1;c<arguments.length-2;c++)void 0===arguments[c]&&(o[c]=void 0)})),o&&x)for(o.groups=d=l(null),c=0;c<x.length;c++)h=x[c],d[h[0]]=o[h[1]];return o}),e.exports=m},"944a":function(e,t,i){var r=i("746f");r("toStringTag")},"94ca":function(e,t,i){var r=i("d039"),a=i("1626"),n=/#|\.prototype\./,s=function(e,t){var i=c[o(e)];return i==u||i!=l&&(a(t)?r(t):!!t)},o=s.normalize=function(e){return String(e).replace(n,".").toLowerCase()},c=s.data={},l=s.NATIVE="N",u=s.POLYFILL="P";e.exports=s},"96cf":function(e,t,i){var r=function(e){"use strict";var t,i=Object.prototype,r=i.hasOwnProperty,a="function"===typeof Symbol?Symbol:{},n=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",o=a.toStringTag||"@@toStringTag";function c(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(I){c=function(e,t,i){return e[t]=i}}function l(e,t,i,r){var a=t&&t.prototype instanceof g?t:g,n=Object.create(a.prototype),s=new R(r||[]);return n._invoke=T(e,i,s),n}function u(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(I){return{type:"throw",arg:I}}}e.wrap=l;var d="suspendedStart",h="suspendedYield",f="executing",p="completed",m={};function g(){}function y(){}function v(){}var b={};c(b,n,(function(){return this}));var A=Object.getPrototypeOf,k=A&&A(A(L([])));k&&k!==i&&r.call(k,n)&&(b=k);var _=v.prototype=g.prototype=Object.create(b);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function i(a,n,s,o){var c=u(e[a],e,n);if("throw"!==c.type){var l=c.arg,d=l.value;return d&&"object"===typeof d&&r.call(d,"__await")?t.resolve(d.__await).then((function(e){i("next",e,s,o)}),(function(e){i("throw",e,s,o)})):t.resolve(d).then((function(e){l.value=e,s(l)}),(function(e){return i("throw",e,s,o)}))}o(c.arg)}var a;function n(e,r){function n(){return new t((function(t,a){i(e,r,t,a)}))}return a=a?a.then(n,n):n()}this._invoke=n}function T(e,t,i){var r=d;return function(a,n){if(r===f)throw new Error("Generator is already running");if(r===p){if("throw"===a)throw n;return D()}i.method=a,i.arg=n;while(1){var s=i.delegate;if(s){var o=E(s,i);if(o){if(o===m)continue;return o}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(r===d)throw r=p,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);r=f;var c=u(e,t,i);if("normal"===c.type){if(r=i.done?p:h,c.arg===m)continue;return{value:c.arg,done:i.done}}"throw"===c.type&&(r=p,i.method="throw",i.arg=c.arg)}}}function E(e,i){var r=e.iterator[i.method];if(r===t){if(i.delegate=null,"throw"===i.method){if(e.iterator["return"]&&(i.method="return",i.arg=t,E(e,i),"throw"===i.method))return m;i.method="throw",i.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var a=u(r,e.iterator,i.arg);if("throw"===a.type)return i.method="throw",i.arg=a.arg,i.delegate=null,m;var n=a.arg;return n?n.done?(i[e.resultName]=n.value,i.next=e.nextLoc,"return"!==i.method&&(i.method="next",i.arg=t),i.delegate=null,m):n:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,m)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function L(e){if(e){var i=e[n];if(i)return i.call(e);if("function"===typeof e.next)return e;if(!isNaN(e.length)){var a=-1,s=function i(){while(++a<e.length)if(r.call(e,a))return i.value=e[a],i.done=!1,i;return i.value=t,i.done=!0,i};return s.next=s}}return{next:D}}function D(){return{value:t,done:!0}}return y.prototype=v,c(_,"constructor",v),c(v,"constructor",y),y.displayName=c(v,o,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"===typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,c(e,o,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},w(S.prototype),c(S.prototype,s,(function(){return this})),e.AsyncIterator=S,e.async=function(t,i,r,a,n){void 0===n&&(n=Promise);var s=new S(l(t,i,r,a),n);return e.isGeneratorFunction(i)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},w(_),c(_,o,"Generator"),c(_,n,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var i in e)t.push(i);return t.reverse(),function i(){while(t.length){var r=t.pop();if(r in e)return i.value=r,i.done=!1,i}return i.done=!0,i}},e.values=L,R.prototype={constructor:R,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var i in this)"t"===i.charAt(0)&&r.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var i=this;function a(r,a){return o.type="throw",o.arg=e,i.next=r,a&&(i.method="next",i.arg=t),!!a}for(var n=this.tryEntries.length-1;n>=0;--n){var s=this.tryEntries[n],o=s.completion;if("root"===s.tryLoc)return a("end");if(s.tryLoc<=this.prev){var c=r.call(s,"catchLoc"),l=r.call(s,"finallyLoc");if(c&&l){if(this.prev<s.catchLoc)return a(s.catchLoc,!0);if(this.prev<s.finallyLoc)return a(s.finallyLoc)}else if(c){if(this.prev<s.catchLoc)return a(s.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return a(s.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var n=a;break}}n&&("break"===e||"continue"===e)&&n.tryLoc<=t&&t<=n.finallyLoc&&(n=null);var s=n?n.completion:{};return s.type=e,s.arg=t,n?(this.method="next",this.next=n.finallyLoc,m):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),C(i),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var r=i.completion;if("throw"===r.type){var a=r.arg;C(i)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,i,r){return this.delegate={iterator:L(e),resultName:i,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=r}catch(a){"object"===typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},9861:function(e,t,i){"use strict";i("e260");var r=i("23e7"),a=i("da84"),n=i("d066"),s=i("c65b"),o=i("e330"),c=i("0d3b"),l=i("6eeb"),u=i("e2cc"),d=i("d44e"),h=i("9ed3"),f=i("69f3"),p=i("19aa"),m=i("1626"),g=i("1a2d"),y=i("0366"),v=i("f5df"),b=i("825a"),A=i("861d"),k=i("577e"),_=i("7c73"),w=i("5c6c"),S=i("9a1f"),T=i("35a1"),E=i("d6d6"),x=i("b622"),C=i("addb"),R=x("iterator"),L="URLSearchParams",D=L+"Iterator",I=f.set,P=f.getterFor(L),O=f.getterFor(D),B=n("fetch"),M=n("Request"),F=n("Headers"),U=M&&M.prototype,j=F&&F.prototype,N=a.RegExp,z=a.TypeError,G=a.decodeURIComponent,H=a.encodeURIComponent,V=o("".charAt),W=o([].join),q=o([].push),K=o("".replace),J=o([].shift),Y=o([].splice),Q=o("".split),X=o("".slice),$=/\+/g,Z=Array(4),ee=function(e){return Z[e-1]||(Z[e-1]=N("((?:%[\\da-f]{2}){"+e+"})","gi"))},te=function(e){try{return G(e)}catch(t){return e}},ie=function(e){var t=K(e,$," "),i=4;try{return G(t)}catch(r){while(i)t=K(t,ee(i--),te);return t}},re=/[!'()~]|%20/g,ae={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},ne=function(e){return ae[e]},se=function(e){return K(H(e),re,ne)},oe=h((function(e,t){I(this,{type:D,iterator:S(P(e).entries),kind:t})}),"Iterator",(function(){var e=O(this),t=e.kind,i=e.iterator.next(),r=i.value;return i.done||(i.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),i}),!0),ce=function(e){this.entries=[],this.url=null,void 0!==e&&(A(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===V(e,0)?X(e,1):e:k(e)))};ce.prototype={type:L,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,i,r,a,n,o,c,l=T(e);if(l){t=S(e,l),i=t.next;while(!(r=s(i,t)).done){if(a=S(b(r.value)),n=a.next,(o=s(n,a)).done||(c=s(n,a)).done||!s(n,a).done)throw z("Expected sequence with length 2");q(this.entries,{key:k(o.value),value:k(c.value)})}}else for(var u in e)g(e,u)&&q(this.entries,{key:u,value:k(e[u])})},parseQuery:function(e){if(e){var t,i,r=Q(e,"&"),a=0;while(a<r.length)t=r[a++],t.length&&(i=Q(t,"="),q(this.entries,{key:ie(J(i)),value:ie(W(i,"="))}))}},serialize:function(){var e,t=this.entries,i=[],r=0;while(r<t.length)e=t[r++],q(i,se(e.key)+"="+se(e.value));return W(i,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var le=function(){p(this,ue);var e=arguments.length>0?arguments[0]:void 0;I(this,new ce(e))},ue=le.prototype;if(u(ue,{append:function(e,t){E(arguments.length,2);var i=P(this);q(i.entries,{key:k(e),value:k(t)}),i.updateURL()},delete:function(e){E(arguments.length,1);var t=P(this),i=t.entries,r=k(e),a=0;while(a<i.length)i[a].key===r?Y(i,a,1):a++;t.updateURL()},get:function(e){E(arguments.length,1);for(var t=P(this).entries,i=k(e),r=0;r<t.length;r++)if(t[r].key===i)return t[r].value;return null},getAll:function(e){E(arguments.length,1);for(var t=P(this).entries,i=k(e),r=[],a=0;a<t.length;a++)t[a].key===i&&q(r,t[a].value);return r},has:function(e){E(arguments.length,1);var t=P(this).entries,i=k(e),r=0;while(r<t.length)if(t[r++].key===i)return!0;return!1},set:function(e,t){E(arguments.length,1);for(var i,r=P(this),a=r.entries,n=!1,s=k(e),o=k(t),c=0;c<a.length;c++)i=a[c],i.key===s&&(n?Y(a,c--,1):(n=!0,i.value=o));n||q(a,{key:s,value:o}),r.updateURL()},sort:function(){var e=P(this);C(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){var t,i=P(this).entries,r=y(e,arguments.length>1?arguments[1]:void 0),a=0;while(a<i.length)t=i[a++],r(t.value,t.key,this)},keys:function(){return new oe(this,"keys")},values:function(){return new oe(this,"values")},entries:function(){return new oe(this,"entries")}},{enumerable:!0}),l(ue,R,ue.entries,{name:"entries"}),l(ue,"toString",(function(){return P(this).serialize()}),{enumerable:!0}),d(le,L),r({global:!0,forced:!c},{URLSearchParams:le}),!c&&m(F)){var de=o(j.has),he=o(j.set),fe=function(e){if(A(e)){var t,i=e.body;if(v(i)===L)return t=e.headers?new F(e.headers):new F,de(t,"content-type")||he(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),_(e,{body:w(0,k(i)),headers:w(0,t)})}return e};if(m(B)&&r({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return B(e,arguments.length>1?fe(arguments[1]):{})}}),m(M)){var pe=function(e){return p(this,U),new M(e,arguments.length>1?fe(arguments[1]):{})};U.constructor=pe,pe.prototype=U,r({global:!0,forced:!0},{Request:pe})}}e.exports={URLSearchParams:le,getState:P}},"99af":function(e,t,i){"use strict";var r=i("23e7"),a=i("da84"),n=i("d039"),s=i("e8b5"),o=i("861d"),c=i("7b0b"),l=i("07fa"),u=i("8418"),d=i("65f0"),h=i("1dde"),f=i("b622"),p=i("2d00"),m=f("isConcatSpreadable"),g=9007199254740991,y="Maximum allowed index exceeded",v=a.TypeError,b=p>=51||!n((function(){var e=[];return e[m]=!1,e.concat()[0]!==e})),A=h("concat"),k=function(e){if(!o(e))return!1;var t=e[m];return void 0!==t?!!t:s(e)},_=!b||!A;r({target:"Array",proto:!0,forced:_},{concat:function(e){var t,i,r,a,n,s=c(this),o=d(s,0),h=0;for(t=-1,r=arguments.length;t<r;t++)if(n=-1===t?s:arguments[t],k(n)){if(a=l(n),h+a>g)throw v(y);for(i=0;i<a;i++,h++)i in n&&u(o,h,n[i])}else{if(h>=g)throw v(y);u(o,h++,n)}return o.length=h,o}})},"99de":function(e,t,i){"use strict";i.d(t,"a",(function(){return n}));i("d9e2"),i("d401");var r=i("53ca"),a=i("257e");function n(e,t){if(t&&("object"===Object(r["a"])(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Object(a["a"])(e)}},"9a0c":function(e,t,i){var r=i("342f");e.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(r)},"9a1f":function(e,t,i){var r=i("da84"),a=i("c65b"),n=i("59ed"),s=i("825a"),o=i("0d51"),c=i("35a1"),l=r.TypeError;e.exports=function(e,t){var i=arguments.length<2?c(e):t;if(n(i))return s(a(i,e));throw l(o(e)+" is not iterable")}},"9a8c":function(e,t,i){"use strict";var r=i("e330"),a=i("ebb5"),n=i("145e"),s=r(n),o=a.aTypedArray,c=a.exportTypedArrayMethod;c("copyWithin",(function(e,t){return s(o(this),e,t,arguments.length>2?arguments[2]:void 0)}))},"9bdd":function(e,t,i){var r=i("825a"),a=i("2a62");e.exports=function(e,t,i,n){try{return n?t(r(i)[0],i[1]):t(i)}catch(s){a(e,"throw",s)}}},"9bf2":function(e,t,i){var r=i("da84"),a=i("83ab"),n=i("0cfb"),s=i("aed9"),o=i("825a"),c=i("a04b"),l=r.TypeError,u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,h="enumerable",f="configurable",p="writable";t.f=a?s?function(e,t,i){if(o(e),t=c(t),o(i),"function"===typeof e&&"prototype"===t&&"value"in i&&p in i&&!i[p]){var r=d(e,t);r&&r[p]&&(e[t]=i.value,i={configurable:f in i?i[f]:r[f],enumerable:h in i?i[h]:r[h],writable:!1})}return u(e,t,i)}:u:function(e,t,i){if(o(e),t=c(t),o(i),n)try{return u(e,t,i)}catch(r){}if("get"in i||"set"in i)throw l("Accessors not supported");return"value"in i&&(e[t]=i.value),e}},"9ed3":function(e,t,i){"use strict";var r=i("ae93").IteratorPrototype,a=i("7c73"),n=i("5c6c"),s=i("d44e"),o=i("3f8c"),c=function(){return this};e.exports=function(e,t,i,l){var u=t+" Iterator";return e.prototype=a(r,{next:n(+!l,i)}),s(e,u,!1,!0),o[u]=c,e}},"9f7f":function(e,t,i){var r=i("d039"),a=i("da84"),n=a.RegExp,s=r((function(){var e=n("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),o=s||r((function(){return!n("a","y").sticky})),c=s||r((function(){var e=n("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));e.exports={BROKEN_CARET:c,MISSED_STICKY:o,UNSUPPORTED_Y:s}},a04b:function(e,t,i){var r=i("c04e"),a=i("d9b5");e.exports=function(e){var t=r(e,"string");return a(t)?t:t+""}},a078:function(e,t,i){var r=i("0366"),a=i("c65b"),n=i("5087"),s=i("7b0b"),o=i("07fa"),c=i("9a1f"),l=i("35a1"),u=i("e95a"),d=i("ebb5").aTypedArrayConstructor;e.exports=function(e){var t,i,h,f,p,m,g=n(this),y=s(e),v=arguments.length,b=v>1?arguments[1]:void 0,A=void 0!==b,k=l(y);if(k&&!u(k)){p=c(y,k),m=p.next,y=[];while(!(f=a(m,p)).done)y.push(f.value)}for(A&&v>2&&(b=r(b,arguments[2])),i=o(y),h=new(d(g))(i),t=0;i>t;t++)h[t]=A?b(y[t],t):y[t];return h}},a15b:function(e,t,i){"use strict";var r=i("23e7"),a=i("e330"),n=i("44ad"),s=i("fc6a"),o=i("a640"),c=a([].join),l=n!=Object,u=o("join",",");r({target:"Array",proto:!0,forced:l||!u},{join:function(e){return c(s(this),void 0===e?",":e)}})},a434:function(e,t,i){"use strict";var r=i("23e7"),a=i("da84"),n=i("23cb"),s=i("5926"),o=i("07fa"),c=i("7b0b"),l=i("65f0"),u=i("8418"),d=i("1dde"),h=d("splice"),f=a.TypeError,p=Math.max,m=Math.min,g=9007199254740991,y="Maximum allowed length exceeded";r({target:"Array",proto:!0,forced:!h},{splice:function(e,t){var i,r,a,d,h,v,b=c(this),A=o(b),k=n(e,A),_=arguments.length;if(0===_?i=r=0:1===_?(i=0,r=A-k):(i=_-2,r=m(p(s(t),0),A-k)),A+i-r>g)throw f(y);for(a=l(b,r),d=0;d<r;d++)h=k+d,h in b&&u(a,d,b[h]);if(a.length=r,i<r){for(d=k;d<A-r;d++)h=d+r,v=d+i,h in b?b[v]=b[h]:delete b[v];for(d=A;d>A-r+i;d--)delete b[d-1]}else if(i>r)for(d=A-r;d>k;d--)h=d+r-1,v=d+i-1,h in b?b[v]=b[h]:delete b[v];for(d=0;d<i;d++)b[d+k]=arguments[d+2];return b.length=A-r+i,a}})},a4b4:function(e,t,i){var r=i("342f");e.exports=/web0s(?!.*chrome)/i.test(r)},a4d3:function(e,t,i){"use strict";var r=i("23e7"),a=i("da84"),n=i("d066"),s=i("2ba4"),o=i("c65b"),c=i("e330"),l=i("c430"),u=i("83ab"),d=i("4930"),h=i("d039"),f=i("1a2d"),p=i("e8b5"),m=i("1626"),g=i("861d"),y=i("3a9b"),v=i("d9b5"),b=i("825a"),A=i("7b0b"),k=i("fc6a"),_=i("a04b"),w=i("577e"),S=i("5c6c"),T=i("7c73"),E=i("df75"),x=i("241c"),C=i("057f"),R=i("7418"),L=i("06cf"),D=i("9bf2"),I=i("37e8"),P=i("d1e7"),O=i("f36a"),B=i("6eeb"),M=i("5692"),F=i("f772"),U=i("d012"),j=i("90e3"),N=i("b622"),z=i("e538"),G=i("746f"),H=i("d44e"),V=i("69f3"),W=i("b727").forEach,q=F("hidden"),K="Symbol",J="prototype",Y=N("toPrimitive"),Q=V.set,X=V.getterFor(K),$=Object[J],Z=a.Symbol,ee=Z&&Z[J],te=a.TypeError,ie=a.QObject,re=n("JSON","stringify"),ae=L.f,ne=D.f,se=C.f,oe=P.f,ce=c([].push),le=M("symbols"),ue=M("op-symbols"),de=M("string-to-symbol-registry"),he=M("symbol-to-string-registry"),fe=M("wks"),pe=!ie||!ie[J]||!ie[J].findChild,me=u&&h((function(){return 7!=T(ne({},"a",{get:function(){return ne(this,"a",{value:7}).a}})).a}))?function(e,t,i){var r=ae($,t);r&&delete $[t],ne(e,t,i),r&&e!==$&&ne($,t,r)}:ne,ge=function(e,t){var i=le[e]=T(ee);return Q(i,{type:K,tag:e,description:t}),u||(i.description=t),i},ye=function(e,t,i){e===$&&ye(ue,t,i),b(e);var r=_(t);return b(i),f(le,r)?(i.enumerable?(f(e,q)&&e[q][r]&&(e[q][r]=!1),i=T(i,{enumerable:S(0,!1)})):(f(e,q)||ne(e,q,S(1,{})),e[q][r]=!0),me(e,r,i)):ne(e,r,i)},ve=function(e,t){b(e);var i=k(t),r=E(i).concat(we(i));return W(r,(function(t){u&&!o(Ae,i,t)||ye(e,t,i[t])})),e},be=function(e,t){return void 0===t?T(e):ve(T(e),t)},Ae=function(e){var t=_(e),i=o(oe,this,t);return!(this===$&&f(le,t)&&!f(ue,t))&&(!(i||!f(this,t)||!f(le,t)||f(this,q)&&this[q][t])||i)},ke=function(e,t){var i=k(e),r=_(t);if(i!==$||!f(le,r)||f(ue,r)){var a=ae(i,r);return!a||!f(le,r)||f(i,q)&&i[q][r]||(a.enumerable=!0),a}},_e=function(e){var t=se(k(e)),i=[];return W(t,(function(e){f(le,e)||f(U,e)||ce(i,e)})),i},we=function(e){var t=e===$,i=se(t?ue:k(e)),r=[];return W(i,(function(e){!f(le,e)||t&&!f($,e)||ce(r,le[e])})),r};if(d||(Z=function(){if(y(ee,this))throw te("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?w(arguments[0]):void 0,t=j(e),i=function(e){this===$&&o(i,ue,e),f(this,q)&&f(this[q],t)&&(this[q][t]=!1),me(this,t,S(1,e))};return u&&pe&&me($,t,{configurable:!0,set:i}),ge(t,e)},ee=Z[J],B(ee,"toString",(function(){return X(this).tag})),B(Z,"withoutSetter",(function(e){return ge(j(e),e)})),P.f=Ae,D.f=ye,I.f=ve,L.f=ke,x.f=C.f=_e,R.f=we,z.f=function(e){return ge(N(e),e)},u&&(ne(ee,"description",{configurable:!0,get:function(){return X(this).description}}),l||B($,"propertyIsEnumerable",Ae,{unsafe:!0}))),r({global:!0,wrap:!0,forced:!d,sham:!d},{Symbol:Z}),W(E(fe),(function(e){G(e)})),r({target:K,stat:!0,forced:!d},{for:function(e){var t=w(e);if(f(de,t))return de[t];var i=Z(t);return de[t]=i,he[i]=t,i},keyFor:function(e){if(!v(e))throw te(e+" is not a symbol");if(f(he,e))return he[e]},useSetter:function(){pe=!0},useSimple:function(){pe=!1}}),r({target:"Object",stat:!0,forced:!d,sham:!u},{create:be,defineProperty:ye,defineProperties:ve,getOwnPropertyDescriptor:ke}),r({target:"Object",stat:!0,forced:!d},{getOwnPropertyNames:_e,getOwnPropertySymbols:we}),r({target:"Object",stat:!0,forced:h((function(){R.f(1)}))},{getOwnPropertySymbols:function(e){return R.f(A(e))}}),re){var Se=!d||h((function(){var e=Z();return"[null]"!=re([e])||"{}"!=re({a:e})||"{}"!=re(Object(e))}));r({target:"JSON",stat:!0,forced:Se},{stringify:function(e,t,i){var r=O(arguments),a=t;if((g(t)||void 0!==e)&&!v(e))return p(t)||(t=function(e,t){if(m(a)&&(t=o(a,this,e,t)),!v(t))return t}),r[1]=t,s(re,null,r)}})}if(!ee[Y]){var Te=ee.valueOf;B(ee,Y,(function(e){return o(Te,this)}))}H(Z,K),U[q]=!0},a623:function(e,t,i){"use strict";var r=i("23e7"),a=i("b727").every,n=i("a640"),s=n("every");r({target:"Array",proto:!0,forced:!s},{every:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}})},a630:function(e,t,i){var r=i("23e7"),a=i("4df4"),n=i("1c7e"),s=!n((function(e){Array.from(e)}));r({target:"Array",stat:!0,forced:s},{from:a})},a640:function(e,t,i){"use strict";var r=i("d039");e.exports=function(e,t){var i=[][e];return!!i&&r((function(){i.call(null,t||function(){return 1},1)}))}},a79d:function(e,t,i){"use strict";var r=i("23e7"),a=i("c430"),n=i("fea9"),s=i("d039"),o=i("d066"),c=i("1626"),l=i("4840"),u=i("cdf9"),d=i("6eeb"),h=!!n&&s((function(){n.prototype["finally"].call({then:function(){}},(function(){}))}));if(r({target:"Promise",proto:!0,real:!0,forced:h},{finally:function(e){var t=l(this,o("Promise")),i=c(e);return this.then(i?function(i){return u(t,e()).then((function(){return i}))}:e,i?function(i){return u(t,e()).then((function(){throw i}))}:e)}}),!a&&c(n)){var f=o("Promise").prototype["finally"];n.prototype["finally"]!==f&&d(n.prototype,"finally",f,{unsafe:!0})}},a874:function(e,t,i){var r=i("23e7"),a=i("145e"),n=i("44d2");r({target:"Array",proto:!0},{copyWithin:a}),n("copyWithin")},a975:function(e,t,i){"use strict";var r=i("ebb5"),a=i("b727").every,n=r.aTypedArray,s=r.exportTypedArrayMethod;s("every",(function(e){return a(n(this),e,arguments.length>1?arguments[1]:void 0)}))},a981:function(e,t){e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},a9e3:function(e,t,i){"use strict";var r=i("83ab"),a=i("da84"),n=i("e330"),s=i("94ca"),o=i("6eeb"),c=i("1a2d"),l=i("7156"),u=i("3a9b"),d=i("d9b5"),h=i("c04e"),f=i("d039"),p=i("241c").f,m=i("06cf").f,g=i("9bf2").f,y=i("408a"),v=i("58a8").trim,b="Number",A=a[b],k=A.prototype,_=a.TypeError,w=n("".slice),S=n("".charCodeAt),T=function(e){var t=h(e,"number");return"bigint"==typeof t?t:E(t)},E=function(e){var t,i,r,a,n,s,o,c,l=h(e,"number");if(d(l))throw _("Cannot convert a Symbol value to a number");if("string"==typeof l&&l.length>2)if(l=v(l),t=S(l,0),43===t||45===t){if(i=S(l,2),88===i||120===i)return NaN}else if(48===t){switch(S(l,1)){case 66:case 98:r=2,a=49;break;case 79:case 111:r=8,a=55;break;default:return+l}for(n=w(l,2),s=n.length,o=0;o<s;o++)if(c=S(n,o),c<48||c>a)return NaN;return parseInt(n,r)}return+l};if(s(b,!A(" 0o1")||!A("0b1")||A("+0x1"))){for(var x,C=function(e){var t=arguments.length<1?0:A(T(e)),i=this;return u(k,i)&&f((function(){y(i)}))?l(Object(t),i,C):t},R=r?p(A):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),L=0;R.length>L;L++)c(A,x=R[L])&&!c(C,x)&&g(C,x,m(A,x));C.prototype=k,k.constructor=C,o(a,b,C)}},aa1f:function(e,t,i){"use strict";var r=i("83ab"),a=i("d039"),n=i("825a"),s=i("7c73"),o=i("e391"),c=Error.prototype.toString,l=a((function(){if(r){var e=s(Object.defineProperty({},"name",{get:function(){return this===e}}));if("true"!==c.call(e))return!0}return"2: 1"!==c.call({message:1,name:2})||"Error"!==c.call({})}));e.exports=l?function(){var e=n(this),t=o(e.name,"Error"),i=o(e.message);return t?i?t+": "+i:t:i}:c},ab13:function(e,t,i){var r=i("b622"),a=r("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(i){try{return t[a]=!1,"/./"[e](t)}catch(r){}}return!1}},ab36:function(e,t,i){var r=i("861d"),a=i("9112");e.exports=function(e,t){r(t)&&"cause"in t&&a(e,"cause",t.cause)}},ac1f:function(e,t,i){"use strict";var r=i("23e7"),a=i("9263");r({target:"RegExp",proto:!0,forced:/./.exec!==a},{exec:a})},acac:function(e,t,i){"use strict";var r=i("e330"),a=i("e2cc"),n=i("f183").getWeakData,s=i("825a"),o=i("861d"),c=i("19aa"),l=i("2266"),u=i("b727"),d=i("1a2d"),h=i("69f3"),f=h.set,p=h.getterFor,m=u.find,g=u.findIndex,y=r([].splice),v=0,b=function(e){return e.frozen||(e.frozen=new A)},A=function(){this.entries=[]},k=function(e,t){return m(e.entries,(function(e){return e[0]===t}))};A.prototype={get:function(e){var t=k(this,e);if(t)return t[1]},has:function(e){return!!k(this,e)},set:function(e,t){var i=k(this,e);i?i[1]=t:this.entries.push([e,t])},delete:function(e){var t=g(this.entries,(function(t){return t[0]===e}));return~t&&y(this.entries,t,1),!!~t}},e.exports={getConstructor:function(e,t,i,r){var u=e((function(e,a){c(e,h),f(e,{type:t,id:v++,frozen:void 0}),void 0!=a&&l(a,e[r],{that:e,AS_ENTRIES:i})})),h=u.prototype,m=p(t),g=function(e,t,i){var r=m(e),a=n(s(t),!0);return!0===a?b(r).set(t,i):a[r.id]=i,e};return a(h,{delete:function(e){var t=m(this);if(!o(e))return!1;var i=n(e);return!0===i?b(t)["delete"](e):i&&d(i,t.id)&&delete i[t.id]},has:function(e){var t=m(this);if(!o(e))return!1;var i=n(e);return!0===i?b(t).has(e):i&&d(i,t.id)}}),a(h,i?{get:function(e){var t=m(this);if(o(e)){var i=n(e);return!0===i?b(t).get(e):i?i[t.id]:void 0}},set:function(e,t){return g(this,e,t)}}:{add:function(e){return g(this,e,!0)}}),u}}},accc:function(e,t,i){var r=i("23e7"),a=i("64e5");r({target:"Date",proto:!0,forced:Date.prototype.toISOString!==a},{toISOString:a})},acd8:function(e,t,i){var r=i("23e7"),a=i("7e12");r({global:!0,forced:parseFloat!=a},{parseFloat:a})},ace4:function(e,t,i){"use strict";var r=i("23e7"),a=i("e330"),n=i("d039"),s=i("621a"),o=i("825a"),c=i("23cb"),l=i("50c4"),u=i("4840"),d=s.ArrayBuffer,h=s.DataView,f=h.prototype,p=a(d.prototype.slice),m=a(f.getUint8),g=a(f.setUint8),y=n((function(){return!new d(2).slice(1,void 0).byteLength}));r({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:y},{slice:function(e,t){if(p&&void 0===t)return p(o(this),e);var i=o(this).byteLength,r=c(e,i),a=c(void 0===t?i:t,i),n=new(u(this,d))(l(a-r)),s=new h(this),f=new h(n),y=0;while(r<a)g(f,y++,m(s,r++));return n}})},ad6d:function(e,t,i){"use strict";var r=i("825a");e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},addb:function(e,t,i){var r=i("4dae"),a=Math.floor,n=function(e,t){var i=e.length,c=a(i/2);return i<8?s(e,t):o(e,n(r(e,0,c),t),n(r(e,c),t),t)},s=function(e,t){var i,r,a=e.length,n=1;while(n<a){r=n,i=e[n];while(r&&t(e[r-1],i)>0)e[r]=e[--r];r!==n++&&(e[r]=i)}return e},o=function(e,t,i,r){var a=t.length,n=i.length,s=0,o=0;while(s<a||o<n)e[s+o]=s<a&&o<n?r(t[s],i[o])<=0?t[s++]:i[o++]:s<a?t[s++]:i[o++];return e};e.exports=n},ade3:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));i("7a82");function r(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}},ae93:function(e,t,i){"use strict";var r,a,n,s=i("d039"),o=i("1626"),c=i("7c73"),l=i("e163"),u=i("6eeb"),d=i("b622"),h=i("c430"),f=d("iterator"),p=!1;[].keys&&(n=[].keys(),"next"in n?(a=l(l(n)),a!==Object.prototype&&(r=a)):p=!0);var m=void 0==r||s((function(){var e={};return r[f].call(e)!==e}));m?r={}:h&&(r=c(r)),o(r[f])||u(r,f,(function(){return this})),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:p}},aed9:function(e,t,i){var r=i("83ab"),a=i("d039");e.exports=r&&a((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},af03:function(e,t,i){var r=i("d039");e.exports=function(e){return r((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}},aff5:function(e,t,i){var r=i("23e7");r({target:"Number",stat:!0},{MAX_SAFE_INTEGER:9007199254740991})},b041:function(e,t,i){"use strict";var r=i("00ee"),a=i("f5df");e.exports=r?{}.toString:function(){return"[object "+a(this)+"]"}},b0c0:function(e,t,i){var r=i("83ab"),a=i("5e77").EXISTS,n=i("e330"),s=i("9bf2").f,o=Function.prototype,c=n(o.toString),l=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,u=n(l.exec),d="name";r&&!a&&s(o,d,{configurable:!0,get:function(){try{return u(l,c(this))[1]}catch(e){return""}}})},b380:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));i("131a");function r(e,t){return r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(e,t)}},b39a:function(e,t,i){"use strict";var r=i("da84"),a=i("2ba4"),n=i("ebb5"),s=i("d039"),o=i("f36a"),c=r.Int8Array,l=n.aTypedArray,u=n.exportTypedArrayMethod,d=[].toLocaleString,h=!!c&&s((function(){d.call(new c(1))})),f=s((function(){return[1,2].toLocaleString()!=new c([1,2]).toLocaleString()}))||!s((function(){c.prototype.toLocaleString.call([1,2])}));u("toLocaleString",(function(){return a(d,h?o(l(this)):l(this),o(arguments))}),f)},b420:function(e,t,i){var r=i("23e7"),a=i("621a"),n=i("a981");r({global:!0,forced:!n},{DataView:a.DataView})},b575:function(e,t,i){var r,a,n,s,o,c,l,u,d=i("da84"),h=i("0366"),f=i("06cf").f,p=i("2cf4").set,m=i("1cdc"),g=i("d4c3"),y=i("a4b4"),v=i("605d"),b=d.MutationObserver||d.WebKitMutationObserver,A=d.document,k=d.process,_=d.Promise,w=f(d,"queueMicrotask"),S=w&&w.value;S||(r=function(){var e,t;v&&(e=k.domain)&&e.exit();while(a){t=a.fn,a=a.next;try{t()}catch(i){throw a?s():n=void 0,i}}n=void 0,e&&e.enter()},m||v||y||!b||!A?!g&&_&&_.resolve?(l=_.resolve(void 0),l.constructor=_,u=h(l.then,l),s=function(){u(r)}):v?s=function(){k.nextTick(r)}:(p=h(p,d),s=function(){p(r)}):(o=!0,c=A.createTextNode(""),new b(r).observe(c,{characterData:!0}),s=function(){c.data=o=!o})),e.exports=S||function(e){var t={fn:e,next:void 0};n&&(n.next=t),a||(a=t,s()),n=t}},b622:function(e,t,i){var r=i("da84"),a=i("5692"),n=i("1a2d"),s=i("90e3"),o=i("4930"),c=i("fdbf"),l=a("wks"),u=r.Symbol,d=u&&u["for"],h=c?u:u&&u.withoutSetter||s;e.exports=function(e){if(!n(l,e)||!o&&"string"!=typeof l[e]){var t="Symbol."+e;o&&n(u,e)?l[e]=u[e]:l[e]=c&&d?d(t):h(t)}return l[e]}},b64b:function(e,t,i){var r=i("23e7"),a=i("7b0b"),n=i("df75"),s=i("d039"),o=s((function(){n(1)}));r({target:"Object",stat:!0,forced:o},{keys:function(e){return n(a(e))}})},b680:function(e,t,i){"use strict";var r=i("23e7"),a=i("da84"),n=i("e330"),s=i("5926"),o=i("408a"),c=i("1148"),l=i("d039"),u=a.RangeError,d=a.String,h=Math.floor,f=n(c),p=n("".slice),m=n(1..toFixed),g=function(e,t,i){return 0===t?i:t%2===1?g(e,t-1,i*e):g(e*e,t/2,i)},y=function(e){var t=0,i=e;while(i>=4096)t+=12,i/=4096;while(i>=2)t+=1,i/=2;return t},v=function(e,t,i){var r=-1,a=i;while(++r<6)a+=t*e[r],e[r]=a%1e7,a=h(a/1e7)},b=function(e,t){var i=6,r=0;while(--i>=0)r+=e[i],e[i]=h(r/t),r=r%t*1e7},A=function(e){var t=6,i="";while(--t>=0)if(""!==i||0===t||0!==e[t]){var r=d(e[t]);i=""===i?r:i+f("0",7-r.length)+r}return i},k=l((function(){return"0.000"!==m(8e-5,3)||"1"!==m(.9,0)||"1.25"!==m(1.255,2)||"1000000000000000128"!==m(0xde0b6b3a7640080,0)}))||!l((function(){m({})}));r({target:"Number",proto:!0,forced:k},{toFixed:function(e){var t,i,r,a,n=o(this),c=s(e),l=[0,0,0,0,0,0],h="",m="0";if(c<0||c>20)throw u("Incorrect fraction digits");if(n!=n)return"NaN";if(n<=-1e21||n>=1e21)return d(n);if(n<0&&(h="-",n=-n),n>1e-21)if(t=y(n*g(2,69,1))-69,i=t<0?n*g(2,-t,1):n/g(2,t,1),i*=4503599627370496,t=52-t,t>0){v(l,0,i),r=c;while(r>=7)v(l,1e7,0),r-=7;v(l,g(10,r,1),0),r=t-1;while(r>=23)b(l,1<<23),r-=23;b(l,1<<r),v(l,1,1),b(l,2),m=A(l)}else v(l,0,i),v(l,1<<-t,0),m=A(l)+f("0",c);return c>0?(a=m.length,m=h+(a<=c?"0."+f("0",c-a)+m:p(m,0,a-c)+"."+p(m,a-c))):m=h+m,m}})},b6b7:function(e,t,i){var r=i("ebb5"),a=i("4840"),n=r.TYPED_ARRAY_CONSTRUCTOR,s=r.aTypedArrayConstructor;e.exports=function(e){return s(a(e,e[n]))}},b727:function(e,t,i){var r=i("0366"),a=i("e330"),n=i("44ad"),s=i("7b0b"),o=i("07fa"),c=i("65f0"),l=a([].push),u=function(e){var t=1==e,i=2==e,a=3==e,u=4==e,d=6==e,h=7==e,f=5==e||d;return function(p,m,g,y){for(var v,b,A=s(p),k=n(A),_=r(m,g),w=o(k),S=0,T=y||c,E=t?T(p,w):i||h?T(p,0):void 0;w>S;S++)if((f||S in k)&&(v=k[S],b=_(v,S,A),e))if(t)E[S]=b;else if(b)switch(e){case 3:return!0;case 5:return v;case 6:return S;case 2:l(E,v)}else switch(e){case 4:return!1;case 7:l(E,v)}return d?-1:a||u?u:E}};e.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterReject:u(7)}},b7ef:function(e,t,i){"use strict";var r=i("23e7"),a=i("d066"),n=i("5c6c"),s=i("9bf2").f,o=i("1a2d"),c=i("19aa"),l=i("7156"),u=i("e391"),d=i("cf98"),h=i("c770"),f=i("c430"),p="DOMException",m=a("Error"),g=a(p),y=function(){c(this,v);var e=arguments.length,t=u(e<1?void 0:arguments[0]),i=u(e<2?void 0:arguments[1],"Error"),r=new g(t,i),a=m(t);return a.name=p,s(r,"stack",n(1,h(a.stack,1))),l(r,this,y),r},v=y.prototype=g.prototype,b="stack"in m(p),A="stack"in new g(1,2),k=b&&!A;r({global:!0,forced:f||k},{DOMException:k?y:g});var _=a(p),w=_.prototype;if(w.constructor!==_)for(var S in f||s(w,"constructor",n(1,_)),d)if(o(d,S)){var T=d[S],E=T.s;o(_,E)||s(_,E,n(6,T.c))}},b8bf:function(e,t,i){var r=i("23e7"),a=i("83ab"),n=i("7c73");r({target:"Object",stat:!0,sham:!a},{create:n})},b917:function(e,t){for(var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r={},a=0;a<66;a++)r[i.charAt(a)]=a;e.exports={itoc:i,ctoi:r}},b980:function(e,t,i){var r=i("d039"),a=i("5c6c");e.exports=!r((function(){var e=Error("a");return!("stack"in e)||(Object.defineProperty(e,"stack",a(1,7)),7!==e.stack)}))},baa5:function(e,t,i){var r=i("23e7"),a=i("e58c");r({target:"Array",proto:!0,forced:a!==[].lastIndexOf},{lastIndexOf:a})},bb2f:function(e,t,i){var r=i("d039");e.exports=!r((function(){return Object.isExtensible(Object.preventExtensions({}))}))},bee2:function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));i("7a82");function r(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function a(e,t,i){return t&&r(e.prototype,t),i&&r(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}},c04e:function(e,t,i){var r=i("da84"),a=i("c65b"),n=i("861d"),s=i("d9b5"),o=i("dc4a"),c=i("485a"),l=i("b622"),u=r.TypeError,d=l("toPrimitive");e.exports=function(e,t){if(!n(e)||s(e))return e;var i,r=o(e,d);if(r){if(void 0===t&&(t="default"),i=a(r,e,t),!n(i)||s(i))return i;throw u("Can't convert object to primitive value")}return void 0===t&&(t="number"),c(e,t)}},c0b6:function(e,t,i){var r=i("23e7"),a=i("0538");r({target:"Function",proto:!0,forced:Function.bind!==a},{bind:a})},c19f:function(e,t,i){"use strict";var r=i("23e7"),a=i("da84"),n=i("621a"),s=i("2626"),o="ArrayBuffer",c=n[o],l=a[o];r({global:!0,forced:l!==c},{ArrayBuffer:c}),s(o)},c1ac:function(e,t,i){"use strict";var r=i("ebb5"),a=i("b727").filter,n=i("1448"),s=r.aTypedArray,o=r.exportTypedArrayMethod;o("filter",(function(e){var t=a(s(this),e,arguments.length>1?arguments[1]:void 0);return n(this,t)}))},c20d:function(e,t,i){var r=i("da84"),a=i("d039"),n=i("e330"),s=i("577e"),o=i("58a8").trim,c=i("5899"),l=r.parseInt,u=r.Symbol,d=u&&u.iterator,h=/^[+-]?0x/i,f=n(h.exec),p=8!==l(c+"08")||22!==l(c+"0x16")||d&&!a((function(){l(Object(d))}));e.exports=p?function(e,t){var i=o(s(e));return l(i,t>>>0||(f(h,i)?16:10))}:l},c430:function(e,t){e.exports=!1},c607:function(e,t,i){var r=i("da84"),a=i("83ab"),n=i("fce3"),s=i("c6b6"),o=i("9bf2").f,c=i("69f3").get,l=RegExp.prototype,u=r.TypeError;a&&n&&o(l,"dotAll",{configurable:!0,get:function(){if(this!==l){if("RegExp"===s(this))return!!c(this).dotAll;throw u("Incompatible receiver, RegExp required")}}})},c60d:function(e,t,i){var r=i("1a2d");e.exports=function(e){return void 0!==e&&(r(e,"value")||r(e,"writable"))}},c65b:function(e,t,i){var r=i("40d5"),a=Function.prototype.call;e.exports=r?a.bind(a):function(){return a.apply(a,arguments)}},c6b6:function(e,t,i){var r=i("e330"),a=r({}.toString),n=r("".slice);e.exports=function(e){return n(a(e),8,-1)}},c6cd:function(e,t,i){var r=i("da84"),a=i("ce4e"),n="__core-js_shared__",s=r[n]||a(n,{});e.exports=s},c740:function(e,t,i){"use strict";var r=i("23e7"),a=i("b727").findIndex,n=i("44d2"),s="findIndex",o=!0;s in[]&&Array(1)[s]((function(){o=!1})),r({target:"Array",proto:!0,forced:o},{findIndex:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}}),n(s)},c770:function(e,t,i){var r=i("e330"),a=r("".replace),n=function(e){return String(Error(e).stack)}("zxcasd"),s=/\n\s*at [^:]*:[^\n]*/,o=s.test(n);e.exports=function(e,t){if(o&&"string"==typeof e)while(t--)e=a(e,s,"");return e}},c7cd:function(e,t,i){"use strict";var r=i("23e7"),a=i("857a"),n=i("af03");r({target:"String",proto:!0,forced:n("fixed")},{fixed:function(){return a(this,"tt","","")}})},c8ba:function(t,i){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"===typeof window&&(r=window)}t.exports=r},c8d2:function(e,t,i){var r=i("5e77").PROPER,a=i("d039"),n=i("5899"),s="​…᠎";e.exports=function(e){return a((function(){return!!n[e]()||s[e]()!==s||r&&n[e].name!==e}))}},c975:function(e,t,i){"use strict";var r=i("23e7"),a=i("e330"),n=i("4d64").indexOf,s=i("a640"),o=a([].indexOf),c=!!o&&1/o([1],1,-0)<0,l=s("indexOf");r({target:"Array",proto:!0,forced:c||!l},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return c?o(this,e,t)||0:n(this,e,t)}})},ca84:function(e,t,i){var r=i("e330"),a=i("1a2d"),n=i("fc6a"),s=i("4d64").indexOf,o=i("d012"),c=r([].push);e.exports=function(e,t){var i,r=n(e),l=0,u=[];for(i in r)!a(o,i)&&a(r,i)&&c(u,i);while(t.length>l)a(r,i=t[l++])&&(~s(u,i)||c(u,i));return u}},ca91:function(e,t,i){"use strict";var r=i("ebb5"),a=i("d58f").left,n=r.aTypedArray,s=r.exportTypedArrayMethod;s("reduce",(function(e){var t=arguments.length;return a(n(this),e,t,t>1?arguments[1]:void 0)}))},caad:function(e,t,i){"use strict";var r=i("23e7"),a=i("4d64").includes,n=i("44d2");r({target:"Array",proto:!0},{includes:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}}),n("includes")},cb29:function(e,t,i){var r=i("23e7"),a=i("81d5"),n=i("44d2");r({target:"Array",proto:!0},{fill:a}),n("fill")},cc12:function(e,t,i){var r=i("da84"),a=i("861d"),n=r.document,s=a(n)&&a(n.createElement);e.exports=function(e){return s?n.createElement(e):{}}},cca6:function(e,t,i){var r=i("23e7"),a=i("60da");r({target:"Object",stat:!0,forced:Object.assign!==a},{assign:a})},cd26:function(e,t,i){"use strict";var r=i("ebb5"),a=r.aTypedArray,n=r.exportTypedArrayMethod,s=Math.floor;n("reverse",(function(){var e,t=this,i=a(t).length,r=s(i/2),n=0;while(n<r)e=t[n],t[n++]=t[--i],t[i]=e;return t}))},cdf9:function(e,t,i){var r=i("825a"),a=i("861d"),n=i("f069");e.exports=function(e,t){if(r(e),a(t)&&t.constructor===e)return t;var i=n.f(e),s=i.resolve;return s(t),i.promise}},ce4e:function(e,t,i){var r=i("da84"),a=Object.defineProperty;e.exports=function(e,t){try{a(r,e,{value:t,configurable:!0,writable:!0})}catch(i){r[e]=t}return t}},cf98:function(e,t){e.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},cfc3:function(e,t,i){var r=i("74e8");r("Float32",(function(e){return function(t,i,r){return e(this,t,i,r)}}))},d012:function(e,t){e.exports={}},d039:function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},d066:function(e,t,i){var r=i("da84"),a=i("1626"),n=function(e){return a(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?n(r[e]):r[e]&&r[e][t]}},d139:function(e,t,i){"use strict";var r=i("ebb5"),a=i("b727").find,n=r.aTypedArray,s=r.exportTypedArrayMethod;s("find",(function(e){return a(n(this),e,arguments.length>1?arguments[1]:void 0)}))},d1e7:function(e,t,i){"use strict";var r={}.propertyIsEnumerable,a=Object.getOwnPropertyDescriptor,n=a&&!r.call({1:2},1);t.f=n?function(e){var t=a(this,e);return!!t&&t.enumerable}:r},d28b:function(e,t,i){var r=i("746f");r("iterator")},d2bb:function(e,t,i){var r=i("e330"),a=i("825a"),n=i("3bbe");e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,i={};try{e=r(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set),e(i,[]),t=i instanceof Array}catch(s){}return function(i,r){return a(i),n(r),t?e(i,r):i.__proto__=r,i}}():void 0)},d3b7:function(e,t,i){var r=i("00ee"),a=i("6eeb"),n=i("b041");r||a(Object.prototype,"toString",n,{unsafe:!0})},d401:function(e,t,i){var r=i("6eeb"),a=i("aa1f"),n=Error.prototype;n.toString!==a&&r(n,"toString",a)},d44e:function(e,t,i){var r=i("9bf2").f,a=i("1a2d"),n=i("b622"),s=n("toStringTag");e.exports=function(e,t,i){e&&!i&&(e=e.prototype),e&&!a(e,s)&&r(e,s,{configurable:!0,value:t})}},d4c3:function(e,t,i){var r=i("342f"),a=i("da84");e.exports=/ipad|iphone|ipod/i.test(r)&&void 0!==a.Pebble},d4ec:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));i("d9e2"),i("d401");function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},d58f:function(e,t,i){var r=i("da84"),a=i("59ed"),n=i("7b0b"),s=i("44ad"),o=i("07fa"),c=r.TypeError,l=function(e){return function(t,i,r,l){a(i);var u=n(t),d=s(u),h=o(u),f=e?h-1:0,p=e?-1:1;if(r<2)while(1){if(f in d){l=d[f],f+=p;break}if(f+=p,e?f<0:h<=f)throw c("Reduce of empty array with no initial value")}for(;e?f>=0:h>f;f+=p)f in d&&(l=i(l,d[f],f,u));return l}};e.exports={left:l(!1),right:l(!0)}},d5d6:function(e,t,i){"use strict";var r=i("ebb5"),a=i("b727").forEach,n=r.aTypedArray,s=r.exportTypedArrayMethod;s("forEach",(function(e){a(n(this),e,arguments.length>1?arguments[1]:void 0)}))},d5e4:function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));i("d9e2"),i("d401");function r(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function a(e,t,i){r(e,t),t.set(e,i)}},d6d6:function(e,t,i){var r=i("da84"),a=r.TypeError;e.exports=function(e,t){if(e<t)throw a("Not enough arguments");return e}},d784:function(e,t,i){"use strict";i("ac1f");var r=i("e330"),a=i("6eeb"),n=i("9263"),s=i("d039"),o=i("b622"),c=i("9112"),l=o("species"),u=RegExp.prototype;e.exports=function(e,t,i,d){var h=o(e),f=!s((function(){var t={};return t[h]=function(){return 7},7!=""[e](t)})),p=f&&!s((function(){var t=!1,i=/a/;return"split"===e&&(i={},i.constructor={},i.constructor[l]=function(){return i},i.flags="",i[h]=/./[h]),i.exec=function(){return t=!0,null},i[h](""),!t}));if(!f||!p||i){var m=r(/./[h]),g=t(h,""[e],(function(e,t,i,a,s){var o=r(e),c=t.exec;return c===n||c===u.exec?f&&!s?{done:!0,value:m(t,i,a)}:{done:!0,value:o(i,t,a)}:{done:!1}}));a(String.prototype,e,g[0]),a(u,h,g[1])}d&&c(u[h],"sham",!0)}},d81d:function(e,t,i){"use strict";var r=i("23e7"),a=i("b727").map,n=i("1dde"),s=n("map");r({target:"Array",proto:!0,forced:!s},{map:function(e){return a(this,e,arguments.length>1?arguments[1]:void 0)}})},d86b:function(e,t,i){var r=i("d039");e.exports=r((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}))},d967:function(t,i,r){"use strict";r.d(i,"a",(function(){return a}));r("d3b7"),r("f8c9"),r("4ae1");function a(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}},d998:function(e,t,i){var r=i("342f");e.exports=/MSIE|Trident/.test(r)},d9b5:function(e,t,i){var r=i("da84"),a=i("d066"),n=i("1626"),s=i("3a9b"),o=i("fdbf"),c=r.Object;e.exports=o?function(e){return"symbol"==typeof e}:function(e){var t=a("Symbol");return n(t)&&s(t.prototype,c(e))}},d9e2:function(e,t,i){var r=i("23e7"),a=i("da84"),n=i("2ba4"),s=i("e5cb"),o="WebAssembly",c=a[o],l=7!==Error("e",{cause:7}).cause,u=function(e,t){var i={};i[e]=s(e,t,l),r({global:!0,forced:l},i)},d=function(e,t){if(c&&c[e]){var i={};i[e]=s(o+"."+e,t,l),r({target:o,stat:!0,forced:l},i)}};u("Error",(function(e){return function(t){return n(e,this,arguments)}})),u("EvalError",(function(e){return function(t){return n(e,this,arguments)}})),u("RangeError",(function(e){return function(t){return n(e,this,arguments)}})),u("ReferenceError",(function(e){return function(t){return n(e,this,arguments)}})),u("SyntaxError",(function(e){return function(t){return n(e,this,arguments)}})),u("TypeError",(function(e){return function(t){return n(e,this,arguments)}})),u("URIError",(function(e){return function(t){return n(e,this,arguments)}})),d("CompileError",(function(e){return function(t){return n(e,this,arguments)}})),d("LinkError",(function(e){return function(t){return n(e,this,arguments)}})),d("RuntimeError",(function(e){return function(t){return n(e,this,arguments)}}))},da84:function(e,t,i){(function(t){var i=function(e){return e&&e.Math==Math&&e};e.exports=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof t&&t)||function(){return this}()||Function("return this")()}).call(this,i("c8ba"))},dbb4:function(e,t,i){var r=i("23e7"),a=i("83ab"),n=i("56ef"),s=i("fc6a"),o=i("06cf"),c=i("8418");r({target:"Object",stat:!0,sham:!a},{getOwnPropertyDescriptors:function(e){var t,i,r=s(e),a=o.f,l=n(r),u={},d=0;while(l.length>d)i=a(r,t=l[d++]),void 0!==i&&c(u,t,i);return u}})},dc4a:function(e,t,i){var r=i("59ed");e.exports=function(e,t){var i=e[t];return null==i?void 0:r(i)}},dca8:function(e,t,i){var r=i("23e7"),a=i("bb2f"),n=i("d039"),s=i("861d"),o=i("f183").onFreeze,c=Object.freeze,l=n((function(){c(1)}));r({target:"Object",stat:!0,forced:l,sham:!a},{freeze:function(e){return c&&s(e)?c(o(e)):e}})},ddb0:function(e,t,i){var r=i("da84"),a=i("fdbc"),n=i("785a"),s=i("e260"),o=i("9112"),c=i("b622"),l=c("iterator"),u=c("toStringTag"),d=s.values,h=function(e,t){if(e){if(e[l]!==d)try{o(e,l,d)}catch(r){e[l]=d}if(e[u]||o(e,u,t),a[t])for(var i in s)if(e[i]!==s[i])try{o(e,i,s[i])}catch(r){e[i]=s[i]}}};for(var f in a)h(r[f]&&r[f].prototype,f);h(n,"DOMTokenList")},df75:function(e,t,i){var r=i("ca84"),a=i("7839");e.exports=Object.keys||function(e){return r(e,a)}},dfb9:function(e,t,i){var r=i("07fa");e.exports=function(e,t){var i=0,a=r(t),n=new e(a);while(a>i)n[i]=t[i++];return n}},e01a:function(e,t,i){"use strict";var r=i("23e7"),a=i("83ab"),n=i("da84"),s=i("e330"),o=i("1a2d"),c=i("1626"),l=i("3a9b"),u=i("577e"),d=i("9bf2").f,h=i("e893"),f=n.Symbol,p=f&&f.prototype;if(a&&c(f)&&(!("description"in p)||void 0!==f().description)){var m={},g=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:u(arguments[0]),t=l(p,this)?new f(e):void 0===e?f():f(e);return""===e&&(m[t]=!0),t};h(g,f),g.prototype=p,p.constructor=g;var y="Symbol(test)"==String(f("test")),v=s(p.toString),b=s(p.valueOf),A=/^Symbol\((.*)\)[^)]+$/,k=s("".replace),_=s("".slice);d(p,"description",{configurable:!0,get:function(){var e=b(this),t=v(e);if(o(m,e))return"";var i=y?_(t,7,-1):k(t,A,"$1");return""===i?void 0:i}}),r({global:!0,forced:!0},{Symbol:g})}},e163:function(e,t,i){var r=i("da84"),a=i("1a2d"),n=i("1626"),s=i("7b0b"),o=i("f772"),c=i("e177"),l=o("IE_PROTO"),u=r.Object,d=u.prototype;e.exports=c?u.getPrototypeOf:function(e){var t=s(e);if(a(t,l))return t[l];var i=t.constructor;return n(i)&&t instanceof i?i.prototype:t instanceof u?d:null}},e177:function(e,t,i){var r=i("d039");e.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},e25e:function(e,t,i){var r=i("23e7"),a=i("c20d");r({global:!0,forced:parseInt!=a},{parseInt:a})},e260:function(e,t,i){"use strict";var r=i("fc6a"),a=i("44d2"),n=i("3f8c"),s=i("69f3"),o=i("9bf2").f,c=i("7dd0"),l=i("c430"),u=i("83ab"),d="Array Iterator",h=s.set,f=s.getterFor(d);e.exports=c(Array,"Array",(function(e,t){h(this,{type:d,target:r(e),index:0,kind:t})}),(function(){var e=f(this),t=e.target,i=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==i?{value:r,done:!1}:"values"==i?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values");var p=n.Arguments=n.Array;if(a("keys"),a("values"),a("entries"),!l&&u&&"values"!==p.name)try{o(p,"name",{value:"values"})}catch(m){}},e285:function(e,t,i){var r=i("da84"),a=r.isFinite;e.exports=Number.isFinite||function(e){return"number"==typeof e&&a(e)}},e2cc:function(e,t,i){var r=i("6eeb");e.exports=function(e,t,i){for(var a in t)r(e,a,t[a],i);return e}},e323:function(e,t,i){"use strict";var r=i("23e7"),a=i("e330"),n=i("1d80"),s=i("5926"),o=i("577e"),c=a("".slice),l=Math.max,u=Math.min,d=!"".substr||"b"!=="ab".substr(-1);r({target:"String",proto:!0,forced:d},{substr:function(e,t){var i,r,a=o(n(this)),d=a.length,h=s(e);return h===1/0&&(h=0),h<0&&(h=l(d+h,0)),i=void 0===t?d:s(t),i<=0||i===1/0?"":(r=u(h+i,d),h>=r?"":c(a,h,r))}})},e330:function(e,t,i){var r=i("40d5"),a=Function.prototype,n=a.bind,s=a.call,o=r&&n.bind(s,s);e.exports=r?function(e){return e&&o(e)}:function(e){return e&&function(){return s.apply(e,arguments)}}},e391:function(e,t,i){var r=i("577e");e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:r(e)}},e439:function(e,t,i){var r=i("23e7"),a=i("d039"),n=i("fc6a"),s=i("06cf").f,o=i("83ab"),c=a((function(){s(1)})),l=!o||c;r({target:"Object",stat:!0,forced:l,sham:!o},{getOwnPropertyDescriptor:function(e,t){return s(n(e),t)}})},e538:function(e,t,i){var r=i("b622");t.f=r},e58c:function(e,t,i){"use strict";var r=i("2ba4"),a=i("fc6a"),n=i("5926"),s=i("07fa"),o=i("a640"),c=Math.min,l=[].lastIndexOf,u=!!l&&1/[1].lastIndexOf(1,-0)<0,d=o("lastIndexOf"),h=u||!d;e.exports=h?function(e){if(u)return r(l,this,arguments)||0;var t=a(this),i=s(t),o=i-1;for(arguments.length>1&&(o=c(o,n(arguments[1]))),o<0&&(o=i+o);o>=0;o--)if(o in t&&t[o]===e)return o||0;return-1}:l},e5cb:function(e,t,i){"use strict";var r=i("d066"),a=i("1a2d"),n=i("9112"),s=i("3a9b"),o=i("d2bb"),c=i("e893"),l=i("7156"),u=i("e391"),d=i("ab36"),h=i("c770"),f=i("b980"),p=i("c430");e.exports=function(e,t,i,m){var g=m?2:1,y=e.split("."),v=y[y.length-1],b=r.apply(null,y);if(b){var A=b.prototype;if(!p&&a(A,"cause")&&delete A.cause,!i)return b;var k=r("Error"),_=t((function(e,t){var i=u(m?t:e,void 0),r=m?new b(e):new b;return void 0!==i&&n(r,"message",i),f&&n(r,"stack",h(r.stack,2)),this&&s(A,this)&&l(r,this,_),arguments.length>g&&d(r,arguments[g]),r}));if(_.prototype=A,"Error"!==v&&(o?o(_,k):c(_,k,{name:!0})),c(_,b),!p)try{A.name!==v&&n(A,"name",v),A.constructor=_}catch(w){}return _}}},e667:function(e,t){e.exports=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}}},e6cf:function(e,t,i){"use strict";var r,a,n,s,o=i("23e7"),c=i("c430"),l=i("da84"),u=i("d066"),d=i("c65b"),h=i("fea9"),f=i("6eeb"),p=i("e2cc"),m=i("d2bb"),g=i("d44e"),y=i("2626"),v=i("59ed"),b=i("1626"),A=i("861d"),k=i("19aa"),_=i("8925"),w=i("2266"),S=i("1c7e"),T=i("4840"),E=i("2cf4").set,x=i("b575"),C=i("cdf9"),R=i("44de"),L=i("f069"),D=i("e667"),I=i("01b4"),P=i("69f3"),O=i("94ca"),B=i("b622"),M=i("6069"),F=i("605d"),U=i("2d00"),j=B("species"),N="Promise",z=P.getterFor(N),G=P.set,H=P.getterFor(N),V=h&&h.prototype,W=h,q=V,K=l.TypeError,J=l.document,Y=l.process,Q=L.f,X=Q,$=!!(J&&J.createEvent&&l.dispatchEvent),Z=b(l.PromiseRejectionEvent),ee="unhandledrejection",te="rejectionhandled",ie=0,re=1,ae=2,ne=1,se=2,oe=!1,ce=O(N,(function(){var e=_(W),t=e!==String(W);if(!t&&66===U)return!0;if(c&&!q["finally"])return!0;if(U>=51&&/native code/.test(e))return!1;var i=new W((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))},a=i.constructor={};return a[j]=r,oe=i.then((function(){}))instanceof r,!oe||!t&&M&&!Z})),le=ce||!S((function(e){W.all(e)["catch"]((function(){}))})),ue=function(e){var t;return!(!A(e)||!b(t=e.then))&&t},de=function(e,t){var i,r,a,n=t.value,s=t.state==re,o=s?e.ok:e.fail,c=e.resolve,l=e.reject,u=e.domain;try{o?(s||(t.rejection===se&&ge(t),t.rejection=ne),!0===o?i=n:(u&&u.enter(),i=o(n),u&&(u.exit(),a=!0)),i===e.promise?l(K("Promise-chain cycle")):(r=ue(i))?d(r,i,c,l):c(i)):l(n)}catch(h){u&&!a&&u.exit(),l(h)}},he=function(e,t){e.notified||(e.notified=!0,x((function(){var i,r=e.reactions;while(i=r.get())de(i,e);e.notified=!1,t&&!e.rejection&&pe(e)})))},fe=function(e,t,i){var r,a;$?(r=J.createEvent("Event"),r.promise=t,r.reason=i,r.initEvent(e,!1,!0),l.dispatchEvent(r)):r={promise:t,reason:i},!Z&&(a=l["on"+e])?a(r):e===ee&&R("Unhandled promise rejection",i)},pe=function(e){d(E,l,(function(){var t,i=e.facade,r=e.value,a=me(e);if(a&&(t=D((function(){F?Y.emit("unhandledRejection",r,i):fe(ee,i,r)})),e.rejection=F||me(e)?se:ne,t.error))throw t.value}))},me=function(e){return e.rejection!==ne&&!e.parent},ge=function(e){d(E,l,(function(){var t=e.facade;F?Y.emit("rejectionHandled",t):fe(te,t,e.value)}))},ye=function(e,t,i){return function(r){e(t,r,i)}},ve=function(e,t,i){e.done||(e.done=!0,i&&(e=i),e.value=t,e.state=ae,he(e,!0))},be=function(e,t,i){if(!e.done){e.done=!0,i&&(e=i);try{if(e.facade===t)throw K("Promise can't be resolved itself");var r=ue(t);r?x((function(){var i={done:!1};try{d(r,t,ye(be,i,e),ye(ve,i,e))}catch(a){ve(i,a,e)}})):(e.value=t,e.state=re,he(e,!1))}catch(a){ve({done:!1},a,e)}}};if(ce&&(W=function(e){k(this,q),v(e),d(r,this);var t=z(this);try{e(ye(be,t),ye(ve,t))}catch(i){ve(t,i)}},q=W.prototype,r=function(e){G(this,{type:N,done:!1,notified:!1,parent:!1,reactions:new I,rejection:!1,state:ie,value:void 0})},r.prototype=p(q,{then:function(e,t){var i=H(this),r=Q(T(this,W));return i.parent=!0,r.ok=!b(e)||e,r.fail=b(t)&&t,r.domain=F?Y.domain:void 0,i.state==ie?i.reactions.add(r):x((function(){de(r,i)})),r.promise},catch:function(e){return this.then(void 0,e)}}),a=function(){var e=new r,t=z(e);this.promise=e,this.resolve=ye(be,t),this.reject=ye(ve,t)},L.f=Q=function(e){return e===W||e===n?new a(e):X(e)},!c&&b(h)&&V!==Object.prototype)){s=V.then,oe||(f(V,"then",(function(e,t){var i=this;return new W((function(e,t){d(s,i,e,t)})).then(e,t)}),{unsafe:!0}),f(V,"catch",q["catch"],{unsafe:!0}));try{delete V.constructor}catch(Ae){}m&&m(V,q)}o({global:!0,wrap:!0,forced:ce},{Promise:W}),g(W,N,!1,!0),y(N),n=u(N),o({target:N,stat:!0,forced:ce},{reject:function(e){var t=Q(this);return d(t.reject,void 0,e),t.promise}}),o({target:N,stat:!0,forced:c||ce},{resolve:function(e){return C(c&&this===n?W:this,e)}}),o({target:N,stat:!0,forced:le},{all:function(e){var t=this,i=Q(t),r=i.resolve,a=i.reject,n=D((function(){var i=v(t.resolve),n=[],s=0,o=1;w(e,(function(e){var c=s++,l=!1;o++,d(i,t,e).then((function(e){l||(l=!0,n[c]=e,--o||r(n))}),a)})),--o||r(n)}));return n.error&&a(n.value),i.promise},race:function(e){var t=this,i=Q(t),r=i.reject,a=D((function(){var a=v(t.resolve);w(e,(function(e){d(a,t,e).then(i.resolve,r)}))}));return a.error&&r(a.value),i.promise}})},e893:function(e,t,i){var r=i("1a2d"),a=i("56ef"),n=i("06cf"),s=i("9bf2");e.exports=function(e,t,i){for(var o=a(t),c=s.f,l=n.f,u=0;u<o.length;u++){var d=o[u];r(e,d)||i&&r(i,d)||c(e,d,l(t,d))}}},e8b5:function(e,t,i){var r=i("c6b6");e.exports=Array.isArray||function(e){return"Array"==r(e)}},e91f:function(e,t,i){"use strict";var r=i("ebb5"),a=i("4d64").indexOf,n=r.aTypedArray,s=r.exportTypedArrayMethod;s("indexOf",(function(e){return a(n(this),e,arguments.length>1?arguments[1]:void 0)}))},e95a:function(e,t,i){var r=i("b622"),a=i("3f8c"),n=r("iterator"),s=Array.prototype;e.exports=function(e){return void 0!==e&&(a.Array===e||s[n]===e)}},e9c4:function(e,t,i){var r=i("23e7"),a=i("da84"),n=i("d066"),s=i("2ba4"),o=i("e330"),c=i("d039"),l=a.Array,u=n("JSON","stringify"),d=o(/./.exec),h=o("".charAt),f=o("".charCodeAt),p=o("".replace),m=o(1..toString),g=/[\uD800-\uDFFF]/g,y=/^[\uD800-\uDBFF]$/,v=/^[\uDC00-\uDFFF]$/,b=function(e,t,i){var r=h(i,t-1),a=h(i,t+1);return d(y,e)&&!d(v,a)||d(v,e)&&!d(y,r)?"\\u"+m(f(e,0),16):e},A=c((function(){return'"\\udf06\\ud834"'!==u("\udf06\ud834")||'"\\udead"'!==u("\udead")}));u&&r({target:"JSON",stat:!0,forced:A},{stringify:function(e,t,i){for(var r=0,a=arguments.length,n=l(a);r<a;r++)n[r]=arguments[r];var o=s(u,null,n);return"string"==typeof o?p(o,g,b):o}})},eac5:function(e,t,i){var r=i("861d"),a=Math.floor;e.exports=Number.isInteger||function(e){return!r(e)&&isFinite(e)&&a(e)===e}},ebb5:function(e,t,i){"use strict";var r,a,n,s=i("a981"),o=i("83ab"),c=i("da84"),l=i("1626"),u=i("861d"),d=i("1a2d"),h=i("f5df"),f=i("0d51"),p=i("9112"),m=i("6eeb"),g=i("9bf2").f,y=i("3a9b"),v=i("e163"),b=i("d2bb"),A=i("b622"),k=i("90e3"),_=c.Int8Array,w=_&&_.prototype,S=c.Uint8ClampedArray,T=S&&S.prototype,E=_&&v(_),x=w&&v(w),C=Object.prototype,R=c.TypeError,L=A("toStringTag"),D=k("TYPED_ARRAY_TAG"),I=k("TYPED_ARRAY_CONSTRUCTOR"),P=s&&!!b&&"Opera"!==h(c.opera),O=!1,B={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},M={BigInt64Array:8,BigUint64Array:8},F=function(e){if(!u(e))return!1;var t=h(e);return"DataView"===t||d(B,t)||d(M,t)},U=function(e){if(!u(e))return!1;var t=h(e);return d(B,t)||d(M,t)},j=function(e){if(U(e))return e;throw R("Target is not a typed array")},N=function(e){if(l(e)&&(!b||y(E,e)))return e;throw R(f(e)+" is not a typed array constructor")},z=function(e,t,i,r){if(o){if(i)for(var a in B){var n=c[a];if(n&&d(n.prototype,e))try{delete n.prototype[e]}catch(s){try{n.prototype[e]=t}catch(l){}}}x[e]&&!i||m(x,e,i?t:P&&w[e]||t,r)}},G=function(e,t,i){var r,a;if(o){if(b){if(i)for(r in B)if(a=c[r],a&&d(a,e))try{delete a[e]}catch(n){}if(E[e]&&!i)return;try{return m(E,e,i?t:P&&E[e]||t)}catch(n){}}for(r in B)a=c[r],!a||a[e]&&!i||m(a,e,t)}};for(r in B)a=c[r],n=a&&a.prototype,n?p(n,I,a):P=!1;for(r in M)a=c[r],n=a&&a.prototype,n&&p(n,I,a);if((!P||!l(E)||E===Function.prototype)&&(E=function(){throw R("Incorrect invocation")},P))for(r in B)c[r]&&b(c[r],E);if((!P||!x||x===C)&&(x=E.prototype,P))for(r in B)c[r]&&b(c[r].prototype,x);if(P&&v(T)!==x&&b(T,x),o&&!d(x,L))for(r in O=!0,g(x,L,{get:function(){return u(this)?this[D]:void 0}}),B)c[r]&&p(c[r],D,r);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:P,TYPED_ARRAY_CONSTRUCTOR:I,TYPED_ARRAY_TAG:O&&D,aTypedArray:j,aTypedArrayConstructor:N,exportTypedArrayMethod:z,exportTypedArrayStaticMethod:G,isView:F,isTypedArray:U,TypedArray:E,TypedArrayPrototype:x}},ec97:function(e,t,i){"use strict";var r=i("ebb5"),a=i("8aa7"),n=r.aTypedArrayConstructor,s=r.exportTypedArrayStaticMethod;s("of",(function(){var e=0,t=arguments.length,i=new(n(this))(t);while(t>e)i[e]=arguments[e++];return i}),a)},efec:function(e,t,i){var r=i("1a2d"),a=i("6eeb"),n=i("51eb"),s=i("b622"),o=s("toPrimitive"),c=Date.prototype;r(c,o)||a(c,o,n)},f00c:function(e,t,i){var r=i("23e7"),a=i("e285");r({target:"Number",stat:!0},{isFinite:a})},f069:function(e,t,i){"use strict";var r=i("59ed"),a=function(e){var t,i;this.promise=new e((function(e,r){if(void 0!==t||void 0!==i)throw TypeError("Bad Promise constructor");t=e,i=r})),this.resolve=r(t),this.reject=r(i)};e.exports.f=function(e){return new a(e)}},f183:function(e,t,i){var r=i("23e7"),a=i("e330"),n=i("d012"),s=i("861d"),o=i("1a2d"),c=i("9bf2").f,l=i("241c"),u=i("057f"),d=i("4fad"),h=i("90e3"),f=i("bb2f"),p=!1,m=h("meta"),g=0,y=function(e){c(e,m,{value:{objectID:"O"+g++,weakData:{}}})},v=function(e,t){if(!s(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,m)){if(!d(e))return"F";if(!t)return"E";y(e)}return e[m].objectID},b=function(e,t){if(!o(e,m)){if(!d(e))return!0;if(!t)return!1;y(e)}return e[m].weakData},A=function(e){return f&&p&&d(e)&&!o(e,m)&&y(e),e},k=function(){_.enable=function(){},p=!0;var e=l.f,t=a([].splice),i={};i[m]=1,e(i).length&&(l.f=function(i){for(var r=e(i),a=0,n=r.length;a<n;a++)if(r[a]===m){t(r,a,1);break}return r},r({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:u.f}))},_=e.exports={enable:k,fastKey:v,getWeakData:b,onFreeze:A};n[m]=!0},f299:function(t,i,r){"use strict";r.r(i);var a=r("99de");r("a4d3"),r("c975"),r("b64b");function n(e,t){if(null==e)return{};var i,r,a={},n=Object.keys(e);for(r=0;r<n.length;r++)i=n[r],t.indexOf(i)>=0||(a[i]=e[i]);return a}function s(e,t){if(null==e)return{};var i,r,a=n(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r<s.length;r++)i=s[r],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}var o=r("1da1");r("277d");function c(e){if(Array.isArray(e))return e}r("e01a"),r("d3b7"),r("d28b"),r("e260"),r("3ca3"),r("ddb0");function l(e,t){var i=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var r,a,n=[],s=!0,o=!1;try{for(i=i.call(e);!(s=(r=i.next()).done);s=!0)if(n.push(r.value),t&&n.length===t)break}catch(c){o=!0,a=c}finally{try{s||null==i["return"]||i["return"]()}finally{if(o)throw a}}return n}}var u=r("06c5");r("d9e2"),r("d401");function d(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(e,t){return c(e)||l(e,t)||Object(u["a"])(e,t)||d()}var f=r("ade3");function p(e,t){var i="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=Object(u["a"])(e))||t&&e&&"number"===typeof e.length){i&&(e=i);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,s=!0,o=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return s=e.done,e},e:function(e){o=!0,n=e},f:function(){try{s||null==i["return"]||i["return"]()}finally{if(o)throw n}}}}var m=r("2909"),g=r("5530"),y=r("9072"),v=r("257e"),b=(r("f8c9"),r("5d41"),r("e439"),r("7e84"));function A(e,t){while(!Object.prototype.hasOwnProperty.call(e,t))if(e=Object(b["a"])(e),null===e)break;return e}function k(){return k="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var r=A(e,t);if(r){var a=Object.getOwnPropertyDescriptor(r,t);return a.get?a.get.call(arguments.length<3?e:i):a.value}},k.apply(this,arguments)}var _=r("262e"),w=r("2caf"),S=r("bee2"),T=r("d4ec"),E=r("53ca"),x=(r("96cf"),r("6c57"),r("99af"),r("e6cf"),r("c0b6"),r("1d1c"),r("ace4"),r("5cc6"),r("907a"),r("9a8c"),r("a975"),r("735e"),r("c1ac"),r("d139"),r("3a7b"),r("d5d6"),r("82f8"),r("e91f"),r("60bd"),r("5f96"),r("3280"),r("3fcc"),r("ca91"),r("25a1"),r("cd26"),r("3c5d"),r("2954"),r("649e"),r("219c"),r("170b"),r("b39a"),r("72f7"),r("ac1f"),r("1276"),r("81b2"),r("0eb6"),r("b7ef"),r("8bd4"),r("5319"),r("0d03"),r("4160"),r("159b"),r("acd8"),r("6eba"),r("ec97"),r("00b4"),r("466d"),r("e25e"),r("a9e3"),r("25f0"),r("4795"),r("b680"),r("2b3d"),r("9861"),r("cca6"),r("498a"),r("e9c4"),r("4de4"),r("38cf"),r("841c"),r("d81d"),r("fb6a"),r("cfc3"),r("4057"),r("84c3"),r("b0c0"),r("cb29"),r("542d"),r("4a9b"),r("c19f"),r("b420"),r("a15b"),r("26e9"),r("e323"),r("c7cd"),r("5377"),r("13d5"),r("a79d"),r("8b09"),r("c740"),r("45fc"),r("a874"),r("4d63"),r("c607"),r("2c3e"),r("7a82"),r("aff5"),r("caad"),r("f5b2"),r("f6d6"),r("a434"),r("fb2c"),r("143c"),r("fd87"),r("a623"),r("7db0"),r("a630"),r("baa5"),r("dbb4"),r("8172"),r("efec"),r("f00c"),r("20bf"),r("9257"),r("b8bf"),r("2532"),r("4e82"),r("583b"),r("2ca0"),r("9129"),r("3410"),r("accc"),r("4d90"),r("6062"),r("dca8"),r("944a"),r("0c47"),r("23dc"),r("4d12"),["retry","retryDelay","onRetryError","transformError"]);(function(e,t){"object"==("undefined"===typeof exports?"undefined":Object(E["a"])(exports))&&("undefined"===typeof module?"undefined":Object(E["a"])(module))<"u"?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=("undefined"===typeof globalThis?"undefined":Object(E["a"])(globalThis))<"u"?globalThis:e||self)["jessibuca-pro"]=t()})(globalThis,(function(){var t="fetch",i="hls",r="websocket",n="webrtc",c="webTransport",l="worker",u="player",d="playerAudio",A="playbackTF",C="mp4",R="webm",L="flv",D="flv",I="m7s",P="hls",O="webrtc",B="webTransport",M="nakedFlow",F="fmp4",U="mpeg4",j={flv:"FLV",m7s:"m7s",hls:"HLS",fmp4:"FMP4",mpeg4:"MPEG4",webrtc:"Webrtc",webTransport:"WebTransport",nakedFlow:"裸流"},N="mse",z="wcs",G="offscreen",H="wasm",V="simd",W="mt",q="canvas",K="video",J="debug",Y="warn",Q="click",X="mouseDownAndUp",$={normal:"normal",simple:"simple"},Z=36e5,ee="/crypto/",te="jbprov",ie=1e4,re={url:"",playbackConfig:{},fullscreenWatermarkConfig:{},playType:u,playbackForwardMaxRateDecodeIFrame:4,playOptions:{},isLive:!0,isMulti:!0,isM7sCrypto:!1,playFailedUseLastFrameShow:!0,playFailedAndPausedShowMessage:!1},ae={playType:u,container:"",videoBuffer:1e3,videoBufferDelay:1e3,networkDelay:1e4,isResize:!0,isFullResize:!1,isFlv:!1,isHls:!1,isFmp4:!1,isFmp4Private:!1,isWebrtc:!1,isWebrtcForZLM:!1,isWebrtcForSRS:!1,isWebrtcForOthers:!1,isNakedFlow:!1,isMpeg4:!1,debug:!1,debugLevel:Y,debugUuid:"",isMulti:!0,multiIndex:-1,hotKey:!1,loadingTimeout:10,heartTimeout:10,timeout:10,pageVisibilityHiddenTimeout:300,loadingTimeoutReplay:!0,heartTimeoutReplay:!0,loadingTimeoutReplayTimes:3,heartTimeoutReplayTimes:3,heartTimeoutReplayUseLastFrameShow:!0,replayUseLastFrameShow:!0,replayShowLoadingIcon:!1,supportDblclickFullscreen:!1,showBandwidth:!1,showPerformance:!1,mseCorrectTimeDuration:20,keepScreenOn:!0,isNotMute:!1,hasAudio:!0,hasVideo:!0,operateBtns:{fullscreen:!1,screenshot:!1,play:!1,audio:!1,record:!1,ptz:!1,quality:!1,zoom:!1,close:!1,scale:!1,performance:!1,logSave:!1,aiFace:!1,aiObject:!1,fullscreenFn:null,fullscreenExitFn:null,screenshotFn:null,playFn:null,pauseFn:null,recordFn:null,recordStopFn:null},extendOperateBtns:[],contextmenuBtns:[],watermarkConfig:{},controlAutoHide:!1,hasControl:!1,loadingIcon:!0,loadingIconStyle:{},loadingText:"",background:"",backgroundLoadingShow:!1,loadingBackground:"",loadingBackgroundWidth:0,loadingBackgroundHeight:0,decoder:"decoder-pro.js",decoderAudio:"decoder-pro-audio.js",decoderHard:"decoder-pro-hard.js",wasmMp4RecorderDecoder:"jessibuca-pro-mp4-recorder-decoder.js",decoderWASM:"",isDecoderUseCDN:!1,url:"",rotate:0,mirrorRotate:"none",aspectRatio:"default",playbackConfig:{playList:[],fps:"",showControl:!0,controlType:$.normal,duration:0,startTime:"",showRateBtn:!1,rateConfig:[],showPrecision:"",showPrecisionBtn:!0,isCacheBeforeDecodeForFpsRender:!1,uiUsePlaybackPause:!1,isPlaybackPauseClearCache:!0,isUseFpsRender:!1,isUseLocalCalculateTime:!1,localOneFrameTimestamp:40,supportWheel:!1,useWCS:!1,useMSE:!1},qualityConfig:[],defaultStreamQuality:"",scaleConfig:["拉伸","缩放","正常"],forceNoOffscreen:!0,hiddenAutoPause:!1,protocol:2,demuxType:D,useWasm:!1,useMSE:!1,useWCS:!1,useSIMD:!0,useMThreading:!1,wcsUseVideoRender:!0,wcsUseWebgl2Render:!0,wasmUseVideoRender:!0,mseUseCanvasRender:!1,hlsUseCanvasRender:!1,webrtcUseCanvasRender:!1,useOffscreen:!1,useWebGPU:!1,mseDecodeErrorReplay:!0,wcsDecodeErrorReplay:!0,wasmDecodeErrorReplay:!0,simdDecodeErrorReplay:!0,autoWasm:!0,decoderErrorAutoWasm:!0,hardDecodingNotSupportAutoWasm:!0,webglAlignmentErrorReplay:!0,webglContextLostErrorReplay:!0,openWebglAlignment:!1,syncAudioAndVideo:!1,syncAudioAndVideoDiff:500,playbackDelayTime:1e3,playbackFps:25,playbackForwardMaxRateDecodeIFrame:4,playbackCurrentTimeMove:!0,useVideoRender:!0,useCanvasRender:!1,networkDelayTimeoutReplay:!1,recordType:C,checkFirstIFrame:!0,nakedFlowFps:25,audioEngine:null,isShowRecordingUI:!0,isShowZoomingUI:!0,useFaceDetector:!1,useObjectDetector:!1,ptzClickType:Q,ptzStopEmitDelay:.3,ptzZoomShow:!1,ptzApertureShow:!1,ptzFocusShow:!1,ptzMoreArrowShow:!1,weiXinInAndroidAudioBufferSize:4800,isM7sCrypto:!1,isSm4Crypto:!1,sm4CryptoKey:"",m7sCryptoKey:"",cryptoKey:"",cryptoIV:"",cryptoKeyUrl:"",autoResize:!1,useWebFullScreen:!1,ptsMaxDiff:3600,aiFaceDetectLevel:2,aiFaceDetectWidth:240,aiFaceDetectShowRect:!0,aiFaceDetectInterval:1e3,aiFaceDetectRectConfig:{},aiObjectDetectLevel:2,aiObjectDetectWidth:240,aiObjectDetectShowRect:!0,aiObjectDetectInterval:1e3,aiObjectDetectRectConfig:{},videoRenderSupportScale:!0,mediaSourceTsIsMaxDiffReplay:!0,controlHtml:"",isH265:!1,isWebrtcH265:!1,supportLockScreenPlayAudio:!0,supportHls265:!1,isEmitSEI:!1,pauseAndNextPlayUseLastFrameShow:!1,demuxUseWorker:!0,playFailedAndReplay:!0,videoElementPlayingFailedReplay:!0,mp4RecordUseWasm:!0,mseAutoCleanupSourceBuffer:!0,mseAutoCleanupMaxBackwardDuration:30,mseAutoCleanupMinBackwardDuration:10,isNewMseDecoder:!0,widthOrHeightChangeReplay:!0,simdH264DecodeVideoWidthIsTooLargeReplay:!0,ghostWatermarkConfig:{on:5,off:5,content:"",fontSize:12,color:"white",opacity:.15,speed:.2},dynamicWatermarkConfig:{content:"",speed:.2,fontSize:12,color:"white",opacity:.15},isDropSameTimestampGop:!1,mseDecodeAudio:!1,nakedFlowH265DemuxUseNew:!0},ne="init",se="initVideo",oe="render",ce="playAudio",le="initAudio",ue="audioCode",de="audioNalu",he="audioAACSequenceHeader",fe="videoCode",pe="videoCodec",me="videoNalu",ge="videoPayload",ye="wasmError",ve="workerFetch",be="iframeIntervalTs",Ae="isDropping",ke="workerEnd",_e="playbackStreamVideoFps",we="wasmDecodeVideoNoResponseError",Se="wasmWidthOrHeightChange",Te="simdDecodeError",Ee="simdH264DecodeVideoWidthIsTooLarge",xe="closeEnd",Ce="tempStream",Re="videoSEI",Le="flvScriptData",De="aacSequenceHeader",Ie="videoSequenceHeader",Pe="flvBufferData",Oe="checkFirstIFrame",Be="Invalid NAL unit size",Me=1,Fe=2,Ue=8,je=9,Ne=18,ze="init",Ge="decode",He="audioDecode",Ve="videoDecode",We="close",qe="updateConfig",Ke="clearBuffer",Je="fetchStream",Ye="sendWsMessage",Qe="fetch",Xe="destroy",$e="buffer",Ze="fetchError",et="fetchClose",tt="fetchSuccess",it={fullscreen:"fullscreen$2",webFullscreen:"webFullscreen",decoderWorkerInit:"decoderWorkerInit",play:"play",playing:"playing",pause:"pause",mute:"mute",load:"load",loading:"loading",zooming:"zooming",videoInfo:"videoInfo",timeUpdate:"timeUpdate",audioInfo:"audioInfo",log:"log",error:"error",kBps:"kBps",timeout:"timeout",delayTimeout:"delayTimeout",delayTimeoutRetryEnd:"delayTimeoutRetryEnd",loadingTimeout:"loadingTimeout",loadingTimeoutRetryEnd:"loadingTimeoutRetryEnd",stats:"stats",performance:"performance",videoSmooth:"videoSmooth",faceDetectActive:"faceDetectActive",objectDetectActive:"objectDetectActive",record:"record",recording:"recording",recordingTimestamp:"recordingTimestamp",recordStart:"recordStart",recordEnd:"recordEnd",recordCreateError:"recordCreateError",recordBlob:"recordBlob",buffer:"buffer",videoFrame:"videoFrame",videoSEI:"videoSEI",start:"start",metadata:"metadata",resize:"resize",volumechange:"volumechange",destroy:"destroy",beforeDestroy:"beforeDestroy",streamEnd:"streamEnd",streamRate:"streamRate",streamAbps:"streamAbps",streamVbps:"streamVbps",streamDts:"streamDts",streamSuccess:"streamSuccess",streamMessage:"streamMessage",streamError:"streamError",streamStats:"streamStats",mseSourceOpen:"mseSourceOpen",mseSourceClose:"mseSourceClose",mseSourceended:"mseSourceended",mseSourceBufferError:"mseSourceBufferError",mseAddSourceBufferError:"mseAddSourceBufferError",mseSourceBufferBusy:"mseSourceBufferBusy",mseSourceBufferFull:"mseSourceBufferFull",videoWaiting:"videoWaiting",videoTimeUpdate:"videoTimeUpdate",videoSyncAudio:"videoSyncAudio",playToRenderTimes:"playToRenderTimes",playbackTime:"playbackTime",playbackTimestamp:"playbackTimestamp",playbackTimeScroll:"playbackTimeScroll",playbackPrecision:"playbackPrecision",playbackShowPrecisionChange:"playbackShowPrecisionChange",playbackJustTime:"playbackJustTime",playbackStats:"playbackStats",playbackSeek:"playbackSeek",playbackPause:"playbackPause",playbackPauseOrResume:"playbackPauseOrResume",playbackRateChange:"playbackRateChange",playbackPreRateChange:"playbackPreRateChange",ptz:"ptz",streamQualityChange:"streamQualityChange",visibilityChange:"visibilityChange",netBuf:"netBuf",close:"close",networkDelayTimeout:"networkDelayTimeout",togglePerformancePanel:"togglePerformancePanel",viewResizeChange:"viewResizeChange",flvDemuxBufferSizeTooLarge:"flvDemuxBufferSizeTooLarge",talkGetUserMediaSuccess:"talkGetUserMediaSuccess",talkGetUserMediaFail:"talkGetUserMediaFail",talkGetUserMediaTimeout:"talkGetUserMediaTimeout",talkStreamStart:"talkStreamStart",talkStreamOpen:"talkStreamOpen",talkStreamClose:"talkStreamClose",talkStreamError:"talkStreamError",talkStreamInactive:"talkStreamInactive",webrtcDisconnect:"webrtcDisconnect",webrtcFailed:"webrtcFailed",webrtcClosed:"webrtcClosed",webrtcOnConnectionStateChange:"webrtcOnConnectionStateChange",webrtcOnIceConnectionStateChange:"webrtcOnIceConnectionStateChange",crashLog:"crashLog",focus:"focus",blur:"blur",visibilityHiddenTimeout:"visibilityHiddenTimeout",websocketOpen:"websocketOpen",websocketClose:"websocketClose",websocketError:"websocketError",websocketMessage:"websocketMessage",aiObjectDetectorInfo:"aiObjectDetectorInfo",aiFaceDetectorInfo:"aiFaceDetectorInfo",playFailedAndPaused:"playFailedAndPaused",audioResumeState:"audioResumeState",webrtcStreamH265:"webrtcStreamH265",flvMetaData:"flvMetaData",talkFailedAndStop:"talkFailedAndStop",removeLoadingBgImage:"removeLoadingBgImage",memoryLog:"memoryLog",downloadMemoryLog:"downloadMemoryLog",pressureObserverCpu:"pressureObserverCpu",currentPts:"currentPts"},rt={load:it.load,timeUpdate:it.timeUpdate,videoInfo:it.videoInfo,audioInfo:it.audioInfo,error:it.error,kBps:it.kBps,start:it.start,timeout:it.timeout,loadingTimeout:it.loadingTimeout,loadingTimeoutRetryEnd:it.loadingTimeoutRetryEnd,delayTimeout:it.delayTimeout,delayTimeoutRetryEnd:it.delayTimeoutRetryEnd,fullscreen:"fullscreen",multiFullscreen:"multiFullscreen",webFullscreen:it.webFullscreen,play:it.play,pause:it.pause,mute:it.mute,stats:it.stats,performance:it.performance,recordingTimestamp:it.recordingTimestamp,recordStart:it.recordStart,recordCreateError:it.recordCreateError,recordEnd:it.recordEnd,recordBlob:it.recordBlob,playToRenderTimes:it.playToRenderTimes,playbackSeek:it.playbackSeek,playbackStats:it.playbackStats,playbackTimestamp:it.playbackTimestamp,playbackPauseOrResume:it.playbackPauseOrResume,playbackPreRateChange:it.playbackPreRateChange,playbackRateChange:it.playbackRateChange,playbackShowPrecisionChange:it.playbackShowPrecisionChange,ptz:it.ptz,streamQualityChange:it.streamQualityChange,zooming:it.zooming,crashLog:it.crashLog,focus:it.focus,blur:it.blur,visibilityHiddenTimeout:it.visibilityHiddenTimeout,visibilityChange:it.visibilityChange,websocketOpen:it.websocketOpen,websocketClose:it.websocketClose,networkDelayTimeout:it.networkDelayTimeout,aiObjectDetectorInfo:it.aiObjectDetectorInfo,aiFaceDetectorInfo:it.aiFaceDetectorInfo,playFailedAndPaused:it.playFailedAndPaused,streamEnd:it.streamEnd,audioResumeState:it.audioResumeState,videoSEI:it.videoSEI,flvMetaData:it.flvMetaData,webrtcOnConnectionStateChange:it.webrtcOnConnectionStateChange,webrtcOnIceConnectionStateChange:it.webrtcOnIceConnectionStateChange,currentPts:it.currentPts,videoSmooth:it.videoSmooth},at={talkStreamClose:it.talkStreamClose,talkStreamError:it.talkStreamError,talkStreamInactive:it.talkStreamInactive,talkGetUserMediaTimeout:it.talkGetUserMediaTimeout,talkFailedAndStop:it.talkFailedAndStop},nt={playError:"playIsNotPauseOrUrlIsNull",fetchError:"fetchError",websocketError:"websocketError",webcodecsH265NotSupport:"webcodecsH265NotSupport",webcodecsDecodeError:"webcodecsDecodeError",webcodecsUnsupportedConfigurationError:"webcodecsUnsupportedConfigurationError",webcodecsDecodeConfigureError:"webcodecsDecodeConfigureError",mediaSourceH265NotSupport:"mediaSourceH265NotSupport",mediaSourceAudioG711NotSupport:"mediaSourceAudioG711NotSupport",mediaSourceDecoderConfigurationError:"mediaSourceDecoderConfigurationError",mediaSourceFull:it.mseSourceBufferFull,mseSourceBufferError:it.mseSourceBufferError,mseAddSourceBufferError:it.mseAddSourceBufferError,mediaSourceAppendBufferError:"mediaSourceAppendBufferError",mediaSourceTsIsMaxDiff:"mediaSourceTsIsMaxDiff",mediaSourceUseCanvasRenderPlayFailed:"mediaSourceUseCanvasRenderPlayFailed",wasmDecodeError:"wasmDecodeError",wasmUseVideoRenderError:"wasmUseVideoRenderError",hlsError:"hlsError",hlsV2Mp4NotSupport:"hlsV2Mp4NotSupport",webrtcError:"webrtcError",webrtcClosed:it.webrtcClosed,webrtcIceCandidateError:"webrtcIceCandidateError",webglAlignmentError:"webglAlignmentError",wasmWidthOrHeightChange:"wasmWidthOrHeightChange",mseWidthOrHeightChange:"mseWidthOrHeightChange",wcsWidthOrHeightChange:"wcsWidthOrHeightChange",widthOrHeightChange:"widthOrHeightChange",tallWebsocketClosedByError:"tallWebsocketClosedByError",flvDemuxBufferSizeTooLarge:it.flvDemuxBufferSizeTooLarge,wasmDecodeVideoNoResponseError:"wasmDecodeVideoNoResponseError",audioChannelError:"audioChannelError",simdH264DecodeVideoWidthIsTooLarge:"simdH264DecodeVideoWidthIsTooLarge",simdDecodeError:"simdDecodeError",webglContextLostError:"webglContextLostError",videoElementPlayingFailed:"videoElementPlayingFailed",videoElementPlayingFailedForWebrtc:"videoElementPlayingFailedForWebrtc",decoderWorkerInitError:"decoderWorkerInitError",videoInfoError:"videoInfoError",videoCodecIdError:"videoCodecIdError",streamEnd:it.streamEnd,delayTimeout:it.delayTimeout,loadingTimeout:it.loadingTimeout,networkDelayTimeout:it.networkDelayTimeout,talkStreamError:it.talkStreamError,talkStreamClose:it.talkStreamClose},st="notConnect",ot="open",ct="close",lt="error",ut={download:"download",base64:"base64",blob:"blob"},dt="download",ht="blob",ft={7:"H264(AVC)",12:"H265(HEVC)",99:"MPEG4"},pt=7,mt=12,gt="H264(AVC)",yt="H265(HEVC)",vt=10,bt=2,At={AAC:"AAC",ALAW:"ALAW(g711a)",MULAW:"MULAW(g711u)",MP3:"MP3"},kt={10:"AAC",7:"ALAW",8:"MULAW",2:"MP3"},_t=7,wt=8,St=5,Tt=6,Et=19,xt=20,Ct=32,Rt=33,Lt=34,Dt=39,It=39,Pt=40,Ot=38,Bt=48,Mt=0,Ft=1,Ut=2,jt="webcodecs",Nt="webgl",zt="webgl2",Gt="webgpu",Ht="offscreen",Vt="mse",Wt="hls",qt="webrtc",Kt="key",Jt="delta",Yt='video/mp4; codecs="avc1.64002A"',Qt='video/mp4; codecs="hev1.1.6.L123.b0"',Xt="ended",$t="open",Zt="closed",ei=27,ti=38,ii=40,ri="oneHour",ai="halfHour",ni="tenMin",si="fiveMin",oi={oneHour:"one-hour",halfHour:"half-hour",tenMin:"ten-min",fiveMin:"five-min"},ci=["oneHour","halfHour","tenMin","fiveMin"],li=["up","right","down","left","left-up","right-up","left-down","right-down"],ui="stop",di="fiStop",hi="zoomExpand",fi="zoomNarrow",pi="apertureFar",mi="apertureNear",gi="focusFar",yi="focusNear",vi="g711a",bi="g711u",Ai="pcm",ki="opus",_i={png:"image/png",jpeg:"image/jpeg",webp:"image/webp"},wi="sourceclose",Si="sourceopen",Ti="sourceended",Ei="canplay",xi="waiting",Ci="timeupdate",Ri="ratechange",Li="hevc",Di="A key frame is required after configure() or flush()",Ii="Cannot call 'decode' on a closed codec",Pi="Unsupported configuration",Oi="Decoder failure",Bi="Decoding error",Mi="Decoder error",Fi="HEVC decoding is not supported",Ui="loading",ji="playing",Ni="paused",zi="destroy",Gi=0,Hi=1,Vi=8,Wi=0,qi=98,Ki="empty",Ji="rtp",Yi="tcp",Qi="open",Xi="close",$i="error",Zi="message",er="worklet",tr="script",ir={encType:vi,packetType:Ji,packetTcpSendType:Yi,rtpSsrc:"0000000000",numberChannels:1,sampleRate:8e3,sampleBitsWidth:16,sendInterval:20,debug:!1,debugLevel:Y,testMicrophone:!1,saveRtpToFile:!1,audioBufferLength:160,engine:er,checkGetUserMediaTimeout:!1,getUserMediaTimeout:1e4,audioConstraints:{latency:!0,noiseSuppression:!0,autoGainControl:!0,echoCancellation:!0,sampleRate:48e3,channelCount:1}},rr="worklet",ar="script",nr="active",sr={name:"",index:0,icon:"",iconHover:"",iconTitle:"",activeIcon:"",activeIconHover:"",activeIconTitle:"",click:null,activeClick:null},or={content:"",click:null,index:0},cr=1,lr="subtitle-segments",ur="hls-manifest-loaded",dr="hls-level-loaded",hr="demuxed-track",fr="flv-script-data",pr="metadata-parsed",mr="ttfb",gr="load-retry",yr="load-start",vr="speed",br="load-complete",Ar="load-response-headers",kr="sei",_r="sei-in-time",wr="switch-url-failed",Sr="switch-url-success",Tr="subtitle-playlist",Er="stream-parsed",xr="error",Cr=[0,160,240,320,480,640],Rr=[0,160,240,320,480,640],Lr=["轻松","正常","较高","高"],Dr={1:"MEDIA_ERR_ABORTED",2:"MEDIA_ERR_NETWORK",3:"MEDIA_ERR_DECODE",4:"MEDIA_ERR_SRC_NOT_SUPPORTED"},Ir=Object(S["a"])((function e(t){Object(T["a"])(this,e),this.log=function(e){if(t._opt.debug&&t._opt.debugLevel==J){for(var i,r=t._opt.debugUuid?"[".concat(t._opt.debugUuid,"]"):"",a=arguments.length,n=new Array(a>1?a-1:0),s=1;s<a;s++)n[s-1]=arguments[s];(i=console).log.apply(i,["JbPro".concat(r,"[✅✅✅][").concat(e,"]")].concat(n))}},this.warn=function(e){if(t._opt.debug&&(t._opt.debugLevel==J||t._opt.debugLevel==Y)){for(var i,r=t._opt.debugUuid?"[".concat(t._opt.debugUuid,"]"):"",a=arguments.length,n=new Array(a>1?a-1:0),s=1;s<a;s++)n[s-1]=arguments[s];(i=console).log.apply(i,["JbPro".concat(r,"[❗❗❗][").concat(e,"]")].concat(n))}},this.error=function(e){for(var i,r=t._opt.debugUuid?"[".concat(t._opt.debugUuid,"]"):"",a=arguments.length,n=new Array(a>1?a-1:0),s=1;s<a;s++)n[s-1]=arguments[s];(i=console).error.apply(i,["JbPro".concat(r,"[❌❌❌][").concat(e,"]")].concat(n))}})),Pr=("undefined"===typeof globalThis?"undefined":Object(E["a"])(globalThis))<"u"?globalThis:("undefined"===typeof window?"undefined":Object(E["a"])(window))<"u"?window:("undefined"===typeof global?"undefined":Object(E["a"])(global))<"u"?global:("undefined"===typeof self?"undefined":Object(E["a"])(self))<"u"?self:{};function Or(e,t){return e(t={exports:{}},t.exports),t.exports}var Br=Or((function(e){(function(){var t=("undefined"===typeof window?"undefined":Object(E["a"])(window))<"u"&&void 0!==window.document?window.document:{},i=e.exports,r=function(){for(var e,i=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],r=0,a=i.length,n={};r<a;r++)if((e=i[r])&&e[1]in t){for(r=0;r<e.length;r++)n[i[0][r]]=e[r];return n}return!1}(),a={change:r.fullscreenchange,error:r.fullscreenerror},n={request:function(e,i){return new Promise(function(a,n){var s=function(){this.off("change",s),a()}.bind(this);this.on("change",s);var o=(e=e||t.documentElement)[r.requestFullscreen](i);o instanceof Promise&&o.then(s)["catch"](n)}.bind(this))},exit:function(){return new Promise(function(e,i){if(this.isFullscreen){var a=function(){this.off("change",a),e()}.bind(this);this.on("change",a);var n=t[r.exitFullscreen]();n instanceof Promise&&n.then(a)["catch"](i)}else e()}.bind(this))},toggle:function(e,t){return this.isFullscreen?this.exit():this.request(e,t)},onchange:function(e){this.on("change",e)},onerror:function(e){this.on("error",e)},on:function(e,i){var r=a[e];r&&t.addEventListener(r,i,!1)},off:function(e,i){var r=a[e];r&&t.removeEventListener(r,i,!1)},raw:r};r?(Object.defineProperties(n,{isFullscreen:{get:function(){return!!t[r.fullscreenElement]}},element:{enumerable:!0,get:function(){return t[r.fullscreenElement]}},isEnabled:{enumerable:!0,get:function(){return!!t[r.fullscreenEnabled]}}}),i?e.exports=n:window.screenfull=n):i?e.exports={isEnabled:!1}:window.screenfull={isEnabled:!1}})()}));function Mr(e){var t=e.profile,i=e.sampleRate,r=e.channel;return new Uint8Array([175,0,t<<3|(14&i)>>1,(1&i)<<7|r<<3])}function Fr(e){return Ur(e)&&e[1]===Gi}function Ur(e){return e[0]>>4===vt}Br.isEnabled;var jr=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Nr=jr;function zr(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])}}function Gr(e){return 1024*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4)/e}var Hr=function(){function e(t){Object(T["a"])(this,e),this.buffer=t,this.buflen=t.length,this.bufpos=0,this.bufoff=0,this.iserro=!1}return Object(S["a"])(e,[{key:"read",value:function(e){for(var t=0,i=0;e;){if(e<0||this.bufpos>=this.buflen)return this.iserro=!0,0;this.iserro=!1,i=this.bufoff+e>8?8-this.bufoff:e,t<<=i,t+=this.buffer[this.bufpos]>>8-this.bufoff-i&255>>8-i,this.bufoff+=i,e-=i,8==this.bufoff&&(this.bufpos++,this.bufoff=0)}return t}},{key:"look",value:function(e){var t=this.bufpos,i=this.bufoff,r=this.read(e);return this.bufpos=t,this.bufoff=i,r}},{key:"read_golomb",value:function(){var e;for(e=0;0==this.read(1)&&!this.iserro;e++);return(1<<e)+this.read(e)-1}}]),e}();function Vr(e){var t=e.read(5);return 31===t&&(t=e.read(6)+32),t}function Wr(e,t){return t.sampling_index=e.read(4),15==t.sampling_index?e.read(24):qr[t.sampling_index]}var qr=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350,0,0,0],Kr=[0,1,2,3,4,5,6,8];function Jr(){}function Yr(e){for(var t=null,i=["webgl","experimental-webgl","moz-webgl","webkit-3d"],r=0;!t&&r<i.length;){var a=i[r];try{var n={preserveDrawingBuffer:!0};t=e.getContext(a,n)}catch(n){console.error(n),t=null}t&&"function"==typeof t.getParameter||(t=null),++r}return t}function Qr(e){var t=null;return t=e.getContext("webgl2"),t}function Xr(){for(var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(","),t=atob(e[1]),i=e[0].replace("data:","").replace(";base64",""),r=t.length,a=new Uint8Array(r);r--;)a[r]=t.charCodeAt(r);return new File([a],"file",{type:i})}function $r(){return(new Date).getTime()}function Zr(e,t,i){return Math.max(Math.min(e,Math.max(t,i)),Math.min(t,i))}function ea(e,t,i){if(e)return"object"==Object(E["a"])(t)&&Object.keys(t).forEach((function(i){ea(e,i,t[i])})),e.style[t]=i,e}function ta(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e)return 0;var r=getComputedStyle(e,null).getPropertyValue(t);return i?parseFloat(r):r}function ia(){return performance&&"function"==typeof performance.now?performance.now():Date.now()}function ra(e){var t=0,i=ia();return function(r){if(ya(r)){t+=r;var a=ia(),n=a-i;n>=1e3&&(e(t/n*1e3),i=a,t=0)}}}(function(){try{if("object"==("undefined"===typeof WebAssembly?"undefined":Object(E["a"])(WebAssembly))&&"function"==typeof WebAssembly.instantiate){var e=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(e instanceof WebAssembly.Module)new WebAssembly.Instance(e),WebAssembly.Instance}}catch(t){}})();var aa='"11-28-2023"';function na(){return/iphone|ipod|android.*mobile|windows.*phone|blackberry.*mobile/i.test(window.navigator.userAgent.toLowerCase())}function sa(){return!(na()||/ipad|android(?!.*mobile)|tablet|kindle|silk/i.test(window.navigator.userAgent.toLowerCase()))}function oa(){var e=window.navigator.userAgent.toLowerCase();return/android/i.test(e)}function ca(){var e=window.navigator.userAgent.toLowerCase()||"",t={type:"",version:""},i={IE:window.ActiveXObject||"ActiveXObject"in window,Chrome:e.indexOf("chrome")>-1&&e.indexOf("safari")>-1,Firefox:e.indexOf("firefox")>-1,Opera:e.indexOf("opera")>-1,Safari:e.indexOf("safari")>-1&&-1==e.indexOf("chrome"),Edge:e.indexOf("edge")>-1,QQBrowser:/qqbrowser/.test(e),WeixinBrowser:/MicroMessenger/i.test(e)};for(var r in i)if(i[r]){var a="";if("IE"===r){var n=e.match(/(msie\s|trident.*rv:)([\w.]+)/);n&&n.length>2&&(a=e.match(/(msie\s|trident.*rv:)([\w.]+)/)[2])}else if("Chrome"===r){for(var s in navigator.mimeTypes)"application/360softmgrplugin"===navigator.mimeTypes[s].type&&(r="360");var o=e.match(/chrome\/([\d.]+)/);o&&o.length>1&&(a=o[1])}else if("Firefox"===r){var c=e.match(/firefox\/([\d.]+)/);c&&c.length>1&&(a=c[1])}else if("Opera"===r){var l=e.match(/opera\/([\d.]+)/);l&&l.length>1&&(a=l[1])}else if("Safari"===r){var u=e.match(/version\/([\d.]+)/);u&&u.length>1&&(a=u[1])}else if("Edge"===r){var d=e.match(/edge\/([\d.]+)/);d&&d.length>1&&(a=d[1])}else if("QQBrowser"===r){var h=e.match(/qqbrowser\/([\d.]+)/);h&&h.length>1&&(a=h[1])}t.type=r,t.version=parseInt(a)}return t}function la(){var e=window.navigator.userAgent.toLowerCase();return e&&/iphone|ipad|ipod|ios/.test(e)}function ua(){var e=window.navigator.userAgent;return!e.match(/Chrome/gi)&&!!e.match(/Safari/gi)}function da(e,t){if(0===arguments.length)return null;var i,r=t||"{y}-{m}-{d} {h}:{i}:{s}";"object"==Object(E["a"])(e)?i=e:(10===(""+e).length&&(e=1e3*parseInt(e)),e=+e,i=new Date(e));var a={y:i.getFullYear(),m:i.getMonth()+1,d:i.getDate(),h:i.getHours(),i:i.getMinutes(),s:i.getSeconds(),a:i.getDay()},n=r.replace(/{(y|m|d|h|i|s|a)+}/g,(function(e,t){var i=a[t];return"a"===t?["一","二","三","四","五","六","日"][i-1]:(e.length>0&&i<10&&(i="0"+i),i||0)}));return n}function ha(){return"VideoFrame"in window}function fa(e){if("string"!=typeof e)return e;var t=Number(e);return isNaN(t)?e:t}function pa(){return"xxxxxxxxxxxx4xxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))}function ma(e,t){var i,r,a=!1;return function n(){for(var s=arguments.length,o=new Array(s),c=0;c<s;c++)o[c]=arguments[c];if(a)return i=o,void(r=this);a=!0,e.apply(this,o),setTimeout((function(){a=!1,i&&(n.apply(r,i),i=null,r=null)}),t)}}function ga(e){if(null==e||""==e)return"0 Bytes";var t=new Array("Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"),i=0,r=parseFloat(e);i=Math.floor(Math.log(r)/Math.log(1024));var a=r/Math.pow(1024,i);return(a=a.toFixed(2))+t[i]}function ya(e){return"[object Number]"===Object.prototype.toString.call(e)}function va(){var e=!1;return"MediaSource"in window&&window.MediaSource.isTypeSupported(Qt)&&(e=!0),e}function ba(){var e=ca();return"chrome"===e.type.toLowerCase()&&e.version>=107}function Aa(){var e=!1;return"MediaStreamTrackGenerator"in window&&(e=!0),e}function ka(){var e=!1;return"MediaStream"in window&&(e=!0),e}function _a(e,t){var i=window.URL.createObjectURL(t),r=window.document.createElement("a");r.download=e,r.href=i;var a=window.document.createEvent("MouseEvents");a.initEvent("click",!0,!0),r.dispatchEvent(a),setTimeout((function(){window.URL.revokeObjectURL(i)}),la()?1e3:0)}function wa(e){return null==e}function Sa(e){return!0===e||!1===e}function Ta(e){return!wa(e)}function Ea(e){var t={left:"",right:"",top:"",bottom:"",opacity:1,backgroundColor:"",image:{src:"",width:"100",height:"60"},text:{content:"",fontSize:"14",color:"#000",width:"",height:""},rect:{color:"green",lineWidth:2,width:"",height:""},html:""},i=Object.assign(t.image,e.image||{}),r=Object.assign(t.text,e.text||{});return t=Object.assign(t,e,{image:i,text:r}),t}function xa(e,t){var i={container:e||"",text:"",opacity:"",angle:"",color:"",fontSize:"",fontFamily:""};return i=Object.assign(i,t),{watermark_parent_node:i.container,watermark_alpha:i.opacity,watermark_angle:i.angle,watermark_fontsize:i.fontSize,watermark_color:i.color,watermark_font:i.fontFamily,watermark_txt:i.text}}function Ca(e,t){return new Promise((function(i,r){var a=Ea(t);if(!a.image.src&&!a.text.content)return i(e);var n=document.createElement("canvas");n.width=t.width,n.height=t.height;var s=n.getContext("2d"),o=0,c=0;ya(a.left)?o=a.left:ya(a.right)&&(o=n.width-a.right),ya(a.top)?c=a.top:ya(a.bottom)&&(c=n.height-a.bottom);var l=new Image;l.src=e,l.onload=function(){if(s.drawImage(l,0,0),a.image&&a.image.src){var e=new Image;e.src=a.image.src,e.setAttribute("crossOrigin","Anonymous"),e.onload=function(){o-=a.image.width,s.drawImage(e,o,c,a.image.width,a.image.height),i(n.toDataURL(t.format,t.quality))},e.onerror=function(e){r()}}else a.text&&a.text.content&&(s.font=a.text.fontSize+"px 宋体",s.fillStyle=a.text.color,s.textAlign="right",s.fillText(a.text.content,o,c),i(n.toDataURL(t.format,t.quality)))},l.onerror=function(e){r(e)}}))}function Ra(e){var t;if(e>-1){var i=Math.floor(e/3600),r=Math.floor(e/60)%60,a=e%60;t=i<10?"0"+i+":":i+":",r<10&&(t+="0"),t+=r+":",(a=Math.round(a))<10&&(t+="0"),t+=a.toFixed(0)}return t}function La(e,t){var i="";if(e>-1){var r=Math.floor(e/60)%60,a=e%60;a=Math.round(a),i=r<10?"0"+r+":":r+":",a<10&&(i+="0"),i+=a,wa(t)||(t<10&&(t="0"+t),i+=":"+t)}return i}function Da(e){var t="";if(e>-1){var i=Math.floor(e/60/60)%60,r=Math.floor(e/60)%60,a=e%60;r=Math.round(r),t=i<10?"0"+i+":":i+":",r<10&&(t+="0"),t+=r+":",a<10&&(t+="0"),t+=a}return t}function Ia(e,t){var i=Math.floor(t/60)%60,r=Math.floor(t%60);return new Date(e).setHours(i,r,0,0)}function Pa(e,t){var i=Math.floor(t/60/60)%60,r=Math.floor(t/60)%60,a=t%60;return new Date(e).setHours(i,r,a,0)}function Oa(e){return(""+e).length}function Ba(e){return!function(e){return e&&0===Object.keys(e).length}(e)}function Ma(e){return"string"==typeof e}var Fa=function(){var e=window.navigator.userAgent;return/MicroMessenger/i.test(e)},Ua=function(){var e=window.navigator.userAgent;return/Chrome/i.test(e)};function ja(e){var t=e||window.event;return t.target||t.srcElement}function Na(){return function(){var e=window.navigator.userAgent.toLowerCase();return/firefox/i.test(e)}()&&function(){var e=navigator.userAgent.toLowerCase();return/macintosh|mac os x/i.test(e)}()}function za(e){return"function"==typeof e}function Ga(e){if(na()){var t=0,i=0;if(1===e.touches.length){var r=e.touches[0];t=r.clientX,i=r.clientY}return{posX:t,posY:i}}var a=0,n=0,s=e||window.event;return s.pageX||s.pageY?(a=s.pageX,n=s.pageY):(s.clientX||s.clientY)&&(a=e.clientX+document.documentElement.scrollLeft+document.body.scrollLeft,n=e.clientY+document.documentElement.scrollTop+document.body.scrollTop),{posX:a,posY:n}}function Ha(){var e=document.createElement("video"),t=e.canPlayType("application/vnd.apple.mpegurl");return e=null,t}function Va(e){return an(e.hasAudio)&&(e.useMSE||e.useWCS&&!e.useOffscreen)&&an(e.demuxUseWorker)}function Wa(e){var t=e.toString().trim().match(/^function\s*\w*\s*\([\w\s,]*\)\s*{([\w\W]*?)}$/)[1],i=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(i)}function qa(e){e.close()}function Ka(){return"https:"===window.location.protocol||"localhost"===window.location.hostname}function Ja(e){var t=Object.prototype.toString;return function(e){switch(t.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:try{return e instanceof Error}catch(i){return!1}}}(e)?e.message:null==e?"":"object"==Object(E["a"])(e)?JSON.stringify(e,null,2):String(e)}function Ya(e,t){t&&(e=e.filter((function(e){return e.type&&e.type===t})));var i=e[0],r=null,a=1;if(e.length>0){var n=e[1];n&&n.ts-i.ts>1e5&&(i=n,a=2)}if(i)for(var s=a;s<e.length;s++){var o=e[s];t&&o.type&&o.type!==t&&(o=null),o&&o.ts-i.ts>=1e3&&e[s-1].ts-i.ts<1e3&&(r=s+1)}return r}function Qa(e){for(var t=(e+"=".repeat((4-e.length%4)%4)).replace(/\-/g,"+").replace(/_/g,"/"),i=window.atob(t),r=new Uint8Array(i.length),a=0;a<i.length;++a)r[a]=i.charCodeAt(a);return r}function Xa(e){var t=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a"),r=e;return t&&(i.setAttribute("href",r),r=i.href),i.setAttribute("href",r),{origin:i.origin,href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname}}function $a(e){var t="";if("object"==Object(E["a"])(e))try{t=JSON.stringify(e),t=JSON.parse(t)}catch(i){t=e}else t=e;return t}function Za(){return $a(re)}function en(){return $a(ae)}function tn(e){return e[0]>>4===Hi&&e[1]===Gi}function rn(e){return!0===e||"true"===e}function an(e){return!0!==e&&"true"!==e}function nn(e){return e.replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()}))}function sn(){return/iphone/i.test(navigator.userAgent)}function on(){return window.performance&&window.performance.memory?window.performance.memory:null}function cn(){try{var e=document.createElement("canvas");return!(!window.WebGL2RenderingContext||!e.getContext("webgl2"))}catch(t){return!1}}function ln(e){return e.trim().match(/^function\s*\w*\s*\([\w\s,]*\)\s*{([\w\W]*?)}$/)[1]}function un(){var e=!1;return"requestVideoFrameCallback"in HTMLVideoElement.prototype&&(e=!0),e}function dn(){var e=!1;return"PressureObserver"in window&&(e=!0),e}var hn=function(){function e(t){Object(T["a"])(this,e),this.destroys=[],this.proxy=this.proxy.bind(this),this.master=t}return Object(S["a"])(e,[{key:"proxy",value:function(e,t,i){var r=this,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(e){if(Array.isArray(t))return t.map((function(t){return r.proxy(e,t,i,a)}));e.addEventListener(t,i,a);var n=function(){za(e.removeEventListener)&&e.removeEventListener(t,i,a)};return this.destroys.push(n),n}}},{key:"destroy",value:function(){this.master.debug&&this.master.debug.log("Events","destroy"),this.destroys.forEach((function(e){return e()})),this.destroys=[]}}]),e}(),fn=function(){function e(){Object(T["a"])(this,e)}return Object(S["a"])(e,[{key:"on",value:function(e,t,i){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:i}),this}},{key:"once",value:function(e,t,i){var r=this;function a(){r.off(e,a);for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];t.apply(i,s)}return a._=t,this.on(e,a,i)}},{key:"emit",value:function(e){for(var t=((this.e||(this.e={}))[e]||[]).slice(),i=arguments.length,r=new Array(i>1?i-1:0),a=1;a<i;a++)r[a-1]=arguments[a];for(var n=0;n<t.length;n+=1)t[n].fn.apply(t[n].ctx,r);return this}},{key:"off",value:function(e,t){var i=this.e||(this.e={});if(!e)return Object.keys(i).forEach((function(e){delete i[e]})),void delete this.e;var r=i[e],a=[];if(r&&t)for(var n=0,s=r.length;n<s;n+=1)r[n].fn!==t&&r[n].fn._!==t&&a.push(r[n]);return a.length?i[e]=a:delete i[e],this}}]),e}(),pn=1e-6,mn=("undefined"===typeof Float32Array?"undefined":Object(E["a"])(Float32Array))<"u"?Float32Array:Array;function gn(){var e=new mn(16);return mn!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function yn(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var vn,bn=function(e,t,i,r,a,n,s){var o=1/(t-i),c=1/(r-a),l=1/(n-s);return e[0]=-2*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*l,e[11]=0,e[12]=(t+i)*o,e[13]=(a+r)*c,e[14]=(s+n)*l,e[15]=1,e};function An(e,t,i){var r=new mn(3);return r[0]=e,r[1]=t,r[2]=i,r}vn=new mn(3),mn!=Float32Array&&(vn[0]=0,vn[1]=0,vn[2]=0);var kn=function(){function e(t,i){Object(T["a"])(this,e),this.gl=t,i&&this.gl.pixelStorei(this.gl.UNPACK_ALIGNMENT,1);var r=this._initShaderProgram();this._programInfo={program:r,attribLocations:{vertexPosition:t.getAttribLocation(r,"aVertexPosition"),texturePosition:t.getAttribLocation(r,"aTexturePosition")},uniformLocations:{projectionMatrix:t.getUniformLocation(r,"uProjectionMatrix"),modelMatrix:t.getUniformLocation(r,"uModelMatrix"),viewMatrix:t.getUniformLocation(r,"uViewMatrix"),rgbatexture:t.getUniformLocation(r,"rgbaTexture"),ytexture:t.getUniformLocation(r,"yTexture"),utexture:t.getUniformLocation(r,"uTexture"),vtexture:t.getUniformLocation(r,"vTexture"),isyuv:t.getUniformLocation(r,"isyuv")}},this._buffers=this._initBuffers(),this._rgbatexture=this._createTexture(),this._ytexture=this._createTexture(),this._utexture=this._createTexture(),this._vtexture=this._createTexture()}return Object(S["a"])(e,[{key:"destroy",value:function(){this.gl.deleteProgram(this._programInfo.program),this.gl.deleteBuffer(this._buffers.position),this.gl.deleteBuffer(this._buffers.texPosition),this.gl.deleteBuffer(this._buffers.indices),this.gl.deleteTexture(this._rgbatexture),this.gl.deleteTexture(this._ytexture),this.gl.deleteTexture(this._utexture),this.gl.deleteTexture(this._vtexture),this._programInfo=null,this._buffers=null,this._rgbatexture=null,this._ytexture=null,this._utexture=null,this._vtexture=null}},{key:"_initShaderProgram",value:function(){var e=this._loadShader(this.gl.VERTEX_SHADER,"\n attribute vec4 aVertexPosition;\n attribute vec2 aTexturePosition;\n varying lowp vec2 vTexturePosition;\n void main(void) {\n gl_Position = aVertexPosition;\n vTexturePosition = aTexturePosition;\n }\n "),t=this._loadShader(this.gl.FRAGMENT_SHADER,"\n precision highp float;\n varying highp vec2 vTexturePosition;\n uniform int isyuv;\n uniform sampler2D rgbaTexture;\n uniform sampler2D yTexture;\n uniform sampler2D uTexture;\n uniform sampler2D vTexture;\n\n const mat4 YUV2RGB = mat4( 1.1643828125, 0, 1.59602734375, -.87078515625,\n 1.1643828125, -.39176171875, -.81296875, .52959375,\n 1.1643828125, 2.017234375, 0, -1.081390625,\n 0, 0, 0, 1);\n\n\n void main(void) {\n\n if (isyuv>0) {\n\n highp float y = texture2D(yTexture, vTexturePosition).r;\n highp float u = texture2D(uTexture, vTexturePosition).r;\n highp float v = texture2D(vTexture, vTexturePosition).r;\n gl_FragColor = vec4(y, u, v, 1) * YUV2RGB;\n\n } else {\n gl_FragColor = texture2D(rgbaTexture, vTexturePosition);\n }\n }\n "),i=this.gl.createProgram();return this.gl.attachShader(i,e),this.gl.attachShader(i,t),this.gl.linkProgram(i),this.gl.getProgramParameter(i,this.gl.LINK_STATUS)?i:(console.log("Unable to initialize the shader program: "+this.gl.getProgramInfoLog(i)),null)}},{key:"_loadShader",value:function(e,t){var i=this.gl,r=i.createShader(e);return i.shaderSource(r,t),i.compileShader(r),i.getShaderParameter(r,i.COMPILE_STATUS)?r:(console.log("An error occurred compiling the shaders: "+i.getShaderInfoLog(r)),i.deleteShader(r),null)}},{key:"_initBuffers",value:function(){var e=this.gl,t=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,t);var i=[-1,-1,1,-1,1,1,-1,1];e.bufferData(e.ARRAY_BUFFER,new Float32Array(i),e.STATIC_DRAW);var r=[];r=r.concat([0,1],[1,1],[1,0],[0,0]);var a=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,a),e.bufferData(e.ARRAY_BUFFER,new Float32Array(r),e.STATIC_DRAW);var n=e.createBuffer();return e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n),e.bufferData(e.ELEMENT_ARRAY_BUFFER,new Uint16Array([0,1,2,0,2,3]),e.STATIC_DRAW),{positions:i,position:t,texPosition:a,indices:n}}},{key:"_createTexture",value:function(){var e=this.gl.createTexture();return this.gl.bindTexture(this.gl.TEXTURE_2D,e),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MAG_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_MIN_FILTER,this.gl.LINEAR),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,this.gl.CLAMP_TO_EDGE),this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,this.gl.CLAMP_TO_EDGE),e}},{key:"_drawScene",value:function(e,t,i){this.gl.viewport(0,0,e,t),this.gl.enable(this.gl.BLEND),this.gl.blendFunc(this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this._buffers.position),this.gl.bufferData(this.gl.ARRAY_BUFFER,new Float32Array(this._buffers.positions),this.gl.STATIC_DRAW),this.gl.vertexAttribPointer(this._programInfo.attribLocations.vertexPosition,2,this.gl.FLOAT,!1,0,0),this.gl.enableVertexAttribArray(this._programInfo.attribLocations.vertexPosition),this.gl.bindBuffer(this.gl.ARRAY_BUFFER,this._buffers.texPosition),this.gl.vertexAttribPointer(this._programInfo.attribLocations.texturePosition,2,this.gl.FLOAT,!1,0,0),this.gl.enableVertexAttribArray(this._programInfo.attribLocations.texturePosition),this.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER,this._buffers.indices),i?(this.gl.activeTexture(this.gl.TEXTURE0+3),this.gl.bindTexture(this.gl.TEXTURE_2D,this._ytexture),this.gl.activeTexture(this.gl.TEXTURE0+4),this.gl.bindTexture(this.gl.TEXTURE_2D,this._utexture),this.gl.activeTexture(this.gl.TEXTURE0+5),this.gl.bindTexture(this.gl.TEXTURE_2D,this._vtexture)):(this.gl.activeTexture(this.gl.TEXTURE0+2),this.gl.bindTexture(this.gl.TEXTURE_2D,this._rgbatexture)),this.gl.useProgram(this._programInfo.program),this.gl.uniform1i(this._programInfo.uniformLocations.rgbatexture,2),this.gl.uniform1i(this._programInfo.uniformLocations.ytexture,3),this.gl.uniform1i(this._programInfo.uniformLocations.utexture,4),this.gl.uniform1i(this._programInfo.uniformLocations.vtexture,5),this.gl.uniform1i(this._programInfo.uniformLocations.isyuv,i?1:0),this.gl.drawElements(this.gl.TRIANGLES,6,this.gl.UNSIGNED_SHORT,0)}},{key:"_calRect",value:function(e,t,i,r,a,n){var s=2*e/a-1,o=2*(n-t-r)/n-1,c=2*(e+i)/a-1,l=2*(n-t)/n-1;return[s,o,c,o,c,l,s,l]}},{key:"_clear",value:function(){this.gl.clearColor(0,0,0,1),this.gl.clearDepth(1),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},{key:"render",value:function(e,t,i,r,a){var n=this.gl;this._clear(),n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,this._ytexture),n.texImage2D(n.TEXTURE_2D,0,n.LUMINANCE,e,t,0,n.LUMINANCE,n.UNSIGNED_BYTE,i),n.activeTexture(n.TEXTURE1),n.bindTexture(n.TEXTURE_2D,this._utexture),n.texImage2D(n.TEXTURE_2D,0,n.LUMINANCE,e/2,t/2,0,n.LUMINANCE,n.UNSIGNED_BYTE,r),n.activeTexture(n.TEXTURE2),n.bindTexture(n.TEXTURE_2D,this._vtexture),n.texImage2D(n.TEXTURE_2D,0,n.LUMINANCE,e/2,t/2,0,n.LUMINANCE,n.UNSIGNED_BYTE,a),this._buffers.positions=[-1,-1,1,-1,1,1,-1,1],this._drawScene(e,t,!0)}},{key:"renderYUV",value:function(e,t,i){var r=i.slice(0,e*t),a=i.slice(e*t,e*t*5/4),n=i.slice(e*t*5/4,e*t*3/2),s=this.gl;this._clear(),s.activeTexture(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,this._ytexture),s.texImage2D(s.TEXTURE_2D,0,s.LUMINANCE,e,t,0,s.LUMINANCE,s.UNSIGNED_BYTE,r),s.activeTexture(s.TEXTURE1),s.bindTexture(s.TEXTURE_2D,this._utexture),s.texImage2D(s.TEXTURE_2D,0,s.LUMINANCE,e/2,t/2,0,s.LUMINANCE,s.UNSIGNED_BYTE,a),s.activeTexture(s.TEXTURE2),s.bindTexture(s.TEXTURE_2D,this._vtexture),s.texImage2D(s.TEXTURE_2D,0,s.LUMINANCE,e/2,t/2,0,s.LUMINANCE,s.UNSIGNED_BYTE,n),this._buffers.positions=[-1,-1,1,-1,1,1,-1,1],this._drawScene(e,t,!0)}},{key:"drawDom",value:function(e,t,i,r,a){var n=this.gl;n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,this._rgbatexture),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,a),this._buffers.positions=this._calRect(i,r,a.width,a.height,e,t),this._drawScene(e,t,!1)}}]),e}(),_n=function(){function e(t){var i=this;Object(T["a"])(this,e),this.gpu=t,this.pipeline=null,this.matrixGroupInfo=null,this.depthTexture=null,this.textureGroupInfo=null,this.hasInited=!1,this.buffers=this._initBuffer(),this._initPipeline().then((function(e){i.pipeline=e,i.matrixGroupInfo=i._initMatrixGroupInfo(),i.hasInited=!0}))}return Object(S["a"])(e,[{key:"destroy",value:function(){this.gpu&&(this.gpu.device.destroy(),this.gpu=null),this.hasInited=!1,this.pipeline=null,this.matrixGroupInfo=null,this.depthTexture=null,this.textureGroupInfo=null}},{key:"_initBuffer",value:function(){var e=this.gpu.device,t=new Float32Array([-1,-1,-1,1,-1,-1,1,1,-1,-1,1,-1]),i=e.createBuffer({size:t.byteLength,usage:window.GPUBufferUsage.VERTEX|window.GPUBufferUsage.COPY_DST});e.queue.writeBuffer(i,0,t);var r=new Float32Array([0,1,1,1,1,0,0,0]),a=e.createBuffer({size:r.byteLength,usage:window.GPUBufferUsage.VERTEX|window.GPUBufferUsage.COPY_DST});e.queue.writeBuffer(a,0,r);var n=new Uint16Array([0,1,2,0,2,3]),s=e.createBuffer({size:n.byteLength,usage:window.GPUBufferUsage.INDEX|window.GPUBufferUsage.COPY_DST});return e.queue.writeBuffer(s,0,n),{positionBuffer:i,texpositionBuffer:a,indexBuffer:s}}},{key:"_initPipeline",value:function(){var e=this;return new Promise((function(t,i){var r=e.gpu.device,a=e.gpu.format,n={layout:"auto",vertex:{module:r.createShaderModule({code:"\n\n @binding(0) @group(0) var<uniform> uModelMatrix : mat4x4<f32>;\n @binding(1) @group(0) var<uniform> uViewMatrix : mat4x4<f32>;\n @binding(2) @group(0) var<uniform> uProjectionMatrix : mat4x4<f32>;\n\n struct VertexOutput {\n @builtin(position) Position : vec4<f32>,\n @location(0) vTexturePosition : vec2<f32>,\n }\n\n @vertex\n fn main(\n @location(0) aVertexPosition : vec4<f32>,\n @location(1) aTexturePosition : vec2<f32>\n ) -> VertexOutput {\n var output : VertexOutput;\n var tmppos : vec4<f32> = uProjectionMatrix * uViewMatrix * uModelMatrix * aVertexPosition;\n output.Position = vec4<f32>(tmppos.x, tmppos.y, (tmppos.z+1.)/2., tmppos.w); // webgl z [-1, 1], webgpu z [0, 1], 这里z做下调整 z-webgpu = (z-webgl+1)/2\n output.vTexturePosition = aTexturePosition;\n return output;\n }\n\n "}),entryPoint:"main",buffers:[{arrayStride:12,attributes:[{shaderLocation:0,offset:0,format:"float32x3"}]},{arrayStride:8,attributes:[{shaderLocation:1,offset:0,format:"float32x2"}]}]},primitive:{topology:"triangle-list"},fragment:{module:r.createShaderModule({code:"\n @group(1) @binding(0) var mySampler: sampler;\n @group(1) @binding(1) var yTexture: texture_2d<f32>;\n @group(1) @binding(2) var uTexture: texture_2d<f32>;\n @group(1) @binding(3) var vTexture: texture_2d<f32>;\n\n const YUV2RGB : mat4x4<f32> = mat4x4<f32>( 1.1643828125, 0, 1.59602734375, -.87078515625,\n 1.1643828125, -.39176171875, -.81296875, .52959375,\n 1.1643828125, 2.017234375, 0, -1.081390625,\n 0, 0, 0, 1);\n\n @fragment\n fn main(\n @location(0) vTexturePosition: vec2<f32>\n ) -> @location(0) vec4<f32> {\n\n var y : f32= textureSample(yTexture, mySampler, vTexturePosition).r;\n var u : f32 = textureSample(uTexture, mySampler, vTexturePosition).r;\n var v : f32 = textureSample(vTexture, mySampler, vTexturePosition).r;\n\n return vec4<f32>(y, u, v, 1.0)*YUV2RGB;\n }\n\n "}),entryPoint:"main",targets:[{format:a}]},depthStencil:{depthWriteEnabled:!0,depthCompare:"less",format:"depth24plus"}};r.createRenderPipelineAsync(n).then((function(e){t(e)}))["catch"]((function(e){i(e)}))}))}},{key:"_initMatrixGroupInfo",value:function(){var e=this.gpu.device,t=this.pipeline,i=gn();bn(i,-1,1,-1,1,.1,100);var r=gn();yn(r);var a=gn();(function(e,t,i,r){var a,n,s,o,c,l,u,d,h,f,p=t[0],m=t[1],g=t[2],y=r[0],v=r[1],b=r[2],A=i[0],k=i[1],_=i[2];Math.abs(p-A)<pn&&Math.abs(m-k)<pn&&Math.abs(g-_)<pn?yn(e):(u=p-A,d=m-k,h=g-_,a=v*(h*=f=1/Math.hypot(u,d,h))-b*(d*=f),n=b*(u*=f)-y*h,s=y*d-v*u,(f=Math.hypot(a,n,s))?(a*=f=1/f,n*=f,s*=f):(a=0,n=0,s=0),o=d*s-h*n,c=h*a-u*s,l=u*n-d*a,(f=Math.hypot(o,c,l))?(o*=f=1/f,c*=f,l*=f):(o=0,c=0,l=0),e[0]=a,e[1]=o,e[2]=u,e[3]=0,e[4]=n,e[5]=c,e[6]=d,e[7]=0,e[8]=s,e[9]=l,e[10]=h,e[11]=0,e[12]=-(a*p+n*m+s*g),e[13]=-(o*p+c*m+l*g),e[14]=-(u*p+d*m+h*g),e[15]=1)})(a,An(0,0,0),An(0,0,-1),An(0,1,0));var n=e.createBuffer({size:64,usage:window.GPUBufferUsage.UNIFORM|window.GPUBufferUsage.COPY_DST});e.queue.writeBuffer(n,0,r);var s=e.createBuffer({size:64,usage:window.GPUBufferUsage.UNIFORM|window.GPUBufferUsage.COPY_DST});e.queue.writeBuffer(s,0,a);var o=e.createBuffer({size:64,usage:window.GPUBufferUsage.UNIFORM|window.GPUBufferUsage.COPY_DST});return e.queue.writeBuffer(o,0,i),{modelMatrixBuffer:n,viewMatrixBuffer:s,projectMatrixBuffer:o,group:e.createBindGroup({label:"group0",layout:t.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:n}},{binding:1,resource:{buffer:s}},{binding:2,resource:{buffer:o}}]})}}},{key:"_initTextureGroupInfo",value:function(e,t){var i=this.gpu.device,r=this.pipeline,a=i.createTexture({size:[e,t],format:"r8unorm",usage:window.GPUTextureUsage.TEXTURE_BINDING|window.GPUTextureUsage.COPY_DST|window.GPUTextureUsage.RENDER_ATTACHMENT}),n=i.createTexture({size:[e/2,t/2],format:"r8unorm",usage:window.GPUTextureUsage.TEXTURE_BINDING|window.GPUTextureUsage.COPY_DST|window.GPUTextureUsage.RENDER_ATTACHMENT}),s=i.createTexture({size:[e/2,t/2],format:"r8unorm",usage:window.GPUTextureUsage.TEXTURE_BINDING|window.GPUTextureUsage.COPY_DST|window.GPUTextureUsage.RENDER_ATTACHMENT}),o=i.createSampler({magFilter:"linear",minFilter:"linear"}),c=i.createBindGroup({label:"group1",layout:r.getBindGroupLayout(1),entries:[{binding:0,resource:o},{binding:1,resource:a.createView()},{binding:2,resource:n.createView()},{binding:3,resource:s.createView()}]});return{yTexture:a,uTexture:n,vTexture:s,group:c}}},{key:"_drawScene",value:function(){var e=this.gpu.device,t=this.gpu.context,i=e.createCommandEncoder(),r={colorAttachments:[{view:t.getCurrentTexture().createView(),clearValue:{r:0,g:0,b:0,a:0},loadOp:"clear",storeOp:"store"}],depthStencilAttachment:{view:this.depthTexture.createView(),depthClearValue:1,depthLoadOp:"clear",depthStoreOp:"store"}},a=i.beginRenderPass(r);a.setPipeline(this.pipeline),a.setBindGroup(0,this.matrixGroupInfo.group),a.setBindGroup(1,this.textureGroupInfo.group),a.setVertexBuffer(0,this.buffers.positionBuffer),a.setVertexBuffer(1,this.buffers.texpositionBuffer),a.setIndexBuffer(this.buffers.indexBuffer,"uint16"),a.drawIndexed(6),a.end(),e.queue.submit([i.finish()])}},{key:"renderYUV",value:function(e,t,i){if(this.hasInited){var r=i.slice(0,e*t),a=i.slice(e*t,e*t*5/4),n=i.slice(e*t*5/4,e*t*3/2),s=this.gpu.device;this.depthTexture||(this.depthTexture=this.gpu.device.createTexture({size:[e,t],format:"depth24plus",usage:window.GPUTextureUsage.RENDER_ATTACHMENT})),this.textureGroupInfo||(this.textureGroupInfo=this._initTextureGroupInfo(e,t)),s.queue.writeTexture({texture:this.textureGroupInfo.yTexture},r,{bytesPerRow:e,rowsPerImage:t},[e,t]),s.queue.writeTexture({texture:this.textureGroupInfo.uTexture},a,{bytesPerRow:e/2,rowsPerImage:t/2},[e/2,t/2]),s.queue.writeTexture({texture:this.textureGroupInfo.vTexture},n,{bytesPerRow:e/2,rowsPerImage:t/2},[e/2,t/2]),this._drawScene()}}},{key:"clear",value:function(){}}]),e}(),wn=function(){function e(t){Object(T["a"])(this,e),this.player=t,this.TAG_NAME="SingleWatermark",this.configList=[],this.shadowRoot=null,this.shadowRootRealDom=null,this.shadowRootInnerDom=null,this.scale=1,this.isDynamic=!1,this._initDom(),this.player.debug.log(this.TAG_NAME,"int")}return Object(S["a"])(e,[{key:"destroy",value:function(){this.configList=[],this.shadowRootInnerDom=null,this.isDynamic=!1,this.scale=1,this.shadowRoot&&(this.player.$container.removeChild(this.shadowRootRealDom),this.shadowRoot=null,this.shadowRootRealDom=null),this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"resize",value:function(){this.player.debug.log(this.TAG_NAME,"resize()"),"default"===this.player._opt.aspectRatio||na()?this.player.getRenderType()===q?this._resizeDomForCanvas():this.player.getRenderType()===K&&this._resizeDomForVideo():this._resizeDomRatio()}},{key:"_initDom",value:function(){var e=this.player.$container,t=null,i=document.createElement("div");i.setAttribute("style","pointer-events: none !important;display: block !important;"),t="function"==typeof i.attachShadow?i.attachShadow({mode:"open"}):i.shadowRoot?i.shadowRoot:i;var r=document.createElement("div");r.setAttribute("style","position: absolute; top: 0; left: 0; width: 0; height: 0;display: none;"),t.appendChild(r);var a=e.children,n=Math.floor(Math.random()*(a.length-1))+1;a[n]?e.insertBefore(i,a[n]):e.appendChild(i),this.shadowRootInnerDom=r,this.shadowRootRealDom=i,this.shadowRoot=t}},{key:"update",value:function(e){this._removeDom();var t=[];Array.isArray(e)?t=e:Ba(e)&&t.push(e);var i=t.map((function(e){return Ea(e)}));this.configList=i,this._updateDom()}},{key:"_resizeDomForVideo",value:function(){var e=this.player.width,t=this.player.height,i=this.player.getVideoInfo();if(i&&i.height>0&&i.width>0){var r=i.width,a=i.height,n=this.player._opt,s=t,o=e;if(n.hasControl&&!n.controlAutoHide){var c=n.playType===A?Bt:Ot;na()&&this.player.fullscreen&&n.useWebFullScreen?o-=c:s-=c}var l=n.rotate,u=(o-r)/2,d=(s-a)/2;270!==l&&90!==l||(r=i.height,a=i.width);var h=o/r,f=s/a,p=h>f?f:h;n.isResize||h!==f&&(p=h+","+f),n.isFullResize&&(p=h>f?h:f);var m="scale("+p+")";"none"===n.mirrorRotate&&l&&(m+=" rotate("+l+"deg)"),"level"===n.mirrorRotate?m+=" rotateY(180deg)":"vertical"===n.mirrorRotate&&(m+=" rotateX(180deg)"),this.scale=-1!==(""+p).indexOf(",")?h:p,this.shadowRootInnerDom.style.transform=m,this.shadowRootInnerDom.style.left=u+"px",this.shadowRootInnerDom.style.top=d+"px",this.shadowRootInnerDom.style.width=i.width+"px",this.shadowRootInnerDom.style.height=i.height+"px",this.shadowRootInnerDom.style.display="block"}}},{key:"_resizeDomForCanvas",value:function(){var e=this.player.getVideoInfo();if(e&&e.height>0&&e.width>0){var t=this.player._opt,i=this.player.width,r=this.player.height;if(t.hasControl&&!t.controlAutoHide){var a=t.playType===A?Bt:Ot;na()&&this.player.fullscreen&&t.useWebFullScreen?i-=a:r-=a}var n=e.width,s=e.height,o=t.rotate,c=(i-n)/2,l=(r-s)/2;270!==o&&90!==o||(n=e.height,s=e.width);var u=i/n,d=r/s,h=u>d?d:u;t.isResize||u!==d&&(h=u+","+d),t.isFullResize&&(h=u>d?u:d);var f="scale("+h+")";"none"===t.mirrorRotate&&o&&(f+=" rotate("+o+"deg)"),"level"===t.mirrorRotate?f+=" rotateY(180deg)":"vertical"===t.mirrorRotate&&(f+=" rotateX(180deg)"),this.shadowRootInnerDom.style.height=e.height+"px",this.shadowRootInnerDom.style.width=e.width+"px",this.shadowRootInnerDom.style.padding="0",this.shadowRootInnerDom.style.transform=f,this.shadowRootInnerDom.style.left=c+"px",this.shadowRootInnerDom.style.top=l+"px",this.shadowRootInnerDom.style.display="block"}}},{key:"_resizeDomRatio",value:function(){var e=this.player.getVideoInfo();if(e&&e.height>0&&e.width>0){var t=this.player._opt.aspectRatio.split(":").map(Number),i=this.player.width,r=this.player.height,a=this.player._opt,n=0;a.hasControl&&!a.controlAutoHide&&(n=a.playType===A?Bt:Ot,r-=n);var s=e.width/e.height,o=t[0]/t[1];if(s>o){var c=o*e.height/e.width;this.shadowRootInnerDom.style.width=100*c+"%",this.shadowRootInnerDom.style.height="calc(100% - ".concat(n,"px)"),this.shadowRootInnerDom.style.padding="0 ".concat((i-i*c)/2,"px")}else{var l=e.width/o/e.height;this.shadowRootInnerDom.style.width="100%",this.shadowRootInnerDom.style.height="calc(".concat(100*l,"% - ").concat(n,"px)"),this.shadowRootInnerDom.style.padding=(r-r*l)/2+"px 0"}this.shadowRootInnerDom.style.display="block"}}},{key:"_updateDom",value:function(){var e=this;this.shadowRoot&&this.configList.forEach((function(t){var i=document.createElement("div"),r=null;t.image&&t.image.src?(r=document.createElement("img"),r.style.height="100%",r.style.width="100%",r.style.objectFit="contain",r.src=t.image.src):t.text&&t.text.content?r=document.createTextNode(t.text.content):(t.rect&&t.rect.color&&t.rect.width||t.html)&&(r=document.createElement("div")),r&&(i.appendChild(r),i.style.visibility="",i.style.position="absolute",i.style.display="block",i.style["-ms-user-select"]="none",i.style["-moz-user-select"]="none",i.style["-webkit-user-select"]="none",i.style["-o-user-select"]="none",i.style["user-select"]="none",i.style["-webkit-touch-callout"]="none",i.style["-webkit-tap-highlight-color"]="rgba(0,0,0,0)",i.style["-webkit-text-size-adjust"]="none",i.style["-webkit-touch-callout"]="none",i.style.opacity=t.opacity,ya(t.left)&&(i.style.left=t.left+"px"),ya(t.right)&&(i.style.right=t.right+"px"),ya(t.top)&&(i.style.top=t.top+"px"),ya(t.bottom)&&(i.style.bottom=t.bottom+"px"),t.backgroundColor&&(i.style.backgroundColor=t.backgroundColor),i.style.overflow="hidden",i.style.zIndex="9999999",t.image&&t.image.src?(i.style.width=t.image.width+"px",i.style.height=t.image.height+"px"):t.text&&t.text.content?(i.style.fontSize=t.text.fontSize+"px",i.style.color=t.text.color,t.text.width&&(i.style.width=t.text.width+"px"),t.text.height&&(i.style.height=t.text.height+"px")):t.rect&&t.rect.color&&t.rect.width?(i.style.width=t.rect.width+"px",i.style.height=t.rect.height+"px",i.style.borderWidth=t.rect.lineWidth+"px",i.style.borderStyle="solid",i.style.borderColor=t.rect.color):t.html&&(i.style.width="100%",i.style.height="100%",i.innerHTML=t.html),e.isDynamic&&(e.shadowRootDynamicDom=i),e.shadowRootInnerDom.appendChild(i))}))}},{key:"remove",value:function(){this._removeDom()}},{key:"_removeDom",value:function(){this.shadowRootInnerDom&&(this.shadowRootInnerDom.innerHTML="")}}]),e}(),Sn=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(){var e;return Object(T["a"])(this,i),e=t.call(this),e.videoInfo={width:null,height:null,encType:null,encTypeCode:null},e.init=!1,e.prevAiFaceDetectTime=null,e.prevAiObjectDetectTime=null,e.contentWatermark=null,e.aiContentWatermark=null,e.tempContentList=[],e.tempAiContentList=[],e.streamFps=0,e.isDestroyed=!1,e}return Object(S["a"])(i,[{key:"destroy",value:function(){this.isDestroyed=!0,this.contentWatermark&&(this.contentWatermark.destroy(),this.contentWatermark=null),this.aiContentWatermark&&(this.aiContentWatermark.destroy(),this.aiContentWatermark=null),this.prevAiFaceDetectTime=null,this.prevAiObjectDetectTime=null,this.tempContentList=[],this.tempAiContentList=[],this.streamFps=0,this.resetInit(),this.off()}},{key:"resetInit",value:function(){this.videoInfo={width:null,height:null,encType:null,encTypeCode:null},this.init=!1}},{key:"getHasInit",value:function(){return this.init}},{key:"updateVideoInfo",value:function(e){Ta(e.encTypeCode)&&(this.videoInfo.encType=ft[e.encTypeCode],this.videoInfo.encTypeCode=e.encTypeCode),Ta(e.encType)&&(this.videoInfo.encType=e.encType),Ta(e.width)&&(this.videoInfo.width=e.width),Ta(e.height)&&(this.videoInfo.height=e.height),Ta(this.videoInfo.encType)&&Ta(this.videoInfo.height)&&Ta(this.videoInfo.width)&&!this.init&&(this.player.emit(it.videoInfo,this.videoInfo),this.init=!0)}},{key:"getVideoInfo",value:function(){return this.videoInfo}},{key:"clearView",value:function(){}},{key:"resize",value:function(){if(this.player.debug.log("CommonVideo","resize()"),"default"===this.player._opt.aspectRatio||na()?this._resize():this._resizeRatio(),this.contentWatermark&&this.contentWatermark.resize(),this.aiContentWatermark&&this.aiContentWatermark.resize(),this.player.singleWatermark&&this.player.singleWatermark.resize(),this.player.ghostWatermark&&this.player.ghostWatermark.resize(),this.player.dynamicWatermark&&this.player.dynamicWatermark.resize(),this.player.zoom&&this.player.zooming){var e=this._getStyleScale();this.player.zoom.updatePrevVideoElementStyleScale(e),this.player.zoom.updateVideoElementScale()}}},{key:"_resizeRatio",value:function(){this.player.debug.log("CommonVideo","_resizeRatio()");var e=this.player._opt.aspectRatio.split(":").map(Number),t=this.player.width,i=this.player.height,r=this.player._opt,a=0;r.hasControl&&!r.controlAutoHide&&(a=r.playType===A?Bt:Ot,i-=a);var n=this.videoInfo,s=n.width/n.height,o=e[0]/e[1];if(this.getType()===q&&(this.$videoElement.style.left="0",this.$videoElement.style.top="0",this.$videoElement.style.transform="none"),this.getType()===K&&this.player._opt.videoRenderSupportScale&&(this.$videoElement.style.objectFit="fill"),s>o){var c=o*n.height/n.width;this.$videoElement.style.width=100*c+"%",this.$videoElement.style.height="calc(100% - ".concat(a,"px)"),this.$videoElement.style.padding="0 ".concat((t-t*c)/2,"px")}else{var l=n.width/o/n.height;this.$videoElement.style.width="100%",this.$videoElement.style.height="calc(".concat(100*l,"% - ").concat(a,"px)"),this.$videoElement.style.padding=(i-i*l)/2+"px 0"}}},{key:"play",value:function(){}},{key:"pause",value:function(){}},{key:"setRate",value:function(e){}},{key:"getType",value:function(){return""}},{key:"getCanvasType",value:function(){return""}},{key:"getCurrentTime",value:function(){return 0}},{key:"getStreamFps",value:function(){return this.streamFps}},{key:"isPlaying",value:function(){return!0}},{key:"getPlaybackQuality",value:function(){return null}},{key:"setStreamFps",value:function(e){this.player.debug.log("CommonVideo","setStreamFps",e),this.streamFps=e}},{key:"addContentToCanvas",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.tempContentList=e}},{key:"addAiContentToCanvas",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.tempAiContentList=e}},{key:"doAddContentToWatermark",value:function(){if(this.tempContentList.length>0){this.contentWatermark||(this.contentWatermark=new wn(this.player),this.contentWatermark.resize());var e=this.tempContentList.map((function(e){var t={left:e.x,top:e.y};return"text"===e.type?t.text={content:e.text,fontSize:e.fontSize,color:e.color}:"rect"===e.type&&(t.rect={width:e.width,height:e.height,color:e.color,lineWidth:e.lineWidth}),t}));this.contentWatermark.update(e)}else this.contentWatermark&&this.contentWatermark.remove()}},{key:"doAddAiContentToWatermark",value:function(){if(this.tempAiContentList.length>0){this.aiContentWatermark||(this.aiContentWatermark=new wn(this.player),this.aiContentWatermark.resize());var e=this.tempAiContentList.map((function(e){var t={left:e.x,top:e.y};return"text"===e.type?t.text={content:e.text,fontSize:e.fontSize,color:e.color}:"rect"===e.type&&(t.rect={width:e.width,height:e.height,color:e.color,lineWidth:e.lineWidth}),t}));this.aiContentWatermark.update(e)}else this.aiContentWatermark&&this.aiContentWatermark.remove()}},{key:"_getStyleScale",value:function(){var e=this.$videoElement.style.transform.match(/scale\([0-9., ]*\)/g),t="";return e&&e[0]&&(t=e[0].replace("scale(","").replace(")","").split(",")),t}}]),i}(fn),Tn="object"==("undefined"===typeof window?"undefined":Object(E["a"])(window))&&window.window===window?window:"object"==("undefined"===typeof self?"undefined":Object(E["a"])(self))&&self.self===self?self:"object"==("undefined"===typeof global?"undefined":Object(E["a"])(global))&&global.global===global?global:void 0;function En(e,t,i){var r=new XMLHttpRequest;r.open("GET",e),r.responseType="blob",r.onload=function(){Ln(r.response,t,i)},r.onerror=function(){console.error("could not download file")},r.send()}function xn(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(i){}return t.status>=200&&t.status<=299}function Cn(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(i){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var Rn=Tn.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),Ln="object"!=("undefined"===typeof window?"undefined":Object(E["a"])(window))||window!==Tn?function(){}:"download"in HTMLAnchorElement.prototype&&!Rn?function(e,t,i){var r=Tn.URL||Tn.webkitURL,a=document.createElementNS("http://www.w3.org/1999/xhtml","a");t=t||e.name||"download",a.download=t,a.rel="noopener","string"==typeof e?(a.href=e,a.origin!==location.origin?xn(a.href)?En(e,t,i):Cn(a,a.target="_blank"):Cn(a)):(a.href=r.createObjectURL(e),setTimeout((function(){r.revokeObjectURL(a.href)}),4e4),setTimeout((function(){Cn(a)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,t,i){if(t=t||e.name||"download","string"==typeof e)if(xn(e))En(e,t,i);else{var r=document.createElement("a");r.href=e,r.target="_blank",setTimeout((function(){Cn(r)}))}else navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!=Object(E["a"])(t)&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([String.fromCharCode(65279),e],{type:e.type}):e}(e,i),t)}:function(e,t,i,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),"string"==typeof e)return En(e,t,i);var a="application/octet-stream"===e.type,n=/constructor/i.test(Tn.HTMLElement)||Tn.safari,s=/CriOS\/[\d]+/.test(navigator.userAgent);if((s||a&&n||Rn)&&("undefined"===typeof FileReader?"undefined":Object(E["a"])(FileReader))<"u"){var o=new FileReader;o.onloadend=function(){var e=o.result;e=s?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=e:location=e,r=null},o.readAsDataURL(e)}else{var c=Tn.URL||Tn.webkitURL,l=c.createObjectURL(e);r?r.location=l:location.href=l,r=null,setTimeout((function(){c.revokeObjectURL(l)}),4e4)}},Dn=function(){function e(t,i){Object(T["a"])(this,e),this.canvas=t,this.gl=i;var r=i.createShader(i.VERTEX_SHADER);if(i.shaderSource(r,"\n attribute vec2 xy;\n varying highp vec2 uv;\n void main(void) {\n gl_Position = vec4(xy, 0.0, 1.0);\n // Map vertex coordinates (-1 to +1) to UV coordinates (0 to 1).\n // UV coordinates are Y-flipped relative to vertex coordinates.\n uv = vec2((1.0 + xy.x) / 2.0, (1.0 - xy.y) / 2.0);\n }\n "),i.compileShader(r),!i.getShaderParameter(r,i.COMPILE_STATUS))throw i.getShaderInfoLog(r);var a=i.createShader(i.FRAGMENT_SHADER);if(i.shaderSource(a,"\n varying highp vec2 uv;\n uniform sampler2D texture;\n void main(void) {\n gl_FragColor = texture2D(texture, uv);\n }\n "),i.compileShader(a),!i.getShaderParameter(a,i.COMPILE_STATUS))throw i.getShaderInfoLog(a);var n=i.createProgram();if(i.attachShader(n,r),i.attachShader(n,a),i.linkProgram(n),!i.getProgramParameter(n,i.LINK_STATUS))throw i.getProgramInfoLog(n);i.useProgram(n);var s=i.createBuffer();i.bindBuffer(i.ARRAY_BUFFER,s),i.bufferData(i.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),i.STATIC_DRAW);var o=i.getAttribLocation(n,"xy");i.vertexAttribPointer(o,2,i.FLOAT,!1,0,0),i.enableVertexAttribArray(o);var c=i.createTexture();i.bindTexture(i.TEXTURE_2D,c),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.NEAREST),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),this.program=n,this.buffer=s,this.vertexShader=r,this.fragmentShader=a,this.texture=c}return Object(S["a"])(e,[{key:"destroy",value:function(){this.gl.deleteProgram(this.program),this.gl.deleteBuffer(this.buffer),this.gl.deleteTexture(this.texture),this.gl.deleteShader(this.vertexShader),this.gl.deleteShader(this.fragmentShader),this.program=null,this.buffer=null,this.vertexShader=null,this.fragmentShader=null,this.texture=null}},{key:"render",value:function(e){this.canvas.width=e.displayWidth,this.canvas.height=e.displayHeight;var t=this.gl;t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e),t.viewport(0,0,t.drawingBufferWidth,t.drawingBufferHeight),t.clearColor(1,0,0,1),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_FAN,0,4)}}]),e}(),In=function(t){Object(_["a"])(r,t);var i=Object(w["a"])(r);function r(e){var t;Object(T["a"])(this,r),t=i.call(this),t.player=e;var a=document.createElement("canvas");return a.style.position="absolute",a.style.top=0,a.style.left=0,t.$videoElement=a,e.$container.appendChild(t.$videoElement),t.context2D=null,t.contextGl=null,t.webglRender=null,t.webglRectRender=null,t.webGPURender=null,t.isWebglContextLost=!1,t.isWcsWebgl2=!1,t.bitmaprenderer=null,t.renderType=null,t.controlHeight=0,t.proxyDestroyList=[],t._initCanvasRender(),t}return Object(S["a"])(r,[{key:"destroy",value:function(){k(Object(b["a"])(r.prototype),"destroy",this).call(this),this.proxyDestroyList.length>0&&(this.proxyDestroyList.forEach((function(e){e&&e()})),this.proxyDestroyList=[]),this.contextGl&&(this.contextGl=null),this.context2D&&(this.context2D=null),this.webglRender&&(this.webglRender.destroy(),this.webglRender=null),this.webglRectRender&&(this.webglRectRender.destroy(),this.webglRectRender=null),this.webGPURender&&(this.webGPURender.destroy(),this.webGPURender=null),this.bitmaprenderer&&(this.bitmaprenderer=null),this.renderType=null,this.isWebglContextLost=!1,this.videoInfo={width:"",height:"",encType:""},this.player.$container.removeChild(this.$videoElement),this.init=!1,this.off()}},{key:"_initContext2D",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.context2D=this.$videoElement.getContext("2d",e)}},{key:"_initContextGl",value:function(){this.player.events,this.contextGl=Yr(this.$videoElement),this.contextGl?(this._bindContextGlEvents(),this.webglRender=new kn(this.contextGl,this.player._opt.openWebglAlignment)):this.player.debug.error("CommonCanvasLoader","_initContextGl() createContextGL error")}},{key:"_initContextGl2",value:function(){if(this.contextGl=Qr(this.$videoElement),this.contextGl){this._bindContextGlEvents(2);try{this.webglRender=new Dn(this.$videoElement,this.contextGl)}catch(e){this.player.debug.error("CommonCanvasLoader","create webgl2Render error is ".concat(e," and next use context2d.draw render")),this.contextGl=null,this.webglRender=null,this._initContext2D()}}else this.player.debug.error("CommonCanvasLoader","_initContextGl2() createContextGL2 error")}},{key:"_bindContextGlEvents",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,i=this.player.events.proxy,r=i(this.$videoElement,"webglcontextlost",(function(i){i.preventDefault(),e.player.debug.error("canvasVideo","webglcontextlost error",i),e.isWebglContextLost=!0,e.webglRender&&(e.player.debug.log("CommonCanvasLoader","webglcontextlost error and destroy webglRender"),e.webglRender.destroy(),e.webglRender=null),e.webglRectRender&&(e.player.debug.log("CommonCanvasLoader","webglcontextlost error and destroy webglRectRender"),e.webglRectRender.destroy(),e.webglRectRender=null),e.contextGl=null,setTimeout((function(){if(e.player.debug.log("CommonCanvasLoader","createContextGL() version ".concat(t)),1===t?e.contextGl=Yr(e.$videoElement):2===t&&(e.contextGl=Qr(e.$videoElement)),e.player.debug.log("CommonCanvasLoader","createContextGL success"),e.contextGl&&e.contextGl.getContextAttributes){var i=e.contextGl.getContextAttributes();i&&i.stencil?(1===t?e.webglRender=new kn(e.contextGl,e.player._opt.openWebglAlignment):2===t&&(e.webglRender=new Dn(e.$videoElement,e.contextGl)),e.isWebglContextLost=!1,e.player.debug.log("CommonCanvasLoader","webglcontextlost error reset and getContextAttributes().stencil is true")):(e.player.debug.error("CommonCanvasLoader","webglcontextlost error, getContextAttributes().stencil is false"),e.player.emitError(nt.webglContextLostError))}else e.player.debug.error("CommonCanvasLoader","webglcontextlost error, getContextAttributes().stencil is false"),e.player.emitError(nt.webglContextLostError)}),500)})),a=i(this.$videoElement,"webglcontextrestored",(function(t){t.preventDefault(),e.player.debug.log("CommonCanvasLoader","webglcontextrestored ",t)}));this.proxyDestroyList.push(r,a)}},{key:"_initContextGPU",value:function(){var t,i=this;(t=this.$videoElement,new Promise((function(e,i){navigator.gpu?navigator.gpu.requestAdapter().then((function(r){r?r.requestDevice().then((function(a){if(a){var n=t.getContext("webgpu");if(n){var s=navigator.gpu.getPreferredCanvasFormat();n.configure({device:a,format:s,alphaMode:"opaque"}),e({adapter:r,device:a,context:n,format:s})}else i('WebGPU "context" create fail')}else i('WebGPU "device" request fail')}))["catch"]((function(e){i('WebGPU "adapter.requestDevice()" fail')})):i('WebGPU "adapter" request fail is empty')}))["catch"]((function(e){i('WebGPU "navigator.gpu.requestAdapter()" fail')})):i("WebGPU not support!!")}))).then((function(t){t?(i.webGPURender=new _n(t),i.player.debug.log("CommonCanvasLoader","webGPURender init success")):(i.player.debug.warn("CommonCanvasLoader","createWebGPUContext error is ".concat(e," and next use webgl render")),i.renderType=Nt,i._initContextGl())}))["catch"]((function(e){i.player.debug.warn("CommonCanvasLoader","createWebGPUContext error is ".concat(e," and next use webgl render")),i.renderType=Nt,i._initContextGl()}))}},{key:"initCanvasViewSize",value:function(){this.$videoElement.width=this.videoInfo.width,this.$videoElement.height=this.videoInfo.height,this.resize()}},{key:"screenshot",value:function(e,t,i,r){e=e||$r(),r=r||ut.download;var a=.92;!_i[t]&&ut[t]&&(r=t,t="png",i=void 0),"string"==typeof i&&(r=i,i=void 0),void 0!==i&&(a=Number(i));var n=_i[t]||_i.png,s=this.$videoElement.toDataURL(n,a);if(r===ut.base64)return s;var o=Xr(s);if(r===ut.blob)return o;if(r===ut.download){var c=n.split("/")[1];Ln(o,e+"."+c)}}},{key:"screenshotWatermark",value:function(e){var t=this;return new Promise((function(i,r){Ma(e)&&(e={filename:e}),(e=e||{}).width=t.videoInfo.width,e.height=t.videoInfo.height,e.filename=e.filename||$r(),e.format=e.format?_i[e.format]:_i.png,e.quality=Number(e.quality)||.92,e.type=e.type||ut.download;var a=t.$videoElement.toDataURL(e.format,e.quality);Ca(a,e).then((function(t){if(e.type===ut.base64)i(a);else{var r=Xr(t);if(e.type===ut.blob)i(r);else if(e.type===ut.download){i();var n=e.format.split("/")[1];Ln(r,e.filename+"."+n)}}}))["catch"]((function(e){r(e)}))}))}},{key:"render",value:function(){}},{key:"clearView",value:function(){}},{key:"play",value:function(){}},{key:"pause",value:function(){}},{key:"_resize",value:function(){this.player.debug.log("canvasVideo","_resize()");var e=this.player._opt,t=this.player.width,i=this.player.height;if(e.hasControl&&!e.controlAutoHide){var r=this.controlHeight;na()&&this.player.fullscreen&&e.useWebFullScreen?t-=r:i-=r}var a=this.$videoElement.width,n=this.$videoElement.height,s=e.rotate,o=(t-a)/2,c=(i-n)/2;270!==s&&90!==s||(a=this.$videoElement.height,n=this.$videoElement.width);var l=t/a,u=i/n,d=l>u?u:l;an(e.isResize)&&l!==u&&(d=l+","+u),e.isFullResize&&(d=l>u?l:u);var h="scale("+d+")";"none"===e.mirrorRotate&&s&&(h+=" rotate("+s+"deg)"),"level"===e.mirrorRotate?h+=" rotateY(180deg)":"vertical"===e.mirrorRotate&&(h+=" rotateX(180deg)"),this.$videoElement.style.height=this.videoInfo.height+"px",this.$videoElement.style.width=this.videoInfo.width+"px",this.$videoElement.style.padding="0",this.$videoElement.style.transform=h,this.$videoElement.style.left=o+"px",this.$videoElement.style.top=c+"px"}},{key:"initFps",value:function(){}},{key:"setStreamFps",value:function(e){}},{key:"getStreamFps",value:function(){return 25}},{key:"getType",value:function(){return q}},{key:"getCanvasType",value:function(){var e=this.renderType===Gt?Gt:Nt;return this.isWcsWebgl2&&(e=zt),e}}]),r}(Sn),Pn=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e),r.yuvList=[],r.controlHeight=Ot,r.tempTextCanvas=null,r.tempTextCanvasCtx=null,r.player.debug.log("CanvasVideo","init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){k(Object(b["a"])(i.prototype),"destroy",this).call(this),this.yuvList=[],this.tempTextCanvas&&(this.tempTextCanvasCtx.clearRect(0,0,this.tempTextCanvas.width,this.tempTextCanvas.height),this.tempTextCanvas.width=0,this.tempTextCanvas.height=0,this.tempTextCanvas=null),this.player.debug.log("CanvasVideoLoader","destroy")}},{key:"_initCanvasRender",value:function(){this.player._opt.useWCS&&!this._supportOffscreen()?(this.renderType=jt,cn()&&this.player._opt.wcsUseWebgl2Render?(this._initContextGl2(),this.webglRender&&(this.isWcsWebgl2=!0)):this._initContext2D()):this.player._opt.useMSE&&this.player._opt.mseUseCanvasRender?(this.renderType=Vt,this._initContext2D()):this.player.isOldHls()&&this.player._opt.useCanvasRender?(this.renderType=Wt,this._initContext2D()):this.player.isWebrtcH264()&&this.player._opt.webrtcUseCanvasRender?(this.renderType=qt,this._initContext2D()):this._supportOffscreen()?(this.renderType=Ht,this._bindOffscreen()):this.player._opt.useWebGPU?(this.renderType=Gt,this._initContextGPU()):(this.renderType=Nt,this._initContextGl())}},{key:"_supportOffscreen",value:function(){return"function"==typeof this.$videoElement.transferControlToOffscreen&&this.player._opt.useOffscreen}},{key:"_bindOffscreen",value:function(){this.bitmaprenderer=this.$videoElement.getContext("bitmaprenderer")}},{key:"render",value:function(e){this.yuvList.push(e),this.startRender()}},{key:"startRender",value:function(){for(;!(this.yuvList.length<=0);){var e=this.yuvList.shift();this.doRender(e)}}},{key:"doRender",value:function(e){var t=this;if(this.renderType!==Vt){var i={ts:e.ts||0,fps:!0};this.player.updateStats(i)}switch(this.renderType){case Ht:this.bitmaprenderer.transferFromImageBitmap(e.buffer);break;case Nt:case Gt:if(this.isWebglContextLost)return void this.player.debug.warn("CanvasVideoLoader","doRender() and webgl context is lost");var r=e.output;if(this.player.faceDetectActive&&this.player.ai&&this.player.ai.faceDetector){null===this.prevAiFaceDetectTime&&(this.prevAiFaceDetectTime=$r());var a=$r();a-this.prevAiFaceDetectTime>=this.player._opt.aiFaceDetectInterval&&(r=this.player.ai.faceDetector.detect({width:this.$videoElement.width,height:this.$videoElement.height,data:e.output,ts:e.ts||0}),this.prevAiFaceDetectTime=a)}if(this.player.objectDetectActive&&this.player.ai&&this.player.ai.objectDetector){null===this.prevAiObjectDetectTime&&(this.prevAiObjectDetectTime=$r());var n=$r();n-this.prevAiObjectDetectTime>=this.player._opt.aiObjectDetectInterval&&(r=this.player.ai.objectDetector.detect({width:this.$videoElement.width,height:this.$videoElement.height,data:e.output,ts:e.ts||0}),this.prevAiObjectDetectTime=n)}if(this.renderType===Gt)try{if(!this.webGPURender)return void this.player.debug.warn("CanvasVideoLoader","doRender webgpu render is not init");this.webGPURender.renderYUV(this.$videoElement.width,this.$videoElement.height,r)}catch(a){this.player.debug.error("CanvasVideoLoader","doRender webgpu render and error: ".concat(a.toString()))}else if(this.renderType===Nt)try{this.webglRender.renderYUV(this.$videoElement.width,this.$videoElement.height,r)}catch(a){this.player.debug.error("CanvasVideoLoader","doRender webgl render context is lost ".concat(this.contextGl&&this.contextGl.isContextLost()," and error: ").concat(a.toString()))}break;case jt:if(this.webglRender)this.webglRender.render(e.videoFrame),qa(e.videoFrame);else if(this.context2D)if(za(e.videoFrame.createImageBitmap))try{e.videoFrame.createImageBitmap().then((function(i){t.context2D.drawImage(i,0,0,t.$videoElement.width,t.$videoElement.height),qa(e.videoFrame)}))}catch(s){}else this.context2D.drawImage(e.videoFrame,0,0,this.$videoElement.width,this.$videoElement.height),qa(e.videoFrame);else this.player.debug.warn("CanvasVideoLoader","doRender() and webcodecs context is lost");break;case Vt:case Wt:case qt:this.context2D.drawImage(e.$video,0,0,this.$videoElement.width,this.$videoElement.height)}this.player.updateCurrentPts(e.ts||0),this.doAddContentToWatermark(),this.doAddAiContentToWatermark()}},{key:"clearView",value:function(){var e=this;switch(this.renderType){case Ht:(function(e,t){var i=document.createElement("canvas");i.width=e,i.height=t;var r=window.createImageBitmap(i,0,0,e,t);return i.width=0,i.height=0,r})(this.$videoElement.width,this.$videoElement.height).then((function(t){e.bitmaprenderer.transferFromImageBitmap(t)}));break;case Nt:this.contextGl.clear(this.contextGl.COLOR_BUFFER_BIT);break;case Gt:this.webGPURender.clear();break;case jt:this.contextGl?this.contextGl.clear(this.contextGl.COLOR_BUFFER_BIT):this.context2D&&this.context2D.clearRect(0,0,this.$videoElement.width,this.$videoElement.height);break;case Vt:case Wt:case qt:this.context2D.clearRect(0,0,this.$videoElement.width,this.$videoElement.height)}}},{key:"_initTempTextCanvas",value:function(){this.tempTextCanvas=document.createElement("canvas"),this.tempTextCanvasCtx=this.tempTextCanvas.getContext("2d"),this.tempTextCanvas.width=600,this.tempTextCanvas.height=20}},{key:"doAddContentToCanvas",value:function(){this.tempContentList.length>0&&this.context2D&&function(e){var t=e.ctx,i=e.list;t.save(),(i||[]).forEach((function(e){"text"===e.type?(t.font="".concat(e.fontSize||12,"px Arial"),t.fillStyle=e.color||"green",t.fillText(e.text,e.x,e.y)):"rect"===e.type&&(t.strokeStyle=e.color||"green",t.lineWidth=e.lineWidth||2,t.strokeRect(e.x,e.y,e.width,e.height))})),t.restore()}({ctx:this.context2D,list:this.tempContentList})}},{key:"doAddContentToWebGlCanvas",value:function(){var e=this;this.tempContentList.length>0&&this.contextGl&&this.webglRectRender&&this.tempContentList.forEach((function(t){var i,r=t.x,a=t.y;if("rect"===t.type){var n=t.width,s=t.height,o=(i=t.color||"#008000",[parseInt(i.substring(1,3),16)/255,parseInt(i.substring(3,5),16)/255,parseInt(i.substring(5,7),16)/255,1]),c=t.lineWidth||4;if(!n||!s)return;e.webglRectRender.drawBox({x:r,y:a,width:n,height:s,lineColor:o,lineWidth:c,canvasWidth:e.$videoElement.width,canvasHeight:e.$videoElement.height})}else if("text"===t.type){var l=t.text||"";if(!l)return;var u=t.fontSize||20,d=t.color||"#008000";e.tempTextCanvas||e._initTempTextCanvas(),e.tempTextCanvasCtx.clearRect(0,0,e.tempTextCanvas.width,e.tempTextCanvas.height),e.tempTextCanvasCtx.font="".concat(u,"px Arial"),e.tempTextCanvasCtx.fillStyle=d,e.tempTextCanvasCtx.textBaseline="top",e.tempTextCanvasCtx.fillText(l,0,0),e.webglRender.drawDom(e.$videoElement.width,e.$videoElement.height,r,a,e.tempTextCanvas)}}))}}]),i}(In),On=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;Object(T["a"])(this,i),r=t.call(this),r.player=e,r.TAG_NAME="Video";var a=document.createElement("video"),n=document.createElement("canvas");a.muted=!0,a.style.position="absolute",a.style.top=0,a.style.left=0,r._delayPlay=!1,e.$container.appendChild(a),r.$videoElement=a,r.$canvasElement=n,r.canvasContext=n.getContext("2d"),r.mediaStream=null,r.vwriter=null,e.canVideoTrackWritter()&&Aa()&&ka()&&(r.trackGenerator=new MediaStreamTrackGenerator({kind:"video"}),r.mediaStream=new MediaStream([r.trackGenerator]),a.srcObject=r.mediaStream,r.vwriter=r.trackGenerator.writable.getWriter()),r.fixChromeVideoFlashBug(),r.fixMobileAutoFullscreen(),r.resize(),r.eventListenList=[],r.isRenderRetryPlaying=!1,r.isRenderRetryPlayingTimes=0,r.isRetryPlaying=!1,r.isRetryPlayingTimes=0;var s=un();r.supportVideoFrameCallbackHandle=null;var o=r.player.events.proxy,c=o(r.$videoElement,"canplay",(function(){r.player.debug.log("Video","canplay"),r._delayPlay&&r._play()})),l=o(r.$videoElement,"waiting",(function(){r.player.debug.log("Video","waiting")})),u=o(r.$videoElement,"loadedmetadata",(function(){r.player.debug.log("Video","loadedmetadata")})),d=o(r.$videoElement,"timeupdate",(function(t){if(an(s)){var i=parseInt(t.timeStamp,10);(e.isWebrtcH264()||r.player.isOldHls())&&(r.player.emit(it.timeUpdate,i),e.handleRender(),e.updateStats({fps:!0,ts:i,dts:i}))}})),h=o(r.$videoElement,"error",(function(){r.player.debug.error("Video","Error Code "+r.$videoElement.error.code+" "+Dr[r.$videoElement.error.code]+"; Details: "+r.$videoElement.error.message)}));return r.eventListenList.push(c,l,d,h,u),un()?r.supportVideoFrameCallbackHandle=r.$videoElement.requestVideoFrameCallback(r.videoFrameCallback.bind(Object(v["a"])(r))):r.player.debug.warn("Video","not support requestVideoFrameCallback and use timeupdate event to update stats"),r.player.debug.log("Video","init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){if(k(Object(b["a"])(i.prototype),"destroy",this).call(this),this.supportVideoFrameCallbackHandle&&this.$videoElement&&(this.$videoElement.cancelVideoFrameCallback(this.supportVideoFrameCallbackHandle),this.supportVideoFrameCallbackHandle=null),this.eventListenList&&(this.eventListenList.forEach((function(e){e()})),this.eventListenList=[]),this.isRenderRetryPlaying=!1,this.isRenderRetryPlayingTimes=0,this.isRetryPlaying=!1,this.isRetryPlayingTimes=0,this.player._opt.videoRenderSupportScale&&this._isNeedAddBackDropFilter()){var e=this.player.$container;e.style.backdropFilter="none",e.style.transform="none"}if(this.$canvasElement.height=0,this.$canvasElement.width=0,this.$canvasElement=null,this.canvasContext=null,this.$videoElement){this.$videoElement.pause(),this.$videoElement.currentTime=0,this.$videoElement.srcObject&&(this.$videoElement.srcObject=null,this.$videoElement.removeAttribute("srcObject")),this.$videoElement.src&&(this.$videoElement.src="",this.$videoElement.removeAttribute("src"));try{this.$videoElement.load()}catch(t){}this.player.$container.removeChild(this.$videoElement),this.$videoElement=null}this.trackGenerator&&(this.trackGenerator.stop(),this.trackGenerator=null),this.vwriter&&(this.vwriter.close(),this.vwriter=null),this._delayPlay=!1,this.mediaStream&&(this.mediaStream.getTracks().forEach((function(e){return e.stop()})),this.mediaStream=null),this.off(),this.player.debug.log("Video","destroy")}},{key:"videoFrameCallback",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.isDestroyed)this.player.debug.log("Video","videoFrameCallback() and isDestroyed");else{if(this.player.isWebrtcH264()||this.player.isOldHls())this.player.emit(it.timeUpdate,t.mediaTime),an(this.getHasInit())&&t.width&&t.height&&this.updateVideoInfo({width:t.width,height:t.height,encTypeCode:pt}),this.player.handleRender(),this.player.updateStats({fps:!0,ts:t.mediaTime||0,dts:t.mediaTime||0}),this.player.updateCurrentPts(1e3*(t.mediaTime||0)),this.doAddContentToWatermark();else if(rn(this.player._opt.useMSE)&&an(this.player._opt.mseUseCanvasRender)){if(this.player.mseDecoder){var i=1e3*(t.mediaTime||0)+(this.player.mseDecoder.firstRenderTime||0);this.player.updateCurrentPts(i)}this.doAddContentToWatermark()}this.supportVideoFrameCallbackHandle=this.$videoElement.requestVideoFrameCallback(this.videoFrameCallback.bind(this))}}},{key:"fixChromeVideoFlashBug",value:function(){if(this.player._opt.videoRenderSupportScale&&this._isNeedAddBackDropFilter()){var e=this.player.$container;e.style.backdropFilter="blur(0px)",e.style.transform="translateZ(0)"}}},{key:"fixMobileAutoFullscreen",value:function(){var e=la(),t=oa();(e||t)&&(this.player.debug.log("Video","fixMobileAutoFullscreen and isIOS ".concat(e," and isAndroid ").concat(t)),this.$videoElement.setAttribute("webkit-playsinline","true"),this.$videoElement.setAttribute("playsinline","true"),this.$videoElement.setAttribute("x5-video-player-type","h5-page"))}},{key:"_isNeedAddBackDropFilter",value:function(){var e=ca().type.toLowerCase();return"chrome"===e||"edge"===e}},{key:"isPaused",value:function(){var e=!0;return this.$videoElement&&(e=this.$videoElement.paused),e}},{key:"isPause",value:function(){return this.isPaused()}},{key:"_getVideoReadyState",value:function(){var e=0;return this.$videoElement&&(e=this.$videoElement.readyState),e}},{key:"_getVideoCurrentTime",value:function(){var e=0;return this.$videoElement&&(e=this.$videoElement.currentTime),e}},{key:"play",value:function(){if(this.$videoElement){var e=this._getVideoReadyState();if(this.player.debug.log("Video","play and readyState: ".concat(e)),0===e)return this.player.debug.log("Video","readyState is 0 and set _delayPlay to true and listen canplay event to play"),void(this._delayPlay=!0);this._play()}}},{key:"_play",value:function(){var e=this;this.$videoElement&&this.$videoElement.play().then((function(){e._delayPlay=!1,e.player.debug.log("Video","_play success"),e.isPlaying()?(e.player.emit(it.removeLoadingBgImage),e.isRetryPlayingTimes=0,e.isRetryPlaying=!1):setTimeout((function(){e._replay()}),100)}))["catch"]((function(t){e.player.debug.error("Video","_play error",t),e.isRetryPlaying=!1,setTimeout((function(){e._replay()}),100)}))}},{key:"_replay",value:function(){if(!this.isPlaying()&&an(this.isRetryPlaying)){if(this.isRetryPlaying=!0,this.isRetryPlayingTimes>=3)return void(this.player.isWebrtcH264()?(this.player.debug.error("Video","_replay(webrtc H264) then but not playing and retry play times is ".concat(this.isRetryPlayingTimes," and emit error")),this.player.emitError(nt.videoElementPlayingFailedForWebrtc)):(this.player.debug.error("Video","_replay then but not playing and retry play times is ".concat(this.isRetryPlayingTimes," and emit error to use canvas render")),this.player.emitError(nt.videoElementPlayingFailed)));this.player.debug.warn("Video","_play then but not playing and retry play"),this._play(),this.isRetryPlayingTimes++}}},{key:"pause",value:function(e){var t=this;this.isPlaying()&&(e?this.$videoElement&&this.$videoElement.pause():setTimeout((function(){t.$videoElement&&t.$videoElement.pause()}),100))}},{key:"clearView",value:function(){this.$videoElement&&(this.$videoElement.pause(),this.$videoElement.currentTime=0,this.$videoElement.src&&(this.$videoElement.src="",this.$videoElement.removeAttribute("src")),this.$videoElement.srcObject&&(this.$videoElement.srcObject=null,this.$videoElement.removeAttribute("srcObject")))}},{key:"screenshot",value:function(e,t,i,r){if(!this._canScreenshot())return this.player.debug.warn("Video","screenshot failed, video is not ready"),null;e=e||$r(),r=r||ut.download;var a=.92;!_i[t]&&ut[t]&&(r=t,t="png",i=void 0),"string"==typeof i&&(r=i,i=void 0),void 0!==i&&(a=Number(i));var n=this.$videoElement,s=this.$canvasElement;s.width=n.videoWidth,s.height=n.videoHeight,this.canvasContext.drawImage(n,0,0,s.width,s.height);var o=_i[t]||_i.png,c=s.toDataURL(o,a);if(this.canvasContext.clearRect(0,0,s.width,s.height),s.width=0,s.height=0,r===ut.base64)return c;var l=Xr(c);if(r===ut.blob)return l;if(r===ut.download){var u=o.split("/")[1];Ln(l,e+"."+u)}}},{key:"screenshotWatermark",value:function(e){var t=this;return new Promise((function(i,r){if(Ma(e)&&(e={filename:e}),!t._canScreenshot())return t.player.debug.warn("Video","screenshot failed, video is not ready"),r("screenshot failed, video is not ready");var a=t.$videoElement;(e=e||{}).width=a.videoWidth,e.height=a.videoHeight,e.filename=e.filename||$r(),e.format=e.format?_i[e.format]:_i.png,e.quality=Number(e.quality)||.92,e.type=e.type||ut.download;var n=t.$canvasElement;n.width=a.videoWidth,n.height=a.videoHeight,t.canvasContext.drawImage(a,0,0,n.width,n.height);var s=n.toDataURL(e.format,e.quality);t.canvasContext.clearRect(0,0,n.width,n.height),n.width=0,n.height=0,Ca(s,e).then((function(t){if(e.type===ut.base64)i(s);else{var r=Xr(t);if(e.type===ut.blob)i(r);else if(e.type===ut.download){i();var a=e.format.split("/")[1];Ln(r,e.filename+"."+a)}}}))["catch"]((function(e){r(e)}))}))}},{key:"initCanvasViewSize",value:function(){this.resize()}},{key:"clear",value:function(){var e=this.$videoElement,t=e.buffered,i=t.length?t.end(t.length-1):0;e.currentTime=i}},{key:"render",value:function(e){var t,i,r=this;if(this.vwriter){if(this.$videoElement.srcObject||(this.$videoElement.srcObject=this.mediaStream),this.isPaused()){var a=this._getVideoReadyState();if(this.player.debug.warn("Video","render() error, video is paused and readyState is "+a),4===a&&an(this.isRenderRetryPlaying)){if(this.isRenderRetryPlaying=!0,this.isRenderRetryPlayingTimes>3)return this.player.debug.error("Video","render() error, video is paused and readyState is "+a+", retry times is "+this.isRenderRetryPlayingTimes+", emit error and use canvas render"),void this.player.emitError(nt.videoElementPlayingFailed);this.$videoElement.play().then((function(){r.isRenderRetryPlayingTimes=0,r.isRenderRetryPlaying=!1,r.player.debug.log("Video","render() video is paused and replay success")}))["catch"]((function(e){r.isRenderRetryPlaying=!1,r.isRenderRetryPlayingTimes++,r.player.debug.warn("Video","render() error, video is paused and replay error ",e)}))}}if(this.player.updateStats({fps:!0,ts:e.ts||0}),e.videoFrame)this.vwriter.write(e.videoFrame),qa(e.videoFrame);else if(e.output){var n=e.output;if(this.player.faceDetectActive&&this.player.ai&&this.player.ai.faceDetector){null===this.prevAiFaceDetectTime&&(this.prevAiFaceDetectTime=$r());var s=$r();s-this.prevAiFaceDetectTime>this.player._opt.aiFaceDetectInterval&&(n=this.player.ai.faceDetector.detect({width:this.videoInfo.width,height:this.videoInfo.height,data:e.output,ts:e.ts||0}),this.prevAiFaceDetectTime=s)}if(this.player.objectDetectActive&&this.player.ai&&this.player.ai.objectDetector){null===this.prevAiObjectDetectTime&&(this.prevAiObjectDetectTime=$r());var o=$r();o-this.prevAiObjectDetectTime>this.player._opt.aiObjectDetectInterval&&(n=this.player.ai.objectDetector.detect({width:this.videoInfo.width,height:this.videoInfo.height,data:e.output,ts:e.ts||0}),this.prevAiObjectDetectTime=o)}try{var c=(t=n,i={format:"I420",codedWidth:this.videoInfo.width,codedHeight:this.videoInfo.height,timestamp:e.ts},new VideoFrame(t,i));this.vwriter.write(c),qa(c)}catch(s){this.player.debug.error("Video","render error",s),this.player.emitError(nt.wasmUseVideoRenderError,s)}}this.player.updateCurrentPts(e.ts||0),this.doAddContentToWatermark(),this.doAddAiContentToWatermark()}else this.player.debug.warn("Video","render and this.vwriter is null")}},{key:"_resize",value:function(){this.player.debug.log("Video","_resize()");var e=this.player.width,t=this.player.height,i=this.player._opt,r=i.rotate;if(i.hasControl&&!i.controlAutoHide){var a=i.playType===A?Bt:Ot;na()&&this.player.fullscreen&&i.useWebFullScreen?e-=a:t-=a}this.$videoElement.width=e,this.$videoElement.height=t,this.$videoElement.style.width=e+"px",this.$videoElement.style.height=t+"px",270!==r&&90!==r||(this.$videoElement.width=t,this.$videoElement.height=e,this.$videoElement.style.width=t+"px",this.$videoElement.style.height=e+"px");var n=(e-this.$videoElement.width)/2,s=(t-this.$videoElement.height)/2,o="contain";an(i.isResize)&&(o="fill"),i.isFullResize&&(o="none");var c="";"none"===i.mirrorRotate&&r&&(c+=" rotate("+r+"deg)"),"level"===i.mirrorRotate?c+=" rotateY(180deg)":"vertical"===i.mirrorRotate&&(c+=" rotateX(180deg)"),this.player._opt.videoRenderSupportScale&&(this.$videoElement.style.objectFit=o),this.$videoElement.style.transform=c,this.$videoElement.style.padding="0",this.$videoElement.style.left=n+"px",this.$videoElement.style.top=s+"px"}},{key:"getType",value:function(){return K}},{key:"getCurrentTime",value:function(){return this.$videoElement.currentTime}},{key:"isPlaying",value:function(){return this.$videoElement&&an(this.$videoElement.paused)&&an(this.$videoElement.ended)&&0!==this.$videoElement.playbackRate&&0!==this.$videoElement.readyState}},{key:"_canScreenshot",value:function(){return this.$videoElement&&this.$videoElement.readyState>=2}},{key:"getPlaybackQuality",value:function(){var e=null;if(this.$videoElement){if(za(this.$videoElement.getVideoPlaybackQuality)){var t=this.$videoElement.getVideoPlaybackQuality();e={droppedVideoFrames:t.droppedVideoFrames||t.corruptedVideoFrames,totalVideoFrames:t.totalVideoFrames,creationTime:t.creationTime}}else e={droppedVideoFrames:this.$videoElement.webkitDroppedFrameCount,totalVideoFrames:this.$videoElement.webkitDecodedFrameCount,creationTime:$r()};e&&(e.renderedVideoFrames=e.totalVideoFrames-e.droppedVideoFrames)}return e}},{key:"setRate",value:function(e){this.$videoElement&&(this.$videoElement.playbackRate=e)}},{key:"rate",get:function(){var e=1;return this.$videoElement&&(e=this.$videoElement.playbackRate),e}}]),i}(Sn),Bn=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e),r.controlHeight=Bt,r.bufferList=[],r.playing=!1,r.playInterval=null,r.fps=1,r.preFps=1,r.streamFps=0,r.playbackRate=1,r._firstTimestamp=null,r._renderFps=0,r._startfpsTime=null,r._startFpsTimestamp=null,r._hasCalcFps=!1,r.player.on(it.playbackPause,(function(e){e?(r.pause(),r.player.playback.isPlaybackPauseClearCache&&r.clear()):r.resume()})),r.player.debug.log("CanvasPlaybackLoader","init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){this._stopSync(),this._firstTimestamp=null,this.playing=!1,this.playbackRate=1,this.fps=1,this.preFps=1,this.bufferList=[],this._renderFps=0,this._startfpsTime=null,this._startFpsTimestamp=null,this._hasCalcFps=!1,k(Object(b["a"])(i.prototype),"destroy",this).call(this),this.player.debug.log("CanvasPlaybackLoader","destroy")}},{key:"_initCanvasRender",value:function(){this.player._opt.useWCS?(this.renderType=jt,cn()&&this.player._opt.wcsUseWebgl2Render?(this._initContextGl2(),this.webglRender&&(this.isWcsWebgl2=!0)):this._initContext2D()):this.player._opt.useWebGPU?(this.renderType=Gt,this._initContextGPU()):(this.renderType=Nt,this._initContextGl())}},{key:"_sync",value:function(){var e=this;this._stopSync(),this._doPlay(),this.playInterval=setInterval((function(){e._doPlay()}),this.fragDuration)}},{key:"_doPlay",value:function(){if(this.bufferList.length>0&&!this.player.seeking){var e=this.bufferList.shift();e&&e.buffer&&(this._doRender(e.buffer),this.player.handleRender(),this.player.playback.updateStats({ts:e.ts,tfTs:e.tfTs}))}}},{key:"_stopSync",value:function(){this.playInterval&&(clearInterval(this.playInterval),this.playInterval=null)}},{key:"_doRender",value:function(e){var t=this;if(this.player._opt.useWCS)if(this.webglRender)this.webglRender.render(e),qa(e);else if(za(e.createImageBitmap))try{e.createImageBitmap().then((function(i){t.context2D.drawImage(i,0,0,t.$videoElement.width,t.$videoElement.height),qa(e)}))}catch(i){}else this.context2D.drawImage(e,0,0,this.$videoElement.width,this.$videoElement.height),qa(e);else if(this.getCanvasType()===Nt)try{this.webglRender.renderYUV(this.$videoElement.width,this.$videoElement.height,e)}catch(r){this.player.debug.error("CanvasPlaybackLoader","doRender webgl render context is lost ".concat(this.contextGl&&this.contextGl.isContextLost()," and error: ").concat(r.toString()))}else if(this.getCanvasType()===Gt)try{if(!this.webGPURender)return void this.player.debug.warn("CanvasVideoLoader","doRender webgpu render is not init");this.webGPURender.renderYUV(this.$videoElement.width,this.$videoElement.height,e)}catch(r){this.player.debug.error("CanvasPlaybackLoader","doRender webgpu render and error: ".concat(r.toString()))}}},{key:"rate",get:function(){return this.playbackRate}},{key:"fragDuration",get:function(){return Math.ceil(1e3/(this.fps*this.playbackRate))}},{key:"bufferSize",get:function(){return this.bufferList.length}},{key:"getStreamFps",value:function(){return this.streamFps}},{key:"initFps",value:function(){this._hasCalcFps?this.player.debug.log("CanvasPlaybackLoader","initFps, has calc fps"):(this.preFps=Zr(this.player.playback.fps,1,100),this.fps=this.preFps)}},{key:"setFps",value:function(e){e!==this.fps?(e>100&&this.player.debug.warn("CanvasPlaybackLoader","setFps max",e),e<0&&this.player.debug.warn("CanvasPlaybackLoader","setFps min",e),this.fps=Zr(e,1,100),this.player.debug.log("CanvasPlaybackLoader","setFps ".concat(this.preFps," -> ").concat(this.fps)),this.player.playback.isUseFpsRender&&this._sync()):this.player.debug.log("CanvasPlaybackLoader","setFps, same fps ".concat(e))}},{key:"setStreamFps",value:function(e){this.player.debug.log("CanvasPlaybackLoader","setStreamFps",e),this._hasCalcFps=!0,this.streamFps=e,this.preFps=e,this.setFps(e)}},{key:"setRate",value:function(e){e!==this.playbackRate&&(this.playbackRate=e,this.player.playback.isUseFpsRender&&this._sync())}},{key:"render$2",value:function(e){null===this._firstTimestamp&&(this._firstTimestamp=e.ts);var t={tfTs:e.ts-this._firstTimestamp,ts:e.ts};e.videoFrame?t.buffer=e.videoFrame:t.buffer=e.output,this.bufferList.push(t),this.startRender(),this.player.handleRender(),this.player.playback.updateStats({ts:e.ts,tfTs:t.tfTs})}},{key:"startRender",value:function(){for(;!(this.bufferList.length<=0);){var e=this.bufferList.shift();this._doRender(e.buffer)}}},{key:"pushData",value:function(e){null===this._firstTimestamp&&(this._firstTimestamp=e.ts);var t={tfTs:e.ts-this._firstTimestamp,ts:e.ts};e.videoFrame?t.buffer=e.videoFrame:t.buffer=e.output;var i=this.player._opt.playbackConfig.isCacheBeforeDecodeForFpsRender;if(i||this.bufferSize>this.fps*this.playbackRate*2&&(this.player.debug.warn("CanvasPlaybackLoader","buffer size is ".concat(this.bufferSize)),this._doPlay()),this.bufferList.push(t),!this._hasCalcFps){var r=Ya(this.bufferList);null!==r&&r!==this.preFps&&(this.player.debug.log("CanvasPlaybackLoader","calc fps is ".concat(r," pre fps is ").concat(this.preFps," and updatePreFps")),this.setStreamFps(r))}if(!i){var a=this.bufferList.length,n=a/(this.fps*this.playbackRate);this.player.debug.log("CanvasPlaybackLoader","rate is",n),n<=1?this.setFps(this.preFps):(this.setFps(this.fps+Math.floor(n*this.playbackRate)),this.player.debug.warn("CanvasPlaybackLoader","rate is",n,"fps is",this.fps,"bufferListLength is",a))}}},{key:"initVideo",value:function(){this.player.playback&&this.player.playback.isUseFpsRender&&this._sync(),this.playing=!0}},{key:"initVideoDelay",value:function(){var e=this,t=this.player._opt.playbackDelayTime;t>0?this.delayTimeout=setTimeout((function(){e.initVideo()}),t):this.initVideo()}},{key:"clearView",value:function(){this.contextGl.clear(this.contextGl.COLOR_BUFFER_BIT)}},{key:"clear",value:function(){this.player._opt.useWCS&&this.bufferList.forEach((function(e){e.buffer&&qa(e.buffer)})),this.bufferList=[]}},{key:"resume",value:function(){this.player.playback.isUseFpsRender&&this._sync(),this.playing=!0}},{key:"pause",value:function(){this.player.playback.isUseFpsRender&&this._stopSync(),this.playing=!1}}]),i}(In),Mn=function(){function e(t){return Object(T["a"])(this,e),new(e.getLoaderFactory(t._opt))(t)}return Object(S["a"])(e,null,[{key:"getLoaderFactory",value:function(e){return e.useMSE?e.mseUseCanvasRender?Pn:On:e.isHls&&an(e.supportHls265)||e.isWebrtc&&an(e.isWebrtcH265)?e.useCanvasRender?Pn:On:e.useWCS?e.playType===A?Bn:!e.useOffscreen&&e.wcsUseVideoRender?On:Pn:e.playType===A?Bn:e.wasmUseVideoRender&&!e.useOffscreen?On:Pn}}]),e}(),Fn=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;Object(T["a"])(this,i),r=t.call(this),r.bufferList=[],r.player=e,r.$audio=null,r.scriptNode=null,r.workletProcessorNode=null,r.hasInitScriptNode=!1,r.audioContext=new(window.AudioContext||window.webkitAudioContext)({sampleRate:48e3}),r.gainNode=r.audioContext.createGain();var a=r.audioContext.createBufferSource();return a.buffer=r.audioContext.createBuffer(1,1,22050),a.connect(r.audioContext.destination),a.noteOn?a.noteOn(0):a.start(0),r.audioBufferSourceNode=a,r.mediaStreamAudioDestinationNode=r.audioContext.createMediaStreamDestination(),r.gainNode.gain.value=0,r.playing=!1,r.audioInfo={encType:"",channels:"",sampleRate:"",depth:""},r.init=!1,r.hasAudio=!1,r.audioResumeStateTimeout=null,r}return Object(S["a"])(i,[{key:"destroy",value:function(){this.closeAudio(),this.resetInit(),this.audioContext&&(this.audioContext.close(),this.audioContext=null),this.gainNode=null,this.hasAudio=!1,this.playing=!1,this.scriptNode&&(this.scriptNode.onaudioprocess=Jr,this.scriptNode=null),this.workletProcessorNode&&(this.workletProcessorNode.port.onmessage=Jr,this.workletProcessorNode=null),this.clearAudioResumeStateTimeout(),this.audioBufferSourceNode=null,this.mediaStreamAudioDestinationNode=null,this.hasInitScriptNode=!1,this.off()}},{key:"resetInit",value:function(){this.audioInfo={encType:"",channels:"",sampleRate:"",depth:""},this.init=!1}},{key:"getAudioInfo",value:function(){return this.audioInfo}},{key:"updateAudioInfo",value:function(e){e.encTypeCode&&(this.audioInfo.encTypeCode=e.encTypeCode,this.audioInfo.encType=kt[e.encTypeCode]),e.channels&&(this.audioInfo.channels=e.channels),e.sampleRate&&(this.audioInfo.sampleRate=e.sampleRate),e.depth&&(this.audioInfo.depth=e.depth),this.audioInfo.sampleRate&&this.audioInfo.channels&&this.audioInfo.encType&&!this.init&&(this.player.emit(it.audioInfo,this.audioInfo),this.init=!0)}},{key:"isPlaying",get:function(){return this.playing}},{key:"isMute",get:function(){return 0===this.gainNode.gain.value}},{key:"volume",get:function(){return this.gainNode.gain.value}},{key:"bufferSize",get:function(){return this.bufferList.length}},{key:"audioContextState",get:function(){var e=null;return this.audioContext&&(e=this.audioContext.state),e}},{key:"initScriptNode",value:function(){}},{key:"initMobileScriptNode",value:function(){}},{key:"initWorkletScriptNode",value:function(){}},{key:"getEngineType",value:function(){return""}},{key:"mute",value:function(e){e?(this.isMute||this.player.emit(it.mute,e),this.setVolume(0),this.clear()):(this.isMute&&this.player.emit(it.mute,e),this.setVolume(this.player.lastVolume||.5))}},{key:"setVolume",value:function(e){e=parseFloat(e).toFixed(2),isNaN(e)||(this.audioEnabled(!0),e=Zr(e,0,1),this.gainNode.gain.value=e,this.player.emit(it.volumechange,this.player.volume))}},{key:"closeAudio",value:function(){this.hasInitScriptNode&&(this.scriptNode&&this.scriptNode.disconnect(this.gainNode),this.workletProcessorNode&&this.workletProcessorNode.disconnect(this.gainNode),this.gainNode&&(this.gainNode.disconnect(this.mediaStreamAudioDestinationNode),this.$audio||this.gainNode.disconnect(this.audioContext.destination))),this.clear()}},{key:"audioEnabled",value:function(e){var t=this;e?this.isStateSuspended()&&(this.audioContext.resume().then((function(){t.player.emit(it.audioResumeState,{state:t.audioContextState,isRunning:t.isStateRunning()})})),this.audioResumeStateTimeout=setTimeout((function(){t.clearAudioResumeStateTimeout(),t.isStateSuspended()&&t.player.emit(it.audioResumeState,{state:t.audioContextState,isRunning:t.isStateRunning()})}),1e3)):this.isStateRunning()&&this.audioContext.suspend()}},{key:"isStateRunning",value:function(){return"running"===this.audioContextState}},{key:"isStateSuspended",value:function(){return"suspended"===this.audioContextState}},{key:"clearAudioResumeStateTimeout",value:function(){this.audioResumeStateTimeout&&(clearTimeout(this.audioResumeStateTimeout),this.audioResumeStateTimeout=null)}},{key:"clear",value:function(){this.bufferList=[]}},{key:"play",value:function(e,t){}},{key:"pause",value:function(){this.playing=!1}},{key:"resume",value:function(){this.playing=!0}},{key:"setRate",value:function(e){}},{key:"getAudioBufferSize",value:function(){return 0}}]),i}(fn),Un=function(){function e(t,i,r,a){Object(T["a"])(this,e),this.player=t,this.audio=i,this.channel=r,this.bufferSize=a}return Object(S["a"])(e,[{key:"extract",value:function(e,t){for(var i=this.provide(t),r=0;r<i.size;r++)e[2*r]=i.left[r],e[2*r+1]=i.right[r];return this.audio.tempAudioTimestamp=i.ts,i.size}},{key:"provide",value:function(e){var t=new Float32Array(e),i=new Float32Array(e),r=0,a=0,n=0,s=e/this.bufferSize,o=this.audio.bufferList;if(s&&o.length>=s){try{for(var c=0;c<s;c++){var l=o.shift();2===this.channel?(t.set(l.buffer[0],n),i.set(l.buffer[1],n)):(t.set(l.buffer[0],n),i.set(l.buffer[0],n)),n+=this.bufferSize,a=l.ts}}catch(c){this.player.debug.warn("Processor","provide()",c),t=new Float32Array(0),i=new Float32Array(0)}r=t.length}return{size:r,ts:a,left:t,right:i}}},{key:"destroy",value:function(){this.buffer=null,this.channel=null}}]),e}(),jn=function(){function e(){Object(T["a"])(this,e),this._vector=new Float32Array,this._position=0,this._frameCount=0}return Object(S["a"])(e,[{key:"vector",get:function(){return this._vector}},{key:"position",get:function(){return this._position}},{key:"startIndex",get:function(){return 2*this._position}},{key:"frameCount",get:function(){return this._frameCount}},{key:"endIndex",get:function(){return 2*(this._position+this._frameCount)}},{key:"clear",value:function(){this.receive(this._frameCount),this.rewind()}},{key:"put",value:function(e){this._frameCount+=e}},{key:"putSamples",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=2*(t=t||0);i>=0||(i=(e.length-r)/2);var a=2*i;this.ensureCapacity(i+this._frameCount);var n=this.endIndex;this.vector.set(e.subarray(r,r+a),n),this._frameCount+=i}},{key:"putBuffer",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;t=t||0,i>=0||(i=e.frameCount-t),this.putSamples(e.vector,e.position+t,i)}},{key:"receive",value:function(e){e>=0&&!(e>this._frameCount)||(e=this.frameCount),this._frameCount-=e,this._position+=e}},{key:"receiveSamples",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=2*t,r=this.startIndex;e.set(this._vector.subarray(r,r+i)),this.receive(t)}},{key:"extract",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.startIndex+2*t,a=2*i;e.set(this._vector.subarray(r,r+a))}},{key:"ensureCapacity",value:function(){var e=parseInt(2*(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0));if(this._vector.length<e){var t=new Float32Array(e);t.set(this._vector.subarray(this.startIndex,this.endIndex)),this._vector=t,this._position=0}else this.rewind()}},{key:"ensureAdditionalCapacity",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.ensureCapacity(this._frameCount+e)}},{key:"rewind",value:function(){this._position>0&&(this._vector.set(this._vector.subarray(this.startIndex,this.endIndex)),this._position=0)}}]),e}(),Nn=function(){function e(t){Object(T["a"])(this,e),t?(this._inputBuffer=new jn,this._outputBuffer=new jn):this._inputBuffer=this._outputBuffer=null}return Object(S["a"])(e,[{key:"inputBuffer",get:function(){return this._inputBuffer},set:function(e){this._inputBuffer=e}},{key:"outputBuffer",get:function(){return this._outputBuffer},set:function(e){this._outputBuffer=e}},{key:"clear",value:function(){this._inputBuffer.clear(),this._outputBuffer.clear()}}]),e}(),zn=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e),r.reset(),r._rate=1,r}return Object(S["a"])(i,[{key:"rate",set:function(e){this._rate=e}},{key:"reset",value:function(){this.slopeCount=0,this.prevSampleL=0,this.prevSampleR=0}},{key:"clone",value:function(){var e=new i;return e.rate=this._rate,e}},{key:"process",value:function(){var e=this._inputBuffer.frameCount;this._outputBuffer.ensureAdditionalCapacity(e/this._rate+1);var t=this.transpose(e);this._inputBuffer.receive(),this._outputBuffer.put(t)}},{key:"transpose",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(0===e)return 0;for(var t=this._inputBuffer.vector,i=this._inputBuffer.startIndex,r=this._outputBuffer.vector,a=this._outputBuffer.endIndex,n=0,s=0;this.slopeCount<1;)r[a+2*s]=(1-this.slopeCount)*this.prevSampleL+this.slopeCount*t[i],r[a+2*s+1]=(1-this.slopeCount)*this.prevSampleR+this.slopeCount*t[i+1],s+=1,this.slopeCount+=this._rate;if(this.slopeCount-=1,1!==e)e:for(;;){for(;this.slopeCount>1;)if(this.slopeCount-=1,n+=1,n>=e-1)break e;var o=i+2*n;r[a+2*s]=(1-this.slopeCount)*t[o]+this.slopeCount*t[o+2],r[a+2*s+1]=(1-this.slopeCount)*t[o+1]+this.slopeCount*t[o+3],s+=1,this.slopeCount+=this._rate}return this.prevSampleL=t[i+2*e-2],this.prevSampleR=t[i+2*e-1],s}}]),i}(Nn),Gn=function(){function e(t){Object(T["a"])(this,e),this._pipe=t}return Object(S["a"])(e,[{key:"pipe",get:function(){return this._pipe}},{key:"inputBuffer",get:function(){return this._pipe.inputBuffer}},{key:"outputBuffer",get:function(){return this._pipe.outputBuffer}},{key:"fillInputBuffer",value:function(){throw new Error("fillInputBuffer() not overridden")}},{key:"fillOutputBuffer",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.outputBuffer.frameCount<e;){var t=16384-this.inputBuffer.frameCount;if(this.fillInputBuffer(t),this.inputBuffer.frameCount<16384)break;this._pipe.process()}}},{key:"clear",value:function(){this._pipe.clear()}}]),e}(),Hn=function(){},Vn=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e,r){var a;Object(T["a"])(this,i);var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Hn;return a=t.call(this,r),a.callback=n,a.sourceSound=e,a.historyBufferSize=22050,a._sourcePosition=0,a.outputBufferPosition=0,a._position=0,a}return Object(S["a"])(i,[{key:"position",get:function(){return this._position},set:function(e){if(e>this._position)throw new RangeError("New position may not be greater than current position");var t=this.outputBufferPosition-(this._position-e);if(t<0)throw new RangeError("New position falls outside of history buffer");this.outputBufferPosition=t,this._position=e}},{key:"sourcePosition",get:function(){return this._sourcePosition},set:function(e){this.clear(),this._sourcePosition=e}},{key:"onEnd",value:function(){this.callback()}},{key:"fillInputBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=new Float32Array(2*e),i=this.sourceSound.extract(t,e,this._sourcePosition);this._sourcePosition+=i,this.inputBuffer.putSamples(t,0,i)}},{key:"extract",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.fillOutputBuffer(this.outputBufferPosition+t);var i=Math.min(t,this.outputBuffer.frameCount-this.outputBufferPosition);this.outputBuffer.extract(e,this.outputBufferPosition,i);var r=this.outputBufferPosition+i;return this.outputBufferPosition=Math.min(this.historyBufferSize,r),this.outputBuffer.receive(Math.max(r-this.historyBufferSize,0)),this._position+=i,i}},{key:"handleSampleData",value:function(e){this.extract(e.data,4096)}},{key:"clear",value:function(){k(Object(b["a"])(i.prototype),"clear",this).call(this),this.outputBufferPosition=0}}]),i}(Gn),Wn=[[124,186,248,310,372,434,496,558,620,682,744,806,868,930,992,1054,1116,1178,1240,1302,1364,1426,1488,0],[-100,-75,-50,-25,25,50,75,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[-20,-15,-10,-5,5,10,15,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[-4,-3,-2,-1,1,2,3,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],qn=-10/1.5,Kn=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e),r._quickSeek=!0,r.midBufferDirty=!1,r.midBuffer=null,r.overlapLength=0,r.autoSeqSetting=!0,r.autoSeekSetting=!0,r._tempo=1,r.setParameters(44100,0,0,8),r}return Object(S["a"])(i,[{key:"clear",value:function(){k(Object(b["a"])(i.prototype),"clear",this).call(this),this.clearMidBuffer()}},{key:"clearMidBuffer",value:function(){this.midBufferDirty&&(this.midBufferDirty=!1,this.midBuffer=null)}},{key:"setParameters",value:function(e,t,i,r){e>0&&(this.sampleRate=e),r>0&&(this.overlapMs=r),t>0?(this.sequenceMs=t,this.autoSeqSetting=!1):this.autoSeqSetting=!0,i>0?(this.seekWindowMs=i,this.autoSeekSetting=!1):this.autoSeekSetting=!0,this.calculateSequenceParameters(),this.calculateOverlapLength(this.overlapMs),this.tempo=this._tempo}},{key:"tempo",get:function(){return this._tempo},set:function(e){var t;this._tempo=e,this.calculateSequenceParameters(),this.nominalSkip=this._tempo*(this.seekWindowLength-this.overlapLength),this.skipFract=0,t=Math.floor(this.nominalSkip+.5),this.sampleReq=Math.max(t+this.overlapLength,this.seekWindowLength)+this.seekLength}},{key:"inputChunkSize",get:function(){return this.sampleReq}},{key:"outputChunkSize",get:function(){return this.overlapLength+Math.max(0,this.seekWindowLength-2*this.overlapLength)}},{key:"calculateOverlapLength",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;e=this.sampleRate*t/1e3,e=e<16?16:e,e-=e%8,this.overlapLength=e,this.refMidBuffer=new Float32Array(2*this.overlapLength),this.midBuffer=new Float32Array(2*this.overlapLength)}},{key:"checkLimits",value:function(e,t,i){return e<t?t:e>i?i:e}},{key:"calculateSequenceParameters",value:function(){var e,t;this.autoSeqSetting&&(e=150+-50*this._tempo,e=this.checkLimits(e,50,125),this.sequenceMs=Math.floor(e+.5)),this.autoSeekSetting&&(t=28.333333333333332+qn*this._tempo,t=this.checkLimits(t,15,25),this.seekWindowMs=Math.floor(t+.5)),this.seekWindowLength=Math.floor(this.sampleRate*this.sequenceMs/1e3),this.seekLength=Math.floor(this.sampleRate*this.seekWindowMs/1e3)}},{key:"quickSeek",set:function(e){this._quickSeek=e}},{key:"clone",value:function(){var e=new i;return e.tempo=this._tempo,e.setParameters(this.sampleRate,this.sequenceMs,this.seekWindowMs,this.overlapMs),e}},{key:"seekBestOverlapPosition",value:function(){return this._quickSeek?this.seekBestOverlapPositionStereoQuick():this.seekBestOverlapPositionStereo()}},{key:"seekBestOverlapPositionStereo",value:function(){var e,t,i,r=0;for(this.preCalculateCorrelationReferenceStereo(),e=0,t=Number.MIN_VALUE;r<this.seekLength;r+=1)i=this.calculateCrossCorrelationStereo(2*r,this.refMidBuffer),i>t&&(t=i,e=r);return e}},{key:"seekBestOverlapPositionStereoQuick",value:function(){var e,t,i,r,a,n=0;for(this.preCalculateCorrelationReferenceStereo(),t=Number.MIN_VALUE,e=0,r=0,a=0;n<4;n+=1){for(var s=0;Wn[n][s]&&(a=r+Wn[n][s],!(a>=this.seekLength));)i=this.calculateCrossCorrelationStereo(2*a,this.refMidBuffer),i>t&&(t=i,e=a),s+=1;r=e}return e}},{key:"preCalculateCorrelationReferenceStereo",value:function(){for(var e,t,i=0;i<this.overlapLength;i+=1)t=i*(this.overlapLength-i),e=2*i,this.refMidBuffer[e]=this.midBuffer[e]*t,this.refMidBuffer[e+1]=this.midBuffer[e+1]*t}},{key:"calculateCrossCorrelationStereo",value:function(e,t){var i=this._inputBuffer.vector;e+=this._inputBuffer.startIndex;for(var r,a=0,n=2,s=2*this.overlapLength;n<s;n+=2)r=n+e,a+=i[r]*t[n]+i[r+1]*t[n+1];return a}},{key:"overlap",value:function(e){this.overlapStereo(2*e)}},{key:"overlapStereo",value:function(e){var t=this._inputBuffer.vector;e+=this._inputBuffer.startIndex;for(var i,r,a,n,s,o=this._outputBuffer.vector,c=this._outputBuffer.endIndex,l=0,u=1/this.overlapLength;l<this.overlapLength;l+=1)r=(this.overlapLength-l)*u,a=l*u,i=2*l,n=i+e,s=i+c,o[s+0]=t[n+0]*a+this.midBuffer[i+0]*r,o[s+1]=t[n+1]*a+this.midBuffer[i+1]*r}},{key:"process",value:function(){var e,t,i;if(null===this.midBuffer){if(this._inputBuffer.frameCount<this.overlapLength)return;this.midBuffer=new Float32Array(2*this.overlapLength),this._inputBuffer.receiveSamples(this.midBuffer,this.overlapLength)}for(;this._inputBuffer.frameCount>=this.sampleReq;){e=this.seekBestOverlapPosition(),this._outputBuffer.ensureAdditionalCapacity(this.overlapLength),this.overlap(Math.floor(e)),this._outputBuffer.put(this.overlapLength),t=this.seekWindowLength-2*this.overlapLength,t>0&&this._outputBuffer.putBuffer(this._inputBuffer,e+this.overlapLength,t);var r=this._inputBuffer.startIndex+2*(e+this.seekWindowLength-this.overlapLength);this.midBuffer.set(this._inputBuffer.vector.subarray(r,r+2*this.overlapLength)),this.skipFract+=this.nominalSkip,i=Math.floor(this.skipFract),this.skipFract-=i,this._inputBuffer.receive(i)}}}]),i}(Nn),Jn=function(e,t){return(e>t?e-t:t-e)>1e-10},Yn=function(){function e(){Object(T["a"])(this,e),this.transposer=new zn(!1),this.stretch=new Kn(!1),this._inputBuffer=new jn,this._intermediateBuffer=new jn,this._outputBuffer=new jn,this._rate=0,this._tempo=0,this.virtualPitch=1,this.virtualRate=1,this.virtualTempo=1,this.calculateEffectiveRateAndTempo()}return Object(S["a"])(e,[{key:"clear",value:function(){this.transposer.clear(),this.stretch.clear()}},{key:"clone",value:function(){var t=new e;return t.rate=this.rate,t.tempo=this.tempo,t}},{key:"rate",get:function(){return this._rate},set:function(e){this.virtualRate=e,this.calculateEffectiveRateAndTempo()}},{key:"rateChange",set:function(e){this._rate=1+.01*e}},{key:"tempo",get:function(){return this._tempo},set:function(e){this.virtualTempo=e,this.calculateEffectiveRateAndTempo()}},{key:"tempoChange",set:function(e){this.tempo=1+.01*e}},{key:"pitch",set:function(e){this.virtualPitch=e,this.calculateEffectiveRateAndTempo()}},{key:"pitchOctaves",set:function(e){this.pitch=Math.exp(.69314718056*e),this.calculateEffectiveRateAndTempo()}},{key:"pitchSemitones",set:function(e){this.pitchOctaves=e/12}},{key:"inputBuffer",get:function(){return this._inputBuffer}},{key:"outputBuffer",get:function(){return this._outputBuffer}},{key:"calculateEffectiveRateAndTempo",value:function(){var e=this._tempo,t=this._rate;this._tempo=this.virtualTempo/this.virtualPitch,this._rate=this.virtualRate*this.virtualPitch,Jn(this._tempo,e)&&(this.stretch.tempo=this._tempo),Jn(this._rate,t)&&(this.transposer.rate=this._rate),this._rate>1?this._outputBuffer!=this.transposer.outputBuffer&&(this.stretch.inputBuffer=this._inputBuffer,this.stretch.outputBuffer=this._intermediateBuffer,this.transposer.inputBuffer=this._intermediateBuffer,this.transposer.outputBuffer=this._outputBuffer):this._outputBuffer!=this.stretch.outputBuffer&&(this.transposer.inputBuffer=this._inputBuffer,this.transposer.outputBuffer=this._intermediateBuffer,this.stretch.inputBuffer=this._intermediateBuffer,this.stretch.outputBuffer=this._outputBuffer)}},{key:"process",value:function(){this._rate>1?(this.stretch.process(),this.transposer.process()):(this.transposer.process(),this.stretch.process())}}]),e}(),Qn=function(){function e(t,i,r){Object(T["a"])(this,e),this.player=t,this.audio=i,this.soundTouch=new Yn,this.soundTouch.tempo=1,this.soundTouch.rate=1,this.filter=new Vn(r,this.soundTouch)}return Object(S["a"])(e,[{key:"setRate",value:function(e){e!==this.soundTouch.rate&&(this.soundTouch.tempo=e)}},{key:"provide",value:function(e){for(var t=new Float32Array(2*e),i=this.filter.extract(t,e),r=new Float32Array(i),a=new Float32Array(i),n=0;n<i;n++)r[n]=t[2*n],a[n]=t[2*n+1];return{size:i,left:r,right:a,ts:this.audio.tempAudioTimestamp||0}}},{key:"destroy",value:function(){this.soundTouch&&(this.soundTouch.clear(),this.soundTouch=null),this.filter&&(this.filter=null)}}]),e}(),Xn=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e),r.defaultPlaybackRate=1,r.playbackRate=1,r.rateProcessor=null,r.processor=null,r.scriptNodeInterval=null,r.engineType=r.getAutoAudioEngineType(),r.audioBufferSize=r.getAudioBufferSizeByType(),r.$audio=null,r._delayPlay=!1,r.eventListenList=[],r.workletUrl=null,r.clearWorkletUrlTimeout=null,r.player._opt.supportLockScreenPlayAudio&&la()&&(r.$audio=document.createElement("audio"),Object.assign(r.$audio.style,{position:"absolute",left:"-100%",top:"-100%"}),e.$container?e.$container.appendChild(r.$audio):document.body.appendChild(r.$audio),r._bindAudioProxy(),r.player.debug.log("AudioContext","create audio element")),r.scriptStartTime=0,r.player.debug.log("AudioContext","init","engineType: ".concat(r.engineType,", audioBufferSize: ").concat(r.audioBufferSize)),r}return Object(S["a"])(i,[{key:"destroy",value:function(){k(Object(b["a"])(i.prototype),"destroy",this).call(this),this.workletUrl&&(URL.revokeObjectURL(this.workletUrl),this.workletUrl=null),this.clearWorkletUrlTimeout&&(clearTimeout(this.clearWorkletUrlTimeout),this.clearWorkletUrlTimeout=null),this.eventListenList&&(this.eventListenList.forEach((function(e){e()})),this.eventListenList=[]),this.$audio&&(this.$audio.pause(),this.$audio.srcObject=null,this.$audio.parentNode&&this.$audio.parentNode.removeChild(this.$audio),this.$audio=null),this.processor&&(this.processor.destroy(),this.processor=null),this.rateProcessor&&(this.rateProcessor.destroy(),this.rateProcessor=null),this.scriptNodeInterval&&(clearInterval(this.scriptNodeInterval),this.scriptNodeInterval=null),this.defaultPlaybackRate=1,this.playbackRate=1,this.scriptStartTime=0,this.audioBufferSize=0,this.engineType=ar,this.player.debug.log("AudioContext","destroy")}},{key:"isAudioPlaying",value:function(){return this.$audio&&an(this.$audio.paused)&&an(this.$audio.ended)&&0!==this.$audio.playbackRate&&0!==this.$audio.readyState}},{key:"_bindAudioProxy",value:function(){var e=this,t=this.player.events.proxy,i=t(this.$audio,"canplay",(function(){e.player.debug.log("AudioContext","canplay"),e._delayPlay&&e._audioElementPlay()}));this.eventListenList.push(i)}},{key:"_getAudioElementReadyState",value:function(){var e=0;return this.$audio&&(e=this.$audio.readyState),e}},{key:"audioElementPlay",value:function(){if(this.$audio){var e=this._getAudioElementReadyState();if(this.player.debug.log("AudioContext","play and readyState: ".concat(e)),!(0!==e||Fa()&&la()))return this.player.debug.warn("AudioContext","readyState is 0 and set _delayPlay to true"),void(this._delayPlay=!0);this._audioElementPlay()}}},{key:"_audioElementPlay",value:function(){var e=this;this.$audio&&this.$audio.play().then((function(){e._delayPlay=!1,e.player.debug.log("AudioContext","_audioElementPlay success"),setTimeout((function(){e.isAudioPlaying()||(e.player.debug.warn("AudioContext","play failed and retry play"),e._audioElementPlay())}),100),e.isAudioPlaying()&&(e.player.debug.log("AudioContext","play success and remove document click event listener"),document.removeEventListener("click",e._audioElementPlay.bind(e)))}))["catch"]((function(t){e.player.debug.error("AudioContext","_audioElementPlay error",t),document.addEventListener("click",e._audioElementPlay.bind(e))}))}},{key:"getAudioBufferSize",value:function(){return this.audioBufferSize}},{key:"oneBufferDuration",get:function(){return this.audioBufferSize/this.audioContext.sampleRate*1e3}},{key:"isActiveEngineType",get:function(){return this.engineType===nr}},{key:"initProcessor",value:function(){this.processor=new Un(this.player,this,this.audioInfo.channels,this.audioBufferSize),this.rateProcessor=new Qn(this.player,this,this.processor)}},{key:"getAutoAudioEngineType",value:function(){var e=this,t=this.player._opt.audioEngine||ar,i=function(){t=Fa()&&oa()?nr:la()&&e.player._opt.supportLockScreenPlayAudio?ar:Ka()?rr:ar};return this.player._opt.audioEngine?this.player._opt.audioEngine===rr&&Ka()?t=rr:this.player._opt.audioEngine===nr?t=nr:this.player._opt.audioEngine===ar?t=ar:i():i(),t}},{key:"getAudioBufferSizeByType",value:function(){var e=this.engineType;this.player._opt.hasVideo;var t=this.player._opt.weiXinInAndroidAudioBufferSize;return e===rr?1024:e===nr?t||4800:1024}},{key:"initScriptNode",value:function(){this.playing=!0,this.hasInitScriptNode||(this.initProcessor(),this.engineType===rr?this.initWorkletScriptNode():this.engineType===nr?this.initIntervalScriptNode():this.engineType===ar&&this.initProcessScriptNode(),this.audioElementPlay())}},{key:"getEngineType",value:function(){return this.engineType}},{key:"isPlaybackRateSpeed",value:function(){return this.playbackRate>this.defaultPlaybackRate}},{key:"initProcessScriptNode",value:function(){var e=this,t=this.audioContext.createScriptProcessor(this.audioBufferSize,0,this.audioInfo.channels);t.onaudioprocess=function(t){var i=t.outputBuffer;e.handleScriptNodeCallback(i)},t.connect(this.gainNode),this.scriptNode=t,this.gainNode.connect(this.mediaStreamAudioDestinationNode),this.$audio?this.$audio.srcObject=this.mediaStreamAudioDestinationNode.stream:this.gainNode.connect(this.audioContext.destination),this.hasInitScriptNode=!0}},{key:"initIntervalScriptNode",value:function(){var e=this;this.scriptStartTime=0;var t=1e3*this.audioBufferSize/this.audioContext.sampleRate;this.scriptNodeInterval=setInterval((function(){if(0===e.bufferList.length||an(e.playing)||e.isMute)e.playing&&an(e.isMute)&&e.player.debug.log("AudioContext","interval script node and bufferList is ".concat(e.bufferList.length," or playing is ").concat(e.playing));else{var t=e.audioContext.createBufferSource(),i=e.audioContext.createBuffer(e.audioInfo.channels,e.audioBufferSize,e.audioContext.sampleRate);e.handleScriptNodeCallback(i,(function(){e.scriptStartTime<e.audioContext.currentTime&&(e.player.debug.log("AudioContext","script start time ".concat(e.scriptStartTime," is less than current time ").concat(e.audioContext.currentTime)),e.scriptStartTime=e.audioContext.currentTime),t.buffer=i,t.connect(e.gainNode),t.start(e.scriptStartTime),e.scriptStartTime+=i.duration}))}}),t),this.gainNode.connect(this.mediaStreamAudioDestinationNode),this.$audio?this.$audio.srcObject=this.mediaStreamAudioDestinationNode.stream:this.gainNode.connect(this.audioContext.destination),this.hasInitScriptNode=!0}},{key:"initWorkletScriptNode",value:function(){var e=this,t=Wa((function(){var e=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(){var e;return Object(T["a"])(this,i),e=t.call(this),e.audioBufferSize=1024,e.start=!1,e.channels=1,e.samplesArray=[],e.offset=0,e.state=0,e.port.onmessage=function(t){"init"===t.data.message?(e.audioBufferSize=t.data.audioBufferSize,e.start=t.data.start,e.channels=t.data.channels,e.state=0,e.offset=0,e.samplesArray=[]):"stop"===t.data.message?(e.state=0,e.start=!1,e.offset=0,e.samplesArray=[]):"data"===t.data.message?e.samplesArray.push(t.data.buffer):"zero"===t.data.message&&e.samplesArray.push({left:new Float32Array(e.audioBufferSize).fill(0),right:new Float32Array(e.audioBufferSize).fill(0)})},e}return Object(S["a"])(i,[{key:"process",value:function(e,t,i){var r=t[0][0],a=t[0][1];if(0===this.offset&&this.port.postMessage({message:"beep"}),0===this.state)this.state=1;else if(1===this.state&&this.samplesArray.length>=4)this.state=2;else if(2===this.state)for(var n=this.samplesArray[0],s=0;s<r.length;s++)1===this.channels?r[s]=n.left[s+this.offset]:2===this.channels&&(r[s]=n.left[s+this.offset],a&&(a[s]=n.right[s+this.offset]));else 1===this.channels?r.fill(0):2===this.channels&&(r.fill(0),a&&a.fill(0));return this.offset+=128,this.offset===this.audioBufferSize&&(this.offset=0,2===this.state&&this.samplesArray.shift(),0===this.samplesArray.length&&(this.state=0)),this.start}}]),i}(Object(y["a"])(AudioWorkletProcessor));registerProcessor("worklet-processor",e)}));this.workletUrl=t,this.audioContext&&this.audioContext.audioWorklet.addModule(t).then((function(){if(e.player.isDestroyed())e.player.debug.log("AudioContext","initWorkletScriptNode() player is destroyed");else if(e.audioContext){var t=[1];2===e.audioInfo.channels&&(t=[1,1]);try{e.workletProcessorNode=new AudioWorkletNode(e.audioContext,"worklet-processor",{numberOfOutputs:e.audioInfo.channels,outputChannelCount:t})}catch(i){e.player.debug.error("AudioContext","initWorkletScriptNode error",i),e.workletProcessorNode=null,e.tierDownToProcessScript()}e.workletProcessorNode&&(e.workletProcessorNode.connect(e.gainNode),e.gainNode.connect(e.mediaStreamAudioDestinationNode),e.$audio?e.$audio.srcObject=e.mediaStreamAudioDestinationNode.stream:e.gainNode.connect(e.audioContext.destination),e.hasInitScriptNode=!0,e.workletProcessorNode.port.postMessage({message:"init",audioBufferSize:e.audioBufferSize,start:!0,channels:e.audioInfo.channels}),e.workletProcessorNode.port.onmessage=function(t){e.workletProcessorNode?e.audioContext?e.handleScriptNodeCallback(e.workletProcessorNode,null,!0):e.workletProcessorNode.port.postMessage({message:"zero"}):e.player.debug.error("AudioContext","workletProcessorNode is null")})}else e.player.debug.warn("AudioContext","initWorkletScriptNode audioContext is null")})),this.clearWorkletUrlTimeout=setTimeout((function(){URL.revokeObjectURL(e.workletUrl),e.workletUrl=null,e.clearWorkletUrlTimeout=null}),ie)}},{key:"tierDownToProcessScript",value:function(){this.player.debug.log("AudioContext","tierDownToProcessScript"),this.engineType=ar,this.audioBufferSize=this.getAudioBufferSizeByType(),this.initProcessScriptNode(),this.audioElementPlay()}},{key:"handleScriptNodeCallback",value:function(e,t){var i,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];t=t||Jr;var a=e.length;r&&(i=e,a=this.audioBufferSize);var n=this.audioInfo.channels;if(this.bufferList.length&&this.playing){if(this.player._opt,this.player.openSyncAudioAndVideo()&&rn(this.player.visibility)){this.calcPlaybackRateBySync();var s=this.player.getAudioSyncVideoDiff();if(s>this.player._opt.syncAudioAndVideoDiff)return this.player.debug.warn("AudioContext","audioSyncVideoOption more than diff :".concat(s,", waiting and bufferList is ").concat(this.bufferList.length)),r?i.port.postMessage({message:"zero"}):this.fillScriptNodeOutputBuffer(e,n),void t()}var o=this._provide(a);if(0===o.size)return this.player.debug.warn("AudioContext","bufferList size is ".concat(this.bufferList.length," outputBufferLength is ").concat(a,",and bufferItem.size is 0")),r?i.port.postMessage({message:"zero"}):this.fillScriptNodeOutputBuffer(e,n),void t();o&&o.ts&&(this.player.audioTimestamp=o.ts),r?i.port.postMessage({message:"data",buffer:o}):this.fillScriptNodeOutputBuffer(e,n,o),t()}else 0===this.bufferList.length&&this.playing&&an(this.isMute)&&this.player.debug.warn("AudioContext","bufferList size is 0 and outputBufferLength is ".concat(a)),r?i.port.postMessage({message:"zero"}):this.fillScriptNodeOutputBuffer(e,n),t()}},{key:"fillScriptNodeOutputBuffer",value:function(e,t,i){if(1===t){var r=e.getChannelData(0);i?0===i.size?r.fill(0):r.set(i.left):r.fill(0)}else if(2===t){var a=e.getChannelData(0),n=e.getChannelData(1);i?0===i.size?(a.fill(0),n.fill(0)):(a.set(i.left),n.set(i.right)):(a.fill(0),n.fill(0))}}},{key:"play",value:function(e,t){this.isMute||(this.hasInitScriptNode?(this.hasAudio=!0,this.player.latestAudioTimestamp=t,this.bufferList.push({buffer:e,ts:t}),an(this.player.openSyncAudioAndVideo())&&this.calcPlaybackRateByBuffer()):this.player.debug.warn("AudioContext","play has not init script node"))}},{key:"calcPlaybackRateBySync",value:function(){if(!this.isMute&&this.playing){var e=Math.floor(2e3/this.oneBufferDuration);if(this.bufferList.length>e)return this.player.debug.warn("AudioContext","bufferList length ".concat(this.bufferList.length," more than ").concat(e,", and drop")),void this.clear();var t=this.player.getAudioSyncVideoDiff();if(this.getEngineType()===nr){if(t<-this.player._opt.syncAudioAndVideoDiff){this.player.debug.warn("AudioContext","engine active , audioSyncVideoOption ".concat(-this.player._opt.syncAudioAndVideoDiff," less than diff :").concat(t,",\n and bufferlist is ").concat(this.bufferList.length));for(var i=this.player.getRenderCurrentPts();this.bufferList.length>0;){var r=this.bufferList[0],a=r.ts-i;if(a>-this.player._opt.syncAudioAndVideoDiff/2){this.player.audioTimestamp=r.ts,this.player.debug.log("AudioContext","engine active , audioSyncVideoOption\n item.ts is ".concat(r.ts," and currentVideoTimestamp is ").concat(i,", diff is ").concat(a," > -").concat(this.player._opt.syncAudioAndVideoDiff/2," and end"));break}this.bufferList.shift(),this.player.audioTimestamp=r.ts}}}else{var n=this.playbackRate;t<-this.player._opt.syncAudioAndVideoDiff?n===this.defaultPlaybackRate&&(this.player.debug.log("AudioContext","audioSyncVideoOption ".concat(-this.player._opt.syncAudioAndVideoDiff," less than diff :").concat(t,",\n speed up, playbackRate is ").concat(n,",\n and bufferList is ").concat(this.bufferList.length)),n=this.defaultPlaybackRate+.2):t>-this.player._opt.syncAudioAndVideoDiff/2&&n!==this.defaultPlaybackRate&&(this.player.debug.log("AudioContext","diff is ".concat(t," > -").concat(this.player._opt.syncAudioAndVideoDiff/2," and speed to 1")),n=this.defaultPlaybackRate),this.updatePlaybackRate(n)}}}},{key:"calcPlaybackRateByBuffer",value:function(){if(!this.isMute&&this.playing){var e=this.playbackRate,t=1e3,i=5e3;this.isAudioPlayer&&(t=this.player._opt.videoBufferDelay,i=this.player._opt.videoBufferMax);var r=Math.floor(t/this.oneBufferDuration),a=Math.floor(i/this.oneBufferDuration);if(this.bufferList.length>a)return this.player.debug.warn("AudioContext","bufferList length ".concat(this.bufferList.length," more than ").concat(a,", and drop")),void this.clear();this.getEngineType()!==nr&&(this.bufferList.length>r?(e=this.defaultPlaybackRate+.2,this.player.debug.log("AudioContext","bufferList length ".concat(this.bufferList.length," more than ").concat(r,", speed up, playbackRate is ").concat(e))):this.bufferList.length<r/2&&(e=this.defaultPlaybackRate),this.updatePlaybackRate(e))}}},{key:"updatePlaybackRate",value:function(e){this.rateProcessor&&(this.playbackRate=e,this.rateProcessor.setRate(this.playbackRate))}},{key:"_provide",value:function(e){return(1===this.playbackRate?this.processor:this.rateProcessor).provide(e)}}]),i}(Fn),$n=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this),r.player=e,r.$video=e.video.$videoElement,r.init=!1,r.player._opt.hlsUseCanvasRender&&(r.$video=r.player.hlsDecoder.$videoElement),r.player._opt.webrtcUseCanvasRender&&(r.$video=r.player.webrtc.$videoElement),r.audioInfo={encType:"",channels:"",sampleRate:""},r.player.debug.log("Audio","init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){this.resetInit(),this.off(),this.player.debug.log("Audio","destroy")}},{key:"resetInit",value:function(){this.init=!1,this.audioInfo={encType:"",channels:"",sampleRate:""}}},{key:"getAudioInfo",value:function(){return this.audioInfo}},{key:"updateAudioInfo",value:function(e){Ta(e.encTypeCode)&&(this.audioInfo.encType=kt[e.encTypeCode]),Ta(e.encType)&&(this.audioInfo.encType=e.encType),Ta(e.channels)&&(this.audioInfo.channels=e.channels),Ta(e.sampleRate)&&(this.audioInfo.sampleRate=e.sampleRate),Ta(this.audioInfo.sampleRate)&&Ta(this.audioInfo.channels)&&Ta(this.audioInfo.encType)&&!this.init&&(this.player.debug.log("Audio","audioInfo",JSON.stringify(this.audioInfo)),this.player.emit(it.audioInfo,this.audioInfo),this.init=!0)}},{key:"isPlaying",get:function(){return!0}},{key:"volume",get:function(){return rn(this.$video.muted)?0:this.$video.volume}},{key:"isMute",get:function(){return 0===this.$video.volume||rn(this.$video.muted)}},{key:"mute",value:function(e){this.setVolume(e?0:this.player.lastVolume||.5)}},{key:"setVolume",value:function(e){e=parseFloat(e),isNaN(e)||(e=Zr(e,0,1),this.$video.muted&&(this.$video.muted=!1),la()&&(this.$video.muted=0===e),this.$video.volume=e,this.player.emit(it.volumechange,this.player.volume))}},{key:"clear",value:function(){}},{key:"play",value:function(){}},{key:"pause",value:function(){}},{key:"resume",value:function(){}},{key:"getEngineType",value:function(){return"audio"}},{key:"isPlaybackRateSpeed",value:function(){return!1}},{key:"getAudioBufferSize",value:function(){return 0}}]),i}(fn),Zn=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e),r.delayTimeout=null,r.player.on(it.playbackPause,(function(e){r.listenPlaybackPause(e)})),r.player.debug.log("AudioPlaybackContext","init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){this.delayTimeout&&(clearTimeout(this.delayTimeout),this.delayTimeout=null),k(Object(b["a"])(i.prototype),"destroy",this).call(this),this.player.debug.log("AudioPlaybackLoader","destroy")}},{key:"listenPlaybackPause",value:function(e){e?(this.pause(),this.player.playback.isPlaybackPauseClearCache&&this.clear()):this.resume()}},{key:"initScriptNodeDelay",value:function(){var e=this,t=this.player._opt.playbackDelayTime;t>0?this.delayTimeout=setTimeout((function(){e.initScriptNode()}),t):this.initScriptNode()}},{key:"setRate",value:function(e){e!==this.defaultPlaybackRate&&this.rateProcessor&&(this.player.debug.log("AudioPlaybackContext","setRate",e),this.defaultPlaybackRate=e,this.updatePlaybackRate(e))}}]),i}(Xn),es=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e),r.TAG_NAME="AudioPlayerLoader",r.isAudioPlayer=!0,r.player.debug.log(r.TAG_NAME,"init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){k(Object(b["a"])(i.prototype),"destroy",this).call(this),this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"play",value:function(e,t){an(this.playing)||k(Object(b["a"])(i.prototype),"play",this).call(this,e,t)}},{key:"pause",value:function(){this.player.debug.log(this.TAG_NAME,"pause"),this.playing=!1,this.clear()}},{key:"resume",value:function(){this.player.debug.log(this.TAG_NAME,"resume"),this.playing=!0}}]),i}(Xn),is=function(){function e(t){return Object(T["a"])(this,e),new(e.getLoaderFactory(t._opt))(t)}return Object(S["a"])(e,null,[{key:"getLoaderFactory",value:function(e){return e.playType===A?Zn:e.playType===d?es:e.isHls&&an(e.supportHls265)||e.isWebrtc&&an(e.isWebrtcH265)?$n:Xn}}]),e}();function rs(){function e(e){return!0===e||"true"===e}function t(e){return!1===e||"false"===e}var i="The user aborted a request",r="AbortError",a="AbortError",n="fetch",s="destroy",o="buffer",c="fetchError",l="fetchClose",u="fetchSuccess",d="idle",h="buffering",f="complete",p=new(function(){function n(){Object(T["a"])(this,n),this._requestAbort=!1,this._status=d,this.writableStream=null,this.isChrome=!1,this.abortController=new AbortController}return Object(S["a"])(n,[{key:"destroy",value:function(){this.abort(),this.writableStream&&t(this.writableStream.locked)&&this.writableStream.close()["catch"]((function(e){})),this.writableStream=null,this._status=d}},{key:"fetchStream",value:function(t){var n=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},p=Object.assign({signal:this.abortController.signal},{headers:s.headers||{}});fetch(t,p).then((function(t){if(n._requestAbort)return n._status=d,void t.body.cancel();if(!function(e){return e.ok&&e.status>=200&&e.status<=299}(t))return n.abort(),void postMessage({cmd:c,message:"fetch response status is ".concat(t.status," and ok is ").concat(t.ok)});if(postMessage({cmd:u}),("undefined"===typeof WritableStream?"undefined":Object(E["a"])(WritableStream))<"u")n.writableStream=new WritableStream({write:function(t){n.abortController&&n.abortController.signal&&n.abortController.signal.aborted||e(n._requestAbort)?n._status=f:(n._status=h,postMessage({cmd:o,buffer:t},[t.buffer]))},close:function(){n._status=f,postMessage({cmd:l})},abort:function(e){if(n.abortController&&n.abortController.signal&&n.abortController.signal.aborted)n._status=f;else{var t=e.toString();-1===t.indexOf(i)&&-1===t.indexOf(r)&&e.name!==a&&(n.abort(),postMessage({cmd:c,message:e.toString()}))}}}),t.body.pipeTo(n.writableStream);else{var s=t.body.getReader(),p=function t(){s.read().then((function(i){var r=i.done,a=i.value;if(r)return n._status=f,void postMessage({cmd:l});n.abortController&&n.abortController.signal&&n.abortController.signal.aborted||e(n._requestAbort)?n._status=f:(n._status=h,postMessage({cmd:o,buffer:a},[a.buffer]),t())}))["catch"]((function(e){if(n.abortController&&n.abortController.signal&&n.abortController.signal.aborted)n._status=f;else{var t=e.toString();-1===t.indexOf(i)&&-1===t.indexOf(r)&&e.name!==a&&(n.abort(),postMessage({cmd:c,message:e.toString()}))}}))};p()}}))["catch"]((function(e){n.abortController&&n.abortController.signal&&n.abortController.signal.aborted||"AbortError"!==e.name&&(n.abort(),postMessage({cmd:c,message:e.toString()}))}))}},{key:"abort",value:function(){if(this._requestAbort=!0,this._status!==h||t(p.isChrome)){if(this.abortController){try{this.abortController.abort()}catch(e){}this.abortController=null}}else this.abortController=null}}]),n}());self.onmessage=function(t){var i=t.data;switch(i.cmd){case n:p.isChrome=e(i.isChrome),p.fetchStream(i.url,JSON.parse(i.options));break;case s:p.destroy(),p=null}}}var as=function(e){Object(_["a"])(r,e);var i=Object(w["a"])(r);function r(e){var t;return Object(T["a"])(this,r),t=i.call(this),t.TAG_NAME="FetchWorkerLoader",t.player=e,t.playing=!1,t.fetchWorker=null,t.workerClearTimeout=null,t.workerUrl=null,t.abortController=new AbortController,t.streamRate=ra((function(t){e.emit(it.kBps,(t/1024).toFixed(2))})),t.streamRateInterval=null,t._initFetchWorker(),e.debug.log(t.TAG_NAME,"init"),t}return Object(S["a"])(r,[{key:"destroy",value:function(){this.off(),this.workerUrl&&(window.URL.revokeObjectURL(this.workerUrl),this.workerUrl=null),this.workerClearTimeout&&(clearTimeout(this.workerClearTimeout),this.workerClearTimeout=null),this.fetchWorker&&(this.fetchWorker.postMessage({cmd:Xe}),this.fetchWorker.terminate(),this.fetchWorker=null),this._stopStreamRateInterval(),this.streamRate=null,this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"_initFetchWorker",value:function(){var e=this,t=ln(rs.toString()),i=new Blob([t],{type:"text/javascript"}),r=URL.createObjectURL(i),a=new Worker(r);this.workerUrl=r,this.workerClearTimeout=setTimeout((function(){window.URL.revokeObjectURL(e.workerUrl),e.workerUrl=null,e.workerClearTimeout=null}),ie),a.onmessage=function(t){var i=e.player.demux,r=t.data;switch(r.cmd){case $e:e.streamRate&&e.streamRate(r.buffer.byteLength),i.dispatch(r.buffer);break;case tt:e.emit(it.streamSuccess),e._startStreamRateInterval();break;case et:i.close(),e.emit(it.streamEnd);break;case Ze:i.close(),e.emit(nt.fetchError,r.message)}},this.fetchWorker=a}},{key:"_startStreamRateInterval",value:function(){var e=this;this._stopStreamRateInterval(),this.streamRateInterval=setInterval((function(){e.streamRate&&e.streamRate(0)}),1e3)}},{key:"_stopStreamRateInterval",value:function(){this.streamRateInterval&&(clearInterval(this.streamRateInterval),this.streamRateInterval=null)}},{key:"fetchStream",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.player._times.streamStart=$r(),this.fetchWorker.postMessage({cmd:Qe,url:e,isChrome:Ua(),options:JSON.stringify(t)})}},{key:"getStreamType",value:function(){return t}}]),r}(fn),ns=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this),r.player=e,r.socket=null,r.socketStatus=st,r.wsUrl=null,r.requestAbort=!1,r.socketDestroyFnList=[],r.streamRate=ra((function(t){e.emit(it.kBps,(t/1024).toFixed(2))})),r.streamRateInterval=null,e.debug.log("WebsocketStream","init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){this._closeWebSocket(),this.stopStreamRateInterval(),this.wsUrl=null,this.off(),this.player.debug.log("WebsocketStream","destroy")}},{key:"startStreamRateInterval",value:function(){var e=this;this.stopStreamRateInterval(),this.streamRateInterval=setInterval((function(){e.streamRate&&e.streamRate(0)}),1e3)}},{key:"stopStreamRateInterval",value:function(){this.streamRateInterval&&(clearInterval(this.streamRateInterval),this.streamRateInterval=null)}},{key:"_createWebSocket",value:function(){var e=this,t=this.player,i=t.debug,r=t.events.proxy,a=t.demux;this.socket=new WebSocket(this.wsUrl),this.socket.binaryType="arraybuffer";var n=r(this.socket,"open",(function(){i.log("WebsocketStream","socket open"),e.socketStatus=ot,e.emit(it.streamSuccess),e.player.emit(it.websocketOpen),e.startStreamRateInterval()})),s=r(this.socket,"message",(function(t){e.streamRate&&e.streamRate(t.data.byteLength),e._handleMessage(t.data)})),o=r(this.socket,"close",(function(t){if(i.log("WebsocketStream","socket close and code is ".concat(t.code)),1006===t.code&&i.error("WebsocketStream","socket close abnormally and code is ".concat(t.code)),rn(e.requestAbort))return e.requestAbort=!1,void i.log("WebsocketStream","socket close and requestAbort is true");a.close(),e.socketStatus=ct,e.player.emit(it.websocketClose),e.emit(it.streamEnd)})),c=r(this.socket,"error",(function(t){i.error("WebsocketStream","socket error",t),e.socketStatus=lt,e.emit(nt.websocketError,t),a.close(),i.log("WebsocketStream","socket error:",t.isTrusted?"websocket user aborted":"websocket error")}));this.socketDestroyFnList.push(n,s,o,c)}},{key:"_closeWebSocket",value:function(){this.socketDestroyFnList.forEach((function(e){return e()})),!this.socket||0!==this.socket.readyState&&1!==this.socket.readyState?this.socket&&this.player.debug.log("WebsocketStream","_closeWebSocket() socket is null or socket status is ".concat(this.socket&&this.socket.readyState)):(this.requestAbort=!0,this.socket.close(1e3,"Client disconnecting")),this.socket=null,this.socketStatus=st,this.streamRate=null}},{key:"_handleMessage",value:function(e){var t=this.player.demux;t?t.dispatch(e):this.player.debug.warn("WebsocketStream","websocket handle message demux is null")}},{key:"fetchStream",value:function(e,t){this.player._times.streamStart=$r(),this.wsUrl=e,this._createWebSocket()}},{key:"sendMessage",value:function(e){this.socket?this.socketStatus===ot?this.socket.send(e):this.player.debug.error("WebsocketStream","websocket send message error and socket status is ".concat(this.socketStatus)):this.player.debug.error("WebsocketStream","websocket send message socket is null")}},{key:"resetFetchStream",value:function(){this._closeWebSocket(),this._createWebSocket()}},{key:"getStreamType",value:function(){return r}}]),i}(fn),ss=function(e){Object(_["a"])(r,e);var t=Object(w["a"])(r);function r(e){var i;return Object(T["a"])(this,r),i=t.call(this),i.player=e,e.debug.log("HlsStream","init"),i}return Object(S["a"])(r,[{key:"destroy",value:function(){this.off(),this.player.debug.log("HlsStream","destroy")}},{key:"fetchStream",value:function(e){var t=this,i=this.player,r=i.hlsDecoder;i.debug;this.player._times.streamStart=$r(),r.loadSource(e).then((function(){t.player.debug.log("HlsStream","loadSource success"),t.emit(it.streamSuccess)}))["catch"]((function(e){t.emit(nt.hlsError,e)}))}},{key:"getStreamType",value:function(){return i}}]),r}(fn),os=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this),r.player=e,r.webrctUrl=null,e.debug.log("WebrtcStream","init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){this.webrctUrl=null,this.off(),this.player.debug.log("WebrtcStream","destroy")}},{key:"fetchStream",value:function(e){var t=this,i=this.player,r=i.webrtc;i.debug;if(this.player._times.streamStart=$r(),this.webrctUrl=e.replace("webrtc:",window.location.protocol),-1===this.webrctUrl.indexOf("/webrtc/play")&&this.player.isWebrtcForM7S()){var a=new URL(this.webrctUrl),n="/webrtc/play"+a.pathname;this.webrctUrl=a.origin+n+a.search,this.player.debug.log("WebrtcStream","original url is ".concat(e,", and new url is: ").concat(this.webrctUrl))}r.loadSource(this.webrctUrl).then((function(){t.player.debug.log("WebrtcStream","loadSource success"),t.emit(it.streamSuccess)}))["catch"]((function(e){t.emit(nt.webrtcError,e)}))}},{key:"getStreamType",value:function(){return n}}]),i}(fn),cs=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this),r.player=e,r.transport=null,r.wtUrl=null,r.streamRate=ra((function(t){e.emit(it.kBps,(t/1024).toFixed(2))})),r.streamRateInterval=null,e.debug.log("WebTransportLoader","init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){this.abort(),this.off(),this.player.debug.log("WebTransportLoader","destroy")}},{key:"startStreamRateInterval",value:function(){var e=this;this.stopStreamRateInterval(),this.streamRateInterval=setInterval((function(){e.streamRate&&e.streamRate(0)}),1e3)}},{key:"stopStreamRateInterval",value:function(){this.streamRateInterval&&(clearInterval(this.streamRateInterval),this.streamRateInterval=null)}},{key:"_createWebTransport",value:function(){var e=this,t=this.player,i=(t.debug,t.events.proxy,t.demux);try{this.transport=new WebTransport(this.wtUrl),this.transport.ready.then((function(){e.emit(it.streamSuccess),e.startStreamRateInterval(),e.transport.createBidirectionalStream().then((function(e){e.readable.pipeTo(new WritableStream(i.input))}))}))["catch"]((function(t){e.player.debug.warn("WebTransportLoader","_createWebTransport-ready",t)}))}catch(r){this.player.debug.warn("WebTransportLoader","_createWebTransport",r)}}},{key:"fetchStream",value:function(e){this.player._times.streamStart=$r(),this.wtUrl=e.replace(/^wt:/,"https:"),this._createWebTransport()}},{key:"abort",value:function(){if(this.transport)try{this.transport.close(),this.transport=null}catch(e){this.transport=null}}},{key:"getStreamType",value:function(){return c}}]),i}(fn),ls=function(e){Object(_["a"])(a,e);var i=Object(w["a"])(a);function a(e){var t;return Object(T["a"])(this,a),t=i.call(this),t.player=e,t.workUrl=null,e.debug.log("WorkerStream","init"),t}return Object(S["a"])(a,[{key:"destroy",value:function(){this.workUrl=null,this.off(),this.player.debug.log("WorkerStream","destroy")}},{key:"sendMessage",value:function(e){this.player.decoderWorker.workerSendMessage(e)}},{key:"fetchStream",value:function(e){this.workUrl=e,this.player._times.streamStart=$r(),this.player.decoderWorker.workerFetchStream(e)}},{key:"getStreamType",value:function(){var e=this.player._opt.protocol;return l+" "+(2===e?t:r)}}]),a}(fn),us=function(){function e(t){return Object(T["a"])(this,e),new(e.getLoaderFactory(t._opt))(t)}return Object(S["a"])(e,null,[{key:"getLoaderFactory",value:function(e){var t=e.protocol,i=e.useWasm,r=e.playType,a=e.useWCS,n=e.useMSE,s=e.demuxUseWorker;return 2===t?r===d?ls:r===u?i&&!Va(e)||s?ls:as:a||n?s?ls:as:ls:1===t?r===d?ls:r===u?i&&!Va(e)||s?ls:ns:a||n?s?ls:ns:ls:3===t?ss:4===t?os:5===t?cs:void 0}}]),e}(),ds=Or((function(e){function t(e,a){if(!e)throw"First parameter is required.";a=new i(e,a=a||{type:"video"});var n=this;function s(t){t&&(a.initCallback=function(){t(),t=a.initCallback=null});var i=new r(e,a);(f=new i(e,a)).record(),h("recording"),a.disableLogs||console.log("Initialized recorderType:",f.constructor.name,"for output-type:",a.type)}function o(e){if(e=e||function(){},f){if("paused"===n.state)return n.resumeRecording(),void setTimeout((function(){o(e)}),1);"recording"===n.state||a.disableLogs||console.warn('Recording state should be: "recording", however current state is: ',n.state),a.disableLogs||console.log("Stopped recording "+a.type+" stream."),"gif"!==a.type?f.stop(t):(f.stop(),t()),h("stopped")}else m();function t(t){if(f){Object.keys(f).forEach((function(e){"function"!=typeof f[e]&&(n[e]=f[e])}));var i=f.blob;if(!i){if(!t)throw"Recording failed.";f.blob=i=t}if(i&&!a.disableLogs&&console.log(i.type,"->",y(i.size)),e){var r;try{r=u.createObjectURL(i)}catch(s){}"function"==typeof e.call?e.call(n,r):e(r)}a.autoWriteToDisk&&l((function(e){var t={};t[a.type+"Blob"]=e,L.Store(t)}))}else"function"==typeof e.call?e.call(n,""):e("")}}function c(e){postMessage((new FileReaderSync).readAsDataURL(e))}function l(e,t){if(!e)throw"Pass a callback function over getDataURL.";var i=t?t.blob:(f||{}).blob;if(!i)return a.disableLogs||console.warn("Blob encoder did not finish its job yet."),void setTimeout((function(){l(e,t)}),1e3);if(("undefined"===typeof Worker?"undefined":Object(E["a"])(Worker))>"u"||navigator.mozGetUserMedia){var r=new FileReader;r.readAsDataURL(i),r.onload=function(t){e(t.target.result)}}else{var n=function(e){try{var t=u.createObjectURL(new Blob([e.toString(),"this.onmessage = function (eee) {"+e.name+"(eee.data);}"],{type:"application/javascript"})),i=new Worker(t);return u.revokeObjectURL(t),i}catch(r){}}(c);n.onmessage=function(t){e(t.data)},n.postMessage(i)}}function d(e){e=e||0,"paused"!==n.state?"stopped"!==n.state&&(e>=n.recordingDuration?o(n.onRecordingStopped):(e+=1e3,setTimeout((function(){d(e)}),1e3))):setTimeout((function(){d(e)}),1e3)}function h(e){n&&(n.state=e,"function"==typeof n.onStateChanged.call?n.onStateChanged.call(n,e):n.onStateChanged(e))}var f,p='It seems that recorder is destroyed or "startRecording" is not invoked for '+a.type+" recorder.";function m(){!0!==a.disableLogs&&console.warn(p)}var g={startRecording:function(t){return a.disableLogs||console.log("RecordRTC version: ",n.version),t&&(a=new i(e,t)),a.disableLogs||console.log("started recording "+a.type+" stream."),f?(f.clearRecordedData(),f.record(),h("recording"),n.recordingDuration&&d(),n):(s((function(){n.recordingDuration&&d()})),n)},stopRecording:o,pauseRecording:function(){f?"recording"===n.state?(h("paused"),f.pause(),a.disableLogs||console.log("Paused recording.")):a.disableLogs||console.warn("Unable to pause the recording. Recording state: ",n.state):m()},resumeRecording:function(){f?"paused"===n.state?(h("recording"),f.resume(),a.disableLogs||console.log("Resumed recording.")):a.disableLogs||console.warn("Unable to resume the recording. Recording state: ",n.state):m()},initRecorder:s,setRecordingDuration:function(e,t){if(void 0===e)throw"recordingDuration is required.";if("number"!=typeof e)throw"recordingDuration must be a number.";return n.recordingDuration=e,n.onRecordingStopped=t||function(){},{onRecordingStopped:function(e){n.onRecordingStopped=e}}},clearRecordedData:function(){f?(f.clearRecordedData(),a.disableLogs||console.log("Cleared old recorded data.")):m()},getBlob:function(){if(f)return f.blob;m()},getDataURL:l,toURL:function(){if(f)return u.createObjectURL(f.blob);m()},getInternalRecorder:function(){return f},save:function(e){f?v(f.blob,e):m()},getFromDisk:function(e){f?t.getFromDisk(a.type,e):m()},setAdvertisementArray:function(e){a.advertisement=[];for(var t=e.length,i=0;i<t;i++)a.advertisement.push({duration:i,image:e[i]})},blob:null,bufferSize:0,sampleRate:0,buffer:null,reset:function(){"recording"!==n.state||a.disableLogs||console.warn("Stop an active recorder."),f&&"function"==typeof f.clearRecordedData&&f.clearRecordedData(),f=null,h("inactive"),n.blob=null},onStateChanged:function(e){a.disableLogs||console.log("Recorder state changed:",e)},state:"inactive",getState:function(){return n.state},destroy:function(){var e=a.disableLogs;a={disableLogs:!0},n.reset(),h("destroyed"),g=n=null,_.AudioContextConstructor&&(_.AudioContextConstructor.close(),_.AudioContextConstructor=null),a.disableLogs=e,a.disableLogs||console.log("RecordRTC is destroyed.")},version:"5.6.2"};if(!this)return n=g,g;for(var b in g)this[b]=g[b];return n=this,g}function i(e,t){return t.recorderType||t.type||(t.audio&&t.video?t.type="video":t.audio&&!t.video&&(t.type="audio")),t.recorderType&&!t.type&&(t.recorderType===C||t.recorderType===x||t.recorderType===O?t.type="video":t.recorderType===D?t.type="gif":t.recorderType===T?t.type="audio":t.recorderType===S&&(A(e,"audio").length&&A(e,"video").length||!A(e,"audio").length&&A(e,"video").length?t.type="video":A(e,"audio").length&&!A(e,"video").length&&(t.type="audio"))),("undefined"===typeof MediaRecorder?"undefined":Object(E["a"])(MediaRecorder))<"u"&&"requestData"in MediaRecorder.prototype&&(t.mimeType||(t.mimeType="video/webm"),t.type||(t.type=t.mimeType.split("/")[0]),t.bitsPerSecond),t.type||(t.mimeType&&(t.type=t.mimeType.split("/")[0]),t.type||(t.type="audio")),t}function r(e,t){var i;return(p||d||h)&&(i=T),("undefined"===typeof MediaRecorder?"undefined":Object(E["a"])(MediaRecorder))<"u"&&"requestData"in MediaRecorder.prototype&&!p&&(i=S),"video"===t.type&&(p||h)&&(i=C,("undefined"===typeof ReadableStream?"undefined":Object(E["a"])(ReadableStream))<"u"&&(i=O)),"gif"===t.type&&(i=D),"canvas"===t.type&&(i=x),w()&&i!==x&&i!==D&&("undefined"===typeof MediaRecorder?"undefined":Object(E["a"])(MediaRecorder))<"u"&&"requestData"in MediaRecorder.prototype&&(A(e,"video").length||A(e,"audio").length)&&("audio"===t.type?"function"==typeof MediaRecorder.isTypeSupported&&MediaRecorder.isTypeSupported("audio/webm")&&(i=S):"function"==typeof MediaRecorder.isTypeSupported&&MediaRecorder.isTypeSupported("video/webm")&&(i=S)),e instanceof Array&&e.length&&(i=P),t.recorderType&&(i=t.recorderType),!t.disableLogs&&i&&i.name&&console.log("Using recorderType:",i.name||i.constructor.name),!i&&m&&(i=S),i}function a(e){this.addStream=function(t){t&&(e=t)},this.mediaType={audio:!0,video:!0},this.startRecording=function(){var i,r=this.mediaType,a=this.mimeType||{audio:null,video:null,gif:null};if("function"!=typeof r.audio&&w()&&!A(e,"audio").length&&(r.audio=!1),"function"!=typeof r.video&&w()&&!A(e,"video").length&&(r.video=!1),"function"!=typeof r.gif&&w()&&!A(e,"video").length&&(r.gif=!1),!r.audio&&!r.video&&!r.gif)throw"MediaStream must have either audio or video tracks.";if(r.audio&&(i=null,"function"==typeof r.audio&&(i=r.audio),this.audioRecorder=new t(e,{type:"audio",bufferSize:this.bufferSize,sampleRate:this.sampleRate,numberOfAudioChannels:this.numberOfAudioChannels||2,disableLogs:this.disableLogs,recorderType:i,mimeType:a.audio,timeSlice:this.timeSlice,onTimeStamp:this.onTimeStamp}),r.video||this.audioRecorder.startRecording()),r.video){i=null,"function"==typeof r.video&&(i=r.video);var n=e;if(w()&&r.audio&&"function"==typeof r.audio){var s=A(e,"video")[0];f?((n=new g).addTrack(s),i&&i===C&&(i=S)):(n=new g).addTrack(s)}this.videoRecorder=new t(n,{type:"video",video:this.video,canvas:this.canvas,frameInterval:this.frameInterval||10,disableLogs:this.disableLogs,recorderType:i,mimeType:a.video,timeSlice:this.timeSlice,onTimeStamp:this.onTimeStamp,workerPath:this.workerPath,webAssemblyPath:this.webAssemblyPath,frameRate:this.frameRate,bitrate:this.bitrate}),r.audio||this.videoRecorder.startRecording()}if(r.audio&&r.video){var o=this,c=!0===w();(r.audio instanceof T&&r.video||!0!==r.audio&&!0!==r.video&&r.audio!==r.video)&&(c=!1),!0===c?(o.audioRecorder=null,o.videoRecorder.startRecording()):o.videoRecorder.initRecorder((function(){o.audioRecorder.initRecorder((function(){o.videoRecorder.startRecording(),o.audioRecorder.startRecording()}))}))}r.gif&&(i=null,"function"==typeof r.gif&&(i=r.gif),this.gifRecorder=new t(e,{type:"gif",frameRate:this.frameRate||200,quality:this.quality||10,disableLogs:this.disableLogs,recorderType:i,mimeType:a.gif}),this.gifRecorder.startRecording())},this.stopRecording=function(e){e=e||function(){},this.audioRecorder&&this.audioRecorder.stopRecording((function(t){e(t,"audio")})),this.videoRecorder&&this.videoRecorder.stopRecording((function(t){e(t,"video")})),this.gifRecorder&&this.gifRecorder.stopRecording((function(t){e(t,"gif")}))},this.pauseRecording=function(){this.audioRecorder&&this.audioRecorder.pauseRecording(),this.videoRecorder&&this.videoRecorder.pauseRecording(),this.gifRecorder&&this.gifRecorder.pauseRecording()},this.resumeRecording=function(){this.audioRecorder&&this.audioRecorder.resumeRecording(),this.videoRecorder&&this.videoRecorder.resumeRecording(),this.gifRecorder&&this.gifRecorder.resumeRecording()},this.getBlob=function(e){var t={};return this.audioRecorder&&(t.audio=this.audioRecorder.getBlob()),this.videoRecorder&&(t.video=this.videoRecorder.getBlob()),this.gifRecorder&&(t.gif=this.gifRecorder.getBlob()),e&&e(t),t},this.destroy=function(){this.audioRecorder&&(this.audioRecorder.destroy(),this.audioRecorder=null),this.videoRecorder&&(this.videoRecorder.destroy(),this.videoRecorder=null),this.gifRecorder&&(this.gifRecorder.destroy(),this.gifRecorder=null)},this.getDataURL=function(e){function t(e,t){if(("undefined"===typeof Worker?"undefined":Object(E["a"])(Worker))<"u"){var i=function(e){var t,i=u.createObjectURL(new Blob([e.toString(),"this.onmessage = function (eee) {"+e.name+"(eee.data);}"],{type:"application/javascript"})),r=new Worker(i);if(void 0!==u)t=u;else{if(("undefined"===typeof webkitURL?"undefined":Object(E["a"])(webkitURL))>"u")throw"Neither URL nor webkitURL detected.";t=webkitURL}return t.revokeObjectURL(i),r}((function(e){postMessage((new FileReaderSync).readAsDataURL(e))}));i.onmessage=function(e){t(e.data)},i.postMessage(e)}else{var r=new FileReader;r.readAsDataURL(e),r.onload=function(e){t(e.target.result)}}}this.getBlob((function(i){i.audio&&i.video?t(i.audio,(function(r){t(i.video,(function(t){e({audio:r,video:t})}))})):i.audio?t(i.audio,(function(t){e({audio:t})})):i.video&&t(i.video,(function(t){e({video:t})}))}))},this.writeToDisk=function(){t.writeToDisk({audio:this.audioRecorder,video:this.videoRecorder,gif:this.gifRecorder})},this.save=function(e){(e=e||{audio:!0,video:!0,gif:!0}).audio&&this.audioRecorder&&this.audioRecorder.save("string"==typeof e.audio?e.audio:""),e.video&&this.videoRecorder&&this.videoRecorder.save("string"==typeof e.video?e.video:""),e.gif&&this.gifRecorder&&this.gifRecorder.save("string"==typeof e.gif?e.gif:"")}}var n;t.version="5.6.2",e.exports=t,t.getFromDisk=function(e,t){if(!t)throw"callback is mandatory.";console.log("Getting recorded "+("all"===e?"blobs":e+" blob ")+" from disk!"),L.Fetch((function(i,r){"all"!==e&&r===e+"Blob"&&t&&t(i),"all"===e&&t&&t(i,r.replace("Blob",""))}))},t.writeToDisk=function(e){console.log("Writing recorded blob(s) to disk!"),(e=e||{}).audio&&e.video&&e.gif?e.audio.getDataURL((function(t){e.video.getDataURL((function(i){e.gif.getDataURL((function(e){L.Store({audioBlob:t,videoBlob:i,gifBlob:e})}))}))})):e.audio&&e.video?e.audio.getDataURL((function(t){e.video.getDataURL((function(e){L.Store({audioBlob:t,videoBlob:e})}))})):e.audio&&e.gif?e.audio.getDataURL((function(t){e.gif.getDataURL((function(e){L.Store({audioBlob:t,gifBlob:e})}))})):e.video&&e.gif?e.video.getDataURL((function(t){e.gif.getDataURL((function(e){L.Store({videoBlob:t,gifBlob:e})}))})):e.audio?e.audio.getDataURL((function(e){L.Store({audioBlob:e})})):e.video?e.video.getDataURL((function(e){L.Store({videoBlob:e})})):e.gif&&e.gif.getDataURL((function(e){L.Store({gifBlob:e})}))},a.getFromDisk=t.getFromDisk,a.writeToDisk=t.writeToDisk,t.MRecordRTC=a,(n=void 0!==Pr?Pr:null)&&("undefined"===typeof window?"undefined":Object(E["a"])(window))>"u"&&void 0!==Pr&&(Pr.navigator={userAgent:"Fake/5.0 (FakeOS) AppleWebKit/123 (KHTML, like Gecko) Fake/12.3.4567.89 Fake/123.45",getUserMedia:function(){}},Pr.console||(Pr.console={}),void 0!==Pr.console.log&&void 0!==Pr.console.error||(Pr.console.error=Pr.console.log=Pr.console.log||function(){console.log(arguments)}),("undefined"===typeof document?"undefined":Object(E["a"])(document))>"u"&&(n.document={documentElement:{appendChild:function(){return""}}},document.createElement=document.captureStream=document.mozCaptureStream=function(){var e={getContext:function(){return e},play:function(){},pause:function(){},drawImage:function(){},toDataURL:function(){return""},style:{}};return e},n.HTMLVideoElement=function(){}),("undefined"===typeof location?"undefined":Object(E["a"])(location))>"u"&&(n.location={protocol:"file:",href:"",hash:""}),("undefined"===typeof screen?"undefined":Object(E["a"])(screen))>"u"&&(n.screen={width:0,height:0}),void 0===u&&(n.URL={createObjectURL:function(){return""},revokeObjectURL:function(){return""}}),n.window=Pr);var s=window.requestAnimationFrame;if(void 0===s)if(("undefined"===typeof webkitRequestAnimationFrame?"undefined":Object(E["a"])(webkitRequestAnimationFrame))<"u")s=webkitRequestAnimationFrame;else if(("undefined"===typeof mozRequestAnimationFrame?"undefined":Object(E["a"])(mozRequestAnimationFrame))<"u")s=mozRequestAnimationFrame;else if(("undefined"===typeof msRequestAnimationFrame?"undefined":Object(E["a"])(msRequestAnimationFrame))<"u")s=msRequestAnimationFrame;else if(void 0===s){var o=0;s=function(e,t){var i=(new Date).getTime(),r=Math.max(0,16-(i-o)),a=setTimeout((function(){e(i+r)}),r);return o=i+r,a}}var c=window.cancelAnimationFrame;void 0===c&&(("undefined"===typeof webkitCancelAnimationFrame?"undefined":Object(E["a"])(webkitCancelAnimationFrame))<"u"?c=webkitCancelAnimationFrame:("undefined"===typeof mozCancelAnimationFrame?"undefined":Object(E["a"])(mozCancelAnimationFrame))<"u"?c=mozCancelAnimationFrame:("undefined"===typeof msCancelAnimationFrame?"undefined":Object(E["a"])(msCancelAnimationFrame))<"u"?c=msCancelAnimationFrame:void 0===c&&(c=function(e){clearTimeout(e)}));var l=window.AudioContext;void 0===l&&(("undefined"===typeof webkitAudioContext?"undefined":Object(E["a"])(webkitAudioContext))<"u"&&(l=webkitAudioContext),("undefined"===typeof mozAudioContext?"undefined":Object(E["a"])(mozAudioContext))<"u"&&(l=mozAudioContext));var u=window.URL;void 0===u&&("undefined"===typeof webkitURL?"undefined":Object(E["a"])(webkitURL))<"u"&&(u=webkitURL),("undefined"===typeof navigator?"undefined":Object(E["a"])(navigator))<"u"&&void 0===navigator.getUserMedia&&(void 0!==navigator.webkitGetUserMedia&&(navigator.getUserMedia=navigator.webkitGetUserMedia),void 0!==navigator.mozGetUserMedia&&(navigator.getUserMedia=navigator.mozGetUserMedia));var d=!(-1===navigator.userAgent.indexOf("Edge")||!navigator.msSaveBlob&&!navigator.msSaveOrOpenBlob),h=!!window.opera||-1!==navigator.userAgent.indexOf("OPR/"),f=navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&"netscape"in window&&/ rv:/.test(navigator.userAgent),p=!h&&!d&&!!navigator.webkitGetUserMedia||b()||-1!==navigator.userAgent.toLowerCase().indexOf("chrome/"),m=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);m&&!p&&-1!==navigator.userAgent.indexOf("CriOS")&&(m=!1,p=!0);var g=window.MediaStream;function y(e){if(0===e)return"0 Bytes";var t=parseInt(Math.floor(Math.log(e)/Math.log(1e3)),10);return(e/Math.pow(1e3,t)).toPrecision(3)+" "+["Bytes","KB","MB","GB","TB"][t]}function v(e,t){if(!e)throw"Blob object is required.";if(!e.type)try{e.type="video/webm"}catch(s){}var i=(e.type||"video/webm").split("/")[1];if(-1!==i.indexOf(";")&&(i=i.split(";")[0]),t&&-1!==t.indexOf(".")){var r=t.split(".");t=r[0],i=r[1]}var a=(t||Math.round(9999999999*Math.random())+888888888)+"."+i;if(void 0!==navigator.msSaveOrOpenBlob)return navigator.msSaveOrOpenBlob(e,a);if(void 0!==navigator.msSaveBlob)return navigator.msSaveBlob(e,a);var n=document.createElement("a");n.href=u.createObjectURL(e),n.download=a,n.style="display:none;opacity:0;color:transparent;",(document.body||document.documentElement).appendChild(n),"function"==typeof n.click?n.click():(n.target="_blank",n.dispatchEvent(new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0}))),u.revokeObjectURL(n.href)}function b(){return("undefined"===typeof window?"undefined":Object(E["a"])(window))<"u"&&"object"==Object(E["a"])(window.process)&&"renderer"===window.process.type||!(("undefined"===typeof process?"undefined":Object(E["a"])(process))>"u"||"object"!=Object(E["a"])(process.versions)||!process.versions.electron)||"object"==("undefined"===typeof navigator?"undefined":Object(E["a"])(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Electron")>=0}function A(e,t){return e&&e.getTracks?e.getTracks().filter((function(e){return e.kind===(t||"audio")})):[]}function k(e,t){"srcObject"in t?t.srcObject=e:"mozSrcObject"in t?t.mozSrcObject=e:t.srcObject=e}void 0===g&&("undefined"===typeof webkitMediaStream?"undefined":Object(E["a"])(webkitMediaStream))<"u"&&(g=webkitMediaStream),void 0!==g&&void 0===g.prototype.stop&&(g.prototype.stop=function(){this.getTracks().forEach((function(e){e.stop()}))}),t.invokeSaveAsDialog=v,t.getTracks=A,t.getSeekableBlob=function(e,t){if(("undefined"===typeof EBML?"undefined":Object(E["a"])(EBML))>"u")throw new Error("Please link: https://www.webrtc-experiment.com/EBML.js");var i=new EBML.Reader,r=new EBML.Decoder,a=EBML.tools,n=new FileReader;n.onload=function(e){r.decode(this.result).forEach((function(e){i.read(e)})),i.stop();var n=a.makeMetadataSeekable(i.metadatas,i.duration,i.cues),s=this.result.slice(i.metadataSize),o=new Blob([n,s],{type:"video/webm"});t(o)},n.readAsArrayBuffer(e)},t.bytesToSize=y,t.isElectron=b;var _={};function w(){if(f||m||d)return!0;var e,t,i=navigator.userAgent,r=""+parseFloat(navigator.appVersion),a=parseInt(navigator.appVersion,10);return(p||h)&&(e=i.indexOf("Chrome"),r=i.substring(e+7)),-1!==(t=r.indexOf(";"))&&(r=r.substring(0,t)),-1!==(t=r.indexOf(" "))&&(r=r.substring(0,t)),a=parseInt(""+r,10),isNaN(a)&&(r=""+parseFloat(navigator.appVersion),a=parseInt(navigator.appVersion,10)),a>=49}function S(e,t){var i,r=this;if(void 0===e)throw'First argument "MediaStream" is required.';if(("undefined"===typeof MediaRecorder?"undefined":Object(E["a"])(MediaRecorder))>"u")throw"Your browser does not support the Media Recorder API. Please try other modules e.g. WhammyRecorder or StereoAudioRecorder.";"audio"===(t=t||{mimeType:"video/webm"}).type&&(A(e,"video").length&&A(e,"audio").length&&(navigator.mozGetUserMedia?(i=new g).addTrack(A(e,"audio")[0]):i=new g(A(e,"audio")),e=i),t.mimeType&&-1!==t.mimeType.toString().toLowerCase().indexOf("audio")||(t.mimeType=p?"audio/webm":"audio/ogg"),t.mimeType&&"audio/ogg"!==t.mimeType.toString().toLowerCase()&&navigator.mozGetUserMedia&&(t.mimeType="audio/ogg"));var a,n=[];function s(){r.timestamps.push((new Date).getTime()),"function"==typeof t.onTimeStamp&&t.onTimeStamp(r.timestamps[r.timestamps.length-1],r.timestamps)}function o(e){return a&&a.mimeType?a.mimeType:e.mimeType||"video/webm"}function c(){n=[],a=null,r.timestamps=[]}this.getArrayOfBlobs=function(){return n},this.record=function(){r.blob=null,r.clearRecordedData(),r.timestamps=[],l=[],n=[];var i=t;t.disableLogs||console.log("Passing following config over MediaRecorder API.",i),a&&(a=null),p&&!w()&&(i="video/vp8"),"function"==typeof MediaRecorder.isTypeSupported&&i.mimeType&&(MediaRecorder.isTypeSupported(i.mimeType)||(t.disableLogs||console.warn("MediaRecorder API seems unable to record mimeType:",i.mimeType),i.mimeType="audio"===t.type?"audio/webm":"video/webm"));try{a=new MediaRecorder(e,i),t.mimeType=i.mimeType}catch(c){a=new MediaRecorder(e)}i.mimeType&&!MediaRecorder.isTypeSupported&&"canRecordMimeType"in a&&!1===a.canRecordMimeType(i.mimeType)&&(t.disableLogs||console.warn("MediaRecorder API seems unable to record mimeType:",i.mimeType)),a.ondataavailable=function(e){if(e.data&&l.push("ondataavailable: "+y(e.data.size)),"number"!=typeof t.timeSlice)!e.data||!e.data.size||e.data.size<100||r.blob?r.recordingCallback&&(r.recordingCallback(new Blob([],{type:o(i)})),r.recordingCallback=null):(r.blob=t.getNativeBlob?e.data:new Blob([e.data],{type:o(i)}),r.recordingCallback&&(r.recordingCallback(r.blob),r.recordingCallback=null));else if(e.data&&e.data.size&&(n.push(e.data),s(),"function"==typeof t.ondataavailable)){var a=t.getNativeBlob?e.data:new Blob([e.data],{type:o(i)});t.ondataavailable(a)}},a.onstart=function(){l.push("started")},a.onpause=function(){l.push("paused")},a.onresume=function(){l.push("resumed")},a.onstop=function(){l.push("stopped")},a.onerror=function(e){e&&(e.name||(e.name="UnknownError"),l.push("error: "+e),t.disableLogs||(-1!==e.name.toString().toLowerCase().indexOf("invalidstate")?console.error("The MediaRecorder is not in a state in which the proposed operation is allowed to be executed.",e):-1!==e.name.toString().toLowerCase().indexOf("notsupported")?console.error("MIME type (",i.mimeType,") is not supported.",e):-1!==e.name.toString().toLowerCase().indexOf("security")?console.error("MediaRecorder security error",e):"OutOfMemory"===e.name?console.error("The UA has exhaused the available memory. User agents SHOULD provide as much additional information as possible in the message attribute.",e):"IllegalStreamModification"===e.name?console.error("A modification to the stream has occurred that makes it impossible to continue recording. An example would be the addition of a Track while recording is occurring. User agents SHOULD provide as much additional information as possible in the message attribute.",e):"OtherRecordingError"===e.name?console.error("Used for an fatal error other than those listed above. User agents SHOULD provide as much additional information as possible in the message attribute.",e):"GenericError"===e.name?console.error("The UA cannot provide the codec or recording option that has been requested.",e):console.error("MediaRecorder Error",e)),function(e){if(!r.manuallyStopped&&a&&"inactive"===a.state)return delete t.timeslice,void a.start(6e5);setTimeout(void 0,1e3)}(),"inactive"!==a.state&&"stopped"!==a.state&&a.stop())},"number"==typeof t.timeSlice?(s(),a.start(t.timeSlice)):a.start(36e5),t.initCallback&&t.initCallback()},this.timestamps=[],this.stop=function(e){e=e||function(){},r.manuallyStopped=!0,a&&(this.recordingCallback=e,"recording"===a.state&&a.stop(),"number"==typeof t.timeSlice&&setTimeout((function(){r.blob=new Blob(n,{type:o(t)}),r.recordingCallback(r.blob)}),100))},this.pause=function(){a&&"recording"===a.state&&a.pause()},this.resume=function(){a&&"paused"===a.state&&a.resume()},this.clearRecordedData=function(){a&&"recording"===a.state&&r.stop(c),c()},this.getInternalRecorder=function(){return a},this.blob=null,this.getState=function(){return a&&a.state||"inactive"};var l=[];this.getAllStates=function(){return l},void 0===t.checkForInactiveTracks&&(t.checkForInactiveTracks=!1),r=this,function i(){if(a&&!1!==t.checkForInactiveTracks)return!1===function(){if("active"in e){if(!e.active)return!1}else if("ended"in e&&e.ended)return!1;return!0}()?(t.disableLogs||console.log("MediaStream seems stopped."),void r.stop()):void setTimeout(i,1e3)}(),this.name="MediaStreamRecorder",this.toString=function(){return this.name}}function T(e,i){if(!A(e,"audio").length)throw"Your stream has no audio tracks.";var r,a=this,n=[],s=[],o=!1,c=0,l=2,d=(i=i||{}).desiredSampRate;function h(){if(!1===i.checkForInactiveTracks)return!0;if("active"in e){if(!e.active)return!1}else if("ended"in e&&e.ended)return!1;return!0}function f(e,t){function i(e,t){var i,r=e.numberOfAudioChannels,a=e.leftBuffers.slice(0),n=e.rightBuffers.slice(0),s=e.sampleRate,o=e.internalInterleavedLength,c=e.desiredSampRate;function l(e,t,i){var r=Math.round(e.length*(t/i)),a=[],n=Number((e.length-1)/(r-1));a[0]=e[0];for(var s=1;s<r-1;s++){var o=s*n,c=Number(Math.floor(o)).toFixed(),l=Number(Math.ceil(o)).toFixed(),d=o-c;a[s]=u(e[c],e[l],d)}return a[r-1]=e[e.length-1],a}function u(e,t,i){return e+(t-e)*i}function d(e,t){for(var i=new Float64Array(t),r=0,a=e.length,n=0;n<a;n++){var s=e[n];i.set(s,r),r+=s.length}return i}function h(e,t,i){for(var r=i.length,a=0;a<r;a++)e.setUint8(t+a,i.charCodeAt(a))}2===r&&(a=d(a,o),n=d(n,o),c&&(a=l(a,c,s),n=l(n,c,s))),1===r&&(a=d(a,o),c&&(a=l(a,c,s))),c&&(s=c),2===r&&(i=function(e,t){for(var i=e.length+t.length,r=new Float64Array(i),a=0,n=0;n<i;)r[n++]=e[a],r[n++]=t[a],a++;return r}(a,n)),1===r&&(i=a);var f=i.length,p=new ArrayBuffer(44+2*f),m=new DataView(p);h(m,0,"RIFF"),m.setUint32(4,36+2*f,!0),h(m,8,"WAVE"),h(m,12,"fmt "),m.setUint32(16,16,!0),m.setUint16(20,1,!0),m.setUint16(22,r,!0),m.setUint32(24,s,!0),m.setUint32(28,s*r*2,!0),m.setUint16(32,2*r,!0),m.setUint16(34,16,!0),h(m,36,"data"),m.setUint32(40,2*f,!0);for(var g=f,y=44,v=0;v<g;v++)m.setInt16(y,32767*i[v],!0),y+=2;if(t)return t({buffer:p,view:m});postMessage({buffer:p,view:m})}if(e.noWorker)i(e,(function(e){t(e.buffer,e.view)}));else{var r,a,n,s=(r=i,a=u.createObjectURL(new Blob([r.toString(),";this.onmessage = function (eee) {"+r.name+"(eee.data);}"],{type:"application/javascript"})),(n=new Worker(a)).workerURL=a,n);s.onmessage=function(e){t(e.data.buffer,e.data.view),u.revokeObjectURL(s.workerURL),s.terminate()},s.postMessage(e)}}!0===i.leftChannel&&(l=1),1===i.numberOfAudioChannels&&(l=1),(!l||l<1)&&(l=2),i.disableLogs||console.log("StereoAudioRecorder is set to record number of channels: "+l),void 0===i.checkForInactiveTracks&&(i.checkForInactiveTracks=!0),this.record=function(){if(!1===h())throw"Please make sure MediaStream is active.";k(),w=b=!1,o=!0,void 0!==i.timeSlice&&T()},this.stop=function(e){e=e||function(){},o=!1,f({desiredSampRate:d,sampleRate:v,numberOfAudioChannels:l,internalInterleavedLength:c,leftBuffers:n,rightBuffers:1===l?[]:s,noWorker:i.noWorker},(function(t,i){a.blob=new Blob([i],{type:"audio/wav"}),a.buffer=new ArrayBuffer(i.buffer.byteLength),a.view=i,a.sampleRate=d||v,a.bufferSize=y,a.length=c,w=!1,e&&e(a.blob)}))},void 0===t.Storage&&(t.Storage={AudioContextConstructor:null,AudioContext:window.AudioContext||window.webkitAudioContext}),t.Storage.AudioContextConstructor&&"closed"!==t.Storage.AudioContextConstructor.state||(t.Storage.AudioContextConstructor=new t.Storage.AudioContext);var p=t.Storage.AudioContextConstructor,m=p.createMediaStreamSource(e),g=[0,256,512,1024,2048,4096,8192,16384],y=void 0===i.bufferSize?4096:i.bufferSize;if(-1===g.indexOf(y)&&(i.disableLogs||console.log("Legal values for buffer-size are "+JSON.stringify(g,null,"\t"))),p.createJavaScriptNode)r=p.createJavaScriptNode(y,l,l);else{if(!p.createScriptProcessor)throw"WebAudio API has no support on this browser.";r=p.createScriptProcessor(y,l,l)}m.connect(r),i.bufferSize||(y=r.bufferSize);var v=void 0!==i.sampleRate?i.sampleRate:p.sampleRate||44100;(v<22050||v>96e3)&&(i.disableLogs||console.log("sample-rate must be under range 22050 and 96000.")),i.disableLogs||i.desiredSampRate&&console.log("Desired sample-rate: "+i.desiredSampRate);var b=!1;function k(){n=[],s=[],c=0,w=!1,o=!1,b=!1,p=null,a.leftchannel=n,a.rightchannel=s,a.numberOfAudioChannels=l,a.desiredSampRate=d,a.sampleRate=v,a.recordingLength=c,S={left:[],right:[],recordingLength:0}}function _(){r&&(r.onaudioprocess=null,r.disconnect(),r=null),m&&(m.disconnect(),m=null),k()}this.pause=function(){b=!0},this.resume=function(){if(!1===h())throw"Please make sure MediaStream is active.";if(!o)return i.disableLogs||console.log("Seems recording has been restarted."),void this.record();b=!1},this.clearRecordedData=function(){i.checkForInactiveTracks=!1,o&&this.stop(_),_()},this.name="StereoAudioRecorder",this.toString=function(){return this.name};var w=!1;r.onaudioprocess=function(e){if(!b)if(!1===h()&&(i.disableLogs||console.log("MediaStream seems stopped."),r.disconnect(),o=!1),o){w||(w=!0,i.onAudioProcessStarted&&i.onAudioProcessStarted(),i.initCallback&&i.initCallback());var t=e.inputBuffer.getChannelData(0),u=new Float32Array(t);if(n.push(u),2===l){var d=e.inputBuffer.getChannelData(1),f=new Float32Array(d);s.push(f)}c+=y,a.recordingLength=c,void 0!==i.timeSlice&&(S.recordingLength+=y,S.left.push(u),2===l&&S.right.push(f))}else m&&(m.disconnect(),m=null)},p.createMediaStreamDestination?r.connect(p.createMediaStreamDestination()):r.connect(p.destination),this.leftchannel=n,this.rightchannel=s,this.numberOfAudioChannels=l,this.desiredSampRate=d,this.sampleRate=v,a.recordingLength=c;var S={left:[],right:[],recordingLength:0};function T(){o&&"function"==typeof i.ondataavailable&&void 0!==i.timeSlice&&(S.left.length?(f({desiredSampRate:d,sampleRate:v,numberOfAudioChannels:l,internalInterleavedLength:S.recordingLength,leftBuffers:S.left,rightBuffers:1===l?[]:S.right},(function(e,t){var r=new Blob([t],{type:"audio/wav"});i.ondataavailable(r),setTimeout(T,i.timeSlice)})),S={left:[],right:[],recordingLength:0}):setTimeout(T,i.timeSlice))}}function x(e,t){if(("undefined"===typeof html2canvas?"undefined":Object(E["a"])(html2canvas))>"u")throw"Please link: https://www.webrtc-experiment.com/screenshot.js";(t=t||{}).frameInterval||(t.frameInterval=10);var i=!1;["captureStream","mozCaptureStream","webkitCaptureStream"].forEach((function(e){e in document.createElement("canvas")&&(i=!0)}));var r,a,n,s=!(!window.webkitRTCPeerConnection&&!window.webkitGetUserMedia||!window.chrome),o=50,c=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);if(s&&c&&c[2]&&(o=parseInt(c[2],10)),s&&o<52&&(i=!1),t.useWhammyRecorder&&(i=!1),i)if(t.disableLogs||console.log("Your browser supports both MediRecorder API and canvas.captureStream!"),e instanceof HTMLCanvasElement)r=e;else{if(!(e instanceof CanvasRenderingContext2D))throw"Please pass either HTMLCanvasElement or CanvasRenderingContext2D.";r=e.canvas}else navigator.mozGetUserMedia&&(t.disableLogs||console.error("Canvas recording is NOT supported in Firefox."));this.record=function(){if(n=!0,i&&!t.useWhammyRecorder){var e;"captureStream"in r?e=r.captureStream(25):"mozCaptureStream"in r?e=r.mozCaptureStream(25):"webkitCaptureStream"in r&&(e=r.webkitCaptureStream(25));try{var s=new g;s.addTrack(A(e,"video")[0]),e=s}catch(o){}if(!e)throw"captureStream API are NOT available.";(a=new S(e,{mimeType:t.mimeType||"video/webm"})).record()}else f.frames=[],h=(new Date).getTime(),d();t.initCallback&&t.initCallback()},this.getWebPImages=function(i){if("canvas"===e.nodeName.toLowerCase()){var r=f.frames.length;f.frames.forEach((function(e,i){var a=r-i;t.disableLogs||console.log(a+"/"+r+" frames remaining"),t.onEncodingCallback&&t.onEncodingCallback(a,r);var n=e.image.toDataURL("image/webp",1);f.frames[i].image=n})),t.disableLogs||console.log("Generating WebM"),i()}else i()},this.stop=function(e){n=!1;var r=this;i&&a?a.stop(e):this.getWebPImages((function(){f.compile((function(i){t.disableLogs||console.log("Recording finished!"),r.blob=i,r.blob.forEach&&(r.blob=new Blob([],{type:"video/webm"})),e&&e(r.blob),f.frames=[]}))}))};var l=!1;function u(){f.frames=[],n=!1,l=!1}function d(){if(l)return h=(new Date).getTime(),setTimeout(d,500);if("canvas"===e.nodeName.toLowerCase()){var i=(new Date).getTime()-h;return h=(new Date).getTime(),f.frames.push({image:(r=document.createElement("canvas"),a=r.getContext("2d"),r.width=e.width,r.height=e.height,a.drawImage(e,0,0),r),duration:i}),void(n&&setTimeout(d,t.frameInterval))}var r,a;html2canvas(e,{grabMouse:void 0===t.showMousePointer||t.showMousePointer,onrendered:function(e){var i=(new Date).getTime()-h;if(!i)return setTimeout(d,t.frameInterval);h=(new Date).getTime(),f.frames.push({image:e.toDataURL("image/webp",1),duration:i}),n&&setTimeout(d,t.frameInterval)}})}this.pause=function(){l=!0,a instanceof S&&a.pause()},this.resume=function(){l=!1,a instanceof S?a.resume():n||this.record()},this.clearRecordedData=function(){n&&this.stop(u),u()},this.name="CanvasRecorder",this.toString=function(){return this.name};var h=(new Date).getTime(),f=new R.Video(100)}function C(e,t){function i(e){e=void 0!==e?e:10;var t=(new Date).getTime()-c;return t?n?(c=(new Date).getTime(),setTimeout(i,100)):(c=(new Date).getTime(),o.paused&&o.play(),d.drawImage(o,0,0,u.width,u.height),l.frames.push({duration:t,image:u.toDataURL("image/webp")}),void(a||setTimeout(i,e,e))):setTimeout(i,e,e)}function r(e,t,i,r,a){var n=document.createElement("canvas");n.width=u.width,n.height=u.height;var s,o,c,l=n.getContext("2d"),d=[],h=-1===t,f=t&&t>0&&t<=e.length?t:e.length,p=0,m=0,g=0,y=Math.sqrt(Math.pow(255,2)+Math.pow(255,2)+Math.pow(255,2)),v=i&&i>=0&&i<=1?i:0,b=r&&r>=0&&r<=1?r:0,A=!1;o=-1,c=(s={length:f,functionToLoop:function(t,i){var r,a,n,s=function(){!A&&n-r<=n*b||(h&&(A=!0),d.push(e[i])),t()};if(A)s();else{var o=new Image;o.onload=function(){l.drawImage(o,0,0,u.width,u.height);var e=l.getImageData(0,0,u.width,u.height);r=0,a=e.data.length,n=e.data.length/4;for(var t=0;t<a;t+=4){var i={r:e.data[t],g:e.data[t+1],b:e.data[t+2]};Math.sqrt(Math.pow(i.r-p,2)+Math.pow(i.g-m,2)+Math.pow(i.b-g,2))<=y*v&&r++}s()},o.src=e[i].image}},callback:function(){(d=d.concat(e.slice(f))).length<=0&&d.push(e[e.length-1]),a(d)}}).length,function e(){++o!==c?setTimeout((function(){s.functionToLoop(e,o)}),1):s.callback()}()}(t=t||{}).frameInterval||(t.frameInterval=10),t.disableLogs||console.log("Using frames-interval:",t.frameInterval),this.record=function(){t.width||(t.width=320),t.height||(t.height=240),t.video||(t.video={width:t.width,height:t.height}),t.canvas||(t.canvas={width:t.width,height:t.height}),u.width=t.canvas.width||320,u.height=t.canvas.height||240,d=u.getContext("2d"),t.video&&t.video instanceof HTMLVideoElement?(o=t.video.cloneNode(),t.initCallback&&t.initCallback()):(o=document.createElement("video"),k(e,o),o.onloadedmetadata=function(){t.initCallback&&t.initCallback()},o.width=t.video.width,o.height=t.video.height),o.muted=!0,o.play(),c=(new Date).getTime(),l=new R.Video,t.disableLogs||(console.log("canvas resolutions",u.width,"*",u.height),console.log("video width/height",o.width||u.width,"*",o.height||u.height)),i(t.frameInterval)};var a=!1;this.stop=function(e){e=e||function(){},a=!0;var i=this;setTimeout((function(){r(l.frames,-1,null,null,(function(r){l.frames=r,t.advertisement&&t.advertisement.length&&(l.frames=t.advertisement.concat(l.frames)),l.compile((function(t){i.blob=t,i.blob.forEach&&(i.blob=new Blob([],{type:"video/webm"})),e&&e(i.blob)}))}))}),10)};var n=!1;function s(){l.frames=[],a=!0,n=!1}this.pause=function(){n=!0},this.resume=function(){n=!1,a&&this.record()},this.clearRecordedData=function(){a||this.stop(s),s()},this.name="WhammyRecorder",this.toString=function(){return this.name};var o,c,l,u=document.createElement("canvas"),d=u.getContext("2d")}void 0!==l?_.AudioContext=l:("undefined"===typeof webkitAudioContext?"undefined":Object(E["a"])(webkitAudioContext))<"u"&&(_.AudioContext=webkitAudioContext),t.Storage=_,t.MediaStreamRecorder=S,t.StereoAudioRecorder=T,t.CanvasRecorder=x,t.WhammyRecorder=C;var R=function(){function e(e){this.frames=[],this.duration=e||1,this.quality=.8}function t(e){function t(e,t,i){return[{data:e,id:231}].concat(i.map((function(e){var i=function(e){var t=0;if(e.keyframe&&(t|=128),e.invisible&&(t|=8),e.lacing&&(t|=e.lacing<<1),e.discardable&&(t|=1),e.trackNum>127)throw"TrackNumber > 127 not supported";return[128|e.trackNum,e.timecode>>8,255&e.timecode,t].map((function(e){return String.fromCharCode(e)})).join("")+e.frame}({discardable:0,frame:e.data.slice(4),invisible:0,keyframe:1,lacing:0,trackNum:1,timecode:Math.round(t)});return t+=e.duration,{data:i,id:163}})))}function i(e){for(var t=[];e>0;)t.push(255&e),e>>=8;return new Uint8Array(t.reverse())}function r(e){var t=[];e=(e.length%8?new Array(9-e.length%8).join("0"):"")+e;for(var i=0;i<e.length;i+=8)t.push(parseInt(e.substr(i,8),2));return new Uint8Array(t)}function a(e){for(var t=[],n=0;n<e.length;n++){var s=e[n].data;"object"==Object(E["a"])(s)&&(s=a(s)),"number"==typeof s&&(s=r(s.toString(2))),"string"==typeof s&&(s=new Uint8Array(s.split("").map((function(e){return e.charCodeAt(0)}))));var o=s.size||s.byteLength||s.length,c=Math.ceil(Math.ceil(Math.log(o)/Math.log(2))/8),l=o.toString(2),u=new Array(7*c+7+1-l.length).join("0")+l,d=new Array(c).join("0")+"1"+u;t.push(i(e[n].id)),t.push(r(d)),t.push(s)}return new Blob(t,{type:"video/webm"})}function n(e,t){return parseInt(e.substr(t+4,4).split("").map((function(e){var t=e.charCodeAt(0).toString(2);return new Array(8-t.length+1).join("0")+t})).join(""),2)}function s(e){for(var t=0,i={};t<e.length;){var r=e.substr(t,4),a=n(e,t),o=e.substr(t+4+4,a);t+=8+a,i[r]=i[r]||[],"RIFF"===r||"LIST"===r?i[r].push(s(o)):i[r].push(o)}return i}var o=new function(e){var i=function(e){if(e[0]){for(var t=e[0].width,i=e[0].height,r=e[0].duration,a=1;a<e.length;a++)r+=e[a].duration;return{duration:r,width:t,height:i}}postMessage({error:"Something went wrong. Maybe WebP format is not supported in the current browser."})}(e);if(!i)return[];for(var r,n=[{id:440786851,data:[{data:1,id:17030},{data:1,id:17143},{data:4,id:17138},{data:8,id:17139},{data:"webm",id:17026},{data:2,id:17031},{data:2,id:17029}]},{id:408125543,data:[{id:357149030,data:[{data:1e6,id:2807729},{data:"whammy",id:19840},{data:"whammy",id:22337},{data:(r=i.duration,[].slice.call(new Uint8Array(new Float64Array([r]).buffer),0).map((function(e){return String.fromCharCode(e)})).reverse().join("")),id:17545}]},{id:374648427,data:[{id:174,data:[{data:1,id:215},{data:1,id:29637},{data:0,id:156},{data:"und",id:2274716},{data:"V_VP8",id:134},{data:"VP8",id:2459272},{data:1,id:131},{id:224,data:[{data:i.width,id:176},{data:i.height,id:186}]}]}]}]}],s=0,o=0;s<e.length;){var c=[],l=0;do{c.push(e[s]),l+=e[s].duration,s++}while(s<e.length&&l<3e4);var u={id:524531317,data:t(o,0,c)};n[1].data.push(u),o+=l}return a(n)}(e.map((function(e){var t=function(e){for(var t=e.RIFF[0].WEBP[0],i=t.indexOf("*"),r=0,a=[];r<4;r++)a[r]=t.charCodeAt(i+3+r);return{width:16383&(a[1]<<8|a[0]),height:16383&(a[3]<<8|a[2]),data:t,riff:e}}(s(atob(e.image.slice(23))));return t.duration=e.duration,t})));postMessage(o)}return e.prototype.add=function(e,t){if("canvas"in e&&(e=e.canvas),"toDataURL"in e&&(e=e.toDataURL("image/webp",this.quality)),!/^data:image\/webp;base64,/gi.test(e))throw"Input must be formatted properly as a base64 encoded DataURI of type image/webp";this.frames.push({image:e,duration:t||this.duration})},e.prototype.compile=function(e){var i,r,a,n=(i=t,r=u.createObjectURL(new Blob([i.toString(),"this.onmessage = function (eee) {"+i.name+"(eee.data);}"],{type:"application/javascript"})),a=new Worker(r),u.revokeObjectURL(r),a);n.onmessage=function(t){t.data.error?console.error(t.data.error):e(t.data)},n.postMessage(this.frames)},{Video:e}}();t.Whammy=R;var L={init:function(){var e=this;if(("undefined"===typeof indexedDB?"undefined":Object(E["a"])(indexedDB))<"u"&&void 0!==indexedDB.open){var t,i=this.dbName||location.href.replace(/\/|:|#|%|\.|\[|\]/g,""),r=indexedDB.open(i,1);r.onerror=e.onError,r.onsuccess=function(){(t=r.result).onerror=e.onError,t.setVersion&&1!==t.version?t.setVersion(1).onsuccess=function(){a(t),n()}:n()},r.onupgradeneeded=function(e){a(e.target.result)}}else console.error("IndexedDB API are not available in this browser.");function a(t){t.createObjectStore(e.dataStoreName)}function n(){var i=t.transaction([e.dataStoreName],"readwrite");function r(t){i.objectStore(e.dataStoreName).get(t).onsuccess=function(i){e.callback&&e.callback(i.target.result,t)}}e.videoBlob&&i.objectStore(e.dataStoreName).put(e.videoBlob,"videoBlob"),e.gifBlob&&i.objectStore(e.dataStoreName).put(e.gifBlob,"gifBlob"),e.audioBlob&&i.objectStore(e.dataStoreName).put(e.audioBlob,"audioBlob"),r("audioBlob"),r("videoBlob"),r("gifBlob")}},Fetch:function(e){return this.callback=e,this.init(),this},Store:function(e){return this.audioBlob=e.audioBlob,this.videoBlob=e.videoBlob,this.gifBlob=e.gifBlob,this.init(),this},onError:function(e){console.error(JSON.stringify(e,null,"\t"))},dataStoreName:"recordRTC",dbName:null};function D(e,t){if(("undefined"===typeof GIFEncoder?"undefined":Object(E["a"])(GIFEncoder))>"u"){var i=document.createElement("script");i.src="https://www.webrtc-experiment.com/gif-recorder.js",(document.body||document.documentElement).appendChild(i)}t=t||{};var r=e instanceof CanvasRenderingContext2D||e instanceof HTMLCanvasElement;this.record=function(){("undefined"===typeof GIFEncoder?"undefined":Object(E["a"])(GIFEncoder))<"u"&&l?(r||(t.width||(t.width=u.offsetWidth||320),t.height||(t.height=u.offsetHeight||240),t.video||(t.video={width:t.width,height:t.height}),t.canvas||(t.canvas={width:t.width,height:t.height}),n.width=t.canvas.width||320,n.height=t.canvas.height||240,u.width=t.video.width||320,u.height=t.video.height||240),(h=new GIFEncoder).setRepeat(0),h.setDelay(t.frameRate||200),h.setQuality(t.quality||10),h.start(),"function"==typeof t.onGifRecordingStarted&&t.onGifRecordingStarted(),f=s((function e(i){if(!0!==p.clearedRecordedData){if(a)return setTimeout((function(){e(i)}),100);f=s(e),void 0===Object(E["a"])(d)&&(d=i),i-d<90||(!r&&u.paused&&u.play(),r||o.drawImage(u,0,0,n.width,n.height),t.onGifPreview&&t.onGifPreview(n.toDataURL("image/png")),h.addFrame(o),d=i)}})),t.initCallback&&t.initCallback()):setTimeout(p.record,1e3)},this.stop=function(e){e=e||function(){},f&&c(f),this.blob=new Blob([new Uint8Array(h.stream().bin)],{type:"image/gif"}),e(this.blob),h.stream().bin=[]};var a=!1;this.pause=function(){a=!0},this.resume=function(){a=!1},this.clearRecordedData=function(){p.clearedRecordedData=!0,h&&(h.stream().bin=[])},this.name="GifRecorder",this.toString=function(){return this.name};var n=document.createElement("canvas"),o=n.getContext("2d");r&&(e instanceof CanvasRenderingContext2D?n=(o=e).canvas:e instanceof HTMLCanvasElement&&(o=e.getContext("2d"),n=e));var l=!0;if(!r){var u=document.createElement("video");u.muted=!0,u.autoplay=!0,u.playsInline=!0,l=!1,u.onloadedmetadata=function(){l=!0},k(e,u),u.play()}var d,h,f=null,p=this}function I(e,t){t=t||"multi-streams-mixer";var i=[],r=!1,a=document.createElement("canvas"),n=a.getContext("2d");a.style.opacity=0,a.style.position="absolute",a.style.zIndex=-1,a.style.top="-1000em",a.style.left="-1000em",a.className=t,(document.body||document.documentElement).appendChild(a),this.disableLogs=!1,this.frameInterval=10,this.width=360,this.height=240,this.useGainNode=!0;var s=this,o=window.AudioContext;void 0===o&&(("undefined"===typeof webkitAudioContext?"undefined":Object(E["a"])(webkitAudioContext))<"u"&&(o=webkitAudioContext),("undefined"===typeof mozAudioContext?"undefined":Object(E["a"])(mozAudioContext))<"u"&&(o=mozAudioContext));var c=window.URL;void 0===c&&("undefined"===typeof webkitURL?"undefined":Object(E["a"])(webkitURL))<"u"&&(c=webkitURL),("undefined"===typeof navigator?"undefined":Object(E["a"])(navigator))<"u"&&void 0===navigator.getUserMedia&&(void 0!==navigator.webkitGetUserMedia&&(navigator.getUserMedia=navigator.webkitGetUserMedia),void 0!==navigator.mozGetUserMedia&&(navigator.getUserMedia=navigator.mozGetUserMedia));var l=window.MediaStream;void 0===l&&("undefined"===typeof webkitMediaStream?"undefined":Object(E["a"])(webkitMediaStream))<"u"&&(l=webkitMediaStream),void 0!==l&&void 0===l.prototype.stop&&(l.prototype.stop=function(){this.getTracks().forEach((function(e){e.stop()}))});var u={};function d(){if(!r){var e=i.length,t=!1,n=[];if(i.forEach((function(e){e.stream||(e.stream={}),e.stream.fullcanvas?t=e:n.push(e)})),t)a.width=t.stream.width,a.height=t.stream.height;else if(n.length){a.width=e>1?2*n[0].width:n[0].width;var o=1;3!==e&&4!==e||(o=2),5!==e&&6!==e||(o=3),7!==e&&8!==e||(o=4),9!==e&&10!==e||(o=5),a.height=n[0].height*o}else a.width=s.width||360,a.height=s.height||240;t&&t instanceof HTMLVideoElement&&h(t),n.forEach((function(e,t){h(e,t)})),setTimeout(d,s.frameInterval)}}function h(e,t){if(!r){var i=0,a=0,s=e.width,o=e.height;1===t&&(i=e.width),2===t&&(a=e.height),3===t&&(i=e.width,a=e.height),4===t&&(a=2*e.height),5===t&&(i=e.width,a=2*e.height),6===t&&(a=3*e.height),7===t&&(i=e.width,a=3*e.height),void 0!==e.stream.left&&(i=e.stream.left),void 0!==e.stream.top&&(a=e.stream.top),void 0!==e.stream.width&&(s=e.stream.width),void 0!==e.stream.height&&(o=e.stream.height),n.drawImage(e,i,a,s,o),"function"==typeof e.stream.onRender&&e.stream.onRender(n,i,a,s,o,t)}}function f(e){var i=document.createElement("video");return function(e,t){"srcObject"in t?t.srcObject=e:"mozSrcObject"in t?t.mozSrcObject=e:t.srcObject=e}(e,i),i.className=t,i.muted=!0,i.volume=0,i.width=e.width||s.width||360,i.height=e.height||s.height||240,i.play(),i}function p(t){i=[],(t=t||e).forEach((function(e){if(e.getTracks().filter((function(e){return"video"===e.kind})).length){var t=f(e);t.stream=e,i.push(t)}}))}void 0!==o?u.AudioContext=o:("undefined"===typeof webkitAudioContext?"undefined":Object(E["a"])(webkitAudioContext))<"u"&&(u.AudioContext=webkitAudioContext),this.startDrawingFrames=function(){d()},this.appendStreams=function(t){if(!t)throw"First parameter is required.";t instanceof Array||(t=[t]),t.forEach((function(t){var r=new l;if(t.getTracks().filter((function(e){return"video"===e.kind})).length){var a=f(t);a.stream=t,i.push(a),r.addTrack(t.getTracks().filter((function(e){return"video"===e.kind}))[0])}if(t.getTracks().filter((function(e){return"audio"===e.kind})).length){var n=s.audioContext.createMediaStreamSource(t);s.audioDestination=s.audioContext.createMediaStreamDestination(),n.connect(s.audioDestination),r.addTrack(s.audioDestination.stream.getTracks().filter((function(e){return"audio"===e.kind}))[0])}e.push(r)}))},this.releaseStreams=function(){i=[],r=!0,s.gainNode&&(s.gainNode.disconnect(),s.gainNode=null),s.audioSources.length&&(s.audioSources.forEach((function(e){e.disconnect()})),s.audioSources=[]),s.audioDestination&&(s.audioDestination.disconnect(),s.audioDestination=null),s.audioContext&&s.audioContext.close(),s.audioContext=null,n.clearRect(0,0,a.width,a.height),a.stream&&(a.stream.stop(),a.stream=null)},this.resetVideoStreams=function(e){!e||e instanceof Array||(e=[e]),p(e)},this.name="MultiStreamsMixer",this.toString=function(){return this.name},this.getMixedStream=function(){r=!1;var t=function(){var e;p(),"captureStream"in a?e=a.captureStream():"mozCaptureStream"in a?e=a.mozCaptureStream():s.disableLogs||console.error("Upgrade to latest Chrome or otherwise enable this flag: chrome://flags/#enable-experimental-web-platform-features");var t=new l;return e.getTracks().filter((function(e){return"video"===e.kind})).forEach((function(e){t.addTrack(e)})),a.stream=t,t}(),i=function(){u.AudioContextConstructor||(u.AudioContextConstructor=new u.AudioContext),s.audioContext=u.AudioContextConstructor,s.audioSources=[],!0===s.useGainNode&&(s.gainNode=s.audioContext.createGain(),s.gainNode.connect(s.audioContext.destination),s.gainNode.gain.value=0);var t=0;if(e.forEach((function(e){if(e.getTracks().filter((function(e){return"audio"===e.kind})).length){t++;var i=s.audioContext.createMediaStreamSource(e);!0===s.useGainNode&&i.connect(s.gainNode),s.audioSources.push(i)}})),t)return s.audioDestination=s.audioContext.createMediaStreamDestination(),s.audioSources.forEach((function(e){e.connect(s.audioDestination)})),s.audioDestination.stream}();return i&&i.getTracks().filter((function(e){return"audio"===e.kind})).forEach((function(e){t.addTrack(e)})),e.forEach((function(e){e.fullcanvas})),t}}function P(e,t){e=e||[];var i,r,a=this;(t=t||{elementClass:"multi-streams-mixer",mimeType:"video/webm",video:{width:360,height:240}}).frameInterval||(t.frameInterval=10),t.video||(t.video={}),t.video.width||(t.video.width=360),t.video.height||(t.video.height=240),this.record=function(){var a;i=new I(e,t.elementClass||"multi-streams-mixer"),(a=[],e.forEach((function(e){A(e,"video").forEach((function(e){a.push(e)}))})),a).length&&(i.frameInterval=t.frameInterval||10,i.width=t.video.width||360,i.height=t.video.height||240,i.startDrawingFrames()),t.previewStream&&"function"==typeof t.previewStream&&t.previewStream(i.getMixedStream()),(r=new S(i.getMixedStream(),t)).record()},this.stop=function(e){r&&r.stop((function(t){a.blob=t,e(t),a.clearRecordedData()}))},this.pause=function(){r&&r.pause()},this.resume=function(){r&&r.resume()},this.clearRecordedData=function(){r&&(r.clearRecordedData(),r=null),i&&(i.releaseStreams(),i=null)},this.addStreams=function(a){if(!a)throw"First parameter is required.";a instanceof Array||(a=[a]),e.concat(a),r&&i&&(i.appendStreams(a),t.previewStream&&"function"==typeof t.previewStream&&t.previewStream(i.getMixedStream()))},this.resetVideoStreams=function(e){i&&(!e||e instanceof Array||(e=[e]),i.resetVideoStreams(e))},this.getMixer=function(){return i},this.name="MultiStreamRecorder",this.toString=function(){return this.name}}function O(e,t){var i,r,a;function n(){return new ReadableStream({start:function(r){var a=document.createElement("canvas"),n=document.createElement("video"),s=!0;n.srcObject=e,n.muted=!0,n.height=t.height,n.width=t.width,n.volume=0,n.onplaying=function(){a.width=t.width,a.height=t.height;var e=a.getContext("2d"),o=1e3/t.frameRate,c=setInterval((function(){if(i&&(clearInterval(c),r.close()),s&&(s=!1,t.onVideoProcessStarted&&t.onVideoProcessStarted()),e.drawImage(n,0,0),"closed"!==r._controlledReadableStream.state)try{r.enqueue(e.getImageData(0,0,t.width,t.height))}catch(a){}}),o)},n.play()}})}function s(e,c){if(!t.workerPath&&!c)return i=!1,void fetch("https://unpkg.com/webm-wasm@latest/dist/webm-worker.js").then((function(t){t.arrayBuffer().then((function(t){s(e,t)}))}));if(!t.workerPath&&c instanceof ArrayBuffer){var l=new Blob([c],{type:"text/javascript"});t.workerPath=u.createObjectURL(l)}t.workerPath||console.error("workerPath parameter is missing."),(r=new Worker(t.workerPath)).postMessage(t.webAssemblyPath||"https://unpkg.com/webm-wasm@latest/dist/webm-wasm.wasm"),r.addEventListener("message",(function(e){"READY"===e.data?(r.postMessage({width:t.width,height:t.height,bitrate:t.bitrate||1200,timebaseDen:t.frameRate||30,realtime:t.realtime}),n().pipeTo(new WritableStream({write:function(e){i?console.error("Got image, but recorder is finished!"):r.postMessage(e.data.buffer,[e.data.buffer])}}))):e.data&&(a||o.push(e.data))}))}("undefined"===typeof ReadableStream?"undefined":Object(E["a"])(ReadableStream))<"u"&&("undefined"===typeof WritableStream?"undefined":Object(E["a"])(WritableStream))<"u"||console.error("Following polyfill is strongly recommended: https://unpkg.com/@mattiasbuelens/web-streams-polyfill/dist/polyfill.min.js"),(t=t||{}).width=t.width||640,t.height=t.height||480,t.frameRate=t.frameRate||30,t.bitrate=t.bitrate||1200,t.realtime=t.realtime||!0,this.record=function(){o=[],a=!1,this.blob=null,s(e),"function"==typeof t.initCallback&&t.initCallback()},this.pause=function(){a=!0},this.resume=function(){a=!1};var o=[];this.stop=function(e){i=!0;var t=this;(function(e){r?(r.addEventListener("message",(function(t){null===t.data&&(r.terminate(),r=null,e&&e())})),r.postMessage(null)):e&&e()})((function(){t.blob=new Blob(o,{type:"video/webm"}),e(t.blob)}))},this.name="WebAssemblyRecorder",this.toString=function(){return this.name},this.clearRecordedData=function(){o=[],a=!1,this.blob=null},this.blob=null}t.DiskStorage=L,t.GifRecorder=D,t.MultiStreamRecorder=P,t.RecordRTCPromisesHandler=function(e,i){if(!this)throw'Use "new RecordRTCPromisesHandler()"';if(void 0===e)throw'First argument "MediaStream" is required.';var r=this;r.recordRTC=new t(e,i),this.startRecording=function(){return new Promise((function(e,t){try{r.recordRTC.startRecording(),e()}catch(i){t(i)}}))},this.stopRecording=function(){return new Promise((function(e,t){try{r.recordRTC.stopRecording((function(i){r.blob=r.recordRTC.getBlob(),r.blob&&r.blob.size?e(i):t("Empty blob.",r.blob)}))}catch(i){t(i)}}))},this.pauseRecording=function(){return new Promise((function(e,t){try{r.recordRTC.pauseRecording(),e()}catch(i){t(i)}}))},this.resumeRecording=function(){return new Promise((function(e,t){try{r.recordRTC.resumeRecording(),e()}catch(i){t(i)}}))},this.getDataURL=function(e){return new Promise((function(e,t){try{r.recordRTC.getDataURL((function(t){e(t)}))}catch(i){t(i)}}))},this.getBlob=function(){return new Promise((function(e,t){try{e(r.recordRTC.getBlob())}catch(i){t(i)}}))},this.getInternalRecorder=function(){return new Promise((function(e,t){try{e(r.recordRTC.getInternalRecorder())}catch(i){t(i)}}))},this.reset=function(){return new Promise((function(e,t){try{e(r.recordRTC.reset())}catch(i){t(i)}}))},this.destroy=function(){return new Promise((function(e,t){try{e(r.recordRTC.destroy())}catch(i){t(i)}}))},this.getState=function(){return new Promise((function(e,t){try{e(r.recordRTC.getState())}catch(i){t(i)}}))},this.blob=null,this.version="5.6.2"},t.WebAssemblyRecorder=O})),hs=function(){function e(t){Object(T["a"])(this,e),this._buffer=t,this._buffer_index=0,this._total_bytes=t.byteLength,this._total_bits=8*t.byteLength,this._current_word=0,this._current_word_bits_left=0}return Object(S["a"])(e,[{key:"destroy",value:function(){this._buffer=null}},{key:"_fillCurrentWord",value:function(){var e=this._total_bytes-this._buffer_index;if(e<=0)console.error("ExpGolomb: _fillCurrentWord() but no bytes available",this._total_bytes,this._buffer_index);else{var t=Math.min(4,e),i=new Uint8Array(4);i.set(this._buffer.subarray(this._buffer_index,this._buffer_index+t)),this._current_word=new DataView(i.buffer).getUint32(0,!1),this._buffer_index+=t,this._current_word_bits_left=8*t}}},{key:"readBits",value:function(e){if(e>32&&console.error("ExpGolomb: readBits() bits exceeded max 32bits!"),e<=this._current_word_bits_left){var t=this._current_word>>>32-e;return this._current_word<<=e,this._current_word_bits_left-=e,t}var i=this._current_word_bits_left?this._current_word:0;i>>>=32-this._current_word_bits_left;var r=e-this._current_word_bits_left;this._fillCurrentWord();var a=Math.min(r,this._current_word_bits_left),n=this._current_word>>>32-a;return this._current_word<<=a,this._current_word_bits_left-=a,i=i<<a|n,i}},{key:"readBool",value:function(){return 1===this.readBits(1)}},{key:"readByte",value:function(){return this.readBits(8)}},{key:"_skipLeadingZero",value:function(){var e;for(e=0;e<this._current_word_bits_left;e++)if(this._current_word&2147483648>>>e)return this._current_word<<=e,this._current_word_bits_left-=e,e;return this._fillCurrentWord(),e+this._skipLeadingZero()}},{key:"readUEG",value:function(){var e=this._skipLeadingZero();return this.readBits(e+1)-1}},{key:"readSEG",value:function(){var e=this.readUEG();return 1&e?e+1>>>1:-1*(e>>>1)}}]),e}(),fs=function(){function e(){Object(T["a"])(this,e)}return Object(S["a"])(e,null,[{key:"_ebsp2rbsp",value:function(e){for(var t=e,i=t.byteLength,r=new Uint8Array(i),a=0,n=0;n<i;n++)n>=2&&3===t[n]&&0===t[n-1]&&0===t[n-2]||(r[a]=t[n],a++);return new Uint8Array(r.buffer,0,a)}},{key:"parseSPS",value:function(t){var i=e._ebsp2rbsp(t),r=new hs(i);r.readByte();var a=r.readByte();r.readByte();var n=r.readByte();r.readUEG();var s=e.getProfileString(a),o=e.getLevelString(n),c=1,l=420,u=[0,420,422,444],d=8;if((100===a||110===a||122===a||244===a||44===a||83===a||86===a||118===a||128===a||138===a||144===a)&&(c=r.readUEG(),3===c&&r.readBits(1),c<=3&&(l=u[c]),d=r.readUEG()+8,r.readUEG(),r.readBits(1),r.readBool()))for(var h=3!==c?8:12,f=0;f<h;f++)r.readBool()&&(f<6?e._skipScalingList(r,16):e._skipScalingList(r,64));r.readUEG();var p=r.readUEG();if(0===p)r.readUEG();else if(1===p){r.readBits(1),r.readSEG(),r.readSEG();for(var m=r.readUEG(),g=0;g<m;g++)r.readSEG()}var y=r.readUEG();r.readBits(1);var v=r.readUEG(),b=r.readUEG(),A=r.readBits(1);0===A&&r.readBits(1),r.readBits(1);var k=0,_=0,w=0,S=0;r.readBool()&&(k=r.readUEG(),_=r.readUEG(),w=r.readUEG(),S=r.readUEG());var T=1,E=1,x=0,C=!0,R=0,L=0;if(r.readBool()){if(r.readBool()){var D=r.readByte(),I=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],P=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];D>0&&D<16?(T=I[D-1],E=P[D-1]):255===D&&(T=r.readByte()<<8|r.readByte(),E=r.readByte()<<8|r.readByte())}if(r.readBool()&&r.readBool(),r.readBool()&&(r.readBits(4),r.readBool()&&r.readBits(24)),r.readBool()&&(r.readUEG(),r.readUEG()),r.readBool()){var O=r.readBits(32),B=r.readBits(32);C=r.readBool(),R=B,L=2*O,x=R/L}}var M=1;1===T&&1===E||(M=T/E);var F=0,U=0;0===c?(F=1,U=2-A):(F=3===c?1:2,U=(1===c?2:1)*(2-A));var j=16*(v+1),N=16*(b+1)*(2-A);j-=(k+_)*F,N-=(w+S)*U;var z=Math.ceil(j*M);return r.destroy(),r=null,{profile_string:s,level_string:o,bit_depth:d,ref_frames:y,chroma_format:l,chroma_format_string:e.getChromaFormatString(l),frame_rate:{fixed:C,fps:x,fps_den:L,fps_num:R},sar_ratio:{width:T,height:E},codec_size:{width:j,height:N},present_size:{width:z,height:N}}}},{key:"parseSPS$2",value:function(t){for(var i=t.subarray(1,4),r="avc1.",a=0;a<3;a++){var n=i[a].toString(16);n.length<2&&(n="0"+n),r+=n}var s=e._ebsp2rbsp(t),o=new hs(s);o.readByte();var c=o.readByte();o.readByte();var l=o.readByte();o.readUEG();var u=e.getProfileString(c),d=e.getLevelString(l),h=1,f=420,p=[0,420,422,444],m=8,g=8;if((100===c||110===c||122===c||244===c||44===c||83===c||86===c||118===c||128===c||138===c||144===c)&&(h=o.readUEG(),3===h&&o.readBits(1),h<=3&&(f=p[h]),m=o.readUEG()+8,g=o.readUEG()+8,o.readBits(1),o.readBool()))for(var y=3!==h?8:12,v=0;v<y;v++)o.readBool()&&(v<6?e._skipScalingList(o,16):e._skipScalingList(o,64));o.readUEG();var b=o.readUEG();if(0===b)o.readUEG();else if(1===b){o.readBits(1),o.readSEG(),o.readSEG();for(var A=o.readUEG(),k=0;k<A;k++)o.readSEG()}var _=o.readUEG();o.readBits(1);var w=o.readUEG(),S=o.readUEG(),T=o.readBits(1);0===T&&o.readBits(1),o.readBits(1);var E=0,x=0,C=0,R=0;o.readBool()&&(E=o.readUEG(),x=o.readUEG(),C=o.readUEG(),R=o.readUEG());var L=1,D=1,I=0,P=!0,O=0,B=0;if(o.readBool()){if(o.readBool()){var M=o.readByte(),F=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],U=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];M>0&&M<16?(L=F[M-1],D=U[M-1]):255===M&&(L=o.readByte()<<8|o.readByte(),D=o.readByte()<<8|o.readByte())}if(o.readBool()&&o.readBool(),o.readBool()&&(o.readBits(4),o.readBool()&&o.readBits(24)),o.readBool()&&(o.readUEG(),o.readUEG()),o.readBool()){var j=o.readBits(32),N=o.readBits(32);P=o.readBool(),O=N,B=2*j,I=O/B}}var z=1;1===L&&1===D||(z=L/D);var G=0,H=0;0===h?(G=1,H=2-T):(G=3===h?1:2,H=(1===h?2:1)*(2-T));var V=16*(w+1),W=16*(S+1)*(2-T);V-=(E+x)*G,W-=(C+R)*H;var q=Math.ceil(V*z);return o.destroy(),o=null,{codec_mimetype:r,profile_idc:c,level_idc:l,profile_string:u,level_string:d,chroma_format_idc:h,bit_depth:m,bit_depth_luma:m,bit_depth_chroma:g,ref_frames:_,chroma_format:f,chroma_format_string:e.getChromaFormatString(f),frame_rate:{fixed:P,fps:I,fps_den:B,fps_num:O},sar_ratio:{width:L,height:D},codec_size:{width:V,height:W},present_size:{width:q,height:W}}}},{key:"_skipScalingList",value:function(e,t){for(var i=8,r=8,a=0,n=0;n<t;n++)0!==r&&(a=e.readSEG(),r=(i+a+256)%256),i=0===r?i:r}},{key:"getProfileString",value:function(e){switch(e){case 66:return"Baseline";case 77:return"Main";case 88:return"Extended";case 100:return"High";case 110:return"High10";case 122:return"High422";case 244:return"High444";default:return"Unknown"}}},{key:"getLevelString",value:function(e){return(e/10).toFixed(1)}},{key:"getChromaFormatString",value:function(e){switch(e){case 420:return"4:2:0";case 422:return"4:2:2";case 444:return"4:4:4";default:return"Unknown"}}}]),e}(),ps=function(){function e(t){Object(T["a"])(this,e),this.buffer=t,this.buflen=t.length,this.bufpos=0,this.bufoff=0,this.iserro=!1}return Object(S["a"])(e,[{key:"read",value:function(e){for(var t=0,i=0;e;){if(e<0||this.bufpos>=this.buflen)return this.iserro=!0,0;this.iserro=!1,i=this.bufoff+e>8?8-this.bufoff:e,t<<=i,t+=this.buffer[this.bufpos]>>8-this.bufoff-i&255>>8-i,this.bufoff+=i,e-=i,8==this.bufoff&&(this.bufpos++,this.bufoff=0)}return t}},{key:"look",value:function(e){var t=this.bufpos,i=this.bufoff,r=this.read(e);return this.bufpos=t,this.bufoff=i,r}},{key:"read_golomb",value:function(){var e;for(e=0;0===this.read(1)&&!this.iserro;e++);return(1<<e)+this.read(e)-1}}]),e}();function ms(e){var t={},i=new DataView(e.buffer),r=i.getUint8(0),a=i.getUint8(1);if(i.getUint8(2),i.getUint8(3),1!==r||0===a)return{};var n=1+(3&i.getUint8(4));if(3!==n&&4!==n)return{};var s=31&i.getUint8(5);if(0===s)return{};for(var o=6,c=0;c<s;c++){var l=i.getUint16(o,!1);if(o+=2,0!==l){var u=new Uint8Array(e.buffer,o,l);o+=l;var d=fs.parseSPS(u);if(0===c){t.sps=u,t.timescale=1e3,t.codecWidth=d.codec_size.width,t.codecHeight=d.codec_size.height,t.presentWidth=d.present_size.width,t.presentHeight=d.present_size.height,t.profile=d.profile_string,t.level=d.level_string,t.bitDepth=d.bit_depth,t.chromaFormat=d.chroma_format,t.sarRatio=d.sar_ratio,t.frameRate=d.frame_rate,!1!==d.frame_rate.fixed&&0!==d.frame_rate.fps_num&&0!==d.frame_rate.fps_den||(t.frameRate={fixed:!0,fps:25,fps_num:25e3,fps_den:1e3});var h=t.frameRate.fps_den,f=t.frameRate.fps_num;t.refSampleDuration=t.timescale*(h/f);for(var p=u.subarray(1,4),m="avc1.",g=0;g<3;g++){var y=p[g].toString(16);y.length<2&&(y="0"+y),m+=y}t.codec=m}}}var v=i.getUint8(o);if(0===v)return{};o++;for(var b=0;b<v;b++){var A=i.getUint16(o,!1);if(o+=2,0!==A){var k=new Uint8Array(e.buffer,o,A);o+=A,t.pps=k}}if(t.videoType="avc",t.sps){var _=t.sps.byteLength,w=new Uint8Array([_>>>24&255,_>>>16&255,_>>>8&255,255&_]),S=new Uint8Array(_+4);S.set(w,0),S.set(t.sps,4),t.sps=S}if(t.pps){var T=t.pps.byteLength,E=new Uint8Array([T>>>24&255,T>>>16&255,T>>>8&255,255&T]),x=new Uint8Array(T+4);x.set(E,0),x.set(t.pps,4),t.pps=x}return t}function gs(e){var t=e.sps,i=e.pps,r=8+t.byteLength+1+2+i.byteLength,a=!1,n=fs.parseSPS$2(t);66!==t[3]&&77!==t[3]&&88!==t[3]&&(a=!0,r+=4);var s=new Uint8Array(r);s[0]=1,s[1]=t[1],s[2]=t[2],s[3]=t[3],s[4]=255,s[5]=225;var o=t.byteLength;s[6]=o>>>8,s[7]=255&o;var c=8;s.set(t,8),c+=o,s[c]=1;var l=i.byteLength;s[c+1]=l>>>8,s[c+2]=255&l,s.set(i,c+3),c+=3+l,a&&(s[c]=252|n.chroma_format_idc,s[c+1]=248|n.bit_depth_luma-8,s[c+2]=248|n.bit_depth_chroma-8,s[c+3]=0,c+=4);var u=[23,0,0,0,0],d=new Uint8Array(u.length+s.byteLength);return d.set(u,0),d.set(s,u.length),d}function ys(e,t){var i=[];i[0]=t?23:39,i[1]=1,i[2]=0,i[3]=0,i[4]=0;var r=new Uint8Array(i.length+e.byteLength);return r.set(i,0),r.set(e,i.length),r}function vs(e){return 31&e[0]}function bs(e){return e===Tt}function As(e){return!function(e){return e===_t||e===wt}(e)&&!bs(e)}function ks(e){return e===St}var _s=function(e){for(var t=e,i=t.byteLength,r=new Uint8Array(i),a=0,n=0;n<i;n++)n>=2&&3===t[n]&&0===t[n-1]&&0===t[n-2]||(r[a]=t[n],a++);return new Uint8Array(r.buffer,0,a)},ws=function(e){switch(e){case 0:return"4:0:0";case 1:return"4:2:0";case 2:return"4:2:2";case 3:return"4:4:4";default:return"Unknown"}};function Ss(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(e[t]<<24>>>0)+(e[t+1]<<16)+(e[t+2]<<8)+(e[t+3]||0)}function Ts(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4;if(!(e.length<4)){for(var i,r=e.length,a=[],n=0;n+t<r;)if(i=Ss(e,n),3===t&&(i>>>=8),n+=t,i){if(n+i>r)break;a.push(e.subarray(n,n+i)),n+=i}return a}}function Es(e){var t=e.byteLength,i=new Uint8Array(4);i[0]=t>>>24&255,i[1]=t>>>16&255,i[2]=t>>>8&255,i[3]=255&t;var r=new Uint8Array(t+4);return r.set(i,0),r.set(e,4),r}function xs(e,t){var i=null;return t?e.length>=28&&(i=1+(3&e[26])):e.length>=12&&(i=1+(3&e[9])),i}function Cs(e){var t={width:0,height:0,profile:0,level:0};e=e.slice(5);do{var i={};if(e.length<23){console.warn("parseHEVCDecoderConfigurationRecord$2","arrayBuffer.length ".concat(e.length," < 23"));break}if(i.configurationVersion=e[0],1!=i.configurationVersion)break;i.general_profile_space=e[1]>>6&3,i.general_tier_flag=e[1]>>5&1,i.general_profile_idc=31&e[1],i.general_profile_compatibility_flags=e[2]<<24|e[3]<<16|e[4]<<8|e[5],i.general_constraint_indicator_flags=e[6]<<24|e[7]<<16|e[8]<<8|e[9],i.general_constraint_indicator_flags=i.general_constraint_indicator_flags<<16|e[10]<<8|e[11],i.general_level_idc=e[12],i.min_spatial_segmentation_idc=(15&e[13])<<8|e[14],i.parallelismType=3&e[15],i.chromaFormat=3&e[16],i.bitDepthLumaMinus8=7&e[17],i.bitDepthChromaMinus8=7&e[18],i.avgFrameRate=e[19]<<8|e[20],i.constantFrameRate=e[21]>>6&3,i.numTemporalLayers=e[21]>>3&7,i.temporalIdNested=e[21]>>2&1,i.lengthSizeMinusOne=3&e[21];for(var r=e[22],a=e.slice(23),n=0;n<r&&!(a.length<3);n++){var s=63&a[0],o=a[1]<<8|a[2];a=a.slice(3);for(var c=0;c<o&&!(a.length<2);c++){var l=a[0]<<8|a[1];if(a.length<2+l)break;if(a=a.slice(2),33==s){var u=new Uint8Array(l);u.set(a.slice(0,l),0),i.psps=Rs(u),t.profile=i.general_profile_idc,t.level=i.general_level_idc/30,t.width=i.psps.pic_width_in_luma_samples-(i.psps.conf_win_left_offset+i.psps.conf_win_right_offset),t.height=i.psps.pic_height_in_luma_samples-(i.psps.conf_win_top_offset+i.psps.conf_win_bottom_offset)}a=a.slice(l)}}}while(0);return t.codecWidth=t.width||1920,t.codecHeight=t.height||1080,t.presentHeight=t.codecHeight,t.presentWidth=t.codecWidth,t.timescale=1e3,t.refSampleDuration=1e3/23976*1e3,t.videoType=Li,t}function Rs(e,t){var i={},r=e.length,a=[],n=new ps(e);n.read(1),n.read(6),n.read(6),n.read(3);for(var s=2;s<r;s++)s+2<r&&3==n.look(24)?(a.push(n.read(8)),a.push(n.read(8)),s+=2,n.read(8)):a.push(n.read(8));var o=new Uint8Array(a),c=new ps(o);if(i.sps_video_parameter_set_id=c.read(4),i.sps_max_sub_layers_minus1=c.read(3),i.sps_temporal_id_nesting_flag=c.read(1),i.profile_tier_level=function(e,t,i){var r={};r.profile_space=e.read(2),r.tier_flag=e.read(1),r.profile_idc=e.read(5),r.profile_compatibility_flags=e.read(32),r.general_progressive_source_flag=e.read(1),r.general_interlaced_source_flag=e.read(1),r.general_non_packed_constraint_flag=e.read(1),r.general_frame_only_constraint_flag=e.read(1),e.read(32),e.read(12),r.level_idc=e.read(8),r.sub_layer_profile_present_flag=[],r.sub_layer_level_present_flag=[];for(var a=0;a<i;a++)r.sub_layer_profile_present_flag[a]=e.read(1),r.sub_layer_level_present_flag[a]=e.read(1);if(i>0)for(var n=i;n<8;n++)e.read(2);r.sub_layer_profile_space=[],r.sub_layer_tier_flag=[],r.sub_layer_profile_idc=[],r.sub_layer_profile_compatibility_flag=[],r.sub_layer_progressive_source_flag=[],r.sub_layer_interlaced_source_flag=[],r.sub_layer_non_packed_constraint_flag=[],r.sub_layer_frame_only_constraint_flag=[],r.sub_layer_level_idc=[];for(var s=0;s<i;s++)r.sub_layer_profile_present_flag[s]&&(r.sub_layer_profile_space[s]=e.read(2),r.sub_layer_tier_flag[s]=e.read(1),r.sub_layer_profile_idc[s]=e.read(5),r.sub_layer_profile_compatibility_flag[s]=e.read(32),r.sub_layer_progressive_source_flag[s]=e.read(1),r.sub_layer_interlaced_source_flag[s]=e.read(1),r.sub_layer_non_packed_constraint_flag[s]=e.read(1),r.sub_layer_frame_only_constraint_flag[s]=e.read(1),e.read(32),e.read(12)),r.sub_layer_level_present_flag[s]?r.sub_layer_level_idc[s]=e.read(8):r.sub_layer_level_idc[s]=1;return r}(c,0,i.sps_max_sub_layers_minus1),i.sps_seq_parameter_set_id=c.read_golomb(),i.chroma_format_idc=c.read_golomb(),3==i.chroma_format_idc?i.separate_colour_plane_flag=c.read(1):i.separate_colour_plane_flag=0,i.pic_width_in_luma_samples=c.read_golomb(),i.pic_height_in_luma_samples=c.read_golomb(),i.conformance_window_flag=c.read(1),i.conformance_window_flag){var l=1+(i.chroma_format_idc<2),u=1+(i.chroma_format_idc<3);i.conf_win_left_offset=c.read_golomb()*u,i.conf_win_right_offset=c.read_golomb()*u,i.conf_win_top_offset=c.read_golomb()*l,i.conf_win_bottom_offset=c.read_golomb()*l}else i.conf_win_left_offset=0,i.conf_win_right_offset=0,i.conf_win_top_offset=0,i.conf_win_bottom_offset=0;return i}function Ls(e){var t=e.vps,i=e.pps,r=e.sps,a={configurationVersion:1},n=function(e){var t=_s(e),i=new hs(t);return i.readByte(),i.readByte(),i.readBits(4),i.readBits(2),i.readBits(6),{num_temporal_layers:i.readBits(3)+1,temporal_id_nested:i.readBool()}}(t),s=function(e){var t=_s(e),i=new hs(t);i.readByte(),i.readByte();i.readBits(4);var r=i.readBits(3);i.readBool();for(var a=i.readBits(2),n=i.readBool(),s=i.readBits(5),o=i.readByte(),c=i.readByte(),l=i.readByte(),u=i.readByte(),d=i.readByte(),h=i.readByte(),f=i.readByte(),p=i.readByte(),m=i.readByte(),g=i.readByte(),y=i.readByte(),v=[],b=[],A=0;A<r;A++)v.push(i.readBool()),b.push(i.readBool());if(r>0)for(var k=r;k<8;k++)i.readBits(2);for(var _=0;_<r;_++)v[_]&&(i.readByte(),i.readByte(),i.readByte(),i.readByte(),i.readByte(),i.readByte(),i.readByte(),i.readByte(),i.readByte(),i.readByte(),i.readByte()),v[_]&&i.readByte();i.readUEG();var w=i.readUEG();3==w&&i.readBits(1);var S=i.readUEG(),T=i.readUEG();i.readBool()&&(i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG());for(var E=i.readUEG(),x=i.readUEG(),C=i.readUEG(),R=i.readBool()?0:r;R<=r;R++)i.readUEG(),i.readUEG(),i.readUEG();if(i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG(),i.readBool()&&i.readBool())for(var L=0;L<4;L++)for(var D=0;D<(3===L?2:6);D++)if(i.readBool()){var I=Math.min(64,1<<4+(L<<1));L>1&&i.readSEG();for(var P=0;P<I;P++)i.readSEG()}else i.readUEG();i.readBool(),i.readBool(),i.readBool()&&(i.readByte(),i.readUEG(),i.readUEG(),i.readBool());for(var O=i.readUEG(),B=0,M=0;M<O;M++){var F=!1;if(0!==M&&(F=i.readBool()),F){M===O&&i.readUEG(),i.readBool(),i.readUEG();for(var U=0,j=0;j<=B;j++){var N=i.readBool(),z=!1;N||(z=i.readBool()),(N||z)&&U++}B=U}else{var G=i.readUEG(),H=i.readUEG();B=G+H;for(var V=0;V<G;V++)i.readUEG(),i.readBool();for(var W=0;W<H;W++)i.readUEG(),i.readBool()}}if(i.readBool())for(var q=i.readUEG(),K=0;K<q;K++){for(var J=0;J<C+4;J++)i.readBits(1);i.readBits(1)}var Y=!1,Q=0,X=1,$=1,Z=!1,ee=1,te=1;if(i.readBool(),i.readBool(),i.readBool()){if(i.readBool()){var ie=i.readByte(),re=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],ae=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];ie>0&&ie<16?(X=re[ie-1],$=ae[ie-1]):255===ie&&(X=i.readBits(16),$=i.readBits(16))}if(i.readBool()&&i.readBool(),i.readBool()&&(i.readBits(3),i.readBool(),i.readBool()&&(i.readByte(),i.readByte(),i.readByte())),i.readBool()&&(i.readUEG(),i.readUEG()),i.readBool(),i.readBool(),i.readBool(),Y=i.readBool(),Y&&(i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG()),i.readBool()&&(ee=i.readBits(32),te=i.readBits(32),i.readBool()&&(i.readUEG(),i.readBool()))){var ne=!1,se=!1,oe=!1;ne=i.readBool(),se=i.readBool(),(ne||se)&&(oe=i.readBool(),oe&&(i.readByte(),i.readBits(5),i.readBool(),i.readBits(5)),i.readBits(4),i.readBits(4),oe&&i.readBits(4),i.readBits(5),i.readBits(5),i.readBits(5));for(var ce=0;ce<=r;ce++){var le=i.readBool();Z=le;var ue=!1,de=1;le||(ue=i.readBool());var he=!1;if(ue?i.readSEG():he=i.readBool(),he||(cpbcnt=i.readUEG()+1),ne)for(var fe=0;fe<de;fe++)i.readUEG(),i.readUEG(),oe&&(i.readUEG(),i.readUEG());if(se)for(var pe=0;pe<de;pe++)i.readUEG(),i.readUEG(),oe&&(i.readUEG(),i.readUEG())}}i.readBool()&&(i.readBool(),i.readBool(),i.readBool(),Q=i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG())}i.readBool();var me,ge="hvc1.".concat(s,".1.L").concat(y,".B0"),ye=S,ve=T,be=1;return 1!==X&&1!==$&&(be=X/$),i.destroy(),i=null,{codec_mimetype:ge,level_string:(me=y,(me/30).toFixed(1)),profile_idc:s,bit_depth:E+8,ref_frames:1,chroma_format:w,chroma_format_string:ws(w),general_level_idc:y,general_profile_space:a,general_tier_flag:n,general_profile_idc:s,general_profile_compatibility_flags_1:o,general_profile_compatibility_flags_2:c,general_profile_compatibility_flags_3:l,general_profile_compatibility_flags_4:u,general_constraint_indicator_flags_1:d,general_constraint_indicator_flags_2:h,general_constraint_indicator_flags_3:f,general_constraint_indicator_flags_4:p,general_constraint_indicator_flags_5:m,general_constraint_indicator_flags_6:g,min_spatial_segmentation_idc:Q,constant_frame_rate:0,chroma_format_idc:w,bit_depth_luma_minus8:E,bit_depth_chroma_minus8:x,frame_rate:{fixed:Z,fps:te/ee,fps_den:ee,fps_num:te},sar_ratio:{width:X,height:$},codec_size:{width:ye,height:ve},present_size:{width:ye*be,height:ve}}}(r),o=function(e){var t=_s(e),i=new hs(t);i.readByte(),i.readByte(),i.readUEG(),i.readUEG(),i.readBool(),i.readBool(),i.readBits(3),i.readBool(),i.readBool(),i.readUEG(),i.readUEG(),i.readSEG(),i.readBool(),i.readBool(),i.readBool()&&i.readUEG(),i.readSEG(),i.readSEG(),i.readBool(),i.readBool(),i.readBool(),i.readBool();var r=i.readBool(),a=i.readBool(),n=1;return a&&r?n=0:a?n=3:r&&(n=2),{parallelismType:n}}(i);a=Object.assign(a,n,s,o);var c=23+(5+t.byteLength)+(5+r.byteLength)+(5+i.byteLength),l=new Uint8Array(c);l[0]=1,l[1]=(3&a.general_profile_space)<<6|(a.general_tier_flag?1:0)<<5|31&a.general_profile_idc,l[2]=a.general_profile_compatibility_flags_1||0,l[3]=a.general_profile_compatibility_flags_2||0,l[4]=a.general_profile_compatibility_flags_3||0,l[5]=a.general_profile_compatibility_flags_4||0,l[6]=a.general_constraint_indicator_flags_1||0,l[7]=a.general_constraint_indicator_flags_2||0,l[8]=a.general_constraint_indicator_flags_3||0,l[9]=a.general_constraint_indicator_flags_4||0,l[10]=a.general_constraint_indicator_flags_5||0,l[11]=a.general_constraint_indicator_flags_6||0,l[12]=60,l[13]=240|(3840&a.min_spatial_segmentation_idc)>>8,l[14]=255&a.min_spatial_segmentation_idc,l[15]=252|3&a.parallelismType,l[16]=252|3&a.chroma_format_idc,l[17]=248|7&a.bit_depth_luma_minus8,l[18]=248|7&a.bit_depth_chroma_minus8,l[19]=0,l[20]=0,l[21]=(3&a.constant_frame_rate)<<6|(7&a.num_temporal_layers)<<3|(a.temporal_id_nested?1:0)<<2|3,l[22]=3,l[23]=128|Ct,l[24]=0,l[25]=1,l[26]=(65280&t.byteLength)>>8,l[27]=(255&t.byteLength)>>0,l.set(t,28),l[23+(5+t.byteLength)+0]=128|Rt,l[23+(5+t.byteLength)+1]=0,l[23+(5+t.byteLength)+2]=1,l[23+(5+t.byteLength)+3]=(65280&r.byteLength)>>8,l[23+(5+t.byteLength)+4]=(255&r.byteLength)>>0,l.set(r,23+(5+t.byteLength)+5),l[23+(5+t.byteLength+5+r.byteLength)+0]=128|Lt,l[23+(5+t.byteLength+5+r.byteLength)+1]=0,l[23+(5+t.byteLength+5+r.byteLength)+2]=1,l[23+(5+t.byteLength+5+r.byteLength)+3]=(65280&i.byteLength)>>8,l[23+(5+t.byteLength+5+r.byteLength)+4]=(255&i.byteLength)>>0,l.set(i,23+(5+t.byteLength+5+r.byteLength)+5);var u=[28,0,0,0,0],d=new Uint8Array(u.length+l.byteLength);return d.set(u,0),d.set(l,u.length),d}function Ds(e,t){var i=[];i[0]=t?28:44,i[1]=1,i[2]=0,i[3]=0,i[4]=0;var r=new Uint8Array(i.length+e.byteLength);return r.set(i,0),r.set(e,i.length),r}function Is(e){return(126&e[0])>>1}function Ps(e){return!function(e){return e>=32&&e<=40}(e)}function Os(e){return e>=16&&e<=21}var Bs=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this),r.TAG_NAME="recorderCommon",r.player=e,r.fileName="",r._isRecording=!1,r._recordingTimestamp=0,r.recordingInterval=null,r.sps=null,r.pps=null,r.vps=null,r.codecId=null,r.audioCodeId=null,r.metaInfo={codecWidth:0,codecHeight:0,presentWidth:0,presentHeight:0,refSampleDuration:0,timescale:1e3,avcc:null,videoType:""},r.audioMetaInfo={timescale:1e3,sampleRate:0,refSampleDuration:0,channelCount:0,codec:"",originalCodec:"",audioType:"",extraData:new Uint8Array(0)},r}return Object(S["a"])(i,[{key:"destroy",value:function(){this._reset(),this.sps=null,this.pps=null,this.vps=null,this.codecId=null,this.audioCodeId=null,this.metaInfo=null,this.audioMetaInfo=null}},{key:"isH264",get:function(){return this.codecId===pt}},{key:"isH265",get:function(){return this.codecId===mt}},{key:"setFileName",value:function(e){this.fileName=e}},{key:"isRecording",get:function(){return this._isRecording}},{key:"recording",get:function(){return this._isRecording}},{key:"recordTime",get:function(){return this._recordingTimestamp}},{key:"startRecord",value:function(){}},{key:"handleAddNaluTrack",value:function(e,t,i,r){}},{key:"handleAddAudioTrack",value:function(e,t){}},{key:"handleAddTrack",value:function(e){}},{key:"stopRecordAndSave",value:function(){}},{key:"startRecordingInterval",value:function(){}},{key:"isWasmMp4",value:function(){return!1}},{key:"stopRecordingInterval",value:function(){this.recordingInterval&&clearInterval(this.recordingInterval),this.recordingInterval=null}},{key:"getToTalByteLength",value:function(){return 0}},{key:"_reset",value:function(){this.fileName="",this._isRecording=!1,this._recordingTimestamp=0,this.stopRecordingInterval()}},{key:"initMetaData",value:function(e,t){var i,r=e.slice(5);if(this.codecId=t,this.metaInfo.avcc=r,t===pt)i=ms(r);else if(t===mt){i=function(e){var t=23,i=e[t];if((63&i)!==Ct)return console.warn("parseHEVCDecoderVPSAndSPSAndPPS and vpsTag is ".concat(i)),{};t+=2,t+=1;var r=e[t+1]|e[t]<<8;t+=2;var a=e.slice(t,t+r);t+=r;var n=e[t];if((63&n)!==Rt)return console.warn("parseHEVCDecoderVPSAndSPSAndPPS and sps tag is ".concat(n)),{};t+=2,t+=1;var s=e[t+1]|e[t]<<8;t+=2;var o=e.slice(t,t+s);t+=s;var c=e[t];if((63&c)!==Lt)return console.warn("parseHEVCDecoderVPSAndSPSAndPPS and pps tag is ".concat(c)),{};t+=2,t+=1;var l=e[t+1]|e[t]<<8;t+=2;var u=e.slice(t,t+l),d=new Uint8Array([s>>>24&255,s>>>16&255,s>>>8&255,255&s]),h=new Uint8Array([l>>>24&255,l>>>16&255,l>>>8&255,255&l]),f=new Uint8Array([r>>>24&255,r>>>16&255,r>>>8&255,255&r]),p=new Uint8Array(s+4);p.set(d,0),p.set(o,4);var m=new Uint8Array(l+4);m.set(h,0),m.set(u,4);var g=new Uint8Array(r+4);return g.set(f,0),g.set(a,4),{sps:p,pps:m,vps:g}}(r);var a=Cs(e);i=Object.assign(i,a)}i&&(i.vps&&(this.vps=i.vps),i.pps&&(this.pps=i.pps),i.sps&&(this.sps=i.sps),i.presentWidth&&(this.metaInfo.presentWidth=i.presentWidth),i.presentHeight&&(this.metaInfo.presentHeight=i.presentHeight),i.codecWidth&&(this.metaInfo.codecWidth=i.codecWidth),i.codecHeight&&(this.metaInfo.codecHeight=i.codecHeight),i.timescale&&(this.metaInfo.timescale=i.timescale),i.refSampleDuration&&(this.metaInfo.refSampleDuration=i.refSampleDuration),i.videoType&&(this.metaInfo.videoType=i.videoType))}},{key:"initAudioMetaData",value:function(e,t){this.audioCodeId=t;var i=e[0]>>1&1,r=null;t===vt?(r=function(e){var t={},i=new Hr(e);return i.read(16),t.object_type=Vr(i),t.sample_rate=Wr(i,t),t.chan_config=i.read(4),t.chan_config<Kr.length&&(t.channels=Kr[t.chan_config]),t.sbr=-1,t.ps=-1,5!=t.object_type&&29!=t.object_type||(29==t.object_type&&(t.ps=1),t.ext_object_type=5,t.sbr=1,t.sample_rate=Wr(i,t),t.object_type=Vr(i)),Object(g["a"])(Object(g["a"])({},t),{},{channelCount:t.channels,sampleRate:t.sample_rate})}(e),r&&(r.channelCount&&(this.audioMetaInfo.channelCount=r.channelCount),r.codec&&(this.audioMetaInfo.codec=r.codec),r.originalCodec&&(this.audioMetaInfo.originalCodec=r.originalCodec),r.config&&(this.audioMetaInfo.config=r.config),r.sampleRate&&(this.audioMetaInfo.sampleRate=r.sampleRate),this.audioMetaInfo.sampleRate&&this.audioMetaInfo.timescale&&(this.audioMetaInfo.refSampleDuration=1024/this.audioMetaInfo.sampleRate*this.audioMetaInfo.timescale)),this.audioMetaInfo.depth=i?16:8,this.audioMetaInfo.extraData=e.slice(2)):this.audioMetaInfo.depth=0===i?8:16}},{key:"initAudioAacExtraData",value:function(e){this.audioMetaInfo.extraData=new Uint8Array(e)}}]),i}(fn),Ms=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e),r.totalByteLength=0,r._startRecordingTimestamp=null,e.debug.log("RecorderRTC","init"),r}return Object(S["a"])(i,[{key:"_reset",value:function(){k(Object(b["a"])(i.prototype),"_reset",this).call(this),this.totalByteLength=0,this._startRecordingTimestamp=null,this.recorder&&(this.recorder.destroy(),this.recorder=null)}},{key:"destroy",value:function(){k(Object(b["a"])(i.prototype),"destroy",this).call(this),this._reset(),this.player.debug.log("RecorderRTC","destroy")}},{key:"getSeekableBlob",value:function(e){var t=new EBML.Reader,i=new EBML.Decoder,r=EBML.tools,a=new FileReader;return new Promise((function(n,s){a.onload=function(e){i.decode(this.result).forEach((function(e){t.read(e)})),t.stop();var a=r.makeMetadataSeekable(t.metadatas,t.duration,t.cues),s=this.result.slice(t.metadataSize),o=new Blob([a,s],{type:"video/webm"});n(o)},a.readAsArrayBuffer(e)}))}},{key:"startRecord",value:function(){var e=this,t=this.player.debug,i={type:"video",mimeType:"video/webm;codecs=h264",timeSlice:1e3,onTimeStamp:function(i){t.log("RecorderRTC","record timestamp :"+i),null===e._startRecordingTimestamp&&(e._startRecordingTimestamp=i),e._recordingTimestamp=(i-e._startRecordingTimestamp)/1e3},ondataavailable:function(i){e.totalByteLength+=i.size,t.log("RecorderRTC","ondataavailable",i.size)},disableLogs:!this.player._opt.debug};try{var r=null;if(this.player.getRenderType()===q?r=this.player.video.$videoElement.captureStream(25):this.player.video.mediaStream?r=this.player.video.mediaStream:this.player.isOldHls()||this.player._opt.useMSE||this.player._opt.useWCS?r=this.player.video.$videoElement.captureStream(25):this.player.isWebrtcH264()&&(r=this.player.webrtc.videoStream),!r)return t.error("RecorderRTC","startRecord error and can not create stream"),void this.player.emitError(it.recordCreateError,"can not create stream");if(this.player.audio&&this.player.audio.mediaStreamAudioDestinationNode&&this.player.audio.mediaStreamAudioDestinationNode.stream&&!this.player.audio.isStateSuspended()&&this.player.audio.hasAudio&&this.player._opt.hasAudio){var a=this.player.audio.mediaStreamAudioDestinationNode.stream;if(a.getAudioTracks().length>0){var n=a.getAudioTracks()[0];n&&n.enabled&&r.addTrack(n)}}this.recorder=ds(r,i)}catch(r){return t.error("RecorderRTC","startRecord error",r),void this.player.emitError(it.recordCreateError,r)}this.recorder&&(this._isRecording=!0,this.player.emit(it.recording,!0),this.recorder.startRecording(),t.log("RecorderRTC","start recording"),this.player.emit(it.recordStart),this.startRecordingInterval())}},{key:"startRecordingInterval",value:function(){var e=this;this.stopRecordingInterval(),this.recordingInterval=window.setInterval((function(){e.player.emit(it.recordingTimestamp,e._recordingTimestamp)}),1e3)}},{key:"stopRecordAndSave",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:dt,i=arguments.length>1?arguments[1]:void 0;return new Promise((function(r,a){e.recorder&&e._isRecording||a("recorder is not ready"),i&&e.setFileName(i),e.recorder.stopRecording((function(){e.player.debug.log("RecorderRTC","stop recording");var i=(e.fileName||$r())+"."+R;if(e.recorder.getBlob(),t===ht){var a=e.recorder.getBlob();r(a),e.player.emit(it.recordBlob,a)}else r(),e.recorder.save(i);e.player.emit(it.recordEnd),e._reset(),e.player.emit(it.recording,!1)}))}))}},{key:"getToTalByteLength",value:function(){return this.totalByteLength}},{key:"getTotalDuration",value:function(){return this.recordTime}},{key:"getType",value:function(){return R}},{key:"initMetaData",value:function(){}}]),i}(Bs),Fs=function(){function e(){Object(T["a"])(this,e)}return Object(S["a"])(e,null,[{key:"init",value:function(){for(var t in e.types={avc1:[],avcC:[],hvc1:[],hvcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[],".mp3":[],free:[],edts:[],elst:[],stss:[]},e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var i=e.constants={};i.FTYP=new Uint8Array([105,115,111,109,0,0,2,0,105,115,111,109,105,115,111,50,97,118,99,49,109,112,52,49,0,0,0,0]),i.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),i.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),i.STSC=i.STCO=i.STTS,i.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),i.HDLR_VIDEO=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),i.HDLR_AUDIO=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),i.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),i.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),i.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}},{key:"box",value:function(e){for(var t=8,i=null,r=Array.prototype.slice.call(arguments,1),a=r.length,n=0;n<a;n++)t+=r[n].byteLength;i=new Uint8Array(t),i[0]=t>>>24&255,i[1]=t>>>16&255,i[2]=t>>>8&255,i[3]=255&t,i.set(e,4);for(var s=8,o=0;o<a;o++)i.set(r[o],s),s+=r[o].byteLength;return i}},{key:"generateInitSegment",value:function(t,i,r){var a=e.box(e.types.ftyp,e.constants.FTYP),n=e.box(e.types.free),s=8,o=new Uint8Array;r+s>=Math.pow(2,32)-1?(s=16,o=new Uint8Array(r+s),o.set(new Uint8Array([0,0,0,1]),0),o.set(e.types.mdat,4),o.set(new Uint8Array([r+8>>>56&255,r+8>>>48&255,r+8>>>40&255,r+8>>>32&255,r+8>>>24&255,r+8>>>16&255,r+8>>>8&255,r+8&255]),8)):(o=new Uint8Array(r+s),o[0]=r+8>>>24&255,o[1]=r+8>>>16&255,o[2]=r+8>>>8&255,o[3]=r+8&255,o.set(e.types.mdat,4));for(var c=0;c<i.length;c++){var l=i[c];l.duration=l.refSampleDuration*l.sequenceNumber;for(var u=0;u<l.sequenceNumber;u++){var d=l.samples[u];d.chunkOffset=a.byteLength+n.byteLength+s;var h=d.data;o.set(h,s),s+=h.byteLength}}var f=e.moov(t,i),p=new Uint8Array(a.byteLength+f.byteLength+o.byteLength+n.byteLength);return p.set(a,0),p.set(n,a.byteLength),p.set(o,a.byteLength+n.byteLength),p.set(f,a.byteLength+o.byteLength+n.byteLength),p}},{key:"moov",value:function(t,i){for(var r=t.timescale,a=t.duration,n=i.length,s=e.mvhd(r,a),o=new Uint8Array,c=0;c<n;c++){var l=e.trak(i[c]),u=new Uint8Array(l.byteLength+o.byteLength);u.set(o,0),u.set(l,o.byteLength),o=new Uint8Array(u.byteLength),o.set(u,0)}return e.box(e.types.moov,s,o)}},{key:"mvhd",value:function(t,i){return e.box(e.types.mvhd,new Uint8Array([0,0,0,0,206,186,253,168,206,186,253,168,t>>>24&255,t>>>16&255,t>>>8&255,255&t,i>>>24&255,i>>>16&255,i>>>8&255,255&i,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,0,0,0,3]))}},{key:"trak",value:function(t){return e.box(e.types.trak,e.tkhd(t),e.mdia(t))}},{key:"tkhd",value:function(t){var i=t.id,r=t.duration,a=t.presentWidth,n=t.presentHeight;return e.box(e.types.tkhd,new Uint8Array([0,0,0,15,206,186,253,168,206,186,253,168,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r,0,0,0,0,0,0,0,0,0,0,0,0,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,n>>>8&255,255&n,0,0]))}},{key:"edts",value:function(t,i){return e.box(e.types.edts,e.elst(t,i))}},{key:"elst",value:function(t,i){for(var r=0,a=0;a<i;a++)"video"===t[a].type&&(r+=t[a].duration);var n=t[i].duration;return 0===r&&(r=t[i].refSampleDuration),e.box(e.types.elst,new Uint8Array([0,0,0,0,0,0,0,2,r>>>24&255,r>>>16&255,r>>>8&255,255&r,255,255,255,255,0,1,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n,0,0,0,0,0,1,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t),e.hdlr(t),e.minf(t))}},{key:"mdhd",value:function(t){var i=t.timescale/t.refSampleDuration,r=i*t.duration/t.timescale;return e.box(e.types.mdhd,new Uint8Array([0,0,0,0,206,186,253,168,206,186,253,168,i>>>24&255,i>>>16&255,i>>>8&255,255&i,r>>>24&255,r>>>16&255,r>>>8&255,255&r,85,196,0,0]))}},{key:"hdlr",value:function(t){var i=null;return i=e.constants.HDLR_VIDEO,e.box(e.types.hdlr,i)}},{key:"minf",value:function(t){var i=null;return i=e.box(e.types.vmhd,e.constants.VMHD),e.box(e.types.minf,i,e.dinf(),e.stbl(t))}},{key:"dinf",value:function(){return e.box(e.types.dinf,e.box(e.types.dref,e.constants.DREF))}},{key:"stbl",value:function(t){for(var i=t.samples,r=[{No:1,num:0,sampleDelte:1,chunkNo:1,duration:i[0].duration}],a=[i[0].duration],n=i.length,s=0;s<n;s++)for(var o=0;o<r.length;o++)i[s].duration===r[o].duration?r[o].num++:a.indexOf(i[s].duration)<0&&(a.push(i[s].duration),r.push({No:2,num:0,sampleDelte:1,chunkNo:s+1,duration:i[s].duration}));return e.box(e.types.stbl,e.stsd(t),e.stts(r),e.stss(i),e.stsc(r),e.stsz(i),e.stco(r,i))}},{key:"stts",value:function(t){var i=t.length,r=new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i]),a=r.byteLength,n=new Uint8Array(a+8*i);n.set(r,0);for(var s=0;s<i;s++)n.set(new Uint8Array([t[s].num>>>24&255,t[s].num>>>16&255,t[s].num>>>8&255,255&t[s].num,t[s].sampleDelte>>>24&255,t[s].sampleDelte>>>16&255,t[s].sampleDelte>>>8&255,255&t[s].sampleDelte]),a),a+=8;return e.box(e.types.stts,n)}},{key:"stss",value:function(t){for(var i=[],r=t.length,a=0;a<r;a++)!0===t[a].isKeyframe&&i.push(a+1);var n=i.length,s=new Uint8Array([0,0,0,0,n>>>24&255,n>>>16&255,n>>>8&255,255&n]),o=s.byteLength,c=new Uint8Array(o+4*n);c.set(s,0);for(var l=0;l<n;l++)c.set(new Uint8Array([i[l]>>>24&255,i[l]>>>16&255,i[l]>>>8&255,255&i[l]]),o),o+=4;return e.box(e.types.stss,c)}},{key:"stsc",value:function(t){var i=t.length,r=new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i]),a=r.byteLength,n=new Uint8Array(a+12*i);n.set(r,0);for(var s=0;s<i;s++){var o=t[s].chunkNo,c=t[s].num,l=t[s].sampleDelte;n.set(new Uint8Array([o>>>24&255,o>>>16&255,o>>>8&255,255&o,c>>>24&255,c>>>16&255,c>>>8&255,255&c,l>>>24&255,l>>>16&255,l>>>8&255,255&l]),a),a+=12}return e.box(e.types.stsc,n)}},{key:"stsz",value:function(t){var i=t.length,r=new Uint8Array([0,0,0,0,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i]),a=r.byteLength,n=new Uint8Array(a+4*i);n.set(r,0);for(var s=0;s<i;s++){var o=t[s].data.byteLength;n.set(new Uint8Array([o>>>24&255,o>>>16&255,o>>>8&255,255&o]),a),a+=4}return e.box(e.types.stsz,n)}},{key:"stco",value:function(t,i){var r=i[0].chunkOffset;return e.box(e.types.stco,new Uint8Array([0,0,0,0,0,0,0,1,r>>>24&255,r>>>16&255,r>>>8&255,255&r]))}},{key:"stsd",value:function(t){return"audio"===t.type?"mp3"===t.codec?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp3(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp4a(t)):"avc"===t.videoType?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.avc1(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.hvc1(t))}},{key:"mp3",value:function(t){var i=t.channelCount,r=t.sampleRate,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,r>>>8&255,255&r,0,0]);return e.box(e.types[".mp3"],a)}},{key:"mp4a",value:function(t){var i=t.channelCount,r=t.sampleRate,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,r>>>8&255,255&r,0,0]);return e.box(e.types.mp4a,a,e.esds(t))}},{key:"esds",value:function(t){var i=t.config||[],r=i.length,a=new Uint8Array([0,0,0,0,3,23+r,0,1,0,4,15+r,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([r]).concat(i).concat([6,1,2]));return e.box(e.types.esds,a)}},{key:"avc1",value:function(t){var i=t.avcc,r=t.codecWidth,a=t.codecHeight,n=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,r>>>8&255,255&r,a>>>8&255,255&a,0,72,0,0,0,72,0,0,0,0,0,0,0,1,13,106,101,115,115,105,98,117,99,97,45,112,114,111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.avc1,n,e.box(e.types.avcC,i))}},{key:"hvc1",value:function(t){var i=t.avcc,r=t.codecWidth,a=t.codecHeight,n=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,r>>>8&255,255&r,a>>>8&255,255&a,0,72,0,0,0,72,0,0,0,0,0,0,0,1,13,106,101,115,115,105,98,117,99,97,45,112,114,111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.hvc1,n,e.box(e.types.hvcC,i))}},{key:"mvex",value:function(t){return e.box(e.types.mvex,e.trex(t))}},{key:"trex",value:function(t){var i=t.id,r=new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return e.box(e.types.trex,r)}},{key:"moof",value:function(t,i){return e.box(e.types.moof,e.mfhd(t.sequenceNumber),e.traf(t,i))}},{key:"mfhd",value:function(t){var i=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t]);return e.box(e.types.mfhd,i)}},{key:"traf",value:function(t,i){var r=t.id,a=e.box(e.types.tfhd,new Uint8Array([0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r])),n=e.box(e.types.tfdt,new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),s=e.sdtp(t),o=e.trun(t,s.byteLength+16+16+8+16+8+8);return e.box(e.types.traf,a,n,o,s)}},{key:"sdtp",value:function(t){for(var i=t.samples||[],r=i.length,a=new Uint8Array(4+r),n=0;n<r;n++){var s=i[n].flags;a[n+4]=s.isLeading<<6|s.dependsOn<<4|s.isDependedOn<<2|s.hasRedundancy}return e.box(e.types.sdtp,a)}},{key:"trun",value:function(t,i){var r=t.samples||[],a=r.length,n=12+16*a,s=new Uint8Array(n);i+=8+n,s.set([0,0,15,1,a>>>24&255,a>>>16&255,a>>>8&255,255&a,i>>>24&255,i>>>16&255,i>>>8&255,255&i],0);for(var o=0;o<a;o++){var c=r[o].duration,l=r[o].size,u=r[o].flags,d=r[o].cts;s.set([c>>>24&255,c>>>16&255,c>>>8&255,255&c,l>>>24&255,l>>>16&255,l>>>8&255,255&l,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.isNonSync,0,0,d>>>24&255,d>>>16&255,d>>>8&255,255&d],12+16*o)}return e.box(e.types.trun,s)}},{key:"mdat",value:function(t){return e.box(e.types.mdat,t)}}]),e}();Fs.init();var Us=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e),r.TAG_NAME="recorderMP4",r._reset(),e.debug.log(r.TAG_NAME,"init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){k(Object(b["a"])(i.prototype),"destroy",this).call(this),this._reset(),this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"_reset",value:function(){k(Object(b["a"])(i.prototype),"_reset",this).call(this),this.totalDuration=0,this.totalAudioDuration=0,this.totalByteLength=0,this.totalAudioByteLength=0,this.bufferList=[],this.audioBufferList=[],this.cacheTrack={},this.audioCacheTrack={},this.sequenceNumber=0,this.audioSequenceNumber=0}},{key:"startRecord",value:function(){var e=this.player.debug;this._isRecording=!0,this.player.emit(it.recording,!0),e.log(this.TAG_NAME,"start recording"),this.player.emit(it.recordStart),this.startRecordingInterval()}},{key:"startRecordingInterval",value:function(){var e=this;this.stopRecordingInterval(),this.recordingInterval=window.setInterval((function(){e.player.emit(it.recordingTimestamp,e.getTotalDuration())}),1e3)}},{key:"formatFmp4Track",value:function(e,t,i,r){return{id:1,sequenceNumber:++this.sequenceNumber,size:e.byteLength,dts:i,cts:r,isKeyframe:t,data:e,duration:0,flags:{isLeading:0,dependsOn:t?2:1,isDependedOn:t?1:0,hasRedundancy:0,isNonSync:t?0:1}}}},{key:"formatAudioFmp4Track",value:function(e,t){return{id:2,sequenceNumber:++this.audioSequenceNumber,size:e.byteLength,dts:t,pts:t,cts:0,data:new Uint8Array(e),duration:0,originalDts:t,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0}}}},{key:"handleAddNaluTrack",value:function(e,t,i,r){this.cacheTrack.id&&i>=this.cacheTrack.dts?(this.cacheTrack.duration=i-this.cacheTrack.dts,this.handleAddFmp4Track(this.cacheTrack)):this.cacheTrack={},this.cacheTrack=this.formatFmp4Track(e,t,i,r)}},{key:"handleAddAudioTrack",value:function(e,t){}},{key:"handleAddFmp4Track",value:function(e){if(this.isRecording)if(null!==this.sps&&null!==this.pps||!this.isH264)if(null!==this.sps&&null!==this.pps&&null!==this.vps||!this.isH265){var t=Object.assign({},e);t.pts=t.dts+t.cts;var i=t.data;if(t.isKeyframe)if(this.isH264){var r=new Uint8Array(this.sps.byteLength+this.pps.byteLength);r.set(this.sps,0),r.set(this.pps,this.sps.byteLength);var a=new Uint8Array(r.byteLength+i.byteLength);a.set(r,0),a.set(i,r.byteLength),t.data=a}else if(this.isH265){var n=new Uint8Array(this.sps.byteLength+this.pps.byteLength+this.vps.byteLength);n.set(this.vps,0),n.set(this.sps,this.vps.byteLength),n.set(this.pps,this.vps.byteLength+this.sps.byteLength);var s=new Uint8Array(n.byteLength+i.byteLength);s.set(n,0),s.set(i,n.byteLength),t.data=s}t.size=t.data.byteLength,this.totalDuration+=t.duration,this.totalByteLength+=t.data.byteLength,t.duration=0,t.originalDts=t.dts,delete t.id,delete t.sequenceNumber,this.bufferList.push(t)}else this.player.debug.error(this.TAG_NAME,"handleAddFmp4Track, is h265 and this.sps or this.pps or this.vps is null ");else this.player.debug.error(this.TAG_NAME,"handleAddFmp4Track, is h264 and this.sps or this.pps is null ");else this.player.debug.error(this.TAG_NAME,"handleAddFmp4Track, isRecording is false ")}},{key:"handleAddFmp4AudioTrack",value:function(e){var t=Object.assign({},e);t.pts=t.dts+t.cts,t.size=t.data.byteLength,this.totalAudioDuration+=t.duration,this.totalAudioByteLength+=t.data.byteLength,t.duration=0,t.originalDts=t.dts,delete t.id,delete t.sequenceNumber,this.audioBufferList.push(t)}},{key:"getTotalDuration",value:function(){return this.totalDuration/1e3}},{key:"getType",value:function(){return C}},{key:"getToTalByteLength",value:function(){return this.totalByteLength+this.totalAudioByteLength}},{key:"stopRecordAndSave",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:dt,i=arguments.length>1?arguments[1]:void 0;return new Promise((function(r,a){if(!e.isRecording)return e.player.debug.error(e.TAG_NAME,"stop recording fail, isRecording is false "),a("stop recording fail, isRecording is false ");if(0===e.bufferList.length)return e.player.debug.error(e.TAG_NAME,"stop recording fail, this.bufferList.length is 0 "),a("stop recording fail, this.bufferList.length is 0 ");i&&e.setFileName(i);var n=Object(g["a"])({id:1,type:"video",sps:e.sps,pps:e.pps,samples:e.bufferList,sequenceNumber:e.bufferList.length,length:0,addSampleNum:1,duration:0},e.metaInfo),s=Object(g["a"])({id:2,type:"audio",sequenceNumber:e.audioBufferList.length,samples:e.audioBufferList},e.audioMetaInfo),o=[n];s.samples.length>0&&o.push(s),e.player.debug.log(e.TAG_NAME,"trackList length is ".concat(o.length));var c=Fs.generateInitSegment({timescale:1e3,duration:e.totalDuration},o,e.totalByteLength+e.totalAudioByteLength);e.player.debug.log(e.TAG_NAME,"stop recording");var l=new Blob([c],{type:"application/octet-stream"});t===ht?(r(l),e.player.emit(it.recordBlob,l)):(r(),_a((e.fileName||$r())+"."+C,l)),e._reset(),e.player.emit(it.recording,!1)}))}}]),i}(Bs),js=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e),r.TAG_NAME="FlvRecorderLoader",r.player=e,r._init(),r.player.debug.log(r.TAG_NAME,"init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){k(Object(b["a"])(i.prototype),"destroy",this).call(this),this._init(),this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"_init",value:function(){this.hasAudio=!1,this.hasVideo=!1,this.startTime=null,this.currentTime=0,this.prevTimestamp=0,this.totalByteLength=0,this.totalDuration=0,this.flvMetaData=null,this.aacSequenceHeader=null,this.videoSequenceHeader=null,this.bufferList=[]}},{key:"_reset",value:function(){k(Object(b["a"])(i.prototype),"_reset",this).call(this),this._init()}},{key:"startRecord",value:function(){var e=this.player.debug;this._isRecording=!0,this.player.emit(it.recording,!0),e.log(this.TAG_NAME,"start recording"),this.player.emit(it.recordStart),this.startRecordingInterval()}},{key:"startRecordingInterval",value:function(){var e=this;this.stopRecordingInterval(),this.recordingInterval=window.setInterval((function(){e.player.emit(it.recordingTimestamp,e.getTotalDuration())}),1e3)}},{key:"addMetaData",value:function(e){this.flvMetaData=e}},{key:"addAACSequenceHeader",value:function(e){this.aacSequenceHeader=e}},{key:"addVideoSequenceHeader",value:function(e){this.videoSequenceHeader=e}},{key:"addVideo",value:function(e,t){this._setStartTime(t);var i=this._getBufferTs(t);this.hasVideo=!0,this._createBufferItem(e,je,i)}},{key:"addAudio",value:function(e,t){this._setStartTime(t);var i=this._getBufferTs(t);this.hasAudio=!0,this._createBufferItem(e,Ue,i)}},{key:"_setStartTime",value:function(e){null===this.startTime&&this._isRecording&&(this.startTime=e,this.player.debug.log(this.TAG_NAME,"_setStartTime is ".concat(e)))}},{key:"_getBufferTs",value:function(e){e>this.currentTime&&(this.currentTime=e);var t=0;return this.startTime&&e>=this.startTime&&(t=e-this.startTime),t>this.prevTimestamp?this.prevTimestamp=t:t=this.prevTimestamp,t}},{key:"_createBufferItem",value:function(e,t,i){var r=this._createFlvPacket(e,t,i),a=this._createFlvTag(r);this.totalByteLength+=a.byteLength,this.bufferList.push(a)}},{key:"_createFlvTag",value:function(e){var t=11+e.header.length,i=new Uint8Array(t+4);i[0]=e.header.type;var r=new DataView(i.buffer);return i[1]=e.header.length>>16&255,i[2]=e.header.length>>8&255,i[3]=255&e.header.length,i[4]=e.header.timestamp>>16&255,i[5]=e.header.timestamp>>8&255,i[6]=255&e.header.timestamp,i[7]=e.header.timestamp>>24&255,i[8]=0,i[9]=0,i[10]=0,r.setUint32(t,t),i.set(e.payload.subarray(0,e.header.length),11),i}},{key:"_createFlvPacket",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return{header:{length:e?e.length:0,timestamp:i,type:t},payload:e}}},{key:"stopRecordAndSave",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:dt,i=arguments.length>1?arguments[1]:void 0;return new Promise((function(r,a){if(!e.isRecording)return e.player.debug.error(e.TAG_NAME,"stop recording fail, isRecording is false "),a("stop recording fail, isRecording is false ");if(0===e.bufferList.length)return e.player.debug.error(e.TAG_NAME,"stop recording fail, this.bufferList.length is 0 "),a("stop recording fail, this.bufferList.length is 0 ");i&&e.setFileName(i);var n=new Uint8Array([70,76,86,1,0,0,0,0,9,0,0,0,0]);e.hasVideo&&(n[4]|=1),e.hasAudio&&(n[4]|=4);var s=[n];if(e.flvMetaData){var o=e._createFlvPacket(e.flvMetaData,Ne),c=e._createFlvTag(o);s.push(c)}if(e.videoSequenceHeader){var l=e._createFlvPacket(e.videoSequenceHeader,je),u=e._createFlvTag(l);s.push(u)}if(e.aacSequenceHeader){var d=e._createFlvPacket(e.aacSequenceHeader,Ue),h=e._createFlvTag(d);s.push(h)}var f=function(e){var t=e[0].constructor;return e.reduce((function(e,i){var r=new t((0|e.byteLength)+(0|i.byteLength));return r.set(e,0),r.set(i,0|e.byteLength),r}),new t)}(s.concat(e.bufferList));e.player.debug.log(e.TAG_NAME,"stop recording");var p=new Blob([f],{type:"application/octet-stream"});t===ht?(r(p),e.player.emit(it.recordBlob,p)):(r(),_a((e.fileName||$r())+"."+L,p)),e._reset(),e.player.emit(it.recording,!1)}))}},{key:"getTotalDuration",value:function(){var e=0;return null!==this.startTime&&null!==this.currentTime&&(e=this.currentTime-this.startTime),Math.round(e/1e3)}},{key:"getType",value:function(){return L}},{key:"getToTalByteLength",value:function(){return this.totalByteLength}}]),i}(Bs),Ns={init:0,findFirstStartCode:1,findSecondStartCode:2},zs=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this),r.player=e,r.isDestroyed=!1,r.reset(),r}return Object(S["a"])(i,[{key:"destroy",value:function(){this.isDestroyed=!1,this.off(),this.reset()}},{key:"reset",value:function(){this.stats=Ns.init,this.tempBuffer=new Uint8Array(0),this.parsedOffset=0,this.versionLayer=0}},{key:"dispatch",value:function(e,t){var i=new Uint8Array(this.tempBuffer.length+e.length);for(i.set(this.tempBuffer,0),i.set(e,this.tempBuffer.length),this.tempBuffer=i;!this.isDestroyed;){if(this.state==Ns.Init){for(var r=!1;this.tempBuffer.length-this.parsedOffset>=2&&!this.isDestroyed;)if(255==this.tempBuffer[this.parsedOffset]){if(!(!1&this.tempBuffer[this.parsedOffset+1])){this.versionLayer=this.tempBuffer[this.parsedOffset+1],this.state=Ns.findFirstStartCode,this.fisrtStartCodeOffset=this.parsedOffset,this.parsedOffset+=2,r=!0;break}this.parsedOffset++}else this.parsedOffset++;if(r)continue;break}if(this.state==Ns.findFirstStartCode){for(var a=!1;this.tempBuffer.length-this.parsedOffset>=2&&!this.isDestroyed;)if(255==this.tempBuffer[this.parsedOffset]){if(this.tempBuffer[this.parsedOffset+1]==this.versionLayer){this.state=Ns.findSecondStartCode,this.secondStartCodeOffset=this.parsedOffset,this.parsedOffset+=2,a=!0;break}this.parsedOffset++}else this.parsedOffset++;if(a)continue;break}if(this.state==Ns.findSecondStartCode){var n=this.tempBuffer.slice(this.fisrtStartCodeOffset,this.secondStartCodeOffset);this.emit("data",n,t),this.tempBuffer=this.tempBuffer.slice(this.secondStartCodeOffset),this.fisrtStartCodeOffset=0,this.parsedOffset=2,this.state=Ns.findFirstStartCode}}}}]),i}(fn),Gs=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e),r.TAG_NAME="recorderWasmMP4",r._reset(),r.wasmMp4Recorder=new window.JessibucaProMp4Recorder({debug:e._opt.debug,debugLevel:e._opt.debugLevel,debugUuid:e._opt.debugUuid,decoder:e._opt.wasmMp4RecorderDecoder}),r.mp3Demuxer=null,e.debug.log(r.TAG_NAME,"init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){k(Object(b["a"])(i.prototype),"destroy",this).call(this),this.mp3Demuxer&&(this.mp3Demuxer.destroy(),this.mp3Demuxer=null),this._reset(),this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"_reset",value:function(){k(Object(b["a"])(i.prototype),"_reset",this).call(this),this.cacheTrack={},this.audioCacheTrack={},this.totalDuration=0,this.totalAudioDuration=0,this.totalByteLength=0,this.totalAudioByteLength=0,this.hasAudio=!1,this.hasVideo=!1}},{key:"getType",value:function(){return C}},{key:"isWasmMp4",value:function(){return!0}},{key:"getTotalDuration",value:function(){return this.totalDuration/1e3}},{key:"getToTalByteLength",value:function(){return this.totalByteLength+this.totalAudioByteLength}},{key:"startRecord",value:function(){var e=this,t=this.player.debug,i=this.player.getAudioInfo(),r=this.player.getVideoInfo(),a={};if(this.codecId){var n={type:this.codecId,width:r.width,height:r.height,extraData:this.metaInfo.avcc};a.video=n,this.hasVideo=!0}if(i.encTypeCode&&(i.encTypeCode===vt||i.encTypeCode===bt)){var s={type:i.encTypeCode,sampleRate:i.sampleRate,channels:i.channels,extraData:this.audioMetaInfo.extraData,depth:i.depth};this.audioCodeId=i.encTypeCode,a.audio=s,this.hasAudio=!0}this.wasmMp4Recorder.startRecord(a).then((function(){e._isRecording=!0,e.player.emit(it.recording,!0),t.log(e.TAG_NAME,"start recording"),e.player.emit(it.recordStart),e.startRecordingInterval()}))["catch"]((function(i){t.error(e.TAG_NAME,"startRecord error",i),e.player.emitError(it.recordCreateError,i)}))}},{key:"startRecordingInterval",value:function(){var e=this;this.stopRecordingInterval(),this.recordingInterval=window.setInterval((function(){e.player.emit(it.recordingTimestamp,e.getTotalDuration())}),1e3)}},{key:"stopRecordAndSave",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:dt,i=arguments.length>1?arguments[1]:void 0;return new Promise((function(r,a){return e.isRecording?0===e.totalDuration?(e.player.debug.error(e.TAG_NAME,"stop recording fail, totalDuration is 0 "),a("stop recording fail, totalDuration is 0 ")):(i&&e.setFileName(i),void e.wasmMp4Recorder.stopRecord().then((function(i){t===ht?(r(i),e.player.emit(it.recordBlob,i)):(r(),_a((e.fileName||$r())+"."+C,i))}))["catch"]((function(t){e.player.debug.error(e.TAG_NAME,"stopRecord error",t),a(t)}))["finally"]((function(){e._reset(),e.player.emit(it.recording,!1)}))):(e.player.debug.error(e.TAG_NAME,"stop recording fail, isRecording is false "),a("stop recording fail, isRecording is false "))}))}},{key:"handleAddAudioTrack",value:function(e,t){var i=this;this.audioCodeId===bt?(this.mp3Demuxer||(this.mp3Demuxer=new zs(this.player),this.mp3Demuxer.on("data",(function(e,t){i._handleAddAudioTrack(e,t)}))),this.mp3Demuxer.dispatch(e,ts)):this._handleAddAudioTrack(e,t)}},{key:"_handleAddAudioTrack",value:function(e,t){an(this.hasAudio)||(this.audioCacheTrack.id&&t>=this.audioCacheTrack.dts?(this.audioCacheTrack.duration=t-this.audioCacheTrack.dts,this.totalAudioDuration+=this.audioCacheTrack.duration,this.totalAudioByteLength+=this.audioCacheTrack.payload.byteLength,this.wasmMp4Recorder.sendAudioFrame(this.audioCacheTrack.payload,this.audioCacheTrack.dts)):this.audioCacheTrack={},this.audioCacheTrack={id:2,payload:e,dts:t})}},{key:"handleAddNaluTrack",value:function(e,t,i,r){an(this.hasVideo)||(this.cacheTrack.id&&i>=this.cacheTrack.dts?(this.cacheTrack.duration=i-this.cacheTrack.dts,this.totalDuration+=this.cacheTrack.duration,this.totalByteLength+=this.cacheTrack.payload.byteLength,this.wasmMp4Recorder.sendVideoFrame(this.cacheTrack.payload,this.cacheTrack.isIFrame,this.cacheTrack.dts)):this.cacheTrack={},this.cacheTrack={id:1,payload:e,isIFrame:t,dts:i,cts:r})}}]),i}(Bs),Hs=function(){function e(t){return Object(T["a"])(this,e),new(e.getLoaderFactory(t._opt))(t)}return Object(S["a"])(e,null,[{key:"getLoaderFactory",value:function(e){if(e.recordType===C){if(e.useWasm||e.useMSE||e.useWCS)return window.JessibucaProMp4Recorder&&e.mp4RecordUseWasm?Gs:Us}else if(e.recordType===L)return js;return Ms}}]),e}();function Vs(e,t,i){var r=e;if(t+i<r.length){for(;i--;)if(128!=(192&r[++t]))return!1;return!0}return!1}function Ws(e){for(var t=[],i=e,r=0,a=e.length;r<a;)if(i[r]<128)t.push(String.fromCharCode(i[r])),++r;else{if(!(i[r]<192))if(i[r]<224){if(Vs(i,r,1)){var n=(31&i[r])<<6|63&i[r+1];if(n>=128){t.push(String.fromCharCode(65535&n)),r+=2;continue}}}else if(i[r]<240){if(Vs(i,r,2)){var s=(15&i[r])<<12|(63&i[r+1])<<6|63&i[r+2];if(s>=2048&&55296!=(63488&s)){t.push(String.fromCharCode(65535&s)),r+=3;continue}}}else if(i[r]<248&&Vs(i,r,3)){var o=(7&i[r])<<18|(63&i[r+1])<<12|(63&i[r+2])<<6|63&i[r+3];if(o>65536&&o<1114112){o-=65536,t.push(String.fromCharCode(o>>>10|55296)),t.push(String.fromCharCode(1023&o|56320)),r+=4;continue}}t.push(String.fromCharCode(65533)),++r}return t.join("")}var qs=function(){var e=new ArrayBuffer(2);return new DataView(e).setInt16(0,256,!0),256===new Int16Array(e)[0]}(),Ks=function(){function e(){Object(T["a"])(this,e)}return Object(S["a"])(e,null,[{key:"parseScriptData",value:function(t,i,r){var a={};try{var n=e.parseValue(t,i,r),s=e.parseValue(t,i+n.size,r-n.size);a[n.data]=s.data}catch(n){console.error("AMF",n.toString())}return a}},{key:"parseObject",value:function(t,i,r){var a=e.parseString(t,i,r),n=e.parseValue(t,i+a.size,r-a.size),s=n.objectEnd;return{data:{name:a.data,value:n.data},size:a.size+n.size,objectEnd:s}}},{key:"parseVariable",value:function(t,i,r){return e.parseObject(t,i,r)}},{key:"parseString",value:function(e,t,i){var r,a=new DataView(e,t,i).getUint16(0,!qs);return r=a>0?Ws(new Uint8Array(e,t+2,a)):"",{data:r,size:2+a}}},{key:"parseLongString",value:function(e,t,i){var r,a=new DataView(e,t,i).getUint32(0,!qs);return r=a>0?Ws(new Uint8Array(e,t+4,a)):"",{data:r,size:4+a}}},{key:"parseDate",value:function(e,t,i){var r=new DataView(e,t,i),a=r.getFloat64(0,!qs);return a+=60*r.getInt16(8,!qs)*1e3,{data:new Date(a),size:10}}},{key:"parseValue",value:function(t,i,r){var a,n=new DataView(t,i,r),s=1,o=n.getUint8(0),c=!1;try{switch(o){case 0:a=n.getFloat64(1,!qs),s+=8;break;case 1:a=!!n.getUint8(1),s+=1;break;case 2:var l=e.parseString(t,i+1,r-1);a=l.data,s+=l.size;break;case 3:a={};var u=0;for(9==(16777215&n.getUint32(r-4,!qs))&&(u=3);s<r-4;){var d=e.parseObject(t,i+s,r-s-u);if(d.objectEnd)break;a[d.data.name]=d.data.value,s+=d.size}s<=r-3&&9===(16777215&n.getUint32(s-1,!qs))&&(s+=3);break;case 8:a={},s+=4;var h=0;for(9==(16777215&n.getUint32(r-4,!qs))&&(h=3);s<r-8;){var f=e.parseVariable(t,i+s,r-s-h);if(f.objectEnd)break;a[f.data.name]=f.data.value,s+=f.size}s<=r-3&&9===(16777215&n.getUint32(s-1,!qs))&&(s+=3);break;case 9:a=void 0,s=1,c=!0;break;case 10:a=[];var p=n.getUint32(1,!qs);s+=4;for(var m=0;m<p;m++){var g=e.parseValue(t,i+s,r-s);a.push(g.data),s+=g.size}break;case 11:var y=e.parseDate(t,i+1,r-1);a=y.data,s+=y.size;break;case 12:var v=e.parseString(t,i+1,r-1);a=v.data,s+=v.size;break;default:s=r,console.warn("AMF","Unsupported AMF value type "+o)}}catch(l){console.error("AMF",l.toString())}return{data:a,size:s,objectEnd:c}}}]),e}();function Js(e){return Ks.parseScriptData(e.buffer,e.byteOffset,e.byteLength)}var Ys=function(){function e(t){var i=this;Object(T["a"])(this,e),this.player=t,this.destroyResolve=null,this.workerClearTimeout=null,this.workerUrl=null;var r=t._opt.decoder;if(this.decoderWorkerCloseTimeout=null,an(this.player._opt.useWasm)&&(r=this.player._opt.demuxUseWorker?t._opt.decoderHard:t._opt.decoderAudio),0===r.indexOf("http")&&this.player._opt.isDecoderUseCDN){var a=new Blob(['importScripts("'.concat(r,'")')],{type:"application/javascript"});r=window.URL.createObjectURL(a),this.workerUrl=r,this.workerClearTimeout=setTimeout((function(){window.URL.revokeObjectURL(i.workerUrl),i.workerUrl=null,i.workerClearTimeout=null}),ie)}this.decoderWorker=new Worker(r),this._initDecoderWorker(),t.debug.log("decoderWorker","init and decoder url is ".concat(r)),t.on(it.visibilityChange,(function(){i.updateWorkConfig({key:"visibility",value:t.visibility})}))}return Object(S["a"])(e,[{key:"destroy",value:function(){var e=this;return new Promise((function(t,i){e.player.loaded?(e.player.debug.log("decoderWorker","has loaded and post message to destroy"),e.decoderWorker?(e.decoderWorker.postMessage({cmd:We}),e.destroyResolve=t,e.decoderWorkerCloseTimeout=setTimeout((function(){e.player.debug.warn("decoderWorker","send close but not response and destroy directly"),e.decoderWorkerCloseTimeout&&(clearTimeout(e.decoderWorkerCloseTimeout),e.decoderWorkerCloseTimeout=null),e._destroy(),setTimeout((function(){t()}),0)}),2e3)):(e.player.debug.warn("decoderWorker","has loaded but decoderWorker is null and destroy directly"),e._destroy(),setTimeout((function(){t()}),0))):(e.player.debug.log("decoderWorker","has not loaded and destroy directly"),e._destroy(),setTimeout((function(){t()}),0))}))}},{key:"_destroy",value:function(){this.decoderWorkerCloseTimeout&&(clearTimeout(this.decoderWorkerCloseTimeout),this.decoderWorkerCloseTimeout=null),this.workerUrl&&(window.URL.revokeObjectURL(this.workerUrl),this.workerUrl=null),this.workerClearTimeout&&(clearTimeout(this.workerClearTimeout),this.workerClearTimeout=null),this.decoderWorker&&(this.decoderWorker.terminate(),this.decoderWorker.onerror=null,this.decoderWorker.onmessageerror=null,this.decoderWorker.onmessage=null,this.decoderWorker=null),this.player.debug.log("decoderWorker","destroy"),this.destroyResolve&&(this.destroyResolve(),this.destroyResolve=null)}},{key:"_initDecoderWorker",value:function(){var e=this,t=this.player,i=t.debug;t.events.proxy;this.decoderWorker.onerror=function(t){e.player.debug.error("decoderWorker","onerror",t),e.player.emitError(nt.decoderWorkerInitError,t)},this.decoderWorker.onmessageerror=function(t){e.player.debug.error("decoderWorker","onmessageerror",t)},this.decoderWorker.onmessage=function(t){var a=t.data;switch(a.cmd){case ne:i.log("decoderWorker","onmessage:",ne),e.decoderWorker&&e._initWork(),e.player.loaded||e.player.emit(it.load),e.player.emit(it.decoderWorkerInit);break;case fe:i.log("decoderWorker","onmessage:",fe,a.code),e.player._times.decodeStart||(e.player._times.decodeStart=$r()),e.player.video.updateVideoInfo({encTypeCode:a.code});break;case pe:i.log("decoderWorker","onmessage:",pe,a.codecId),e.player.recorder&&e.player.recorder.initMetaData(a.buffer,a.codecId);break;case ue:i.log("decoderWorker","onmessage:",ue,a.code),e.player.audio&&e.player.audio.updateAudioInfo({encTypeCode:a.code});break;case he:i.log("decoderWorker","onmessage:",he),e.player.recorder&&e.player.recorder.initAudioAacExtraData(a.buffer);break;case se:if(i.log("decoderWorker","onmessage:",se,"width:".concat(a.w,",height:").concat(a.h)),wa(a.w)||wa(a.h))return void e.player.emitError(nt.videoInfoError,"video width ".concat(a.w," or height ").concat(a.h," is empty"));if(e.player.video.updateVideoInfo({width:a.w,height:a.h}),!e.player._opt.openWebglAlignment&&a.w/2%4!=0&&e.player.getRenderType()===q)return void e.player.emitError(nt.webglAlignmentError);e.player.video.initCanvasViewSize(),e.player._opt.playType===A&&(e.player.video.initFps(),e.player.video.initVideoDelay());break;case le:if(i.log("decoderWorker","onmessage:",le,"channels:".concat(a.channels,",sampleRate:").concat(a.sampleRate)),a.channels>2)return void e.player.emitError(nt.audioChannelError,"audio channel is ".concat(a.channels,", max is 2"));e.player.audio&&(e.player.audio.updateAudioInfo(a),e.player._opt.playType===u?e.player.audio.initScriptNode():e.player._opt.playType===A&&e.player.audio.initScriptNodeDelay());break;case oe:if(!e.player.video)return void i.warn("decoderWorker","onmessage render but video is null");if(e.player.isPlayer()){if(an(e.player.video.getHasInit()))return void i.warn("decoderWorker","onmessage render but video has not init");e.player.video.render(a),e.player.handleRender(),e.player.emit(it.timeUpdate,a.ts),e.player.updateStats({dfps:!0,buf:a.delay}),e.player._times.videoStart||(e.player._times.videoStart=$r(),e.player.handlePlayToRenderTimes())}else e.player.isPlayback()&&(e.player.updateStats({dfps:!0}),an(e.player.playbackPause)?(e.player.playback.isUseLocalCalculateTime&&e.player.playback.increaseLocalTimestamp(),e.player.playback.isUseFpsRender?e.player.video.pushData(a):e.player.video.render$2(a)):!e.player.playback.isPlaybackPauseClearCache&&e.player.playback.isCacheBeforeDecodeForFpsRender&&e.player.playback.isUseFpsRender&&e.player.video.pushData(a));break;case me:e.player.recorder&&e.player.recorder.isRecording&&e.player._opt.recordType===C&&e.player.recorder.handleAddNaluTrack(a.buffer,a.isIFrame,a.ts,a.cts);break;case de:e.player.recorder&&e.player.recorder.isRecording&&e.player._opt.recordType===C&&e.player.recorder.isWasmMp4()&&e.player.recorder.handleAddAudioTrack(a.buffer,a.ts);break;case ge:var n=e.player,s=n.webcodecsDecoder,o=n.mseDecoder;e.player.updateStats({buf:a.delay});var c=new Uint8Array(a.payload);e.player._opt.useWCS&&!e.player._opt.useOffscreen?s.decodeVideo(c,a.ts,a.isIFrame,a.cts):e.player._opt.useMSE&&o.decodeVideo(c,a.ts,a.isIFrame,a.cts);break;case ce:if(!e.player.audio)return void i.warn("decoderWorker","onmessage playAudio but audio is null");(e.player.playing&&e.player.audio||!e.player.video)&&(e.player._opt.hasVideo||e.player.handleRender(),(e.player._opt.playType===u||e.player._opt.playType===A&&(an(e.player.playbackPause)||!e.player.playback.isPlaybackPauseClearCache&&e.player.playback.isCacheBeforeDecodeForFpsRender&&e.player.playback.isUseFpsRender))&&e.player.audio.play(a.buffer,a.ts));break;case ve:if(a.type===it.streamSuccess)e.player.stream?e.player.stream.emit(it.streamSuccess):i.warn("decoderWorker","onmessage and workerFetch response stream success but stream is null");else if(a.type===it.streamRate)e.player.emit(it.kBps,(a.value/1024).toFixed(2));else if(a.type===it.streamEnd)e.player?(a.value===r&&e.player.emit(it.websocketClose),e.player.stream?e.player.stream.emit(it.streamEnd):i&&i.warn("decoderWorker","onmessage and workerFetch response stream end but player.stream is null")):i&&i.warn("decoderWorker","onmessage and workerFetch response stream end but player is null");else if(a.type===nt.websocketError)e.player&&e.player.stream?e.player.stream.emit(nt.websocketError,a.value):i&&i.warn("decoderWorker","onmessage and workerFetch response websocket error but stream is null");else if(a.type===nt.fetchError)e.player&&e.player.stream?e.player.stream.emit(nt.fetchError,a.value):i&&i.warn("decoderWorker","onmessage and workerFetch response fetch error but stream is null");else if(a.type===it.streamAbps)e.player.updateStats({abps:a.value});else if(a.type===it.streamVbps)e.player._times.demuxStart||(e.player._times.demuxStart=$r()),e.player.updateStats({vbps:a.value});else if(a.type===it.streamDts)e.player.updateStats({dts:a.value});else if(a.type===it.netBuf)e.player.updateStats({netBuf:a.value});else if(a.type===it.networkDelayTimeout)e.player.emit(it.networkDelayTimeout,a.value);else if(a.type===it.streamStats){var l=JSON.parse(a.value);e.player.updateStats({workerStats:l})}else a.type===it.websocketOpen&&e.player.emit(it.websocketOpen);break;case be:e.player&&(e.player.videoIframeIntervalTs=a.value);break;case Ae:e.player&&e.player.updateStats({isDropping:!0});break;case Oe:e.player.decoderCheckFirstIFrame();break;case _e:e.player&&e.player.video&&e.player.video.setStreamFps(a.value);break;case ye:a.message&&-1!==a.message.indexOf(Be)&&e.player.emitError(nt.wasmDecodeError,"");break;case we:e.player.emitError(nt.wasmDecodeVideoNoResponseError);break;case Ee:e.player.emitError(nt.simdH264DecodeVideoWidthIsTooLarge);break;case Se:e.player.emitError(nt.wasmWidthOrHeightChange);break;case Te:e.player.emitError(nt.simdDecodeError);break;case ke:i.log("decoderWorker","onmessage:",ke);break;case xe:i.log("decoderWorker","onmessage:",xe),e._destroy();break;case Ce:e.player&&e.player.pushTempStream(a.buffer);break;case Re:e.player&&e.player.emit(it.videoSEI,{ts:a.ts,data:new Uint8Array(a.buffer)});break;case Le:if(e.player){if(e.player.isRecordTypeFlv()){var d=new Uint8Array(a.buffer);e.player.recorder.addMetaData(d)}var h=Js(new Uint8Array(a.buffer));h&&h.onMetaData&&e.player.updateMetaData(h.onMetaData)}break;case De:if(e.player&&e.player.isRecordTypeFlv()){var f=new Uint8Array(a.buffer);e.player.recorder.addAACSequenceHeader(f,a.ts)}break;case Ie:if(e.player&&e.player.isRecordTypeFlv()){var p=new Uint8Array(a.buffer);e.player.recorder.addVideoSequenceHeader(p,a.ts)}break;case Pe:if(e.player&&e.player.isRecordTypeFlv()&&e.player.recording){var m=new Uint8Array(a.buffer);a.type===Fe?e.player.recorder.addVideo(m,a.ts):a.type===Me&&e.player.recorder.addAudio(m,a.ts)}break;default:e.player[a.cmd]&&e.player[a.cmd](a)}}}},{key:"_initWork",value:function(){var e={debug:this.player._opt.debug,debugLevel:this.player._opt.debugLevel,debugUuid:this.player._opt.debugUuid,useOffscreen:this.player._opt.useOffscreen,useWCS:this.player._opt.useWCS,useMSE:this.player._opt.useMSE,videoBuffer:this.player._opt.videoBuffer,videoBufferDelay:this.player._opt.videoBufferDelay,openWebglAlignment:this.player._opt.openWebglAlignment,playType:this.player._opt.playType,hasAudio:this.player._opt.hasAudio,hasVideo:this.player._opt.hasVideo,playbackRate:1,playbackForwardMaxRateDecodeIFrame:this.player._opt.playbackForwardMaxRateDecodeIFrame,playbackIsCacheBeforeDecodeForFpsRender:this.player._opt.playbackConfig.isCacheBeforeDecodeForFpsRender,sampleRate:this.player.audio&&this.player.audio.audioContext&&this.player.audio.audioContext.sampleRate||0,audioBufferSize:this.player.audio&&this.player.audio.getAudioBufferSize()||1024,networkDelay:this.player._opt.networkDelay,visibility:this.player.visibility,useSIMD:this.player._opt.useSIMD,recordType:this.player._opt.recordType,checkFirstIFrame:this.player._opt.checkFirstIFrame,isM7sCrypto:this.player._opt.isM7sCrypto,isFlv:this.player._opt.isFlv,isFmp4:this.player._opt.isFmp4,isMpeg4:this.player._opt.isMpeg4,isNakedFlow:this.player._opt.isNakedFlow,isHls265:this.player.isUseHls265(),isFmp4Private:this.player._opt.isFmp4Private,isSm4Crypto:this.player._opt.isSm4Crypto,sm4CryptoKey:this.player._opt.sm4CryptoKey,isEmitSEI:this.player._opt.isEmitSEI,isRecordTypeFlv:this.player.isRecordTypeFlv(),isWasmMp4:this.player.recorder&&this.player.recorder.isWasmMp4()||!1,isChrome:Ua(),isDropSameTimestampGop:this.player._opt.isDropSameTimestampGop,nakedFlowH265DemuxUseNew:this.player._opt.nakedFlowH265DemuxUseNew};this.decoderWorker.postMessage({cmd:ze,opt:JSON.stringify(e)}),this.player._opt.isM7sCrypto&&(this.updateWorkConfig({key:"cryptoKey",value:this.player._opt.cryptoKey}),this.updateWorkConfig({key:"cryptoIV",value:this.player._opt.cryptoIV}))}},{key:"decodeVideo",value:function(e,t,i){this.player._opt.playType===u?this.player.isUseHls265()?this._decodeVideoNoDelay(e,t,i):this._decodeVideo(e,t,i):this.player._opt.playType===A&&(this.player.video.rate>=this.player._opt.playbackForwardMaxRateDecodeIFrame?i&&(this.player.debug.log("decoderWorker","current rate is ".concat(this.player.video.rate,",only decode i frame")),this._decodeVideoNoDelay(e,t,i)):1===this.player.video.rate?this._decodeVideo(e,t,i):this._decodeVideoNoDelay(e,t,i))}},{key:"_decodeVideo",value:function(e,t,i){var r={type:Fe,ts:Math.max(t,0),isIFrame:i};this.decoderWorker.postMessage({cmd:Ge,buffer:e,options:r},[e.buffer])}},{key:"_decodeVideoNoDelay",value:function(e,t,i){this.decoderWorker.postMessage({cmd:Ve,buffer:e,ts:Math.max(t,0),isIFrame:i},[e.buffer])}},{key:"decodeAudio",value:function(e,t){this.player._opt.playType===u?this.player._opt.useWCS||this.player._opt.useMSE||this.player.isUseHls265()?this._decodeAudioNoDelay(e,t):this._decodeAudio(e,t):this.player._opt.playType===A&&(1===this.player.video.rate?this._decodeAudio(e,t):this._decodeAudioNoDelay(e,t))}},{key:"_decodeAudio",value:function(e,t){var i={type:Me,ts:Math.max(t,0)};this.decoderWorker.postMessage({cmd:Ge,buffer:e,options:i},[e.buffer])}},{key:"_decodeAudioNoDelay",value:function(e,t){this.decoderWorker.postMessage({cmd:He,buffer:e,ts:Math.max(t,0)},[e.buffer])}},{key:"updateWorkConfig",value:function(e){this.decoderWorker&&this.decoderWorker.postMessage({cmd:qe,key:e.key,value:e.value})}},{key:"workerFetchStream",value:function(e){var t=this.player._opt,i={protocol:t.protocol,isFlv:t.isFlv,isFmp4:t.isFmp4,isMpeg4:t.isMpeg4,isNakedFlow:t.isNakedFlow};this.decoderWorker.postMessage({cmd:Je,url:e,opt:JSON.stringify(i)})}},{key:"clearWorkBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.decoderWorker.postMessage({cmd:Ke,needClear:e})}},{key:"workerSendMessage",value:function(e){this.decoderWorker.postMessage({cmd:Ye,message:e})}}]),e}(),Qs=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this),r.TAG_NAME="CommonDemux",r.player=e,r.stopId=null,r.firstTimestamp=null,r.startTimestamp=null,r.preDelayTimestamp=null,r.preLoopTimestamp=null,r.bufferStartDts=null,r.bufferStartLocalTs=null,r.preIframeTs=null,r.preFrameTs=null,r.preTimestamp=null,r.preTimestampDuration=0,r.prevPayloadBufferSize=0,r.isStreamTsMoreThanLocal=!1,r.delay=-1,r.pushLatestDelay=-1,r.bufferList=[],r.historyIntervalDiffTimeList=[],r.playbackStreamFps=null,r.playbackStreamAudioFps=null,r.playbackStreamVideoFps=null,r.dropping=!1,r.isPushDropping=!1,r.nalUnitSize=null,r.initInterval(),r.player.debug.log("CommonDemux","init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){this.bufferList=[],this.historyIntervalDiffTimeList=[],this.playbackStreamFps=null,this.playbackStreamAudioFps=null,this.playbackStreamVideoFps=null,this.clearStopInterval(),this.firstTimestamp=null,this.startTimestamp=null,this.bufferStartDts=null,this.bufferStartLocalTs=null,this.preDelayTimestamp=null,this.preLoopTimestamp=null,this.preIframeTs=null,this.preTimestamp=null,this.preTimestampDuration=0,this.prevPayloadBufferSize=0,this.isStreamTsMoreThanLocal=!1,this.delay=-1,this.pushLatestDelay=-1,this.dropping=!1,this.isPushDropping=!1,this.nalUnitSize=null,this.off(),this.player.debug.log("CommonDemux","destroy")}},{key:"isDropping",value:function(){return this.dropping||this.isPushDropping}},{key:"getDelay",value:function(e,t){if(!e||!this.player.isDemuxDecodeFirstIIframeInit())return-1;if(t===Me)return this.delay;if(this.preDelayTimestamp&&this.preDelayTimestamp>e)return this.preDelayTimestamp-e>1e3&&this.player.debug.warn("CommonDemux","getDelay() and preDelayTimestamp is ".concat(this.preDelayTimestamp," > timestamp is ").concat(e," more than ").concat(this.preDelayTimestamp-e,"ms and return ").concat(this.delay)),this.preDelayTimestamp=e,this.delay;if(this.firstTimestamp){if(e){var i=Date.now()-this.startTimestamp,r=e-this.firstTimestamp;i>=r?(this.isStreamTsMoreThanLocal=!1,this.delay=i-r):(this.isStreamTsMoreThanLocal=!0,this.delay=r-i)}}else this.firstTimestamp=e,this.startTimestamp=Date.now(),this.delay=-1;return this.preDelayTimestamp=e,this.delay}},{key:"getDelayNotUpdateDelay",value:function(e,t){if(!e||!this.player.isDemuxDecodeFirstIIframeInit())return-1;if(t===Me)return this.pushLatestDelay;if(this.preDelayTimestamp&&this.preDelayTimestamp-e>1e3)return this.player.debug.warn("CommonDemux","getDelayNotUpdateDelay() and preDelayTimestamp is ".concat(this.preDelayTimestamp," > timestamp is ").concat(e," more than ").concat(this.preDelayTimestamp-e,"ms and return -1")),-1;if(this.firstTimestamp){var i=-1;if(e){var r=Date.now()-this.startTimestamp,a=e-this.firstTimestamp;i=r>=a?r-a:a-r}return i}return-1}},{key:"resetDelay",value:function(){this.firstTimestamp=null,this.startTimestamp=null,this.delay=-1,this.dropping=!1}},{key:"resetAllDelay",value:function(){this.resetDelay(),this.preDelayTimestamp=null}},{key:"initInterval",value:function(){var e=this;this.player.isUseHls265()?this.player.debug.log("CommonDemux","initInterval() and is hls and support hls265 so return"):-1===this.player.getStreamType().indexOf(l)?this.player.isPlaybackCacheBeforeDecodeForFpsRender()?this.player.debug.log("CommonDemux","initInterval() and playback and playbackIsCacheBeforeDecodeForFpsRender is true so return"):(this.player.debug.log("CommonDemux","initInterval()"),this._loop(),this.stopId=setInterval((function(){var t=(new Date).getTime();e.preLoopTimestamp||(e.preLoopTimestamp=t);var i=t-e.preLoopTimestamp;e.updateHistoryIntervalDiffTimeList(i),i>100&&e.player.debug.warn("CommonDemux","loop demux diff time is ".concat(i)),e._loop(),e.preLoopTimestamp=(new Date).getTime()}),20)):this.player.debug.log("CommonDemux","initInterval() and is worker stream so return")}},{key:"clearStopInterval",value:function(){this.stopId&&(clearInterval(this.stopId),this.stopId=null)}},{key:"updateHistoryIntervalDiffTimeList",value:function(e){this.historyIntervalDiffTimeList.length>5&&this.historyIntervalDiffTimeList.shift(),this.historyIntervalDiffTimeList.push(e)}},{key:"isHistoryIntervalDiffTimeAllLarge",value:function(){if(this.historyIntervalDiffTimeList.length<5)return!1;for(var e=0;e<this.historyIntervalDiffTimeList.length;e++)if(this.historyIntervalDiffTimeList[e]<900)return!1;return!0}},{key:"initPlaybackCacheLoop",value:function(){var e=this;this.clearStopInterval();var t=function(){var t=null;e.bufferList.length&&(t=e.bufferList.shift(),e._doDecoderDecode(t))};t();var i=Math.ceil(1e3/(this.playbackStreamFps*this.player.getPlaybackRate()));this.player.debug.log("CommonDemux","initPlaybackCacheLoop() and fragDuration is ".concat(i,", playbackStreamFps is ").concat(this.playbackStreamFps,", playbackRate is ").concat(this.player.getPlaybackRate())),this.stopId=setInterval(t,i)}},{key:"_loop",value:function(){var e,t=this.player._opt.videoBuffer,i=this.player._opt.videoBufferDelay,r=this.player._opt.playType===u;if(this.bufferList.length){if(this.isPushDropping)return void this.player.debug.warn("CommonDemux","_loop isPushDropping is true and bufferList length is ".concat(this.bufferList.length));if(this.dropping){for(e=this.bufferList.shift(),this.player.debug.warn("CommonDemux","_loop is dropping and data.ts is ".concat(e.ts,", data.type is ").concat(e.type,", data.isIFrame is ").concat(e.isIFrame,", delay is ").concat(this.delay," ,buffer list is ").concat(this.bufferList.length));!e.isIFrame&&this.bufferList.length;)e=this.bufferList.shift();var a=this.getDelayNotUpdateDelay(e.ts,e.type);e.isIFrame&&a<=this.getNotDroppingDelayTs()&&(this.player.debug.log("CommonDemux","_loop data isIFrame is true and delay is ".concat(this.delay)),this.dropping=!1,this._doDecoderDecode(e),this._decodeNext(e))}else if(this.player.isPlayback())for(;this.bufferList.length;)e=this.bufferList.shift(),this._doDecoderDecode(e);else if(e=this.bufferList[0],-1===this.getDelay(e.ts,e.type))this.player.debug.log("CommonDemux","delay is -1 and data.ts is ".concat(e.ts," data.type is ").concat(e.type)),this.bufferList.shift(),this._doDecoderDecode(e),this._decodeNext(e);else if(this.delay>i+t&&r)this.hasIframeInBufferList()?(this.player.debug.warn("CommonDemux","_loop delay is ".concat(this.delay,", set dropping is true")),this.resetAllDelay(),this.dropping=!0,this.player.updateStats({isDropping:!0})):(this.bufferList.shift(),this._doDecoderDecode(e),this._decodeNext(e));else for(;this.bufferList.length;){if(e=this.bufferList[0],!(this.getDelay(e.ts,e.type)>t)){this.delay<0&&this.player.debug.warn("CommonDemux","_loop delay is ".concat(this.delay," bufferList is ").concat(this.bufferList));break}this.bufferList.shift(),this._doDecoderDecode(e)}}else-1!==this.delay&&this.player.debug.log("CommonDemux","loop() bufferList is empty and reset delay"),this.resetAllDelay()}},{key:"_doDecode",value:function(e,t,i,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,n=this.player,s={ts:i,cts:a,type:t,isIFrame:!1};this.player.isPlayer()?(t===Fe&&n._opt.playType===u&&this.calcNetworkDelay(i),n._opt.useWCS&&!n._opt.useOffscreen||n._opt.useMSE?(t===Fe&&(s.isIFrame=r),this.pushBuffer(e,s)):t===Fe?n.decoderWorker&&n.decoderWorker.decodeVideo(e,i,r):t===Me&&n._opt.hasAudio&&n.decoderWorker&&n.decoderWorker.decodeAudio(e,i)):this.player.isPlayback()&&(t===Fe&&(s.isIFrame=r),this.player.isPlaybackOnlyDecodeIFrame()?t===Fe&&r&&this.pushBuffer(e,s):this.player.isPlaybackCacheBeforeDecodeForFpsRender()||1===this.player.getPlaybackRate()?this.pushBuffer(e,s):this.pushBuffer(e,s,!1))}},{key:"_doDecodeByHls",value:function(e,t,i,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,n=!1;if(t===Me&&Fr(e)&&(this.player.debug.log("CommonDemux","hls pushBuffer audio ts is ".concat(i,", isAacCodecPacket is true")),n=!0,this.player.isRecordTypeFlv())){var s=new Uint8Array(e);this.player.recorder.addAACSequenceHeader(s,i)}var o=!1;if(t===Fe&&r&&tn(e)&&(this.player.debug.log("CommonDemux","hls pushBuffer video ts is ".concat(i,", isVideoSequenceHeader is true")),o=!0,this.player.isRecordTypeFlv())){var c=new Uint8Array(e);this.player.recorder.addVideoSequenceHeader(c,i)}this.player.recording&&an(o)&&an(n)&&this.handleRecording(e,t,i,r,a),t===Fe?this._doDecoderDecode({ts:i,cts:a,payload:e,type:Fe,isIFrame:r}):t===Me&&this._doDecoderDecode({ts:i,payload:e,type:Me})}},{key:"_doDecodeByFmp4",value:function(e,t,i,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;this._doDecode(e,t,i,r,a)}},{key:"_decodeNext",value:function(e){var t=e.ts;if(0!==this.bufferList.length){var i=this.bufferList[0],r=i.ts-t,a=e.type===Fe&&i.type===Me,n=e.type===Fe&&tn(e.payload);(r<=20||a||n)&&(this.player.debug.log("CommonDemux","decode data type is ".concat(e.type," and\n ts is ").concat(t," next data type is ").concat(i.type," ts is ").concat(i.ts,"\n diff is ").concat(r," and isVideoAndNextAudio is ").concat(a," and isVideoSqeHeader is ").concat(n)),this.bufferList.shift(),this._doDecoderDecode(i))}}},{key:"_doDecoderDecode",value:function(e){var t=this.player,i=t.webcodecsDecoder,r=t.mseDecoder;this.player.isPlayer()&&this.player.updateStats({buf:this.delay}),e.type===Me?t._opt.hasAudio&&t.decoderWorker&&t.decoderWorker.decodeAudio(e.payload,e.ts):e.type===Fe&&(t._opt.isEmitSEI&&this.findSei(e.payload,e.ts),t._opt.useWCS&&!t._opt.useOffscreen?i.decodeVideo(e.payload,e.ts,e.isIFrame,e.cts):t._opt.useMSE?r.decodeVideo(e.payload,e.ts,e.isIFrame,e.cts):t.decoderWorker&&t.decoderWorker.decodeVideo(e.payload,e.ts,e.isIFrame))}},{key:"pushBuffer",value:function(e,t){var i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this.player._opt.videoBuffer,a=this.player._opt.videoBufferDelay,n=this.player.isPlayer();if(t.type===Me&&Fr(e)){if(this.player.debug.log("CommonDemux","pushBuffer() audio ts is ".concat(t.ts,", isAacCodecPacket is true")),this.player.isRecordTypeFlv()){var s=new Uint8Array(e);this.player.recorder.addAACSequenceHeader(s,t.ts)}this._doDecoderDecode({ts:t.ts,payload:e,type:Me})}else if(t.type===Fe&&t.isIFrame&&tn(e)){if(this.player.debug.log("CommonDemux","pushBuffer() video ts is ".concat(t.ts,", isVideoSequenceHeader is true")),this.player.isRecordTypeFlv()){var o=new Uint8Array(e);this.player.recorder.addVideoSequenceHeader(o,t.ts)}this._doDecoderDecode({ts:t.ts,payload:e,type:Fe,isIFrame:t.isIFrame,cts:t.cts})}else{if(this.player.recording&&this.handleRecording(e,t.type,t.ts,t.isIFrame,t.cts),n){if(this.preTimestampDuration>0&&this.preTimestamp>0&&t.type===Fe){var c=t.ts-this.preTimestamp,l=this.preTimestampDuration+this.preTimestampDuration/2;c>=l&&this.player.debug.log("CommonDemux","pushBuffer() video\n ts is ".concat(t.ts,", preTimestamp is ").concat(this.preTimestamp,",\n diff is ").concat(c," and preTimestampDuration is ").concat(this.preTimestampDuration," and maxDiff is ").concat(l,"\n maybe trigger black screen or flower screen"))}if(this.preTimestamp>0&&t.ts<this.preTimestamp&&t.type===Fe&&this.preTimestamp-t.ts>Z&&(this.player.debug.warn("CommonDemux","pushBuffer() video\n ts is ".concat(t.ts,", preTimestamp is ").concat(this.preTimestamp,",\n diff is ").concat(this.preTimestamp-t.ts," more than 3600000\n and resetAllDelay()")),this.resetAllDelay()),t.ts<=this.preTimestamp&&this.preTimestamp>0&&t.type===Fe&&(this.player.debug.warn("CommonDemux","pushBuffer() video\n ts is ".concat(t.ts," less than (or equal) preTimestamp is ").concat(this.preTimestamp," and\n payloadBufferSize is ").concat(e.byteLength," and prevPayloadBufferSize is ").concat(this.prevPayloadBufferSize)),this.player._opt.isDropSameTimestampGop&&this.player.isDemuxDecodeFirstIIframeInit())){var u=this.hasIframeInBufferList(),d=an(this.isPushDropping);return this.player.debug.log("CommonDemux","pushBuffer(), isDropSameTimestampGop is true and\n hasIframe is ".concat(u," and isNotPushDropping is ").concat(d," and next drop buffer")),void(u&&d?this.dropBuffer$2():this.clearBuffer(!0))}if(this.player.isDemuxDecodeFirstIIframeInit()){var h=this.getDelayNotUpdateDelay(t.ts,t.type);this.pushLatestDelay=h;var f=a+r;this.player._opt.useMSE?h>f&&this.delay<f&&this.delay>0&&this.hasIframeInBufferList()&&!1===this.isPushDropping&&(this.player.debug.warn("CommonDemux","useMSE, pushLatestDelay is ".concat(h," > ").concat(a+r,", bufferList is ").concat(this.bufferList.length,", delay is ").concat(this.delay," and dropBuffer$2()")),this.dropBuffer$2()):h>f&&this.delay<f&&this.delay>0&&this.hasIframeInBufferList()&&!1===this.isPushDropping&&(this.player.debug.warn("CommonDemux","useWCS, pushLatestDelay is ".concat(h," > ").concat(a+r,",bufferList is ").concat(this.bufferList.length,", delay is ").concat(this.delay," and dropBuffer$2()")),this.dropBuffer$2()),this.isHistoryIntervalDiffTimeAllLarge()&&an(this.player.visibility)&&(this.player._opt.useMSE?this.hasIframeInBufferList()&&!1===this.isPushDropping&&(this.player.debug.warn("CommonDemux","useMSE, page visibility is false and\n history interval diff is ".concat(this.historyIntervalDiffTimeList.join(",")," and\n bufferList is ").concat(this.bufferList.length,",\n delay is ").concat(this.delay," and dropBuffer$2()")),this.dropBuffer$2()):this.hasIframeInBufferList()&&!1===this.isPushDropping&&(this.player.debug.warn("CommonDemux","useWCS, page visibility is false and\n history interval diff is ".concat(this.historyIntervalDiffTimeList.join(",")," and\n bufferList is ").concat(this.bufferList.length,",\n delay is ").concat(this.delay," and dropBuffer$2()")),this.dropBuffer$2()))}t.type===Fe&&(this.preTimestamp>0&&(this.preTimestampDuration=t.ts-this.preTimestamp),this.prevPayloadBufferSize=e.byteLength,this.preTimestamp=t.ts)}if(i?t.type===Me?this.bufferList.push({ts:t.ts,payload:e,type:Me}):t.type===Fe&&this.bufferList.push({ts:t.ts,cts:t.cts,payload:e,type:Fe,isIFrame:t.isIFrame}):t.type===Fe?this._doDecoderDecode({ts:t.ts,cts:t.cts,payload:e,type:Fe,isIFrame:t.isIFrame}):t.type===Me&&this._doDecoderDecode({ts:t.ts,payload:e,type:Me}),this.player.isPlaybackCacheBeforeDecodeForFpsRender()&&(wa(this.playbackStreamVideoFps)||wa(this.playbackStreamAudioFps))){var p=this.playbackStreamVideoFps,m=this.playbackStreamAudioFps;if(wa(this.playbackStreamVideoFps)&&(p=Ya(this.bufferList,Fe),p>0&&(this.playbackStreamVideoFps=p,this.player.video&&this.player.video.setStreamFps(this.playbackStreamVideoFps),this.playbackStreamFps=m?p+m:p,an(this.player._opt.hasAudio)&&(this.player.debug.log(this.TAG_NAME,"playbackCacheBeforeDecodeForFpsRender,_opt.hasAudio is false and set streamAudioFps is 0"),this.playbackStreamAudioFps=0),this.initPlaybackCacheLoop())),wa(this.playbackStreamAudioFps)&&(m=Ya(this.bufferList,Me),m>0&&(this.playbackStreamAudioFps=m,this.playbackStreamFps=p?p+m:m,this.initPlaybackCacheLoop())),wa(this.playbackStreamVideoFps)&&wa(this.playbackStreamAudioFps)){var g=this.bufferList.map((function(e){return{type:e.type,ts:e.ts}}));this.player.debug.log("CommonDemux","playbackCacheBeforeDecodeForFpsRender, calc streamAudioFps is ".concat(m,", streamVideoFps is ").concat(p,", bufferListLength is ").concat(this.bufferList.length," and ts list is ").concat(JSON.stringify(g)))}var y=this.getAudioBufferLength()>0,v=y?60:40;this.bufferList.length>=v&&(this.debug.warn("CommonDemux","playbackCacheBeforeDecodeForFpsRender, bufferListLength is ".concat(this.bufferList.length," more than ").concat(v,", and hasAudio is ").concat(y," an set streamFps is 25")),this.playbackStreamVideoFps=p,this.player.video&&this.player.video.setStreamFps(this.playbackStreamVideoFps),y?(this.playbackStreamAudioFps=25,this.playbackStreamFps=this.playbackStreamVideoFps+this.playbackStreamAudioFps):this.playbackStreamFps=this.playbackStreamVideoFps,this.initPlaybackCacheLoop())}}}},{key:"dropBuffer$2",value:function(){if(this.bufferList.length>0){var e=this.bufferList.findIndex((function(e){return rn(e.isIFrame)&&e.type===Fe}));if(this.isAllIframeInBufferList())for(var t=0;t<this.bufferList.length;t++){var i=this.bufferList[t],r=this.getDelayNotUpdateDelay(i.ts,i.type);if(r>=this.getNotDroppingDelayTs()){this.player.debug.log("CommonDemux","dropBuffer$2() isAllIframeInBufferList() is true, and index is ".concat(t," and tempDelay is ").concat(r," and notDroppingDelayTs is ").concat(this.getNotDroppingDelayTs())),e=t;break}}if(e>=0){this.isPushDropping=!0,this.player.updateStats({isDropping:!0});var a=this.bufferList.length;this.bufferList=this.bufferList.slice(e);var n=this.bufferList.shift();this.resetAllDelay(),this.getDelay(n.ts,n.type),this._doDecoderDecode(n),this.isPushDropping=!1,this.player.debug.log("CommonDemux","dropBuffer$2() iFrameIndex is ".concat(e,",and old bufferList length is ").concat(a," ,and new bufferList length is ").concat(this.bufferList.length," and new delay is ").concat(this.delay," "))}else this.isPushDropping=!1}0===this.bufferList.length&&(this.isPushDropping=!1)}},{key:"clearBuffer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.player.debug.log("CommonDemux","clearBuffer,buffer length is ".concat(this.bufferList.length,", need clear is ").concat(e)),e&&(this.bufferList=[]),this.player.isPlayer()&&(this.resetAllDelay(),rn(this.player._opt.checkFirstIFrame)&&(this.dropping=!0,this.player.updateStats({isDropping:!0}))),this.player.decoderCheckFirstIFrame()}},{key:"calcNetworkDelay",value:function(e){if(this.player.isDemuxDecodeFirstIIframeInit()&&e>0){null===this.bufferStartDts?(this.bufferStartDts=e,this.bufferStartLocalTs=$r()):e<this.bufferStartDts&&(this.player.debug.warn("CommonDemux","calcNetworkDelay dts is ".concat(e," and bufferStartDts is ").concat(this.bufferStartDts)),this.bufferStartDts=e,this.bufferStartLocalTs=$r());var t=e-this.bufferStartDts,i=$r()-this.bufferStartLocalTs,r=i>t?i-t:0;r>this.player._opt.networkDelay&&this.player._opt.playType===u&&(this.player.debug.warn("CommonDemux","delay is more than networkDelay and now dts:".concat(e,",start dts is ").concat(this.bufferStartDts,", vs start is ").concat(t,",local diff is ").concat(i," ,delay is ").concat(r,", _opt.networkDelay is ").concat(this.player._opt.networkDelay)),this.player.emit(it.networkDelayTimeout,r)),this.player.updateStats({netBuf:r})}}},{key:"calcIframeIntervalTimestamp",value:function(e){if(null===this.preIframeTs)this.preIframeTs=e;else if(this.preIframeTs<e){var t=e-this.preIframeTs;this.player&&(this.player.videoIframeIntervalTs=t),this.preIframeTs=e}}},{key:"calcBufferFps",value:function(e){}},{key:"getNotDroppingDelayTs",value:function(){return this.player._opt.videoBuffer+this.player._opt.videoBufferDelay/2}},{key:"getMaxDelayTs",value:function(){return this.player._opt.videoBuffer+this.player._opt.videoBufferDelay}},{key:"getPushLatestDelay",value:function(){return this.pushLatestDelay}},{key:"getVideoBufferLength",value:function(){var e=0;return this.bufferList.forEach((function(t){t.type===Fe&&(e+=1)})),e}},{key:"getAudioBufferLength",value:function(){var e=0;return this.bufferList.forEach((function(t){t.type===Me&&(e+=1)})),e}},{key:"hasIframeInBufferList",value:function(){return this.bufferList.some((function(e){return e.type===Fe&&e.isIFrame}))}},{key:"isAllIframeInBufferList",value:function(){var e=this.getVideoBufferLength(),t=0;return this.bufferList.forEach((function(e){e.type===Fe&&e.isIFrame&&(t+=1)})),e===t}},{key:"getInputByteLength",value:function(){return 0}},{key:"getIsStreamTsMoreThanLocal",value:function(){return this.isStreamTsMoreThanLocal}},{key:"close",value:function(){}},{key:"reset",value:function(){}},{key:"findSei",value:function(e,t){var i=this,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=4;Ta(this.nalUnitSize)&&(a=this.nalUnitSize);var n=Ts(e.slice(5),a);if(an(r)){var s=this.player.getVideoInfo();s&&s.encType&&(r=s.encType===yt)}n.forEach((function(e){var a=r?e[0]>>>1&63:31&e[0];(r&&(a===Pt||a===It)||an(r)&&a===Tt)&&i.player.emit(it.videoSEI,{ts:t,data:e})}))}},{key:"handleRecording",value:function(e,t,i,r,a){if(this.player.isRecordTypeFlv()){var n=new Uint8Array(e);t===Fe?this.player.recorder.addVideo(n,i):t===Me&&this.player.recorder.addAudio(n,i)}else if(this.player.isRecordTypeMp4()){var s=new Uint8Array(e);if(this.player.recorder.isWasmMp4()){if(t===Fe)this.player.recorder.handleAddNaluTrack(s.slice(5),r,i,a);else if(t===Me){var o=new Uint8Array(e);this.player.recorder.handleAddAudioTrack(Ur(o)?o.slice(2):o.slice(1),i)}}else t===Fe&&this.player.recorder.handleAddNaluTrack(s.slice(5),r,i,a)}}}]),i}(fn),Xs=function(e,t,i,r){return new(i||(i=Promise))((function(a,n){function s(e){try{c(r.next(e))}catch(t){n(t)}}function o(e){try{c(r["throw"](e))}catch(t){n(t)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,o)}c((r=r.apply(e,t||[])).next())}))},$s=Symbol(32),Zs=Symbol(16),eo=Symbol(8),to=function(){function e(t){Object(T["a"])(this,e),this.g=t,this.consumed=0,t&&(this.need=t.next().value)}return Object(S["a"])(e,[{key:"setG",value:function(e){this.g=e,this.demand(e.next().value,!0)}},{key:"consume",value:function(){this.buffer&&this.consumed&&(this.buffer.copyWithin(0,this.consumed),this.buffer=this.buffer.subarray(0,this.buffer.length-this.consumed),this.consumed=0)}},{key:"demand",value:function(e,t){return t&&this.consume(),this.need=e,this.flush()}},{key:"read",value:function(e){return Xs(this,void 0,void 0,regeneratorRuntime.mark((function t(){var i=this;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(t.t0=this.lastReadPromise,!t.t0){t.next=4;break}return t.next=4,this.lastReadPromise;case 4:return t.abrupt("return",this.lastReadPromise=new Promise((function(t,r){var a;i.reject=r,i.resolve=function(e){delete i.lastReadPromise,delete i.resolve,delete i.need,t(e)},i.demand(e,!0)||null===(a=i.pull)||void 0===a||a.call(i,e)})));case 5:case"end":return t.stop()}}),t,this)})))}},{key:"readU32",value:function(){return this.read($s)}},{key:"readU16",value:function(){return this.read(Zs)}},{key:"readU8",value:function(){return this.read(eo)}},{key:"close",value:function(){var e;this.g&&this.g["return"](),this.buffer&&this.buffer.subarray(0,0),null===(e=this.reject)||void 0===e||e.call(this,new Error("EOF")),delete this.lastReadPromise}},{key:"flush",value:function(){if(this.buffer&&this.need){var e=null,t=this.buffer.subarray(this.consumed),i=0,r=function(e){return t.length<(i=e)};if("number"==typeof this.need){if(r(this.need))return;e=t.subarray(0,i)}else if(this.need===$s){if(r(4))return;e=t[0]<<24|t[1]<<16|t[2]<<8|t[3]}else if(this.need===Zs){if(r(2))return;e=t[0]<<8|t[1]}else if(this.need===eo){if(r(1))return;e=t[0]}else if("buffer"in this.need){if("byteOffset"in this.need){if(r(this.need.byteLength-this.need.byteOffset))return;new Uint8Array(this.need.buffer,this.need.byteOffset).set(t.subarray(0,i)),e=this.need}else if(this.g)return void this.g["throw"](new Error("Unsupported type"))}else{if(r(this.need.byteLength))return;new Uint8Array(this.need).set(t.subarray(0,i)),e=this.need}return this.consumed+=i,this.g?this.demand(this.g.next(e).value,!0):this.resolve&&this.resolve(e),e}}},{key:"write",value:function(e){var t=this;if(e instanceof Uint8Array?this.malloc(e.length).set(e):"buffer"in e?this.malloc(e.byteLength).set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)):this.malloc(e.byteLength).set(new Uint8Array(e)),!this.g&&!this.resolve)return new Promise((function(e){return t.pull=e}));this.flush()}},{key:"writeU32",value:function(e){this.malloc(4).set([e>>24&255,e>>16&255,e>>8&255,255&e]),this.flush()}},{key:"writeU16",value:function(e){this.malloc(2).set([e>>8&255,255&e]),this.flush()}},{key:"writeU8",value:function(e){this.malloc(1)[0]=e,this.flush()}},{key:"malloc",value:function(e){if(this.buffer){var t=this.buffer.length,i=t+e;if(i<=this.buffer.buffer.byteLength-this.buffer.byteOffset)this.buffer=new Uint8Array(this.buffer.buffer,this.buffer.byteOffset,i);else{var r=new Uint8Array(i);r.set(this.buffer),this.buffer=r}return this.buffer.subarray(t,i)}return this.buffer=new Uint8Array(e),this.buffer}}]),e}();to.U32=$s,to.U16=Zs,to.U8=eo;var io,ro="application/json, text/javascript",ao="text/html",no=/^(?:text|application)\/xml/i,so=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,oo=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,co=/^\s*$/,lo={},uo={},ho="",fo={type:"GET",beforeSend:po,success:po,error:po,complete:po,context:null,xhr:function(){return new window.XMLHttpRequest},accepts:{json:ro,xml:"application/xml, text/xml",html:ao,text:"text/plain","*":"*/".concat("*")},crossDomain:!1,timeout:0,username:null,password:null,processData:!0,promise:po,contentType:"application/x-www-form-urlencoded; charset=UTF-8"};function po(){}var mo=function(e,t){"object"==Object(E["a"])(e)&&(t=e,e=void 0);var i=wo({},t=t||{});for(var r in fo)void 0===i[r]&&(i[r]=fo[r]);try{var a={},n=new Promise((function(e,t){a.resolve=e,a.reject=t}));n.resolve=a.resolve,n.reject=a.reject,i.promise=n}catch(v){i.promise={resolve:po,reject:po}}var s=oo.exec(window.location.href.toLowerCase())||[];i.url=((e||i.url||window.location.href)+"").replace(/#.*$/,"").replace(/^\/\//,s[1]+"//");var o=i.url;i.crossDomain||(i.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(i.url)&&RegExp.$2!==window.location.href);var c=i.dataType;if("jsonp"===c){if(!/=\?/.test(i.url)){var l=(i.jsonp||"callback")+"=?";i.url=Ao(i.url,l)}return function(e){var t,i=e.jsonpCallback||"jsonp"+Eo(),r=window.document.createElement("script"),a={abort:function(){i in window&&(window[i]=po)}},n=window.document.getElementsByTagName("head")[0]||window.document.documentElement;function s(i){window.clearTimeout(t),a.abort(),vo(i.type,a,i.type,e),o()}function o(){r.clearAttributes?r.clearAttributes():r.onload=r.onreadystatechange=r.onerror=null,r.parentNode&&r.parentNode.removeChild(r),r=null,delete window[i]}return r.onerror=function(e){s(e)},window[i]=function(i){window.clearTimeout(t),go(i,a,e),o()},ko(e),r.src=e.url.replace(/=\?/,"="+i),r.src=Ao(r.src,"_="+(new Date).getTime()),r.async=!0,e.scriptCharset&&(r.charset=e.scriptCharset),n.insertBefore(r,n.firstChild),e.timeout>0&&(t=window.setTimeout((function(){a.abort(),vo("timeout",a,"timeout",e),o()}),e.timeout)),e.promise.abort=function(){a.abort()},e.promise.xhr=a,e.promise}(i)}ko(i);var u=i.accepts[c]||i.accepts["*"],d={};/^([\w-]+:)\/\//.test(i.url)?RegExp.$1:window.location.protocol;var h,f=fo.xhr();i.crossDomain||d["X-Requested-With"]||(d["X-Requested-With"]="XMLHttpRequest"),i.ifModified&&(lo[o]&&(d["If-Modified-Since"]=lo[o]),uo[o]&&(d["If-None-Match"]=uo[o])),u&&(d.Accept=u,u.indexOf(",")>-1&&(u=u.split(",",2)[0]),f.overrideMimeType&&f.overrideMimeType(u));var p=!/^(?:GET|HEAD)$/.test(i.type.toUpperCase());if((i.data&&p&&!1!==i.contentType||t.contentType)&&(d["Content-Type"]=i.contentType),!1===i.cache&&!p){var m=/([?&])_=[^&]*/;i.url=m.test(o)?o.replace(m,"$1_="+Eo()):o+(/\?/.test(o)?"&":"?")+"_="+Eo()}i.headers=wo(d,i.headers||{}),f.onreadystatechange=function(){if(4===f.readyState){var e;clearTimeout(h);var t=!1;if(f.status>=200&&f.status<300||304===f.status){if(ho=f.getAllResponseHeaders(),i.ifModified){var r=bo("Last-Modified");r&&(lo[o]=r),(r=bo("etag"))&&(uo[o]=r)}c=c||function(e){return e&&(e===ao?"html":e===ro?"json":no.test(e)&&"xml")||"text"}(f.getResponseHeader("content-type")),e=f.responseText;try{"xml"===c?e=f.responseXML:"json"===c&&(e=co.test(e)?null:JSON.parse(e))}catch(a){t=a}t?vo(t,"parseerror",f,i):go(e,f,i)}else vo(null,"error",f,i)}};var g=!("async"in i)||i.async;if(f.open(i.type,i.url,g,i.username,i.password),i.xhrFields)for(var y in i.xhrFields)f[y]=i.xhrFields[y];for(var y in i.mimeType&&f.overrideMimeType&&f.overrideMimeType(i.mimeType),i.headers)void 0!==i.headers[y]&&f.setRequestHeader(y,i.headers[y]+"");return!1===function(e,t){var i=t.context;if(!1===t.beforeSend.call(i,e,t))return!1}(f,i)?(f.abort(),!1):(i.timeout>0&&(h=window.setTimeout((function(){f.onreadystatechange=po,f.abort(),vo(null,"timeout",f,i)}),i.timeout)),f.send(i.data?i.data:null),i.promise.abort=function(){f.abort()},i.promise)};function go(e,t,i){var r=i.context,a="success";i.success.call(r,e,a,t),i.promise.resolve(e,a,t),yo(a,t,i)}function yo(e,t,i){var r=i.context;i.complete.call(r,t,e)}function vo(e,t,i,r){var a=r.context;r.error.call(a,i,t,e),r.promise.reject(i,t,e),yo(t,i,r)}function bo(e){var t;if(!io){for(io={};t=so.exec(ho);)io[t[1].toLowerCase()]=t[2];t=io[e.toLowerCase()]}return null===t?null:t}function Ao(e,t){return(e+"&"+t).replace(/[&?]{1,2}/,"?")}function ko(e){!So(e)||e.data instanceof FormData||!e.processData||(e.data=function(e,t){var i=[];return i.add=function(e,t){this.push(encodeURIComponent(e)+"="+encodeURIComponent(t))},_o(i,e,t),i.join("&").replace("%20","+")}(e.data)),!e.data||e.type&&"GET"!==e.type.toUpperCase()||(e.url=Ao(e.url,e.data))}function _o(e,t,i,r){var a=function(e){return"[object Array]"===Object.prototype.toString.call(e)}(t);for(var n in t){var s=t[n];r&&(n=i?r:r+"["+(a?"":n)+"]"),!r&&a?e.add(s.name,s.value):(i?a(s):So(s))?_o(e,s,i,n):e.add(n,s)}}function wo(e){for(var t=Array.prototype.slice,i=t.call(arguments,1),r=0,a=i.length;r<a;r++){var n=i[r]||{};for(var s in n)n.hasOwnProperty(s)&&void 0!==n[s]&&(e[s]=n[s])}return e}function So(e){var t=Object(E["a"])(e);return"function"===t||"object"===t&&!!e}function To(e){return"function"==typeof e}function Eo(){return(new Date).getTime()}function xo(e){return parseInt(e)===e}function Co(e){if(!xo(e.length))return!1;for(var t=0;t<e.length;t++)if(!xo(e[t])||e[t]<0||e[t]>255)return!1;return!0}function Ro(e,t){if(e.buffer&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!Co(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(xo(e.length)&&Co(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function Lo(e){return new Uint8Array(e)}function Do(e,t,i,r,a){null==r&&null==a||(e=e.slice?e.slice(r,a):Array.prototype.slice.call(e,r,a)),t.set(e,i)}mo.get=function(e,t,i,r){return To(t)&&(r=r||i,i=t,t=void 0),mo({url:e,data:t,success:i,dataType:r})},mo.post=function(e,t,i,r){return To(t)&&(r=r||i,i=t,t=void 0),mo({type:"POST",url:e,data:t,success:i,dataType:r})},mo.getJSON=function(e,t,i){return To(t)&&(i=t,t=void 0),mo({url:e,data:t,success:i,dataType:"json"})},mo.ajaxSetup=function(e,t){return t?wo(wo(e,fo),t):wo(fo,e)};var Io={toBytes:function(e){var t=[],i=0;for(e=encodeURI(e);i<e.length;){var r=e.charCodeAt(i++);37===r?(t.push(parseInt(e.substr(i,2),16)),i+=2):t.push(r)}return Ro(t)},fromBytes:function(e){for(var t=[],i=0;i<e.length;){var r=e[i];r<128?(t.push(String.fromCharCode(r)),i++):r>191&&r<224?(t.push(String.fromCharCode((31&r)<<6|63&e[i+1])),i+=2):(t.push(String.fromCharCode((15&r)<<12|(63&e[i+1])<<6|63&e[i+2])),i+=3)}return t.join("")}},Po=function(){var e="0123456789abcdef";return{toBytes:function(e){for(var t=[],i=0;i<e.length;i+=2)t.push(parseInt(e.substr(i,2),16));return t},fromBytes:function(t){for(var i=[],r=0;r<t.length;r++){var a=t[r];i.push(e[(240&a)>>4]+e[15&a])}return i.join("")}}}(),Oo={16:10,24:12,32:14},Bo=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],Mo=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],Fo=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],Uo=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],jo=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],No=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],zo=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],Go=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],Ho=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],Vo=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],Wo=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],qo=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],Ko=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],Jo=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],Yo=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function Qo(e){for(var t=[],i=0;i<e.length;i+=4)t.push(e[i]<<24|e[i+1]<<16|e[i+2]<<8|e[i+3]);return t}var Xo=function e(t){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:Ro(t,!0)}),this._prepare()};Xo.prototype._prepare=function(){var e=Oo[this.key.length];if(null==e)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var t=0;t<=e;t++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var i,r=4*(e+1),a=this.key.length/4,n=Qo(this.key);for(t=0;t<a;t++)i=t>>2,this._Ke[i][t%4]=n[t],this._Kd[e-i][t%4]=n[t];for(var s,o=0,c=a;c<r;){if(s=n[a-1],n[0]^=Mo[s>>16&255]<<24^Mo[s>>8&255]<<16^Mo[255&s]<<8^Mo[s>>24&255]^Bo[o]<<24,o+=1,8!=a)for(t=1;t<a;t++)n[t]^=n[t-1];else{for(t=1;t<a/2;t++)n[t]^=n[t-1];for(s=n[a/2-1],n[a/2]^=Mo[255&s]^Mo[s>>8&255]<<8^Mo[s>>16&255]<<16^Mo[s>>24&255]<<24,t=a/2+1;t<a;t++)n[t]^=n[t-1]}for(t=0;t<a&&c<r;)l=c>>2,u=c%4,this._Ke[l][u]=n[t],this._Kd[e-l][u]=n[t++],c++}for(var l=1;l<e;l++)for(var u=0;u<4;u++)s=this._Kd[l][u],this._Kd[l][u]=qo[s>>24&255]^Ko[s>>16&255]^Jo[s>>8&255]^Yo[255&s]},Xo.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,i=[0,0,0,0],r=Qo(e),a=0;a<4;a++)r[a]^=this._Ke[0][a];for(var n=1;n<t;n++){for(a=0;a<4;a++)i[a]=Uo[r[a]>>24&255]^jo[r[(a+1)%4]>>16&255]^No[r[(a+2)%4]>>8&255]^zo[255&r[(a+3)%4]]^this._Ke[n][a];r=i.slice()}var s,o=Lo(16);for(a=0;a<4;a++)s=this._Ke[t][a],o[4*a]=255&(Mo[r[a]>>24&255]^s>>24),o[4*a+1]=255&(Mo[r[(a+1)%4]>>16&255]^s>>16),o[4*a+2]=255&(Mo[r[(a+2)%4]>>8&255]^s>>8),o[4*a+3]=255&(Mo[255&r[(a+3)%4]]^s);return o},Xo.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,i=[0,0,0,0],r=Qo(e),a=0;a<4;a++)r[a]^=this._Kd[0][a];for(var n=1;n<t;n++){for(a=0;a<4;a++)i[a]=Go[r[a]>>24&255]^Ho[r[(a+3)%4]>>16&255]^Vo[r[(a+2)%4]>>8&255]^Wo[255&r[(a+1)%4]]^this._Kd[n][a];r=i.slice()}var s,o=Lo(16);for(a=0;a<4;a++)s=this._Kd[t][a],o[4*a]=255&(Fo[r[a]>>24&255]^s>>24),o[4*a+1]=255&(Fo[r[(a+3)%4]>>16&255]^s>>16),o[4*a+2]=255&(Fo[r[(a+2)%4]>>8&255]^s>>8),o[4*a+3]=255&(Fo[255&r[(a+1)%4]]^s);return o};var $o=function e(t){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new Xo(t)};$o.prototype.encrypt=function(e){if((e=Ro(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=Lo(e.length),i=Lo(16),r=0;r<e.length;r+=16)Do(e,i,0,r,r+16),Do(i=this._aes.encrypt(i),t,r);return t},$o.prototype.decrypt=function(e){if((e=Ro(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=Lo(e.length),i=Lo(16),r=0;r<e.length;r+=16)Do(e,i,0,r,r+16),Do(i=this._aes.decrypt(i),t,r);return t};var Zo=function e(t,i){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",i){if(16!=i.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else i=Lo(16);this._lastCipherblock=Ro(i,!0),this._aes=new Xo(t)};Zo.prototype.encrypt=function(e){if((e=Ro(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=Lo(e.length),i=Lo(16),r=0;r<e.length;r+=16){Do(e,i,0,r,r+16);for(var a=0;a<16;a++)i[a]^=this._lastCipherblock[a];this._lastCipherblock=this._aes.encrypt(i),Do(this._lastCipherblock,t,r)}return t},Zo.prototype.decrypt=function(e){if((e=Ro(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=Lo(e.length),i=Lo(16),r=0;r<e.length;r+=16){Do(e,i,0,r,r+16),i=this._aes.decrypt(i);for(var a=0;a<16;a++)t[r+a]=i[a]^this._lastCipherblock[a];Do(e,this._lastCipherblock,0,r,r+16)}return t};var ec=function e(t,i,r){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",i){if(16!=i.length)throw new Error("invalid initialation vector size (must be 16 size)")}else i=Lo(16);r||(r=1),this.segmentSize=r,this._shiftRegister=Ro(i,!0),this._aes=new Xo(t)};ec.prototype.encrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var t,i=Ro(e,!0),r=0;r<i.length;r+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var a=0;a<this.segmentSize;a++)i[r+a]^=t[a];Do(this._shiftRegister,this._shiftRegister,0,this.segmentSize),Do(i,this._shiftRegister,16-this.segmentSize,r,r+this.segmentSize)}return i},ec.prototype.decrypt=function(e){if(e.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var t,i=Ro(e,!0),r=0;r<i.length;r+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var a=0;a<this.segmentSize;a++)i[r+a]^=t[a];Do(this._shiftRegister,this._shiftRegister,0,this.segmentSize),Do(e,this._shiftRegister,16-this.segmentSize,r,r+this.segmentSize)}return i};var tc=function e(t,i){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",i){if(16!=i.length)throw new Error("invalid initialation vector size (must be 16 bytes)")}else i=Lo(16);this._lastPrecipher=Ro(i,!0),this._lastPrecipherIndex=16,this._aes=new Xo(t)};tc.prototype.encrypt=function(e){for(var t=Ro(e,!0),i=0;i<t.length;i++)16===this._lastPrecipherIndex&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),t[i]^=this._lastPrecipher[this._lastPrecipherIndex++];return t},tc.prototype.decrypt=tc.prototype.encrypt;var ic=function e(t){if(!(this instanceof e))throw Error("Counter must be instanitated with `new`");0===t||t||(t=1),"number"==typeof t?(this._counter=Lo(16),this.setValue(t)):this.setBytes(t)};ic.prototype.setValue=function(e){if("number"!=typeof e||parseInt(e)!=e)throw new Error("invalid counter value (must be an integer)");if(e>Number.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var t=15;t>=0;--t)this._counter[t]=e%256,e=parseInt(e/256)},ic.prototype.setBytes=function(e){if(16!=(e=Ro(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},ic.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var rc=function e(t,i){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",i instanceof ic||(i=new ic(i)),this._counter=i,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new Xo(t)};rc.prototype.encrypt=function(e){for(var t=Ro(e,!0),i=0;i<t.length;i++)16===this._remainingCounterIndex&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),t[i]^=this._remainingCounter[this._remainingCounterIndex++];return t},rc.prototype.decrypt=rc.prototype.encrypt;var ac={AES:Xo,Counter:ic,ModeOfOperation:{ecb:$o,cbc:Zo,cfb:ec,ofb:tc,ctr:rc},utils:{hex:Po,utf8:Io},padding:{pkcs7:{pad:function(e){var t=16-(e=Ro(e,!0)).length%16,i=Lo(e.length+t);Do(e,i);for(var r=e.length;r<i.length;r++)i[r]=t;return i},strip:function(e){if((e=Ro(e,!0)).length<16)throw new Error("PKCS#7 invalid length");var t=e[e.length-1];if(t>16)throw new Error("PKCS#7 padding byte out of range");for(var i=e.length-t,r=0;r<t;r++)if(e[i+r]!==t)throw new Error("PKCS#7 invalid padding byte");var a=Lo(i);return Do(e,a,0,0,i),a}}},_arrayTest:{coerceArray:Ro,createArray:Lo,copyArray:Do}};function nc(e){return e[3]|e[2]<<8|e[1]<<16|e[0]<<24}function sc(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];t=new Uint8Array(t),i=new Uint8Array(i);for(var a=e.byteLength,n=5;n<a;){var s=nc(e.slice(n,n+4));if(s>a)break;var o=e[n+4],c=!1;if(r?(o=o>>>1&63,c=[0,1,2,3,4,5,6,7,8,9,16,17,18,19,20].includes(o)):(o&=31,c=1===o||5===o),c){var l=e.slice(n+4+2,n+4+s),u=new ac.ModeOfOperation.ctr(t,new ac.Counter(i)),d=u.decrypt(l);u=null,e.set(d,n+4+2)}n=n+4+s}return e}var oc=16,cc=[214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5,43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153,156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98,228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166,71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168,104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53,30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135,212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158,234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161,224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227,29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111,213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81,141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216,10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176,137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132,24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72],lc=[462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257];function uc(e){for(var t=[],i=0,r=e.length;i<r;i+=2)t.push(parseInt(e.substr(i,2),16));return t}function dc(e){return e.map((function(e){return 1===(e=e.toString(16)).length?"0"+e:e})).join("")}function hc(e){for(var t=[],i=0,r=e.length;i<r;i++){var a=e.codePointAt(i);if(a<=127)t.push(a);else if(a<=2047)t.push(192|a>>>6),t.push(128|63&a);else if(a<=55295||a>=57344&&a<=65535)t.push(224|a>>>12),t.push(128|a>>>6&63),t.push(128|63&a);else{if(!(a>=65536&&a<=1114111))throw t.push(a),new Error("input is not supported");i++,t.push(240|a>>>18&28),t.push(128|a>>>12&63),t.push(128|a>>>6&63),t.push(128|63&a)}}return t}function fc(e){for(var t=[],i=0,r=e.length;i<r;i++)e[i]>=240&&e[i]<=247?(t.push(String.fromCodePoint(((7&e[i])<<18)+((63&e[i+1])<<12)+((63&e[i+2])<<6)+(63&e[i+3]))),i+=3):e[i]>=224&&e[i]<=239?(t.push(String.fromCodePoint(((15&e[i])<<12)+((63&e[i+1])<<6)+(63&e[i+2]))),i+=2):e[i]>=192&&e[i]<=223?(t.push(String.fromCodePoint(((31&e[i])<<6)+(63&e[i+1]))),i++):t.push(String.fromCodePoint(e[i]));return t.join("")}function pc(e,t){var i=31&t;return e<<i|e>>>32-i}function mc(e){return(255&cc[e>>>24&255])<<24|(255&cc[e>>>16&255])<<16|(255&cc[e>>>8&255])<<8|255&cc[255&e]}function gc(e){return e^pc(e,2)^pc(e,10)^pc(e,18)^pc(e,24)}function yc(e){return e^pc(e,13)^pc(e,23)}function vc(e,t,i){for(var r=new Array(4),a=new Array(4),n=0;n<4;n++)a[0]=255&e[4*n],a[1]=255&e[4*n+1],a[2]=255&e[4*n+2],a[3]=255&e[4*n+3],r[n]=a[0]<<24|a[1]<<16|a[2]<<8|a[3];for(var s,o=0;o<32;o+=4)s=r[1]^r[2]^r[3]^i[o+0],r[0]^=gc(mc(s)),s=r[2]^r[3]^r[0]^i[o+1],r[1]^=gc(mc(s)),s=r[3]^r[0]^r[1]^i[o+2],r[2]^=gc(mc(s)),s=r[0]^r[1]^r[2]^i[o+3],r[3]^=gc(mc(s));for(var c=0;c<16;c+=4)t[c]=r[3-c/4]>>>24&255,t[c+1]=r[3-c/4]>>>16&255,t[c+2]=r[3-c/4]>>>8&255,t[c+3]=255&r[3-c/4]}function bc(e,t,i){for(var r=new Array(4),a=new Array(4),n=0;n<4;n++)a[0]=255&e[0+4*n],a[1]=255&e[1+4*n],a[2]=255&e[2+4*n],a[3]=255&e[3+4*n],r[n]=a[0]<<24|a[1]<<16|a[2]<<8|a[3];r[0]^=2746333894,r[1]^=1453994832,r[2]^=1736282519,r[3]^=2993693404;for(var s,o=0;o<32;o+=4)s=r[1]^r[2]^r[3]^lc[o+0],t[o+0]=r[0]^=yc(mc(s)),s=r[2]^r[3]^r[0]^lc[o+1],t[o+1]=r[1]^=yc(mc(s)),s=r[3]^r[0]^r[1]^lc[o+2],t[o+2]=r[2]^=yc(mc(s)),s=r[0]^r[1]^r[2]^lc[o+3],t[o+3]=r[3]^=yc(mc(s));if(0===i)for(var c,l=0;l<16;l++)c=t[l],t[l]=t[31-l],t[31-l]=c}function Ac(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=r.padding,n=void 0===a?"pkcs#7":a,s=r.mode,o=r.iv,c=void 0===o?[]:o,l=r.output,u=void 0===l?"string":l;if("cbc"===s&&("string"==typeof c&&(c=uc(c)),16!==c.length))throw new Error("iv is invalid");if("string"==typeof t&&(t=uc(t)),16!==t.length)throw new Error("key is invalid");if(e="string"==typeof e?0!==i?hc(e):uc(e):Object(m["a"])(e),("pkcs#5"===n||"pkcs#7"===n)&&0!==i)for(var d=oc-e.length%oc,h=0;h<d;h++)e.push(d);var f=new Array(32);bc(t,f,i);for(var p=[],g=c,y=e.length,v=0;y>=oc;){var b=e.slice(v,v+16),A=new Array(16);if("cbc"===s)for(var k=0;k<oc;k++)0!==i&&(b[k]^=g[k]);vc(b,A,f);for(var _=0;_<oc;_++)"cbc"===s&&0===i&&(A[_]^=g[_]),p[v+_]=A[_];"cbc"===s&&(g=0!==i?A:b),y-=oc,v+=oc}if(("pkcs#5"===n||"pkcs#7"===n)&&0===i){for(var w=p.length,S=p[w-1],T=1;T<=S;T++)if(p[w-T]!==S)throw new Error("padding is invalid");p.splice(w-S,S)}return"array"!==u?0!==i?dc(p):fc(p):p}function kc(e,t){for(var i,r=e.byteLength,a=5;a<r;){var n=(i=e.slice(a,a+4))[3]|i[2]<<8|i[1]<<16|i[0]<<24;if(n>r)break;var s=e[a+4];if(s&=31,1===s||5===s){var o=Ac(e.slice(a+4+2,a+4+n),t,0,{padding:"none",output:"array"});e.set(o,a+4+2)}a=a+4+n}return e}var _c,wc=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e),r.input=new to(r.demux()),e.debug.log("FlvDemux","init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){k(Object(b["a"])(i.prototype),"destroy",this).call(this),this.input=null,this.player.debug.log("FlvDemux","destroy")}},{key:"dispatch",value:function(e){this.input?this.input.write(e):this.player&&this.player.debug.warn("FlvDemux","dispatch() this.input is null")}},{key:"demux",value:regeneratorRuntime.mark((function e(){var t,i,r,a,n,s,o,c,l,u,d,h,f,p,m,g,y,v;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,9;case 2:t=new ArrayBuffer(4),i=new Uint8Array(t),r=new Uint32Array(t),a=this.player;case 3:if(this.input){e.next=5;break}return e.abrupt("return");case 5:return i[3]=0,e.next=8,15;case 8:return n=e.sent,s=n[4],i[0]=n[7],i[1]=n[6],i[2]=n[5],o=r[0],i[0]=n[10],i[1]=n[9],i[2]=n[8],i[3]=n[11],c=r[0],e.next=16,o;case 16:if(l=e.sent.slice(),a){e.next=19;break}return e.abrupt("return");case 19:e.t0=s,e.next=e.t0===Ue?22:e.t0===je?24:e.t0===Ne?26:30;break;case 22:return a._opt.hasAudio&&(a.updateStats({abps:l.byteLength}),l.byteLength>0&&this._doDecode(l,Me,c)),e.abrupt("break",31);case 24:return a._opt.hasVideo&&l.length>=6?(u=c,a.updateStats({vbps:l.byteLength,dts:u}),l[0],d=(l[0]>>4&15)===cr,d&&(this.calcIframeIntervalTimestamp(c),null===this.nalUnitSize&&tn(l))&&(h=15&l[0],this.player.video.updateVideoInfo({encTypeCode:h}),f=h===mt,this.nalUnitSize=xs(l,f),this.player.debug.log("FlvDemux","demux() isIFrame is ".concat(d," and isVideoSequenceHeader is true and isHevc is ").concat(f," and nalUnitSize is ").concat(this.nalUnitSize))),r[0]=l[4],r[1]=l[3],r[2]=l[2],r[3]=0,p=r[0],a._times.demuxStart||(a._times.demuxStart=$r()),m=l,a._opt.isM7sCrypto?a._opt.cryptoKey&&a._opt.cryptoKey.byteLength>0&&a._opt.cryptoIV&&a._opt.cryptoIV.byteLength>0?(g=this.player.video.getVideoInfo(),g.encTypeCode?m=sc(l,a._opt.cryptoKey,a._opt.cryptoIV,g.encTypeCode===mt):a.debug.warn("FlvDemux","videoInfo.encTypeCode is ".concat(g.encTypeCode))):a.debug.error("FlvDemux","cryptoKey.length is ".concat(a._opt.cryptoKey&&a._opt.cryptoKey.byteLength," or cryptoIV.length is ").concat(a._opt.cryptoIV&&a._opt.cryptoIV.byteLength," null")):a._opt.isSm4Crypto&&(a._opt.sm4CryptoKey&&d?m=kc(l,a._opt.sm4CryptoKey):a._opt.sm4CryptoKey||a.debug.error("FlvDemux","opt.sm4CryptoKey is null")),this._doDecode(m,Fe,c,d,p)):l.length<6&&a.debug.warn("FlvDemux","payload.length is ".concat(l.length," less than 6 and ignore")),e.abrupt("break",31);case 26:return this.player.isRecordTypeFlv()&&(y=new Uint8Array(l),this.player.recorder.addMetaData(y)),v=Js(l),v&&v.onMetaData&&a.updateMetaData(v.onMetaData),e.abrupt("break",31);case 30:a.debug.log("FlvDemux","demux() type is ".concat(s));case 31:e.next=3;break;case 33:case"end":return e.stop()}}),e,this)}))},{key:"close",value:function(){this.input=null}},{key:"getInputByteLength",value:function(){var e=0;return this.input&&this.input.buffer&&(e=this.input.buffer.byteLength),e}},{key:"hasUnitTypeIDR",value:function(e,t){var i=Ts(e.slice(5)),r=!1;return i.forEach((function(e){var i=t?e[0]>>>1&63:31&e[0];(t&&(i===Et||i===xt)||an(t)&&i===St)&&(r=!0)})),r}}]),i}(Qs),Sc=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e),e.debug.log("M7sDemux","init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){k(Object(b["a"])(i.prototype),"destroy",this).call(this),this.player.debug.log("M7sDemux","destroy")}},{key:"dispatch",value:function(e){var t=this.player,i=new DataView(e),r=i.getUint8(0),a=i.getUint32(1,!1);switch(r){case Me:if(t._opt.hasAudio){var n=new Uint8Array(e,5);t.updateStats({abps:n.byteLength}),n.byteLength>0&&this._doDecode(n,r,a)}break;case Fe:if(t._opt.hasVideo)if(t._times.demuxStart||(t._times.demuxStart=$r()),i.byteLength>5){var s=new Uint8Array(e,5),o=i.getUint8(5)>>4==1,c=a;t.updateStats({vbps:s.byteLength,dts:c}),s.byteLength>0&&(o&&this.calcIframeIntervalTimestamp(a),this._doDecode(s,r,a,o))}else this.player.debug.warn("M7sDemux","dispatch","dv byteLength is",i.byteLength)}}}]),i}(Qs),Tc=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e),e.debug.log("WebTransportDemux","init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){this.player.debug.log("WebTransportDemux","destroy"),k(Object(b["a"])(i.prototype),"destroy",this).call(this)}}]),i}(wc),Ec=Or((function(e){e.exports=function(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e},e.exports.__esModule=!0,e.exports["default"]=e.exports})),xc=(_c=Ec)&&_c.__esModule&&Object.prototype.hasOwnProperty.call(_c,"default")?_c["default"]:_c,Cc=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e),xc(Object(v["a"])(r),"TAG_NAME","NakedFlowDemux"),r.lastBuf=null,r.vps=null,r.sps=null,r.pps=null,r.streamVideoType=null,r.streamAudioType=null,r.tempNaluBufferList=new Uint8Array(0),r.localDts=0,r.isSendSeqHeader=!1,r.isSendAACSeqHeader=!1,e.debug.log(r.TAG_NAME,"init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){k(Object(b["a"])(i.prototype),"destroy",this).call(this),this.lastBuf=null,this.vps=null,this.sps=null,this.pps=null,this.streamVideoType=null,this.streamAudioType=null,this.tempNaluBufferList=new Uint8Array(0),this.localDts=0,this.localAudioDts=0,this.isSendSeqHeader=!1,this.isSendAACSeqHeader=!1,this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"dispatch",value:function(e){this.player;var t=new Uint8Array(e);this.extractNALu$2(t)}},{key:"addNaluToBuffer",value:function(e){var t=e.byteLength+this.tempNaluBufferList.byteLength,i=new Uint8Array(t);i.set(this.tempNaluBufferList,0),i.set(e,this.tempNaluBufferList.byteLength),this.tempNaluBufferList=i}},{key:"downloadNakedFlowFile",value:function(){var e=new Blob([this.tempNaluBufferList]);try{var t=document.createElement("a");t.href=window.URL.createObjectURL(e),t.download=Date.now()+".h264",t.click(),window.URL.revokeObjectURL(t.href)}catch(t){console.error("downloadTempNalu",t)}}},{key:"getNaluDts",value:function(){var e=this.player._opt.nakedFlowFps;return this.localDts=this.localDts+parseInt(1e3/e),this.localDts}},{key:"getNaluAudioDts",value:function(){var e=this.player.audio.audioContext.sampleRate,t=this.player.audio.audioBufferSize;return this.localDts+parseInt(t/e*1e3)}},{key:"extractNALu",value:function(e){for(var t,i,r=0,a=e.byteLength,n=0,s=[];r<a;)switch(t=e[r++],n){case 0:0===t&&(n=1);break;case 1:n=0===t?2:0;break;case 2:case 3:0===t?n=3:(1===t&&r<a&&(e[r],i&&s.push(e.subarray(i,r-n-1)),i=r),n=0)}return i&&s.push(e.subarray(i,a)),s}},{key:"extractNALu$2",value:function(e){var t=null;if(e&&!(e.byteLength<1)){this.lastBuf?(t=new Uint8Array(e.byteLength+this.lastBuf.length),t.set(this.lastBuf),t.set(new Uint8Array(e),this.lastBuf.length)):t=new Uint8Array(e);for(var i=0,r=-1,a=-2,n=new Array,s=0;s<t.length;s+=2){var o=t[s],c=t[s+1];0==r&&0==o&&0==c?n.push(s-1):1==c&&0==o&&0==r&&0==a&&n.push(s-2),a=o,r=c}if(n.length>1)for(var l=0;l<n.length-1;++l){var u=t.subarray(n[l],n[l+1]+1);this.handleNALu(u),i=n[l+1]}else i=n[0];if(0!=i&&i<t.length)this.lastBuf=t.subarray(i);else{this.lastBuf||(this.lastBuf=t);var d=new Uint8Array(this.lastBuf.length+e.byteLength);d.set(this.lastBuf),d.set(new Uint8Array(e),this.lastBuf.length),this.lastBuf=d}}}},{key:"handleNALu",value:function(e){e.byteLength<4?this.player.debug.warn(this.TAG_NAME,"handleNALu nalu byteLength is ".concat(e.byteLength," <= 4")):(e=e.slice(4),this.handleVideoNalu(e))}},{key:"handleVideoNalu",value:function(e){var t=this,i=new Uint8Array(e);if(this.streamVideoType||(this.streamVideoType=function(e){var t=null,i=31&e[0];return i!==_t&&i!==wt||(t=gt),t||(i=(126&e[0])>>1,i!==Ct&&i!==Rt&&i!==Lt||(t=yt)),t}(i)),this.streamVideoType===gt){var r=this.handleAddNaluStartCode(i),a=this.extractNALu(r);if(0===a.length)return void this.player.debug.warn(this.TAG_NAME,"handleVideoNalu","naluList.length === 0");var n=[];if(a.forEach((function(e){var i=vs(e);i===wt||i===_t?t.handleVideoH264Nalu(e):As(i)&&n.push(e)})),1===n.length)this.handleVideoH264Nalu(n[0]);else if(function(e){if(0===e.length)return!1;for(var t=vs(e[0]),i=1;i<e.length;i++)if(t!==vs(e[i]))return!1;return!0}(n)){var s=vs(n[0]),o=ks(s);this.handleVideoH264NaluList(n,o,s)}else n.forEach((function(e){t.handleVideoH264Nalu(e)}))}else if(this.streamVideoType===yt)if(this.player._opt.nakedFlowH265DemuxUseNew){var c=this.handleAddNaluStartCode(i),l=this.extractNALu(c);if(0===l.length)return void this.player.debug.warn(this.TAG_NAME,"handleVideoNalu","h265 naluList.length === 0");var u=[];if(l.forEach((function(e){var i=Is(e);i===Lt||i===Rt||i===Ct?t.handleVideoH265Nalu(e):Ps(i)&&u.push(e)})),1===u.length)this.handleVideoH265Nalu(u[0]);else if(function(e){if(0===e.length)return!1;for(var t=Is(e[0]),i=1;i<e.length;i++)if(t!==Is(e[i]))return!1;return!0}(u)){var d=Is(u[0]),h=Os(d);this.handleVideoH265NaluList(u,h,d)}else u.forEach((function(e){t.handleVideoH265Nalu(e)}))}else Is(i)===Lt?this.extractH265PPS(i):this.handleVideoH265Nalu(i);else this.player.debug.error(this.TAG_NAME," this.streamVideoType is null")}},{key:"extractH264PPS",value:function(e){var t=this,i=this.handleAddNaluStartCode(e);this.extractNALu(i).forEach((function(e){bs(vs(e))?t.extractH264SEI(e):t.handleVideoH264Nalu(e)}))}},{key:"extractH265PPS",value:function(e){var t=this,i=this.handleAddNaluStartCode(e);this.extractNALu(i).forEach((function(e){Is(e)===Dt?t.extractH265SEI(e):t.handleVideoH265Nalu(e)}))}},{key:"extractH264SEI",value:function(e){var t=this,i=this.handleAddNaluStartCode(e);this.extractNALu(i).forEach((function(e){t.handleVideoH264Nalu(e)}))}},{key:"extractH265SEI",value:function(e){var t=this,i=this.handleAddNaluStartCode(e);this.extractNALu(i).forEach((function(e){t.handleVideoH265Nalu(e)}))}},{key:"handleAddNaluStartCode",value:function(e){var t=[0,0,0,1],i=new Uint8Array(e.length+t.length);return i.set(t),i.set(e,t.length),i}},{key:"handleAudioAACNalu",value:function(e){if(e&&!(e.byteLength<1)){this.streamAudioType||(this.streamAudioType=At.AAC);var t=new Uint8Array(e),i=t.slice(0,7);if(t=t.slice(7),!this.isSendAACSeqHeader){var r=(192&i[2])>>6,a=(60&i[2])>>2,n=(1&i[2])<<2|(192&i[3])>>6,s=new Uint8Array([175,0,r<<3|(14&a)>>1,(1&a)<<7|n<<3]);this.isSendAACSeqHeader=!0,this._doDecode(s,Me,0,!1,0)}var o=this.getNaluAudioDts(),c=new Uint8Array(t.length+2);c.set([175,1],0),c.set(t,2),this._doDecode(c,Me,o,!1,0)}}},{key:"handleAudioG711ANalu",value:function(e){if(e&&!(e.byteLength<1)){this.streamAudioType||(this.streamAudioType=At.ALAW);var t=new Uint8Array(e),i=this.getNaluAudioDts(),r=new Uint8Array(t.length+1);r.set([114],0),r.set(t,1),this._doDecode(r,Me,i,!1,0)}}},{key:"handleAudioG711UNalu",value:function(e){if(e&&!(e.byteLength<1)){this.streamAudioType||(this.streamAudioType=At.MULAW);var t=new Uint8Array(e),i=this.getNaluAudioDts(),r=new Uint8Array(t.length+1);r.set([130],0),r.set(t,1),this._doDecode(r,Me,i,!1,0)}}},{key:"handleVideoH264Nalu",value:function(e){var t=vs(e);switch(t){case _t:this.sps=e;break;case wt:this.pps=e}if(this.isSendSeqHeader){if(this.sps&&this.pps){var i=gs({sps:this.sps,pps:this.pps}),r=this.getNaluDts();this._doDecode(i,Fe,r,!0,0),this.sps=null,this.pps=null}if(As(t)){this.player._times.demuxStart||(this.player._times.demuxStart=$r());var a=ks(t),n=this.getNaluDts(),s=function(e,t){var i=[];i[0]=t?23:39,i[1]=1,i[2]=0,i[3]=0,i[4]=0,i[5]=e.byteLength>>24&255,i[6]=e.byteLength>>16&255,i[7]=e.byteLength>>8&255,i[8]=255&e.byteLength;var r=new Uint8Array(i.length+e.byteLength);return r.set(i,0),r.set(e,i.length),r}(e,a);this._preDoDecode(s,Fe,n,a,0)}else this.player.debug.warn(this.TAG_NAME,"handleVideoH264Nalu is avc seq head nalType is ".concat(t))}else if(this.sps&&this.pps){this.isSendSeqHeader=!0;var o=gs({sps:this.sps,pps:this.pps});this._doDecode(o,Fe,0,!0,0),this.sps=null,this.pps=null}}},{key:"handleVideoH264NaluList",value:function(e,t,i){if(this.isSendSeqHeader){this.player._times.demuxStart||(this.player._times.demuxStart=$r());var r=this.getNaluDts(),a=ys(e.reduce((function(e,t){var i=Es(e),r=Es(t),a=new Uint8Array(i.byteLength+r.byteLength);return a.set(i,0),a.set(r,i.byteLength),a})),t);this._preDoDecode(a,Fe,r,t,0)}else this.player.debug.warn(this.TAG_NAME,"handleVideoH264NaluList isSendSeqHeader is false")}},{key:"handleVideoH265Nalu",value:function(e){var t=Is(e);switch(t){case Ct:this.vps=e;break;case Rt:this.sps=e;break;case Lt:this.pps=e}if(this.isSendSeqHeader){if(this.vps&&this.sps&&this.pps){var i=Ls({vps:this.vps,sps:this.sps,pps:this.pps}),r=this.getNaluDts();this._doDecode(i,Fe,r,!0,0),this.vps=null,this.sps=null,this.pps=null}if(Ps(t)){this.player._times.demuxStart||(this.player._times.demuxStart=$r());var a=Os(t),n=this.getNaluDts(),s=function(e,t){var i=[];i[0]=t?28:44,i[1]=1,i[2]=0,i[3]=0,i[4]=0,i[5]=e.byteLength>>24&255,i[6]=e.byteLength>>16&255,i[7]=e.byteLength>>8&255,i[8]=255&e.byteLength;var r=new Uint8Array(i.length+e.byteLength);return r.set(i,0),r.set(e,i.length),r}(e,a);this._preDoDecode(s,Fe,n,a,0)}}else if(this.vps&&this.sps&&this.pps){this.isSendSeqHeader=!0;var o=Ls({vps:this.vps,sps:this.sps,pps:this.pps});this._doDecode(o,Fe,0,!0,0),this.vps=null,this.sps=null,this.pps=null}}},{key:"handleVideoH265NaluList",value:function(e,t,i){if(this.isSendSeqHeader){this.player._times.demuxStart||(this.player._times.demuxStart=$r());var r=this.getNaluDts(),a=Ds(e.reduce((function(e,t){var i=Es(e),r=Es(t),a=new Uint8Array(i.byteLength+r.byteLength);return a.set(i,0),a.set(r,i.byteLength),a})),t);this._preDoDecode(a,Fe,r,t,0)}else this.player.debug.warn(this.TAG_NAME,"handleVideoH265NaluList isSendSeqHeader is false")}},{key:"_preDoDecode",value:function(e,t,i,r,a){this.player.updateStats({vbps:e.byteLength,dts:i}),r&&this.calcIframeIntervalTimestamp(i),this._doDecode(e,Fe,i,r,a)}},{key:"getInputByteLength",value:function(){var e=0;return this.lastBuf&&(e=this.lastBuf.byteLength),e}}]),i}(Qs),Rc=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e),r.player=e,e.debug.log("EmptyDemux","init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){k(Object(b["a"])(i.prototype),"destroy",this).call(this),this.player.debug.log("EmptyDemux","destroy")}}]),i}(Qs),Lc=Or((function(e,t){var i,r,a,n=(i=new Date,r=4,a={setLogLevel:function(e){r=e==this.debug?1:e==this.info?2:e==this.warn?3:(this.error,4)},debug:function(e,t){void 0===console.debug&&(console.debug=console.log),1>=r&&console.debug("["+n.getDurationString(new Date-i,1e3)+"]","["+e+"]",t)},log:function(e,t){this.debug(e.msg)},info:function(e,t){2>=r&&console.info("["+n.getDurationString(new Date-i,1e3)+"]","["+e+"]",t)},warn:function(e,t){3>=r&&console.warn("["+n.getDurationString(new Date-i,1e3)+"]","["+e+"]",t)},error:function(e,t){4>=r&&console.error("["+n.getDurationString(new Date-i,1e3)+"]","["+e+"]",t)}},a);n.getDurationString=function(e,t){var i;function r(e,t){for(var i=(""+e).split(".");i[0].length<t;)i[0]="0"+i[0];return i.join(".")}e<0?(i=!0,e=-e):i=!1;var a=e/(t||1),n=Math.floor(a/3600);a-=3600*n;var s=Math.floor(a/60),o=1e3*(a-=60*s);return o-=1e3*(a=Math.floor(a)),o=Math.floor(o),(i?"-":"")+n+":"+r(s,2)+":"+r(a,2)+"."+r(o,3)},n.printRanges=function(e){var t=e.length;if(t>0){for(var i="",r=0;r<t;r++)r>0&&(i+=","),i+="["+n.getDurationString(e.start(r))+","+n.getDurationString(e.end(r))+"]";return i}return"(empty)"},t.Log=n;var s=function(e){if(!(e instanceof ArrayBuffer))throw"Needs an array buffer";this.buffer=e,this.dataview=new DataView(e),this.position=0};s.prototype.getPosition=function(){return this.position},s.prototype.getEndPosition=function(){return this.buffer.byteLength},s.prototype.getLength=function(){return this.buffer.byteLength},s.prototype.seek=function(e){var t=Math.max(0,Math.min(this.buffer.byteLength,e));return this.position=isNaN(t)||!isFinite(t)?0:t,!0},s.prototype.isEos=function(){return this.getPosition()>=this.getEndPosition()},s.prototype.readAnyInt=function(e,t){var i=0;if(this.position+e<=this.buffer.byteLength){switch(e){case 1:i=t?this.dataview.getInt8(this.position):this.dataview.getUint8(this.position);break;case 2:i=t?this.dataview.getInt16(this.position):this.dataview.getUint16(this.position);break;case 3:if(t)throw"No method for reading signed 24 bits values";i=this.dataview.getUint8(this.position)<<16,i|=this.dataview.getUint8(this.position+1)<<8,i|=this.dataview.getUint8(this.position+2);break;case 4:i=t?this.dataview.getInt32(this.position):this.dataview.getUint32(this.position);break;case 8:if(t)throw"No method for reading signed 64 bits values";i=this.dataview.getUint32(this.position)<<32,i|=this.dataview.getUint32(this.position+4);break;default:throw"readInt method not implemented for size: "+e}return this.position+=e,i}throw"Not enough bytes in buffer"},s.prototype.readUint8=function(){return this.readAnyInt(1,!1)},s.prototype.readUint16=function(){return this.readAnyInt(2,!1)},s.prototype.readUint24=function(){return this.readAnyInt(3,!1)},s.prototype.readUint32=function(){return this.readAnyInt(4,!1)},s.prototype.readUint64=function(){return this.readAnyInt(8,!1)},s.prototype.readString=function(e){if(this.position+e<=this.buffer.byteLength){for(var t="",i=0;i<e;i++)t+=String.fromCharCode(this.readUint8());return t}throw"Not enough bytes in buffer"},s.prototype.readCString=function(){for(var e=[];;){var t=this.readUint8();if(0===t)break;e.push(t)}return String.fromCharCode.apply(null,e)},s.prototype.readInt8=function(){return this.readAnyInt(1,!0)},s.prototype.readInt16=function(){return this.readAnyInt(2,!0)},s.prototype.readInt32=function(){return this.readAnyInt(4,!0)},s.prototype.readInt64=function(){return this.readAnyInt(8,!1)},s.prototype.readUint8Array=function(e){for(var t=new Uint8Array(e),i=0;i<e;i++)t[i]=this.readUint8();return t},s.prototype.readInt16Array=function(e){for(var t=new Int16Array(e),i=0;i<e;i++)t[i]=this.readInt16();return t},s.prototype.readUint16Array=function(e){for(var t=new Int16Array(e),i=0;i<e;i++)t[i]=this.readUint16();return t},s.prototype.readUint32Array=function(e){for(var t=new Uint32Array(e),i=0;i<e;i++)t[i]=this.readUint32();return t},s.prototype.readInt32Array=function(e){for(var t=new Int32Array(e),i=0;i<e;i++)t[i]=this.readInt32();return t},t.MP4BoxStream=s;var o=function e(t,i,r){this._byteOffset=i||0,t instanceof ArrayBuffer?this.buffer=t:"object"==Object(E["a"])(t)?(this.dataView=t,i&&(this._byteOffset+=i)):this.buffer=new ArrayBuffer(t||0),this.position=0,this.endianness=null!==r&&void 0!==r?r:e.LITTLE_ENDIAN};o.prototype={},o.prototype.getPosition=function(){return this.position},o.prototype._realloc=function(e){if(this._dynamicSize){var t=this._byteOffset+this.position+e,i=this._buffer.byteLength;if(t<=i)t>this._byteLength&&(this._byteLength=t);else{for(i<1&&(i=1);t>i;)i*=2;var r=new ArrayBuffer(i),a=new Uint8Array(this._buffer);new Uint8Array(r,0,a.length).set(a),this.buffer=r,this._byteLength=t}}},o.prototype._trimAlloc=function(){if(this._byteLength!=this._buffer.byteLength){var e=new ArrayBuffer(this._byteLength),t=new Uint8Array(e),i=new Uint8Array(this._buffer,0,t.length);t.set(i),this.buffer=e}},o.BIG_ENDIAN=!1,o.LITTLE_ENDIAN=!0,o.prototype._byteLength=0,Object.defineProperty(o.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}}),Object.defineProperty(o.prototype,"buffer",{get:function(){return this._trimAlloc(),this._buffer},set:function(e){this._buffer=e,this._dataView=new DataView(this._buffer,this._byteOffset),this._byteLength=this._buffer.byteLength}}),Object.defineProperty(o.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e,this._dataView=new DataView(this._buffer,this._byteOffset),this._byteLength=this._buffer.byteLength}}),Object.defineProperty(o.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset,this._buffer=e.buffer,this._dataView=new DataView(this._buffer,this._byteOffset),this._byteLength=this._byteOffset+e.byteLength}}),o.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t},o.prototype.isEof=function(){return this.position>=this._byteLength},o.prototype.mapUint8Array=function(e){this._realloc(1*e);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);return this.position+=1*e,t},o.prototype.readInt32Array=function(e,t){var i;e=null!==(i=e)&&void 0!==i?i:this.byteLength-this.position/4;var r=new Int32Array(e);return o.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT),o.arrayToNative(r,null!==t&&void 0!==t?t:this.endianness),this.position+=r.byteLength,r},o.prototype.readInt16Array=function(e,t){var i;e=null!==(i=e)&&void 0!==i?i:this.byteLength-this.position/2;var r=new Int16Array(e);return o.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT),o.arrayToNative(r,null!==t&&void 0!==t?t:this.endianness),this.position+=r.byteLength,r},o.prototype.readInt8Array=function(e){var t;e=null!==(t=e)&&void 0!==t?t:this.byteLength-this.position;var i=new Int8Array(e);return o.memcpy(i.buffer,0,this.buffer,this.byteOffset+this.position,e*i.BYTES_PER_ELEMENT),this.position+=i.byteLength,i},o.prototype.readUint32Array=function(e,t){var i;e=null!==(i=e)&&void 0!==i?i:this.byteLength-this.position/4;var r=new Uint32Array(e);return o.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT),o.arrayToNative(r,null!==t&&void 0!==t?t:this.endianness),this.position+=r.byteLength,r},o.prototype.readUint16Array=function(e,t){var i;e=null!==(i=e)&&void 0!==i?i:this.byteLength-this.position/2;var r=new Uint16Array(e);return o.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT),o.arrayToNative(r,null!==t&&void 0!==t?t:this.endianness),this.position+=r.byteLength,r},o.prototype.readUint8Array=function(e){var t;e=null!==(t=e)&&void 0!==t?t:this.byteLength-this.position;var i=new Uint8Array(e);return o.memcpy(i.buffer,0,this.buffer,this.byteOffset+this.position,e*i.BYTES_PER_ELEMENT),this.position+=i.byteLength,i},o.prototype.readFloat64Array=function(e,t){var i;e=null!==(i=e)&&void 0!==i?i:this.byteLength-this.position/8;var r=new Float64Array(e);return o.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT),o.arrayToNative(r,null!==t&&void 0!==t?t:this.endianness),this.position+=r.byteLength,r},o.prototype.readFloat32Array=function(e,t){var i;e=null!==(i=e)&&void 0!==i?i:this.byteLength-this.position/4;var r=new Float32Array(e);return o.memcpy(r.buffer,0,this.buffer,this.byteOffset+this.position,e*r.BYTES_PER_ELEMENT),o.arrayToNative(r,null!==t&&void 0!==t?t:this.endianness),this.position+=r.byteLength,r},o.prototype.readInt32=function(e){var t=this._dataView.getInt32(this.position,null!==e&&void 0!==e?e:this.endianness);return this.position+=4,t},o.prototype.readInt16=function(e){var t=this._dataView.getInt16(this.position,null!==e&&void 0!==e?e:this.endianness);return this.position+=2,t},o.prototype.readInt8=function(){var e=this._dataView.getInt8(this.position);return this.position+=1,e},o.prototype.readUint32=function(e){var t=this._dataView.getUint32(this.position,null!==e&&void 0!==e?e:this.endianness);return this.position+=4,t},o.prototype.readUint16=function(e){var t=this._dataView.getUint16(this.position,null!==e&&void 0!==e?e:this.endianness);return this.position+=2,t},o.prototype.readUint8=function(){var e=this._dataView.getUint8(this.position);return this.position+=1,e},o.prototype.readFloat32=function(e){var t=this._dataView.getFloat32(this.position,null!==e&&void 0!==e?e:this.endianness);return this.position+=4,t},o.prototype.readFloat64=function(e){var t=this._dataView.getFloat64(this.position,null!==e&&void 0!==e?e:this.endianness);return this.position+=8,t},o.endianness=new Int8Array(new Int16Array([1]).buffer)[0]>0,o.memcpy=function(e,t,i,r,a){var n=new Uint8Array(e,t,a),s=new Uint8Array(i,r,a);n.set(s)},o.arrayToNative=function(e,t){return t==this.endianness?e:this.flipArrayEndianness(e)},o.nativeToEndian=function(e,t){return this.endianness==t?e:this.flipArrayEndianness(e)},o.flipArrayEndianness=function(e){for(var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),i=0;i<e.byteLength;i+=e.BYTES_PER_ELEMENT)for(var r=i+e.BYTES_PER_ELEMENT-1,a=i;r>a;r--,a++){var n=t[a];t[a]=t[r],t[r]=n}return e},o.prototype.failurePosition=0,String.fromCharCodeUint8=function(e){for(var t=[],i=0;i<e.length;i++)t[i]=e[i];return String.fromCharCode.apply(null,t)},o.prototype.readString=function(e,t){return null==t||"ASCII"==t?String.fromCharCodeUint8.apply(null,[this.mapUint8Array(null!==e&&void 0!==e?e:this.byteLength-this.position)]):new TextDecoder(t).decode(this.mapUint8Array(e))},o.prototype.readCString=function(e){var t=this.byteLength-this.position,i=new Uint8Array(this._buffer,this._byteOffset+this.position),r=t;null!=e&&(r=Math.min(e,t));for(var a=0;a<r&&0!==i[a];a++);var n=String.fromCharCodeUint8.apply(null,[this.mapUint8Array(a)]);return null!=e?this.position+=r-a:a!=t&&(this.position+=1),n};var c=Math.pow(2,32);o.prototype.readInt64=function(){return this.readInt32()*c+this.readUint32()},o.prototype.readUint64=function(){return this.readUint32()*c+this.readUint32()},o.prototype.readInt64=function(){return this.readUint32()*c+this.readUint32()},o.prototype.readUint24=function(){return(this.readUint8()<<16)+(this.readUint8()<<8)+this.readUint8()},t.DataStream=o,o.prototype.save=function(e){var t=new Blob([this.buffer]);if(!window.URL||!URL.createObjectURL)throw"DataStream.save: Can't create object URL.";var i=window.URL.createObjectURL(t),r=document.createElement("a");document.body.appendChild(r),r.setAttribute("href",i),r.setAttribute("download",e),r.setAttribute("target","_self"),r.click(),window.URL.revokeObjectURL(i)},o.prototype._dynamicSize=!0,Object.defineProperty(o.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){e||this._trimAlloc(),this._dynamicSize=e}}),o.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e),i=new Uint8Array(t),r=new Uint8Array(this._buffer,e,i.length);i.set(r),this.buffer=t,this.position-=e},o.prototype.writeInt32Array=function(e,t){if(this._realloc(4*e.length),e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)o.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapInt32Array(e.length,t);else for(var i=0;i<e.length;i++)this.writeInt32(e[i],t)},o.prototype.writeInt16Array=function(e,t){if(this._realloc(2*e.length),e instanceof Int16Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)o.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapInt16Array(e.length,t);else for(var i=0;i<e.length;i++)this.writeInt16(e[i],t)},o.prototype.writeInt8Array=function(e){if(this._realloc(1*e.length),e instanceof Int8Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)o.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapInt8Array(e.length);else for(var t=0;t<e.length;t++)this.writeInt8(e[t])},o.prototype.writeUint32Array=function(e,t){if(this._realloc(4*e.length),e instanceof Uint32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)o.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapUint32Array(e.length,t);else for(var i=0;i<e.length;i++)this.writeUint32(e[i],t)},o.prototype.writeUint16Array=function(e,t){if(this._realloc(2*e.length),e instanceof Uint16Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)o.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapUint16Array(e.length,t);else for(var i=0;i<e.length;i++)this.writeUint16(e[i],t)},o.prototype.writeUint8Array=function(e){if(this._realloc(1*e.length),e instanceof Uint8Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)o.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapUint8Array(e.length);else for(var t=0;t<e.length;t++)this.writeUint8(e[t])},o.prototype.writeFloat64Array=function(e,t){if(this._realloc(8*e.length),e instanceof Float64Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)o.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapFloat64Array(e.length,t);else for(var i=0;i<e.length;i++)this.writeFloat64(e[i],t)},o.prototype.writeFloat32Array=function(e,t){if(this._realloc(4*e.length),e instanceof Float32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)o.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapFloat32Array(e.length,t);else for(var i=0;i<e.length;i++)this.writeFloat32(e[i],t)},o.prototype.writeInt32=function(e,t){this._realloc(4),this._dataView.setInt32(this.position,e,null!==t&&void 0!==t?t:this.endianness),this.position+=4},o.prototype.writeInt16=function(e,t){this._realloc(2),this._dataView.setInt16(this.position,e,null!==t&&void 0!==t?t:this.endianness),this.position+=2},o.prototype.writeInt8=function(e){this._realloc(1),this._dataView.setInt8(this.position,e),this.position+=1},o.prototype.writeUint32=function(e,t){this._realloc(4),this._dataView.setUint32(this.position,e,null!==t&&void 0!==t?t:this.endianness),this.position+=4},o.prototype.writeUint16=function(e,t){this._realloc(2),this._dataView.setUint16(this.position,e,null!==t&&void 0!==t?t:this.endianness),this.position+=2},o.prototype.writeUint8=function(e){this._realloc(1),this._dataView.setUint8(this.position,e),this.position+=1},o.prototype.writeFloat32=function(e,t){this._realloc(4),this._dataView.setFloat32(this.position,e,null!==t&&void 0!==t?t:this.endianness),this.position+=4},o.prototype.writeFloat64=function(e,t){this._realloc(8),this._dataView.setFloat64(this.position,e,null!==t&&void 0!==t?t:this.endianness),this.position+=8},o.prototype.writeUCS2String=function(e,t,i){null==i&&(i=e.length);for(var r=0;r<e.length&&r<i;r++)this.writeUint16(e.charCodeAt(r),t);for(;r<i;r++)this.writeUint16(0)},o.prototype.writeString=function(e,t,i){var r=0;if(null==t||"ASCII"==t)if(null!=i){var a=Math.min(e.length,i);for(r=0;r<a;r++)this.writeUint8(e.charCodeAt(r));for(;r<i;r++)this.writeUint8(0)}else for(r=0;r<e.length;r++)this.writeUint8(e.charCodeAt(r));else this.writeUint8Array(new TextEncoder(t).encode(e.substring(0,i)))},o.prototype.writeCString=function(e,t){var i=0;if(null!=t){var r=Math.min(e.length,t);for(i=0;i<r;i++)this.writeUint8(e.charCodeAt(i));for(;i<t;i++)this.writeUint8(0)}else{for(i=0;i<e.length;i++)this.writeUint8(e.charCodeAt(i));this.writeUint8(0)}},o.prototype.writeStruct=function(e,t){for(var i=0;i<e.length;i+=2){var r=e[i+1];this.writeType(r,t[e[i]],t)}},o.prototype.writeType=function(e,t,i){var r;if("function"==typeof e)return e(this,t);if("object"==Object(E["a"])(e)&&!(e instanceof Array))return e.set(this,t,i);var a=null,n="ASCII",s=this.position;switch("string"==typeof e&&/:/.test(e)&&(r=e.split(":"),e=r[0],a=parseInt(r[1])),"string"==typeof e&&/,/.test(e)&&(r=e.split(","),e=r[0],n=parseInt(r[1])),e){case"uint8":this.writeUint8(t);break;case"int8":this.writeInt8(t);break;case"uint16":this.writeUint16(t,this.endianness);break;case"int16":this.writeInt16(t,this.endianness);break;case"uint32":this.writeUint32(t,this.endianness);break;case"int32":this.writeInt32(t,this.endianness);break;case"float32":this.writeFloat32(t,this.endianness);break;case"float64":this.writeFloat64(t,this.endianness);break;case"uint16be":this.writeUint16(t,o.BIG_ENDIAN);break;case"int16be":this.writeInt16(t,o.BIG_ENDIAN);break;case"uint32be":this.writeUint32(t,o.BIG_ENDIAN);break;case"int32be":this.writeInt32(t,o.BIG_ENDIAN);break;case"float32be":this.writeFloat32(t,o.BIG_ENDIAN);break;case"float64be":this.writeFloat64(t,o.BIG_ENDIAN);break;case"uint16le":this.writeUint16(t,o.LITTLE_ENDIAN);break;case"int16le":this.writeInt16(t,o.LITTLE_ENDIAN);break;case"uint32le":this.writeUint32(t,o.LITTLE_ENDIAN);break;case"int32le":this.writeInt32(t,o.LITTLE_ENDIAN);break;case"float32le":this.writeFloat32(t,o.LITTLE_ENDIAN);break;case"float64le":this.writeFloat64(t,o.LITTLE_ENDIAN);break;case"cstring":this.writeCString(t,a);break;case"string":this.writeString(t,n,a);break;case"u16string":this.writeUCS2String(t,this.endianness,a);break;case"u16stringle":this.writeUCS2String(t,o.LITTLE_ENDIAN,a);break;case"u16stringbe":this.writeUCS2String(t,o.BIG_ENDIAN,a);break;default:if(3==e.length){for(var c=e[1],l=0;l<t.length;l++)this.writeType(c,t[l]);break}this.writeStruct(e,t)}null!=a&&(this.position=s,this._realloc(a),this.position=s+a)},o.prototype.writeUint64=function(e){var t=Math.floor(e/c);this.writeUint32(t),this.writeUint32(4294967295&e)},o.prototype.writeUint24=function(e){this.writeUint8((16711680&e)>>16),this.writeUint8((65280&e)>>8),this.writeUint8(255&e)},o.prototype.adjustUint32=function(e,t){var i=this.position;this.seek(e),this.writeUint32(t),this.seek(i)},o.prototype.mapInt32Array=function(e,t){this._realloc(4*e);var i=new Int32Array(this._buffer,this.byteOffset+this.position,e);return o.arrayToNative(i,null!==t&&void 0!==t?t:this.endianness),this.position+=4*e,i},o.prototype.mapInt16Array=function(e,t){this._realloc(2*e);var i=new Int16Array(this._buffer,this.byteOffset+this.position,e);return o.arrayToNative(i,null!==t&&void 0!==t?t:this.endianness),this.position+=2*e,i},o.prototype.mapInt8Array=function(e){this._realloc(1*e);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);return this.position+=1*e,t},o.prototype.mapUint32Array=function(e,t){this._realloc(4*e);var i=new Uint32Array(this._buffer,this.byteOffset+this.position,e);return o.arrayToNative(i,null!==t&&void 0!==t?t:this.endianness),this.position+=4*e,i},o.prototype.mapUint16Array=function(e,t){this._realloc(2*e);var i=new Uint16Array(this._buffer,this.byteOffset+this.position,e);return o.arrayToNative(i,null!==t&&void 0!==t?t:this.endianness),this.position+=2*e,i},o.prototype.mapFloat64Array=function(e,t){this._realloc(8*e);var i=new Float64Array(this._buffer,this.byteOffset+this.position,e);return o.arrayToNative(i,null!==t&&void 0!==t?t:this.endianness),this.position+=8*e,i},o.prototype.mapFloat32Array=function(e,t){this._realloc(4*e);var i=new Float32Array(this._buffer,this.byteOffset+this.position,e);return o.arrayToNative(i,null!==t&&void 0!==t?t:this.endianness),this.position+=4*e,i};var l=function(e){this.buffers=[],this.bufferIndex=-1,e&&(this.insertBuffer(e),this.bufferIndex=0)};(l.prototype=new o(new ArrayBuffer,0,o.BIG_ENDIAN)).initialized=function(){var e;return this.bufferIndex>-1||(this.buffers.length>0?0===(e=this.buffers[0]).fileStart?(this.buffer=e,this.bufferIndex=0,n.debug("MultiBufferStream","Stream ready for parsing"),!0):(n.warn("MultiBufferStream","The first buffer should have a fileStart of 0"),this.logBufferLevel(),!1):(n.warn("MultiBufferStream","No buffer to start parsing from"),this.logBufferLevel(),!1))},ArrayBuffer.concat=function(e,t){n.debug("ArrayBuffer","Trying to create a new buffer of size: "+(e.byteLength+t.byteLength));var i=new Uint8Array(e.byteLength+t.byteLength);return i.set(new Uint8Array(e),0),i.set(new Uint8Array(t),e.byteLength),i.buffer},l.prototype.reduceBuffer=function(e,t,i){var r;return(r=new Uint8Array(i)).set(new Uint8Array(e,t,i)),r.buffer.fileStart=e.fileStart+t,r.buffer.usedBytes=0,r.buffer},l.prototype.insertBuffer=function(e){for(var t=!0,i=0;i<this.buffers.length;i++){var r=this.buffers[i];if(e.fileStart<=r.fileStart){if(e.fileStart===r.fileStart){if(e.byteLength>r.byteLength){this.buffers.splice(i,1),i--;continue}n.warn("MultiBufferStream","Buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+") already appended, ignoring")}else e.fileStart+e.byteLength<=r.fileStart||(e=this.reduceBuffer(e,0,r.fileStart-e.fileStart)),n.debug("MultiBufferStream","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")"),this.buffers.splice(i,0,e),0===i&&(this.buffer=e);t=!1;break}if(e.fileStart<r.fileStart+r.byteLength){var a=r.fileStart+r.byteLength-e.fileStart,s=e.byteLength-a;if(!(s>0)){t=!1;break}e=this.reduceBuffer(e,a,s)}}t&&(n.debug("MultiBufferStream","Appending new buffer (fileStart: "+e.fileStart+" - Length: "+e.byteLength+")"),this.buffers.push(e),0===i&&(this.buffer=e))},l.prototype.logBufferLevel=function(e){var t,i,r,a,s,o=[],c="";for(r=0,a=0,t=0;t<this.buffers.length;t++)i=this.buffers[t],0===t?(s={},o.push(s),s.start=i.fileStart,s.end=i.fileStart+i.byteLength,c+="["+s.start+"-"):s.end===i.fileStart?s.end=i.fileStart+i.byteLength:((s={}).start=i.fileStart,c+=o[o.length-1].end-1+"], ["+s.start+"-",s.end=i.fileStart+i.byteLength,o.push(s)),r+=i.usedBytes,a+=i.byteLength;o.length>0&&(c+=s.end-1+"]");var l=e?n.info:n.debug;0===this.buffers.length?l("MultiBufferStream","No more buffer in memory"):l("MultiBufferStream",this.buffers.length+" stored buffer(s) ("+r+"/"+a+" bytes), continuous ranges: "+c)},l.prototype.cleanBuffers=function(){var e,t;for(e=0;e<this.buffers.length;e++)(t=this.buffers[e]).usedBytes===t.byteLength&&(n.debug("MultiBufferStream","Removing buffer #"+e),this.buffers.splice(e,1),e--)},l.prototype.mergeNextBuffer=function(){var e;if(this.bufferIndex+1<this.buffers.length){if((e=this.buffers[this.bufferIndex+1]).fileStart===this.buffer.fileStart+this.buffer.byteLength){var t=this.buffer.byteLength,i=this.buffer.usedBytes,r=this.buffer.fileStart;return this.buffers[this.bufferIndex]=ArrayBuffer.concat(this.buffer,e),this.buffer=this.buffers[this.bufferIndex],this.buffers.splice(this.bufferIndex+1,1),this.buffer.usedBytes=i,this.buffer.fileStart=r,n.debug("ISOFile","Concatenating buffer for box parsing (length: "+t+"->"+this.buffer.byteLength+")"),!0}return!1}return!1},l.prototype.findPosition=function(e,t,i){var r,a=null,s=-1;for(r=!0===e?0:this.bufferIndex;r<this.buffers.length&&(a=this.buffers[r]).fileStart<=t;)s=r,i&&(a.fileStart+a.byteLength<=t?a.usedBytes=a.byteLength:a.usedBytes=t-a.fileStart,this.logBufferLevel()),r++;return-1!==s&&(a=this.buffers[s]).fileStart+a.byteLength>=t?(n.debug("MultiBufferStream","Found position in existing buffer #"+s),s):-1},l.prototype.findEndContiguousBuf=function(e){var t,i,r,a=void 0!==e?e:this.bufferIndex;if(i=this.buffers[a],this.buffers.length>a+1)for(t=a+1;t<this.buffers.length&&(r=this.buffers[t]).fileStart===i.fileStart+i.byteLength;t++)i=r;return i.fileStart+i.byteLength},l.prototype.getEndFilePositionAfter=function(e){var t=this.findPosition(!0,e,!1);return-1!==t?this.findEndContiguousBuf(t):e},l.prototype.addUsedBytes=function(e){this.buffer.usedBytes+=e,this.logBufferLevel()},l.prototype.setAllUsedBytes=function(){this.buffer.usedBytes=this.buffer.byteLength,this.logBufferLevel()},l.prototype.seek=function(e,t,i){var r;return-1!==(r=this.findPosition(t,e,i))?(this.buffer=this.buffers[r],this.bufferIndex=r,this.position=e-this.buffer.fileStart,n.debug("MultiBufferStream","Repositioning parser at buffer position: "+this.position),!0):(n.debug("MultiBufferStream","Position "+e+" not found in buffered data"),!1)},l.prototype.getPosition=function(){if(-1===this.bufferIndex||null===this.buffers[this.bufferIndex])throw"Error accessing position in the MultiBufferStream";return this.buffers[this.bufferIndex].fileStart+this.position},l.prototype.getLength=function(){return this.byteLength},l.prototype.getEndPosition=function(){if(-1===this.bufferIndex||null===this.buffers[this.bufferIndex])throw"Error accessing position in the MultiBufferStream";return this.buffers[this.bufferIndex].fileStart+this.byteLength},t.MultiBufferStream=l;var u=function(){var e=[];e[3]="ES_Descriptor",e[4]="DecoderConfigDescriptor",e[5]="DecoderSpecificInfo",e[6]="SLConfigDescriptor",this.getDescriptorName=function(t){return e[t]};var t=this,i={};return this.parseOneDescriptor=function(t){var r,a,s,o=0;for(r=t.readUint8(),s=t.readUint8();128&s;)o=(127&s)<<7,s=t.readUint8();return o+=127&s,n.debug("MPEG4DescriptorParser","Found "+(e[r]||"Descriptor "+r)+", size "+o+" at position "+t.getPosition()),(a=e[r]?new i[e[r]](o):new i.Descriptor(o)).parse(t),a},i.Descriptor=function(e,t){this.tag=e,this.size=t,this.descs=[]},i.Descriptor.prototype.parse=function(e){this.data=e.readUint8Array(this.size)},i.Descriptor.prototype.findDescriptor=function(e){for(var t=0;t<this.descs.length;t++)if(this.descs[t].tag==e)return this.descs[t];return null},i.Descriptor.prototype.parseRemainingDescriptors=function(e){for(var i=e.position;e.position<i+this.size;){var r=t.parseOneDescriptor(e);this.descs.push(r)}},i.ES_Descriptor=function(e){i.Descriptor.call(this,3,e)},i.ES_Descriptor.prototype=new i.Descriptor,i.ES_Descriptor.prototype.parse=function(e){if(this.ES_ID=e.readUint16(),this.flags=e.readUint8(),this.size-=3,128&this.flags?(this.dependsOn_ES_ID=e.readUint16(),this.size-=2):this.dependsOn_ES_ID=0,64&this.flags){var t=e.readUint8();this.URL=e.readString(t),this.size-=t+1}else this.URL="";32&this.flags?(this.OCR_ES_ID=e.readUint16(),this.size-=2):this.OCR_ES_ID=0,this.parseRemainingDescriptors(e)},i.ES_Descriptor.prototype.getOTI=function(e){var t=this.findDescriptor(4);return t?t.oti:0},i.ES_Descriptor.prototype.getAudioConfig=function(e){var t=this.findDescriptor(4);if(!t)return null;var i=t.findDescriptor(5);if(i&&i.data){var r=(248&i.data[0])>>3;return 31===r&&i.data.length>=2&&(r=32+((7&i.data[0])<<3)+((224&i.data[1])>>5)),r}return null},i.DecoderConfigDescriptor=function(e){i.Descriptor.call(this,4,e)},i.DecoderConfigDescriptor.prototype=new i.Descriptor,i.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8(),this.streamType=e.readUint8(),this.bufferSize=e.readUint24(),this.maxBitrate=e.readUint32(),this.avgBitrate=e.readUint32(),this.size-=13,this.parseRemainingDescriptors(e)},i.DecoderSpecificInfo=function(e){i.Descriptor.call(this,5,e)},i.DecoderSpecificInfo.prototype=new i.Descriptor,i.SLConfigDescriptor=function(e){i.Descriptor.call(this,6,e)},i.SLConfigDescriptor.prototype=new i.Descriptor,this};t.MPEG4DescriptorParser=u;var d={ERR_INVALID_DATA:-1,ERR_NOT_ENOUGH_DATA:0,OK:1,BASIC_BOXES:["mdat","idat","free","skip","meco","strk"],FULL_BOXES:["hmhd","nmhd","iods","xml ","bxml","ipro","mere"],CONTAINER_BOXES:[["moov",["trak","pssh"]],["trak"],["edts"],["mdia"],["minf"],["dinf"],["stbl",["sgpd","sbgp"]],["mvex",["trex"]],["moof",["traf"]],["traf",["trun","sgpd","sbgp"]],["vttc"],["tref"],["iref"],["mfra",["tfra"]],["meco"],["hnti"],["hinf"],["strk"],["strd"],["sinf"],["rinf"],["schi"],["trgr"],["udta",["kind"]],["iprp",["ipma"]],["ipco"]],boxCodes:[],fullBoxCodes:[],containerBoxCodes:[],sampleEntryCodes:{},sampleGroupEntryCodes:[],trackGroupTypes:[],UUIDBoxes:{},UUIDs:[],initialize:function(){d.FullBox.prototype=new d.Box,d.ContainerBox.prototype=new d.Box,d.SampleEntry.prototype=new d.Box,d.TrackGroupTypeBox.prototype=new d.FullBox,d.BASIC_BOXES.forEach((function(e){d.createBoxCtor(e)})),d.FULL_BOXES.forEach((function(e){d.createFullBoxCtor(e)})),d.CONTAINER_BOXES.forEach((function(e){d.createContainerBoxCtor(e[0],null,e[1])}))},Box:function(e,t,i){this.type=e,this.size=t,this.uuid=i},FullBox:function(e,t,i){d.Box.call(this,e,t,i),this.flags=0,this.version=0},ContainerBox:function(e,t,i){d.Box.call(this,e,t,i),this.boxes=[]},SampleEntry:function(e,t,i,r){d.ContainerBox.call(this,e,t),this.hdr_size=i,this.start=r},SampleGroupEntry:function(e){this.grouping_type=e},TrackGroupTypeBox:function(e,t){d.FullBox.call(this,e,t)},createBoxCtor:function(e,t){d.boxCodes.push(e),d[e+"Box"]=function(t){d.Box.call(this,e,t)},d[e+"Box"].prototype=new d.Box,t&&(d[e+"Box"].prototype.parse=t)},createFullBoxCtor:function(e,t){d[e+"Box"]=function(t){d.FullBox.call(this,e,t)},d[e+"Box"].prototype=new d.FullBox,d[e+"Box"].prototype.parse=function(e){this.parseFullHeader(e),t&&t.call(this,e)}},addSubBoxArrays:function(e){if(e){this.subBoxNames=e;for(var t=e.length,i=0;i<t;i++)this[e[i]+"s"]=[]}},createContainerBoxCtor:function(e,t,i){d[e+"Box"]=function(t){d.ContainerBox.call(this,e,t),d.addSubBoxArrays.call(this,i)},d[e+"Box"].prototype=new d.ContainerBox,t&&(d[e+"Box"].prototype.parse=t)},createMediaSampleEntryCtor:function(e,t,i){d.sampleEntryCodes[e]=[],d[e+"SampleEntry"]=function(e,t){d.SampleEntry.call(this,e,t),d.addSubBoxArrays.call(this,i)},d[e+"SampleEntry"].prototype=new d.SampleEntry,t&&(d[e+"SampleEntry"].prototype.parse=t)},createSampleEntryCtor:function(e,t,i,r){d.sampleEntryCodes[e].push(t),d[t+"SampleEntry"]=function(i){d[e+"SampleEntry"].call(this,t,i),d.addSubBoxArrays.call(this,r)},d[t+"SampleEntry"].prototype=new d[e+"SampleEntry"],i&&(d[t+"SampleEntry"].prototype.parse=i)},createEncryptedSampleEntryCtor:function(e,t,i){d.createSampleEntryCtor.call(this,e,t,i,["sinf"])},createSampleGroupCtor:function(e,t){d[e+"SampleGroupEntry"]=function(t){d.SampleGroupEntry.call(this,e,t)},d[e+"SampleGroupEntry"].prototype=new d.SampleGroupEntry,t&&(d[e+"SampleGroupEntry"].prototype.parse=t)},createTrackGroupCtor:function(e,t){d[e+"TrackGroupTypeBox"]=function(t){d.TrackGroupTypeBox.call(this,e,t)},d[e+"TrackGroupTypeBox"].prototype=new d.TrackGroupTypeBox,t&&(d[e+"TrackGroupTypeBox"].prototype.parse=t)},createUUIDBox:function(e,t,i,r){d.UUIDs.push(e),d.UUIDBoxes[e]=function(r){t?d.FullBox.call(this,"uuid",r,e):i?d.ContainerBox.call(this,"uuid",r,e):d.Box.call(this,"uuid",r,e)},d.UUIDBoxes[e].prototype=t?new d.FullBox:i?new d.ContainerBox:new d.Box,r&&(d.UUIDBoxes[e].prototype.parse=t?function(e){this.parseFullHeader(e),r&&r.call(this,e)}:r)}};d.initialize(),d.TKHD_FLAG_ENABLED=1,d.TKHD_FLAG_IN_MOVIE=2,d.TKHD_FLAG_IN_PREVIEW=4,d.TFHD_FLAG_BASE_DATA_OFFSET=1,d.TFHD_FLAG_SAMPLE_DESC=2,d.TFHD_FLAG_SAMPLE_DUR=8,d.TFHD_FLAG_SAMPLE_SIZE=16,d.TFHD_FLAG_SAMPLE_FLAGS=32,d.TFHD_FLAG_DUR_EMPTY=65536,d.TFHD_FLAG_DEFAULT_BASE_IS_MOOF=131072,d.TRUN_FLAGS_DATA_OFFSET=1,d.TRUN_FLAGS_FIRST_FLAG=4,d.TRUN_FLAGS_DURATION=256,d.TRUN_FLAGS_SIZE=512,d.TRUN_FLAGS_FLAGS=1024,d.TRUN_FLAGS_CTS_OFFSET=2048,d.Box.prototype.add=function(e){return this.addBox(new d[e+"Box"])},d.Box.prototype.addBox=function(e){return this.boxes.push(e),this[e.type+"s"]?this[e.type+"s"].push(e):this[e.type]=e,e},d.Box.prototype.set=function(e,t){return this[e]=t,this},d.Box.prototype.addEntry=function(e,t){var i=t||"entries";return this[i]||(this[i]=[]),this[i].push(e),this},t.BoxParser=d,d.parseUUID=function(e){return d.parseHex16(e)},d.parseHex16=function(e){for(var t="",i=0;i<16;i++){var r=e.readUint8().toString(16);t+=1===r.length?"0"+r:r}return t},d.parseOneBox=function(e,t,i){var r,a,s,o=e.getPosition(),c=0;if(e.getEndPosition()-o<8)return n.debug("BoxParser","Not enough data in stream to parse the type and size of the box"),{code:d.ERR_NOT_ENOUGH_DATA};if(i&&i<8)return n.debug("BoxParser","Not enough bytes left in the parent box to parse a new box"),{code:d.ERR_NOT_ENOUGH_DATA};var l=e.readUint32(),u=e.readString(4),h=u;if(n.debug("BoxParser","Found box of type '"+u+"' and size "+l+" at position "+o),c=8,"uuid"==u){if(e.getEndPosition()-e.getPosition()<16||i-c<16)return e.seek(o),n.debug("BoxParser","Not enough bytes left in the parent box to parse a UUID box"),{code:d.ERR_NOT_ENOUGH_DATA};c+=16,h=s=d.parseUUID(e)}if(1==l){if(e.getEndPosition()-e.getPosition()<8||i&&i-c<8)return e.seek(o),n.warn("BoxParser",'Not enough data in stream to parse the extended size of the "'+u+'" box'),{code:d.ERR_NOT_ENOUGH_DATA};l=e.readUint64(),c+=8}else if(0===l)if(i)l=i;else if("mdat"!==u)return n.error("BoxParser","Unlimited box size not supported for type: '"+u+"'"),r=new d.Box(u,l),{code:d.OK,box:r,size:r.size};return 0!==l&&l<c?(n.error("BoxParser","Box of type "+u+" has an invalid size "+l+" (too small to be a box)"),{code:d.ERR_NOT_ENOUGH_DATA,type:u,size:l,hdr_size:c,start:o}):0!==l&&i&&l>i?(n.error("BoxParser","Box of type '"+u+"' has a size "+l+" greater than its container size "+i),{code:d.ERR_NOT_ENOUGH_DATA,type:u,size:l,hdr_size:c,start:o}):0!==l&&o+l>e.getEndPosition()?(e.seek(o),n.info("BoxParser","Not enough data in stream to parse the entire '"+u+"' box"),{code:d.ERR_NOT_ENOUGH_DATA,type:u,size:l,hdr_size:c,start:o}):t?{code:d.OK,type:u,size:l,hdr_size:c,start:o}:(d[u+"Box"]?r=new d[u+"Box"](l):"uuid"!==u?(n.warn("BoxParser","Unknown box type: '"+u+"'"),(r=new d.Box(u,l)).has_unparsed_data=!0):d.UUIDBoxes[s]?r=new d.UUIDBoxes[s](l):(n.warn("BoxParser","Unknown uuid type: '"+s+"'"),(r=new d.Box(u,l)).uuid=s,r.has_unparsed_data=!0),r.hdr_size=c,r.start=o,r.write===d.Box.prototype.write&&"mdat"!==r.type&&(n.info("BoxParser","'"+h+"' box writing not yet implemented, keeping unparsed data in memory for later write"),r.parseDataAndRewind(e)),r.parse(e),(a=e.getPosition()-(r.start+r.size))<0?(n.warn("BoxParser","Parsing of box '"+h+"' did not read the entire indicated box data size (missing "+-a+" bytes), seeking forward"),e.seek(r.start+r.size)):a>0&&(n.error("BoxParser","Parsing of box '"+h+"' read "+a+" more bytes than the indicated box data size, seeking backwards"),0!==r.size&&e.seek(r.start+r.size)),{code:d.OK,box:r,size:r.size})},d.Box.prototype.parse=function(e){"mdat"!=this.type?this.data=e.readUint8Array(this.size-this.hdr_size):0===this.size?e.seek(e.getEndPosition()):e.seek(this.start+this.size)},d.Box.prototype.parseDataAndRewind=function(e){this.data=e.readUint8Array(this.size-this.hdr_size),e.position-=this.size-this.hdr_size},d.FullBox.prototype.parseDataAndRewind=function(e){this.parseFullHeader(e),this.data=e.readUint8Array(this.size-this.hdr_size),this.hdr_size-=4,e.position-=this.size-this.hdr_size},d.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8(),this.flags=e.readUint24(),this.hdr_size+=4},d.FullBox.prototype.parse=function(e){this.parseFullHeader(e),this.data=e.readUint8Array(this.size-this.hdr_size)},d.ContainerBox.prototype.parse=function(e){for(var t,i;e.getPosition()<this.start+this.size;){if((t=d.parseOneBox(e,!1,this.size-(e.getPosition()-this.start))).code!==d.OK)return;if(i=t.box,this.boxes.push(i),this.subBoxNames&&-1!=this.subBoxNames.indexOf(i.type))this[this.subBoxNames[this.subBoxNames.indexOf(i.type)]+"s"].push(i);else{var r="uuid"!==i.type?i.type:i.uuid;this[r]?n.warn("Box of type "+r+" already stored in field of this type"):this[r]=i}}},d.Box.prototype.parseLanguage=function(e){this.language=e.readUint16();var t=[];t[0]=this.language>>10&31,t[1]=this.language>>5&31,t[2]=31&this.language,this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96)},d.SAMPLE_ENTRY_TYPE_VISUAL="Visual",d.SAMPLE_ENTRY_TYPE_AUDIO="Audio",d.SAMPLE_ENTRY_TYPE_HINT="Hint",d.SAMPLE_ENTRY_TYPE_METADATA="Metadata",d.SAMPLE_ENTRY_TYPE_SUBTITLE="Subtitle",d.SAMPLE_ENTRY_TYPE_SYSTEM="System",d.SAMPLE_ENTRY_TYPE_TEXT="Text",d.SampleEntry.prototype.parseHeader=function(e){e.readUint8Array(6),this.data_reference_index=e.readUint16(),this.hdr_size+=8},d.SampleEntry.prototype.parse=function(e){this.parseHeader(e),this.data=e.readUint8Array(this.size-this.hdr_size)},d.SampleEntry.prototype.parseDataAndRewind=function(e){this.parseHeader(e),this.data=e.readUint8Array(this.size-this.hdr_size),this.hdr_size-=8,e.position-=this.size-this.hdr_size},d.SampleEntry.prototype.parseFooter=function(e){d.ContainerBox.prototype.parse.call(this,e)},d.createMediaSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_HINT),d.createMediaSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_METADATA),d.createMediaSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_SUBTITLE),d.createMediaSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_SYSTEM),d.createMediaSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_TEXT),d.createMediaSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_VISUAL,(function(e){var t;this.parseHeader(e),e.readUint16(),e.readUint16(),e.readUint32Array(3),this.width=e.readUint16(),this.height=e.readUint16(),this.horizresolution=e.readUint32(),this.vertresolution=e.readUint32(),e.readUint32(),this.frame_count=e.readUint16(),t=Math.min(31,e.readUint8()),this.compressorname=e.readString(t),t<31&&e.readString(31-t),this.depth=e.readUint16(),e.readUint16(),this.parseFooter(e)})),d.createMediaSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_AUDIO,(function(e){this.parseHeader(e),e.readUint32Array(2),this.channel_count=e.readUint16(),this.samplesize=e.readUint16(),e.readUint16(),e.readUint16(),this.samplerate=e.readUint32()/65536,this.parseFooter(e)})),d.createSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_VISUAL,"avc1"),d.createSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_VISUAL,"avc2"),d.createSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_VISUAL,"avc3"),d.createSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_VISUAL,"avc4"),d.createSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_VISUAL,"av01"),d.createSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_VISUAL,"hvc1"),d.createSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_VISUAL,"hev1"),d.createSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_VISUAL,"vvc1"),d.createSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_VISUAL,"vvi1"),d.createSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_VISUAL,"vvs1"),d.createSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_VISUAL,"vvcN"),d.createSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_VISUAL,"vp08"),d.createSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_VISUAL,"vp09"),d.createSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_AUDIO,"mp4a"),d.createSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_AUDIO,"ac-3"),d.createSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_AUDIO,"ec-3"),d.createSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_AUDIO,"Opus"),d.createEncryptedSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_VISUAL,"encv"),d.createEncryptedSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_AUDIO,"enca"),d.createEncryptedSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_SUBTITLE,"encu"),d.createEncryptedSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_SYSTEM,"encs"),d.createEncryptedSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_TEXT,"enct"),d.createEncryptedSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_METADATA,"encm"),d.createBoxCtor("a1lx",(function(e){var t=16*(1+(1&e.readUint8()));this.layer_size=[];for(var i=0;i<3;i++)this.layer_size[i]=16==t?e.readUint16():e.readUint32()})),d.createBoxCtor("a1op",(function(e){this.op_index=e.readUint8()})),d.createFullBoxCtor("auxC",(function(e){this.aux_type=e.readCString();var t=this.size-this.hdr_size-(this.aux_type.length+1);this.aux_subtype=e.readUint8Array(t)})),d.createBoxCtor("av1C",(function(e){var t=e.readUint8();if(t>>7&!1)n.error("av1C marker problem");else if(this.version=127&t,1===this.version)if(t=e.readUint8(),this.seq_profile=t>>5&7,this.seq_level_idx_0=31&t,t=e.readUint8(),this.seq_tier_0=t>>7&1,this.high_bitdepth=t>>6&1,this.twelve_bit=t>>5&1,this.monochrome=t>>4&1,this.chroma_subsampling_x=t>>3&1,this.chroma_subsampling_y=t>>2&1,this.chroma_sample_position=3&t,t=e.readUint8(),this.reserved_1=t>>5&7,0===this.reserved_1){if(this.initial_presentation_delay_present=t>>4&1,1===this.initial_presentation_delay_present)this.initial_presentation_delay_minus_one=15&t;else if(this.reserved_2=15&t,0!==this.reserved_2)return void n.error("av1C reserved_2 parsing problem");var i=this.size-this.hdr_size-4;this.configOBUs=e.readUint8Array(i)}else n.error("av1C reserved_1 parsing problem");else n.error("av1C version "+this.version+" not supported")})),d.createBoxCtor("avcC",(function(e){var t,i;for(this.configurationVersion=e.readUint8(),this.AVCProfileIndication=e.readUint8(),this.profile_compatibility=e.readUint8(),this.AVCLevelIndication=e.readUint8(),this.lengthSizeMinusOne=3&e.readUint8(),this.nb_SPS_nalus=31&e.readUint8(),i=this.size-this.hdr_size-6,this.SPS=[],t=0;t<this.nb_SPS_nalus;t++)this.SPS[t]={},this.SPS[t].length=e.readUint16(),this.SPS[t].nalu=e.readUint8Array(this.SPS[t].length),i-=2+this.SPS[t].length;for(this.nb_PPS_nalus=e.readUint8(),i--,this.PPS=[],t=0;t<this.nb_PPS_nalus;t++)this.PPS[t]={},this.PPS[t].length=e.readUint16(),this.PPS[t].nalu=e.readUint8Array(this.PPS[t].length),i-=2+this.PPS[t].length;i>0&&(this.ext=e.readUint8Array(i))})),d.createBoxCtor("btrt",(function(e){this.bufferSizeDB=e.readUint32(),this.maxBitrate=e.readUint32(),this.avgBitrate=e.readUint32()})),d.createBoxCtor("clap",(function(e){this.cleanApertureWidthN=e.readUint32(),this.cleanApertureWidthD=e.readUint32(),this.cleanApertureHeightN=e.readUint32(),this.cleanApertureHeightD=e.readUint32(),this.horizOffN=e.readUint32(),this.horizOffD=e.readUint32(),this.vertOffN=e.readUint32(),this.vertOffD=e.readUint32()})),d.createBoxCtor("clli",(function(e){this.max_content_light_level=e.readUint16(),this.max_pic_average_light_level=e.readUint16()})),d.createFullBoxCtor("co64",(function(e){var t,i;if(t=e.readUint32(),this.chunk_offsets=[],0===this.version)for(i=0;i<t;i++)this.chunk_offsets.push(e.readUint64())})),d.createFullBoxCtor("CoLL",(function(e){this.maxCLL=e.readUint16(),this.maxFALL=e.readUint16()})),d.createBoxCtor("colr",(function(e){if(this.colour_type=e.readString(4),"nclx"===this.colour_type){this.colour_primaries=e.readUint16(),this.transfer_characteristics=e.readUint16(),this.matrix_coefficients=e.readUint16();var t=e.readUint8();this.full_range_flag=t>>7}else("rICC"===this.colour_type||"prof"===this.colour_type)&&(this.ICC_profile=e.readUint8Array(this.size-4))})),d.createFullBoxCtor("cprt",(function(e){this.parseLanguage(e),this.notice=e.readCString()})),d.createFullBoxCtor("cslg",(function(e){0===this.version&&(this.compositionToDTSShift=e.readInt32(),this.leastDecodeToDisplayDelta=e.readInt32(),this.greatestDecodeToDisplayDelta=e.readInt32(),this.compositionStartTime=e.readInt32(),this.compositionEndTime=e.readInt32())})),d.createFullBoxCtor("ctts",(function(e){var t,i;if(t=e.readUint32(),this.sample_counts=[],this.sample_offsets=[],0===this.version)for(i=0;i<t;i++){this.sample_counts.push(e.readUint32());var r=e.readInt32();r<0&&n.warn("BoxParser","ctts box uses negative values without using version 1"),this.sample_offsets.push(r)}else if(1==this.version)for(i=0;i<t;i++)this.sample_counts.push(e.readUint32()),this.sample_offsets.push(e.readInt32())})),d.createBoxCtor("dac3",(function(e){var t=e.readUint8(),i=e.readUint8(),r=e.readUint8();this.fscod=t>>6,this.bsid=t>>1&31,this.bsmod=(1&t)<<2|i>>6&3,this.acmod=i>>3&7,this.lfeon=i>>2&1,this.bit_rate_code=3&i|r>>5&7})),d.createBoxCtor("dec3",(function(e){var t=e.readUint16();this.data_rate=t>>3,this.num_ind_sub=7&t,this.ind_subs=[];for(var i=0;i<this.num_ind_sub+1;i++){var r={};this.ind_subs.push(r);var a=e.readUint8(),n=e.readUint8(),s=e.readUint8();r.fscod=a>>6,r.bsid=a>>1&31,r.bsmod=(1&a)<<4|n>>4&15,r.acmod=n>>1&7,r.lfeon=1&n,r.num_dep_sub=s>>1&15,r.num_dep_sub>0&&(r.chan_loc=(1&s)<<8|e.readUint8())}})),d.createFullBoxCtor("dfLa",(function(e){var t=[],i=["STREAMINFO","PADDING","APPLICATION","SEEKTABLE","VORBIS_COMMENT","CUESHEET","PICTURE","RESERVED"];for(this.parseFullHeader(e);;){var r=e.readUint8(),a=Math.min(127&r,i.length-1);if(a?e.readUint8Array(e.readUint24()):(e.readUint8Array(13),this.samplerate=e.readUint32()>>12,e.readUint8Array(20)),t.push(i[a]),128&r)break}this.numMetadataBlocks=t.length+" ("+t.join(", ")+")"})),d.createBoxCtor("dimm",(function(e){this.bytessent=e.readUint64()})),d.createBoxCtor("dmax",(function(e){this.time=e.readUint32()})),d.createBoxCtor("dmed",(function(e){this.bytessent=e.readUint64()})),d.createBoxCtor("dOps",(function(e){if(this.Version=e.readUint8(),this.OutputChannelCount=e.readUint8(),this.PreSkip=e.readUint16(),this.InputSampleRate=e.readUint32(),this.OutputGain=e.readInt16(),this.ChannelMappingFamily=e.readUint8(),0!==this.ChannelMappingFamily){this.StreamCount=e.readUint8(),this.CoupledCount=e.readUint8(),this.ChannelMapping=[];for(var t=0;t<this.OutputChannelCount;t++)this.ChannelMapping[t]=e.readUint8()}})),d.createFullBoxCtor("dref",(function(e){var t,i;this.entries=[];for(var r=e.readUint32(),a=0;a<r;a++){if((t=d.parseOneBox(e,!1,this.size-(e.getPosition()-this.start))).code!==d.OK)return;i=t.box,this.entries.push(i)}})),d.createBoxCtor("drep",(function(e){this.bytessent=e.readUint64()})),d.createFullBoxCtor("elng",(function(e){this.extended_language=e.readString(this.size-this.hdr_size)})),d.createFullBoxCtor("elst",(function(e){this.entries=[];for(var t=e.readUint32(),i=0;i<t;i++){var r={};this.entries.push(r),1===this.version?(r.segment_duration=e.readUint64(),r.media_time=e.readInt64()):(r.segment_duration=e.readUint32(),r.media_time=e.readInt32()),r.media_rate_integer=e.readInt16(),r.media_rate_fraction=e.readInt16()}})),d.createFullBoxCtor("emsg",(function(e){1==this.version?(this.timescale=e.readUint32(),this.presentation_time=e.readUint64(),this.event_duration=e.readUint32(),this.id=e.readUint32(),this.scheme_id_uri=e.readCString(),this.value=e.readCString()):(this.scheme_id_uri=e.readCString(),this.value=e.readCString(),this.timescale=e.readUint32(),this.presentation_time_delta=e.readUint32(),this.event_duration=e.readUint32(),this.id=e.readUint32());var t=this.size-this.hdr_size-(16+(this.scheme_id_uri.length+1)+(this.value.length+1));1==this.version&&(t-=4),this.message_data=e.readUint8Array(t)})),d.createFullBoxCtor("esds",(function(e){var t=e.readUint8Array(this.size-this.hdr_size),i=new u;this.esd=i.parseOneDescriptor(new o(t.buffer,0,o.BIG_ENDIAN))})),d.createBoxCtor("fiel",(function(e){this.fieldCount=e.readUint8(),this.fieldOrdering=e.readUint8()})),d.createBoxCtor("frma",(function(e){this.data_format=e.readString(4)})),d.createBoxCtor("ftyp",(function(e){var t=this.size-this.hdr_size;this.major_brand=e.readString(4),this.minor_version=e.readUint32(),t-=8,this.compatible_brands=[];for(var i=0;t>=4;)this.compatible_brands[i]=e.readString(4),t-=4,i++})),d.createFullBoxCtor("hdlr",(function(e){0===this.version&&(e.readUint32(),this.handler=e.readString(4),e.readUint32Array(3),this.name=e.readString(this.size-this.hdr_size-20),"\0"===this.name[this.name.length-1]&&(this.name=this.name.slice(0,-1)))})),d.createBoxCtor("hvcC",(function(e){var t,i,r,a;this.configurationVersion=e.readUint8(),a=e.readUint8(),this.general_profile_space=a>>6,this.general_tier_flag=(32&a)>>5,this.general_profile_idc=31&a,this.general_profile_compatibility=e.readUint32(),this.general_constraint_indicator=e.readUint8Array(6),this.general_level_idc=e.readUint8(),this.min_spatial_segmentation_idc=4095&e.readUint16(),this.parallelismType=3&e.readUint8(),this.chroma_format_idc=3&e.readUint8(),this.bit_depth_luma_minus8=7&e.readUint8(),this.bit_depth_chroma_minus8=7&e.readUint8(),this.avgFrameRate=e.readUint16(),a=e.readUint8(),this.constantFrameRate=a>>6,this.numTemporalLayers=(13&a)>>3,this.temporalIdNested=(4&a)>>2,this.lengthSizeMinusOne=3&a,this.nalu_arrays=[];var n=e.readUint8();for(t=0;t<n;t++){var s=[];this.nalu_arrays.push(s),a=e.readUint8(),s.completeness=(128&a)>>7,s.nalu_type=63&a;var o=e.readUint16();for(i=0;i<o;i++){var c={};s.push(c),r=e.readUint16(),c.data=e.readUint8Array(r)}}})),d.createFullBoxCtor("iinf",(function(e){var t;0===this.version?this.entry_count=e.readUint16():this.entry_count=e.readUint32(),this.item_infos=[];for(var i=0;i<this.entry_count;i++){if((t=d.parseOneBox(e,!1,this.size-(e.getPosition()-this.start))).code!==d.OK)return;"infe"!==t.box.type&&n.error("BoxParser","Expected 'infe' box, got "+t.box.type),this.item_infos[i]=t.box}})),d.createFullBoxCtor("iloc",(function(e){var t;t=e.readUint8(),this.offset_size=t>>4&15,this.length_size=15&t,t=e.readUint8(),this.base_offset_size=t>>4&15,1===this.version||2===this.version?this.index_size=15&t:this.index_size=0,this.items=[];var i=0;if(this.version<2)i=e.readUint16();else{if(2!==this.version)throw"version of iloc box not supported";i=e.readUint32()}for(var r=0;r<i;r++){var a={};if(this.items.push(a),this.version<2)a.item_ID=e.readUint16();else{if(2!==this.version)throw"version of iloc box not supported";a.item_ID=e.readUint16()}switch(1===this.version||2===this.version?a.construction_method=15&e.readUint16():a.construction_method=0,a.data_reference_index=e.readUint16(),this.base_offset_size){case 0:a.base_offset=0;break;case 4:a.base_offset=e.readUint32();break;case 8:a.base_offset=e.readUint64();break;default:throw"Error reading base offset size"}var n=e.readUint16();a.extents=[];for(var s=0;s<n;s++){var o={};if(a.extents.push(o),1===this.version||2===this.version)switch(this.index_size){case 0:o.extent_index=0;break;case 4:o.extent_index=e.readUint32();break;case 8:o.extent_index=e.readUint64();break;default:throw"Error reading extent index"}switch(this.offset_size){case 0:o.extent_offset=0;break;case 4:o.extent_offset=e.readUint32();break;case 8:o.extent_offset=e.readUint64();break;default:throw"Error reading extent index"}switch(this.length_size){case 0:o.extent_length=0;break;case 4:o.extent_length=e.readUint32();break;case 8:o.extent_length=e.readUint64();break;default:throw"Error reading extent index"}}}})),d.createBoxCtor("imir",(function(e){var t=e.readUint8();this.reserved=t>>7,this.axis=1&t})),d.createFullBoxCtor("infe",(function(e){if(0!==this.version&&1!==this.version||(this.item_ID=e.readUint16(),this.item_protection_index=e.readUint16(),this.item_name=e.readCString(),this.content_type=e.readCString(),this.content_encoding=e.readCString()),1===this.version)return this.extension_type=e.readString(4),n.warn("BoxParser","Cannot parse extension type"),void e.seek(this.start+this.size);this.version>=2&&(2===this.version?this.item_ID=e.readUint16():3===this.version&&(this.item_ID=e.readUint32()),this.item_protection_index=e.readUint16(),this.item_type=e.readString(4),this.item_name=e.readCString(),"mime"===this.item_type?(this.content_type=e.readCString(),this.content_encoding=e.readCString()):"uri "===this.item_type&&(this.item_uri_type=e.readCString()))})),d.createFullBoxCtor("ipma",(function(e){var t,i;for(entry_count=e.readUint32(),this.associations=[],t=0;t<entry_count;t++){var r={};this.associations.push(r),this.version<1?r.id=e.readUint16():r.id=e.readUint32();var a=e.readUint8();for(r.props=[],i=0;i<a;i++){var n=e.readUint8(),s={};r.props.push(s),s.essential=(128&n)>>7==1,1&this.flags?s.property_index=(127&n)<<8|e.readUint8():s.property_index=127&n}}})),d.createFullBoxCtor("iref",(function(e){var t,i;for(this.references=[];e.getPosition()<this.start+this.size;){if((t=d.parseOneBox(e,!0,this.size-(e.getPosition()-this.start))).code!==d.OK)return;(i=0===this.version?new d.SingleItemTypeReferenceBox(t.type,t.size,t.hdr_size,t.start):new d.SingleItemTypeReferenceBoxLarge(t.type,t.size,t.hdr_size,t.start)).write===d.Box.prototype.write&&"mdat"!==i.type&&(n.warn("BoxParser",i.type+" box writing not yet implemented, keeping unparsed data in memory for later write"),i.parseDataAndRewind(e)),i.parse(e),this.references.push(i)}})),d.createBoxCtor("irot",(function(e){this.angle=3&e.readUint8()})),d.createFullBoxCtor("ispe",(function(e){this.image_width=e.readUint32(),this.image_height=e.readUint32()})),d.createFullBoxCtor("kind",(function(e){this.schemeURI=e.readCString(),this.value=e.readCString()})),d.createFullBoxCtor("leva",(function(e){var t=e.readUint8();this.levels=[];for(var i=0;i<t;i++){var r={};this.levels[i]=r,r.track_ID=e.readUint32();var a=e.readUint8();switch(r.padding_flag=a>>7,r.assignment_type=127&a,r.assignment_type){case 0:r.grouping_type=e.readString(4);break;case 1:r.grouping_type=e.readString(4),r.grouping_type_parameter=e.readUint32();break;case 2:case 3:break;case 4:r.sub_track_id=e.readUint32();break;default:n.warn("BoxParser","Unknown leva assignement type")}}})),d.createBoxCtor("lsel",(function(e){this.layer_id=e.readUint16()})),d.createBoxCtor("maxr",(function(e){this.period=e.readUint32(),this.bytes=e.readUint32()})),d.createBoxCtor("mdcv",(function(e){this.display_primaries=[],this.display_primaries[0]={},this.display_primaries[0].x=e.readUint16(),this.display_primaries[0].y=e.readUint16(),this.display_primaries[1]={},this.display_primaries[1].x=e.readUint16(),this.display_primaries[1].y=e.readUint16(),this.display_primaries[2]={},this.display_primaries[2].x=e.readUint16(),this.display_primaries[2].y=e.readUint16(),this.white_point={},this.white_point.x=e.readUint16(),this.white_point.y=e.readUint16(),this.max_display_mastering_luminance=e.readUint32(),this.min_display_mastering_luminance=e.readUint32()})),d.createFullBoxCtor("mdhd",(function(e){1==this.version?(this.creation_time=e.readUint64(),this.modification_time=e.readUint64(),this.timescale=e.readUint32(),this.duration=e.readUint64()):(this.creation_time=e.readUint32(),this.modification_time=e.readUint32(),this.timescale=e.readUint32(),this.duration=e.readUint32()),this.parseLanguage(e),e.readUint16()})),d.createFullBoxCtor("mehd",(function(e){1&this.flags&&(n.warn("BoxParser","mehd box incorrectly uses flags set to 1, converting version to 1"),this.version=1),1==this.version?this.fragment_duration=e.readUint64():this.fragment_duration=e.readUint32()})),d.createFullBoxCtor("meta",(function(e){this.boxes=[],d.ContainerBox.prototype.parse.call(this,e)})),d.createFullBoxCtor("mfhd",(function(e){this.sequence_number=e.readUint32()})),d.createFullBoxCtor("mfro",(function(e){this._size=e.readUint32()})),d.createFullBoxCtor("mvhd",(function(e){1==this.version?(this.creation_time=e.readUint64(),this.modification_time=e.readUint64(),this.timescale=e.readUint32(),this.duration=e.readUint64()):(this.creation_time=e.readUint32(),this.modification_time=e.readUint32(),this.timescale=e.readUint32(),this.duration=e.readUint32()),this.rate=e.readUint32(),this.volume=e.readUint16()>>8,e.readUint16(),e.readUint32Array(2),this.matrix=e.readUint32Array(9),e.readUint32Array(6),this.next_track_id=e.readUint32()})),d.createBoxCtor("npck",(function(e){this.packetssent=e.readUint32()})),d.createBoxCtor("nump",(function(e){this.packetssent=e.readUint64()})),d.createFullBoxCtor("padb",(function(e){var t=e.readUint32();this.padbits=[];for(var i=0;i<Math.floor((t+1)/2);i++)this.padbits=e.readUint8()})),d.createBoxCtor("pasp",(function(e){this.hSpacing=e.readUint32(),this.vSpacing=e.readUint32()})),d.createBoxCtor("payl",(function(e){this.text=e.readString(this.size-this.hdr_size)})),d.createBoxCtor("payt",(function(e){this.payloadID=e.readUint32();var t=e.readUint8();this.rtpmap_string=e.readString(t)})),d.createFullBoxCtor("pdin",(function(e){var t=(this.size-this.hdr_size)/8;this.rate=[],this.initial_delay=[];for(var i=0;i<t;i++)this.rate[i]=e.readUint32(),this.initial_delay[i]=e.readUint32()})),d.createFullBoxCtor("pitm",(function(e){0===this.version?this.item_id=e.readUint16():this.item_id=e.readUint32()})),d.createFullBoxCtor("pixi",(function(e){var t;for(this.num_channels=e.readUint8(),this.bits_per_channels=[],t=0;t<this.num_channels;t++)this.bits_per_channels[t]=e.readUint8()})),d.createBoxCtor("pmax",(function(e){this.bytes=e.readUint32()})),d.createFullBoxCtor("prft",(function(e){this.ref_track_id=e.readUint32(),this.ntp_timestamp=e.readUint64(),0===this.version?this.media_time=e.readUint32():this.media_time=e.readUint64()})),d.createFullBoxCtor("pssh",(function(e){if(this.system_id=d.parseHex16(e),this.version>0){var t=e.readUint32();this.kid=[];for(var i=0;i<t;i++)this.kid[i]=d.parseHex16(e)}var r=e.readUint32();r>0&&(this.data=e.readUint8Array(r))})),d.createFullBoxCtor("clef",(function(e){this.width=e.readUint32(),this.height=e.readUint32()})),d.createFullBoxCtor("enof",(function(e){this.width=e.readUint32(),this.height=e.readUint32()})),d.createFullBoxCtor("prof",(function(e){this.width=e.readUint32(),this.height=e.readUint32()})),d.createContainerBoxCtor("tapt",null,["clef","prof","enof"]),d.createBoxCtor("rtp ",(function(e){this.descriptionformat=e.readString(4),this.sdptext=e.readString(this.size-this.hdr_size-4)})),d.createFullBoxCtor("saio",(function(e){1&this.flags&&(this.aux_info_type=e.readUint32(),this.aux_info_type_parameter=e.readUint32());var t=e.readUint32();this.offset=[];for(var i=0;i<t;i++)0===this.version?this.offset[i]=e.readUint32():this.offset[i]=e.readUint64()})),d.createFullBoxCtor("saiz",(function(e){1&this.flags&&(this.aux_info_type=e.readUint32(),this.aux_info_type_parameter=e.readUint32()),this.default_sample_info_size=e.readUint8();var t=e.readUint32();if(this.sample_info_size=[],0===this.default_sample_info_size)for(var i=0;i<t;i++)this.sample_info_size[i]=e.readUint8()})),d.createSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_METADATA,"mett",(function(e){this.parseHeader(e),this.content_encoding=e.readCString(),this.mime_format=e.readCString(),this.parseFooter(e)})),d.createSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_METADATA,"metx",(function(e){this.parseHeader(e),this.content_encoding=e.readCString(),this.namespace=e.readCString(),this.schema_location=e.readCString(),this.parseFooter(e)})),d.createSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_SUBTITLE,"sbtt",(function(e){this.parseHeader(e),this.content_encoding=e.readCString(),this.mime_format=e.readCString(),this.parseFooter(e)})),d.createSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_SUBTITLE,"stpp",(function(e){this.parseHeader(e),this.namespace=e.readCString(),this.schema_location=e.readCString(),this.auxiliary_mime_types=e.readCString(),this.parseFooter(e)})),d.createSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_SUBTITLE,"stxt",(function(e){this.parseHeader(e),this.content_encoding=e.readCString(),this.mime_format=e.readCString(),this.parseFooter(e)})),d.createSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_SUBTITLE,"tx3g",(function(e){this.parseHeader(e),this.displayFlags=e.readUint32(),this.horizontal_justification=e.readInt8(),this.vertical_justification=e.readInt8(),this.bg_color_rgba=e.readUint8Array(4),this.box_record=e.readInt16Array(4),this.style_record=e.readUint8Array(12),this.parseFooter(e)})),d.createSampleEntryCtor(d.SAMPLE_ENTRY_TYPE_METADATA,"wvtt",(function(e){this.parseHeader(e),this.parseFooter(e)})),d.createSampleGroupCtor("alst",(function(e){var t,i=e.readUint16();for(this.first_output_sample=e.readUint16(),this.sample_offset=[],t=0;t<i;t++)this.sample_offset[t]=e.readUint32();var r=this.description_length-4-4*i;for(this.num_output_samples=[],this.num_total_samples=[],t=0;t<r/4;t++)this.num_output_samples[t]=e.readUint16(),this.num_total_samples[t]=e.readUint16()})),d.createSampleGroupCtor("avll",(function(e){this.layerNumber=e.readUint8(),this.accurateStatisticsFlag=e.readUint8(),this.avgBitRate=e.readUint16(),this.avgFrameRate=e.readUint16()})),d.createSampleGroupCtor("avss",(function(e){this.subSequenceIdentifier=e.readUint16(),this.layerNumber=e.readUint8();var t=e.readUint8();this.durationFlag=t>>7,this.avgRateFlag=t>>6&1,this.durationFlag&&(this.duration=e.readUint32()),this.avgRateFlag&&(this.accurateStatisticsFlag=e.readUint8(),this.avgBitRate=e.readUint16(),this.avgFrameRate=e.readUint16()),this.dependency=[];for(var i=e.readUint8(),r=0;r<i;r++){var a={};this.dependency.push(a),a.subSeqDirectionFlag=e.readUint8(),a.layerNumber=e.readUint8(),a.subSequenceIdentifier=e.readUint16()}})),d.createSampleGroupCtor("dtrt",(function(e){n.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")})),d.createSampleGroupCtor("mvif",(function(e){n.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")})),d.createSampleGroupCtor("prol",(function(e){this.roll_distance=e.readInt16()})),d.createSampleGroupCtor("rap ",(function(e){var t=e.readUint8();this.num_leading_samples_known=t>>7,this.num_leading_samples=127&t})),d.createSampleGroupCtor("rash",(function(e){if(this.operation_point_count=e.readUint16(),this.description_length!==2+(1===this.operation_point_count?2:6*this.operation_point_count)+9)n.warn("BoxParser","Mismatch in "+this.grouping_type+" sample group length"),this.data=e.readUint8Array(this.description_length-2);else{if(1===this.operation_point_count)this.target_rate_share=e.readUint16();else{this.target_rate_share=[],this.available_bitrate=[];for(var t=0;t<this.operation_point_count;t++)this.available_bitrate[t]=e.readUint32(),this.target_rate_share[t]=e.readUint16()}this.maximum_bitrate=e.readUint32(),this.minimum_bitrate=e.readUint32(),this.discard_priority=e.readUint8()}})),d.createSampleGroupCtor("roll",(function(e){this.roll_distance=e.readInt16()})),d.SampleGroupEntry.prototype.parse=function(e){n.warn("BoxParser","Unknown Sample Group type: "+this.grouping_type),this.data=e.readUint8Array(this.description_length)},d.createSampleGroupCtor("scif",(function(e){n.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")})),d.createSampleGroupCtor("scnm",(function(e){n.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")})),d.createSampleGroupCtor("seig",(function(e){this.reserved=e.readUint8();var t=e.readUint8();this.crypt_byte_block=t>>4,this.skip_byte_block=15&t,this.isProtected=e.readUint8(),this.Per_Sample_IV_Size=e.readUint8(),this.KID=d.parseHex16(e),this.constant_IV_size=0,this.constant_IV=0,1===this.isProtected&&0===this.Per_Sample_IV_Size&&(this.constant_IV_size=e.readUint8(),this.constant_IV=e.readUint8Array(this.constant_IV_size))})),d.createSampleGroupCtor("stsa",(function(e){n.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")})),d.createSampleGroupCtor("sync",(function(e){var t=e.readUint8();this.NAL_unit_type=63&t})),d.createSampleGroupCtor("tele",(function(e){var t=e.readUint8();this.level_independently_decodable=t>>7})),d.createSampleGroupCtor("tsas",(function(e){n.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")})),d.createSampleGroupCtor("tscl",(function(e){n.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")})),d.createSampleGroupCtor("vipr",(function(e){n.warn("BoxParser","Sample Group type: "+this.grouping_type+" not fully parsed")})),d.createFullBoxCtor("sbgp",(function(e){this.grouping_type=e.readString(4),1===this.version?this.grouping_type_parameter=e.readUint32():this.grouping_type_parameter=0,this.entries=[];for(var t=e.readUint32(),i=0;i<t;i++){var r={};this.entries.push(r),r.sample_count=e.readInt32(),r.group_description_index=e.readInt32()}})),d.createFullBoxCtor("schm",(function(e){this.scheme_type=e.readString(4),this.scheme_version=e.readUint32(),1&this.flags&&(this.scheme_uri=e.readString(this.size-this.hdr_size-8))})),d.createBoxCtor("sdp ",(function(e){this.sdptext=e.readString(this.size-this.hdr_size)})),d.createFullBoxCtor("sdtp",(function(e){var t,i=this.size-this.hdr_size;this.is_leading=[],this.sample_depends_on=[],this.sample_is_depended_on=[],this.sample_has_redundancy=[];for(var r=0;r<i;r++)t=e.readUint8(),this.is_leading[r]=t>>6,this.sample_depends_on[r]=t>>4&3,this.sample_is_depended_on[r]=t>>2&3,this.sample_has_redundancy[r]=3&t})),d.createFullBoxCtor("senc"),d.createFullBoxCtor("sgpd",(function(e){this.grouping_type=e.readString(4),n.debug("BoxParser","Found Sample Groups of type "+this.grouping_type),1===this.version?this.default_length=e.readUint32():this.default_length=0,this.version>=2&&(this.default_group_description_index=e.readUint32()),this.entries=[];for(var t=e.readUint32(),i=0;i<t;i++){var r;r=d[this.grouping_type+"SampleGroupEntry"]?new d[this.grouping_type+"SampleGroupEntry"](this.grouping_type):new d.SampleGroupEntry(this.grouping_type),this.entries.push(r),1===this.version&&0===this.default_length?r.description_length=e.readUint32():r.description_length=this.default_length,r.write===d.SampleGroupEntry.prototype.write&&(n.info("BoxParser","SampleGroup for type "+this.grouping_type+" writing not yet implemented, keeping unparsed data in memory for later write"),r.data=e.readUint8Array(r.description_length),e.position-=r.description_length),r.parse(e)}})),d.createFullBoxCtor("sidx",(function(e){this.reference_ID=e.readUint32(),this.timescale=e.readUint32(),0===this.version?(this.earliest_presentation_time=e.readUint32(),this.first_offset=e.readUint32()):(this.earliest_presentation_time=e.readUint64(),this.first_offset=e.readUint64()),e.readUint16(),this.references=[];for(var t=e.readUint16(),i=0;i<t;i++){var r={};this.references.push(r);var a=e.readUint32();r.reference_type=a>>31&1,r.referenced_size=2147483647&a,r.subsegment_duration=e.readUint32(),a=e.readUint32(),r.starts_with_SAP=a>>31&1,r.SAP_type=a>>28&7,r.SAP_delta_time=268435455&a}})),d.SingleItemTypeReferenceBox=function(e,t,i,r){d.Box.call(this,e,t),this.hdr_size=i,this.start=r},d.SingleItemTypeReferenceBox.prototype=new d.Box,d.SingleItemTypeReferenceBox.prototype.parse=function(e){this.from_item_ID=e.readUint16();var t=e.readUint16();this.references=[];for(var i=0;i<t;i++)this.references[i]=e.readUint16()},d.SingleItemTypeReferenceBoxLarge=function(e,t,i,r){d.Box.call(this,e,t),this.hdr_size=i,this.start=r},d.SingleItemTypeReferenceBoxLarge.prototype=new d.Box,d.SingleItemTypeReferenceBoxLarge.prototype.parse=function(e){this.from_item_ID=e.readUint32();var t=e.readUint16();this.references=[];for(var i=0;i<t;i++)this.references[i]=e.readUint32()},d.createFullBoxCtor("SmDm",(function(e){this.primaryRChromaticity_x=e.readUint16(),this.primaryRChromaticity_y=e.readUint16(),this.primaryGChromaticity_x=e.readUint16(),this.primaryGChromaticity_y=e.readUint16(),this.primaryBChromaticity_x=e.readUint16(),this.primaryBChromaticity_y=e.readUint16(),this.whitePointChromaticity_x=e.readUint16(),this.whitePointChromaticity_y=e.readUint16(),this.luminanceMax=e.readUint32(),this.luminanceMin=e.readUint32()})),d.createFullBoxCtor("smhd",(function(e){this.balance=e.readUint16(),e.readUint16()})),d.createFullBoxCtor("ssix",(function(e){this.subsegments=[];for(var t=e.readUint32(),i=0;i<t;i++){var r={};this.subsegments.push(r),r.ranges=[];for(var a=e.readUint32(),n=0;n<a;n++){var s={};r.ranges.push(s),s.level=e.readUint8(),s.range_size=e.readUint24()}}})),d.createFullBoxCtor("stco",(function(e){var t;if(t=e.readUint32(),this.chunk_offsets=[],0===this.version)for(var i=0;i<t;i++)this.chunk_offsets.push(e.readUint32())})),d.createFullBoxCtor("stdp",(function(e){var t=(this.size-this.hdr_size)/2;this.priority=[];for(var i=0;i<t;i++)this.priority[i]=e.readUint16()})),d.createFullBoxCtor("sthd"),d.createFullBoxCtor("stri",(function(e){this.switch_group=e.readUint16(),this.alternate_group=e.readUint16(),this.sub_track_id=e.readUint32();var t=(this.size-this.hdr_size-8)/4;this.attribute_list=[];for(var i=0;i<t;i++)this.attribute_list[i]=e.readUint32()})),d.createFullBoxCtor("stsc",(function(e){var t,i;if(t=e.readUint32(),this.first_chunk=[],this.samples_per_chunk=[],this.sample_description_index=[],0===this.version)for(i=0;i<t;i++)this.first_chunk.push(e.readUint32()),this.samples_per_chunk.push(e.readUint32()),this.sample_description_index.push(e.readUint32())})),d.createFullBoxCtor("stsd",(function(e){var t,i,r,a;for(this.entries=[],r=e.readUint32(),t=1;t<=r;t++){if((i=d.parseOneBox(e,!0,this.size-(e.getPosition()-this.start))).code!==d.OK)return;d[i.type+"SampleEntry"]?((a=new d[i.type+"SampleEntry"](i.size)).hdr_size=i.hdr_size,a.start=i.start):(n.warn("BoxParser","Unknown sample entry type: "+i.type),a=new d.SampleEntry(i.type,i.size,i.hdr_size,i.start)),a.write===d.SampleEntry.prototype.write&&(n.info("BoxParser","SampleEntry "+a.type+" box writing not yet implemented, keeping unparsed data in memory for later write"),a.parseDataAndRewind(e)),a.parse(e),this.entries.push(a)}})),d.createFullBoxCtor("stsg",(function(e){this.grouping_type=e.readUint32();var t=e.readUint16();this.group_description_index=[];for(var i=0;i<t;i++)this.group_description_index[i]=e.readUint32()})),d.createFullBoxCtor("stsh",(function(e){var t,i;if(t=e.readUint32(),this.shadowed_sample_numbers=[],this.sync_sample_numbers=[],0===this.version)for(i=0;i<t;i++)this.shadowed_sample_numbers.push(e.readUint32()),this.sync_sample_numbers.push(e.readUint32())})),d.createFullBoxCtor("stss",(function(e){var t,i;if(i=e.readUint32(),0===this.version)for(this.sample_numbers=[],t=0;t<i;t++)this.sample_numbers.push(e.readUint32())})),d.createFullBoxCtor("stsz",(function(e){var t;if(this.sample_sizes=[],0===this.version)for(this.sample_size=e.readUint32(),this.sample_count=e.readUint32(),t=0;t<this.sample_count;t++)0===this.sample_size?this.sample_sizes.push(e.readUint32()):this.sample_sizes[t]=this.sample_size})),d.createFullBoxCtor("stts",(function(e){var t,i,r;if(t=e.readUint32(),this.sample_counts=[],this.sample_deltas=[],0===this.version)for(i=0;i<t;i++)this.sample_counts.push(e.readUint32()),(r=e.readInt32())<0&&(n.warn("BoxParser","File uses negative stts sample delta, using value 1 instead, sync may be lost!"),r=1),this.sample_deltas.push(r)})),d.createFullBoxCtor("stvi",(function(e){var t=e.readUint32();this.single_view_allowed=3&t,this.stereo_scheme=e.readUint32();var i,r,a=e.readUint32();for(this.stereo_indication_type=e.readString(a),this.boxes=[];e.getPosition()<this.start+this.size;){if((i=d.parseOneBox(e,!1,this.size-(e.getPosition()-this.start))).code!==d.OK)return;r=i.box,this.boxes.push(r),this[r.type]=r}})),d.createBoxCtor("styp",(function(e){d.ftypBox.prototype.parse.call(this,e)})),d.createFullBoxCtor("stz2",(function(e){var t,i;if(this.sample_sizes=[],0===this.version)if(this.reserved=e.readUint24(),this.field_size=e.readUint8(),i=e.readUint32(),4===this.field_size)for(t=0;t<i;t+=2){var r=e.readUint8();this.sample_sizes[t]=r>>4&15,this.sample_sizes[t+1]=15&r}else if(8===this.field_size)for(t=0;t<i;t++)this.sample_sizes[t]=e.readUint8();else if(16===this.field_size)for(t=0;t<i;t++)this.sample_sizes[t]=e.readUint16();else n.error("BoxParser","Error in length field in stz2 box")})),d.createFullBoxCtor("subs",(function(e){var t,i,r,a;for(r=e.readUint32(),this.entries=[],t=0;t<r;t++){var n={};if(this.entries[t]=n,n.sample_delta=e.readUint32(),n.subsamples=[],(a=e.readUint16())>0)for(i=0;i<a;i++){var s={};n.subsamples.push(s),1==this.version?s.size=e.readUint32():s.size=e.readUint16(),s.priority=e.readUint8(),s.discardable=e.readUint8(),s.codec_specific_parameters=e.readUint32()}}})),d.createFullBoxCtor("tenc",(function(e){if(e.readUint8(),0===this.version)e.readUint8();else{var t=e.readUint8();this.default_crypt_byte_block=t>>4&15,this.default_skip_byte_block=15&t}this.default_isProtected=e.readUint8(),this.default_Per_Sample_IV_Size=e.readUint8(),this.default_KID=d.parseHex16(e),1===this.default_isProtected&&0===this.default_Per_Sample_IV_Size&&(this.default_constant_IV_size=e.readUint8(),this.default_constant_IV=e.readUint8Array(this.default_constant_IV_size))})),d.createFullBoxCtor("tfdt",(function(e){1==this.version?this.baseMediaDecodeTime=e.readUint64():this.baseMediaDecodeTime=e.readUint32()})),d.createFullBoxCtor("tfhd",(function(e){var t=0;this.track_id=e.readUint32(),this.size-this.hdr_size>t&&this.flags&d.TFHD_FLAG_BASE_DATA_OFFSET?(this.base_data_offset=e.readUint64(),t+=8):this.base_data_offset=0,this.size-this.hdr_size>t&&this.flags&d.TFHD_FLAG_SAMPLE_DESC?(this.default_sample_description_index=e.readUint32(),t+=4):this.default_sample_description_index=0,this.size-this.hdr_size>t&&this.flags&d.TFHD_FLAG_SAMPLE_DUR?(this.default_sample_duration=e.readUint32(),t+=4):this.default_sample_duration=0,this.size-this.hdr_size>t&&this.flags&d.TFHD_FLAG_SAMPLE_SIZE?(this.default_sample_size=e.readUint32(),t+=4):this.default_sample_size=0,this.size-this.hdr_size>t&&this.flags&d.TFHD_FLAG_SAMPLE_FLAGS?(this.default_sample_flags=e.readUint32(),t+=4):this.default_sample_flags=0})),d.createFullBoxCtor("tfra",(function(e){this.track_ID=e.readUint32(),e.readUint24();var t=e.readUint8();this.length_size_of_traf_num=t>>4&3,this.length_size_of_trun_num=t>>2&3,this.length_size_of_sample_num=3&t,this.entries=[];for(var i=e.readUint32(),r=0;r<i;r++)1===this.version?(this.time=e.readUint64(),this.moof_offset=e.readUint64()):(this.time=e.readUint32(),this.moof_offset=e.readUint32()),this.traf_number=e["readUint"+8*(this.length_size_of_traf_num+1)](),this.trun_number=e["readUint"+8*(this.length_size_of_trun_num+1)](),this.sample_number=e["readUint"+8*(this.length_size_of_sample_num+1)]()})),d.createFullBoxCtor("tkhd",(function(e){1==this.version?(this.creation_time=e.readUint64(),this.modification_time=e.readUint64(),this.track_id=e.readUint32(),e.readUint32(),this.duration=e.readUint64()):(this.creation_time=e.readUint32(),this.modification_time=e.readUint32(),this.track_id=e.readUint32(),e.readUint32(),this.duration=e.readUint32()),e.readUint32Array(2),this.layer=e.readInt16(),this.alternate_group=e.readInt16(),this.volume=e.readInt16()>>8,e.readUint16(),this.matrix=e.readInt32Array(9),this.width=e.readUint32(),this.height=e.readUint32()})),d.createBoxCtor("tmax",(function(e){this.time=e.readUint32()})),d.createBoxCtor("tmin",(function(e){this.time=e.readUint32()})),d.createBoxCtor("totl",(function(e){this.bytessent=e.readUint32()})),d.createBoxCtor("tpay",(function(e){this.bytessent=e.readUint32()})),d.createBoxCtor("tpyl",(function(e){this.bytessent=e.readUint64()})),d.TrackGroupTypeBox.prototype.parse=function(e){this.parseFullHeader(e),this.track_group_id=e.readUint32()},d.createTrackGroupCtor("msrc"),d.TrackReferenceTypeBox=function(e,t,i,r){d.Box.call(this,e,t),this.hdr_size=i,this.start=r},d.TrackReferenceTypeBox.prototype=new d.Box,d.TrackReferenceTypeBox.prototype.parse=function(e){this.track_ids=e.readUint32Array((this.size-this.hdr_size)/4)},d.trefBox.prototype.parse=function(e){for(var t,i;e.getPosition()<this.start+this.size;){if((t=d.parseOneBox(e,!0,this.size-(e.getPosition()-this.start))).code!==d.OK)return;(i=new d.TrackReferenceTypeBox(t.type,t.size,t.hdr_size,t.start)).write===d.Box.prototype.write&&"mdat"!==i.type&&(n.info("BoxParser","TrackReference "+i.type+" box writing not yet implemented, keeping unparsed data in memory for later write"),i.parseDataAndRewind(e)),i.parse(e),this.boxes.push(i)}},d.createFullBoxCtor("trep",(function(e){for(this.track_ID=e.readUint32(),this.boxes=[];e.getPosition()<this.start+this.size;){if(ret=d.parseOneBox(e,!1,this.size-(e.getPosition()-this.start)),ret.code!==d.OK)return;box=ret.box,this.boxes.push(box)}})),d.createFullBoxCtor("trex",(function(e){this.track_id=e.readUint32(),this.default_sample_description_index=e.readUint32(),this.default_sample_duration=e.readUint32(),this.default_sample_size=e.readUint32(),this.default_sample_flags=e.readUint32()})),d.createBoxCtor("trpy",(function(e){this.bytessent=e.readUint64()})),d.createFullBoxCtor("trun",(function(e){var t=0;if(this.sample_count=e.readUint32(),t+=4,this.size-this.hdr_size>t&&this.flags&d.TRUN_FLAGS_DATA_OFFSET?(this.data_offset=e.readInt32(),t+=4):this.data_offset=0,this.size-this.hdr_size>t&&this.flags&d.TRUN_FLAGS_FIRST_FLAG?(this.first_sample_flags=e.readUint32(),t+=4):this.first_sample_flags=0,this.sample_duration=[],this.sample_size=[],this.sample_flags=[],this.sample_composition_time_offset=[],this.size-this.hdr_size>t)for(var i=0;i<this.sample_count;i++)this.flags&d.TRUN_FLAGS_DURATION&&(this.sample_duration[i]=e.readUint32()),this.flags&d.TRUN_FLAGS_SIZE&&(this.sample_size[i]=e.readUint32()),this.flags&d.TRUN_FLAGS_FLAGS&&(this.sample_flags[i]=e.readUint32()),this.flags&d.TRUN_FLAGS_CTS_OFFSET&&(0===this.version?this.sample_composition_time_offset[i]=e.readUint32():this.sample_composition_time_offset[i]=e.readInt32())})),d.createFullBoxCtor("tsel",(function(e){this.switch_group=e.readUint32();var t=(this.size-this.hdr_size-4)/4;this.attribute_list=[];for(var i=0;i<t;i++)this.attribute_list[i]=e.readUint32()})),d.createFullBoxCtor("txtC",(function(e){this.config=e.readCString()})),d.createFullBoxCtor("url ",(function(e){1!==this.flags&&(this.location=e.readCString())})),d.createFullBoxCtor("urn ",(function(e){this.name=e.readCString(),this.size-this.hdr_size-this.name.length-1>0&&(this.location=e.readCString())})),d.createUUIDBox("a5d40b30e81411ddba2f0800200c9a66",!0,!1,(function(e){this.LiveServerManifest=e.readString(this.size-this.hdr_size).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")})),d.createUUIDBox("d08a4f1810f34a82b6c832d8aba183d3",!0,!1,(function(e){this.system_id=d.parseHex16(e);var t=e.readUint32();t>0&&(this.data=e.readUint8Array(t))})),d.createUUIDBox("a2394f525a9b4f14a2446c427c648df4",!0,!1),d.createUUIDBox("8974dbce7be74c5184f97148f9882554",!0,!1,(function(e){this.default_AlgorithmID=e.readUint24(),this.default_IV_size=e.readUint8(),this.default_KID=d.parseHex16(e)})),d.createUUIDBox("d4807ef2ca3946958e5426cb9e46a79f",!0,!1,(function(e){this.fragment_count=e.readUint8(),this.entries=[];for(var t=0;t<this.fragment_count;t++){var i={},r=0,a=0;1===this.version?(r=e.readUint64(),a=e.readUint64()):(r=e.readUint32(),a=e.readUint32()),i.absolute_time=r,i.absolute_duration=a,this.entries.push(i)}})),d.createUUIDBox("6d1d9b0542d544e680e2141daff757b2",!0,!1,(function(e){1===this.version?(this.absolute_time=e.readUint64(),this.duration=e.readUint64()):(this.absolute_time=e.readUint32(),this.duration=e.readUint32())})),d.createFullBoxCtor("vmhd",(function(e){this.graphicsmode=e.readUint16(),this.opcolor=e.readUint16Array(3)})),d.createFullBoxCtor("vpcC",(function(e){var t;1===this.version?(this.profile=e.readUint8(),this.level=e.readUint8(),t=e.readUint8(),this.bitDepth=t>>4,this.chromaSubsampling=t>>1&7,this.videoFullRangeFlag=1&t,this.colourPrimaries=e.readUint8(),this.transferCharacteristics=e.readUint8(),this.matrixCoefficients=e.readUint8(),this.codecIntializationDataSize=e.readUint16(),this.codecIntializationData=e.readUint8Array(this.codecIntializationDataSize)):(this.profile=e.readUint8(),this.level=e.readUint8(),t=e.readUint8(),this.bitDepth=t>>4&15,this.colorSpace=15&t,t=e.readUint8(),this.chromaSubsampling=t>>4&15,this.transferFunction=t>>1&7,this.videoFullRangeFlag=1&t,this.codecIntializationDataSize=e.readUint16(),this.codecIntializationData=e.readUint8Array(this.codecIntializationDataSize))})),d.createBoxCtor("vttC",(function(e){this.text=e.readString(this.size-this.hdr_size)})),d.createFullBoxCtor("vvcC",(function(e){var t,i,r={held_bits:void 0,num_held_bits:0,stream_read_1_bytes:function(e){this.held_bits=e.readUint8(),this.num_held_bits=8},stream_read_2_bytes:function(e){this.held_bits=e.readUint16(),this.num_held_bits=16},extract_bits:function(e){var t=this.held_bits>>this.num_held_bits-e&(1<<e)-1;return this.num_held_bits-=e,t}};if(r.stream_read_1_bytes(e),r.extract_bits(5),this.lengthSizeMinusOne=r.extract_bits(2),this.ptl_present_flag=r.extract_bits(1),this.ptl_present_flag){if(r.stream_read_2_bytes(e),this.ols_idx=r.extract_bits(9),this.num_sublayers=r.extract_bits(3),this.constant_frame_rate=r.extract_bits(2),this.chroma_format_idc=r.extract_bits(2),r.stream_read_1_bytes(e),this.bit_depth_minus8=r.extract_bits(3),r.extract_bits(5),r.stream_read_2_bytes(e),r.extract_bits(2),this.num_bytes_constraint_info=r.extract_bits(6),this.general_profile_idc=r.extract_bits(7),this.general_tier_flag=r.extract_bits(1),this.general_level_idc=e.readUint8(),r.stream_read_1_bytes(e),this.ptl_frame_only_constraint_flag=r.extract_bits(1),this.ptl_multilayer_enabled_flag=r.extract_bits(1),this.general_constraint_info=new Uint8Array(this.num_bytes_constraint_info),this.num_bytes_constraint_info){for(t=0;t<this.num_bytes_constraint_info-1;t++){var a=r.extract_bits(6);r.stream_read_1_bytes(e);var n=r.extract_bits(2);this.general_constraint_info[t]=a<<2|n}this.general_constraint_info[this.num_bytes_constraint_info-1]=r.extract_bits(6)}else r.extract_bits(6);for(r.stream_read_1_bytes(e),this.ptl_sublayer_present_mask=0,i=this.num_sublayers-2;i>=0;--i){var s=r.extract_bits(1);this.ptl_sublayer_present_mask|=s<<i}for(i=this.num_sublayers;i<=8&&this.num_sublayers>1;++i)r.extract_bits(1);for(i=this.num_sublayers-2;i>=0;--i)this.ptl_sublayer_present_mask&1<<i&&(this.sublayer_level_idc[i]=e.readUint8());if(this.ptl_num_sub_profiles=e.readUint8(),this.general_sub_profile_idc=[],this.ptl_num_sub_profiles)for(t=0;t<this.ptl_num_sub_profiles;t++)this.general_sub_profile_idc.push(e.readUint32());this.max_picture_width=e.readUint16(),this.max_picture_height=e.readUint16(),this.avg_frame_rate=e.readUint16()}this.nalu_arrays=[];var o=e.readUint8();for(t=0;t<o;t++){var c=[];this.nalu_arrays.push(c),r.stream_read_1_bytes(e),c.completeness=r.extract_bits(1),r.extract_bits(2),c.nalu_type=r.extract_bits(5);var l=1;for(13!=c.nalu_type&&12!=c.nalu_type&&(l=e.readUint16()),i=0;i<l;i++){var u=e.readUint16();c.push({data:e.readUint8Array(u),length:u})}}})),d.createFullBoxCtor("vvnC",(function(e){var t=strm.readUint8();this.lengthSizeMinusOne=3&t})),d.SampleEntry.prototype.isVideo=function(){return!1},d.SampleEntry.prototype.isAudio=function(){return!1},d.SampleEntry.prototype.isSubtitle=function(){return!1},d.SampleEntry.prototype.isMetadata=function(){return!1},d.SampleEntry.prototype.isHint=function(){return!1},d.SampleEntry.prototype.getCodec=function(){return this.type.replace(".","")},d.SampleEntry.prototype.getWidth=function(){return""},d.SampleEntry.prototype.getHeight=function(){return""},d.SampleEntry.prototype.getChannelCount=function(){return""},d.SampleEntry.prototype.getSampleRate=function(){return""},d.SampleEntry.prototype.getSampleSize=function(){return""},d.VisualSampleEntry.prototype.isVideo=function(){return!0},d.VisualSampleEntry.prototype.getWidth=function(){return this.width},d.VisualSampleEntry.prototype.getHeight=function(){return this.height},d.AudioSampleEntry.prototype.isAudio=function(){return!0},d.AudioSampleEntry.prototype.getChannelCount=function(){return this.channel_count},d.AudioSampleEntry.prototype.getSampleRate=function(){return this.samplerate},d.AudioSampleEntry.prototype.getSampleSize=function(){return this.samplesize},d.SubtitleSampleEntry.prototype.isSubtitle=function(){return!0},d.MetadataSampleEntry.prototype.isMetadata=function(){return!0},d.decimalToHex=function(e,t){var i=Number(e).toString(16);for(t=null!==(r=t)&&void 0!==r?r:t=2;i.length<t;){var r;i="0"+i}return i},d.avc1SampleEntry.prototype.getCodec=d.avc2SampleEntry.prototype.getCodec=d.avc3SampleEntry.prototype.getCodec=d.avc4SampleEntry.prototype.getCodec=function(){var e=d.SampleEntry.prototype.getCodec.call(this);return this.avcC?e+"."+d.decimalToHex(this.avcC.AVCProfileIndication)+d.decimalToHex(this.avcC.profile_compatibility)+d.decimalToHex(this.avcC.AVCLevelIndication):e},d.hev1SampleEntry.prototype.getCodec=d.hvc1SampleEntry.prototype.getCodec=function(){var e,t=d.SampleEntry.prototype.getCodec.call(this);if(this.hvcC){switch(t+=".",this.hvcC.general_profile_space){case 0:t+="";break;case 1:t+="A";break;case 2:t+="B";break;case 3:t+="C"}t+=this.hvcC.general_profile_idc,t+=".";var i=this.hvcC.general_profile_compatibility,r=0;for(e=0;e<32&&(r|=1&i,31!=e);e++)r<<=1,i>>=1;t+=d.decimalToHex(r,0),t+=".",0===this.hvcC.general_tier_flag?t+="L":t+="H",t+=this.hvcC.general_level_idc;var a=!1,n="";for(e=5;e>=0;e--)(this.hvcC.general_constraint_indicator[e]||a)&&(n="."+d.decimalToHex(this.hvcC.general_constraint_indicator[e],0)+n,a=!0);t+=n}return t},d.vvc1SampleEntry.prototype.getCodec=d.vvi1SampleEntry.prototype.getCodec=function(){var e,t=d.SampleEntry.prototype.getCodec.call(this);if(this.vvcC){t+="."+this.vvcC.general_profile_idc,this.vvcC.general_tier_flag?t+=".H":t+=".L",t+=this.vvcC.general_level_idc;var i="";if(this.vvcC.general_constraint_info){var r,a=[],n=0;for(n|=this.vvcC.ptl_frame_only_constraint<<7,n|=this.vvcC.ptl_multilayer_enabled<<6,e=0;e<this.vvcC.general_constraint_info.length;++e)n|=this.vvcC.general_constraint_info[e]>>2&63,a.push(n),n&&(r=e),n=this.vvcC.general_constraint_info[e]>>2&3;if(void 0===r)i=".CA";else{i=".C";var s="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",o=0,c=0;for(e=0;e<=r;++e)for(o=o<<8|a[e],c+=8;c>=5;)i+=s[o>>c-5&31],o&=(1<<(c-=5))-1;c&&(i+=s[31&(o<<=5-c)])}}t+=i}return t},d.mp4aSampleEntry.prototype.getCodec=function(){var e=d.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI(),i=this.esds.esd.getAudioConfig();return e+"."+d.decimalToHex(t)+(i?"."+i:"")}return e},d.stxtSampleEntry.prototype.getCodec=function(){var e=d.SampleEntry.prototype.getCodec.call(this);return this.mime_format?e+"."+this.mime_format:e},d.vp08SampleEntry.prototype.getCodec=d.vp09SampleEntry.prototype.getCodec=function(){var e=d.SampleEntry.prototype.getCodec.call(this),t=this.vpcC.level;0==t&&(t="00");var i=this.vpcC.bitDepth;return 8==i&&(i="08"),e+".0"+this.vpcC.profile+"."+t+"."+i},d.av01SampleEntry.prototype.getCodec=function(){var e,t=d.SampleEntry.prototype.getCodec.call(this),i=this.av1C.seq_level_idx_0;return i<10&&(i="0"+i),2===this.av1C.seq_profile&&1===this.av1C.high_bitdepth?e=1===this.av1C.twelve_bit?"12":"10":this.av1C.seq_profile<=2&&(e=1===this.av1C.high_bitdepth?"10":"08"),t+"."+this.av1C.seq_profile+"."+i+(this.av1C.seq_tier_0?"H":"M")+"."+e},d.Box.prototype.writeHeader=function(e,t){this.size+=8,this.size>c&&(this.size+=8),"uuid"===this.type&&(this.size+=16),n.debug("BoxWriter","Writing box "+this.type+" of size: "+this.size+" at position "+e.getPosition()+(t||"")),this.size>c?e.writeUint32(1):(this.sizePosition=e.getPosition(),e.writeUint32(this.size)),e.writeString(this.type,null,4),"uuid"===this.type&&e.writeUint8Array(this.uuid),this.size>c&&e.writeUint64(this.size)},d.FullBox.prototype.writeHeader=function(e){this.size+=4,d.Box.prototype.writeHeader.call(this,e," v="+this.version+" f="+this.flags),e.writeUint8(this.version),e.writeUint24(this.flags)},d.Box.prototype.write=function(e){"mdat"===this.type?this.data&&(this.size=this.data.length,this.writeHeader(e),e.writeUint8Array(this.data)):(this.size=this.data?this.data.length:0,this.writeHeader(e),this.data&&e.writeUint8Array(this.data))},d.ContainerBox.prototype.write=function(e){this.size=0,this.writeHeader(e);for(var t=0;t<this.boxes.length;t++)this.boxes[t]&&(this.boxes[t].write(e),this.size+=this.boxes[t].size);n.debug("BoxWriter","Adjusting box "+this.type+" with new size "+this.size),e.adjustUint32(this.sizePosition,this.size)},d.TrackReferenceTypeBox.prototype.write=function(e){this.size=4*this.track_ids.length,this.writeHeader(e),e.writeUint32Array(this.track_ids)},d.avcCBox.prototype.write=function(e){var t;for(this.size=7,t=0;t<this.SPS.length;t++)this.size+=2+this.SPS[t].length;for(t=0;t<this.PPS.length;t++)this.size+=2+this.PPS[t].length;for(this.ext&&(this.size+=this.ext.length),this.writeHeader(e),e.writeUint8(this.configurationVersion),e.writeUint8(this.AVCProfileIndication),e.writeUint8(this.profile_compatibility),e.writeUint8(this.AVCLevelIndication),e.writeUint8(this.lengthSizeMinusOne+252),e.writeUint8(this.SPS.length+224),t=0;t<this.SPS.length;t++)e.writeUint16(this.SPS[t].length),e.writeUint8Array(this.SPS[t].nalu);for(e.writeUint8(this.PPS.length),t=0;t<this.PPS.length;t++)e.writeUint16(this.PPS[t].length),e.writeUint8Array(this.PPS[t].nalu);this.ext&&e.writeUint8Array(this.ext)},d.co64Box.prototype.write=function(e){var t;for(this.version=0,this.flags=0,this.size=4+8*this.chunk_offsets.length,this.writeHeader(e),e.writeUint32(this.chunk_offsets.length),t=0;t<this.chunk_offsets.length;t++)e.writeUint64(this.chunk_offsets[t])},d.cslgBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=20,this.writeHeader(e),e.writeInt32(this.compositionToDTSShift),e.writeInt32(this.leastDecodeToDisplayDelta),e.writeInt32(this.greatestDecodeToDisplayDelta),e.writeInt32(this.compositionStartTime),e.writeInt32(this.compositionEndTime)},d.cttsBox.prototype.write=function(e){var t;for(this.version=0,this.flags=0,this.size=4+8*this.sample_counts.length,this.writeHeader(e),e.writeUint32(this.sample_counts.length),t=0;t<this.sample_counts.length;t++)e.writeUint32(this.sample_counts[t]),1===this.version?e.writeInt32(this.sample_offsets[t]):e.writeUint32(this.sample_offsets[t])},d.drefBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=4,this.writeHeader(e),e.writeUint32(this.entries.length);for(var t=0;t<this.entries.length;t++)this.entries[t].write(e),this.size+=this.entries[t].size;n.debug("BoxWriter","Adjusting box "+this.type+" with new size "+this.size),e.adjustUint32(this.sizePosition,this.size)},d.elngBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=this.extended_language.length,this.writeHeader(e),e.writeString(this.extended_language)},d.elstBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=4+12*this.entries.length,this.writeHeader(e),e.writeUint32(this.entries.length);for(var t=0;t<this.entries.length;t++){var i=this.entries[t];e.writeUint32(i.segment_duration),e.writeInt32(i.media_time),e.writeInt16(i.media_rate_integer),e.writeInt16(i.media_rate_fraction)}},d.emsgBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=16+this.message_data.length+(this.scheme_id_uri.length+1)+(this.value.length+1),this.writeHeader(e),e.writeCString(this.scheme_id_uri),e.writeCString(this.value),e.writeUint32(this.timescale),e.writeUint32(this.presentation_time_delta),e.writeUint32(this.event_duration),e.writeUint32(this.id),e.writeUint8Array(this.message_data)},d.ftypBox.prototype.write=function(e){this.size=8+4*this.compatible_brands.length,this.writeHeader(e),e.writeString(this.major_brand,null,4),e.writeUint32(this.minor_version);for(var t=0;t<this.compatible_brands.length;t++)e.writeString(this.compatible_brands[t],null,4)},d.hdlrBox.prototype.write=function(e){this.size=20+this.name.length+1,this.version=0,this.flags=0,this.writeHeader(e),e.writeUint32(0),e.writeString(this.handler,null,4),e.writeUint32(0),e.writeUint32(0),e.writeUint32(0),e.writeCString(this.name)},d.kindBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=this.schemeURI.length+1+(this.value.length+1),this.writeHeader(e),e.writeCString(this.schemeURI),e.writeCString(this.value)},d.mdhdBox.prototype.write=function(e){this.size=20,this.flags=0,this.version=0,this.writeHeader(e),e.writeUint32(this.creation_time),e.writeUint32(this.modification_time),e.writeUint32(this.timescale),e.writeUint32(this.duration),e.writeUint16(this.language),e.writeUint16(0)},d.mehdBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=4,this.writeHeader(e),e.writeUint32(this.fragment_duration)},d.mfhdBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=4,this.writeHeader(e),e.writeUint32(this.sequence_number)},d.mvhdBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=96,this.writeHeader(e),e.writeUint32(this.creation_time),e.writeUint32(this.modification_time),e.writeUint32(this.timescale),e.writeUint32(this.duration),e.writeUint32(this.rate),e.writeUint16(this.volume<<8),e.writeUint16(0),e.writeUint32(0),e.writeUint32(0),e.writeUint32Array(this.matrix),e.writeUint32(0),e.writeUint32(0),e.writeUint32(0),e.writeUint32(0),e.writeUint32(0),e.writeUint32(0),e.writeUint32(this.next_track_id)},d.SampleEntry.prototype.writeHeader=function(e){this.size=8,d.Box.prototype.writeHeader.call(this,e),e.writeUint8(0),e.writeUint8(0),e.writeUint8(0),e.writeUint8(0),e.writeUint8(0),e.writeUint8(0),e.writeUint16(this.data_reference_index)},d.SampleEntry.prototype.writeFooter=function(e){for(var t=0;t<this.boxes.length;t++)this.boxes[t].write(e),this.size+=this.boxes[t].size;n.debug("BoxWriter","Adjusting box "+this.type+" with new size "+this.size),e.adjustUint32(this.sizePosition,this.size)},d.SampleEntry.prototype.write=function(e){this.writeHeader(e),e.writeUint8Array(this.data),this.size+=this.data.length,n.debug("BoxWriter","Adjusting box "+this.type+" with new size "+this.size),e.adjustUint32(this.sizePosition,this.size)},d.VisualSampleEntry.prototype.write=function(e){this.writeHeader(e),this.size+=70,e.writeUint16(0),e.writeUint16(0),e.writeUint32(0),e.writeUint32(0),e.writeUint32(0),e.writeUint16(this.width),e.writeUint16(this.height),e.writeUint32(this.horizresolution),e.writeUint32(this.vertresolution),e.writeUint32(0),e.writeUint16(this.frame_count),e.writeUint8(Math.min(31,this.compressorname.length)),e.writeString(this.compressorname,null,31),e.writeUint16(this.depth),e.writeInt16(-1),this.writeFooter(e)},d.AudioSampleEntry.prototype.write=function(e){this.writeHeader(e),this.size+=20,e.writeUint32(0),e.writeUint32(0),e.writeUint16(this.channel_count),e.writeUint16(this.samplesize),e.writeUint16(0),e.writeUint16(0),e.writeUint32(this.samplerate<<16),this.writeFooter(e)},d.stppSampleEntry.prototype.write=function(e){this.writeHeader(e),this.size+=this.namespace.length+1+this.schema_location.length+1+this.auxiliary_mime_types.length+1,e.writeCString(this.namespace),e.writeCString(this.schema_location),e.writeCString(this.auxiliary_mime_types),this.writeFooter(e)},d.SampleGroupEntry.prototype.write=function(e){e.writeUint8Array(this.data)},d.sbgpBox.prototype.write=function(e){this.version=1,this.flags=0,this.size=12+8*this.entries.length,this.writeHeader(e),e.writeString(this.grouping_type,null,4),e.writeUint32(this.grouping_type_parameter),e.writeUint32(this.entries.length);for(var t=0;t<this.entries.length;t++){var i=this.entries[t];e.writeInt32(i.sample_count),e.writeInt32(i.group_description_index)}},d.sgpdBox.prototype.write=function(e){var t,i;for(this.flags=0,this.size=12,t=0;t<this.entries.length;t++)i=this.entries[t],1===this.version&&(0===this.default_length&&(this.size+=4),this.size+=i.data.length);for(this.writeHeader(e),e.writeString(this.grouping_type,null,4),1===this.version&&e.writeUint32(this.default_length),this.version>=2&&e.writeUint32(this.default_sample_description_index),e.writeUint32(this.entries.length),t=0;t<this.entries.length;t++)i=this.entries[t],1===this.version&&0===this.default_length&&e.writeUint32(i.description_length),i.write(e)},d.sidxBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=20+12*this.references.length,this.writeHeader(e),e.writeUint32(this.reference_ID),e.writeUint32(this.timescale),e.writeUint32(this.earliest_presentation_time),e.writeUint32(this.first_offset),e.writeUint16(0),e.writeUint16(this.references.length);for(var t=0;t<this.references.length;t++){var i=this.references[t];e.writeUint32(i.reference_type<<31|i.referenced_size),e.writeUint32(i.subsegment_duration),e.writeUint32(i.starts_with_SAP<<31|i.SAP_type<<28|i.SAP_delta_time)}},d.smhdBox.prototype.write=function(e){this.version=0,this.flags=1,this.size=4,this.writeHeader(e),e.writeUint16(this.balance),e.writeUint16(0)},d.stcoBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=4+4*this.chunk_offsets.length,this.writeHeader(e),e.writeUint32(this.chunk_offsets.length),e.writeUint32Array(this.chunk_offsets)},d.stscBox.prototype.write=function(e){var t;for(this.version=0,this.flags=0,this.size=4+12*this.first_chunk.length,this.writeHeader(e),e.writeUint32(this.first_chunk.length),t=0;t<this.first_chunk.length;t++)e.writeUint32(this.first_chunk[t]),e.writeUint32(this.samples_per_chunk[t]),e.writeUint32(this.sample_description_index[t])},d.stsdBox.prototype.write=function(e){var t;for(this.version=0,this.flags=0,this.size=0,this.writeHeader(e),e.writeUint32(this.entries.length),this.size+=4,t=0;t<this.entries.length;t++)this.entries[t].write(e),this.size+=this.entries[t].size;n.debug("BoxWriter","Adjusting box "+this.type+" with new size "+this.size),e.adjustUint32(this.sizePosition,this.size)},d.stshBox.prototype.write=function(e){var t;for(this.version=0,this.flags=0,this.size=4+8*this.shadowed_sample_numbers.length,this.writeHeader(e),e.writeUint32(this.shadowed_sample_numbers.length),t=0;t<this.shadowed_sample_numbers.length;t++)e.writeUint32(this.shadowed_sample_numbers[t]),e.writeUint32(this.sync_sample_numbers[t])},d.stssBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=4+4*this.sample_numbers.length,this.writeHeader(e),e.writeUint32(this.sample_numbers.length),e.writeUint32Array(this.sample_numbers)},d.stszBox.prototype.write=function(e){var t,i=!0;if(this.version=0,this.flags=0,this.sample_sizes.length>0)for(t=0;t+1<this.sample_sizes.length;){if(this.sample_sizes[t+1]!==this.sample_sizes[0]){i=!1;break}t++}else i=!1;this.size=8,i||(this.size+=4*this.sample_sizes.length),this.writeHeader(e),i?e.writeUint32(this.sample_sizes[0]):e.writeUint32(0),e.writeUint32(this.sample_sizes.length),i||e.writeUint32Array(this.sample_sizes)},d.sttsBox.prototype.write=function(e){var t;for(this.version=0,this.flags=0,this.size=4+8*this.sample_counts.length,this.writeHeader(e),e.writeUint32(this.sample_counts.length),t=0;t<this.sample_counts.length;t++)e.writeUint32(this.sample_counts[t]),e.writeUint32(this.sample_deltas[t])},d.tfdtBox.prototype.write=function(e){var t=Math.pow(2,32)-1;this.version=this.baseMediaDecodeTime>t?1:0,this.flags=0,this.size=4,1===this.version&&(this.size+=4),this.writeHeader(e),1===this.version?e.writeUint64(this.baseMediaDecodeTime):e.writeUint32(this.baseMediaDecodeTime)},d.tfhdBox.prototype.write=function(e){this.version=0,this.size=4,this.flags&d.TFHD_FLAG_BASE_DATA_OFFSET&&(this.size+=8),this.flags&d.TFHD_FLAG_SAMPLE_DESC&&(this.size+=4),this.flags&d.TFHD_FLAG_SAMPLE_DUR&&(this.size+=4),this.flags&d.TFHD_FLAG_SAMPLE_SIZE&&(this.size+=4),this.flags&d.TFHD_FLAG_SAMPLE_FLAGS&&(this.size+=4),this.writeHeader(e),e.writeUint32(this.track_id),this.flags&d.TFHD_FLAG_BASE_DATA_OFFSET&&e.writeUint64(this.base_data_offset),this.flags&d.TFHD_FLAG_SAMPLE_DESC&&e.writeUint32(this.default_sample_description_index),this.flags&d.TFHD_FLAG_SAMPLE_DUR&&e.writeUint32(this.default_sample_duration),this.flags&d.TFHD_FLAG_SAMPLE_SIZE&&e.writeUint32(this.default_sample_size),this.flags&d.TFHD_FLAG_SAMPLE_FLAGS&&e.writeUint32(this.default_sample_flags)},d.tkhdBox.prototype.write=function(e){this.version=0,this.size=80,this.writeHeader(e),e.writeUint32(this.creation_time),e.writeUint32(this.modification_time),e.writeUint32(this.track_id),e.writeUint32(0),e.writeUint32(this.duration),e.writeUint32(0),e.writeUint32(0),e.writeInt16(this.layer),e.writeInt16(this.alternate_group),e.writeInt16(this.volume<<8),e.writeUint16(0),e.writeInt32Array(this.matrix),e.writeUint32(this.width),e.writeUint32(this.height)},d.trexBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=20,this.writeHeader(e),e.writeUint32(this.track_id),e.writeUint32(this.default_sample_description_index),e.writeUint32(this.default_sample_duration),e.writeUint32(this.default_sample_size),e.writeUint32(this.default_sample_flags)},d.trunBox.prototype.write=function(e){this.version=0,this.size=4,this.flags&d.TRUN_FLAGS_DATA_OFFSET&&(this.size+=4),this.flags&d.TRUN_FLAGS_FIRST_FLAG&&(this.size+=4),this.flags&d.TRUN_FLAGS_DURATION&&(this.size+=4*this.sample_duration.length),this.flags&d.TRUN_FLAGS_SIZE&&(this.size+=4*this.sample_size.length),this.flags&d.TRUN_FLAGS_FLAGS&&(this.size+=4*this.sample_flags.length),this.flags&d.TRUN_FLAGS_CTS_OFFSET&&(this.size+=4*this.sample_composition_time_offset.length),this.writeHeader(e),e.writeUint32(this.sample_count),this.flags&d.TRUN_FLAGS_DATA_OFFSET&&(this.data_offset_position=e.getPosition(),e.writeInt32(this.data_offset)),this.flags&d.TRUN_FLAGS_FIRST_FLAG&&e.writeUint32(this.first_sample_flags);for(var t=0;t<this.sample_count;t++)this.flags&d.TRUN_FLAGS_DURATION&&e.writeUint32(this.sample_duration[t]),this.flags&d.TRUN_FLAGS_SIZE&&e.writeUint32(this.sample_size[t]),this.flags&d.TRUN_FLAGS_FLAGS&&e.writeUint32(this.sample_flags[t]),this.flags&d.TRUN_FLAGS_CTS_OFFSET&&(0===this.version?e.writeUint32(this.sample_composition_time_offset[t]):e.writeInt32(this.sample_composition_time_offset[t]))},d["url Box"].prototype.write=function(e){this.version=0,this.location?(this.flags=0,this.size=this.location.length+1):(this.flags=1,this.size=0),this.writeHeader(e),this.location&&e.writeCString(this.location)},d["urn Box"].prototype.write=function(e){this.version=0,this.flags=0,this.size=this.name.length+1+(this.location?this.location.length+1:0),this.writeHeader(e),e.writeCString(this.name),this.location&&e.writeCString(this.location)},d.vmhdBox.prototype.write=function(e){this.version=0,this.flags=1,this.size=8,this.writeHeader(e),e.writeUint16(this.graphicsmode),e.writeUint16Array(this.opcolor)},d.cttsBox.prototype.unpack=function(e){var t,i,r;for(r=0,t=0;t<this.sample_counts.length;t++)for(i=0;i<this.sample_counts[t];i++)e[r].pts=e[r].dts+this.sample_offsets[t],r++},d.sttsBox.prototype.unpack=function(e){var t,i,r;for(r=0,t=0;t<this.sample_counts.length;t++)for(i=0;i<this.sample_counts[t];i++)e[r].dts=0===r?0:e[r-1].dts+this.sample_deltas[t],r++},d.stcoBox.prototype.unpack=function(e){var t;for(t=0;t<this.chunk_offsets.length;t++)e[t].offset=this.chunk_offsets[t]},d.stscBox.prototype.unpack=function(e){var t,i,r,a,n;for(a=0,n=0,t=0;t<this.first_chunk.length;t++)for(i=0;i<(t+1<this.first_chunk.length?this.first_chunk[t+1]:1/0);i++)for(n++,r=0;r<this.samples_per_chunk[t];r++){if(!e[a])return;e[a].description_index=this.sample_description_index[t],e[a].chunk_index=n,a++}},d.stszBox.prototype.unpack=function(e){var t;for(t=0;t<this.sample_sizes.length;t++)e[t].size=this.sample_sizes[t]},d.DIFF_BOXES_PROP_NAMES=["boxes","entries","references","subsamples","items","item_infos","extents","associations","subsegments","ranges","seekLists","seekPoints","esd","levels"],d.DIFF_PRIMITIVE_ARRAY_PROP_NAMES=["compatible_brands","matrix","opcolor","sample_counts","sample_counts","sample_deltas","first_chunk","samples_per_chunk","sample_sizes","chunk_offsets","sample_offsets","sample_description_index","sample_duration"],d.boxEqualFields=function(e,t){if(e&&!t)return!1;var i;for(i in e)if(!(d.DIFF_BOXES_PROP_NAMES.indexOf(i)>-1||e[i]instanceof d.Box||t[i]instanceof d.Box||void 0===e[i]||void 0===t[i]||"function"==typeof e[i]||"function"==typeof t[i]||e.subBoxNames&&e.subBoxNames.indexOf(i.slice(0,4))>-1||t.subBoxNames&&t.subBoxNames.indexOf(i.slice(0,4))>-1||"data"===i||"start"===i||"size"===i||"creation_time"===i||"modification_time"===i||d.DIFF_PRIMITIVE_ARRAY_PROP_NAMES.indexOf(i)>-1||e[i]===t[i]))return!1;return!0},d.boxEqual=function(e,t){if(!d.boxEqualFields(e,t))return!1;for(var i=0;i<d.DIFF_BOXES_PROP_NAMES.length;i++){var r=d.DIFF_BOXES_PROP_NAMES[i];if(e[r]&&t[r]&&!d.boxEqual(e[r],t[r]))return!1}return!0};var h=function(){};h.prototype.parseSample=function(e){var t,i={resources:[]},r=new s(e.data.buffer);if(e.subsamples&&0!==e.subsamples.length){if(i.documentString=r.readString(e.subsamples[0].size),e.subsamples.length>1)for(t=1;t<e.subsamples.length;t++)i.resources[t]=r.readUint8Array(e.subsamples[t].size)}else i.documentString=r.readString(e.data.length);return("undefined"===typeof DOMParser?"undefined":Object(E["a"])(DOMParser))<"u"&&(i.document=(new DOMParser).parseFromString(i.documentString,"application/xml")),i};var f=function(){};f.prototype.parseSample=function(e){return new s(e.data.buffer).readString(e.data.length)},f.prototype.parseConfig=function(e){var t=new s(e.buffer);return t.readUint32(),t.readCString()},t.XMLSubtitlein4Parser=h,t.Textin4Parser=f;var p=function(e){this.stream=e||new l,this.boxes=[],this.mdats=[],this.moofs=[],this.isProgressive=!1,this.moovStartFound=!1,this.onMoovStart=null,this.moovStartSent=!1,this.onReady=null,this.readySent=!1,this.onSegment=null,this.onSamples=null,this.onError=null,this.sampleListBuilt=!1,this.fragmentedTracks=[],this.extractedTracks=[],this.isFragmentationInitialized=!1,this.sampleProcessingStarted=!1,this.nextMoofNumber=0,this.itemListBuilt=!1,this.onSidx=null,this.sidxSent=!1};p.prototype.setSegmentOptions=function(e,t,i){var r=this.getTrackById(e);if(r){var a={};this.fragmentedTracks.push(a),a.id=e,a.user=t,a.trak=r,r.nextSample=0,a.segmentStream=null,a.nb_samples=1e3,a.rapAlignement=!0,i&&(i.nbSamples&&(a.nb_samples=i.nbSamples),i.rapAlignement&&(a.rapAlignement=i.rapAlignement))}},p.prototype.unsetSegmentOptions=function(e){for(var t=-1,i=0;i<this.fragmentedTracks.length;i++)this.fragmentedTracks[i].id==e&&(t=i);t>-1&&this.fragmentedTracks.splice(t,1)},p.prototype.setExtractionOptions=function(e,t,i){var r=this.getTrackById(e);if(r){var a={};this.extractedTracks.push(a),a.id=e,a.user=t,a.trak=r,r.nextSample=0,a.nb_samples=1e3,a.samples=[],i&&i.nbSamples&&(a.nb_samples=i.nbSamples)}},p.prototype.unsetExtractionOptions=function(e){for(var t=-1,i=0;i<this.extractedTracks.length;i++)this.extractedTracks[i].id==e&&(t=i);t>-1&&this.extractedTracks.splice(t,1)},p.prototype.parse=function(){var e,t;if(!this.restoreParsePosition||this.restoreParsePosition())for(;;){if(this.hasIncompleteMdat&&this.hasIncompleteMdat()){if(this.processIncompleteMdat())continue;return}if(this.saveParsePosition&&this.saveParsePosition(),(e=d.parseOneBox(this.stream,!1)).code===d.ERR_NOT_ENOUGH_DATA){if(this.processIncompleteBox){if(this.processIncompleteBox(e))continue;return}return}var i;switch(i="uuid"!==(t=e.box).type?t.type:t.uuid,this.boxes.push(t),i){case"mdat":this.mdats.push(t);break;case"moof":this.moofs.push(t);break;case"moov":this.moovStartFound=!0,0===this.mdats.length&&(this.isProgressive=!0);default:void 0!==this[i]&&n.warn("ISOFile","Duplicate Box of type: "+i+", overriding previous occurrence"),this[i]=t}this.updateUsedBytes&&this.updateUsedBytes(t,e)}},p.prototype.checkBuffer=function(e){if(null==e)throw"Buffer must be defined and non empty";if(void 0===e.fileStart)throw"Buffer must have a fileStart property";return 0===e.byteLength?(n.warn("ISOFile","Ignoring empty buffer (fileStart: "+e.fileStart+")"),this.stream.logBufferLevel(),!1):(n.info("ISOFile","Processing buffer (fileStart: "+e.fileStart+")"),e.usedBytes=0,this.stream.insertBuffer(e),this.stream.logBufferLevel(),!!this.stream.initialized()||(n.warn("ISOFile","Not ready to start parsing"),!1))},p.prototype.appendBuffer=function(e,t){var i;if(this.checkBuffer(e))return this.parse(),this.moovStartFound&&!this.moovStartSent&&(this.moovStartSent=!0,this.onMoovStart&&this.onMoovStart()),this.moov?(this.sampleListBuilt||(this.buildSampleLists(),this.sampleListBuilt=!0),this.updateSampleLists(),this.onReady&&!this.readySent&&(this.readySent=!0,this.onReady(this.getInfo())),this.processSamples(t),this.nextSeekPosition?(i=this.nextSeekPosition,this.nextSeekPosition=void 0):i=this.nextParsePosition,this.stream.getEndFilePositionAfter&&(i=this.stream.getEndFilePositionAfter(i))):i=this.nextParsePosition?this.nextParsePosition:0,this.sidx&&this.onSidx&&!this.sidxSent&&(this.onSidx(this.sidx),this.sidxSent=!0),this.meta&&(this.flattenItemInfo&&!this.itemListBuilt&&(this.flattenItemInfo(),this.itemListBuilt=!0),this.processItems&&this.processItems(this.onItem)),this.stream.cleanBuffers&&(n.info("ISOFile","Done processing buffer (fileStart: "+e.fileStart+") - next buffer to fetch should have a fileStart position of "+i),this.stream.logBufferLevel(),this.stream.cleanBuffers(),this.stream.logBufferLevel(!0),n.info("ISOFile","Sample data size in memory: "+this.getAllocatedSampleDataSize())),i},p.prototype.getInfo=function(){var e,t,i,r,a,n,s={},o=new Date("1904-01-01T00:00:00Z").getTime();if(this.moov)for(s.hasMoov=!0,s.duration=this.moov.mvhd.duration,s.timescale=this.moov.mvhd.timescale,s.isFragmented=null!=this.moov.mvex,s.isFragmented&&this.moov.mvex.mehd&&(s.fragment_duration=this.moov.mvex.mehd.fragment_duration),s.isProgressive=this.isProgressive,s.hasIOD=null!=this.moov.iods,s.brands=[],s.brands.push(this.ftyp.major_brand),s.brands=s.brands.concat(this.ftyp.compatible_brands),s.created=new Date(o+1e3*this.moov.mvhd.creation_time),s.modified=new Date(o+1e3*this.moov.mvhd.modification_time),s.tracks=[],s.audioTracks=[],s.videoTracks=[],s.subtitleTracks=[],s.metadataTracks=[],s.hintTracks=[],s.otherTracks=[],e=0;e<this.moov.traks.length;e++){if(n=(i=this.moov.traks[e]).mdia.minf.stbl.stsd.entries[0],r={},s.tracks.push(r),r.id=i.tkhd.track_id,r.name=i.mdia.hdlr.name,r.references=[],i.tref)for(t=0;t<i.tref.boxes.length;t++)a={},r.references.push(a),a.type=i.tref.boxes[t].type,a.track_ids=i.tref.boxes[t].track_ids;i.edts&&(r.edits=i.edts.elst.entries),r.created=new Date(o+1e3*i.tkhd.creation_time),r.modified=new Date(o+1e3*i.tkhd.modification_time),r.movie_duration=i.tkhd.duration,r.movie_timescale=s.timescale,r.layer=i.tkhd.layer,r.alternate_group=i.tkhd.alternate_group,r.volume=i.tkhd.volume,r.matrix=i.tkhd.matrix,r.track_width=i.tkhd.width/65536,r.track_height=i.tkhd.height/65536,r.timescale=i.mdia.mdhd.timescale,r.cts_shift=i.mdia.minf.stbl.cslg,r.duration=i.mdia.mdhd.duration,r.samples_duration=i.samples_duration,r.codec=n.getCodec(),r.kind=i.udta&&i.udta.kinds.length?i.udta.kinds[0]:{schemeURI:"",value:""},r.language=i.mdia.elng?i.mdia.elng.extended_language:i.mdia.mdhd.languageString,r.nb_samples=i.samples.length,r.size=i.samples_size,r.bitrate=8*r.size*r.timescale/r.samples_duration,n.isAudio()?(r.type="audio",s.audioTracks.push(r),r.audio={},r.audio.sample_rate=n.getSampleRate(),r.audio.channel_count=n.getChannelCount(),r.audio.sample_size=n.getSampleSize()):n.isVideo()?(r.type="video",s.videoTracks.push(r),r.video={},r.video.width=n.getWidth(),r.video.height=n.getHeight()):n.isSubtitle()?(r.type="subtitles",s.subtitleTracks.push(r)):n.isHint()?(r.type="metadata",s.hintTracks.push(r)):n.isMetadata()?(r.type="metadata",s.metadataTracks.push(r)):(r.type="metadata",s.otherTracks.push(r))}else s.hasMoov=!1;if(s.mime="",s.hasMoov&&s.tracks){for(s.videoTracks&&s.videoTracks.length>0?s.mime+='video/mp4; codecs="':s.audioTracks&&s.audioTracks.length>0?s.mime+='audio/mp4; codecs="':s.mime+='application/mp4; codecs="',e=0;e<s.tracks.length;e++)0!==e&&(s.mime+=","),s.mime+=s.tracks[e].codec;s.mime+='"; profiles="',s.mime+=this.ftyp.compatible_brands.join(),s.mime+='"'}return s},p.prototype.processSamples=function(e){var t,i;if(this.sampleProcessingStarted){if(this.isFragmentationInitialized&&null!==this.onSegment)for(t=0;t<this.fragmentedTracks.length;t++){var r=this.fragmentedTracks[t];for(i=r.trak;i.nextSample<i.samples.length&&this.sampleProcessingStarted;){n.debug("ISOFile","Creating media fragment on track #"+r.id+" for sample "+i.nextSample);var a=this.createFragment(r.id,i.nextSample,r.segmentStream);if(!a||(r.segmentStream=a,i.nextSample++,(i.nextSample%r.nb_samples==0||e||i.nextSample>=i.samples.length)&&(n.info("ISOFile","Sending fragmented data on track #"+r.id+" for samples ["+Math.max(0,i.nextSample-r.nb_samples)+","+(i.nextSample-1)+"]"),n.info("ISOFile","Sample data size in memory: "+this.getAllocatedSampleDataSize()),this.onSegment&&this.onSegment(r.id,r.user,r.segmentStream.buffer,i.nextSample,e||i.nextSample>=i.samples.length),r.segmentStream=null,r!==this.fragmentedTracks[t])))break}}if(null!==this.onSamples)for(t=0;t<this.extractedTracks.length;t++){var s=this.extractedTracks[t];for(i=s.trak;i.nextSample<i.samples.length&&this.sampleProcessingStarted;){n.debug("ISOFile","Exporting on track #"+s.id+" sample #"+i.nextSample);var o=this.getSample(i,i.nextSample);if(!o||(i.nextSample++,s.samples.push(o),(i.nextSample%s.nb_samples==0||i.nextSample>=i.samples.length)&&(n.debug("ISOFile","Sending samples on track #"+s.id+" for sample "+i.nextSample),this.onSamples&&this.onSamples(s.id,s.user,s.samples),s.samples=[],s!==this.extractedTracks[t])))break}}}},p.prototype.getBox=function(e){var t=this.getBoxes(e,!0);return t.length?t[0]:null},p.prototype.getBoxes=function(e,t){var i=[];return p._sweep.call(this,e,i,t),i},p._sweep=function(e,t,i){for(var r in this.type&&this.type==e&&t.push(this),this.boxes){if(t.length&&i)return;p._sweep.call(this.boxes[r],e,t,i)}},p.prototype.getTrackSamplesInfo=function(e){var t=this.getTrackById(e);return t?t.samples:void 0},p.prototype.getTrackSample=function(e,t){var i=this.getTrackById(e);return this.getSample(i,t)},p.prototype.releaseUsedSamples=function(e,t){var i=0,r=this.getTrackById(e);r.lastValidSample||(r.lastValidSample=0);for(var a=r.lastValidSample;a<t;a++)i+=this.releaseSample(r,a);n.info("ISOFile","Track #"+e+" released samples up to "+t+" (released size: "+i+", remaining: "+this.samplesDataSize+")"),r.lastValidSample=t},p.prototype.start=function(){this.sampleProcessingStarted=!0,this.processSamples(!1)},p.prototype.stop=function(){this.sampleProcessingStarted=!1},p.prototype.flush=function(){n.info("ISOFile","Flushing remaining samples"),this.updateSampleLists(),this.processSamples(!0),this.stream.cleanBuffers(),this.stream.logBufferLevel(!0)},p.prototype.seekTrack=function(e,t,i){var r,a,s,o,c=0,l=0;if(0===i.samples.length)return n.info("ISOFile","No sample in track, cannot seek! Using time "+n.getDurationString(0,1)+" and offset: 0"),{offset:0,time:0};for(r=0;r<i.samples.length;r++){if(a=i.samples[r],0===r)l=0,o=a.timescale;else if(a.cts>e*a.timescale){l=r-1;break}t&&a.is_sync&&(c=r)}for(t&&(l=c),e=i.samples[l].cts,i.nextSample=l;i.samples[l].alreadyRead===i.samples[l].size&&i.samples[l+1];)l++;return s=i.samples[l].offset+i.samples[l].alreadyRead,n.info("ISOFile","Seeking to "+(t?"RAP":"")+" sample #"+i.nextSample+" on track "+i.tkhd.track_id+", time "+n.getDurationString(e,o)+" and offset: "+s),{offset:s,time:e/o}},p.prototype.seek=function(e,t){var i,r,a,s=this.moov,o={offset:1/0,time:1/0};if(this.moov){for(a=0;a<s.traks.length;a++)i=s.traks[a],(r=this.seekTrack(e,t,i)).offset<o.offset&&(o.offset=r.offset),r.time<o.time&&(o.time=r.time);return n.info("ISOFile","Seeking at time "+n.getDurationString(o.time,1)+" needs a buffer with a fileStart position of "+o.offset),o.offset===1/0?o={offset:this.nextParsePosition,time:0}:o.offset=this.stream.getEndFilePositionAfter(o.offset),n.info("ISOFile","Adjusted seek position (after checking data already in buffer): "+o.offset),o}throw"Cannot seek: moov not received!"},p.prototype.equal=function(e){for(var t=0;t<this.boxes.length&&t<e.boxes.length;){var i=this.boxes[t],r=e.boxes[t];if(!d.boxEqual(i,r))return!1;t++}return!0},t.ISOFile=p,p.prototype.lastBoxStartPosition=0,p.prototype.parsingMdat=null,p.prototype.nextParsePosition=0,p.prototype.discardMdatData=!1,p.prototype.processIncompleteBox=function(e){var t;return"mdat"===e.type?(t=new d[e.type+"Box"](e.size),this.parsingMdat=t,this.boxes.push(t),this.mdats.push(t),t.start=e.start,t.hdr_size=e.hdr_size,this.stream.addUsedBytes(t.hdr_size),this.lastBoxStartPosition=t.start+t.size,this.stream.seek(t.start+t.size,!1,this.discardMdatData)?(this.parsingMdat=null,!0):(this.moovStartFound?this.nextParsePosition=this.stream.findEndContiguousBuf():this.nextParsePosition=t.start+t.size,!1)):("moov"===e.type&&(this.moovStartFound=!0,0===this.mdats.length&&(this.isProgressive=!0)),this.stream.mergeNextBuffer&&this.stream.mergeNextBuffer()?(this.nextParsePosition=this.stream.getEndPosition(),!0):(e.type?this.moovStartFound?this.nextParsePosition=this.stream.getEndPosition():this.nextParsePosition=this.stream.getPosition()+e.size:this.nextParsePosition=this.stream.getEndPosition(),!1))},p.prototype.hasIncompleteMdat=function(){return null!==this.parsingMdat},p.prototype.processIncompleteMdat=function(){var e;return e=this.parsingMdat,this.stream.seek(e.start+e.size,!1,this.discardMdatData)?(n.debug("ISOFile","Found 'mdat' end in buffered data"),this.parsingMdat=null,!0):(this.nextParsePosition=this.stream.findEndContiguousBuf(),!1)},p.prototype.restoreParsePosition=function(){return this.stream.seek(this.lastBoxStartPosition,!0,this.discardMdatData)},p.prototype.saveParsePosition=function(){this.lastBoxStartPosition=this.stream.getPosition()},p.prototype.updateUsedBytes=function(e,t){this.stream.addUsedBytes&&("mdat"===e.type?(this.stream.addUsedBytes(e.hdr_size),this.discardMdatData&&this.stream.addUsedBytes(e.size-e.hdr_size)):this.stream.addUsedBytes(e.size))},p.prototype.add=d.Box.prototype.add,p.prototype.addBox=d.Box.prototype.addBox,p.prototype.init=function(e){var t=e||{};this.add("ftyp").set("major_brand",t.brands&&t.brands[0]||"iso4").set("minor_version",0).set("compatible_brands",t.brands||["iso4"]);var i=this.add("moov");return i.add("mvhd").set("timescale",t.timescale||600).set("rate",t.rate||65536).set("creation_time",0).set("modification_time",0).set("duration",t.duration||0).set("volume",t.width?0:256).set("matrix",[65536,0,0,0,65536,0,0,0,1073741824]).set("next_track_id",1),i.add("mvex"),this},p.prototype.addTrack=function(e){this.moov||this.init(e);var t=e||{};t.width=t.width||320,t.height=t.height||320,t.id=t.id||this.moov.mvhd.next_track_id,t.type=t.type||"avc1";var i=this.moov.add("trak");this.moov.mvhd.next_track_id=t.id+1,i.add("tkhd").set("flags",d.TKHD_FLAG_ENABLED|d.TKHD_FLAG_IN_MOVIE|d.TKHD_FLAG_IN_PREVIEW).set("creation_time",0).set("modification_time",0).set("track_id",t.id).set("duration",t.duration||0).set("layer",t.layer||0).set("alternate_group",0).set("volume",1).set("matrix",[0,0,0,0,0,0,0,0,0]).set("width",t.width<<16).set("height",t.height<<16);var r=i.add("mdia");r.add("mdhd").set("creation_time",0).set("modification_time",0).set("timescale",t.timescale||1).set("duration",t.media_duration||0).set("language",t.language||"und"),r.add("hdlr").set("handler",t.hdlr||"vide").set("name",t.name||"Track created with MP4Box.js"),r.add("elng").set("extended_language",t.language||"fr-FR");var a=r.add("minf");if(void 0!==d[t.type+"SampleEntry"]){var n=new d[t.type+"SampleEntry"];n.data_reference_index=1;var o="";for(var c in d.sampleEntryCodes)for(var l=d.sampleEntryCodes[c],u=0;u<l.length;u++)if(l.indexOf(t.type)>-1){o=c;break}switch(o){case"Visual":if(a.add("vmhd").set("graphicsmode",0).set("opcolor",[0,0,0]),n.set("width",t.width).set("height",t.height).set("horizresolution",72<<16).set("vertresolution",72<<16).set("frame_count",1).set("compressorname",t.type+" Compressor").set("depth",24),t.avcDecoderConfigRecord){var h=new d.avcCBox,f=new s(t.avcDecoderConfigRecord);h.parse(f),n.addBox(h)}break;case"Audio":a.add("smhd").set("balance",t.balance||0),n.set("channel_count",t.channel_count||2).set("samplesize",t.samplesize||16).set("samplerate",t.samplerate||65536);break;case"Hint":a.add("hmhd");break;case"Subtitle":a.add("sthd"),"stpp"===t.type&&n.set("namespace",t.namespace||"nonamespace").set("schema_location",t.schema_location||"").set("auxiliary_mime_types",t.auxiliary_mime_types||"");break;default:a.add("nmhd")}t.description&&n.addBox(t.description),t.description_boxes&&t.description_boxes.forEach((function(e){n.addBox(e)})),a.add("dinf").add("dref").addEntry((new d["url Box"]).set("flags",1));var p=a.add("stbl");return p.add("stsd").addEntry(n),p.add("stts").set("sample_counts",[]).set("sample_deltas",[]),p.add("stsc").set("first_chunk",[]).set("samples_per_chunk",[]).set("sample_description_index",[]),p.add("stco").set("chunk_offsets",[]),p.add("stsz").set("sample_sizes",[]),this.moov.mvex.add("trex").set("track_id",t.id).set("default_sample_description_index",t.default_sample_description_index||1).set("default_sample_duration",t.default_sample_duration||0).set("default_sample_size",t.default_sample_size||0).set("default_sample_flags",t.default_sample_flags||0),this.buildTrakSampleLists(i),t.id}},d.Box.prototype.computeSize=function(e){var t=e||new o;t.endianness=o.BIG_ENDIAN,this.write(t)},p.prototype.addSample=function(e,t,i){var r=i||{},a={},n=this.getTrackById(e);if(null!==n){a.number=n.samples.length,a.track_id=n.tkhd.track_id,a.timescale=n.mdia.mdhd.timescale,a.description_index=r.sample_description_index?r.sample_description_index-1:0,a.description=n.mdia.minf.stbl.stsd.entries[a.description_index],a.data=t,a.size=t.byteLength,a.alreadyRead=a.size,a.duration=r.duration||1,a.cts=r.cts||0,a.dts=r.dts||0,a.is_sync=r.is_sync||!1,a.is_leading=r.is_leading||0,a.depends_on=r.depends_on||0,a.is_depended_on=r.is_depended_on||0,a.has_redundancy=r.has_redundancy||0,a.degradation_priority=r.degradation_priority||0,a.offset=0,a.subsamples=r.subsamples,n.samples.push(a),n.samples_size+=a.size,n.samples_duration+=a.duration,n.first_dts||(n.first_dts=r.dts),this.processSamples();var s=this.createSingleSampleMoof(a);return this.addBox(s),s.computeSize(),s.trafs[0].truns[0].data_offset=s.size+8,this.add("mdat").data=new Uint8Array(t),a}},p.prototype.createSingleSampleMoof=function(e){var t=0;t=e.is_sync?1<<25:65536;var i=new d.moofBox;i.add("mfhd").set("sequence_number",this.nextMoofNumber),this.nextMoofNumber++;var r=i.add("traf"),a=this.getTrackById(e.track_id);return r.add("tfhd").set("track_id",e.track_id).set("flags",d.TFHD_FLAG_DEFAULT_BASE_IS_MOOF),r.add("tfdt").set("baseMediaDecodeTime",e.dts-(a.first_dts||0)),r.add("trun").set("flags",d.TRUN_FLAGS_DATA_OFFSET|d.TRUN_FLAGS_DURATION|d.TRUN_FLAGS_SIZE|d.TRUN_FLAGS_FLAGS|d.TRUN_FLAGS_CTS_OFFSET).set("data_offset",0).set("first_sample_flags",0).set("sample_count",1).set("sample_duration",[e.duration]).set("sample_size",[e.size]).set("sample_flags",[t]).set("sample_composition_time_offset",[e.cts-e.dts]),i},p.prototype.lastMoofIndex=0,p.prototype.samplesDataSize=0,p.prototype.resetTables=function(){var e,t,i,r,a,n;for(this.initial_duration=this.moov.mvhd.duration,this.moov.mvhd.duration=0,e=0;e<this.moov.traks.length;e++){(t=this.moov.traks[e]).tkhd.duration=0,t.mdia.mdhd.duration=0,(t.mdia.minf.stbl.stco||t.mdia.minf.stbl.co64).chunk_offsets=[],(i=t.mdia.minf.stbl.stsc).first_chunk=[],i.samples_per_chunk=[],i.sample_description_index=[],(t.mdia.minf.stbl.stsz||t.mdia.minf.stbl.stz2).sample_sizes=[],(r=t.mdia.minf.stbl.stts).sample_counts=[],r.sample_deltas=[],(a=t.mdia.minf.stbl.ctts)&&(a.sample_counts=[],a.sample_offsets=[]),n=t.mdia.minf.stbl.stss;var s=t.mdia.minf.stbl.boxes.indexOf(n);-1!=s&&(t.mdia.minf.stbl.boxes[s]=null)}},p.initSampleGroups=function(e,t,i,r,a){var n,s,o,c;function l(e,t,i){this.grouping_type=e,this.grouping_type_parameter=t,this.sbgp=i,this.last_sample_in_run=-1,this.entry_index=-1}for(t&&(t.sample_groups_info=[]),e.sample_groups_info||(e.sample_groups_info=[]),s=0;s<i.length;s++){for(c=i[s].grouping_type+"/"+i[s].grouping_type_parameter,o=new l(i[s].grouping_type,i[s].grouping_type_parameter,i[s]),t&&(t.sample_groups_info[c]=o),e.sample_groups_info[c]||(e.sample_groups_info[c]=o),n=0;n<r.length;n++)r[n].grouping_type===i[s].grouping_type&&(o.description=r[n],o.description.used=!0);if(a)for(n=0;n<a.length;n++)a[n].grouping_type===i[s].grouping_type&&(o.fragment_description=a[n],o.fragment_description.used=!0,o.is_fragment=!0)}if(t){if(a)for(s=0;s<a.length;s++)!a[s].used&&a[s].version>=2&&(c=a[s].grouping_type+"/0",(o=new l(a[s].grouping_type,0)).is_fragment=!0,t.sample_groups_info[c]||(t.sample_groups_info[c]=o))}else for(s=0;s<r.length;s++)!r[s].used&&r[s].version>=2&&(c=r[s].grouping_type+"/0",o=new l(r[s].grouping_type,0),e.sample_groups_info[c]||(e.sample_groups_info[c]=o))},p.setSampleGroupProperties=function(e,t,i,r){var a,n;for(a in t.sample_groups=[],r){var s;t.sample_groups[a]={},t.sample_groups[a].grouping_type=r[a].grouping_type,t.sample_groups[a].grouping_type_parameter=r[a].grouping_type_parameter,i>=r[a].last_sample_in_run&&(r[a].last_sample_in_run<0&&(r[a].last_sample_in_run=0),r[a].entry_index++,r[a].entry_index<=r[a].sbgp.entries.length-1&&(r[a].last_sample_in_run+=r[a].sbgp.entries[r[a].entry_index].sample_count)),r[a].entry_index<=r[a].sbgp.entries.length-1?t.sample_groups[a].group_description_index=r[a].sbgp.entries[r[a].entry_index].group_description_index:t.sample_groups[a].group_description_index=-1,0!==t.sample_groups[a].group_description_index&&(s=r[a].fragment_description?r[a].fragment_description:r[a].description,t.sample_groups[a].group_description_index>0?(n=t.sample_groups[a].group_description_index>65535?(t.sample_groups[a].group_description_index>>16)-1:t.sample_groups[a].group_description_index-1,s&&n>=0&&(t.sample_groups[a].description=s.entries[n])):s&&s.version>=2&&s.default_group_description_index>0&&(t.sample_groups[a].description=s.entries[s.default_group_description_index-1]))}},p.process_sdtp=function(e,t,i){t&&(e?(t.is_leading=e.is_leading[i],t.depends_on=e.sample_depends_on[i],t.is_depended_on=e.sample_is_depended_on[i],t.has_redundancy=e.sample_has_redundancy[i]):(t.is_leading=0,t.depends_on=0,t.is_depended_on=0,t.has_redundancy=0))},p.prototype.buildSampleLists=function(){var e,t;for(e=0;e<this.moov.traks.length;e++)t=this.moov.traks[e],this.buildTrakSampleLists(t)},p.prototype.buildTrakSampleLists=function(e){var t,i,r,a,n,s,o,c,l,u,d,h,f,m,g,y,v,b,A,k,_,w,S,T;if(e.samples=[],e.samples_duration=0,e.samples_size=0,i=e.mdia.minf.stbl.stco||e.mdia.minf.stbl.co64,r=e.mdia.minf.stbl.stsc,a=e.mdia.minf.stbl.stsz||e.mdia.minf.stbl.stz2,n=e.mdia.minf.stbl.stts,s=e.mdia.minf.stbl.ctts,o=e.mdia.minf.stbl.stss,c=e.mdia.minf.stbl.stsd,l=e.mdia.minf.stbl.subs,h=e.mdia.minf.stbl.stdp,u=e.mdia.minf.stbl.sbgps,d=e.mdia.minf.stbl.sgpds,b=-1,A=-1,k=-1,_=-1,w=0,S=0,T=0,p.initSampleGroups(e,null,u,d),void 0!==a){for(t=0;t<a.sample_sizes.length;t++){var E={};E.number=t,E.track_id=e.tkhd.track_id,E.timescale=e.mdia.mdhd.timescale,E.alreadyRead=0,e.samples[t]=E,E.size=a.sample_sizes[t],e.samples_size+=E.size,0===t?(m=1,f=0,E.chunk_index=m,E.chunk_run_index=f,v=r.samples_per_chunk[f],y=0,g=f+1<r.first_chunk.length?r.first_chunk[f+1]-1:1/0):t<v?(E.chunk_index=m,E.chunk_run_index=f):(m++,E.chunk_index=m,y=0,m<=g||(g=1+ ++f<r.first_chunk.length?r.first_chunk[f+1]-1:1/0),E.chunk_run_index=f,v+=r.samples_per_chunk[f]),E.description_index=r.sample_description_index[E.chunk_run_index]-1,E.description=c.entries[E.description_index],E.offset=i.chunk_offsets[E.chunk_index-1]+y,y+=E.size,t>b&&(A++,b<0&&(b=0),b+=n.sample_counts[A]),t>0?(e.samples[t-1].duration=n.sample_deltas[A],e.samples_duration+=e.samples[t-1].duration,E.dts=e.samples[t-1].dts+e.samples[t-1].duration):E.dts=0,s?(t>=k&&(_++,k<0&&(k=0),k+=s.sample_counts[_]),E.cts=e.samples[t].dts+s.sample_offsets[_]):E.cts=E.dts,o?(t==o.sample_numbers[w]-1?(E.is_sync=!0,w++):(E.is_sync=!1,E.degradation_priority=0),l&&l.entries[S].sample_delta+T==t+1&&(E.subsamples=l.entries[S].subsamples,T+=l.entries[S].sample_delta,S++)):E.is_sync=!0,p.process_sdtp(e.mdia.minf.stbl.sdtp,E,E.number),E.degradation_priority=h?h.priority[t]:0,l&&l.entries[S].sample_delta+T==t&&(E.subsamples=l.entries[S].subsamples,T+=l.entries[S].sample_delta),(u.length>0||d.length>0)&&p.setSampleGroupProperties(e,E,t,e.sample_groups_info)}t>0&&(e.samples[t-1].duration=Math.max(e.mdia.mdhd.duration-e.samples[t-1].dts,0),e.samples_duration+=e.samples[t-1].duration)}},p.prototype.updateSampleLists=function(){var e,t,i,r,a,n,s,o,c,l,u,h,f,m,g;if(void 0!==this.moov)for(;this.lastMoofIndex<this.moofs.length;)if(c=this.moofs[this.lastMoofIndex],this.lastMoofIndex++,"moof"==c.type)for(l=c,e=0;e<l.trafs.length;e++){for(u=l.trafs[e],h=this.getTrackById(u.tfhd.track_id),f=this.getTrexById(u.tfhd.track_id),r=u.tfhd.flags&d.TFHD_FLAG_SAMPLE_DESC?u.tfhd.default_sample_description_index:f?f.default_sample_description_index:1,a=u.tfhd.flags&d.TFHD_FLAG_SAMPLE_DUR?u.tfhd.default_sample_duration:f?f.default_sample_duration:0,n=u.tfhd.flags&d.TFHD_FLAG_SAMPLE_SIZE?u.tfhd.default_sample_size:f?f.default_sample_size:0,s=u.tfhd.flags&d.TFHD_FLAG_SAMPLE_FLAGS?u.tfhd.default_sample_flags:f?f.default_sample_flags:0,u.sample_number=0,u.sbgps.length>0&&p.initSampleGroups(h,u,u.sbgps,h.mdia.minf.stbl.sgpds,u.sgpds),t=0;t<u.truns.length;t++){var y=u.truns[t];for(i=0;i<y.sample_count;i++){(m={}).moof_number=this.lastMoofIndex,m.number_in_traf=u.sample_number,u.sample_number++,m.number=h.samples.length,u.first_sample_index=h.samples.length,h.samples.push(m),m.track_id=h.tkhd.track_id,m.timescale=h.mdia.mdhd.timescale,m.description_index=r-1,m.description=h.mdia.minf.stbl.stsd.entries[m.description_index],m.size=n,y.flags&d.TRUN_FLAGS_SIZE&&(m.size=y.sample_size[i]),h.samples_size+=m.size,m.duration=a,y.flags&d.TRUN_FLAGS_DURATION&&(m.duration=y.sample_duration[i]),h.samples_duration+=m.duration,h.first_traf_merged||i>0?m.dts=h.samples[h.samples.length-2].dts+h.samples[h.samples.length-2].duration:(u.tfdt?m.dts=u.tfdt.baseMediaDecodeTime:m.dts=0,h.first_traf_merged=!0),m.cts=m.dts,y.flags&d.TRUN_FLAGS_CTS_OFFSET&&(m.cts=m.dts+y.sample_composition_time_offset[i]),g=s,y.flags&d.TRUN_FLAGS_FLAGS?g=y.sample_flags[i]:0===i&&y.flags&d.TRUN_FLAGS_FIRST_FLAG&&(g=y.first_sample_flags),m.is_sync=!(g>>16&1),m.is_leading=g>>26&3,m.depends_on=g>>24&3,m.is_depended_on=g>>22&3,m.has_redundancy=g>>20&3,m.degradation_priority=65535&g;var v=!!(u.tfhd.flags&d.TFHD_FLAG_BASE_DATA_OFFSET),b=!!(u.tfhd.flags&d.TFHD_FLAG_DEFAULT_BASE_IS_MOOF),A=!!(y.flags&d.TRUN_FLAGS_DATA_OFFSET),k=0;k=v?u.tfhd.base_data_offset:b||0===t?l.start:o,m.offset=0===t&&0===i?A?k+y.data_offset:k:o,o=m.offset+m.size,(u.sbgps.length>0||u.sgpds.length>0||h.mdia.minf.stbl.sbgps.length>0||h.mdia.minf.stbl.sgpds.length>0)&&p.setSampleGroupProperties(h,m,m.number_in_traf,u.sample_groups_info)}}if(u.subs){h.has_fragment_subsamples=!0;var _=u.first_sample_index;for(t=0;t<u.subs.entries.length;t++)_+=u.subs.entries[t].sample_delta,(m=h.samples[_-1]).subsamples=u.subs.entries[t].subsamples}}},p.prototype.getSample=function(e,t){var i,r=e.samples[t];if(!this.moov)return null;if(r.data){if(r.alreadyRead==r.size)return r}else r.data=new Uint8Array(r.size),r.alreadyRead=0,this.samplesDataSize+=r.size,n.debug("ISOFile","Allocating sample #"+t+" on track #"+e.tkhd.track_id+" of size "+r.size+" (total: "+this.samplesDataSize+")");for(;;){var a=this.stream.findPosition(!0,r.offset+r.alreadyRead,!1);if(!(a>-1))return null;var s=(i=this.stream.buffers[a]).byteLength-(r.offset+r.alreadyRead-i.fileStart);if(r.size-r.alreadyRead<=s)return n.debug("ISOFile","Getting sample #"+t+" data (alreadyRead: "+r.alreadyRead+" offset: "+(r.offset+r.alreadyRead-i.fileStart)+" read size: "+(r.size-r.alreadyRead)+" full size: "+r.size+")"),o.memcpy(r.data.buffer,r.alreadyRead,i,r.offset+r.alreadyRead-i.fileStart,r.size-r.alreadyRead),i.usedBytes+=r.size-r.alreadyRead,this.stream.logBufferLevel(),r.alreadyRead=r.size,r;if(0===s)return null;n.debug("ISOFile","Getting sample #"+t+" partial data (alreadyRead: "+r.alreadyRead+" offset: "+(r.offset+r.alreadyRead-i.fileStart)+" read size: "+s+" full size: "+r.size+")"),o.memcpy(r.data.buffer,r.alreadyRead,i,r.offset+r.alreadyRead-i.fileStart,s),r.alreadyRead+=s,i.usedBytes+=s,this.stream.logBufferLevel()}},p.prototype.releaseSample=function(e,t){var i=e.samples[t];return i.data?(this.samplesDataSize-=i.size,i.data=null,i.alreadyRead=0,i.size):0},p.prototype.getAllocatedSampleDataSize=function(){return this.samplesDataSize},p.prototype.getCodecs=function(){var e,t="";for(e=0;e<this.moov.traks.length;e++)e>0&&(t+=","),t+=this.moov.traks[e].mdia.minf.stbl.stsd.entries[0].getCodec();return t},p.prototype.getTrexById=function(e){var t;if(!this.moov||!this.moov.mvex)return null;for(t=0;t<this.moov.mvex.trexs.length;t++){var i=this.moov.mvex.trexs[t];if(i.track_id==e)return i}return null},p.prototype.getTrackById=function(e){if(void 0===this.moov)return null;for(var t=0;t<this.moov.traks.length;t++){var i=this.moov.traks[t];if(i.tkhd.track_id==e)return i}return null},p.prototype.items=[],p.prototype.itemsDataSize=0,p.prototype.flattenItemInfo=function(){var e,t,i,r=this.items,a=this.meta;if(null!=a&&void 0!==a.hdlr&&void 0!==a.iinf){for(e=0;e<a.iinf.item_infos.length;e++)(i={}).id=a.iinf.item_infos[e].item_ID,r[i.id]=i,i.ref_to=[],i.name=a.iinf.item_infos[e].item_name,a.iinf.item_infos[e].protection_index>0&&(i.protection=a.ipro.protections[a.iinf.item_infos[e].protection_index-1]),a.iinf.item_infos[e].item_type?i.type=a.iinf.item_infos[e].item_type:i.type="mime",i.content_type=a.iinf.item_infos[e].content_type,i.content_encoding=a.iinf.item_infos[e].content_encoding;if(a.iloc)for(e=0;e<a.iloc.items.length;e++){var s=a.iloc.items[e];switch(i=r[s.item_ID],0!==s.data_reference_index&&(n.warn("Item storage with reference to other files: not supported"),i.source=a.dinf.boxes[s.data_reference_index-1]),s.construction_method){case 0:break;case 1:case 2:n.warn("Item storage with construction_method : not supported")}for(i.extents=[],i.size=0,t=0;t<s.extents.length;t++)i.extents[t]={},i.extents[t].offset=s.extents[t].extent_offset+s.base_offset,i.extents[t].length=s.extents[t].extent_length,i.extents[t].alreadyRead=0,i.size+=i.extents[t].length}if(a.pitm&&(r[a.pitm.item_id].primary=!0),a.iref)for(e=0;e<a.iref.references.length;e++){var o=a.iref.references[e];for(t=0;t<o.references.length;t++)r[o.from_item_ID].ref_to.push({type:o.type,id:o.references[t]})}if(a.iprp)for(var c=0;c<a.iprp.ipmas.length;c++){var l=a.iprp.ipmas[c];for(e=0;e<l.associations.length;e++){var u=l.associations[e];for(void 0===(i=r[u.id]).properties&&(i.properties={},i.properties.boxes=[]),t=0;t<u.props.length;t++){var d=u.props[t];if(d.property_index>0&&d.property_index-1<a.iprp.ipco.boxes.length){var h=a.iprp.ipco.boxes[d.property_index-1];i.properties[h.type]=h,i.properties.boxes.push(h)}}}}}},p.prototype.getItem=function(e){var t,i;if(!this.meta)return null;if(!(i=this.items[e]).data&&i.size)i.data=new Uint8Array(i.size),i.alreadyRead=0,this.itemsDataSize+=i.size,n.debug("ISOFile","Allocating item #"+e+" of size "+i.size+" (total: "+this.itemsDataSize+")");else if(i.alreadyRead===i.size)return i;for(var r=0;r<i.extents.length;r++){var a=i.extents[r];if(a.alreadyRead!==a.length){var s=this.stream.findPosition(!0,a.offset+a.alreadyRead,!1);if(!(s>-1))return null;var c=(t=this.stream.buffers[s]).byteLength-(a.offset+a.alreadyRead-t.fileStart);if(!(a.length-a.alreadyRead<=c))return n.debug("ISOFile","Getting item #"+e+" extent #"+r+" partial data (alreadyRead: "+a.alreadyRead+" offset: "+(a.offset+a.alreadyRead-t.fileStart)+" read size: "+c+" full extent size: "+a.length+" full item size: "+i.size+")"),o.memcpy(i.data.buffer,i.alreadyRead,t,a.offset+a.alreadyRead-t.fileStart,c),a.alreadyRead+=c,i.alreadyRead+=c,t.usedBytes+=c,this.stream.logBufferLevel(),null;n.debug("ISOFile","Getting item #"+e+" extent #"+r+" data (alreadyRead: "+a.alreadyRead+" offset: "+(a.offset+a.alreadyRead-t.fileStart)+" read size: "+(a.length-a.alreadyRead)+" full extent size: "+a.length+" full item size: "+i.size+")"),o.memcpy(i.data.buffer,i.alreadyRead,t,a.offset+a.alreadyRead-t.fileStart,a.length-a.alreadyRead),t.usedBytes+=a.length-a.alreadyRead,this.stream.logBufferLevel(),i.alreadyRead+=a.length-a.alreadyRead,a.alreadyRead=a.length}}return i.alreadyRead===i.size?i:null},p.prototype.releaseItem=function(e){var t=this.items[e];if(t.data){this.itemsDataSize-=t.size,t.data=null,t.alreadyRead=0;for(var i=0;i<t.extents.length;i++)t.extents[i].alreadyRead=0;return t.size}return 0},p.prototype.processItems=function(e){for(var t in this.items){var i=this.items[t];this.getItem(i.id),e&&!i.sent&&(e(i),i.sent=!0,i.data=null)}},p.prototype.hasItem=function(e){for(var t in this.items){var i=this.items[t];if(i.name===e)return i.id}return-1},p.prototype.getMetaHandler=function(){return this.meta?this.meta.hdlr.handler:null},p.prototype.getPrimaryItem=function(){return this.meta&&this.meta.pitm?this.getItem(this.meta.pitm.item_id):null},p.prototype.itemToFragmentedTrackFile=function(e){var t=e||{},i=null;if(null==(i=t.itemId?this.getItem(t.itemId):this.getPrimaryItem()))return null;var r=new p;r.discardMdatData=!1;var a={type:i.type,description_boxes:i.properties.boxes};i.properties.ispe&&(a.width=i.properties.ispe.image_width,a.height=i.properties.ispe.image_height);var n=r.addTrack(a);return n?(r.addSample(n,i.data),r):null},p.prototype.write=function(e){for(var t=0;t<this.boxes.length;t++)this.boxes[t].write(e)},p.prototype.createFragment=function(e,t,i){var r=this.getTrackById(e),a=this.getSample(r,t);if(null==a)return a=r.samples[t],this.nextSeekPosition?this.nextSeekPosition=Math.min(a.offset+a.alreadyRead,this.nextSeekPosition):this.nextSeekPosition=r.samples[t].offset+a.alreadyRead,null;var s=i||new o;s.endianness=o.BIG_ENDIAN;var c=this.createSingleSampleMoof(a);c.write(s),c.trafs[0].truns[0].data_offset=c.size+8,n.debug("MP4Box","Adjusting data_offset with new value "+c.trafs[0].truns[0].data_offset),s.adjustUint32(c.trafs[0].truns[0].data_offset_position,c.trafs[0].truns[0].data_offset);var l=new d.mdatBox;return l.data=a.data,l.write(s),s},p.writeInitializationSegment=function(e,t,i,r){var a;n.debug("ISOFile","Generating initialization segment");var s=new o;s.endianness=o.BIG_ENDIAN,e.write(s);var c=t.add("mvex");for(i&&c.add("mehd").set("fragment_duration",i),a=0;a<t.traks.length;a++)c.add("trex").set("track_id",t.traks[a].tkhd.track_id).set("default_sample_description_index",1).set("default_sample_duration",r).set("default_sample_size",0).set("default_sample_flags",65536);return t.write(s),s.buffer},p.prototype.save=function(e){var t=new o;t.endianness=o.BIG_ENDIAN,this.write(t),t.save(e)},p.prototype.getBuffer=function(){var e=new o;return e.endianness=o.BIG_ENDIAN,this.write(e),e.buffer},p.prototype.initializeSegmentation=function(){var e,t,i,r;for(null===this.onSegment&&n.warn("MP4Box","No segmentation callback set!"),this.isFragmentationInitialized||(this.isFragmentationInitialized=!0,this.nextMoofNumber=0,this.resetTables()),t=[],e=0;e<this.fragmentedTracks.length;e++){var a=new d.moovBox;a.mvhd=this.moov.mvhd,a.boxes.push(a.mvhd),i=this.getTrackById(this.fragmentedTracks[e].id),a.boxes.push(i),a.traks.push(i),(r={}).id=i.tkhd.track_id,r.user=this.fragmentedTracks[e].user,r.buffer=p.writeInitializationSegment(this.ftyp,a,this.moov.mvex&&this.moov.mvex.mehd?this.moov.mvex.mehd.fragment_duration:void 0,this.moov.traks[e].samples.length>0?this.moov.traks[e].samples[0].duration:0),t.push(r)}return t},d.Box.prototype.printHeader=function(e){this.size+=8,this.size>c&&(this.size+=8),"uuid"===this.type&&(this.size+=16),e.log(e.indent+"size:"+this.size),e.log(e.indent+"type:"+this.type)},d.FullBox.prototype.printHeader=function(e){this.size+=4,d.Box.prototype.printHeader.call(this,e),e.log(e.indent+"version:"+this.version),e.log(e.indent+"flags:"+this.flags)},d.Box.prototype.print=function(e){this.printHeader(e)},d.ContainerBox.prototype.print=function(e){this.printHeader(e);for(var t=0;t<this.boxes.length;t++)if(this.boxes[t]){var i=e.indent;e.indent+=" ",this.boxes[t].print(e),e.indent=i}},p.prototype.print=function(e){e.indent="";for(var t=0;t<this.boxes.length;t++)this.boxes[t]&&this.boxes[t].print(e)},d.mvhdBox.prototype.print=function(e){d.FullBox.prototype.printHeader.call(this,e),e.log(e.indent+"creation_time: "+this.creation_time),e.log(e.indent+"modification_time: "+this.modification_time),e.log(e.indent+"timescale: "+this.timescale),e.log(e.indent+"duration: "+this.duration),e.log(e.indent+"rate: "+this.rate),e.log(e.indent+"volume: "+(this.volume>>8)),e.log(e.indent+"matrix: "+this.matrix.join(", ")),e.log(e.indent+"next_track_id: "+this.next_track_id)},d.tkhdBox.prototype.print=function(e){d.FullBox.prototype.printHeader.call(this,e),e.log(e.indent+"creation_time: "+this.creation_time),e.log(e.indent+"modification_time: "+this.modification_time),e.log(e.indent+"track_id: "+this.track_id),e.log(e.indent+"duration: "+this.duration),e.log(e.indent+"volume: "+(this.volume>>8)),e.log(e.indent+"matrix: "+this.matrix.join(", ")),e.log(e.indent+"layer: "+this.layer),e.log(e.indent+"alternate_group: "+this.alternate_group),e.log(e.indent+"width: "+this.width),e.log(e.indent+"height: "+this.height)};var m={createFile:function(e,t){var i=void 0===e||e,r=new p(t);return r.discardMdatData=!i,r}};t.createFile=m.createFile}));function Dc(e){return e.reduce((function(e,t){return 256*e+t}))}function Ic(e){var t=[101,103,119,99],i=e.length-28,r=e.slice(i,i+t.length);return t.every((function(e,t){return e===r[t]}))}Lc.Log,Lc.MP4BoxStream,Lc.DataStream,Lc.MultiBufferStream,Lc.MPEG4DescriptorParser,Lc.BoxParser,Lc.XMLSubtitlein4Parser,Lc.Textin4Parser,Lc.ISOFile,Lc.createFile;var Pc=function(){function e(){Object(T["a"])(this,e),this.s=null,this.a=null,this.l=0,this.c=0,this.u=1/0,this.A=!1,this.d=!1,this.r=4194304,this.n=new Uint8Array([30,158,90,33,244,57,83,165,2,70,35,87,215,231,226,108]),this.t=this.n.slice().reverse()}return Object(S["a"])(e,[{key:"destroy",value:function(){this.s=null,this.a=null,this.l=0,this.c=0,this.u=1/0,this.A=!1,this.d=!1,this.r=4194304,this.n=null,this.t=null}},{key:"transport",value:function(e){var t=this;if(!this.s&&this.l>50||(this.l++,this.d))return e;var i=new Uint8Array(e);if(this.A){if(!(this.c<this.u))return this.a&&this.s?(this.a.set(i,this.r),this.s.parse(null,this.r,i.byteLength),this.a.slice(this.r,this.r+i.byteLength)):(console.error("video_error_2"),this.d=!0,e);Ic(i)&&this.c++}else{var r=function(e,t){var i=function(e,t){for(var i=0;i<e.byteLength-t.length;i++)for(var r=0;r<t.length&&e[i+r]===t[r];r++)if(r===t.length-1)return i;return null}(e,t);if(i){var r=Dc(e.slice(i+16,i+16+8));return[r,Dc(e.slice(i+24,i+24+8)),function(e){return e.map((function(e){return~e}))}(e.slice(i+32,i+32+r))]}return null}(i,this.t);if(!r)return e;var a=function(e){try{if("object"!=("undefined"===typeof WebAssembly?"undefined":Object(E["a"])(WebAssembly))||"function"!=typeof WebAssembly.instantiate)throw null;var t=new WebAssembly.Module(Uint8Array.of(0,97,115,109,1,0,0,0));if(!(t instanceof WebAssembly.Module&&new WebAssembly.Instance(t)instanceof WebAssembly.Instance))throw null}catch(r){return new Error("video_error_4")}var i;try{i={env:{__handle_stack_overflow:function(){return e(new Error("video_error_1"))},memory:new WebAssembly.Memory({initial:256,maximum:256})}}}catch(a){return new Error("video_error_5")}return i}(e);if(a instanceof Error)return console.error(a.message),this.d=!0,e;this.A=!0,this.u=r[1],Ic(i)&&this.c++,WebAssembly.instantiate(r[2],a).then((function(e){if(!function(e){return"function"==typeof e.parse&&"object"==Object(E["a"])(e.memory)}(e.instance.exports))return t.d=!0,void console.error("video_error_3");t.s=e.instance.exports,t.a=new Uint8Array(t.s.memory.buffer)}))["catch"]((function(e){t.d=!0,console.error("video_error_6")}))}return e}}]),e}(),Oc=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e),r.TAG_NAME="Fmp4Loader",r.player=e,r.mp4Box=Lc.createFile(),r.tempFmp4List=[],r.offset=0,r.videoTrackId=null,r.audioTrackId=null,r.isHevc=!1,r.transportDescarmber=null,r.player._opt.isFmp4Private&&(r.transportDescarmber=new Pc),r._listenMp4Box(),e.debug.log(r.TAG_NAME,"init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){this.mp4Box&&(this.mp4Box.flush(),this.mp4Box=null),this.transportDescarmber&&(this.transportDescarmber.destroy(),this.transportDescarmber=null),this.tempFmp4List=[],this.offset=0,this.videoTrackId=null,this.audioTrackId=null,this.isHevc=!1,this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"_listenMp4Box",value:function(){this.mp4Box.onReady=this.onReady.bind(this),this.mp4Box.onError=this.onError.bind(this),this.mp4Box.onSamples=this.onSamples.bind(this)}},{key:"onReady",value:function(e){this.player.debug.log(this.TAG_NAME,"onReady",e);var t=e.videoTracks[0],i=e.audioTracks[0];if(t){this.videoTrackId=t.id;var r=this.getSeqHeader(t);r&&(this.player.debug.log(this.TAG_NAME,"seqHeader",r),this._doDecodeByFmp4(r,Fe,0,!0,0)),this.mp4Box.setExtractionOptions(t.id)}if(i){this.audioTrackId=i.id;var a=i.audio||{},n=Nr.indexOf(a.sample_rate),s=i.codec.replace("mp4a.40.","");this.mp4Box.setExtractionOptions(i.id);var o={profile:parseInt(s,10),sampleRate:n,channel:a.channel_count},c=Mr(o);this.player.debug.log(this.TAG_NAME,"aacADTSHeader",c,"config",o),this._doDecodeByFmp4(c,Me,0,!1,0)}this.mp4Box.start()}},{key:"onError",value:function(e){this.player.debug.error(this.TAG_NAME,"mp4Box onError",e)}},{key:"onSamples",value:function(e,t,i){if(e===this.videoTrackId){var r,a=p(i);try{for(a.s();!(r=a.n()).done;){var n=r.value,s=n.data,o=n.is_sync,c=1e3*n.cts/n.timescale;n.duration,n.timescale,this.player.updateStats({vbps:s.byteLength,dts:c}),o&&this.calcIframeIntervalTimestamp(c);var l=null;l=this.isHevc?Ds(s,o):ys(s,o),this._doDecodeByFmp4(l,Fe,c,o,0)}}catch(y){a.e(y)}finally{a.f()}}else if(e===this.audioTrackId){var u,d=p(i);try{for(d.s();!(u=d.n()).done;){var h=u.value,f=h.data;this.player.updateStats({abps:f.byteLength});var m=1e3*h.cts/h.timescale;h.duration,h.timescale;var g=new Uint8Array(f.byteLength+2);g.set([175,1],0),g.set(f,2),this._doDecodeByFmp4(g,Me,m,!1,0)}}catch(y){d.e(y)}finally{d.f()}}else this.player.debug.warn(this.TAG_NAME,"onSamples() trackId error",e)}},{key:"getSeqHeader",value:function(e){var t,i=this.mp4Box.getTrackById(e.id),r=p(i.mdia.minf.stbl.stsd.entries);try{for(r.s();!(t=r.n()).done;){var a=t.value;if(a.avcC||a.hvcC){var n=new Lc.DataStream(void 0,0,Lc.DataStream.BIG_ENDIAN),s=[];a.avcC?(a.avcC.write(n),s=[23,0,0,0,0]):(this.isHevc=!0,a.hvcC.write(n),s=[28,0,0,0,0]);var o=new Uint8Array(n.buffer,8),c=new Uint8Array(s.length+o.length);return c.set(s,0),c.set(o,s.length),c}}}catch(l){r.e(l)}finally{r.f()}return null}},{key:"dispatch",value:function(e){var t=new Uint8Array(e);"string"!=typeof e?"object"==Object(E["a"])(e)?(this.transportDescarmber&&(t=this.transportDescarmber.transport(t)),t.buffer.fileStart=this.offset,this.offset+=t.byteLength,this.mp4Box.appendBuffer(t.buffer)):this.player.debug.warn(this.TAG_NAME,"dispatch()","data is not object",e):this.player.debug.warn(this.TAG_NAME,"dispatch()","data is string",e)}},{key:"downloadFmp4File",value:function(){var e=new Blob(this.tempFmp4List,{type:'video/mp4; codecs="avc1.640028,mp4a.40.2"'}),t=URL.createObjectURL(e),i=document.createElement("a");i.href=t,i.download=$r()+".fmp4",i.click(),URL.revokeObjectURL(t)}}]),i}(Qs),Bc=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e),xc(Object(v["a"])(r),"LOG_NAME","Mpeg4Loader"),r.player=e,r.player.debug.log(r.LOG_NAME,"init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){k(Object(b["a"])(i.prototype),"destroy",this).call(this),this.player.debug.log(this.LOG_NAME,"destroy")}}]),i}(Qs),Mc=function(){function e(t){return Object(T["a"])(this,e),new(e.getLoaderFactory(t))(t)}return Object(S["a"])(e,null,[{key:"getLoaderFactory",value:function(e){var t=e._opt.demuxType;return t===I?Sc:t===D||e.isWebrtcH265()?wc:t===B?Tc:t===M?Cc:t===F?Oc:t===U?Bc:Rc}}]),e}(),Fc=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this),r.player=e,r.hasInit=!1,r.isDecodeFirstIIframe=!!an(e._opt.checkFirstIFrame),r.isInitInfo=!1,r.prevTimestamp=null,r.decodeDiffTimestamp=null,r.prevDts=null,r.decoder=null,r.isWidthOrHeightChanged=!1,r.initDecoder(),e.debug.log("Webcodecs","init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){this.decoder&&(an(this.isDecodeStateClosed())&&this.decoder.close(),this.decoder=null),this.prevTimestamp=null,this.decodeDiffTimestamp=null,this.prevDts=null,this.hasInit=!1,this.isInitInfo=!1,this.isDecodeFirstIIframe=!1,this.isWidthOrHeightChanged=!1,this.off(),this.player.debug.log("Webcodecs","destroy")}},{key:"initDecoder",value:function(){var e=this;this.decoder=new VideoDecoder({output:function(t){e.handleDecode(t)},error:function(t){e.handleError(t)}})}},{key:"handleDecode",value:function(e){this.isInitInfo||(this.player.video.updateVideoInfo({width:e.codedWidth,height:e.codedHeight}),this.player.video.initCanvasViewSize(),this.isInitInfo=!0),this.player.isPlayer()?(this.player.updateStats({dfps:!0}),this.player._times.videoStart||(this.player._times.videoStart=$r(),this.player.handlePlayToRenderTimes()),this.player.video.render({videoFrame:e,ts:e.timestamp}),this.player.handleRender()):this.player.isPlayback()&&(this.player.updateStats({dfps:!0}),an(this.player.playbackPause)?(this.player.playback.isUseLocalCalculateTime&&this.player.playback.increaseLocalTimestamp(),this.player.playback.isUseFpsRender?this.player.video.pushData({videoFrame:e,ts:e.timestamp}):this.player.video.render$2({videoFrame:e,ts:e.timestamp})):an(this.player.playback.isPlaybackPauseClearCache)&&this.player.playback.isCacheBeforeDecodeForFpsRender&&this.player.playback.isUseFpsRender&&this.player.video.pushData({videoFrame:e,ts:e.timestamp}))}},{key:"handleError",value:function(e){this.player.debug.error("Webcodecs","VideoDecoder handleError:",e.code,e);var t=e.toString();-1!==t.indexOf(Pi)?this.player.emitError(nt.webcodecsUnsupportedConfigurationError,t):(-1!==t.indexOf(Oi)||-1!==t.indexOf(Bi)||-1!==t.indexOf(Mi))&&this.player.emitError(nt.webcodecsDecodeError,t)}},{key:"decodeVideo",value:function(e,t,i,r){var a;if(this.player)if(this.player.isDestroyed())this.player.debug.warn("Webcodecs","decodeVideo() player is destroyed");else if(this.hasInit)if(!this.isDecodeFirstIIframe&&i&&(this.isDecodeFirstIIframe=!0),this.isDecodeFirstIIframe){if(this.isDecodeStateClosed())return void this.player.debug.warn("Webcodecs","VideoDecoder isDecodeStateClosed true");if(i&&0===e[1]){var n=15&e[0],s={};n===pt?s=ms(e.slice(5)):n===mt&&(s=Cs(e));var o=this.player.video.videoInfo;o&&o.width&&o.height&&s&&s.codecWidth&&s.codecHeight&&(s.codecWidth!==o.width||s.codecHeight!==o.height)&&(this.player.debug.warn("Webcodecs","decodeVideo: video width or height is changed,\n old width is ".concat(o.width,", old height is ").concat(o.height,",\n new width is ").concat(s.codecWidth,", new height is ").concat(s.codecHeight,",\n and emit change event")),this.isWidthOrHeightChanged=!0,this.player.emitError(nt.wcsWidthOrHeightChange))}if(this.isWidthOrHeightChanged)return void this.player.debug.warn("Webcodecs","decodeVideo: video width or height is changed, and return");if(tn(e))return void this.player.debug.warn("Webcodecs","decodeVideo and payload is video sequence header so drop this frame");if(e.byteLength<12)return void this.player.debug.warn("Webcodecs","decodeVideo and payload is too small , payload length is ".concat(e.byteLength));var c=!1,l=(new Date).getTime();this.prevTimestamp||(this.prevTimestamp=l,c=!0);var u=l-this.prevTimestamp;this.decodeDiffTimestamp=u,u>500&&!c&&this.player.isPlayer()&&this.player.debug.warn("Webcodecs","decodeVideo diff time is ",u);var d=e.slice(5),h=new EncodedVideoChunk({data:d,timestamp:t,type:i?Kt:Jt});this.player.emit(it.timeUpdate,t);try{this.decoder.decode(h)}catch(n){this.player.debug.error("Webcodecs","VideoDecoder",n);var f=n.toString();(-1!==f.indexOf(Di)||-1!==f.indexOf(Ii))&&this.player.emitError(nt.webcodecsDecodeError)}this.prevTimestamp=(new Date).getTime()}else this.player.debug.log("Webcodecs","VideoDecoder first frame is not iFrame");else if(i&&e[1]===Gi){var p=15&e[0];if(this.player.video.updateVideoInfo({encTypeCode:p}),p===mt&&!ba()){var m=ca();return this.player.debug.warn("Webcodecs","WebcodecsDecoder not support hevc decode",m.type,m.version),void this.emit(nt.webcodecsH265NotSupport)}this.player._times.decodeStart||(this.player._times.decodeStart=$r());var g=null,y=null,v=e.slice(5);p===pt?(g=function(e){for(var t=e.subarray(1,4),i="avc1.",r=0;r<3;r++){var a=t[r].toString(16);a.length<2&&(a="0"+a),i+=a}return{codec:i,description:e}}(v),y=ms(v)):p===mt&&((a=v).subarray(1,4),g={codec:"hev1.1.6.L120.90",description:a},y=Cs(e)),y&&y.codecWidth&&y.codecHeight&&(g.codedHeight=y.codecHeight,g.codedWidth=y.codecWidth),this.player.recorder&&this.player._opt.recordType===C&&this.player.recorder.initMetaData(e,p);try{this.decoder.configure(g),this.hasInit=!0}catch(h){this.player.debug.log("Webcodecs","configure error",h.code,h),-1!==h.toString().indexOf(Fi)?this.emit(nt.webcodecsH265NotSupport):this.player.emitError(nt.webcodecsDecodeConfigureError)}}}},{key:"getDecodeDiffTimes",value:function(){return this.decodeDiffTimestamp}},{key:"isDecodeStateClosed",value:function(){return"closed"===this.decoder.state}},{key:"isDecodeStateConfigured",value:function(){return"configured"===this.decoder.state}},{key:"isDecodeStateUnConfigured",value:function(){return"unconfigured"===this.decoder.state}}]),i}(fn),Uc={play:"播放",pause:"暂停",audio:"",mute:"",screenshot:"截图",loading:"",fullscreen:"全屏",fullscreenExit:"退出全屏",record:"录制",recordStop:"停止录制",narrow:"缩小",expand:"放大",ptz:"操作盘",ptzActive:"操作盘激活",zoom:"电子放大",zoomStop:"关闭电子放大",close:"关闭",performance:"性能面板",performanceActive:"性能面板激活",face:"人脸识别",faceActive:"人脸识别激活",object:"物品识别",objectActive:"物品识别激活",logSave:"保存日志"},jc=Object.keys(Uc).reduce((function(e,t){return e[t]='\n <i class="jessibuca-icon jessibuca-icon-'.concat(t,'"></i>\n ').concat(Uc[t]?'<span class="icon-title-tips"><span class="icon-title">'.concat(Uc[t],"</span></span>"):"","\n"),e}),{});function Nc(e,t){var i=!1;return e.forEach((function(e){i||e.startTimestamp<=t&&e.endTimestamp>t&&(i=!0)})),i}function zc(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,r=e.length,a=t.length,n=Math.max(r,a),s=2e3,o=Math.ceil(n/s),c=0,l=0;function u(){for(var a="",n="",d=0;d<s;d++){var h=e[l];h&&(a+='\n <div class="jessibuca-playback-time-minute-one'.concat(h.hasRecord?" active":"").concat(h.isStart?" start":"",'" data-has-record="').concat(h.hasRecord,'"\n data-time="').concat(h.timestamp,'" data-type="').concat(h.dataType,'">\n <span class="jessibuca-playback-time-title-tips ').concat(l>r-60?"jessibuca-playback-time-title-tips-left":"",'"><span class="jessibuca-playback-time-title">').concat(h.title,"</span></span>\n </div>\n "));var f=t[l];f&&(n+='\n <div class="jessibuca-playback-time-hour" data-hour="'.concat(f.hour,'" data-min="').concat(f.min,'" data-second="').concat(f.second,'"><span class="jessibuca-playback-time-hour-text">').concat(f.title,"</span></div>\n ")),l+=1}a&&i.$playbackTimeListOne.insertAdjacentHTML("beforeend",a),n&&i.$playbackTimeListSecond.insertAdjacentHTML("beforeend",n),c+=1,c<o&&(i.rafId=window.requestAnimationFrame(u))}u()}function Gc(e,t){var i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],i=(e[0]||{}).startTimestamp,r=0;r<1440;r++){var a=r%60==0,n=!1;i&&(n=Nc(e,Ia(i,r))),t.push({title:La(r),timestamp:r,dataType:"min",hasRecord:n,isStart:a})}return t}(e);zc(i,function(){for(var e=[],t=0;t<24;t++){var i=t+":00";t<10&&(i="0"+i),e.push({title:i,hour:t,min:0,second:0})}return e}(),t)}function Hc(e,t){var i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],i=(e[0]||{}).startTimestamp,r=0;r<1440;r++){var a=60*r,n=a%1800==0,s=!1;i&&(s=Nc(e,Pa(i,a))),t.push({title:Da(a),timestamp:a,dataType:"second",hasRecord:s,isStart:n});var o=60*r+30;n=o%1800==0,i&&(s=Nc(e,Pa(i,o))),t.push({title:Da(o),timestamp:o,dataType:"second",hasRecord:s,isStart:n})}return t}(e);zc(i,function(){for(var e=[],t=0;t<24;t++){var i=t+":00",r=t+":30";t<10&&(i="0"+i,r="0"+r),e.push({title:i,hour:t,min:0,second:0}),e.push({title:r,hour:t,min:30,second:0})}return e}(),t)}function Vc(e,t){var i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],i=(e[0]||{}).startTimestamp,r=0;r<144;r++)for(var a=0;a<60;a++){var n=10*a+600*r,s=n%600==0,o=!1;i&&(o=Nc(e,Pa(i,n))),t.push({title:Da(n),timestamp:n,dataType:"second",isStart:s,hasRecord:o})}return t}(e);zc(i,function(){for(var e=[],t=0;t<24;t++){var i=t+":00";t<10&&(i="0"+i),e.push({title:i,hour:t,min:0,second:0});for(var r=1;r<6;r++){var a=r+"0";e.push({title:i.replace(":00",":"+a),hour:t,min:10*r,second:0})}}return e}(),t)}function Wc(e,t){var i=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[],i=(e[0]||{}).startTimestamp,r=0;r<288;r++)for(var a=0;a<60;a++){var n=5*a+300*r,s=n%300==0,o=!1;i&&(o=Nc(e,Pa(i,n))),t.push({title:Da(n),timestamp:n,dataType:"second",isStart:s,hasRecord:o})}return t}(e);zc(i,function(){for(var e=[],t=0;t<24;t++){var i=t+":00";t<10&&(i="0"+i),e.push({title:i,hour:t,min:0,second:0}),e.push({title:i.replace(":00",":05"),hour:t,min:5,second:0});for(var r=1;r<6;r++){var a=r+"0",n=r+"5";e.push({title:i.replace(":00",":"+a),hour:t,min:10*r,second:0}),e.push({title:i.replace(":00",":"+n),hour:t,min:10*r+5,second:0})}}return e}(),t)}function qc(e){var t=Math.floor(e/3600),i=Math.floor((e-3600*t)/60),r=Math.floor(e-3600*t-60*i);return(t>0?[t,i,r]:[i,r]).map((function(e){return e<10?"0".concat(e):String(e)})).join(":")}function Kc(e,t,i){var r=e.$playbackProgress,a=r.getBoundingClientRect(),n=a.left,s=Zr((na()?i.touches[0].clientX:i.pageX)-n,0,r.clientWidth),o=parseInt(s/r.clientWidth*t,10);return{second:o,time:qc(o),width:s,percentage:Zr(s/r.clientWidth,0,1)}}function Jc(e,t){return t instanceof Element?e.appendChild(t):e.insertAdjacentHTML("beforeend",String(t)),e.lastElementChild||e.lastChild}function Yc(e,t,i){return e&&e.style&&Ta(t)&&(e.style[t]=i),e}function Qc(e,t){return e.composedPath&&e.composedPath().indexOf(t)>-1}function Xc(e){var t=!1;return e&&e.parentNode&&(e.parentNode.removeChild(e),t=!0),t}var $c=function(e,t){var i=e.events.proxy,r=document.createElement("object");r.setAttribute("aria-hidden","true"),r.setAttribute("tabindex",-1),r.type="text/html",r.data="about:blank",ea(r,{display:"block",position:"absolute",top:"0",left:"0",height:"100%",width:"100%",overflow:"hidden",pointerEvents:"none",zIndex:"-1"});var a=e.width,n=e.height,s=ma((function(){e.width===a&&e.height===n||(a=e.width,n=e.height,e.emit(it.resize),d())}),500);i(r,"load",(function(){i(r.contentDocument.defaultView,"resize",(function(){s()}))})),e.$container.appendChild(r),e.on(it.destroy,(function(){e.$container.removeChild(r)})),e.on(it.volumechange,(function(){(function(e){if(0===e)ea(t.$volumeOn,"display","none"),ea(t.$volumeOff,"display","flex"),ea(t.$volumeHandle,"top","48px");else if(t.$volumeHandle&&t.$volumePanel){var i=ta(t.$volumePanel,"height")||60,r=ta(t.$volumeHandle,"height"),a=i-(i-r)*e-r;ea(t.$volumeHandle,"top","".concat(a,"px")),ea(t.$volumeOn,"display","flex"),ea(t.$volumeOff,"display","none")}t.$volumePanelText&&(t.$volumePanelText.innerHTML=parseInt(100*e))})(e.volume)})),e.on(it.loading,(function(i){ea(t.$loading,"display",i?"flex":"none"),(an(e._opt.backgroundLoadingShow)&&rn(i)||an(i))&&ea(t.$poster,"display","none"),i&&ea(t.$playBig,"display","none"),na()||i||e.getRenderType()===q&&an(e._opt.useMSE)&&o()})),e.on(it.removeLoadingBgImage,(function(){na()||o()}));var o=function(){t.$loadingBgImage&&t.$loadingBg&&t.$loadingBgImage.src&&(e.debug&&e.debug.log("Control","remove loading bg image"),t.$loadingBgImage.width=0,t.$loadingBgImage.height=0,t.$loadingBgImage.src="",ea(t.$loadingBg,"display","none"))},c=function(t){e.fullscreen?ja(t)===e.$container&&l():l()},l=function(i){var r=Sa(i)?i:e.fullscreen;ea(t.$fullscreenExit,"display",r?"flex":"none"),ea(t.$fullscreen,"display",r?"none":"flex")},u=function(){return e._opt.playType===A&&e._opt.playbackConfig.showControl},d=function(i){na()&&t.$controls&&e._opt.useWebFullScreen&&setTimeout((function(){if(e.fullscreen){var r=u()?Bt:Ot,a=e.height/2-e.width+r/2,n=e.height/2-r/2;if(t.$controls.style.transform="translateX(".concat(-a,"px) translateY(-").concat(n,"px) rotate(-90deg)"),t.$zoomControls){var s=e.width/2+78-15;t.$zoomControls.style.transform="translateX(".concat(-s,"px) translateY(").concat(e.height/2,"px) rotate(-90deg)")}if(t.$recording){var o=e.width/2+50.5-10;t.$recording.style.transform="translateX(".concat(-o,"px) translateY(").concat(e.height/2,"px) rotate(-90deg)")}}else t.$controls.style.transform="translateX(0) translateY(0) rotate(0)",t.$zoomControls&&(t.$zoomControls.style.transform="translateX(-50%) translateY(0) rotate(0)"),t.$recording&&(t.$recording.style.transform="translateX(-50%) translateY(0) rotate(0)");i&&i()}),10)};try{Br.on("change",c),e.events.destroys.push((function(){Br.off("change",c)}))}catch(_){}e.on(it.webFullscreen,(function(e){na()&&(l(e),d((function(){f()})))})),e.on(it.recording,(function(){e.playing&&(ea(t.$record,"display",e.recording?"none":"flex"),ea(t.$recordStop,"display",e.recording?"flex":"none"),(e._opt.hasControl||e._opt.isShowRecordingUI)&&(ea(t.$recording,"display",e.recording?"flex":"none"),an(e.recording)&&t.$recordingTime&&(t.$recordingTime.innerHTML=Ra(0))))})),e.on(it.recordingTimestamp,(function(e){t.$recordingTime&&(t.$recordingTime.innerHTML=Ra(e))})),e.on(it.zooming,(function(){e.playing&&(ea(t.$zoom,"display",e.zooming?"none":"flex"),ea(t.$zoomStop,"display",e.zooming?"flex":"none"),(e._opt.hasControl||e._opt.isShowZoomingUI)&&ea(t.$zoomControls,"display",e.zooming?"flex":"none"))})),e.on(it.playing,(function(e){h(e)}));var h=function(i){ea(t.$play,"display",i?"none":"flex"),ea(t.$playBig,"display",i?"none":"block"),ea(t.$pause,"display",i?"flex":"none"),ea(t.$screenshot,"display",i?"flex":"none"),ea(t.$record,"display",i?"flex":"none"),ea(t.$qualityMenu,"display",i?"flex":"none"),ea(t.$volume,"display",i?"flex":"none"),ea(t.$ptz,"display",i?"flex":"none"),ea(t.$zoom,"display",i?"flex":"none"),ea(t.$scaleMenu,"display",i?"flex":"none"),ea(t.$faceDetect,"display",i?"flex":"none"),ea(t.$objectDetect,"display",i?"flex":"none"),ea(t.$controlHtml,"display",i?"flex":"none"),e.isPlayback()&&ea(t.$speedMenu,"display",i?"flex":"none"),l(),t.extendBtnList.forEach((function(e){e.$iconWrap&&ea(e.$iconWrap,"display",i?"flex":"none"),e.$activeIconWrap&&ea(e.$activeIconWrap,"display","none")})),e._opt.showPerformance?ea(t.$performanceActive,"display",i?"flex":"none"):(ea(t.$performance,"display",i?"flex":"none"),ea(t.$performanceActive,"display","none")),ea(t.$poster,"display","none"),ea(t.$ptzActive,"display","none"),ea(t.$recordStop,"display","none"),ea(t.$zoomStop,"display","none"),ea(t.$faceDetectActive,"display","none"),ea(t.$objectDetectActive,"display","none"),i||(t.$speed&&(t.$speed.innerHTML=function(e){if(null==e||""===e)return"0 KB/s";var t=parseFloat(e);return t=t.toFixed(2),t+"KB/s"}("")),ea(t.$zoomControls,"display","none"),ea(t.$recording,"display","none"),t.$ptzControl&&t.$ptzControl.classList.remove("jessibuca-ptz-controls-show")),f(),i&&p()};e.on(it.playbackPause,(function(e){h(!e)})),e.on(it.kBps,(function(i){var r=function(e){if(null==e||""===e||0===parseFloat(e)||"NaN"===e)return"0 KB/s";var t=["KB/s","MB/s","GB/s","TB/s","PB/s","EB/s","ZB/s","YB/s"],i=0,r=parseFloat(e);i=Math.floor(Math.log(r)/Math.log(1024));var a=r/Math.pow(1024,i);return a=a.toFixed(2),a+(t[i]||t[0])}(i);t.kbpsShow=r,e._opt.showBandwidth&&(t.$speed&&(t.$speed.innerHTML=r),f())}));var f=function(){if(u()&&e._opt.playbackConfig.controlType===$.normal){var i=t.controlsInnerRect.width-t.controlsLeftRect.width-t.controlsRightRect.width-t.controlsPlaybackBtnsRect.width;na()&&e.webFullscreen&&(i=t.controlsInnerRect.height-t.controlsLeftRect.height-t.controlsRightRect.height-t.controlsPlaybackBtnsRect.height),t.$playbackTimeInner.style.width=i+"px"}},p=function(){if(u()&&e._opt.playbackConfig.controlType===$.normal){var i=t.$playbackCurrentTime.style.left,r=parseInt(i,10),a=t.controlsPlaybackTimeInner.width;r=r-a/2>0?parseInt(r-a/2,10):0,t.$playbackTimeInner.scrollLeft=r}};if(u()){var m=function(){if(u()){var i=0,r=e.playback&&e.playback.playingTimestamp;if(r){var a=new Date(r),n=a.getHours(),s=a.getMinutes(),o=a.getSeconds();e.playback.is60Min?i=60*n+s:e.playback.is30Min?i=2*(60*n+s)+parseInt(o/30,10):e.playback.is10Min?i=6*(60*n+s)+parseInt(o/10,10):e.playback.is5Min?i=12*(60*n+s)+parseInt(o/5,10):e.playback.is1Min&&(i=60*(60*n+s)+parseInt(o,10)),t.$playbackCurrentTime.style.left=i+"px"}}},g=function(e){t.$playbackNarrow.classList.remove("disabled"),t.$playbackExpand.classList.remove("disabled"),e===ri&&t.$playbackNarrow.classList.add("disabled"),e===si&&t.$playbackExpand.classList.add("disabled")};e.on(it.playbackTime,(function(i){if(e._opt.playbackConfig.controlType===$.normal)t.$playbackCurrentTimeText&&(t.$playbackCurrentTimeText.innerText=da(i,"{h}:{i}:{s}")),m();else if(e._opt.playbackConfig.controlType===$.simple){var r=(a=i,n=e.playback.totalDuration,Zr(a/n,0,1));t.$playbackProgressPlayed.style.width=100*r+"%",t.$playbackProgressIndicator.style.left="calc(".concat(100*r,"% - 7px)"),t.$playbackProgressTime.innerText="".concat(qc(i)," / ").concat(qc(e.playback.totalDuration))}var a,n})),e.on(it.playbackPrecision,(function(i,r){u()&&e._opt.playbackConfig.controlType===$.normal&&(t.$playbackTimeScroll.classList.remove(oi.oneHour,oi.halfHour,oi.fiveMin,oi.tenMin),t.$playbackTimeScroll.classList.add(oi[i]),t.rafId&&(window.cancelAnimationFrame(t.rafId),t.rafId=null),t.changePercisitionInterval&&(clearTimeout(t.changePercisitionInterval),t.changePercisitionInterval=null),t.$playbackTimeListOne.innerHTML="",t.$playbackTimeListSecond.innerHTML="",t.changePercisitionInterval=setTimeout((function(){switch(t.$playbackTimeListOne.innerHTML="",t.$playbackTimeListSecond.innerHTML="",i){case ri:Gc(r,t);break;case ai:Hc(r,t);break;case ni:Vc(r,t);break;case si:Wc(r,t)}m(),e._opt.playbackConfig.showPrecisionBtn&&g(i),p()}),16))})),e.on(it.resize,(function(){f()})),e.on(it.playbackTimeScroll,(function(){p()})),f()}if(e._opt.operateBtns.quality&&e._opt.qualityConfig.length>0){e.on(it.streamQualityChange,(function(e){y(e)}));var y=function(e){t.$qualityText.innerText=e,t.$qualityMenuItems.forEach((function(t){var i=t.dataset.quality;t.classList.remove("jessibuca-quality-menu-item-active"),i===e&&t.classList.add("jessibuca-quality-menu-item-active")}))};(function(){var i=e._opt.qualityConfig||[],r="";i.forEach((function(e){r+='\n <div class="jessibuca-quality-menu-item" data-quality="'.concat(e,'">').concat(e,"</div>\n ")})),r&&(t.$qualityMenuList.insertAdjacentHTML("beforeend",r),Object.defineProperty(t,"$qualityMenuItems",{value:e.$container.querySelectorAll(".jessibuca-quality-menu-item")}),setTimeout((function(){var t=i[0];e.streamQuality=t}),0))})(),e.streamQuality&&y(e.streamQuality)}if(e._opt.operateBtns.scale&&e._opt.scaleConfig.length>0){e.on(it.viewResizeChange,(function(e){v(e)}));var v=function(i){var r=e._opt.scaleConfig[i];t.$scaleText.innerText=r,t.$scaleMenuItems.forEach((function(e){var t=e.dataset.scale;e.classList.remove("jessibuca-scale-menu-item-active"),fa(t)===fa(i)&&e.classList.add("jessibuca-scale-menu-item-active")}))};(function(){var i=e._opt.scaleConfig||[],r="";i.forEach((function(e,t){r+='\n <div class="jessibuca-scale-menu-item" data-scale="'.concat(t,'">').concat(e,"</div>\n ")})),r&&(t.$scaleMenuList.insertAdjacentHTML("beforeend",r),Object.defineProperty(t,"$scaleMenuItems",{value:e.$container.querySelectorAll(".jessibuca-scale-menu-item")}))})(),v(e.scaleType)}if(e.isPlayback()&&e._opt.playbackConfig.showRateBtn&&e._opt.playbackConfig.rateConfig.length>0){e.on(it.playbackRateChange,(function(e){b(e)}));var b=function(i){var r=e._opt.playbackConfig.rateConfig.find((function(e){return fa(e.value)===fa(i)}));r&&(t.$speedText.innerText=r.label,t.$speedMenuItems.forEach((function(e){var t=e.dataset.speed;e.classList.remove("jessibuca-speed-menu-item-active"),fa(t)===fa(i)&&e.classList.add("jessibuca-speed-menu-item-active")})))};(function(){var i=e._opt.playbackConfig.rateConfig,r="";i.forEach((function(e,t){r+='\n <div class="jessibuca-speed-menu-item" data-speed="'.concat(e.value,'">').concat(e.label,"</div>\n ")})),r&&(t.$speedMenuList.insertAdjacentHTML("beforeend",r),Object.defineProperty(t,"$speedMenuItems",{value:e.$container.querySelectorAll(".jessibuca-speed-menu-item")}))})();var k=e.playback?e.playback.playbackRate:1;b(k)}e.on(it.stats,(function(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(e._opt.showPerformance){ea(t.$performancePanel,"display","block"),t.$performancePanel.innerHTML="";var r=aa,a=on(),n=e.getCpuLevel(),s=Ta(n)&&-1!==n?"".concat(Lr[n]):"",o=e.video&&e.video.videoInfo||{},c=e.audio&&e.audio.audioInfo||{},l=e._times||{},u=e.getRenderType(),d=e.getCanvasRenderType(),h=e.getDecodeType(),f=e.getDemuxType(),p=e.getStreamType(),m=e.getAudioEngineType(),g=e.getRecordingDuration(),y=e.getRecordingByteLength(),v=e.isAudioPlaybackRateSpeed(),b=e.videoIframeIntervalTs;g=Ra(g),y=ga(y);var A=e.isPlayback()?"录播":"直播",k=i.isDropping;e.isWebrtcH264();var _=e.control?e.control.kbpsShow:"0 KB/s",w=e.getVideoPlaybackQuality(),S='\n <div class="jessibuca-performance-item">\n <span>版本 '.concat(r,"</span>\n </div>\n ").concat(e._opt.isMulti?'\n <div class="jessibuca-performance-item">\n <span>UUid '.concat(e._opt.debugUuid,"</span>\n </div>\n "):"","\n ").concat(e.isInMulti()?'\n <div class="jessibuca-performance-item">\n <span>窗口下标 '.concat(e._opt.multiIndex,"</span>\n </div>\n "):"","\n ").concat(a?'\n <div class="jessibuca-performance-item">\n <span>内存大小限制 '.concat(ga(a.jsHeapSizeLimit),'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>可使用的内存 ').concat(ga(a.totalJSHeapSize),'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>已使用的内存 ').concat(ga(a.usedJSHeapSize),"</span>\n </div>\n "):"","\n ").concat(s?'\n <div class="jessibuca-performance-item">\n <span>CPU压力情况 '.concat(s,"</span>\n </div>\n "):"","\n\n ").concat(a&&a.usedJSHeapSize>a.totalJSHeapSize?'\n <div class="jessibuca-performance-item">\n <span>可能内存泄漏 是}</span>\n </div>\n ':"",'\n <div class="jessibuca-performance-item">\n <span>播放模式 ').concat(A,"</span>\n </div>\n ").concat(e.isPlayback()?'\n <div class="jessibuca-performance-item">\n <span>播放倍率 '.concat(e.playback.rate,'倍</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>播放模式 ').concat(e.playback.isUseFpsRender?"固定FPS":"动态FPS","</span>\n </div>\n ").concat(e.playback.isUseFpsRender?'\n <div class="jessibuca-performance-item">\n <span>固定FPS '.concat(e.video.getStreamFps(),"</span>\n </div>\n "):"","\n "):"",'\n <div class="jessibuca-performance-item">\n <span>解封装模式 ').concat(j[f],'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>解码模式 ').concat(h,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>渲染组件 ').concat(u,"</span>\n </div>\n ").concat(u===q?'\n <div class="jessibuca-performance-item">\n <span>渲染引擎 '.concat(d,"</span>\n </div>\n "):"",'\n <div class="jessibuca-performance-item">\n <span>网络请求组件 ').concat(p,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>视频格式 ').concat(o.encType||"-",'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>视频(宽x高) ').concat(o.width||"-","x").concat(o.height||"-","</span>\n </div>\n ").concat(e.isPlayer()?'\n <div class="jessibuca-performance-item">\n <span>视频GOP(ms) '.concat(b||"-","</span>\n </div>\n "):"",'\n <div class="jessibuca-performance-item">\n <span>音频格式 ').concat(At[c.encType]||"-",'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>音频引擎 ').concat(m||"-",'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>音频通道 ').concat(c.channels||"-",'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>音频采样率 ').concat(c.sampleRate||"-","</span>\n </div>\n ").concat(e.isPlayer()?'\n <div class="jessibuca-performance-item">\n <span>播放器初始化(ms) '.concat(l.playTimestamp,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>开始请求地址(ms) ').concat(l.streamTimestamp,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>请求响应(ms) ').concat(l.streamResponseTimestamp,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>解封装(ms) ').concat(l.demuxTimestamp,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>解码(ms) ').concat(l.decodeTimestamp,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>页面开始渲染(ms) ').concat(l.videoTimestamp,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>初始化到页面渲染(ms) ').concat(l.allTimestamp,"</span>\n </div>\n ").concat(e.recording?'\n <div class="jessibuca-performance-item">\n <span>视频录制时间 '.concat(g,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>视频录制大小 ').concat(y,"</span>\n </div>\n "):"","\n "):"",'\n <div class="jessibuca-performance-item">\n <span>音频码率(bit) ').concat(i.abps,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>视频码率(bit) ').concat(i.vbps,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>视频帧率(fps) ').concat(i.fps,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>视频峰值帧率(fps) ').concat(i.maxFps,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>解码帧率(fps) ').concat(i.dfps,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>音频缓冲帧 ').concat(i.audioBuffer,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>音频缓冲时长(ms) ').concat(i.audioBufferDelayTs,"</span>\n </div>\n ").concat(e.isPlayer()?'\n <div class="jessibuca-performance-item">\n <span>视频待解码帧 '.concat(i.demuxBuffer,"</span>\n </div>\n "):'\n <div class="jessibuca-performance-item">\n <span>缓存时长(ms) '.concat(i.playbackCacheDataDuration,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>视频待渲染帧 ').concat(i.playbackVideoBuffer,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>视频待解码帧 ').concat(i.demuxBuffer,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>音频待解码帧 ').concat(i.audioDemuxBuffer,"</span>\n </div>\n "),'\n <div class="jessibuca-performance-item">\n <span>待解封装数据(byte) ').concat(i.flvBuffer,"</span>\n </div>\n ").concat(e._opt.useMSE?'\n <div class="jessibuca-performance-item">\n <span>MSE缓冲时长(ms) '.concat(i.mseDelay,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>MSE缓存时长(s) ').concat(i.mseStore,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>MSE解码间隔(ms) ').concat(i.mseDecodeDiffTimes,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>MSE解码时间(ms) ').concat(i.mseTs,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>MSE播放模式 ').concat(i.mseDecodePlaybackRate>1?"加速":"正常","</span>\n </div>\n "):"","\n ").concat(e._opt.useWCS?'\n <div class="jessibuca-performance-item">\n <span>WCS解码间隔(ms) '.concat(i.wcsDecodeDiffTimes,"</span>\n </div>\n "):"","\n ").concat(e.isOldHls()?'<div class="jessibuca-performance-item">\n <span>HLS缓冲时长(ms) '.concat(i.hlsDelay,"</span>\n </div>\n "):"","\n ").concat(e.isUseHls265()?'<div class="jessibuca-performance-item">\n <span>HLS缓冲时长(ms) '.concat(i.hlsDelay,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>HLS待解码帧 ').concat(i.hlsDemuxLength,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>HLS待解码视频帧 ').concat(i.hlsDemuxVideoLength,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>HLS待解码音频帧 ').concat(i.hlsDemuxAudioLength,"</span>\n </div>\n "):"","\n ").concat(e.isPlayer()&&w?'\n <div class="jessibuca-performance-item">\n <span>已渲染帧 '.concat(w.renderedVideoFrames,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>已丢弃帧 ').concat(w.droppedVideoFrames,"</span>\n </div>\n "):"","\n ").concat(e.isPlayer()?'\n <div class="jessibuca-performance-item">\n <span>网络延迟(ms) '.concat(i.netBuf,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>缓冲时长(ms) ').concat(i.buf,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>最新缓冲时长(ms) ').concat(i.pushLatestDelay,"</span>\n </div>\n "):"","\n ").concat(e._opt.useMSE?'\n <div class="jessibuca-performance-item">\n <span>video显示时间(s) '.concat(i.videoCurrentTime,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>video间隔时间(s) ').concat(i.videoCurrentTimeDiff,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>videoBuffer缓存时间(ms) ').concat(i.mseVideoBufferDelayTime,"</span>\n </div>\n "):"",'\n <div class="jessibuca-performance-item">\n <span>视频显示时间(ms) ').concat(i.currentPts||i.ts,"</span>\n </div>\n ").concat(e._opt.hasAudio&&e.isAudioNotMute()?'\n <div class="jessibuca-performance-item">\n <span>音频显示时间(ms) '.concat(i.audioTs,"</span>\n </div>\n ").concat(e._opt.hasVideo?'\n <div class="jessibuca-performance-item">\n <span>音视频同步时间戳(ms) '.concat(i.audioSyncVideo,"</span>\n </div>\n "):"",'\n <div class="jessibuca-performance-item">\n <span>音频播放模式 ').concat(v?"加速":"正常","</span>\n </div>\n "):"",'\n <div class="jessibuca-performance-item">\n <span>视频解码时间(ms) ').concat(i.dts,"</span>\n </div>\n ").concat(e.isPlayer()?'\n <div class="jessibuca-performance-item">\n <span>解码前-解码后延迟(ms) '.concat(i.delayTs,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>总延迟(网络+解码)(ms) ').concat(i.totalDelayTs,"</span>\n </div>\n "):"","\n ").concat(e.isPlayer()&&i.isStreamTsMoreThanLocal?'<div class="jessibuca-performance-item">\n <span>是否超过一倍率推流 是</span>\n </div>\n ':"","\n ").concat(e.isPlayer()?'\n <div class="jessibuca-performance-item">\n <span>是否播放流畅 '.concat(i.videoSmooth,"</span>\n </div>\n "):"","\n ").concat(e.isPlayer()?'\n <div class="jessibuca-performance-item">\n <span>是否在丢帧 '.concat(k,"</span>\n </div>\n "):"",'\n <div class="jessibuca-performance-item">\n <span>网速 ').concat(_,'</span>\n </div>\n <div class="jessibuca-performance-item">\n <span>播放时长(s) ').concat(Ra(i.pTs),'</span>\n </div>\n <div class="jessibuca-performance-item-block"></div>\n ');t.$performancePanel.insertAdjacentHTML("beforeend",S)}else t.$performancePanel.innerHTML="",ea(t.$performancePanel,"display","none")})),e.on(it.togglePerformancePanel,(function(e){ea(t.$performance,"display",e?"none":"flex"),ea(t.$performanceActive,"display",e?"flex":"none")})),e.on(it.faceDetectActive,(function(e){ea(t.$faceDetect,"display",e?"none":"flex"),ea(t.$faceDetectActive,"display",e?"flex":"none")})),e.on(it.objectDetectActive,(function(e){ea(t.$objectDetect,"display",e?"none":"flex"),ea(t.$objectDetectActive,"display",e?"flex":"none")}))};function Zc(e,t){void 0===t&&(t={});var i=t.insertAt;if(e&&("undefined"===typeof document?"undefined":Object(E["a"])(document))<"u"){var r=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===i&&r.firstChild?r.insertBefore(a,r.firstChild):r.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}Zc('@keyframes rotation{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@keyframes magentaPulse{0%{background-color:#630030;-webkit-box-shadow:0 0 9px #333}50%{background-color:#a9014b;-webkit-box-shadow:0 0 18px #a9014b}to{background-color:#630030;-webkit-box-shadow:0 0 9px #333}}.jessibuca-container .jessibuca-icon{cursor:pointer;width:16px;height:16px;display:inline-block}.jessibuca-container .jessibuca-ptz-controls{position:absolute;width:156px;height:156px;visibility:hidden;opacity:0;border-radius:78px;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATgAAAE4BAMAAAA9UfJZAAAAMFBMVEUAAABHcEy0tLRZWVmysrKoqKi1tbWvr6+2traBgYG1tbWWlpa1tbW1tbVUVFS1tbVGCHqkAAAAD3RSTlMzAO9U3LSWySp3aZcVRDUDw823AAAJYUlEQVR42u3d32sbVxYH8EPHxgg/lBsa7SBkukmpSbwLI2KbEPpgZ5MQtwmM0wRMmgdhP6RgEuwlSVnYlmGMYaEvMU1KKX4QNq0pocVmm7CYfRBaQguFpbgPKRSC/4V2LGliO+bulWKrkvVrftyZ+WbxeTRG+nDnnnNmRjP3EpMR6tMH18du/0Xj1tGz5+9cf/DUlPKx5PsTkr8s3eZ1cX7ym1zkuI/f1wTFunNt9fP+FIno7/98/tFY+Y8ffBUlLrmkl2Cr96guTv27BMxP5iLCqUvi68+tpqhJKPNXBH3SjACnfimm/7Wmsl3fI/FP75lh457oPH+1Da3M+1T8481QcT0T7UetevR618LDPdH4hTlyHLGH3LoZEk6d4PlvyVW8pfNeMwzcDwa/kCKXoTzk9tfB455o1mXyEIOa+0PrFvcFt+fIU8QM/k6guOQifzNFHkN5l/flgsOJVHibfMR9l2nhBqem+VXyFZ/xghkMTp3il8lnDPKiGQROhs2lzjEuKcVW1uWk4ybk2Eq63pxk3CK/RZLiJO+Ti/vZXw3ZX1E+kon7jv+JJMY/+Q15uIRWIKmRthZk4VTDTsnFKYZtSsItWiskObq1Pjm4f8gqIrUF5W8ycAl+nAKIT/iCf1zSKFAgkW4/7drifrLmgsHF2k87alvhblFAcbJttWuDU/VtCiyyedMXbjGfCg6n6H1+cHE+TQFGFx/3jksa2xRoZO2cZ9xsUJn6e8aOeMX1aGco4Biw1jzilm0KPNJb3nBxvhI8rrtVTlCLK5ptCiEyBS+474POhr2c+NA9Lqm/QaHEiXzONW42yN5Q2ydG3OLU4MvI7+XEdImbCWvgSkN3zB1O1YYptOhoNnRNcDM2hRjGMTc4VZsOE9fVZOioyYyjUKPJrKPGNW44XFxX41rXEPc4vFTdS9iLTnFJ4wyFHAO2U1zcSoWNU7RLDnFTb1DocaLoDJfgc+HjYo3uTjTArW9TBJHdcYJTtdEocJ0NCnE97nGBIon0RQc4YzgaXIfdHhdBHdmrJuNtceubFFFkdtrhVG0lKlx3XUrsxz22KbIwLrbBTQ1Hhxsotsb18FR0OIWvtcT9Z5sijOyfW+KM6ShxXXYrXMJKRYlTtIUWuLubFGlknrXAGaPR4jrt5riERRFH7XGtwc1sRo3LHGuKi/qo7j+uhJOr9flKMBW4QR2uxk1NR4/rKjbGRdpXG/bXKtxrAEdVHNfTDXHLf0TAvbLVCJfU5hBwMSvXABfPE0To4w1wP25i4DLPG+CmRjFwncV6nIpQSF4UE7MOd7hAIJG+VIe7u4GCG3pWh0uPouA6C/txMFOuetIR3JSrmnQEN+WqJh2BVbmaSreLS+JMudKky9Xg4jYBRXq8BndoEwmXOVKDWx5GwnVs1eD0OSRcLF+N67EIKrS1Klx8GwuXHa/C/biBhRt6XoVbnsbCdW1V4bDyoZIRZZwKlg8iI8wKLl5Aw73oEWXcoQ003NCRCm59GA3XsVPBTa2g4bqLFZyWQsMp1h6uJ09woa/t4tCaV6WBEWSy7qYrQSbrbroS2MVNzUUOAXbWSnel0sU+AUbpsl/gEjYizlgo4w5vI+Kyl8o4xEryopYI3N1hRFzHszJueRQR17lVxqXnEHGxQhmHd06yd15CgBcQlcsIYokCJi69IHDxbUycOGki9toGJm7otMC9/ism7tXfBA6zBperMIHW4HIVJsDrwsrVIYE2CNEibIHDbBDlFkFJ0AYhWkSOemxUnLFGqN2r1L8ItXuV+hfFN1FxmXH6wwYqbuivdAgXd4RQ+36p8xNq3y91flqfRsV17dD6KCquc4eWcXFbtLyCiusu0hQ0bg4VFytSGhdXICOFilNs0nFx+QOcZ5xGsGEd4DzjOC6OH+A847QD3P9jtuJ2CGjcQeP3gYM+2YQ+TYe+wMG+NETGQd+OgL6RA30LDPrm4eu/ouJe/Q37hjX0rX7oH0mgf16C/mEO+idN6B+DoX9Gx34AAfrRDeiHXqAfF0Lt/OUHrVAfUcucRn+4D/qxSOgHSqEfxcV+iBn68W/EV3AqD85Dv3IA/bIG9GsumC8IaSb+q1XYL6VBv84H/SIk9Cuk0C/fQr+2jP3CN/Sr8tCLDEAvzwC9sAX0kiDYi6lAL0MDvYAP9NJH0ItGYS+3Bb1QGVaP2LfEG/TieNDLCmIvyAi9lCX0IqDQy6diLzwLvWQv9GLH0MtER76rRqWxPgdemtwYf9kWdYdeDh97IwHoLRigN6/A3vYDesMU6K1msDfpgd7eiOmjSEf1ZdpSC3ozMuht3LA3wIPeOjDSTRdfKb7M21VCb/QJvUUq9uay0NvyYm9oHFFKdDvaChp6E23s7cehN25nh5G3vE8aZ8LGDdjMIY49zoc9dPpFx7ikHnIh7sjnHOPYTMj36oxjzDlO1UI9Xe9oUICb49iMDTBwzXCqFuKsG2gycM1wYtaFlrCK3mTgmuJU7UzkA9cUx2bDGjpFH2FucUk9pA57onGNa4lj31uhnJzEtA+ZexxLh3KpkykwL7g4D+GUuJuPe8Kx5RCuJtJbzBuuJ/hyMmCtecSx2aBzIqaNMK+4pBHwtU7WznnGiZwI9Oykq1U2tMWxxSD7hKL3MT84VQ/wwGbzpi8c+47fCsp2kt9g/nDsp6AyNqb1Mb+4pBFQKU7bpm8cS/DjQdg+aXT/wTWOzfLL8m2DfITJwLFFS/oZQHf7CecQpxq25GqnGO0nnEMcS2iSq13WWmCycKLaHZebDDeYPBz7mb8tz3aff8Rk4tiivJQd5H1MLo5NyNIN8t6cbJw6ZV2WYys6tTnHCZ2MsRM2k8nHSdG5srnBMTXNr/qzfcYLLmyucEyd8FdR7vNeNzZ3OJZc5G967mTKu7wvx4LDMfYFtz2efMYM/o7LL3OLY080byVlULNusqBx7AeDX3B9aJWH3P6aBY8rpUX+W3e2t3SXqeAZVzq0/JyLmRe7wt0fUs849t8Jzv/u8Ngq/+K8d42FhxODp/P8VQc85VPxjzc9folXHFO/1Lh1rc3BjT0S//SeycLGCd6Sxvm51abDp8xf4dyaNL1/gw+caBhLuvj6O6v36mWn5scEPe+H5hMn4uP3hUEAr63e6y+PYX//qflHY+U/fvCVzw/3ixPD98vSbV4X5ye/yfn+aP+4MvDpg+tjZ4+K8bKOnr1z/cFTU8rH/g92biFxn2S73AAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%;transition:visibility .3s,opacity .3s;right:43px;bottom:135px}.jessibuca-container .jessibuca-ptz-controls.jessibuca-ptz-controls-show{visibility:visible;opacity:1}.jessibuca-container .jessibuca-ptz-bg-active{visibility:hidden;opacity:0;width:156px;height:156px;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATgAAAE4CAMAAAD4oR9YAAAAM1BMVEX///////////////////////////9HcEz///////////////////////////////////85yRS0AAAAEXRSTlO5DCgVgZBxAK2fQDRkBR5XTPLKM/gAABnnSURBVHja7F0Jkqs6DGQPO9z/tD8Jq6WWbCCvIjKfzAGmulrW3ooedr6ui+M4TdP++SXPr1l/SdL3aRrHhv7ZyA5qb9xe0L3Am+DrkzeCL/BeX908MezTuPsfOArdgl3KsZuhq99fk/Tx3waum+ByAHua5QbYilkzY1aP728YhrH5InrfBa57OLAtVjpRbYaumex04dq4APeC7vnVSfo/45bXLe33jGscMx3f0A1vyg3t69e2dRL/NeA6wrgdcCvjyPM2U25mXDt9xVD3f/qN0yi3Mm6P20S54vlXtGPS/R3GPSbYOsC4ZAvmJtiaGiL3Zlzx/Ht+Y/KXTJXbqmaqe9za1VYn3N7YpX/OVGev2qduOLIiB7xqOzGuWCiXFVmWtU3368A5lkqeOJI21I5XXaORxVRnxmUTdNnY/4U3riNvHMJts9XRtdXVUttipdzrK/4x7UyY6sK4Gbo+nU21T1zKcd9AGJetlMvyLKvj3zXVfeqQElMljINx3MK4xVQ3xj2Ry7N/6CiMOIfYyVUXWxUyBx7HuZRbcHt9bf/Lb9zsHlzKzabauJaK47iVcC7jJujS33/joKkmxDnM4QiJ4xDjZuT+DXQW3jgxV012qcPuiePhCGfchlv1/P0D6Czmqmuq2gPGkbIS8Q4ZsNU3dGP3Y2+cW1RyKpkrbAnwqhi3iXHFHrU3bFVV5c3vBsCsOALjkXErAW85F3rjFvBm5Kos+TngCOXYG7fA1ojFER7GPUHbmer0tfGPANeROM6pjvDMQSkrsWQ1d564Fbr61964TvSqDa6O0ELmAtvGuc2rrpQrn/aa/qCpYq+6mSpOVhnjWBy38u2JXFl9yL8acg6CV3Ur5yxVZfW4AsRxG+XKssz6n3njVMYR4Eg8sj1yi3tgtroxrpyhG38gc+h8PYddPQ551dVQW5jju2/cG7kXdB946Uy9cbDnQOpxuCCHcq5dHDcht8D2/K67VxPNGtLJd7qDTcgb1zLGbXEcY9z0Fd39GReTzIH1B/2lcxrGTYxjXnXyqxNyef8zpipVlfDsyCCmDkuumhGvWq6W+vyisqxvDJwwOxJQO6fNmjaQcRt0ZdR2dwWOFZViuculNWtgBZjk+DNq1cq45y+Lf5NxE25B3oEyLueFJWqtT+Ciqr8r48jsCAyAG+2Na53MAdQxX16VhHEL4Z7Ilc2dGad28pskaULiEdDlyijjdqa6gBeNtwSu63AnP3V6NUnAG9cu1RHOuL2hVi5qr6+9Za4qV0dCGcfCEfDIufWRFbsZvKy7KeNgW7XHvRqxWfOGLhO6XCrjoiiPb/rGdZ75uGRfj9u3B1sWAEtdLuxVF/Cq9HaMe4A4TptkZYwLqI44rmGDbUe5E8hZcg54zquRbHXu5NN6HKuO7N84YqwbdGV/Q8YF5arUN7CJTNLkgplD5T5xG+OOI2ehAhxv00ocOlpWwhHwljns5uNg6bxCb9wbueSupip6VTnj2jGudSvnOeqrVo6h7vl2nHM2K8AkV1WyfDYDvHUcWF+1VBl3EDlLKdc2dQ6aNbhXw2eAt14Nf+MqFse5rDuS8tucHUmhqaJppYF6B8440h7E8cjhqMTiLtcaAL+ga9jWZb35hpbHceyNI9WRSmHcE7n4jqbqTp2D2nnzgm154mB1hJQy1cwBIpd3twCOrjnEoDsoTZ2jepybb2VKrhpx3zB92Z29Khpl1ZN8MHWzJV1CdYQHJEeqTMbqcfEMW+obLBwES83w7AgvY0YlMNT3N96GcXEHGQdxG2t3CQ5kDkoFeO8esHd4fc193jinAtxvXhUN3Ywz5VAFGM3cENfgVM4x5YICYRumqu5yIVMdJuhaLXMAFWBKOIhbWFBiO44Dg4Usxx/cCrDyxqESMIYuu4lX1fYcGnVaaVmtKXZxHOzW5Bvfqtk3iLAFuVaLew4HluDUzIH1VYMZF+AgLMZxcAYY1uNYBTgrwPDIaqxOQ1p540IchBFTJW9c2ofNAO99Q+sYaugbJ35Vd4sKsPbGqVM33KsWmdpXLeXqufsVNwhH8FyhOh8n74foKb5WVDr0zFky1Rgt+iaJZyJTWErKMynpqsqgVy4q0xv0VTvZq0pJPq5jzn41zzzVET0aCYjmTO05OLaaBEwWqhvSenUkKtVw5P0N96mOpNr2YCPuh4AJCGEAoioDver7628Sx8WAcU2i1eM259AWhZBzuQEJieN07JR6sCHgXoSLnepI7yo9NqgCLE5A6K4hjHGKsVqK49JYEGyBg4XIq2b7FREUx5Xu2LkXOtmz2pJBW5sOqdjJF3sOjHG5fz7OT7n8DtURwjjPtBKtx7VLOa6Q4zh5Wkn8xhvU4xbG9al/s2bAbxwYkJO7XCGME43VIuMc56Dnqi7hpPE4cVopBLnibozTp5X4DHAQ49iwfsCX3IhxYFoJB8C0y7Xr1iwBSZXDulIUjF11G6+qr5aPALlCmTrfyWfQzCEK49xoPMnnjFMaq3QlX9tzQPuq0QFbLeNbMU6cHRn3Sb60HwJ6NXAhKQi61nzpPAbtQaY8jUUgQnRHSodxZSjjoig161W7HePIRGZDJzJHQXiEzE4DpRtSjotCHzkUkhj2qqJi4V54T1S6cWwVp/nhjAP1JQuDhbs4TtFW0spKTgW4UHJVFv4GQpcZA64jkt1xDNS8lDEv9Y3z5KpRGY4biIINMC7e2lxKNFJDqUfQquGZA2yrHoINUM7G6ZX1iVM2RKDUI08dssVUfduDRyI5QDkbFWCnscrWVWV1/RZ2uaRc9UyKL1LO0r7q1qwBm761WsmEUjdge9ApAB9iHHWslq4kMalHTbHQieO0zXKljHmIc4XdOE695yCpsg7eOE7t5B/4Uqv1uDSGKhDYq0r6yQWYj5NnRw5BNxjOHJAKRJB+nJqr4jcuOki4qOzs5qrgulSDJzJHUcyrCNMdOc44ty5nel815KDZ4HTypeoILAEfZJxbCjYkSpVKgZx/IpOfXgnarDkKXWIrHAm7kiTqxw1er+oQzg2Bj32FTcYJ2kpCIx9PK2XMq1ZCz+EM46LYZK4qaCsdmo+TqiOV5FWPITdYLZ2jOqYa/6LN8kJSZT1dxkSTJEYKmZ2/OuI5aIYYh+UzKn3TN9A9mLjL1cl6LexKkqof575xVJWVx3HRefdgUbGQNGs2U2Ul4HYQ60o+HeBzjCtt9VXVqXMpc3DEzh2NzEJSnr7OuG35wUTpPGjqXN3lQgdE0AWRA2sOHls1eO2yh/uqWM1LbUgvQzeatOhR5NZM39QIBNyQbviBVajYItbOYa56knCbrRrUj0vxTn5QVQlOnUtdrjKKztuqpbMEJ27WtCG3BzX9uMPfYqsmlW7SPnRfFeSqwTrAp9641VZtXi1PlX1VN44THzlvPe4k45aZLys9h+7cvuqsAqEpBAm6I9HJN24pZ9oIRzp5XzVUsVCZOnd0Ry4zbu52GdMBDn7j+NVyYXaEneW6+sbNrQcjtwdJCTh4WmlrSLcF3axRZ4AvMC6zxjj9annty1X9M8BoefBMQGKudB5UjnMnMltQV1JuD5JK5jnGTUU52zeke+4cfMJ7ygxwSZuDJ6EbzDEuZF+VNLnczCETlPdkdf3Tj5yhAHhNVdV9VXgJGV9JyqWjjRdS1fWRs6vmRctK1KuiLD/b22q2KyvlWJT1HOPeo3IWqyNwlwtrxJNrlwW69ZNr0qKnoBsfNrWVcH+w9gzIFXxDeisr5cxSrzCusFVWkpVukH7coF/0zQRt0a2QGZ1HLrfAuIfDOL/uiLOTz9UMMiTmtXMOVXmxW/P+OqM6wPBKEmLcbuiGMw4lq9cmIPbewa5iIb3LdYxxKHMouYDcSeRqcxd9+dS5VFWCGZd3e9DtR5+21dbYRd/1EAaagUC6IzDLV7YHj4pSKbmDkZRLnmRNcHeQ3azZdvLJ9qCUOVyhXGVmQUSpx9GWAzNW6Y0DmYMzrbTeHjzxxTeI41zktugXtQezAsRxon7caUt9VZZMMQ7pAPMnjnTyB5lxJHPgU+enGTeajONUHWB46wfW41jmAE79nHerNiYyFeXpBu/keycyM8983CWv+sxWLe2rsgpwH7qRxPuqb7pl6IKe61RPYpcbvefQy3e58LSSbwY4B071CuNKk31VtswlTyuJ+6oZuss1h3HVCTEDluZb7Ks6prqrjijlOLTLxRlXUhng85RLo+77por7qp5c1fUN8I1Tbw9eqce9ArkvA6eqxOOr5UQGgrdVC1l5GszHnYSuNsC4OKgeF6au73S5Mt983IU3bvwqcN3jAe9y9VgkvvHPskp7DuI9h7PfYOGNw3EcH7rx91XRPbNPT2TOEbCNNw7uJOGhG+naD8+5PG/cJcI9gYu/CxuYVuqd+6reHbgBWqrvavlV5LLvAqfdc6AFYElcyW1IS0eScqg7ch65/MvABXW5ElWvZXDiOL2Tz3VHzn7Vt4F7iNuDobMjwp7DUh3hfKs+EQCbAs43O9KgG9KDrK6vMe5qIPdd4NS7XFLi4NxzADf0eEPa8aqX1lV35REjb5zac1geuYVwtfjGbTmXsJH0qf7g14Hz9xzE9iD0qigewTv5F71qaeKNwz0HXI+jb5zLODABQWaAP+MbXA2SbxdH9KlzMjw9jvAUMr72o6363hQ4VyQ+lU+vkH70ALVFM2cnP8f1uOojhLPgVZnWI7y9Enjtcr+TT/qDJdj0LW9tqlgFQtUdYQfNQupxnHE3dw5aripmDgOcOt90gHOpOvKRF85EOCJKPSrVEa/y9D9QLDQEXKco3UiqVPtdrjZIIxNuSEeX+qomc9U+3S/WUIUgvD2o7nJ9UnfECnAPWQUiSOu8HYKERz6oO2IDuE7THcHOATIO9xzQhnT1IcblVhjnagRp8QjZVw1gHOFb9ZnSuY1OvutVe3/86w4Be7XOc6GvetsuF47jAq5dElFWn9a5oJF5YUDOBHCdds9BzRw2xrWy1jl946qrC6tfb0i7uWoKZ0eaoJs1e8LR+6pQPy66GMiNhqaV4ljbc/DqjrTC1fL8n/RVa0ummiI1r0a/yyUPT2dcXBR08s9Cl9gVpdKvEvgO00LB7qta585g4eP7jIuDxEXdaSV87TID91WdiUx67uf011lkHBTea/R6HN1XhTdr0AmROw9Pd1h5euurJvxKEh2e9uyrfnYn38q4vnp7cLchXXuVbtxdLoFx1UVtpWnv0uLNGudquTCROXj2HHI6riRK791zJakjIxDKRGatMI5fu8z81y4vzU5bE2yJmYLyFsc1jaythPcc+CW4j2grGVi71GTQgnLV1tFrQduDUj3uWvwb27p2Sefjel/PAXXy+QywoFh4IZKrTF67lC6I1H6NTHEGOBeWB88LoVm6dimoGaxO1a+RiafOpX3V8r7yGayOuZfPgGsOQhy3V4Fgew7wSlJ5hXG1aY1Msj2IK8B0BAK8cYIIxBXG9bZuD6ZUlCqk5zC0x/Yczh9YtSVK9ZA3pAN6Dqq6vnAo9ANx3Ndl0LazXPK0kq/n4J06F+45XMkc7Ajv0Sy/VzZrpAsiLUnyhZ38fQX4vOqIOXX9o9cutRlgfZfrSuZgTVxU9KrKPQdQOgd3CZB7OO9VzcnZ4pYDHddnkoVSrprlAXe5ynN5gxF1/Vi7ocenp7XdcueJyxSt8wtjhRYku2EcB3Hb1LxqHMb9192VJTmuw7DxSsfxdv/Tvn7TSceiAEpylqYnH/lWsWBRXABMVLHQ8B4cjvWUfN1xTYU6wJEqqy7y1ynBEIGt8ycqBxe2BGh3JEt3hO3HtXjm0KFJ/kHIOTDCmEUM2RFMH9ygn8N+WoNmDpcLZEgfFuz2pQPMKof7eHBME0RsxAVX3OFS1Y/Zj77jtGQ34nLRWjVeHtFF/pOIc2EvRdf1m/2UKy11s+8qtXzmAKQMhiNNTDefqiWtFIlkQqEbNJFuO7g6oqr84p8PC710IxN0R0bK5VIFV2svTx9CnCPTxspm1iiGiBKeptmh26tAYOXpp+y3HSGuqUwnONzIZN7bRAdYp4bDZpee5qq5OsAKcdTQISjykUjmM/aq3lRZK3rH6a5SOMmPZw5BQ47yQ05rvm3NVVXhkLCs0YqF2EN60A4iw8Ev1dtcNXvmsGK+qukh/QIRtEHE06cK1fXtKRfLqoTLRadcw8Ev1ZkTXBXzVdkdt5k1PvtQo/24I604520lvq0EFAvxXLXlytPHpjUXcRU4tTuiJvkx4EbugxHojrRJTn4p5jY3gcspucLQKW0lVnNhFQhF5ir+VhsvgZsN/Tji9cOcVybD6wcOuQ5MuXpxirhyt0tTea9NTPKLEVf7CdzMaZdZbpd0Pw6LZ1wiN7PhWGpwk1Uz/BzQDsSEnOB6vXT+cLscntoB3sQZ4qiaV/qOixjSJYgrBNwwu0OcSYKzzbe1ExwYrF6InFdpVp3EG+IIJSlsnWv9uEQ/DrMH497IcOgt4hNxC9vXv2b5ElhU32fuuF78IQ4r3XyreV3NST5V86K16uG6YRF3iIt1gJscxRbgE9oG88E2oa5fdMu14h9x5pZX2I9DuaGn+nGXmOdw6PHrvh+X9OWagGdNbzCkI5uk7NhpwHliSDf2sIY4wQHl6ZysWvoaqcUz4hLyGUrsfF85QIZIvASsh1zZsYsA54qTDyuHSAViM7wH+x6NarDWeRHiFpHT3HE1g5zldsk6wEDOdiiwJejFJeKYvaqtWEhFqShfFSkWHikaPHZH0qJUxEOvnK9a4CE9ibvACVQsbMLKwWTWGP6qMeKOAW6o3AWOXHHZ/TiD55BGXHZW3UScfqqPVdbGMjSLa1VVcRG+KmRI53fOOxGnn2piedpgSK9GB5h0MssBVzsM3AwdfXPuuFh3ZGLaonBUk3/J9eIfcXDmcC1RLEwotgTvuDzIDY3LwM1z0kMam/1gjcyWjQePq7VscjrE2YuFxNHMLFWB1vlwKDO4rlX1tj7ROidZNc1XzZJPZh/q73O5BPBVo90R5PaTyKqYPVhcdK3iGXHxJB8RRLT14KZYl1FW7RJa5zkf6uw2cJJ8x5kbmcDsx+yO6NglQreInO+Oy9oBNry348qh2M5hFTkH4sysihA3WXNVvAIciQSVtH2d745kdZUYQ9pa1o8QNxzLqO4m+eFcNRk6BLmWiHZ3gK+a+FZH8Y444q9qbuuTmcMLlad7Ee+Iq9gOcNJ7cFqZDjCXOs98AV9m8Y84OFitI7fLK0VcwHPoqZ+Dks+wPtRhEf+IS4kZ1ElqOZrW3CBH+ar2O24U34GT8rmqntWsif24jjFrrCtuEjkD4qC2kpqrjrQ9cpDLZXlIt+I+cEl/VernsB7Zj9PTQZIYKjkX4iCz5go7mYpZY2qdI77qH+M9MtRyGsQZXC5rrzBWnt77OQCNzKB2YIi7ipwDcZXJ5YJS54p32UM/h84WAmZZdZMTBE435LLt3sm2foajbyqtTnKCwCkVCFMlHnKSpkhev4UdYHDHke5IK2cIXKACYbuWm7UqVp7uzDsOI66bzxE4ogKBZg5ZtWqCIR2+4wDiLtl2s84m+VW8ra+YNXZ3BHaA4VwVvn8vjcipEJezr8/UDOgOMDeYYv24ZGXvtzuS0Y9jO8AT3QHmnPzhz9G4OZs5QKIvFgJW40FYqraAWRP4OQSRK4qbM55Dxpeqd4B/uiNTmj1oVg5ZhZbvKZdi1mBHMyIuanPydXdk97GW4U28GZqFSjdL8h2nkgN+x7E7bo+40rj50AHOkTq3NYIQ4tpolRXKi36/Q0rj5m2uWkV81ZS6/hRvK/XRyIHRHIby95v/d1y9WEk1lmW1uVx4XekWua4SOSHiKuZnZu3HYXV9yh6EPIc74NojBuQe9uMqUz+ujp4jI+2dt6w7Qp3ghuw+krNaNctBrwYqaNB7MHgAdyk/h5K+pdfx4GzusoafKujHRR3gDu/HhfpxfxF3lTMGbrZtCdB+XIi4KDegmQPagbh1zsufIY4QV2ltJcVXDTn5EeKKuFyqcmgrOWng9g05pZG5RFvnd8SNtDuiPKRbw9H3/ztumkVOjrg5ra2kEIe7IxBx4e7IA3DjMwf3eMfhh9xovH/73dZ5n9cBHrpFzhs4hbhgB5iqeaH5IGDWtCazZuhnOXHg5jmdVX9mDte0u9TjAQz9HB6Iu4zPHt2v7kgNe+cb3FbqeVa9qBfw39C1jZw9cMBDmr7jwqHDylzL+5Sfw2V9wcn9Iy5qZFoTaZRV9b7+k1nB55Sr2gEOaysFiFO+tCSrhqsj2yzyjyAu3lYCHnojyap85gAdfV9wu3l+x2V0R36INSvWAUbvuMvzydRprWogTmfVO+AI4uB+XF/JvxK4UHekMZRucHdkQhsQvdqPuwGurV95cl+LhUR3hPfjTN5lkFa78bUH97StdEdcOJC277h0bvgO24ty6RkQV5OtG5Pn0GIy19S8/OCeKofojlu47gjVT+4/EjZvdu9grnq1uVxAB1il1beEzRtBJJQICv1VMeKU93a0OzItbzq5k90RgLhl+XGCqy3ERdYrO0fftXnb2T3VqjfE5aigMbf3YANirN54co93XMjJT20rhWteP5Hrr/NbT+7xjoPMctOzJkqq6/Luk3u84+7vuGUBSzeBweoE3yPTm8Hm444LiA5gyMXuuJU56G3NR07uAXHVwwo5fgBTf1Xo2rjVnzq7r6yK1LwSr5HHHTdt9fy5k5/R7XLcJdX7FbeOy2dP7trPweQ57FRZx7r6+Mndq3ldEzrAY938ysl9uiQ1cJNVa2SO16X6tZP/dj8uDqJW2VfM/O/ftf7FmPkK3OMZ3MAu8G3T6ytiTTU7OK8jxMlfuN1idg/X91/9VUZ81WOVo8P+Bw+0DogP6NDPAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-ptz-bg-active.jessibuca-ptz-bg-active-up{transform:rotate(-90deg)}.jessibuca-container .jessibuca-ptz-bg-active.jessibuca-ptz-bg-active-left{transform:rotate(180deg)}.jessibuca-container .jessibuca-ptz-bg-active.jessibuca-ptz-bg-active-down{transform:rotate(90deg)}.jessibuca-container .jessibuca-ptz-bg-active.jessibuca-ptz-bg-active-left-up{transform:rotate(-135deg)}.jessibuca-container .jessibuca-ptz-bg-active.jessibuca-ptz-bg-active-right-up{transform:rotate(-45deg)}.jessibuca-container .jessibuca-ptz-bg-active.jessibuca-ptz-bg-active-left-down{transform:rotate(135deg)}.jessibuca-container .jessibuca-ptz-bg-active.jessibuca-ptz-bg-active-right-down{transform:rotate(45deg)}.jessibuca-container .jessibuca-ptz-bg-active.jessibuca-ptz-bg-active-show{visibility:visible;opacity:1}.jessibuca-container .jessibuca-ptz-control{position:absolute;left:53px;top:53px;width:50px;height:50px;background:#fff;border-radius:50%;transition:left .3s,top .3s}.jessibuca-container .jessibuca-ptz-control.jessibuca-ptz-control-left{left:33px}.jessibuca-container .jessibuca-ptz-control.jessibuca-ptz-control-up{top:33px}.jessibuca-container .jessibuca-ptz-control.jessibuca-ptz-control-right{left:73px}.jessibuca-container .jessibuca-ptz-control.jessibuca-ptz-control-down{top:73px}.jessibuca-container .jessibuca-ptz-control.jessibuca-ptz-control-left-up{top:39px;left:39px}.jessibuca-container .jessibuca-ptz-control.jessibuca-ptz-control-left-down{left:39px;top:67px}.jessibuca-container .jessibuca-ptz-control.jessibuca-ptz-control-right-up{top:39px;left:67px}.jessibuca-container .jessibuca-ptz-control.jessibuca-ptz-control-right-down{top:67px;left:67px}.jessibuca-container .jessibuca-ptz-icon{position:relative}.jessibuca-container .jessibuca-ptz-icon:hover .icon-title-tips{visibility:visible;opacity:1}.jessibuca-container .jessibuca-ptz-btns{display:block;position:absolute;left:0;top:156px;width:156px;box-sizing:border-box;padding:0 30px}.jessibuca-container .jessibuca-ptz-btns .jessibuca-ptz-btn{display:flex;justify-content:space-between}.jessibuca-container .jessibuca-ptz-expand .jessibuca-ptz-expand-icon{display:inline-block;width:28px;height:28px;cursor:pointer;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAANlBMVEVfX19fX19fX19fX19fX19fX19fX19HcExfX19fX19fX1/////Pz8+oqKjCwsKhoaHn5+eWlpaOqTaDAAAAC3RSTlP/3CaKxwJiAELtp4ri/s4AAACuSURBVCjPfZPREoUgCERXBdPRyv7/Z6/Z1aQp9oWJMyYLiKUrOIpAJBdGCldgbzBkPM/QEoTI3jBEPBRDhwEvChe08Q1Ge0ImvIq4Qj8ljrLdH77CyQPWlCdHC0Q1e9rmmuC+oQN9Q4LwcQg40L6eyqm0uEpXSUqe3fKpkkqL+Y/o+07SrahNEO0T0LBsvOitf4xsLqiNTB32wtqaVKosGLO2mhUrS93+PZ4D99wPqzMJVcbEyA8AAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-ptz-expand:hover .jessibuca-ptz-expand-icon{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAM1BMVEVHcEyZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZn////i4uLZ2dnIyMjExMS8vLy+iXNeAAAACnRSTlMAYomLxwEm9+NCLo6DKwAAALNJREFUKM99k9kWgyAMRIMmEMLm/39tKaVKFJkXl3sYJ4sAXeQ3ZOcYd0+gRYblFBuFLYoS2ot5lpvYn8zJQ65TO2GVNmdCmQq/qczw4gjpejD14BgmhziEIvCjVRlPioftHW6A7xBB1a8CCUMvsuSqEkPM7eZX6h8GrQ67bYpNIbRL6rb4/k2EfVXKsgmqfQrW9qnGq96a28jGQG1ky2HXpVysyYyeDIhWq7le6ua9P36HD6+2GRi8iBZBAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-ptz-narrow .jessibuca-ptz-narrow-icon{display:inline-block;width:28px;height:28px;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAM1BMVEVHcExfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX1/9/f2/v7/y8vLUObqxAAAADXRSTlMA3IrE6SZi9wI+y0gNXAn3CgAAAI5JREFUKM+Fk1kOwyAMBQ04bJHT3P+0JVUMNMWv8zvSk1cipfjAKXHwhR7k6KTjYp7dVuWLug1XWB5wz96T/JD2O3Phmv0k5ypL6lVVFIPYpLOka5WKSSFvS0/BloHYlkza5HkMzrvVLo8ZlRr7mtFYWBBsBQ4BjC//GTxcGVw2PpOVHQ6fJj7qS4936OoN2K4e5yE6N1UAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%;cursor:pointer}.jessibuca-container .jessibuca-ptz-narrow:hover .jessibuca-ptz-narrow-icon{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcBAMAAACAI8KnAAAAJ1BMVEVHcEyZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZn+/v7X19ckk9ihAAAACnRSTlMA9+NCAsuKJsRiPv/2GwAAAJlJREFUGNNjYAAC5gxFoTYDBijw1FoFBIumQHjsUavAYGkBmGu0CgqUwRqlYNyFIO2Fq+BAnIGBJQrBXerAwLkKCUxgYELmKjBYIXMXM2Qhc5cxdCFzVzBoIXMXMYAcsRsMdgEdgs4FKT4DBqdAitGMQrMIzRkojlRB9wKaB9G8z+CMGjgshjCuMCjoWNxRAxYt2KGRYgJiAQAnZcjElaB/xwAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-ptz-aperture-far .jessibuca-ptz-aperture-icon{display:inline-block;width:28px;height:28px;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAASFBMVEVHcExfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX1////9fX1+kpKRzc3ODg4PFxcW1tbXW1tbk5OT29vaVlZVmZmZ8vCMFAAAADHRSTlMAxGJ5Mssm9+NCiYtiH91SAAABAklEQVQoz41T7Q6DIAyEJQooUL55/zddhVazzZjdHyqXXo8DhWCYTWqltNyN+MZLuxP69UGti/vAsl6c0e4L+tQ2yv1AEbvecMhO5cXdYhk+6aO3WGrNAMwentlMz/ZAKIlNoRsqY2wtFWu9t8wasc0iYVN0LkQfrG1zbxNyrIBcntOQrH1Ukkb60QcxYF1xMA2dh8zWj6ZDsLCsIrL4Ds5Hm9FMbCEROWUB0COaLXEIZJKV7CKybGO7UuxjxY2C/TkMbxboKBQCxgMN6MCJQ6Ch/QjOZg/B13LGx8FDTe3IFvl+Bc9XBi3UWoex68qeL/vxmdyxyvz3NJ8f9dDef36HN7koIK2LjxB0AAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%;cursor:pointer}.jessibuca-container .jessibuca-ptz-aperture-far:hover .jessibuca-ptz-aperture-icon{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAOVBMVEVHcEyZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZn+/v6cnJzr6+u/v7+xsbGlpaXNzc3b29vqh7uRAAAAC3RSTlMAyRjKA59J/3PzPhe1wxwAAAD2SURBVCjPjZPrssMgCIR1mkYtisD7P+zBCyZpM5mzv5hs0M8VnZvaok9BlXzc3FXbO5z0vtifFC5Kn8OL4UfxwVvuHm61d5Z0b6ZGZZwZpQAUosWsjVZntVS1sH3ZFo1IRVYfGXgx+VGwNkkIVbhq9/jm3cAhaNv1Uk3IA8mNn7D3kbQeWK3TLH2jCthrDFcTMwUWaKiClc9mJtJWhS3SF5BpJqMQW1b3xwnkDahMoHYomkeJRgSENA/MFsKML7fgoCBVbGvM+Cx4JcKWbWHKK/h1ZYS1Jy/nK3u8bB3KhzG5deMxtfv3aO7/Heq+9ms8h9fxHP4AHzAWU9zlWNgAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-ptz-aperture-near .jessibuca-ptz-aperture-icon{display:inline-block;width:28px;height:28px;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAQlBMVEVHcExfX19fX19fX19fX19fX19fX19fX19fX19fX19fX1////9fX1+FhYWbm5vz8/Nzc3OwsLDi4uLDw8PW1tZmZmYgm6a+AAAAC3RSTlMAYmOLx4kn9+NCIVJiPGAAAAD+SURBVCjPjVPttoMgDMOJAqOU8uH7v+qKFN2c597lF5LTJg1VqQG3aGuM1bNTV0wWDtjpg3pq+IB+npyzcIE9ejsDXzDCrjccs+tOariF3n2OLyw5xko0vh9MDjNb9Q0hp2GK3cixlIApe4/JD9appR8SFxWAUFLg6n63iB1irnY1Jv0mlrok7nUdcZRa1YeshxBA9iijChlxI6iZEaBgSEL2tkRcymPGGJpqlbZ6uDg0WR/F0DwuMpxDkYwiIXA8hO2uMJdGCCK6teB8RQoY8xGfevQjxYQt25qoRwDT25MRBjZ7GtP/P/afa3LHmrflXa+ruf661Hvv+et3eAF6Fh3v+sSUGgAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%;cursor:pointer}.jessibuca-container .jessibuca-ptz-aperture-near:hover .jessibuca-ptz-aperture-icon{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAM1BMVEWZmZmZmZmZmZmZmZmZmZmZmZmZmZlHcEyZmZmZmZn///+qqqq9vb3z8/PMzMzo6Oja2tpXGg+mAAAACnRSTlP/JomLxwJiAONCr+rW2wAAAOtJREFUKM99U9sWhCAInEpLBS///7WLEWy7p9O8qEzCMBIOQ15DAlLYsoegS9yFMKQ93skl4Adh+ZI54Q8pG5nxgKzkgkcsk4zhmQxRyN1OPHqtncjOu5AuppcJ6s1EHTA1YzC3Wgq3YmzGqpsmlwZAo7F8oLEVKoeE6+TbSxK0JJ/3FLOwFnUxzXuoltYDDMLoAlmYXLAWIrkqbdZKs+q4KBfkNV1uwGaBim9TdLWS3R7iGRvCNTPB7JvGlc5EXK8cKbrxooint73RzXh7Msl6Oj/uT/b62O9j8sj6gMXX0Xwf6jP3Zr9DtNAHTYMMXrXSK0YAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-ptz-focus-far .jessibuca-ptz-focus-icon{display:inline-block;width:28px;height:28px;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAPFBMVEVHcExfX19fX19fX19fX19fX19fX19fX19fX19fX19fX1////92dnbs7OyFhYWjo6Pe3t7Ly8uxsbG8vLyG+Q0EAAAAC3RSTlMAiWJjx9wm/0Lti7mfpe0AAADaSURBVCjPfVMJDoQgDERFC/bg8P9/XUSO6CqTqA0TptNDpSrMpC2A1btRT8wrNKzzjdo03KC3zhkLD9imbeAFhd3sG2kvZQ2v0NknfGBJZKkhBM9MxOxDKBV1N4iHi0TRHYjN01Qi7/kK2PtyNDU7DAEJgDAAN0u1jsQEFEkcVVmrqjeXrkWRmC67eqbgG7bJyvkQSQkvUvec7szpek6t9ubWJSK/uJVSm+APzHKCh++DWWuH4plQKNYOpfappcjy2VvJn9744cjGwx6uyXjBxqs5Xuqsvf/9Dj8rLhRg+bQ5VAAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%;cursor:pointer}.jessibuca-container .jessibuca-ptz-focus-far:hover .jessibuca-ptz-focus-icon{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAOVBMVEWZmZmZmZmZmZmZmZmZmZmZmZmZmZlHcEyZmZmZmZmZmZn///+xsbGoqKjt7e309PTExMTQ0NDe3t774OlGAAAAC3RSTlP/itxixwImAELtp8B2gZgAAADmSURBVCjPjZMLjsUgCEVpq60G8Lf/xQ62gvNeOmZuUiWeKHC1cKnC5iJAdFuwJXgmf+xg2g//G54OPuTOCUOEL8WgMMCLwgPP+Abj2aF38CrnBR7whw6Bo4fWUk7MMrQ2OrpAq0GspTLLgKg1wTailNITZA0EaTkZGjIAY5NwlATah5CGRMJYj50tFtlWiapsLvAPRdtL/WOmET7QzZyl5ywzp7NWsjBJ1odsragJqeJ9HGFNZoLaJw71hMTm0O7NeDE1Z6YsU5rGL69sedmXXz0ToW8PzA/oV09T8OJR32fb7+B17Qe3WwtC9PVbHAAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-ptz-focus-near .jessibuca-ptz-focus-icon{display:inline-block;width:28px;height:28px;background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAARVBMVEVHcExfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX1/////t7e2dnZ3W1tbGxsa3t7eDg4Oqqqri4uKTk5NImu/5AAAADXRSTlMAYieJ3MvE/0Lti4oh87zNagAAAOtJREFUKM+NU1sOwyAMY30FtoWS8Lj/UZe2gWpVh2aJH1wcO0mNqbDj4gDc8rLmiscEDdPji3rP8IX5fXLWwQWuaVu4gbKDuyPdsJMz3GLefcIPbJ6PDCEAFDlUAJiORM3NigQFAXAFlqOeRhWJyFFIHxNGvRrN0mp470U++3axGM2RAmXcXqKnkDSN0a9WIk5Sa01MpDXBQAdVtrA8lBhFnnKpsmoo5VBrhszV0KuJ5N2tP92O50iQjpzcctravoihdoi0Q1NrfN56m0VWzFBoje+OrD/s7pr0F0yUr6s5/LvUu/bz+B2ep+IHdMIV2SUZfCsAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%;cursor:pointer}.jessibuca-container .jessibuca-ptz-focus-near:hover .jessibuca-ptz-focus-icon{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAAQlBMVEVHcEyZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZn////c3Nz09PTp6enR0dHFxcW7u7uwsLAUKT0cAAAADXRSTlMA3IrE6WIm9wI+y0gNQZpqdwAAAOdJREFUKM99U9GShCAMQ8BF3Cmlpfz/r15dAe88l8zwQiQkoRrTEa3zIXhno7lhWxcYWNbtN/fa4Q/218VFDzf4of0O8A/h3TQfOGU/ytsOj9gPVyt8warkmYEQQAgABYDxTKROz88koS6AVIB1fRCNbSI1cVUy15Jq27LGjTtyzipPeWw40/IXQkrHyZSRmqw3LaQgctFNKYzYyGACfEXossLMojFEj7J0WfdwJ3dD9uY2X25tL0Hj45mTR87Y66u9IQFsDS1bL57o7JbUDNIofvpk08eej8kTe3Hz0ZwP9UFfv8OgfgBUByCEUZhYtAAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-ptz-arrow{cursor:pointer;position:absolute;width:0;height:0}.jessibuca-container .jessibuca-ptz-arrow-up{left:71px;top:15px;border:7px solid transparent;border-bottom:10px solid #fff}.jessibuca-container .jessibuca-ptz-arrow-right{top:71px;right:15px;border:7px solid transparent;border-left:10px solid #fff}.jessibuca-container .jessibuca-ptz-arrow-left{left:15px;top:71px;border:7px solid transparent;border-right:10px solid #fff}.jessibuca-container .jessibuca-ptz-arrow-down{left:71px;bottom:15px;border:7px solid transparent;border-top:10px solid #fff}.jessibuca-container .jessibuca-ptz-arrow-left-up{transform:rotate(45deg);left:32px;top:33px;border:7px solid transparent;border-right:10px solid #fff}.jessibuca-container .jessibuca-ptz-arrow-right-up{transform:rotate(-45deg);right:32px;top:33px;border:7px solid transparent;border-left:10px solid #fff}.jessibuca-container .jessibuca-ptz-arrow-left-down{transform:rotate(45deg);left:32px;bottom:33px;border:7px solid transparent;border-top:10px solid #fff}.jessibuca-container .jessibuca-ptz-arrow-right-down{transform:rotate(-45deg);right:32px;bottom:33px;border:7px solid transparent;border-top:10px solid #fff}.jessibuca-container .jessibuca-loading-bg{display:none}.jessibuca-container .jessibuca-loading-bg,.jessibuca-container .jessibuca-poster{position:absolute;z-index:10;left:0;top:0;right:0;bottom:0;height:100%;width:100%;background-position:50%;background-repeat:no-repeat;background-size:contain;pointer-events:none}.jessibuca-container .jessibuca-play-big{position:absolute;display:none;height:100%;width:100%;background:rgba(0,0,0,.4)}.jessibuca-container .jessibuca-play-big:after{cursor:pointer;content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:block;width:48px;height:48px;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAIVBMVEVHcEzMzMzMzMzNzc3MzMzPz8/Nzc3MzMzMzMzMzMzMzMzLVn6fAAAACnRSTlMA+duduRUwSGSD8toSsAAAAI9JREFUOMvV07ENgzAQhWG3lLSp6MwCViYIRSpG8AiM4FWMaPymDBKESMF/cQ0S136F353vnLuo3gp1kOYEoCXW4LFKIZAnqAXYICeASoAdzgG+cApwgF4EfwF+oDkCqIwA6gnyAKA8AaizQhsBAjzuqUHofInGIQbjRxXjMrTJuHDestR4Bng4eGrN0929PqNfzC6h06weAAAAAElFTkSuQmCC");background-repeat:no-repeat;background-position:50%}.jessibuca-container .jessibuca-play-big:hover:after{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEVHcEz///////////////////////////////////////////8Uel1nAAAAC3RSTlMA+rbVFUecgC7rYhEEz+4AAACbSURBVDjL1dMhDsJAEIXhdeiGpKYWQVKDWc8ReojFc4ReAlPFFQazad7lIGkb0jK/WEPSsZ+YN5mZEP5UrZIP0vgE0Kv3oPlIJlAk8AJM4ASYwAkww2+ABfQg0ImgugPYsfNBVl99kA0AsjOArAPQpRTGHiBB8whxM0y+3skXNltsvMYriIWrpWPA80mFJ5qL3gAfB1/tcAt7rzdiV+HEgs1oBgAAAABJRU5ErkJggg==")}.jessibuca-container .jessibuca-recording{display:none;position:absolute;box-sizing:border-box;left:50%;top:0;padding:0 3px;transform:translateX(-50%);justify-content:space-around;align-items:center;width:101px;height:20px;background:#000;opacity:1;border-radius:0 0 8px 8px;z-index:1}.jessibuca-container .jessibuca-recording .jessibuca-recording-red-point{width:8px;height:8px;background:#ff1f1f;border-radius:50%;animation:magentaPulse 1s linear infinite}.jessibuca-container .jessibuca-recording .jessibuca-recording-time{font-size:14px;font-weight:500;color:#ddd}.jessibuca-container .jessibuca-recording .jessibuca-recording-stop{height:100%}.jessibuca-container .jessibuca-recording .jessibuca-icon-recordStop{width:16px;height:16px;cursor:pointer}.jessibuca-container .jessibuca-zoom-controls{display:none;position:absolute;box-sizing:border-box;left:50%;top:0;padding:0 3px;transform:translateX(-50%);justify-content:space-around;align-items:center;width:156px;height:30px;background:#000;opacity:1;border-radius:0 0 8px 8px;z-index:1}.jessibuca-container .jessibuca-zoom-controls .jessibuca-icon{vertical-align:top}.jessibuca-container .jessibuca-zoom-controls .jessibuca-zoom-narrow{width:16px;height:16px;cursor:pointer}.jessibuca-container .jessibuca-zoom-controls .jessibuca-zoom-tips{font-size:14px;font-weight:500;color:#ddd}.jessibuca-container .jessibuca-zoom-controls .jessibuca-zoom-expand,.jessibuca-container .jessibuca-zoom-controls .jessibuca-zoom-stop2{width:16px;height:16px;cursor:pointer}.jessibuca-container .jessibuca-loading{display:none;flex-direction:column;justify-content:center;align-items:center;position:absolute;z-index:20;left:0;top:0;right:0;bottom:0;width:100%;height:100%;pointer-events:none}.jessibuca-container .jessibuca-loading-text{line-height:20px;font-size:13px;color:#fff;margin-top:10px}.jessibuca-container .jessibuca-controls{background-color:#161616;box-sizing:border-box;display:flex;flex-direction:column;justify-content:flex-end;position:absolute;z-index:40;left:0;right:0;bottom:0;height:38px;width:100%;padding-left:13px;padding-right:13px;font-size:14px;color:#fff;opacity:0;visibility:hidden;transition:all .2s ease-in-out;-webkit-user-select:none;-moz-user-select:none;user-select:none;transition:width .5s ease-in}.jessibuca-container .jessibuca-controls .jessibuca-controls-item{position:relative;display:flex;justify-content:center;padding:0 8px}.jessibuca-container .jessibuca-controls .jessibuca-controls-item:hover .icon-title-tips{visibility:visible;opacity:1}.jessibuca-container .jessibuca-controls .jessibuca-controls-item.jessibuca-face,.jessibuca-container .jessibuca-controls .jessibuca-controls-item.jessibuca-face-active,.jessibuca-container .jessibuca-controls .jessibuca-controls-item.jessibuca-fullscreen,.jessibuca-container .jessibuca-controls .jessibuca-controls-item.jessibuca-fullscreen-exit,.jessibuca-container .jessibuca-controls .jessibuca-controls-item.jessibuca-icon-audio,.jessibuca-container .jessibuca-controls .jessibuca-controls-item.jessibuca-microphone-close,.jessibuca-container .jessibuca-controls .jessibuca-controls-item.jessibuca-object,.jessibuca-container .jessibuca-controls .jessibuca-controls-item.jessibuca-object-active,.jessibuca-container .jessibuca-controls .jessibuca-controls-item.jessibuca-pause,.jessibuca-container .jessibuca-controls .jessibuca-controls-item.jessibuca-performance,.jessibuca-container .jessibuca-controls .jessibuca-controls-item.jessibuca-performance-active,.jessibuca-container .jessibuca-controls .jessibuca-controls-item.jessibuca-play,.jessibuca-container .jessibuca-controls .jessibuca-controls-item.jessibuca-ptz,.jessibuca-container .jessibuca-controls .jessibuca-controls-item.jessibuca-ptz-active,.jessibuca-container .jessibuca-controls .jessibuca-controls-item.jessibuca-quality-menu,.jessibuca-container .jessibuca-controls .jessibuca-controls-item.jessibuca-record,.jessibuca-container .jessibuca-controls .jessibuca-controls-item.jessibuca-record-stop,.jessibuca-container .jessibuca-controls .jessibuca-controls-item.jessibuca-scale-menu,.jessibuca-container .jessibuca-controls .jessibuca-controls-item.jessibuca-screenshot,.jessibuca-container .jessibuca-controls .jessibuca-controls-item.jessibuca-speed-menu,.jessibuca-container .jessibuca-controls .jessibuca-controls-item.jessibuca-template-menu,.jessibuca-container .jessibuca-controls .jessibuca-controls-item.jessibuca-volume,.jessibuca-container .jessibuca-controls .jessibuca-controls-item.jessibuca-zoom,.jessibuca-container .jessibuca-controls .jessibuca-controls-item.jessibuca-zoom-stop{display:none}.jessibuca-container .jessibuca-controls .jessibuca-controls-item.jessibuca-speed{padding:0}.jessibuca-container .jessibuca-controls .jessibuca-controls-item-html{position:relative;display:none;justify-content:center}.jessibuca-container .jessibuca-controls .jessibuca-playback-control-time{position:relative;justify-content:center;padding:0 8px}.jessibuca-container .jessibuca-controls .jessibuca-icon-audio,.jessibuca-container .jessibuca-controls .jessibuca-icon-mute{z-index:1}.jessibuca-container .jessibuca-controls .jessibuca-controls-bottom{display:flex;justify-content:space-between;height:100%}.jessibuca-container .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-left,.jessibuca-container .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-right{display:flex;align-items:center}.jessibuca-container.jessibuca-controls-show .jessibuca-controls{opacity:1;visibility:visible}.jessibuca-container.jessibuca-controls-show-auto-hide .jessibuca-controls{opacity:.8;visibility:visible;display:none}.jessibuca-container.jessibuca-hide-cursor *{cursor:none!important}.jessibuca-container .jessibuca-icon-loading{width:50px;height:50px;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8BAMAAADI0sRBAAAAIVBMVEVHcEx4eHh4eHh4eHh4eHh3d3d4eHh4eHh4eHh4eHh4eHiqaCaRAAAACnRSTlMAikwX3CxpwZ7zIGi5xgAAAZ9JREFUOMt9lb9Lw0AUx2Njqm4iGEqmEnBxslKUdhJctFMVcW5wKZ0CLpJJQRw6iVqQbg3FtPdX+l5+XHJ3796bQj557773fe8ujtOI+6jz5p84dHjTkYD4+RhT9CIRZWRPJr1bChnbY532GhT4oUpbI6HEuqvgIH9544dh9J4/rpr0Ms8oV3zMNT7X1MXSmaznzfHjM4n72moe5n8ryYrW9rKRvgf0S93JA7yKa9lbzUg3keJb8OVCtwkrFmoO4MnsAuj5rGqnZg+GZXUXkl9NjEui9n3YA9XgpMgakLXz6ujMTIgrCkPVv0Jil8KgKQN/wRN69hLcb1vrbR2nQkxwiZTGQ5Teb7TO8PUaS8Q03sE+zkjP8qbjzgJtEhRbV4gnlkOFeM7hDYNdxPbiYFvKSHN6L2NmY5WzMYPtplZdTxncRvn2sI+DHIoug22jWMaA12Y7BrXzrG8BX32XPMDKWVzw1bdMOnH1KNqNi8toqn7JGumZnStXLi0e4tcP6R3I635Nc/mzsMxl9aux9b78UVmn2pve8u6eR50j9c0/ywzyVl5+z84AAAAASUVORK5CYII=");background-position:50%;background-repeat:no-repeat;background-size:100% 100%;animation-name:rotation;animation-duration:1s;animation-timing-function:linear;animation-iteration-count:infinite}.jessibuca-container .jessibuca-icon-screenshot{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEVHcEzMzMzMzMzMzMzMzMzNzc3MzMzMzMzNzc3Nzc3MzMzMzMwv5ahDAAAAC3RSTlMAW+8S2UGVwyyZnOTRhEMAAAEfSURBVDjLzZKxbsJADIYdBQpsSCyVMlXAdEuQYGKpWFk6dWHJgsQ7sMDSpUv3PgITAQT0f7ly57ucQ45KXRAZot+/89k+X4ju9KzL4XOhlm3pR0enYrWViSRPXQIQSASkRSkIJEFRimYCuQAHSW89IOv6SH5TCsuAj68Ab1wDzqkAzqoC7AUAPtgsABgkBBgkCJiNHehGok//KRVsHqd+3Dj1/vukt3AH/Jj05s5/AmyZhFVWXDls44iVvfQWkCvgxU6g9ZdJfCLvjJbYaT3GvjOY4mQSG3SJGjhr/Y1Xohp+TGKqqzexZ/1GVGdNCitt6R8zVvb9d+JmKdl8o5sPWbtxT6zFuJcDQtk92MNmYiXHquYlZlVt1j4P6cd7fgHFW7Nhqu29TwAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-screenshot:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAALVBMVEVHcEz////////////////////////////////////////////////////////NXt0CAAAADnRSTlMAWe+X2TINXUYZvctoYyuS2NgAAAEVSURBVDjLzZKhDsJADIZLCAsEg8WgEGCWGSwCgZxB4MgEAonB8wQEXoBH4BEWXgPJgEBG0mdgR3u77raRYAgnlq+9+/t3TQF+dKbZcJXSYSnzlViT457lRScKmBqILSFA3GoO8S4E+Ex5JiSJ4CbVdyOQdZNomX9D4dl+ko3NC8vFFmhPy8FIsi0ZlwLBW/LY5BxYYreUSgoFAEmhB5Rc9OCbUoXmTmDadQKTn4y6A/XTaoSKdb6KyGU6RJ7eHgpb3ABinAoil303xB6vQnRahNhXvMdre+fzOgxVrokX4jHAnBh8PALU8Eq8BqgTg/vePF8tpuPy9/NFaalSc273RizarYqfkswjifNMQ/TyTGMv4v87L+ks5gqDbc9OAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-play{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAIVBMVEVHcEzMzMzMzMzNzc3MzMzPz8/Nzc3MzMzMzMzMzMzMzMzLVn6fAAAACnRSTlMA+duduRUwSGSD8toSsAAAAI9JREFUOMvV07ENgzAQhWG3lLSp6MwCViYIRSpG8AiM4FWMaPymDBKESMF/cQ0S136F353vnLuo3gp1kOYEoCXW4LFKIZAnqAXYICeASoAdzgG+cApwgF4EfwF+oDkCqIwA6gnyAKA8AaizQhsBAjzuqUHofInGIQbjRxXjMrTJuHDestR4Bng4eGrN0929PqNfzC6h06weAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-play:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJFBMVEVHcEz///////////////////////////////////////////8Uel1nAAAAC3RSTlMA+rbVFUecgC7rYhEEz+4AAACbSURBVDjL1dMhDsJAEIXhdeiGpKYWQVKDWc8ReojFc4ReAlPFFQazad7lIGkb0jK/WEPSsZ+YN5mZEP5UrZIP0vgE0Kv3oPlIJlAk8AJM4ASYwAkww2+ABfQg0ImgugPYsfNBVl99kA0AsjOArAPQpRTGHiBB8whxM0y+3skXNltsvMYriIWrpWPA80mFJ5qL3gAfB1/tcAt7rzdiV+HEgs1oBgAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-pause{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEVHcEzMzMzHx8fMzMzMzMzOzs7MzMz4IlKVAAAABnRSTlMA6xIU1hVqIuOVAAAAMUlEQVQ4y2NgGFYgLS3RAEQziQFZoxKjEqMSaBJpEAkgIw1ZQlBQRAEs4QhkDeIMDgAWx1gMHyIL4wAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-pause:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEVHcEz///////////////////////+3ygHaAAAABnRSTlMA7OgSFBXMmAA4AAAAM0lEQVQ4y2NgGFYgLS3JAUQzi6WlJY5KjEqMSqBJpEEkgIw0ZAklJSUDsISikpLQIM7gAJjhWp6XcaOxAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-record{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAHlBMVEVHcEzGxsbMzMzMzMzLy8vMzMzMzMzNzc3MzMzMzMxEZ/aQAAAACXRSTlMADPKKKeBxlV6neZ4mAAAArUlEQVQ4y2NgGDZgJhpowCURAJeYpIQENJEkCgWRgCeShAGyjfgl2EqwS7BFToZJiLg4ICTEImdOh0pwRM6cDJcIjpw5E6aDFeh8B5gECBCUYAkKCoMbNXNSOlyCgUEQ4apJJmxIEkjOVWFgxi4RgEsikGQJnEYp4pLA6VxUDyJLIAUJcRLIwY7qXKSIQvOHWCQODzKIleBPPjgTHM4kijNR48oGkajiYUMykwMAAfmZhUjBISQAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-record:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJ1BMVEVHcEz///////////////////////////////////////////////8NopmKAAAADHRSTlMA8gyMLeRw1x2DBpWGN2QDAAAAt0lEQVQ4y2NgGDbgDBpIwCVRAJc4KIgEZM4EwCU2KSEBHySJCcg29iBJGCBLgHUs24FdYlnNYZiESksDXKJALebMaagES8yZw3CJypgzZ2A6WIHOd4BJgABMgh2XBEtpaBjcqDMHs+ESDFyLEK46aMGGkEB2rgQDJ3aJAFwSUSRL4DQKp+VHcTkXxYMoEkhBQpwEcrCjSCBHFJo/1GIO408MOJMPzgSHM4niTNS4skENqnjYkMzkAEgzyFpeX6L3AAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-recordStop{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAOVBMVEVHcEz///////////////////////////////////////////////////////////////////////99PJZNAAAAEnRSTlMAMPndsnZj1CSYPcmL6wsdoU80pOJLAAABu0lEQVRIx5VV26KEIAhMA++p9f8fezatFDPr8LSrjMxwiWlqzRuMYKW0ENH46c3WuGyVLXEduuO83UyK59fl1jX5EEUXD9DOaSh43XEP5zUIdZ4pAecTofVnWSt3ip4rx7N61vjnY1D30CpH4QQR8vsP+RA5Rs3KpjfMU/pMim/LgbvH7DF2F8sU0owqapKLqgnhuGWwImUagn2zhUX6WQQoYkXG9WxSAJd700/ygsCpAoliaDsPiG48GM1X5Ft/06sfp8DrDE+3DpekWjxM6366fgEcnklC+AIIWYQmPEeAaUmjFOnhCLDfxZRH+w1gU5b/DYjfNcyJ0p7dxX8B+FwxQVtvAGB5ig0d5gFA5KbzS91hI8CenvlHflfN/XvzJQnxbBEko1gbvVnPii+FadSVRUEaYylQfJtpLB+aRG4LY/80yKdUbCraM0lozGR4ewZ0Wtnj1iC7hjWKNnjYmR62W15cLlL3+2pyMR09jccyuyUrHKsvthc5xsY1iWJ0Xk3t+2XP7AnWwrAQmBH6asXubmL1Z5Lz6o992jWiu9lnMSiQsK27FS9NxhCumZgB2fTBPFsFolhZr5B/D3o9sJAI6skAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-recordStop:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAMFBMVEVHcEwimP0imPwimP8imPwimP0imPsimP0imfsimPwimP0imPwimf8imPwimPwimPxLmg1rAAAAD3RSTlMA15sisGUvdz3szYwMT8H+hDJEAAABx0lEQVQ4y3WUO08CQRCADxBQchBiMDE24KswFlw0Wtig/oHzUWglJBZWio3GDjUxlhhrEzT+ABMrO2iptLLVRluDggI+xtmdXW73LkxxNzvfzuzszNwZhhDzdOxqaPGgYrgkOgFczh90ezAJQmpL2v6OHYnqk2aWxOTtAnu/O/Y5XNZXmTZjo3ot7aESwLdFeqAM0MoJkMf9ltwVQJ9PcQN0UFIJogvdJgLQVFMsAlxyBaPmVBDCE8W7qd+2SDsx0q4OwhSrCG134W54jDfKLjDNxaL8/9AAMM/solptRnoALBbwEPWYrOEzLnrZsTGoMW+fBHG2SiLPUNI6KMOH8QS/XsCMBYQekIEv7NGZF/Rht2yqmA4i3UG9O0iTqgMfhirDhRdU8XJZqqEO8tDAqje8IIt1r+I5HmBjfD9AxQ1MgJQRpc6GJRALHOAS1WRlhMs4VaSFzwIWzCUF3op71kdNsNs/FDCuA58YqCQl7IhN3WbDnlLtfjnuON515WM17c7w41QPOuBIzDT5wqi0T4ESGV3gjtTjkuPATwHoX9+cPRlmmvJ57YAir2qKy459QL/UhrS/uAu3xf8KiX3DI+b22t6jc9F/qfaum9E1pJ4AAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-fullscreen{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAALVBMVEVHcEzMzMzOzs7Pz8/MzMzMzMzNzc3MzMzMzMzMzMzMzMzMzMzNzc3MzMzMzMxdHBitAAAADnRSTlMA8AwGYt0aUcg+til5kgmZywUAAAGWSURBVDjL1VM9SwNBEB12IcGkMagxNktQSZFCYimIJAqKpZ3Vco3YBYs0NkKQgBg4ECtLFSFVCGgQrERBsLayPE0Ip7n5De73BdKLTrE3ezPvze6+GYDfsAQKy/Rz0i/OZJjY9XREuohTKulS+ZFGiADfyZXU5uHktI44VH5apDx554aXwJqloiIwiEsStAjCAsRNF1jCmGqa4Vc+BvS4JkjwzyPE6xiwzsxxeTbZxqjkANSWZFkoIj5bQBl4aBDfkPDNpeRRialB+SRAFz8UU1sAaEUjSCDoJ7iukZJ1V+c01bFczM1pWaa+a0Rp7MHn4V8Z1R9vLLCv9WjKdVFfk77JP+bZdz35YAfKXx6KhKp93abUYVbrj49g9aAYSuFCLbPUwzdCsYEWTloXgw1oGwQbENeuKwxzXhxwAADRMFd+zzRc6AAASY6RH8VjUHaXTrlOpDgCUP3gelc01e2d+f16cWbnQ46BGCRNVsWAWQJVw2xGfUXVv2k1OsLfazXqblzS99u1FwKFvBJioXBY2+r82U75Ab7O0ypVV0wKAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-fullscreen:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAANlBMVEVHcEz///////////////////////////////////////////////////////////////////+GUsxbAAAAEXRSTlMA3clDHfdfDQbsVG00u4Cqkr04dRsAAAGaSURBVEjH7VXLdsQgCPUBAROdjP//s1UTDUxsz3TRTc+wC94bHsLVmP9hkE8LIdvgupt2tFhcpy2CMZyVxNePEoqDp4hwEGz5PTqWoZNzLrmD9riltBEYzzpZQ8bweXy56Qy6Tivsp5JQYtawuMH3eJlSxIJtdSSa4xer4lMB89pK23mKrwjZVpsRzLq35vEE3+r26h6w5EKppcp3fP2lIpTPWJvoXoobeNI1sM3haHvx56tu2sdElJ54GbnPQ7RZ1sCpl8qPEMXBNQ8vN82jNbzLCPzGSDOZj/2Bqd19R1rELIEbDFrUJfKYdlALbDuDMko/hz7t8DqtCfr8h1Vt4rn7eh/6Ph37ch20aW8McsfGCOXzcr+GOlQG1rJ2HSHUDO/4Mu01qVAqTCpCJfgZ3phTS2pKm5aZOMUbs7Q6nk6L8UzRh6W78jH+gD/VRxHokPuNgUGTaPPR+zDR1mrlvcGgwkAVacSbeoN4Z0rb5/6XLrW/2GTLk2NhXHRKzrqAt9cD4rr4ddvae0NAYgOICdZyvPj4UYRf2BdfbB8iWvnTUwAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-fullscreenExit{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAG1BMVEVHcEzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMxi4XDRAAAACHRSTlMAf3WqJmy+7azWNnMAAADNSURBVDjLxZQ9E4IwDIaLfMzCOTDSOz07OjLir5CR0dmJFVHIzzZtnMzbOzcyZHnuaXpJWmO2ji4GhpAzzZeQzw8FKCj1pMHss9OgpwsGOS0YGOcVUMPsfBVkmJoVCBJW0FFB6SFIaMKAlRGDnEiDkuM00lP3SmL6H5QSh+iIr9ZWVWntUV9Z4qWbHAWrhcUYNLC4Wwm3xb1r2mOQYoVn2EKFAVb81KHiQQq6L3vSUoMBUmSzgCKbVeiL3eTp3Odf8H1sxRAZZNZt/Vt8AHcPQbiQQVF+AAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-fullscreenExit:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJ1BMVEVHcEz///////////////////////////////////////////////8NopmKAAAADHRSTlMAe4Fzh7MZbKPtN8gpX19xAAAA3klEQVQ4y8XUIQ7CQBAF0CWhKQHDGtQKQFcURUgqEARBED0Aoqp3IKnoATAEW8MNOACmhQYKcyi6uyjmr+aLqXj56bSbVoh/J3HBxcw0ZfA2c3FiQLGeQcWh1lOVDDJTAeCbCgAR6QqCDj0xCEU5Bl2BIALKMwhdKjGILRUYfCIOEynlvABANk64M5jabJxHfJY2I76yzYu/ZCc0s1WbNYAQ3jxqwMoGHoqWGHpUQajEgcYYcKWFtjLE4FGJQewoxODRDQOqKPPcHl9sfzSXa/0L349tEDsOsp/8+2/xAY+BZBY9KhM5AAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-audio{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAIVBMVEVHcEzKysrMzMzMzMzMzMzMzMzMzMzMzMzMzMzNzc3MzMz8gU00AAAACnRSTlMAL0jMZKt96hGJsSKv1QAAAJ9JREFUOMvN078KQFAYBfCbJEw2q6SUyWxTnsJT2JTJ6D38Gb6n5PpT6BwbuaNfTnz3fEp9fZwAP7czD0MsGCzBYJcEYsGwBEHQQRB0EII1CMAWdAOzyJUvJ4jyDVyZVHKGpj9guEI2IuhaDFadYnCkIm9I+kPgn8t+kI7kOsT72HcwQnJR9Gofy8DrwwtHK8pLzdeALg5fNb6cdJ1fOjOGYrl5CLFcggAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-audio:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAJ1BMVEVHcEz///////////////////////////////////////////////8NopmKAAAADHRSTlMAL0TQf2frEaZYt8E+idL4AAAAnUlEQVQ4y2NgoDdgUcAuzr4Hh4TaGQHsBp3BLsG+BoeE2hnsEkCDsEqADMIqATIImwTYICwSEIPQJFhnBjKInUGSUA2CSPCcOcIwB1ki5xRM4iiDDrKEzQlsEuUF2CVY0jbgkDhjMLQkEkj0IM4gQQ1EHMHOOXMiakRpTiQQtXgTA+7kgzvB4UyiuBM17myAM+Pgzmq4MyfO7EwjAAAEf+BAxqI/agAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-mute{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAMFBMVEVHcEzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMztXryaAAAAD3RSTlMAHd4P7ztyiy1OnKhdx7uY2gyAAAAB8ElEQVQ4y72Uu0vDQBzHE45C3SJFaSGjUEiRpJRCBifXokkpSv0DfOBrEKxUUSoFH9ClFAUfU7c4OARRCs5WjThIsJuDlLo4ldvPe8SYxGyCt1zgw+dev+8vHPcvYybvfCR2OgUv2CoLdI62bUn3gq5UJxOomZofXPUNrIChJRklfcDSiKK2bYQ6PiCaREk0EQoYPFYa3F73F+DGsBJLmAjBAMBKakG15KAxqIhd2KuK5reRccBDNbqGJhfSlnNc/kBh4OY+vaoR5QrRC0afKgxMrKdXNKI8yxRENpyd+i0VA6wMm5IOBmORCwfAFjGwolofevbuPrvpGhRgpVaqiJflrLuUQQFRToS9l894EMDe7q6yL7/G5wMATc5mQCiAvQo3HAbwLtyYHQZgTxhohgGUa/CP12EA16W2/Ou4ZEj1dNG9oPMkZGiwJWQ8j+huPoJy9Z/XHTfUFSbAURveCtE5px5vs7hQDKS25FSDn2KR5Up1/lRmIHne7BvKd82LMRJbSjr5M40lmaYZ5/PRpiCpizjJyk+CwOGOzACLpSdz02QxkiuRhd8dNOwkV7zl2YX1mcySKJrQiPkXY9klSt6rkJPRwIlmzrcWSGyzHuTb11V/N0y/S6SdwdCR4m/47OIN7XOQCfwJwHGp8IcfyRdBLEZK4Uxp6wAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-mute:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAP1BMVEVHcEz///////////////////////////////////////////////////////////////////////////////9KjZoYAAAAFHRSTlMAbk2o8o0P5TsGnVojFi/XHcV9urLaq0oAAAIQSURBVEjH3ZZZkqswDEXxLM8T+1/rkw0BuwM0f131+IvDyZVk6SrL8p88QCHp8UAnWmoWoG8AwQRN4/vOiqwUuwWqiob646MMhEW+KnMLMIXffgiZoODBusb7kCzjByF7OOszkOyp4amJ7fWVPwCN6BpyWRypvANPCvi7u4aTXe13YI+KkYA5bMRTSMlLnSyGwisSH40B0FJOrKVB6iAw2U7sGgPgQ/DTPQjitCOZT4Q6gWCtGwGFbSM34ENUNSpAKTACmC31rnRgJwjDdkFAJpfkAsZcAJvCSVQB2FaWWKdB/ATMAHwIUYL21lRBZRDiC5AnsBHBUqxEyaraFMoz0AnvHNa6xDWS34FGgNf6PYAEZoCt+BroUWFVbeb5HbCqSvB2cToyca+Adjlycdawt0C/HeyScl1W/w3gsU3aAd7JF8AuAN6isr7NAogXAFeq59Ec7ifAm49hF8wCMWfVNXAeCAkjEGuBr6R5ZGJzBrl4gGniBME+w8aMMyCsNZtfaemnmYaAQ6I3Rz0fnDhHJxc93Vrr7sHWjP3XRtTba2L3EkdFVaPC6YmXxKI9DGF1YPLdiwfD2r37cL5nDVw+uKzU5K27hsXCXPtyC2uyyl0D0p2TY7VaIvFYWU0Dm8TdOXmrVp52HG4lU4K/N38PpS/Kw70dbmb/sC0WCcQwNNzzjrzUj7veUyIIyL/4m/EP8V829O8zh5EAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-ptz{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAM1BMVEVHcEzMzMzMzMzMzMzMzMzMzMzNzc3MzMzNzc3MzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMxDm1AzAAAAEXRSTlMAHqw+E8It/gjxc03jhGDTlgAjE2kAAAI6SURBVEjHpVbZkoQgDBwg3Of/f+12gtfMbK1Yy4NampCju4Ov1y8ruNyyo9fyCibVlNW6vUu29GpWQwTVdPTernqwffHex0WP4Nro3k+PrMKCvew/PcZ95aoNsY9yua+cGxTZsnf2K7ch4CAdGnWwYx/5LgKZCgxGdrhH3BeqNmnwviFXPZbQJmcM25HJ5n7/Pczr2QqksMJfO7BJOHLKLWFdMiL1QXYRwFagMklb4GB1zS7s8Le3fqH7Q28tVLkKdIzeaOJB2OKtY8KfTQCUa4++dNsLbrqpTR7xguHGt8hfg8P+seuaEkNdBjahzOD7g1cHP21SL2LtMNBKMdTRJjffTX1wVgrsEb1ITJU6QknwYJAcQky2cE02NbzPp70KyKggtpu9xM7Ik+CBIqY+8FrYyRUkrs+MEm1TG6tG9LZxNDNFGDue63TYGgIHqUUcuNhvhyZtn5LnlDq3Juxa4noCuX0scErOpNMDCrVcHPCS5rFGuQR9KZpxnB6CQ0ZO+AIBcTPk3UdbTx1L7jLEEHsMW7ZYm8NlIFyxn8+xdL7MURYEhzd5k2N2TabxIAORwC2r00QQfNSgrnqTJfh7cDmDu9ggtV0EZFr7kGu4KAxtNDln406TLwF9iZCIwn9EfjPuncRHYm5x3NfK3cFAS5kWxljSnTFlPHBAUFg5HsCCVOd9cdwXq+027un2QJlMjqISJutCDceRtTTuT4+1Q3HWHR8cu0fh9sGvADTYH9iLah/9nPz5+/MDJnQfoIVoAnQAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-ptz:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAAQlBMVEVHcEz////////////////////////////////////////////////////////////////////////////////////1bZCPAAAAFXRSTlMAeVoYDS1pBiPv4/g6lkzO2qSxvoixscijAAACi0lEQVRIx51W2ZLcIAwcLnPf+P9/NS2wp5xkq0ziF3ZRC3R0i/l8fvi04oxx89n+RBi1sqB38TKw7lw7lNzDa3U0e57bHhJ4d567HlqGC08eLAj9Gv8XD4/OwtsdhlfCW2s9LfWtuNrMhG1uLWP17Xh14LF4m8dx1OJ9jkm85YCYch5JzDVy81on3MFYkpTNYGmHHloYI+aqlNhlh5ZSvmH1AyBUwPcMX+u/clW3XYvA2YgRGXyZIZX6PXv0l3GlV9Jp9FKcK7mytJIg8xEeBdaBtV4P8tAixexnp73tY7ZBkrk9WEL8t7ZUDqtIA3jXa8sODSeUVqw5aztT+g4QeNAgM0PGTA0+EmfVeUvU0CEW4hX+lt/zseE7jJKDSmi0EUKBhr7EAMKPvNjOA9Fz4Yk/CFgcGRSdkYOHCLRxQfzKRN5SB/b5Ot8SzzQiKqcb6ipFdCfi1JI84OBdxzarhJ8RkpxHOQszl7bpn0GpmnXq6R4OfTkwwlyUWzeQg7rSLNhNUzEUEqJF3DMHeeXgqRIaYwHimLKipK8hMZOYVfJ5oKtIFSgXk5z4KcNx3GOIPGYfPigh9YGHBNQKVKbZhxMnqq+OHfWBHARZfWm1dnfSXfJuXInplse8wy39zkisdQ5kuLY+Bpc5hwGiH8Mx1rE24DFaLqXkfrNVkjk+8JPTPF0bUw+R9MCVuA8ks/xDyF/9orMqpBQeiob5RbIbmv7/TxvoX1Oqa914TsYg7QUWx8Y7R89JQY8mY6Dat1G5GARuMOgYHY9cbL1vNvc++fk67olLk4nrQSl7457OPqdeKn+vEwm4LPzW87DyXvqIyei9znHS+cZz9SxV+Qf8nNbjn37NkDx4+PmCXzHOLUMtjgmUAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-ptzActive{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAANlBMVEVHcEwgmv8imPwimPwhmP8imP8imPwimPwmmf8imPwimPwhmP0imPwimPwimPwimPsimP0imPoLqfILAAAAEnRSTlMADprCJBnU/gXwh3LiUKxAXjJ/ELXKAAACbklEQVRIx5VW2bbjIAwLa1jM9v8/O7Iht+09MwPlpS2VwLZkJ9f1lxVG1joPdZ0u1ZIxurhv8DH6dMpQI5t439GAEc7xYPgTRnAtV7plReRhd5kDP8+fd+wzt70yPhIJzWT7/6DCJCAYLReZPMIuJC4pClSktHqbNpJO1aTmmAme3cvtWs9NSfq52CPhnJNjlbVHwgmWSWGHeQHcKFjj7fygwidf2fa4mbVOuladcnsoDn9/CKKAWf6HEtpANiJvUp9Fgr0SvocPP/sqjOCK9ktpyCAo4Kt/d4n4/6baseNKAt5XrauPN1A4ZLAd30RUI4kNfELVx+yd3lrXYIg1Bp/B/dGs5N8mPsJoVyiwkofQSlm+K9aiwmoQMDoI4wefoK/rhkESrSuV+BR2i6HZH9juLzxCtBmn6rFmB66gNJQwBOSxncT/N3FAlxAoLQfJDy2+6rMLI3aznl9fhOcGSdZzoNhex2K3TXJEVe3M4Zb6QhHuJc5BWakYIqqietcPw6FK+EHofUHRqtLEQ5X8dKVENXXgEpLOpcjwkFI30YFVHE8fyx2ShZJ/ydTKlZwZ4BCOv/af9uMi0DILe4kieynScgPbhai+DRDckTT6N6zJpI3HMghM3BMg+q9pHmwrbR0Q0D5wc0JHPy0E5Ur7Nf3Rk68LnR0NHfO28/T5P4cNr+uLFR7eEdiNxvMRbd5Onlqsis4iIVdme4di3akWOz+3T0aUnFWHa8QZrO51NO69MeLPafrNuBenxel/3d21j8k/jyxf+75OQabFxOtuT94G3Lpjzb0zBn2Dl0ep/waPidQ/p/XB60Dp7e8F/QO7WSJg4zEzdwAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-ptzActive:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAANlBMVEVHcExru/9ru/9qu/9ru/9ru/9ru/9ru/9svP9ruv9ru/9ru/9ru/9ru/9ru/9ru/9ru/9ru/+3uxEqAAAAEnRSTlMA5q0cR/PC/ggSKtN5OIhaa5izIOiAAAACV0lEQVRIx5VW2ZLjMAiMToNu/f/PboNsJ5PaKWv8kKRkWkDTQF6v/zyUfO+JX9sP1dKKd/v2acQcm992kbo1R4il7iHIif0BRNtCUOozH4cikAdt2YfjRLTnzN15/8I85wFCI2xDzlnyMLO7R0aFoTzbFGB+jIkYLkyePvmW8d2fs2ZfZuv8It9s6zvV5uSr2LmKb9oVh37QvpjYOcf8fcO3Cb1jGqOU0SvTTd6X2KUBLgKdLzaiDtE2n+isTh8/+AX7E6/Vh/NNSyfVm10RXIe1nxXRapmsDQB7SMnkmE0IxgqvUn0jteEf1T2CHXgr0gjZllGk1HoJL7lD7fRpD20CgJcwQ6EdSh3lLK0zVfuqz2WvPlPJh7HqnCQ4MysxoAYQE0vHub/toRuqzRy5pEUvbg62MzlJQn1MHBe1x7WSAddpNDSN1c9wRMhKfi2jrICwAIsQvHkD7Al41bOrBNC1Y7QdmSg15LDokGETJB/imxYJKfmFMDqI3FjUkDS3NSEDjBaxknRYSb+4nj4kC43W2OKrkqGB8jV2Fq03YiWbhHQTpUV1mMHXWYf8HlNX7ZUQRC6iwBAIK0r0ILr1UxqKsPattAkhwSIiMl76bT/Ft/TbTy2jHQoM7Cz9isHVMb6GILl0H4DGivbw7xNc8rAtiJn3O/qvD6JT/wgs7Y370ZSdWmbZWEKiG1lXImldW7Q1jGMbZW9tUVKZmGjjGvf+EXAqzWiX5OfFSHVp/zjbfGPc3whdcbTF67V2N1e79qYMru2/AnzVYFsdWFt/+nOypv8vQvoHou4gOtSrG5EAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-performance{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAnUExURUdwTM7OzszMzM3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3Nzc3NzW8hQDoAAAAMdFJOUwC/gO8ra6tUQNmVEKtAA1gAAAE4SURBVDjLzZMhT8RAEIWnpS3tXcWdQ6wgOJIKfFdUICv6AyruB5w4EuSJCwRXgUBWkGArLsEi6JVuaZkfxawguSWz/p7azLdtdt97C3ASagp+PpeXPDjHVx7McMWDCBc8qPCZB4m44YFIeOBh+ckCf9z+sCCYqi8WvA/5Nwu26cfA+JRBs4h7WmX/tr9AXcQHAPdgzEPZh5idTQBOZ3zyiModISKQGxZ7dd85E0SKfMGjM7vXeI/5AE5LvrwpcK9IOrQYB5BlCsFIvjzgrkaSjsBZbmC9XsGsAxfn8gKXpL9sSlnQFBwFTTuaKWXgI5Ar+sfHTrW6DUDO+2jEEtCNQ9wL6gNujMvvdFS3eugxGT51fBXxTvF1wLLngbT0BGphKalAy0MQ3Z4Ha2V7UoMFJKkFVAWcvH4B0OJfd9YsTl0AAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-performance:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAzUExURUdwTP///////////////////////////////////////////////////////////////8/RimEAAAAQdFJOUwD2qdfrViyAwW2XORBGtSCsD6SyAAABN0lEQVRIx+2VzQ7DIAyDYfxToH7/p10CbQ+T2s33Rb1MijM3/qDG/EurolD9zSNRggBU0hFelMABmenfADhGkJDhGUFGgiX6I1AAQlDgZK/td8ELtQORiTmIq42I2bYdCD8NjzPmYQxO+rbn2S5qzEUF6YjkgcJude56X3s0SoL7LRAeylyaVPiFq0Jyx230mpeXmXVOHssRbhackhCq25Sny++xcBW1n6Snqw6BTgrqRP6kzfDcgmRLGonDWSf2OecwB491dOrEVZpNsxiyiHzWJ0Z+BbBwzaoWVb49HrqVfSkxHen7WNznLhzl8xpQlT3E9oHUtYaufB+7NY9g9ctbjFfj/h1DwXUrzDltMn1Ql9M814EQWPLmEBg4R7JSzpFQxTmSBMkLvJKOhFHfKEEnv3L/+qw3DuMPzAFH9pIAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-performanceActive{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAtUExURUdwTBGW2xKV2hKW3BKW2xGW3BKW2xGW3BGW2xKW2xKV3RGW2xGW2xGW3BKW2+P2IvgAAAAOdFJOUwC/gCvzq1RAleURc9VmrA9rXAAAAT9JREFUOMvNkzFLw1AUhU+SxtTahnZyC+IsIeAenDuE/oJQcS/FTYTi6hKcHYpDZ/EXBME95BeURpM0Me39Db4Mgk/u23umcL8kvHfOucBBKEr5eW95xoMjeuBBlyY86NOQBwt654HrPPHAca/YuUHrDQsG9eybBWa1+GLBqvS3LJiNX0vGJw/R0N6LJ+/f6x9I3uwG0D+luRU0FnmdCtBy6ZM7KvQdjgXwJYuNZVNrFfqF8IX+nFm/oBvyS2iZ8OWxgH4u1IZmU4kgfoa5E77c0jwhoTYCbTRFGE7QrXFCveCURkK/2cRBCp2gFYiyWk7Jw4AgXOmQZMAqa9uAeCP+JsViihtb9OKIPtBUuvy8jeqyHRpMhvc5X0W6Lvg60HrPg0DREySOoqQJKRbByRWbExaqlSoVwB0rwCLFwesHquttxhcsa64AAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-performanceActive:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAnUExURUdwTH3G63zE6n3G7H3F633G7H3F633G633F7H3F7HvG7H3G7H3F6xOzy+EAAAAMdFJOUwC/hKbvK0BT2XURZct0z00AAAE3SURBVDjLzZMhU8NAEIX3LiSUNqI1qBMMChFRgYxAd07E4CI6HQwzEUXgKjC4CH5ABAKJyA+oaHqBJO3+KPaYYSZh9nyfyuyXu7l77x3ASSgu+flYX/HgHOc8kC4wwikPMnzhQaTueKAiHvi43bFg0m4OLPBM9sWCjyb9ZsHm8NkwPiUQT8MjfSX/fn+F/C3syJf9YB7oLsDkjIaiHix5QCNbGBmAFPve+3lXi/0viLB3ZnmDz5g2ICry5daAvCbZhSE2oIsFeC35ssJljiQbgZitIY7nIGu4wLG+xBnpL5tClxQhCANR1Q5TSmCCQK7YjftOVbYNUOxot0EsHl0uwHdFfcD14PJLG9W9HfpMho81X0V8MnwdcHvkgS4cBcqVo6QKHQ9B1a6XY1zAcSiIFg6QlXDy+gEd714RcAqEowAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-face{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAeUExURUdwTL+/v76+vsDAwL+/v7+/v7+/v8DAwL+/v7+/v96T4QgAAAAJdFJOUwBAgSCbs9hZap+hQJoAAADvSURBVDjLY2AYRkAJCAygbEZBQUEBKJtpJhDAOJpA9kSYxESgKphuIaBuhASqyYzESjC2hDRilQBZ64BFgm2qMLPYNCwSkQpAwlMBWYIRzJsKYrKCxZSRncKSDFYzBSNY2MD2MqRhSFgqgClPAwwJBxwSbAk4jGKZDCKZp2JIsEOcOx0ztjQDYL5ENwsYJKrTsMSvGSgepzVg2pE5qSikPRPT8sopBuDod0ATZ54JsbZyBrJgAVAp1Ax2oPXMykjxYQaLA2CMoERUZQDMrgBUCc8CKIdzAvHJhyQJpLQLSu0TCaV2lPwBSu0KQy+LAwBuJj5UbruNggAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-face:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAnUExURUdwTP///////////////////////////////////////////////w2imYoAAAAMdFJOUwBAgBvfrFmcw4wrbtGliFoAAAD2SURBVDjLY2AYRkAJCAygbEZBQUEBKJvpDBDAODpA9kGYxEGgKphuIaBuhASqyYzESjBu79yIVWIP0NoCLBIsR4WZJY5gkYiZACRqFJAlGMG8EyAmK1hMGdkp7M4gkus4RrCwBIApFwwJmwlgqsYAQ6IAIrEAwygHHEaxngJbfhRDgg0sxHoMM7Z0AmC+RAPsJ4S5NE5gid8VoHg8sgHTDh/PzM60HkzLc44bgKMf3RKuMwoQ+dNIgswJDAycUDPYjhgwMCsjxYcJLA6AMYISUTkBMLsaUCVqEqAcngPEJx+SJJDSLii1HySU2lHyByi1Kwy9LA4AqflRBKNSA88AAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-faceActive{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAhUExURUdwTBCT2xKV2hGY2hKW2xGW2xGW2xGW2xKX3BGX3BKW23povfoAAAAKdFJOUwBAgRybs9hZLG6hrV9tAAAA80lEQVQ4y2NgGEZACQgMoGxGQUFBASibaRUQwDhaQPZCmMRCoCqYbiGgboQEqsmMxEowTgmZiFViFtBaBywSbEuFmcWWYZGIUgASXgrIEoxg3lIQkxUspozsFJZkEMmxBCNY2MD2MqRhSFgpgCkvAwwJBxwSbAk4jGJZAbZ8KYYEO8S5yzFjSysA5kt0s5YKc6guwxK/baB4XDYB045Vi4pCyrMwLa9aYgCOfgc0cY5VEGurViIJMhcAlULNYF9mwMCsjBQfZrA4AMYISkRVBcDsCkCV8CqAcrgWEJ98SJJASrug1L6QUGpHyR+g1K4w9LI4ALk0RHtSETFcAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-faceActive:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAhUExURUdwTHzD63zE6n7H7H3F7H3F633G63zF7H3G7H3F7H3F68TinBIAAAAKdFJOUwBAgR+Z31ipwW4yAjb9AAAA+UlEQVQ4y2NgGEZACQgMoGxGQUFBASibaRUQwDhaQPZCmMRCoCqYbiGgboQEqsmMxEowTmmZiFViFtBaBywSrMuFmSWWYpGoUgASXgrIEowgHtsKEJMDLKaM7BSWYLCaJRjBwloAploxJKwUwJSXAYYE2KUMVRgSrAFgKhTDKPbFIJJ5OYYEG1iIfRlmbGkVwHyJBlhWCDNrrMASvxageFw6AdOOqKCklrQuTMuzlhiAo98BTZx5FcTarJXIgglApVBr2ZYaMDArI8WHKSwOgDGCElFZBTC7GlAlvBKgHK4FxCcfkiSQ0i4otS8klNpR8gcotSsMvSwOAIs+RIlIrewIAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-object{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAA51JREFUaEPtmT1oFEEUx9/bnRALGxE70btkZjcR7QMiRisRbCzEQvxCLGyEhCDRBC/RoNaWFgYLFUSwUBAUDKKFFqIQ3OzNJpfCyspS8HaejNyG87J7t7N3l03gttydefP/vbcz8+YNwhZ/cIvrhx5A3hFMjEAQBDwMwzOmAi3LWhBCLDTr5/t+ycSubdtLnPOncX1iAfQAlmXdNBmkru2RVgBSSspg+5kQ4lRjv1iAIAgqRFTIMIju0i2AWNvrAKSUowDwLqP4tACm9rWmbABCiFxXKimlhu0BtPFHtdc19wj4vn/Wtu3XnPOfWVByA5BSngCAuwCwryb8Hud8EhGNltANB/B9/5BlWXcA4GCMx/8g4jjn/H7aaGwYgOd5BxhjcwCgPd/0QcRVAJhM2l3rO3cdQEq5GxFvEdH5VsLX7aKIH8MwLLmu+zapb9cAFhcXt/f3988AwJip8Jj2L2zbLg0MDHxr/NY1gCAIpohIJ2V2BwC0iUd9fX2lQqFQ6cQvtJbICSGOxHhlVOdKjuPMl8vlqzrxI6IdWUAQ8Um1Wp0ZGhryiYghYrUtgDQionxJT0al1IwGkVJeBAANvieNDQB4joglzvmilHIXAIwrpX67rmuUamfKcxoTvnoQ3/dP27Z9g4j2J4C81KBCiC9LS0suY2yMiC7rttoZuQBEQhsiopfT6wAwUvv+hjE2XSwWP0kpRxBxgohO1kPmDhAHEgTBUaVU1XGc98vLy8eVUhoqbpPLPwIx6/wqEV2ovX8AALzZ/Ng0EWgQGa1iLQ8xPYCUyx8YHjt7EWjm2I7sAy0it7ERqNWEDkeiklIJg8pFWwC1ZC6SM9NYc1oXgcaiVlxVYmVlZW8YhlMAcCnFvOkEQPqqRBqASLTneTsZY3pjapZSpwF4Y1nW7ODg4Ie202kTgGiwSqWyrVqtXgOA6Zj0OhGAiF4R0azrup87dqDJAlA/eLlcnkDESQCI0us4gOdEdNtxnK+tfkHjA027AJEgKeUVANBROVd7p3fixwAwJ4T43kp4nR2zylynAOoE/JuAiPiDcx6kFb5pAEwF5zKJ2xXZrH9uc6BTUD0AAGh639Xo6bjUI+G/NglS+p3Y87wCY+y/2ozJSGkuRDLekQFjbEexWPxVryfpjuxhllKhNtwtAESc55xHx9M1hsR0WlcOlFLHTLyv26Ypi5hesyql5oeHh3VBeN2T6TxgCtXN9j2Abno3je0tH4G/KbtRT7VUKs8AAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-object:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAwdJREFUaEPtmTuIFTEUhv8fLSxsFrET3UIQRHtBRNdKBBsLsRBfiIWNoIisD1xfqLWlhYuFCiJYKAgKLqKFFqIgoiBoYWVlKbjwy4HMJXs3M5Nk7tzZCzfdvZPk/F9OHicnxIgXjrh+jAG69mCpByStB3AgQ+AcybmqdpJmEvv9SvJhqE0QwBm4lGikqD4VAaCMvh+R3NffrgzgB4DJDCPWpC2AYN+LACTtAPAqU3wsQGr/pikPgGSnO5Ukgx0DNJhRzZp27gFJBwE8J/k7B6UzAEl7ANwEsNEJvwVgmmTSFjp0AEnbANwAsDUw4v8AnCZ5O9YbQwOQtBnAdQA28nXlp/NG8HT1G7cOIGkNgKsADtepDnx/C2CG5Muytq0BSFoJ4DKAUxnC+5s8cSCf+j+0CXDBjAJYNgAA6+Keg7AwpldyAXqBHMmpwKjYyThJclbSSQBWfyIT5IF5kuQ3SctJzjcCiBHhxUu2GM24gRx1IGtj+gDw2I34Z0mrbXcC8JdkUqidFecEAj4fZD+A8wA2lYA8NVCSHyRtcGvouKtrg9EJQKHVB7Ht9ByALe7jCwAXSb6TZP+dAbC3D7JzgBDITgDzJF9L2u2gQoectV0yAD7IEffjDgC7plaVJQdgYotdLOYSMwaI2gETr51jD1SN6qDOgSobw/WAywltLxRVhBIxi7LxInaxUCHHFvmCpFkorWInoR8LheqsA2DB3LGIRdPIAznBXC1AIVrSKncwVYXUMQB2Sl8h+SYQOCanVaIBPJAVAM5aqBAIr6sAnjnh78s82aoHQkYlWYwz7YXXIQCLRK+R/Fg3BYcO4HnlhPPKIfefTYX7dm8m+aVOuNdP+1OoSow79KzKL5LfY4UvGYBUwZ0s4qYiazzY7RRqCtfZIm4qfGBrAEDle1e/0FDoUTKvUxiT3gfsaWlBbibFUsyDiKSkBK9nf4LkH19P2RvZ3cxUIVoEmCVZXE97DFXPrJY52JUy+lY3Ji2S8cxq4i3jsahk3QdSodqsPwZoc3Rj+h55D/wH5CHfQHNA9EUAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-objectActive{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAA9JJREFUaEPtmU+IE1ccx7+/N7O0BwUn24UeRKOd7LalvS+I6HoSwYsH8SCtLf1jEqWoyLJVMfEP6nlNIgi6eFChCB4UChaU0h7aQ1GQrnFSdw9e/JNs9LTFzPvJZI27m8xk5k02m13I3sK+33vfz/u9N+/7fo+wzP9ometHF6DTGfTMQF+mYNqwd6sKlFLcK++P3WsWF8nkUyr9stAeTcXN624xrgDVAUgcVxmk1lbaGPIFyFocou9fSonYzvo4d4BsYQLgaIhB0EYA174bAFaNWpuFhrthxDsxQQCMrKXUPwGbvfr2BSglYh39UjmwXYCwy2kh4jqegd5M/itdaL8+i5vPwwB1DMDIWNuJcBbA545wAs4V4+YIiJQ+oYsOYGTzGwniDIANLjP+hkCHiglzNGg2Fg3AGB3/Ugj9NBO2+4ujSSaMeJ2uc+PbDhC5aK1GhU6CeY+/8IZz9E+CnSomBn7zim0bQF/m4QqbPkgDOKgufH4EAzdZaKny3vUP6vtqG0BvtnCUwY4p01oFcOIZuCJ7elKvvo9OtLyESMN7IzeViA3VC3TshiY4Wkz2j0Uyj3+aMX5shAIhuia4kn6Z+DSPu6xjiCotAQQRMeuXaJJYpqsgOetbcBV8TZA+ANxgotRU3Hz48SWr7800DjHL6VJyQMlqh/I5jYZvFsTI5XcRa0cA/sLDv98iieMv98X++Sj7aEBCPwjwD9W2LNMdAqhJnQMyc5D9DGBwRhzukK4fK/647q9I1hoE6DDAO+ZBdh6gEaQ3V9hi27JS3tf/u3Hhv20kpQPldsgthQw0fOcnpc3fVK2EhosEmE33x9LJwKxM54Lj/Ap0SeoCBPz+qVw7uxnwmdQFOge8R1n0DDg1ISaxqSbJy0oE2pTvqhStbOK5FQy2ka6vOTVkoL6o5VaVWHX+yVoh7KMAvvPbNq1mQNmNBgGoiV55fry3R+jOweRpqQMBMO4wxImp5Cd/tGynVQBqg0UvT3z4eroyDMaxenvdHIBvE/GJYnzgb69MtjUDboMa2ceHCTQCoGqvPQBuSOZT5WT/fb8luOgANUFGxkoQYVja+Lq2iQm4ygKnS3tj//oJf9+PamUuzBJqJsY59Jz/9wh6+iJpFoIKXzIAqoI7solbFdksvmN7YKGgugAMNH3vqp9pN+vhtq5VMqT2PpAbjwrW59VmVAYL8iASCfdGBvm/bpQPrCvP1eP+RpYrXA5XKgTaBkA0Voqb1eupL4DToFo5YLlVZfadtkHKIqrPrFLIsXL8s0k3LaHuA6pQ7WzfBWjn7Abpe9ln4C11Qo9Pmb2aMgAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-objectActive:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAA8hJREFUaEPtmU1oU1kUx//nvthx4cJqX3RgGLsQBNG1tq8Z7axkwM0sxIX4hbhwIygibfPMeyapunY5iymzGAURZjEDAwoVm8SPhSiIKAjtQtAmiooLiyb3yEtNm76+5L37kjQp5C2Te879/+65H+eeS1jlH61y/egCtDuCNSOQyH3cWirNHVIXKO6kYvqdenbxqVlLxS8J8Txp6Ne9bDwBnA5IiIRKJ5W2LDHsB2BmC6zqmxk3UkP6AbedJ4CZfTsNcL9qJ077VgHU8r0MID5V2EsCk2HEBwbIFdT8M/aGBkgaelt3KtOB7QKEnU9NsGt7BMyp2cOa4P8tY3M+DE/bAC7cK+xnxmUwtjvCCXzFHtRHiEhpC11xADOTjwG4BCLDY8S/MvhsyoheDRqNFQMwc292QmppEPb7i6MZgEdqna7V9i0HSNx/95MscRLgo/7CXS0IWS6VrFRs8+1ati0DSEzm18kesgGcURa+3OAfSGklY5ueuP9qGYCZzceZySKC1gQAgPkvXtNjpXatn258CmlYSOSSg/qwW+B8usH9SSM6Ec/lTxM7iR/3hgEh4Jpk2Kkh/UVikiP2MBUbAggiYjFfchajtB0QM/fuOFg64D8H8QHQTQ3CsowNT8cffdLnPn8+KyXPpWKb1FLtYJ0tbbU84asCyRYOEmiMwTtq+P63JJAYH9AfxTOFbUTlNXRyPlmTdpsAKlIXQZyDDJJGGbx7/l++BSHM5EDfg7HMm91CRM6B+fdqyA4AWA5iZd/++hWymDaid+OZ/G8EGgXB65DrhAi4Jw3NsORj5VRC4A8AW+tN2Q6KwKJM54b2HcD3EtMFCLojqVw7uxHwGdVQ992OjkC5JqSJPRXw2qlEsMpFo1OonMx9/7gE211z8iirLC1qeVUlxrLvtwgU4wBO+K2bpgCoVSX8ASqiRx682hgp/jBaL6UOBsC3pMTFdCyaaUI6HRyg0llicnptqWfdeTBMd3pdH4D/kyQupgf7HtaKZIj7gDpAdefxzOw5IjECoJxeewEQ6CZBpmwj+thvCq44QEWQmZ09BYjzLHFk4SQm/C2KIm3/svGZn/AFP+qVucYi4BbmbLnOb5rGr+zB6MugwjsGQFVwWxZxoyLr2bdtDTQLqgsAQt33LvdIe6UenvNaJUQqJ3Hi3ut+KSNLajMqfQV5EAnzRuZoEF8ivfZw74dqPbXeyP4MVSoE0DoAmkgafeXrqS+A08CpHBDTPpXRd9oGKYuoPrNqETlhD/w446Ul1H1AFaqV7bsArRzdIL5XfQS+AaeCtE+rbksUAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-logSave{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAA1RJREFUaEPtmT1oFEEUx9/bFLFKJzG2WiknZObFxlO8RtFC8SuFWlrYGBtRRNCghV9YmFQWgoVaaAS1ULRRRKvbmYBBQezVYBOIGFMkT0ZuYXPufOxdspuDO7jibmfe/H/z3sy8eYvQ4R/scP3QBSjbg8EemJyc3La4uHgUETcx82YAWNum+N8A8IWZrxLR41ZtBQForUeY+Xarg/j6MfMVIrroa5f13AuglOJWDLfQ56aU8mzefk4ApdR9ADiW12ir7RFxXAgxkqe/FUBrvYeZXzQbY+bh3t7ed5VKZTrPQM2eNHYQ8VGGjTtSypOhtq0AcRyPIeKptCEppTfkbAM3AxhbcRwfyYJg5nEiCvKEVZBS6hUA7EoEIeJ+IcTz0JlpbpcFYNrYIBDxlhDijG88lwd+IGJ/YoCZ1xPRd5/BUA/Mzc31VavVWRcEM18jovOuMV0eWLL7tBM+RoBS6isAbEzERFFUHRwc/JD8dnjishDikg2iSIAJADiU8uhdIjqRFuZYEweI6Gmuc8AWs6EhVK/XR3t6eg4zMyKiEQ/MvOSwQsS3iHhhZmbmY61W++UIp/dSyu2FAmit3zDzTjMoItaFEFuVUt8AYCB0ElLtZqWUfYUCZHlQKXUQAJ60AAC2Nbhia8AWglprAoB7jYQwmGXVACSKzRqJomgLAJjvBh/JqgPwCQ7dRAoPIZ/w5HkXIHQGQlOHvCd56PjdEOpoD6TShT/MfD19OXeFQCPnOYeIaxYWFiaGhoZGQ9Pv5nZthVA6XWjkOsMJRGj+b/IhIURtVQCkIUJvYKUCONLf/+67tjuw+T+rLlTYLmSDCDmwbOIbF6CgC1Vba8B3m3JBuMQXDuC4iGQy+MSXAhAKESK+NAAfRKj4UgFsEHnElw5gBGit9wFAUqy9kbco1vY2Gsfxsha2QrbV1K42gIimAPDvw8zTRLQuy0ZhpcU8AMZ7zPws1ee1lHJ3LoDlLu7mAcioZFuLvYWV130AU1NT/fPz8zuyqtWIuFcI8TKXBxo7QaEvOCyQD6SUx20T4K33F/iKKVOj7yrqBWhsiSv6ki8zNBBPCyHGfKEXBGCMrMBr1mZtPxHxEzN/jqLoYbr07oIIBvDNRFnPuwBlzXwybsd74C95KWhPrxIhsgAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-logSave:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAAAthJREFUaEPtmTuMTUEYx3//TrWdeLRUJCrReISGUBCvLVAqNGiEiASh8IoClUKyBQqPBAWhsREqnYRE9NgoV0T3yci5m9mzc2bmnHvvOXuTO8ktbs7MN//ffPP45hsx4kUjrp8xQNcezPaAmW0EDgFrgLXA0j7F/wG+AlckPW5qKwvAzE4At5p2ktHusqTzGfUWVEkCmJk1MdygzQ1Jp+u2iwKY2X3gcF2jfdS/I8l5O7tUApjZTuBlwNIk8E7STHYvQMCTzs6jgI27ko7l2o4B3AaO+4YkJadcVcdlAGfLzA5WQGR7IgbwGtjuCdoj6UXuyJTrhQBcnQjETUmnUv3FAH4CyzwDKyX9SBnM9QAwIWk2AXFV0tlYnzGAebtPP9OnEPkNWO2J2STpQ+9/xBOXJF2ogmgT4Amw3xNyT9JRX1gEYq+kZyGIoQGY2UXgAPyPt5x4V8qH1TRwDvgk6XdkOr2XtLltgLfA1qLTj5I2mNl3YEWDdTQraaJtgAVryMz2AU8bAFC1Boc5hYKbgJmtB6aKgDCbZdEAeLuOWyPrit+qFMmiA0gJrjr4yu1an0Ip4Z6Hss6hMUBu6FD3JB9PodwRGGkPeOHCX+CafzmPDUAR85wBlrgwQ5LbUueV3AHsaxGbmR8uOAGTPYga8f+0pG2LBWAOosYNrFOAqith6L5bdQee81optG7nHIjE8DlnVlB8EVa3AxCJ4VMAleJbB2gAERXfCUANiKT4zgAyILLEdwoQgcgW3zlAIWA30EvWXq+bFBvESTzQxFZqSyqdAe7i7xIAvTIjaXnIRmupxZoAznvPvTZvJO2oCzDQ5G5NgPKbRGWyt7X0egrAzFwedktFtnqXpFe1PFAsxLYfOEIaH0g6UjUAyXx/i09MQY2pq2gSoPDEsB/5QuJPSnLrMFqyAAqIQT+zloX9Aj4DX4CHfuo9RpANkBqJrr6PAboa+V6/I++Bf0in3kCazcMZAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-zoom{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAkUExURUdwTMDAwL+/v7+/v7+/v76+vr+/v7+/v7+/v7+/v7+/v7+/vxtcv/AAAAALdFJOUwBVdZCpGdZE7C3B0wnY6AAAAV9JREFUOMt1lDtPwzAQx20ghGwVsHVJhQRDlsywWKqEULsw8FhRJ2iWiglGGJvFCw8xIVVCSEwkKU25L4ftpOHs2Cclsu7v370smxCLecRh+xOH8Ja5kGEs/6dtYf1XONcWZurbwwRCQjYZ9l7uHAPAOBHpI1QC/QSY9g84ldmnAn7Z3htwsfZnvSe54eJd5hlcC7gccxTwSETZEr5+714vLRdfkFraVNtetXLpR7ha+mkHCV1Y/q8ZOW8AgDkecsIaAEIcGbIGyLUq4KcBYl0o7QAB4FZACBMrQKpaJOCZQqyAIhgayYEpgD1DZghXCvBTNJFKmCvgzmhcCEsBwMjSRx6BslYftRX0JLYKrAsLqzDC54EFMwvy58QhMM8hFNq0UpwET+sLC9/4BmEBTytyRCIbDoAEiR1Qp1dbRxfoyv9g3ogaKVuXhVZZbtqX6Ez6H23PxG4CM259QDwt/h8ABfK8nDqSAAAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-zoom:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAzUExURUdwTP///////////////////////////////////////////////////////////////8/RimEAAAAQdFJOUwCCyreU7KZVRCDaZnETLwj6WaYVAAABUUlEQVRIx5WV2Q6EIAxFoVBWxf7/184AOnGUsvTBqDmXrqRCzNou1kwGtyZIQNuiD0P6evWTURFUMtIoPO+iVoGIZPkMqkdKA0jZgoJ6suQc2EoiGBldOoQ9HSDk5+GTs1Fqo9IlcEpvNv3qv0MBhSalIFSv3+MCJCY8fUaCxasycrMu9dp5VTUhubXZ6CqsAvn66ZAsx+e8fON37oT3bZ4aiRU0kDlavGSrQI95HPBZACt8FuCL16IruBVkzBeBW+CLYHvyfiDQd96IpHpOMqP++fAq9VMQ7rwrM5+6gjwG/3y/D/m8ylPYpvpAeqO7DfvwMPO9D6jnBabG56YFZx77fEjD+9AyLdYEhp8nxoNh5wmJtfY8AS+wzIZZrJNcC4h3wV8IH1p87Iyfnc6XVaAd7ICHAsebw97zgDSxZ/yvViiPuYUfTe650knM2+7Ywz9yOCklzohLOwAAAABJRU5ErkJggg==") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-zoomStop{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAMAAABg3Am1AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAzUExURUdwTP///////////////////////////////////////////////////////////////8/RimEAAAAQdFJOUwDjmTC6Y0KBVakX8s8iC3JYR1wyAAABVUlEQVRIx62V2baFIAiGcwJRS97/aU/Zbtht0VzrcJOuvl/AAabpXy1RF0F/m2h2PX5mzucEuO9gMon1MY7KlG8w4LImC1XFQmxDGVkm1DYpXi0qS1gXTEGzKoqNS1ajAxPqJDikFLcFS+aukYJffRfXnAj9kYUXFVi86wzzPjuCFRXBwS3KaC/Pt02Ww7uf1jz3BVYtX/OsyDQFDn7yswPXb+Ovs39eJJWwxrOXV4thgC+//QBf/uMAXwAa4AuRBvgdWR58CB2B+eaRG5e8QO7Jn2sIAvzhbdsDnXzev8q0BengGXv8EciH3y1CY5++yI/BRNx82g/La7lc7b0Am/tUC6n3HoZ4SbDyy5BgzSNivV6wbPXeIPOpHlOU+CjkTQKvQOpXdRdJvn+5xttWQa4EZUOzluonT6+q72X6Zb0+T/lNhQd7hg9vm8LWUhW5gT4iN7c/0ZUo8Q3AttYAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-zoomStop:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAqUExURUdwTBKV2hGW2xKW2xKW2xKW2xGV3BGW2xGW3BGX2xKW3BKW2xCX2xKW2yDN61kAAAANdFJOUwCAVKxm3T/DmhrxKw97YQBGAAABaklEQVQ4y2NgIA6wGqCLMCqAqV4HdIm9F0Ek22UMM9hiG4AkVzQDA+cmx+YyJJnDlw8wMNQaNpfevbu0QgxJgrN3JQPD3VvhjU57kESnOZqvvXuJgcEXxVFMEkDt1w11gZYwoVgue3d5SzaQSgCydZG1TMkBU8vBuq9guBcqNBNDgj0GQrMEb0CVYEmA2ViANRQZ795tQPZduADciXcVUNSthGu4hGrAJawagBIXsWoAClzGqgEocRWrBqDIrQNQDTPRXZ8A0cB41wBNQgGiQfbubTQJAagGDB0GIA0OsnevbkCTCADiu4J374ahW34JqAEIbiXMRJOAgkvMKJYgJBx6717AKiF4F4eOu+jxgQCXGHBIKPDgkBC8JYCURJDtQHYWN4oEcvpZiyR+C9lZtkgSKKG1CyGOGrxItleixjrcLFBWRAYcMIkG9NQMiY67N7AlcxAQwMwA6SBxM2xZQ3jtVRPsRQ83sg8ACMIUxzzE8wsAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-close{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAeUExURUdwTM3Nzc7Ozs7Ozs3Nzc3NzcrKys3Nzc3Nzc3NzePZJxkAAAAJdFJOUwCtKdPBGAmNTt3jdDcAAADfSURBVDjL1dOxDoIwEADQgwR07GTCZtI/IGHgAzBhM9EPkMTB0Y3V0ZXIcn/rtRR6pefgSKeSu3ellyvA9lZ/5F9p/3K7PZY8oPG5BD6MpPUSgIITzdIStifAshjRQV1PCFT8TxaicTzzwEwINOEdHVmDmcTAkRhMhMAp7iQRjcMtDhCp8SA1v0ARGIIK/gnkv0p1OBTS4QRUIpE7DiYYXTBrzcld3JIrAarXrps4AVNwRSZgExoJmIyAaAdsShUMn/JF2fh4YEkpAcgvnuwYCIb6EbbbP4PsDfLD2dD6Av1qTvAQlzUTAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-close:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAeUExURUdwTP///////////////////////////////////8kBMKEAAAAJdFJOUwCt0igUwJdJePGbgLgAAADcSURBVDjL1ZMxEoIwFESTCaOWFDapqeicnAALTiANnaWlnVewDTMW/7b+aCAb8jkAVIHN2/lsNkrt73lf8M08nnF1pAYFR/dFmAAx7SIoi4iDbRrWDMAuQFzmmxAGbjjJgjj6dCjMCAND/o8RWQMzUgIRKYE/wsC5TJIRR74rBUZaqqXwLZEXT0WTDGwLW1aavJWQir9qadw++NgykWoMNtcykh8Q5EECgr5C+jjpGjHjPGhPU5eVzyfPJitfnUyhPg6ywMKZ7BygcYcsPCj1Kc8uXYPqpeSLs6PnC4w8S+8OJ9MLAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-narrow{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAABm1JREFUaEPVWWuIVVUUXmvfYRosHzUZUUqKjkSXSe5Z+5qJhfawLELCR5ohPhKjjB4EWgkpkopRSWEPS1Mqy7Gkd0iPGaKy6ey9Z3z0opwEQytSMiS5NZ4Ve7j3dubMOfecO96buf/cx17rW+vba52919oH4RQfeIr7DxUjoLW+BhHHAsAAZh5gPwGghpl/TKVSHZ7n7T9+/Ph+ANg/atQo+1mRcUIEtNYzAWAiM09ExLPK8KgNADYw8wYp5Z9l6PUQ7RWBvON3AMClJ2Kcmb9DxAKR33qDVRYBrfUNzLwQESf0xliUDjPvR8T1RLSsXNzEBIwxc5l5fYSBnxGxxfO8bQCwN5VKHc7lcofr6+tzR44cGcTMg4UQgxDRfp8IAJdH4KwlooXlkEhEQGv9EAAsDQF+GwDWEdE75Rg1xlwFADcx83QAOCOg29SvX79ZDQ0NuSSYsQS01h8BwBUBsF45HnTIGHMBM9uFmR2Ya0bEWxzHORBHoiQBY8xmZp4RAFlNRIvigMuZN8asYOb7Azq7hBCTMpnMvlJYkQSMMUuYeblf2fO8ZdlsNiyVyvE3VNZ13XFCiGb/JCK+6DjOrLIJ2N0GAN4KKG4hIpuzVRtKqf6I+HvAwAIiWhdlNDQCSqntga3yUyK6rGqe+4Db2tqu8zzv3cJfiPiLfQYdx/k6zH4PAvlD6iWf8B7P8yZls9mO/4KAtaG1fhgAHvCReN1xnClJCXweOGFLhrAapJqamlLDhg372H9eMPNMKeXmoL1uEVBKTUXEJp+QJiJZDSfjMIOZgIibHMcJbrfdq1Gt9WMAcI8P/D9f/YJtpVQfW7n6isSDRHReyQhorXcCwMV5oWN1dXWD0un04bjVqta81to+i7bi7RpCiAmZTOYDv71iCu3cuXNQZ2env07fRkSTq+VcEtyQ7XwNEfkz5N8Ucl13khDiDR/b+ZlM5vkkhqopo5Q65Euj74loRGgElFJ3IuIThUnP8xqz2eyeajqXBFtrvR0AiuU7EXXbeIo/tNaPAMB9BVBmrpVS/l3KiDFmBjNPKbMbK0A+6zjOq3EktNavAUAxlUsR2AIA0ywgM3dIKYfFgRtjmph5apxc2Dwz/ySlHBynq7V+wV+tliLwPgBcmwdsJaLRceDGmD3MnI6Ti5j/g4j6x+lqrZ8EgGKTE0nAGPM0M9+Wj8BhKWV9HLjrukuFEPMBoMf+HKdrm3oimhcnFyy1IwkopRYj4soCYF1dXf3JPAMKfiilNiFisaSOJOC67nQhxCu+h3i0lLI1boWqPW+M6WDmoXk7+4io8L3rr+IuZIwZycztPocWEdHqajtYCl8pdSEifuOT2UhEc/w63fZUrfWvADCwixlii+M4408mAa31AgB4xufDHCLaGElAKbUZEf09cAMR/XCySGit7TXO3IJ9IcTQYI8cLKfvQsQ1BYVq9sBxi9La2jqipqbmMwA4Oy8bWtoHCTiIaBua0/JKB5hZSikPxhms9LxSah0i2i26MHoUct0eYt+2tRIRF5/MKGit7YFqD9auYU9tRBwfls49emJjzEBm3gEAxVKCmadJKbdWepWj8LTWHwLAlb75hUS0Nkw+6lbidkTspoCI6aibgUoSU0otR8QlBUxE3Oo4TleNlpiAFQwWUfa/XC7XZ8yYMccq6bAfS2v9OADcHUidqUT0RdkE8iS+BIBsQHkkEe2qNAml1HOIeGsA914isqQiR5LL3aMAcHoAYTIR2av0Ex7t7e3ne563mplvDoIh4le2xC+VurEE8pGwh1m3/sBec3ie96iUcndvWLS3t4/o7OycK4SYw8znRKZIDIlEBPIk7IrfGDB01JIAgJZsNtuShIjruplUKmWdtidsMLK2lFmFiPP8fUapSCQmYJ2L6cDsNfh7iLiXme1VjG3GOwFguOd5DYg4HAAa7O/Q3QTRXiavchxnhzHmIgCw3V6xWYoiURYBa9h13atTqdTssJxNEoEImQeJaIV/LimJsgkUjCilLrGXToho33mFrmoMod2I+LLneW9KKb8Nk01CotcE/AaVUmOFENcz8zgAGAIA54Y4dAgADiCifejtjcQnSSIWRgIAniIi+5q3cm/q/c40NzfX9e3bd4gQ4kxEPFhbW3sgnU7/lcThJJHwV8kViUBvHStHz0aCme2qe7W1tasbGxu7rkFPGQKR50Q5q/B/lP0HjgOoT/ydvaYAAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-narrow:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAABS1JREFUaEPVmgmoVVUUhr+fosKC5ogGSsqIpKQwMqjIBpsICdMGQ7ISo4wGApugJCoxLClssElpNEuaI5okKjOI5onKhEQrSiKiaKA/Vu3zOu+8c88593qvj7fgcO99e6/h33udtdda+4khThri9tM1ALaPAQ4Btso9GwNfAyuBb7JHUnzvCq0XANuTgePSs00bFr0L3BuPpF/b4BswtSMAyfDzgYPXRznweQ7ID53IaguA7ROBGcC4TpRV8IRL3SNpVrtyGwOwfVYoaaHgW2AZsBT4CliXnt+BXYBd02d8D5c7rIWc+ZJigRpTIwC2rwauKZH6NLBA0jONNQK2jwJOAU4FtijwPgpMkRTga6kWgO2XgSMKkjoyvGiN7d3SwpxZGHsVOEPSmjoElQBsPwScVhAyR9LMOsHtjNu+Hri8wPMBMF7SqipZLQHYvgq4tsA8S1KZK7Vjb+lc24cDsfJ5ul/SlLYBpGjzVIFxsaTw2Z6R7S2BnwoKpkta0Epp6Q7YfqEQKl+XdGjPLM8Jtn088GzuT9/FOyjpkzL9AwCkQ+qB3OSPki9GOrBByPZ1wBU5ZY9LOrkpgDcLJ2zlFvYCke2NgFcK58VkSRFU+lG/HbA9EYg4nNE7kkb3wsg6mSWesEhSMdz2z0Zt3wRcnBO+wVc/0217WMpesyRxraSd6nbgfWC/NOm3OP4lRVowKGQ73sXIeDMaJ+nFvDF9LmQ78pR8nr5U0oRBsTwpLQnn8yTlPeR/F7I9HngiZ/A0SXcPJoDQbftHIHOjLyTt1WoHLgBuyQ3uKylC6KBS8UyS1C/w5F3oRuDSnLWbSPqzynrbkSdFfG6nGstE3inpkbrVsf0Y0OfKVQAWA5OSwJWS9mggPEJuhN5OaLWkqBMqyfZ9QF/4rALwPHBskrZC0pgGwsPFRtbNazH+s6TIfeoA3JqqwH/nVQG4HTg3SVsnadsGwiMznQYMiM91vKmgP7tuXjHVrgJwGXBDTuC2g3kGZHbYXhQVWva7CkCkyg/nAIyRtKJuhXo9bjuSyOFJzypJ2ff/XCqHdBTwXs6gmZLm9NrAKvm29wY+zc1ZKGlqnqeYzH0PbJ8mLJM0dpABTAfuyNkwVdLCKgDFGniEpC8HC4TtaONEOyej4cUaubgDFwLzcgw9q4HrFsV2pAxvANuluaWpfRHAAUAUNJsmpmhrjJa0tk5ht8dtRx0cITqjAYlcv5c49zJHKI2QmtEG3wXbcaDGwZrRamBsmTuX1cTxEi8H8qnEJElLur3KreTZfgk4Mjc+Q9L8svmtuhLnAUWGka06A90EZjt6UdGTymiJpCxHG6CqqrHVL4lKnMMkRaXWE7J9M3BRwXUmSnqrlcK61uLbwIEF5lGSou3XVbJ9F3BOQeglkgJUS2rS3P0F2LwgYYKkaKWvN9neGYgT//QSYR9Hil/lurUAQqjtOMyK9UEkWXMlfdgJihTn45CK1GCHChmVIBoBSCBixU8qKIrdmRuXG5LigqOWbO+fjA7jizsbqcxsINLsfJ3REkRjAAlEVQUWbfDncjc0UYz/BewJjCh8lgGNZvJsSctt75MabLUg2gKQQBydSrwyn63dgRYTrpQUdwR91BRE2wAyDbYPSk2nuPOKVW6X4t15EHhS0mdlzE1AdAygsFpxwX0CEJcUuwM7lhgULhW5VRgeHYnXmiBuAeI2SXHN272b+gKgzRKQrYFIBNdI+qOJwQ13oi8/68oOdGpYO3xpJ2LV/45zI/t3hSEDoBXYIQ/gH99H3EBePlczAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-expand{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAABvJJREFUaEPVWWmIXEUQrnqzZseYxGM9QBNF4hrJEDfzqieuAY/gFRXPyMYbzUHwQBQUzx+KeBAJKhrRqEhEQWMU75AYXREPlunu3bjxIDGraIwiuJpFkL26pMK84eXtm3lvZieGFAzsTtf1VVd3V9Ug7OOE+7j/0BAAnZ2d2UmTJl2cyWTaAOBA+TDzgYjYDAB/y4eZ5fNjc3Pze7NmzfqlUYEbFwBr7TUAcAEzXwAA2bROIeKnzrkNALBeKWXTysXx1QXAGHMVANwEACePxzgzjyLi057nrczn81vr0VUTAGOMRPtmRDy7HmOVZBDxL+fcyr6+vgc7OjqGatGdGoC19hZmfrKC8t9LafEWAGzLZDL9g4OD/S0tLYM7d+6cyszTPM+biojy97kAcGoFPV8ODw8vbG9v354WRCoAxpiXAUDyPUrvAcAqIno/rUHhs9aeCQALmflyAJgUlkXEf5xzp6U9G4kAjDHcKMejeqy1xzDz/QBwXYyNViL6ISkwVQEYY74AgLkRJcuJ6M4kxbWsW2sfZua7ozJNTU1HtLW1/VFNV0UAxpjlAHBHWNg590ChUJCINZyKxeLpnud1RhSvmzJlyiWtra2DFS+AuAW5bQDg3cja60QkObvHSGstj588fGVi5heVUktqAqC1Xh+5Kj8nolP2mOchxd3d3ec55z6I2JpPROvj7I9JodIj9UqIebNz7qJCodD3fwAQG8aYhwDgnpC99UQ0Py2ALyMv7DIiWvV/OS921qxZk5k+ffon4fcCEZf4vv9i1I/ddkBrfSUivhpiMkSkanXeWnsFAFwCADNHR0fX1nPwYzJhAxGdkwTgJUQM38l1Rd8Y8yYAXFoytoOIjqo1CFrriQDwCyIeEsh6nndsPp//KayrvANbt25tHhgY+AsA9i8x/JvNZqfmcrn+Wo1bazuZ+fRAjogSH8w4G8YYOYtSOAZ0GxE9EQvAGCMRk8gF9BYRLajVeeFvIIDdrnOpt3zfnxcLwFr7CDPfFdqupfl8/oW9CUBsa63/DKXRz0R0TCUAzzDzDcGic25WoVDYvLcBGGPk/i+X7wMDA/vNmzdvJPCrnJvW2leZ+cpggZknKKWGqwGw1l7IzOcg4swoX/gMyNbH6HnO9/3XkgJkjFkLAOVUzmQyM2bPnr1lDABjjJTE58sCM/cppaanUK4BgJL44taZebtSalqSrDHmpXC1ysynKKU+j9uBj5hZ6nShLiJqT1Jurd3MzLkkvgrrfxPRwUmyxpinAODmSqkdTqE3mPmy0g70K6VakpQXi8X7Pc9bCgBHJvHGrEsjtCxJLlpqDw8PTwt3bGEAzzNzuerLZrMt9bwB4lCjrtHSLbQaEa8NgGaz2cm5XO6fuDPwGADcHjrE7UqprqQIxa03EoC1to+Zjy3ZGZN25R3QWt+IiCtDDt1JRNLU1EyNAqC1PgERvws58DYRSY1VpjKA3t7eaUNDQz+Xtybm1UuLpFEAjDFyRp4N2a1cSsTlLgCkaqyjwBoIQMrnRYH+0dHR/Jw5c3pid6B0YO5GxIdDV1ZdPbC19nLn3GOIOAUA1hLR4rS7F/B1dXUd39TUJEOFQ+U7RNzo+/5ZUT3RfsBHRGloZCgrtIOZlVLqt1odGC+/1noVIsoVHdAiIpJHbTcaU+ZqrR9BxHJRtycnEZVAGmOkfVwXOo9bJk+efGLcdGIMAGvtYcz8FQCUSwlm7lBKvTHeqKaVN8ZsBIAz0qRybKMRc6VKDuZ83/82rRP18mmtH0TE+0LyHxNRUOKMUVuxU7LWlkuLQGpwcHDi3Llz/63XuSQ5Y8zjAHBrwMfM/cy8oFAoxFWzu9iSRou/xtQ5bUT0dZIzta5rrZ+XyUNYDhFv931/RTVdVQF0d3e3OufKtXdI0QIiklH6uKmnp+co59zycC8SOrzfAEBHtdRNbLaLxeIMz/O+H3N9Ia52zq1QSvXWg6Knp+f4kZGRRZ7nXc/Mh1fSgYhVQSQCEMW9vb1HDA0NyS0UHS/KLF+2+NNqeRp2rlgs5jOZjDgtL+wBEcdlEv0oIi4O9xnVQKQCIEZkTuN53uqgZ4iJmMxrPkTEbXL4AECaceldj3POtSLicVKayP9x0UZEGSY/6vv+V9ZaaVHXpAGRGkBgtFgsnpXJZK6Ly9l6Uqkkcy8RlUsY+S4tiJoBBE5qrU9CxKvlZ1YA2G3UkRJIr4wxnXPvKKXGnLG0IOoGEHZSnn5EvIiZTwKAowEgrh39U2orRJRDLxOJz9IAjdsJAHiGiORn3sb8Uh91ZNOmTQeMjIwcjYgHIeJvEyZM2JHL5Wr6+TSsMwoCEVf4vr+re2zIDqSJ5Hh5BAQzS9R/IiJpf3fRPgOg4jsx3sjsbfn/AH37LF5g3/BiAAAAAElFTkSuQmCC") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-icon-expand:hover{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAAAXNSR0IArs4c6QAABYZJREFUaEPVmXmoVVUUxn8f0WRzVkJlIWVGUmIJWWADTVaUldFclCnSQBQYNv1RSCWGVFRSlkRh0GBS2YBmJWGJUBHNNJiYWQSZfwTRxBfrce5jv/3Ovefc++4z3oKLD/fea61v7bXXdMQQJw1x/ekKANs7AOcA44Ddkt/2wJbk9z2wTNIP3TLcgADYvhw4q/gFiLq0ClgBLJf0Ud1DZfs6AmD7UuA64JiBCAf+BR4GHpH0TSe82gJgO6x9PXBqJ8JanPktQABzJP3VDu/aAGzfADzYhPnPQLjFUuA7YHPx+xPYHxhZ/Bt/nw4c14TP+8CFkjbWBVELgO2ngfD3nJYBCyW9Wldg7LN9cigKXATsnJ39HTi+7tuoBGDb3VI852P7QOBO4MoSGaMlfVtlmJYAbL8HHJsxmSdpdhXjdtZt3wPcWnJmhKRfWvFqCsD2PODm7PBdksJiXSfbJwDvZIzfAM6VFG+plEoBFNHmlezEc5LCZweNbEcSjMSX0iJJ09sFsDwLlaslTRo0zRPGts8AXstkTZYUOvWjfjdQJKnFyc7PgCmS1m0NACHD9t3AbYm8yNiT6wKIWJxm2JmSFm4t5QsA2wBvZ/liuqRFuR59bsD2JcAzyaYPJU1oV3nbF8fjAw4DlnTy8Es8YYWk06oAPJnF5I6sb/tF4LxC2CZJ+3VghGFAVK17JmdHSVqf8uq9AdtR+kZNsmOx4Y9I/5KiLGiLbEc4jLDYQ5IqE2aZANvxFqNwbNBNkh5oBiAsFpZr0FJJU9vSvNjcRQBRPKbhfJWkE5sBuBe4JVmcIemJ/xNAyLb9a+JGGyRF+dFLqQstAK5J1g6XFCG0berWDRQA8py0raR/et2z8YftiD4RhRq0naS/W2lv+2wgIkNEm5x630BRaufrj0l6tso6tpcAqSuPkfR1GYAoic8sFtZJOqgG8w+Ao6r2NVnfKCn6hJZkO4+MkyStLgPwJhB1etBaSRNrMA8XG1u1r8n6Fkl7VJ21/VDRBTa29nHt9A28AJxf7NosaXgN5lGZzgD2rdpbsh6N0MyqcyWl9si0Y0sBPA6kVd/wTnJAKNTlR/wUcEUCdBdJ0bX1UArgPmBWsnGipLVVFipb7zKAKCJHFXL6uV0K4NpiMtDQabakaGrapm4BsH0o8GWiwEuSosbqpRRARIQNyVq/rFcXSRcBxBt5NJHbvJQo812gVmOdA+sigCifpyX8x0v6uPQGCgDRWEeD3aCOemDb0XrGm9q1KKevrnt7jX22DwFiqLBX8X8rJZ2S88n7gSOBaGiiMg3aBEyQ9FO7Cgx0v+1ooiJEN2iapEhqfaispcyLuo5uYSAAbEf7GBOJBkXpcETZdKIMwN7AGiAtJS6QFIluq5DtlcBJdVy52VglD6nBa6ykLwYbge05wB2JnLckNUqcfuJbDbbS0qJxcJik6NQGhWzfD9yYMI9ucKqkGByXUtVo8ceSOmecpE+6jcB2XsqEiFmS5reSVQVgNNBbeyeMwioxSh8w2Y6GPzJ+2os0+H4OxPtr6rqVzbbtMcBXJZpGkTVf0qedoCjifCSpq4B9WvBoCaISQDC2PQKIN5GPF6MqjCuOsqOpn6bK2R5fKB3K75QpHpPouUAkvrTPaAqiFoACRMxpwuqNniE3WsxrXk++0EQzHr3rwVGSZP+WGTymD3MlrbEdLerzdUDUBtCQaDvSeXyQKPPZTrwpztwuKS1h4tZrgWgbQALkaOCy4hNrn1FHTRTxdmKQ8LKksjdWC0THADK/jtQ/BQhQBwBl7Wi4VNRWoXhMJN6tA7TJTSyQFJ95u/OlPlfEdjzOALI7EIVgzEfb+nyaGSh3p4h+Pd1jV26gjiUHuqe4ibD6eklRqvfQkAHQzABDHsB/7aMVT352GH8AAAAASUVORK5CYII=") no-repeat 50%;background-size:100% 100%}.jessibuca-container .jessibuca-menu-icon-text,.jessibuca-container .jessibuca-quality-icon-text,.jessibuca-container .jessibuca-scale-icon-text,.jessibuca-container .jessibuca-speed-icon-text{font-size:14px;min-width:30px;height:20px;line-height:20px;cursor:pointer;text-align:center}.jessibuca-container .jessibuca-speed{box-sizing:border-box;text-align:center;font-size:14px;color:#fff;width:90px}.jessibuca-container .jessibuca-menu-list,.jessibuca-container .jessibuca-quality-menu-list,.jessibuca-container .jessibuca-scale-menu-list,.jessibuca-container .jessibuca-speed-menu-list{position:absolute;left:50%;bottom:100%;visibility:hidden;opacity:0;transform:translateX(-50%);transition:visibility .3s,opacity .3s;background-color:rgba(0,0,0,.5);border-radius:4px;overflow:hidden;width:-moz-max-content;width:max-content}.jessibuca-container .jessibuca-menu-list.jessibuca-menu-shown,.jessibuca-container .jessibuca-menu-list.jessibuca-quality-menu-shown,.jessibuca-container .jessibuca-menu-list.jessibuca-scale-menu-shown,.jessibuca-container .jessibuca-menu-list.jessibuca-speed-menu-shown,.jessibuca-container .jessibuca-quality-menu-list.jessibuca-menu-shown,.jessibuca-container .jessibuca-quality-menu-list.jessibuca-quality-menu-shown,.jessibuca-container .jessibuca-quality-menu-list.jessibuca-scale-menu-shown,.jessibuca-container .jessibuca-quality-menu-list.jessibuca-speed-menu-shown,.jessibuca-container .jessibuca-scale-menu-list.jessibuca-menu-shown,.jessibuca-container .jessibuca-scale-menu-list.jessibuca-quality-menu-shown,.jessibuca-container .jessibuca-scale-menu-list.jessibuca-scale-menu-shown,.jessibuca-container .jessibuca-scale-menu-list.jessibuca-speed-menu-shown,.jessibuca-container .jessibuca-speed-menu-list.jessibuca-menu-shown,.jessibuca-container .jessibuca-speed-menu-list.jessibuca-quality-menu-shown,.jessibuca-container .jessibuca-speed-menu-list.jessibuca-scale-menu-shown,.jessibuca-container .jessibuca-speed-menu-list.jessibuca-speed-menu-shown{visibility:visible;opacity:1}.jessibuca-container .icon-title-tips{pointer-events:none;position:absolute;left:50%;bottom:100%;visibility:hidden;opacity:0;transform:translateX(-50%);transition:visibility .3s ease 0s,opacity .3s ease 0s;background-color:rgba(0,0,0,.5);border-radius:4px}.jessibuca-container .icon-title{display:inline-block;padding:5px 10px;font-size:12px;white-space:nowrap;color:#fff}.jessibuca-container .jessibuca-quality-menu{padding:8px 0}.jessibuca-container .jessibuca-menu-item,.jessibuca-container .jessibuca-quality-menu-item,.jessibuca-container .jessibuca-scale-menu-item,.jessibuca-container .jessibuca-speed-menu-item{display:block;height:25px;line-height:25px;margin:0;padding:0 10px;cursor:pointer;font-size:14px;text-align:center;width:50px;color:hsla(0,0%,100%,.5);transition:color .3s,background-color .3s}.jessibuca-container .jessibuca-menu-item:hover,.jessibuca-container .jessibuca-quality-menu-item:hover,.jessibuca-container .jessibuca-scale-menu-item:hover,.jessibuca-container .jessibuca-speed-menu-item:hover{background-color:hsla(0,0%,100%,.2)}.jessibuca-container .jessibuca-menu-item:focus,.jessibuca-container .jessibuca-quality-menu-item:focus,.jessibuca-container .jessibuca-scale-menu-item:focus,.jessibuca-container .jessibuca-speed-menu-item:focus{outline:none}.jessibuca-container .jessibuca-menu-item.jessibuca-menu-item-active,.jessibuca-container .jessibuca-menu-item.jessibuca-quality-menu-item-active,.jessibuca-container .jessibuca-menu-item.jessibuca-scale-menu-item-active,.jessibuca-container .jessibuca-menu-item.jessibuca-speed-menu-item-active,.jessibuca-container .jessibuca-quality-menu-item.jessibuca-menu-item-active,.jessibuca-container .jessibuca-quality-menu-item.jessibuca-quality-menu-item-active,.jessibuca-container .jessibuca-quality-menu-item.jessibuca-scale-menu-item-active,.jessibuca-container .jessibuca-quality-menu-item.jessibuca-speed-menu-item-active,.jessibuca-container .jessibuca-scale-menu-item.jessibuca-menu-item-active,.jessibuca-container .jessibuca-scale-menu-item.jessibuca-quality-menu-item-active,.jessibuca-container .jessibuca-scale-menu-item.jessibuca-scale-menu-item-active,.jessibuca-container .jessibuca-scale-menu-item.jessibuca-speed-menu-item-active,.jessibuca-container .jessibuca-speed-menu-item.jessibuca-menu-item-active,.jessibuca-container .jessibuca-speed-menu-item.jessibuca-quality-menu-item-active,.jessibuca-container .jessibuca-speed-menu-item.jessibuca-scale-menu-item-active,.jessibuca-container .jessibuca-speed-menu-item.jessibuca-speed-menu-item-active{color:#2298fc}.jessibuca-container .jessibuca-volume-panel-wrap{position:absolute;left:50%;bottom:100%;visibility:hidden;opacity:0;transform:translateX(-50%) translateY(22%);transition:visibility .3s,opacity .3s;background-color:rgba(0,0,0,.5);border-radius:4px;height:120px;width:50px;overflow:hidden}.jessibuca-container .jessibuca-volume-panel-wrap.jessibuca-volume-panel-wrap-show{visibility:visible;opacity:1}.jessibuca-container .jessibuca-volume-panel{cursor:pointer;position:absolute;top:21px;height:60px;width:50px;overflow:hidden}.jessibuca-container .jessibuca-volume-panel-text{position:absolute;left:0;top:0;width:50px;height:20px;line-height:20px;text-align:center;color:#fff;font-size:12px}.jessibuca-container .jessibuca-volume-panel-handle{position:absolute;top:48px;left:50%;width:12px;height:12px;border-radius:12px;margin-left:-6px;background:#fff}.jessibuca-container .jessibuca-volume-panel-handle:before{bottom:-54px;background:#fff}.jessibuca-container .jessibuca-volume-panel-handle:after{bottom:6px;background:hsla(0,0%,100%,.2)}.jessibuca-container .jessibuca-volume-panel-handle:after,.jessibuca-container .jessibuca-volume-panel-handle:before{content:"";position:absolute;display:block;left:50%;width:3px;margin-left:-1px;height:60px}.jessibuca-container.jessibuca-fullscreen-web .jessibuca-controls{width:100vh}.jessibuca-container.jessibuca-fullscreen-web .jessibuca-play-big:after{transform:translate(-50%,-50%) rotate(270deg)}.jessibuca-container.jessibuca-fullscreen-web .jessibuca-loading{flex-direction:row}.jessibuca-container.jessibuca-fullscreen-web .jessibuca-loading-text{transform:rotate(270deg)}.jessibuca-container .jessibuca-contextmenus{display:none;flex-direction:column;position:absolute;z-index:120;left:10px;top:10px;min-width:200px;padding:5px 0;background-color:rgba(0,0,0,.9);border-radius:3px}.jessibuca-container .jessibuca-contextmenus .jessibuca-contextmenu{cursor:pointer;font-size:12px;display:block;color:#fff;padding:10px 15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-shadow:0 0 2px rgba(0,0,0,.5);border-bottom:1px solid hsla(0,0%,100%,.1)}.jessibuca-container .jessibuca-contextmenus .jessibuca-contextmenu a{color:#fff;text-decoration:none}.jessibuca-container .jessibuca-contextmenus .jessibuca-contextmenu span{display:inline-block;padding:0 7px}.jessibuca-container .jessibuca-contextmenus .jessibuca-contextmenu span.art-current,.jessibuca-container .jessibuca-contextmenus .jessibuca-contextmenu span:hover{color:var(--theme)}.jessibuca-container .jessibuca-contextmenus .jessibuca-contextmenu:hover{background-color:hsla(0,0%,100%,.1)}.jessibuca-container .jessibuca-contextmenus .jessibuca-contextmenu:last-child{border-bottom:none}.jessibuca-container.jessibuca-contextmenus-show .jessibuca-contextmenus{display:flex}.jessibuca-container-playback .jessibuca-controls{height:48px}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center{flex:1;display:flex;box-sizing:border-box;justify-content:space-between;font-size:12px}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-controls-playback-time{box-sizing:border-box;flex:1;position:relative;height:100%}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-controls-playback-time-inner{width:300px;height:100%;overflow-y:hidden;overflow-x:auto}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-controls-playback-current-time{position:absolute;left:0;top:0;height:15px;width:1px;background-color:red;text-align:center;z-index:1}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-controls-playback-current-time-text{position:absolute;box-sizing:border-box;padding:0 5px;width:60px;left:-25px;top:15px;border:1px solid red;height:15px;line-height:15px;cursor:move;background-color:#fff;color:#000;-webkit-user-select:none;-moz-user-select:none;user-select:none}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-controls-playback-time-scroll{position:relative;width:1440px;margin:0 auto}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-controls-playback-time-scroll.one-hour{width:1440px}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-controls-playback-time-scroll.half-hour{width:2880px}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-controls-playback-time-scroll.ten-min{width:8640px}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-controls-playback-time-scroll.five-min{width:17280px}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-controls-playback-time-scroll.one-min{width:86400px}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-controls-playback-time-list{position:relative;background-color:#ccc;height:48px}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-playback-time-day{height:100%;overflow:hidden}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-playback-time-one-wrap{height:8px;z-index:1}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-playback-time-second-wrap{height:25px}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-controls-playback-btns{display:flex;align-items:center}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-playback-time-minute-one,.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-playback-time-second-one{float:left;width:1px;height:8px;margin:0;cursor:default;position:relative;z-index:1}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-playback-time-minute-one.active,.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-playback-time-second-one.active{background-color:orange;cursor:pointer}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-playback-time-minute-one.start,.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-playback-time-second-one.start{background-color:#999}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-playback-time-minute-one:hover .jessibuca-playback-time-title-tips,.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-playback-time-second-one:hover .jessibuca-playback-time-title-tips{visibility:visible;opacity:1}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-playback-time-title-tips{pointer-events:none;position:absolute;left:0;top:100%;visibility:hidden;opacity:0;transform:translateX(13%);transition:visibility .3s ease 0s,opacity .3s ease 0s;background-color:#000;border-radius:4px;z-index:1}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-playback-time-title-tips.jessibuca-playback-time-title-tips-left{transform:translateX(-100%)}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-playback-time-title-tips .jessibuca-playback-time-title{display:inline-block;padding:2px 5px;font-size:12px;white-space:nowrap;color:#fff}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-playback-time-hour,.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-playback-time-minute{float:left;position:relative;width:60px;box-sizing:border-box;border-top:1px solid #999;-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:left;height:25px;line-height:25px}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-playback-time-hour:first-child,.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-playback-time-minute:first-child{border-left:0}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-playback-time-hour:first-child .jessibuca-playback-time-hour-text,.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-playback-time-minute:first-child .jessibuca-playback-time-hour-text{left:0}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-playback-time-hour:after,.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-playback-time-minute:after{content:"";position:absolute;left:0;top:-8px;width:1px;height:14px;background-color:#999}.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-playback-time-hour-text,.jessibuca-container-playback .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-center .jessibuca-playback-time-minute-text{position:absolute;left:-13px}.jessibuca-container-playback .jessibuca-playback-expand.disabled .jessibuca-icon-expand,.jessibuca-container-playback .jessibuca-playback-narrow.disabled .jessibuca-icon-narrow{cursor:no-drop}.jessibuca-container-playback .jessibuca-control-progress-simple{position:absolute;box-sizing:border-box;left:0;top:-2px;width:100%;display:flex;flex-direction:row;align-items:center;height:8px;cursor:pointer}.jessibuca-container-playback .jessibuca-control-progress-simple:hover{top:0;align-items:flex-start}.jessibuca-container-playback .jessibuca-control-progress-simple:hover .jessibuca-control-progress-inner{height:100%}.jessibuca-container-playback .jessibuca-control-progress-simple:hover .jessibuca-control-progress-inner .jessibuca-progress-indicator{transform:scale(1);visibility:visible}.jessibuca-container-playback .jessibuca-control-progress-inner{display:flex;align-items:center;position:relative;height:50%;width:100%;transition:all .2s ease;background:hsla(0,0%,100%,.5)}.jessibuca-container-playback .jessibuca-progress-hover{display:none;width:0}.jessibuca-container-playback .jessibuca-progress-played{position:absolute;left:0;top:0;right:0;bottom:0;height:100%;width:0;background-color:orange}.jessibuca-container-playback .jessibuca-progress-indicator{visibility:hidden;align-items:center;justify-content:center;position:absolute;z-index:40;border-radius:50%;transform:scale(.1);transition:transform .1s ease-in-out}.jessibuca-container-playback .jessibuca-progress-indicator .jessibuca-icon{width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.jessibuca-container-playback .jessibuca-progress-indicator:hover{transform:scale(1.2)!important}.jessibuca-container-playback .jessibuca-progress-tip{display:none;position:absolute;z-index:50;top:-25px;left:0;height:20px;padding:0 5px;line-height:20px;color:#fff;font-size:12px;text-align:center;background:rgba(0,0,0,.7);border-radius:3px;font-weight:700;white-space:nowrap}.jessibuca-container-playback.jessibuca-fullscreen-web .jessibuca-controls .jessibuca-controls-bottom .jessibuca-controls-playback-time-inner{overflow-y:auto}.jessibuca-zoom-control{cursor:grab}.jessibuca-performance-panel{position:absolute;box-sizing:border-box;z-index:10000;left:0;top:0;padding:5px;font-size:10px;background:rgba(0,0,0,.2);color:#fff;max-height:100%;overflow-y:auto;display:none}.jessibuca-performance-panel .jessibuca-performance-item{display:flex;align-items:center;margin-top:3px;color:#fff}.jessibuca-performance-panel .jessibuca-performance-item-block{height:10px}');var el=function(){function e(t){var i,r=this;Object(T["a"])(this,e),this.player=t,this.extendBtnList=[],function(e,t){e._opt.hasControl&&e._opt.controlAutoHide?e.$container.classList.add("jessibuca-controls-show-auto-hide"):e.$container.classList.add("jessibuca-controls-show");var i=e._opt,r=i.operateBtns,a='\n <div class="jessibuca-controls-center">\n <div class="jessibuca-controls-playback-time">\n <div class="jessibuca-controls-playback-time-inner">\n <div class="jessibuca-controls-playback-time-scroll">\n <div class="jessibuca-controls-playback-time-list">\n <div class="jessibuca-playback-time-day">\n <div class="jessibuca-playback-time-one-wrap"></div>\n <div class="jessibuca-playback-time-second-wrap"></div>\n </div>\n </div>\n <div class="jessibuca-controls-playback-current-time">\n <div class="jessibuca-controls-playback-current-time-text">00:00:00</div>\n </div>\n </div>\n </div>\n </div>\n '.concat(i.playbackConfig.showPrecisionBtn?'\n <div class="jessibuca-controls-playback-btns">\n <div class="jessibuca-controls-item jessibuca-playback-narrow">'.concat(jc.narrow,'</div>\n <div class="jessibuca-controls-item jessibuca-playback-expand">').concat(jc.expand,"</div>\n </div>\n "):"","\n </div>\n ");e.$container.insertAdjacentHTML("beforeend","\n ".concat(i.background?'<div class="jessibuca-poster" style="background-image: url('.concat(i.background,')"></div>'):"",'\n <div class="jessibuca-loading-bg">\n <img class="jessibuca-loading-bg-image" src="" alt="">\n </div>\n ').concat(i.loadingIcon?'\n <div class="jessibuca-loading">\n '.concat(jc.loading,'\n <div class="jessibuca-loading-text">').concat(i.loadingText,"</div>\n </div>\n "):"","\n ").concat(i.hasControl&&r.play?'<div class="jessibuca-play-big"></div>':"","\n ").concat(i.hasControl&&r.ptz?'\n <div class="jessibuca-ptz-controls">\n <div class="jessibuca-ptz-bg-active"></div>\n <div class="jessibuca-ptz-arrow jessibuca-ptz-arrow-up" data-arrow="up"></div>\n <div class="jessibuca-ptz-arrow jessibuca-ptz-arrow-right" data-arrow="right"></div>\n <div class="jessibuca-ptz-arrow jessibuca-ptz-arrow-down" data-arrow="down"></div>\n <div class="jessibuca-ptz-arrow jessibuca-ptz-arrow-left" data-arrow="left"></div>\n '.concat(i.ptzMoreArrowShow?'\n <div class="jessibuca-ptz-arrow jessibuca-ptz-arrow-left-up" data-arrow="left-up"></div>\n <div class="jessibuca-ptz-arrow jessibuca-ptz-arrow-right-up" data-arrow="right-up"></div>\n <div class="jessibuca-ptz-arrow jessibuca-ptz-arrow-left-down" data-arrow="left-down"></div>\n <div class="jessibuca-ptz-arrow jessibuca-ptz-arrow-right-down" data-arrow="right-down"></div>\n ':"",'\n <div class="jessibuca-ptz-control"></div>\n <div class="jessibuca-ptz-btns">\n ').concat(i.ptzZoomShow?'\n <div class="jessibuca-ptz-btn">\n <div class="jessibuca-ptz-expand jessibuca-ptz-icon">\n <i class="jessibuca-ptz-expand-icon"></i>\n <span class="icon-title-tips">\n <span class="icon-title">缩放+</span>\n </span>\n </div>\n <div class="jessibuca-ptz-narrow jessibuca-ptz-icon">\n <i class="jessibuca-ptz-narrow-icon"></i>\n <span class="icon-title-tips">\n <span class="icon-title">缩放-</span>\n </span>\n </div>\n </div>\n ':"","\n ").concat(i.ptzApertureShow?'\n <div class="jessibuca-ptz-btn">\n <div class="jessibuca-ptz-aperture-far jessibuca-ptz-icon">\n <i class="jessibuca-ptz-aperture-icon"></i>\n <span class="icon-title-tips">\n <span class="icon-title">光圈+</span>\n </span>\n </div>\n <div class="jessibuca-ptz-aperture-near jessibuca-ptz-icon">\n <i class="jessibuca-ptz-aperture-icon"></i>\n <span class="icon-title-tips">\n <span class="icon-title">光圈-</span>\n </span>\n </div>\n </div>\n ':"","\n ").concat(i.ptzFocusShow?'\n <div class="jessibuca-ptz-btn">\n <div class="jessibuca-ptz-focus-far jessibuca-ptz-icon">\n <i class="jessibuca-ptz-focus-icon"></i>\n <span class="icon-title-tips">\n <span class="icon-title">聚焦+</span>\n </span>\n </div>\n <div class="jessibuca-ptz-focus-near jessibuca-ptz-icon">\n <i class="jessibuca-ptz-focus-icon"></i>\n <span class="icon-title-tips">\n <span class="icon-title">聚焦-</span>\n </span>\n </div>\n </div>\n ':"","\n </div>\n </div>\n "):"","\n ").concat(i.hasVideo?'\n <div class="jessibuca-zoom-controls">\n <div class="jessibuca-zoom-narrow">'.concat(jc.narrow,'</div>\n <div class="jessibuca-zoom-tips">电子放大</div>\n <div class="jessibuca-zoom-expand">').concat(jc.expand,'</div>\n <div class="jessibuca-zoom-stop2">').concat(jc.zoomStop,'</div>\n </div>\n <div class="jessibuca-recording">\n <div class="jessibuca-recording-red-point"></div>\n <div class="jessibuca-recording-time">00:00:00</div>\n <div class="jessibuca-recording-stop">').concat(jc.recordStop,"</div>\n </div>\n "):"","\n\n ").concat(i.hasControl?'\n <div class="jessibuca-controls">\n <div class="jessibuca-controls-bottom">\n <div class="jessibuca-controls-left">\n '.concat(i.showBandwidth?'<div class="jessibuca-controls-item jessibuca-speed"></div>':"",'\n <div class="jessibuca-playback-control-time"></div>\n <div class="jessibuca-controls-item-html">').concat(i.controlHtml,"</div>\n </div>\n ").concat(i.playType===A&&i.playbackConfig.showControl&&i.playbackConfig.controlType===$.normal?a:"","\n ").concat(i.playType===A&&i.playbackConfig.showControl&&i.playbackConfig.controlType===$.simple?'\n <div class="jessibuca-control-progress-simple">\n <div class="jessibuca-control-progress-inner">\n <div class="jessibuca-progress-hover"></div>\n <div class="jessibuca-progress-played"></div>\n <div class="jessibuca-progress-indicator"></div>\n <div class="jessibuca-progress-tip">00:00</div>\n </div>\n </div>\n ':"",'\n <div class="jessibuca-controls-right">\n ').concat(i.playType===A&&i.playbackConfig.showRateBtn?'\n <div class="jessibuca-controls-item-wrap">\n <div class="jessibuca-controls-item jessibuca-speed-menu">\n <div class="jessibuca-speed-icon-text"></div>\n <div class="jessibuca-speed-menu-list"></div>\n </div>\n </div>\n ':"","\n ").concat(r.close?'<div class="jessibuca-controls-item-wrap"><div class="jessibuca-controls-item jessibuca-close">'.concat(jc.close,"</div></div>"):"","\n ").concat(r.logSave?'<div class="jessibuca-controls-item-wrap"><div class="jessibuca-controls-item jessibuca-logSave">'.concat(jc.logSave,"</div></div>"):"","\n ").concat(r.performance?'<div class="jessibuca-controls-item-wrap"><div class="jessibuca-controls-item jessibuca-performance">'.concat(jc.performance,'</div><div class="jessibuca-controls-item jessibuca-performance-active">').concat(jc.performanceActive,"</div></div>"):"","\n ").concat(r.aiFace?'<div class="jessibuca-controls-item-wrap"><div class="jessibuca-controls-item jessibuca-face">'.concat(jc.face,'</div><div class="jessibuca-controls-item jessibuca-face-active">').concat(jc.faceActive,"</div></div>"):"","\n ").concat(r.aiObject?'<div class="jessibuca-controls-item-wrap"><div class="jessibuca-controls-item jessibuca-object">'.concat(jc.object,'</div><div class="jessibuca-controls-item jessibuca-object-active">').concat(jc.objectActive,"</div></div>"):"","\n ").concat(r.quality?'\n <div class="jessibuca-controls-item-wrap">\n <div class="jessibuca-controls-item jessibuca-quality-menu">\n <div class="jessibuca-quality-icon-text"></div>\n <div class="jessibuca-quality-menu-list"></div>\n </div>\n </div>\n ':"","\n ").concat(r.scale?'\n <div class="jessibuca-controls-item-wrap">\n <div class="jessibuca-controls-item jessibuca-scale-menu">\n <div class="jessibuca-scale-icon-text"></div>\n <div class="jessibuca-scale-menu-list"></div>\n </div>\n </div>\n ':"","\n ").concat(r.audio?'\n <div class="jessibuca-controls-item-wrap">\n <div class="jessibuca-controls-item jessibuca-volume">\n '.concat(jc.audio,"\n ").concat(jc.mute,'\n <div class="jessibuca-volume-panel-wrap">\n <div class="jessibuca-volume-panel">\n <div class="jessibuca-volume-panel-handle"></div>\n </div>\n <div class="jessibuca-volume-panel-text"></div>\n </div>\n </div>\n </div>\n '):"","\n ").concat(r.play?'<div class="jessibuca-controls-item-wrap"><div class="jessibuca-controls-item jessibuca-play">'.concat(jc.play,'</div><div class="jessibuca-controls-item jessibuca-pause">').concat(jc.pause,"</div></div>"):"","\n ").concat(r.screenshot?'<div class="jessibuca-controls-item-wrap"><div class="jessibuca-controls-item jessibuca-screenshot">'.concat(jc.screenshot,"</div></div>"):"","\n ").concat(r.record?' <div class="jessibuca-controls-item-wrap"><div class="jessibuca-controls-item jessibuca-record">'.concat(jc.record,'</div><div class="jessibuca-controls-item jessibuca-record-stop">').concat(jc.recordStop,"</div></div>"):"","\n ").concat(r.ptz?' <div class="jessibuca-controls-item-wrap"><div class="jessibuca-controls-item jessibuca-ptz">'.concat(jc.ptz,'</div><div class="jessibuca-controls-item jessibuca-ptz-active">').concat(jc.ptzActive,"</div></div>"):"","\n ").concat(r.zoom?' <div class="jessibuca-controls-item-wrap"><div class="jessibuca-controls-item jessibuca-zoom">'.concat(jc.zoom,'</div><div class="jessibuca-controls-item jessibuca-zoom-stop">').concat(jc.zoomStop,"</div></div>"):"","\n ").concat(r.fullscreen?'<div class="jessibuca-controls-item-wrap"><div class="jessibuca-controls-item jessibuca-fullscreen">'.concat(jc.fullscreen,'</div><div class="jessibuca-controls-item jessibuca-fullscreen-exit">').concat(jc.fullscreenExit,"</div></div>"):"","\n </div>\n </div>\n </div>\n "):"",'\n <div class="jessibuca-performance-panel"></div>\n <div class="jessibuca-contextmenus"></div>\n ')),Object.defineProperty(t,"$poster",{value:e.$container.querySelector(".jessibuca-poster")}),Object.defineProperty(t,"$loadingBg",{value:e.$container.querySelector(".jessibuca-loading-bg")}),Object.defineProperty(t,"$loadingBgImage",{value:e.$container.querySelector(".jessibuca-loading-bg-image")}),Object.defineProperty(t,"$loading",{value:e.$container.querySelector(".jessibuca-loading")}),Object.defineProperty(t,"$loadingText",{value:e.$container.querySelector(".jessibuca-loading-text")}),Object.defineProperty(t,"$play",{value:e.$container.querySelector(".jessibuca-play")}),Object.defineProperty(t,"$playBig",{value:e.$container.querySelector(".jessibuca-play-big")}),Object.defineProperty(t,"$recording",{value:e.$container.querySelector(".jessibuca-recording")}),Object.defineProperty(t,"$recordingTime",{value:e.$container.querySelector(".jessibuca-recording-time")}),Object.defineProperty(t,"$recordingStop",{value:e.$container.querySelector(".jessibuca-recording-stop")}),Object.defineProperty(t,"$pause",{value:e.$container.querySelector(".jessibuca-pause")}),Object.defineProperty(t,"$controls",{value:e.$container.querySelector(".jessibuca-controls")}),Object.defineProperty(t,"$controlsInner",{value:e.$container.querySelector(".jessibuca-controls-bottom")}),Object.defineProperty(t,"$controlsLeft",{value:e.$container.querySelector(".jessibuca-controls-left")}),Object.defineProperty(t,"$controlsRight",{value:e.$container.querySelector(".jessibuca-controls-right")}),Object.defineProperty(t,"$volume",{value:e.$container.querySelector(".jessibuca-volume")}),Object.defineProperty(t,"$volumePanelWrap",{value:e.$container.querySelector(".jessibuca-volume-panel-wrap")}),Object.defineProperty(t,"$volumePanelText",{value:e.$container.querySelector(".jessibuca-volume-panel-text")}),Object.defineProperty(t,"$volumePanel",{value:e.$container.querySelector(".jessibuca-volume-panel")}),Object.defineProperty(t,"$volumeHandle",{value:e.$container.querySelector(".jessibuca-volume-panel-handle")}),Object.defineProperty(t,"$volumeOn",{value:e.$container.querySelector(".jessibuca-icon-audio")}),Object.defineProperty(t,"$volumeOff",{value:e.$container.querySelector(".jessibuca-icon-mute")}),Object.defineProperty(t,"$fullscreen",{value:e.$container.querySelector(".jessibuca-fullscreen")}),Object.defineProperty(t,"$fullscreenExit",{value:e.$container.querySelector(".jessibuca-fullscreen-exit")}),Object.defineProperty(t,"$record",{value:e.$container.querySelector(".jessibuca-record")}),Object.defineProperty(t,"$recordStop",{value:e.$container.querySelector(".jessibuca-record-stop")}),Object.defineProperty(t,"$screenshot",{value:e.$container.querySelector(".jessibuca-screenshot")}),Object.defineProperty(t,"$speed",{value:e.$container.querySelector(".jessibuca-speed")}),Object.defineProperty(t,"$controlHtml",{value:e.$container.querySelector(".jessibuca-controls-item-html")}),Object.defineProperty(t,"$playbackTime",{value:e.$container.querySelector(".jessibuca-controls-playback-time")}),Object.defineProperty(t,"$playbackTimeInner",{value:e.$container.querySelector(".jessibuca-controls-playback-time-inner")}),Object.defineProperty(t,"$playbackTimeScroll",{value:e.$container.querySelector(".jessibuca-controls-playback-time-scroll")}),Object.defineProperty(t,"$playbackTimeList",{value:e.$container.querySelector(".jessibuca-controls-playback-time-list")}),Object.defineProperty(t,"$playbackTimeListOne",{value:e.$container.querySelector(".jessibuca-playback-time-one-wrap")}),Object.defineProperty(t,"$playbackTimeListSecond",{value:e.$container.querySelector(".jessibuca-playback-time-second-wrap")}),Object.defineProperty(t,"$playbackCurrentTime",{value:e.$container.querySelector(".jessibuca-controls-playback-current-time")}),Object.defineProperty(t,"$playbackCurrentTimeText",{value:e.$container.querySelector(".jessibuca-controls-playback-current-time-text")}),Object.defineProperty(t,"$controlsPlaybackBtns",{value:e.$container.querySelector(".jessibuca-controls-playback-btns")}),Object.defineProperty(t,"$playbackNarrow",{value:e.$container.querySelector(".jessibuca-playback-narrow")}),Object.defineProperty(t,"$playbackExpand",{value:e.$container.querySelector(".jessibuca-playback-expand")}),Object.defineProperty(t,"$ptz",{value:e.$container.querySelector(".jessibuca-ptz")}),Object.defineProperty(t,"$ptzActive",{value:e.$container.querySelector(".jessibuca-ptz-active")}),Object.defineProperty(t,"$ptzControl",{value:e.$container.querySelector(".jessibuca-ptz-controls")}),Object.defineProperty(t,"$ptzBgActive",{value:e.$container.querySelector(".jessibuca-ptz-bg-active")}),Object.defineProperty(t,"$ptzControlCircular",{value:e.$container.querySelector(".jessibuca-ptz-control")}),Object.defineProperty(t,"$ptzArrows",{value:e.$container.querySelectorAll(".jessibuca-ptz-arrow")}),Object.defineProperty(t,"$ptzExpand",{value:e.$container.querySelector(".jessibuca-ptz-expand")}),Object.defineProperty(t,"$ptzNarrow",{value:e.$container.querySelector(".jessibuca-ptz-narrow")}),Object.defineProperty(t,"$ptzApertureFar",{value:e.$container.querySelector(".jessibuca-ptz-aperture-far")}),Object.defineProperty(t,"$ptzApertureNear",{value:e.$container.querySelector(".jessibuca-ptz-aperture-near")}),Object.defineProperty(t,"$ptzFocusFar",{value:e.$container.querySelector(".jessibuca-ptz-focus-far")}),Object.defineProperty(t,"$ptzFocusNear",{value:e.$container.querySelector(".jessibuca-ptz-focus-near")}),Object.defineProperty(t,"$qualityText",{value:e.$container.querySelector(".jessibuca-quality-icon-text")}),Object.defineProperty(t,"$qualityMenu",{value:e.$container.querySelector(".jessibuca-quality-menu")}),Object.defineProperty(t,"$qualityMenuList",{value:e.$container.querySelector(".jessibuca-quality-menu-list")}),Object.defineProperty(t,"$scaleText",{value:e.$container.querySelector(".jessibuca-scale-icon-text")}),Object.defineProperty(t,"$scaleMenu",{value:e.$container.querySelector(".jessibuca-scale-menu")}),Object.defineProperty(t,"$scaleMenuList",{value:e.$container.querySelector(".jessibuca-scale-menu-list")}),Object.defineProperty(t,"$zoom",{value:e.$container.querySelector(".jessibuca-zoom")}),Object.defineProperty(t,"$zoomStop",{value:e.$container.querySelector(".jessibuca-zoom-stop")}),Object.defineProperty(t,"$zoomNarrow",{value:e.$container.querySelector(".jessibuca-zoom-narrow")}),Object.defineProperty(t,"$zoomExpand",{value:e.$container.querySelector(".jessibuca-zoom-expand")}),Object.defineProperty(t,"$zoomStop2",{value:e.$container.querySelector(".jessibuca-zoom-stop2")}),Object.defineProperty(t,"$close",{value:e.$container.querySelector(".jessibuca-close")}),Object.defineProperty(t,"$zoomControls",{value:e.$container.querySelector(".jessibuca-zoom-controls")}),Object.defineProperty(t,"$performancePanel",{value:e.$container.querySelector(".jessibuca-performance-panel")}),Object.defineProperty(t,"$performance",{value:e.$container.querySelector(".jessibuca-performance")}),Object.defineProperty(t,"$performanceActive",{value:e.$container.querySelector(".jessibuca-performance-active")}),Object.defineProperty(t,"$faceDetect",{value:e.$container.querySelector(".jessibuca-face")}),Object.defineProperty(t,"$faceDetectActive",{value:e.$container.querySelector(".jessibuca-face-active")}),Object.defineProperty(t,"$objectDetect",{value:e.$container.querySelector(".jessibuca-object")}),Object.defineProperty(t,"$objectDetectActive",{value:e.$container.querySelector(".jessibuca-object-active")}),Object.defineProperty(t,"$contextmenus",{value:e.$container.querySelector(".jessibuca-contextmenus")}),Object.defineProperty(t,"$speedText",{value:e.$container.querySelector(".jessibuca-speed-icon-text")}),Object.defineProperty(t,"$speedMenu",{value:e.$container.querySelector(".jessibuca-speed-menu")}),Object.defineProperty(t,"$speedMenuList",{value:e.$container.querySelector(".jessibuca-speed-menu-list")}),Object.defineProperty(t,"$logSave",{value:e.$container.querySelector(".jessibuca-logSave")}),Object.defineProperty(t,"$playbackProgress",{value:e.$container.querySelector(".jessibuca-control-progress-simple")}),Object.defineProperty(t,"$playbackProgressTip",{value:e.$container.querySelector(".jessibuca-progress-tip")}),Object.defineProperty(t,"$playbackProgressHover",{value:e.$container.querySelector(".jessibuca-progress-hover")}),Object.defineProperty(t,"$playbackProgressPlayed",{value:e.$container.querySelector(".jessibuca-progress-played")}),Object.defineProperty(t,"$playbackProgressIndicator",{value:e.$container.querySelector(".jessibuca-progress-indicator")}),Object.defineProperty(t,"$playbackProgressTime",{value:e.$container.querySelector(".jessibuca-playback-control-time")})}(t,this),t._opt.extendOperateBtns.length>0&&t._opt.extendOperateBtns.forEach((function(e){r.addExtendBtn(e)})),i=this,Object.defineProperty(i,"controlsRect",{get:function(){return i.$controls.getBoundingClientRect()}}),Object.defineProperty(i,"controlsInnerRect",{get:function(){return i.$controlsInner.getBoundingClientRect()}}),Object.defineProperty(i,"controlsLeftRect",{get:function(){return i.$controlsLeft.getBoundingClientRect()}}),Object.defineProperty(i,"controlsRightRect",{get:function(){return i.$controlsRight.getBoundingClientRect()}}),Object.defineProperty(i,"controlsPlaybackTimeInner",{get:function(){return i.$playbackTimeInner&&i.$playbackTimeInner.getBoundingClientRect()||{}}}),Object.defineProperty(i,"controlsPlaybackBtnsRect",{get:function(){return i.$controlsPlaybackBtns&&i.$controlsPlaybackBtns.getBoundingClientRect()||{width:0}}}),$c(t,this),function(e,t){var i=e.events.proxy,r=(e.debug,e._opt),a=r.operateBtns;function n(e){var i=t.$volumePanel.getBoundingClientRect(),r=i.bottom,a=i.height,n=t.$volumeHandle.getBoundingClientRect(),s=n.height;return Zr(r-e.y-s/2,0,a-s/2)/(a-s)}if(sa()&&i(window,["click","contextmenu"],(function(i){i.composedPath().indexOf(e.$container)>-1?t.isFocus=!0:t.isFocus=!1})),i(t.$controls,"click",(function(e){e.stopPropagation()})),a.play&&(i(t.$pause,"click",(function(t){r.playType===A&&r.playbackConfig.uiUsePlaybackPause?e.playbackPause=!0:za(a.pauseFn)?a.pauseFn():e.pauseForControl()})),i(t.$play,"click",(function(t){r.playType===A&&e.playbackPause?e.playbackPause=!1:za(a.playFn)?a.playFn():e.playForControl().then((function(){e.resumeAudioAfterPause()}))}))),i(t.$playBig,"click",(function(t){r.playType===A&&e.playbackPause?e.playbackPause=!1:za(a.playFn)?a.playFn():e.playForControl().then((function(){e.resumeAudioAfterPause()}))})),a.screenshot&&i(t.$screenshot,"click",(function(t){t.stopPropagation(),za(a.screenshotFn)?a.screenshotFn():e.video.screenshot()})),a.audio&&(sa()&&(i(t.$volume,"mouseover",(function(){t.$volumePanelWrap.classList.add("jessibuca-volume-panel-wrap-show")})),i(t.$volume,"mouseout",(function(){t.$volumePanelWrap.classList.remove("jessibuca-volume-panel-wrap-show")})),i(t.$volumePanel,"click",(function(t){t.stopPropagation(),e.volume=n(t)})),i(t.$volumeHandle,"mousedown",(function(){t.isVolumeDroging=!0})),i(t.$volumeHandle,"mousemove",(function(i){t.isVolumeDroging&&(e.volume=n(i))})),i(document,"mouseup",(function(){t.isVolumeDroging&&(t.isVolumeDroging=!1)}))),i(t.$volumeOn,"click",(function(i){i.stopPropagation(),ea(t.$volumeOn,"display","none"),ea(t.$volumeOff,"display","block");var r=e.volume;e.volume=0,e._lastVolume=sa()?r:1})),i(t.$volumeOff,"click",(function(i){i.stopPropagation(),ea(t.$volumeOn,"display","block"),ea(t.$volumeOff,"display","none"),e.volume=sa()?e.lastVolume||.5:1}))),a.record&&(i(t.$record,"click",(function(t){t.stopPropagation(),za(a.recordFn)?a.recordFn():e.recording=!0})),i(t.$recordStop,"click",(function(t){t.stopPropagation(),za(a.recordStopFn)?a.recordStopFn():e.recording=!1}))),i(t.$recordingStop,"click",(function(t){t.stopPropagation(),za(a.recordStopFn)?a.recordStopFn():e.recording=!1})),a.fullscreen&&(i(t.$fullscreen,"click",(function(t){t.stopPropagation(),za(a.fullscreenFn)?a.fullscreenFn():e.fullscreen=!0})),i(t.$fullscreenExit,"click",(function(t){t.stopPropagation(),za(a.fullscreenExitFn)?a.fullscreenExitFn():e.fullscreen=!1}))),a.ptz){if(i(t.$ptz,"click",(function(e){e.stopPropagation(),ea(t.$ptzActive,"display","flex"),ea(t.$ptz,"display","none"),t.$ptzControl.classList.add("jessibuca-ptz-controls-show")})),i(t.$ptzActive,"click",(function(e){e.stopPropagation(),ea(t.$ptz,"display","flex"),ea(t.$ptzActive,"display","none"),t.$ptzControl.classList.remove("jessibuca-ptz-controls-show")})),t.$ptzArrows.forEach((function(a){if(r.ptzClickType===Q)i(a,"click",(function(i){i.stopPropagation();var a=i.currentTarget.dataset.arrow;t.$ptzBgActive.classList.add("jessibuca-ptz-bg-active-show"),t.$ptzBgActive.classList.add("jessibuca-ptz-bg-active-".concat(a)),t.$ptzControlCircular.classList.add("jessibuca-ptz-control-".concat(a)),e.emit(it.ptz,nn(a)),setTimeout((function(){t.$ptzBgActive.classList.remove("jessibuca-ptz-bg-active-show"),li.forEach((function(e){t.$ptzBgActive.classList.remove("jessibuca-ptz-bg-active-".concat(e)),t.$ptzControlCircular.classList.remove("jessibuca-ptz-control-".concat(e))})),e.emit(it.ptz,ui)}),1e3*r.ptzStopEmitDelay)}));else if(r.ptzClickType===X){var n=!1;i(a,"mousedown",(function(i){i.stopPropagation(),n=!0;var r=i.currentTarget.dataset.arrow;t.$ptzBgActive.classList.add("jessibuca-ptz-bg-active-show"),t.$ptzBgActive.classList.add("jessibuca-ptz-bg-active-".concat(r)),t.$ptzControlCircular.classList.add("jessibuca-ptz-control-".concat(r)),e.emit(it.ptz,nn(r))}));var s=function(){n=!1,t.$ptzBgActive.classList.remove("jessibuca-ptz-bg-active-show"),li.forEach((function(e){t.$ptzBgActive.classList.remove("jessibuca-ptz-bg-active-".concat(e)),t.$ptzControlCircular.classList.remove("jessibuca-ptz-control-".concat(e))})),e.emit(it.ptz,ui)};i(a,"mouseup",(function(e){e.stopPropagation(),n&&s()})),i(window,"mouseup",(function(e){e.stopPropagation(),n&&s()}))}})),r.ptzZoomShow)if(r.ptzClickType===Q)i(t.$ptzExpand,"click",(function(t){t.stopPropagation(),e.emit(it.ptz,hi),setTimeout((function(){e.emit(it.ptz,ui)}),1e3*r.ptzStopEmitDelay)})),i(t.$ptzNarrow,"click",(function(t){t.stopPropagation(),e.emit(it.ptz,fi),setTimeout((function(){e.emit(it.ptz,ui)}),1e3*r.ptzStopEmitDelay)}));else if(r.ptzClickType===X){var s=!1,o=!1;i(t.$ptzExpand,"mousedown",(function(t){t.stopPropagation(),s=!0,e.emit(it.ptz,hi)})),i(t.$ptzNarrow,"mousedown",(function(t){t.stopPropagation(),o=!0,e.emit(it.ptz,fi)}));var c=function(){s=!1,o=!1,e.emit(it.ptz,ui)};i(t.$ptzExpand,"mouseup",(function(e){e.stopPropagation(),s&&c()})),i(t.$ptzNarrow,"mouseup",(function(e){e.stopPropagation(),o&&c()})),i(window,"mouseup",(function(e){e.stopPropagation(),(s||o)&&c()}))}if(r.ptzApertureShow)if(r.ptzClickType===Q)i(t.$ptzApertureFar,"click",(function(t){t.stopPropagation(),e.emit(it.ptz,pi),setTimeout((function(){e.emit(it.ptz,di)}),1e3*r.ptzStopEmitDelay)})),i(t.$ptzApertureNear,"click",(function(t){t.stopPropagation(),e.emit(it.ptz,mi),setTimeout((function(){e.emit(it.ptz,di)}),1e3*r.ptzStopEmitDelay)}));else if(r.ptzClickType===X){var l=!1,u=!1;i(t.$ptzApertureFar,"mousedown",(function(t){t.stopPropagation(),l=!0,e.emit(it.ptz,pi)})),i(t.$ptzApertureNear,"mousedown",(function(t){t.stopPropagation(),u=!0,e.emit(it.ptz,mi)}));var d=function(){l=!1,u=!1,e.emit(it.ptz,di)};i(t.$ptzApertureFar,"mouseup",(function(e){e.stopPropagation(),l&&d()})),i(t.$ptzApertureNear,"mouseup",(function(e){e.stopPropagation(),u&&d()})),i(window,"mouseup",(function(e){e.stopPropagation(),(l||u)&&d()}))}if(r.ptzFocusShow)if(r.ptzClickType===Q)i(t.$ptzFocusFar,"click",(function(t){t.stopPropagation(),e.emit(it.ptz,gi),setTimeout((function(){e.emit(it.ptz,di)}),1e3*r.ptzStopEmitDelay)})),i(t.$ptzFocusNear,"click",(function(t){t.stopPropagation(),e.emit(it.ptz,yi),setTimeout((function(){e.emit(it.ptz,di)}),1e3*r.ptzStopEmitDelay)}));else if(r.ptzClickType===X){var h=!1,f=!1;i(t.$ptzFocusFar,"mousedown",(function(t){t.stopPropagation(),h=!0,e.emit(it.ptz,gi)})),i(t.$ptzFocusNear,"mousedown",(function(t){t.stopPropagation(),f=!0,e.emit(it.ptz,yi)}));var p=function(){h=!1,f=!1,e.emit(it.ptz,di)};i(t.$ptzFocusFar,"mouseup",(function(e){e.stopPropagation(),h&&p()})),i(t.$ptzFocusNear,"mouseup",(function(e){e.stopPropagation(),f&&p()})),i(window,"mouseup",(function(e){e.stopPropagation(),(h||f)&&p()}))}}if(a.performance&&(i(t.$performance,"click",(function(t){t.stopPropagation(),e.togglePerformancePanel(!0)})),i(t.$performanceActive,"click",(function(t){t.stopPropagation(),e.togglePerformancePanel(!1)}))),a.logSave&&i(t.$logSave,"click",(function(t){t.stopPropagation(),e.downloadMemoryLog()})),a.aiFace&&(i(t.$faceDetect,"click",(function(t){t.stopPropagation(),e.faceDetect(!0)})),i(t.$faceDetectActive,"click",(function(t){t.stopPropagation(),e.faceDetect(!1)}))),a.aiObject&&(i(t.$objectDetect,"click",(function(t){t.stopPropagation(),e.objectDetect(!0)})),i(t.$objectDetectActive,"click",(function(t){t.stopPropagation(),e.objectDetect(!1)}))),e._opt.hasControl&&e._opt.controlAutoHide){i(e.$container,"mouseover",(function(){e.fullscreen||(ea(t.$controls,"display","block"),g())})),i(e.$container,"mousemove",(function(){e.$container&&t.$controls&&(e.fullscreen,"none"===t.$controls.style.display&&(ea(t.$controls,"display","block"),g()))})),i(e.$container,"mouseout",(function(){y(),ea(t.$controls,"display","none")}));var m=null,g=function(){y(),m=setTimeout((function(){ea(t.$controls,"display","none")}),5e3)},y=function(){m&&(clearTimeout(m),m=null)}}if(e._opt.playType===A){var v=e._opt.playbackConfig.controlType;e._opt.playbackConfig.showRateBtn&&(i(t.$speedMenu,"mouseover",(function(){t.$speedMenuList.classList.add("jessibuca-speed-menu-shown")})),i(t.$speedMenu,"mouseout",(function(){t.$speedMenuList.classList.remove("jessibuca-speed-menu-shown")})),i(t.$speedMenuList,"click",(function(t){var i=ja(t);if(i.matches("div.jessibuca-speed-menu-item")){var r=i.dataset;e.emit(it.playbackPreRateChange,r.speed)}}))),v===$.normal?(i(t.$playbackNarrow,"click",(function(t){t.stopPropagation(),e.playback&&e.playback.narrowPrecision()})),i(t.$playbackExpand,"click",(function(t){t.stopPropagation(),e.playback&&e.playback.expandPrecision()})),i(t.$playbackTimeList,"click",(function(t){var i=ja(t);i.matches("div.jessibuca-playback-time-minute-one")&&e.playback&&e.playback.seek(i.dataset)})),e._opt.playbackConfig.supportWheel&&i(t.$playbackTimeInner,"wheel",(function(t){t.preventDefault(),(t.wheelDelta?t.wheelDelta/120:-(t.detail||0)/3)>0?e.playback&&e.playback.expandPrecision():e.playback&&e.playback.narrowPrecision()}))):v===$.simple&&(t.isDroging=!1,i(t.$playbackProgress,"click",(function(i){if(i.target!==t.$playbackProgressIndicator){var r=0,a=0;if(e.isInWebFullscreen())r=i.touches[0].clientY/e.height,a=r*e.playback.totalDuration;else{var n=Kc(t,e.playback.totalDuration,i);r=n.percentage,a=n.second}e.playback&&e.playback.seek({time:a})}})),i(t.$playbackProgress,"mousemove",(function(i){ea(t.$playbackProgressTip,"display","block");var r=Kc(t,e.playback.totalDuration,i),a=r.width,n=r.time;t.$playbackProgressTip.innerHTML=n;var s=t.$playbackProgressTip.clientWidth;a<=s/2?ea(t.$playbackProgressTip,"left",0):a>t.$playbackProgress.clientWidth-s/2?ea(t.$playbackProgressTip,"left",t.$playbackProgress-s+"px"):ea(t.$playbackProgressTip,"left",a-s/2+"px")})),i(t.$playbackProgress,"mouseout",(function(){ea(t.$playbackProgressTip,"display","none")})),i(t.$playbackProgressIndicator,"mousedown",(function(e){t.isDroging=!0})),i(t.$playbackProgress,"mousemove",(function(i){if(t.isDroging){var r=Kc(t,e.playback.totalDuration,i),a=r.second;r.percentage;e.playback&&e.playback.seek({time:a})}})),i(t.$playbackProgress,"mouseup",(function(e){t.isDroging&&(t.isDroging=!1)})))}a.quality&&(i(t.$qualityMenu,"mouseover",(function(){t.$qualityMenuList.classList.add("jessibuca-quality-menu-shown")})),i(t.$qualityMenu,"mouseout",(function(){t.$qualityMenuList.classList.remove("jessibuca-quality-menu-shown")})),i(t.$qualityMenuList,"click",(function(t){var i=ja(t);if(i.matches("div.jessibuca-quality-menu-item")){var r=i.dataset;e.streamQuality=r.quality}}))),a.scale&&(i(t.$scaleMenu,"mouseover",(function(){t.$scaleMenuList.classList.add("jessibuca-scale-menu-shown")})),i(t.$scaleMenu,"mouseout",(function(){t.$scaleMenuList.classList.remove("jessibuca-scale-menu-shown")})),i(t.$scaleMenuList,"click",(function(t){var i=ja(t);if(i.matches("div.jessibuca-scale-menu-item")){var r=i.dataset;e.setScaleMode(r.scale)}}))),a.zoom&&(i(t.$zoom,"click",(function(t){t.stopPropagation(),e.zooming=!0})),i(t.$zoomStop,"click",(function(t){t.stopPropagation(),e.zooming=!1}))),i(t.$zoomExpand,"click",(function(t){t.stopPropagation(),e.zoom&&e.zoom.expandPrecision()})),i(t.$zoomNarrow,"click",(function(t){t.stopPropagation(),e.zoom&&e.zoom.narrowPrecision()})),i(t.$zoomStop2,"click",(function(t){t.stopPropagation(),e.zooming=!1})),a.close&&i(t.$close,"click",(function(t){t.stopPropagation(),e.doDestroy()}))}(t,this),t._opt.hotKey&&function(e,t){var i=e.events.proxy,r={};function a(e,t){r[e]?r[e].push(t):r[e]=[t]}a(ei,(function(){e.fullscreen&&(e.fullscreen=!1)})),a(ti,(function(){e.volume+=.05})),a(ii,(function(){e.volume-=.05})),i(window,"keydown",(function(e){if(t.isFocus){var i=document.activeElement.tagName.toUpperCase(),a=document.activeElement.getAttribute("contenteditable");if("INPUT"!==i&&"TEXTAREA"!==i&&""!==a&&"true"!==a){var n=r[e.keyCode];n&&(e.preventDefault(),n.forEach((function(e){return e()})))}}}))}(t,this),this.btnIndex=0,this.initLoadingBackground(),Ba(t._opt.loadingIconStyle)&&this.initLoadingIconStyle(t._opt.loadingIconStyle),this.kbpsShow="0 KB/s",this.player.debug.log("Control","init")}return Object(S["a"])(e,[{key:"destroy",value:function(){if(this.$performancePanel&&(this.$performancePanel.innerHTML="",!Xc(this.$performancePanel))){var e=this.player.$container.querySelector(".jessibuca-performance-panel");e&&this.player.$container&&this.player.$container.removeChild(e)}if(this.$poster&&!Xc(this.$poster)){var t=this.player.$container.querySelector(".jessibuca-poster");t&&this.player.$container&&this.player.$container.removeChild(t)}if(this.$loading&&!Xc(this.$loading)){var i=this.player.$container.querySelector(".jessibuca-loading");i&&this.player.$container&&this.player.$container.removeChild(i)}if(this.$loadingBg&&!Xc(this.$loadingBg)){var r=this.player.$container.querySelector(".jessibuca-loading-bg");r&&this.player.$container&&this.player.$container.removeChild(r)}if(this.$controls&&!Xc(this.$controls)){var a=this.player.$container.querySelector(".jessibuca-controls");a&&this.player.$container&&this.player.$container.removeChild(a)}if(this.$playBig&&!Xc(this.$playBig)){var n=this.player.$container.querySelector(".jessibuca-play-big");n&&this.player.$container&&this.player.$container.removeChild(n)}if(this.$recording&&!Xc(this.$recording)){var s=this.player.$container.querySelector(".jessibuca-recording");s&&this.player.$container&&this.player.$container.removeChild(s)}if(this.$ptzControl&&!Xc(this.$ptzControl)){var o=this.player.$container.querySelector(".jessibuca-ptz-controls");o&&this.player.$container&&this.player.$container.removeChild(o)}if(this.$zoomControls&&!Xc(this.$zoomControls)){var c=this.player.$container.querySelector(".jessibuca-zoom-controls");c&&this.player.$container&&this.player.$container.removeChild(c)}if(this.$contextmenus&&(this.$contextmenus.innerHTML="",!Xc(this.$contextmenus))){var l=this.player.$container.querySelector(".jessibuca-contextmenus");l&&this.player.$container&&this.player.$container.removeChild(l)}this.btnIndex=0,this.extendBtnList=[],this.kbpsShow="0 KB/s",this.player.$container&&(this.player.$container.classList.remove("jessibuca-controls-show-auto-hide"),this.player.$container.classList.remove("jessibuca-controls-show")),this.player.debug.log("Control","destroy")}},{key:"getBtnIndex",value:function(){return this.btnIndex++}},{key:"autoSize",value:function(){var e=this.player;e.$container.style.padding="0 0";var t=e.width,i=e.height,r=t/i,a=e.video.$videoElement.width/e.video.$videoElement.height;if(r>a){var n=(t-i*a)/2;e.$container.style.padding="0 ".concat(n,"px")}else{var s=(i-t/a)/2;e.$container.style.padding="".concat(s,"px 0")}}},{key:"initLoadingBackground",value:function(){var e=this.player;e._opt.loadingBackground&&e._opt.loadingBackgroundWidth&&e._opt.loadingBackgroundHeight&&(e.debug.log("Control","initLoadingBackground()"),"default"===this.player._opt.aspectRatio||na()?(e.getRenderType()===q||e.getRenderType()===K)&&this._initLoadingBackground():this._initLoadingBackgroundForRatio(),Yc(this.$loadingBg,"display","block"),e._opt.loadingBackground="",e._opt.loadingBackgroundWidth=0,e._opt.loadingBackgroundHeight=0)}},{key:"initLoadingIconStyle",value:function(e){var t=this.player.$container.querySelector(".jessibuca-icon-loading");t&&(e.width&&Yc(t,"width","".concat(e.width,"px")),e.height&&Yc(t,"height","".concat(e.height,"px")),e.background&&Yc(t,"backgroundImage",'url("'.concat(e.background,'")')),!1===e.hasAnimation&&(Yc(t,"animationName","none"),Yc(t,"animationDuration",0),Yc(t,"animationTimingFunction","ease"),Yc(t,"animationIterationCount",1)))}},{key:"_initLoadingBackgroundForRatio",value:function(){var e=this.player._opt.aspectRatio.split(":").map(Number),t=this.player.width,i=this.player.height,r=this.player._opt,a=0;r.hasControl&&!r.controlAutoHide&&(a=r.playType===A?Bt:Ot,i-=a);var n=this.player._opt.loadingBackgroundWidth,s=this.player._opt.loadingBackgroundHeight,o=n/s,c=e[0]/e[1];if(this.$loadingBgImage.src=this.player._opt.loadingBackground,o>c){var l=c*s/n;this.$loadingBgImage.style.width=100*l+"%",this.$loadingBgImage.style.height="calc(100% - ".concat(a,"px)"),this.$loadingBgImage.style.padding="0 ".concat((t-t*l)/2,"px")}else{var u=n/c/s;this.$loadingBgImage.style.width="100%",this.$loadingBgImage.style.height="calc(".concat(100*u,"% - ").concat(a,"px)"),this.$loadingBgImage.style.padding=(i-i*u)/2+"px 0"}}},{key:"_initLoadingBackgroundForCanvas",value:function(){var e=this.player._opt,t=this.player.width,i=this.player.height;if(e.hasControl&&!e.controlAutoHide){var r=e.playType===A?Bt:Ot;na()&&this.player.fullscreen&&e.useWebFullScreen?t-=r:i-=r}var a={width:this.player._opt.loadingBackgroundWidth,height:this.player._opt.loadingBackgroundHeight},n=a.width,s=a.height,o=e.rotate,c=(t-n)/2,l=(i-s)/2;270!==o&&90!==o||(n=a.height,s=a.width);var u=t/n,d=i/s,h=u>d?d:u;e.isResize||u!==d&&(h=u+","+d),e.isFullResize&&(h=u>d?u:d);var f="scale("+h+")";"none"===e.mirrorRotate&&o&&(f+=" rotate("+o+"deg)"),"level"===e.mirrorRotate?f+=" rotateY(180deg)":"vertical"===e.mirrorRotate&&(f+=" rotateX(180deg)"),this.$loadingBgImage.src=this.player._opt.loadingBackground,this.$loadingBgImage.style.height=a.height+"px",this.$loadingBgImage.style.width=a.width+"px",this.$loadingBgImage.style.padding="0",this.$loadingBgImage.style.transform=f,this.$loadingBgImage.style.left=c+"px",this.$loadingBgImage.style.top=l+"px",this.$loadingBgImage.style.display="block"}},{key:"_initLoadingBackground",value:function(){var e=this.player,t=e.height,i=e._opt;i.hasControl&&!i.controlAutoHide&&(t-=i.playType===A?Bt:Ot);var r=e.width,a=t,n=i.rotate;270!==n&&90!==n||(r=t,a=e.width),this.$loadingBgImage.width=r,this.$loadingBgImage.height=a,this.$loadingBgImage.src=e._opt.loadingBackground;var s=(e.width-r)/2,o=(t-a)/2,c="contain";i.isResize||(c="fill"),i.isFullResize&&(c="none");var l="";"none"===i.mirrorRotate&&n&&(l+=" rotate("+n+"deg)"),"level"===i.mirrorRotate?l+=" rotateY(180deg)":"vertical"===i.mirrorRotate&&(l+=" rotateX(180deg)"),this.player._opt.videoRenderSupportScale&&(this.$loadingBgImage.style.objectFit=c),this.$loadingBgImage.style.transform=l,this.$loadingBgImage.style.padding="0",this.$loadingBgImage.style.left=s+"px",this.$loadingBgImage.style.top=o+"px"}},{key:"_validateExtendBtn",value:function(e){var t=!0;return e.name||(this.player.debug.warn("Control","extend button name is required"),t=!1),t&&-1!==this.extendBtnList.findIndex((function(t){return t.name===e.name}))&&(this.player.debug.warn("Control","extend button name: ".concat(e.name," is already exist")),t=!1),t&&(e.icon||(this.player.debug.warn("Control","extend button icon is required"),t=!1)),t}},{key:"addExtendBtn",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=$a(sr);if(t=Object.assign({},i,t),this._validateExtendBtn(t)){var r=t.name||"",a=this.$controlsRight,n=t.activeIcon&&t.activeClick,s='\n <div class="jessibuca-controls-item-wrap jessibuca-controls-item-wrap-'.concat(r,'">\n ').concat(t.icon?'<div class="jessibuca-controls-item jessibuca-control-extend-'.concat(r,'">\n <i class="jessibuca-icon jessibuca-icon-extend-').concat(r,'"></i>\n ').concat(t.iconTitle?'\n <span class="icon-title-tips"><span class="icon-title">'.concat(t.iconTitle,"</span></span>\n "):"","\n </div>"):"","\n ").concat(t.activeIcon?'<div class="jessibuca-controls-item jessibuca-control-extend-'.concat(r,'-active">\n <i class="jessibuca-icon jessibuca-icon-extend-').concat(r,'-active"></i>\n ').concat(t.activeIconTitle?'\n <span class="icon-title-tips"><span class="icon-title">'.concat(t.activeIconTitle,"</span></span>\n "):"","\n </div>"):"","\n </div>\n "),o=Array.from(a.children)[t.index];o?o.insertAdjacentHTML("beforebegin",s):Jc(a,s);var c=a.querySelector(".jessibuca-controls-item-wrap-".concat(r)),l=t.icon?a.querySelector(".jessibuca-icon-extend-".concat(r)):null,u=t.icon?a.querySelector(".jessibuca-control-extend-".concat(r)):null,d=t.activeIcon?a.querySelector(".jessibuca-icon-extend-".concat(r,"-active")):null,h=t.activeIcon?a.querySelector(".jessibuca-control-extend-".concat(r,"-active")):null,f=this.player,p=f.events.proxy;f.debug;t.icon&&(Yc(l,"background","url(".concat(t.icon,") no-repeat center")),Yc(l,"background-size","100% 100%"),Yc(u,"display","none"),t.iconHover&&(p(l,"mouseover",(function(){Yc(l,"background","url(".concat(t.iconHover,") no-repeat center")),Yc(l,"background-size","100% 100%")})),p(l,"mouseout",(function(){Yc(l,"background","url(".concat(t.icon,") no-repeat center")),Yc(l,"background-size","100% 100%")})))),t.activeIcon&&(Yc(d,"background","url(".concat(t.activeIcon,") no-repeat center")),Yc(d,"background-size","100% 100%"),Yc(h,"display","none"),t.activeIconHover&&(p(d,"mouseover",(function(){Yc(d,"background","url(".concat(t.activeIconHover,") no-repeat center")),Yc(d,"background-size","100% 100%")})),p(d,"mouseout",(function(){Yc(d,"background","url(".concat(t.activeIcon,") no-repeat center")),Yc(d,"background-size","100% 100%")})))),t.click&&l&&p(l,"click",(function(i){i.preventDefault(),n&&(Yc(u,"display","none"),Yc(h,"display","flex")),e.player.isInMulti()?t.click.call(e.player,i,e.player._opt.multiIndex):t.click.call(e.player,i)})),t.activeClick&&d&&p(d,"click",(function(i){i.preventDefault(),Yc(u,"display","flex"),Yc(h,"display","none"),e.player.isInMulti()?t.activeClick.call(e.player,i,e.player._opt.multiIndex):t.activeClick.call(e.player,i)})),this.extendBtnList.push({name:r,$iconContainer:c,$iconWrap:u,$activeIconWrap:h})}}},{key:"updateLoadingText",value:function(e){this.$loadingText&&(this.$loadingText.innerText=e)}},{key:"getExtendBtnList",value:function(){return this.extendBtnList}}]),e}();Zc(".jessibuca-container{position:relative;width:100%;height:100%;overflow:hidden}.jessibuca-container.jessibuca-fullscreen-web{position:fixed;z-index:9999;left:0;top:0;right:0;bottom:0;width:100vw!important;height:100vh!important;background:#000}");var tl=function(){function e(){Object(T["a"])(this,e)}return Object(S["a"])(e,null,[{key:"init",value:function(){for(var t in e.types={avc1:[],avcC:[],hvc1:[],hvcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],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 i=e.constants={};i.FTYP=new Uint8Array([105,115,111,109,0,0,0,1,105,115,111,109,97,118,99,49]),i.STSD_PREFIX=new Uint8Array([0,0,0,0,0,0,0,1]),i.STTS=new Uint8Array([0,0,0,0,0,0,0,0]),i.STSC=i.STCO=i.STTS,i.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),i.HDLR_VIDEO=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),i.HDLR_AUDIO=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),i.DREF=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),i.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),i.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}},{key:"box",value:function(e){for(var t=8,i=null,r=Array.prototype.slice.call(arguments,1),a=r.length,n=0;n<a;n++)t+=r[n].byteLength;i=new Uint8Array(t),i[0]=t>>>24&255,i[1]=t>>>16&255,i[2]=t>>>8&255,i[3]=255&t,i.set(e,4);for(var s=8,o=0;o<a;o++)i.set(r[o],s),s+=r[o].byteLength;return i}},{key:"generateInitSegment",value:function(t){var i=e.box(e.types.ftyp,e.constants.FTYP),r=e.moov(t),a=new Uint8Array(i.byteLength+r.byteLength);return a.set(i,0),a.set(r,i.byteLength),a}},{key:"moov",value:function(t){var i=e.mvhd(t.timescale,t.duration),r=e.trak(t),a=e.mvex(t);return e.box(e.types.moov,i,r,a)}},{key:"mvhd",value:function(t,i){return e.box(e.types.mvhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]))}},{key:"trak",value:function(t){return e.box(e.types.trak,e.tkhd(t),e.mdia(t))}},{key:"tkhd",value:function(t){var i=t.id,r=t.duration,a=t.presentWidth,n=t.presentHeight;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r,0,0,0,0,0,0,0,0,0,0,0,0,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,n>>>8&255,255&n,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t),e.hdlr(t),e.minf(t))}},{key:"mdhd",value:function(t){var i=t.timescale,r=t.duration;return e.box(e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,r>>>24&255,r>>>16&255,r>>>8&255,255&r,85,196,0,0]))}},{key:"hdlr",value:function(t){var i=null;return i="audio"===t.type?e.constants.HDLR_AUDIO:e.constants.HDLR_VIDEO,e.box(e.types.hdlr,i)}},{key:"minf",value:function(t){var i=null;return i="audio"===t.type?e.box(e.types.smhd,e.constants.SMHD):e.box(e.types.vmhd,e.constants.VMHD),e.box(e.types.minf,i,e.dinf(),e.stbl(t))}},{key:"dinf",value:function(){return e.box(e.types.dinf,e.box(e.types.dref,e.constants.DREF))}},{key:"stbl",value:function(t){return e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.constants.STTS),e.box(e.types.stsc,e.constants.STSC),e.box(e.types.stsz,e.constants.STSZ),e.box(e.types.stco,e.constants.STCO))}},{key:"stsd",value:function(t){return"audio"===t.type?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.mp4a(t)):"avc"===t.videoType?e.box(e.types.stsd,e.constants.STSD_PREFIX,e.avc1(t)):e.box(e.types.stsd,e.constants.STSD_PREFIX,e.hvc1(t))}},{key:"mp4a",value:function(t){var i=t.channelCount,r=t.audioSampleRate,a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,i,0,16,0,0,0,0,r>>>8&255,255&r,0,0]);return e.box(e.types.mp4a,a,e.esds(t))}},{key:"esds",value:function(t){var i=t.config||[],r=i.length,a=new Uint8Array([0,0,0,0,3,23+r,0,1,0,4,15+r,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([r]).concat(i).concat([6,1,2]));return e.box(e.types.esds,a)}},{key:"avc1",value:function(t){var i=t.avcc,r=t.codecWidth,a=t.codecHeight,n=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,r>>>8&255,255&r,a>>>8&255,255&a,0,72,0,0,0,72,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.avc1,n,e.box(e.types.avcC,i))}},{key:"hvc1",value:function(t){var i=t.avcc,r=t.codecWidth,a=t.codecHeight,n=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,r>>>8&255,255&r,a>>>8&255,255&a,0,72,0,0,0,72,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,255,255]);return e.box(e.types.hvc1,n,e.box(e.types.hvcC,i))}},{key:"mvex",value:function(t){return e.box(e.types.mvex,e.trex(t))}},{key:"trex",value:function(t){var i=t.id,r=new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return e.box(e.types.trex,r)}},{key:"moof",value:function(t,i){return e.box(e.types.moof,e.mfhd(t.sequenceNumber),e.traf(t,i))}},{key:"mfhd",value:function(t){var i=new Uint8Array([0,0,0,0,t>>>24&255,t>>>16&255,t>>>8&255,255&t]);return e.box(e.types.mfhd,i)}},{key:"traf",value:function(t,i){var r=t.id,a=e.box(e.types.tfhd,new Uint8Array([0,0,0,0,r>>>24&255,r>>>16&255,r>>>8&255,255&r])),n=e.box(e.types.tfdt,new Uint8Array([0,0,0,0,i>>>24&255,i>>>16&255,i>>>8&255,255&i])),s=e.sdtp(t),o=e.trun(t,s.byteLength+16+16+8+16+8+8);return e.box(e.types.traf,a,n,o,s)}},{key:"sdtp",value:function(t){var i=new Uint8Array(5),r=t.flags;return i[4]=r.isLeading<<6|r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy,e.box(e.types.sdtp,i)}},{key:"trun",value:function(t,i){var r=new Uint8Array(28);i+=36,r.set([0,0,15,1,0,0,0,1,i>>>24&255,i>>>16&255,i>>>8&255,255&i],0);var a=t.duration,n=t.size,s=t.flags,o=t.cts;return r.set([a>>>24&255,a>>>16&255,a>>>8&255,255&a,n>>>24&255,n>>>16&255,n>>>8&255,255&n,s.isLeading<<2|s.dependsOn,s.isDependedOn<<6|s.hasRedundancy<<4|s.isNonSync,0,0,o>>>24&255,o>>>16&255,o>>>8&255,255&o],12),e.box(e.types.trun,r)}},{key:"mdat",value:function(t){return e.box(e.types.mdat,t)}}]),e}();tl.init();var il=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this),r.TAG_NAME="MediaSourceCommon",r.player=e,r.isAvc=!0,r.mediaSource=new window.MediaSource,r.sourceBuffer=null,r.hasInit=!1,r.isInitInfo=!1,r.cacheTrack={},r.timeInit=!1,r.sequenceNumber=0,r.dropping=!1,r.firstRenderTime=null,r.$videoElement=null,r.mediaSourceAppendBufferFull=!1,r.mediaSourceAppendBufferError=!1,r.mediaSourceAddSourceBufferError=!1,r.mediaSourceBufferError=!1,r.mediaSourceError=!1,r.isDecodeFirstIIframe=!!an(e._opt.checkFirstIFrame),r.prevTimestamp=null,r.decodeDiffTimestamp=null,r.prevDts=null,r.prevPayloadBufferSize=0,r.isWidthOrHeightChanged=!1,r.prevTs=null,r.mediaSourceObjectURL=window.URL.createObjectURL(r.mediaSource),r.eventListenList=[],r.tempFmp4List=[],r.pendingRemoveRanges=[],r.pendingSegments=[],r.isSupportVideoFrameCallback=un(),r.supportVideoFrameCallbackHandle=null,e._opt.mseUseCanvasRender?(r.$videoElement=document.createElement("video"),r.$videoElement.src=r.mediaSourceObjectURL,r.initVideoEvents()):(r.player.video.$videoElement.src=r.mediaSourceObjectURL,r.$videoElement=r.player.video.$videoElement),r._bindMediaSourceEvents(),r.player.isPlayback()&&r.player.on(it.playbackPause,(function(t){an(t)?(rn(e._opt.checkFirstIFrame)&&(r.player.debug.log(r.TAG_NAME,"playbackPause is false and _opt.checkFirstIFrame is true so set isDecodeFirstIIframe = false"),r.isDecodeFirstIIframe=!1),r.clearUpAllSourceBuffer(),r.$videoElement.play()):(r.$videoElement.pause(),r.cacheTrack={})})),r.player.on(it.visibilityChange,(function(e){e&&setTimeout((function(){if(r.player.isPlaying()&&r.$videoElement){var e=r.getVideoBufferLastTime();e>r.$videoElement.currentTime&&(r.player.debug.log(r.TAG_NAME,"visibilityChange is true and lastTime is ".concat(e," and currentTime is ").concat(r.$videoElement.currentTime," so set currentTime to lastTime")),r.$videoElement.currentTime=e)}}),300)})),r}return Object(S["a"])(i,[{key:"destroy",value:function(){this.stop(),this.eventListenList.length&&(this.eventListenList.forEach((function(e){return e()})),this.eventListenList=[]),this.supportVideoFrameCallbackHandle&&this.$videoElement&&(this.$videoElement.cancelVideoFrameCallback(this.supportVideoFrameCallbackHandle),this.supportVideoFrameCallbackHandle=null),this.tempFmp4List=[],this.pendingRemoveRanges=[],this.pendingSegments=[],this.mediaSource=null,this.sourceBuffer=null,this.hasInit=!1,this.isInitInfo=!1,this.sequenceNumber=0,this.cacheTrack={},this.timeInit=!1,this.mediaSourceAppendBufferFull=!1,this.mediaSourceAppendBufferError=!1,this.mediaSourceAddSourceBufferError=!1,this.mediaSourceError=!1,this.mediaSourceBufferError=!1,this.isDecodeFirstIIframe=!1,this.prevTimestamp=null,this.prevDts=null,this.prevPayloadBufferSize=0,this.prevTs=null,this.firstRenderTime=null,this.isWidthOrHeightChanged=!1,this.dropping=!1,this.$videoElement&&(this.player._opt.mseUseCanvasRender&&this.$videoElement.src&&(this.$videoElement.src="",this.$videoElement.removeAttribute("src")),this.$videoElement=null),this.mediaSourceObjectURL&&(window.URL.revokeObjectURL(this.mediaSourceObjectURL),this.mediaSourceObjectURL=null),this.off()}},{key:"state",get:function(){return this.mediaSource&&this.mediaSource.readyState}},{key:"isStateOpen",get:function(){return this.state===$t}},{key:"isStateClosed",get:function(){return this.state===Zt}},{key:"isStateEnded",get:function(){return this.state===Xt}},{key:"duration",get:function(){return this.mediaSource&&this.mediaSource.duration||-1},set:function(e){this.mediaSource.duration=e}},{key:"_bindMediaSourceEvents",value:function(){var e=this,t=this.player,i=(t.debug,t.events.proxy),r=i(this.mediaSource,Si,(function(){e._hasPendingSegments()&&e._doAppendSegments(),e.player&&e.player.emit(it.mseSourceOpen)})),a=i(this.mediaSource,wi,(function(){e.player&&e.player.emit(it.mseSourceClose)})),n=i(this.mediaSource,Ti,(function(){e.player&&e.player.emit(it.mseSourceended)}));this.eventListenList.push(r,a,n);var s=i(this.$videoElement,Ci,(function(t){if(e.player._opt.mseUseCanvasRender)if(e.player.checkIsInRender())e.player.handleRender();else{var i=parseInt(t.timeStamp,10);e.player.debug.warn(e.TAG_NAME,"mseUseCanvasRender is true and $videoElement ts is ".concat(i,", but not in render"))}else e.player.handleRender()})),o=i(this.$videoElement,Ri,(function(){e.player.debug.log(e.TAG_NAME,"video playback Rate change",e.$videoElement&&e.$videoElement.playbackRate)}));this.eventListenList.push(s,o)}},{key:"initVideoEvents",value:function(){var e=this,t=this.player.events.proxy,i=t(this.$videoElement,Ei,(function(){e.player.debug.log(e.TAG_NAME,"video canplay"),e.$videoElement.play().then((function(){e.player.emit(it.removeLoadingBgImage),un()&&(e.supportVideoFrameCallbackHandle=e.$videoElement.requestVideoFrameCallback(e.videoFrameCallback.bind(e))),e.player.debug.log(e.TAG_NAME,"video play")}))["catch"]((function(t){e.player.debug.error(e.TAG_NAME,"video play error ",t),e.player.emitError(nt.mediaSourceUseCanvasRenderPlayFailed,t)}))})),r=t(this.$videoElement,xi,(function(){e.player.debug.log(e.TAG_NAME,"video waiting")})),a=t(this.$videoElement,Ci,(function(t){parseInt(t.timeStamp,10),e.$videoElement.paused&&(e.player.debug.warn(e.TAG_NAME,"video is paused and next try to replay"),e.$videoElement.play().then((function(){e.player.debug.log(e.TAG_NAME,"video is paused and replay success")}))["catch"]((function(t){e.player.debug.warn(e.TAG_NAME,"video is paused and replay error ",t)})))}));this.eventListenList.push(i,r,a)}},{key:"videoFrameCallback",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.player.isDestroyed()?this.player.debug.log(this.TAG_NAME,"videoFrameCallback() player is destroyed"):(this.player.video.render({$video:this.$videoElement,ts:t.mediaTime||0}),this.supportVideoFrameCallbackHandle=this.$videoElement.requestVideoFrameCallback(this.videoFrameCallback.bind(this)))}},{key:"decodeVideo",value:function(e,t,i,r){var a=this.player;if(a)if(this.player.isDestroyed())this.player.debug.warn(this.TAG_NAME,"decodeVideo() player is destroyed");else if(this.hasInit)if(!this.isDecodeFirstIIframe&&i&&(this.isDecodeFirstIIframe=!0),this.isDecodeFirstIIframe){if(i&&0===e[1]){var n=15&e[0],s={};n===pt?s=ms(e.slice(5)):n===mt&&(s=Cs(e));var o=this.player.video.videoInfo;o&&o.width&&o.height&&s&&s.codecWidth&&s.codecHeight&&(s.codecWidth!==o.width||s.codecHeight!==o.height)&&(this.player.debug.warn(this.TAG_NAME,"\n decodeVideo: video width or height is changed,\n old width is ".concat(o.width,", old height is ").concat(o.height,",\n new width is ").concat(s.codecWidth,", new height is ").concat(s.codecHeight,",\n and emit change event")),this.isWidthOrHeightChanged=!0,this.player.emitError(nt.mseWidthOrHeightChange))}if(this.isWidthOrHeightChanged)return void this.player.debug.warn(this.TAG_NAME,"decodeVideo: video width or height is changed, and return");if(tn(e))return void this.player.debug.warn(this.TAG_NAME,"decodeVideo and payload is video sequence header so drop this frame");if(e.byteLength<12)return void this.player.debug.warn(this.TAG_NAME,"decodeVideo and payload is too small , payload length is ".concat(e.byteLength));var c=t;if(this.player.isPlayer()){if(null===this.firstRenderTime&&(this.firstRenderTime=t),c=t-this.firstRenderTime,c<0&&(this.player.debug.warn(this.TAG_NAME,"decodeVideo\n local dts is < 0 , ts is ".concat(t," and prevTs is ").concat(this.prevTs,",\n firstRenderTime is ").concat(this.firstRenderTime," and mseCorrectTimeDuration is ").concat(this.player._opt.mseCorrectTimeDuration)),c=null===this.prevDts?0:this.prevDts+this.player._opt.mseCorrectTimeDuration,this._checkTsIsMaxDiff(t)))return this.player.debug.warn(this.TAG_NAME,"decodeVideo is max diff , ts is ".concat(t," and prevTs is ").concat(this.prevTs,", diff is ").concat(this.prevTs-t)),void this.emit(nt.mediaSourceTsIsMaxDiff);if(null!==this.prevDts&&c<=this.prevDts){if(this.player.debug.warn(this.TAG_NAME,"\n decodeVideo dts is less than(or equal) prev dts ,\n dts is ".concat(c," and prev dts is ").concat(this.prevDts," ,\n and now ts is ").concat(t," and prev ts is ").concat(this.prevTs," ,\n and diff is ").concat(t-this.prevTs," and firstRenderTime is ").concat(this.firstRenderTime," and isIframe is ").concat(i,",\n and mseCorrectTimeDuration is ").concat(this.player._opt.mseCorrectTimeDuration,",\n and prevPayloadBufferSize is ").concat(this.prevPayloadBufferSize," and payload size is ").concat(e.byteLength)),c===this.prevDts&&this.prevPayloadBufferSize===e.byteLength)return void this.player.debug.warn(this.TAG_NAME,"decodeVideo dts is equal to prev dts and payload size is equal to prev payload size so drop this frame");if(c=this.prevDts+this.player._opt.mseCorrectTimeDuration,this._checkTsIsMaxDiff(t))return this.player.debug.warn(this.TAG_NAME,"decodeVideo is max diff , ts is ".concat(t," and prevTs is ").concat(this.prevTs,", diff is ").concat(this.prevTs-t," and emit replay")),void this.emit(nt.mediaSourceTsIsMaxDiff)}}this.player.isPlayer()?this._decodeVideo(e,c,i,r,t):this.player.isPlayback()&&an(this.player.playbackPause)&&(this.player.playback.isUseLocalCalculateTime&&this.player.playback.increaseLocalTimestamp(),this._decodeVideo(e,c,i,r,t)),this.prevDts=c,this.prevPayloadBufferSize=e.byteLength,this.prevTs=t,this.player.getRenderType()===K&&this.player.video&&this.player.video.doAddContentToWatermark()}else this.player.debug.log(this.TAG_NAME,"decodeVideo first frame is not iFrame");else if(i&&e[1]===Gi){var l=15&e[0];if(a.video.updateVideoInfo({encTypeCode:l}),l===mt&&an(va()))return void this.emit(nt.mediaSourceH265NotSupport);a._times.decodeStart||(a._times.decodeStart=$r()),this.hasInit=this._decodeConfigurationRecord(e,t,i,l)}else this.player.debug.warn(this.TAG_NAME,"decodeVideo has not init , isIframe is ".concat(i," , payload is ").concat(e[1]))}},{key:"_checkTsIsMaxDiff",value:function(e){return this.prevTs>0&&e<this.prevTs&&this.prevTs-e>Z}},{key:"_decodeConfigurationRecord",value:function(e,t,i,r){var a=e.slice(5),n={};if(r===pt?n=ms(a):r===mt&&(n=Cs(e)),this.player.recorder&&this.player._opt.recordType===C&&this.player.recorder.initMetaData(e,r),0===n.codecWidth&&0===n.codecHeight)return this.player.debug.warn(this.TAG_NAME,"_decodeConfigurationRecord",n),this.emit(nt.mediaSourceDecoderConfigurationError),!1;var s={id:1,type:"video",timescale:1e3,duration:0,avcc:a,codecWidth:n.codecWidth,codecHeight:n.codecHeight,videoType:n.videoType},o=tl.generateInitSegment(s);return this.isAvc=r===pt,this.appendBuffer(o.buffer),this.sequenceNumber=0,this.cacheTrack={},this.timeInit=!1,!0}},{key:"_decodeVideo",value:function(e,t,i,r,a){var n=this.player,s=e.slice(5),o=s.byteLength;if(0!==o){var c=(new Date).getTime(),l=!1;this.prevTimestamp||(this.prevTimestamp=c,l=!0);var u=c-this.prevTimestamp;this.decodeDiffTimestamp=u,u>500&&!l&&this.player.isPlayer()&&n.debug.warn(this.TAG_NAME,"_decodeVideo now time is ".concat(c," and prev time is ").concat(this.prevTimestamp,", diff time is ").concat(u," ms"));var d=this.$videoElement,h=n._opt.videoBufferDelay+n._opt.videoBuffer;if(d.buffered.length>1&&(this.removeBuffer(d.buffered.start(0),d.buffered.end(0)),this.timeInit=!1),this.dropping&&this.cacheTrack.id&&t-this.cacheTrack.dts>h)n.debug.warn(this.TAG_NAME,"dropping time is ",t-this.cacheTrack.dts),this.dropping=!1,this.cacheTrack={};else if(this.cacheTrack.id&&t>=this.cacheTrack.dts){var f=8+this.cacheTrack.size,p=new Uint8Array(f);p[0]=f>>>24&255,p[1]=f>>>16&255,p[2]=f>>>8&255,p[3]=255&f,p.set(tl.types.mdat,4),p.set(this.cacheTrack.data,8),this.cacheTrack.duration=t-this.cacheTrack.dts;var m=tl.moof(this.cacheTrack,this.cacheTrack.dts);this.cacheTrack={};var g=new Uint8Array(m.byteLength+p.byteLength);g.set(m,0),g.set(p,m.byteLength),this.appendBuffer(g.buffer),n.emit(it.timeUpdate,a),n.isPlayer()?n.updateStats({fps:!0,dfps:!0,ts:a,mseTs:t}):n.isPlayback()&&n.playback.updateStats({ts:a}),n._times.videoStart||(n._times.videoStart=$r(),n.handlePlayToRenderTimes())}else n.debug.log(this.TAG_NAME,"timeInit set false , cacheTrack = {} now dts is ".concat(t,", and ts is ").concat(a," cacheTrack dts is ").concat(this.cacheTrack&&this.cacheTrack.dts)),this.timeInit=!1,this.cacheTrack={};this.cacheTrack||(this.cacheTrack={}),this.cacheTrack.id=1,this.cacheTrack.sequenceNumber=++this.sequenceNumber,this.cacheTrack.size=o,this.cacheTrack.dts=t,this.cacheTrack.cts=r,this.cacheTrack.isKeyframe=i,this.cacheTrack.data=s,this.cacheTrack.flags={isLeading:0,dependsOn:i?2:1,isDependedOn:i?1:0,hasRedundancy:0,isNonSync:i?0:1},this.timeInit||1!==d.buffered.length||(n.debug.log(this.TAG_NAME,"timeInit set true"),this.timeInit=!0,d.currentTime=d.buffered.end(0)),!this.isInitInfo&&d.videoWidth>0&&d.videoHeight>0&&(n.debug.log(this.TAG_NAME,"updateVideoInfo: ".concat(d.videoWidth,",").concat(d.videoHeight)),n.video.updateVideoInfo({width:d.videoWidth,height:d.videoHeight}),n.video.initCanvasViewSize(),this.isInitInfo=!0),n._opt.mseUseCanvasRender&&an(this.isSupportVideoFrameCallback)&&n.video.render({$video:d,ts:t}),this.prevTimestamp=(new Date).getTime()}else n.debug.warn(this.TAG_NAME,"_decodeVideo payload bytes is 0 and return")}},{key:"appendBuffer",value:function(e){}},{key:"getSourceBufferUpdating",value:function(){return this.sourceBuffer&&this.sourceBuffer.updating}},{key:"stop",value:function(){this.removeSourceBuffer(),this.endOfStream(),this.abortSourceBuffer()}},{key:"checkSourceBufferDelay",value:function(){var e=this.$videoElement,t=0;return e.buffered.length>0&&(t=e.buffered.end(e.buffered.length-1)-e.currentTime),t<0&&(this.player.debug.warn(this.TAG_NAME,"checkSourceBufferDelay end(0) is ".concat(e.buffered.end(0)," - currentTime is ").concat(e.currentTime," and result < 0 and result is ").concat(t)),t=0),t}},{key:"checkSourceBufferStore",value:function(){var e=this.$videoElement,t=0;return e.buffered.length>0&&(t=e.currentTime-e.buffered.start(0)),t}},{key:"getDecodeDiffTimes",value:function(){return this.decodeDiffTimestamp}},{key:"removeBuffer",value:function(e,t){var i=Na();if(this.player.debug.log(this.TAG_NAME,"removeBuffer() start is ".concat(e," and end is ").concat(t," and this.sourceBuffer.updating is ").concat(this.sourceBuffer.updating," and _isMacOsFirefox is ").concat(i)),this.isStateOpen&&!1===this.sourceBuffer.updating&&an(i))try{this.sourceBuffer.remove(e,t)}catch(r){this.player.debug.warn(this.TAG_NAME,"removeBuffer() error",r)}else this.player.debug.warn(this.TAG_NAME,"removeBuffer() this.isStateOpen is",this.isStateOpen,"this.sourceBuffer.updating",this.sourceBuffer.updating)}},{key:"clearUpAllSourceBuffer",value:function(){for(var e=this.$videoElement.buffered,t=0;t<e.length;t++){var i=e.start(t),r=e.end(t);this.pendingRemoveRanges.push({start:i,end:r})}an(this.getSourceBufferUpdating())&&this._doRemoveRanges()}},{key:"endOfStream",value:function(){if(this.isStateOpen&&this.$videoElement&&this.$videoElement.readyState>=1)try{this.player.debug.log(this.TAG_NAME,"endOfStream()"),this.mediaSource.endOfStream()}catch(e){this.player.debug.warn(this.TAG_NAME,"endOfStream() error",e)}}},{key:"abortSourceBuffer",value:function(){if(this.isStateOpen&&this.sourceBuffer)try{this.player.debug.log(this.TAG_NAME,"abortSourceBuffer()"),this.sourceBuffer.abort()}catch(e){}this.sourceBuffer=null}},{key:"removeSourceBuffer",value:function(){if(!this.isStateClosed&&this.mediaSource&&this.sourceBuffer)try{this.player.debug.log(this.TAG_NAME,"removeSourceBuffer()"),this.mediaSource.removeSourceBuffer(this.sourceBuffer)}catch(e){this.player.debug.warn(this.TAG_NAME,"removeSourceBuffer() error",e)}}},{key:"_hasPendingSegments",value:function(){return this.pendingSegments.length>0}},{key:"_handleUpdatePlaybackRate",value:function(){if(this.$videoElement){var e=this.$videoElement,t=(this.player._opt.videoBuffer+this.player._opt.videoBufferDelay)/1e3,i=e.buffered;i.length&&i.start(0);var r=i.length?i.end(i.length-1):0,a=e.currentTime,n=r-a,s=Math.max(5,t+3);this.player.updateStats({mseVideoBufferDelayTime:n}),n>s?(this.player.debug.log(this.TAG_NAME,"handleUpdatePlaybackRate and buffered is ".concat(r," and current is ").concat(a," , delay buffer is more than ").concat(s," is ").concat(n," and new time is ").concat(r)),e.currentTime=r,a=e.currentTime):n<0&&(this.player.debug.warn(this.TAG_NAME,"handleUpdatePlaybackRate and delay buffer is ".concat(r," - current is ").concat(a," = ").concat(n," < 0 and check video is paused : ").concat(e.paused," ")),e.paused&&e.play());var o=this._getPlaybackRate(r-a);e.playbackRate!==o&&(this.player.debug.log(this.TAG_NAME,"handleUpdatePlaybackRate and buffered is ".concat(r," and current time is ").concat(a," and delay is ").concat(r-a," set playbackRate is ").concat(o," ")),e.playbackRate=o)}}},{key:"_handleUpdateBufferDelayTime",value:function(){var e=this.getVideoBufferDelayTime();this.player.updateStats({mseVideoBufferDelayTime:e})}},{key:"_doAppendSegments",value:function(){}},{key:"_doCleanUpSourceBuffer",value:function(){for(var e=this.$videoElement,t=e.buffered,i=e.currentTime,r=!1,a=0;a<t.length;a++){var n=t.start(a),s=t.end(a);if(n<=i&&i<s+3){if(i-n>=this.player._opt.mseAutoCleanupMaxBackwardDuration){r=!0;var o=i-this.player._opt.mseAutoCleanupMinBackwardDuration;this.pendingRemoveRanges.push({start:n,end:o})}}else s<i&&(r=!0,this.pendingRemoveRanges.push({start:n,end:s}))}r&&an(this.getSourceBufferUpdating())&&this._doRemoveRanges()}},{key:"_hasPendingRemoveRanges",value:function(){return this.pendingRemoveRanges.length>0}},{key:"_doRemoveRanges",value:function(){if(!this.getSourceBufferUpdating())for(var e=this.pendingRemoveRanges;e.length&&an(this.getSourceBufferUpdating());){var t=e.shift();try{this.sourceBuffer.remove(t.start,t.end)}catch(i){this.player.debug.warn(this.TAG_NAME,"removeBuffer() error",i)}}}},{key:"getDecodePlaybackRate",value:function(){var e=0,t=this.$videoElement;return t&&(e=t.playbackRate),e}},{key:"_getPlaybackRate",value:function(e){var t=this.$videoElement,i=this.player._opt.videoBufferDelay,r=Math.max(i,500),a=r/2;return e*=1e3,1===t.playbackRate?e>r?1.2:1:e<=a?1:t.playbackRate}},{key:"_needCleanupSourceBuffer",value:function(){if(an(this.player._opt.mseAutoCleanupSourceBuffer))return!1;var e=this.$videoElement,t=e.buffered,i=e.currentTime;return t.length>=1&&i-t.start(0)>=this.player._opt.mseAutoCleanupMaxBackwardDuration}},{key:"getVideoCurrentTime",value:function(){var e=0;return this.$videoElement&&(e=this.$videoElement.currentTime),e}},{key:"getVideoBufferLastTime",value:function(){var e=this.$videoElement,t=0;if(e){var i=e.buffered;i.length&&i.start(0),t=i.length?i.end(i.length-1):0}return t}},{key:"getVideoBufferDelayTime",value:function(){var e=this.$videoElement,t=this.getVideoBufferLastTime()-e.currentTime;return t>0?t:0}}]),i}(fn),rl=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e),r.TAG_NAME="MseDecoder",e.debug.log(r.TAG_NAME,"init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){k(Object(b["a"])(i.prototype),"destroy",this).call(this),this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"appendBuffer",value:function(e){var t=this,i=this.player,r=i.debug,a=i.events.proxy;if(this.mediaSourceAddSourceBufferError)r.warn(this.TAG_NAME,"this.mediaSourceAddSourceBufferError is true");else if(this.mediaSourceAppendBufferFull)r.warn(this.TAG_NAME,"this.mediaSourceAppendBufferFull is true");else if(this.mediaSourceAppendBufferError)r.warn(this.TAG_NAME,"this.mediaSourceAppendBufferError is true");else if(this.mediaSourceBufferError)r.warn(this.TAG_NAME,"this.mediaSourceBufferError is true");else{if(null===this.sourceBuffer){var n=this.isAvc?Yt:Qt;try{this.sourceBuffer=this.mediaSource.addSourceBuffer(n)}catch(s){return r.error(this.TAG_NAME,"this.mediaSource.addSourceBuffer()",s.code,"isAvc:".concat(this.isAvc),s),this.player.emitError(nt.mseAddSourceBufferError,s),void(this.mediaSourceAddSourceBufferError=!0)}if(this.sourceBuffer){var s=a(this.sourceBuffer,"error",(function(e){t.mediaSourceBufferError=!0,t.player.emitError(nt.mseSourceBufferError,e)})),o=a(this.sourceBuffer,"updateend",(function(){}));this.eventListenList.push(s,o)}}if(this.player.isPlayer()&&this._handleUpdatePlaybackRate(),this.player.isPlayback()&&this._handleUpdateBufferDelayTime(),this.player._opt.mseAutoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanUpSourceBuffer(),an(this.sourceBuffer.updating)&&this.isStateOpen)try{var c=e;if(this.tempFmp4List.length>0){r.log(this.TAG_NAME,"this.tempFmp4List.length = ".concat(this.tempFmp4List.length," and merge buffer"));var l=0;this.tempFmp4List.push(e);for(var u=0;u<this.tempFmp4List.length;u++)l+=this.tempFmp4List[u].byteLength;for(var d=new Uint8Array(l),h=0,f=0;f<this.tempFmp4List.length;f++){var p=new Uint8Array(this.tempFmp4List[f]);d.set(p,h),h+=this.tempFmp4List[f].byteLength}c=d,this.tempFmp4List=[]}this.sourceBuffer.appendBuffer(c)}catch(n){r.error(this.TAG_NAME,"this.sourceBuffer.appendBuffer()",n.code,n),22===n.code?(this.stop(),this.mediaSourceAppendBufferFull=!0,this.emit(nt.mediaSourceFull)):11===n.code?(this.stop(),this.mediaSourceAppendBufferError=!0,this.emit(nt.mediaSourceAppendBufferError)):(this.stop(),r.error(this.TAG_NAME,"appendBuffer error",n),this.mediaSourceBufferError=!0,this.player.emitError(it.mseSourceBufferError,n))}else this.isStateClosed?(this.mediaSourceBufferError=!0,this.player.emitError(nt.mseSourceBufferError,"mediaSource is not attached to video or mediaSource is closed")):this.isStateEnded?(this.mediaSourceBufferError=!0,this.player.emitError(nt.mseSourceBufferError,"mediaSource is end")):(rn(this.sourceBuffer.updating)&&this.player.isPlayer()&&r.log(this.TAG_NAME,"mseSourceBufferBusy"),this.tempFmp4List.push(e))}}},{key:"getVideoBufferDelayTime",value:function(){var e=this.$videoElement,t=e.buffered;t.length&&t.start(0);var i=(t.length?t.end(t.length-1):0)-e.currentTime;return i>0?i:0}}]),i}(il),al=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e),r.TAG_NAME="MseDecoderV2",e.debug.log(r.TAG_NAME,"init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){k(Object(b["a"])(i.prototype),"destroy",this).call(this),this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"appendBuffer",value:function(e){var t=this,i=this.player,r=i.debug,a=i.events.proxy;if(this.mediaSourceAddSourceBufferError)r.warn(this.TAG_NAME,"this.mediaSourceAddSourceBufferError is true");else if(this.mediaSourceAppendBufferFull)r.warn(this.TAG_NAME,"this.mediaSourceAppendBufferFull is true");else if(this.mediaSourceAppendBufferError)r.warn(this.TAG_NAME,"this.mediaSourceAppendBufferError is true");else if(this.mediaSourceBufferError)r.warn(this.TAG_NAME,"this.mediaSourceBufferError is true");else{if(null===this.sourceBuffer){var n=this.isAvc?Yt:Qt;try{this.sourceBuffer=this.mediaSource.addSourceBuffer(n)}catch(s){return r.error(this.TAG_NAME,"this.mediaSource.addSourceBuffer()",s.code,s),this.player.emitError(nt.mseAddSourceBufferError,s),void(this.mediaSourceAddSourceBufferError=!0)}if(this.sourceBuffer){var s=a(this.sourceBuffer,"error",(function(e){t.mediaSourceBufferError=!0,t.player.emitError(nt.mseSourceBufferError,e)})),o=a(this.sourceBuffer,"updateend",(function(){t._hasPendingRemoveRanges()?(r.log(t.TAG_NAME,"this.sourceBuffer updateend and has pending remove ranges"),t._doRemoveRanges()):t._hasPendingSegments()&&(r.log(t.TAG_NAME,"this.sourceBuffer updateend and has pending segments"),t._doAppendSegments())}));this.eventListenList.push(s,o)}}this.pendingSegments.push(e),this.player.isPlayer()&&this._handleUpdatePlaybackRate(),this.player.isPlayback()&&this._handleUpdateBufferDelayTime(),this.player._opt.mseAutoCleanupSourceBuffer&&this._needCleanupSourceBuffer()&&this._doCleanUpSourceBuffer(),an(this.sourceBuffer.updating)&&this.isStateOpen&&an(this._hasPendingRemoveRanges())?this._doAppendSegments():this.isStateClosed?(this.mediaSourceBufferError=!0,this.player.emitError(nt.mseSourceBufferError,"mediaSource is not attached to video or mediaSource is closed")):this.isStateEnded?(this.mediaSourceBufferError=!0,this.player.emitError(nt.mseSourceBufferError,"mediaSource is end")):(rn(this.sourceBuffer.updating)&&this.player.isPlayer()&&r.log(this.TAG_NAME,"mseSourceBufferBusy"),this._hasPendingRemoveRanges()&&r.log(this.TAG_NAME,"has pending remove ranges"))}}},{key:"_doAppendSegments",value:function(){if(!(this.isStateClosed||this.isStateEnded||this.getSourceBufferUpdating())&&this.pendingSegments.length>0){var e=this.pendingSegments.shift();try{this.sourceBuffer.appendBuffer(e)}catch(t){this.player.debug.error(this.TAG_NAME,"this.sourceBuffer.appendBuffer()",t.code,t),22===t.code?(this.stop(),this.mediaSourceAppendBufferFull=!0,this.emit(nt.mediaSourceFull)):11===t.code?(this.stop(),this.mediaSourceAppendBufferError=!0,this.emit(nt.mediaSourceAppendBufferError)):(this.stop(),this.mediaSourceBufferError=!0,this.player.debug.error(this.TAG_NAME,"appendBuffer error",t),this.player.emitError(it.mseSourceBufferError,t))}}}}]),i}(il),nl=function(){return"wakeLock"in navigator&&-1===window.navigator.userAgent.indexOf("Samsung")&&an(la())},sl=function(){function e(t){var i=this;Object(T["a"])(this,e),this.player=t,this.enabled=!1,nl()?(this.player.debug.log("NoSleep","Native Wake Lock API supported."),this._wakeLock=null,this.handleVisibilityChange=function(){null!==i._wakeLock&&"visible"===document.visibilityState&&i.enable()},document.addEventListener("visibilitychange",this.handleVisibilityChange),document.addEventListener("fullscreenchange",this.handleVisibilityChange)):(this.player.debug.log("NoSleep","Native Wake Lock API not supported. so use video element."),this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm","data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQRChYECGFOAZwEAAAAAABLfEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHYTbuMU6uEElTDZ1OsggGXTbuMU6uEHFO7a1OsghLJ7AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmsirXsYMPQkBNgI1MYXZmNTguNDUuMTAwV0GNTGF2ZjU4LjQ1LjEwMESJiECzmgAAAAAAFlSua0C5rgEAAAAAAABO14EBc8WI9UhIq9EDJPCcgQAitZyDdW5khoVWX1ZQOIOBASPjg4QF9eEA4AEAAAAAAAAbsIIBQLqB8FSwggElVLqB8FWwiFW3gQFVuIECrgEAAAAAAABZ14ECc8WIUEWPA9J/iJ6cgQAitZyDdW5khoZBX09QVVNWqoNjLqBWu4QExLQAg4EC4ZGfgQG1iEDncAAAAAAAYmSBIGOik09wdXNIZWFkAQE4AYC7AAAAAAASVMNnQcJzcwEAAAAAAACXY8CAZ8gBAAAAAAAAFUWji01BSk9SX0JSQU5ERIeEaXNvbWfIAQAAAAAAABZFo41NSU5PUl9WRVJTSU9ORIeDNTEyZ8gBAAAAAAAAJ0WjkUNPTVBBVElCTEVfQlJBTkRTRIeQaXNvbWlzbzJhdmMxbXA0MWfIAQAAAAAAABpFo4dFTkNPREVSRIeNTGF2ZjU4LjQ1LjEwMHNzAQAAAAAAAIZjwItjxYj1SEir0QMk8GfIAQAAAAAAAB5Fo4xIQU5ETEVSX05BTUVEh4xWaWRlb0hhbmRsZXJnyAEAAAAAAAAhRaOHRU5DT0RFUkSHlExhdmM1OC45MS4xMDAgbGlidnB4Z8iiRaOIRFVSQVRJT05Eh5QwMDowMDowNS4wMDcwMDAwMDAAAHNzAQAAAAAAAIdjwItjxYhQRY8D0n+InmfIAQAAAAAAAB5Fo4xIQU5ETEVSX05BTUVEh4xTb3VuZEhhbmRsZXJnyAEAAAAAAAAiRaOHRU5DT0RFUkSHlUxhdmM1OC45MS4xMDAgbGlib3B1c2fIokWjiERVUkFUSU9ORIeUMDA6MDA6MDUuMDE4MDAwMDAwAAAfQ7Z1T2TngQCjh4IAAID4//6jQKSBAAeAMBIAnQEqQAHwAABHCIWFiIWEiAICAAYWBPcGgWSfa9ubJzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh7Jzh69AD+/6tQgKOHggAVgPj//qOHggApgPj//qOHggA9gPj//qOHggBRgPj//qOHggBlgPj//qOegQBrANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCAHmA+P/+o4eCAI2A+P/+o4eCAKGA+P/+o4eCALWA+P/+o4eCAMmA+P/+o56BAM8A0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IA3YD4//6jh4IA8YD4//6jh4IBBYD4//6jh4IBGYD4//6jh4IBLYD4//6jnoEBMwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHggFBgPj//qOHggFVgPj//qOHggFpgPj//qOHggF9gPj//qOHggGRgPj//qOegQGXANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCAaWA+P/+o4eCAbmA+P/+o4eCAc2A+P/+o4eCAeGA+P/+o4eCAfWA+P/+o56BAfsA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4ICCYD4//6jh4ICHYD4//6jh4ICMYD4//6jh4ICRYD4//6jh4ICWYD4//6jnoECXwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHggJtgPj//qOHggKBgPj//qOHggKVgPj//qOHggKpgPj//qOHggK9gPj//qOegQLDANECAAUQEBRgAGFgv9AAIgAQzX61yT5xzAAAo4eCAtGA+P/+o4eCAuWA+P/+o4eCAvmA+P/+o4eCAw2A+P/+o4eCAyGA+P/+o56BAycA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IDNYD4//6jh4IDSYD4//6jh4IDXYD4//6jh4IDcYD4//6jh4IDhYD4//6jnoEDiwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHggOZgPj//qOHggOtgPj//qOHggPBgPj//qOHggPVgPj//qOHggPpgPj//qOegQPvANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCA/2A+P/+o4eCBBGA+P/+o4eCBCWA+P/+o4eCBDmA+P/+o4eCBE2A+P/+o56BBFMA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IEiID4//6jh4IEnID4//6jh4IEsID4//6jnoEEtwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHggTEgPj//qOHggTYgPj//qOHggTsgPj//qOHggUAgPj//qOHggUUgPj//qOegQUbANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCBSiA+P/+o4eCBTyA+P/+o4eCBVCA+P/+o4eCBWSA+P/+o4eCBXiA+P/+o56BBX8A0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IFjID4//6jh4IFoID4//6jh4IFtID4//6jh4IFyID4//6jh4IF3ID4//6jnoEF4wDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHggXwgPj//qOHggYEgPj//qOHggYYgPj//qOHggYsgPj//qOHggZAgPj//qOegQZHANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCBlSA+P/+o4eCBmiA+P/+o4eCBnyA+P/+o4eCBpCA+P/+o4eCBqSA+P/+o56BBqsA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IGuID4//6jh4IGzID4//6jh4IG4ID4//6jh4IG9ID4//6jh4IHCID4//6jnoEHDwDRAgAFEBAUYABhYL/QACIAEM1+tck+ccwAAKOHggccgPj//qOHggcwgPj//qOHggdEgPj//qOHggdYgPj//qOHggdsgPj//qOegQdzANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCB4CA+P/+o4eCB5SA+P/+o4eCB6iA+P/+o4eCB7yA+P/+o4eCB9CA+P/+o56BB9cA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IH5ID4//6jh4IH+ID4//6jh4IIDID4//6jh4IIIID4//6jh4IINID4//6jnoEIOwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHgghIgPj//qOHgghcgPj//qOHgghwgPj//qOHggiEgPj//qOegQifANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCCMCA+P/+o4eCCNSA+P/+o4eCCOiA+P/+o4eCCPyA+P/+o56BCQMA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IJEID4//6jh4IJJID4//6jh4IJOID4//6jh4IJTID4//6jh4IJYID4//6jnoEJZwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHggl0gPj//qOHggmIgPj//qOHggmcgPj//qOHggmwgPj//qOHggnEgPj//qOegQnLANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCCdiA+P/+o4eCCeyA+P/+o4eCCgCA+P/+o4eCChSA+P/+o4eCCiiA+P/+o56BCi8A0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IKPID4//6jh4IKUID4//6jh4IKZID4//6jh4IKeID4//6jh4IKjID4//6jnoEKkwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHggqggPj//qOHggq0gPj//qOHggrIgPj//qOHggrcgPj//qOHggrwgPj//qOegQr3ANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCCwSA+P/+o4eCCxiA+P/+o4eCCyyA+P/+o4eCC0CA+P/+o4eCC1SA+P/+o56BC1sA0QIABRAQFGAAYWC/0AAiABDNfrXJPnHMAACjh4ILaID4//6jh4ILfID4//6jh4ILkID4//6jh4ILpID4//6jh4ILuID4//6jnoELvwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHggvMgPj//qOHggvggPj//qOHggv0gPj//qOHggwIgPj//qOHggwcgPj//qOegQwjANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCDDCA+P/+o4eCDESA+P/+o4eCDFiA+P/+o4eCDGyA+P/+o4eCDICA+P/+o56BDIcA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IMlID4//6jh4IMqID4//6jh4IMvID4//6jh4IM0ID4//6jnoEM6wDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHgg0MgPj//qOHgg0ggPj//qOHgg00gPj//qOHgg1IgPj//qOegQ1PANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCDVyA+P/+o4eCDXCA+P/+o4eCDYSA+P/+o4eCDZiA+P/+o4eCDayA+P/+o56BDbMA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4INwID4//6jh4IN1ID4//6jh4IN6ID4//6jh4IN/ID4//6jh4IOEID4//6jnoEOFwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHgg4kgPj//qOHgg44gPj//qOHgg5MgPj//qOHgg5ggPj//qOHgg50gPj//qOegQ57ANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCDoiA+P/+o4eCDpyA+P/+o4eCDrCA+P/+o4eCDsSA+P/+o4eCDtiA+P/+o56BDt8A0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IO7ID4//6jh4IPAID4//6jh4IPFID4//6jh4IPKID4//6jh4IPPID4//6jnoEPQwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHgg9QgPj//qOHgg9kgPj//qOHgg94gPj//qOHgg+MgPj//qOHgg+ggPj//qOegQ+nANECAAUQEBRgAGFgv9AAIgAQzX61yT5xzAAAo4eCD7SA+P/+o4eCD8iA+P/+o4eCD9yA+P/+o4eCD/CA+P/+o4eCEASA+P/+o56BEAsA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IQGID4//6jh4IQLID4//6jh4IQQID4//6jh4IQVID4//6jh4IQaID4//6jnoEQbwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHghB8gPj//qOHghCQgPj//qOHghCkgPj//qOHghC4gPj//qOHghDMgPj//qOegRDTANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCEOCA+P/+o4eCEPSA+P/+o4eCEQiA+P/+o56BETcA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4IRQ4D4//6jh4IRV4D4//6jh4IRa4D4//6jh4IRf4D4//6jh4IRk4D4//6jnoERmwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHghGngPj//qOHghG7gPj//qOHghHPgPj//qOHghHjgPj//qOHghH3gPj//qOegRH/ANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCEguA+P/+o4eCEh+A+P/+o4eCEjOA+P/+o4eCEkeA+P/+o4eCEluA+P/+o56BEmMA0QIABRCsABgAGFgv9AAIgAQzX61yT5xzAACjh4ISb4D4//6jh4ISg4D4//6jh4ISl4D4//6jh4ISq4D4//6jh4ISv4D4//6jnoESxwDRAgAFEKwAGAAYWC/0AAiABDNfrXJPnHMAAKOHghLTgPj//qOHghLngPj//qOHghL7gPj//qOHghMPgPj//qOHghMjgPj//qOegRMrANECAAUQrAAYABhYL/QACIAEM1+tck+ccwAAo4eCEzeA+P/+o4eCE0uA+P/+o4eCE1+A+P/+o4eCE3OA+P/+oAEAAAAAAAAPoYeCE4cA+P/+daKDB/KBHFO7a5G7j7OBB7eK94EB8YIDX/CBDA=="),this._addSourceToVideo(this.noSleepVideo,"mp4","data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAACORtZGF03gIATGF2YzU4LjM1LjEwMAACMEAOAAACcQYF//9t3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE2MSByMzAyNyA0MTIxMjc3IC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAyMCAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTAgcmVmPTMgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MToweDExMSBtZT1oZXggc3VibWU9NyBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0xIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MSA4eDhkY3Q9MCBjcW09MCBkZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0tMiB0aHJlYWRzPTcgbG9va2FoZWFkX3RocmVhZHM9MSBzbGljZWRfdGhyZWFkcz0wIG5yPTAgZGVjaW1hdGU9MSBpbnRlcmxhY2VkPTAgYmx1cmF5X2NvbXBhdD0wIGNvbnN0cmFpbmVkX2ludHJhPTAgYmZyYW1lcz0wIHdlaWdodHA9MCBrZXlpbnQ9MjUwIGtleWludF9taW49MTAgc2NlbmVjdXQ9NDAgaW50cmFfcmVmcmVzaD0wIHJjX2xvb2thaGVhZD00MCByYz1jcmYgbWJ0cmVlPTEgY3JmPTIzLjAgcWNvbXA9MC42MCBxcG1pbj0wIHFwbWF4PTY5IHFwc3RlcD00IGlwX3JhdGlvPTEuNDAgYXE9MToxLjAwAIAAAADvZYiED/JigADD7JycnJycnJycnJycnJycnJycnJ11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111114BGCAHARggBwEYIAcBGCAHARggBwAAAAdBmjgf4BLYARggBwEYIAcBGCAHARggBwAAAAdBmlQH+AS2ARggBwEYIAcBGCAHARggBwAAAAdBmmA/wCWwARggBwEYIAcBGCAHARggBwEYIAcAAAAHQZqAP8AlsAEYIAcBGCAHARggBwEYIAcAAAAHQZqgP8AlsAEYIAcBGCAHARggBwEYIAcAAAAHQZrAP8AlsAEYIAcBGCAHARggBwEYIAcBGCAHAAAAB0Ga4D/AJbABGCAHARggBwEYIAcBGCAHAAAAB0GbAD/AJbABGCAHARggBwEYIAcBGCAHAAAAB0GbID/AJbABGCAHARggBwEYIAcBGCAHARggBwAAAAdBm0A/wCWwARggBwEYIAcBGCAHAAAAB0GbYD/AJbABGCAHARggBwEYIAcAAAAHQZuAP8AlsAEYIAcBGCAHARggBwEYIAcBGCAHAAAAB0GboD/AJbABGCAHARggBwEYIAcBGCAHAAAAB0GbwD/AJbABGCAHARggBwEYIAcBGCAHAAAAB0Gb4D/AJbABGCAHARggBwEYIAcBGCAHARggBwAAAAdBmgA/wCWwARggBwEYIAcBGCAHARggBwAAAAdBmiA/wCWwARggBwEYIAcBGCAHARggBwAAAAdBmkA/wCWwARggBwEYIAcBGCAHARggBwEYIAcAAAAHQZpgP8AlsAEYIAcBGCAHARggBwEYIAcAAAAHQZqAP8AlsAEYIAcBGCAHARggBwEYIAcAAAAHQZqgP8AlsAEYIAcBGCAHARggBwAAAAdBmsA/wCWwARggBwEYIAcBGCAHARggBwAAAAdBmuA/wCWwARggBwEYIAcBGCAHARggBwAAAAdBmwA/wCWwARggBwEYIAcBGCAHARggBwEYIAcAAAAHQZsgP8AlsAEYIAcBGCAHARggBwEYIAcAAAAHQZtAP8AlsAEYIAcBGCAHARggBwEYIAcAAAAHQZtgP8AlsAEYIAcBGCAHARggBwEYIAcBGCAHAAAAB0GbgD/AJbABGCAHARggBwEYIAcBGCAHAAAAB0GboD/AJbABGCAHARggBwEYIAcBGCAHAAAAB0GbwD/AJbABGCAHARggBwEYIAcBGCAHARggBwAAAAdBm+A/wCWwARggBwEYIAcBGCAHARggBwAAAAdBmgA/wCWwARggBwEYIAcAAAAHQZogP8AlsAEYIAcBGCAHARggBwEYIAcBGCAHAAAAB0GaQD/AJbABGCAHARggBwEYIAcBGCAHAAAAB0GaYD/AJbABGCAHARggBwEYIAcBGCAHAAAAB0GagD/AJbABGCAHARggBwEYIAcBGCAHARggBwAAAAdBmqA/wCWwARggBwEYIAcBGCAHARggBwAAAAdBmsA/wCWwARggBwEYIAcBGCAHARggBwAAAAdBmuA/wCWwARggBwEYIAcBGCAHARggBwEYIAcAAAAHQZsAP8AlsAEYIAcBGCAHARggBwEYIAcAAAAHQZsgP8AlsAEYIAcBGCAHARggBwEYIAcAAAAHQZtAP8AlsAEYIAcBGCAHARggBwEYIAcBGCAHAAAAB0GbYD/AJbABGCAHARggBwAAAAdBm4A/wCWwARggBwEYIAcBGCAHARggBwAAAAdBm6A/wCWwARggBwEYIAcBGCAHARggBwEYIAcAAAAHQZvAP8AlsAEYIAcBGCAHARggBwEYIAcAAAAHQZvgP8AlsAEYIAcBGCAHARggBwEYIAcAAAAHQZoAO8AlsAEYIAcBGCAHARggBwEYIAcBGCAHAAAAB0GaIDfAJbABGCAHARggBwEYIAcBGCAHAAAMxm1vb3YAAABsbXZoZAAAAAAAAAAAAAAAAAAAA+gAABOgAAEAAAEAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAPLdHJhawAAAFx0a2hkAAAAAwAAAAAAAAAAAAAAAQAAAAAAABOIAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAElVVUA8AAAAAAAJGVkdHMAAAAcZWxzdAAAAAAAAAABAAATiAAAAAAAAQAAAAADQ21kaWEAAAAgbWRoZAAAAAAAAAAAAAAAAAAAKAAAAMgAVcQAAAAAAC1oZGxyAAAAAAAAAAB2aWRlAAAAAAAAAAAAAAAAVmlkZW9IYW5kbGVyAAAAAu5taW5mAAAAFHZtaGQAAAABAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAKuc3RibAAAAKpzdHNkAAAAAAAAAAEAAACaYXZjMQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAFAAPAASAAAAEgAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABj//wAAADRhdmNDAULAC//hABxnQsAL2QFB+/8ACwAMEAAAAwAQAAADAUDxQqSAAQAFaMuDyyAAAAAQcGFzcAAAAAsAAAAMAAAAGHN0dHMAAAAAAAAAAQAAADIAAAQAAAAAFHN0c3MAAAAAAAAAAQAAAAEAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAEAAAABAAAA3HN0c3oAAAAAAAAAAAAAADIAAANoAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAAAsAAAALAAAACwAAANhzdGNvAAAAAAAAADIAAABFAAADwQAAA9wAAAP3AAAEFgAABDEAAARMAAAEawAABIYAAAShAAAEwAAABNcAAATuAAAFDQAABSgAAAVDAAAFYgAABX0AAAWYAAAFtwAABdIAAAXtAAAGBAAABh8AAAY6AAAGWQAABnQAAAaPAAAGrgAABskAAAbkAAAHAwAABx4AAAcxAAAHUAAAB2sAAAeGAAAHpQAAB8AAAAfbAAAH+gAACBUAAAgwAAAITwAACGIAAAh9AAAInAAACLcAAAjSAAAI8QAACCV0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAACAAAAAAAAE6AAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAABOIAAAEAAABAAAAAAedbWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAACsRAADYVRVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAAHSG1pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAAHDHN0YmwAAABqc3RzZAAAAAAAAAABAAAAWm1wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAACsRAAAAAAANmVzZHMAAAAAA4CAgCUAAgAEgICAF0AVAAAAAAENiAAABVQFgICABRIIVuUABoCAgAECAAAAYHN0dHMAAAAAAAAACgAAAC8AAAQAAAAAAQAACtUAAAAsAAAEAAAAAAEAAArWAAAALAAABAAAAAABAAAK1QAAACwAAAQAAAAAAQAACtUAAAAaAAAEAAAAAAEAAAH/AAABzHN0c2MAAAAAAAAAJQAAAAEAAAABAAAAAQAAAAIAAAAFAAAAAQAAAAMAAAAEAAAAAQAAAAUAAAAFAAAAAQAAAAYAAAAEAAAAAQAAAAgAAAAFAAAAAQAAAAkAAAAEAAAAAQAAAAsAAAAFAAAAAQAAAAwAAAADAAAAAQAAAA4AAAAFAAAAAQAAAA8AAAAEAAAAAQAAABEAAAAFAAAAAQAAABIAAAAEAAAAAQAAABQAAAAFAAAAAQAAABUAAAAEAAAAAQAAABcAAAADAAAAAQAAABgAAAAEAAAAAQAAABoAAAAFAAAAAQAAABsAAAAEAAAAAQAAAB0AAAAFAAAAAQAAAB4AAAAEAAAAAQAAACAAAAAFAAAAAQAAACEAAAAEAAAAAQAAACIAAAACAAAAAQAAACMAAAAFAAAAAQAAACQAAAAEAAAAAQAAACYAAAAFAAAAAQAAACcAAAAEAAAAAQAAACkAAAAFAAAAAQAAACoAAAAEAAAAAQAAACwAAAAFAAAAAQAAAC0AAAACAAAAAQAAAC4AAAAEAAAAAQAAAC8AAAAFAAAAAQAAADAAAAAEAAAAAQAAADIAAAAFAAAAAQAAADMAAAAEAAAAAQAAA1xzdHN6AAAAAAAAAAAAAADSAAAAFQAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAA3HN0Y28AAAAAAAAAMwAAADAAAAOtAAADzAAAA+cAAAQCAAAEIQAABDwAAARXAAAEdgAABJEAAASsAAAEywAABOIAAAT5AAAFGAAABTMAAAVOAAAFbQAABYgAAAWjAAAFwgAABd0AAAX4AAAGDwAABioAAAZFAAAGZAAABn8AAAaaAAAGuQAABtQAAAbvAAAHDgAABykAAAc8AAAHWwAAB3YAAAeRAAAHsAAAB8sAAAfmAAAIBQAACCAAAAg7AAAIWgAACG0AAAiIAAAIpwAACMIAAAjdAAAI/AAAABpzZ3BkAQAAAHJvbGwAAAACAAAAAf//AAAAHHNiZ3AAAAAAcm9sbAAAAAEAAADSAAAAAQAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTguMjAuMTAw"),Object.assign(this.noSleepVideo.style,{position:"absolute",left:"-100%",top:"-100%"}),document.querySelector("body").append(this.noSleepVideo),this.handleNoSleepVideoTimeUpdate=function(){i.noSleepVideo&&i.noSleepVideo.currentTime>4&&(i.noSleepVideo.currentTime=1)},this.noSleepVideo.addEventListener("timeupdate",this.handleNoSleepVideoTimeUpdate))}return Object(S["a"])(e,[{key:"destroy",value:function(){if(this._wakeLock&&(this._wakeLock.release(),this._wakeLock=null),this.noSleepVideo){this.handleNoSleepVideoTimeUpdate&&this.noSleepVideo.removeEventListener("timeupdate",this.handleNoSleepVideoTimeUpdate);try{this.noSleepVideo.parentNode&&this.noSleepVideo.parentNode.removeChild(this.noSleepVideo)}catch(e){this.player.debug.warn("NoSleep","Failed to remove noSleepVideo element.")}this.noSleepVideo=null}this.handleVisibilityChange&&(document.removeEventListener("visibilitychange",this.handleVisibilityChange),document.removeEventListener("fullscreenchange",this.handleVisibilityChange))}},{key:"_addSourceToVideo",value:function(e,t,i){var r=document.createElement("source");r.src=i,r.type="video/".concat(t),e.appendChild(r)}},{key:"isEnabled",get:function(){return this.enabled}},{key:"enable",value:function(){var e=this,t=this.player.debug;return nl()?navigator.wakeLock.request("screen").then((function(i){e._wakeLock=i,e.enabled=!0,t.log("wakeLock","Wake Lock active."),e._wakeLock.addEventListener("release",(function(){t.log("wakeLock","Wake Lock released.")}))}))["catch"]((function(i){throw e.enabled=!1,t.warn("wakeLock","".concat(i.name,", ").concat(i.message)),i})):this.noSleepVideo.play().then((function(i){return t.log("wakeLock","noSleepVideo Wake Lock active."),e.enabled=!0,i}))["catch"]((function(i){throw t.warn("wakeLock","noSleepVideo ".concat(i.name,", ").concat(i.message)),e.enabled=!1,i}))}},{key:"disable",value:function(){nl()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):this.noSleepVideo&&this.noSleepVideo.pause(),this.enabled=!1,this.player.debug.log("wakeLock","Disabling wake lock.")}}]),e}();function ol(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e["default"]:e}var cl={exports:{}};(function(e,t){var i,r,a,n,s;i=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,r=/^(?=([^\/?#]*))\1([^]*)$/,a=/(?:\/|^)\.(?=\/)/g,n=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,s={buildAbsoluteURL:function(e,t,i){if(i=i||{},e=e.trim(),!(t=t.trim())){if(!i.alwaysNormalize)return e;var a=s.parseURL(e);if(!a)throw new Error("Error trying to parse base URL.");return a.path=s.normalizePath(a.path),s.buildURLFromParts(a)}var n=s.parseURL(t);if(!n)throw new Error("Error trying to parse relative URL.");if(n.scheme)return i.alwaysNormalize?(n.path=s.normalizePath(n.path),s.buildURLFromParts(n)):t;var o=s.parseURL(e);if(!o)throw new Error("Error trying to parse base URL.");if(!o.netLoc&&o.path&&"/"!==o.path[0]){var c=r.exec(o.path);o.netLoc=c[1],o.path=c[2]}o.netLoc&&!o.path&&(o.path="/");var l={scheme:o.scheme,netLoc:n.netLoc,path:null,params:n.params,query:n.query,fragment:n.fragment};if(!n.netLoc&&(l.netLoc=o.netLoc,"/"!==n.path[0]))if(n.path){var u=o.path,d=u.substring(0,u.lastIndexOf("/")+1)+n.path;l.path=s.normalizePath(d)}else l.path=o.path,n.params||(l.params=o.params,n.query||(l.query=o.query));return null===l.path&&(l.path=i.alwaysNormalize?s.normalizePath(n.path):n.path),s.buildURLFromParts(l)},parseURL:function(e){var t=i.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(n,"")).length;);return e.split("").reverse().join("")},buildURLFromParts:function(e){return e.scheme+e.netLoc+e.path+e.params+e.query+e.fragment}},e.exports=s})(cl);var ll=cl.exports;function ul(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,r)}return i}function dl(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?ul(Object(i),!0).forEach((function(t){hl(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):ul(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function hl(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=Object(E["a"])(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=Object(E["a"])(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Object(E["a"])(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function fl(){return fl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e},fl.apply(this,arguments)}var pl=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},ml=function(e){return e.MEDIA_ATTACHING="hlsMediaAttaching",e.MEDIA_ATTACHED="hlsMediaAttached",e.MEDIA_DETACHING="hlsMediaDetaching",e.MEDIA_DETACHED="hlsMediaDetached",e.BUFFER_RESET="hlsBufferReset",e.BUFFER_CODECS="hlsBufferCodecs",e.BUFFER_CREATED="hlsBufferCreated",e.BUFFER_APPENDING="hlsBufferAppending",e.BUFFER_APPENDED="hlsBufferAppended",e.BUFFER_EOS="hlsBufferEos",e.BUFFER_FLUSHING="hlsBufferFlushing",e.BUFFER_FLUSHED="hlsBufferFlushed",e.MANIFEST_LOADING="hlsManifestLoading",e.MANIFEST_LOADED="hlsManifestLoaded",e.MANIFEST_PARSED="hlsManifestParsed",e.LEVEL_SWITCHING="hlsLevelSwitching",e.LEVEL_SWITCHED="hlsLevelSwitched",e.LEVEL_LOADING="hlsLevelLoading",e.LEVEL_LOADED="hlsLevelLoaded",e.LEVEL_UPDATED="hlsLevelUpdated",e.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",e.LEVELS_UPDATED="hlsLevelsUpdated",e.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",e.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",e.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",e.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",e.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",e.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",e.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",e.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",e.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",e.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",e.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",e.CUES_PARSED="hlsCuesParsed",e.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",e.INIT_PTS_FOUND="hlsInitPtsFound",e.FRAG_LOADING="hlsFragLoading",e.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",e.FRAG_LOADED="hlsFragLoaded",e.FRAG_DECRYPTED="hlsFragDecrypted",e.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",e.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",e.FRAG_PARSING_METADATA="hlsFragParsingMetadata",e.FRAG_PARSED="hlsFragParsed",e.FRAG_BUFFERED="hlsFragBuffered",e.FRAG_CHANGED="hlsFragChanged",e.FPS_DROP="hlsFpsDrop",e.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",e.ERROR="hlsError",e.DESTROYING="hlsDestroying",e.KEY_LOADING="hlsKeyLoading",e.KEY_LOADED="hlsKeyLoaded",e.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",e.BACK_BUFFER_REACHED="hlsBackBufferReached",e}({}),gl=function(e){return e.NETWORK_ERROR="networkError",e.MEDIA_ERROR="mediaError",e.KEY_SYSTEM_ERROR="keySystemError",e.MUX_ERROR="muxError",e.OTHER_ERROR="otherError",e}({}),yl=function(e){return e.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",e.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",e.KEY_SYSTEM_NO_SESSION="keySystemNoSession",e.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",e.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",e.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",e.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",e.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",e.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",e.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",e.MANIFEST_LOAD_ERROR="manifestLoadError",e.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",e.MANIFEST_PARSING_ERROR="manifestParsingError",e.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",e.LEVEL_EMPTY_ERROR="levelEmptyError",e.LEVEL_LOAD_ERROR="levelLoadError",e.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",e.LEVEL_PARSING_ERROR="levelParsingError",e.LEVEL_SWITCH_ERROR="levelSwitchError",e.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",e.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",e.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",e.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",e.FRAG_LOAD_ERROR="fragLoadError",e.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",e.FRAG_DECRYPT_ERROR="fragDecryptError",e.FRAG_PARSING_ERROR="fragParsingError",e.FRAG_GAP="fragGap",e.REMUX_ALLOC_ERROR="remuxAllocError",e.KEY_LOAD_ERROR="keyLoadError",e.KEY_LOAD_TIMEOUT="keyLoadTimeOut",e.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",e.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",e.BUFFER_APPEND_ERROR="bufferAppendError",e.BUFFER_APPENDING_ERROR="bufferAppendingError",e.BUFFER_STALLED_ERROR="bufferStalledError",e.BUFFER_FULL_ERROR="bufferFullError",e.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",e.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",e.INTERNAL_EXCEPTION="internalException",e.INTERNAL_ABORTED="aborted",e.UNKNOWN="unknown",e}({}),vl=function(){},bl={trace:vl,debug:vl,log:vl,warn:vl,info:vl,error:vl},Al=bl;function kl(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];i.forEach((function(t){Al[t]=e[t]?e[t].bind(e):function(e){var t=self.console[e];return t?t.bind(self.console,"[".concat(e,"] >")):vl}(t)}))}var _l=Al,wl=/^(\d+)x(\d+)$/,Sl=/(.+?)=(".*?"|.*?)(?:,|$)/g,Tl=function(){function e(t){for(var i in Object(T["a"])(this,e),"string"==typeof t&&(t=e.parseAttrList(t)),t)t.hasOwnProperty(i)&&("X-"===i.substring(0,2)&&(this.clientAttrs=this.clientAttrs||[],this.clientAttrs.push(i)),this[i]=t[i])}return Object(S["a"])(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 i=new Uint8Array(t.length/2),r=0;r<t.length/2;r++)i[r]=parseInt(t.slice(2*r,2*r+2),16);return i}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:"optionalFloat",value:function(e,t){var i=this[e];return i?parseFloat(i):t}},{key:"enumeratedString",value:function(e){return this[e]}},{key:"bool",value:function(e){return"YES"===this[e]}},{key:"decimalResolution",value:function(e){var t=wl.exec(this[e]);if(null!==t)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}}],[{key:"parseAttrList",value:function(e){var t,i={};for(Sl.lastIndex=0;null!==(t=Sl.exec(e));){var r=t[2];0===r.indexOf('"')&&r.lastIndexOf('"')===r.length-1&&(r=r.slice(1,-1)),i[t[1].trim()]=r}return i}}]),e}();function El(e){return"SCTE35-OUT"===e||"SCTE35-IN"===e}var xl=function(){function e(t,i){if(Object(T["a"])(this,e),this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,i){var r=i.attr;for(var a in r)if(Object.prototype.hasOwnProperty.call(t,a)&&t[a]!==r[a]){_l.warn('DATERANGE tag attribute: "'.concat(a,'" does not match for tags with ID: "').concat(t.ID,'"')),this._badValueForSameId=a;break}t=fl(new Tl({}),r,t)}if(this.attr=t,this._startDate=new Date(t["START-DATE"]),"END-DATE"in this.attr){var n=new Date(this.attr["END-DATE"]);pl(n.getTime())&&(this._endDate=n)}}return Object(S["a"])(e,[{key:"id",get:function(){return this.attr.ID}},{key:"class",get:function(){return this.attr.CLASS}},{key:"startDate",get:function(){return this._startDate}},{key:"endDate",get:function(){if(this._endDate)return this._endDate;var e=this.duration;return null!==e?new Date(this._startDate.getTime()+1e3*e):null}},{key:"duration",get:function(){if("DURATION"in this.attr){var e=this.attr.decimalFloatingPoint("DURATION");if(pl(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}},{key:"plannedDuration",get:function(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}},{key:"endOnNext",get:function(){return this.attr.bool("END-ON-NEXT")}},{key:"isValid",get:function(){return!!this.id&&!this._badValueForSameId&&pl(this.startDate.getTime())&&(null===this.duration||this.duration>=0)&&(!this.endOnNext||!!this["class"])}}]),e}(),Cl=Object(S["a"])((function e(){Object(T["a"])(this,e),this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}})),Rl="audio",Ll="video",Dl="audiovideo",Il=function(){function e(t){var i;Object(T["a"])(this,e),this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(i={},Object(f["a"])(i,Rl,null),Object(f["a"])(i,Ll,null),Object(f["a"])(i,Dl,null),i),this.baseurl=t}return Object(S["a"])(e,[{key:"setByteRange",value:function(e,t){var i=e.split("@",2),r=[];1===i.length?r[0]=t?t.byteRangeEndOffset:0:r[0]=parseInt(i[1]),r[1]=parseInt(i[0])+r[0],this._byteRange=r}},{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=ll.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(e){this._url=e}}]),e}(),Pl=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e,r){var a;return Object(T["a"])(this,i),a=t.call(this,r),a._decryptdata=null,a.rawProgramDateTime=null,a.programDateTime=null,a.tagList=[],a.duration=0,a.sn=0,a.levelkeys=void 0,a.type=void 0,a.loader=null,a.keyLoader=null,a.level=-1,a.cc=0,a.startPTS=void 0,a.endPTS=void 0,a.startDTS=void 0,a.endDTS=void 0,a.start=0,a.deltaPTS=void 0,a.maxStartPTS=void 0,a.minEndPTS=void 0,a.stats=new Cl,a.urlId=0,a.data=void 0,a.bitrateTest=!1,a.title=null,a.initSegment=null,a.endList=void 0,a.gap=void 0,a.type=e,a}return Object(S["a"])(i,[{key:"decryptdata",get:function(){var e=this.levelkeys;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){var t=this.levelkeys.identity;if(t)this._decryptdata=t.getDecryptData(this.sn);else{var i=Object.keys(this.levelkeys);if(1===i.length)return this._decryptdata=this.levelkeys[i[0]].getDecryptData(this.sn)}}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(null===this.programDateTime||!pl(this.programDateTime))return null;var e=pl(this.duration)?this.duration:0;return this.programDateTime+1e3*e}},{key:"encrypted",get:function(){var e;if(null!=(e=this._decryptdata)&&e.encrypted)return!0;if(this.levelkeys){var t=Object.keys(this.levelkeys),i=t.length;if(i>1||1===i&&this.levelkeys[t[0]].encrypted)return!0}return!1}},{key:"setKeyFormat",value:function(e){if(this.levelkeys){var t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}},{key:"abortRequests",value:function(){var e,t;null==(e=this.loader)||e.abort(),null==(t=this.keyLoader)||t.abort()}},{key:"setElementaryStreamInfo",value:function(e,t,i,r,a){var n=arguments.length>5&&void 0!==arguments[5]&&arguments[5],s=this.elementaryStreams,o=s[e];o?(o.startPTS=Math.min(o.startPTS,t),o.endPTS=Math.max(o.endPTS,i),o.startDTS=Math.min(o.startDTS,r),o.endDTS=Math.max(o.endDTS,a)):s[e]={startPTS:t,endPTS:i,startDTS:r,endDTS:a,partial:n}}},{key:"clearElementaryStreamInfo",value:function(){var e=this.elementaryStreams;e[Rl]=null,e[Ll]=null,e[Dl]=null}}]),i}(Il),Ol=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e,r,a,n,s){var o;Object(T["a"])(this,i),o=t.call(this,a),o.fragOffset=0,o.duration=0,o.gap=!1,o.independent=!1,o.relurl=void 0,o.fragment=void 0,o.index=void 0,o.stats=new Cl,o.duration=e.decimalFloatingPoint("DURATION"),o.gap=e.bool("GAP"),o.independent=e.bool("INDEPENDENT"),o.relurl=e.enumeratedString("URI"),o.fragment=r,o.index=n;var c=e.enumeratedString("BYTERANGE");return c&&o.setByteRange(c,s),s&&(o.fragOffset=s.fragOffset+s.duration),o}return Object(S["a"])(i,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var e=this.elementaryStreams;return!!(e.audio||e.video||e.audiovideo)}}]),i}(Il),Bl=function(){function e(t){Object(T["a"])(this,e),this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=t}return Object(S["a"])(e,[{key:"reloaded",value:function(e){if(!e)return this.advanced=!0,void(this.updated=!0);var t=this.lastPartSn-e.lastPartSn,i=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!i||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||0===t&&i>0,this.updated||this.advanced?this.misses=Math.floor(.6*e.misses):this.misses=e.misses+1,this.availabilityDelay=e.availabilityDelay}},{key:"hasProgramDateTime",get:function(){return!!this.fragments.length&&pl(this.fragments[this.fragments.length-1].programDateTime)}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||10}},{key:"drift",get:function(){var e=this.driftEndTime-this.driftStartTime;return e>0?1e3*(this.driftEnd-this.driftStart)/e:1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var e;return null!=(e=this.fragments)&&e.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var e;return null!=(e=this.partList)&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),e}();function Ml(e){return Uint8Array.from(atob(e),(function(e){return e.charCodeAt(0)}))}function Fl(e){var t=e.split(":"),i=null;if("data"===t[0]&&2===t.length){var r=t[1].split(";"),a=r[r.length-1].split(",");if(2===a.length){var n="base64"===a[0],s=a[1];n?(r.splice(-1,1),i=Ml(s)):i=function(e){var t=Ul(e).subarray(0,16),i=new Uint8Array(16);return i.set(t,16-t.length),i}(s)}}return i}function Ul(e){return Uint8Array.from(unescape(encodeURIComponent(e)),(function(e){return e.charCodeAt(0)}))}var jl={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},Nl="org.w3.clearkey",zl="com.apple.streamingkeydelivery",Gl="com.microsoft.playready",Hl="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";function Vl(e){switch(e){case zl:return jl.FAIRPLAY;case Gl:return jl.PLAYREADY;case Hl:return jl.WIDEVINE;case Nl:return jl.CLEARKEY}}var Wl="edef8ba979d64acea3c827dcd51d21ed";function ql(e){switch(e){case jl.FAIRPLAY:return zl;case jl.PLAYREADY:return Gl;case jl.WIDEVINE:return Hl;case jl.CLEARKEY:return Nl}}function Kl(e){var t=e.drmSystems,i=e.widevineLicenseUrl,r=t?[jl.FAIRPLAY,jl.WIDEVINE,jl.PLAYREADY,jl.CLEARKEY].filter((function(e){return!!t[e]})):[];return!r[jl.WIDEVINE]&&i&&r.push(jl.WIDEVINE),r}var Jl=("undefined"===typeof self?"undefined":Object(E["a"])(self))<"u"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null;function Yl(e,t,i){return Uint8Array.prototype.slice?e.slice(t,i):new Uint8Array(Array.prototype.slice.call(e,t,i))}var Ql,Xl=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},$l=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},Zl=function(e,t){for(var i=t,r=0;Xl(e,t);)r+=10,r+=eu(e,t+6),$l(e,t+10)&&(r+=10),t+=r;if(r>0)return e.subarray(i,i+r)},eu=function(e,t){var i=0;return i=(127&e[t])<<21,i|=(127&e[t+1])<<14,i|=(127&e[t+2])<<7,i|=127&e[t+3],i},tu=function(e,t){return Xl(e,t)&&eu(e,t+6)+10<=e.length-t},iu=function(e){return e&&"PRIV"===e.key&&"com.apple.streaming.transportStreamTimestamp"===e.info},ru=function(e){var t=String.fromCharCode(e[0],e[1],e[2],e[3]),i=eu(e,4);return{type:t,size:i,data:e.subarray(10,10+i)}},au=function(e){for(var t=0,i=[];Xl(e,t);){var r=eu(e,t+6);t+=10;for(var a=t+r;t+8<a;){var n=ru(e.subarray(t)),s=nu(n);s&&i.push(s),t+=n.size+10}$l(e,t)&&(t+=10)}return i},nu=function(e){return"PRIV"===e.type?su(e):"W"===e.type[0]?cu(e):ou(e)},su=function(e){if(!(e.size<2)){var t=uu(e.data,!0),i=new Uint8Array(e.data.subarray(t.length+1));return{key:e.type,info:t,data:i.buffer}}},ou=function(e){if(!(e.size<2)){if("TXXX"===e.type){var t=1,i=uu(e.data.subarray(t),!0);t+=i.length+1;var r=uu(e.data.subarray(t));return{key:e.type,info:i,data:r}}var a=uu(e.data.subarray(1));return{key:e.type,data:a}}},cu=function(e){if("WXXX"===e.type){if(e.size<2)return;var t=1,i=uu(e.data.subarray(t),!0);t+=i.length+1;var r=uu(e.data.subarray(t));return{key:e.type,info:i,data:r}}var a=uu(e.data);return{key:e.type,data:a}},lu=function(e){if(8===e.data.byteLength){var t=new Uint8Array(e.data),i=1&t[3],r=(t[4]<<23)+(t[5]<<15)+(t[6]<<7)+t[7];return r/=45,i&&(r+=47721858.84),Math.round(r)}},uu=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=du();if(i){var r=i.decode(e);if(t){var a=r.indexOf("\0");return-1!==a?r.substring(0,a):r}return r.replace(/\0/g,"")}for(var n,s,o,c=e.length,l="",u=0;u<c;){if(n=e[u++],0===n&&t)return l;if(0!==n&&3!==n)switch(n>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:l+=String.fromCharCode(n);break;case 12:case 13:s=e[u++],l+=String.fromCharCode((31&n)<<6|63&s);break;case 14:s=e[u++],o=e[u++],l+=String.fromCharCode((15&n)<<12|(63&s)<<6|(63&o)<<0)}}return l};function du(){return Ql||void 0===self.TextDecoder||(Ql=new self.TextDecoder("utf-8")),Ql}var hu=function(e){for(var t="",i=0;i<e.length;i++){var r=e[i].toString(16);r.length<2&&(r="0"+r),t+=r}return t},fu=Math.pow(2,32)-1,pu=[].push,mu={video:1,audio:2,id3:3,text:4};function gu(e){return String.fromCharCode.apply(null,e)}function yu(e,t){var i=e[t]<<8|e[t+1];return i<0?65536+i:i}function vu(e,t){var i=bu(e,t);return i<0?4294967296+i:i}function bu(e,t){return e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function Au(e,t,i){e[t]=i>>24,e[t+1]=i>>16&255,e[t+2]=i>>8&255,e[t+3]=255&i}function ku(e,t){var i=[];if(!t.length)return i;for(var r=e.byteLength,a=0;a<r;){var n=vu(e,a),s=n>1?a+n:r;if(gu(e.subarray(a+4,a+8))===t[0])if(1===t.length)i.push(e.subarray(a+8,s));else{var o=ku(e.subarray(a+8,s),t.slice(1));o.length&&pu.apply(i,o)}a=s}return i}function _u(e){var t=[],i=e[0],r=8,a=vu(e,r);r+=4,r+=0===i?8:16,r+=2;var n=e.length+0,s=yu(e,r);r+=2;for(var o=0;o<s;o++){var c=r,l=vu(e,c);c+=4;var u=2147483647&l;if((2147483648&l)>>>31===1)return _l.warn("SIDX has hierarchical references (not supported)"),null;var d=vu(e,c);c+=4,t.push({referenceSize:u,subsegmentDuration:d,info:{duration:d/a,start:n,end:n+u-1}}),n+=u,c+=4,r=c}return{earliestPresentationTime:0,timescale:a,version:i,referencesCount:s,references:t}}function wu(e){for(var t=[],i=ku(e,["moov","trak"]),r=0;r<i.length;r++){var a=i[r],n=ku(a,["tkhd"])[0];if(n){var s=n[0],o=0===s?12:20,c=vu(n,o),l=ku(a,["mdia","mdhd"])[0];if(l){s=l[0],o=0===s?12:20;var u=vu(l,o),d=ku(a,["mdia","hdlr"])[0];if(d){var h=gu(d.subarray(8,12)),f={soun:Rl,vide:Ll}[h];if(f){var p=ku(a,["mdia","minf","stbl","stsd"])[0],m=void 0;p&&(m=gu(p.subarray(12,16))),t[c]={timescale:u,type:f},t[f]={timescale:u,id:c,codec:m}}}}}}return ku(e,["moov","mvex","trex"]).forEach((function(e){var i=vu(e,4),r=t[i];r&&(r["default"]={duration:vu(e,12),flags:vu(e,20)})})),t}function Su(e){var t=ku(e,["schm"])[0];if(t){var i=gu(t.subarray(4,8));if("cbcs"===i||"cenc"===i)return ku(e,["schi","tenc"])[0]}return _l.error("[eme] missing 'schm' box"),null}function Tu(e){var t=vu(e,0),i=8;1&t&&(i+=4),4&t&&(i+=4);for(var r=0,a=vu(e,4),n=0;n<a;n++)256&t&&(r+=vu(e,i),i+=4),512&t&&(i+=4),1024&t&&(i+=4),2048&t&&(i+=4);return r}function Eu(e,t){var i=new Uint8Array(e.length+t.length);return i.set(e),i.set(t,e.length),i}function xu(e,t){var i=[],r=t.samples,a=t.timescale,n=t.id,s=!1;return ku(r,["moof"]).map((function(o){var c=o.byteOffset-8;ku(o,["traf"]).map((function(o){var l=ku(o,["tfdt"]).map((function(e){var t=e[0],i=vu(e,4);return 1===t&&(i*=Math.pow(2,32),i+=vu(e,8)),i/a}))[0];return void 0!==l&&(e=l),ku(o,["tfhd"]).map((function(l){var u=vu(l,4),d=16777215&vu(l,0),h=0,f=0!=(16&d),p=0,m=0!=(32&d),g=8;u===n&&(1&d&&(g+=8),2&d&&(g+=4),8&d&&(h=vu(l,g),g+=4),f&&(p=vu(l,g),g+=4),m&&(g+=4),"video"===t.type&&(s=function(e){if(!e)return!1;var t=e.indexOf("."),i=t<0?e:e.substring(0,t);return"hvc1"===i||"hev1"===i||"dvh1"===i||"dvhe"===i}(t.codec)),ku(o,["trun"]).map((function(n){var o=n[0],l=16777215&vu(n,0),u=0!=(1&l),d=0,f=0!=(4&l),m=0!=(256&l),g=0,y=0!=(512&l),v=0,b=0!=(1024&l),A=0!=(2048&l),k=0,_=vu(n,4),w=8;u&&(d=vu(n,w),w+=4),f&&(w+=4);for(var S=d+c,T=0;T<_;T++){if(m?(g=vu(n,w),w+=4):g=h,y?(v=vu(n,w),w+=4):v=p,b&&(w+=4),A&&(k=0===o?vu(n,w):bu(n,w),w+=4),t.type===Ll)for(var E=0;E<v;){var x=vu(r,S);S+=4,Cu(s,r[S])&&Ru(r.subarray(S,S+x),s?2:1,e+k/a,i),S+=x,E+=x+4}e+=g/a}})))}))}))})),i}function Cu(e,t){if(e){var i=t>>1&63;return 39===i||40===i}return 6===(31&t)}function Ru(e,t,i,r){var a=Lu(e),n=0;n+=t;for(var s=0,o=0,c=!1,l=0;n<a.length;){s=0;do{if(n>=a.length)break;l=a[n++],s+=l}while(255===l);o=0;do{if(n>=a.length)break;l=a[n++],o+=l}while(255===l);var u=a.length-n;if(!c&&4===s&&n<a.length){if(c=!0,181===a[n++]){var d=yu(a,n);if(n+=2,49===d){var h=vu(a,n);if(n+=4,1195456820===h){var f=a[n++];if(3===f){var p=a[n++],m=31&p,g=64&p,y=g?2+3*m:0,v=new Uint8Array(y);if(g){v[0]=p;for(var b=1;b<y;b++)v[b]=a[n++]}r.push({type:f,payloadType:s,pts:i,bytes:v})}}}}}else if(5===s&&o<u){if(c=!0,o>16){for(var A=[],k=0;k<16;k++){var _=a[n++].toString(16);A.push(1==_.length?"0"+_:_),3!==k&&5!==k&&7!==k&&9!==k||A.push("-")}for(var w=o-16,S=new Uint8Array(w),T=0;T<w;T++)S[T]=a[n++];r.push({payloadType:s,pts:i,uuid:A.join(""),userData:uu(S),userDataBytes:S})}}else if(o<u)n+=o;else if(o>u)break}}function Lu(e){for(var t=e.byteLength,i=[],r=1;r<t-2;)0===e[r]&&0===e[r+1]&&3===e[r+2]?(i.push(r+2),r+=2):r++;if(0===i.length)return e;var a=t-i.length,n=new Uint8Array(a),s=0;for(r=0;r<a;s++,r++)s===i[0]&&(s++,i.shift()),n[r]=e[s];return n}function Du(e,t,i){if(16!==e.byteLength)throw new RangeError("Invalid system id");var r,a,n;if(t){r=1,a=new Uint8Array(16*t.length);for(var s=0;s<t.length;s++){var o=t[s];if(16!==o.byteLength)throw new RangeError("Invalid key");a.set(o,16*s)}}else r=0,a=new Uint8Array;r>0?(n=new Uint8Array(4),t.length>0&&new DataView(n.buffer).setUint32(0,t.length,!1)):n=new Uint8Array;var c=new Uint8Array(4);return i&&i.byteLength>0&&new DataView(c.buffer).setUint32(0,i.byteLength,!1),function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];for(var a=i.length,n=8,s=a;s--;)n+=i[s].byteLength;var o=new Uint8Array(n);for(o[0]=n>>24&255,o[1]=n>>16&255,o[2]=n>>8&255,o[3]=255&n,o.set(e,4),s=0,n=8;s<a;s++)o.set(i[s],n),n+=i[s].byteLength;return o}([112,115,115,104],new Uint8Array([r,0,0,0]),e,n,a,c,i||new Uint8Array)}var Iu={},Pu=function(){function e(t,i,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[1],n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;Object(T["a"])(this,e),this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=t,this.uri=i,this.keyFormat=r,this.keyFormatVersions=a,this.iv=n,this.encrypted=!!t&&"NONE"!==t,this.isCommonEncryption=this.encrypted&&"AES-128"!==t}return Object(S["a"])(e,[{key:"isSupported",value:function(){if(this.method){if("AES-128"===this.method||"NONE"===this.method)return!0;if("identity"===this.keyFormat)return"SAMPLE-AES"===this.method;switch(this.keyFormat){case zl:case Hl:case Gl:case Nl:return-1!==["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)}}return!1}},{key:"getDecryptData",value:function(t){if(!this.encrypted||!this.uri)return null;if("AES-128"===this.method&&this.uri&&!this.iv){"number"!=typeof t&&("AES-128"!==this.method||this.iv||_l.warn('missing IV for initialization segment with method="'.concat(this.method,'" - compliance issue')),t=0);var i=function(e){for(var t=new Uint8Array(16),i=12;i<16;i++)t[i]=e>>8*(15-i)&255;return t}(t);return new e(this.method,this.uri,"identity",this.keyFormatVersions,i)}var r=Fl(this.uri);if(r)switch(this.keyFormat){case Hl:this.pssh=r,r.length>=22&&(this.keyId=r.subarray(r.length-22,r.length-6));break;case Gl:var a=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=Du(a,null,r);var n=new Uint16Array(r.buffer,r.byteOffset,r.byteLength/2),s=String.fromCharCode.apply(null,Array.from(n)),o=s.substring(s.indexOf("<"),s.length),c=(new DOMParser).parseFromString(o,"text/xml").getElementsByTagName("KID")[0];if(c){var l=c.childNodes[0]?c.childNodes[0].nodeValue:c.getAttribute("VALUE");if(l){var u=Ml(l).subarray(0,16);(function(e){var t=function(e,t,i){var r=e[t];e[t]=e[i],e[i]=r};t(e,0,3),t(e,1,2),t(e,4,5),t(e,6,7)})(u),this.keyId=u}}break;default:var d=r.subarray(0,16);if(16!==d.length){var h=new Uint8Array(16);h.set(d,16-d.length),d=h}this.keyId=d;break}if(!this.keyId||16!==this.keyId.byteLength){var f=Iu[this.uri];if(!f){var p=Object.keys(Iu).length%Number.MAX_SAFE_INTEGER;f=new Uint8Array(16),new DataView(f.buffer,12,4).setUint32(0,p),Iu[this.uri]=f}this.keyId=f}return this}}],[{key:"clearKeyUriToKeyIdMap",value:function(){Iu={}}}]),e}(),Ou=/\{\$([a-zA-Z0-9-_]+)\}/g;function Bu(e){return Ou.test(e)}function Mu(e,t,i){if(null!==e.variableList||e.hasVariableRefs)for(var r=i.length;r--;){var a=i[r],n=t[a];n&&(t[a]=Fu(e,n))}}function Fu(e,t){if(null!==e.variableList||e.hasVariableRefs){var i=e.variableList;return t.replace(Ou,(function(t){var r=t.substring(2,t.length-1),a=null==i?void 0:i[r];return void 0===a?(e.playlistParsingError||(e.playlistParsingError=new Error('Missing preceding EXT-X-DEFINE tag for Variable Reference: "'.concat(r,'"'))),t):a}))}return t}function Uu(e,t,i){var r,a,n=e.variableList;if(n||(e.variableList=n={}),"QUERYPARAM"in t){r=t.QUERYPARAM;try{var s=new self.URL(i).searchParams;if(!s.has(r))throw new Error('"'.concat(r,'" does not match any query parameter in URI: "').concat(i,'"'));a=s.get(r)}catch(s){e.playlistParsingError||(e.playlistParsingError=new Error("EXT-X-DEFINE QUERYPARAM: ".concat(s.message)))}}else r=t.NAME,a=t.VALUE;r in n?e.playlistParsingError||(e.playlistParsingError=new Error('EXT-X-DEFINE duplicate Variable Name declarations: "'.concat(r,'"'))):n[r]=a||""}function ju(e,t,i){var r=t.IMPORT;if(i&&r in i){var a=e.variableList;a||(e.variableList=a={}),a[r]=i[r]}else e.playlistParsingError||(e.playlistParsingError=new Error('EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "'.concat(r,'"')))}function Nu(){if(("undefined"===typeof self?"undefined":Object(E["a"])(self))<"u")return self.MediaSource||self.WebKitMediaSource}var zu={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dva1:!0,dvav:!0,dvh1:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}},Gu=Nu();function Hu(e,t){var i;return null!=(i=null==Gu?void 0:Gu.isTypeSupported("".concat(t||"video",'/mp4;codecs="').concat(e,'"')))&&i}var Vu=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,Wu=/#EXT-X-MEDIA:(.*)/g,qu=/^#EXT(?:INF|-X-TARGETDURATION):/m,Ku=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),Ju=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),Yu=function(){function e(){Object(T["a"])(this,e)}return Object(S["a"])(e,null,[{key:"findGroup",value:function(e,t){for(var i=0;i<e.length;i++){var r=e[i];if(r.id===t)return r}}},{key:"convertAVC1ToAVCOTI",value:function(e){var t=e.split(".");if(t.length>2){var i=t.shift()+".";return i+=parseInt(t.shift()).toString(16),i+=("000"+parseInt(t.shift()).toString(16)).slice(-4),i}return e}},{key:"resolve",value:function(e,t){return ll.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}},{key:"isMediaPlaylist",value:function(e){return qu.test(e)}},{key:"parseMasterPlaylist",value:function(t,i){var r,a={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:Bu(t)},n=[];for(Vu.lastIndex=0;null!=(r=Vu.exec(t));)if(r[1]){var s,o=new Tl(r[1]);Mu(a,o,["CODECS","SUPPLEMENTAL-CODECS","ALLOWED-CPC","PATHWAY-ID","STABLE-VARIANT-ID","AUDIO","VIDEO","SUBTITLES","CLOSED-CAPTIONS","NAME"]);var c=Fu(a,r[2]),l={attrs:o,bitrate:o.decimalInteger("AVERAGE-BANDWIDTH")||o.decimalInteger("BANDWIDTH"),name:o.NAME,url:e.resolve(c,i)},u=o.decimalResolution("RESOLUTION");u&&(l.width=u.width,l.height=u.height),$u((o.CODECS||"").split(/[ ,]+/).filter((function(e){return e})),l),l.videoCodec&&-1!==l.videoCodec.indexOf("avc1")&&(l.videoCodec=e.convertAVC1ToAVCOTI(l.videoCodec)),null!=(s=l.unknownCodecs)&&s.length||n.push(l),a.levels.push(l)}else if(r[3]){var d=r[3],h=r[4];switch(d){case"SESSION-DATA":var f=new Tl(h);Mu(a,f,["DATA-ID","LANGUAGE","VALUE","URI"]);var p=f["DATA-ID"];p&&(null===a.sessionData&&(a.sessionData={}),a.sessionData[p]=f);break;case"SESSION-KEY":var m=Qu(h,i,a);m.encrypted&&m.isSupported()?(null===a.sessionKeys&&(a.sessionKeys=[]),a.sessionKeys.push(m)):_l.warn('[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "'.concat(h,'"'));break;case"DEFINE":var g=new Tl(h);Mu(a,g,["NAME","VALUE","QUERYPARAM"]),Uu(a,g,i);break;case"CONTENT-STEERING":var y=new Tl(h);Mu(a,y,["SERVER-URI","PATHWAY-ID"]),a.contentSteering={uri:e.resolve(y["SERVER-URI"],i),pathwayId:y["PATHWAY-ID"]||"."};break;case"START":a.startTimeOffset=Xu(h)}}var v=n.length>0&&n.length<a.levels.length;return a.levels=v?n:a.levels,0===a.levels.length&&(a.playlistParsingError=new Error("no levels found in manifest")),a}},{key:"parseMasterPlaylistMedia",value:function(t,i,r){var a,n={},s=r.levels,o={AUDIO:s.map((function(e){return{id:e.attrs.AUDIO,audioCodec:e.audioCodec}})),SUBTITLES:s.map((function(e){return{id:e.attrs.SUBTITLES,textCodec:e.textCodec}})),"CLOSED-CAPTIONS":[]},c=0;for(Wu.lastIndex=0;null!==(a=Wu.exec(t));){var l=new Tl(a[1]),u=l.TYPE;if(u){var d=o[u],h=n[u]||[];n[u]=h,Mu(r,l,["URI","GROUP-ID","LANGUAGE","ASSOC-LANGUAGE","STABLE-RENDITION-ID","NAME","INSTREAM-ID","CHARACTERISTICS","CHANNELS"]);var f={attrs:l,bitrate:0,id:c++,groupId:l["GROUP-ID"]||"",instreamId:l["INSTREAM-ID"],name:l.NAME||l.LANGUAGE||"",type:u,default:l.bool("DEFAULT"),autoselect:l.bool("AUTOSELECT"),forced:l.bool("FORCED"),lang:l.LANGUAGE,url:l.URI?e.resolve(l.URI,i):""};if(null!=d&&d.length){var p=e.findGroup(d,f.groupId)||d[0];Zu(f,p,"audioCodec"),Zu(f,p,"textCodec")}h.push(f)}}return n}},{key:"parseLevelPlaylist",value:function(e,t,i,r,a,n){var s,o,c,l=new Bl(t),u=l.fragments,d=null,h=0,f=0,p=0,m=0,g=null,y=new Pl(r,t),v=-1,b=!1;for(Ku.lastIndex=0,l.m3u8=e,l.hasVariableRefs=Bu(e);null!==(s=Ku.exec(e));){b&&(b=!1,y=new Pl(r,t),y.start=p,y.sn=h,y.cc=m,y.level=i,d&&(y.initSegment=d,y.rawProgramDateTime=d.rawProgramDateTime,d.rawProgramDateTime=null));var A=s[1];if(A){y.duration=parseFloat(A);var k=(" "+s[2]).slice(1);y.title=k||null,y.tagList.push(k?["INF",A,k]:["INF",A])}else if(s[3]){if(pl(y.duration)){y.start=p,c&&id(y,c,l),y.sn=h,y.level=i,y.cc=m,y.urlId=a,u.push(y);var _=(" "+s[3]).slice(1);y.relurl=Fu(l,_),ed(y,g),g=y,p+=y.duration,h++,f=0,b=!0}}else if(s[4]){var w=(" "+s[4]).slice(1);g?y.setByteRange(w,g):y.setByteRange(w)}else if(s[5])y.rawProgramDateTime=(" "+s[5]).slice(1),y.tagList.push(["PROGRAM-DATE-TIME",y.rawProgramDateTime]),-1===v&&(v=u.length);else{if(s=s[0].match(Ju),!s){_l.warn("No matches on slow regex match for level playlist!");continue}for(o=1;o<s.length&&void 0===s[o];o++);var S=(" "+s[o]).slice(1),T=(" "+s[o+1]).slice(1),E=s[o+2]?(" "+s[o+2]).slice(1):"";switch(S){case"PLAYLIST-TYPE":l.type=T.toUpperCase();break;case"MEDIA-SEQUENCE":h=l.startSN=parseInt(T);break;case"SKIP":var x=new Tl(T);Mu(l,x,["RECENTLY-REMOVED-DATERANGES"]);var C=x.decimalInteger("SKIPPED-SEGMENTS");if(pl(C)){l.skippedSegments=C;for(var R=C;R--;)u.unshift(null);h+=C}var L=x.enumeratedString("RECENTLY-REMOVED-DATERANGES");L&&(l.recentlyRemovedDateranges=L.split("\t"));break;case"TARGETDURATION":l.targetduration=Math.max(parseInt(T),1);break;case"VERSION":l.version=parseInt(T);break;case"EXTM3U":break;case"ENDLIST":l.live=!1;break;case"#":(T||E)&&y.tagList.push(E?[T,E]:[T]);break;case"DISCONTINUITY":m++,y.tagList.push(["DIS"]);break;case"GAP":y.gap=!0,y.tagList.push([S]);break;case"BITRATE":y.tagList.push([S,T]);break;case"DATERANGE":var D=new Tl(T);Mu(l,D,["ID","CLASS","START-DATE","END-DATE","SCTE35-CMD","SCTE35-OUT","SCTE35-IN"]),Mu(l,D,D.clientAttrs);var I=new xl(D,l.dateRanges[D.ID]);I.isValid||l.skippedSegments?l.dateRanges[I.id]=I:_l.warn('Ignoring invalid DATERANGE tag: "'.concat(T,'"')),y.tagList.push(["EXT-X-DATERANGE",T]);break;case"DEFINE":var P=new Tl(T);Mu(l,P,["NAME","VALUE","IMPORT","QUERYPARAM"]),"IMPORT"in P?ju(l,P,n):Uu(l,P,t);break;case"DISCONTINUITY-SEQUENCE":m=parseInt(T);break;case"KEY":var O=Qu(T,t,l);if(O.isSupported()){if("NONE"===O.method){c=void 0;break}c||(c={}),c[O.keyFormat]&&(c=fl({},c)),c[O.keyFormat]=O}else _l.warn('[Keys] Ignoring invalid EXT-X-KEY tag: "'.concat(T,'"'));break;case"START":l.startTimeOffset=Xu(T);break;case"MAP":var B=new Tl(T);if(Mu(l,B,["BYTERANGE","URI"]),y.duration){var M=new Pl(r,t);td(M,B,i,c),d=M,y.initSegment=d,d.rawProgramDateTime&&!y.rawProgramDateTime&&(y.rawProgramDateTime=d.rawProgramDateTime)}else td(y,B,i,c),d=y,b=!0;break;case"SERVER-CONTROL":var F=new Tl(T);l.canBlockReload=F.bool("CAN-BLOCK-RELOAD"),l.canSkipUntil=F.optionalFloat("CAN-SKIP-UNTIL",0),l.canSkipDateRanges=l.canSkipUntil>0&&F.bool("CAN-SKIP-DATERANGES"),l.partHoldBack=F.optionalFloat("PART-HOLD-BACK",0),l.holdBack=F.optionalFloat("HOLD-BACK",0);break;case"PART-INF":var U=new Tl(T);l.partTarget=U.decimalFloatingPoint("PART-TARGET");break;case"PART":var j=l.partList;j||(j=l.partList=[]);var N=f>0?j[j.length-1]:void 0,z=f++,G=new Tl(T);Mu(l,G,["BYTERANGE","URI"]);var H=new Ol(G,y,t,z,N);j.push(H),y.duration+=H.duration;break;case"PRELOAD-HINT":var V=new Tl(T);Mu(l,V,["URI"]),l.preloadHint=V;break;case"RENDITION-REPORT":var W=new Tl(T);Mu(l,W,["URI"]),l.renditionReports=l.renditionReports||[],l.renditionReports.push(W);break;default:_l.warn("line parsed but not handled: ".concat(s))}}}g&&!g.relurl?(u.pop(),p-=g.duration,l.partList&&(l.fragmentHint=g)):l.partList&&(ed(y,g),y.cc=m,l.fragmentHint=y,c&&id(y,c,l));var q=u.length,K=u[0],J=u[q-1];if(p+=l.skippedSegments*l.targetduration,p>0&&q&&J){l.averagetargetduration=p/q;var Y=J.sn;l.endSN="initSegment"!==Y?Y:0,l.live||(J.endList=!0),K&&(l.startCC=K.cc)}else l.endSN=0,l.startCC=0;return l.fragmentHint&&(p+=l.fragmentHint.duration),l.totalduration=p,l.endCC=m,v>0&&function(e,t){for(var i=e[t],r=t;r--;){var a=e[r];if(!a)return;a.programDateTime=i.programDateTime-1e3*a.duration,i=a}}(u,v),l}}]),e}();function Qu(e,t,i){var r,a,n=new Tl(e);Mu(i,n,["KEYFORMAT","KEYFORMATVERSIONS","URI","IV","URI"]);var s=null!=(r=n.METHOD)?r:"",o=n.URI,c=n.hexadecimalInteger("IV"),l=n.KEYFORMATVERSIONS,u=null!=(a=n.KEYFORMAT)?a:"identity";o&&n.IV&&!c&&_l.error("Invalid IV: ".concat(n.IV));var d=o?Yu.resolve(o,t):"",h=(l||"1").split("/").map(Number).filter(Number.isFinite);return new Pu(s,d,u,h,c)}function Xu(e){var t=new Tl(e).decimalFloatingPoint("TIME-OFFSET");return pl(t)?t:null}function $u(e,t){["video","audio","text"].forEach((function(i){var r=e.filter((function(e){return function(e,t){var i=zu[t];return!!i&&!0===i[e.slice(0,4)]}(e,i)}));if(r.length){var a=r.filter((function(e){return 0===e.lastIndexOf("avc1",0)||0===e.lastIndexOf("mp4a",0)}));t["".concat(i,"Codec")]=a.length>0?a[0]:r[0],e=e.filter((function(e){return-1===r.indexOf(e)}))}})),t.unknownCodecs=e}function Zu(e,t,i){var r=t[i];r&&(e[i]=r)}function ed(e,t){e.rawProgramDateTime?e.programDateTime=Date.parse(e.rawProgramDateTime):null!=t&&t.programDateTime&&(e.programDateTime=t.endProgramDateTime),pl(e.programDateTime)||(e.programDateTime=null,e.rawProgramDateTime=null)}function td(e,t,i,r){e.relurl=t.URI,t.BYTERANGE&&e.setByteRange(t.BYTERANGE),e.level=i,e.sn="initSegment",r&&(e.levelkeys=r),e.initSegment=null}function id(e,t,i){e.levelkeys=t;var r=i.encryptedFragments;r.length&&r[r.length-1].levelkeys===t||!Object.keys(t).some((function(e){return t[e].isCommonEncryption}))||r.push(e)}var rd="manifest",ad="level",nd="audioTrack",sd="subtitleTrack",od="main",cd="audio",ld="subtitle";function ud(e){var t=e.type;switch(t){case nd:return cd;case sd:return ld;default:return od}}function dd(e,t){var i=e.url;return void 0!==i&&0!==i.indexOf("data:")||(i=t.url),i}var hd=function(){function e(t){Object(T["a"])(this,e),this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.hls=t,this.registerListeners()}return Object(S["a"])(e,[{key:"startLoad",value:function(e){}},{key:"stopLoad",value:function(){this.destroyInternalLoaders()}},{key:"registerListeners",value:function(){var e=this.hls;e.on(ml.MANIFEST_LOADING,this.onManifestLoading,this),e.on(ml.LEVEL_LOADING,this.onLevelLoading,this),e.on(ml.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(ml.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}},{key:"unregisterListeners",value:function(){var e=this.hls;e.off(ml.MANIFEST_LOADING,this.onManifestLoading,this),e.off(ml.LEVEL_LOADING,this.onLevelLoading,this),e.off(ml.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(ml.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)}},{key:"createInternalLoader",value:function(e){var t=this.hls.config,i=t.pLoader,r=t.loader,a=new(i||r)(t);return this.loaders[e.type]=a,a}},{key:"getInternalLoader",value:function(e){return this.loaders[e.type]}},{key:"resetInternalLoader",value:function(e){this.loaders[e]&&delete this.loaders[e]}},{key:"destroyInternalLoaders",value:function(){for(var e in this.loaders){var t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}},{key:"destroy",value:function(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}},{key:"onManifestLoading",value:function(e,t){var i=t.url;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:rd,url:i,deliveryDirectives:null})}},{key:"onLevelLoading",value:function(e,t){var i=t.id,r=t.level,a=t.url,n=t.deliveryDirectives;this.load({id:i,level:r,responseType:"text",type:ad,url:a,deliveryDirectives:n})}},{key:"onAudioTrackLoading",value:function(e,t){var i=t.id,r=t.groupId,a=t.url,n=t.deliveryDirectives;this.load({id:i,groupId:r,level:null,responseType:"text",type:nd,url:a,deliveryDirectives:n})}},{key:"onSubtitleTrackLoading",value:function(e,t){var i=t.id,r=t.groupId,a=t.url,n=t.deliveryDirectives;this.load({id:i,groupId:r,level:null,responseType:"text",type:sd,url:a,deliveryDirectives:n})}},{key:"load",value:function(e){var t,i,r,a=this,n=this.hls.config,s=this.getInternalLoader(e);if(s){var o=s.context;if(o&&o.url===e.url)return void _l.trace("[playlist-loader]: playlist request ongoing");_l.log("[playlist-loader]: aborting previous loader for type: ".concat(e.type)),s.abort()}if((i=e.type===rd?n.manifestLoadPolicy["default"]:fl({},n.playlistLoadPolicy["default"],{timeoutRetry:null,errorRetry:null}),s=this.createInternalLoader(e),null!=(t=e.deliveryDirectives)&&t.part)&&(e.type===ad&&null!==e.level?r=this.hls.levels[e.level].details:e.type===nd&&null!==e.id?r=this.hls.audioTracks[e.id].details:e.type===sd&&null!==e.id&&(r=this.hls.subtitleTracks[e.id].details),r)){var c=r.partTarget,l=r.targetduration;if(c&&l){var u=1e3*Math.max(3*c,.8*l);i=fl({},i,{maxTimeToFirstByteMs:Math.min(u,i.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(u,i.maxTimeToFirstByteMs)})}}var d=i.errorRetry||i.timeoutRetry||{},h={loadPolicy:i,timeout:i.maxLoadTimeMs,maxRetry:d.maxNumRetry||0,retryDelay:d.retryDelayMs||0,maxRetryDelay:d.maxRetryDelayMs||0},f={onSuccess:function(e,t,i,r){var n=a.getInternalLoader(i);a.resetInternalLoader(i.type);var s=e.data;0===s.indexOf("#EXTM3U")?(t.parsing.start=performance.now(),Yu.isMediaPlaylist(s)?a.handleTrackOrLevelPlaylist(e,t,i,r||null,n):a.handleMasterPlaylist(e,t,i,r)):a.handleManifestParsingError(e,i,new Error("no EXTM3U delimiter"),r||null,t)},onError:function(e,t,i,r){a.handleNetworkError(t,i,!1,e,r)},onTimeout:function(e,t,i){a.handleNetworkError(t,i,!0,void 0,e)}};s.load(e,h,f)}},{key:"handleMasterPlaylist",value:function(e,t,i,r){var a=this.hls,n=e.data,s=dd(e,i),o=Yu.parseMasterPlaylist(n,s);if(o.playlistParsingError)this.handleManifestParsingError(e,i,o.playlistParsingError,r,t);else{var c=o.contentSteering,l=o.levels,u=o.sessionData,d=o.sessionKeys,h=o.startTimeOffset,f=o.variableList;this.variableList=f;var p=Yu.parseMasterPlaylistMedia(n,s,o),m=p.AUDIO,g=void 0===m?[]:m,y=p.SUBTITLES,v=p["CLOSED-CAPTIONS"];g.length&&(g.some((function(e){return!e.url}))||!l[0].audioCodec||l[0].attrs.AUDIO||(_l.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),g.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new Tl({}),bitrate:0,url:""}))),a.trigger(ml.MANIFEST_LOADED,{levels:l,audioTracks:g,subtitles:y,captions:v,contentSteering:c,url:s,stats:t,networkDetails:r,sessionData:u,sessionKeys:d,startTimeOffset:h,variableList:f})}}},{key:"handleTrackOrLevelPlaylist",value:function(e,t,i,r,a){var n=this.hls,s=i.id,o=i.level,c=i.type,l=dd(e,i),u=pl(s)?s:0,d=pl(o)?o:u,h=ud(i),f=Yu.parseLevelPlaylist(e.data,l,d,h,u,this.variableList);if(c===rd){var p={attrs:new Tl({}),bitrate:0,details:f,name:"",url:l};n.trigger(ml.MANIFEST_LOADED,{levels:[p],audioTracks:[],url:l,stats:t,networkDetails:r,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),i.levelDetails=f,this.handlePlaylistLoaded(f,e,t,i,r,a)}},{key:"handleManifestParsingError",value:function(e,t,i,r,a){this.hls.trigger(ml.ERROR,{type:gl.NETWORK_ERROR,details:yl.MANIFEST_PARSING_ERROR,fatal:t.type===rd,url:e.url,err:i,error:i,reason:i.message,response:e,context:t,networkDetails:r,stats:a})}},{key:"handleNetworkError",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0,n="A network ".concat(i?"timeout":"error"+(r?" (status "+r.code+")":"")," occurred while loading ").concat(e.type);e.type===ad?n+=": ".concat(e.level," id: ").concat(e.id):e.type!==nd&&e.type!==sd||(n+=" id: ".concat(e.id,' group-id: "').concat(e.groupId,'"'));var s=new Error(n);_l.warn("[playlist-loader]: ".concat(n));var o=yl.UNKNOWN,c=!1,l=this.getInternalLoader(e);switch(e.type){case rd:o=i?yl.MANIFEST_LOAD_TIMEOUT:yl.MANIFEST_LOAD_ERROR,c=!0;break;case ad:o=i?yl.LEVEL_LOAD_TIMEOUT:yl.LEVEL_LOAD_ERROR,c=!1;break;case nd:o=i?yl.AUDIO_TRACK_LOAD_TIMEOUT:yl.AUDIO_TRACK_LOAD_ERROR,c=!1;break;case sd:o=i?yl.SUBTITLE_TRACK_LOAD_TIMEOUT:yl.SUBTITLE_LOAD_ERROR,c=!1}l&&this.resetInternalLoader(e.type);var u={type:gl.NETWORK_ERROR,details:o,fatal:c,url:e.url,loader:l,context:e,error:s,networkDetails:t,stats:a};if(r){var d=(null==t?void 0:t.url)||e.url;u.response=dl({url:d,data:void 0},r)}this.hls.trigger(ml.ERROR,u)}},{key:"handlePlaylistLoaded",value:function(e,t,i,r,a,n){var s=this.hls,o=r.type,c=r.level,l=r.id,u=r.groupId,d=r.deliveryDirectives,h=dd(t,r),f=ud(r),p="number"==typeof r.level&&f===od?c:void 0;if(e.fragments.length){e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));var m=e.playlistParsingError;if(m)s.trigger(ml.ERROR,{type:gl.NETWORK_ERROR,details:yl.LEVEL_PARSING_ERROR,fatal:!1,url:h,error:m,reason:m.message,response:t,context:r,level:p,parent:f,networkDetails:a,stats:i});else switch(e.live&&n&&(n.getCacheAge&&(e.ageHeader=n.getCacheAge()||0),n.getCacheAge&&!isNaN(e.ageHeader)||(e.ageHeader=0)),o){case rd:case ad:s.trigger(ml.LEVEL_LOADED,{details:e,level:p||0,id:l||0,stats:i,networkDetails:a,deliveryDirectives:d});break;case nd:s.trigger(ml.AUDIO_TRACK_LOADED,{details:e,id:l||0,groupId:u||"",stats:i,networkDetails:a,deliveryDirectives:d});break;case sd:s.trigger(ml.SUBTITLE_TRACK_LOADED,{details:e,id:l||0,groupId:u||"",stats:i,networkDetails:a,deliveryDirectives:d})}}else{var g=new Error("No Segments found in Playlist");s.trigger(ml.ERROR,{type:gl.NETWORK_ERROR,details:yl.LEVEL_EMPTY_ERROR,fatal:!1,url:h,error:g,reason:g.message,response:t,context:r,level:p,parent:f,networkDetails:a,stats:i})}}}]),e}();function fd(e,t){var i;try{i=new Event("addtrack")}catch(r){i=document.createEvent("Event"),i.initEvent("addtrack",!1,!1)}i.track=e,t.dispatchEvent(i)}function pd(e,t){var i=e.mode;if("disabled"===i&&(e.mode="hidden"),e.cues&&!e.cues.getCueById(t.id))try{if(e.addCue(t),!e.cues.getCueById(t.id))throw new Error("addCue is failed for: ".concat(t))}catch(a){_l.debug("[texttrack-utils]: ".concat(a));try{var r=new self.TextTrackCue(t.startTime,t.endTime,t.text);r.id=t.id,e.addCue(r)}catch(r){_l.debug("[texttrack-utils]: Legacy TextTrackCue fallback failed: ".concat(r))}}"disabled"===i&&(e.mode=i)}function md(e){var t=e.mode;if("disabled"===t&&(e.mode="hidden"),e.cues)for(var i=e.cues.length;i--;)e.removeCue(e.cues[i]);"disabled"===t&&(e.mode=t)}function gd(e,t,i,r){var a=e.mode;if("disabled"===a&&(e.mode="hidden"),e.cues&&e.cues.length>0)for(var n=function(e,t,i){var r=[],a=function(e,t){if(t<e[0].startTime)return 0;var i=e.length-1;if(t>e[i].endTime)return-1;for(var r=0,a=i;r<=a;){var n=Math.floor((a+r)/2);if(t<e[n].startTime)a=n-1;else{if(!(t>e[n].startTime&&r<i))return n;r=n+1}}return e[r].startTime-t<t-e[a].startTime?r:a}(e,t);if(a>-1)for(var n=a,s=e.length;n<s;n++){var o=e[n];if(o.startTime>=t&&o.endTime<=i)r.push(o);else if(o.startTime>i)return r}return r}(e.cues,t,i),s=0;s<n.length;s++)r&&!r(n[s])||e.removeCue(n[s]);"disabled"===a&&(e.mode=a)}var yd="org.id3",vd="com.apple.quicktime.HLS",bd="https://aomedia.org/emsg/ID3";function Ad(){if(("undefined"===typeof self?"undefined":Object(E["a"])(self))<"u")return self.WebKitDataCue||self.VTTCue||self.TextTrackCue}var kd=function(){var e=Ad();try{new e(0,Number.POSITIVE_INFINITY,"")}catch(t){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY}();function _d(e,t){return e.getTime()/1e3-t}var wd=function(){function e(t){Object(T["a"])(this,e),this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=t,this._registerListeners()}return Object(S["a"])(e,[{key:"destroy",value:function(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null}},{key:"_registerListeners",value:function(){var e=this.hls;e.on(ml.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(ml.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(ml.MANIFEST_LOADING,this.onManifestLoading,this),e.on(ml.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(ml.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(ml.LEVEL_UPDATED,this.onLevelUpdated,this)}},{key:"_unregisterListeners",value:function(){var e=this.hls;e.off(ml.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(ml.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(ml.MANIFEST_LOADING,this.onManifestLoading,this),e.off(ml.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(ml.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(ml.LEVEL_UPDATED,this.onLevelUpdated,this)}},{key:"onMediaAttached",value:function(e,t){this.media=t.media}},{key:"onMediaDetaching",value:function(){this.id3Track&&(md(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})}},{key:"onManifestLoading",value:function(){this.dateRangeCuesAppended={}}},{key:"createTrack",value:function(e){var t=this.getID3Track(e.textTracks);return t.mode="hidden",t}},{key:"getID3Track",value:function(e){if(this.media){for(var t=0;t<e.length;t++){var i=e[t];if("metadata"===i.kind&&"id3"===i.label)return fd(i,this.media),i}return this.media.addTextTrack("metadata","id3")}}},{key:"onFragParsingMetadata",value:function(e,t){if(this.media){var i=this.hls.config,r=i.enableEmsgMetadataCues,a=i.enableID3MetadataCues;if(r||a){var n=t.samples;this.id3Track||(this.id3Track=this.createTrack(this.media));for(var s=Ad(),o=0;o<n.length;o++){var c=n[o].type;if((c!==bd||r)&&a){var l=au(n[o].data);if(l){var u=n[o].pts,d=u+n[o].duration;d>kd&&(d=kd),d-u<=0&&(d=u+.25);for(var h=0;h<l.length;h++){var f=l[h];if(!iu(f)){this.updateId3CueEnds(u,c);var p=new s(u,d,"");p.value=f,c&&(p.type=c),this.id3Track.addCue(p)}}}}}}}}},{key:"updateId3CueEnds",value:function(e,t){var i,r=null==(i=this.id3Track)?void 0:i.cues;if(r)for(var a=r.length;a--;){var n=r[a];n.type===t&&n.startTime<e&&n.endTime===kd&&(n.endTime=e)}}},{key:"onBufferFlushing",value:function(e,t){var i=t.startOffset,r=t.endOffset,a=t.type,n=this.id3Track,s=this.hls;if(s){var o,c=s.config,l=c.enableEmsgMetadataCues,u=c.enableID3MetadataCues;if(n&&(l||u))o="audio"===a?function(e){return e.type===yd&&u}:"video"===a?function(e){return e.type===bd&&l}:function(e){return e.type===yd&&u||e.type===bd&&l},gd(n,i,r,o)}}},{key:"onLevelUpdated",value:function(e,t){var i=this,r=t.details;if(this.media&&r.hasProgramDateTime&&this.hls.config.enableDateRangeMetadataCues){var a=this.dateRangeCuesAppended,n=this.id3Track,s=r.dateRanges,o=Object.keys(s);if(n)for(var c=Object.keys(a).filter((function(e){return!o.includes(e)})),l=function(e){var t=c[e];Object.keys(a[t].cues).forEach((function(e){n.removeCue(a[t].cues[e])})),delete a[t]},u=c.length;u--;)l(u);var d=r.fragments[r.fragments.length-1];if(0!==o.length&&pl(null==d?void 0:d.programDateTime)){this.id3Track||(this.id3Track=this.createTrack(this.media));for(var h,f,p=d.programDateTime/1e3-d.start,m=Ad(),g=function(e){var t=o[e],r=s[t],n=a[t],c=(null==n?void 0:n.cues)||{},l=(null==n?void 0:n.durationKnown)||!1,u=_d(r.startDate,p),d=kd,g=r.endDate;if(g)d=_d(g,p),l=!0;else if(r.endOnNext&&!l){var y=o.reduce((function(e,t){var i=s[t];return i["class"]===r["class"]&&i.id!==t&&i.startDate>r.startDate&&e.push(i),e}),[]).sort((function(e,t){return e.startDate.getTime()-t.startDate.getTime()}))[0];y&&(d=_d(y.startDate,p),l=!0)}for(var v=Object.keys(r.attr),b=0;b<v.length;b++){var A=v[b];if("ID"!==(f=A)&&"CLASS"!==f&&"START-DATE"!==f&&"DURATION"!==f&&"END-DATE"!==f&&"END-ON-NEXT"!==f){var k=c[A];if(k)l&&!n.durationKnown&&(k.endTime=d);else{var _=r.attr[A];k=new m(u,d,""),El(A)&&(h=_,_=Uint8Array.from(h.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer),k.value={key:A,data:_},k.type=vd,k.id=t,i.id3Track.addCue(k),c[A]=k}}}a[t]={cues:c,dateRange:r,durationKnown:l}},y=0;y<o.length;y++)g(y)}}}}]),e}(),Sd=function(){function e(t){var i=this;Object(T["a"])(this,e),this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return i.timeupdate()},this.hls=t,this.config=t.config,this.registerListeners()}return Object(S["a"])(e,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var e=this.config,t=this.levelDetails;return void 0!==e.liveMaxLatencyDuration?e.liveMaxLatencyDuration:t?e.liveMaxLatencyDurationCount*t.targetduration:0}},{key:"targetLatency",get:function(){var e=this.levelDetails;if(null===e)return null;var t=e.holdBack,i=e.partHoldBack,r=e.targetduration,a=this.config,n=a.liveSyncDuration,s=a.liveSyncDurationCount,o=a.lowLatencyMode,c=this.hls.userConfig,l=o&&i||t;(c.liveSyncDuration||c.liveSyncDurationCount||0===l)&&(l=void 0!==n?n:s*r);var u=r;return l+Math.min(1*this.stallCount,u)}},{key:"liveSyncPosition",get:function(){var e=this.estimateLiveEdge(),t=this.targetLatency,i=this.levelDetails;if(null===e||null===t||null===i)return null;var r=i.edge,a=e-t-this.edgeStalled,n=r-i.totalduration,s=r-(this.config.lowLatencyMode&&i.partTarget||i.targetduration);return Math.min(Math.max(n,a),s)}},{key:"drift",get:function(){var e=this.levelDetails;return null===e?1:e.drift}},{key:"edgeStalled",get:function(){var e=this.levelDetails;if(null===e)return 0;var t=3*(this.config.lowLatencyMode&&e.partTarget||e.targetduration);return Math.max(e.age-t,0)}},{key:"forwardBufferLength",get:function(){var e=this.media,t=this.levelDetails;if(!e||!t)return 0;var i=e.buffered.length;return(i?e.buffered.end(i-1):t.edge)-this.currentTime}},{key:"destroy",value:function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null}},{key:"registerListeners",value:function(){this.hls.on(ml.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(ml.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(ml.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(ml.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(ml.ERROR,this.onError,this)}},{key:"unregisterListeners",value:function(){this.hls.off(ml.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(ml.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.off(ml.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(ml.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.off(ml.ERROR,this.onError,this)}},{key:"onMediaAttached",value:function(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)}},{key:"onMediaDetaching",value:function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)}},{key:"onManifestLoading",value:function(){this.levelDetails=null,this._latency=null,this.stallCount=0}},{key:"onLevelUpdated",value:function(e,t){var i=t.details;this.levelDetails=i,i.advanced&&this.timeupdate(),!i.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)}},{key:"onError",value:function(e,t){var i;t.details===yl.BUFFER_STALLED_ERROR&&(this.stallCount++,null!=(i=this.levelDetails)&&i.live&&_l.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))}},{key:"timeupdate",value:function(){var e=this.media,t=this.levelDetails;if(e&&t){this.currentTime=e.currentTime;var i=this.computeLatency();if(null!==i){this._latency=i;var r=this.config,a=r.lowLatencyMode,n=r.maxLiveSyncPlaybackRate;if(a&&1!==n){var s=this.targetLatency;if(null!==s){var o=i-s,c=o<Math.min(this.maxLatency,s+t.targetduration);if(t.live&&c&&o>.05&&this.forwardBufferLength>1){var l=Math.min(2,Math.max(1,n)),u=Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20;e.playbackRate=Math.min(l,Math.max(1,u))}else 1!==e.playbackRate&&0!==e.playbackRate&&(e.playbackRate=1)}}}}}},{key:"estimateLiveEdge",value:function(){var e=this.levelDetails;return null===e?null:e.edge+e.age}},{key:"computeLatency",value:function(){var e=this.estimateLiveEdge();return null===e?null:e-this.currentTime}}]),e}(),Td=["NONE","TYPE-0","TYPE-1",null],Ed="",xd="YES",Cd="v2",Rd=function(){function e(t,i,r){Object(T["a"])(this,e),this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=t,this.part=i,this.skip=r}return Object(S["a"])(e,[{key:"addDirectives",value:function(e){var t=new self.URL(e);return void 0!==this.msn&&t.searchParams.set("_HLS_msn",this.msn.toString()),void 0!==this.part&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}]),e}(),Ld=function(){function e(t){Object(T["a"])(this,e),this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[t.url],this._attrs=[t.attrs],this.bitrate=t.bitrate,t.details&&(this.details=t.details),this.id=t.id||0,this.name=t.name,this.width=t.width||0,this.height=t.height||0,this.audioCodec=t.audioCodec,this.videoCodec=t.videoCodec,this.unknownCodecs=t.unknownCodecs,this.codecSet=[t.videoCodec,t.audioCodec].filter((function(e){return e})).join(",").replace(/\.[^.,]+/g,"")}return Object(S["a"])(e,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"attrs",get:function(){return this._attrs[this._urlId]}},{key:"pathwayId",get:function(){return this.attrs["PATHWAY-ID"]||"."}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(e){var t=e%this.url.length;this._urlId!==t&&(this.fragmentError=0,this.loadError=0,this.details=void 0,this._urlId=t)}},{key:"audioGroupId",get:function(){var e;return null==(e=this.audioGroupIds)?void 0:e[this.urlId]}},{key:"textGroupId",get:function(){var e;return null==(e=this.textGroupIds)?void 0:e[this.urlId]}},{key:"addFallback",value:function(e){this.url.push(e.url),this._attrs.push(e.attrs)}}]),e}();function Dd(e,t){var i=t.startPTS;if(pl(i)){var r,a=0;t.sn>e.sn?(a=i-e.start,r=e):(a=e.start-i,r=t),r.duration!==a&&(r.duration=a)}else t.sn>e.sn?e.cc===t.cc&&e.minEndPTS?t.start=e.start+(e.minEndPTS-e.start):t.start=e.start+e.duration:t.start=Math.max(e.start-t.duration,0)}function Id(e,t,i,r,a,n){r-i<=0&&(_l.warn("Fragment should have a positive duration",t),r=i+t.duration,n=a+t.duration);var s=i,o=r,c=t.startPTS,l=t.endPTS;if(pl(c)){var u=Math.abs(c-i);pl(t.deltaPTS)?t.deltaPTS=Math.max(u,t.deltaPTS):t.deltaPTS=u,s=Math.max(i,c),i=Math.min(i,c),a=Math.min(a,t.startDTS),o=Math.min(r,l),r=Math.max(r,l),n=Math.max(n,t.endDTS)}var d=i-t.start;0!==t.start&&(t.start=i),t.duration=r-t.start,t.startPTS=i,t.maxStartPTS=s,t.startDTS=a,t.endPTS=r,t.minEndPTS=o,t.endDTS=n;var h,f=t.sn;if(!e||f<e.startSN||f>e.endSN)return 0;var p=f-e.startSN,m=e.fragments;for(m[p]=t,h=p;h>0;h--)Dd(m[h],m[h-1]);for(h=p;h<m.length-1;h++)Dd(m[h],m[h+1]);return e.fragmentHint&&Dd(m[m.length-1],e.fragmentHint),e.PTSKnown=e.alignedSliding=!0,d}function Pd(e,t){for(var i=null,r=e.fragments,a=r.length-1;a>=0;a--){var n=r[a].initSegment;if(n){i=n;break}}e.fragmentHint&&delete e.fragmentHint.endPTS;var s,o=0;if(function(e,t,i){for(var r=t.skippedSegments,a=Math.max(e.startSN,t.startSN)-t.startSN,n=(e.fragmentHint?1:0)+(r?t.endSN:Math.min(e.endSN,t.endSN))-t.startSN,s=t.startSN-e.startSN,o=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,c=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,l=a;l<=n;l++){var u=c[s+l],d=o[l];r&&!d&&l<r&&(d=t.fragments[l]=u),u&&d&&i(u,d)}}(e,t,(function(e,r){e.relurl&&(o=e.cc-r.cc),pl(e.startPTS)&&pl(e.endPTS)&&(r.start=r.startPTS=e.startPTS,r.startDTS=e.startDTS,r.maxStartPTS=e.maxStartPTS,r.endPTS=e.endPTS,r.endDTS=e.endDTS,r.minEndPTS=e.minEndPTS,r.duration=e.endPTS-e.startPTS,r.duration&&(s=r),t.PTSKnown=t.alignedSliding=!0),r.elementaryStreams=e.elementaryStreams,r.loader=e.loader,r.stats=e.stats,r.urlId=e.urlId,e.initSegment&&(r.initSegment=e.initSegment,i=e.initSegment)})),i&&(t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments).forEach((function(e){var t;e.initSegment&&e.initSegment.relurl!==(null==(t=i)?void 0:t.relurl)||(e.initSegment=i)})),t.skippedSegments)if(t.deltaUpdateFailed=t.fragments.some((function(e){return!e})),t.deltaUpdateFailed){_l.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var c=t.skippedSegments;c--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}else t.canSkipDateRanges&&(t.dateRanges=function(e,t,i){var r=fl({},e);return i&&i.forEach((function(e){delete r[e]})),Object.keys(t).forEach((function(e){var i=new xl(t[e].attr,r[e]);i.isValid?r[e]=i:_l.warn('Ignoring invalid Playlist Delta Update DATERANGE tag: "'.concat(JSON.stringify(t[e].attr),'"'))})),r}(e.dateRanges,t.dateRanges,t.recentlyRemovedDateranges));var l=t.fragments;if(o){_l.warn("discontinuity sliding from playlist, take drift into account");for(var u=0;u<l.length;u++)l[u].cc+=o}t.skippedSegments&&(t.startCC=t.fragments[0].cc),function(e,t,i){if(e&&t)for(var r=0,a=0,n=e.length;a<=n;a++){var s=e[a],o=t[a+r];s&&o&&s.index===o.index&&s.fragment.sn===o.fragment.sn?i(s,o):r--}}(e.partList,t.partList,(function(e,t){t.elementaryStreams=e.elementaryStreams,t.stats=e.stats})),s?Id(t,s,s.startPTS,s.endPTS,s.startDTS,s.endDTS):Od(e,t),l.length&&(t.totalduration=t.edge-l[0].start),t.driftStartTime=e.driftStartTime,t.driftStart=e.driftStart;var d=t.advancedDateTime;if(t.advanced&&d){var h=t.edge;t.driftStart||(t.driftStartTime=d,t.driftStart=h),t.driftEndTime=d,t.driftEnd=h}else t.driftEndTime=e.driftEndTime,t.driftEnd=e.driftEnd,t.advancedDateTime=e.advancedDateTime}function Od(e,t){var i=t.startSN+t.skippedSegments-e.startSN,r=e.fragments;i<0||i>=r.length||Bd(t,r[i].start)}function Bd(e,t){if(t){for(var i=e.fragments,r=e.skippedSegments;r<i.length;r++)i[r].start+=t;e.fragmentHint&&(e.fragmentHint.start+=t)}}function Md(e,t,i){var r;return null!=e&&e.details?Fd(null==(r=e.details)?void 0:r.partList,t,i):null}function Fd(e,t,i){if(e)for(var r=e.length;r--;){var a=e[r];if(a.index===i&&a.fragment.sn===t)return a}return null}function Ud(e){switch(e.details){case yl.FRAG_LOAD_TIMEOUT:case yl.KEY_LOAD_TIMEOUT:case yl.LEVEL_LOAD_TIMEOUT:case yl.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function jd(e,t){var i=Ud(t);return e["default"][(i?"timeout":"error")+"Retry"]}function Nd(e,t){var i="linear"===e.backoff?1:Math.pow(2,t);return Math.min(i*e.retryDelayMs,e.maxRetryDelayMs)}function zd(e){return dl(dl({},e),{errorRetry:null,timeoutRetry:null})}function Gd(e,t,i,r){return!!e&&t<e.maxNumRetry&&(function(e){return 0===e&&!1===navigator.onLine||!!e&&(e<400||e>499)}(r)||!!i)}var Hd=function(e,t){for(var i=0,r=e.length-1,a=null,n=null;i<=r;){a=(i+r)/2|0,n=e[a];var s=t(n);if(s>0)i=a+1;else{if(!(s<0))return n;r=a-1}}return null};function Vd(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=null;if(e?a=t[e.sn-t[0].sn+1]||null:0===i&&0===t[0].start&&(a=t[0]),a&&0===Wd(i,r,a))return a;var n=Hd(t,Wd.bind(null,i,r));return!n||n===e&&a?a:n}function Wd(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2?arguments[2]:void 0;if(i.start<=e&&i.start+i.duration>e)return 0;var r=Math.min(t,i.duration+(i.deltaPTS?i.deltaPTS:0));return i.start+i.duration-r<=e?1:i.start-r>e&&i.start?-1:0}function qd(e,t,i){var r=1e3*Math.min(t,i.duration+(i.deltaPTS?i.deltaPTS:0));return(i.endProgramDateTime||0)-r>e}var Kd=0,Jd=2,Yd=5,Qd=0,Xd=1,$d=2;function Zd(e,t,i){if(performance.now()-e.lastErrorPerfMs>3e5)return!0;var r=e.details;if(t.details===yl.FRAG_GAP&&r&&t.frag){var a=t.frag.start,n=Vd(null,r.fragments,a);if(n&&!n.gap)return!0}if(i&&e.errors.length<i.errors.length){var s=e.errors[e.errors.length-1];if(r&&s.frag&&t.frag&&Math.abs(s.frag.start-t.frag.start)>3*r.targetduration)return!0}return!1}var eh,th=function(){function e(t,i){Object(T["a"])(this,e),this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.log=void 0,this.warn=void 0,this.log=_l.log.bind(_l,"".concat(i,":")),this.warn=_l.warn.bind(_l,"".concat(i,":")),this.hls=t}return Object(S["a"])(e,[{key:"destroy",value:function(){this.clearTimer(),this.hls=this.log=this.warn=null}},{key:"clearTimer",value:function(){clearTimeout(this.timer),this.timer=-1}},{key:"startLoad",value:function(){this.canLoad=!0,this.requestScheduled=-1,this.loadPlaylist()}},{key:"stopLoad",value:function(){this.canLoad=!1,this.clearTimer()}},{key:"switchParams",value:function(e,t){var i=null==t?void 0:t.renditionReports;if(i){for(var r=-1,a=0;a<i.length;a++){var n=i[a],s=void 0;try{s=new self.URL(n.URI,t.url).href}catch(u){_l.warn("Could not construct new URL for Rendition Report: ".concat(u)),s=n.URI||""}if(s===e){r=a;break}s===e.substring(0,s.length)&&(r=a)}if(-1!==r){var o=i[r],c=parseInt(o["LAST-MSN"])||(null==t?void 0:t.lastPartSn),l=parseInt(o["LAST-PART"])||(null==t?void 0:t.lastPartIndex);if(this.hls.config.lowLatencyMode){var u=Math.min(t.age-t.partTarget,t.targetduration);l>=0&&u>t.partTarget&&(l+=1)}return new Rd(c,l>=0?l:void 0,Ed)}}}},{key:"loadPlaylist",value:function(e){-1===this.requestScheduled&&(this.requestScheduled=self.performance.now())}},{key:"shouldLoadPlaylist",value:function(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}},{key:"shouldReloadPlaylist",value:function(e){return-1===this.timer&&-1===this.requestScheduled&&this.shouldLoadPlaylist(e)}},{key:"playlistLoaded",value:function(e,t,i){var r=this,a=t.details,n=t.stats,s=self.performance.now(),o=n.loading.first?Math.max(0,s-n.loading.first):0;if(a.advancedDateTime=Date.now()-o,a.live||null!=i&&i.live){if(a.reloaded(i),i&&this.log("live playlist ".concat(e," ").concat(a.advanced?"REFRESHED "+a.lastPartSn+"-"+a.lastPartIndex:a.updated?"UPDATED":"MISSED")),i&&a.fragments.length>0&&Pd(i,a),!this.canLoad||!a.live)return;var c,l,u;if(a.canBlockReload&&a.endSN&&a.advanced){var d=this.hls.config.lowLatencyMode,h=a.lastPartSn,f=a.endSN,p=a.lastPartIndex,m=h===f,g=d?0:p;-1!==p?(l=m?f+1:h,u=m?g:p+1):l=f+1;var y=a.age,v=y+a.ageHeader,b=Math.min(v-a.partTarget,1.5*a.targetduration);if(b>0){if(i&&b>i.tuneInGoal)this.warn("CDN Tune-in goal increased from: ".concat(i.tuneInGoal," to: ").concat(b," with playlist age: ").concat(a.age)),b=0;else{var A=Math.floor(b/a.targetduration);l+=A,void 0!==u&&(u+=Math.round(b%a.targetduration/a.partTarget)),this.log("CDN Tune-in age: ".concat(a.ageHeader,"s last advanced ").concat(y.toFixed(2),"s goal: ").concat(b," skip sn ").concat(A," to part ").concat(u))}a.tuneInGoal=b}if(c=this.getDeliveryDirectives(a,t.deliveryDirectives,l,u),d||!m)return void this.loadPlaylist(c)}else(a.canBlockReload||a.canSkipUntil)&&(c=this.getDeliveryDirectives(a,t.deliveryDirectives,l,u));var k=this.hls.mainForwardBufferInfo,_=k?k.end-k.len:0,w=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,i=1e3*e.targetduration;if(e.updated){var r=e.fragments,a=4;if(r.length&&i*a>t){var n=1e3*r[r.length-1].duration;n<i&&(i=n)}}else i/=2;return Math.round(i)}(a,1e3*(a.edge-_));a.updated&&s>this.requestScheduled+w&&(this.requestScheduled=n.loading.start),void 0!==l&&a.canBlockReload?this.requestScheduled=n.loading.first+w-(1e3*a.partTarget||1e3):-1===this.requestScheduled||this.requestScheduled+w<s?this.requestScheduled=s:this.requestScheduled-s<=0&&(this.requestScheduled+=w);var S=this.requestScheduled-s;S=Math.max(0,S),this.log("reload live playlist ".concat(e," in ").concat(Math.round(S)," ms")),this.timer=self.setTimeout((function(){return r.loadPlaylist(c)}),S)}else this.clearTimer()}},{key:"getDeliveryDirectives",value:function(e,t,i,r){var a=function(e,t){var i=e.canSkipUntil,r=e.canSkipDateRanges,a=e.endSN;return i&&(void 0!==t?t-a:0)<i?r?Cd:xd:Ed}(e,i);return null!=t&&t.skip&&e.deltaUpdateFailed&&(i=t.msn,r=t.part,a=Ed),new Rd(i,r,a)}},{key:"checkRetry",value:function(e){var t=this,i=e.details,r=Ud(e),a=e.errorAction,n=a||{},s=n.action,o=n.retryCount,c=void 0===o?0:o,l=n.retryConfig,u=!!a&&!!l&&(s===Yd||!a.resolved&&s===Jd);if(u){var d;if(this.requestScheduled=-1,c>=l.maxNumRetry)return!1;if(r&&null!=(d=e.context)&&d.deliveryDirectives)this.warn("Retrying playlist loading ".concat(c+1,"/").concat(l.maxNumRetry,' after "').concat(i,'" without delivery-directives')),this.loadPlaylist();else{var h=Nd(l,c);this.timer=self.setTimeout((function(){return t.loadPlaylist()}),h),this.warn("Retrying playlist loading ".concat(c+1,"/").concat(l.maxNumRetry,' after "').concat(i,'" in ').concat(h,"ms"))}e.levelRetry=!0,a.resolved=!0}return u}}]),e}(),ih=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e,r){var a;return Object(T["a"])(this,i),a=t.call(this,e,"[level-controller]"),a._levels=[],a._firstLevel=-1,a._startLevel=void 0,a.currentLevel=null,a.currentLevelIndex=-1,a.manualLevelIndex=-1,a.steering=void 0,a.onParsedComplete=void 0,a.steering=r,a._registerListeners(),a}return Object(S["a"])(i,[{key:"_registerListeners",value:function(){var e=this.hls;e.on(ml.MANIFEST_LOADING,this.onManifestLoading,this),e.on(ml.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(ml.LEVEL_LOADED,this.onLevelLoaded,this),e.on(ml.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(ml.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(ml.FRAG_LOADED,this.onFragLoaded,this),e.on(ml.ERROR,this.onError,this)}},{key:"_unregisterListeners",value:function(){var e=this.hls;e.off(ml.MANIFEST_LOADING,this.onManifestLoading,this),e.off(ml.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(ml.LEVEL_LOADED,this.onLevelLoaded,this),e.off(ml.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(ml.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(ml.FRAG_LOADED,this.onFragLoaded,this),e.off(ml.ERROR,this.onError,this)}},{key:"destroy",value:function(){this._unregisterListeners(),this.steering=null,this.resetLevels(),k(Object(b["a"])(i.prototype),"destroy",this).call(this)}},{key:"startLoad",value:function(){this._levels.forEach((function(e){e.loadError=0,e.fragmentError=0})),k(Object(b["a"])(i.prototype),"startLoad",this).call(this)}},{key:"resetLevels",value:function(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[]}},{key:"onManifestLoading",value:function(e,t){this.resetLevels()}},{key:"onManifestLoaded",value:function(e,t){var i,r=[],a={};t.levels.forEach((function(e){var t,n=e.attrs;-1!==(null==(t=e.audioCodec)?void 0:t.indexOf("mp4a.40.34"))&&(eh||(eh=/chrome|firefox/i.test(navigator.userAgent)),eh&&(e.audioCodec=void 0));var s=n.AUDIO,o=n.CODECS,c=n["FRAME-RATE"],l=n["PATHWAY-ID"],u=n.RESOLUTION,d=n.SUBTITLES,h="".concat("".concat(l||".","-"),e.bitrate,"-").concat(u,"-").concat(c,"-").concat(o);i=a[h],i?i.addFallback(e):(i=new Ld(e),a[h]=i,r.push(i)),rh(i,"audio",s),rh(i,"text",d)})),this.filterAndSortMediaOptions(r,t)}},{key:"filterAndSortMediaOptions",value:function(e,t){var i=this,r=[],a=[],n=!1,s=!1,o=!1,c=e.filter((function(e){var t=e.audioCodec,i=e.videoCodec,r=e.width,a=e.height,c=e.unknownCodecs;return n||(n=!(!r||!a)),s||(s=!!i),o||(o=!!t),!(null!=c&&c.length)&&(!t||Hu(t,"audio"))&&(!i||Hu(i,"video"))}));if((n||s)&&o&&(c=c.filter((function(e){var t=e.videoCodec,i=e.width,r=e.height;return!!t||!(!i||!r)}))),0!==c.length){t.audioTracks&&(r=t.audioTracks.filter((function(e){return!e.audioCodec||Hu(e.audioCodec,"audio")})),ah(r)),t.subtitles&&(a=t.subtitles,ah(a));var l=c.slice(0);c.sort((function(e,t){return e.attrs["HDCP-LEVEL"]!==t.attrs["HDCP-LEVEL"]?(e.attrs["HDCP-LEVEL"]||"")>(t.attrs["HDCP-LEVEL"]||"")?1:-1:e.bitrate!==t.bitrate?e.bitrate-t.bitrate:e.attrs["FRAME-RATE"]!==t.attrs["FRAME-RATE"]?e.attrs.decimalFloatingPoint("FRAME-RATE")-t.attrs.decimalFloatingPoint("FRAME-RATE"):e.attrs.SCORE!==t.attrs.SCORE?e.attrs.decimalFloatingPoint("SCORE")-t.attrs.decimalFloatingPoint("SCORE"):n&&e.height!==t.height?e.height-t.height:0}));var u=l[0];if(this.steering&&(c=this.steering.filterParsedLevels(c),c.length!==l.length))for(var d=0;d<l.length;d++)if(l[d].pathwayId===c[0].pathwayId){u=l[d];break}this._levels=c;for(var h=0;h<c.length;h++)if(c[h]===u){this._firstLevel=h,this.log("manifest loaded, ".concat(c.length," level(s) found, first bitrate: ").concat(u.bitrate));break}var f=o&&!s,p={levels:c,audioTracks:r,subtitleTracks:a,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:o,video:s,altAudio:!f&&r.some((function(e){return!!e.url}))};this.hls.trigger(ml.MANIFEST_PARSED,p),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else Promise.resolve().then((function(){if(i.hls){var e=new Error("no level with compatible codecs found in manifest");i.hls.trigger(ml.ERROR,{type:gl.MEDIA_ERROR,details:yl.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:e,reason:e.message})}}))}},{key:"levels",get:function(){return 0===this._levels.length?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(e){var t=this._levels;if(0!==t.length){if(e<0||e>=t.length){var i=new Error("invalid level idx"),r=e<0;if(this.hls.trigger(ml.ERROR,{type:gl.OTHER_ERROR,details:yl.LEVEL_SWITCH_ERROR,level:e,fatal:r,error:i,reason:i.message}),r)return;e=Math.min(e,t.length-1)}var a=this.currentLevelIndex,n=this.currentLevel,s=n?n.attrs["PATHWAY-ID"]:void 0,o=t[e],c=o.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=o,a!==e||!o.details||!n||s!==c){this.log("Switching to level ".concat(e).concat(c?" with Pathway "+c:""," from level ").concat(a).concat(s?" with Pathway "+s:""));var l=fl({},o,{level:e,maxBitrate:o.maxBitrate,attrs:o.attrs,uri:o.uri,urlId:o.urlId});delete l._attrs,delete l._urlId,this.hls.trigger(ml.LEVEL_SWITCHING,l);var u=o.details;if(!u||u.live){var d=this.switchParams(o.uri,null==n?void 0:n.details);this.loadPlaylist(d)}}}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(e){this.manualLevelIndex=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:"onError",value:function(e,t){!t.fatal&&t.context&&t.context.type===ad&&t.context.level===this.level&&this.checkRetry(t)}},{key:"onFragLoaded",value:function(e,t){var i=t.frag;if(void 0!==i&&i.type===od){var r=this._levels[i.level];void 0!==r&&(r.loadError=0)}}},{key:"onLevelLoaded",value:function(e,t){var i,r,a=t.level,n=t.details,s=this._levels[a];if(!s)return this.warn("Invalid level index ".concat(a)),void(null!=(r=t.deliveryDirectives)&&r.skip&&(n.deltaUpdateFailed=!0));a===this.currentLevelIndex?(0===s.fragmentError&&(s.loadError=0),this.playlistLoaded(a,t,s.details)):null!=(i=t.deliveryDirectives)&&i.skip&&(n.deltaUpdateFailed=!0)}},{key:"onAudioTrackSwitched",value:function(e,t){var i=this.currentLevel;if(i){var r=this.hls.audioTracks[t.id].groupId;if(i.audioGroupIds&&i.audioGroupId!==r){for(var a=-1,n=0;n<i.audioGroupIds.length;n++)if(i.audioGroupIds[n]===r){a=n;break}-1!==a&&a!==i.urlId&&(i.urlId=a,this.canLoad&&this.startLoad())}}}},{key:"loadPlaylist",value:function(e){k(Object(b["a"])(i.prototype),"loadPlaylist",this).call(this);var t=this.currentLevelIndex,r=this.currentLevel;if(r&&this.shouldLoadPlaylist(r)){var a=r.urlId,n=r.uri;if(e)try{n=e.addDirectives(n)}catch(o){this.warn("Could not construct new URL with HLS Delivery Directives: ".concat(o))}var s=r.attrs["PATHWAY-ID"];this.log("Loading level index ".concat(t).concat(void 0!==(null==e?void 0:e.msn)?" at sn "+e.msn+" part "+e.part:""," with").concat(s?" Pathway "+s:""," URI ").concat(a+1,"/").concat(r.url.length," ").concat(n)),this.clearTimer(),this.hls.trigger(ml.LEVEL_LOADING,{url:n,level:t,id:a,deliveryDirectives:e||null})}}},{key:"nextLoadLevel",get:function(){return-1!==this.manualLevelIndex?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(e){this.level=e,-1===this.manualLevelIndex&&(this.hls.nextAutoLevel=e)}},{key:"removeLevel",value:function(e,t){var i=this,r=function(e,i){return i!==t},a=this._levels.filter((function(a,n){return n!==e||(a.url.length>1&&void 0!==t?(a.url=a.url.filter(r),a.audioGroupIds&&(a.audioGroupIds=a.audioGroupIds.filter(r)),a.textGroupIds&&(a.textGroupIds=a.textGroupIds.filter(r)),a.urlId=0,!0):(i.steering&&i.steering.removeLevel(a),!1))}));this.hls.trigger(ml.LEVELS_UPDATED,{levels:a})}},{key:"onLevelsUpdated",value:function(e,t){var i=t.levels;i.forEach((function(e,t){var i=e.details;null!=i&&i.fragments&&i.fragments.forEach((function(e){e.level=t}))})),this._levels=i}}]),i}(th);function rh(e,t,i){i&&("audio"===t?(e.audioGroupIds||(e.audioGroupIds=[]),e.audioGroupIds[e.url.length-1]=i):"text"===t&&(e.textGroupIds||(e.textGroupIds=[]),e.textGroupIds[e.url.length-1]=i))}function ah(e){var t={};e.forEach((function(e){var i=e.groupId||"";e.id=t[i]=t[i]||0,t[i]++}))}var nh="NOT_LOADED",sh="APPENDING",oh="PARTIAL",ch="OK",lh=function(){function e(t){Object(T["a"])(this,e),this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=t,this._registerListeners()}return Object(S["a"])(e,[{key:"_registerListeners",value:function(){var e=this.hls;e.on(ml.BUFFER_APPENDED,this.onBufferAppended,this),e.on(ml.FRAG_BUFFERED,this.onFragBuffered,this),e.on(ml.FRAG_LOADED,this.onFragLoaded,this)}},{key:"_unregisterListeners",value:function(){var e=this.hls;e.off(ml.BUFFER_APPENDED,this.onBufferAppended,this),e.off(ml.FRAG_BUFFERED,this.onFragBuffered,this),e.off(ml.FRAG_LOADED,this.onFragLoaded,this)}},{key:"destroy",value:function(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}},{key:"getAppendedFrag",value:function(e,t){var i=this.activePartLists[t];if(i)for(var r=i.length;r--;){var a=i[r];if(!a)break;var n=a.end;if(a.start<=e&&null!==n&&e<=n)return a}return this.getBufferedFrag(e,t)}},{key:"getBufferedFrag",value:function(e,t){for(var i=this.fragments,r=Object.keys(i),a=r.length;a--;){var n=i[r[a]];if((null==n?void 0:n.body.type)===t&&n.buffered){var s=n.body;if(s.start<=e&&e<=s.end)return s}}return null}},{key:"detectEvictedFragments",value:function(e,t,i,r){var a=this;this.timeRanges&&(this.timeRanges[e]=t);var n=(null==r?void 0:r.fragment.sn)||-1;Object.keys(this.fragments).forEach((function(r){var s=a.fragments[r];if(s&&!(n>=s.body.sn))if(s.buffered||s.loaded){var o=s.range[e];o&&o.time.some((function(e){var i=!a.isTimeBuffered(e.startPTS,e.endPTS,t);return i&&a.removeFragment(s.body),i}))}else s.body.type===i&&a.removeFragment(s.body)}))}},{key:"detectPartialFragments",value:function(e){var t=this,i=this.timeRanges,r=e.frag,a=e.part;if(i&&"initSegment"!==r.sn){var n=dh(r),s=this.fragments[n];if(!(!s||s.buffered&&r.gap)){var o=!r.relurl;Object.keys(i).forEach((function(e){var n=r.elementaryStreams[e];if(n){var c=i[e],l=o||!0===n.partial;s.range[e]=t.getBufferedTimes(r,a,l,c)}})),s.loaded=null,Object.keys(s.range).length?(s.buffered=!0,(s.body.endList=r.endList||s.body.endList)&&(this.endListFragments[s.body.type]=s),uh(s)||this.removeParts(r.sn-1,r.type)):this.removeFragment(s.body)}}}},{key:"removeParts",value:function(e,t){var i=this.activePartLists[t];i&&(this.activePartLists[t]=i.filter((function(t){return t.fragment.sn>=e})))}},{key:"fragBuffered",value:function(e,t){var i=dh(e),r=this.fragments[i];!r&&t&&(r=this.fragments[i]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),r&&(r.loaded=null,r.buffered=!0)}},{key:"getBufferedTimes",value:function(e,t,i,r){for(var a={time:[],partial:i},n=e.start,s=e.end,o=e.minEndPTS||s,c=e.maxStartPTS||n,l=0;l<r.length;l++){var u=r.start(l)-this.bufferPadding,d=r.end(l)+this.bufferPadding;if(c>=u&&o<=d){a.time.push({startPTS:Math.max(n,r.start(l)),endPTS:Math.min(s,r.end(l))});break}if(n<d&&s>u)a.partial=!0,a.time.push({startPTS:Math.max(n,r.start(l)),endPTS:Math.min(s,r.end(l))});else if(s<=u)break}return a}},{key:"getPartialFragment",value:function(e){var t,i,r,a=null,n=0,s=this.bufferPadding,o=this.fragments;return Object.keys(o).forEach((function(c){var l=o[c];l&&uh(l)&&(i=l.body.start-s,r=l.body.end+s,e>=i&&e<=r&&(t=Math.min(e-i,r-e),n<=t&&(a=l.body,n=t)))})),a}},{key:"isEndListAppended",value:function(e){var t=this.endListFragments[e];return void 0!==t&&(t.buffered||uh(t))}},{key:"getState",value:function(e){var t=dh(e),i=this.fragments[t];return i?i.buffered?uh(i)?oh:ch:sh:nh}},{key:"isTimeBuffered",value:function(e,t,i){for(var r,a,n=0;n<i.length;n++){if(r=i.start(n)-this.bufferPadding,a=i.end(n)+this.bufferPadding,e>=r&&t<=a)return!0;if(t<=r)return!1}return!1}},{key:"onFragLoaded",value:function(e,t){var i=t.frag,r=t.part;if("initSegment"!==i.sn&&!i.bitrateTest){var a=r?null:t,n=dh(i);this.fragments[n]={body:i,appendedPTS:null,loaded:a,buffered:!1,range:Object.create(null)}}}},{key:"onBufferAppended",value:function(e,t){var i=this,r=t.frag,a=t.part,n=t.timeRanges;if("initSegment"!==r.sn){var s=r.type;if(a){var o=this.activePartLists[s];o||(this.activePartLists[s]=o=[]),o.push(a)}this.timeRanges=n,Object.keys(n).forEach((function(e){var t=n[e];i.detectEvictedFragments(e,t,s,a)}))}}},{key:"onFragBuffered",value:function(e,t){this.detectPartialFragments(t)}},{key:"hasFragment",value:function(e){var t=dh(e);return!!this.fragments[t]}},{key:"hasParts",value:function(e){var t;return!(null==(t=this.activePartLists[e])||!t.length)}},{key:"removeFragmentsInRange",value:function(e,t,i,r,a){var n=this;r&&!this.hasGaps||Object.keys(this.fragments).forEach((function(s){var o=n.fragments[s];if(o){var c=o.body;c.type!==i||r&&!c.gap||c.start<t&&c.end>e&&(o.buffered||a)&&n.removeFragment(c)}}))}},{key:"removeFragment",value:function(e){var t=dh(e);e.stats.loaded=0,e.clearElementaryStreamInfo();var i=this.activePartLists[e.type];if(i){var r=e.sn;this.activePartLists[e.type]=i.filter((function(e){return e.fragment.sn!==r}))}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}},{key:"removeAllFragments",value:function(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1}}]),e}();function uh(e){var t,i,r;return e.buffered&&(e.body.gap||(null==(t=e.range.video)?void 0:t.partial)||(null==(i=e.range.audio)?void 0:i.partial)||(null==(r=e.range.audiovideo)?void 0:r.partial))}function dh(e){return"".concat(e.type,"_").concat(e.level,"_").concat(e.urlId,"_").concat(e.sn)}var hh=Math.pow(2,17),fh=function(){function e(t){Object(T["a"])(this,e),this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=t}return Object(S["a"])(e,[{key:"destroy",value:function(){this.loader&&(this.loader.destroy(),this.loader=null)}},{key:"abort",value:function(){this.loader&&this.loader.abort()}},{key:"load",value:function(e,t){var i=this,r=e.url;if(!r)return Promise.reject(new gh({type:gl.NETWORK_ERROR,details:yl.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error("Fragment does not have a "+(r?"part list":"url")),networkDetails:null}));this.abort();var a=this.config,n=a.fLoader,s=a.loader;return new Promise((function(o,c){if(i.loader&&i.loader.destroy(),e.gap){if(e.tagList.some((function(e){return"GAP"===e[0]})))return void c(mh(e));e.gap=!1}var l=i.loader=e.loader=n?new n(a):new s(a),u=ph(e),d=zd(a.fragLoadPolicy["default"]),h={loadPolicy:d,timeout:d.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:"initSegment"===e.sn?1/0:hh};e.stats=l.stats,l.load(u,h,{onSuccess:function(t,r,a,n){i.resetLoader(e,l);var s=t.data;a.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(s.slice(0,16)),s=s.slice(16)),o({frag:e,part:null,payload:s,networkDetails:n})},onError:function(t,a,n,s){i.resetLoader(e,l),c(new gh({type:gl.NETWORK_ERROR,details:yl.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:dl({url:r,data:void 0},t),error:new Error("HTTP Error ".concat(t.code," ").concat(t.text)),networkDetails:n,stats:s}))},onAbort:function(t,r,a){i.resetLoader(e,l),c(new gh({type:gl.NETWORK_ERROR,details:yl.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:a,stats:t}))},onTimeout:function(t,r,a){i.resetLoader(e,l),c(new gh({type:gl.NETWORK_ERROR,details:yl.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error("Timeout after ".concat(h.timeout,"ms")),networkDetails:a,stats:t}))},onProgress:function(i,r,a,n){t&&t({frag:e,part:null,payload:a,networkDetails:n})}})}))}},{key:"loadPart",value:function(e,t,i){var r=this;this.abort();var a=this.config,n=a.fLoader,s=a.loader;return new Promise((function(o,c){if(r.loader&&r.loader.destroy(),e.gap||t.gap)c(mh(e,t));else{var l=r.loader=e.loader=n?new n(a):new s(a),u=ph(e,t),d=zd(a.fragLoadPolicy["default"]),h={loadPolicy:d,timeout:d.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:hh};t.stats=l.stats,l.load(u,h,{onSuccess:function(a,n,s,c){r.resetLoader(e,l),r.updateStatsFromPart(e,t);var u={frag:e,part:t,payload:a.data,networkDetails:c};i(u),o(u)},onError:function(i,a,n,s){r.resetLoader(e,l),c(new gh({type:gl.NETWORK_ERROR,details:yl.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:dl({url:u.url,data:void 0},i),error:new Error("HTTP Error ".concat(i.code," ").concat(i.text)),networkDetails:n,stats:s}))},onAbort:function(i,a,n){e.stats.aborted=t.stats.aborted,r.resetLoader(e,l),c(new gh({type:gl.NETWORK_ERROR,details:yl.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:n,stats:i}))},onTimeout:function(i,a,n){r.resetLoader(e,l),c(new gh({type:gl.NETWORK_ERROR,details:yl.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error("Timeout after ".concat(h.timeout,"ms")),networkDetails:n,stats:i}))}})}}))}},{key:"updateStatsFromPart",value:function(e,t){var i=e.stats,r=t.stats,a=r.total;if(i.loaded+=r.loaded,a){var n=Math.round(e.duration/t.duration),s=Math.min(Math.round(i.loaded/a),n),o=(n-s)*Math.round(i.loaded/s);i.total=i.loaded+o}else i.total=Math.max(i.loaded,i.total);var c=i.loading,l=r.loading;c.start?c.first+=l.first-l.start:(c.start=l.start,c.first=l.first),c.end=l.end}},{key:"resetLoader",value:function(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}]),e}();function ph(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=t||e,r={frag:e,part:t,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},a=i.byteRangeStartOffset,n=i.byteRangeEndOffset;if(pl(a)&&pl(n)){var s,o=a,c=n;if("initSegment"===e.sn&&"AES-128"===(null==(s=e.decryptdata)?void 0:s.method)){var l=n-a;l%16&&(c=n+(16-l%16)),0!==a&&(r.resetIV=!0,o=a-16)}r.rangeStart=o,r.rangeEnd=c}return r}function mh(e,t){var i=new Error("GAP ".concat(e.gap?"tag":"attribute"," found")),r={type:gl.MEDIA_ERROR,details:yl.FRAG_GAP,fatal:!1,frag:e,error:i,networkDetails:null};return t&&(r.part=t),(t||e).stats.aborted=!0,new gh(r)}var gh=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e.error.message),r.data=void 0,r.data=e,r}return Object(S["a"])(i)}(Object(y["a"])(Error)),yh=function(){function e(t){Object(T["a"])(this,e),this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=t}return Object(S["a"])(e,[{key:"abort",value:function(e){for(var t in this.keyUriToKeyInfo){var i=this.keyUriToKeyInfo[t].loader;if(i){if(e&&e!==i.context.frag.type)return;i.abort()}}}},{key:"detach",value:function(){for(var e in this.keyUriToKeyInfo){var t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}},{key:"destroy",value:function(){for(var e in this.detach(),this.keyUriToKeyInfo){var t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}},{key:"createKeyLoadError",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:yl.KEY_LOAD_ERROR,i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,a=arguments.length>4?arguments[4]:void 0;return new gh({type:gl.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:a,error:i,networkDetails:r})}},{key:"loadClear",value:function(e,t){var i=this;if(this.emeController&&this.config.emeEnabled)for(var r=e.sn,a=e.cc,n=function(e){var n=t[e];if(a<=n.cc&&("initSegment"===r||"initSegment"===n.sn||r<n.sn))return i.emeController.selectKeySystemFormat(n).then((function(e){n.setKeyFormat(e)})),"break"},s=0;s<t.length;s++){var o=n(s);if("break"===o)break}}},{key:"load",value:function(e){var t=this;return!e.decryptdata&&e.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(e).then((function(i){return t.loadInternal(e,i)})):this.loadInternal(e)}},{key:"loadInternal",value:function(e,t){var i,r;t&&e.setKeyFormat(t);var a=e.decryptdata;if(!a){var n=new Error(t?"Expected frag.decryptdata to be defined after setting format ".concat(t):"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,yl.KEY_LOAD_ERROR,n))}var s=a.uri;if(!s)return Promise.reject(this.createKeyLoadError(e,yl.KEY_LOAD_ERROR,new Error('Invalid key URI: "'.concat(s,'"'))));var o,c=this.keyUriToKeyInfo[s];if(null!=(i=c)&&i.decryptdata.key)return a.key=c.decryptdata.key,Promise.resolve({frag:e,keyInfo:c});if(null!=(r=c)&&r.keyLoadPromise)switch(null==(o=c.mediaKeySessionContext)?void 0:o.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return c.keyLoadPromise.then((function(t){return a.key=t.keyInfo.decryptdata.key,{frag:e,keyInfo:c}}))}switch(c=this.keyUriToKeyInfo[s]={decryptdata:a,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},a.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return"identity"===a.keyFormat?this.loadKeyHTTP(c,e):this.loadKeyEME(c,e);case"AES-128":return this.loadKeyHTTP(c,e);default:return Promise.reject(this.createKeyLoadError(e,yl.KEY_LOAD_ERROR,new Error('Key supplied with unsupported METHOD: "'.concat(a.method,'"'))))}}},{key:"loadKeyEME",value:function(e,t){var i={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){var r=this.emeController.loadKey(i);if(r)return(e.keyLoadPromise=r.then((function(t){return e.mediaKeySessionContext=t,i})))["catch"]((function(t){throw e.keyLoadPromise=null,t}))}return Promise.resolve(i)}},{key:"loadKeyHTTP",value:function(e,t){var i=this,r=this.config,a=new r.loader(r);return t.keyLoader=e.loader=a,e.keyLoadPromise=new Promise((function(n,s){var o={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},c=r.keyLoadPolicy["default"],l={loadPolicy:c,timeout:c.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},u={onSuccess:function(e,t,r,a){var o=r.frag,c=r.keyInfo,l=r.url;if(!o.decryptdata||c!==i.keyUriToKeyInfo[l])return s(i.createKeyLoadError(o,yl.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),a));c.decryptdata.key=o.decryptdata.key=new Uint8Array(e.data),o.keyLoader=null,c.loader=null,n({frag:o,keyInfo:c})},onError:function(e,r,a,n){i.resetLoader(r),s(i.createKeyLoadError(t,yl.KEY_LOAD_ERROR,new Error("HTTP Error ".concat(e.code," loading key ").concat(e.text)),a,dl({url:o.url,data:void 0},e)))},onTimeout:function(e,r,a){i.resetLoader(r),s(i.createKeyLoadError(t,yl.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),a))},onAbort:function(e,r,a){i.resetLoader(r),s(i.createKeyLoadError(t,yl.INTERNAL_ABORTED,new Error("key loading aborted"),a))}};a.load(o,l,u)}))}},{key:"resetLoader",value:function(e){var t=e.frag,i=e.keyInfo,r=e.url,a=i.loader;t.keyLoader===a&&(t.keyLoader=null,i.loader=null),delete this.keyUriToKeyInfo[r],a&&a.destroy()}}]),e}(),vh=function(){function e(){Object(T["a"])(this,e),this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}return Object(S["a"])(e,[{key:"destroy",value:function(){this.onHandlerDestroying(),this.onHandlerDestroyed()}},{key:"onHandlerDestroying",value:function(){this.clearNextTick(),this.clearInterval()}},{key:"onHandlerDestroyed",value:function(){}},{key:"hasInterval",value:function(){return!!this._tickInterval}},{key:"hasNextTick",value:function(){return!!this._tickTimer}},{key:"setInterval",value:function(e){return!this._tickInterval&&(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}},{key:"clearInterval",value:function(){return!!this._tickInterval&&(self.clearInterval(this._tickInterval),this._tickInterval=null,!0)}},{key:"clearNextTick",value:function(){return!!this._tickTimer&&(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0)}},{key:"tick",value:function(){this._tickCallCount++,1===this._tickCallCount&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}},{key:"tickImmediate",value:function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}},{key:"doTick",value:function(){}}]),e}(),bh={length:0,start:function(){return 0},end:function(){return 0}},Ah=function(){function e(){Object(T["a"])(this,e)}return Object(S["a"])(e,null,[{key:"isBuffered",value:function(t,i){try{if(t)for(var r=e.getBuffered(t),a=0;a<r.length;a++)if(i>=r.start(a)&&i<=r.end(a))return!0}catch(n){}return!1}},{key:"bufferInfo",value:function(t,i,r){try{if(t){var a,n=e.getBuffered(t),s=[];for(a=0;a<n.length;a++)s.push({start:n.start(a),end:n.end(a)});return this.bufferedInfo(s,i,r)}}catch(o){}return{len:0,start:i,end:i,nextStart:void 0}}},{key:"bufferedInfo",value:function(e,t,i){t=Math.max(0,t),e.sort((function(e,t){return e.start-t.start||t.end-e.end}));var r=[];if(i)for(var a=0;a<e.length;a++){var n=r.length;if(n){var s=r[n-1].end;e[a].start-s<i?e[a].end>s&&(r[n-1].end=e[a].end):r.push(e[a])}else r.push(e[a])}else r=e;for(var o,c=0,l=t,u=t,d=0;d<r.length;d++){var h=r[d].start,f=r[d].end;if(t+i>=h&&t<f)l=h,u=f,c=u-t;else if(t+i<h){o=h;break}}return{len:c,start:l||0,end:u||0,nextStart:o}}},{key:"getBuffered",value:function(e){try{return e.buffered}catch(t){return _l.log("failed to get media.buffered",t),bh}}}]),e}(),kh=Object(S["a"])((function e(t,i,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,s=arguments.length>5&&void 0!==arguments[5]&&arguments[5];Object(T["a"])(this,e),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing={start:0,executeStart:0,executeEnd:0,end:0},this.buffering={audio:{start:0,executeStart:0,executeEnd:0,end:0},video:{start:0,executeStart:0,executeEnd:0,end:0},audiovideo:{start:0,executeStart:0,executeEnd:0,end:0}},this.level=t,this.sn=i,this.id=r,this.size=a,this.part=n,this.partial=s}));function _h(e,t){for(var i=null,r=0,a=e.length;r<a;r++){var n=e[r];if(n&&n.cc===t){i=n;break}}return i}function wh(e,t){if(e){var i=e.start+t;e.start=e.startPTS=i,e.endPTS=i+e.duration}}function Sh(e,t){for(var i=t.fragments,r=0,a=i.length;r<a;r++)wh(i[r],e);t.fragmentHint&&wh(t.fragmentHint,e),t.alignedSliding=!0}function Th(e,t,i){t&&(function(e,t,i){if(function(e,t,i){return!(!t.details||!(i.endCC>i.startCC||e&&e.cc<i.startCC))}(e,i,t)){var r=function(e,t){var i=e.fragments,r=t.fragments;if(r.length&&i.length){var a=_h(i,r[0].cc);if(a&&(!a||a.startPTS))return a;_l.log("No frag in previous level to align on")}else _l.log("No fragments to align")}(i.details,t);r&&pl(r.start)&&(_l.log("Adjusting PTS using last level due to CC increase within current level ".concat(t.url)),Sh(r.start,t))}}(e,i,t),!i.alignedSliding&&t.details&&function(e,t){if(t.fragments.length&&e.hasProgramDateTime&&t.hasProgramDateTime){var i=t.fragments[0].programDateTime,r=e.fragments[0].programDateTime,a=(r-i)/1e3+t.fragments[0].start;a&&pl(a)&&(_l.log("Adjusting PTS using programDateTime delta ".concat(r-i,"ms, sliding:").concat(a.toFixed(3)," ").concat(e.url," ")),Sh(a,e))}}(i,t.details),i.alignedSliding||!t.details||i.skippedSegments||Od(t.details,i))}function Eh(e,t){if(e.hasProgramDateTime&&t.hasProgramDateTime){var i=e.fragments,r=t.fragments;if(i.length&&r.length){var a=r[Math.round(r.length/2)-1],n=_h(i,a.cc)||i[Math.round(i.length/2)-1],s=a.programDateTime,o=n.programDateTime;null===s||null===o||Sh((o-s)/1e3-(n.start-a.start),e)}}}var xh=function(){function e(t,i){Object(T["a"])(this,e),this.subtle=void 0,this.aesIV=void 0,this.subtle=t,this.aesIV=i}return Object(S["a"])(e,[{key:"decrypt",value:function(e,t){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e)}}]),e}(),Ch=function(){function e(t,i){Object(T["a"])(this,e),this.subtle=void 0,this.key=void 0,this.subtle=t,this.key=i}return Object(S["a"])(e,[{key:"expandKey",value:function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])}}]),e}(),Rh=function(){function e(){Object(T["a"])(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.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}return Object(S["a"])(e,[{key:"uint8ArrayToUint32Array_",value:function(e){for(var t=new DataView(e),i=new Uint32Array(4),r=0;r<4;r++)i[r]=t.getUint32(4*r);return i}},{key:"initTable",value:function(){var e=this.sBox,t=this.invSBox,i=this.subMix,r=i[0],a=i[1],n=i[2],s=i[3],o=this.invSubMix,c=o[0],l=o[1],u=o[2],d=o[3],h=new Uint32Array(256),f=0,p=0,m=0;for(m=0;m<256;m++)h[m]=m<128?m<<1:m<<1^283;for(m=0;m<256;m++){var g=p^p<<1^p<<2^p<<3^p<<4;g=g>>>8^255&g^99,e[f]=g,t[g]=f;var y=h[f],v=h[y],b=h[v],A=257*h[g]^16843008*g;r[f]=A<<24|A>>>8,a[f]=A<<16|A>>>16,n[f]=A<<8|A>>>24,s[f]=A,A=16843009*b^65537*v^257*y^16843008*f,c[g]=A<<24|A>>>8,l[g]=A<<16|A>>>16,u[g]=A<<8|A>>>24,d[g]=A,f?(f=y^h[h[h[b^y]]],p^=h[h[p]]):f=p=1}}},{key:"expandKey",value:function(e){for(var t=this.uint8ArrayToUint32Array_(e),i=!0,r=0;r<t.length&&i;)i=t[r]===this.key[r],r++;if(!i){this.key=t;var a=this.keySize=t.length;if(4!==a&&6!==a&&8!==a)throw new Error("Invalid aes key size="+a);var n,s,o,c,l=this.ksRows=4*(a+6+1),u=this.keySchedule=new Uint32Array(l),d=this.invKeySchedule=new Uint32Array(l),h=this.sBox,f=this.rcon,p=this.invSubMix,m=p[0],g=p[1],y=p[2],v=p[3];for(n=0;n<l;n++)n<a?o=u[n]=t[n]:(c=o,n%a==0?(c=c<<8|c>>>24,c=h[c>>>24]<<24|h[c>>>16&255]<<16|h[c>>>8&255]<<8|h[255&c],c^=f[n/a|0]<<24):a>6&&n%a==4&&(c=h[c>>>24]<<24|h[c>>>16&255]<<16|h[c>>>8&255]<<8|h[255&c]),u[n]=o=(u[n-a]^c)>>>0);for(s=0;s<l;s++)n=l-s,c=3&s?u[n]:u[n-4],d[s]=s<4||n<=4?c:m[h[c>>>24]]^g[h[c>>>16&255]]^y[h[c>>>8&255]]^v[h[255&c]],d[s]=d[s]>>>0}}},{key:"networkToHostOrderSwap",value:function(e){return e<<24|(65280&e)<<8|(16711680&e)>>8|e>>>24}},{key:"decrypt",value:function(e,t,i){for(var r,a,n,s,o,c,l,u,d,h,f,p,m,g,y=this.keySize+6,v=this.invKeySchedule,b=this.invSBox,A=this.invSubMix,k=A[0],_=A[1],w=A[2],S=A[3],T=this.uint8ArrayToUint32Array_(i),E=T[0],x=T[1],C=T[2],R=T[3],L=new Int32Array(e),D=new Int32Array(L.length),I=this.networkToHostOrderSwap;t<L.length;){for(d=I(L[t]),h=I(L[t+1]),f=I(L[t+2]),p=I(L[t+3]),o=d^v[0],c=p^v[1],l=f^v[2],u=h^v[3],m=4,g=1;g<y;g++)r=k[o>>>24]^_[c>>16&255]^w[l>>8&255]^S[255&u]^v[m],a=k[c>>>24]^_[l>>16&255]^w[u>>8&255]^S[255&o]^v[m+1],n=k[l>>>24]^_[u>>16&255]^w[o>>8&255]^S[255&c]^v[m+2],s=k[u>>>24]^_[o>>16&255]^w[c>>8&255]^S[255&l]^v[m+3],o=r,c=a,l=n,u=s,m+=4;r=b[o>>>24]<<24^b[c>>16&255]<<16^b[l>>8&255]<<8^b[255&u]^v[m],a=b[c>>>24]<<24^b[l>>16&255]<<16^b[u>>8&255]<<8^b[255&o]^v[m+1],n=b[l>>>24]<<24^b[u>>16&255]<<16^b[o>>8&255]<<8^b[255&c]^v[m+2],s=b[u>>>24]<<24^b[o>>16&255]<<16^b[c>>8&255]<<8^b[255&l]^v[m+3],D[t]=I(r^E),D[t+1]=I(s^x),D[t+2]=I(n^C),D[t+3]=I(a^R),E=d,x=h,C=f,R=p,t+=4}return D.buffer}}]),e}(),Lh=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=i.removePKCS7Padding,a=void 0===r||r;if(Object(T["a"])(this,e),this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.useSoftware=t.enableSoftwareAES,this.removePKCS7Padding=a,a)try{var n=self.crypto;n&&(this.subtle=n.subtle||n.webkitSubtle)}catch(s){}null===this.subtle&&(this.useSoftware=!0)}return Object(S["a"])(e,[{key:"destroy",value:function(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}},{key:"isSync",value:function(){return this.useSoftware}},{key:"flush",value:function(){var e=this.currentResult,t=this.remainderData;if(!e||t)return this.reset(),null;var i=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?function(e){var t=e.byteLength,i=t&&new DataView(e.buffer).getUint8(t-1);return i?Yl(e,0,t-i):e}(i):i}},{key:"reset",value:function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}},{key:"decrypt",value:function(e,t,i){var r=this;return this.useSoftware?new Promise((function(a,n){r.softwareDecrypt(new Uint8Array(e),t,i);var s=r.flush();s?a(s.buffer):n(new Error("[softwareDecrypt] Failed to decrypt data"))})):this.webCryptoDecrypt(new Uint8Array(e),t,i)}},{key:"softwareDecrypt",value:function(e,t,i){var r=this.currentIV,a=this.currentResult,n=this.remainderData;this.logOnce("JS AES decrypt"),n&&(e=Eu(n,e),this.remainderData=null);var s=this.getValidChunk(e);if(!s.length)return null;r&&(i=r);var o=this.softwareDecrypter;o||(o=this.softwareDecrypter=new Rh),o.expandKey(t);var c=a;return this.currentResult=o.decrypt(s.buffer,0,i),this.currentIV=Yl(s,-16).buffer,c||null}},{key:"webCryptoDecrypt",value:function(e,t,i){var r=this,a=this.subtle;return this.key===t&&this.fastAesKey||(this.key=t,this.fastAesKey=new Ch(a,t)),this.fastAesKey.expandKey().then((function(t){return a?(r.logOnce("WebCrypto AES decrypt"),new xh(a,new Uint8Array(i)).decrypt(e.buffer,t)):Promise.reject(new Error("web crypto not initialized"))}))["catch"]((function(a){return _l.warn("[decrypter]: WebCrypto Error, disable WebCrypto API, ".concat(a.name,": ").concat(a.message)),r.onWebCryptoError(e,t,i)}))}},{key:"onWebCryptoError",value:function(e,t,i){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,i);var r=this.flush();if(r)return r.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")}},{key:"getValidChunk",value:function(e){var t=e,i=e.length-e.length%16;return i!==e.length&&(t=Yl(e,0,i),this.remainderData=Yl(e,i)),t}},{key:"logOnce",value:function(e){this.logEnabled&&(_l.log("[decrypter]: ".concat(e)),this.logEnabled=!1)}}]),e}(),Dh=function(e){for(var t="",i=e.length,r=0;r<i;r++)t+="[".concat(e.start(r).toFixed(3),"-").concat(e.end(r).toFixed(3),"]");return t},Ih="STOPPED",Ph="IDLE",Oh="KEY_LOADING",Bh="FRAG_LOADING",Mh="FRAG_LOADING_WAITING_RETRY",Fh="WAITING_TRACK",Uh="PARSING",jh="PARSED",Nh="ENDED",zh="ERROR",Gh="WAITING_INIT_PTS",Hh="WAITING_LEVEL",Vh=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e,r,a,n,s){var o;return Object(T["a"])(this,i),o=t.call(this),o.hls=void 0,o.fragPrevious=null,o.fragCurrent=null,o.fragmentTracker=void 0,o.transmuxer=null,o._state=Ih,o.playlistType=void 0,o.media=null,o.mediaBuffer=null,o.config=void 0,o.bitrateTest=!1,o.lastCurrentTime=0,o.nextLoadPosition=0,o.startPosition=0,o.startTimeOffset=null,o.loadedmetadata=!1,o.retryDate=0,o.levels=null,o.fragmentLoader=void 0,o.keyLoader=void 0,o.levelLastLoaded=null,o.startFragRequested=!1,o.decrypter=void 0,o.initPTS=[],o.onvseeking=null,o.onvended=null,o.logPrefix="",o.log=void 0,o.warn=void 0,o.playlistType=s,o.logPrefix=n,o.log=_l.log.bind(_l,"".concat(n,":")),o.warn=_l.warn.bind(_l,"".concat(n,":")),o.hls=e,o.fragmentLoader=new fh(e.config),o.keyLoader=a,o.fragmentTracker=r,o.config=e.config,o.decrypter=new Lh(e.config),e.on(ml.MANIFEST_LOADED,o.onManifestLoaded,Object(v["a"])(o)),o}return Object(S["a"])(i,[{key:"doTick",value:function(){this.onTickEnd()}},{key:"onTickEnd",value:function(){}},{key:"startLoad",value:function(e){}},{key:"stopLoad",value:function(){this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);var e=this.fragCurrent;null!=e&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=Ih}},{key:"_streamEnded",value:function(e,t){if(t.live||e.nextStart||!e.end||!this.media)return!1;var i=t.partList;if(null!=i&&i.length){var r=i[i.length-1];return Ah.isBuffered(this.media,r.start+r.duration/2)}var a=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(a)}},{key:"getLevelDetails",value:function(){var e;if(this.levels&&null!==this.levelLastLoaded)return null==(e=this.levels[this.levelLastLoaded])?void 0:e.details}},{key:"onMediaAttached",value:function(e,t){var i=this.media=this.mediaBuffer=t.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),i.addEventListener("seeking",this.onvseeking),i.addEventListener("ended",this.onvended);var r=this.config;this.levels&&r.autoStartLoad&&this.state===Ih&&this.startLoad(r.startPosition)}},{key:"onMediaDetaching",value:function(){var e=this.media;null!=e&&e.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),e&&this.onvseeking&&this.onvended&&(e.removeEventListener("seeking",this.onvseeking),e.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.keyLoader&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}},{key:"onMediaSeeking",value:function(){var e=this.config,t=this.fragCurrent,i=this.media,r=this.mediaBuffer,a=this.state,n=i?i.currentTime:0,s=Ah.bufferInfo(r||i,n,e.maxBufferHole);if(this.log("media seeking to ".concat(pl(n)?n.toFixed(3):n,", state: ").concat(a)),this.state===Nh)this.resetLoadingState();else if(t){var o=e.maxFragLookUpTolerance,c=t.start-o,l=t.start+t.duration+o;if(!s.len||l<s.start||c>s.end){var u=n>l;(n<c||u)&&(u&&t.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),t.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}i&&(this.fragmentTracker.removeFragmentsInRange(n,1/0,this.playlistType,!0),this.lastCurrentTime=n),this.loadedmetadata||s.len||(this.nextLoadPosition=this.startPosition=n),this.tickImmediate()}},{key:"onMediaEnded",value:function(){this.startPosition=this.lastCurrentTime=0}},{key:"onManifestLoaded",value:function(e,t){this.startTimeOffset=t.startTimeOffset,this.initPTS=[]}},{key:"onHandlerDestroying",value:function(){this.stopLoad(),k(Object(b["a"])(i.prototype),"onHandlerDestroying",this).call(this)}},{key:"onHandlerDestroyed",value:function(){this.state=Ih,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,k(Object(b["a"])(i.prototype),"onHandlerDestroyed",this).call(this)}},{key:"loadFragment",value:function(e,t,i){this._loadFragForPlayback(e,t,i)}},{key:"_loadFragForPlayback",value:function(e,t,i){var r=this;this._doFragLoad(e,t,i,(function(t){if(r.fragContextChanged(e))return r.warn("Fragment ".concat(e.sn).concat(t.part?" p: "+t.part.index:""," of level ").concat(e.level," was dropped during download.")),void r.fragmentTracker.removeFragment(e);e.stats.chunkCount++,r._handleFragmentLoadProgress(t)})).then((function(t){if(t){var i=r.state;r.fragContextChanged(e)?(i===Bh||!r.fragCurrent&&i===Uh)&&(r.fragmentTracker.removeFragment(e),r.state=Ph):("payload"in t&&(r.log("Loaded fragment ".concat(e.sn," of level ").concat(e.level)),r.hls.trigger(ml.FRAG_LOADED,t)),r._handleFragmentLoadComplete(t))}}))["catch"]((function(t){r.state!==Ih&&r.state!==zh&&(r.warn(t),r.resetFragmentLoading(e))}))}},{key:"clearTrackerIfNeeded",value:function(e){var t,i=this.fragmentTracker;if(i.getState(e)===sh){var r=e.type,a=this.getFwdBufferInfo(this.mediaBuffer,r),n=Math.max(e.duration,a?a.len:this.config.maxBufferLength);this.reduceMaxBufferLength(n)&&i.removeFragment(e)}else 0===(null==(t=this.mediaBuffer)?void 0:t.buffered.length)?i.removeAllFragments():i.hasParts(e.type)&&(i.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),i.getState(e)===oh&&i.removeFragment(e))}},{key:"checkLiveUpdate",value:function(e){if(e.updated&&!e.live){var t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}},{key:"flushMainBuffer",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(e-t){var r={startOffset:e,endOffset:t,type:i};this.hls.trigger(ml.BUFFER_FLUSHING,r)}}},{key:"_loadInitSegment",value:function(e,t){var i=this;this._doFragLoad(e,t).then((function(t){if(!t||i.fragContextChanged(e)||!i.levels)throw new Error("init load aborted");return t})).then((function(t){var r=i.hls,a=t.payload,n=e.decryptdata;if(a&&a.byteLength>0&&n&&n.key&&n.iv&&"AES-128"===n.method){var s=self.performance.now();return i.decrypter.decrypt(new Uint8Array(a),n.key.buffer,n.iv.buffer)["catch"]((function(t){throw r.trigger(ml.ERROR,{type:gl.MEDIA_ERROR,details:yl.FRAG_DECRYPT_ERROR,fatal:!1,error:t,reason:t.message,frag:e}),t})).then((function(i){var a=self.performance.now();return r.trigger(ml.FRAG_DECRYPTED,{frag:e,payload:i,stats:{tstart:s,tdecrypt:a}}),t.payload=i,t}))}return t})).then((function(r){var a=i.fragCurrent,n=i.hls,s=i.levels;if(!s)throw new Error("init load aborted, missing levels");var o=e.stats;i.state=Ph,t.fragmentError=0,e.data=new Uint8Array(r.payload),o.parsing.start=o.buffering.start=self.performance.now(),o.parsing.end=o.buffering.end=self.performance.now(),r.frag===a&&n.trigger(ml.FRAG_BUFFERED,{stats:o,frag:a,part:null,id:e.type}),i.tick()}))["catch"]((function(t){i.state!==Ih&&i.state!==zh&&(i.warn(t),i.resetFragmentLoading(e))}))}},{key:"fragContextChanged",value:function(e){var t=this.fragCurrent;return!e||!t||e.level!==t.level||e.sn!==t.sn||e.urlId!==t.urlId}},{key:"fragBufferedComplete",value:function(e,t){var i,r,a,n,s=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered ".concat(e.type," sn: ").concat(e.sn).concat(t?" part: "+t.index:""," of ").concat(this.playlistType===od?"level":"track"," ").concat(e.level," (frag:[").concat((null!=(i=e.startPTS)?i:NaN).toFixed(3),"-").concat((null!=(r=e.endPTS)?r:NaN).toFixed(3),"] > buffer:").concat(s?Dh(Ah.getBuffered(s)):"(detached)",")")),this.state=Ph,s&&(!this.loadedmetadata&&e.type==od&&s.buffered.length&&(null==(a=this.fragCurrent)?void 0:a.sn)===(null==(n=this.fragPrevious)?void 0:n.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())}},{key:"seekToStartPos",value:function(){}},{key:"_handleFragmentLoadComplete",value:function(e){var t=this.transmuxer;if(t){var i=e.frag,r=e.part,a=e.partsLoaded,n=!a||0===a.length||a.some((function(e){return!e})),s=new kh(i.level,i.sn,i.stats.chunkCount+1,0,r?r.index:-1,!n);t.flush(s)}}},{key:"_handleFragmentLoadProgress",value:function(e){}},{key:"_doFragLoad",value:function(e,t){var i,r=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3?arguments[3]:void 0,s=null==t?void 0:t.details;if(!this.levels||!s)throw new Error("frag load aborted, missing level".concat(s?"":" detail","s"));var o=null;if(!e.encrypted||null!=(i=e.decryptdata)&&i.key?!e.encrypted&&s.encryptedFragments.length&&this.keyLoader.loadClear(e,s.encryptedFragments):(this.log("Loading key for ".concat(e.sn," of [").concat(s.startSN,"-").concat(s.endSN,"], ").concat("[stream-controller]"===this.logPrefix?"level":"track"," ").concat(e.level)),this.state=Oh,this.fragCurrent=e,o=this.keyLoader.load(e).then((function(e){if(!r.fragContextChanged(e.frag))return r.hls.trigger(ml.KEY_LOADED,e),r.state===Oh&&(r.state=Ph),e})),this.hls.trigger(ml.KEY_LOADING,{frag:e}),null===this.fragCurrent&&(o=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))),a=Math.max(e.start,a||0),this.config.lowLatencyMode&&"initSegment"!==e.sn){var c=s.partList;if(c&&n){a>e.end&&s.fragmentHint&&(e=s.fragmentHint);var l=this.getNextPart(c,e,a);if(l>-1){var u,d=c[l];return this.log("Loading part sn: ".concat(e.sn," p: ").concat(d.index," cc: ").concat(e.cc," of playlist [").concat(s.startSN,"-").concat(s.endSN,"] parts [0-").concat(l,"-").concat(c.length-1,"] ").concat("[stream-controller]"===this.logPrefix?"level":"track",": ").concat(e.level,", target: ").concat(parseFloat(a.toFixed(3)))),this.nextLoadPosition=d.start+d.duration,this.state=Bh,u=o?o.then((function(i){return!i||r.fragContextChanged(i.frag)?null:r.doFragPartsLoad(e,d,t,n)}))["catch"]((function(e){return r.handleFragLoadError(e)})):this.doFragPartsLoad(e,d,t,n)["catch"]((function(e){return r.handleFragLoadError(e)})),this.hls.trigger(ml.FRAG_LOADING,{frag:e,part:d,targetBufferTime:a}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):u}if(!e.url||this.loadedEndOfParts(c,a))return Promise.resolve(null)}}this.log("Loading fragment ".concat(e.sn," cc: ").concat(e.cc," ").concat(s?"of ["+s.startSN+"-"+s.endSN+"] ":"").concat("[stream-controller]"===this.logPrefix?"level":"track",": ").concat(e.level,", target: ").concat(parseFloat(a.toFixed(3)))),pl(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=Bh;var f,p=this.config.progressive;return f=p&&o?o.then((function(t){return!t||r.fragContextChanged(null==t?void 0:t.frag)?null:r.fragmentLoader.load(e,n)}))["catch"]((function(e){return r.handleFragLoadError(e)})):Promise.all([this.fragmentLoader.load(e,p?n:void 0),o]).then((function(e){var t=h(e,1),i=t[0];return!p&&i&&n&&n(i),i}))["catch"]((function(e){return r.handleFragLoadError(e)})),this.hls.trigger(ml.FRAG_LOADING,{frag:e,targetBufferTime:a}),null===this.fragCurrent?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):f}},{key:"doFragPartsLoad",value:function(e,t,i,r){var a=this;return new Promise((function(n,s){var o,c=[],l=null==(o=i.details)?void 0:o.partList,u=function t(o){a.fragmentLoader.loadPart(e,o,r).then((function(r){c[o.index]=r;var s=r.part;a.hls.trigger(ml.FRAG_LOADED,r);var u=Md(i,e.sn,o.index+1)||Fd(l,e.sn,o.index+1);if(!u)return n({frag:e,part:s,partsLoaded:c});t(u)}))["catch"](s)};u(t)}))}},{key:"handleFragLoadError",value:function(e){if("data"in e){var t=e.data;e.data&&t.details===yl.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(ml.ERROR,t)}else this.hls.trigger(ml.ERROR,{type:gl.OTHER_ERROR,details:yl.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}},{key:"_handleTransmuxerFlush",value:function(e){var t=this.getCurrentContext(e);if(t&&this.state===Uh){var i=t.frag,r=t.part,a=t.level,n=self.performance.now();i.stats.parsing.end=n,r&&(r.stats.parsing.end=n),this.updateLevelTiming(i,r,a,e.partial)}else this.fragCurrent||this.state===Ih||this.state===zh||(this.state=Ph)}},{key:"getCurrentContext",value:function(e){var t=this.levels,i=this.fragCurrent,r=e.level,a=e.sn,n=e.part;if(null==t||!t[r])return this.warn("Levels object was unset while buffering fragment ".concat(a," of level ").concat(r,". The current chunk will not be buffered.")),null;var s=t[r],o=n>-1?Md(s,a,n):null,c=o?o.fragment:function(e,t,i){if(null==e||!e.details)return null;var r=e.details,a=r.fragments[t-r.startSN];return a||(a=r.fragmentHint,a&&a.sn===t?a:t<r.startSN&&i&&i.sn===t?i:null)}(s,a,i);return c?(i&&i!==c&&(c.stats=i.stats),{frag:c,part:o,level:s}):null}},{key:"bufferFragmentData",value:function(e,t,i,r,a){var n;if(e&&this.state===Uh){var s=e.data1,o=e.data2,c=s;if(s&&o&&(c=Eu(s,o)),null!=(n=c)&&n.length){var l={type:e.type,frag:t,part:i,chunkMeta:r,parent:t.type,data:c};if(this.hls.trigger(ml.BUFFER_APPENDING,l),e.dropped&&e.independent&&!i){if(a)return;this.flushBufferGap(t)}}}}},{key:"flushBufferGap",value:function(e){var t=this.media;if(t)if(Ah.isBuffered(t,t.currentTime)){var i=t.currentTime,r=Ah.bufferInfo(t,i,0),a=e.duration,n=Math.min(2*this.config.maxFragLookUpTolerance,.25*a),s=Math.max(Math.min(e.start-n,r.end-n),i+n);e.start-s>n&&this.flushMainBuffer(s,e.start)}else this.flushMainBuffer(0,e.start)}},{key:"getFwdBufferInfo",value:function(e,t){var i=this.getLoadPosition();return pl(i)?this.getFwdBufferInfoAtPos(e,i,t):null}},{key:"getFwdBufferInfoAtPos",value:function(e,t,i){var r=this.config.maxBufferHole,a=Ah.bufferInfo(e,t,r);if(0===a.len&&void 0!==a.nextStart){var n=this.fragmentTracker.getBufferedFrag(t,i);if(n&&a.nextStart<n.end)return Ah.bufferInfo(e,t,Math.max(a.nextStart,r))}return a}},{key:"getMaxBufferLength",value:function(e){var t,i=this.config;return t=e?Math.max(8*i.maxBufferSize/e,i.maxBufferLength):i.maxBufferLength,Math.min(t,i.maxMaxBufferLength)}},{key:"reduceMaxBufferLength",value:function(e){var t=this.config,i=e||t.maxBufferLength;return t.maxMaxBufferLength>=i&&(t.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to ".concat(t.maxMaxBufferLength,"s")),!0)}},{key:"getAppendedFrag",value:function(e){var t=this.fragmentTracker.getAppendedFrag(e,od);return t&&"fragment"in t?t.fragment:t}},{key:"getNextFragment",value:function(e,t){var i=t.fragments,r=i.length;if(!r)return null;var a,n=this.config,s=i[0].start;if(t.live){var o=n.initialLiveManifestSize;if(r<o)return this.warn("Not enough fragments to start playback (have: ".concat(r,", need: ").concat(o,")")),null;t.PTSKnown||this.startFragRequested||-1!==this.startPosition||(a=this.getInitialLiveFragment(t,i),this.startPosition=a?this.hls.liveSyncPosition||a.start:e)}else e<=s&&(a=i[0]);if(!a){var c=n.lowLatencyMode?t.partEnd:t.fragmentEnd;a=this.getFragmentAtPosition(e,c,t)}return this.mapToInitFragWhenRequired(a)}},{key:"isLoopLoading",value:function(e,t){var i=this.fragmentTracker.getState(e);return(i===ch||i===oh&&!!e.gap)&&this.nextLoadPosition>t}},{key:"getNextFragmentLoopLoading",value:function(e,t,i,r,a){var n=e.gap,s=this.getNextFragment(this.nextLoadPosition,t);if(null===s)return s;if(e=s,n&&e&&!e.gap&&i.nextStart){var o=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,i.nextStart,r);if(null!==o&&i.len+o.len>=a)return this.log('buffer full after gaps in "'.concat(r,'" playlist starting at sn: ').concat(e.sn)),null}return e}},{key:"mapToInitFragWhenRequired",value:function(e){return null==e||!e.initSegment||null!=e&&e.initSegment.data||this.bitrateTest?e:e.initSegment}},{key:"getNextPart",value:function(e,t,i){for(var r=-1,a=!1,n=!0,s=0,o=e.length;s<o;s++){var c=e[s];if(n=n&&!c.independent,r>-1&&i<c.start)break;var l=c.loaded;l?r=-1:(a||c.independent||n)&&c.fragment===t&&(r=s),a=l}return r}},{key:"loadedEndOfParts",value:function(e,t){var i=e[e.length-1];return i&&t>i.start&&i.loaded}},{key:"getInitialLiveFragment",value:function(e,t){var i=this.fragPrevious,r=null;if(i){if(e.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: ".concat(i.programDateTime)),r=function(e,t,i){if(null===t||!Array.isArray(e)||!e.length||!pl(t)||t<(e[0].programDateTime||0)||t>=(e[e.length-1].endProgramDateTime||0))return null;i=i||0;for(var r=0;r<e.length;++r){var a=e[r];if(qd(t,i,a))return a}return null}(t,i.endProgramDateTime,this.config.maxFragLookUpTolerance)),!r){var a=i.sn+1;if(a>=e.startSN&&a<=e.endSN){var n=t[a-e.startSN];i.cc===n.cc&&(r=n,this.log("Live playlist, switching playlist, load frag with next SN: ".concat(r.sn)))}r||(r=function(e,t){return Hd(e,(function(e){return e.cc<t?1:e.cc>t?-1:0}))}(t,i.cc),r&&this.log("Live playlist, switching playlist, load frag with same CC: ".concat(r.sn)))}}else{var s=this.hls.liveSyncPosition;null!==s&&(r=this.getFragmentAtPosition(s,this.bitrateTest?e.fragmentEnd:e.edge,e))}return r}},{key:"getFragmentAtPosition",value:function(e,t,i){var r,a=this.config,n=this.fragPrevious,s=i.fragments,o=i.endSN,c=i.fragmentHint,l=a.maxFragLookUpTolerance,u=i.partList,d=!!(a.lowLatencyMode&&null!=u&&u.length&&c);if(d&&c&&!this.bitrateTest&&(s=s.concat(c),o=c.sn),r=e<t?Vd(n,s,e,e>t-l?0:l):s[s.length-1],r){var h=r.sn-i.startSN,f=this.fragmentTracker.getState(r);if((f===ch||f===oh&&r.gap)&&(n=r),n&&r.sn===n.sn&&(!d||u[0].fragment.sn>r.sn)&&n&&r.level===n.level){var p=s[h+1];r=r.sn<o&&this.fragmentTracker.getState(p)!==ch?p:null}}return r}},{key:"synchronizeToLiveEdge",value:function(e){var t=this.config,i=this.media;if(i){var r=this.hls.liveSyncPosition,a=i.currentTime,n=e.fragments[0].start,s=e.edge,o=a>=n-t.maxFragLookUpTolerance&&a<=s;if(null!==r&&i.duration>r&&(a<r||!o)){var c=void 0!==t.liveMaxLatencyDuration?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;(!o&&i.readyState<4||a<s-c)&&(this.loadedmetadata||(this.nextLoadPosition=r),i.readyState&&(this.warn("Playback: ".concat(a.toFixed(3)," is located too far from the end of live sliding playlist: ").concat(s,", reset currentTime to : ").concat(r.toFixed(3))),i.currentTime=r))}}}},{key:"alignPlaylists",value:function(e,t){var i=this.levels,r=this.levelLastLoaded,a=this.fragPrevious,n=null!==r?i[r]:null,s=e.fragments.length;if(!s)return this.warn("No fragments in live playlist"),0;var o=e.fragments[0].start,c=!t,l=e.alignedSliding&&pl(o);if(c||!l&&!o){Th(a,n,e);var u=e.fragments[0].start;return this.log("Live playlist sliding: ".concat(u.toFixed(2)," start-sn: ").concat(t?t.startSN:"na","->").concat(e.startSN," prev-sn: ").concat(a?a.sn:"na"," fragments: ").concat(s)),u}return o}},{key:"waitForCdnTuneIn",value:function(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,3*e.partTarget)}},{key:"setStartPosition",value:function(e,t){var i=this.startPosition;if(i<t&&(i=-1),-1===i||-1===this.lastCurrentTime){var r=null!==this.startTimeOffset,a=r?this.startTimeOffset:e.startTimeOffset;null!==a&&pl(a)?(i=t+a,a<0&&(i+=e.totalduration),i=Math.min(Math.max(t,i),t+e.totalduration),this.log("Start time offset ".concat(a," found in ").concat(r?"multivariant":"media"," playlist, adjust startPosition to ").concat(i)),this.startPosition=i):e.live?i=this.hls.liveSyncPosition||t:this.startPosition=i=0,this.lastCurrentTime=i}this.nextLoadPosition=i}},{key:"getLoadPosition",value:function(){var e=this.media,t=0;return this.loadedmetadata&&e?t=e.currentTime:this.nextLoadPosition&&(t=this.nextLoadPosition),t}},{key:"handleFragLoadAborted",value:function(e,t){this.transmuxer&&"initSegment"!==e.sn&&e.stats.aborted&&(this.warn("Fragment ".concat(e.sn).concat(t?" part "+t.index:""," of level ").concat(e.level," was aborted")),this.resetFragmentLoading(e))}},{key:"resetFragmentLoading",value:function(e){this.fragCurrent&&(this.fragContextChanged(e)||this.state===Mh)||(this.state=Ph)}},{key:"onFragmentOrKeyLoadError",value:function(e,t){if(t.chunkMeta&&!t.frag){var i=this.getCurrentContext(t.chunkMeta);i&&(t.frag=i.frag)}var r,a=t.frag;if(a&&a.type===e&&this.levels)if(this.fragContextChanged(a))this.warn("Frag load error must match current frag to retry ".concat(a.url," > ").concat(null==(r=this.fragCurrent)?void 0:r.url));else{var n=t.details===yl.FRAG_GAP;n&&this.fragmentTracker.fragBuffered(a,!0);var s=t.errorAction,o=s||{},c=o.action,l=o.retryCount,u=void 0===l?0:l,d=o.retryConfig;if(s&&c===Yd&&d){var h;this.resetStartWhenNotLoaded(null!=(h=this.levelLastLoaded)?h:a.level);var f=Nd(d,u);this.warn("Fragment ".concat(a.sn," of ").concat(e," ").concat(a.level," errored with ").concat(t.details,", retrying loading ").concat(u+1,"/").concat(d.maxNumRetry," in ").concat(f,"ms")),s.resolved=!0,this.retryDate=self.performance.now()+f,this.state=Mh}else d&&s?(this.resetFragmentErrors(e),u<d.maxNumRetry?n||(s.resolved=!0):_l.warn("".concat(t.details," reached or exceeded max retry (").concat(u,")"))):(null==s?void 0:s.action)===Jd?this.state=Hh:this.state=zh;this.tickImmediate()}}},{key:"reduceLengthAndFlushBuffer",value:function(e){if(this.state===Uh||this.state===jh){var t=e.parent,i=this.getFwdBufferInfo(this.mediaBuffer,t),r=i&&i.len>.5;r&&this.reduceMaxBufferLength(i.len);var a=!r;return a&&this.warn("Buffer full error while media.currentTime is not buffered, flush ".concat(t," buffer")),e.frag&&(this.fragmentTracker.removeFragment(e.frag),this.nextLoadPosition=e.frag.start),this.resetLoadingState(),a}return!1}},{key:"resetFragmentErrors",value:function(e){e===cd&&(this.fragCurrent=null),this.loadedmetadata||(this.startFragRequested=!1),this.state!==Ih&&(this.state=Ph)}},{key:"afterBufferFlushed",value:function(e,t,i){if(e){var r=Ah.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,r,i),this.state===Nh&&this.resetLoadingState()}}},{key:"resetLoadingState",value:function(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=Ph}},{key:"resetStartWhenNotLoaded",value:function(e){if(!this.loadedmetadata){this.startFragRequested=!1;var t=this.levels?this.levels[e].details:null;null!=t&&t.live?(this.startPosition=-1,this.setStartPosition(t,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}},{key:"resetWhenMissingContext",value:function(e){var t;this.warn("The loading context changed while buffering fragment ".concat(e.sn," of level ").concat(e.level,". This chunk will not be buffered.")),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(null!=(t=this.levelLastLoaded)?t:e.level),this.resetLoadingState()}},{key:"removeUnbufferedFrags",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}},{key:"updateLevelTiming",value:function(e,t,i,r){var a,n=this,s=i.details;if(s){if(Object.keys(e.elementaryStreams).reduce((function(t,a){var o=e.elementaryStreams[a];if(o){var c=o.endPTS-o.startPTS;if(c<=0)return n.warn("Could not parse fragment ".concat(e.sn," ").concat(a," duration reliably (").concat(c,")")),t||!1;var l=r?0:Id(s,e,o.startPTS,o.endPTS,o.startDTS,o.endDTS);return n.hls.trigger(ml.LEVEL_PTS_UPDATED,{details:s,level:i,drift:l,type:a,frag:e,start:o.startPTS,end:o.endPTS}),!0}return t}),!1))i.fragmentError=0;else if(null===(null==(a=this.transmuxer)?void 0:a.error)){var o=new Error("Found no media in fragment ".concat(e.sn," of level ").concat(e.level," resetting transmuxer to fallback to playlist timing"));if(0===i.fragmentError&&(i.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)),this.warn(o.message),this.hls.trigger(ml.ERROR,{type:gl.MEDIA_ERROR,details:yl.FRAG_PARSING_ERROR,fatal:!1,error:o,frag:e,reason:"Found no media in msn ".concat(e.sn,' of level "').concat(i.url,'"')}),!this.hls)return;this.resetTransmuxer()}this.state=jh,this.hls.trigger(ml.FRAG_PARSED,{frag:e,part:t})}else this.warn("level.details undefined")}},{key:"resetTransmuxer",value:function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)}},{key:"recoverWorkerError",value:function(e){var t,i,r;"demuxerWorker"===e.event&&(this.fragmentTracker.removeAllFragments(),this.resetTransmuxer(),this.resetStartWhenNotLoaded(null!=(t=null!=(i=this.levelLastLoaded)?i:null==(r=this.fragCurrent)?void 0:r.level)?t:0),this.resetLoadingState())}},{key:"state",get:function(){return this._state},set:function(e){var t=this._state;t!==e&&(this._state=e,this.log("".concat(t,"->").concat(e)))}}]),i}(vh);function Wh(){return self.SourceBuffer||self.WebKitSourceBuffer}function qh(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4;return{type:e,id:-1,pid:-1,inputTimeScale:t,sequenceNumber:-1,samples:[],dropped:0}}var Kh=function(){function e(){Object(T["a"])(this,e),this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}return Object(S["a"])(e,[{key:"resetInitSegment",value:function(e,t,i,r){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}},{key:"resetTimeStamp",value:function(e){this.initPTS=e,this.resetContiguity()}},{key:"resetContiguity",value:function(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}},{key:"canParse",value:function(e,t){return!1}},{key:"appendFrame",value:function(e,t,i){}},{key:"demux",value:function(e,t){this.cachedData&&(e=Eu(this.cachedData,e),this.cachedData=null);var i,r=Zl(e,0),a=r?r.length:0,n=this._audioTrack,s=this._id3Track,o=r?function(e){for(var t=au(e),i=0;i<t.length;i++){var r=t[i];if(iu(r))return lu(r)}}(r):void 0,c=e.length;for((null===this.basePTS||0===this.frameIndex&&pl(o))&&(this.basePTS=Jh(o,t,this.initPTS),this.lastPTS=this.basePTS),null===this.lastPTS&&(this.lastPTS=this.basePTS),r&&r.length>0&&s.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:yd,duration:Number.POSITIVE_INFINITY});a<c;){if(this.canParse(e,a)){var l=this.appendFrame(n,e,a);l?(this.frameIndex++,this.lastPTS=l.sample.pts,a+=l.length,i=a):a=c}else tu(e,a)?(r=Zl(e,a),s.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:yd,duration:Number.POSITIVE_INFINITY}),a+=r.length,i=a):a++;if(a===c&&i!==c){var u=Yl(e,i);this.cachedData?this.cachedData=Eu(this.cachedData,u):this.cachedData=u}}return{audioTrack:n,videoTrack:qh(),id3Track:s,textTrack:qh()}}},{key:"demuxSampleAes",value:function(e,t,i){return Promise.reject(new Error("[".concat(this,"] This demuxer does not support Sample-AES decryption")))}},{key:"flush",value:function(e){var t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),{audioTrack:this._audioTrack,videoTrack:qh(),id3Track:this._id3Track,textTrack:qh()}}},{key:"destroy",value:function(){}}]),e}(),Jh=function(e,t,i){return pl(e)?90*e:9e4*t+(i?9e4*i.baseTime/i.timescale:0)};function Yh(e,t){return 255===e[t]&&240==(246&e[t+1])}function Qh(e,t){return 1&e[t+1]?7:9}function Xh(e,t){return(3&e[t+3])<<11|e[t+4]<<3|(224&e[t+5])>>>5}function $h(e,t){return t+1<e.length&&Yh(e,t)}function Zh(e,t){if($h(e,t)){var i=Qh(e,t);if(t+i>=e.length)return!1;var r=Xh(e,t);if(r<=i)return!1;var a=t+r;return a===e.length||$h(e,a)}return!1}function ef(e,t,i,r,a){if(!e.samplerate){var n=function(e,t,i,r){var a,n,s,o,c=navigator.userAgent.toLowerCase(),l=r,u=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];a=1+((192&t[i+2])>>>6);var d=(60&t[i+2])>>>2;if(!(d>u.length-1))return s=(1&t[i+2])<<2,s|=(192&t[i+3])>>>6,_l.log("manifest codec:".concat(r,", ADTS type:").concat(a,", samplingIndex:").concat(d)),/firefox/i.test(c)?d>=6?(a=5,o=new Array(4),n=d-3):(a=2,o=new Array(2),n=d):-1!==c.indexOf("android")?(a=2,o=new Array(2),n=d):(a=5,o=new Array(4),r&&(-1!==r.indexOf("mp4a.40.29")||-1!==r.indexOf("mp4a.40.5"))||!r&&d>=6?n=d-3:((r&&-1!==r.indexOf("mp4a.40.2")&&(d>=6&&1===s||/vivaldi/i.test(c))||!r&&1===s)&&(a=2,o=new Array(2)),n=d)),o[0]=a<<3,o[0]|=(14&d)>>1,o[1]|=(1&d)<<7,o[1]|=s<<3,5===a&&(o[1]|=(14&n)>>1,o[2]=(1&n)<<7,o[2]|=8,o[3]=0),{config:o,samplerate:u[d],channelCount:s,codec:"mp4a.40."+a,manifestCodec:l};e.trigger(ml.ERROR,{type:gl.MEDIA_ERROR,details:yl.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:".concat(d)})}(t,i,r,a);if(!n)return;e.config=n.config,e.samplerate=n.samplerate,e.channelCount=n.channelCount,e.codec=n.codec,e.manifestCodec=n.manifestCodec,_l.log("parsed codec:".concat(e.codec,", rate:").concat(n.samplerate,", channels:").concat(n.channelCount))}}function tf(e){return 9216e4/e}function rf(e,t,i,r,a){var n,s=r+a*tf(e.samplerate),o=function(e,t){var i=Qh(e,t);if(t+i<=e.length){var r=Xh(e,t)-i;if(r>0)return{headerLength:i,frameLength:r}}}(t,i);if(o){var c=o.frameLength,l=o.headerLength,u=l+c,d=Math.max(0,i+u-t.length);d?(n=new Uint8Array(u-l),n.set(t.subarray(i+l,t.length),0)):n=t.subarray(i+l,i+u);var h={unit:n,pts:s};return d||e.samples.push(h),{sample:h,length:u,missing:d}}var f=t.length-i;return n=new Uint8Array(f),n.set(t.subarray(i,t.length),0),{sample:{unit:n,pts:s},length:f,missing:-1}}var af=/\/emsg[-/]ID3/i,nf=null,sf=[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],of=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],cf=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],lf=[0,1,1,4];function uf(e,t,i,r,a){if(!(i+24>t.length)){var n=df(t,i);if(n&&i+n.frameLength<=t.length){var s=r+a*(9e4*n.samplesPerFrame/n.sampleRate),o={unit:t.subarray(i,i+n.frameLength),pts:s,dts:s};return e.config=[],e.channelCount=n.channelCount,e.samplerate=n.sampleRate,e.samples.push(o),{sample:o,length:n.frameLength,missing:0}}}}function df(e,t){var i=e[t+1]>>3&3,r=e[t+1]>>1&3,a=e[t+2]>>4&15,n=e[t+2]>>2&3;if(1!==i&&0!==a&&15!==a&&3!==n){var s=e[t+2]>>1&1,o=e[t+3]>>6,c=1e3*sf[14*(3===i?3-r:3===r?3:4)+a-1],l=of[3*(3===i?0:2===i?1:2)+n],u=3===o?1:2,d=cf[i][r],h=lf[r],f=8*d*h,p=Math.floor(d*c/l+s)*h;if(null===nf){var m=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);nf=m?parseInt(m[1]):0}return nf&&nf<=87&&2===r&&c>=224e3&&0===o&&(e[t+3]=128|e[t+3]),{sampleRate:l,channelCount:u,frameLength:p,samplesPerFrame:f}}}function hf(e,t){return 255===e[t]&&224==(224&e[t+1])&&0!=(6&e[t+1])}function ff(e,t){return t+1<e.length&&hf(e,t)}function pf(e,t){if(t+1<e.length&&hf(e,t)){var i=df(e,t),r=4;null!=i&&i.frameLength&&(r=i.frameLength);var a=t+r;return a===e.length||ff(e,a)}return!1}var mf=function(){function e(t){Object(T["a"])(this,e),this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=t,this.bytesAvailable=t.byteLength,this.word=0,this.bitsAvailable=0}return Object(S["a"])(e,[{key:"loadWord",value:function(){var e=this.data,t=this.bytesAvailable,i=e.byteLength-t,r=new Uint8Array(4),a=Math.min(4,t);if(0===a)throw new Error("no bytes available");r.set(e.subarray(i,i+a)),this.word=new DataView(r.buffer).getUint32(0),this.bitsAvailable=8*a,this.bytesAvailable-=a}},{key:"skipBits",value:function(e){var t;e=Math.min(e,8*this.bytesAvailable+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(t=(e-=this.bitsAvailable)>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}},{key:"readBits",value:function(e){var t=Math.min(this.bitsAvailable,e),i=this.word>>>32-t;if(e>32&&_l.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else{if(!(this.bytesAvailable>0))throw new Error("no bits available");this.loadWord()}return t=e-t,t>0&&this.bitsAvailable?i<<t|this.readBits(t):i}},{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){for(var t,i=8,r=8,a=0;a<e;a++)0!==r&&(t=this.readEG(),r=(i+t+256)%256),i=0===r?i:r}},{key:"readSPS",value:function(){var e,t,i,r=0,a=0,n=0,s=0,o=this.readUByte.bind(this),c=this.readBits.bind(this),l=this.readUEG.bind(this),u=this.readBoolean.bind(this),d=this.skipBits.bind(this),h=this.skipEG.bind(this),f=this.skipUEG.bind(this),p=this.skipScalingList.bind(this);o();var m=o();if(c(5),d(3),o(),f(),100===m||110===m||122===m||244===m||44===m||83===m||86===m||118===m||128===m){var g=l();if(3===g&&d(1),f(),f(),d(1),u())for(t=3!==g?8:12,i=0;i<t;i++)u()&&p(i<6?16:64)}f();var y=l();if(0===y)l();else if(1===y)for(d(1),h(),h(),e=l(),i=0;i<e;i++)h();f(),d(1);var v=l(),b=l(),A=c(1);0===A&&d(1),d(1),u()&&(r=l(),a=l(),n=l(),s=l());var k=[1,1];if(u()&&u())switch(o()){case 1:k=[1,1];break;case 2:k=[12,11];break;case 3:k=[10,11];break;case 4:k=[16,11];break;case 5:k=[40,33];break;case 6:k=[24,11];break;case 7:k=[20,11];break;case 8:k=[32,11];break;case 9:k=[80,33];break;case 10:k=[18,11];break;case 11:k=[15,11];break;case 12:k=[64,33];break;case 13:k=[160,99];break;case 14:k=[4,3];break;case 15:k=[3,2];break;case 16:k=[2,1];break;case 255:k=[o()<<8|o(),o()<<8|o()]}return{width:Math.ceil(16*(v+1)-2*r-2*a),height:(2-A)*(b+1)*16-(A?2:4)*(n+s),pixelRatio:k}}},{key:"readSliceType",value:function(){return this.readUByte(),this.readUEG(),this.readUEG()}}]),e}(),gf=function(){function e(t,i,r){Object(T["a"])(this,e),this.keyData=void 0,this.decrypter=void 0,this.keyData=r,this.decrypter=new Lh(i,{removePKCS7Padding:!1})}return Object(S["a"])(e,[{key:"decryptBuffer",value:function(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer)}},{key:"decryptAacSample",value:function(e,t,i){var r=this,a=e[t].unit;if(!(a.length<=16)){var n=a.subarray(16,a.length-a.length%16),s=n.buffer.slice(n.byteOffset,n.byteOffset+n.length);this.decryptBuffer(s).then((function(n){var s=new Uint8Array(n);a.set(s,16),r.decrypter.isSync()||r.decryptAacSamples(e,t+1,i)}))}}},{key:"decryptAacSamples",value:function(e,t,i){for(;;t++){if(t>=e.length)return void i();if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,i),!this.decrypter.isSync()))return}}},{key:"getAvcEncryptedData",value:function(e){for(var t=16*Math.floor((e.length-48)/160)+16,i=new Int8Array(t),r=0,a=32;a<e.length-16;a+=160,r+=16)i.set(e.subarray(a,a+16),r);return i}},{key:"getAvcDecryptedUnit",value:function(e,t){for(var i=new Uint8Array(t),r=0,a=32;a<e.length-16;a+=160,r+=16)e.set(i.subarray(r,r+16),a);return e}},{key:"decryptAvcSample",value:function(e,t,i,r,a){var n=this,s=Lu(a.data),o=this.getAvcEncryptedData(s);this.decryptBuffer(o.buffer).then((function(o){a.data=n.getAvcDecryptedUnit(s,o),n.decrypter.isSync()||n.decryptAvcSamples(e,t,i+1,r)}))}},{key:"decryptAvcSamples",value:function(e,t,i,r){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,i=0){if(t>=e.length)return void r();for(var a=e[t].units;!(i>=a.length);i++){var n=a[i];if(!(n.data.length<=48||1!==n.type&&5!==n.type||(this.decryptAvcSample(e,t,i,r,n),this.decrypter.isSync())))return}}}}]),e}(),yf=188,vf=function(){function e(t,i,r){Object(T["a"])(this,e),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=t,this.config=i,this.typeSupported=r}return Object(S["a"])(e,[{key:"resetInitSegment",value:function(t,i,r,a){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=e.createTrack("video"),this._audioTrack=e.createTrack("audio",a),this._id3Track=e.createTrack("id3"),this._txtTrack=e.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.audioCodec=i,this.videoCodec=r,this._duration=a}},{key:"resetTimeStamp",value:function(){}},{key:"resetContiguity",value:function(){var e=this._audioTrack,t=this._avcTrack,i=this._id3Track;e&&(e.pesData=null),t&&(t.pesData=null),i&&(i.pesData=null),this.aacOverFlow=null,this.avcSample=null,this.remainderData=null}},{key:"demux",value:function(t,i){var r,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];a||(this.sampleAes=null);var s=this._avcTrack,o=this._audioTrack,c=this._id3Track,l=this._txtTrack,u=s.pid,d=s.pesData,h=o.pid,f=c.pid,p=o.pesData,m=c.pesData,g=null,y=this.pmtParsed,v=this._pmtId,b=t.length;if(this.remainderData&&(b=(t=Eu(this.remainderData,t)).length,this.remainderData=null),b<yf&&!n)return this.remainderData=t,{audioTrack:o,videoTrack:s,id3Track:c,textTrack:l};var A=Math.max(0,e.syncOffset(t));b-=(b-A)%yf,b<t.byteLength&&!n&&(this.remainderData=new Uint8Array(t.buffer,b,t.buffer.byteLength-b));for(var k=0,_=A;_<b;_+=yf)if(71===t[_]){var w=!!(64&t[_+1]),S=Af(t,_),T=void 0;if((48&t[_+3])>>4>1){if(T=_+5+t[_+4],T===_+yf)continue}else T=_+4;switch(S){case u:w&&(d&&(r=wf(d))&&this.parseAVCPES(s,l,r,!1),d={data:[],size:0}),d&&(d.data.push(t.subarray(T,_+yf)),d.size+=_+yf-T);break;case h:if(w){if(p&&(r=wf(p)))switch(o.segmentCodec){case"aac":this.parseAACPES(o,r);break;case"mp3":this.parseMPEGPES(o,r)}p={data:[],size:0}}p&&(p.data.push(t.subarray(T,_+yf)),p.size+=_+yf-T);break;case f:w&&(m&&(r=wf(m))&&this.parseID3PES(c,r),m={data:[],size:0}),m&&(m.data.push(t.subarray(T,_+yf)),m.size+=_+yf-T);break;case 0:w&&(T+=t[T]+1),v=this._pmtId=kf(t,T);break;case v:w&&(T+=t[T]+1);var E=_f(t,T,this.typeSupported,a);u=E.avc,u>0&&(s.pid=u),h=E.audio,h>0&&(o.pid=h,o.segmentCodec=E.segmentCodec),f=E.id3,f>0&&(c.pid=f),null===g||y||(_l.warn("MPEG-TS PMT found at ".concat(_," after unknown PID '").concat(g,"'. Backtracking to sync byte @").concat(A," to parse all TS packets.")),g=null,_=A-188),y=this.pmtParsed=!0;break;case 17:case 8191:break;default:g=S}}else k++;if(k>0){var x=new Error("Found ".concat(k," TS packet/s that do not start with 0x47"));this.observer.emit(ml.ERROR,ml.ERROR,{type:gl.MEDIA_ERROR,details:yl.FRAG_PARSING_ERROR,fatal:!1,error:x,reason:x.message})}s.pesData=d,o.pesData=p,c.pesData=m;var C={audioTrack:o,videoTrack:s,id3Track:c,textTrack:l};return n&&this.extractRemainingSamples(C),C}},{key:"flush",value:function(){var e,t=this.remainderData;return this.remainderData=null,e=t?this.demux(t,-1,!1,!0):{videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(e),this.sampleAes?this.decrypt(e,this.sampleAes):e}},{key:"extractRemainingSamples",value:function(e){var t,i=e.audioTrack,r=e.videoTrack,a=e.id3Track,n=e.textTrack,s=r.pesData,o=i.pesData,c=a.pesData;if(s&&(t=wf(s))?(this.parseAVCPES(r,n,t,!0),r.pesData=null):r.pesData=s,o&&(t=wf(o))){switch(i.segmentCodec){case"aac":this.parseAACPES(i,t);break;case"mp3":this.parseMPEGPES(i,t)}i.pesData=null}else null!=o&&o.size&&_l.log("last AAC PES packet truncated,might overlap between fragments"),i.pesData=o;c&&(t=wf(c))?(this.parseID3PES(a,t),a.pesData=null):a.pesData=c}},{key:"demuxSampleAes",value:function(e,t,i){var r=this.demux(e,i,!0,!this.config.progressive),a=this.sampleAes=new gf(this.observer,this.config,t);return this.decrypt(r,a)}},{key:"decrypt",value:function(e,t){return new Promise((function(i){var r=e.audioTrack,a=e.videoTrack;r.samples&&"aac"===r.segmentCodec?t.decryptAacSamples(r.samples,0,(function(){a.samples?t.decryptAvcSamples(a.samples,0,0,(function(){i(e)})):i(e)})):a.samples&&t.decryptAvcSamples(a.samples,0,0,(function(){i(e)}))}))}},{key:"destroy",value:function(){this._duration=0}},{key:"parseAVCPES",value:function(e,t,i,r){var a,n=this,s=this.parseAVCNALu(e,i.data),o=this.avcSample,c=!1;i.data=null,o&&s.length&&!e.audFound&&(Sf(o,e),o=this.avcSample=bf(!1,i.pts,i.dts,"")),s.forEach((function(r){var s;switch(r.type){case 1:var l=!1;a=!0;var u,d=r.data;if(c&&d.length>4){var h=new mf(d).readSliceType();2!==h&&4!==h&&7!==h&&9!==h||(l=!0)}l&&null!=(u=o)&&u.frame&&!o.key&&(Sf(o,e),o=n.avcSample=null),o||(o=n.avcSample=bf(!0,i.pts,i.dts,"")),o.frame=!0,o.key=l;break;case 5:a=!0,null!=(s=o)&&s.frame&&!o.key&&(Sf(o,e),o=n.avcSample=null),o||(o=n.avcSample=bf(!0,i.pts,i.dts,"")),o.key=!0,o.frame=!0;break;case 6:a=!0,Ru(r.data,1,i.pts,t.samples);break;case 7:if(a=!0,c=!0,!e.sps){var f=r.data,p=new mf(f).readSPS();e.width=p.width,e.height=p.height,e.pixelRatio=p.pixelRatio,e.sps=[f],e.duration=n._duration;for(var m=f.subarray(1,4),g="avc1.",y=0;y<3;y++){var v=m[y].toString(16);v.length<2&&(v="0"+v),g+=v}e.codec=g}break;case 8:a=!0,e.pps||(e.pps=[r.data]);break;case 9:a=!1,e.audFound=!0,o&&Sf(o,e),o=n.avcSample=bf(!1,i.pts,i.dts,"");break;case 12:a=!0;break;default:a=!1,o&&(o.debug+="unknown NAL "+r.type+" ")}o&&a&&o.units.push(r)})),r&&o&&(Sf(o,e),this.avcSample=null)}},{key:"getLastNalUnit",value:function(e){var t,i,r=this.avcSample;if(r&&0!==r.units.length||(r=e[e.length-1]),null!=(t=r)&&t.units){var a=r.units;i=a[a.length-1]}return i}},{key:"parseAVCNALu",value:function(e,t){var i,r,a,n=t.byteLength,s=e.naluState||0,o=s,c=[],l=0,u=-1,d=0;for(-1===s&&(u=0,d=31&t[0],s=0,l=1);l<n;)if(i=t[l++],s)if(1!==s)if(i)if(1===i){if(u>=0){var h={data:t.subarray(u,l-s-1),type:d};c.push(h)}else{var f=this.getLastNalUnit(e.samples);if(f&&(o&&l<=4-o&&f.state&&(f.data=f.data.subarray(0,f.data.byteLength-o)),r=l-s-1,r>0)){var p=new Uint8Array(f.data.byteLength+r);p.set(f.data,0),p.set(t.subarray(0,r),f.data.byteLength),f.data=p,f.state=0}}l<n?(a=31&t[l],u=l,d=a,s=0):s=-1}else s=0;else s=3;else s=i?0:2;else s=i?0:1;if(u>=0&&s>=0){var m={data:t.subarray(u,n),type:d,state:s};c.push(m)}if(0===c.length){var g=this.getLastNalUnit(e.samples);if(g){var y=new Uint8Array(g.data.byteLength+t.byteLength);y.set(g.data,0),y.set(t,g.data.byteLength),g.data=y}}return e.naluState=s,c}},{key:"parseAACPES",value:function(e,t){var i,r,a,n=0,s=this.aacOverFlow,o=t.data;if(s){this.aacOverFlow=null;var c=s.missing,l=s.sample.unit.byteLength;if(-1===c){var u=new Uint8Array(l+o.byteLength);u.set(s.sample.unit,0),u.set(o,l),o=u}else{var d=l-c;s.sample.unit.set(o.subarray(0,c),d),e.samples.push(s.sample),n=s.missing}}for(i=n,r=o.length;i<r-1&&!$h(o,i);i++);if(i!==n){var h,f=i<r-1;h=f?"AAC PES did not start with ADTS header,offset:".concat(i):"No ADTS header found in AAC PES";var p=new Error(h);if(_l.warn("parsing error: ".concat(h)),this.observer.emit(ml.ERROR,ml.ERROR,{type:gl.MEDIA_ERROR,details:yl.FRAG_PARSING_ERROR,fatal:!1,levelRetry:f,error:p,reason:h}),!f)return}if(ef(e,this.observer,o,i,this.audioCodec),void 0!==t.pts)a=t.pts;else{if(!s)return void _l.warn("[tsdemuxer]: AAC PES unknown PTS");var m=tf(e.samplerate);a=s.sample.pts+m}for(var g,y=0;i<r;){if(g=rf(e,o,i,a,y),i+=g.length,g.missing){this.aacOverFlow=g;break}for(y++;i<r-1&&!$h(o,i);i++);}}},{key:"parseMPEGPES",value:function(e,t){var i=t.data,r=i.length,a=0,n=0,s=t.pts;if(void 0!==s)for(;n<r;)if(ff(i,n)){var o=uf(e,i,n,s,a);if(!o)break;n+=o.length,a++}else n++;else _l.warn("[tsdemuxer]: MPEG PES unknown PTS")}},{key:"parseID3PES",value:function(e,t){if(void 0!==t.pts){var i=fl({},t,{type:this._avcTrack?bd:yd,duration:Number.POSITIVE_INFINITY});e.samples.push(i)}else _l.warn("[tsdemuxer]: ID3 PES unknown PTS")}}],[{key:"probe",value:function(t){var i=e.syncOffset(t);return i>0&&_l.warn("MPEG2-TS detected but first sync word found @ offset ".concat(i)),-1!==i}},{key:"syncOffset",value:function(e){for(var t=e.length,i=Math.min(940,e.length-yf)+1,r=0;r<i;){for(var a=!1,n=-1,s=0,o=r;o<t;o+=yf){if(71!==e[o]){if(s)return-1;break}if(s++,-1===n&&(n=o,0!==n&&(i=Math.min(n+18612,e.length-yf)+1)),a||(a=0===Af(e,o)),a&&s>1&&(0===n&&s>2||o+yf>i))return n}r++}return-1}},{key:"createTrack",value:function(e,t){return{container:"video"===e||"audio"===e?"video/mp2t":void 0,type:e,id:mu[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:"audio"===e?t:void 0}}}]),e}();function bf(e,t,i,r){return{key:e,frame:!1,pts:t,dts:i,units:[],debug:r,length:0}}function Af(e,t){return((31&e[t+1])<<8)+e[t+2]}function kf(e,t){return(31&e[t+10])<<8|e[t+11]}function _f(e,t,i,r){var a={audio:-1,avc:-1,id3:-1,segmentCodec:"aac"},n=t+3+((15&e[t+1])<<8|e[t+2])-4;for(t+=12+((15&e[t+10])<<8|e[t+11]);t<n;){var s=Af(e,t);switch(e[t]){case 207:if(!r){_l.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:-1===a.audio&&(a.audio=s);break;case 21:-1===a.id3&&(a.id3=s);break;case 219:if(!r){_l.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:-1===a.avc&&(a.avc=s);break;case 3:case 4:!0!==i.mpeg&&!0!==i.mp3?_l.log("MPEG audio found, not supported in this browser"):-1===a.audio&&(a.audio=s,a.segmentCodec="mp3");break;case 36:_l.warn("Unsupported HEVC stream type found")}t+=5+((15&e[t+3])<<8|e[t+4])}return a}function wf(e){var t,i,r,a,n,s=0,o=e.data;if(!e||0===e.size)return null;for(;o[0].length<19&&o.length>1;){var c=new Uint8Array(o[0].length+o[1].length);c.set(o[0]),c.set(o[1],o[0].length),o[0]=c,o.splice(1,1)}if(t=o[0],(t[0]<<16)+(t[1]<<8)+t[2]===1){if(i=(t[4]<<8)+t[5],i&&i>e.size-6)return null;var l=t[7];192&l&&(a=536870912*(14&t[9])+4194304*(255&t[10])+16384*(254&t[11])+128*(255&t[12])+(254&t[13])/2,64&l?(n=536870912*(14&t[14])+4194304*(255&t[15])+16384*(254&t[16])+128*(255&t[17])+(254&t[18])/2,a-n>54e5&&(_l.warn("".concat(Math.round((a-n)/9e4),"s delta between PTS and DTS, align them")),a=n)):n=a),r=t[8];var u=r+9;if(e.size<=u)return null;e.size-=u;for(var d=new Uint8Array(e.size),h=0,f=o.length;h<f;h++){t=o[h];var p=t.byteLength;if(u){if(u>p){u-=p;continue}t=t.subarray(u),p-=u,u=0}d.set(t,s),s+=p}return i&&(i-=r+3),{data:d,pts:a,dts:n,len:i}}return null}function Sf(e,t){if(e.units.length&&e.frame){if(void 0===e.pts){var i=t.samples,r=i.length;if(!r)return void t.dropped++;var a=i[r-1];e.pts=a.pts,e.dts=a.dts}t.samples.push(e)}e.debug.length&&_l.log(e.pts+"/"+e.dts+":"+e.debug)}var Tf=function(){function e(){Object(T["a"])(this,e)}return Object(S["a"])(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])}}}]),e}(),Ef=Math.pow(2,32)-1,xf=function(){function e(){Object(T["a"])(this,e)}return Object(S["a"])(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 i=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]),r=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:i,audio:r};var a=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),n=new Uint8Array([0,0,0,0,0,0,0,0]);e.STTS=e.STSC=e.STCO=n,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 s=new Uint8Array([105,115,111,109]),o=new Uint8Array([97,118,99,49]),c=new Uint8Array([0,0,0,1]);e.FTYP=e.box(e.types.ftyp,s,c,s,o),e.DINF=e.box(e.types.dinf,e.box(e.types.dref,a))}},{key:"box",value:function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];for(var a=8,n=i.length,s=n;n--;)a+=i[n].byteLength;var o=new Uint8Array(a);for(o[0]=a>>24&255,o[1]=a>>16&255,o[2]=a>>8&255,o[3]=255&a,o.set(e,4),n=0,a=8;n<s;n++)o.set(i[n],a),a+=i[n].byteLength;return o}},{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,i){i*=t;var r=Math.floor(i/(Ef+1)),a=Math.floor(i%(Ef+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,r>>24,r>>16&255,r>>8&255,255&r,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,i,r){return e.box(e.types.moof,e.mfhd(t),e.traf(r,i))}},{key:"moov",value:function(t){for(var i=t.length,r=[];i--;)r[i]=e.trak(t[i]);return e.box.apply(null,[e.types.moov,e.mvhd(t[0].timescale,t[0].duration)].concat(r).concat(e.mvex(t)))}},{key:"mvex",value:function(t){for(var i=t.length,r=[];i--;)r[i]=e.trex(t[i]);return e.box.apply(null,[e.types.mvex].concat(r))}},{key:"mvhd",value:function(t,i){i*=t;var r=Math.floor(i/(Ef+1)),a=Math.floor(i%(Ef+1)),n=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,r>>24,r>>16&255,r>>8&255,255&r,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,n)}},{key:"sdtp",value:function(t){var i,r,a=t.samples||[],n=new Uint8Array(4+a.length);for(i=0;i<a.length;i++)r=a[i].flags,n[i+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return e.box(e.types.sdtp,n)}},{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 i,r,a,n=[],s=[];for(i=0;i<t.sps.length;i++)r=t.sps[i],a=r.byteLength,n.push(a>>>8&255),n.push(255&a),n=n.concat(Array.prototype.slice.call(r));for(i=0;i<t.pps.length;i++)r=t.pps[i],a=r.byteLength,s.push(a>>>8&255),s.push(255&a),s=s.concat(Array.prototype.slice.call(r));var o=e.box(e.types.avcC,new Uint8Array([1,n[3],n[4],n[5],255,224|t.sps.length].concat(n).concat([t.pps.length]).concat(s))),c=t.width,l=t.height,u=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,c>>8&255,255&c,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]),o,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([u>>24,u>>16&255,u>>8&255,255&u,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 i=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,i>>8&255,255&i,0,0]),e.box(e.types.esds,e.esds(t)))}},{key:"mp3",value:function(t){var i=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,i>>8&255,255&i,0,0]))}},{key:"stsd",value:function(t){return"audio"===t.type?"mp3"===t.segmentCodec&&"mp3"===t.codec?e.box(e.types.stsd,e.STSD,e.mp3(t)):e.box(e.types.stsd,e.STSD,e.mp4a(t)):e.box(e.types.stsd,e.STSD,e.avc1(t))}},{key:"tkhd",value:function(t){var i=t.id,r=t.duration*t.timescale,a=t.width,n=t.height,s=Math.floor(r/(Ef+1)),o=Math.floor(r%(Ef+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,i>>24&255,i>>16&255,i>>8&255,255&i,0,0,0,0,s>>24,s>>16&255,s>>8&255,255&s,o>>24,o>>16&255,o>>8&255,255&o,0,0,0,0,0,0,0,0,0,0,0,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,n>>8&255,255&n,0,0]))}},{key:"traf",value:function(t,i){var r=e.sdtp(t),a=t.id,n=Math.floor(i/(Ef+1)),s=Math.floor(i%(Ef+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,n>>24,n>>16&255,n>>8&255,255&n,s>>24,s>>16&255,s>>8&255,255&s])),e.trun(t,r.length+16+20+8+16+8+8),r)}},{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 i=t.id;return e.box(e.types.trex,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"trun",value:function(t,i){var r,a,n,s,o,c,l=t.samples||[],u=l.length,d=12+16*u,h=new Uint8Array(d);for(i+=8+d,h.set(["video"===t.type?1:0,0,15,1,u>>>24&255,u>>>16&255,u>>>8&255,255&u,i>>>24&255,i>>>16&255,i>>>8&255,255&i],0),r=0;r<u;r++)a=l[r],n=a.duration,s=a.size,o=a.flags,c=a.cts,h.set([n>>>24&255,n>>>16&255,n>>>8&255,255&n,s>>>24&255,s>>>16&255,s>>>8&255,255&s,o.isLeading<<2|o.dependsOn,o.isDependedOn<<6|o.hasRedundancy<<4|o.paddingValue<<1|o.isNonSync,61440&o.degradPrio,15&o.degradPrio,c>>>24&255,c>>>16&255,c>>>8&255,255&c],12+16*r);return e.box(e.types.trun,h)}},{key:"initSegment",value:function(t){e.types||e.init();var i=e.moov(t),r=new Uint8Array(e.FTYP.byteLength+i.byteLength);return r.set(e.FTYP),r.set(i,e.FTYP.byteLength),r}}]),e}();function Cf(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],a=e*t*i;return r?Math.round(a):a}function Rf(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Cf(e,1e3,1/9e4,t)}xf.types=void 0,xf.HDLR_TYPES=void 0,xf.STTS=void 0,xf.STSC=void 0,xf.STCO=void 0,xf.STSZ=void 0,xf.VMHD=void 0,xf.SMHD=void 0,xf.STSD=void 0,xf.FTYP=void 0,xf.DINF=void 0;var Lf,Df=null,If=null,Pf=function(){function e(t,i,r){if(Object(T["a"])(this,e),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextAvcDts=null,this.nextAudioPts=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=t,this.config=i,this.typeSupported=r,this.ISGenerated=!1,null===Df){var a=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Df=a?parseInt(a[1]):0}if(null===If){var n=navigator.userAgent.match(/Safari\/(\d+)/i);If=n?parseInt(n[1]):0}}return Object(S["a"])(e,[{key:"destroy",value:function(){}},{key:"resetTimeStamp",value:function(e){_l.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=e}},{key:"resetNextTimestamp",value:function(){_l.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}},{key:"resetInitSegment",value:function(){_l.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1}},{key:"getVideoStartPts",value:function(e){var t=!1,i=e.reduce((function(e,i){var r=i.pts-e;return r<-4294967296?(t=!0,Of(e,i.pts)):r>0?e:i.pts}),e[0].pts);return t&&_l.debug("PTS rollover detected"),i}},{key:"remux",value:function(e,t,i,r,a,n,s,o){var c,l,u,d,h,f,p=a,m=a,g=e.pid>-1,y=t.pid>-1,v=t.samples.length,b=e.samples.length>0,A=s&&v>0||v>1;if((!g||b)&&(!y||A)||this.ISGenerated||s){this.ISGenerated||(u=this.generateIS(e,t,a,n));var k,_=this.isVideoContiguous,w=-1;if(A&&(w=function(e){for(var t=0;t<e.length;t++)if(e[t].key)return t;return-1}(t.samples),!_&&this.config.forceKeyFrameOnDiscontinuity))if(f=!0,w>0){_l.warn("[mp4-remuxer]: Dropped ".concat(w," out of ").concat(v," video samples due to a missing keyframe"));var S=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(w),t.dropped+=w,m+=(t.samples[0].pts-S)/t.inputTimeScale,k=m}else-1===w&&(_l.warn("[mp4-remuxer]: No keyframe found out of ".concat(v," video samples")),f=!1);if(this.ISGenerated){if(b&&A){var T=this.getVideoStartPts(t.samples),E=(Of(e.samples[0].pts,T)-T)/t.inputTimeScale;p+=Math.max(0,E),m+=Math.max(0,-E)}if(b){if(e.samplerate||(_l.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),u=this.generateIS(e,t,a,n)),l=this.remuxAudio(e,p,this.isAudioContiguous,n,y||A||o===cd?m:void 0),A){var x=l?l.endPTS-l.startPTS:0;t.inputTimeScale||(_l.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),u=this.generateIS(e,t,a,n)),c=this.remuxVideo(t,m,_,x)}}else A&&(c=this.remuxVideo(t,m,_,0));c&&(c.firstKeyFrame=w,c.independent=-1!==w,c.firstKeyFramePTS=k)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(i.samples.length&&(h=Bf(i,a,this._initPTS,this._initDTS)),r.samples.length&&(d=Mf(r,a,this._initPTS))),{audio:l,video:c,initSegment:u,independent:f,text:d,id3:h}}},{key:"generateIS",value:function(e,t,i,r){var a,n,s,o=e.samples,c=t.samples,l=this.typeSupported,u={},d=this._initPTS,h=!d||r,f="audio/mp4";if(h&&(a=n=1/0),e.config&&o.length&&(e.timescale=e.samplerate,"mp3"===e.segmentCodec&&(l.mpeg?(f="audio/mpeg",e.codec=""):l.mp3&&(e.codec="mp3")),u.audio={id:"audio",container:f,codec:e.codec,initSegment:"mp3"===e.segmentCodec&&l.mpeg?new Uint8Array(0):xf.initSegment([e]),metadata:{channelCount:e.channelCount}},h&&(s=e.inputTimeScale,d&&s===d.timescale?h=!1:a=n=o[0].pts-Math.round(s*i))),t.sps&&t.pps&&c.length&&(t.timescale=t.inputTimeScale,u.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:xf.initSegment([t]),metadata:{width:t.width,height:t.height}},h))if(s=t.inputTimeScale,d&&s===d.timescale)h=!1;else{var p=this.getVideoStartPts(c),m=Math.round(s*i);n=Math.min(n,Of(c[0].dts,p)-m),a=Math.min(a,p-m)}if(Object.keys(u).length)return this.ISGenerated=!0,h?(this._initPTS={baseTime:a,timescale:s},this._initDTS={baseTime:n,timescale:s}):a=s=void 0,{tracks:u,initPTS:a,timescale:s}}},{key:"remuxVideo",value:function(e,t,i,r){var a,n,s=e.inputTimeScale,o=e.samples,c=[],l=o.length,u=this._initPTS,d=this.nextAvcDts,h=8,f=this.videoSampleDuration,p=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY,g=!1;(!i||null===d)&&(d=t*s-(o[0].pts-Of(o[0].dts,o[0].pts)));for(var y=u.baseTime*s/u.timescale,v=0;v<l;v++){var b=o[v];b.pts=Of(b.pts-y,d),b.dts=Of(b.dts-y,d),b.dts<o[v>0?v-1:v].dts&&(g=!0)}g&&o.sort((function(e,t){var i=e.dts-t.dts,r=e.pts-t.pts;return i||r})),a=o[0].dts,n=o[o.length-1].dts;var A=n-a,k=A?Math.round(A/(l-1)):f||e.inputTimeScale/30;if(i){var _=a-d,w=_>k,S=_<-1;if((w||S)&&(w?_l.warn("AVC: ".concat(Rf(_,!0)," ms (").concat(_,"dts) hole between fragments detected, filling it")):_l.warn("AVC: ".concat(Rf(-_,!0)," ms (").concat(_,"dts) overlapping between fragments detected")),!S||d>=o[0].pts)){a=d;var T=o[0].pts-_;o[0].dts=a,o[0].pts=T,_l.log("Video: First PTS/DTS adjusted: ".concat(Rf(T,!0),"/").concat(Rf(a,!0),", delta: ").concat(Rf(_,!0)," ms"))}}a=Math.max(0,a);for(var E=0,x=0,C=0;C<l;C++){for(var R=o[C],L=R.units,D=L.length,I=0,P=0;P<D;P++)I+=L[P].data.length;x+=I,E+=D,R.length=I,R.dts=Math.max(R.dts,a),p=Math.min(R.pts,p),m=Math.max(R.pts,m)}n=o[l-1].dts;var O,B=x+4*E+8;try{O=new Uint8Array(B)}catch(v){return void this.observer.emit(ml.ERROR,ml.ERROR,{type:gl.MUX_ERROR,details:yl.REMUX_ALLOC_ERROR,fatal:!1,error:v,bytes:B,reason:"fail allocating video mdat ".concat(B)})}var M=new DataView(O.buffer);M.setUint32(0,B),O.set(xf.types.mdat,4);for(var F=!1,U=Number.POSITIVE_INFINITY,j=Number.POSITIVE_INFINITY,N=Number.NEGATIVE_INFINITY,z=Number.NEGATIVE_INFINITY,G=0;G<l;G++){for(var H=o[G],V=H.units,W=void 0,q=0,K=0,J=V.length;K<J;K++){var Y=V[K],Q=Y.data,X=Y.data.byteLength;M.setUint32(h,X),h+=4,O.set(Q,h),h+=X,q+=4+X}if(G<l-1)f=o[G+1].dts-H.dts,W=o[G+1].pts-H.pts;else{var $=this.config,Z=G>0?H.dts-o[G-1].dts:k;if(W=G>0?H.pts-o[G-1].pts:k,$.stretchShortVideoTrack&&null!==this.nextAudioPts){var ee=Math.floor($.maxBufferHole*s),te=(r?p+r*s:this.nextAudioPts)-H.pts;te>ee?(f=te-Z,f<0?f=Z:F=!0,_l.log("[mp4-remuxer]: It is approximately ".concat(te/90," ms to the next segment; using duration ").concat(f/90," ms for the last video frame."))):f=Z}else f=Z}var ie=Math.round(H.pts-H.dts);U=Math.min(U,f),N=Math.max(N,f),j=Math.min(j,W),z=Math.max(z,W),c.push(new Ff(H.key,f,q,ie))}if(c.length)if(Df){if(Df<70){var re=c[0].flags;re.dependsOn=2,re.isNonSync=0}}else if(If&&z-j<N-U&&k/N<.025&&0===c[0].cts){_l.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");for(var ae=a,ne=0,se=c.length;ne<se;ne++){var oe=ae+c[ne].duration,ce=ae+c[ne].cts;if(ne<se-1){var le=oe+c[ne+1].cts;c[ne].duration=le-ce}else c[ne].duration=ne?c[ne-1].duration:k;c[ne].cts=0,ae=oe}}f=F||!f?k:f,this.nextAvcDts=d=n+f,this.videoSampleDuration=f,this.isVideoContiguous=!0;var ue={data1:xf.moof(e.sequenceNumber++,a,fl({},e,{samples:c})),data2:O,startPTS:p/s,endPTS:(m+f)/s,startDTS:a/s,endDTS:d/s,type:"video",hasAudio:!1,hasVideo:!0,nb:c.length,dropped:e.dropped};return e.samples=[],e.dropped=0,ue}},{key:"remuxAudio",value:function(e,t,i,r,a){var n=e.inputTimeScale,s=n/(e.samplerate?e.samplerate:n),o="aac"===e.segmentCodec?1024:1152,c=o*s,l=this._initPTS,u="mp3"===e.segmentCodec&&this.typeSupported.mpeg,d=[],h=void 0!==a,f=e.samples,p=u?0:8,m=this.nextAudioPts||-1,g=t*n,y=l.baseTime*n/l.timescale;if(this.isAudioContiguous=i=i||f.length&&m>0&&(r&&Math.abs(g-m)<9e3||Math.abs(Of(f[0].pts-y,g)-m)<20*c),f.forEach((function(e){e.pts=Of(e.pts-y,g)})),!i||m<0){if(f=f.filter((function(e){return e.pts>=0})),!f.length)return;m=0===a?0:r&&!h?Math.max(0,g):f[0].pts}if("aac"===e.segmentCodec)for(var v=this.config.maxAudioFramesDrift,b=0,A=m;b<f.length;b++){var k=f[b],_=k.pts,w=_-A,S=Math.abs(1e3*w/n);if(w<=-v*c&&h)0===b&&(_l.warn("Audio frame @ ".concat((_/n).toFixed(3),"s overlaps nextAudioPts by ").concat(Math.round(1e3*w/n)," ms.")),this.nextAudioPts=m=A=_);else if(w>=v*c&&S<1e4&&h){var T=Math.round(w/c);A=_-T*c,A<0&&(T--,A+=c),0===b&&(this.nextAudioPts=m=A),_l.warn("[mp4-remuxer]: Injecting ".concat(T," audio frame @ ").concat((A/n).toFixed(3),"s due to ").concat(Math.round(1e3*w/n)," ms gap."));for(var E=0;E<T;E++){var x=Math.max(A,0),C=Tf.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);C||(_l.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),C=k.unit.subarray()),f.splice(b,0,{unit:C,pts:x}),A+=c,b++}}k.pts=A,A+=c}for(var R,L=null,D=null,I=0,P=f.length;P--;)I+=f[P].unit.byteLength;for(var O=0,B=f.length;O<B;O++){var M=f[O],F=M.unit,U=M.pts;if(null!==D)d[O-1].duration=Math.round((U-D)/s);else{if(i&&"aac"===e.segmentCodec&&(U=m),L=U,!(I>0))return;I+=p;try{R=new Uint8Array(I)}catch(S){return void this.observer.emit(ml.ERROR,ml.ERROR,{type:gl.MUX_ERROR,details:yl.REMUX_ALLOC_ERROR,fatal:!1,error:S,bytes:I,reason:"fail allocating audio mdat ".concat(I)})}u||(new DataView(R.buffer).setUint32(0,I),R.set(xf.types.mdat,4))}R.set(F,p);var j=F.byteLength;p+=j,d.push(new Ff(!0,o,j,0)),D=U}var N=d.length;if(N){var z=d[d.length-1];this.nextAudioPts=m=D+s*z.duration;var G=u?new Uint8Array(0):xf.moof(e.sequenceNumber++,L/s,fl({},e,{samples:d}));e.samples=[];var H=L/n,V=m/n,W={data1:G,data2:R,startPTS:H,endPTS:V,startDTS:H,endDTS:V,type:"audio",hasAudio:!0,hasVideo:!1,nb:N};return this.isAudioContiguous=!0,W}}},{key:"remuxEmptyAudio",value:function(e,t,i,r){var a=e.inputTimeScale,n=a/(e.samplerate?e.samplerate:a),s=this.nextAudioPts,o=this._initDTS,c=9e4*o.baseTime/o.timescale,l=(null!==s?s:r.startDTS*a)+c,u=r.endDTS*a+c,d=1024*n,h=Math.ceil((u-l)/d),f=Tf.getSilentFrame(e.manifestCodec||e.codec,e.channelCount);if(_l.warn("[mp4-remuxer]: remux empty Audio"),f){for(var p=[],m=0;m<h;m++){var g=l+m*d;p.push({unit:f,pts:g,dts:g})}return e.samples=p,this.remuxAudio(e,t,i,!1)}_l.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec")}}]),e}();function Of(e,t){var i;if(null===t)return e;for(i=t<e?-8589934592:8589934592;Math.abs(e-t)>4294967296;)e+=i;return e}function Bf(e,t,i,r){var a=e.samples.length;if(a){for(var n=e.inputTimeScale,s=0;s<a;s++){var o=e.samples[s];o.pts=Of(o.pts-i.baseTime*n/i.timescale,t*n)/n,o.dts=Of(o.dts-r.baseTime*n/r.timescale,t*n)/n}var c=e.samples;return e.samples=[],{samples:c}}}function Mf(e,t,i){var r=e.samples.length;if(r){for(var a=e.inputTimeScale,n=0;n<r;n++){var s=e.samples[n];s.pts=Of(s.pts-i.baseTime*a/i.timescale,t*a)/a}e.samples.sort((function(e,t){return e.pts-t.pts}));var o=e.samples;return e.samples=[],{samples:o}}}var Ff=Object(S["a"])((function e(t,i,r,a){Object(T["a"])(this,e),this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=i,this.size=r,this.cts=a,this.flags=new Uf(t)})),Uf=Object(S["a"])((function e(t){Object(T["a"])(this,e),this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=t?2:1,this.isNonSync=t?0:1}));function jf(e,t){var i=null==e?void 0:e.codec;return i&&i.length>4?i:"hvc1"===i||"hev1"===i?"hvc1.1.6.L120.90":"av01"===i?"av01.0.04M.08":"avc1"===i||t===Ll?"avc1.42e01e":"mp4a.40.5"}try{Lf=self.performance.now.bind(self.performance)}catch(Yy){_l.debug("Unable to use Performance API on this environment"),Lf=("undefined"===typeof self?"undefined":Object(E["a"])(self))<"u"&&self.Date.now}var Nf=[{demux:function(){function e(t,i){Object(T["a"])(this,e),this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=i}return Object(S["a"])(e,[{key:"resetTimeStamp",value:function(){}},{key:"resetInitSegment",value:function(e,t,i,r){var a=this.videoTrack=qh("video",1),n=this.audioTrack=qh("audio",1),s=this.txtTrack=qh("text",1);if(this.id3Track=qh("id3",1),this.timeOffset=0,null!=e&&e.byteLength){var o=wu(e);if(o.video){var c=o.video,l=c.id,u=c.timescale,d=c.codec;a.id=l,a.timescale=s.timescale=u,a.codec=d}if(o.audio){var h=o.audio,f=h.id,p=h.timescale,m=h.codec;n.id=f,n.timescale=p,n.codec=m}s.id=mu.text,a.sampleDuration=0,a.duration=n.duration=r}}},{key:"resetContiguity",value:function(){this.remainderData=null}},{key:"demux",value:function(e,t){this.timeOffset=t;var i=e,r=this.videoTrack,a=this.txtTrack;if(this.config.progressive){this.remainderData&&(i=Eu(this.remainderData,e));var n=function(e){var t={valid:null,remainder:null},i=ku(e,["moof"]);if(!i)return t;if(i.length<2)return t.remainder=e,t;var r=i[i.length-1];return t.valid=Yl(e,0,r.byteOffset-8),t.remainder=Yl(e,r.byteOffset-8),t}(i);this.remainderData=n.remainder,r.samples=n.valid||new Uint8Array}else r.samples=i;var s=this.extractID3Track(r,t);return a.samples=xu(t,r),{videoTrack:r,audioTrack:this.audioTrack,id3Track:s,textTrack:this.txtTrack}}},{key:"flush",value:function(){var e=this.timeOffset,t=this.videoTrack,i=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;var r=this.extractID3Track(t,this.timeOffset);return i.samples=xu(e,t),{videoTrack:t,audioTrack:qh(),id3Track:r,textTrack:qh()}}},{key:"extractID3Track",value:function(e,t){var i=this.id3Track;if(e.samples.length){var r=ku(e.samples,["emsg"]);r&&r.forEach((function(e){var r=function(e){var t=e[0],i="",r="",a=0,n=0,s=0,o=0,c=0,l=0;if(0===t){for(;"\0"!==gu(e.subarray(l,l+1));)i+=gu(e.subarray(l,l+1)),l+=1;for(i+=gu(e.subarray(l,l+1)),l+=1;"\0"!==gu(e.subarray(l,l+1));)r+=gu(e.subarray(l,l+1)),l+=1;r+=gu(e.subarray(l,l+1)),l+=1,a=vu(e,12),n=vu(e,16),o=vu(e,20),c=vu(e,24),l=28}else if(1===t){l+=4,a=vu(e,l),l+=4;var u=vu(e,l);l+=4;var d=vu(e,l);for(l+=4,s=4294967296*u+d,Number.isSafeInteger(s)||(s=Number.MAX_SAFE_INTEGER,_l.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),o=vu(e,l),l+=4,c=vu(e,l),l+=4;"\0"!==gu(e.subarray(l,l+1));)i+=gu(e.subarray(l,l+1)),l+=1;for(i+=gu(e.subarray(l,l+1)),l+=1;"\0"!==gu(e.subarray(l,l+1));)r+=gu(e.subarray(l,l+1)),l+=1;r+=gu(e.subarray(l,l+1)),l+=1}return{schemeIdUri:i,value:r,timeScale:a,presentationTime:s,presentationTimeDelta:n,eventDuration:o,id:c,payload:e.subarray(l,e.byteLength)}}(e);if(af.test(r.schemeIdUri)){var a=pl(r.presentationTime)?r.presentationTime/r.timeScale:t+r.presentationTimeDelta/r.timeScale,n=4294967295===r.eventDuration?Number.POSITIVE_INFINITY:r.eventDuration/r.timeScale;n<=.001&&(n=Number.POSITIVE_INFINITY);var s=r.payload;i.samples.push({data:s,len:s.byteLength,dts:a,pts:a,type:bd,duration:n})}}))}return i}},{key:"demuxSampleAes",value:function(e,t,i){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}},{key:"destroy",value:function(){}}],[{key:"probe",value:function(e){return ku(e=e.length>16384?e.subarray(0,16384):e,["moof"]).length>0}}]),e}(),remux:function(){function e(){Object(T["a"])(this,e),this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null}return Object(S["a"])(e,[{key:"destroy",value:function(){}},{key:"resetTimeStamp",value:function(e){this.initPTS=e,this.lastEndTime=null}},{key:"resetNextTimestamp",value:function(){this.lastEndTime=null}},{key:"resetInitSegment",value:function(e,t,i,r){this.audioCodec=t,this.videoCodec=i,this.generateInitSegment(function(e,t){if(!e||!t)return e;var i=t.keyId;return i&&t.isCommonEncryption&&ku(e,["moov","trak"]).forEach((function(e){var t=ku(e,["mdia","minf","stbl","stsd"])[0].subarray(8),r=ku(t,["enca"]),a=r.length>0;a||(r=ku(t,["encv"])),r.forEach((function(e){ku(a?e.subarray(28):e.subarray(78),["sinf"]).forEach((function(e){var t=Su(e);if(t){var r=t.subarray(8,24);r.some((function(e){return 0!==e}))||(_l.log("[eme] Patching keyId in 'enc".concat(a?"a":"v",">sinf>>tenc' box: ").concat(hu(r)," -> ").concat(hu(i))),t.set(i,8))}}))}))})),e}(e,r)),this.emitInitSegment=!0}},{key:"generateInitSegment",value:function(e){var t=this.audioCodec,i=this.videoCodec;if(null==e||!e.byteLength)return this.initTracks=void 0,void(this.initData=void 0);var r=this.initData=wu(e);t||(t=jf(r.audio,Rl)),i||(i=jf(r.video,Ll));var a={};r.audio&&r.video?a.audiovideo={container:"video/mp4",codec:t+","+i,initSegment:e,id:"main"}:r.audio?a.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:r.video?a.video={container:"video/mp4",codec:i,initSegment:e,id:"main"}:_l.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=a}},{key:"remux",value:function(e,t,i,r,a,n){var s,o,c=this.initPTS,l=this.lastEndTime,u={audio:void 0,video:void 0,text:r,id3:i,initSegment:void 0};pl(l)||(l=this.lastEndTime=a||0);var d=t.samples;if(null==d||!d.length)return u;var h={initPTS:void 0,timescale:1},f=this.initData;if(null!=(s=f)&&s.length||(this.generateInitSegment(d),f=this.initData),null==(o=f)||!o.length)return _l.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),u;this.emitInitSegment&&(h.tracks=this.initTracks,this.emitInitSegment=!1);var p=function(e,t){for(var i=0,r=0,a=0,n=ku(e,["moof","traf"]),s=0;s<n.length;s++){var o=n[s],c=ku(o,["tfhd"])[0],l=t[vu(c,4)];if(l){var u=l["default"],d=vu(c,0)|(null==u?void 0:u.flags),h=null==u?void 0:u.duration;8&d&&(h=vu(c,2&d?12:8));for(var f=l.timescale||9e4,p=ku(o,["trun"]),m=0;m<p.length;m++)i=Tu(p[m]),!i&&h&&(i=h*vu(p[m],4)),l.type===Ll?r+=i/f:l.type===Rl&&(a+=i/f)}}if(0===r&&0===a){for(var g=0,y=ku(e,["sidx"]),v=0;v<y.length;v++){var b=_u(y[v]);null!=b&&b.references&&(g+=b.references.reduce((function(e,t){return e+t.info.duration||0}),0))}return g}return r||a}(d,f),m=function(e,t){return ku(t,["moof","traf"]).reduce((function(t,i){var r=ku(i,["tfdt"])[0],a=r[0],n=ku(i,["tfhd"]).reduce((function(t,i){var n=vu(i,4),s=e[n];if(s){var o=vu(r,4);if(1===a){if(o===fu)return _l.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"),t;o*=fu+1,o+=vu(r,8)}var c=o/(s.timescale||9e4);if(isFinite(c)&&(null===t||c<t))return c}return t}),null);return null!==n&&isFinite(n)&&(null===t||n<t)?n:t}),null)}(f,d),g=null===m?a:m;(function(e,t,i,r){if(null===e)return!0;var a=Math.max(r,1),n=t-e.baseTime/e.timescale;return Math.abs(n-i)>a}(c,g,a,p)||h.timescale!==c.timescale&&n)&&(h.initPTS=g-a,c&&1===c.timescale&&_l.warn("Adjusting initPTS by "+(h.initPTS-c.baseTime)),this.initPTS=c={baseTime:h.initPTS,timescale:1});var y=e?g-c.baseTime/c.timescale:l,v=y+p;(function(e,t,i){ku(t,["moof","traf"]).forEach((function(t){ku(t,["tfhd"]).forEach((function(r){var a=vu(r,4),n=e[a];if(n){var s=n.timescale||9e4;ku(t,["tfdt"]).forEach((function(e){var t=e[0],r=vu(e,4);if(0===t)r-=i*s,r=Math.max(r,0),Au(e,4,r);else{r*=Math.pow(2,32),r+=vu(e,8),r-=i*s,r=Math.max(r,0);var a=Math.floor(r/(fu+1)),n=Math.floor(r%(fu+1));Au(e,4,a),Au(e,8,n)}}))}}))}))})(f,d,c.baseTime/c.timescale),p>0?this.lastEndTime=v:(_l.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var b=!!f.audio,A=!!f.video,k="";b&&(k+="audio"),A&&(k+="video");var _={data1:d,startPTS:y,startDTS:y,endPTS:v,endDTS:v,type:k,hasAudio:b,hasVideo:A,nb:1,dropped:0};return u.audio="audio"===_.type?_:void 0,u.video="audio"!==_.type?_:void 0,u.initSegment=h,u.id3=Bf(i,a,c,c),r.samples.length&&(u.text=Mf(r,a,c)),u}}]),e}()},{demux:vf,remux:Pf},{demux:function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e,r){var a;return Object(T["a"])(this,i),a=t.call(this),a.observer=void 0,a.config=void 0,a.observer=e,a.config=r,a}return Object(S["a"])(i,[{key:"resetInitSegment",value:function(e,t,r,a){k(Object(b["a"])(i.prototype),"resetInitSegment",this).call(this,e,t,r,a),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:a,inputTimeScale:9e4,dropped:0}}},{key:"canParse",value:function(e,t){return function(e,t){return function(e,t){return t+5<e.length}(e,t)&&Yh(e,t)&&Xh(e,t)<=e.length-t}(e,t)}},{key:"appendFrame",value:function(e,t,i){ef(e,this.observer,t,i,e.manifestCodec);var r=rf(e,t,i,this.basePTS,this.frameIndex);if(r&&0===r.missing)return r}}],[{key:"probe",value:function(e){if(!e)return!1;for(var t=(Zl(e,0)||[]).length,i=e.length;t<i;t++)if(Zh(e,t))return _l.log("ADTS sync word found !"),!0;return!1}}]),i}(Kh),remux:Pf},{demux:function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(){return Object(T["a"])(this,i),t.apply(this,arguments)}return Object(S["a"])(i,[{key:"resetInitSegment",value:function(e,t,r,a){k(Object(b["a"])(i.prototype),"resetInitSegment",this).call(this,e,t,r,a),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:a,inputTimeScale:9e4,dropped:0}}},{key:"canParse",value:function(e,t){return function(e,t){return hf(e,t)&&4<=e.length-t}(e,t)}},{key:"appendFrame",value:function(e,t,i){if(null!==this.basePTS)return uf(e,t,i,this.basePTS,this.frameIndex)}}],[{key:"probe",value:function(e){if(!e)return!1;for(var t=(Zl(e,0)||[]).length,i=e.length;t<i;t++)if(pf(e,t))return _l.log("MPEG Audio sync word found !"),!0;return!1}}]),i}(Kh),remux:Pf}],zf=function(){function e(t,i,r,a,n){Object(T["a"])(this,e),this.async=!1,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=t,this.typeSupported=i,this.config=r,this.vendor=a,this.id=n}return Object(S["a"])(e,[{key:"configure",value:function(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}},{key:"push",value:function(e,t,i,r){var a=this,n=i.transmuxing;n.executeStart=Lf();var s=new Uint8Array(e),o=this.currentTransmuxState,c=this.transmuxConfig;r&&(this.currentTransmuxState=r);var l=r||o,u=l.contiguous,d=l.discontinuity,h=l.trackSwitch,f=l.accurateTimeOffset,p=l.timeOffset,m=l.initSegmentChange,g=c.audioCodec,y=c.videoCodec,v=c.defaultInitPts,b=c.duration,A=c.initSegmentData,k=function(e,t){var i=null;return e.byteLength>0&&null!=t&&null!=t.key&&null!==t.iv&&null!=t.method&&(i=t),i}(s,t);if(k&&"AES-128"===k.method){var _=this.getDecrypter();if(!_.isSync())return this.decryptionPromise=_.webCryptoDecrypt(s,k.key.buffer,k.iv.buffer).then((function(e){var t=a.push(e,null,i);return a.decryptionPromise=null,t})),this.decryptionPromise;var w=_.softwareDecrypt(s,k.key.buffer,k.iv.buffer);if(i.part>-1&&(w=_.flush()),!w)return n.executeEnd=Lf(),Gf(i);s=new Uint8Array(w)}var S=this.needsProbing(d,h);if(S){var T=this.configureTransmuxer(s);if(T)return _l.warn("[transmuxer] ".concat(T.message)),this.observer.emit(ml.ERROR,ml.ERROR,{type:gl.MEDIA_ERROR,details:yl.FRAG_PARSING_ERROR,fatal:!1,error:T,reason:T.message}),n.executeEnd=Lf(),Gf(i)}(d||h||m||S)&&this.resetInitSegment(A,g,y,b,t),(d||m||S)&&this.resetInitialTimestamp(v),u||this.resetContiguity();var E=this.transmux(s,k,p,f,i),x=this.currentTransmuxState;return x.contiguous=!0,x.discontinuity=!1,x.trackSwitch=!1,n.executeEnd=Lf(),E}},{key:"flush",value:function(e){var t=this,i=e.transmuxing;i.executeStart=Lf();var r=this.decrypter,a=this.currentTransmuxState,n=this.decryptionPromise;if(n)return n.then((function(){return t.flush(e)}));var s=[],o=a.timeOffset;if(r){var c=r.flush();c&&s.push(this.push(c,null,e))}var l=this.demuxer,u=this.remuxer;if(!l||!u)return i.executeEnd=Lf(),[Gf(e)];var d=l.flush(o);return Hf(d)?d.then((function(i){return t.flushRemux(s,i,e),s})):(this.flushRemux(s,d,e),s)}},{key:"flushRemux",value:function(e,t,i){var r=t.audioTrack,a=t.videoTrack,n=t.id3Track,s=t.textTrack,o=this.currentTransmuxState,c=o.accurateTimeOffset,l=o.timeOffset;_l.log("[transmuxer.ts]: Flushed fragment ".concat(i.sn).concat(i.part>-1?" p: "+i.part:""," of level ").concat(i.level));var u=this.remuxer.remux(r,a,n,s,l,c,!0,this.id);e.push({remuxResult:u,chunkMeta:i}),i.transmuxing.executeEnd=Lf()}},{key:"resetInitialTimestamp",value:function(e){var t=this.demuxer,i=this.remuxer;t&&i&&(t.resetTimeStamp(e),i.resetTimeStamp(e))}},{key:"resetContiguity",value:function(){var e=this.demuxer,t=this.remuxer;e&&t&&(e.resetContiguity(),t.resetNextTimestamp())}},{key:"resetInitSegment",value:function(e,t,i,r,a){var n=this.demuxer,s=this.remuxer;n&&s&&(n.resetInitSegment(e,t,i,r),s.resetInitSegment(e,t,i,a))}},{key:"destroy",value:function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}},{key:"transmux",value:function(e,t,i,r,a){var n;return n=t&&"SAMPLE-AES"===t.method?this.transmuxSampleAes(e,t,i,r,a):this.transmuxUnencrypted(e,i,r,a),n}},{key:"transmuxUnencrypted",value:function(e,t,i,r){var a=this.demuxer.demux(e,t,!1,!this.config.progressive),n=a.audioTrack,s=a.videoTrack,o=a.id3Track,c=a.textTrack;return{remuxResult:this.remuxer.remux(n,s,o,c,t,i,!1,this.id),chunkMeta:r}}},{key:"transmuxSampleAes",value:function(e,t,i,r,a){var n=this;return this.demuxer.demuxSampleAes(e,t,i).then((function(e){return{remuxResult:n.remuxer.remux(e.audioTrack,e.videoTrack,e.id3Track,e.textTrack,i,r,!1,n.id),chunkMeta:a}}))}},{key:"configureTransmuxer",value:function(e){for(var t,i=this.config,r=this.observer,a=this.typeSupported,n=this.vendor,s=0,o=Nf.length;s<o;s++)if(Nf[s].demux.probe(e)){t=Nf[s];break}if(!t)return new Error("Failed to find demuxer by probing fragment data");var c=this.demuxer,l=this.remuxer,u=t.remux,d=t.demux;l&&l instanceof u||(this.remuxer=new u(r,i,a,n)),c&&c instanceof d||(this.demuxer=new d(r,i,a),this.probe=d.probe)}},{key:"needsProbing",value:function(e,t){return!this.demuxer||!this.remuxer||e||t}},{key:"getDecrypter",value:function(){var e=this.decrypter;return e||(e=this.decrypter=new Lh(this.config)),e}}]),e}(),Gf=function(e){return{remuxResult:{},chunkMeta:e}};function Hf(e){return"then"in e&&e.then instanceof Function}var Vf=Object(S["a"])((function e(t,i,r,a,n){Object(T["a"])(this,e),this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=t,this.videoCodec=i,this.initSegmentData=r,this.duration=a,this.defaultInitPts=n||null})),Wf=Object(S["a"])((function e(t,i,r,a,n,s){Object(T["a"])(this,e),this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=t,this.contiguous=i,this.accurateTimeOffset=r,this.trackSwitch=a,this.timeOffset=n,this.initSegmentChange=s})),qf={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,i="~";function r(){}function a(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function n(e,t,r,n,s){if("function"!=typeof r)throw new TypeError("The listener must be a function");var o=new a(r,n||e,s),c=i?i+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],o]:e._events[c].push(o):(e._events[c]=o,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function o(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(i=!1)),o.prototype.eventNames=function(){var e,r,a=[];if(0===this._eventsCount)return a;for(r in e=this._events)t.call(e,r)&&a.push(i?r.slice(1):r);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(e)):a},o.prototype.listeners=function(e){var t=i?i+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var a=0,n=r.length,s=new Array(n);a<n;a++)s[a]=r[a].fn;return s},o.prototype.listenerCount=function(e){var t=i?i+e:e,r=this._events[t];return r?r.fn?1:r.length:0},o.prototype.emit=function(e,t,r,a,n,s){var o=i?i+e:e;if(!this._events[o])return!1;var c,l,u=this._events[o],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,a),!0;case 5:return u.fn.call(u.context,t,r,a,n),!0;case 6:return u.fn.call(u.context,t,r,a,n,s),!0}for(l=1,c=new Array(d-1);l<d;l++)c[l-1]=arguments[l];u.fn.apply(u.context,c)}else{var h,f=u.length;for(l=0;l<f;l++)switch(u[l].once&&this.removeListener(e,u[l].fn,void 0,!0),d){case 1:u[l].fn.call(u[l].context);break;case 2:u[l].fn.call(u[l].context,t);break;case 3:u[l].fn.call(u[l].context,t,r);break;case 4:u[l].fn.call(u[l].context,t,r,a);break;default:if(!c)for(h=1,c=new Array(d-1);h<d;h++)c[h-1]=arguments[h];u[l].fn.apply(u[l].context,c)}}return!0},o.prototype.on=function(e,t,i){return n(this,e,t,i,!1)},o.prototype.once=function(e,t,i){return n(this,e,t,i,!0)},o.prototype.removeListener=function(e,t,r,a){var n=i?i+e:e;if(!this._events[n])return this;if(!t)return s(this,n),this;var o=this._events[n];if(o.fn)o.fn!==t||a&&!o.once||r&&o.context!==r||s(this,n);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||a&&!o[c].once||r&&o[c].context!==r)&&l.push(o[c]);l.length?this._events[n]=1===l.length?l[0]:l:s(this,n)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&s(this,t)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,e.exports=o})(qf);var Kf=ol(qf.exports),Jf=Nu()||{isTypeSupported:function(){return!1}},Yf=function(){function e(t,i,r,a){var n=this;Object(T["a"])(this,e),this.error=null,this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0;var s=t.config;this.hls=t,this.id=i,this.useWorker=!!s.enableWorker,this.onTransmuxComplete=r,this.onFlush=a;var o=function(e,t){(t=t||{}).frag=n.frag,t.id=n.id,e===ml.ERROR&&(n.error=t.error),n.hls.trigger(e,t)};this.observer=new Kf,this.observer.on(ml.FRAG_DECRYPTED,o),this.observer.on(ml.ERROR,o);var c={mp4:Jf.isTypeSupported("video/mp4"),mpeg:Jf.isTypeSupported("audio/mpeg"),mp3:Jf.isTypeSupported('audio/mp4; codecs="mp3"')},l=navigator.vendor;if(this.useWorker&&("undefined"===typeof Worker?"undefined":Object(E["a"])(Worker))<"u"&&(s.workerPath||"function"==typeof __HLS_WORKER_BUNDLE__))try{s.workerPath?(_l.log("loading Web Worker ".concat(s.workerPath,' for "').concat(i,'"')),this.workerContext=function(e){var t=new self.URL(e,self.location.href).href;return{worker:new self.Worker(t),scriptURL:t}}(s.workerPath)):(_l.log('injecting Web Worker for "'.concat(i,'"')),this.workerContext=function(){var e=new self.Blob(["var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(".concat(__HLS_WORKER_BUNDLE__.toString(),")(true);")],{type:"text/javascript"}),t=self.URL.createObjectURL(e);return{worker:new self.Worker(t),objectURL:t}}()),this.onwmsg=function(e){return n.onWorkerMessage(e)};var u=this.workerContext.worker;u.addEventListener("message",this.onwmsg),u.onerror=function(e){var t=new Error("".concat(e.message," (").concat(e.filename,":").concat(e.lineno,")"));s.enableWorker=!1,_l.warn('Error in "'.concat(i,'" Web Worker, fallback to inline')),n.hls.trigger(ml.ERROR,{type:gl.OTHER_ERROR,details:yl.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:t})},u.postMessage({cmd:"init",typeSupported:c,vendor:l,id:i,config:JSON.stringify(s)})}catch(u){_l.warn('Error setting up "'.concat(i,'" Web Worker, fallback to inline'),u),this.resetWorker(),this.error=null,this.transmuxer=new zf(this.observer,c,s,l,i)}else this.transmuxer=new zf(this.observer,c,s,l,i)}return Object(S["a"])(e,[{key:"resetWorker",value:function(){if(this.workerContext){var e=this.workerContext,t=e.worker,i=e.objectURL;i&&self.URL.revokeObjectURL(i),t.removeEventListener("message",this.onwmsg),t.onerror=null,t.terminate(),this.workerContext=null}}},{key:"destroy",value:function(){if(this.workerContext)this.resetWorker(),this.onwmsg=void 0;else{var e=this.transmuxer;e&&(e.destroy(),this.transmuxer=null)}var t=this.observer;t&&t.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null}},{key:"push",value:function(e,t,i,r,a,n,s,o,c,l){var u,d,h=this;c.transmuxing.start=self.performance.now();var f=this.transmuxer,p=n?n.start:a.start,m=a.decryptdata,g=this.frag,y=!(g&&a.cc===g.cc),v=!(g&&c.level===g.level),b=g?c.sn-g.sn:-1,A=this.part?c.part-this.part.index:-1,k=0===b&&c.id>1&&c.id===(null==g?void 0:g.stats.chunkCount),_=!v&&(1===b||0===b&&(1===A||k&&A<=0)),w=self.performance.now();(v||b||0===a.stats.parsing.start)&&(a.stats.parsing.start=w),!n||!A&&_||(n.stats.parsing.start=w);var S=!(g&&(null==(u=a.initSegment)?void 0:u.url)===(null==(d=g.initSegment)?void 0:d.url)),T=new Wf(y,_,o,v,p,S);if(!_||y||S){_l.log("[transmuxer-interface, ".concat(a.type,"]: Starting new transmux session for sn: ").concat(c.sn," p: ").concat(c.part," level: ").concat(c.level," id: ").concat(c.id,"\n discontinuity: ").concat(y,"\n trackSwitch: ").concat(v,"\n contiguous: ").concat(_,"\n accurateTimeOffset: ").concat(o,"\n timeOffset: ").concat(p,"\n initSegmentChange: ").concat(S));var E=new Vf(i,r,t,s,l);this.configureTransmuxer(E)}if(this.frag=a,this.part=n,this.workerContext)this.workerContext.worker.postMessage({cmd:"demux",data:e,decryptdata:m,chunkMeta:c,state:T},e instanceof ArrayBuffer?[e]:[]);else if(f){var x=f.push(e,m,c,T);Hf(x)?(f.async=!0,x.then((function(e){h.handleTransmuxComplete(e)}))["catch"]((function(e){h.transmuxerError(e,c,"transmuxer-interface push error")}))):(f.async=!1,this.handleTransmuxComplete(x))}}},{key:"flush",value:function(e){var t=this;e.transmuxing.start=self.performance.now();var i=this.transmuxer;if(this.workerContext)this.workerContext.worker.postMessage({cmd:"flush",chunkMeta:e});else if(i){var r=i.flush(e);Hf(r)||i.async?(Hf(r)||(r=Promise.resolve(r)),r.then((function(i){t.handleFlushResult(i,e)}))["catch"]((function(i){t.transmuxerError(i,e,"transmuxer-interface flush error")}))):this.handleFlushResult(r,e)}}},{key:"transmuxerError",value:function(e,t,i){this.hls&&(this.error=e,this.hls.trigger(ml.ERROR,{type:gl.MEDIA_ERROR,details:yl.FRAG_PARSING_ERROR,chunkMeta:t,fatal:!1,error:e,err:e,reason:i}))}},{key:"handleFlushResult",value:function(e,t){var i=this;e.forEach((function(e){i.handleTransmuxComplete(e)})),this.onFlush(t)}},{key:"onWorkerMessage",value:function(e){var t=e.data,i=this.hls;switch(t.event){case"init":var r,a=null==(r=this.workerContext)?void 0:r.objectURL;a&&self.URL.revokeObjectURL(a);break;case"transmuxComplete":this.handleTransmuxComplete(t.data);break;case"flush":this.onFlush(t.data);break;case"workerLog":_l[t.data.logType]&&_l[t.data.logType](t.data.message);break;default:t.data=t.data||{},t.data.frag=this.frag,t.data.id=this.id,i.trigger(t.event,t.data)}}},{key:"configureTransmuxer",value:function(e){var t=this.transmuxer;this.workerContext?this.workerContext.worker.postMessage({cmd:"configure",config:e}):t&&t.configure(e)}},{key:"handleTransmuxComplete",value:function(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}]),e}(),Qf=function(){function e(t,i,r,a){Object(T["a"])(this,e),this.config=void 0,this.media=null,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=t,this.media=i,this.fragmentTracker=r,this.hls=a}return Object(S["a"])(e,[{key:"destroy",value:function(){this.media=null,this.hls=this.fragmentTracker=null}},{key:"poll",value:function(e,t){var i=this.config,r=this.media,a=this.stalled;if(null!==r){var n=r.currentTime,s=r.seeking,o=this.seeking&&!s,c=!this.seeking&&s;if(this.seeking=s,n===e){if(c||o)this.stalled=null;else if(!(r.paused&&!s||r.ended||0===r.playbackRate)&&Ah.getBuffered(r).length){var l=Ah.bufferInfo(r,n,0),u=l.len>0,d=l.nextStart||0;if(u||d){if(s){var h=l.len>2,f=!d||t&&t.start<=n||d-n>2&&!this.fragmentTracker.getPartialFragment(n);if(h||f)return;this.moved=!1}if(!this.moved&&null!==this.stalled){var p,m=Math.max(d,l.start||0)-n,g=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,y=null!=g&&null!=(p=g.details)&&p.live?2*g.details.targetduration:2,v=this.fragmentTracker.getPartialFragment(n);if(m>0&&(m<=y||v))return void this._trySkipBufferHole(v)}var b=self.performance.now();if(null!==a){var A=b-a;if(s||!(A>=250)||(this._reportStall(l),this.media)){var k=Ah.bufferInfo(r,n,i.maxBufferHole);this._tryFixBufferStall(k,A)}}else this.stalled=b}}}else if(this.moved=!0,null!==a){if(this.stallReported){var _=self.performance.now()-a;_l.warn("playback not stuck anymore @".concat(n,", after ").concat(Math.round(_),"ms")),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}}}},{key:"_tryFixBufferStall",value:function(e,t){var i=this.config,r=this.fragmentTracker,a=this.media;if(null!==a){var n=a.currentTime,s=r.getPartialFragment(n);s&&(this._trySkipBufferHole(s)||!this.media)||(e.len>i.maxBufferHole||e.nextStart&&e.nextStart-n<i.maxBufferHole)&&t>1e3*i.highBufferWatchdogPeriod&&(_l.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}}},{key:"_reportStall",value:function(e){var t=this.hls,i=this.media,r=this.stallReported;if(!r&&i){this.stallReported=!0;var a=new Error("Playback stalling at @".concat(i.currentTime," due to low buffer (").concat(JSON.stringify(e),")"));_l.warn(a.message),t.trigger(ml.ERROR,{type:gl.MEDIA_ERROR,details:yl.BUFFER_STALLED_ERROR,fatal:!1,error:a,buffer:e.len})}}},{key:"_trySkipBufferHole",value:function(e){var t=this.config,i=this.hls,r=this.media;if(null===r)return 0;var a=r.currentTime,n=Ah.bufferInfo(r,a,0),s=a<n.start?n.start:n.nextStart;if(s){var o=n.len<=t.maxBufferHole,c=n.len>0&&n.len<1&&r.readyState<3,l=s-a;if(l>0&&(o||c)){if(l>t.maxBufferHole){var u=this.fragmentTracker,d=!1;if(0===a){var h=u.getAppendedFrag(0,od);h&&s<h.end&&(d=!0)}if(!d){var f=e||u.getAppendedFrag(a,od);if(f){for(var p=!1,m=f.end;m<s;){var g=u.getPartialFragment(m);if(!g){p=!0;break}m+=g.duration}if(p)return 0}}}var y=Math.max(s+.05,a+.1);if(_l.warn("skipping hole, adjusting currentTime from ".concat(a," to ").concat(y)),this.moved=!0,this.stalled=null,r.currentTime=y,e&&!e.gap){var v=new Error("fragment loaded with buffer holes, seeking from ".concat(a," to ").concat(y));i.trigger(ml.ERROR,{type:gl.MEDIA_ERROR,details:yl.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:v,reason:v.message,frag:e})}return y}}return 0}},{key:"_tryNudgeBuffer",value:function(){var e=this.config,t=this.hls,i=this.media,r=this.nudgeRetry;if(null!==i){var a=i.currentTime;if(this.nudgeRetry++,r<e.nudgeMaxRetry){var n=a+(r+1)*e.nudgeOffset,s=new Error("Nudging 'currentTime' from ".concat(a," to ").concat(n));_l.warn(s.message),i.currentTime=n,t.trigger(ml.ERROR,{type:gl.MEDIA_ERROR,details:yl.BUFFER_NUDGE_ON_STALL,error:s,fatal:!1})}else{var o=new Error("Playhead still not moving while enough data buffered @".concat(a," after ").concat(e.nudgeMaxRetry," nudges"));_l.error(o.message),t.trigger(ml.ERROR,{type:gl.MEDIA_ERROR,details:yl.BUFFER_STALLED_ERROR,error:o,fatal:!0})}}}}]),e}(),Xf=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e,r,a){var n;return Object(T["a"])(this,i),n=t.call(this,e,r,a,"[stream-controller]",od),n.audioCodecSwap=!1,n.gapController=null,n.level=-1,n._forceStartLoad=!1,n.altAudio=!1,n.audioOnly=!1,n.fragPlaying=null,n.onvplaying=null,n.onvseeked=null,n.fragLastKbps=0,n.couldBacktrack=!1,n.backtrackFragment=null,n.audioCodecSwitch=!1,n.videoBuffer=null,n._registerListeners(),n}return Object(S["a"])(i,[{key:"_registerListeners",value:function(){var e=this.hls;e.on(ml.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(ml.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(ml.MANIFEST_LOADING,this.onManifestLoading,this),e.on(ml.MANIFEST_PARSED,this.onManifestParsed,this),e.on(ml.LEVEL_LOADING,this.onLevelLoading,this),e.on(ml.LEVEL_LOADED,this.onLevelLoaded,this),e.on(ml.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(ml.ERROR,this.onError,this),e.on(ml.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(ml.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(ml.BUFFER_CREATED,this.onBufferCreated,this),e.on(ml.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(ml.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(ml.FRAG_BUFFERED,this.onFragBuffered,this)}},{key:"_unregisterListeners",value:function(){var e=this.hls;e.off(ml.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(ml.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(ml.MANIFEST_LOADING,this.onManifestLoading,this),e.off(ml.MANIFEST_PARSED,this.onManifestParsed,this),e.off(ml.LEVEL_LOADED,this.onLevelLoaded,this),e.off(ml.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(ml.ERROR,this.onError,this),e.off(ml.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(ml.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(ml.BUFFER_CREATED,this.onBufferCreated,this),e.off(ml.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(ml.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(ml.FRAG_BUFFERED,this.onFragBuffered,this)}},{key:"onHandlerDestroying",value:function(){this._unregisterListeners(),this.onMediaDetaching()}},{key:"startLoad",value:function(e){if(this.levels){var t=this.lastCurrentTime,i=this.hls;if(this.stopLoad(),this.setInterval(100),this.level=-1,!this.startFragRequested){var r=i.startLevel;-1===r&&(i.config.testBandwidth&&this.levels.length>1?(r=0,this.bitrateTest=!0):r=i.nextAutoLevel),this.level=i.nextLoadLevel=r,this.loadedmetadata=!1}t>0&&-1===e&&(this.log("Override startPosition with lastCurrentTime @".concat(t.toFixed(3))),e=t),this.state=Ph,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}else this._forceStartLoad=!0,this.state=Ih}},{key:"stopLoad",value:function(){this._forceStartLoad=!1,k(Object(b["a"])(i.prototype),"stopLoad",this).call(this)}},{key:"doTick",value:function(){switch(this.state){case Hh:var e,t=this.levels,i=this.level,r=null==t||null==(e=t[i])?void 0:e.details;if(r&&(!r.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(r))break;this.state=Ph;break}if(this.hls.nextLoadLevel!==this.level){this.state=Ph;break}break;case Mh:var a,n=self.performance.now(),s=this.retryDate;(!s||n>=s||null!=(a=this.media)&&a.seeking)&&(this.resetStartWhenNotLoaded(this.level),this.state=Ph)}this.state===Ph&&this.doTickIdle(),this.onTickEnd()}},{key:"onTickEnd",value:function(){k(Object(b["a"])(i.prototype),"onTickEnd",this).call(this),this.checkBuffer(),this.checkFragmentChanged()}},{key:"doTickIdle",value:function(){var e=this.hls,t=this.levelLastLoaded,i=this.levels,r=this.media,a=e.config,n=e.nextLoadLevel;if(!(null===t||!r&&(this.startFragRequested||!a.startFragPrefetch)||this.altAudio&&this.audioOnly||null==i)&&i[n]){var s=i[n],o=this.getMainFwdBufferInfo();if(null!==o){var c=this.getLevelDetails();if(c&&this._streamEnded(o,c)){var l={};return this.altAudio&&(l.type="video"),this.hls.trigger(ml.BUFFER_EOS,l),void(this.state=Nh)}e.loadLevel!==n&&-1===e.manualLevel&&this.log("Adapting to level ".concat(n," from level ").concat(this.level)),this.level=e.nextLoadLevel=n;var u=s.details;if(!u||this.state===Hh||u.live&&this.levelLastLoaded!==n)return this.level=n,void(this.state=Hh);var d=o.len,h=this.getMaxBufferLength(s.maxBitrate);if(!(d>=h)){this.backtrackFragment&&this.backtrackFragment.start>o.end&&(this.backtrackFragment=null);var f=this.backtrackFragment?this.backtrackFragment.start:o.end,p=this.getNextFragment(f,u);if(this.couldBacktrack&&!this.fragPrevious&&p&&"initSegment"!==p.sn&&this.fragmentTracker.getState(p)!==ch){var m,g=(null!=(m=this.backtrackFragment)?m:p).sn-u.startSN,y=u.fragments[g-1];y&&p.cc===y.cc&&(p=y,this.fragmentTracker.removeFragment(y))}else this.backtrackFragment&&o.len&&(this.backtrackFragment=null);if(p&&this.isLoopLoading(p,f)){if(!p.gap){var v=this.audioOnly&&!this.altAudio?Rl:Ll,b=(v===Ll?this.videoBuffer:this.mediaBuffer)||this.media;b&&this.afterBufferFlushed(b,v,od)}p=this.getNextFragmentLoopLoading(p,u,o,od,h)}p&&(!p.initSegment||p.initSegment.data||this.bitrateTest||(p=p.initSegment),this.loadFragment(p,s,f))}}}}},{key:"loadFragment",value:function(e,t,r){var a=this.fragmentTracker.getState(e);this.fragCurrent=e,a===nh||a===oh?"initSegment"===e.sn?this._loadInitSegment(e,t):this.bitrateTest?(this.log("Fragment ".concat(e.sn," of level ").concat(e.level," is being downloaded to test bitrate and will not be buffered")),this._loadBitrateTestFrag(e,t)):(this.startFragRequested=!0,k(Object(b["a"])(i.prototype),"loadFragment",this).call(this,e,t,r)):this.clearTrackerIfNeeded(e)}},{key:"getBufferedFrag",value:function(e){return this.fragmentTracker.getBufferedFrag(e,od)}},{key:"followingBufferedFrag",value:function(e){return e?this.getBufferedFrag(e.end+.5):null}},{key:"immediateLevelSwitch",value:function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}},{key:"nextLevelSwitch",value:function(){var e=this.levels,t=this.media;if(null!=t&&t.readyState){var i,r=this.getAppendedFrag(t.currentTime);r&&r.start>1&&this.flushMainBuffer(0,r.start-1);var a=this.getLevelDetails();if(null!=a&&a.live){var n=this.getMainFwdBufferInfo();if(!n||n.len<2*a.targetduration)return}if(!t.paused&&e){var s=e[this.hls.nextLoadLevel],o=this.fragLastKbps;i=o&&this.fragCurrent?this.fragCurrent.duration*s.maxBitrate/(1e3*o)+1:0}else i=0;var c=this.getBufferedFrag(t.currentTime+i);if(c){var l=this.followingBufferedFrag(c);if(l){this.abortCurrentFrag();var u=l.maxStartPTS?l.maxStartPTS:l.start,d=l.duration,h=Math.max(c.end,u+Math.min(Math.max(d-this.config.maxFragLookUpTolerance,.5*d),.75*d));this.flushMainBuffer(h,Number.POSITIVE_INFINITY)}}}}},{key:"abortCurrentFrag",value:function(){var e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case Oh:case Bh:case Mh:case Uh:case jh:this.state=Ph}this.nextLoadPosition=this.getLoadPosition()}},{key:"flushMainBuffer",value:function(e,t){k(Object(b["a"])(i.prototype),"flushMainBuffer",this).call(this,e,t,this.altAudio?"video":null)}},{key:"onMediaAttached",value:function(e,t){k(Object(b["a"])(i.prototype),"onMediaAttached",this).call(this,e,t);var r=t.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),r.addEventListener("playing",this.onvplaying),r.addEventListener("seeked",this.onvseeked),this.gapController=new Qf(this.config,r,this.fragmentTracker,this.hls)}},{key:"onMediaDetaching",value:function(){var e=this.media;e&&this.onvplaying&&this.onvseeked&&(e.removeEventListener("playing",this.onvplaying),e.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),k(Object(b["a"])(i.prototype),"onMediaDetaching",this).call(this)}},{key:"onMediaPlaying",value:function(){this.tick()}},{key:"onMediaSeeked",value:function(){var e=this.media,t=e?e.currentTime:null;pl(t)&&this.log("Media seeked to ".concat(t.toFixed(3)));var i=this.getMainFwdBufferInfo();null!==i&&0!==i.len?this.tick():this.warn('Main forward buffer length on "seeked" event '.concat(i?i.len:"empty",")"))}},{key:"onManifestLoading",value:function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(ml.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=0,this.levels=this.fragPlaying=this.backtrackFragment=null,this.altAudio=this.audioOnly=!1}},{key:"onManifestParsed",value:function(e,t){var i,r=!1,a=!1;t.levels.forEach((function(e){i=e.audioCodec,i&&(-1!==i.indexOf("mp4a.40.2")&&(r=!0),-1!==i.indexOf("mp4a.40.5")&&(a=!0))})),this.audioCodecSwitch=r&&a&&!function(){var e,t=Wh();return"function"==typeof(null==t||null==(e=t.prototype)?void 0:e.changeType)}(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}},{key:"onLevelLoading",value:function(e,t){var i=this.levels;if(i&&this.state===Ph){var r=i[t.level];(!r.details||r.details.live&&this.levelLastLoaded!==t.level||this.waitForCdnTuneIn(r.details))&&(this.state=Hh)}}},{key:"onLevelLoaded",value:function(e,t){var i,r=this.levels,a=t.level,n=t.details,s=n.totalduration;if(r){this.log("Level ".concat(a," loaded [").concat(n.startSN,",").concat(n.endSN,"]").concat(n.lastPartSn?"[part-".concat(n.lastPartSn,"-").concat(n.lastPartIndex,"]"):"",", cc [").concat(n.startCC,", ").concat(n.endCC,"] duration:").concat(s));var o=r[a],c=this.fragCurrent;!c||this.state!==Bh&&this.state!==Mh||c.level===t.level&&c.urlId===o.urlId||!c.loader||this.abortCurrentFrag();var l=0;if(n.live||null!=(i=o.details)&&i.live){if(this.checkLiveUpdate(n),n.deltaUpdateFailed)return;l=this.alignPlaylists(n,o.details)}if(o.details=n,this.levelLastLoaded=a,this.hls.trigger(ml.LEVEL_UPDATED,{details:n,level:a}),this.state===Hh){if(this.waitForCdnTuneIn(n))return;this.state=Ph}this.startFragRequested?n.live&&this.synchronizeToLiveEdge(n):this.setStartPosition(n,l),this.tick()}else this.warn("Levels were reset while loading level ".concat(a))}},{key:"_handleFragmentLoadProgress",value:function(e){var t,i=e.frag,r=e.part,a=e.payload,n=this.levels;if(n){var s=n[i.level],o=s.details;if(!o)return this.warn("Dropping fragment ".concat(i.sn," of level ").concat(i.level," after level details were reset")),void this.fragmentTracker.removeFragment(i);var c=s.videoCodec,l=o.PTSKnown||!o.live,u=null==(t=i.initSegment)?void 0:t.data,d=this._getAudioCodec(s),h=this.transmuxer=this.transmuxer||new Yf(this.hls,od,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),f=r?r.index:-1,p=-1!==f,m=new kh(i.level,i.sn,i.stats.chunkCount,a.byteLength,f,p),g=this.initPTS[i.cc];h.push(a,u,d,c,i,r,o.totalduration,l,m,g)}else this.warn("Levels were reset while fragment load was in progress. Fragment ".concat(i.sn," of level ").concat(i.level," will not be buffered"))}},{key:"onAudioTrackSwitching",value:function(e,t){var i=this.altAudio;if(!t.url){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var r=this.fragCurrent;r&&(this.log("Switching to main audio track, cancel main fragment load"),r.abortRequests(),this.fragmentTracker.removeFragment(r)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var a=this.hls;i&&(a.trigger(ml.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null}),this.fragmentTracker.removeAllFragments()),a.trigger(ml.AUDIO_TRACK_SWITCHED,t)}}},{key:"onAudioTrackSwitched",value:function(e,t){var i=t.id,r=!!this.hls.audioTracks[i].url;if(r){var a=this.videoBuffer;a&&this.mediaBuffer!==a&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=a)}this.altAudio=r,this.tick()}},{key:"onBufferCreated",value:function(e,t){var i,r,a=t.tracks,n=!1;for(var s in a){var o=a[s];if("main"===o.id){if(r=s,i=o,"video"===s){var c=a[s];c&&(this.videoBuffer=c.buffer)}}else n=!0}n&&i?(this.log("Alternate track found, use ".concat(r,".buffered to schedule main fragment loading")),this.mediaBuffer=i.buffer):this.mediaBuffer=this.media}},{key:"onFragBuffered",value:function(e,t){var i=t.frag,r=t.part;if(!i||i.type===od){if(this.fragContextChanged(i))return this.warn("Fragment ".concat(i.sn).concat(r?" p: "+r.index:""," of level ").concat(i.level," finished buffering, but was aborted. state: ").concat(this.state)),void(this.state===jh&&(this.state=Ph));var a=r?r.stats:i.stats;this.fragLastKbps=Math.round(8*a.total/(a.buffering.end-a.loading.first)),"initSegment"!==i.sn&&(this.fragPrevious=i),this.fragBufferedComplete(i,r)}}},{key:"onError",value:function(e,t){var i;if(t.fatal)this.state=zh;else switch(t.details){case yl.FRAG_GAP:case yl.FRAG_PARSING_ERROR:case yl.FRAG_DECRYPT_ERROR:case yl.FRAG_LOAD_ERROR:case yl.FRAG_LOAD_TIMEOUT:case yl.KEY_LOAD_ERROR:case yl.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(od,t);break;case yl.LEVEL_LOAD_ERROR:case yl.LEVEL_LOAD_TIMEOUT:case yl.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==Hh||(null==(i=t.context)?void 0:i.type)!==ad||(this.state=Ph);break;case yl.BUFFER_FULL_ERROR:if(!t.parent||"main"!==t.parent)return;this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case yl.INTERNAL_EXCEPTION:this.recoverWorkerError(t)}}},{key:"checkBuffer",value:function(){var e=this.media,t=this.gapController;if(e&&t&&e.readyState){if(this.loadedmetadata||!Ah.getBuffered(e).length){var i=this.state!==Ph?this.fragCurrent:null;t.poll(this.lastCurrentTime,i)}this.lastCurrentTime=e.currentTime}}},{key:"onFragLoadEmergencyAborted",value:function(){this.state=Ph,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()}},{key:"onBufferFlushed",value:function(e,t){var i=t.type;if(i!==Rl||this.audioOnly&&!this.altAudio){var r=(i===Ll?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(r,i,od)}}},{key:"onLevelsUpdated",value:function(e,t){this.levels=t.levels}},{key:"swapAudioCodec",value:function(){this.audioCodecSwap=!this.audioCodecSwap}},{key:"seekToStartPos",value:function(){var e=this.media;if(e){var t=e.currentTime,i=this.startPosition;if(i>=0&&t<i){if(e.seeking)return void this.log("could not seek to ".concat(i,", already seeking at ").concat(t));var r=Ah.getBuffered(e),a=(r.length?r.start(0):0)-i;a>0&&(a<this.config.maxBufferHole||a<this.config.maxFragLookUpTolerance)&&(this.log("adjusting start position by ".concat(a," to match buffer start")),i+=a,this.startPosition=i),this.log("seek to target start position ".concat(i," from current time ").concat(t)),e.currentTime=i}}}},{key:"_getAudioCodec",value:function(e){var t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t=-1!==t.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),t}},{key:"_loadBitrateTestFrag",value:function(e,t){var i=this;e.bitrateTest=!0,this._doFragLoad(e,t).then((function(r){var a=i.hls;if(r&&!i.fragContextChanged(e)){t.fragmentError=0,i.state=Ph,i.startFragRequested=!1,i.bitrateTest=!1;var n=e.stats;n.parsing.start=n.parsing.end=n.buffering.start=n.buffering.end=self.performance.now(),a.trigger(ml.FRAG_LOADED,r),e.bitrateTest=!1}}))}},{key:"_handleTransmuxComplete",value:function(e){var t,i="main",r=this.hls,a=e.remuxResult,n=e.chunkMeta,s=this.getCurrentContext(n);if(s){var o=s.frag,c=s.part,l=s.level,u=a.video,d=a.text,h=a.id3,f=a.initSegment,p=l.details,m=this.altAudio?void 0:a.audio;if(this.fragContextChanged(o))this.fragmentTracker.removeFragment(o);else{if(this.state=Uh,f){if(null!=f&&f.tracks){var g=o.initSegment||o;this._bufferInitSegment(l,f.tracks,g,n),r.trigger(ml.FRAG_PARSING_INIT_SEGMENT,{frag:g,id:i,tracks:f.tracks})}var y=f.initPTS,v=f.timescale;pl(y)&&(this.initPTS[o.cc]={baseTime:y,timescale:v},r.trigger(ml.INIT_PTS_FOUND,{frag:o,id:i,initPTS:y,timescale:v}))}if(u&&p&&"initSegment"!==o.sn){var b=p.fragments[o.sn-1-p.startSN],A=o.sn===p.startSN,k=!b||o.cc>b.cc;if(!1!==a.independent){var _=u.startPTS,w=u.endPTS,S=u.startDTS,T=u.endDTS;if(c)c.elementaryStreams[u.type]={startPTS:_,endPTS:w,startDTS:S,endDTS:T};else if(u.firstKeyFrame&&u.independent&&1===n.id&&!k&&(this.couldBacktrack=!0),u.dropped&&u.independent){var E=this.getMainFwdBufferInfo(),x=(E?E.end:this.getLoadPosition())+this.config.maxBufferHole,C=u.firstKeyFramePTS?u.firstKeyFramePTS:_;if(!A&&x<C-this.config.maxBufferHole&&!k)return void this.backtrack(o);k&&(o.gap=!0),o.setElementaryStreamInfo(u.type,o.start,w,o.start,T,!0)}o.setElementaryStreamInfo(u.type,_,w,S,T),this.backtrackFragment&&(this.backtrackFragment=o),this.bufferFragmentData(u,o,c,n,A||k)}else{if(!A&&!k)return void this.backtrack(o);o.gap=!0}}if(m){var R=m.startPTS,L=m.endPTS,D=m.startDTS,I=m.endDTS;c&&(c.elementaryStreams[Rl]={startPTS:R,endPTS:L,startDTS:D,endDTS:I}),o.setElementaryStreamInfo(Rl,R,L,D,I),this.bufferFragmentData(m,o,c,n)}if(p&&null!=h&&null!=(t=h.samples)&&t.length){var P={id:i,frag:o,details:p,samples:h.samples};r.trigger(ml.FRAG_PARSING_METADATA,P)}if(p&&d){var O={id:i,frag:o,details:p,samples:d.samples};r.trigger(ml.FRAG_PARSING_USERDATA,O)}}}else this.resetWhenMissingContext(n)}},{key:"_bufferInitSegment",value:function(e,t,i,r){var a=this;if(this.state===Uh){this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&delete t.audio;var n=t.audio,s=t.video,o=t.audiovideo;if(n){var c=e.audioCodec,l=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(c&&(c=-1!==c.indexOf("mp4a.40.5")?"mp4a.40.2":"mp4a.40.5"),1!==n.metadata.channelCount&&-1===l.indexOf("firefox")&&(c="mp4a.40.5")),-1!==l.indexOf("android")&&"audio/mpeg"!==n.container&&(c="mp4a.40.2",this.log("Android: force audio codec to ".concat(c))),e.audioCodec&&e.audioCodec!==c&&this.log('Swapping manifest audio codec "'.concat(e.audioCodec,'" for "').concat(c,'"')),n.levelCodec=c,n.id="main",this.log("Init audio buffer, container:".concat(n.container,", codecs[selected/level/parsed]=[").concat(c||"","/").concat(e.audioCodec||"","/").concat(n.codec,"]"))}s&&(s.levelCodec=e.videoCodec,s.id="main",this.log("Init video buffer, container:".concat(s.container,", codecs[level/parsed]=[").concat(e.videoCodec||"","/").concat(s.codec,"]"))),o&&this.log("Init audiovideo buffer, container:".concat(o.container,", codecs[level/parsed]=[").concat(e.attrs.CODECS||"","/").concat(o.codec,"]")),this.hls.trigger(ml.BUFFER_CODECS,t),Object.keys(t).forEach((function(e){var n=t[e].initSegment;null!=n&&n.byteLength&&a.hls.trigger(ml.BUFFER_APPENDING,{type:e,data:n,frag:i,part:null,chunkMeta:r,parent:i.type})})),this.tick()}}},{key:"getMainFwdBufferInfo",value:function(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,od)}},{key:"backtrack",value:function(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=Ph}},{key:"checkFragmentChanged",value:function(){var e=this.media,t=null;if(e&&e.readyState>1&&!1===e.seeking){var i=e.currentTime;if(Ah.isBuffered(e,i)?t=this.getAppendedFrag(i):Ah.isBuffered(e,i+.1)&&(t=this.getAppendedFrag(i+.1)),t){this.backtrackFragment=null;var r=this.fragPlaying,a=t.level;r&&t.sn===r.sn&&r.level===a&&t.urlId===r.urlId||(this.fragPlaying=t,this.hls.trigger(ml.FRAG_CHANGED,{frag:t}),r&&r.level===a||this.hls.trigger(ml.LEVEL_SWITCHED,{level:a}))}}}},{key:"nextLevel",get:function(){var e=this.nextBufferedFrag;return e?e.level:-1}},{key:"currentFrag",get:function(){var e=this.media;return e?this.fragPlaying||this.getAppendedFrag(e.currentTime):null}},{key:"currentProgramDateTime",get:function(){var e=this.media;if(e){var t=e.currentTime,i=this.currentFrag;if(i&&pl(t)&&pl(i.programDateTime)){var r=i.programDateTime+1e3*(t-i.start);return new Date(r)}}return null}},{key:"currentLevel",get:function(){var e=this.currentFrag;return e?e.level:-1}},{key:"nextBufferedFrag",get:function(){var e=this.currentFrag;return e?this.followingBufferedFrag(e):null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),i}(Vh),$f=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;Object(T["a"])(this,e),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=t,this.alpha_=t?Math.exp(Math.log(.5)/t):0,this.estimate_=i,this.totalWeight_=r}return Object(S["a"])(e,[{key:"sample",value:function(e,t){var i=Math.pow(this.alpha_,e);this.estimate_=t*(1-i)+i*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_);if(e)return this.estimate_/e}return this.estimate_}}]),e}(),Zf=function(){function e(t,i,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100;Object(T["a"])(this,e),this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=r,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new $f(t),this.fast_=new $f(i),this.defaultTTFB_=a,this.ttfb_=new $f(t)}return Object(S["a"])(e,[{key:"update",value:function(e,t){var i=this.slow_,r=this.fast_,a=this.ttfb_;i.halfLife!==e&&(this.slow_=new $f(e,i.getEstimate(),i.getTotalWeight())),r.halfLife!==t&&(this.fast_=new $f(t,r.getEstimate(),r.getTotalWeight())),a.halfLife!==e&&(this.ttfb_=new $f(e,a.getEstimate(),a.getTotalWeight()))}},{key:"sample",value:function(e,t){var i=(e=Math.max(e,this.minDelayMs_))/1e3,r=8*t/i;this.fast_.sample(i,r),this.slow_.sample(i,r)}},{key:"sampleTTFB",value:function(e){var t=e/1e3,i=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(i,Math.max(e,5))}},{key:"canEstimate",value:function(){return this.fast_.getTotalWeight()>=this.minWeight_}},{key:"getEstimate",value:function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}},{key:"getEstimateTTFB",value:function(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}},{key:"destroy",value:function(){}}]),e}(),ep=function(){function e(){Object(T["a"])(this,e),this.chunks=[],this.dataLength=0}return Object(S["a"])(e,[{key:"push",value:function(e){this.chunks.push(e),this.dataLength+=e.length}},{key:"flush",value:function(){var e,t=this.chunks,i=this.dataLength;return t.length?(e=1===t.length?t[0]:function(e,t){for(var i=new Uint8Array(t),r=0,a=0;a<e.length;a++){var n=e[a];i.set(n,r),r+=n.length}return i}(t,i),this.reset(),e):new Uint8Array(0)}},{key:"reset",value:function(){this.chunks.length=0,this.dataLength=0}}]),e}();function tp(e,t){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(!ip(e[i].attrs,t[i].attrs))return!1;return!0}function ip(e,t){var i=e["STABLE-RENDITION-ID"];return i?i===t["STABLE-RENDITION-ID"]:!["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED"].some((function(i){return e[i]!==t[i]}))}var rp=Object(S["a"])((function e(t){Object(T["a"])(this,e),this.buffered=void 0;var i=function(e,i,r){if((i>>>=0)>r-1)throw new DOMException("Failed to execute '".concat(e,"' on 'TimeRanges': The index provided (").concat(i,") is greater than the maximum bound (").concat(r,")"));return t[i][e]};this.buffered={get length(){return t.length},end:function(e){return i("end",e,t.length)},start:function(e){return i("start",e,t.length)}}}));function ap(e){for(var t=[],i=0;i<e.length;i++){var r=e[i];"subtitles"!==r.kind&&"captions"!==r.kind||!r.label||t.push(e[i])}return t}var np=function(){function e(t){Object(T["a"])(this,e),this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=t}return Object(S["a"])(e,[{key:"append",value:function(e,t){var i=this.queues[t];i.push(e),1===i.length&&this.buffers[t]&&this.executeNext(t)}},{key:"insertAbort",value:function(e,t){this.queues[t].unshift(e),this.executeNext(t)}},{key:"appendBlocker",value:function(e){var t,i=new Promise((function(e){t=e})),r={execute:t,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(r,e),i}},{key:"executeNext",value:function(e){var t=this.buffers,i=this.queues,r=t[e],a=i[e];if(a.length){var n=a[0];try{n.execute()}catch(s){_l.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),n.onError(s),null!=r&&r.updating||(a.shift(),this.executeNext(e))}}}},{key:"shiftAndExecuteNext",value:function(e){this.queues[e].shift(),this.executeNext(e)}},{key:"current",value:function(e){return this.queues[e][0]}}]),e}(),sp=Nu(),op=/([ha]vc.)(?:\.[^.,]+)+/,cp={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},lp=function(e){var t=e;return cp.hasOwnProperty(e)&&(t=cp[e]),String.fromCharCode(t)},up=15,dp=100,hp={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},fp={17:2,18:4,21:6,22:8,23:10,19:13,20:15},pp={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},mp={25:2,26:4,29:6,30:8,31:10,27:13,28:15},gp=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],yp=function(){function e(){Object(T["a"])(this,e),this.time=null,this.verboseLevel=0}return Object(S["a"])(e,[{key:"log",value:function(e,t){if(this.verboseLevel>=e){var i="function"==typeof t?t():t;_l.log("".concat(this.time," [").concat(e,"] ").concat(i))}}}]),e}(),vp=function(e){for(var t=[],i=0;i<e.length;i++)t.push(e[i].toString(16));return t},bp=function(){function e(t,i,r,a,n){Object(T["a"])(this,e),this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=t||"white",this.underline=i||!1,this.italics=r||!1,this.background=a||"black",this.flash=n||!1}return Object(S["a"])(e,[{key:"reset",value:function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}},{key:"setStyles",value:function(e){for(var t=["foreground","underline","italics","background","flash"],i=0;i<t.length;i++){var r=t[i];e.hasOwnProperty(r)&&(this[r]=e[r])}}},{key:"isDefault",value:function(){return"white"===this.foreground&&!this.underline&&!this.italics&&"black"===this.background&&!this.flash}},{key:"equals",value:function(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}},{key:"copy",value:function(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}},{key:"toString",value:function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}]),e}(),Ap=function(){function e(t,i,r,a,n,s){Object(T["a"])(this,e),this.uchar=void 0,this.penState=void 0,this.uchar=t||" ",this.penState=new bp(i,r,a,n,s)}return Object(S["a"])(e,[{key:"reset",value:function(){this.uchar=" ",this.penState.reset()}},{key:"setChar",value:function(e,t){this.uchar=e,this.penState.copy(t)}},{key:"setPenState",value:function(e){this.penState.copy(e)}},{key:"equals",value:function(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}},{key:"copy",value:function(e){this.uchar=e.uchar,this.penState.copy(e.penState)}},{key:"isEmpty",value:function(){return" "===this.uchar&&this.penState.isDefault()}}]),e}(),kp=function(){function e(t){Object(T["a"])(this,e),this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var i=0;i<dp;i++)this.chars.push(new Ap);this.logger=t,this.pos=0,this.currPenState=new bp}return Object(S["a"])(e,[{key:"equals",value:function(e){for(var t=!0,i=0;i<dp;i++)if(!this.chars[i].equals(e.chars[i])){t=!1;break}return t}},{key:"copy",value:function(e){for(var t=0;t<dp;t++)this.chars[t].copy(e.chars[t])}},{key:"isEmpty",value:function(){for(var e=!0,t=0;t<dp;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e}},{key:"setCursor",value:function(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>dp&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=dp)}},{key:"moveCursor",value:function(e){var t=this.pos+e;if(e>1)for(var i=this.pos+1;i<t+1;i++)this.chars[i].setPenState(this.currPenState);this.setCursor(t)}},{key:"backSpace",value:function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}},{key:"insertChar",value:function(e){var t=this;e>=144&&this.backSpace();var i=lp(e);this.pos>=dp?this.logger.log(0,(function(){return"Cannot insert "+e.toString(16)+" ("+i+") at position "+t.pos+". Skipping it!"})):(this.chars[this.pos].setChar(i,this.currPenState),this.moveCursor(1))}},{key:"clearFromPos",value:function(e){var t;for(t=e;t<dp;t++)this.chars[t].reset()}},{key:"clear",value:function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}},{key:"clearToEndOfRow",value:function(){this.clearFromPos(this.pos)}},{key:"getTextString",value:function(){for(var e=[],t=!0,i=0;i<dp;i++){var r=this.chars[i].uchar;" "!==r&&(t=!1),e.push(r)}return t?"":e.join("")}},{key:"setPenStyles",value:function(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}]),e}(),_p=function(){function e(t){Object(T["a"])(this,e),this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var i=0;i<up;i++)this.rows.push(new kp(t));this.logger=t,this.currRow=14,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}return Object(S["a"])(e,[{key:"reset",value:function(){for(var e=0;e<up;e++)this.rows[e].clear();this.currRow=14}},{key:"equals",value:function(e){for(var t=!0,i=0;i<up;i++)if(!this.rows[i].equals(e.rows[i])){t=!1;break}return t}},{key:"copy",value:function(e){for(var t=0;t<up;t++)this.rows[t].copy(e.rows[t])}},{key:"isEmpty",value:function(){for(var e=!0,t=0;t<up;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e}},{key:"backSpace",value:function(){this.rows[this.currRow].backSpace()}},{key:"clearToEndOfRow",value:function(){this.rows[this.currRow].clearToEndOfRow()}},{key:"insertChar",value:function(e){this.rows[this.currRow].insertChar(e)}},{key:"setPen",value:function(e){this.rows[this.currRow].setPenStyles(e)}},{key:"moveCursor",value:function(e){this.rows[this.currRow].moveCursor(e)}},{key:"setCursor",value:function(e){this.logger.log(2,"setCursor: "+e),this.rows[this.currRow].setCursor(e)}},{key:"setPAC",value:function(e){this.logger.log(2,(function(){return"pacData = "+JSON.stringify(e)}));var t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(var i=0;i<up;i++)this.rows[i].clear();var r=this.currRow+1-this.nrRollUpRows,a=this.lastOutputScreen;if(a){var n=a.rows[r].cueStartTime,s=this.logger.time;if(n&&null!==s&&n<s)for(var o=0;o<this.nrRollUpRows;o++)this.rows[t-this.nrRollUpRows+o+1].copy(a.rows[r+o])}}this.currRow=t;var c=this.rows[this.currRow];if(null!==e.indent){var l=e.indent,u=Math.max(l-1,0);c.setCursor(e.indent),e.color=c.chars[u].penState.foreground}var d={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(d)}},{key:"setBkgData",value:function(e){this.logger.log(2,(function(){return"bkgData = "+JSON.stringify(e)})),this.backSpace(),this.setPen(e),this.insertChar(32)}},{key:"setRollUpRows",value:function(e){this.nrRollUpRows=e}},{key:"rollUp",value:function(){var e=this;if(null!==this.nrRollUpRows){this.logger.log(1,(function(){return e.getDisplayText()}));var t=this.currRow+1-this.nrRollUpRows,i=this.rows.splice(t,1)[0];i.clear(),this.rows.splice(this.currRow,0,i),this.logger.log(2,"Rolling up")}else this.logger.log(3,"roll_up but nrRollUpRows not set yet")}},{key:"getDisplayText",value:function(e){e=e||!1;for(var t=[],i="",r=-1,a=0;a<up;a++){var n=this.rows[a].getTextString();n&&(r=a+1,e?t.push("Row "+r+": '"+n+"'"):t.push(n.trim()))}return t.length>0&&(i=e?"["+t.join(" | ")+"]":t.join("\n")),i}},{key:"getTextAndFormat",value:function(){return this.rows}}]),e}(),wp=function(){function e(t,i,r){Object(T["a"])(this,e),this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=t,this.outputFilter=i,this.mode=null,this.verbose=0,this.displayedMemory=new _p(r),this.nonDisplayedMemory=new _p(r),this.lastOutputScreen=new _p(r),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=r}return Object(S["a"])(e,[{key:"reset",value:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}},{key:"getHandler",value:function(){return this.outputFilter}},{key:"setHandler",value:function(e){this.outputFilter=e}},{key:"setPAC",value:function(e){this.writeScreen.setPAC(e)}},{key:"setBkgData",value:function(e){this.writeScreen.setBkgData(e)}},{key:"setMode",value:function(e){e!==this.mode&&(this.mode=e,this.logger.log(2,(function(){return"MODE="+e})),"MODE_POP-ON"===this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}},{key:"insertChars",value:function(e){for(var t=this,i=0;i<e.length;i++)this.writeScreen.insertChar(e[i]);var r=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,(function(){return r+": "+t.writeScreen.getDisplayText(!0)})),"MODE_PAINT-ON"!==this.mode&&"MODE_ROLL-UP"!==this.mode||(this.logger.log(1,(function(){return"DISPLAYED: "+t.displayedMemory.getDisplayText(!0)})),this.outputDataUpdate())}},{key:"ccRCL",value:function(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}},{key:"ccBS",value:function(){this.logger.log(2,"BS - BackSpace"),"MODE_TEXT"!==this.mode&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}},{key:"ccAOF",value:function(){}},{key:"ccAON",value:function(){}},{key:"ccDER",value:function(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}},{key:"ccRU",value:function(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}},{key:"ccFON",value:function(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}},{key:"ccRDC",value:function(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}},{key:"ccTR",value:function(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}},{key:"ccRTD",value:function(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}},{key:"ccEDM",value:function(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}},{key:"ccCR",value:function(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}},{key:"ccENM",value:function(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}},{key:"ccEOC",value:function(){var e=this;if(this.logger.log(2,"EOC - End Of Caption"),"MODE_POP-ON"===this.mode){var t=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=t,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,(function(){return"DISP: "+e.displayedMemory.getDisplayText()}))}this.outputDataUpdate(!0)}},{key:"ccTO",value:function(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}},{key:"ccMIDROW",value:function(e){var t={flash:!1};if(t.underline=e%2==1,t.italics=e>=46,t.italics)t.foreground="white";else{var i=Math.floor(e/2)-16,r=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=r[i]}this.logger.log(2,"MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)}},{key:"outputDataUpdate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.logger.time;null!==t&&this.outputFilter&&(null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t):this.cueStartTime=t,this.lastOutputScreen.copy(this.displayedMemory))}},{key:"cueSplitAtTime",value:function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}]),e}(),Sp=function(){function e(t,i,r){Object(T["a"])(this,e),this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var a=new yp;this.channels=[null,new wp(t,i,a),new wp(t+1,r,a)],this.cmdHistory={a:null,b:null},this.logger=a}return Object(S["a"])(e,[{key:"getHandler",value:function(e){return this.channels[e].getHandler()}},{key:"setHandler",value:function(e,t){this.channels[e].setHandler(t)}},{key:"addData",value:function(e,t){var i,r,a,n=!1;this.logger.time=e;for(var s=0;s<t.length;s+=2)if(r=127&t[s],a=127&t[s+1],0!==r||0!==a){if(this.logger.log(3,"["+vp([t[s],t[s+1]])+"] -> ("+vp([r,a])+")"),i=this.parseCmd(r,a),i||(i=this.parseMidrow(r,a)),i||(i=this.parsePAC(r,a)),i||(i=this.parseBackgroundAttributes(r,a)),!i&&(n=this.parseChars(r,a),n)){var o=this.currentChannel;o&&o>0?this.channels[o].insertChars(n):this.logger.log(2,"No channel found yet. TEXT-MODE?")}i||n||this.logger.log(2,"Couldn't parse cleaned data "+vp([r,a])+" orig: "+vp([t[s],t[s+1]]))}}},{key:"parseCmd",value:function(e,t){var i=this.cmdHistory;if(!((20===e||28===e||21===e||29===e)&&t>=32&&t<=47)&&!((23===e||31===e)&&t>=33&&t<=35))return!1;if(Ep(e,t,i))return Tp(null,null,i),this.logger.log(3,"Repeated command ("+vp([e,t])+") is dropped"),!0;var r=20===e||21===e||23===e?1:2,a=this.channels[r];return 20===e||21===e||28===e||29===e?32===t?a.ccRCL():33===t?a.ccBS():34===t?a.ccAOF():35===t?a.ccAON():36===t?a.ccDER():37===t?a.ccRU(2):38===t?a.ccRU(3):39===t?a.ccRU(4):40===t?a.ccFON():41===t?a.ccRDC():42===t?a.ccTR():43===t?a.ccRTD():44===t?a.ccEDM():45===t?a.ccCR():46===t?a.ccENM():47===t&&a.ccEOC():a.ccTO(t-32),Tp(e,t,i),this.currentChannel=r,!0}},{key:"parseMidrow",value:function(e,t){var i=0;if((17===e||25===e)&&t>=32&&t<=47){if(i=17===e?1:2,i!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;var r=this.channels[i];return!!r&&(r.ccMIDROW(t),this.logger.log(3,"MIDROW ("+vp([e,t])+")"),!0)}return!1}},{key:"parsePAC",value:function(e,t){var i,r=this.cmdHistory;if(!((e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127)&&!((16===e||24===e)&&t>=64&&t<=95))return!1;if(Ep(e,t,r))return Tp(null,null,r),!0;var a=e<=23?1:2;i=t>=64&&t<=95?1===a?hp[e]:pp[e]:1===a?fp[e]:mp[e];var n=this.channels[a];return!!n&&(n.setPAC(this.interpretPAC(i,t)),Tp(e,t,r),this.currentChannel=a,!0)}},{key:"interpretPAC",value:function(e,t){var i,r={color:null,italics:!1,indent:null,underline:!1,row:e};return i=t>95?t-96:t-64,r.underline=1==(1&i),i<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(i/2)]:i<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((i-16)/2),r}},{key:"parseChars",value:function(e,t){var i,r,a=null,n=null;(e>=25?(i=2,n=e-8):(i=1,n=e),n>=17&&n<=19)?(r=17===n?t+80:18===n?t+112:t+144,this.logger.log(2,"Special char '"+lp(r)+"' in channel "+i),a=[r]):e>=32&&e<=127&&(a=0===t?[e]:[e,t]);if(a){var s=vp(a);this.logger.log(3,"Char codes = "+s.join(",")),Tp(e,t,this.cmdHistory)}return a}},{key:"parseBackgroundAttributes",value:function(e,t){if(!((16===e||24===e)&&t>=32&&t<=47)&&!((23===e||31===e)&&t>=45&&t<=47))return!1;var i,r={};16===e||24===e?(i=Math.floor((t-32)/2),r.background=gp[i],t%2==1&&(r.background=r.background+"_semi")):45===t?r.background="transparent":(r.foreground="black",47===t&&(r.underline=!0));var a=e<=23?1:2;return this.channels[a].setBkgData(r),Tp(e,t,this.cmdHistory),!0}},{key:"reset",value:function(){for(var e=0;e<Object.keys(this.channels).length;e++){var t=this.channels[e];t&&t.reset()}this.cmdHistory={a:null,b:null}}},{key:"cueSplitAtTime",value:function(e){for(var t=0;t<this.channels.length;t++){var i=this.channels[t];i&&i.cueSplitAtTime(e)}}}]),e}();function Tp(e,t,i){i.a=e,i.b=t}function Ep(e,t,i){return i.a===e&&i.b===t}var xp=function(){function e(t,i){Object(T["a"])(this,e),this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=t,this.trackName=i}return Object(S["a"])(e,[{key:"dispatchCue",value:function(){null!==this.startTime&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}},{key:"newCue",value:function(e,t,i){(null===this.startTime||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=i,this.timelineController.createCaptionsTrack(this.trackName)}},{key:"reset",value:function(){this.cueRanges=[],this.startTime=null}}]),e}(),Cp=function(){if(("undefined"===typeof self?"undefined":Object(E["a"])(self))<"u"&&self.VTTCue)return self.VTTCue;var e=["","lr","rl"],t=["start","middle","end","left","right"];function i(e,t){if("string"!=typeof t||!Array.isArray(e))return!1;var i=t.toLowerCase();return!!~e.indexOf(i)&&i}function r(e){return i(t,e)}function a(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];for(var a=1;a<arguments.length;a++){var n=arguments[a];for(var s in n)e[s]=n[s]}return e}function n(t,n,s){var o=this,c={enumerable:!0};o.hasBeenReset=!1;var l="",u=!1,d=t,h=n,f=s,p=null,m="",g=!0,y="auto",v="start",b=50,A="middle",k=50,_="middle";Object.defineProperty(o,"id",a({},c,{get:function(){return l},set:function(e){l=""+e}})),Object.defineProperty(o,"pauseOnExit",a({},c,{get:function(){return u},set:function(e){u=!!e}})),Object.defineProperty(o,"startTime",a({},c,{get:function(){return d},set:function(e){if("number"!=typeof e)throw new TypeError("Start time must be set to a number.");d=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"endTime",a({},c,{get:function(){return h},set:function(e){if("number"!=typeof e)throw new TypeError("End time must be set to a number.");h=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"text",a({},c,{get:function(){return f},set:function(e){f=""+e,this.hasBeenReset=!0}})),Object.defineProperty(o,"region",a({},c,{get:function(){return p},set:function(e){p=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"vertical",a({},c,{get:function(){return m},set:function(t){var r=function(t){return i(e,t)}(t);if(!1===r)throw new SyntaxError("An invalid or illegal string was specified.");m=r,this.hasBeenReset=!0}})),Object.defineProperty(o,"snapToLines",a({},c,{get:function(){return g},set:function(e){g=!!e,this.hasBeenReset=!0}})),Object.defineProperty(o,"line",a({},c,{get:function(){return y},set:function(e){if("number"!=typeof e&&"auto"!==e)throw new SyntaxError("An invalid number or illegal string was specified.");y=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"lineAlign",a({},c,{get:function(){return v},set:function(e){var t=r(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");v=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"position",a({},c,{get:function(){return b},set:function(e){if(e<0||e>100)throw new Error("Position must be between 0 and 100.");b=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"positionAlign",a({},c,{get:function(){return A},set:function(e){var t=r(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");A=t,this.hasBeenReset=!0}})),Object.defineProperty(o,"size",a({},c,{get:function(){return k},set:function(e){if(e<0||e>100)throw new Error("Size must be between 0 and 100.");k=e,this.hasBeenReset=!0}})),Object.defineProperty(o,"align",a({},c,{get:function(){return _},set:function(e){var t=r(e);if(!t)throw new SyntaxError("An invalid or illegal string was specified.");_=t,this.hasBeenReset=!0}})),o.displayState=void 0}return n.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},n}(),Rp=function(){function e(){Object(T["a"])(this,e)}return Object(S["a"])(e,[{key:"decode",value:function(e,t){if(!e)return"";if("string"!=typeof e)throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}]),e}();function Lp(e){function t(e,t,i,r){return 3600*(0|e)+60*(0|t)+(0|i)+parseFloat(r||0)}var i=e.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return i?parseFloat(i[2])>59?t(i[2],i[3],0,i[4]):t(i[1],i[2],i[3],i[4]):null}var Dp=function(){function e(){Object(T["a"])(this,e),this.values=Object.create(null)}return Object(S["a"])(e,[{key:"set",value:function(e,t){this.get(e)||""===t||(this.values[e]=t)}},{key:"get",value:function(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t}},{key:"has",value:function(e){return e in this.values}},{key:"alt",value:function(e,t,i){for(var r=0;r<i.length;++r)if(t===i[r]){this.set(e,t);break}}},{key:"integer",value:function(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}},{key:"percent",value:function(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){var i=parseFloat(t);if(i>=0&&i<=100)return this.set(e,i),!0}return!1}}]),e}();function Ip(e,t,i,r){var a=r?e.split(r):[e];for(var n in a)if("string"==typeof a[n]){var s=a[n].split(i);2===s.length&&t(s[0],s[1])}}var Pp=new Cp(0,0,""),Op="middle"===Pp.align?"middle":"center";function Bp(e,t,i){var r=e;function a(){var t=Lp(e);if(null===t)throw new Error("Malformed timestamp: "+r);return e=e.replace(/^[^\sa-zA-Z-]+/,""),t}function n(){e=e.replace(/^\s+/,"")}if(n(),t.startTime=a(),n(),"--\x3e"!==e.slice(0,3))throw new Error("Malformed time stamp (time stamps must be separated by '--\x3e'): "+r);e=e.slice(3),n(),t.endTime=a(),n(),function(e,t){var r=new Dp;Ip(e,(function(e,t){var a;switch(e){case"region":for(var n=i.length-1;n>=0;n--)if(i[n].id===t){r.set(e,i[n].region);break}break;case"vertical":r.alt(e,t,["rl","lr"]);break;case"line":a=t.split(","),r.integer(e,a[0]),r.percent(e,a[0])&&r.set("snapToLines",!1),r.alt(e,a[0],["auto"]),2===a.length&&r.alt("lineAlign",a[1],["start",Op,"end"]);break;case"position":a=t.split(","),r.percent(e,a[0]),2===a.length&&r.alt("positionAlign",a[1],["start",Op,"end","line-left","line-right","auto"]);break;case"size":r.percent(e,t);break;case"align":r.alt(e,t,["start",Op,"end","left","right"])}}),/:/,/\s/),t.region=r.get("region",null),t.vertical=r.get("vertical","");var a=r.get("line","auto");"auto"===a&&-1===Pp.line&&(a=-1),t.line=a,t.lineAlign=r.get("lineAlign","start"),t.snapToLines=r.get("snapToLines",!0),t.size=r.get("size",100),t.align=r.get("align",Op);var n=r.get("position","auto");"auto"===n&&50===Pp.position&&(n="start"===t.align||"left"===t.align?0:"end"===t.align||"right"===t.align?100:50),t.position=n}(e,t)}function Mp(e){return e.replace(/<br(?: \/)?>/gi,"\n")}var Fp=function(){function e(){Object(T["a"])(this,e),this.state="INITIAL",this.buffer="",this.decoder=new Rp,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}return Object(S["a"])(e,[{key:"parse",value:function(e){var t=this;function i(){var e=t.buffer,i=0;for(e=Mp(e);i<e.length&&"\r"!==e[i]&&"\n"!==e[i];)++i;var r=e.slice(0,i);return"\r"===e[i]&&++i,"\n"===e[i]&&++i,t.buffer=e.slice(i),r}e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));try{var r="";if("INITIAL"===t.state){if(!/\r\n|\n/.test(t.buffer))return this;r=i();var a=r.match(/^()?WEBVTT([ \t].*)?$/);if(null==a||!a[0])throw new Error("Malformed WebVTT signature.");t.state="HEADER"}for(var n=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(n?n=!1:r=i(),t.state){case"HEADER":/:/.test(r)?Ip(r,(function(e,t){}),/:/):r||(t.state="ID");continue;case"NOTE":r||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(r)){t.state="NOTE";break}if(!r)continue;if(t.cue=new Cp(0,0,""),t.state="CUE",-1===r.indexOf("--\x3e")){t.cue.id=r;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{Bp(r,t.cue,t.regionList)}catch(o){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":var s=-1!==r.indexOf("--\x3e");if(!r||s&&(n=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(null===t.cue)continue;t.cue.text&&(t.cue.text+="\n"),t.cue.text+=r;continue;case"BADCUE":r||(t.state="ID")}}}catch(c){"CUETEXT"===t.state&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state="INITIAL"===t.state?"BADWEBVTT":"BADCUE"}return this}},{key:"flush",value:function(){var e=this;try{if((e.cue||"HEADER"===e.state)&&(e.buffer+="\n\n",e.parse()),"INITIAL"===e.state||"BADWEBVTT"===e.state)throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}]),e}(),Up=/\r\n|\n\r|\n|\r/g,jp=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return e.slice(i,i+t.length)===t},Np=function(e){for(var t=5381,i=e.length;i;)t=33*t^e.charCodeAt(--i);return(t>>>0).toString()};function zp(e,t,i){return Np(e.toString())+Np(t.toString())+Np(i)}function Gp(e,t,i,r,a,n,s){var o,c=new Fp,l=uu(new Uint8Array(e)).trim().replace(Up,"\n").split("\n"),u=[],d=t?function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return Cf(e,9e4,1/t)}(t.baseTime,t.timescale):0,h="00:00.000",f=0,p=0,m=!0;c.oncue=function(e){var n=i[r],s=i.ccOffset,c=(f-d)/9e4;if(null!=n&&n["new"]&&(void 0!==p?s=i.ccOffset=n.start:function(e,t,i){var r=e[t],a=e[r.prevCC];if(!a||!a["new"]&&r["new"])return e.ccOffset=e.presentationOffset=r.start,void(r["new"]=!1);for(;null!=(n=a)&&n["new"];){var n;e.ccOffset+=r.start-a.start,r["new"]=!1,r=a,a=e[r.prevCC]}e.presentationOffset=i}(i,r,c)),c){if(!t)return void(o=new Error("Missing initPTS for VTT MPEGTS"));s=c-i.presentationOffset}var l=e.endTime-e.startTime,h=Of(9e4*(e.startTime+s-p),9e4*a)/9e4;e.startTime=Math.max(h,0),e.endTime=Math.max(h+l,0);var m=e.text.trim();e.text=decodeURIComponent(encodeURIComponent(m)),e.id||(e.id=zp(e.startTime,e.endTime,m)),e.endTime>0&&u.push(e)},c.onparsingerror=function(e){o=e},c.onflush=function(){o?s(o):n(u)},l.forEach((function(e){if(m){if(jp(e,"X-TIMESTAMP-MAP=")){m=!1,e.slice(16).split(",").forEach((function(e){jp(e,"LOCAL:")?h=e.slice(6):jp(e,"MPEGTS:")&&(f=parseInt(e.slice(7)))}));try{p=function(e){var t=parseInt(e.slice(-3)),i=parseInt(e.slice(-6,-4)),r=parseInt(e.slice(-9,-7)),a=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!(pl(t)&&pl(i)&&pl(r)&&pl(a)))throw Error("Malformed X-TIMESTAMP-MAP: Local:".concat(e));return t+=1e3*i,t+=6e4*r,t+=36e5*a,t}(h)/1e3}catch(t){o=t}return}""===e&&(m=!1)}c.parse(e+"\n")})),c.flush()}var Hp="stpp.ttml.im1t",Vp=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Wp=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,qp={left:"start",center:"center",right:"end",start:"start",end:"end"};function Kp(e,t,i,r){var a=ku(new Uint8Array(e),["mdat"]);if(0!==a.length){var n=a.map((function(e){return uu(e)})),s=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Cf(e,t,1/i,r)}(t.baseTime,1,t.timescale);try{n.forEach((function(e){return i(function(e,t){var i=new DOMParser,r=i.parseFromString(e,"text/xml").getElementsByTagName("tt")[0];if(!r)throw new Error("Invalid ttml");var a={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},n=Object.keys(a).reduce((function(e,t){return e[t]=r.getAttribute("ttp:".concat(t))||a[t],e}),{}),s="preserve"!==r.getAttribute("xml:space"),o=Yp(Jp(r,"styling","style")),c=Yp(Jp(r,"layout","region")),l=Jp(r,"body","[begin]");return[].map.call(l,(function(e){var i=Qp(e,s);if(!i||!e.hasAttribute("begin"))return null;var r=Zp(e.getAttribute("begin"),n),a=Zp(e.getAttribute("dur"),n),l=Zp(e.getAttribute("end"),n);if(null===r)throw $p(e);if(null===l){if(null===a)throw $p(e);l=r+a}var u=new Cp(r-t,l-t,i);u.id=zp(u.startTime,u.endTime,u.text);var d=function(e,t,i){var r="http://www.w3.org/ns/ttml#styling",a=null,n=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],s=null!=e&&e.hasAttribute("style")?e.getAttribute("style"):null;return s&&i.hasOwnProperty(s)&&(a=i[s]),n.reduce((function(i,n){var s=Xp(t,r,n)||Xp(e,r,n)||Xp(a,r,n);return s&&(i[n]=s),i}),{})}(c[e.getAttribute("region")],o[e.getAttribute("style")],o),h=d.textAlign;if(h){var f=qp[h];f&&(u.lineAlign=f),u.align=h}return fl(u,d),u})).filter((function(e){return null!==e}))}(e,s))}))}catch(o){r(o)}}else r(new Error("Could not parse IMSC1 mdat"))}function Jp(e,t,i){var r=e.getElementsByTagName(t)[0];return r?[].slice.call(r.querySelectorAll(i)):[]}function Yp(e){return e.reduce((function(e,t){var i=t.getAttribute("xml:id");return i&&(e[i]=t),e}),{})}function Qp(e,t){return[].slice.call(e.childNodes).reduce((function(e,i,r){var a;return"br"===i.nodeName&&r?e+"\n":null!=(a=i.childNodes)&&a.length?Qp(i,t):t?e+i.textContent.trim().replace(/\s+/g," "):e+i.textContent}),"")}function Xp(e,t,i){return e&&e.hasAttributeNS(t,i)?e.getAttributeNS(t,i):null}function $p(e){return new Error("Could not parse ttml timestamp ".concat(e))}function Zp(e,t){if(!e)return null;var i=Lp(e);return null===i&&(Vp.test(e)?i=function(e,t){var i=Vp.exec(e),r=(0|i[4])+(0|i[5])/t.subFrameRate;return 3600*(0|i[1])+60*(0|i[2])+(0|i[3])+r/t.frameRate}(e,t):Wp.test(e)&&(i=function(e,t){var i=Wp.exec(e),r=Number(i[1]);switch(i[2]){case"h":return 3600*r;case"m":return 60*r;case"ms":return 1e3*r;case"f":return r/t.frameRate;case"t":return r/t.tickRate}return r}(e,t))),i}function em(e,t){return!!e&&e.label===t.name&&!(e.textTrack1||e.textTrack2)}var tm=function(){function e(t){Object(T["a"])(this,e),this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=t,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}return Object(S["a"])(e,[{key:"setStreamController",value:function(e){this.streamController=e}},{key:"destroy",value:function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}},{key:"registerListeners",value:function(){var e=this.hls;e.on(ml.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(ml.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(ml.MANIFEST_PARSED,this.onManifestParsed,this),e.on(ml.BUFFER_CODECS,this.onBufferCodecs,this),e.on(ml.MEDIA_DETACHING,this.onMediaDetaching,this)}},{key:"unregisterListener",value:function(){var e=this.hls;e.off(ml.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(ml.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(ml.MANIFEST_PARSED,this.onManifestParsed,this),e.off(ml.BUFFER_CODECS,this.onBufferCodecs,this),e.off(ml.MEDIA_DETACHING,this.onMediaDetaching,this)}},{key:"onFpsDropLevelCapping",value:function(e,t){var i=this.hls.levels[t.droppedLevel];this.isLevelAllowed(i)&&this.restrictedLevels.push({bitrate:i.bitrate,height:i.height,width:i.width})}},{key:"onMediaAttaching",value:function(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null}},{key:"onManifestParsed",value:function(e,t){var i=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,i.config.capLevelToPlayerSize&&t.video&&this.startCapping()}},{key:"onBufferCodecs",value:function(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}},{key:"onMediaDetaching",value:function(){this.stopCapping()}},{key:"detectPlayerSize",value:function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var e=this.hls.levels;if(e.length){var t=this.hls;t.autoLevelCapping=this.getMaxLevel(e.length-1),t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}},{key:"getMaxLevel",value:function(t){var i=this,r=this.hls.levels;if(!r.length)return-1;var a=r.filter((function(e,r){return i.isLevelAllowed(e)&&r<=t}));return this.clientRect=null,e.getMaxLevelByMediaSize(a,this.mediaWidth,this.mediaHeight)}},{key:"startCapping",value:function(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}},{key:"stopCapping",value:function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}},{key:"getDimensions",value:function(){if(this.clientRect)return this.clientRect;var e=this.media,t={width:0,height:0};if(e){var i=e.getBoundingClientRect();t.width=i.width,t.height=i.height,t.width||t.height||(t.width=i.right-i.left||e.width||0,t.height=i.bottom-i.top||e.height||0)}return this.clientRect=t,t}},{key:"mediaWidth",get:function(){return this.getDimensions().width*this.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*this.contentScaleFactor}},{key:"contentScaleFactor",get:function(){var e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch(t){}return e}},{key:"isLevelAllowed",value:function(e){return!this.restrictedLevels.some((function(t){return e.bitrate===t.bitrate&&e.width===t.width&&e.height===t.height}))}}],[{key:"getMaxLevelByMediaSize",value:function(e,t,i){if(null==e||!e.length)return-1;for(var r,a,n=e.length-1,s=0;s<e.length;s+=1){var o=e[s];if((o.width>=t||o.height>=i)&&(r=o,!(a=e[s+1])||r.width!==a.width||r.height!==a.height)){n=s;break}}return n}}]),e}(),im="[eme]",rm=function(){function e(t){Object(T["a"])(this,e),this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=e.CDMCleanupPromise?[e.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=_l.debug.bind(_l,im),this.log=_l.log.bind(_l,im),this.warn=_l.warn.bind(_l,im),this.error=_l.error.bind(_l,im),this.hls=t,this.config=t.config,this.registerListeners()}return Object(S["a"])(e,[{key:"destroy",value:function(){this.unregisterListeners(),this.onMediaDetached();var e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null,this.config=null}},{key:"registerListeners",value:function(){this.hls.on(ml.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(ml.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(ml.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(ml.MANIFEST_LOADED,this.onManifestLoaded,this)}},{key:"unregisterListeners",value:function(){this.hls.off(ml.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(ml.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(ml.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(ml.MANIFEST_LOADED,this.onManifestLoaded,this)}},{key:"getLicenseServerUrl",value:function(e){var t=this.config,i=t.drmSystems,r=t.widevineLicenseUrl,a=i[e];if(a)return a.licenseUrl;if(e===jl.WIDEVINE&&r)return r;throw new Error('no license server URL configured for key-system "'.concat(e,'"'))}},{key:"getServerCertificateUrl",value:function(e){var t=this.config.drmSystems,i=t[e];if(i)return i.serverCertificateUrl;this.log('No Server Certificate in config.drmSystems["'.concat(e,'"]'))}},{key:"attemptKeySystemAccess",value:function(e){var t=this,i=this.hls.levels,r=function(e,t,i){return!!e&&i.indexOf(e)===t},a=i.map((function(e){return e.audioCodec})).filter(r),n=i.map((function(e){return e.videoCodec})).filter(r);return a.length+n.length===0&&n.push("avc1.42e01e"),new Promise((function(i,r){var s=function e(s){var o=s.shift();t.getMediaKeysPromise(o,a,n).then((function(e){return i({keySystem:o,mediaKeys:e})}))["catch"]((function(t){s.length?e(s):r(t instanceof am?t:new am({type:gl.KEY_SYSTEM_ERROR,details:yl.KEY_SYSTEM_NO_ACCESS,error:t,fatal:!0},t.message))}))};s(e)}))}},{key:"requestMediaKeySystemAccess",value:function(e,t){var i=this.config.requestMediaKeySystemAccessFunc;if("function"!=typeof i){var r="Configured requestMediaKeySystemAccess is not a function ".concat(i);return null===Jl&&"http:"===self.location.protocol&&(r="navigator.requestMediaKeySystemAccess is not available over insecure protocol ".concat(location.protocol)),Promise.reject(new Error(r))}return i(e,t)}},{key:"getMediaKeysPromise",value:function(e,t,i){var r=this,a=function(e,t,i,r){var a;switch(e){case jl.FAIRPLAY:a=["cenc","sinf"];break;case jl.WIDEVINE:case jl.PLAYREADY:a=["cenc"];break;case jl.CLEARKEY:a=["cenc","keyids"];break;default:throw new Error("Unknown key-system: ".concat(e))}return function(e,t,i,r){return[{initDataTypes:e,persistentState:r.persistentState||"not-allowed",distinctiveIdentifier:r.distinctiveIdentifier||"not-allowed",sessionTypes:r.sessionTypes||[r.sessionType||"temporary"],audioCapabilities:t.map((function(e){return{contentType:'audio/mp4; codecs="'.concat(e,'"'),robustness:r.audioRobustness||"",encryptionScheme:r.audioEncryptionScheme||null}})),videoCapabilities:i.map((function(e){return{contentType:'video/mp4; codecs="'.concat(e,'"'),robustness:r.videoRobustness||"",encryptionScheme:r.videoEncryptionScheme||null}}))}]}(a,t,i,r)}(e,t,i,this.config.drmSystemOptions),n=this.keySystemAccessPromises[e],s=null==n?void 0:n.keySystemAccess;if(!s){this.log('Requesting encrypted media "'.concat(e,'" key-system access with config: ').concat(JSON.stringify(a))),s=this.requestMediaKeySystemAccess(e,a);var o=this.keySystemAccessPromises[e]={keySystemAccess:s};return s["catch"]((function(t){r.log('Failed to obtain access to key-system "'.concat(e,'": ').concat(t))})),s.then((function(t){r.log('Access for key-system "'.concat(t.keySystem,'" obtained'));var i=r.fetchServerCertificate(e);return r.log('Create media-keys for "'.concat(e,'"')),o.mediaKeys=t.createMediaKeys().then((function(t){return r.log('Media-keys created for "'.concat(e,'"')),i.then((function(i){return i?r.setMediaKeysServerCertificate(t,e,i):t}))})),o.mediaKeys["catch"]((function(t){r.error('Failed to create media-keys for "'.concat(e,'"}: ').concat(t))})),o.mediaKeys}))}return s.then((function(){return n.mediaKeys}))}},{key:"createMediaKeySessionContext",value:function(e){var t=e.decryptdata,i=e.keySystem,r=e.mediaKeys;this.log('Creating key-system session "'.concat(i,'" keyId: ').concat(hu(t.keyId||[])));var a=r.createSession(),n={decryptdata:t,keySystem:i,mediaKeys:r,mediaKeysSession:a,keyStatus:"status-pending"};return this.mediaKeySessions.push(n),n}},{key:"renewKeySession",value:function(e){var t=e.decryptdata;if(t.pssh){var i=this.createMediaKeySessionContext(e),r=this.getKeyIdString(t),a="cenc";this.keyIdToKeySessionPromise[r]=this.generateRequestWithPreferredKeySession(i,a,t.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}},{key:"getKeyIdString",value:function(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(null===e.keyId)throw new Error("keyId is null");return hu(e.keyId)}},{key:"updateKeySession",value:function(e,t){var i,r=e.mediaKeysSession;return this.log('Updating key-session "'.concat(r.sessionId,'" for keyID ').concat(hu((null==(i=e.decryptdata)?void 0:i.keyId)||[]),"\n } (data length: ").concat(t&&t.byteLength,")")),r.update(t)}},{key:"selectKeySystemFormat",value:function(e){var t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log("Selecting key-system from fragment (sn: ".concat(e.sn," ").concat(e.type,": ").concat(e.level,") key formats ").concat(t.join(", "))),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}},{key:"getKeyFormatPromise",value:function(e){var t=this;return new Promise((function(i,r){var a=Kl(t.config),n=e.map(Vl).filter((function(e){return!!e&&-1!==a.indexOf(e)}));return t.getKeySystemSelectionPromise(n).then((function(e){var t=e.keySystem,a=ql(t);a?i(a):r(new Error('Unable to find format for key-system "'.concat(t,'"')))}))["catch"](r)}))}},{key:"loadKey",value:function(e){var t=this,i=e.keyInfo.decryptdata,r=this.getKeyIdString(i),a="(keyId: ".concat(r,' format: "').concat(i.keyFormat,'" method: ').concat(i.method," uri: ").concat(i.uri,")");this.log("Starting session for key ".concat(a));var n=this.keyIdToKeySessionPromise[r];return n||(n=this.keyIdToKeySessionPromise[r]=this.getKeySystemForKeyPromise(i).then((function(r){var n=r.keySystem,s=r.mediaKeys;return t.throwIfDestroyed(),t.log("Handle encrypted media sn: ".concat(e.frag.sn," ").concat(e.frag.type,": ").concat(e.frag.level," using key ").concat(a)),t.attemptSetMediaKeys(n,s).then((function(){t.throwIfDestroyed();var e=t.createMediaKeySessionContext({keySystem:n,mediaKeys:s,decryptdata:i});return t.generateRequestWithPreferredKeySession(e,"cenc",i.pssh,"playlist-key")}))})),n["catch"]((function(e){return t.handleError(e)}))),n}},{key:"throwIfDestroyed",value:function(){if(!this.hls)throw new Error("invalid state")}},{key:"handleError",value:function(e){this.hls&&(this.error(e.message),e instanceof am?this.hls.trigger(ml.ERROR,e.data):this.hls.trigger(ml.ERROR,{type:gl.KEY_SYSTEM_ERROR,details:yl.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}},{key:"getKeySystemForKeyPromise",value:function(e){var t=this.getKeyIdString(e),i=this.keyIdToKeySessionPromise[t];if(!i){var r=Vl(e.keyFormat),a=r?[r]:Kl(this.config);return this.attemptKeySystemAccess(a)}return i}},{key:"getKeySystemSelectionPromise",value:function(e){if(e.length||(e=Kl(this.config)),0===e.length)throw new am({type:gl.KEY_SYSTEM_ERROR,details:yl.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},"Missing key-system license configuration options ".concat(JSON.stringify({drmSystems:this.config.drmSystems})));return this.attemptKeySystemAccess(e)}},{key:"_onMediaEncrypted",value:function(e){var t=this,i=e.initDataType,r=e.initData;if(this.debug('"'.concat(e.type,'" event: init data type: "').concat(i,'"')),null!==r){var a,n;if("sinf"===i&&this.config.drmSystems[jl.FAIRPLAY]){var s=gu(new Uint8Array(r));try{var o=Ml(JSON.parse(s).sinf),c=Su(new Uint8Array(o));if(!c)return;a=c.subarray(8,24),n=jl.FAIRPLAY}catch(y){return void this.warn('Failed to parse sinf "encrypted" event message initData')}}else{var l=function(e){if(!(e instanceof ArrayBuffer)||e.byteLength<32)return null;var t={version:0,systemId:"",kids:null,data:null},i=new DataView(e),r=i.getUint32(0);if(e.byteLength!==r&&r>44||1886614376!==i.getUint32(4)||(t.version=i.getUint32(8)>>>24,t.version>1))return null;t.systemId=hu(new Uint8Array(e,12,16));var a=i.getUint32(28);if(0===t.version){if(r-32<a)return null;t.data=new Uint8Array(e,32,a)}else if(1===t.version){t.kids=[];for(var n=0;n<a;n++)t.kids.push(new Uint8Array(e,32+16*n,16))}return t}(r);if(null===l)return;0===l.version&&l.systemId===Wl&&l.data&&(a=l.data.subarray(8,24)),n=function(e){if(e===Wl)return jl.WIDEVINE}(l.systemId)}if(n&&a){for(var u=hu(a),d=this.keyIdToKeySessionPromise,h=this.mediaKeySessions,f=d[u],p=function(e){var n=h[e],s=n.decryptdata;if(s.pssh||!s.keyId)return"continue";var o=hu(s.keyId);return u===o||-1!==s.uri.replace(/-/g,"").indexOf(u)?(f=d[o],delete d[o],s.pssh=new Uint8Array(r),s.keyId=a,f=d[u]=f.then((function(){return t.generateRequestWithPreferredKeySession(n,i,r,"encrypted-event-key-match")})),"break"):void 0},m=0;m<h.length;m++){var g=p(m);if("continue"!==g&&"break"===g)break}f||(f=d[u]=this.getKeySystemSelectionPromise([n]).then((function(e){var n,s=e.keySystem,o=e.mediaKeys;t.throwIfDestroyed();var c=new Pu("ISO-23001-7",u,null!=(n=ql(s))?n:"");return c.pssh=new Uint8Array(r),c.keyId=a,t.attemptSetMediaKeys(s,o).then((function(){t.throwIfDestroyed();var e=t.createMediaKeySessionContext({decryptdata:c,keySystem:s,mediaKeys:o});return t.generateRequestWithPreferredKeySession(e,i,r,"encrypted-event-no-match")}))}))),f["catch"]((function(e){return t.handleError(e)}))}}}},{key:"_onWaitingForKey",value:function(e){this.log('"'.concat(e.type,'" event'))}},{key:"attemptSetMediaKeys",value:function(e,t){var i=this,r=this.setMediaKeysQueue.slice();this.log('Setting media-keys for "'.concat(e,'"'));var a=Promise.all(r).then((function(){if(!i.media)throw new Error("Attempted to set mediaKeys without media element attached");return i.media.setMediaKeys(t)}));return this.setMediaKeysQueue.push(a),a.then((function(){i.log('Media-keys set for "'.concat(e,'"')),r.push(a),i.setMediaKeysQueue=i.setMediaKeysQueue.filter((function(e){return-1===r.indexOf(e)}))}))}},{key:"generateRequestWithPreferredKeySession",value:function(e,t,i,r){var a,n,s=this,o=null==(a=this.config.drmSystems)||null==(n=a[e.keySystem])?void 0:n.generateRequest;if(o)try{var c=o.call(this.hls,t,i,e);if(!c)throw new Error("Invalid response from configured generateRequest filter");t=c.initDataType,i=e.decryptdata.pssh=c.initData?new Uint8Array(c.initData):null}catch(c){var l;if(this.warn(c.message),null!=(l=this.hls)&&l.config.debug)throw c}if(null===i)return this.log('Skipping key-session request for "'.concat(r,'" (no initData)')),Promise.resolve(e);var u=this.getKeyIdString(e.decryptdata);this.log('Generating key-session request for "'.concat(r,'": ').concat(u," (init data type: ").concat(t," length: ").concat(i?i.byteLength:null,")"));var d=new Kf;e.mediaKeysSession.onmessage=function(t){var i=e.mediaKeysSession;if(i){var r=t.messageType,a=t.message;s.log('"'.concat(r,'" message event for session "').concat(i.sessionId,'" message size: ').concat(a.byteLength)),"license-request"===r||"license-renewal"===r?s.renewLicense(e,a)["catch"]((function(e){s.handleError(e),d.emit("error",e)})):"license-release"===r?e.keySystem===jl.FAIRPLAY&&(s.updateKeySession(e,Ul("acknowledged")),s.removeSession(e)):s.warn('unhandled media key message type "'.concat(r,'"'))}else d.emit("error",new Error("invalid state"))},e.mediaKeysSession.onkeystatuseschange=function(t){if(e.mediaKeysSession){s.onKeyStatusChange(e);var i=e.keyStatus;d.emit("keyStatus",i),"expired"===i&&(s.warn("".concat(e.keySystem," expired for key ").concat(u)),s.renewKeySession(e))}else d.emit("error",new Error("invalid state"))};var h=new Promise((function(e,t){d.on("error",t),d.on("keyStatus",(function(i){i.startsWith("usable")?e():"output-restricted"===i?t(new am({type:gl.KEY_SYSTEM_ERROR,details:yl.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):"internal-error"===i?t(new am({type:gl.KEY_SYSTEM_ERROR,details:yl.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},'key status changed to "'.concat(i,'"'))):"expired"===i?t(new Error("key expired while generating request")):s.warn('unhandled key status change "'.concat(i,'"'))}))}));return e.mediaKeysSession.generateRequest(t,i).then((function(){var t;s.log('Request generated for key-session "'.concat(null==(t=e.mediaKeysSession)?void 0:t.sessionId,'" keyId: ').concat(u))}))["catch"]((function(e){throw new am({type:gl.KEY_SYSTEM_ERROR,details:yl.KEY_SYSTEM_NO_SESSION,error:e,fatal:!1},"Error generating key-session request: ".concat(e))})).then((function(){return h}))["catch"]((function(t){throw d.removeAllListeners(),s.removeSession(e),t})).then((function(){return d.removeAllListeners(),e}))}},{key:"onKeyStatusChange",value:function(e){var t=this;e.mediaKeysSession.keyStatuses.forEach((function(i,r){t.log('key status change "'.concat(i,'" for keyStatuses keyId: ').concat(hu("buffer"in r?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):new Uint8Array(r))," session keyId: ").concat(hu(new Uint8Array(e.decryptdata.keyId||[]))," uri: ").concat(e.decryptdata.uri)),e.keyStatus=i}))}},{key:"fetchServerCertificate",value:function(e){var t=this.config,i=new t.loader(t),r=this.getServerCertificateUrl(e);return r?(this.log('Fetching serverCertificate for "'.concat(e,'"')),new Promise((function(a,n){var s={responseType:"arraybuffer",url:r},o=t.certLoadPolicy["default"],c={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},l={onSuccess:function(e,t,i,r){a(e.data)},onError:function(t,i,a,o){n(new am({type:gl.KEY_SYSTEM_ERROR,details:yl.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:a,response:dl({url:s.url,data:void 0},t)},'"'.concat(e,'" certificate request failed (').concat(r,"). Status: ").concat(t.code," (").concat(t.text,")")))},onTimeout:function(t,i,a){n(new am({type:gl.KEY_SYSTEM_ERROR,details:yl.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:a,response:{url:s.url,data:void 0}},'"'.concat(e,'" certificate request timed out (').concat(r,")")))},onAbort:function(e,t,i){n(new Error("aborted"))}};i.load(s,c,l)}))):Promise.resolve()}},{key:"setMediaKeysServerCertificate",value:function(e,t,i){var r=this;return new Promise((function(a,n){e.setServerCertificate(i).then((function(n){r.log("setServerCertificate ".concat(n?"success":"not supported by CDM"," (").concat(null==i?void 0:i.byteLength,') on "').concat(t,'"')),a(e)}))["catch"]((function(e){n(new am({type:gl.KEY_SYSTEM_ERROR,details:yl.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:e,fatal:!0},e.message))}))}))}},{key:"renewLicense",value:function(e,t){var i=this;return this.requestLicense(e,new Uint8Array(t)).then((function(t){return i.updateKeySession(e,new Uint8Array(t))["catch"]((function(e){throw new am({type:gl.KEY_SYSTEM_ERROR,details:yl.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:e,fatal:!0},e.message)}))}))}},{key:"setupLicenseXHR",value:function(e,t,i,r){var a=this,n=this.config.licenseXhrSetup;return n?Promise.resolve().then((function(){if(!i.decryptdata)throw new Error("Key removed");return n.call(a.hls,e,t,i,r)}))["catch"]((function(s){if(!i.decryptdata)throw s;return e.open("POST",t,!0),n.call(a.hls,e,t,i,r)})).then((function(i){return e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:i||r}})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:r}))}},{key:"requestLicense",value:function(e,t){var i=this,r=this.config.keyLoadPolicy["default"];return new Promise((function(a,n){var s=i.getLicenseServerUrl(e.keySystem);i.log("Sending license request to URL: ".concat(s));var o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=function(){if(!i.hls||!e.mediaKeysSession)return n(new Error("invalid state"));if(4===o.readyState)if(200===o.status){i._requestLicenseFailureCount=0;var c=o.response;i.log("License received ".concat(c instanceof ArrayBuffer?c.byteLength:c));var l=i.config.licenseResponseCallback;if(l)try{c=l.call(i.hls,o,s,e)}catch(h){i.error(h)}a(c)}else{var u=r.errorRetry,d=u?u.maxNumRetry:0;if(i._requestLicenseFailureCount++,i._requestLicenseFailureCount>d||o.status>=400&&o.status<500)n(new am({type:gl.KEY_SYSTEM_ERROR,details:yl.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:o,response:{url:s,data:void 0,code:o.status,text:o.statusText}},"License Request XHR failed (".concat(s,"). Status: ").concat(o.status," (").concat(o.statusText,")")));else{var h=d-i._requestLicenseFailureCount+1;i.warn("Retrying license request, ".concat(h," attempts left")),i.requestLicense(e,t).then(a,n)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=o,i.setupLicenseXHR(o,s,e,t).then((function(e){var t=e.xhr,i=e.licenseChallenge;t.send(i)}))}))}},{key:"onMediaAttached",value:function(e,t){if(this.config.emeEnabled){var i=t.media;this.media=i,i.addEventListener("encrypted",this.onMediaEncrypted),i.addEventListener("waitingforkey",this.onWaitingForKey)}}},{key:"onMediaDetached",value:function(){var t=this,i=this.media,r=this.mediaKeySessions;i&&(i.removeEventListener("encrypted",this.onMediaEncrypted),i.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},Pu.clearKeyUriToKeyIdMap();var a=r.length;e.CDMCleanupPromise=Promise.all(r.map((function(e){return t.removeSession(e)})).concat(null==i?void 0:i.setMediaKeys(null)["catch"]((function(e){t.log("Could not clear media keys: ".concat(e,". media.src: ").concat(null==i?void 0:i.src))})))).then((function(){a&&(t.log("finished closing key sessions and clearing media keys"),r.length=0)}))["catch"]((function(e){t.log("Could not close sessions and clear media keys: ".concat(e,". media.src: ").concat(null==i?void 0:i.src))}))}},{key:"onManifestLoading",value:function(){this.keyFormatPromise=null}},{key:"onManifestLoaded",value:function(e,t){var i=t.sessionKeys;if(i&&this.config.emeEnabled&&!this.keyFormatPromise){var r=i.reduce((function(e,t){return-1===e.indexOf(t.keyFormat)&&e.push(t.keyFormat),e}),[]);this.log("Selecting key-system from session-keys ".concat(r.join(", "))),this.keyFormatPromise=this.getKeyFormatPromise(r)}}},{key:"removeSession",value:function(e){var t=this,i=e.mediaKeysSession,r=e.licenseXhr;if(i){this.log("Remove licenses and keys and close session ".concat(i.sessionId)),i.onmessage=null,i.onkeystatuseschange=null,r&&r.readyState!==XMLHttpRequest.DONE&&r.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;var a=this.mediaKeySessions.indexOf(e);return a>-1&&this.mediaKeySessions.splice(a,1),i.remove()["catch"]((function(e){t.log("Could not remove session: ".concat(e))})).then((function(){return i.close()}))["catch"]((function(e){t.log("Could not close session: ".concat(e))}))}}}]),e}();rm.CDMCleanupPromise=void 0;var am=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e,r){var a;return Object(T["a"])(this,i),a=t.call(this,r),a.data=void 0,e.error||(e.error=new Error(r)),a.data=e,e.err=e.error,a}return Object(S["a"])(i)}(Object(y["a"])(Error)),nm="m",sm="a",om="v",cm="av",lm="i",um="tt",dm=function(){function e(t){var i=this;Object(T["a"])(this,e),this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){i.initialized&&(i.starved=!0),i.buffering=!0},this.onPlaying=function(){i.initialized||(i.initialized=!0),i.buffering=!1},this.applyPlaylistData=function(e){try{i.apply(e,{ot:nm,su:!i.initialized})}catch(t){_l.warn("Could not generate manifest CMCD data.",t)}},this.applyFragmentData=function(e){try{var t=e.frag,r=i.hls.levels[t.level],a=i.getObjectType(t),n={d:1e3*t.duration,ot:a};a!==om&&a!==sm&&a!=cm||(n.br=r.bitrate/1e3,n.tb=i.getTopBandwidth(a)/1e3,n.bl=i.getBufferLength(a)),i.apply(e,n)}catch(t){_l.warn("Could not generate segment CMCD data.",t)}},this.hls=t;var r=this.config=t.config,a=r.cmcd;null!=a&&(r.pLoader=this.createPlaylistLoader(),r.fLoader=this.createFragmentLoader(),this.sid=a.sessionId||e.uuid(),this.cid=a.contentId,this.useHeaders=!0===a.useHeaders,this.registerListeners())}return Object(S["a"])(e,[{key:"registerListeners",value:function(){var e=this.hls;e.on(ml.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(ml.MEDIA_DETACHED,this.onMediaDetached,this),e.on(ml.BUFFER_CREATED,this.onBufferCreated,this)}},{key:"unregisterListeners",value:function(){var e=this.hls;e.off(ml.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(ml.MEDIA_DETACHED,this.onMediaDetached,this),e.off(ml.BUFFER_CREATED,this.onBufferCreated,this)}},{key:"destroy",value:function(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null}},{key:"onMediaAttached",value:function(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}},{key:"onMediaDetached",value:function(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}},{key:"onBufferCreated",value:function(e,t){var i,r;this.audioBuffer=null==(i=t.tracks.audio)?void 0:i.buffer,this.videoBuffer=null==(r=t.tracks.video)?void 0:r.buffer}},{key:"createData",value:function(){var e;return{v:1,sf:"h",sid:this.sid,cid:this.cid,pr:null==(e=this.media)?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}},{key:"apply",value:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};fl(i,this.createData());var r=i.ot===lm||i.ot===om||i.ot===cm;if(this.starved&&r&&(i.bs=!0,i.su=!0,this.starved=!1),null==i.su&&(i.su=this.buffering),this.useHeaders){var a=e.toHeaders(i);if(!Object.keys(a).length)return;t.headers||(t.headers={}),fl(t.headers,a)}else{var n=e.toQuery(i);if(!n)return;t.url=e.appendQueryToUri(t.url,n)}}},{key:"getObjectType",value:function(e){var t=e.type;return"subtitle"===t?um:"initSegment"===e.sn?lm:"audio"===t?sm:"main"===t?this.hls.audioTracks.length?om:cm:void 0}},{key:"getTopBandwidth",value:function(e){var t,i=0,r=this.hls;if(e===sm)t=r.audioTracks;else{var a=r.maxAutoLevel,n=a>-1?a+1:r.levels.length;t=r.levels.slice(0,n)}var s,o=p(t);try{for(o.s();!(s=o.n()).done;){var c=s.value;c.bitrate>i&&(i=c.bitrate)}}catch(l){o.e(l)}finally{o.f()}return i>0?i:NaN}},{key:"getBufferLength",value:function(e){var t=this.hls.media,i=e===sm?this.audioBuffer:this.videoBuffer;return i&&t?1e3*Ah.bufferInfo(i,t.currentTime,this.config.maxBufferHole).len:NaN}},{key:"createPlaylistLoader",value:function(){var e=this.config.pLoader,t=this.applyPlaylistData,i=e||this.config.loader;return function(){function e(t){Object(T["a"])(this,e),this.loader=void 0,this.loader=new i(t)}return Object(S["a"])(e,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}},{key:"destroy",value:function(){this.loader.destroy()}},{key:"abort",value:function(){this.loader.abort()}},{key:"load",value:function(e,i,r){t(e),this.loader.load(e,i,r)}}]),e}()}},{key:"createFragmentLoader",value:function(){var e=this.config.fLoader,t=this.applyFragmentData,i=e||this.config.loader;return function(){function e(t){Object(T["a"])(this,e),this.loader=void 0,this.loader=new i(t)}return Object(S["a"])(e,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}},{key:"destroy",value:function(){this.loader.destroy()}},{key:"abort",value:function(){this.loader.abort()}},{key:"load",value:function(e,i,r){t(e),this.loader.load(e,i,r)}}]),e}()}}],[{key:"uuid",value:function(){var e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}},{key:"serialize",value:function(e){var t,i=[],r=function(e){return!Number.isNaN(e)&&null!=e&&""!==e&&!1!==e},a=function(e){return Math.round(e)},n=function(e){return 100*a(e/100)},s={br:a,d:a,bl:n,dl:n,mtp:n,nor:function(e){return encodeURIComponent(e)},rtp:n,tb:a},o=Object.keys(e||{}).sort(),c=p(o);try{for(c.s();!(t=c.n()).done;){var l=t.value,u=e[l];if(!(!r(u)||"v"===l&&1===u||"pr"==l&&1===u)){var d=s[l];d&&(u=d(u));var h=Object(E["a"])(u),f=void 0;f="ot"===l||"sf"===l||"st"===l?"".concat(l,"=").concat(u):"boolean"===h?l:"number"===h?"".concat(l,"=").concat(u):"".concat(l,"=").concat(JSON.stringify(u)),i.push(f)}}}catch(m){c.e(m)}finally{c.f()}return i.join(",")}},{key:"toHeaders",value:function(t){for(var i=Object.keys(t),r={},a=["Object","Request","Session","Status"],n=[{},{},{},{}],s={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},o=0,c=i;o<c.length;o++){var l=c[o];n[null!=s[l]?s[l]:1][l]=t[l]}for(var u=0;u<n.length;u++){var d=e.serialize(n[u]);d&&(r["CMCD-".concat(a[u])]=d)}return r}},{key:"toQuery",value:function(t){return"CMCD=".concat(encodeURIComponent(e.serialize(t)))}},{key:"appendQueryToUri",value:function(e,t){if(!t)return e;var i=e.includes("?")?"&":"?";return"".concat(e).concat(i).concat(t)}}]),e}();function hm(e,t,i,r){e&&Object.keys(t).forEach((function(a){var n=e.filter((function(e){return e.groupId===a})).map((function(e){var n=fl({},e);return n.details=void 0,n.attrs=new Tl(n.attrs),n.url=n.attrs.URI=fm(e.url,e.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",i),n.groupId=n.attrs["GROUP-ID"]=t[a],n.attrs["PATHWAY-ID"]=r,n}));e.push.apply(e,Object(m["a"])(n))}))}function fm(e,t,i,r){var a,n=r.HOST,s=r.PARAMS,o=r[i];t&&(a=null==o?void 0:o[t],a&&(e=a));var c=new self.URL(e);return n&&!a&&(c.host=n),s&&Object.keys(s).sort().forEach((function(e){e&&c.searchParams.set(e,s[e])})),c.href}var pm=/^age:\s*[\d.]+\s*$/im,mm=function(){function e(t){Object(T["a"])(this,e),this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=t&&t.xhrSetup||null,this.stats=new Cl,this.retryDelay=0}return Object(S["a"])(e,[{key:"destroy",value:function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null}},{key:"abortInternal",value:function(){var e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,4!==e.readyState&&(this.stats.aborted=!0,e.abort()))}},{key:"abort",value:function(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}},{key:"load",value:function(e,t,i){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=i,this.loadInternal()}},{key:"loadInternal",value:function(){var e=this,t=this.config,i=this.context;if(t){var r=this.loader=new self.XMLHttpRequest,a=this.stats;a.loading.first=0,a.loaded=0,a.aborted=!1;var n=this.xhrSetup;n?Promise.resolve().then((function(){if(!e.stats.aborted)return n(r,i.url)}))["catch"]((function(e){return r.open("GET",i.url,!0),n(r,i.url)})).then((function(){e.stats.aborted||e.openAndSendXhr(r,i,t)}))["catch"]((function(t){e.callbacks.onError({code:r.status,text:t.message},i,r,a)})):this.openAndSendXhr(r,i,t)}}},{key:"openAndSendXhr",value:function(e,t,i){e.readyState||e.open("GET",t.url,!0);var r=this.context.headers,a=i.loadPolicy,n=a.maxTimeToFirstByteMs,s=a.maxLoadTimeMs;if(r)for(var o in r)e.setRequestHeader(o,r[o]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),i.timeout=n&&pl(n)?n:s,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.timeout),e.send()}},{key:"readystatechange",value:function(){var e=this.context,t=this.loader,i=this.stats;if(e&&t){var r=t.readyState,a=this.config;if(!i.aborted&&r>=2&&(0===i.loading.first&&(i.loading.first=Math.max(self.performance.now(),i.loading.start),a.timeout!==a.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),a.timeout=a.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.loadPolicy.maxLoadTimeMs-(i.loading.first-i.loading.start)))),4===r)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;var n=t.status,s="text"!==t.responseType;if(n>=200&&n<300&&(s&&t.response||null!==t.responseText)){i.loading.end=Math.max(self.performance.now(),i.loading.first);var o=s?t.response:t.responseText,c="arraybuffer"===t.responseType?o.byteLength:o.length;if(i.loaded=i.total=c,i.bwEstimate=8e3*i.total/(i.loading.end-i.loading.first),!this.callbacks)return;var l=this.callbacks.onProgress;if(l&&l(i,e,o,t),!this.callbacks)return;var u={url:t.responseURL,data:o,code:n};this.callbacks.onSuccess(u,i,e,t)}else{var d=a.loadPolicy.errorRetry;Gd(d,i.retry,!1,n)?this.retry(d):(_l.error("".concat(n," while loading ").concat(e.url)),this.callbacks.onError({code:n,text:t.statusText},e,t,i))}}}}},{key:"loadtimeout",value:function(){var e,t=null==(e=this.config)?void 0:e.loadPolicy.timeoutRetry;if(Gd(t,this.stats.retry,!0))this.retry(t);else{_l.warn("timeout while loading ".concat(this.context.url));var i=this.callbacks;i&&(this.abortInternal(),i.onTimeout(this.stats,this.context,this.loader))}}},{key:"retry",value:function(e){var t=this.context,i=this.stats;this.retryDelay=Nd(e,i.retry),i.retry++,_l.warn("".concat(status?"HTTP Status "+status:"Timeout"," while loading ").concat(t.url,", retrying ").concat(i.retry,"/").concat(e.maxNumRetry," in ").concat(this.retryDelay,"ms")),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}},{key:"loadprogress",value:function(e){var t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}},{key:"getCacheAge",value:function(){var e=null;if(this.loader&&pm.test(this.loader.getAllResponseHeaders())){var t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}},{key:"getResponseHeader",value:function(e){return this.loader&&new RegExp("^".concat(e,":\\s*[\\d.]+\\s*$"),"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}]),e}(),gm=/(\d+)-(\d+)\/(\d+)/,ym=function(){function e(t){Object(T["a"])(this,e),this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=t.fetchSetup||vm,this.controller=new self.AbortController,this.stats=new Cl}return Object(S["a"])(e,[{key:"destroy",value:function(){this.loader=this.callbacks=null,this.abortInternal()}},{key:"abortInternal",value:function(){var e=this.response;null!=e&&e.ok||(this.stats.aborted=!0,this.controller.abort())}},{key:"abort",value:function(){var e;this.abortInternal(),null!=(e=this.callbacks)&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}},{key:"load",value:function(e,t,i){var r=this,a=this.stats;if(a.loading.start)throw new Error("Loader can only be used once.");a.loading.start=self.performance.now();var n=function(e,t){var i={method:"GET",mode:"cors",credentials:"same-origin",signal:t,headers:new self.Headers(fl({},e.headers))};return e.rangeEnd&&i.headers.set("Range","bytes="+e.rangeStart+"-"+String(e.rangeEnd-1)),i}(e,this.controller.signal),s=i.onProgress,o="arraybuffer"===e.responseType,c=o?"byteLength":"length",l=t.loadPolicy,u=l.maxTimeToFirstByteMs,d=l.maxLoadTimeMs;this.context=e,this.config=t,this.callbacks=i,this.request=this.fetchSetup(e,n),self.clearTimeout(this.requestTimeout),t.timeout=u&&pl(u)?u:d,this.requestTimeout=self.setTimeout((function(){r.abortInternal(),i.onTimeout(a,e,r.response)}),t.timeout),self.fetch(this.request).then((function(n){r.response=r.loader=n;var c=Math.max(self.performance.now(),a.loading.start);if(self.clearTimeout(r.requestTimeout),t.timeout=d,r.requestTimeout=self.setTimeout((function(){r.abortInternal(),i.onTimeout(a,e,r.response)}),d-(c-a.loading.start)),!n.ok){var l=n.status,u=n.statusText;throw new bm(u||"fetch, bad network response",l,n)}return a.loading.first=c,a.total=function(e){var t=e.get("Content-Range");if(t){var i=function(e){var t=gm.exec(e);if(t)return parseInt(t[2])-parseInt(t[1])+1}(t);if(pl(i))return i}var r=e.get("Content-Length");if(r)return parseInt(r)}(n.headers)||a.total,s&&pl(t.highWaterMark)?r.loadProgressively(n,a,e,t.highWaterMark,s):o?n.arrayBuffer():"json"===e.responseType?n.json():n.text()})).then((function(n){var o=r.response;self.clearTimeout(r.requestTimeout),a.loading.end=Math.max(self.performance.now(),a.loading.first);var l=n[c];l&&(a.loaded=a.total=l);var u={url:o.url,data:n,code:o.status};s&&!pl(t.highWaterMark)&&s(a,e,n,o),i.onSuccess(u,a,e,o)}))["catch"]((function(t){if(self.clearTimeout(r.requestTimeout),!a.aborted){var n=t&&t.code||0,s=t?t.message:null;i.onError({code:n,text:s},e,t?t.details:null,a)}}))}},{key:"getCacheAge",value:function(){var e=null;if(this.response){var t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}},{key:"getResponseHeader",value:function(e){return this.response?this.response.headers.get(e):null}},{key:"loadProgressively",value:function(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4?arguments[4]:void 0,n=new ep,s=e.body.getReader(),o=function o(){return s.read().then((function(s){if(s.done)return n.dataLength&&a(t,i,n.flush(),e),Promise.resolve(new ArrayBuffer(0));var c=s.value,l=c.length;return t.loaded+=l,l<r||n.dataLength?(n.push(c),n.dataLength>=r&&a(t,i,n.flush(),e)):a(t,i,c,e),o()}))["catch"]((function(){return Promise.reject()}))};return o()}}]),e}();function vm(e,t){return new self.Request(e.url,t)}var bm=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e,r,a){var n;return Object(T["a"])(this,i),n=t.call(this,e),n.code=void 0,n.details=void 0,n.code=r,n.details=a,n}return Object(S["a"])(i)}(Object(y["a"])(Error)),Am=/\s/,km={newCue:function(e,t,i,r){for(var a,n,s,o,c,l=[],u=self.VTTCue||self.TextTrackCue,d=0;d<r.rows.length;d++)if(a=r.rows[d],s=!0,o=0,c="",!a.isEmpty()){for(var h,f=0;f<a.chars.length;f++)Am.test(a.chars[f].uchar)&&s?o++:(c+=a.chars[f].uchar,s=!1);a.cueStartTime=t,t===i&&(i+=1e-4),o>=16?o--:o++;var p=Mp(c.trim()),m=zp(t,i,p);null!=e&&null!=(h=e.cues)&&h.getCueById(m)||(n=new u(t,i,p),n.id=m,n.line=d+1,n.align="left",n.position=10+Math.min(80,10*Math.floor(8*o/32)),l.push(n))}return e&&l.length&&(l.sort((function(e,t){return"auto"===e.line||"auto"===t.line?0:e.line>8&&t.line>8?t.line-e.line:e.line-t.line})),l.forEach((function(t){return pd(e,t)}))),l}},_m=dl(dl({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,maxBufferSize:6e7,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:mm,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:function(){function e(t){Object(T["a"])(this,e),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=-1,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=t;var i=t.config;this.bwEstimator=new Zf(i.abrEwmaSlowVoD,i.abrEwmaFastVoD,i.abrEwmaDefaultEstimate),this.registerListeners()}return Object(S["a"])(e,[{key:"registerListeners",value:function(){var e=this.hls;e.on(ml.FRAG_LOADING,this.onFragLoading,this),e.on(ml.FRAG_LOADED,this.onFragLoaded,this),e.on(ml.FRAG_BUFFERED,this.onFragBuffered,this),e.on(ml.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(ml.LEVEL_LOADED,this.onLevelLoaded,this)}},{key:"unregisterListeners",value:function(){var e=this.hls;e.off(ml.FRAG_LOADING,this.onFragLoading,this),e.off(ml.FRAG_LOADED,this.onFragLoaded,this),e.off(ml.FRAG_BUFFERED,this.onFragBuffered,this),e.off(ml.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(ml.LEVEL_LOADED,this.onLevelLoaded,this)}},{key:"destroy",value:function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null}},{key:"onFragLoading",value:function(e,t){var i,r=t.frag;this.ignoreFragment(r)||(this.fragCurrent=r,this.partCurrent=null!=(i=t.part)?i:null,this.clearTimer(),this.timer=self.setInterval(this.onCheck,100))}},{key:"onLevelSwitching",value:function(e,t){this.clearTimer()}},{key:"getTimeToLoadFrag",value:function(e,t,i,r){return e+i/t+(r?this.lastLevelLoadSec:0)}},{key:"onLevelLoaded",value:function(e,t){var i=this.hls.config,r=t.stats,a=r.total,n=r.bwEstimate;pl(a)&&pl(n)&&(this.lastLevelLoadSec=8*a/n),t.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD)}},{key:"_abandonRulesCheck",value:function(){var e=this.fragCurrent,t=this.partCurrent,i=this.hls,r=i.autoLevelEnabled,a=i.media;if(e&&a){var n=performance.now(),s=t?t.stats:e.stats,o=t?t.duration:e.duration,c=n-s.loading.start;if(s.aborted||s.loaded&&s.loaded===s.total||0===e.level)return this.clearTimer(),void(this._nextAutoLevel=-1);if(r&&!a.paused&&a.playbackRate&&a.readyState){var l=i.mainForwardBufferInfo;if(null!==l){var u=this.bwEstimator.getEstimateTTFB(),d=Math.abs(a.playbackRate);if(!(c<=Math.max(u,o/(2*d)*1e3))){var h=l.len/d;if(!(h>=2*o/d)){var f=s.loading.first?s.loading.first-s.loading.start:-1,p=s.loaded&&f>-1,m=this.bwEstimator.getEstimate(),g=i.levels,y=i.minAutoLevel,v=g[e.level],b=s.total||Math.max(s.loaded,Math.round(o*v.maxBitrate/8)),A=c-f;A<1&&p&&(A=Math.min(c,8*s.loaded/m));var k=p?1e3*s.loaded/A:0,_=k?(b-s.loaded)/k:8*b/m+u/1e3;if(!(_<=h)){var w,S=k?8*k:m,T=Number.POSITIVE_INFINITY;for(w=e.level-1;w>y;w--){var E=g[w].maxBitrate;if(T=this.getTimeToLoadFrag(u/1e3,S,o*E,!g[w].details),T<h)break}T>=_||T>10*o||(i.nextLoadLevel=w,p?this.bwEstimator.sample(c-Math.min(u,f),s.loaded):this.bwEstimator.sampleTTFB(c),this.clearTimer(),_l.warn("[abr] Fragment ".concat(e.sn).concat(t?" part "+t.index:""," of level ").concat(e.level," is loading too slowly;\n Time to underbuffer: ").concat(h.toFixed(3)," s\n Estimated load time for current fragment: ").concat(_.toFixed(3)," s\n Estimated load time for down switch fragment: ").concat(T.toFixed(3)," s\n TTFB estimate: ").concat(f,"\n Current BW estimate: ").concat(pl(m)?(m/1024).toFixed(3):"Unknown"," Kb/s\n New BW estimate: ").concat((this.bwEstimator.getEstimate()/1024).toFixed(3)," Kb/s\n Aborting and switching to level ").concat(w)),e.loader&&(this.fragCurrent=this.partCurrent=null,e.abortRequests()),i.trigger(ml.FRAG_LOAD_EMERGENCY_ABORTED,{frag:e,part:t,stats:s}))}}}}}}}},{key:"onFragLoaded",value:function(e,t){var i=t.frag,r=t.part,a=r?r.stats:i.stats;if(i.type===od&&this.bwEstimator.sampleTTFB(a.loading.first-a.loading.start),!this.ignoreFragment(i)){if(this.clearTimer(),this.lastLoadedFragLevel=i.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var n=r?r.duration:i.duration,s=this.hls.levels[i.level],o=(s.loaded?s.loaded.bytes:0)+a.loaded,c=(s.loaded?s.loaded.duration:0)+n;s.loaded={bytes:o,duration:c},s.realBitrate=Math.round(8*o/c)}if(i.bitrateTest){var l={stats:a,frag:i,part:r,id:i.type};this.onFragBuffered(ml.FRAG_BUFFERED,l),i.bitrateTest=!1}}}},{key:"onFragBuffered",value:function(e,t){var i=t.frag,r=t.part,a=null!=r&&r.stats.loaded?r.stats:i.stats;if(!a.aborted&&!this.ignoreFragment(i)){var n=a.parsing.end-a.loading.start-Math.min(a.loading.first-a.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(n,a.loaded),a.bwEstimate=this.bwEstimator.getEstimate(),i.bitrateTest?this.bitrateTestDelay=n/1e3:this.bitrateTestDelay=0}}},{key:"ignoreFragment",value:function(e){return e.type!==od||"initSegment"===e.sn}},{key:"clearTimer",value:function(){self.clearInterval(this.timer)}},{key:"nextAutoLevel",get:function(){var e=this._nextAutoLevel,t=this.bwEstimator;if(-1!==e&&!t.canEstimate())return e;var i=this.getNextABRAutoLevel();if(-1!==e){var r=this.hls.levels;if(r.length>Math.max(e,i)&&r[e].loadError<=r[i].loadError)return e}return-1!==e&&(i=Math.min(e,i)),i},set:function(e){this._nextAutoLevel=e}},{key:"getNextABRAutoLevel",value:function(){var e=this.fragCurrent,t=this.partCurrent,i=this.hls,r=i.maxAutoLevel,a=i.config,n=i.minAutoLevel,s=i.media,o=t?t.duration:e?e.duration:0,c=s&&0!==s.playbackRate?Math.abs(s.playbackRate):1,l=this.bwEstimator?this.bwEstimator.getEstimate():a.abrEwmaDefaultEstimate,u=i.mainForwardBufferInfo,d=(u?u.len:0)/c,h=this.findBestLevel(l,n,r,d,a.abrBandWidthFactor,a.abrBandWidthUpFactor);if(h>=0)return h;_l.trace("[abr] ".concat(d?"rebuffering expected":"buffer is empty",", finding optimal quality level"));var f=o?Math.min(o,a.maxStarvationDelay):a.maxStarvationDelay,p=a.abrBandWidthFactor,m=a.abrBandWidthUpFactor;if(!d){var g=this.bitrateTestDelay;g&&(f=(o?Math.min(o,a.maxLoadingDelay):a.maxLoadingDelay)-g,_l.trace("[abr] bitrate test took ".concat(Math.round(1e3*g),"ms, set first fragment max fetchDuration to ").concat(Math.round(1e3*f)," ms")),p=m=1)}return h=this.findBestLevel(l,n,r,d+f,p,m),Math.max(h,0)}},{key:"findBestLevel",value:function(e,t,i,r,a,n){for(var s,o=this.fragCurrent,c=this.partCurrent,l=this.lastLoadedFragLevel,u=this.hls.levels,d=u[l],h=!(null==d||null==(s=d.details)||!s.live),f=null==d?void 0:d.codecSet,p=c?c.duration:o?o.duration:0,m=this.bwEstimator.getEstimateTTFB()/1e3,g=t,y=-1,v=i;v>=t;v--){var b=u[v];if(!b||f&&b.codecSet!==f)b&&(g=Math.min(v,g),y=Math.max(v,y));else{-1!==y&&_l.trace("[abr] Skipped level(s) ".concat(g,"-").concat(y,' with CODECS:"').concat(u[y].attrs.CODECS,'"; not compatible with "').concat(d.attrs.CODECS,'"'));var A=b.details,k=(c?null==A?void 0:A.partTarget:null==A?void 0:A.averagetargetduration)||p,_=void 0;_=v<=l?a*e:n*e;var w=u[v].maxBitrate,S=this.getTimeToLoadFrag(m,_,w*k,void 0===A);if(_l.trace("[abr] level:".concat(v," adjustedbw-bitrate:").concat(Math.round(_-w)," avgDuration:").concat(k.toFixed(1)," maxFetchDuration:").concat(r.toFixed(1)," fetchDuration:").concat(S.toFixed(1))),_>w&&(0===S||!pl(S)||h&&!this.bitrateTestDelay||S<r))return v}}return-1}}]),e}(),bufferController:function(){function e(t){var i=this;Object(T["a"])(this,e),this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var e=i.media,t=i.mediaSource;_l.log("[buffer-controller]: Media source opened"),e&&(e.removeEventListener("emptied",i._onMediaEmptied),i.updateMediaElementDuration(),i.hls.trigger(ml.MEDIA_ATTACHED,{media:e})),t&&t.removeEventListener("sourceopen",i._onMediaSourceOpen),i.checkPendingTracks()},this._onMediaSourceClose=function(){_l.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){_l.log("[buffer-controller]: Media source ended")},this._onMediaEmptied=function(){var e=i.media,t=i._objectUrl;e&&e.src!==t&&_l.error("Media element src was set while attaching MediaSource (".concat(t," > ").concat(e.src,")"))},this.hls=t,this._initSourceBuffer(),this.registerListeners()}return Object(S["a"])(e,[{key:"hasSourceTypes",value:function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0}},{key:"destroy",value:function(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null}},{key:"registerListeners",value:function(){var e=this.hls;e.on(ml.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(ml.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(ml.MANIFEST_LOADING,this.onManifestLoading,this),e.on(ml.MANIFEST_PARSED,this.onManifestParsed,this),e.on(ml.BUFFER_RESET,this.onBufferReset,this),e.on(ml.BUFFER_APPENDING,this.onBufferAppending,this),e.on(ml.BUFFER_CODECS,this.onBufferCodecs,this),e.on(ml.BUFFER_EOS,this.onBufferEos,this),e.on(ml.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(ml.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(ml.FRAG_PARSED,this.onFragParsed,this),e.on(ml.FRAG_CHANGED,this.onFragChanged,this)}},{key:"unregisterListeners",value:function(){var e=this.hls;e.off(ml.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(ml.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(ml.MANIFEST_LOADING,this.onManifestLoading,this),e.off(ml.MANIFEST_PARSED,this.onManifestParsed,this),e.off(ml.BUFFER_RESET,this.onBufferReset,this),e.off(ml.BUFFER_APPENDING,this.onBufferAppending,this),e.off(ml.BUFFER_CODECS,this.onBufferCodecs,this),e.off(ml.BUFFER_EOS,this.onBufferEos,this),e.off(ml.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(ml.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(ml.FRAG_PARSED,this.onFragParsed,this),e.off(ml.FRAG_CHANGED,this.onFragChanged,this)}},{key:"_initSourceBuffer",value:function(){this.sourceBuffer={},this.operationQueue=new np(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.lastMpegAudioChunk=null}},{key:"onManifestLoading",value:function(){this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=0,this.details=null}},{key:"onManifestParsed",value:function(e,t){var i=2;(t.audio&&!t.video||!t.altAudio)&&(i=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=i,_l.log("".concat(this.bufferCodecEventsExpected," bufferCodec event(s) expected"))}},{key:"onMediaAttaching",value:function(e,t){var i=this.media=t.media;if(i&&sp){var r=this.mediaSource=new sp;r.addEventListener("sourceopen",this._onMediaSourceOpen),r.addEventListener("sourceended",this._onMediaSourceEnded),r.addEventListener("sourceclose",this._onMediaSourceClose),i.src=self.URL.createObjectURL(r),this._objectUrl=i.src,i.addEventListener("emptied",this._onMediaEmptied)}}},{key:"onMediaDetaching",value:function(){var e=this.media,t=this.mediaSource,i=this._objectUrl;if(t){if(_l.log("[buffer-controller]: media source detaching"),"open"===t.readyState)try{t.endOfStream()}catch(r){_l.warn("[buffer-controller]: onMediaDetaching: ".concat(r.message," while calling endOfStream"))}this.onBufferReset(),t.removeEventListener("sourceopen",this._onMediaSourceOpen),t.removeEventListener("sourceended",this._onMediaSourceEnded),t.removeEventListener("sourceclose",this._onMediaSourceClose),e&&(e.removeEventListener("emptied",this._onMediaEmptied),i&&self.URL.revokeObjectURL(i),e.src===i?(e.removeAttribute("src"),e.load()):_l.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(ml.MEDIA_DETACHED,void 0)}},{key:"onBufferReset",value:function(){var e=this;this.getSourceBufferTypes().forEach((function(t){var i=e.sourceBuffer[t];try{i&&(e.removeBufferListeners(t),e.mediaSource&&e.mediaSource.removeSourceBuffer(i),e.sourceBuffer[t]=void 0)}catch(r){_l.warn("[buffer-controller]: Failed to reset the ".concat(t," buffer"),r)}})),this._initSourceBuffer()}},{key:"onBufferCodecs",value:function(e,t){var i=this,r=this.getSourceBufferTypes().length;Object.keys(t).forEach((function(e){if(r){var a=i.tracks[e];if(a&&"function"==typeof a.buffer.changeType){var n=t[e],s=n.id,o=n.codec,c=n.levelCodec,l=n.container,u=n.metadata,d=(a.levelCodec||a.codec).replace(op,"$1"),h=(c||o).replace(op,"$1");if(d!==h){var f="".concat(l,";codecs=").concat(c||o);i.appendChangeType(e,f),_l.log("[buffer-controller]: switching codec ".concat(d," to ").concat(h)),i.tracks[e]={buffer:a.buffer,codec:o,container:l,levelCodec:c,metadata:u,id:s}}}}else i.pendingTracks[e]=t[e]})),r||(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&"open"===this.mediaSource.readyState&&this.checkPendingTracks())}},{key:"appendChangeType",value:function(e,t){var i=this,r=this.operationQueue,a={execute:function(){var a=i.sourceBuffer[e];a&&(_l.log("[buffer-controller]: changing ".concat(e," sourceBuffer type to ").concat(t)),a.changeType(t)),r.shiftAndExecuteNext(e)},onStart:function(){},onComplete:function(){},onError:function(t){_l.warn("[buffer-controller]: Failed to change ".concat(e," SourceBuffer type"),t)}};r.append(a,e)}},{key:"onBufferAppending",value:function(e,t){var i=this,r=this.hls,a=this.operationQueue,n=this.tracks,s=t.data,o=t.type,c=t.frag,l=t.part,u=t.chunkMeta,d=u.buffering[o],h=self.performance.now();d.start=h;var f=c.stats.buffering,p=l?l.stats.buffering:null;0===f.start&&(f.start=h),p&&0===p.start&&(p.start=h);var m=n.audio,g=!1;"audio"===o&&"audio/mpeg"===(null==m?void 0:m.container)&&(g=!this.lastMpegAudioChunk||1===u.id||this.lastMpegAudioChunk.sn!==u.sn,this.lastMpegAudioChunk=u);var y=c.start,v={execute:function(){if(d.executeStart=self.performance.now(),g){var e=i.sourceBuffer[o];if(e){var t=y-e.timestampOffset;Math.abs(t)>=.1&&(_l.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to ".concat(y," (delta: ").concat(t,") sn: ").concat(c.sn,")")),e.timestampOffset=y)}}i.appendExecutor(s,o)},onStart:function(){},onComplete:function(){var e=self.performance.now();d.executeEnd=d.end=e,0===f.first&&(f.first=e),p&&0===p.first&&(p.first=e);var t=i.sourceBuffer,r={};for(var a in t)r[a]=Ah.getBuffered(t[a]);i.appendError=0,i.hls.trigger(ml.BUFFER_APPENDED,{type:o,frag:c,part:l,chunkMeta:u,parent:c.type,timeRanges:r})},onError:function(e){_l.error("[buffer-controller]: Error encountered while trying to append to the ".concat(o," SourceBuffer"),e);var t={type:gl.MEDIA_ERROR,parent:c.type,details:yl.BUFFER_APPEND_ERROR,frag:c,part:l,chunkMeta:u,error:e,err:e,fatal:!1};e.code===DOMException.QUOTA_EXCEEDED_ERR?t.details=yl.BUFFER_FULL_ERROR:(i.appendError++,t.details=yl.BUFFER_APPEND_ERROR,i.appendError>r.config.appendErrorMaxRetry&&(_l.error("[buffer-controller]: Failed ".concat(r.config.appendErrorMaxRetry," times to append segment in sourceBuffer")),t.fatal=!0)),r.trigger(ml.ERROR,t)}};a.append(v,o)}},{key:"onBufferFlushing",value:function(e,t){var i=this,r=this.operationQueue,a=function(e){return{execute:i.removeExecutor.bind(i,e,t.startOffset,t.endOffset),onStart:function(){},onComplete:function(){i.hls.trigger(ml.BUFFER_FLUSHED,{type:e})},onError:function(t){_l.warn("[buffer-controller]: Failed to remove from ".concat(e," SourceBuffer"),t)}}};t.type?r.append(a(t.type),t.type):this.getSourceBufferTypes().forEach((function(e){r.append(a(e),e)}))}},{key:"onFragParsed",value:function(e,t){var i=this,r=t.frag,a=t.part,n=[],s=a?a.elementaryStreams:r.elementaryStreams;s[Dl]?n.push("audiovideo"):(s[Rl]&&n.push("audio"),s[Ll]&&n.push("video")),0===n.length&&_l.warn("Fragments must have at least one ElementaryStreamType set. type: ".concat(r.type," level: ").concat(r.level," sn: ").concat(r.sn)),this.blockBuffers((function(){var e=self.performance.now();r.stats.buffering.end=e,a&&(a.stats.buffering.end=e);var t=a?a.stats:r.stats;i.hls.trigger(ml.FRAG_BUFFERED,{frag:r,part:a,stats:t,id:r.type})}),n)}},{key:"onFragChanged",value:function(e,t){this.flushBackBuffer()}},{key:"onBufferEos",value:function(e,t){var i=this;this.getSourceBufferTypes().reduce((function(e,r){var a=i.sourceBuffer[r];return!a||t.type&&t.type!==r||(a.ending=!0,a.ended||(a.ended=!0,_l.log("[buffer-controller]: ".concat(r," sourceBuffer now EOS")))),e&&!(a&&!a.ended)}),!0)&&(_l.log("[buffer-controller]: Queueing mediaSource.endOfStream()"),this.blockBuffers((function(){i.getSourceBufferTypes().forEach((function(e){var t=i.sourceBuffer[e];t&&(t.ending=!1)}));var e=i.mediaSource;e&&"open"===e.readyState?(_l.log("[buffer-controller]: Calling mediaSource.endOfStream()"),e.endOfStream()):e&&_l.info("[buffer-controller]: Could not call mediaSource.endOfStream(). mediaSource.readyState: ".concat(e.readyState))})))}},{key:"onLevelUpdated",value:function(e,t){var i=t.details;i.fragments.length&&(this.details=i,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())}},{key:"flushBackBuffer",value:function(){var e=this.hls,t=this.details,i=this.media,r=this.sourceBuffer;if(i&&null!==t){var a=this.getSourceBufferTypes();if(a.length){var n=t.live&&null!==e.config.liveBackBufferLength?e.config.liveBackBufferLength:e.config.backBufferLength;if(pl(n)&&!(n<0)){var s=i.currentTime,o=t.levelTargetDuration,c=Math.max(n,o),l=Math.floor(s/o)*o-c;a.forEach((function(i){var a=r[i];if(a){var n=Ah.getBuffered(a);if(n.length>0&&l>n.start(0)){if(e.trigger(ml.BACK_BUFFER_REACHED,{bufferEnd:l}),t.live)e.trigger(ml.LIVE_BACK_BUFFER_REACHED,{bufferEnd:l});else if(a.ended&&n.end(n.length-1)-s<2*o)return void _l.info("[buffer-controller]: Cannot flush ".concat(i," back buffer while SourceBuffer is in ended state"));e.trigger(ml.BUFFER_FLUSHING,{startOffset:0,endOffset:l,type:i})}}}))}}}}},{key:"updateMediaElementDuration",value:function(){if(this.details&&this.media&&this.mediaSource&&"open"===this.mediaSource.readyState){var e=this.details,t=this.hls,i=this.media,r=this.mediaSource,a=e.fragments[0].start+e.totalduration,n=i.duration,s=pl(r.duration)?r.duration:0;e.live&&t.config.liveDurationInfinity?(_l.log("[buffer-controller]: Media Source duration is set to Infinity"),r.duration=1/0,this.updateSeekableRange(e)):(a>s&&a>n||!pl(n))&&(_l.log("[buffer-controller]: Updating Media Source duration to ".concat(a.toFixed(3))),r.duration=a)}}},{key:"updateSeekableRange",value:function(e){var t=this.mediaSource,i=e.fragments;if(i.length&&e.live&&null!=t&&t.setLiveSeekableRange){var r=Math.max(0,i[0].start),a=Math.max(r,r+e.totalduration);t.setLiveSeekableRange(r,a)}}},{key:"checkPendingTracks",value:function(){var e=this.bufferCodecEventsExpected,t=this.operationQueue,i=this.pendingTracks,r=Object.keys(i).length;if(r&&!e||2===r){this.createSourceBuffers(i),this.pendingTracks={};var a=this.getSourceBufferTypes();if(a.length)this.hls.trigger(ml.BUFFER_CREATED,{tracks:this.tracks}),a.forEach((function(e){t.executeNext(e)}));else{var n=new Error("could not create source buffer for media codec(s)");this.hls.trigger(ml.ERROR,{type:gl.MEDIA_ERROR,details:yl.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:n,reason:n.message})}}}},{key:"createSourceBuffers",value:function(e){var t=this.sourceBuffer,i=this.mediaSource;if(!i)throw Error("createSourceBuffers called when mediaSource was null");for(var r in e)if(!t[r]){var a=e[r];if(!a)throw Error("source buffer exists for track ".concat(r,", however track does not"));var n=a.levelCodec||a.codec,s="".concat(a.container,";codecs=").concat(n);_l.log("[buffer-controller]: creating sourceBuffer(".concat(s,")"));try{var o=t[r]=i.addSourceBuffer(s),c=r;this.addBufferListener(c,"updatestart",this._onSBUpdateStart),this.addBufferListener(c,"updateend",this._onSBUpdateEnd),this.addBufferListener(c,"error",this._onSBUpdateError),this.tracks[r]={buffer:o,codec:n,container:a.container,levelCodec:a.levelCodec,metadata:a.metadata,id:a.id}}catch(o){_l.error("[buffer-controller]: error while trying to add sourceBuffer: ".concat(o.message)),this.hls.trigger(ml.ERROR,{type:gl.MEDIA_ERROR,details:yl.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:o,mimeType:s})}}}},{key:"_onSBUpdateStart",value:function(e){var t=this.operationQueue;t.current(e).onStart()}},{key:"_onSBUpdateEnd",value:function(e){var t=this.operationQueue;t.current(e).onComplete(),t.shiftAndExecuteNext(e)}},{key:"_onSBUpdateError",value:function(e,t){var i=new Error("".concat(e," SourceBuffer error"));_l.error("[buffer-controller]: ".concat(i),t),this.hls.trigger(ml.ERROR,{type:gl.MEDIA_ERROR,details:yl.BUFFER_APPENDING_ERROR,error:i,fatal:!1});var r=this.operationQueue.current(e);r&&r.onError(t)}},{key:"removeExecutor",value:function(e,t,i){var r=this.media,a=this.mediaSource,n=this.operationQueue,s=this.sourceBuffer,o=s[e];if(!r||!a||!o)return _l.warn("[buffer-controller]: Attempting to remove from the ".concat(e," SourceBuffer, but it does not exist")),void n.shiftAndExecuteNext(e);var c=pl(r.duration)?r.duration:1/0,l=pl(a.duration)?a.duration:1/0,u=Math.max(0,t),d=Math.min(i,c,l);d>u&&!o.ending?(o.ended=!1,_l.log("[buffer-controller]: Removing [".concat(u,",").concat(d,"] from the ").concat(e," SourceBuffer")),o.remove(u,d)):n.shiftAndExecuteNext(e)}},{key:"appendExecutor",value:function(e,t){var i=this.operationQueue,r=this.sourceBuffer,a=r[t];if(!a)return _l.warn("[buffer-controller]: Attempting to append to the ".concat(t," SourceBuffer, but it does not exist")),void i.shiftAndExecuteNext(t);a.ended=!1,a.appendBuffer(e)}},{key:"blockBuffers",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.getSourceBufferTypes();if(!i.length)return _l.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),void Promise.resolve().then(e);var r=this.operationQueue,a=i.map((function(e){return r.appendBlocker(e)}));Promise.all(a).then((function(){e(),i.forEach((function(e){var i=t.sourceBuffer[e];null!=i&&i.updating||r.shiftAndExecuteNext(e)}))}))}},{key:"getSourceBufferTypes",value:function(){return Object.keys(this.sourceBuffer)}},{key:"addBufferListener",value:function(e,t,i){var r=this.sourceBuffer[e];if(r){var a=i.bind(this,e);this.listeners[e].push({event:t,listener:a}),r.addEventListener(t,a)}}},{key:"removeBufferListeners",value:function(e){var t=this.sourceBuffer[e];t&&this.listeners[e].forEach((function(e){t.removeEventListener(e.event,e.listener)}))}}]),e}(),capLevelController:tm,errorController:function(){function e(t){Object(T["a"])(this,e),this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.log=void 0,this.warn=void 0,this.error=void 0,this.hls=t,this.log=_l.log.bind(_l,"[info]:"),this.warn=_l.warn.bind(_l,"[warning]:"),this.error=_l.error.bind(_l,"[error]:"),this.registerListeners()}return Object(S["a"])(e,[{key:"registerListeners",value:function(){var e=this.hls;e.on(ml.ERROR,this.onError,this),e.on(ml.MANIFEST_LOADING,this.onManifestLoading,this),e.on(ml.LEVEL_UPDATED,this.onLevelUpdated,this)}},{key:"unregisterListeners",value:function(){var e=this.hls;e&&(e.off(ml.ERROR,this.onError,this),e.off(ml.ERROR,this.onErrorOut,this),e.off(ml.MANIFEST_LOADING,this.onManifestLoading,this),e.off(ml.LEVEL_UPDATED,this.onLevelUpdated,this))}},{key:"destroy",value:function(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}},{key:"startLoad",value:function(e){this.playlistError=0}},{key:"stopLoad",value:function(){}},{key:"getVariantLevelIndex",value:function(e){return(null==e?void 0:e.type)===od?e.level:this.hls.loadLevel}},{key:"onManifestLoading",value:function(){this.playlistError=0,this.penalizedRenditions={}}},{key:"onLevelUpdated",value:function(){this.playlistError=0}},{key:"onError",value:function(e,t){var i,r;if(!t.fatal){var a=this.hls,n=t.context;switch(t.details){case yl.FRAG_LOAD_ERROR:case yl.FRAG_LOAD_TIMEOUT:case yl.KEY_LOAD_ERROR:case yl.KEY_LOAD_TIMEOUT:return void(t.errorAction=this.getFragRetryOrSwitchAction(t));case yl.FRAG_PARSING_ERROR:if(null!=(i=t.frag)&&i.gap)return void(t.errorAction={action:Kd,flags:Qd});case yl.FRAG_GAP:case yl.FRAG_DECRYPT_ERROR:return t.errorAction=this.getFragRetryOrSwitchAction(t),void(t.errorAction.action=Jd);case yl.LEVEL_EMPTY_ERROR:case yl.LEVEL_PARSING_ERROR:var s,o,c=t.parent===od?t.level:a.loadLevel;return void(t.details===yl.LEVEL_EMPTY_ERROR&&null!=(s=t.context)&&null!=(o=s.levelDetails)&&o.live?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,c):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,c)));case yl.LEVEL_LOAD_ERROR:case yl.LEVEL_LOAD_TIMEOUT:return void("number"==typeof(null==n?void 0:n.level)&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,n.level)));case yl.AUDIO_TRACK_LOAD_ERROR:case yl.AUDIO_TRACK_LOAD_TIMEOUT:case yl.SUBTITLE_LOAD_ERROR:case yl.SUBTITLE_TRACK_LOAD_TIMEOUT:if(n){var l=a.levels[a.loadLevel];if(l&&(n.type===nd&&n.groupId===l.audioGroupId||n.type===sd&&n.groupId===l.textGroupId))return t.errorAction=this.getPlaylistRetryOrSwitchAction(t,a.loadLevel),t.errorAction.action=Jd,void(t.errorAction.flags=Xd)}return;case yl.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:var u=a.levels[a.loadLevel],d=null==u?void 0:u.attrs["HDCP-LEVEL"];return void(d&&(t.errorAction={action:Jd,flags:$d,hdcpLevel:d}));case yl.BUFFER_ADD_CODEC_ERROR:case yl.REMUX_ALLOC_ERROR:return void(t.errorAction=this.getLevelSwitchAction(t,null!=(r=t.level)?r:a.loadLevel));case yl.INTERNAL_EXCEPTION:case yl.BUFFER_APPENDING_ERROR:case yl.BUFFER_APPEND_ERROR:case yl.BUFFER_FULL_ERROR:case yl.LEVEL_SWITCH_ERROR:case yl.BUFFER_STALLED_ERROR:case yl.BUFFER_SEEK_OVER_HOLE:case yl.BUFFER_NUDGE_ON_STALL:return void(t.errorAction={action:Kd,flags:Qd})}if(t.type===gl.KEY_SYSTEM_ERROR){var h=this.getVariantLevelIndex(t.frag);return t.levelRetry=!1,void(t.errorAction=this.getLevelSwitchAction(t,h))}}}},{key:"getPlaylistRetryOrSwitchAction",value:function(e,t){var i,r=jd(this.hls.config.playlistLoadPolicy,e),a=this.playlistError++,n=null==(i=e.response)?void 0:i.code;if(Gd(r,a,Ud(e),n))return{action:Yd,flags:Qd,retryConfig:r,retryCount:a};var s=this.getLevelSwitchAction(e,t);return r&&(s.retryConfig=r,s.retryCount=a),s}},{key:"getFragRetryOrSwitchAction",value:function(e){var t=this.hls,i=this.getVariantLevelIndex(e.frag),r=t.levels[i],a=t.config,n=a.fragLoadPolicy,s=a.keyLoadPolicy,o=jd(e.details.startsWith("key")?s:n,e),c=t.levels.reduce((function(e,t){return e+t.fragmentError}),0);if(r){var l;e.details!==yl.FRAG_GAP&&r.fragmentError++;var u=null==(l=e.response)?void 0:l.code;if(Gd(o,c,Ud(e),u))return{action:Yd,flags:Qd,retryConfig:o,retryCount:c}}var d=this.getLevelSwitchAction(e,i);return o&&(d.retryConfig=o,d.retryCount=c),d}},{key:"getLevelSwitchAction",value:function(e,t){var i=this.hls;null==t&&(t=i.loadLevel);var r=this.hls.levels[t];if(r&&(r.loadError++,i.autoLevelEnabled)){for(var a,n,s=-1,o=i.levels,c=i.loadLevel,l=i.minAutoLevel,u=i.maxAutoLevel,d=null==(a=e.frag)?void 0:a.type,h=null!=(n=e.context)?n:{},f=h.type,p=h.groupId,m=o.length;m--;){var g=(m+c)%o.length;if(g!==c&&g>=l&&g<=u&&0===o[g].loadError){var y=o[g];if(e.details===yl.FRAG_GAP&&e.frag){var v=o[g].details;if(v){var b=Vd(e.frag,v.fragments,e.frag.start);if(null!=b&&b.gap)continue}}else if(f===nd&&p===y.audioGroupId||f===sd&&p===y.textGroupId||d===cd&&r.audioGroupId===y.audioGroupId||d===ld&&r.textGroupId===y.textGroupId)continue;s=g;break}}if(s>-1&&i.loadLevel!==s)return e.levelRetry=!0,this.playlistError=0,{action:Jd,flags:Qd,nextAutoLevel:s}}return{action:Jd,flags:Xd}}},{key:"onErrorOut",value:function(e,t){var i;switch(null==(i=t.errorAction)?void 0:i.action){case Kd:break;case Jd:this.sendAlternateToPenaltyBox(t),t.errorAction.resolved||t.details===yl.FRAG_GAP||(t.fatal=!0)}t.fatal&&this.hls.stopLoad()}},{key:"sendAlternateToPenaltyBox",value:function(e){var t=this.hls,i=e.errorAction;if(i){var r=i.flags,a=i.hdcpLevel,n=i.nextAutoLevel;switch(r){case Qd:this.switchLevel(e,n);break;case Xd:i.resolved||(i.resolved=this.redundantFailover(e));break;case $d:a&&(t.maxHdcpLevel=Td[Td.indexOf(a)-1],i.resolved=!0),this.warn('Restricting playback to HDCP-LEVEL of "'.concat(t.maxHdcpLevel,'" or lower'))}i.resolved||this.switchLevel(e,n)}}},{key:"switchLevel",value:function(e,t){void 0!==t&&e.errorAction&&(this.warn("switching to level ".concat(t," after ").concat(e.details)),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel)}},{key:"redundantFailover",value:function(e){var t=this,i=this.hls,r=this.penalizedRenditions,a=e.parent===od?e.level:i.loadLevel,n=i.levels[a],s=n.url.length,o=e.frag?e.frag.urlId:n.urlId;n.urlId!==o||e.frag&&!n.details||this.penalizeRendition(n,e);for(var c=function(c){var l=(o+c)%s,u=r[l];if(!u||Zd(u,e,r[o]))return{v:(t.warn("Switching to Redundant Stream ".concat(l+1,"/").concat(s,': "').concat(n.url[l],'" after ').concat(e.details)),t.playlistError=0,i.levels.forEach((function(e){e.urlId=l})),i.nextLoadLevel=a,!0)}},l=1;l<s;l++){var u=c(l);if("object"===Object(E["a"])(u))return u.v}return!1}},{key:"penalizeRendition",value:function(e,t){var i=this.penalizedRenditions,r=i[e.urlId]||{lastErrorPerfMs:0,errors:[],details:void 0};r.lastErrorPerfMs=performance.now(),r.errors.push(t),r.details=e.details,i[e.urlId]=r}}]),e}(),fpsController:function(){function e(t){Object(T["a"])(this,e),this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=t,this.registerListeners()}return Object(S["a"])(e,[{key:"setStreamController",value:function(e){this.streamController=e}},{key:"registerListeners",value:function(){this.hls.on(ml.MEDIA_ATTACHING,this.onMediaAttaching,this)}},{key:"unregisterListeners",value:function(){this.hls.off(ml.MEDIA_ATTACHING,this.onMediaAttaching,this)}},{key:"destroy",value:function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}},{key:"onMediaAttaching",value:function(e,t){var i=this.hls.config;if(i.capLevelOnFPSDrop){var r=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=r,r&&"function"==typeof r.getVideoPlaybackQuality&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),i.fpsDroppedMonitoringPeriod)}}},{key:"checkFPS",value:function(e,t,i){var r=performance.now();if(t){if(this.lastTime){var a=r-this.lastTime,n=i-this.lastDroppedFrames,s=t-this.lastDecodedFrames,o=1e3*n/a,c=this.hls;if(c.trigger(ml.FPS_DROP,{currentDropped:n,currentDecoded:s,totalDroppedFrames:i}),o>0&&n>c.config.fpsDroppedMonitoringThreshold*s){var l=c.currentLevel;_l.warn("drop FPS ratio greater than max allowed value for currentLevel: "+l),l>0&&(-1===c.autoLevelCapping||c.autoLevelCapping>=l)&&(l-=1,c.trigger(ml.FPS_DROP_LEVEL_CAPPING,{level:l,droppedLevel:c.currentLevel}),c.autoLevelCapping=l,this.streamController.nextLevelSwitch())}}this.lastTime=r,this.lastDroppedFrames=i,this.lastDecodedFrames=t}}},{key:"checkFPSInterval",value:function(){var e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){var t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}]),e}(),stretchShortVideoTrack:!1,maxAudioFramesDrift: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,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:Jl,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0,certLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null}},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},{cueHandler:km,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}),{},{subtitleStreamController:function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e,r,a){var n;return Object(T["a"])(this,i),n=t.call(this,e,r,a,"[subtitle-stream-controller]",ld),n.levels=[],n.currentTrackId=-1,n.tracksBuffered=[],n.mainDetails=null,n._registerListeners(),n}return Object(S["a"])(i,[{key:"onHandlerDestroying",value:function(){this._unregisterListeners(),this.mainDetails=null}},{key:"_registerListeners",value:function(){var e=this.hls;e.on(ml.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(ml.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(ml.MANIFEST_LOADING,this.onManifestLoading,this),e.on(ml.LEVEL_LOADED,this.onLevelLoaded,this),e.on(ml.ERROR,this.onError,this),e.on(ml.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(ml.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(ml.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(ml.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(ml.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(ml.FRAG_BUFFERED,this.onFragBuffered,this)}},{key:"_unregisterListeners",value:function(){var e=this.hls;e.off(ml.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(ml.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(ml.MANIFEST_LOADING,this.onManifestLoading,this),e.off(ml.LEVEL_LOADED,this.onLevelLoaded,this),e.off(ml.ERROR,this.onError,this),e.off(ml.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(ml.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(ml.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(ml.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(ml.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(ml.FRAG_BUFFERED,this.onFragBuffered,this)}},{key:"startLoad",value:function(e){this.stopLoad(),this.state=Ph,this.setInterval(500),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}},{key:"onManifestLoading",value:function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()}},{key:"onMediaDetaching",value:function(){this.tracksBuffered=[],k(Object(b["a"])(i.prototype),"onMediaDetaching",this).call(this)}},{key:"onLevelLoaded",value:function(e,t){this.mainDetails=t.details}},{key:"onSubtitleFragProcessed",value:function(e,t){var i=t.frag,r=t.success;if(this.fragPrevious=i,this.state=Ph,r){var a=this.tracksBuffered[this.currentTrackId];if(a){for(var n,s=i.start,o=0;o<a.length;o++)if(s>=a[o].start&&s<=a[o].end){n=a[o];break}var c=i.start+i.duration;n?n.end=c:(n={start:s,end:c},a.push(n)),this.fragmentTracker.fragBuffered(i)}}}},{key:"onBufferFlushing",value:function(e,t){var i=t.startOffset,r=t.endOffset;if(0===i&&r!==Number.POSITIVE_INFINITY){var a=r-1;if(a<=0)return;t.endOffsetSubtitles=Math.max(0,a),this.tracksBuffered.forEach((function(e){for(var t=0;t<e.length;)if(e[t].end<=a)e.shift();else{if(!(e[t].start<a))break;e[t].start=a,t++}})),this.fragmentTracker.removeFragmentsInRange(i,a,ld)}}},{key:"onFragBuffered",value:function(e,t){var i;this.loadedmetadata||t.frag.type!==od||null!=(i=this.media)&&i.buffered.length&&(this.loadedmetadata=!0)}},{key:"onError",value:function(e,t){var i=t.frag;(null==i?void 0:i.type)===ld&&(this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==Ih&&(this.state=Ph))}},{key:"onSubtitleTracksUpdated",value:function(e,t){var i=this,r=t.subtitleTracks;tp(this.levels,r)?this.levels=r.map((function(e){return new Ld(e)})):(this.tracksBuffered=[],this.levels=r.map((function(e){var t=new Ld(e);return i.tracksBuffered[t.id]=[],t})),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,ld),this.fragPrevious=null,this.mediaBuffer=null)}},{key:"onSubtitleTrackSwitch",value:function(e,t){if(this.currentTrackId=t.id,this.levels.length&&-1!==this.currentTrackId){var i=this.levels[this.currentTrackId];null!=i&&i.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,i&&this.setInterval(500)}else this.clearInterval()}},{key:"onSubtitleTrackLoaded",value:function(e,t){var i,r=t.details,a=t.id,n=this.currentTrackId,s=this.levels;if(s.length){var o=s[n];if(!(a>=s.length||a!==n)&&o){this.mediaBuffer=this.mediaBufferTimeRanges;var c=0;if(r.live||null!=(i=o.details)&&i.live){var l=this.mainDetails;if(r.deltaUpdateFailed||!l)return;var u=l.fragments[0];o.details?(c=this.alignPlaylists(r,o.details),0===c&&u&&(c=u.start,Bd(r,c))):r.hasProgramDateTime&&l.hasProgramDateTime?(Eh(r,l),c=r.fragments[0].start):u&&(c=u.start,Bd(r,c))}o.details=r,this.levelLastLoaded=a,this.startFragRequested||!this.mainDetails&&r.live||this.setStartPosition(o.details,c),this.tick(),r.live&&!this.fragCurrent&&this.media&&this.state===Ph&&(Vd(null,r.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),o.details=void 0))}}}},{key:"_handleFragmentLoadComplete",value:function(e){var t=this,i=e.frag,r=e.payload,a=i.decryptdata,n=this.hls;if(!this.fragContextChanged(i)&&r&&r.byteLength>0&&a&&a.key&&a.iv&&"AES-128"===a.method){var s=performance.now();this.decrypter.decrypt(new Uint8Array(r),a.key.buffer,a.iv.buffer)["catch"]((function(e){throw n.trigger(ml.ERROR,{type:gl.MEDIA_ERROR,details:yl.FRAG_DECRYPT_ERROR,fatal:!1,error:e,reason:e.message,frag:i}),e})).then((function(e){var t=performance.now();n.trigger(ml.FRAG_DECRYPTED,{frag:i,payload:e,stats:{tstart:s,tdecrypt:t}})}))["catch"]((function(e){t.warn("".concat(e.name,": ").concat(e.message)),t.state=Ph}))}}},{key:"doTick",value:function(){if(this.media){if(this.state===Ph){var e=this.currentTrackId,t=this.levels,i=t[e];if(!t.length||!i||!i.details)return;var r=this.config,a=this.getLoadPosition(),n=Ah.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],a,r.maxBufferHole),s=n.end,o=n.len,c=this.getFwdBufferInfo(this.media,od),l=i.details;if(o>this.getMaxBufferLength(null==c?void 0:c.len)+l.levelTargetDuration)return;var u=l.fragments,d=u.length,h=l.edge,f=null,p=this.fragPrevious;if(s<h){var m=r.maxFragLookUpTolerance,g=s>h-m?0:m;f=Vd(p,u,Math.max(u[0].start,s),g),!f&&p&&p.start<u[0].start&&(f=u[0])}else f=u[d-1];if(!f)return;if(f=this.mapToInitFragWhenRequired(f),"initSegment"!==f.sn){var y=u[f.sn-l.startSN-1];y&&y.cc===f.cc&&this.fragmentTracker.getState(y)===nh&&(f=y)}this.fragmentTracker.getState(f)===nh&&this.loadFragment(f,i,s)}}else this.state=Ph}},{key:"getMaxBufferLength",value:function(e){var t=k(Object(b["a"])(i.prototype),"getMaxBufferLength",this).call(this);return e?Math.max(t,e):t}},{key:"loadFragment",value:function(e,t,r){this.fragCurrent=e,"initSegment"===e.sn?this._loadInitSegment(e,t):(this.startFragRequested=!0,k(Object(b["a"])(i.prototype),"loadFragment",this).call(this,e,t,r))}},{key:"mediaBufferTimeRanges",get:function(){return new rp(this.tracksBuffered[this.currentTrackId]||[])}}]),i}(Vh),subtitleTrackController:function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e,"[subtitle-track-controller]"),r.media=null,r.tracks=[],r.groupId=null,r.tracksInGroup=[],r.trackId=-1,r.selectDefaultTrack=!0,r.queuedDefaultTrack=-1,r.trackChangeListener=function(){return r.onTextTracksChanged()},r.asyncPollTrackChange=function(){return r.pollTrackChange(0)},r.useTextTrackPolling=!1,r.subtitlePollingInterval=-1,r._subtitleDisplay=!0,r.registerListeners(),r}return Object(S["a"])(i,[{key:"destroy",value:function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,k(Object(b["a"])(i.prototype),"destroy",this).call(this)}},{key:"subtitleDisplay",get:function(){return this._subtitleDisplay},set:function(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes(this.trackId)}},{key:"registerListeners",value:function(){var e=this.hls;e.on(ml.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(ml.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(ml.MANIFEST_LOADING,this.onManifestLoading,this),e.on(ml.MANIFEST_PARSED,this.onManifestParsed,this),e.on(ml.LEVEL_LOADING,this.onLevelLoading,this),e.on(ml.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(ml.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(ml.ERROR,this.onError,this)}},{key:"unregisterListeners",value:function(){var e=this.hls;e.off(ml.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(ml.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(ml.MANIFEST_LOADING,this.onManifestLoading,this),e.off(ml.MANIFEST_PARSED,this.onManifestParsed,this),e.off(ml.LEVEL_LOADING,this.onLevelLoading,this),e.off(ml.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(ml.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(ml.ERROR,this.onError,this)}},{key:"onMediaAttached",value:function(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}},{key:"pollTrackChange",value:function(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,e)}},{key:"onMediaDetaching",value:function(){this.media&&(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),ap(this.media.textTracks).forEach((function(e){md(e)})),this.subtitleTrack=-1,this.media=null)}},{key:"onManifestLoading",value:function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0}},{key:"onManifestParsed",value:function(e,t){this.tracks=t.subtitleTracks}},{key:"onSubtitleTrackLoaded",value:function(e,t){var i=t.id,r=t.details,a=this.trackId,n=this.tracksInGroup[a];if(n){var s=n.details;n.details=t.details,this.log("subtitle track ".concat(i," loaded [").concat(r.startSN,"-").concat(r.endSN,"]")),i===this.trackId&&this.playlistLoaded(i,t,s)}else this.warn("Invalid subtitle track id ".concat(i))}},{key:"onLevelLoading",value:function(e,t){this.switchLevel(t.level)}},{key:"onLevelSwitching",value:function(e,t){this.switchLevel(t.level)}},{key:"switchLevel",value:function(e){var t=this.hls.levels[e];if(null!=t&&t.textGroupIds){var i=t.textGroupIds[t.urlId],r=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;if(this.groupId!==i){var a=this.tracks.filter((function(e){return!i||e.groupId===i}));this.tracksInGroup=a;var n=this.findTrackId(null==r?void 0:r.name)||this.findTrackId();this.groupId=i||null;var s={subtitleTracks:a};this.log("Updating subtitle tracks, ".concat(a.length,' track(s) found in "').concat(i,'" group-id')),this.hls.trigger(ml.SUBTITLE_TRACKS_UPDATED,s),-1!==n&&this.setSubtitleTrack(n,r)}else this.shouldReloadPlaylist(r)&&this.setSubtitleTrack(this.trackId,r)}}},{key:"findTrackId",value:function(e){for(var t=this.tracksInGroup,i=0;i<t.length;i++){var r=t[i];if((!this.selectDefaultTrack||r["default"])&&(!e||e===r.name))return r.id}return-1}},{key:"onError",value:function(e,t){!t.fatal&&t.context&&t.context.type===sd&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&this.checkRetry(t)}},{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(e){this.selectDefaultTrack=!1;var t=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(e,t)}},{key:"loadPlaylist",value:function(e){k(Object(b["a"])(i.prototype),"loadPlaylist",this).call(this);var t=this.tracksInGroup[this.trackId];if(this.shouldLoadPlaylist(t)){var r=t.id,a=t.groupId,n=t.url;if(e)try{n=e.addDirectives(n)}catch(s){this.warn("Could not construct new URL with HLS Delivery Directives: ".concat(s))}this.log("Loading subtitle playlist for id ".concat(r)),this.hls.trigger(ml.SUBTITLE_TRACK_LOADING,{url:n,id:r,groupId:a,deliveryDirectives:e||null})}}},{key:"toggleTrackModes",value:function(e){var t=this,i=this.media,r=this.trackId;if(i){var a=ap(i.textTracks),n=a.filter((function(e){return e.groupId===t.groupId}));if(-1===e)[].slice.call(a).forEach((function(e){e.mode="disabled"}));else{var s=n[r];s&&(s.mode="disabled")}var o=n[e];o&&(o.mode=this.subtitleDisplay?"showing":"hidden")}}},{key:"setSubtitleTrack",value:function(e,t){var i,r=this.tracksInGroup;if(this.media){if(this.trackId!==e&&this.toggleTrackModes(e),!(this.trackId===e&&(-1===e||null!=(i=r[e])&&i.details)||e<-1||e>=r.length)){this.clearTimer();var a=r[e];if(this.log("Switching to subtitle-track ".concat(e)+(a?' "'.concat(a.name,'" lang:').concat(a.lang," group:").concat(a.groupId):"")),this.trackId=e,a){var n=a.id,s=a.groupId,o=void 0===s?"":s,c=a.name,l=a.type,u=a.url;this.hls.trigger(ml.SUBTITLE_TRACK_SWITCH,{id:n,groupId:o,name:c,type:l,url:u});var d=this.switchParams(a.url,null==t?void 0:t.details);this.loadPlaylist(d)}else this.hls.trigger(ml.SUBTITLE_TRACK_SWITCH,{id:e})}}else this.queuedDefaultTrack=e}},{key:"onTextTracksChanged",value:function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),this.media&&this.hls.config.renderTextTracksNatively){for(var e=-1,t=ap(this.media.textTracks),i=0;i<t.length;i++)if("hidden"===t[i].mode)e=i;else if("showing"===t[i].mode){e=i;break}this.subtitleTrack!==e&&(this.subtitleTrack=e)}}}]),i}(th),timelineController:function(){function e(t){if(Object(T["a"])(this,e),this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this.captionsProperties=void 0,this.hls=t,this.config=t.config,this.Cues=t.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var i=new xp(this,"textTrack1"),r=new xp(this,"textTrack2"),a=new xp(this,"textTrack3"),n=new xp(this,"textTrack4");this.cea608Parser1=new Sp(1,i,r),this.cea608Parser2=new Sp(3,a,n)}t.on(ml.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(ml.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(ml.MANIFEST_LOADING,this.onManifestLoading,this),t.on(ml.MANIFEST_LOADED,this.onManifestLoaded,this),t.on(ml.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.on(ml.FRAG_LOADING,this.onFragLoading,this),t.on(ml.FRAG_LOADED,this.onFragLoaded,this),t.on(ml.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.on(ml.FRAG_DECRYPTED,this.onFragDecrypted,this),t.on(ml.INIT_PTS_FOUND,this.onInitPtsFound,this),t.on(ml.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.on(ml.BUFFER_FLUSHING,this.onBufferFlushing,this)}return Object(S["a"])(e,[{key:"destroy",value:function(){var e=this.hls;e.off(ml.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(ml.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(ml.MANIFEST_LOADING,this.onManifestLoading,this),e.off(ml.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(ml.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(ml.FRAG_LOADING,this.onFragLoading,this),e.off(ml.FRAG_LOADED,this.onFragLoaded,this),e.off(ml.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(ml.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(ml.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(ml.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(ml.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null}},{key:"addCues",value:function(e,t,i,r,a){for(var n,s,o,c,l=!1,u=a.length;u--;){var d=a[u],h=(n=d[0],s=d[1],o=t,c=i,Math.min(s,c)-Math.max(n,o));if(h>=0&&(d[0]=Math.min(d[0],t),d[1]=Math.max(d[1],i),l=!0,h/(i-t)>.5))return}if(l||a.push([t,i]),this.config.renderTextTracksNatively){var f=this.captionsTracks[e];this.Cues.newCue(f,t,i,r)}else{var p=this.Cues.newCue(null,t,i,r);this.hls.trigger(ml.CUES_PARSED,{type:"captions",cues:p,track:e})}}},{key:"onInitPtsFound",value:function(e,t){var i=this,r=t.frag,a=t.id,n=t.initPTS,s=t.timescale,o=this.unparsedVttFrags;"main"===a&&(this.initPTS[r.cc]={baseTime:n,timescale:s}),o.length&&(this.unparsedVttFrags=[],o.forEach((function(e){i.onFragLoaded(ml.FRAG_LOADED,e)})))}},{key:"getExistingTrack",value:function(e){var t=this.media;if(t)for(var i=0;i<t.textTracks.length;i++){var r=t.textTracks[i];if(r[e])return r}return null}},{key:"createCaptionsTrack",value:function(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}},{key:"createNativeTrack",value:function(e){if(!this.captionsTracks[e]){var t=this.captionsProperties,i=this.captionsTracks,r=this.media,a=t[e],n=a.label,s=a.languageCode,o=this.getExistingTrack(e);if(o)i[e]=o,md(i[e]),fd(i[e],r);else{var c=this.createTextTrack("captions",n,s);c&&(c[e]=!0,i[e]=c)}}}},{key:"createNonNativeTrack",value:function(e){if(!this.nonNativeCaptionsTracks[e]){var t=this.captionsProperties[e];if(t){var i={_id:e,label:t.label,kind:"captions",default:!!t.media&&!!t.media["default"],closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=i,this.hls.trigger(ml.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[i]})}}}},{key:"createTextTrack",value:function(e,t,i){var r=this.media;if(r)return r.addTextTrack(e,t,i)}},{key:"onMediaAttaching",value:function(e,t){this.media=t.media,this._cleanTracks()}},{key:"onMediaDetaching",value:function(){var e=this.captionsTracks;Object.keys(e).forEach((function(t){md(e[t]),delete e[t]})),this.nonNativeCaptionsTracks={}}},{key:"onManifestLoading",value:function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs={ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}},this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}},{key:"_cleanTracks",value:function(){var e=this.media;if(e){var t=e.textTracks;if(t)for(var i=0;i<t.length;i++)md(t[i])}}},{key:"onSubtitleTracksUpdated",value:function(e,t){var i=this,r=t.subtitleTracks||[],a=r.some((function(e){return e.textCodec===Hp}));if(this.config.enableWebVTT||a&&this.config.enableIMSC1){if(tp(this.tracks,r))return void(this.tracks=r);if(this.textTracks=[],this.tracks=r,this.config.renderTextTracksNatively){var n=this.media?this.media.textTracks:null;this.tracks.forEach((function(e,t){var r;if(n&&t<n.length){for(var a=null,s=0;s<n.length;s++)if(em(n[s],e)){a=n[s];break}a&&(r=a)}if(r)md(r);else{var o=i._captionsOrSubtitlesFromCharacteristics(e);r=i.createTextTrack(o,e.name,e.lang),r&&(r.mode="disabled")}r&&(r.groupId=e.groupId,i.textTracks.push(r))}))}else if(this.tracks.length){var s=this.tracks.map((function(e){return{label:e.name,kind:e.type.toLowerCase(),default:e["default"],subtitleTrack:e}}));this.hls.trigger(ml.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:s})}}}},{key:"_captionsOrSubtitlesFromCharacteristics",value:function(e){if(e.attrs.CHARACTERISTICS){var t=/transcribes-spoken-dialog/gi.test(e.attrs.CHARACTERISTICS),i=/describes-music-and-sound/gi.test(e.attrs.CHARACTERISTICS);if(t&&i)return"captions"}return"subtitles"}},{key:"onManifestLoaded",value:function(e,t){var i=this;this.config.enableCEA708Captions&&t.captions&&t.captions.forEach((function(e){var t=/(?:CC|SERVICE)([1-4])/.exec(e.instreamId);if(t){var r="textTrack".concat(t[1]),a=i.captionsProperties[r];a&&(a.label=e.name,e.lang&&(a.languageCode=e.lang),a.media=e)}}))}},{key:"closedCaptionsForLevel",value:function(e){var t=this.hls.levels[e.level];return null==t?void 0:t.attrs["CLOSED-CAPTIONS"]}},{key:"onFragLoading",value:function(e,t){var i=this.cea608Parser1,r=this.cea608Parser2,a=this.lastSn,n=this.lastPartIndex;if(this.enabled&&i&&r&&t.frag.type===od){var s,o,c=t.frag.sn,l=null!=(s=null==t||null==(o=t.part)?void 0:o.index)?s:-1;c===a+1||c===a&&l===n+1||(i.reset(),r.reset()),this.lastSn=c,this.lastPartIndex=l}}},{key:"onFragLoaded",value:function(e,t){var i=t.frag,r=t.payload;if(i.type===ld)if(r.byteLength){var a=i.decryptdata,n="stats"in t;if(null==a||!a.encrypted||n){var s=this.tracks[i.level],o=this.vttCCs;o[i.cc]||(o[i.cc]={start:i.start,prevCC:this.prevCC,new:!0},this.prevCC=i.cc),s&&s.textCodec===Hp?this._parseIMSC1(i,r):this._parseVTTs(t)}}else this.hls.trigger(ml.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:new Error("Empty subtitle payload")})}},{key:"_parseIMSC1",value:function(e,t){var i=this,r=this.hls;Kp(t,this.initPTS[e.cc],(function(t){i._appendCues(t,e.level),r.trigger(ml.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})}),(function(t){_l.log("Failed to parse IMSC1: ".concat(t)),r.trigger(ml.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:t})}))}},{key:"_parseVTTs",value:function(e){var t,i=this,r=e.frag,a=e.payload,n=this.initPTS,s=this.unparsedVttFrags,o=n.length-1;if(n[r.cc]||-1!==o){var c=this.hls;Gp(null!=(t=r.initSegment)&&t.data?Eu(r.initSegment.data,new Uint8Array(a)):a,this.initPTS[r.cc],this.vttCCs,r.cc,r.start,(function(e){i._appendCues(e,r.level),c.trigger(ml.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:r})}),(function(t){var n="Missing initPTS for VTT MPEGTS"===t.message;n?s.push(e):i._fallbackToIMSC1(r,a),_l.log("Failed to parse VTT cue: ".concat(t)),n&&o>r.cc||c.trigger(ml.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:t})}))}else s.push(e)}},{key:"_fallbackToIMSC1",value:function(e,t){var i=this,r=this.tracks[e.level];r.textCodec||Kp(t,this.initPTS[e.cc],(function(){r.textCodec=Hp,i._parseIMSC1(e,t)}),(function(){r.textCodec="wvtt"}))}},{key:"_appendCues",value:function(e,t){var i=this.hls;if(this.config.renderTextTracksNatively){var r=this.textTracks[t];if(!r||"disabled"===r.mode)return;e.forEach((function(e){return pd(r,e)}))}else{var a=this.tracks[t];if(!a)return;var n=a["default"]?"default":"subtitles"+t;i.trigger(ml.CUES_PARSED,{type:"subtitles",cues:e,track:n})}}},{key:"onFragDecrypted",value:function(e,t){var i=t.frag;i.type===ld&&this.onFragLoaded(ml.FRAG_LOADED,t)}},{key:"onSubtitleTracksCleared",value:function(){this.tracks=[],this.captionsTracks={}}},{key:"onFragParsingUserdata",value:function(e,t){var i=this.cea608Parser1,r=this.cea608Parser2;if(this.enabled&&i&&r){var a=t.frag,n=t.samples;if(a.type!==od||"NONE"!==this.closedCaptionsForLevel(a))for(var s=0;s<n.length;s++){var o=n[s].bytes;if(o){var c=this.extractCea608Data(o);i.addData(n[s].pts,c[0]),r.addData(n[s].pts,c[1])}}}}},{key:"onBufferFlushing",value:function(e,t){var i=t.startOffset,r=t.endOffset,a=t.endOffsetSubtitles,n=t.type,s=this.media;if(s&&!(s.currentTime<r)){if(!n||"video"===n){var o=this.captionsTracks;Object.keys(o).forEach((function(e){return gd(o[e],i,r)}))}if(this.config.renderTextTracksNatively&&0===i&&void 0!==a){var c=this.textTracks;Object.keys(c).forEach((function(e){return gd(c[e],i,a)}))}}}},{key:"extractCea608Data",value:function(e){for(var t=[[],[]],i=31&e[0],r=2,a=0;a<i;a++){var n=e[r++],s=127&e[r++],o=127&e[r++];if((0!==s||0!==o)&&4&n){var c=3&n;0!==c&&1!==c||(t[c].push(s),t[c].push(o))}}return t}}]),e}(),audioStreamController:function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e,r,a){var n;return Object(T["a"])(this,i),n=t.call(this,e,r,a,"[audio-stream-controller]",cd),n.videoBuffer=null,n.videoTrackCC=-1,n.waitingVideoCC=-1,n.bufferedTrack=null,n.switchingTrack=null,n.trackId=-1,n.waitingData=null,n.mainDetails=null,n.bufferFlushed=!1,n.cachedTrackLoadedData=null,n._registerListeners(),n}return Object(S["a"])(i,[{key:"onHandlerDestroying",value:function(){this._unregisterListeners(),this.mainDetails=null,this.bufferedTrack=null,this.switchingTrack=null}},{key:"_registerListeners",value:function(){var e=this.hls;e.on(ml.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(ml.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(ml.MANIFEST_LOADING,this.onManifestLoading,this),e.on(ml.LEVEL_LOADED,this.onLevelLoaded,this),e.on(ml.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(ml.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(ml.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(ml.ERROR,this.onError,this),e.on(ml.BUFFER_RESET,this.onBufferReset,this),e.on(ml.BUFFER_CREATED,this.onBufferCreated,this),e.on(ml.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(ml.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(ml.FRAG_BUFFERED,this.onFragBuffered,this)}},{key:"_unregisterListeners",value:function(){var e=this.hls;e.off(ml.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(ml.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(ml.MANIFEST_LOADING,this.onManifestLoading,this),e.off(ml.LEVEL_LOADED,this.onLevelLoaded,this),e.off(ml.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(ml.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(ml.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(ml.ERROR,this.onError,this),e.off(ml.BUFFER_RESET,this.onBufferReset,this),e.off(ml.BUFFER_CREATED,this.onBufferCreated,this),e.off(ml.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(ml.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(ml.FRAG_BUFFERED,this.onFragBuffered,this)}},{key:"onInitPtsFound",value:function(e,t){var i=t.frag,r=t.id,a=t.initPTS,n=t.timescale;if("main"===r){var s=i.cc;this.initPTS[i.cc]={baseTime:a,timescale:n},this.log("InitPTS for cc: ".concat(s," found from main: ").concat(a)),this.videoTrackCC=s,this.state===Gh&&this.tick()}}},{key:"startLoad",value:function(e){if(!this.levels)return this.startPosition=e,void(this.state=Ih);var t=this.lastCurrentTime;this.stopLoad(),this.setInterval(100),t>0&&-1===e?(this.log("Override startPosition with lastCurrentTime @".concat(t.toFixed(3))),e=t,this.state=Ph):(this.loadedmetadata=!1,this.state=Fh),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=e,this.tick()}},{key:"doTick",value:function(){switch(this.state){case Ph:this.doTickIdle();break;case Fh:var e,t=this.levels,r=this.trackId,a=null==t||null==(e=t[r])?void 0:e.details;if(a){if(this.waitForCdnTuneIn(a))break;this.state=Gh}break;case Mh:var n,s=performance.now(),o=this.retryDate;(!o||s>=o||null!=(n=this.media)&&n.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.trackId),this.state=Ph);break;case Gh:var c=this.waitingData;if(c){var l=c.frag,u=c.part,d=c.cache,h=c.complete;if(void 0!==this.initPTS[l.cc]){this.waitingData=null,this.waitingVideoCC=-1,this.state=Bh;var f={frag:l,part:u,payload:d.flush(),networkDetails:null};this._handleFragmentLoadProgress(f),h&&k(Object(b["a"])(i.prototype),"_handleFragmentLoadComplete",this).call(this,f)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log("Waiting fragment cc (".concat(l.cc,") cancelled because video is at cc ").concat(this.videoTrackCC)),this.clearWaitingFragment();else{var p=this.getLoadPosition(),m=Ah.bufferInfo(this.mediaBuffer,p,this.config.maxBufferHole);Wd(m.end,this.config.maxFragLookUpTolerance,l)<0&&(this.log("Waiting fragment cc (".concat(l.cc,") @ ").concat(l.start," cancelled because another fragment at ").concat(m.end," is needed")),this.clearWaitingFragment())}}else this.state=Ph}this.onTickEnd()}},{key:"clearWaitingFragment",value:function(){var e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=Ph)}},{key:"resetLoadingState",value:function(){this.clearWaitingFragment(),k(Object(b["a"])(i.prototype),"resetLoadingState",this).call(this)}},{key:"onTickEnd",value:function(){var e=this.media;null!=e&&e.readyState&&(this.lastCurrentTime=e.currentTime)}},{key:"doTickIdle",value:function(){var e=this.hls,t=this.levels,i=this.media,r=this.trackId,a=e.config;if(null!=t&&t[r]&&(i||!this.startFragRequested&&a.startFragPrefetch)){var n=t[r],s=n.details;if(!s||s.live&&this.levelLastLoaded!==r||this.waitForCdnTuneIn(s))this.state=Fh;else{var o=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&o&&(this.bufferFlushed=!1,this.afterBufferFlushed(o,Rl,cd));var c=this.getFwdBufferInfo(o,cd);if(null!==c){var l=this.bufferedTrack,u=this.switchingTrack;if(!u&&this._streamEnded(c,s))return e.trigger(ml.BUFFER_EOS,{type:"audio"}),void(this.state=Nh);var d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,od),h=c.len,f=this.getMaxBufferLength(null==d?void 0:d.len);if(!(h>=f)||u){var p=s.fragments[0].start,m=c.end;if(u&&i){var g=this.getLoadPosition();l&&u.attrs!==l.attrs&&(m=g),s.PTSKnown&&g<p&&(c.end>p||c.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),i.currentTime=p+.05)}var y=this.getNextFragment(m,s),v=!1;if(y&&this.isLoopLoading(y,m)&&(v=!!y.gap,y=this.getNextFragmentLoopLoading(y,s,c,od,f)),y){var b=d&&y.start>d.end+s.targetduration;if(b||(null==d||!d.len)&&c.len){var A=this.getAppendedFrag(y.start,od);if(null===A||(v||(v=!!A.gap||!!b&&0===d.len),b&&!v||v&&c.nextStart&&c.nextStart<A.end))return}this.loadFragment(y,n,m)}else this.bufferFlushed=!0}}}}}},{key:"getMaxBufferLength",value:function(e){var t=k(Object(b["a"])(i.prototype),"getMaxBufferLength",this).call(this);return e?Math.min(Math.max(t,e),this.config.maxMaxBufferLength):t}},{key:"onMediaDetaching",value:function(){this.videoBuffer=null,k(Object(b["a"])(i.prototype),"onMediaDetaching",this).call(this)}},{key:"onAudioTracksUpdated",value:function(e,t){var i=t.audioTracks;this.resetTransmuxer(),this.levels=i.map((function(e){return new Ld(e)}))}},{key:"onAudioTrackSwitching",value:function(e,t){var i=!!t.url;this.trackId=t.id;var r=this.fragCurrent;r&&(r.abortRequests(),this.removeUnbufferedFrags(r.start)),this.resetLoadingState(),i?this.setInterval(100):this.resetTransmuxer(),i?(this.switchingTrack=t,this.state=Ph):(this.switchingTrack=null,this.bufferedTrack=t,this.state=Ih),this.tick()}},{key:"onManifestLoading",value:function(){this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1,this.levels=this.mainDetails=this.waitingData=this.bufferedTrack=this.cachedTrackLoadedData=this.switchingTrack=null,this.startFragRequested=!1,this.trackId=this.videoTrackCC=this.waitingVideoCC=-1}},{key:"onLevelLoaded",value:function(e,t){this.mainDetails=t.details,null!==this.cachedTrackLoadedData&&(this.hls.trigger(ml.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)}},{key:"onAudioTrackLoaded",value:function(e,t){var i;if(null!=this.mainDetails){var r=this.levels,a=t.details,n=t.id;if(r){this.log("Track ".concat(n," loaded [").concat(a.startSN,",").concat(a.endSN,"]").concat(a.lastPartSn?"[part-".concat(a.lastPartSn,"-").concat(a.lastPartIndex,"]"):"",",duration:").concat(a.totalduration));var s=r[n],o=0;if(a.live||null!=(i=s.details)&&i.live){this.checkLiveUpdate(a);var c=this.mainDetails;if(a.deltaUpdateFailed||!c)return;!s.details&&a.hasProgramDateTime&&c.hasProgramDateTime?(Eh(a,c),o=a.fragments[0].start):o=this.alignPlaylists(a,s.details)}s.details=a,this.levelLastLoaded=n,this.startFragRequested||!this.mainDetails&&a.live||this.setStartPosition(s.details,o),this.state!==Fh||this.waitForCdnTuneIn(a)||(this.state=Ph),this.tick()}else this.warn("Audio tracks were reset while loading level ".concat(n))}else this.cachedTrackLoadedData=t}},{key:"_handleFragmentLoadProgress",value:function(e){var t,i=e.frag,r=e.part,a=e.payload,n=this.config,s=this.trackId,o=this.levels;if(o){var c=o[s];if(c){var l=c.details;if(!l)return this.warn("Audio track details undefined on fragment load progress"),void this.removeUnbufferedFrags(i.start);var u=n.defaultAudioCodec||c.audioCodec||"mp4a.40.2",d=this.transmuxer;d||(d=this.transmuxer=new Yf(this.hls,cd,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var h=this.initPTS[i.cc],f=null==(t=i.initSegment)?void 0:t.data;if(void 0!==h){var p=r?r.index:-1,m=-1!==p,g=new kh(i.level,i.sn,i.stats.chunkCount,a.byteLength,p,m);d.push(a,f,u,"",i,r,l.totalduration,!1,g,h)}else{this.log("Unknown video PTS for cc ".concat(i.cc,", waiting for video PTS before demuxing audio frag ").concat(i.sn," of [").concat(l.startSN," ,").concat(l.endSN,"],track ").concat(s));var y=this.waitingData=this.waitingData||{frag:i,part:r,cache:new ep,complete:!1},v=y.cache;v.push(new Uint8Array(a)),this.waitingVideoCC=this.videoTrackCC,this.state=Gh}}else this.warn("Audio track is undefined on fragment load progress")}else this.warn("Audio tracks were reset while fragment load was in progress. Fragment ".concat(i.sn," of level ").concat(i.level," will not be buffered"))}},{key:"_handleFragmentLoadComplete",value:function(e){this.waitingData?this.waitingData.complete=!0:k(Object(b["a"])(i.prototype),"_handleFragmentLoadComplete",this).call(this,e)}},{key:"onBufferReset",value:function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1}},{key:"onBufferCreated",value:function(e,t){var i=t.tracks.audio;i&&(this.mediaBuffer=i.buffer||null),t.tracks.video&&(this.videoBuffer=t.tracks.video.buffer||null)}},{key:"onFragBuffered",value:function(e,t){var i=t.frag,r=t.part;if(i.type===cd)if(this.fragContextChanged(i))this.warn("Fragment ".concat(i.sn).concat(r?" p: "+r.index:""," of level ").concat(i.level," finished buffering, but was aborted. state: ").concat(this.state,", audioSwitch: ").concat(this.switchingTrack?this.switchingTrack.name:"false"));else{if("initSegment"!==i.sn){this.fragPrevious=i;var a=this.switchingTrack;a&&(this.bufferedTrack=a,this.switchingTrack=null,this.hls.trigger(ml.AUDIO_TRACK_SWITCHED,dl({},a)))}this.fragBufferedComplete(i,r)}else if(!this.loadedmetadata&&i.type===od){var n=this.videoBuffer||this.media;n&&Ah.getBuffered(n).length&&(this.loadedmetadata=!0)}}},{key:"onError",value:function(e,t){var r;if(t.fatal)this.state=zh;else switch(t.details){case yl.FRAG_GAP:case yl.FRAG_PARSING_ERROR:case yl.FRAG_DECRYPT_ERROR:case yl.FRAG_LOAD_ERROR:case yl.FRAG_LOAD_TIMEOUT:case yl.KEY_LOAD_ERROR:case yl.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(cd,t);break;case yl.AUDIO_TRACK_LOAD_ERROR:case yl.AUDIO_TRACK_LOAD_TIMEOUT:case yl.LEVEL_PARSING_ERROR:t.levelRetry||this.state!==Fh||(null==(r=t.context)?void 0:r.type)!==nd||(this.state=Ph);break;case yl.BUFFER_FULL_ERROR:if(!t.parent||"audio"!==t.parent)return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,k(Object(b["a"])(i.prototype),"flushMainBuffer",this).call(this,0,Number.POSITIVE_INFINITY,"audio"));break;case yl.INTERNAL_EXCEPTION:this.recoverWorkerError(t)}}},{key:"onBufferFlushed",value:function(e,t){var i=t.type;i===Rl&&(this.bufferFlushed=!0,this.state===Nh&&(this.state=Ph))}},{key:"_handleTransmuxComplete",value:function(e){var t,i="audio",r=this.hls,a=e.remuxResult,n=e.chunkMeta,s=this.getCurrentContext(n);if(s){var o=s.frag,c=s.part,l=s.level,u=l.details,d=a.audio,h=a.text,f=a.id3,p=a.initSegment;if(!this.fragContextChanged(o)&&u){if(this.state=Uh,this.switchingTrack&&d&&this.completeAudioSwitch(this.switchingTrack),null!=p&&p.tracks){var m=o.initSegment||o;this._bufferInitSegment(p.tracks,m,n),r.trigger(ml.FRAG_PARSING_INIT_SEGMENT,{frag:m,id:i,tracks:p.tracks})}if(d){var g=d.startPTS,y=d.endPTS,v=d.startDTS,b=d.endDTS;c&&(c.elementaryStreams[Rl]={startPTS:g,endPTS:y,startDTS:v,endDTS:b}),o.setElementaryStreamInfo(Rl,g,y,v,b),this.bufferFragmentData(d,o,c,n)}if(null!=f&&null!=(t=f.samples)&&t.length){var A=fl({id:i,frag:o,details:u},f);r.trigger(ml.FRAG_PARSING_METADATA,A)}if(h){var k=fl({id:i,frag:o,details:u},h);r.trigger(ml.FRAG_PARSING_USERDATA,k)}}else this.fragmentTracker.removeFragment(o)}else this.resetWhenMissingContext(n)}},{key:"_bufferInitSegment",value:function(e,t,i){if(this.state===Uh){e.video&&delete e.video;var r=e.audio;if(r){r.levelCodec=r.codec,r.id="audio",this.log("Init audio buffer, container:".concat(r.container,", codecs[parsed]=[").concat(r.codec,"]")),this.hls.trigger(ml.BUFFER_CODECS,e);var a=r.initSegment;if(null!=a&&a.byteLength){var n={type:"audio",frag:t,part:null,chunkMeta:i,parent:t.type,data:a};this.hls.trigger(ml.BUFFER_APPENDING,n)}this.tick()}}}},{key:"loadFragment",value:function(e,t,r){var a,n=this.fragmentTracker.getState(e);this.fragCurrent=e,this.switchingTrack||n===nh||n===oh?"initSegment"===e.sn?this._loadInitSegment(e,t):null!=(a=t.details)&&a.live&&!this.initPTS[e.cc]?(this.log("Waiting for video PTS in continuity counter ".concat(e.cc," of live stream before loading audio fragment ").concat(e.sn," of level ").concat(this.trackId)),this.state=Gh):(this.startFragRequested=!0,k(Object(b["a"])(i.prototype),"loadFragment",this).call(this,e,t,r)):this.clearTrackerIfNeeded(e)}},{key:"completeAudioSwitch",value:function(e){var t=this.hls,r=this.media,a=this.bufferedTrack,n=null==a?void 0:a.attrs,s=e.attrs;r&&n&&(n.CHANNELS!==s.CHANNELS||n.NAME!==s.NAME||n.LANGUAGE!==s.LANGUAGE)&&(this.log("Switching audio track : flushing all audio"),k(Object(b["a"])(i.prototype),"flushMainBuffer",this).call(this,0,Number.POSITIVE_INFINITY,"audio")),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(ml.AUDIO_TRACK_SWITCHED,dl({},e))}}]),i}(Vh),audioTrackController:function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e,"[audio-track-controller]"),r.tracks=[],r.groupId=null,r.tracksInGroup=[],r.trackId=-1,r.currentTrack=null,r.selectDefaultTrack=!0,r.registerListeners(),r}return Object(S["a"])(i,[{key:"registerListeners",value:function(){var e=this.hls;e.on(ml.MANIFEST_LOADING,this.onManifestLoading,this),e.on(ml.MANIFEST_PARSED,this.onManifestParsed,this),e.on(ml.LEVEL_LOADING,this.onLevelLoading,this),e.on(ml.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(ml.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(ml.ERROR,this.onError,this)}},{key:"unregisterListeners",value:function(){var e=this.hls;e.off(ml.MANIFEST_LOADING,this.onManifestLoading,this),e.off(ml.MANIFEST_PARSED,this.onManifestParsed,this),e.off(ml.LEVEL_LOADING,this.onLevelLoading,this),e.off(ml.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(ml.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(ml.ERROR,this.onError,this)}},{key:"destroy",value:function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,k(Object(b["a"])(i.prototype),"destroy",this).call(this)}},{key:"onManifestLoading",value:function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}},{key:"onManifestParsed",value:function(e,t){this.tracks=t.audioTracks||[]}},{key:"onAudioTrackLoaded",value:function(e,t){var i=t.id,r=t.groupId,a=t.details,n=this.tracksInGroup[i];if(n&&n.groupId===r){var s=n.details;n.details=t.details,this.log("audio-track ".concat(i,' "').concat(n.name,'" lang:').concat(n.lang," group:").concat(r," loaded [").concat(a.startSN,"-").concat(a.endSN,"]")),i===this.trackId&&this.playlistLoaded(i,t,s)}else this.warn("Track with id:".concat(i," and group:").concat(r," not found in active group ").concat(n.groupId))}},{key:"onLevelLoading",value:function(e,t){this.switchLevel(t.level)}},{key:"onLevelSwitching",value:function(e,t){this.switchLevel(t.level)}},{key:"switchLevel",value:function(e){var t=this.hls.levels[e];if(null!=t&&t.audioGroupIds){var i=t.audioGroupIds[t.urlId];if(this.groupId!==i){this.groupId=i||null;var r=this.tracks.filter((function(e){return!i||e.groupId===i}));this.selectDefaultTrack&&!r.some((function(e){return e["default"]}))&&(this.selectDefaultTrack=!1),this.tracksInGroup=r;var a={audioTracks:r};this.log("Updating audio tracks, ".concat(r.length," track(s) found in group:").concat(i)),this.hls.trigger(ml.AUDIO_TRACKS_UPDATED,a),this.selectInitialTrack()}else this.shouldReloadPlaylist(this.currentTrack)&&this.setAudioTrack(this.trackId)}}},{key:"onError",value:function(e,t){!t.fatal&&t.context&&t.context.type===nd&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&(this.requestScheduled=-1,this.checkRetry(t))}},{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}},{key:"setAudioTrack",value:function(e){var t=this.tracksInGroup;if(e<0||e>=t.length)this.warn("Invalid id passed to audio-track controller");else{this.clearTimer();var i=this.currentTrack;t[this.trackId];var r=t[e],a=r.groupId,n=r.name;if(this.log("Switching to audio-track ".concat(e,' "').concat(n,'" lang:').concat(r.lang," group:").concat(a)),this.trackId=e,this.currentTrack=r,this.selectDefaultTrack=!1,this.hls.trigger(ml.AUDIO_TRACK_SWITCHING,dl({},r)),!r.details||r.details.live){var s=this.switchParams(r.url,null==i?void 0:i.details);this.loadPlaylist(s)}}}},{key:"selectInitialTrack",value:function(){var e=this.tracksInGroup,t=this.findTrackId(this.currentTrack)|this.findTrackId(null);if(-1!==t)this.setAudioTrack(t);else{var i=new Error("No track found for running audio group-ID: ".concat(this.groupId," track count: ").concat(e.length));this.warn(i.message),this.hls.trigger(ml.ERROR,{type:gl.MEDIA_ERROR,details:yl.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:i})}}},{key:"findTrackId",value:function(e){for(var t=this.tracksInGroup,i=0;i<t.length;i++){var r=t[i];if((!this.selectDefaultTrack||r["default"])&&(!e||void 0!==e.attrs["STABLE-RENDITION-ID"]&&e.attrs["STABLE-RENDITION-ID"]===r.attrs["STABLE-RENDITION-ID"]||e.name===r.name&&e.lang===r.lang))return r.id}return-1}},{key:"loadPlaylist",value:function(e){k(Object(b["a"])(i.prototype),"loadPlaylist",this).call(this);var t=this.tracksInGroup[this.trackId];if(this.shouldLoadPlaylist(t)){var r=t.id,a=t.groupId,n=t.url;if(e)try{n=e.addDirectives(n)}catch(s){this.warn("Could not construct new URL with HLS Delivery Directives: ".concat(s))}this.log("loading audio-track playlist ".concat(r,' "').concat(t.name,'" lang:').concat(t.lang," group:").concat(a)),this.clearTimer(),this.hls.trigger(ml.AUDIO_TRACK_LOADING,{url:n,id:r,groupId:a,deliveryDirectives:e||null})}}}]),i}(th),emeController:rm,cmcdController:dm,contentSteeringController:function(){function e(t){Object(T["a"])(this,e),this.hls=void 0,this.log=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this.pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=t,this.log=_l.log.bind(_l,"[content-steering]:"),this.registerListeners()}return Object(S["a"])(e,[{key:"registerListeners",value:function(){var e=this.hls;e.on(ml.MANIFEST_LOADING,this.onManifestLoading,this),e.on(ml.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(ml.MANIFEST_PARSED,this.onManifestParsed,this),e.on(ml.ERROR,this.onError,this)}},{key:"unregisterListeners",value:function(){var e=this.hls;e&&(e.off(ml.MANIFEST_LOADING,this.onManifestLoading,this),e.off(ml.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(ml.MANIFEST_PARSED,this.onManifestParsed,this),e.off(ml.ERROR,this.onError,this))}},{key:"startLoad",value:function(){if(this.started=!0,self.clearTimeout(this.reloadTimer),this.enabled&&this.uri)if(this.updated){var e=Math.max(1e3*this.timeToLoad-(performance.now()-this.updated),0);this.scheduleRefresh(this.uri,e)}else this.loadSteeringManifest(this.uri)}},{key:"stopLoad",value:function(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),self.clearTimeout(this.reloadTimer)}},{key:"destroy",value:function(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}},{key:"removeLevel",value:function(e){var t=this.levels;t&&(this.levels=t.filter((function(t){return t!==e})))}},{key:"onManifestLoading",value:function(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}},{key:"onManifestLoaded",value:function(e,t){var i=t.contentSteering;null!==i&&(this.pathwayId=i.pathwayId,this.uri=i.uri,this.started&&this.startLoad())}},{key:"onManifestParsed",value:function(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}},{key:"onError",value:function(e,t){var i=t.errorAction;if((null==i?void 0:i.action)===Jd&&i.flags===Xd){var r=this.pathwayPriority,a=this.pathwayId;this.penalizedPathways[a]||(this.penalizedPathways[a]=performance.now()),!r&&this.levels&&(r=this.levels.reduce((function(e,t){return-1===e.indexOf(t.pathwayId)&&e.push(t.pathwayId),e}),[])),r&&r.length>1&&(this.updatePathwayPriority(r),i.resolved=this.pathwayId!==a)}}},{key:"filterParsedLevels",value:function(e){this.levels=e;var t=this.getLevelsForPathway(this.pathwayId);if(0===t.length){var i=e[0].pathwayId;this.log("No levels found in Pathway ".concat(this.pathwayId,'. Setting initial Pathway to "').concat(i,'"')),t=this.getLevelsForPathway(i),this.pathwayId=i}return t.length!==e.length?(this.log("Found ".concat(t.length,"/").concat(e.length,' levels in Pathway "').concat(this.pathwayId,'"')),t):e}},{key:"getLevelsForPathway",value:function(e){return null===this.levels?[]:this.levels.filter((function(t){return e===t.pathwayId}))}},{key:"updatePathwayPriority",value:function(e){var t;this.pathwayPriority=e;var i=this.penalizedPathways,r=performance.now();Object.keys(i).forEach((function(e){r-i[e]>3e5&&delete i[e]}));for(var a=0;a<e.length;a++){var n=e[a];if(!i[n]){if(n===this.pathwayId)return;var s=this.hls.nextLoadLevel,o=this.hls.levels[s];if(t=this.getLevelsForPathway(n),t.length>0){this.log('Setting Pathway to "'.concat(n,'"')),this.pathwayId=n,this.hls.trigger(ml.LEVELS_UPDATED,{levels:t});var c=this.hls.levels[s];o&&c&&this.levels&&(c.attrs["STABLE-VARIANT-ID"]!==o.attrs["STABLE-VARIANT-ID"]&&c.bitrate!==o.bitrate&&this.log("Unstable Pathways change from bitrate ".concat(o.bitrate," to ").concat(c.bitrate)),this.hls.nextLoadLevel=s);break}}}}},{key:"clonePathways",value:function(e){var t=this,i=this.levels;if(i){var r={},a={};e.forEach((function(e){var n=e.ID,s=e["BASE-ID"],o=e["URI-REPLACEMENT"];if(!i.some((function(e){return e.pathwayId===n}))){var c=t.getLevelsForPathway(s).map((function(e){var t=fl({},e);t.details=void 0,t.url=fm(e.uri,e.attrs["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",o);var i=new Tl(e.attrs);i["PATHWAY-ID"]=n;var s=i.AUDIO&&"".concat(i.AUDIO,"_clone_").concat(n),c=i.SUBTITLES&&"".concat(i.SUBTITLES,"_clone_").concat(n);s&&(r[i.AUDIO]=s,i.AUDIO=s),c&&(a[i.SUBTITLES]=c,i.SUBTITLES=c),t.attrs=i;var l=new Ld(t);return rh(l,"audio",s),rh(l,"text",c),l}));i.push.apply(i,Object(m["a"])(c)),hm(t.audioTracks,r,o,n),hm(t.subtitleTracks,a,o,n)}}))}}},{key:"loadSteeringManifest",value:function(e){var t,i=this,r=this.hls.config,a=r.loader;this.loader&&this.loader.destroy(),this.loader=new a(r);try{t=new self.URL(e)}catch(d){return this.enabled=!1,void this.log("Failed to parse Steering Manifest URI: ".concat(e))}if("data:"!==t.protocol){var n=0|(this.hls.bandwidthEstimate||r.abrEwmaDefaultEstimate);t.searchParams.set("_HLS_pathway",this.pathwayId),t.searchParams.set("_HLS_throughput",""+n)}var s={responseType:"json",url:t.href},o=r.steeringManifestLoadPolicy["default"],c=o.errorRetry||o.timeoutRetry||{},l={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:c.maxNumRetry||0,retryDelay:c.retryDelayMs||0,maxRetryDelay:c.maxRetryDelayMs||0},u={onSuccess:function(e,r,a,n){i.log('Loaded steering manifest: "'.concat(t,'"'));var s=e.data;if(1===s.VERSION){i.updated=performance.now(),i.timeToLoad=s.TTL;var o=s["RELOAD-URI"],c=s["PATHWAY-CLONES"],l=s["PATHWAY-PRIORITY"];if(o)try{i.uri=new self.URL(o,t).href}catch(u){return i.enabled=!1,void i.log("Failed to parse Steering Manifest RELOAD-URI: ".concat(o))}i.scheduleRefresh(i.uri||a.url),c&&i.clonePathways(c),l&&i.updatePathwayPriority(l)}else i.log("Steering VERSION ".concat(s.VERSION," not supported!"))},onError:function(e,t,r,a){if(i.log("Error loading steering manifest: ".concat(e.code," ").concat(e.text," (").concat(t.url,")")),i.stopLoad(),410===e.code)return i.enabled=!1,void i.log("Steering manifest ".concat(t.url," no longer available"));var n=1e3*i.timeToLoad;if(429!==e.code)i.scheduleRefresh(i.uri||t.url,n);else{var s=i.loader;if("function"==typeof(null==s?void 0:s.getResponseHeader)){var o=s.getResponseHeader("Retry-After");o&&(n=1e3*parseFloat(o))}i.log("Steering manifest ".concat(t.url," rate limited"))}},onTimeout:function(e,t,r){i.log("Timeout loading steering manifest (".concat(t.url,")")),i.scheduleRefresh(i.uri||t.url)}};this.log("Requesting steering manifest: ".concat(t)),this.loader.load(s,l,u)}},{key:"scheduleRefresh",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3*this.timeToLoad;self.clearTimeout(this.reloadTimer),this.reloadTimer=self.setTimeout((function(){t.loadSteeringManifest(e)}),i)}}]),e}()});function wm(e){return e&&"object"==Object(E["a"])(e)?Array.isArray(e)?e.map(wm):Object.keys(e).reduce((function(t,i){return t[i]=wm(e[i]),t}),{}):e}function Sm(e){var t=e.loader;t!==ym&&t!==mm?(_l.log("[config]: Custom loader detected, cannot enable progressive streaming"),e.progressive=!1):function(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(e){}return!1}()&&(e.loader=ym,e.progressive=!0,e.enableSoftwareAES=!0,_l.log("[config]: Progressive streaming enabled, using FetchLoader"))}var Tm=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(T["a"])(this,e),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new Kf,this._autoLevelCapping=void 0,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null,function(e,t){if(self.console&&!0===e||"object"==Object(E["a"])(e)){kl(e,"debug","log","info","warn","error");try{Al.log('Debug logs enabled for "'.concat(t,'" in hls.js version 1.4.12'))}catch(i){Al=bl}}else Al=bl}(t.debug||!1,"Hls instance");var i=this.config=function(e,t){if((t.liveSyncDurationCount||t.liveMaxLatencyDurationCount)&&(t.liveSyncDuration||t.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(void 0!==t.liveMaxLatencyDurationCount&&(void 0===t.liveSyncDurationCount||t.liveMaxLatencyDurationCount<=t.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(void 0!==t.liveMaxLatencyDuration&&(void 0===t.liveSyncDuration||t.liveMaxLatencyDuration<=t.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');var i=wm(e),r=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return["manifest","level","frag"].forEach((function(e){var a="".concat("level"===e?"playlist":e,"LoadPolicy"),n=void 0===t[a],s=[];r.forEach((function(r){var o="".concat(e,"Loading").concat(r),c=t[o];if(void 0!==c&&n){s.push(o);var l=i[a]["default"];switch(t[a]={default:l},r){case"TimeOut":l.maxLoadTimeMs=c,l.maxTimeToFirstByteMs=c;break;case"MaxRetry":l.errorRetry.maxNumRetry=c,l.timeoutRetry.maxNumRetry=c;break;case"RetryDelay":l.errorRetry.retryDelayMs=c,l.timeoutRetry.retryDelayMs=c;break;case"MaxRetryTimeout":l.errorRetry.maxRetryDelayMs=c,l.timeoutRetry.maxRetryDelayMs=c}}})),s.length&&_l.warn('hls.js config: "'.concat(s.join('", "'),'" setting(s) are deprecated, use "').concat(a,'": ').concat(JSON.stringify(t[a])))})),dl(dl({},i),t)}(e.DefaultConfig,t);this.userConfig=t,this._autoLevelCapping=-1,i.progressive&&Sm(i);var r=i.abrController,a=i.bufferController,n=i.capLevelController,s=i.errorController,o=i.fpsController,c=new s(this),l=this.abrController=new r(this),u=this.bufferController=new a(this),d=this.capLevelController=new n(this),h=new o(this),f=new hd(this),p=new wd(this),m=i.contentSteeringController,g=m?new m(this):null,y=this.levelController=new ih(this,g),v=new lh(this),b=new yh(this.config),A=this.streamController=new Xf(this,v,b);d.setStreamController(A),h.setStreamController(A);var k=[f,y,A];g&&k.splice(1,0,g),this.networkControllers=k;var _=[l,u,d,h,p,v];this.audioTrackController=this.createController(i.audioTrackController,k);var w=i.audioStreamController;w&&k.push(new w(this,v,b)),this.subtitleTrackController=this.createController(i.subtitleTrackController,k);var S=i.subtitleStreamController;S&&k.push(new S(this,v,b)),this.createController(i.timelineController,_),b.emeController=this.emeController=this.createController(i.emeController,_),this.cmcdController=this.createController(i.cmcdController,_),this.latencyController=this.createController(Sd,_),this.coreComponents=_,k.push(c);var x=c.onErrorOut;"function"==typeof x&&this.on(ml.ERROR,x,c)}return Object(S["a"])(e,[{key:"createController",value:function(e,t){if(e){var i=new e(this);return t&&t.push(i),i}return null}},{key:"on",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;this._emitter.on(e,t,i)}},{key:"once",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this;this._emitter.once(e,t,i)}},{key:"removeAllListeners",value:function(e){this._emitter.removeAllListeners(e)}},{key:"off",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this,r=arguments.length>3?arguments[3]:void 0;this._emitter.off(e,t,i,r)}},{key:"listeners",value:function(e){return this._emitter.listeners(e)}},{key:"emit",value:function(e,t,i){return this._emitter.emit(e,t,i)}},{key:"trigger",value:function(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(i){_l.error("An internal error happened while handling event "+e+'. Error message: "'+i.message+'". Here is a stacktrace:',i),this.trigger(ml.ERROR,{type:gl.OTHER_ERROR,details:yl.INTERNAL_EXCEPTION,fatal:!1,event:e,error:i})}return!1}},{key:"listenerCount",value:function(e){return this._emitter.listenerCount(e)}},{key:"destroy",value:function(){_l.log("destroy"),this.trigger(ml.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach((function(e){return e.destroy()})),this.networkControllers.length=0,this.coreComponents.forEach((function(e){return e.destroy()})),this.coreComponents.length=0;var e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}},{key:"attachMedia",value:function(e){_l.log("attachMedia"),this._media=e,this.trigger(ml.MEDIA_ATTACHING,{media:e})}},{key:"detachMedia",value:function(){_l.log("detachMedia"),this.trigger(ml.MEDIA_DETACHING,void 0),this._media=null}},{key:"loadSource",value:function(e){this.stopLoad();var t=this.media,i=this.url,r=this.url=ll.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});_l.log("loadSource:".concat(r)),t&&i&&(i!==r||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(ml.MANIFEST_LOADING,{url:e})}},{key:"startLoad",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;_l.log("startLoad(".concat(e,")")),this.networkControllers.forEach((function(t){t.startLoad(e)}))}},{key:"stopLoad",value:function(){_l.log("stopLoad"),this.networkControllers.forEach((function(e){e.stopLoad()}))}},{key:"swapAudioCodec",value:function(){_l.log("swapAudioCodec"),this.streamController.swapAudioCodec()}},{key:"recoverMediaError",value:function(){_l.log("recoverMediaError");var e=this._media;this.detachMedia(),e&&this.attachMedia(e)}},{key:"removeLevel",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.levelController.removeLevel(e,t)}},{key:"levels",get:function(){return this.levelController.levels||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(e){_l.log("set currentLevel:".concat(e)),this.loadLevel=e,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(e){_l.log("set nextLevel:".concat(e)),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(e){_l.log("set loadLevel:".concat(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){_l.log("set firstLevel:".concat(e)),this.levelController.firstLevel=e}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(e){_l.log("set startLevel:".concat(e)),-1!==e&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(e){var t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(e){this._autoLevelCapping!==e&&(_l.log("set autoLevelCapping:".concat(e)),this._autoLevelCapping=e)}},{key:"bandwidthEstimate",get:function(){var e=this.abrController.bwEstimator;return e?e.getEstimate():NaN}},{key:"ttfbEstimate",get:function(){var e=this.abrController.bwEstimator;return e?e.getEstimateTTFB():NaN}},{key:"maxHdcpLevel",get:function(){return this._maxHdcpLevel},set:function(e){Td.indexOf(e)>-1&&(this._maxHdcpLevel=e)}},{key:"autoLevelEnabled",get:function(){return-1===this.levelController.manualLevel}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var e=this.levels,t=this.config.minAutoBitrate;if(!e)return 0;for(var i=e.length,r=0;r<i;r++)if(e[r].maxBitrate>=t)return r;return 0}},{key:"maxAutoLevel",get:function(){var e,t=this.levels,i=this.autoLevelCapping,r=this.maxHdcpLevel;if(e=-1===i&&t&&t.length?t.length-1:i,r)for(var a=e;a--;){var n=t[a].attrs["HDCP-LEVEL"];if(n&&n<=r)return a}return e}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(e){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,e)}},{key:"playingDate",get:function(){return this.streamController.currentProgramDateTime}},{key:"mainForwardBufferInfo",get:function(){return this.streamController.getMainFwdBufferInfo()}},{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:"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)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var e=this.subtitleTrackController;return!!e&&e.subtitleDisplay},set:function(e){var t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(e){this.config.lowLatencyMode=e}},{key:"liveSyncPosition",get:function(){return this.latencyController.liveSyncPosition}},{key:"latency",get:function(){return this.latencyController.latency}},{key:"maxLatency",get:function(){return this.latencyController.maxLatency}},{key:"targetLatency",get:function(){return this.latencyController.targetLatency}},{key:"drift",get:function(){return this.latencyController.drift}},{key:"forceStartLoad",get:function(){return this.streamController.forceStartLoad}}],[{key:"version",get:function(){return"1.4.12"}},{key:"isSupported",value:function(){return function(){var e=Nu();if(!e)return!1;var t=Wh(),i=e&&"function"==typeof e.isTypeSupported&&e.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),r=!t||t.prototype&&"function"==typeof t.prototype.appendBuffer&&"function"==typeof t.prototype.remove;return!!i&&!!r}()}},{key:"Events",get:function(){return ml}},{key:"ErrorTypes",get:function(){return gl}},{key:"ErrorDetails",get:function(){return yl}},{key:"DefaultConfig",get:function(){return e.defaultConfig?e.defaultConfig:_m},set:function(t){e.defaultConfig=t}}]),e}();Tm.defaultConfig=void 0;var Em=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this),r.player=e,e._opt,r.canVideoPlay=!1,r.$videoElement=null,r.canvasRenderInterval=null,r.bandwidthEstimateInterval=null,r.fpsInterval=null,r.hlsFps=0,r.hlsPrevFrams=0,r.isInitInfo=!1,r.eventsDestroy=[],r.supportVideoFrameCallbackHandle=null,Ha()?(r.$videoElement=r.player.video.$videoElement,r.canVideoPlay=!0):Tm.isSupported()?(r.$videoElement=r.player.video.$videoElement,r.hls=new Tm({}),r._initHls(),r._bindEvents()):r.player.debug.error("HlsDecoder","init hls error ,not support "),r.player.debug.log("HlsDecoder","init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){var e=this;return new Promise((function(t,i){e.supportVideoFrameCallbackHandle&&e.$videoElement&&(e.$videoElement.cancelVideoFrameCallback(e.supportVideoFrameCallbackHandle),e.supportVideoFrameCallbackHandle=null),e.hls&&(e.hls.destroy(),e.hls=null),e.eventsDestroy.length&&(e.eventsDestroy.forEach((function(e){return e()})),e.eventsDestroy=[]),e.isInitInfo=!1,e._stopCanvasRender(),e._stopBandwidthEstimateInterval(),e._stopFpsInterval(),e.$videoElement=null,e.hlsFps=0,e.player.debug.log("HlsDecoder","destroy"),setTimeout((function(){t()}),0)}))}},{key:"checkHlsBufferedDelay",value:function(){var e=this.$videoElement,t=0,i=e.buffered,r=i.length?i.end(i.length-1):0;return t=r-e.currentTime,t<0&&(this.player.debug.warn("HlsDecoder","checkHlsBufferedDelay result < 0",t,r,e.currentTime),t=0),t}},{key:"getFps",value:function(){return this.hlsFps}},{key:"_startCanvasRender",value:function(){var e=this;un()?this.supportVideoFrameCallbackHandle=this.$videoElement.requestVideoFrameCallback(this.videoFrameCallback.bind(this)):(this._stopCanvasRender(),this.canvasRenderInterval=setInterval((function(){e.player.video.render({$video:e.$videoElement,ts:0})}),40))}},{key:"_stopCanvasRender",value:function(){this.canvasRenderInterval&&(clearInterval(this.canvasRenderInterval),this.canvasRenderInterval=null)}},{key:"videoFrameCallback",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.player.isDestroyed()?this.player.debug.log("HlsDecoder","videoFrameCallback() player is destroyed"):(this.player.video.render({$video:this.$videoElement,ts:t.mediaTime||0}),this.player.updateStats({dts:t.mediaTime||0}),this.supportVideoFrameCallbackHandle=this.$videoElement.requestVideoFrameCallback(this.videoFrameCallback.bind(this)))}},{key:"_startBandwidthEstimateInterval",value:function(){var e=this;this._stopBandwidthEstimateInterval(),this.bandwidthEstimateInterval=setInterval((function(){var t=0;e.hls.bandwidthEstimate&&(t=e.hls.bandwidthEstimate),e.player.emit(it.kBps,(t/1024/8/10).toFixed(2))}),1e3)}},{key:"_stopBandwidthEstimateInterval",value:function(){this.bandwidthEstimateInterval&&(clearInterval(this.bandwidthEstimateInterval),this.bandwidthEstimateInterval=null)}},{key:"_startFpsInterval",value:function(){var e=this;this._stopCanvasRender(),this.fpsInterval=setInterval((function(){if(e.$videoElement)if(za(e.$videoElement.getVideoPlaybackQuality)){var t=e.$videoElement.getVideoPlaybackQuality();e.hlsFps=t.totalVideoFrames-e.hlsPrevFrams,e.hlsPrevFrams=t.totalVideoFrames}else{var i=e.$videoElement.webkitDecodedFrameCount||0;e.hlsFps=i-e.hlsPrevFrams,e.hlsPrevFrams=i}}),1e3)}},{key:"_stopFpsInterval",value:function(){this.fpsInterval&&(clearInterval(this.fpsInterval),this.fpsInterval=null)}},{key:"_initHls",value:function(){this.player._opt.useCanvasRender&&(this.$videoElement=document.createElement("video"),this.$videoElement.muted=!0,ua()&&(this.$videoElement.style.position="absolute"),this.initVideoEvents()),this.hls.attachMedia(this.$videoElement)}},{key:"_bindEvents",value:function(){var e=this,t=this.player,i=this.player.events.proxy;this.hls;var r=this.$videoElement,a=un(),n=i(r,Ci,(function(i){if(e.hls){var r=parseInt(i.timeStamp,10);e.player._opt.useCanvasRender&&an(a)&&t.updateStats({ts:r,dts:r})}}));this.eventsDestroy.push(n),this._startBandwidthEstimateInterval(),this._startFpsInterval(),this.hls.on(Tm.Events.ERROR,(function(t,i){if(i.fatal)switch(i.type){case Tm.ErrorTypes.NETWORK_ERROR:e.player.debug.warn("HlsDecoder","fatal network error encountered, try to recover"),e.hls.startLoad();break;case Tm.ErrorTypes.MEDIA_ERROR:e.player.debug.warn("HlsDecoder","fatal media error encountered, try to recover"),e.hls.recoverMediaError()}})),this.hls.on(Tm.Events.MEDIA_ATTACHING,(function(){})),this.hls.on(Tm.Events.MEDIA_ATTACHED,(function(){})),this.hls.on(Tm.Events.MEDIA_DETACHING,(function(){})),this.hls.on(Tm.Events.MEDIA_DETACHED,(function(){})),this.hls.on(Tm.Events.BUFFER_RESET,(function(){})),this.hls.on(Tm.Events.BUFFER_CODECS,(function(){})),this.hls.on(Tm.Events.BUFFER_CREATED,(function(){})),this.hls.on(Tm.Events.BUFFER_APPENDING,(function(t,i){e.player.debug.log("HlsDecoder","BUFFER_APPENDING",i.type)})),this.hls.on(Tm.Events.BUFFER_APPENDED,(function(){})),this.hls.on(Tm.Events.BUFFER_EOS,(function(){})),this.hls.on(Tm.Events.BUFFER_FLUSHING,(function(){})),this.hls.on(Tm.Events.BUFFER_FLUSHED,(function(){})),this.hls.on(Tm.Events.MANIFEST_LOADING,(function(){e.player.debug.log("HlsDecoder","MANIFEST_LOADING 开始加载playlist m3u8资源")})),this.hls.on(Tm.Events.MANIFEST_LOADED,(function(t,i){e.player.debug.log("HlsDecoder","MANIFEST_LOADED playlist m3u8文件加载完成",i.url)})),this.hls.on(Tm.Events.MANIFEST_PARSED,(function(){e.player.debug.log("HlsDecoder","MANIFEST_PARSED playlist m3u8解析完成"),t._times.demuxStart||(t._times.demuxStart=$r())})),this.hls.on(Tm.Events.LEVEL_LOADING,(function(){})),this.hls.on(Tm.Events.LEVEL_LOADED,(function(e,t){})),this.hls.on(Tm.Events.FRAG_LOADING,(function(){})),this.hls.on(Tm.Events.FRAG_LOADED,(function(e,i){t._times.decodeStart||(t._times.decodeStart=$r())})),this.hls.on(Tm.Events.BUFFER_APPENDING,(function(){t._times.videoStart||(t._times.videoStart=$r(),t.handlePlayToRenderTimes())})),this.hls.on(Tm.Events.FRAG_DECRYPTED,(function(){})),this.hls.on(Tm.Events.KEY_LOADING,(function(){})),this.hls.on(Tm.Events.KEY_LOADING,(function(){})),this.hls.on(Tm.Events.FPS_DROP,(function(e){})),this.hls.on(Tm.Events.FPS_DROP_LEVEL_CAPPING,(function(e){})),this.hls.on(Tm.Events.FRAG_PARSING_INIT_SEGMENT,(function(t,i){e.player.debug.log("HlsDecoder","FRAG_PARSING_INIT_SEGMENT",i);var r=!!(i&&i.tracks&&i.tracks.audio),a=!!(i&&i.tracks&&i.tracks.video);if(r&&i.tracks.audio){var n=i.tracks.audio,s=n.metadata&&n.metadata.channelCount?n.metadata.channelCount:0,o=n.codec;e.player.audio&&e.player.audio.updateAudioInfo({encType:o,channels:s,sampleRate:44100})}if(a&&i.tracks.video){var c=i.tracks.video,l=c.codec,u=c.metadata&&c.metadata.width?c.metadata.width:0,d=c.metadata&&c.metadata.height?c.metadata.height:0;e.player.video&&e.player.video.updateVideoInfo({encTypeCode:-1!==l.indexOf("avc")?pt:mt,width:u,height:d})}}))}},{key:"initVideoPlay",value:function(e){this.player._opt.useCanvasRender&&(this.$videoElement=document.createElement("video"),this.initVideoEvents()),this.$videoElement.muted=!0,this.$videoElement.src=e}},{key:"_initRenderSize",value:function(){this.isInitInfo||(this.player.video.updateVideoInfo({width:this.$videoElement.videoWidth,height:this.$videoElement.videoHeight}),this.player.video.initCanvasViewSize(),this.isInitInfo=!0)}},{key:"initVideoEvents",value:function(){var e=this,t=this.player.events.proxy,i=t(this.$videoElement,Ei,(function(){e.player.debug.log("HlsDecoder","video canplay"),e.$videoElement.play().then((function(){e.player.debug.log("HlsDecoder","video play"),e._startCanvasRender(),e._initRenderSize()}))["catch"]((function(t){e.player.debug.warn("HlsDecoder","video play error ",t)}))})),r=t(this.$videoElement,xi,(function(){e.player.debug.log("HlsDecoder","video waiting")})),a=t(this.$videoElement,Ci,(function(t){var i=parseInt(t.timeStamp,10);e.player.handleRender(),e.player.updateStats({ts:i}),e.$videoElement.paused&&(e.player.debug.warn("HlsDecoder","video is paused and next try to replay"),e.$videoElement.play().then((function(){e.player.debug.log("HlsDecoder","video is paused and replay success")}))["catch"]((function(t){e.player.debug.warn("HlsDecoder","video is paused and replay error ",t)})))})),n=t(this.$videoElement,Ri,(function(){e.player.debug.log("HlsDecoder","video playback Rate change",e.$videoElement&&e.$videoElement.playbackRate)}));this.eventsDestroy.push(i,r,a,n)}},{key:"loadSource",value:function(e){var t=this;return new Promise((function(i,r){t.canVideoPlay?(t.initVideoPlay(e),i()):t.hls.on(Tm.Events.MEDIA_ATTACHED,(function(){t.hls.loadSource(e),i()}))}))}}]),i}(fn),xm=2097152,Cm="fetch",Rm="xhr",Lm="arraybuffer",Dm="text",Im="json",Pm="real_time_speed",Om=Object.prototype.toString;function Bm(e){if("[object Object]"!==Om.call(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}function Mm(e){if(e&&null!==e[0]&&void 0!==e[0]&&(0!==e[0]||null!==e[1]&&void 0!==e[1])){var t="bytes="+e[0]+"-";return e[1]&&(t+=e[1]),t}}function Fm(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Um(e,t){if(e){if(!t)return e;var i,r=Object.keys(t).map((function(e){if(i=t[e],null!=i)return Array.isArray(i)?e+="[]":i=[i],i.map((function(t){var i;return i=t,"[object Date]"===Om.call(i)?t=t.toISOString():function(e){return null!==e&&"object"==Object(E["a"])(e)}(t)&&(t=JSON.stringify(t)),"".concat(Fm(e),"=").concat(Fm(t))})).join("&")})).filter(Boolean).join("&");if(r){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}}function jm(e,t,i,r,a,n,s,o,c,l,u){return a=null!=a?parseFloat(a):null,r=parseInt(r||"0",10),Number.isNaN(r)&&(r=0),{data:e,done:t,option:{range:c,vid:l,index:o,contentLength:r,age:a,startTime:n,firstByteTime:s,endTime:Date.now(),priOptions:u},response:i}}function Nm(e,t){return Math.round(8*e*1e3/t/1024)}var zm=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e,r,a,n){var s;return Object(T["a"])(this,i),s=t.call(this,n),xc(Object(v["a"])(s),"retryCount",0),xc(Object(v["a"])(s),"isTimeout",!1),xc(Object(v["a"])(s),"loaderType",Cm),xc(Object(v["a"])(s),"startTime",0),xc(Object(v["a"])(s),"endTime",0),xc(Object(v["a"])(s),"options",{}),s.url=e,s.request=r,s.response=a,s}return Object(S["a"])(i)}(Object(y["a"])(Error)),Gm=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this),xc(Object(v["a"])(r),"_abortController",null),xc(Object(v["a"])(r),"_timeoutTimer",null),xc(Object(v["a"])(r),"_reader",null),xc(Object(v["a"])(r),"_response",null),xc(Object(v["a"])(r),"_aborted",!1),xc(Object(v["a"])(r),"_index",-1),xc(Object(v["a"])(r),"_range",null),xc(Object(v["a"])(r),"_receivedLength",0),xc(Object(v["a"])(r),"_running",!1),xc(Object(v["a"])(r),"_logger",null),xc(Object(v["a"])(r),"_vid",""),xc(Object(v["a"])(r),"_onProcessMinLen",0),xc(Object(v["a"])(r),"_onCancel",null),xc(Object(v["a"])(r),"_priOptions",null),xc(Object(v["a"])(r),"TAG_NAME","FetchLoader"),r.player=e,r}return Object(S["a"])(i,[{key:"load",value:function(e){var t,i=this,r=e.url,a=e.vid,n=e.timeout,s=e.responseType,c=e.onProgress,l=e.index,u=e.onTimeout,d=e.onCancel,h=e.range,f=e.transformResponse,p=e.request,m=e.params,g=(e.logger,e.method),y=e.headers,v=e.body,b=e.mode,A=e.credentials,k=e.cache,_=e.redirect,w=e.referrer,S=e.referrerPolicy,T=e.onProcessMinLen,x=e.priOptions;this._aborted=!1,this._onProcessMinLen=T,this._onCancel=d,this._abortController=("undefined"===typeof AbortController?"undefined":Object(E["a"])(AbortController))<"u"&&new AbortController,this._running=!0,this._index=l,this._range=h||[0,0],this._vid=a||r,this._priOptions=x||{};var C={method:g,headers:y,body:v,mode:b,credentials:A,cache:k,redirect:_,referrer:w,referrerPolicy:S,signal:null===(t=this._abortController)||void 0===t?void 0:t.signal},R=!1;clearTimeout(this._timeoutTimer),r=Um(r,m);var L=Mm(h);L&&(y=p?p.headers:C.headers=C.headers||(Headers?new Headers:{}),Headers&&y instanceof Headers?y.append("Range",L):y.Range=L),n&&(this._timeoutTimer=setTimeout((function(){if(R=!0,i.cancel(),u){var e=new zm(r,C,null,"timeout");e.isTimeout=!0,u(e,{index:i._index,range:i._range,vid:i._vid,priOptions:i._priOptions})}}),n));var D=Date.now();return(Ta(l)||Ta(h))&&this.player.debug.log(this.TAG_NAME,"[fetch load start], index,",l,",range,",h),new Promise((function(e,t){fetch(p||r,p?void 0:C).then(function(){var a=Object(o["a"])(regeneratorRuntime.mark((function a(n){var o,u,d,p;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(clearTimeout(i._timeoutTimer),i._response=n,!i._aborted&&i._running){a.next=2;break}return a.abrupt("return");case 2:if(f&&(n=f(n,r)||n),n.ok){a.next=4;break}throw new zm(r,C,n,"bad network response");case 4:if(o=Date.now(),s!==Dm){a.next=12;break}return a.next=8,n.text();case 8:u=a.sent,i._running=!1,a.next=28;break;case 12:if(s!==Im){a.next=19;break}return a.next=15,n.json();case 15:u=a.sent,i._running=!1,a.next=28;break;case 19:if(!c){a.next=21;break}return a.abrupt("return",(i.resolve=e,i.reject=t,void i._loadChunk(n,c,D,o)));case 21:return a.next=23,n.arrayBuffer();case 23:u=a.sent,u=new Uint8Array(u),i._running=!1,d=Date.now()-D,p=Nm(u.byteLength,d),i.emit(Pm,{speed:p,len:u.byteLength,time:d,vid:i._vid,index:i._index,range:i._range,priOptions:i._priOptions});case 28:(Ta(l)||Ta(h))&&i.player.debug.log(i.TAG_NAME,"[fetch load end], index,",l,",range,",h),e(jm(u,!0,n,n.headers.get("Content-Length"),n.headers.get("age"),D,o,l,h,i._vid,i._priOptions));case 29:case"end":return a.stop()}}),a)})));return function(e){return a.apply(this,arguments)}}())["catch"]((function(e){var a;clearTimeout(i._timeoutTimer),i._running=!1,i._aborted&&!R||((e=e instanceof zm?e:new zm(r,C,null,null===(a=e)||void 0===a?void 0:a.message)).startTime=D,e.endTime=Date.now(),e.isTimeout=R,e.options={index:i._index,range:i._range,vid:i._vid,priOptions:i._priOptions},t(e))}))}))}},{key:"cancel",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this._aborted){e.next=14;break}if(this._aborted=!0,this._running=!1,!this._response){e.next=12;break}if(e.prev=2,e.t0=this._reader,!e.t0){e.next=7;break}return e.next=7,this._reader.cancel();case 7:e.next=11;break;case 9:e.prev=9,e.t1=e["catch"](2);case 11:this._response=this._reader=null;case 12:if(this._abortController){try{this._abortController.abort()}catch(t){}this._abortController=null}this._onCancel&&this._onCancel({index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions});case 14:case"end":return e.stop()}}),e,this,[[2,9]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"_loadChunk",value:function(e,t,i,r){var a=this;if(!e.body||!e.body.getReader){this._running=!1;var n=new zm(e.url,"",e,"onProgress of bad response.body.getReader");return n.options={index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions},void this.reject(n)}this._onProcessMinLen>0&&(this._cache=new Uint8Array(xm),this._writeIdx=0);var s,c,l,u=this._reader=e.body.getReader(),d=function(){var n=Object(o["a"])(regeneratorRuntime.mark((function n(){var o,h,f,p,m,g,y,v;return regeneratorRuntime.wrap((function(n){while(1)switch(n.prev=n.next){case 0:return c=Date.now(),n.prev=1,n.next=4,u.read();case 4:s=n.sent,l=Date.now(),n.next=11;break;case 8:return n.prev=8,n.t0=n["catch"](1),n.abrupt("return",(l=Date.now(),void(a._aborted||(a._running=!1,n.t0.options={index:a._index,range:a._range,vid:a._vid,priOptions:a._priOptions},a.reject(n.t0)))));case 11:if(h=(null===(o=a._range)||void 0===o?void 0:o.length)>0?a._range[0]:0,f=h+a._receivedLength,!a._aborted){n.next=14;break}return n.abrupt("return",(a._running=!1,void t(void 0,!1,{range:[f,f],vid:a._vid,index:a._index,startTime:c,endTime:l,st:i,firstByteTime:r,priOptions:a._priOptions},e)));case 14:p=s.value?s.value.byteLength:0,a._receivedLength+=p,a.player.debug.log(a.TAG_NAME,"【fetchLoader,onProgress call】,task,",a._range,", start,",f,", end,",h+a._receivedLength,", done,",s.done),a._onProcessMinLen>0?a._writeIdx+p>=a._onProcessMinLen||s.done?(m=new Uint8Array(a._writeIdx+p),m.set(a._cache.slice(0,a._writeIdx),0),p>0&&m.set(s.value,a._writeIdx),a._writeIdx=0,a.player.debug.log(a.TAG_NAME,"【fetchLoader,onProgress enough】,done,",s.done,",len,",m.byteLength,", writeIdx,",a._writeIdx)):p>0&&a._writeIdx+p<xm?(a._cache.set(s.value,a._writeIdx),a._writeIdx+=p,a.player.debug.log(a.TAG_NAME,"【fetchLoader,onProgress cache】,len,",p,", writeIdx,",a._writeIdx)):p>0&&(g=new Uint8Array(a._writeIdx+p+2048),a.player.debug.log(a.TAG_NAME,"【fetchLoader,onProgress extra start】,size,",a._writeIdx+p+2048,", datalen,",p,", writeIdx,",a._writeIdx),g.set(a._cache.slice(0,a._writeIdx),0),p>0&&g.set(s.value,a._writeIdx),a._writeIdx+=p,delete a._cache,a._cache=g,a.player.debug.log(a.TAG_NAME,"【fetchLoader,onProgress extra end】,len,",p,", writeIdx,",a._writeIdx)):m=s.value,(m&&m.byteLength>0||s.done)&&t(m,s.done,{range:[a._range[0]+a._receivedLength-(m?m.byteLength:0),a._range[0]+a._receivedLength],vid:a._vid,index:a._index,startTime:c,endTime:l,st:i,firstByteTime:r,priOptions:a._priOptions},e),s.done?(y=Date.now()-i,v=Nm(a._receivedLength,y),a.emit(Pm,{speed:v,len:a._receivedLength,time:y,vid:a._vid,index:a._index,range:a._range,priOptions:a._priOptions}),a._running=!1,a.player.debug.log(a.TAG_NAME,"[fetchLoader onProgress end],task,",a._range,",done,",s.done),a.resolve(jm(s,!0,e,e.headers.get("Content-Length"),e.headers.get("age"),i,r,a._index,a._range,a._vid,a._priOptions))):d();case 17:case"end":return n.stop()}}),n,null,[[1,8]])})));return function(){return n.apply(this,arguments)}}();d()}},{key:"receiveLen",get:function(){return this._receivedLength}},{key:"running",get:function(){return this._running},set:function(e){this._running=e}}],[{key:"isSupported",value:function(){return!(("undefined"===typeof fetch?"undefined":Object(E["a"])(fetch))>"u")}}]),i}(fn),Hm=function(){function e(t,i,r){Object(T["a"])(this,e),xc(this,"TAG_NAME","Task"),this.promise=function(){var e,t,i=new Promise((function(i,r){e=i,t=r}));return i.used=!1,i.resolve=function(){return i.used=!0,e.apply(void 0,arguments)},i.reject=function(){return i.used=!0,t.apply(void 0,arguments)},i}(),this.alive=!!i.onProgress,this._loaderType=t,this.player=r,this._loader=t===Cm&&window.fetch?new Gm(r):new Vm(r),this._config=i,this._retryCount=0,this._retryTimer=null,this._canceled=!1,this._retryCheckFunc=i.retryCheckFunc}return Object(S["a"])(e,[{key:"exec",value:function(){var e=this,t=this._config,i=t.retry,r=t.retryDelay,a=t.onRetryError,n=t.transformError,c=s(t,x),l=function(){var t=Object(o["a"])(regeneratorRuntime.mark((function t(){var s,o,u;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e._loader.load(c);case 3:s=t.sent,e.promise.resolve(s),t.next=18;break;case 7:if(t.prev=7,t.t0=t["catch"](0),e._loader.running=!1,e.player.debug.log(e.TAG_NAME,"[task request catch err]",t.t0),!e._canceled){t.next=11;break}return t.abrupt("return");case 11:if(t.t0.loaderType=e._loaderType,t.t0.retryCount=e._retryCount,o=t.t0,n&&(o=n(o)||o),a&&e._retryCount>0&&a(o,e._retryCount,{index:c.index,vid:c.vid,range:c.range,priOptions:c.priOptions}),e._retryCount++,u=!0,e._retryCheckFunc&&(u=e._retryCheckFunc(t.t0)),!(u&&e._retryCount<=i)){t.next=17;break}return t.abrupt("return",(clearTimeout(e._retryTimer),e.player.debug.log(e.TAG_NAME,"[task request setTimeout],retry",e._retryCount,",retry range,",c.range),void(e._retryTimer=setTimeout(l,r))));case 17:e.promise.reject(o);case 18:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(){return t.apply(this,arguments)}}();return l(),this.promise}},{key:"cancel",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",(clearTimeout(this._retryTimer),this._canceled=!0,this._loader.running=!1,this._loader.cancel()));case 1:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"running",get:function(){return this._loader&&this._loader.running}},{key:"loader",get:function(){return this._loader}}]),e}(),Vm=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this),xc(Object(v["a"])(r),"_xhr",null),xc(Object(v["a"])(r),"_aborted",!1),xc(Object(v["a"])(r),"_timeoutTimer",null),xc(Object(v["a"])(r),"_range",null),xc(Object(v["a"])(r),"_receivedLength",0),xc(Object(v["a"])(r),"_url",null),xc(Object(v["a"])(r),"_onProgress",null),xc(Object(v["a"])(r),"_index",-1),xc(Object(v["a"])(r),"_headers",null),xc(Object(v["a"])(r),"_currentChunkSizeKB",384),xc(Object(v["a"])(r),"_timeout",null),xc(Object(v["a"])(r),"_xhr",null),xc(Object(v["a"])(r),"_withCredentials",null),xc(Object(v["a"])(r),"_startTime",-1),xc(Object(v["a"])(r),"_loadCompleteResolve",null),xc(Object(v["a"])(r),"_loadCompleteReject",null),xc(Object(v["a"])(r),"_runing",!1),xc(Object(v["a"])(r),"_logger",!1),xc(Object(v["a"])(r),"_vid",""),xc(Object(v["a"])(r),"_responseType",void 0),xc(Object(v["a"])(r),"_credentials",void 0),xc(Object(v["a"])(r),"_method",void 0),xc(Object(v["a"])(r),"_transformResponse",void 0),xc(Object(v["a"])(r),"_firstRtt",void 0),xc(Object(v["a"])(r),"_onCancel",null),xc(Object(v["a"])(r),"_priOptions",null),xc(Object(v["a"])(r),"TAG_NAME","XhrLoader"),r.player=e,r}return Object(S["a"])(i,[{key:"load",value:function(e){var t=this;clearTimeout(this._timeoutTimer),this._range=e.range,this._onProgress=e.onProgress,this._index=e.index,this._headers=e.headers,this._withCredentials="include"===e.credentials||"same-origin"===e.credentials,this._body=e.body||null,e.method&&(this._method=e.method),this._timeout=e.timeout||null,this._runing=!0,this._vid=e.vid||e.url,this._responseType=e.responseType,this._firstRtt=-1,this._onTimeout=e.onTimeout,this._onCancel=e.onCancel,this._request=e.request,this._priOptions=e.priOptions||{},this.player.debug.log(this.TAG_NAME,"【xhrLoader task】, range",this._range),this._url=Um(e.url,e.params);var i=Date.now();return new Promise((function(e,i){t._loadCompleteResolve=e,t._loadCompleteReject=i,t._startLoad()}))["catch"]((function(e){if(clearTimeout(t._timeoutTimer),t._runing=!1,!t._aborted)throw(e=e instanceof zm?e:new zm(t._url,t._request)).startTime=i,e.endTime=Date.now(),e.options={index:t._index,vid:t._vid,priOptions:t._priOptions},e}))}},{key:"_startLoad",value:function(){var e=null;if(this._responseType===Lm&&this._range&&this._range.length>1)if(this._onProgress){this._firstRtt=-1;var t=1024*this._currentChunkSizeKB,i=this._range[0]+this._receivedLength,r=this._range[1];t<this._range[1]-i&&(r=i+t),e=[i,r],this.player.debug.log(this.TAG_NAME,"[xhr_loader->],tast :",this._range,", SubRange, ",e)}else e=this._range,this.player.debug.log(this.TAG_NAME,"[xhr_loader->],tast :",this._range,", allRange, ",e);this._internalOpen(e)}},{key:"_internalOpen",value:function(e){var t=this;try{this._startTime=Date.now();var i=this._xhr=new XMLHttpRequest;i.open(this._method||"GET",this._url,!0),i.responseType=this._responseType,this._timeout&&(i.timeout=this._timeout),i.withCredentials=this._withCredentials,i.onload=this._onLoad.bind(this),i.onreadystatechange=this._onReadyStatechange.bind(this),i.onerror=function(e){var i,r,a;t._running=!1;var n=new zm(t._url,t._request,null==e||null===(i=e.currentTarget)||void 0===i?void 0:i.response,"xhr.onerror.status:"+(null==e||null===(r=e.currentTarget)||void 0===r?void 0:r.status)+",statusText,"+(null==e||null===(a=e.currentTarget)||void 0===a?void 0:a.statusText));n.options={index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions},t._loadCompleteReject(n)},i.ontimeout=function(e){t.cancel();var i=new zm(t._url,t._request,{status:408},"timeout");t._onTimeout&&(i.isTimeout=!0,t._onTimeout(i,{index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions})),i.options={index:t._index,range:t._range,vid:t._vid,priOptions:t._priOptions},t._loadCompleteReject(i)};var r=this._headers||{},a=Mm(e);a&&(r.Range=a),r&&Object.keys(r).forEach((function(e){i.setRequestHeader(e,r[e])})),this.player.debug.log(this.TAG_NAME,"[xhr.send->] tast,",this._range,",load sub range, ",e),i.send(this._body)}catch(i){i.options={index:this._index,range:e,vid:this._vid,priOptions:this._priOptions},this._loadCompleteReject(i)}}},{key:"_onReadyStatechange",value:function(e){2===e.target.readyState&&this._firstRtt<0&&(this._firstRtt=Date.now())}},{key:"_onLoad",value:function(e){var t,i=e.target.status;if(i<200||i>299){var r=new zm(this._url,null,Object(g["a"])(Object(g["a"])({},e.target.response),{},{status:i}),"bad response,status:"+i);return r.options={index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions},this._loadCompleteReject(r)}var a,n=null,s=!1,o=(null===(t=this._range)||void 0===t?void 0:t.length)>0?this._range[0]:0;if(this._responseType===Lm){var c,l=new Uint8Array(e.target.response);if(a=o+this._receivedLength,l&&l.byteLength>0){this._receivedLength+=l.byteLength;var u=Date.now()-this._startTime,d=Nm(this._receivedLength,u);this.emit(Pm,{speed:d,len:this._receivedLength,time:u,vid:this._vid,index:this._index,range:[a,o+this._receivedLength],priOptions:this._priOptions})}n=l,s=!((null===(c=this._range)||void 0===c?void 0:c.length)>1&&this._range[1]&&this._receivedLength<this._range[1]-this._range[0]),this.player.debug.log(this.TAG_NAME,"[xhr load done->], tast :",this._range,", start",a,"end ",o+this._receivedLength,",dataLen,",l?l.byteLength:0,",receivedLength",this._receivedLength,",index,",this._index,", done,",s)}else s=!0,n=e.target.response;var h={ok:i>=200&&i<300,status:i,statusText:this._xhr.statusText,url:this._xhr.responseURL,headers:this._getHeaders(this._xhr),body:this._xhr.response};this._transformResponse&&(h=this._transformResponse(h,this._url)||h),this._onProgress&&this._onProgress(n,s,{index:this._index,vid:this._vid,range:[a,o+this._receivedLength],startTime:this._startTime,endTime:Date.now(),priOptions:this._priOptions},h),s?(this._runing=!1,this._loadCompleteResolve&&this._loadCompleteResolve(jm(this._onProgress?null:n,s,h,h.headers["content-length"],h.headers.age,this._startTime,this._firstRtt,this._index,this._range,this._vid,this._priOptions))):this._startLoad()}},{key:"cancel",value:function(){if(!this._aborted)return this._aborted=!0,this._runing=!1,k(Object(b["a"])(i.prototype),"removeAllListeners",this).call(this),this._onCancel&&this._onCancel({index:this._index,range:this._range,vid:this._vid,priOptions:this._priOptions}),this._xhr?this._xhr.abort():void 0}},{key:"receiveLen",get:function(){return this._receivedLength}},{key:"running",get:function(){return this._running},set:function(e){this._running=e}},{key:"_getHeaders",value:function(e){var t,i=e.getAllResponseHeaders().trim().split("\r\n"),r={},a=p(i);try{for(a.s();!(t=a.n()).done;){var n=t.value,s=n.split(": ");r[s[0].toLowerCase()]=s.slice(1).join(": ")}}catch(o){a.e(o)}finally{a.f()}return r}}],[{key:"isSupported",value:function(){return("undefined"===typeof XMLHttpRequest?"undefined":Object(E["a"])(XMLHttpRequest))<"u"}}]),i}(fn),Wm=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e,r){var a;return Object(T["a"])(this,i),a=t.call(this),xc(Object(v["a"])(a),"type",Cm),xc(Object(v["a"])(a),"_queue",[]),xc(Object(v["a"])(a),"_alive",[]),xc(Object(v["a"])(a),"_currentTask",null),xc(Object(v["a"])(a),"_config",void 0),a.player=r,a._config=function(e){return Object(g["a"])({loaderType:Cm,retry:0,retryDelay:0,timeout:0,request:null,onTimeout:void 0,onProgress:void 0,onRetryError:void 0,transformRequest:void 0,transformResponse:void 0,transformError:void 0,responseType:Dm,range:void 0,url:"",params:void 0,method:"GET",headers:{},body:void 0,mode:void 0,credentials:void 0,cache:void 0,redirect:void 0,referrer:void 0,referrerPolicy:void 0,integrity:void 0,onProcessMinLen:0},e)}(e),a._config.loaderType!==Rm&&Gm.isSupported()||(a.type=Rm),a}return Object(S["a"])(i,[{key:"destroy",value:function(){this._queue=[],this._alive=[],this._currentTask=null}},{key:"isFetch",value:function(){return this.type===Cm}},{key:"load",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"string"!=typeof e&&e?i=e:i.url=e||i.url||this._config.url,i=Object.assign({},this._config,i),i.params&&(i.params=Object.assign({},i.params)),i.headers&&Bm(i.headers)&&(i.headers=Object.assign({},i.headers)),i.body&&Bm(i.body)&&(i.body=Object.assign({},i.body)),i.transformRequest&&(i=i.transformRequest(i)||i);var r=new Hm(this.type,i,this.player);return r.loader.on(Pm,(function(e){t.emit(Pm,e)})),this._queue.push(r),1!==this._queue.length||this._currentTask&&this._currentTask.running||this._processTask(),r.promise}},{key:"cancel",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=this._queue.map((function(e){return e.cancel()})).concat(this._alive.map((function(e){return e.cancel()}))),this._currentTask&&t.push(this._currentTask.cancel()),this._queue=[],this._alive=[],e.next=6,Promise.all(t);case 6:return e.next=8,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise((function(t){return setTimeout(t,e)}))}();case 8:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"_processTask",value:function(){var e=this;if(this._currentTask=this._queue.shift(),this._currentTask){this._currentTask.alive&&this._alive.push(this._currentTask);var t=this._currentTask.exec()["catch"]((function(e){}));t&&"function"==typeof t["finally"]&&t["finally"]((function(){var t,i;null!==(t=e._currentTask)&&void 0!==t&&t.alive&&(null===(i=e._alive)||void 0===i?void 0:i.length)>0&&(e._alive=e._alive.filter((function(t){return t&&t!==e._currentTask}))),e._processTask()}))}}}],[{key:"isFetchSupport",value:function(){return Gm.isSupported()}}]),i}(fn),qm="network",Km="network_timeout",Jm="other",Ym="manifest",Qm="hls",Xm="demux",$m=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e,r,a,n,s){var o;return Object(T["a"])(this,i),o=t.call(this,s||(null==a?void 0:a.message)),o.errorType=e===Km?qm:e,o.originError=a,o.ext=n,o.errorMessage=o.message,o}return Object(S["a"])(i,null,[{key:"create",value:function(e,t,r,a,n){return e instanceof i?e:(e instanceof Error&&(r=e,e=""),e||(e=Jm),new i(e,t,r,a,n))}},{key:"network",value:function(e){var t;return new i(null!=e&&e.isTimeout?Km:qm,null,e instanceof Error?e:null,{url:null==e?void 0:e.url,response:null==e?void 0:e.response,httpCode:null==e||null===(t=e.response)||void 0===t?void 0:t.status})}}]),i}(Object(y["a"])(Error)),Zm=/^#(EXT[^:]*)(?::(.*))?$/,eg=/([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g,tg=/^(?:[a-zA-Z0-9+\-.]+:)?\/\//,ig=/^((?:[a-zA-Z0-9+\-.]+:)?\/\/[^/?#]*)?([^?#]*\/)?/;function rg(e){var t=e.match(Zm);if(t&&t[1])return[t[1].replace("EXT-X-",""),t[2]]}function ag(e){for(var t={},i=eg.exec(e);i;)t[i[1]]=i[2]||i[3],i=eg.exec(e);return t}function ng(e,t){if(!t||!e||tg.test(e))return e;var i=ig.exec(t);return i?"/"===e[0]?i[1]+e:i[1]+i[2]+e:e}var sg={audio:[/^mp4a/,/^vorbis$/,/^opus$/,/^flac$/,/^[ae]c-3$/],video:[/^avc/,/^hev/,/^hvc/,/^vp0?[89]/,/^av1$/],text:[/^vtt$/,/^wvtt/,/^stpp/]};function og(e,t){var i=sg[e];if(i&&t&&t.length)for(var r=0;r<i.length;r++)for(var a=0;a<t.length;a++)if(i[r].test(t[a]))return t[a]}var cg=Object(S["a"])((function e(){Object(T["a"])(this,e),this.version=0,this.streams=[],this.isMaster=!0})),lg="AUDIO",ug="SUBTITLE",dg=Object(S["a"])((function e(){Object(T["a"])(this,e),xc(this,"id",0),xc(this,"url",""),xc(this,"default",!1),xc(this,"autoSelect",!1),xc(this,"forced",!1),xc(this,"group",""),xc(this,"name",""),xc(this,"lang",""),xc(this,"segments",[]),xc(this,"endSN",0)})),hg=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(){var e;return Object(T["a"])(this,i),e=t.apply(this,arguments),xc(Object(v["a"])(e),"mediaType",lg),xc(Object(v["a"])(e),"channels",0),e}return Object(S["a"])(i)}(dg),fg=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(){var e;return Object(T["a"])(this,i),e=t.apply(this,arguments),xc(Object(v["a"])(e),"mediaType",ug),e}return Object(S["a"])(i)}(dg),pg=Object(S["a"])((function e(){Object(T["a"])(this,e),xc(this,"id",0),xc(this,"bitrate",0),xc(this,"width",0),xc(this,"height",0),xc(this,"name",""),xc(this,"url",""),xc(this,"audioCodec",""),xc(this,"videoCodec",""),xc(this,"textCodec",""),xc(this,"audioGroup",""),xc(this,"audioStreams",[]),xc(this,"subtitleStreams",[]),xc(this,"closedCaptionsStream",[])})),mg=Object(S["a"])((function e(){Object(T["a"])(this,e),xc(this,"version",0),xc(this,"url",""),xc(this,"type",""),xc(this,"startCC",0),xc(this,"endCC",0),xc(this,"startSN",0),xc(this,"endSN",0),xc(this,"totalDuration",0),xc(this,"targetDuration",0),xc(this,"live",!0),xc(this,"segments",[])})),gg=function(){function e(){Object(T["a"])(this,e),xc(this,"sn",0),xc(this,"cc",0),xc(this,"url",""),xc(this,"title",""),xc(this,"start",0),xc(this,"duration",0),xc(this,"key",null),xc(this,"byteRange",null),xc(this,"isInitSegment",!1),xc(this,"initSegment",null),xc(this,"isLast",!1),xc(this,"hasAudio",!1),xc(this,"hasVideo",!1)}return Object(S["a"])(e,[{key:"end",get:function(){return this.start+this.duration}},{key:"setTrackExist",value:function(e,t){this.hasVideo=e,this.hasAudio=t}},{key:"setByteRange",value:function(e,t){this.byteRange=[0];var i=e.split("@");1===i.length&&t&&t.byteRange?(this.byteRange[0]=t.byteRange[1]||0,this.byteRange[0]&&(this.byteRange[0]+=1)):this.byteRange[0]=parseInt(i[1]),this.byteRange[1]=this.byteRange[0]+parseInt(i[0])-1}}]),e}(),yg=function(){function e(t){Object(T["a"])(this,e),xc(this,"method",""),xc(this,"url",""),xc(this,"iv",null),xc(this,"keyFormat",""),xc(this,"keyFormatVersions",""),t instanceof e&&(this.method=t.method,this.url=t.url,this.keyFormat=t.keyFormat,this.keyFormatVersions=t.keyFormatVersions,t.iv&&(this.iv=new Uint8Array(t.iv)))}return Object(S["a"])(e,[{key:"clone",value:function(t){var i=new e(this);return null!=t&&i.setIVFromSN(t),i}},{key:"setIVFromSN",value:function(e){if(!this.iv&&"AES-128"===this.method&&"number"==typeof e&&this.url){this.iv=new Uint8Array(16);for(var t=12;t<16;t++)this.iv[t]=e>>8*(15-t)&255}}}]),e}(),vg=function(){function e(){Object(T["a"])(this,e)}return Object(S["a"])(e,null,[{key:"parse",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1?arguments[1]:void 0;if(!t.includes("#EXTM3U"))throw new Error("Invalid m3u8 file");var r=function(e){return e.split(/[\r\n]/).map((function(e){return e.trim()})).filter(Boolean)}(t);return e.isMediaPlaylist(t)?function(e,t){var i=new mg;i.url=t;for(var r,a=new gg,n=null,s=null,o=0,c=0,l=0,u=0,d=!1;(r=e[u++])&&!d;)if("#"===r[0]){var f=rg(r);if(f){var p=h(f,2),m=p[0],g=p[1];switch(m){case"VERSION":i.version=parseInt(g);break;case"PLAYLIST-TYPE":i.type=null==g?void 0:g.toUpperCase();break;case"TARGETDURATION":i.targetDuration=parseFloat(g);break;case"ENDLIST":var y=i.segments[i.segments.length-1];y&&(y.isLast=!0),i.live=!1,d=!0;break;case"MEDIA-SEQUENCE":c=i.startSN=parseInt(g);break;case"DISCONTINUITY-SEQUENCE":l=i.startCC=parseInt(g);break;case"DISCONTINUITY":l++;break;case"BYTERANGE":a.setByteRange(g,i.segments[i.segments.length-1]);break;case"EXTINF":var v=g.split(","),b=h(v,2),A=b[0],k=b[1];a.start=o,a.duration=parseFloat(A),o+=a.duration,a.title=k;break;case"KEY":var _=ag(g);if("NONE"===_.METHOD){s=null;break}if("AES-128"!==_.METHOD)throw new Error("encrypt ".concat(_.METHOD,"/").concat(_.KEYFORMAT," is not supported"));if(s=new yg,s.method=_.METHOD,s.url=/^blob:/.test(_.URI)?_.URI:ng(_.URI,t),s.keyFormat=_.KEYFORMAT||"identity",s.keyFormatVersions=_.KEYFORMATVERSIONS,_.IV){var w=_.IV.slice(2);w=(1&w.length?"0":"")+w,s.iv=new Uint8Array(w.length/2);for(var S=0,T=w.length/2;S<T;S++)s.iv[S]=parseInt(w.slice(2*S,2*S+2),16)}break;case"MAP":var E=ag(g);a.url=ng(E.URI,t),E.BYTERANGE&&a.setByteRange(E.BYTERANGE),a.isInitSegment=!0,a.sn=0,s&&(a.key=s.clone(0)),n=a,a=new gg}}}else a.sn=c,a.cc=l,a.url=ng(r,t),s&&(a.key=s.clone(c)),n&&(a.initSegment=n),i.segments.push(a),a=new gg,c++;var x=i.segments[i.segments.length-1];return x&&(i.endSN=x.sn),i.totalDuration=o,i.endCC=l,i}(r,i):function(e,t){for(var i,r=new cg,a=0,n=[],s=[];i=e[a++];){var o=rg(i);if(o){var c=h(o,2),l=c[0],u=c[1];if("VERSION"===l)r.version=parseInt(u);else if("MEDIA"===l&&u){var d=ag(u),f=void 0;switch(d.TYPE){case"AUDIO":f=new hg;break;case"SUBTITLES":f=new fg;break;default:f=new dg}f.url=ng(d.URI,t),f["default"]="YES"===d.DEFAULT,f.autoSelect="YES"===d.AUTOSELECT,f.group=d["GROUP-ID"],f.name=d.NAME,f.lang=d.LANGUAGE,d.CHANNELS&&(f.channels=Number(d.CHANNELS.split("/")[0]),Number.isNaN(f.channels)&&(f.channels=0)),"AUDIO"===d.TYPE&&d.URI&&n.push(f),"SUBTITLES"===d.TYPE&&s.push(f)}else if("STREAM-INF"===l&&u){var p=new pg,m=ag(u);if(p.bitrate=parseInt(m["AVERAGE-BANDWIDTH"]||m.BANDWIDTH),p.name=m.NAME,p.url=ng(e[a++],t),m.RESOLUTION){var g=m.RESOLUTION.split("x"),y=h(g,2),v=y[0],b=y[1];p.width=parseInt(v),p.height=parseInt(b)}if(m.CODECS){var A=m.CODECS.split(/[ ,]+/).filter(Boolean);p.videoCodec=og("video",A),p.audioCodec=og("audio",A),p.textCodec=og("text",A)}p.audioGroup=m.AUDIO,p.subtitleGroup=m.SUBTITLES,r.streams.push(p)}}}return r.streams.forEach((function(e,t){e.id=t})),n.length&&(n.forEach((function(e,t){e.id=t})),r.streams.forEach((function(e){e.audioGroup&&(e.audioStreams=n.filter((function(t){return t.group===e.audioGroup})))}))),s.length&&(s.forEach((function(e,t){e.id=t})),r.streams.forEach((function(e){e.subtitleGroup&&(e.subtitleStreams=s.filter((function(t){return t.group===e.subtitleGroup})))}))),r}(r,i)}},{key:"isMediaPlaylist",value:function(e){return e.includes("#EXTINF:")||e.includes("#EXT-X-TARGETDURATION:")}}]),e}(),bg=function(){function e(t){var i=this;Object(T["a"])(this,e),xc(this,"_onLoaderRetry",(function(e,t){i.hls.emit(gr,{error:$m.network(e),retryTime:t})})),this.hls=t,this.player=t.player,this.TAG_NAME="HlsManifestLoader",this._timer=null;var r=this.hls.config,a=r.retryCount,n=r.retryDelay,s=r.loadTimeout,o=r.fetchOptions;this._loader=new Wm(Object(g["a"])(Object(g["a"])({},o),{},{responseType:"text",retry:a,retryDelay:n,timeout:s,onRetryError:this._onLoaderRetry}),this.player),this._audioLoader=new Wm(Object(g["a"])(Object(g["a"])({},o),{},{responseType:"text",retry:a,retryDelay:n,timeout:s,onRetryError:this._onLoaderRetry}),this.player),this._subtitleLoader=new Wm(Object(g["a"])(Object(g["a"])({},o),{},{responseType:"text",retry:a,retryDelay:n,timeout:s,onRetryError:this._onLoaderRetry}),this.player)}return Object(S["a"])(e,[{key:"destroy",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.stopPoll();case 2:this._audioLoader&&(this._audioLoader.destroy(),this._audioLoader=null),this._subtitleLoader&&(this._subtitleLoader.destroy(),this._subtitleLoader=null),this._loader&&(this._loader.destroy(),this._loader=null);case 5:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"load",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t,i,r){var a,n,s,o,c,l,u,d,f,p,m,g,y;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.player.debug.log(this.TAG_NAME,"load()",t,i,r),a=[this._loader.load(t)],i&&a.push(this._audioLoader.load(i)),r&&a.push(this._subtitleLoader.load(r)),e.prev=3,e.next=6,Promise.all(a);case 6:if(d=e.sent,f=h(d,3),p=f[0],m=f[1],g=f[2],p){e.next=13;break}return e.abrupt("return",[]);case 13:n=p.data,i?(s=null==m?void 0:m.data,o=null==g?void 0:g.data):o=null==m?void 0:m.data,e.next=19;break;case 16:throw e.prev=16,e.t0=e["catch"](3),$m.network(e.t0);case 19:if(e.prev=19,c=vg.parse(n,t),!1!==(null===(y=c)||void 0===y?void 0:y.live)||!c.segments||c.segments.length){e.next=22;break}throw new Error("empty segments list");case 22:s&&(l=vg.parse(s,i)),o&&(u=vg.parse(o,r)),e.next=28;break;case 25:throw e.prev=25,e.t1=e["catch"](19),new $m(Ym,Qm,e.t1);case 28:return e.abrupt("return",(c&&(c.isMaster?this.hls.emit(ur,{playlist:c}):this.hls.emit(dr,{playlist:c})),[c,l,u]));case 29:case"end":return e.stop()}}),e,this,[[3,16],[19,25]])})));function t(t,i,r){return e.apply(this,arguments)}return t}()},{key:"poll",value:function(e,t,i,r,a,n){var s=this;clearTimeout(this._timer),n=n||3e3;var c=this.hls.config.pollRetryCount,l=function(){var u=Object(o["a"])(regeneratorRuntime.mark((function o(){var u;return regeneratorRuntime.wrap((function(o){while(1)switch(o.prev=o.next){case 0:return clearTimeout(s._timer),o.prev=1,o.next=4,s.load(e,t,i);case 4:if(u=o.sent,u[0]){o.next=7;break}return o.abrupt("return");case 7:c=s.hls.config.pollRetryCount,r(u[0],u[1],u[2]),o.next=13;break;case 10:o.prev=10,o.t0=o["catch"](1),c--,c<=0&&a(o.t0);case 13:s._timer=setTimeout(l,n);case 14:case"end":return o.stop()}}),o,null,[[1,10]])})));return function(){return u.apply(this,arguments)}}();this._timer=setTimeout(l,n)}},{key:"stopPoll",value:function(){return clearTimeout(this._timer),this.cancel()}},{key:"cancel",value:function(){return Promise.all([this._loader.cancel(),this._audioLoader.cancel()])}}]),e}(),Ag=function(){function e(){Object(T["a"])(this,e),xc(this,"_chunkSpeeds",[]),xc(this,"_speeds",[])}return Object(S["a"])(e,[{key:"addRecord",value:function(e,t){e&&t&&(this._speeds.push(8e3*e/t),this._speeds=this._speeds.slice(-3))}},{key:"addChunkRecord",value:function(e,t){e&&t&&(this._chunkSpeeds.push(8e3*e/t),this._chunkSpeeds=this._chunkSpeeds.slice(-100))}},{key:"getAvgSpeed",value:function(){return this._chunkSpeeds.length||this._speeds.length?this._speeds.length?this._speeds.reduce((function(e,t){return e+t}))/this._speeds.length:this._chunkSpeeds.reduce((function(e,t){return e+t}))/this._chunkSpeeds.length:0}},{key:"getLatestSpeed",value:function(){return this._chunkSpeeds.length||this._speeds.length?this._speeds.length?this._speeds[this._speeds.length-1]:this._chunkSpeeds[this._chunkSpeeds.length-1]:0}},{key:"reset",value:function(){this._chunkSpeeds=[],this._speeds=[]}}]),e}(),kg=function(){function e(t){var i=this;Object(T["a"])(this,e),xc(this,"_emitOnLoaded",(function(e,t){var r=e.data,a=e.response,n=e.option,s=n||{},o=s.firstByteTime,c=s.startTime,l=s.endTime,u=s.contentLength,d=l-c;i._bandwidthService.addRecord(u||r.byteLength,d),i.hls.emit(vr,{time:d,byteLength:u,url:t}),i.hls.emit(br,{url:t,elapsed:d||0}),i.hls.emit(mr,{url:t,responseUrl:a.url,elapsed:o-c}),i.hls.emit(Ar,{headers:a.headers})})),xc(this,"_onLoaderRetry",(function(e,t){i.hls.emit(gr,{error:$m.network(e),retryTime:t})})),this.hls=t,this.player=t.player,this._bandwidthService=new Ag;var r=this.hls.config,a=r.retryCount,n=r.retryDelay,s=r.loadTimeout,o=r.fetchOptions;this._segmentLoader=new Wm(Object(g["a"])(Object(g["a"])({},o),{},{responseType:"arraybuffer",retry:a,retryDelay:n,timeout:s,onRetryError:this._onLoaderRetry}),this.player),this._audioSegmentLoader=new Wm(Object(g["a"])(Object(g["a"])({},o),{},{responseType:"arraybuffer",retry:a,retryDelay:n,timeout:s,onRetryError:this._onLoaderRetry}),this.player),this._keyLoader=new Wm(Object(g["a"])(Object(g["a"])({},o),{},{responseType:"arraybuffer",retry:a,retryDelay:n,timeout:s,onRetryError:this._onLoaderRetry}),this.player)}return Object(S["a"])(e,[{key:"destroy",value:function(){this.reset(),this._keyLoader&&(this._keyLoader.destroy(),this._keyLoader=null),this._audioSegmentLoader&&(this._audioSegmentLoader.destroy(),this._audioSegmentLoader=null),this._segmentLoader&&(this._segmentLoader.destroy(),this._segmentLoader=null)}},{key:"speedInfo",value:function(){return{speed:this._bandwidthService.getLatestSpeed(),avgSpeed:this._bandwidthService.getAvgSpeed()}}},{key:"load",value:function(e,t,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i,a=[];return e&&(a[0]=this.loadVideoSegment(e,i)),t&&(a[1]=this.loadAudioSegment(t,r)),Promise.all(a)}},{key:"loadVideoSegment",value:function(e,t){return this._loadSegment(this._segmentLoader,e,t)}},{key:"loadAudioSegment",value:function(e,t){return this._loadSegment(this._audioSegmentLoader,e,t)}},{key:"_loadSegment",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t,i,r){var a,n,s,o,c,l,u,d,f,p,m,g,y,v,b,A=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return u=[],this.hls.emit(yr,{url:i.url}),u[0]=t.load(i.url),r&&i.initSegment&&(f=i.initSegment.url,n=this._mapCache[f],n||(this.hls.emit(yr,{url:f}),u[1]=t.load(f).then((function(e){e&&(Object.keys(A._mapCache)>30&&(A._mapCache={}),n=A._mapCache[f]=e.data,A._emitOnLoaded(e,f))}))),p=null===(d=i.initSegment.key)||void 0===d?void 0:d.url,p&&(l=i.initSegment.key.iv,c=this._keyCache[p],c||(this.hls.emit(yr,{url:p}),u[2]=this._keyLoader.load(p).then((function(e){e&&(c=A._keyCache[p]=e.data,A._emitOnLoaded(e,p))}))))),m=null===(a=i.key)||void 0===a?void 0:a.url,m&&(o=i.key.iv,s=this._keyCache[m],s||(this.hls.emit(yr,{url:m}),u[3]=this._keyLoader.load(m).then((function(e){e&&(s=A._keyCache[m]=e.data,A._emitOnLoaded(e,m))})))),e.next=6,Promise.all(u);case 6:if(g=e.sent,y=h(g,1),v=y[0],v){e.next=11;break}return e.abrupt("return");case 11:return b=v.data,e.abrupt("return",(this._emitOnLoaded(v,i.url),{data:b,map:n,key:s,mapKey:c,keyIv:o,mapKeyIv:l}));case 13:case"end":return e.stop()}}),e,this)})));function t(t,i,r){return e.apply(this,arguments)}return t}()},{key:"reset",value:function(){this.error=null,this._mapCache={},this._keyCache={},this._bandwidthService.reset()}},{key:"cancel",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([this._keyLoader.cancel(),this._segmentLoader.cancel(),this._audioSegmentLoader.cancel()]);case 2:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()}]),e}(),_g=function(){function e(t,i,r){Object(T["a"])(this,e),this.live=void 0,this.id=0,this.bitrate=0,this.width=0,this.height=0,this.name="",this.url="",this.audioCodec="",this.videoCodec="",this.textCodec="",this.startCC=0,this.endCC=0,this.startSN=0,this.endSN=-1,this.totalDuration=0,this.targetDuration=0,this.snDiff=null,this.segments=[],this.audioStreams=[],this.subtitleStreams=[],this.closedCaptions=[],this.currentAudioStream=null,this.currentSubtitleStream=null,this.TAG_NAME="HlsStream",this.update(t,i,r)}return Object(S["a"])(e,[{key:"lastSegment",get:function(){return this.segments.length?this.segments[this.segments.length-1]:null}},{key:"segmentDuration",get:function(){var e;return this.targetDuration||(null===(e=this.segments[0])||void 0===e?void 0:e.duration)||0}},{key:"liveEdge",get:function(){return this.endTime}},{key:"endTime",get:function(){var e;return(null===(e=this.lastSegment)||void 0===e?void 0:e.end)||0}},{key:"currentSubtitleEndSn",get:function(){var e;return(null===(e=this.currentSubtitleStream)||void 0===e?void 0:e.endSN)||0}},{key:"clearOldSegment",value:function(e,t){return this._clearSegments(e,t)}},{key:"getAudioSegment",value:function(e){if(e&&this.currentAudioStream){var t=e.sn-this.snDiff;return this.currentAudioStream.segments.find((function(e){return e.sn===t}))}}},{key:"update",value:function(e,t){this.url=e.url,Array.isArray(e.segments)?(null!==this.live&&void 0!==this.live||(this.live=e.live),this._updateSegments(e,this),this.startCC=e.startCC,this.endCC=e.endCC,this.startSN=e.startSN,this.endSN=e.endSN||-1,this.totalDuration=e.totalDuration,this.targetDuration=e.targetDuration,this.live=e.live,t&&this.currentAudioStream&&Array.isArray(t.segments)&&(this._updateSegments(t,this.currentAudioStream),(null===this.snDiff||void 0===this.snDiff)&&e.segments.length&&t.segments.length&&(this.snDiff=e.segments[0].sn-t.segments[0].sn))):(this.id=e.id,this.bitrate=e.bitrate,this.width=e.width,this.height=e.height,this.name=e.name,this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.textCodec=e.textCodec,this.audioStreams=e.audioStreams,this.subtitleStreams=e.subtitleStreams,!this.currentAudioStream&&this.audioStreams.length&&(this.currentAudioStream=this.audioStreams.find((function(e){return e["default"]}))||this.audioStreams[0]),!this.currentSubtitleStream&&this.subtitleStreams.length&&(this.currentSubtitleStream=this.subtitleStreams.find((function(e){return e["default"]}))||this.subtitleStreams[0]))}},{key:"updateSubtitle",value:function(e){var t=this;if(e&&this.currentSubtitleStream&&Array.isArray(e.segments)){var i=this._updateSegments(e,this.currentSubtitleStream),r=this.currentSubtitleStream.segments;return r.length>100&&(this.currentSubtitleStream.segments=r.slice(100)),i?i.map((function(e){return{sn:e.sn,url:e.url,duration:e.duration,start:e.start,end:e.end,lang:t.currentSubtitleStream.lang}})):void 0}}},{key:"switchSubtitle",value:function(e){var t=this.subtitleStreams.find((function(t){return t.lang===e})),i=this.currentSubtitleStream;t&&(this.currentSubtitleStream=t,i.segments=[])}},{key:"_clearSegments",value:function(e,t){for(var i=0,r=this.segments,a=0,n=r.length;a<n;a++)if(r[a].end>=e){i=a;break}return i>t&&(i=t),i&&(this.segments=this.segments.slice(i),this.currentAudioStream&&(this.currentAudioStream.segments=this.currentAudioStream.segments.slice(i))),t-i}},{key:"_updateSegments",value:function(e,t){var i=t.segments;if(this.live){var r=i[i.length-1],a=(null==r?void 0:r.sn)||-1;if(a<e.endSN&&e.segments.length){var n=e.segments.findIndex((function(e){return e.sn===a})),s=n<0?e.segments:e.segments.slice(n+1);if(i.length&&s.length){var o=r.end;s.forEach((function(e){e.start=o,o=e.end}));var c=(null==r?void 0:r.cc)||-1;c>s[0].cc&&s.forEach((function(e){return e.cc+=c}))}return t.endSN=e.endSN,t.segments=i.concat(s),s}}else t.segments=e.segments}}]),e}(),wg=function(){function e(t){Object(T["a"])(this,e),this.hls=t,this.player=t.player,this.streams=[],this.currentStream=null,this.dvrWindow=0,this._segmentPointer=-1,this.TAG_NAME="HlsPlaylist"}return Object(S["a"])(e,[{key:"destroy",value:function(){this.reset()}},{key:"lastSegment",get:function(){var e;return null===(e=this.currentStream)||void 0===e?void 0:e.lastSegment}},{key:"currentSegment",get:function(){var e;return null===(e=this.currentSegments)||void 0===e?void 0:e[this._segmentPointer]}},{key:"nextSegment",get:function(){var e;return null===(e=this.currentSegments)||void 0===e?void 0:e[this._segmentPointer+1]}},{key:"currentSegments",get:function(){var e;return null===(e=this.currentStream)||void 0===e?void 0:e.segments}},{key:"currentSubtitleEndSn",get:function(){var e;return null===(e=this.currentStream)||void 0===e?void 0:e.currentSubtitleEndSn}},{key:"liveEdge",get:function(){var e;return null===(e=this.currentStream)||void 0===e?void 0:e.liveEdge}},{key:"totalDuration",get:function(){var e;return(null===(e=this.currentStream)||void 0===e?void 0:e.totalDuration)||0}},{key:"seekRange",get:function(){var e=this.currentSegments;if(e&&e.length)return[e[0].start,e[e.length-1].end]}},{key:"isEmpty",get:function(){var e;return!(null!==(e=this.currentSegments)&&void 0!==e&&e.length)}},{key:"isLive",get:function(){var e;return null===(e=this.currentStream)||void 0===e?void 0:e.live}},{key:"hasSubtitle",get:function(){var e;return!(null===(e=this.currentStream)||void 0===e||!e.currentSubtitleStream)}},{key:"getAudioSegment",value:function(e){var t;return null===(t=this.currentStream)||void 0===t?void 0:t.getAudioSegment(e)}},{key:"moveSegmentPointer",value:function(e){var t;null==e&&(e=this._segmentPointer+1),this._segmentPointer=Zr(e,-1,null===(t=this.currentSegments)||void 0===t?void 0:t.length),this.player.debug.log(this.TAG_NAME,"moveSegmentPointer()",e,this._segmentPointer)}},{key:"reset",value:function(){this.streams=[],this.currentStream=null,this.dvrWindow=0,this._segmentPointer=-1}},{key:"getSegmentByIndex",value:function(e){var t;return null===(t=this.currentSegments)||void 0===t?void 0:t[e]}},{key:"setNextSegmentByIndex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this._segmentPointer=e-1,this.player.debug.log(this.TAG_NAME,"setNextSegmentByIndex()",e,this._segmentPointer)}},{key:"findSegmentIndexByTime",value:function(e){var t=this.currentSegments;if(t){for(var i,r=0,a=t.length;r<a;r++)if(i=t[r],e>=i.start&&e<i.end)return r;var n=t[t.length-1];if(Math.abs(e-n.end)<.2)return t.length-1}}},{key:"upsertPlaylist",value:function(e,t,i){var r=this;if(e){if(e.isMaster)this.streams.length=e.streams.length,e.streams.filter((function(e){return e.url})).forEach((function(e,t){r.streams[t]?r.streams[t].update(e):r.streams[t]=new _g(e)})),this.currentStream=this.streams[0];else if(Array.isArray(e.segments)){var a=this.currentStream;if(a){a.update(e,t,i);var n=a.updateSubtitle(i);n&&this.hls.emit(lr,{list:n})}else this.reset(),this.currentStream=this.streams[0]=new _g(e,t,i)}this.currentStream&&this.hls.isLive&&!this.dvrWindow&&(this.dvrWindow=this.currentSegments.reduce((function(e,t){return e+t.duration}),0))}else this.player.debug.warn(this.TAG_NAME,"upsertPlaylist() playlist is null")}},{key:"switchSubtitle",value:function(e){var t;null===(t=this.currentStream)||void 0===t||t.switchSubtitle(e)}},{key:"clearOldSegment",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50,t=this.currentStream;if(this.dvrWindow&&t){var i=t.endTime-this.dvrWindow;if(i<=0)this.player.debug.log(this.TAG_NAME,"clearOldSegment() stream.endTime:".concat(t.endTime,", this.dvrWindow:").concat(this.dvrWindow," startTime <= 0"));else{var r=t.segments;if(r.length<=e)this.player.debug.log(this.TAG_NAME,"clearOldSegment() segments.length:".concat(r.length," <= maxPlaylistSize:").concat(e));else{var a=this._segmentPointer;this._segmentPointer=t.clearOldSegment(i,a),this.player.debug.log(this.TAG_NAME,"clearOldSegment() update _segmentPointer:",a,this._segmentPointer),this.player.debug.log(this.TAG_NAME,"currentSegments",this.currentSegments)}}}}},{key:"checkSegmentTrackChange",value:function(e,t){var i=this.findSegmentIndexByTime(e),r=this.getSegmentByIndex(i);if(r&&(r.hasAudio||r.hasVideo)){if(2!==t&&r.hasAudio&&r.hasVideo)return r;if(!(r.end-e>.3)){var a=this.getSegmentByIndex(i+1);return!a||!a.hasAudio&&!a.hasVideo||a.hasAudio===r.hasAudio&&a.hasVideo===r.hasVideo?void 0:a}}}}]),e}();function Sg(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];if((t=t.filter(Boolean)).length<2)return t[0];var r=new Uint8Array(t.reduce((function(e,t){return e+t.byteLength}),0)),a=0;return t.forEach((function(e){r.set(e,a),a+=e.byteLength})),r}var Tg=function(){function e(t,i){Object(T["a"])(this,e),this.hls=t,this.player=i;var r=window.crypto||window.msCrypto;this.subtle=r&&(r.subtle||r.webkitSubtle),this.externalDecryptor=null}return Object(S["a"])(e,[{key:"decrypt",value:function(e,t){if(e||t){var i=[];return e&&(i[0]=this._decryptSegment(e)),t&&(i[1]=this._decryptSegment(t)),Promise.all(i)}}},{key:"_decryptSegment",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t){var i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(i=t.data,e.t0=t.key,!e.t0){e.next=6;break}return e.next=5,this._decryptData(t.data,t.key,t.keyIv);case 5:i=e.sent;case 6:return e.abrupt("return",t.map?Sg(t.map,i):i);case 7:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"_decryptData",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t,i,r){var a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!this.externalDecryptor){e.next=4;break}return e.next=3,this.externalDecryptor.decrypt(t,i,r);case 3:return e.abrupt("return",e.sent);case 4:if(this.subtle){e.next=6;break}throw new Error("crypto is not defined");case 6:return e.next=8,this.subtle.importKey("raw",i,{name:"AES-CBC"},!1,["encrypt","decrypt"]);case 8:return a=e.sent,e.t0=Uint8Array,e.next=12,this.subtle.decrypt({name:"AES-CBC",iv:r},a,t);case 12:return e.t1=e.sent,e.abrupt("return",new e.t0(e.t1));case 14:case"end":return e.stop()}}),e,this)})));function t(t,i,r){return e.apply(this,arguments)}return t}()}]),e}(),Eg=9e4,xg=45e4,Cg=9e4,Rg=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e),r.player=e,r._pmtId=-1,r._remainingPacketData=null,r._videoPesData=[],r._audioPesData=[],r._gopId=0,r._videoPid=-1,r._audioPid=-1,r._codecType=pt,r._audioCodecType=vt,r._vps=null,r._sps=null,r._pps=null,r.TAG_NAME="TsLoader",r.videoTrack=i.initVideoTrack(),r.audioTrack=i.initAudioTrack(),r._baseDts=-1,r._baseDtsInited=!1,r._basefps=25,r._baseFpsInterval=null,r._tempSampleTsList=[],r._hasAudio=!1,r._hasVideo=!1,r._audioNextPts=void 0,r._videoNextDts=void 0,r._audioTimestampBreak=!1,r._videoTimestampBreak=!1,r._lastAudioExceptionGapDot=0,r._lastAudioExceptionOverlapDot=0,r._lastAudioExceptionLargeGapDot=0,r._isSendAACSeqHeader=!1,r.workerClearTimeout=null,r.workerUrl=null,r.loopWorker=null,r.tempSampleListInfo={},r._initLoopWorker(),r.player.debug.log(r.TAG_NAME,"init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){k(Object(b["a"])(i.prototype),"destroy",this).call(this),this.workerUrl&&(URL.revokeObjectURL(this.workerUrl),this.workerUrl=null),this.workerClearTimeout&&(clearTimeout(this.workerClearTimeout),this.workerClearTimeout=null),this.loopWorker&&(this.loopWorker.postMessage({cmd:"destroy"}),this.loopWorker.terminate(),this.loopWorker=null),this._stopDecodeLoopInterval(),this.videoTrack=null,this.audioTrack=null,this.tempSampleListInfo={},this._baseDts=-1,this._baseDtsInited=!1,this._basefps=50,this._hasCalcFps=!1,this._audioNextPts=void 0,this._videoNextDts=void 0,this._audioTimestampBreak=!1,this._videoTimestampBreak=!1,this._lastAudioExceptionGapDot=0,this._lastAudioExceptionOverlapDot=0,this._lastAudioExceptionLargeGapDot=0,this._isSendAACSeqHeader=!1,this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"_demux",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];t&&(this._pmtId=-1,this.videoTrack=i.initVideoTrack(),this.audioTrack=i.initAudioTrack()),!r||t?(this._remainingPacketData=null,this._videoPesData=[],this._audioPesData=[]):(this.videoTrack.samples=[],this.audioTrack.samples=[],this._remainingPacketData&&(e=Sg(this._remainingPacketData,e),this._remainingPacketData=null));var a=e.length,n=a%188;n&&(this._remainingPacketData=e.subarray(a-n),a-=n);for(var s=0;s<a;s+=188){if(71!==e[s])throw new Error("TS packet did not start with 0x47");var o=!!(64&e[s+1]),c=((31&e[s+1])<<8)+e[s+2],l=void 0;if((48&e[s+3])>>4>1){if(l=s+5+e[s+4],l===s+188)continue}else l=s+4;switch(c){case 0:o&&(l+=e[l]+1),this._pmtId=(31&e[l+10])<<8|e[l+11];break;case this._pmtId:o&&(l+=e[l]+1);var u=l+3+((15&e[l+1])<<8|e[l+2])-4;for(l+=12+((15&e[l+10])<<8|e[l+11]);l<u;){var d=(31&e[l+1])<<8|e[l+2];switch(e[l]){case 15:this._audioPid=d,this._audioCodecType=vt;break;case 27:this._videoPid=d,this._codecType=pt;break;case 36:this._videoPid=d,this._codecType=mt;break;default:console.warn("Unsupported stream. type: ".concat(e[l],", pid: ").concat(d))}l+=5+((15&e[l+3])<<8|e[l+4])}break;case this._videoPid:o&&this._videoPesData.length&&this._parseVideoData(),this._videoPesData.push(e.subarray(l,s+188));break;case this._audioPid:o&&this._audioPesData.length&&this._parseAudioData(),this._audioPesData.push(e.subarray(l,s+188));break;case 17:case 8191:break;default:console.warn("Unknown pid: ".concat(c))}}this._parseVideoData(),this._parseAudioData(),this.audioTrack.formatTimescale=this.videoTrack.formatTimescale=this.videoTrack.timescale=9e4,this.audioTrack.timescale=this.audioTrack.sampleRate||0}},{key:"demuxAndFix",value:function(e,t,i,r){this.player._times.demuxStart||(this.player._times.demuxStart=$r()),this._demux(e,t,i,r),this._fix(r,t,i)}},{key:"_parseVideoData",value:function(){if(this._videoPesData.length){var e=i._parsePES(Sg.apply(void 0,Object(m["a"])(this._videoPesData)));if(e){this.player.updateStats({vbps:e.data.byteLength});var t=function(e){for(var t=e.length,i=2,r=0;null!==e[i]&&void 0!==e[i]&&1!==e[i];)i++;if(i++,r=i+2,r>=t)return[];for(var a=[];r<t;)switch(e[r]){case 0:if(0!==e[r-1]){r+=2;break}if(0!==e[r-2]){r++;break}i!==r-2&&a.push(e.subarray(i,r-2));do{r++}while(1!==e[r]&&r<t);i=r+1,r=i+2;break;case 1:if(0!==e[r-1]||0!==e[r-2]){r+=3;break}i!==r-2&&a.push(e.subarray(i,r-2)),i=r+1,r=i+2;break;default:r+=3}return i<t&&a.push(e.subarray(i)),a}(e.data);t?this._createVideoSample(t,e.pts,e.dts):this.player.debug.warn(this.TAG_NAME,"Cannot parse avc units",e),this._videoPesData=[]}else console.warn("Cannot parse video pes",this._videoPesData)}else console.log("_parseVideoData","no video pes data")}},{key:"_createVideoSample",value:function(e,t,i){var r=this;if(e.length){var a=this._codecType===mt,n={isIFrame:!1,type:Fe,isHevc:a,vps:null,sps:null,pps:null,pts:t,dts:i,payload:null};e.forEach((function(e){var t=a?e[0]>>>1&63:31&e[0];switch(t){case 5:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:if(!a&&5!==t||a&&5===t)break;n.isIFrame=!0,r._gopId++;break;case 6:case 39:case 40:if(!a&&6!==t||a&&6===t)break;return void function(e,t){for(var i=e.length,r=t?2:1,a=0;255===e[r];)a+=255,r++;for(a+=e[r++];255===e[r];)255,r++;if(e[r++],5===a&&i>r+16)for(var n=0;n<16;n++)e[r].toString(16),r++;e.subarray(r)}(function(e){for(var t=e.byteLength,i=[],r=1;r<t-2;)0===e[r]&&0===e[r+1]&&3===e[r+2]?(i.push(r+2),r+=2):r++;if(!i.length)return e;var a=t-i.length,n=new Uint8Array(a),s=0;for(r=0;r<a;s++,r++)s===i[0]&&(s++,i.shift()),n[r]=e[s];return n}(e),a);case 32:if(!a)break;n.vps||(n.vps=e);break;case 7:case 33:if(!a&&7!==t||a&&7===t)break;n.sps||(n.sps=e);break;case 8:case 34:if(!a&&8!==t||a&&8===t)break;n.pps||(n.pps=e)}if(a&&Ps(t)||!a&&As(t)){var i=Es(e);if(n.payload){var s=new Uint8Array(n.payload.byteLength+i.byteLength);s.set(n.payload,0),s.set(i,n.payload.byteLength),n.payload=s}else n.payload=i}}));var s=null;a?n.sps&&n.vps&&n.pps&&(s=Ls({vps:n.vps,sps:n.sps,pps:n.pps})):n.sps&&n.pps&&(s=gs({sps:n.sps,pps:n.pps})),s&&(this.player.debug.log(this.TAG_NAME,"_createVideoSample","seqHeader"),this._doDecodeByHls(s,Fe,n.pts,!0,0)),n.isIFrame&&this.calcIframeIntervalTimestamp(n.dts/90),this.videoTrack.samples=this.videoTrack.samples.concat(n)}}},{key:"_parseAudioData",value:function(){if(this._audioPesData.length){var e=i._parsePES(Sg.apply(void 0,Object(m["a"])(this._audioPesData)));if(e){if(this.player._opt.hasAudio){if(this.player.updateStats({abps:e.data.byteLength}),this._audioCodecType===vt){var t=function(e,t){for(var i=e.length,r=0;r+2<i&&(255!==e[r]||240!=(246&e[r+1]));)r++;if(!(r>=i)){var a=r,n=[],s=(60&e[r+2])>>>2,o=jr[s];if(!o)throw new Error("Invalid sampling index: ".concat(s));for(var c,l,u=1+((192&e[r+2])>>>6),d=(1&e[r+2])<<2|(192&e[r+3])>>>6,h=0,f=Gr(o);r+7<i;)if(255===e[r]&&240==(246&e[r+1])){if(l=(3&e[r+3])<<11|e[r+4]<<3|(224&e[r+5])>>5,i-r<l)break;c=2*(1&~e[r+1]),n.push({pts:t+h*f,data:e.subarray(r+7+c,r+l)}),h++,r+=l}else r++;return{skip:a,remaining:r>=i?void 0:e.subarray(r),frames:n,samplingFrequencyIndex:s,sampleRate:o,objectType:u,channelCount:d,originCodec:"mp4a.40.".concat(u)}}}(e.data,e.originalPts);if(t){if(this.audioTrack.codec=t.codec,this.audioTrack.sampleRate=t.sampleRate,this.audioTrack.channelCount=t.channelCount,!this._isSendAACSeqHeader){var r=Mr({profile:t.objectType,sampleRate:t.samplingFrequencyIndex,channel:t.channelCount});this._isSendAACSeqHeader=!0,this.player.debug.log(this.TAG_NAME,"aac seq header","profile: ".concat(t.objectType,", sampleRate:").concat(t.sampleRate,",sampleRateIndex: ").concat(t.samplingFrequencyIndex,", channel: ").concat(t.channelCount)),this._doDecodeByHls(r,Me,0,!1,0)}if(this._isSendAACSeqHeader){var a=[];t.frames.forEach((function(e){var t=e.pts,i=new Uint8Array(e.data.length+2);i.set([175,1],0),i.set(e.data,2);var r={type:Me,pts:t,dts:t,payload:i};a.push(r)})),this.audioTrack.samples=this.audioTrack.samples.concat(a)}else this.player.debug.warn(this.TAG_NAME,"aac seq header not send")}else this.player.debug.warn(this.TAG_NAME,"aac parseADTS error")}this._audioPesData=[]}}else console.warn("Cannot parse audio pes",this._audioPesData)}}},{key:"_fix",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];t=Math.round(9e4*t);var a=this.videoTrack,n=this.audioTrack,s=a.samples,o=n.samples;if(s.length||o.length){var c=s[0],l=o[0],u=0;if(s.length&&o.length&&(u=c.dts-l.pts),this._baseDtsInited||this._calculateBaseDts(),i&&(this._calculateBaseDts(),this._baseDts-=t),!r){this._videoNextDts=u>0?t+u:t,this._audioNextPts=u>0?t:t-u;var d=c?c.dts-this._baseDts-this._videoNextDts:0,h=l?l.pts-this._baseDts-this._audioNextPts:0;Math.abs(d||h)>Cg&&(this._calculateBaseDts(this.audioTrack,this.videoTrack),this._baseDts-=t)}this._resetBaseDtsWhenStreamBreaked(),this._fixAudio(n),this._fixVideo(a);var f=a.samples.concat(n.samples);f=f.map((function(e){return e.dts=e.dts/90,e.pts=e.pts/90,e.cts=e.pts-e.dts,e})).sort((function(e,t){return e.dts-t.dts})),f.forEach((function(t){var i=new Uint8Array(t.payload);delete t.payload,e.loopWorker.postMessage(Object(g["a"])(Object(g["a"])({},t),{},{payload:i,cmd:"sample"}),[i.buffer])})),an(this._hasCalcFps)&&(this._hasCalcFps=!0,this._calcDecodeFps(f))}}},{key:"_calculateBaseDts",value:function(){var e=this.audioTrack,t=this.videoTrack,i=e.samples,r=t.samples;if(!i.length&&!r.length)return!1;var a=1/0,n=1/0;i.length&&(e.baseDts=a=i[0].pts),r.length&&(t.baseDts=n=r[0].dts),this._baseDts=Math.min(a,n);var s=n-a;return Number.isFinite(s)&&Math.abs(s)>45e3&&this.player.debug.warn(this.TAG_NAME,"large av first frame gap,\n video pts: ".concat(n,",\n audio pts: ").concat(a,",\n base dts: ").concat(this._baseDts,",\n detect is: ").concat(s)),this._baseDtsInited=!0,!0}},{key:"_resetBaseDtsWhenStreamBreaked",value:function(){if(this._baseDtsInited&&this._videoTimestampBreak&&this._audioTimestampBreak){if(!this._calculateBaseDts(this.audioTrack,this.videoTrack))return;this._baseDts-=Math.min(this._audioNextPts,this._videoNextDts),this._audioLastSample=null,this._videoLastSample=null,this._videoTimestampBreak=!1,this._audioTimestampBreak=!1}}},{key:"_fixAudio",value:function(e){var t=this,i=e.samples;i.length&&(i.forEach((function(e){e.pts-=t._baseDts,e.dts=e.pts})),this._doFixAudioInternal(e,i,9e4))}},{key:"_fixVideo",value:function(e){var t=this,i=e.samples;if(i.length){if(i.forEach((function(e){e.dts-=t._baseDts,e.pts-=t._baseDts})),void 0===this._videoNextDts){var r=i[0];this._videoNextDts=r.dts}var a,n=i.length,s=0,o=i[0],c=i[1],l=this._videoNextDts-o.dts;Math.abs(l)>45e3&&(o.dts+=l,o.pts+=l,this.player.debug.warn(this.TAG_NAME,"large video gap between chunk,\n next dts is ".concat(this._videoNextDts,",\n first dts is ").concat(o.dts,",\n next dts is ").concat(c.dts,",\n duration is ").concat(l)),c&&Math.abs(c.dts-o.dts)>Cg&&(this._videoTimestampBreak=!0,i.forEach((function(e,t){0!==t&&(e.dts+=l,e.pts+=l)}))));var u=e.samples[0],d=e.samples[n-1];a=1===n?9e3:Math.floor((d.dts-u.dts)/(n-1));for(var h=0;h<n;h++){var f=i[h].dts,p=i[h+1];if(s=h<n-1?p.dts-f:i[h-1]?Math.min(f-i[h-1].dts,a):a,s>Cg||s<0){this._videoTimestampBreak=!0,s=this._audioTimestampBreak?a:Math.max(s,2700);var m=this._audioNextPts||0;p&&p.dts>m&&(s=a),this.player.debug.warn(this.TAG_NAME,"large video gap between frames,\n time is ".concat(f/e.timescale,",\n dts is ").concat(f,",\n origin dts is ").concat(i[h].originalDts,",\n next dts is ").concat(this._videoNextDts,",\n sample Duration is ").concat(s," ,\n ref Sample DurationInt is ").concat(a))}i[h].duration=s,this._videoNextDts+=s}}}},{key:"_doFixAudioInternal",value:function(e,t,i){e.sampleDuration||(e.sampleDuration=Gr(e.timescale,i));var r=e.sampleDuration;if(void 0===this._audioNextPts){var a=t[0];this._audioNextPts=a.pts}for(var n=0;n<t.length;n++){var s=this._audioNextPts,o=t[n],c=o.pts-s;if(!this._audioTimestampBreak&&c>=3*r&&c<=Eg&&!ua()){zr(e.codec,e.channelCount)||t[0].data.subarray();var l=Math.floor(c/r);Math.abs(o.pts-this._lastAudioExceptionGapDot)>xg&&(this._lastAudioExceptionGapDot=o.pts),this.player.debug.warn(this.TAG_NAME,"audio gap detected,\n pts is ".concat(t.pts,",\n originPts is ").concat(t.originalPts,",\n count is ").concat(l,",\n nextPts is ").concat(s,",\n ref sample duration is ").concat(r));for(var u=0;u<l;u++)this._audioNextPts+=r,n++;n--}else c<=-3*r&&c>=-9e4?(Math.abs(o.pts-this._lastAudioExceptionOverlapDot)>xg&&(this._lastAudioExceptionOverlapDot=o.pts,this.player.debug.warn(this.TAG_NAME,"audio overlap detected,\n pts is ".concat(o.pts,",\n originPts is ").concat(o.originalPts,",\n nextPts is ").concat(s,",\n ref sample duration is ").concat(r))),t.splice(n,1),n--):(Math.abs(c)>=Eg&&(this._audioTimestampBreak=!0,Math.abs(o.pts-this._lastAudioExceptionLargeGapDot)>xg&&(this._lastAudioExceptionLargeGapDot=o.pts,this.player.debug.warn(this.TAG_NAME,"large audio gap detected,\n time is ".concat(o.pts/1e3,"\n pts is ").concat(o.pts,",\n originPts is ").concat(o.originalPts,",\n nextPts is ").concat(s,",\n sample duration is ").concat(c,"\n ref sample duration is ").concat(r)))),o.dts=o.pts=s,this._audioNextPts+=r)}}},{key:"_calcDecodeFps",value:function(e){var t=Ya(e.map((function(e){return{ts:e.dts||e.pts,type:e.type}})),Fe);t&&(this._basefps=t,this._postMessageToLoopWorker("updateBaseFps",{baseFps:this._basefps}),this.player.debug.log(this.TAG_NAME,"_calcDecodeFps() video fps is ".concat(t,", update base fps is ").concat(this._basefps)))}},{key:"_initLoopWorker",value:function(){var e=this,t=ln(function(){var e=new(function(){function e(){Object(T["a"])(this,e),this.baseFps=0,this.fpsInterval=null,this.preLoopTimestamp=null,this.startBpsTime=null,this.allSampleList=[]}return Object(S["a"])(e,[{key:"destroy",value:function(){this._clearInterval(),this.baseFps=0,this.allSampleList=[],this.preLoopTimestamp=null,this.startBpsTime=null}},{key:"updateBaseFps",value:function(e){this.baseFps=e,this._clearInterval(),this._startInterval()}},{key:"pushSample",value:function(e){delete e.cmd,this.allSampleList.push(e)}},{key:"_startInterval",value:function(){var e=this,t=Math.ceil(1e3/this.baseFps);this.fpsInterval=setInterval((function(){var i=(new Date).getTime();e.preLoopTimestamp||(e.preLoopTimestamp=i),e.startBpsTime||(e.startBpsTime=i);var r=i-e.preLoopTimestamp;r>2*t&&console.warn("JbPro:[TsLoader LoopWorker] loop interval is ".concat(r,"ms, more than ").concat(t," * 2ms")),e._loop(),e.preLoopTimestamp=(new Date).getTime(),e.startBpsTime&&i-e.startBpsTime>=1e3&&(e._calcSampleList(),e.startBpsTime=i)}),t)}},{key:"_clearInterval",value:function(){this.fpsInterval&&(clearInterval(this.fpsInterval),this.fpsInterval=null)}},{key:"_calcSampleList",value:function(){var e={buferredDuration:0,allListLength:this.allSampleList.length,audioListLength:0,videoListLength:0};this.allSampleList.forEach((function(t){2===t.type?(e.videoListLength++,t.duration&&(e.buferredDuration+=t.duration/90)):1===t.type&&e.audioListLength++})),postMessage(Object(g["a"])({cmd:"sampleListInfo"},e))}},{key:"_loop",value:function(){var e=null;if(this.allSampleList.length)if(e=this.allSampleList.shift(),2===e.type){postMessage(Object(g["a"])({cmd:"decodeVideo"},e),[e.payload.buffer]);for(var t=this.allSampleList[0];t&&1===t.type;)e=this.allSampleList.shift(),postMessage(Object(g["a"])({cmd:"decodeAudio"},e),[e.payload.buffer]),t=this.allSampleList[0]}else 1===e.type&&(postMessage(Object(g["a"])({cmd:"decodeAudio"},e),[e.payload.buffer]),this.allSampleList.length&&2===this.allSampleList[0].type&&(e=this.allSampleList.shift(),postMessage(Object(g["a"])({cmd:"decodeVideo"},e),[e.payload.buffer])))}}]),e}());self.onmessage=function(t){var i=t.data;switch(i.cmd){case"updateBaseFps":e.updateBaseFps(i.baseFps);break;case"sample":e.pushSample(i);break;case"destroy":e.destroy(),e=null}}}.toString()),i=new Blob([t],{type:"text/javascript"}),r=URL.createObjectURL(i),a=new Worker(r);this.workerUrl=r,this.workerClearTimeout=setTimeout((function(){window.URL.revokeObjectURL(e.workerUrl),e.workerUrl=null,e.workerClearTimeout=null}),ie),a.onmessage=function(t){var i=t.data;switch(i.cmd){case"decodeVideo":e._doDecodeVideo(i);break;case"decodeAudio":e._doDecodeAudio(i);break;case"sampleListInfo":e.tempSampleListInfo=i}},this.loopWorker=a}},{key:"_postMessageToLoopWorker",value:function(e,t){this.loopWorker?this.loopWorker.postMessage(Object(g["a"])({cmd:e},t)):this.player.debug.warn(this.TAG_NAME,"loop worker is not init, can not post message")}},{key:"_doDecodeAudio",value:function(e){var t=new Uint8Array(e.payload);this._doDecodeByHls(t,Me,e.dts,!1,0)}},{key:"_doDecodeVideo",value:function(e){var t=new Uint8Array(e.payload),i=null;i=e.isHevc?Ds(t,e.isIFrame):ys(t,e.isIFrame),this.player.updateStats({dts:e.dts});var r=e.pts-e.dts;this._doDecodeByHls(i,Fe,e.dts,e.isIFrame,r)}},{key:"_stopDecodeLoopInterval",value:function(){this._baseFpsInterval&&(clearInterval(this._baseFpsInterval),this._baseFpsInterval=null)}},{key:"getBuferredDuration",value:function(){return this.tempSampleListInfo.buferredDuration||0}},{key:"getSampleListLength",value:function(){return this.tempSampleListInfo.allListLength||0}},{key:"getSampleAudioListLength",value:function(){return this.tempSampleListInfo.audioListLength||0}},{key:"getSampleVideoListLength",value:function(){return this.tempSampleListInfo.videoListLength||0}}],[{key:"initVideoTrack",value:function(){return{samples:[]}}},{key:"initAudioTrack",value:function(){return{samples:[]}}},{key:"probe",value:function(e){return!!e.length&&71===e[0]&&71===e[188]&&71===e[376]}},{key:"_parsePES",value:function(e){var t=e[8];if(!(null==t||e.length<t+9||1!==(e[0]<<16|e[1]<<8|e[2]))){var i=(e[4]<<8)+e[5];if(!(i&&i>e.length-6)){var r,a,n=e[7];return 192&n&&(r=536870912*(14&e[9])+4194304*(255&e[10])+16384*(254&e[11])+128*(255&e[12])+(254&e[13])/2,64&n?(a=536870912*(14&e[14])+4194304*(255&e[15])+16384*(254&e[16])+128*(255&e[17])+(254&e[18])/2,r-a>54e5&&(r=a)):a=r),{data:e.subarray(9+t),pts:r,dts:a,originalPts:r,originalDts:a}}}}}]),i}(Qs);function Lg(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(e[t]<<8)+(e[t+1]||0)}function Dg(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(e[t]<<24>>>0)+(e[t+1]<<16)+(e[t+2]<<8)+(e[t+3]||0)}function Ig(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=Math.pow(2,32);return Dg(e,t)*i+Dg(e,t+4)}var Pg="aac",Og="g7110a",Bg="g7110m",Mg="avc",Fg="hevc",Ug=function(){function e(){Object(T["a"])(this,e)}return Object(S["a"])(e,null,[{key:"getFrameDuration",value:function(e){return 1024*(arguments.length>1&&void 0!==arguments[1]?arguments[1]:9e4)/e}},{key:"getRateIndexByRate",value:function(t){return e.FREQ.indexOf(t)}}]),e}();function jg(e,t,i,r,a,n){var s,o,c,l=[],u=null==a?void 0:a.entries,d=t.entries,h=r.entries,f=i.entrySizes,p=null==n?void 0:n.entries;p&&(s={},p.forEach((function(e){s[e-1]=!0}))),u&&(o=[],u.forEach((function(e){for(var t=e.count,i=e.offset,r=0;r<t;r++)o.push(i)})));var m=-1,g=0,y=0,v=0,b=0,A=0,k=d[0].samplesPerChunk,_=d[1]?d[1].firstChunk-1:1/0;return e.entries.forEach((function(e){for(var t=e.count,r=e.delta,a=0;a<t;a++)c={dts:g,duration:r,size:f[y]||i.sampleSize,offset:h[v]+A,index:y},p&&(c.keyframe=s[y],c.keyframe&&m++,c.gopId=m),o&&y<o.length&&(c.pts=c.dts+o[y]),l.push(c),g+=r,y++,y<k?A+=c.size:(v++,A=0,v>=_&&(b++,_=d[b+1]?d[b+1].firstChunk-1:1/0),k+=d[b].samplesPerChunk)})),l}function Ng(e,t){return e.dataReferenceIndex=Lg(t,6),e.width=Lg(t,24),e.height=Lg(t,26),e.horizresolution=Dg(t,28),e.vertresolution=Dg(t,32),e.frameCount=Lg(t,40),e.depth=Lg(t,74),78}function zg(e,t){return e.dataReferenceIndex=Lg(t,6),e.channelCount=Lg(t,16),e.sampleSize=Lg(t,18),e.sampleRate=Dg(t,24)/65536,28}function Gg(e,t,i){if(e){if(e.size!==e.data.length)throw new Error("box ".concat(e.type," size !== data.length"));var r={start:e.start,size:e.size,headerSize:e.headerSize,type:e.type};return t&&(r.version=e.data[e.headerSize],r.flags=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(e[t]<<16)+(e[t+1]<<8)+(e[t+2]||0)}(e.data,e.headerSize+1),r.headerSize+=4),i(r,e.data.subarray(r.headerSize),r.start+r.headerSize),r}}xc(Ug,"FREQ",[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350]);var Hg=function(e,t,i){for(var r=String(i),a=t>>0,n=Math.ceil(a/r.length),s=[],o=String(e);n--;)s.push(r);return s.join("").substring(0,a-o.length)+o},Vg=function(){for(var e=[],t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];return i.forEach((function(t){e.push(Hg(Number(t).toString(16),2,0))})),e[0]},Wg=function(){function e(){Object(T["a"])(this,e)}return Object(S["a"])(e,null,[{key:"probe",value:function(t){return!!e.findBox(t,["ftyp"])}},{key:"findBox",value:function(t,i){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=[];if(!t)return a;for(var n=0,s="",o=0;t.length>7;){if(n=Dg(t),s=String.fromCharCode.apply(null,t.subarray(4,8)),o=8,1===n?(n=Ig(t,8),o+=8):n||(n=t.length),!i[0]||s===i[0]){var c=t.subarray(0,n);if(!(i.length<2))return e.findBox(c.subarray(o),i.slice(1),r+o);a.push({start:r,size:n,headerSize:o,type:s,data:c})}r+=n,t=t.subarray(n)}return a}},{key:"tfhd",value:function(e){return Gg(e,!0,(function(e,t){e.trackId=Dg(t);var i=4,r=1&e.flags,a=2&e.flags,n=8&e.flags,s=16&e.flags,o=32&e.flags;r&&(i+=4,e.baseDataOffset=Dg(t,i),i+=4),a&&(e.sampleDescriptionIndex=Dg(t,i),i+=4),n&&(e.defaultSampleDuration=Dg(t,i),i+=4),s&&(e.defaultSampleSize=Dg(t,i),i+=4),o&&(e.defaultSampleFlags=Dg(t,i))}))}},{key:"sidx",value:function(e){return Gg(e,!0,(function(e,t){var i=0;e.reference_ID=Dg(t,i),i+=4,e.timescale=Dg(t,i),i+=4,0===e.version?(e.earliest_presentation_time=Dg(t,i),i+=4,e.first_offset=Dg(t,i),i+=4):(e.earliest_presentation_time=Ig(t,i),i+=8,e.first_offset=Ig(t,i),i+=8),i+=2,e.references=[];var r=Lg(t,i);i+=2;for(var a=0;a<r;a++){var n={};e.references.push(n);var s=Dg(t,i);i+=4,n.reference_type=s>>31&1,n.referenced_size=2147483647&s,n.subsegment_duration=Dg(t,i),i+=4,s=Dg(t,i),i+=4,n.starts_with_SAP=s>>31&1,n.SAP_type=s>>28&7,n.SAP_delta_time=268435455&s}}))}},{key:"moov",value:function(t){return Gg(t,!1,(function(t,i,r){t.mvhd=e.mvhd(e.findBox(i,["mvhd"],r)[0]),t.trak=e.findBox(i,["trak"],r).map((function(t){return e.trak(t)})),t.pssh=e.pssh(e.findBox(i,["pssh"],r)[0])}))}},{key:"mvhd",value:function(e){return Gg(e,!0,(function(e,t){var i=0;1===e.version?(e.timescale=Dg(t,16),e.duration=Ig(t,20),i+=28):(e.timescale=Dg(t,8),e.duration=Dg(t,12),i+=16),e.nextTrackId=Dg(t,i+76)}))}},{key:"trak",value:function(t){return Gg(t,!1,(function(t,i,r){t.tkhd=e.tkhd(e.findBox(i,["tkhd"],r)[0]),t.mdia=e.mdia(e.findBox(i,["mdia"],r)[0])}))}},{key:"tkhd",value:function(e){return Gg(e,!0,(function(e,t){var i=0;1===e.version?(e.trackId=Dg(t,16),e.duration=Ig(t,24),i+=32):(e.trackId=Dg(t,8),e.duration=Dg(t,16),i+=20),e.width=Dg(t,i+52),e.height=Dg(t,i+56)}))}},{key:"mdia",value:function(t){return Gg(t,!1,(function(t,i,r){t.mdhd=e.mdhd(e.findBox(i,["mdhd"],r)[0]),t.hdlr=e.hdlr(e.findBox(i,["hdlr"],r)[0]),t.minf=e.minf(e.findBox(i,["minf"],r)[0])}))}},{key:"mdhd",value:function(e){return Gg(e,!0,(function(e,t){var i=0;1===e.version?(e.timescale=Dg(t,16),e.duration=Ig(t,20),i+=28):(e.timescale=Dg(t,8),e.duration=Dg(t,12),i+=16);var r=Lg(t,i);e.language=String.fromCharCode(96+(r>>10&31),96+(r>>5&31),96+(31&r))}))}},{key:"hdlr",value:function(e){return Gg(e,!0,(function(e,t){0===e.version&&(e.handlerType=String.fromCharCode.apply(null,t.subarray(4,8)))}))}},{key:"minf",value:function(t){return Gg(t,!1,(function(t,i,r){t.vmhd=e.vmhd(e.findBox(i,["vmhd"],r)[0]),t.smhd=e.smhd(e.findBox(i,["smhd"],r)[0]),t.stbl=e.stbl(e.findBox(i,["stbl"],r)[0])}))}},{key:"vmhd",value:function(e){return Gg(e,!0,(function(e,t){e.graphicsmode=Lg(t),e.opcolor=[Lg(t,2),Lg(t,4),Lg(t,6)]}))}},{key:"smhd",value:function(e){return Gg(e,!0,(function(e,t){e.balance=Lg(t)}))}},{key:"stbl",value:function(t){return Gg(t,!1,(function(t,i,r){var a,n,s;t.stsd=e.stsd(e.findBox(i,["stsd"],r)[0]),t.stts=e.stts(e.findBox(i,["stts"],r)[0]),t.ctts=e.ctts(e.findBox(i,["ctts"],r)[0]),t.stsc=e.stsc(e.findBox(i,["stsc"],r)[0]),t.stsz=e.stsz(e.findBox(i,["stsz"],r)[0]),t.stco=e.stco(e.findBox(i,["stco"],r)[0]),t.stco||(t.co64=e.co64(e.findBox(i,["co64"],r)[0]),t.stco=t.co64);var o=null===(a=t.stsd.entries[0])||void 0===a||null===(n=a.sinf)||void 0===n||null===(s=n.schi)||void 0===s?void 0:s.tenc.default_IV_size;t.stss=e.stss(e.findBox(i,["stss"],r)[0]),t.senc=e.senc(e.findBox(i,["senc"],r)[0],o)}))}},{key:"senc",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return Gg(e,!0,(function(e,i){var r=0,a=Dg(i,r);r+=4,e.samples=[];for(var n=0;n<a;n++){for(var s={InitializationVector:[]},o=0;o<t;o++)s.InitializationVector[o]=i[r+o];if(r+=t,2&e.flags){s.subsamples=[];var c=Lg(i,r);r+=2;for(var l=0;l<c;l++){var u={};u.BytesOfClearData=Lg(i,r),r+=2,u.BytesOfProtectedData=Dg(i,r),r+=4,s.subsamples.push(u)}}e.samples.push(s)}}))}},{key:"pssh",value:function(e){return Gg(e,!0,(function(e,t){for(var i=[],r=[],a=0,n=0;n<16;n++)r.push(Vg(t[a+n]));if(a+=16,e.version>0){var s=Dg(t,a);a+=4;for(var o=0;o<(""+s).length;o++)for(var c=0;c<16;c++){var l=t[a];a+=1,i.push(Vg(l))}}var u=Dg(t,a);e.data_size=u,a+=4,e.kid=i,e.system_id=r,e.buffer=t}))}},{key:"stsd",value:function(t){return Gg(t,!0,(function(t,i,r){t.entryCount=Dg(i),t.entries=e.findBox(i.subarray(4),[],r+4).map((function(t){switch(t.type){case"avc1":case"avc2":case"avc3":case"avc4":return e.avc1(t);case"hvc1":case"hev1":return e.hvc1(t);case"mp4a":return e.mp4a(t);case"alaw":case"ulaw":return e.alaw(t);case"enca":return Gg(t,!1,(function(t,i,r){t.channelCount=Lg(i,16),t.samplesize=Lg(i,18),t.sampleRate=Dg(i,24)/65536,i=i.subarray(28),t.sinf=e.sinf(e.findBox(i,["sinf"],r)[0]),t.esds=e.esds(e.findBox(i,["esds"],r)[0])}));case"encv":return Gg(t,!1,(function(t,i,r){t.width=Lg(i,24),t.height=Lg(i,26),t.horizresolution=Dg(i,28),t.vertresolution=Dg(i,32),i=i.subarray(78),t.sinf=e.sinf(e.findBox(i,["sinf"],r)[0]),t.avcC=e.avcC(e.findBox(i,["avcC"],r)[0]),t.hvcC=e.hvcC(e.findBox(i,["hvcC"],r)[0]),t.pasp=e.pasp(e.findBox(i,["pasp"],r)[0])}))}})).filter(Boolean)}))}},{key:"tenc",value:function(e){return Gg(e,!1,(function(e,t){var i=6;e.default_IsEncrypted=t[i],i+=1,e.default_IV_size=t[i],i+=1,e.default_KID=[];for(var r=0;r<16;r++)e.default_KID.push(Vg(t[i])),i+=1}))}},{key:"schi",value:function(t){return Gg(t,!1,(function(t,i,r){t.tenc=e.tenc(e.findBox(i,["tenc"],r)[0])}))}},{key:"sinf",value:function(t){return Gg(t,!1,(function(t,i,r){t.schi=e.schi(e.findBox(i,["schi"],r)[0]),t.frma=e.frma(e.findBox(i,["frma"],r)[0])}))}},{key:"frma",value:function(e){return Gg(e,!1,(function(e,t){e.data_format="";for(var i=0;i<4;i++)e.data_format+=String.fromCharCode(t[i])}))}},{key:"avc1",value:function(t){return Gg(t,!1,(function(t,i,r){var a=Ng(t,i),n=i.subarray(a);r+=a,t.avcC=e.avcC(e.findBox(n,["avcC"],r)[0]),t.pasp=e.pasp(e.findBox(n,["pasp"],r)[0])}))}},{key:"avcC",value:function(e){return Gg(e,!1,(function(e,t){e.configurationVersion=t[0],e.AVCProfileIndication=t[1],e.profileCompatibility=t[2],e.AVCLevelIndication=t[3],e.codec=function(e){for(var t,i="avc1.",r=0;r<3;r++)t=e[r].toString(16),t.length<2&&(t="0".concat(t)),i+=t;return i}([t[1],t[2],t[3]]),e.lengthSizeMinusOne=3&t[4],e.spsLength=31&t[5],e.sps=[];for(var i=6,r=0;r<e.spsLength;r++){var a=Lg(t,i);i+=2,e.sps.push(t.subarray(i,i+a)),i+=a}e.ppsLength=t[i],i+=1,e.pps=[];for(var n=0;n<e.ppsLength;n++){var s=Lg(t,i);i+=2,e.pps.push(t.subarray(i,i+=s)),i+=s}}))}},{key:"hvc1",value:function(t){return Gg(t,!1,(function(t,i,r){var a=Ng(t,i),n=i.subarray(a);r+=a,t.hvcC=e.hvcC(e.findBox(n,["hvcC"],r)[0]),t.pasp=e.pasp(e.findBox(n,["pasp"],r)[0])}))}},{key:"hvcC",value:function(e){return Gg(e,!1,(function(t,i){t.data=e.data,t.codec="hev1.1.6.L93.B0",t.configurationVersion=i[0];var r=i[1];t.generalProfileSpace=r>>6,t.generalTierFlag=(32&r)>>5,t.generalProfileIdc=31&r,t.generalProfileCompatibility=Dg(i,2),t.generalConstraintIndicatorFlags=i.subarray(6,12),t.generalLevelIdc=i[12],t.avgFrameRate=Lg(i,19),t.numOfArrays=i[22],t.vps=[],t.sps=[],t.pps=[];for(var a=23,n=0,s=0,o=0,c=0;c<t.numOfArrays;c++){var l,u,d;n=63&i[a],s=Lg(i,a+1),a+=3;for(var h=[],f=0;f<s;f++)o=Lg(i,a),a+=2,h.push(i.subarray(a,a+o)),a+=o;32===n?(l=t.vps).push.apply(l,h):33===n?(u=t.sps).push.apply(u,h):34===n&&(d=t.pps).push.apply(d,h)}}))}},{key:"pasp",value:function(e){return Gg(e,!1,(function(e,t){e.hSpacing=Dg(t),e.vSpacing=Dg(t,4)}))}},{key:"mp4a",value:function(t){return Gg(t,!1,(function(t,i,r){var a=zg(t,i);t.esds=e.esds(e.findBox(i.subarray(a),["esds"],r+a)[0])}))}},{key:"esds",value:function(e){return Gg(e,!0,(function(e,t){e.codec="mp4a.";for(var i=0,r=0,a=0,n=0;t.length;){for(i=0,n=t[i],r=t[i+1],i+=2;128&r;)a=(127&r)<<7,r=t[i],i+=1;if(a+=127&r,3===n)t=t.subarray(i+3);else{if(4!==n){if(5===n){var s=e.config=t.subarray(i,i+a),o=(248&s[0])>>3;return 31===o&&s.length>=2&&(o=32+((7&s[0])<<3)+((224&s[1])>>5)),e.objectType=o,e.codec+=o.toString(16),void("."===e.codec[e.codec.length-1]&&(e.codec=e.codec.substring(0,e.codec.length-1)))}return void("."===e.codec[e.codec.length-1]&&(e.codec=e.codec.substring(0,e.codec.length-1)))}e.codec+=(t[i].toString(16)+".").padStart(3,"0"),t=t.subarray(i+13)}}}))}},{key:"alaw",value:function(e){return Gg(e,!1,(function(e,t){zg(e,t)}))}},{key:"stts",value:function(e){return Gg(e,!0,(function(e,t){for(var i=Dg(t),r=[],a=4,n=0;n<i;n++)r.push({count:Dg(t,a),delta:Dg(t,a+4)}),a+=8;e.entryCount=i,e.entries=r}))}},{key:"ctts",value:function(e){return Gg(e,!0,(function(e,t){var i=Dg(t),r=[],a=4;if(1===e.version)for(var n=0;n<i;n++)r.push({count:Dg(t,a),offset:Dg(t,a+4)}),a+=8;else for(var s=0;s<i;s++)r.push({count:Dg(t,a),offset:-(1+~Dg(t,a+4))}),a+=8;e.entryCount=i,e.entries=r}))}},{key:"stsc",value:function(e){return Gg(e,!0,(function(e,t){for(var i=Dg(t),r=[],a=4,n=0;n<i;n++)r.push({firstChunk:Dg(t,a),samplesPerChunk:Dg(t,a+4),sampleDescriptionIndex:Dg(t,a+8)}),a+=12;e.entryCount=i,e.entries=r}))}},{key:"stsz",value:function(e){return Gg(e,!0,(function(e,t){var i=Dg(t),r=Dg(t,4),a=[];if(!i)for(var n=8,s=0;s<r;s++)a.push(Dg(t,n)),n+=4;e.sampleSize=i,e.sampleCount=r,e.entrySizes=a}))}},{key:"stco",value:function(e){return Gg(e,!0,(function(e,t){for(var i=Dg(t),r=[],a=4,n=0;n<i;n++)r.push(Dg(t,a)),a+=4;e.entryCount=i,e.entries=r}))}},{key:"co64",value:function(e){return Gg(e,!0,(function(e,t){for(var i=Dg(t),r=[],a=4,n=0;n<i;n++)r.push(Ig(t,a)),a+=8;e.entryCount=i,e.entries=r}))}},{key:"stss",value:function(e){return Gg(e,!0,(function(e,t){for(var i=Dg(t),r=[],a=4,n=0;n<i;n++)r.push(Dg(t,a)),a+=4;e.entryCount=i,e.entries=r}))}},{key:"moof",value:function(t){return Gg(t,!1,(function(t,i,r){t.mfhd=e.mfhd(e.findBox(i,["mfhd"],r)[0]),t.traf=e.findBox(i,["traf"],r).map((function(t){return e.traf(t)}))}))}},{key:"mfhd",value:function(e){return Gg(e,!0,(function(e,t){e.sequenceNumber=Dg(t)}))}},{key:"traf",value:function(t){return Gg(t,!1,(function(t,i,r){t.tfhd=e.tfhd(e.findBox(i,["tfhd"],r)[0]),t.tfdt=e.tfdt(e.findBox(i,["tfdt"],r)[0]),t.trun=e.trun(e.findBox(i,["trun"],r)[0])}))}},{key:"trun",value:function(e){return Gg(e,!0,(function(e,t){var i=e.version,r=e.flags,a=t.length,n=e.sampleCount=Dg(t),s=4;if(a>s&&1&r&&(e.dataOffset=-(1+~Dg(t,s)),s+=4),a>s&&4&r&&(e.firstSampleFlags=Dg(t,s),s+=4),e.samples=[],a>s)for(var o,c=0;c<n;c++)o={},256&r&&(o.duration=Dg(t,s),s+=4),512&r&&(o.size=Dg(t,s),s+=4),1024&r&&(o.flags=Dg(t,s),s+=4),2048&r&&(o.cts=i?-(1+~Dg(t,s+4)):Dg(t,s),s+=4),e.samples.push(o)}))}},{key:"tfdt",value:function(e){return Gg(e,!0,(function(e,t){1===e.version?e.baseMediaDecodeTime=Ig(t):e.baseMediaDecodeTime=Dg(t)}))}},{key:"parseSampleFlags",value:function(e){return{isLeading:(12&e[0])>>>2,dependsOn:3&e[0],isDependedOn:(192&e[1])>>>6,hasRedundancy:(48&e[1])>>>4,paddingValue:(14&e[1])>>>1,isNonSyncSample:1&e[1],degradationPriority:e[2]<<8|e[3]}}},{key:"moovToTrack",value:function(e,t,i){var r,a,n=e.trak;if(n&&n.length){var s=n.find((function(e){var t,i;return"vide"===(null===(t=e.mdia)||void 0===t||null===(i=t.hdlr)||void 0===i?void 0:i.handlerType)})),o=n.find((function(e){var t,i;return"soun"===(null===(t=e.mdia)||void 0===t||null===(i=t.hdlr)||void 0===i?void 0:i.handlerType)}));if(s&&t){var c,l,u,d,h,f,p,m=t;null!=(null===(c=s.tkhd)||void 0===c?void 0:c.trackId)&&(m.id=s.tkhd.trackId),m.tkhdDuration=s.tkhd.duration,m.mvhdDurtion=e.mvhd.duration,m.mvhdTimecale=e.mvhd.timescale,m.timescale=m.formatTimescale=s.mdia.mdhd.timescale,m.duration=s.mdia.mdhd.duration||m.mvhdDurtion/m.mvhdTimecale*m.timescale;var g,y,v,b,A,k,_,w,S=s.mdia.minf.stbl.stsd.entries[0];if(m.width=S.width,m.height=S.height,S.pasp&&(m.sarRatio=[S.pasp.hSpacing,S.pasp.vSpacing]),S.hvcC)m.codecType=Fg,m.codec=S.hvcC.codec,m.vps=S.hvcC.vps,m.sps=S.hvcC.sps,m.pps=S.hvcC.pps,m.hvcC=S.hvcC.data;else{if(!S.avcC)throw new Error("unknown video stsd entry");m.codecType=Mg,m.codec=S.avcC.codec,m.sps=S.avcC.sps,m.pps=S.avcC.pps}m.present=!0,m.ext={},m.ext.stss=null===(l=s.mdia)||void 0===l||null===(u=l.minf)||void 0===u||null===(d=u.stbl)||void 0===d?void 0:d.stss,m.ext.ctts=null===(h=s.mdia)||void 0===h||null===(f=h.minf)||void 0===f||null===(p=f.stbl)||void 0===p?void 0:p.ctts,S&&"encv"===S.type&&(m.isVideoEncryption=!0,S.default_KID=null===(g=S.sinf)||void 0===g||null===(y=g.schi)||void 0===y?void 0:y.tenc.default_KID,S.default_IsEncrypted=null===(v=S.sinf)||void 0===v||null===(b=v.schi)||void 0===b?void 0:b.tenc.default_IsEncrypted,S.default_IV_size=null===(A=S.sinf)||void 0===A||null===(k=A.schi)||void 0===k?void 0:k.tenc.default_IV_size,m.videoSenc=s.mdia.minf.stbl.senc&&s.mdia.minf.stbl.senc.samples,S.data_format=null===(_=S.sinf)||void 0===_||null===(w=_.frma)||void 0===w?void 0:w.data_format,m.useEME=e.useEME,m.kidValue=e.kidValue,m.pssh=e.pssh,m.encv=S)}if(o&&i){var T,E,x,C,R,L,D,I,P,O=i;null!=(null===(T=o.tkhd)||void 0===T?void 0:T.trackId)&&(O.id=o.tkhd.trackId),O.tkhdDuration=o.tkhd.duration,O.mvhdDurtion=e.mvhd.duration,O.mvhdTimecale=e.mvhd.timescale,O.timescale=O.formatTimescale=o.mdia.mdhd.timescale,O.duration=o.mdia.mdhd.duration||O.mvhdDurtion/O.mvhdTimecale*O.timescale;var B,M,F,U,j,N,z,G,H=o.mdia.minf.stbl.stsd.entries[0];switch(O.sampleSize=H.sampleSize,O.sampleRate=H.sampleRate,O.channelCount=H.channelCount,O.present=!0,H.type){case"alaw":O.codecType=O.codec=Og,O.sampleRate=8e3;break;case"ulaw":O.codecType=O.codec=Bg,O.sampleRate=8e3;break;default:O.codecType=Pg,O.sampleDuration=Ug.getFrameDuration(O.sampleRate,O.timescale),O.sampleRateIndex=Ug.getRateIndexByRate(O.sampleRate),O.objectType=(null===(r=H.esds)||void 0===r?void 0:r.objectType)||2,H.esds&&(O.config=Array.from(H.esds.config)),O.codec=(null===(a=H.esds)||void 0===a?void 0:a.codec)||"mp4a.40.2"}O.sampleDuration=Ug.getFrameDuration(O.sampleRate,O.timescale),O.objectType=(null===(E=H.esds)||void 0===E?void 0:E.objectType)||2,H.esds&&(H.esds.config?O.config=Array.from(H.esds.config):console.warn("esds config is null")),O.codec=(null===(x=H.esds)||void 0===x?void 0:x.codec)||"mp4a.40.2",O.sampleRateIndex=Ug.getRateIndexByRate(O.sampleRate),O.ext={},O.ext.stss=null===(C=o.mdia)||void 0===C||null===(R=C.minf)||void 0===R||null===(L=R.stbl)||void 0===L?void 0:L.stss,O.ext.ctts=null===(D=o.mdia)||void 0===D||null===(I=D.minf)||void 0===I||null===(P=I.stbl)||void 0===P?void 0:P.ctts,O.present=!0,H&&"enca"===H.type&&(O.isAudioEncryption=!0,H.data_format=null===(B=H.sinf)||void 0===B||null===(M=B.frma)||void 0===M?void 0:M.data_format,H.default_KID=null===(F=H.sinf)||void 0===F||null===(U=F.schi)||void 0===U?void 0:U.tenc.default_KID,H.default_IsEncrypted=null===(j=H.sinf)||void 0===j||null===(N=j.schi)||void 0===N?void 0:N.tenc.default_IsEncrypted,H.default_IV_size=null===(z=H.sinf)||void 0===z||null===(G=z.schi)||void 0===G?void 0:G.tenc.default_IV_size,O.audioSenc=o.mdia.minf.stbl.senc&&o.mdia.minf.stbl.senc.samples,O.useEME=e.useEME,O.kidValue=e.kidValue,O.enca=H)}if(i&&(i.isVideoEncryption=!!t&&t.isVideoEncryption),t&&(t.isAudioEncryption=!!i&&i.isAudioEncryption),null!=t&&t.encv||null!=i&&i.enca){var V,W,q=null==t||null===(V=t.encv)||void 0===V?void 0:V.default_KID,K=null==i||null===(W=i.enca)||void 0===W?void 0:W.default_KID,J=q||K?(q||K).join(""):null;t&&(t.kid=J),i&&(i.kid=J)}return t&&(t.flags=3841),i&&(i.flags=1793),{videoTrack:t,audioTrack:i}}}},{key:"evaluateDefaultDuration",value:function(e,t,i){var r,a=null==t||null===(r=t.samples)||void 0===r?void 0:r.length;return a?1024*a/t.timescale*e.timescale/i:1024}},{key:"moofToSamples",value:function(t,i,r){var a={};return t.mfhd&&(i&&(i.sequenceNumber=t.mfhd.sequenceNumber),r&&(r.sequenceNumber=t.mfhd.sequenceNumber)),t.traf.forEach((function(t){var n=t.tfhd,s=t.tfdt,o=t.trun;if(n&&o){s&&(i&&i.id===n.trackId&&(i.baseMediaDecodeTime=s.baseMediaDecodeTime),r&&r.id===n.trackId&&(r.baseMediaDecodeTime=s.baseMediaDecodeTime));var c=n.defaultSampleSize||0,l=n.defaultSampleDuration||e.evaluateDefaultDuration(i,r,o.samples.length||o.sampleCount),u=o.dataOffset||0,d=0,h=-1;if(!o.samples.length&&o.sampleCount){a[n.trackId]=[];for(var f=0;f<o.sampleCount;f++)a[n.trackId].push({offset:u,dts:d,duration:l,size:c}),d+=l,u+=c}else a[n.trackId]=o.samples.map((function(e,t){return(e={offset:u,dts:d,pts:d+(e.cts||0),duration:e.duration||l,size:e.size||c,gopId:h,keyframe:0===t||null!==e.flags&&void 0!==e.flags&&(65536&e.flags)>>>0!=65536}).keyframe&&(h++,e.gopId=h),d+=e.duration,u+=e.size,e}))}})),a}},{key:"moovToSamples",value:function(e){var t=e.trak;if(t&&t.length){var i=t.find((function(e){var t,i;return"vide"===(null===(t=e.mdia)||void 0===t||null===(i=t.hdlr)||void 0===i?void 0:i.handlerType)})),r=t.find((function(e){var t,i;return"soun"===(null===(t=e.mdia)||void 0===t||null===(i=t.hdlr)||void 0===i?void 0:i.handlerType)}));if(i||r){var a,n;if(i){var s,o,c=null===(s=i.mdia)||void 0===s||null===(o=s.minf)||void 0===o?void 0:o.stbl;if(!c)return;var l=c.stts,u=c.stsc,d=c.stsz,h=c.stco,f=c.stss,p=c.ctts;if(!(l&&u&&d&&h&&f))return;a=jg(l,u,d,h,p,f)}if(r){var m,g,y,v=null===(m=r.mdia)||void 0===m||null===(g=m.minf)||void 0===g?void 0:g.stbl;if(!v)return;var b=null===(y=r.mdia.mdhd)||void 0===y?void 0:y.timescale,A=v.stts,k=v.stsc,_=v.stsz,w=v.stco;if(!(b&&A&&k&&_&&w))return;n=jg(A,k,_,w)}return{videoSamples:a,audioSamples:n}}}}}]),e}(),qg=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e),r.player=e,r.TAG_NAME="HlsFmp4Loader",r.tempSampleListInfo={},r.isInitVideo=!1,r.isInitAudio=!1,r.videoTrack={id:1,samples:[],sps:[],pps:[],vps:[],codec:""},r.audioTrack={id:2,samples:[],sampleRate:0,channelCount:0,codec:"",codecType:""},r.workerClearTimeout=null,r.workerUrl=null,r.loopWorker=null,r._hasCalcFps=!1,r._initLoopWorker(),e.debug.log(r.TAG_NAME,"init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){k(Object(b["a"])(i.prototype),"destroy",this).call(this),this.workerUrl&&(URL.revokeObjectURL(this.workerUrl),this.workerUrl=null),this.workerClearTimeout&&(clearTimeout(this.workerClearTimeout),this.workerClearTimeout=null),this.loopWorker&&(this.loopWorker.postMessage({cmd:"destroy"}),this.loopWorker.terminate(),this.loopWorker=null),this._hasCalcFps=!1,this.videoTrack=null,this.audioTrack=null,this.isInitVideo=!1,this.isInitAudio=!1,this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"demux",value:function(e,t){var i=this,r=this.audioTrack,a=this.videoTrack;if(this.checkInitAudio(),this.checkInitVideo(),r.samples=[],a.samples=[],t){if(an(this.isInitAudio)){var n=Wg.findBox(t,["moov"])[0];if(!n)return void this.player.debug.error(this.TAG_NAME,"cannot found moov box");Wg.moovToTrack(Wg.moov(n),null,r),this.checkInitAudio()&&(this.player.debug.log(this.TAG_NAME,"audioData audio init success"),this._sendAccADTSHeader(r))}var s=Wg.findBox(t,["moof"])[0];if(s){var o=Wg.moofToSamples(Wg.moof(s),null,r)[r.id],c=r.baseMediaDecodeTime;if(o){var l=s.start;o.map((function(e){e.offset+=l;var i=t.subarray(e.offset,e.offset+e.size),a=e.dts+c,n=new Uint8Array(i.length+2);n.set([175,1],0),n.set(i,2),r.samples.push({type:Me,pts:a,dts:a,payload:n,duration:e.duration,size:n.byteLength})}))}}}if(e){if(an(this.isInitVideo)&&an(this.isInitAudio)){var u=Wg.findBox(e,["moov"])[0];if(!u)throw new Error("cannot found moov box");if(Wg.moovToTrack(Wg.moov(u),a,r),an(this.isInitAudio)&&this.checkInitAudio()&&(this.player.debug.log(this.TAG_NAME,"videoData audio init success",r),this._sendAccADTSHeader(r)),this.checkInitVideo()){this.player.debug.log(this.TAG_NAME,"video init success");var d=null;a.codecType===Li?a.sps.length&&a.vps.length&&a.pps.length&&(d=Ls({sps:a.sps[0],pps:a.pps[0],vps:a.vps[0]})):a.sps.length&&a.pps.length&&(d=gs({sps:a.sps[0],pps:a.pps[0]})),d&&(this.player.debug.log(this.TAG_NAME,"seqHeader"),this._doDecodeByHls(d,Fe,0,!0,0))}}var h=Wg.findBox(e,["moof"])[0];if(h){var f=Wg.moofToSamples(Wg.moof(h),a,r),p=a.baseMediaDecodeTime,m=r.baseMediaDecodeTime,y=h.start;Object.keys(f).forEach((function(t){a.id==t?f[t].map((function(t){t.offset+=y;var i={type:Fe,pts:(t.pts||t.dts)+p,dts:t.dts+p,units:[],payload:null,isIFrame:!1};i.duration=t.duration,i.gopId=t.gopId,t.keyframe&&(i.isIFrame=!0);var r=e.subarray(t.offset,t.offset+t.size);i.payload=r,a.samples.push(i)})):r.id==t&&f[t].map((function(t){t.offset+=y;var i=e.subarray(t.offset,t.offset+t.size),a=t.dts+m,n=new Uint8Array(i.length+2);n.set([175,1],0),n.set(i,2),r.samples.push({type:Me,pts:a,dts:a,payload:n,duration:t.duration,size:n.byteLength})}))}))}}var v=a.samples.concat(r.samples);v.sort((function(e,t){return e.dts-t.dts})),v.forEach((function(e){var t=new Uint8Array(e.payload);delete e.payload,i.loopWorker.postMessage(Object(g["a"])(Object(g["a"])({},e),{},{payload:t,cmd:"sample"}),[t.buffer])})),an(this._hasCalcFps)&&(this._hasCalcFps=!0,this._calcDecodeFps(v))}},{key:"checkInitAudio",value:function(){return this.isInitAudio=!!(this.audioTrack.sampleRate&&this.audioTrack.channelCount&&this.audioTrack.codec&&"aac"===this.audioTrack.codecType),this.isInitAudio}},{key:"checkInitVideo",value:function(){return this.isInitVideo=!!(this.videoTrack.pps.length&&this.videoTrack.sps.length&&this.videoTrack.codec),this.isInitVideo}},{key:"_sendAccADTSHeader",value:function(e){var t=Mr({profile:e.objectType,sampleRate:e.sampleRateIndex,channel:e.channelCount});this._doDecodeByHls(t,Me,0,!0,0)}},{key:"_calcDecodeFps",value:function(e){var t=Ya(e.map((function(e){return{ts:e.dts||e.pts,type:e.type}})),Fe);t&&(this._basefps=t,this._postMessageToLoopWorker("updateBaseFps",{baseFps:this._basefps}),this.player.debug.log(this.TAG_NAME,"_calcDecodeFps() video fps is ".concat(t,", update base fps is ").concat(this._basefps)))}},{key:"_initLoopWorker",value:function(){var e=this,t=ln(function(){var e=new(function(){function e(){Object(T["a"])(this,e),this.baseFps=0,this.fpsInterval=null,this.preLoopTimestamp=null,this.startBpsTime=null,this.allSampleList=[]}return Object(S["a"])(e,[{key:"destroy",value:function(){this._clearInterval(),this.baseFps=0,this.allSampleList=[],this.preLoopTimestamp=null,this.startBpsTime=null}},{key:"updateBaseFps",value:function(e){this.baseFps=e,this._clearInterval(),this._startInterval()}},{key:"pushSample",value:function(e){delete e.cmd,this.allSampleList.push(e)}},{key:"_startInterval",value:function(){var e=this,t=Math.ceil(1e3/this.baseFps);this.fpsInterval=setInterval((function(){var i=(new Date).getTime();e.preLoopTimestamp||(e.preLoopTimestamp=i),e.startBpsTime||(e.startBpsTime=i);var r=i-e.preLoopTimestamp;r>2*t&&console.warn("JbPro:[TsLoader LoopWorker] loop interval is ".concat(r,"ms, more than ").concat(t," * 2ms")),e._loop(),e.preLoopTimestamp=(new Date).getTime(),e.startBpsTime&&i-e.startBpsTime>=1e3&&(e._calcSampleList(),e.startBpsTime=i)}),t)}},{key:"_clearInterval",value:function(){this.fpsInterval&&(clearInterval(this.fpsInterval),this.fpsInterval=null)}},{key:"_calcSampleList",value:function(){var e={buferredDuration:0,allListLength:this.allSampleList.length,audioListLength:0,videoListLength:0};this.allSampleList.forEach((function(t){2===t.type?(e.videoListLength++,t.duration&&(e.buferredDuration+=t.duration)):1===t.type&&e.audioListLength++})),postMessage(Object(g["a"])({cmd:"sampleListInfo"},e))}},{key:"_loop",value:function(){var e=null;if(this.allSampleList.length)if(e=this.allSampleList.shift(),2===e.type){postMessage(Object(g["a"])({cmd:"decodeVideo"},e),[e.payload.buffer]);for(var t=this.allSampleList[0];t&&1===t.type;)e=this.allSampleList.shift(),postMessage(Object(g["a"])({cmd:"decodeAudio"},e),[e.payload.buffer]),t=this.allSampleList[0]}else 1===e.type&&(postMessage(Object(g["a"])({cmd:"decodeAudio"},e),[e.payload.buffer]),this.allSampleList.length&&2===this.allSampleList[0].type&&(e=this.allSampleList.shift(),postMessage(Object(g["a"])({cmd:"decodeVideo"},e),[e.payload.buffer])))}}]),e}());self.onmessage=function(t){var i=t.data;switch(i.cmd){case"updateBaseFps":e.updateBaseFps(i.baseFps);break;case"sample":e.pushSample(i);break;case"destroy":e.destroy(),e=null}}}.toString()),i=new Blob([t],{type:"text/javascript"}),r=URL.createObjectURL(i),a=new Worker(r);this.workerUrl=r,this.workerClearTimeout=setTimeout((function(){window.URL.revokeObjectURL(e.workerUrl),e.workerUrl=null,e.workerClearTimeout=null}),ie),a.onmessage=function(t){var i=t.data;switch(i.cmd){case"decodeVideo":e._doDecodeVideo(i);break;case"decodeAudio":e._doDecodeAudio(i);break;case"sampleListInfo":e.tempSampleListInfo=i}},this.loopWorker=a}},{key:"_postMessageToLoopWorker",value:function(e,t){this.loopWorker?this.loopWorker.postMessage(Object(g["a"])({cmd:e},t)):this.player.debug.warn(this.TAG_NAME,"loop worker is not init, can not post message")}},{key:"_doDecodeAudio",value:function(e){var t=new Uint8Array(e.payload);this._doDecodeByHls(t,Me,e.dts,!1,0)}},{key:"_doDecodeVideo",value:function(e){var t=new Uint8Array(e.payload),i=null;i=e.isHevc?Ds(t,e.isIFrame):ys(t,e.isIFrame),this.player.updateStats({dts:e.dts});var r=e.pts-e.dts;this._doDecodeByHls(i,Fe,e.dts,e.isIFrame,r)}},{key:"getBuferredDuration",value:function(){return this.tempSampleListInfo.buferredDuration||0}},{key:"getSampleListLength",value:function(){return this.tempSampleListInfo.allListLength||0}},{key:"getSampleAudioListLength",value:function(){return this.tempSampleListInfo.audioListLength||0}},{key:"getSampleVideoListLength",value:function(){return this.tempSampleListInfo.videoListLength||0}}]),i}(Qs),Kg=function(){function e(t,i){Object(T["a"])(this,e),this.hls=t,this.player=this.hls.player,this.isMP4=i,this._initSegmentId="",this.TAG_NAME="HlsTransmuxer",this.hlsV2Mp4NotSupport=!1,this._demuxer=i?new qg(this.hls.player):new Rg(this.hls.player),this.player.debug.log(this.TAG_NAME,"init and isMP4 is ".concat(i))}return Object(S["a"])(e,[{key:"destroy",value:function(){this.hlsV2Mp4NotSupport=!1,this._demuxer&&(this._demuxer.destroy(),this._demuxer=null)}},{key:"transmux",value:function(e,t,i,r,a,n){this.player.debug.log(this.TAG_NAME,"transmux videoChunk:".concat(e&&e.byteLength,", audioChunk:").concat(t&&t.byteLength,", discontinuity:").concat(i,", contiguous:").concat(r,", startTime:").concat(a,", needInit:").concat(n));var s=this._demuxer;try{this.isMP4?s.demux(e,t):s.demuxAndFix(Sg(e,t),i,r,a)}catch(o){throw new $m(Xm,Qm,o)}}}]),e}(),Jg=function(){function e(t){Object(T["a"])(this,e),this.hls=t,this.player=t.player,this._decryptor=new Tg(this.hls,this.player),this._transmuxer=null,this._mse=null,this._softVideo=null,this._sourceCreated=!1,this._needInitSegment=!0,this._directAppend=!1,this.TAG_NAME="HlsBufferService"}return Object(S["a"])(e,[{key:"destroy",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:this._softVideo=null,this._transmuxer&&(this._transmuxer.destroy(),this._transmuxer=null);case 1:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"baseDts",get:function(){var e,t;return null===(e=this._transmuxer)||void 0===e||null===(t=e._demuxer)||void 0===t?void 0:t._baseDts}},{key:"nbSb",get:function(){return 0}},{key:"updateDuration",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:this.player.debug.log(this.TAG_NAME,"updateDuration()",t);case 1:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"getBuferredDuration",value:function(){var e,t;return null===(e=this._transmuxer)||void 0===e||null===(t=e._demuxer)||void 0===t?void 0:t.getBuferredDuration()}},{key:"getBufferedSegments",value:function(){var e,t;return null===(e=this._transmuxer)||void 0===e||null===(t=e._demuxer)||void 0===t?void 0:t.getSampleListLength()}},{key:"getBufferedAudioSegments",value:function(){var e,t;return null===(e=this._transmuxer)||void 0===e||null===(t=e._demuxer)||void 0===t?void 0:t.getSampleAudioListLength()}},{key:"getBufferedVideoSegments",value:function(){var e,t;return null===(e=this._transmuxer)||void 0===e||null===(t=e._demuxer)||void 0===t?void 0:t.getSampleVideoListLength()}},{key:"createSource",value:function(e,t,i,r){if(!this._sourceCreated){var a=e||t;a&&(Rg.probe(a)?this._transmuxer||(this._transmuxer=new Kg(this.hls,!1)):Wg.probe(a)?this._transmuxer||(this._transmuxer=new Kg(this.hls,!0)):this.player.debug.error(this.TAG_NAME,"createSource error: chunk is not ts"))}}},{key:"appendBuffer",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t,i,r,a,n,s,o){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!(null!=r&&r.length||null!=a&&a.length)){e.next=2;break}return e.abrupt("return",(this._needInitSegment,this._transmuxer.transmux(r,a,n,s,o,this._needInitSegment||n),!0));case 2:case"end":return e.stop()}}),e,this)})));function t(t,i,r,a,n,s,o){return e.apply(this,arguments)}return t}()},{key:"clearAllBuffer",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:this.player.debug.log(this.TAG_NAME,"clearAllBuffer");case 1:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"decryptBuffer",value:function(e,t){return this._decryptor.decrypt(e,t)}},{key:"reset",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:this._transmuxer=null,this._needInitSegment=!0,this._directAppend=!1;case 1:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"endOfStream",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:this._softVideo&&this._softVideo.endOfStream();case 1:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"setLiveSeekableRange",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t,i){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)})));function t(t,i){return e.apply(this,arguments)}return t}()},{key:"seamlessSwitch",value:function(){this._needInitSegment=!0}}]),e}(),Yg=function(){function e(t){var i=this;Object(T["a"])(this,e),this.emitter=t,this._seiSet=new Set,t.on(kr,(function(e){e&&i._seiSet.add(e)}))}return Object(S["a"])(e,[{key:"throw",value:function(e){var t=this;if(null!=e&&this._seiSet.size){var i=e-.2,r=e+.2,a=[];this._seiSet.forEach((function(e){e.time>=i&&e.time<=r&&a.push(e)})),a.forEach((function(e){t._seiSet["delete"](e),t.emitter.emit(_r,e)}))}}},{key:"reset",value:function(){this._seiSet.clear()}}]),e}(),Qg=function(){function e(t){Object(T["a"])(this,e),this._timescale=t,this.encodeType="",this.audioCodec="",this.videoCodec="",this.domain="",this.fps=0,this.bitrate=0,this.width=0,this.height=0,this.samplerate=0,this.channelCount=0,this.gop=0,this._bitsAccumulateSize=0,this._bitsAccumulateDuration=0}return Object(S["a"])(e,[{key:"getStats",value:function(){return{encodeType:this.encodeType,audioCodec:this.audioCodec,videoCodec:this.videoCodec,domain:this.domain,fps:this.fps,bitrate:this.bitrate,width:this.width,height:this.height,samplerate:this.samplerate,channelCount:this.channelCount,gop:this.gop}}},{key:"setEncodeType",value:function(e){this.encodeType=e}},{key:"setFpsFromScriptData",value:function(e){var t,i=e.data,r=null==i||null===(t=i.onMetaData)||void 0===t?void 0:t.framerate;r&&r>0&&r<100&&(this.fps=r)}},{key:"setVideoMeta",value:function(e){if(this.width=e.width,this.height=e.height,this.videoCodec=e.codec,this.encodeType=e.codecType,e.fpsNum&&e.fpsDen){var t=e.fpsNum/e.fpsDen;t>0&&t<100&&(this.fps=t)}}},{key:"setAudioMeta",value:function(e){this.audioCodec=e.codec,this.samplerate=e.sampleRate,this.channelCount=e.channelCount}},{key:"setDomain",value:function(e){this.domain=e.split("/").slice(2,3)[0]}},{key:"updateBitrate",value:function(e){var t=this;if((!this.fps||this.fps>=100)&&e.length){var i=e.reduce((function(e,t){return e+t.duration}),0)/e.length;this.fps=Math.round(this._timescale/i)}e.forEach((function(e){1===e.gopId&&t.gop++,t._bitsAccumulateDuration+=e.duration/(t._timescale/1e3),t._bitsAccumulateSize+=e.units.reduce((function(e,t){return e+t.length}),0),t._bitsAccumulateDuration>=1e3&&(t.bitrate=8*t._bitsAccumulateSize,t._bitsAccumulateDuration=0,t._bitsAccumulateSize=0)}))}}]),e}(),Xg=function(){function e(t){Object(T["a"])(this,e);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;xc(this,"_core",null),xc(this,"_samples",[]),this._core=t,this._timescale=i,this._stats=new Qg(i),this._bindEvents()}return Object(S["a"])(e,[{key:"getStats",value:function(){var e,t,i,r,a,n,s,o=(null===(e=this._core)||void 0===e?void 0:e.media)||{},c=o.currentTime,l=void 0===c?0:c,u=o.decodeFps,d=void 0===u?0:u;return Object(g["a"])(Object(g["a"])({},this._stats.getStats()),{},{downloadSpeed:(null===(t=this._core)||void 0===t||null===(i=t.speedInfo)||void 0===i?void 0:i.call(t).speed)||0,avgSpeed:(null===(r=this._core)||void 0===r||null===(a=r.speedInfo)||void 0===a?void 0:a.call(r).avgSpeed)||0,currentTime:l,bufferEnd:(null===(n=this._core)||void 0===n||null===(s=n.bufferInfo())||void 0===s?void 0:s.remaining)||0,decodeFps:d})}},{key:"_bindEvents",value:function(){var e=this;this._core.on(hr,(function(t){return e._stats.updateBitrate(t.samples)})),this._core.on(fr,(function(t){e._stats.setFpsFromScriptData(t)})),this._core.on(pr,(function(t){"video"===t.type?e._stats.setVideoMeta(t.track):e._stats.setAudioMeta(t.track)})),this._core.on(mr,(function(t){e._stats.setDomain(t.responseUrl)}))}},{key:"reset",value:function(){this._samples=[],this._stats=new Qg(this._timescale)}}]),e}(),$g=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;Object(T["a"])(this,i);var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r=t.call(this),xc(Object(v["a"])(r),"_loadSegment",Object(o["a"])(regeneratorRuntime.mark((function e(){var t,i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(r.player.debug.log(r.TAG_NAME,"_loadSegment()","_segmentProcessing",r._segmentProcessing),!r._segmentProcessing){e.next=2;break}return e.abrupt("return",void r.player.debug.warn("_loadSegment()","_segmentProcessing is ture and return"));case 2:if(t=r._playlist.currentSegment,i=r._playlist.nextSegment,r.player.debug.log(r.TAG_NAME,"_loadSegment()","curSeg",t,"nextSeg",i),!i){e.next=5;break}return e.abrupt("return",r._loadSegmentDirect());case 5:r.player.debug.log(r.TAG_NAME,"nextSeg is null and return");case 6:case"end":return e.stop()}}),e)})))),r.player=e,r.config=null,r._manifestLoader=null,r._segmentLoader=null,r._playlist=null,r._bufferService=null,r._seiService=null,r._stats=null,r._prevSegSn=null,r._prevSegCc=null,r._tickTimer=null,r._tickInterval=500,r._segmentProcessing=!1,r._reloadOnPlay=!1,r._switchUrlOpts=null,r._disconnectTimer=null,r.TAG_NAME="Hls256",r.canVideoPlay=!1,r.$videoElement=null,r.config=a=function(e){return Object(g["a"])({isLive:!0,maxPlaylistSize:50,retryCount:3,retryDelay:1e3,pollRetryCount:2,loadTimeout:1e4,preloadTime:30,softDecode:!1,bufferBehind:10,maxJumpDistance:3,startTime:0,targetLatency:10,maxLatency:20,allowedStreamTrackChange:!0},e)}(a),r._manifestLoader=new bg(Object(v["a"])(r)),r._segmentLoader=new kg(Object(v["a"])(r)),r._playlist=new wg(Object(v["a"])(r)),r._bufferService=new Jg(Object(v["a"])(r)),r._seiService=new Yg(Object(v["a"])(r)),r._stats=new Xg(Object(v["a"])(r),9e4),r.player.debug.log(r.TAG_NAME,"init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.player.debug.log(this.TAG_NAME,"destroy()"),this._playlist.reset(),this._segmentLoader.reset(),this._seiService.reset(),e.next=6,Promise.all([this._clear(),this._bufferService.destroy()]);case 6:if(e.t0=this._manifestLoader,!e.t0){e.next=11;break}return e.next=10,this._manifestLoader.destroy();case 10:this._manifestLoader=null;case 11:this._segmentLoader&&(this._segmentLoader.destroy(),this._segmentLoader=null),this._playlist&&(this._playlist.destroy(),this._playlist=null),this.player.debug.log(this.TAG_NAME,"destroy end");case 14:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"_startTick",value:function(){var e=this;this._stopTick(),this._tickTimer=setTimeout((function(){e._tick()}),this._tickInterval)}},{key:"_stopTick",value:function(){this._tickTimer&&clearTimeout(this._tickTimer),this._tickTimer=null}},{key:"_tick",value:function(){this._startTick(),this._loadSegment()}},{key:"isLive",get:function(){return this._playlist.isLive}},{key:"streams",get:function(){return this._playlist.streams}},{key:"currentStream",get:function(){return this._playlist.currentStream}},{key:"hasSubtitle",get:function(){return this._playlist.hasSubtitle}},{key:"baseDts",get:function(){var e;return null===(e=this._bufferService)||void 0===e?void 0:e.baseDts}},{key:"speedInfo",value:function(){return this._segmentLoader.speedInfo()}},{key:"getStats",value:function(){return this._stats.getStats()}},{key:"loadSource",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.player.debug.log(this.TAG_NAME,"loadSource() ".concat(t)),e.next=3,this._reset();case 3:return e.next=5,this._loadData(t);case 5:return this._startTick(),e.abrupt("return",!0);case 7:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"_loadData",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t){var i,r,a,n,s,o,c,l;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:this.player.debug.log(this.TAG_NAME,"_loadData() ".concat(t));try{t&&(t=t.trim())}catch(u){}if(t){e.next=4;break}throw this._emitError(new $m(Jm,Jm,null,null,"m3u8 url is missing"));case 4:return e.next=6,this._loadM3U8(t);case 6:if(i=e.sent,r=this._playlist.currentStream,this._urlSwitching&&(0===r.bitrate&&null!==(a=this._switchUrlOpts)&&void 0!==a&&a.bitrate&&(r.bitrate=null===(n=this._switchUrlOpts)||void 0===n?void 0:n.bitrate),s=this._getSeamlessSwitchPoint(),this.config.startTime=s,o=this._playlist.findSegmentIndexByTime(s),c=this._playlist.getSegmentByIndex(o+1),c&&(l=c.start,this.player.debug.warn(this.TAG_NAME,"clear buffer from ".concat(l)))),e.t0=i,!e.t0){e.next=18;break}if(!this.isLive){e.next=15;break}this.player.debug.log(this.TAG_NAME,"is live"),this._bufferService.setLiveSeekableRange(0,4294967295),this.config.targetLatency<this._playlist.totalDuration&&(this.config.targetLatency=this._playlist.totalDuration,this.config.maxLatency=1.5*this.config.targetLatency),i.isMaster||this._pollM3U8(t),e.next=18;break;case 15:return this.player.debug.log(this.TAG_NAME,"is vod and totalDuration is ".concat(r.totalDuration," s")),e.next=18,this._bufferService.updateDuration(r.totalDuration);case 18:return e.next=20,this._loadSegment();case 20:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"_loadM3U8",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t){var i,r,a,n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.player.debug.log(this.TAG_NAME,"load m3u8: ".concat(t)),e.prev=1,e.next=4,this._manifestLoader.load(t);case 4:r=e.sent,a=h(r,1),i=a[0],e.next=12;break;case 9:throw e.prev=9,e.t0=e["catch"](1),this._emitError($m.create(e.t0));case 12:if(!i){e.next=23;break}if(this._playlist.upsertPlaylist(i),!i.isMaster){e.next=20;break}return null!==(n=this._playlist.currentStream.subtitleStreams)&&void 0!==n&&n.length&&this.emit(Tr,{list:this._playlist.currentStream.subtitleStreams}),e.next=18,this._refreshM3U8();case 18:e.next=21;break;case 20:this.player.debug.warn(this.TAG_NAME,"_loadM3U8() is not master playlist");case 21:return this.emit(Er),e.abrupt("return",i);case 23:this.player.debug.warn(this.TAG_NAME,"_loadM3U8() playlist is empty");case 24:case"end":return e.stop()}}),e,this,[[1,9]])})));function t(t){return e.apply(this,arguments)}return t}()},{key:"_refreshM3U8",value:function(){var e,t,i=this;this.player.debug.log(this.TAG_NAME,"_refreshM3U8()");var r=this._playlist.currentStream;if(!r||!r.url)throw this._emitError($m.create(null,null,new Error("m3u8 url is not defined")));var a=r.url,n=null===(e=r.currentAudioStream)||void 0===e?void 0:e.url,s=null===(t=r.currentSubtitleStream)||void 0===t?void 0:t.url;return this._manifestLoader.load(a,n,s).then((function(e){var t=h(e,3),r=t[0],o=t[1],c=t[2];r?(i._playlist.upsertPlaylist(r,o,c),i.isLive&&i._pollM3U8(a,n,s)):i.player.debug.warn(i.TAG_NAME,"_refreshM3U8() mediaPlaylist is empty")}))["catch"]((function(e){throw i._emitError($m.create(e))}))}},{key:"_pollM3U8",value:function(e,t,i){var r,a=this,n=this._playlist.isEmpty;this._manifestLoader.poll(e,t,i,(function(e,t,i){a._playlist.upsertPlaylist(e,t,i),a._playlist.clearOldSegment(),e&&n&&!a._playlist.isEmpty&&a._loadSegment(),n&&(n=a._playlist.isEmpty)}),(function(e){a._emitError($m.create(e))}),1e3*((null===(r=this._playlist.lastSegment)||void 0===r?void 0:r.duration)||0))}},{key:"_loadSegmentDirect",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){var t,i,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this.player.debug.log(this.TAG_NAME,"_loadSegmentDirect()"),t=this._playlist.nextSegment,t){e.next=4;break}return e.abrupt("return",void this.player.debug.log(this.TAG_NAME,"_loadSegmentDirect() !seg"));case 4:return i=!1,r=null,e.prev=5,this._segmentProcessing=!0,e.next=9,this._reqAndBufferSegment(t,this._playlist.getAudioSegment(t));case 9:i=e.sent,e.next=15;break;case 12:e.prev=12,e.t0=e["catch"](5),r=e.t0;case 15:return e.prev=15,this._segmentProcessing=!1,e.finish(15);case 18:return e.abrupt("return",r?this._emitError($m.create(r)):(i?(this._urlSwitching&&(this._urlSwitching=!1,this.emit(Sr,{url:this.config.url})),this._playlist.moveSegmentPointer(),this.player.debug.log(this.TAG_NAME,"_loadSegmentDirect()","seg.isLast",t.isLast),t.isLast?(this.player.debug.log(this.TAG_NAME,"_loadSegmentDirect()","seg.isLast"),this._end()):(this.player.debug.log(this.TAG_NAME,"_loadSegmentDirect()","and next _loadSegment()"),this._loadSegment())):this.player.debug.log(this.TAG_NAME,"_loadSegmentDirect() not appended"),i));case 19:case"end":return e.stop()}}),e,this,[[5,12,15,18]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"_reqAndBufferSegment",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t,i){var r,a,n,s,o,c,l,u;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.player.debug.log(this.TAG_NAME,"video seg",t&&t.url,"audio seg",i&&i.url),a=t?t.cc:i.cc,n=this._prevSegCc!==a,s=[],e.prev=3,e.next=6,this._segmentLoader.load(t,i,n);case 6:s=e.sent,e.next=12;break;case 9:throw e.prev=9,e.t0=e["catch"](3),e.t0.fatal=!1,this._segmentLoader.error=e.t0,e.t0;case 12:if(s[0]){e.next=14;break}return e.abrupt("return");case 14:return e.next=16,(r=this._bufferService).decryptBuffer.apply(r,Object(m["a"])(s));case 16:if(o=e.sent,o){e.next=19;break}return e.abrupt("return",void this.player.debug.log(this.TAG_NAME,"decryptBuffer return null"));case 19:return c=t?t.sn:i.sn,l=t?t.start:i.start,u=this._playlist.currentStream,this._bufferService.createSource(o[0],o[1],null==u?void 0:u.videoCodec,null==u?void 0:u.audioCodec),e.next=23,this._bufferService.appendBuffer(t,i,o[0],o[1],n,this._prevSegSn===c-1,l);case 23:return this._prevSegCc=a,this._prevSegSn=c,e.abrupt("return",!0);case 26:case"end":return e.stop()}}),e,this,[[3,9]])})));function t(t,i){return e.apply(this,arguments)}return t}()},{key:"_clear",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.player.debug.log(this.TAG_NAME,"_clear()"),clearTimeout(this._disconnectTimer),this._stopTick(),e.next=5,Promise.all([this._segmentLoader.cancel(),this._manifestLoader.stopPoll()]);case 5:this._segmentProcessing=!1;case 6:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"_reset",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){var t,i=arguments;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=i.length>0&&void 0!==i[0]&&i[0],this.player.debug.log(this.TAG_NAME,"_reset()"),this._reloadOnPlay=!1,this._prevSegSn=null,this._prevSegCc=null,this._switchUrlOpts=null,this._playlist.reset(),this._segmentLoader.reset(),this._seiService.reset(),this._stats.reset(),e.next=12,this._clear();case 12:return e.abrupt("return",this._bufferService.reset(t));case 13:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"_end",value:function(){this.player.debug.log(this.TAG_NAME,"_end()"),this._clear()}},{key:"_emitError",value:function(e){var t,i,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!1===(null===(t=e.originError)||void 0===t?void 0:t.fatal)?console.warn(e):(console.table(e),console.error(e),console.error(null===(i=this.media)||void 0===i?void 0:i.error),this._stopTick(),this._urlSwitching&&(this._urlSwitching=!1,this.emit(wr,e)),r&&this._end(),this._seiService.reset(),this.emit(xr,e)),e}},{key:"_getSeamlessSwitchPoint",value:function(){var e=this.media,t=e.currentTime;if(!e.paused){var i,r=this._playlist.findSegmentIndexByTime(e.currentTime),a=this._playlist.getSegmentByIndex(r),n=null===(i=this._stats)||void 0===i?void 0:i.getStats().downloadSpeed;t+=n&&a?a.duration*this._playlist.currentStream.bitrate/n+1:5}return t}},{key:"getDemuxBuferredDuration",value:function(){return this._bufferService.getBuferredDuration()||0}},{key:"getDemuxBufferedListLength",value:function(){return this._bufferService.getBufferedSegments()||0}},{key:"getDemuxAudioBufferedListLength",value:function(){return this._bufferService.getBufferedAudioSegments()||0}},{key:"getDemuxVideoBufferedListLength",value:function(){return this._bufferService.getBufferedVideoSegments()||0}}]),i}(fn),Zg=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this),xc(Object(v["a"])(r),"TAG_NAME","Hls256Decoder"),r.player=e,r.canVideoPlay=!1,r.$videoElement=r.player.video.$videoElement,r.hls=null,r.eventsDestroy=[],r.bandwidthEstimateInterval=null,Ha()?r.canVideoPlay=!0:(r.hls=new $g(e),r._bindEvents()),r}return Object(S["a"])(i,[{key:"destroy",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this._stopBandwidthEstimateInterval(),e.t0=this.hls,!e.t0){e.next=6;break}return e.next=5,this.hls.destroy();case 5:this.hls=null;case 6:return this.eventsDestroy.length&&(this.eventsDestroy.forEach((function(e){return e()})),this.eventsDestroy=[]),this.$videoElement=null,this.player.debug.log(this.TAG_NAME,"destroy"),e.abrupt("return",!0);case 10:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"_bindEvents",value:function(){var e=this;this.hls.on(xr,(function(t){e.player.emitError(nt.hlsError,t)})),this._startBandwidthEstimateInterval()}},{key:"_startBandwidthEstimateInterval",value:function(){var e=this;this._stopBandwidthEstimateInterval(),this.bandwidthEstimateInterval=setInterval((function(){var t=e.hls.speedInfo();e.player.emit(it.kBps,(t.avgSpeed/1024/8).toFixed(2))}),1e3)}},{key:"_stopBandwidthEstimateInterval",value:function(){this.bandwidthEstimateInterval&&(clearInterval(this.bandwidthEstimateInterval),this.bandwidthEstimateInterval=null)}},{key:"initVideoPlay",value:function(e){this.$videoElement.muted=!0,this.$videoElement.src=e}},{key:"loadSource",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this.player.debug.log(this.TAG_NAME,"loadSource() ".concat(t)),this.url=t,!this.canVideoPlay){e.next=6;break}this.initVideoPlay(t),e.next=8;break;case 6:return e.next=8,this.hls.loadSource(t);case 8:return e.abrupt("return",!0);case 9:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"checkHlsBufferedDelay",value:function(){var e=0;return this.hls&&(e=this.hls.getDemuxBuferredDuration()),e}},{key:"getDemuxBufferedListLength",value:function(){var e=0;return this.hls&&(e=this.hls.getDemuxBufferedListLength()),e}},{key:"getDemuxAudioBufferedListLength",value:function(){var e=0;return this.hls&&(e=this.hls.getDemuxAudioBufferedListLength()),e}},{key:"getDemuxVideoBufferedListLength",value:function(){var e=0;return this.hls&&(e=this.hls.getDemuxVideoBufferedListLength()),e}}]),i}(fn),ey=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this),r.player=e,r.TAG_NAME="CommonWebrtc",r.rtcPeerConnection=null,r.videoStream=null,r.isDisconnected=!1,r.isH264=r.player.isWebrtcH264(),r.eventsDestroy=[],r.supportVideoFrameCallbackHandle=null,r.isInitInfo=!1,r.$videoElement=r.player.video.$videoElement,r.player._opt.webrtcUseCanvasRender&&r.isH264&&(r.$videoElement=document.createElement("video"),ua()&&(r.$videoElement.style.position="absolute"),r._initVideoEvents()),r.$videoElement.muted=!0,r._initRtcPeerConnection(),r}return Object(S["a"])(i,[{key:"destroy",value:function(){this.isDisconnected=!1,this.isInitInfo=!1,this.supportVideoFrameCallbackHandle&&this.$videoElement&&(this.$videoElement.cancelVideoFrameCallback(this.supportVideoFrameCallbackHandle),this.supportVideoFrameCallbackHandle=null),this.eventsDestroy.length&&(this.eventsDestroy.forEach((function(e){return e()})),this.eventsDestroy=[]),this.isH264&&(this.videoStream&&(this.videoStream.getTracks().forEach((function(e){return e.stop()})),this.videoStream=null),this.$videoElement.srcObject=null),this.rtcPeerConnection&&(this.rtcPeerConnection.onicecandidate=Jr,this.rtcPeerConnection.ontrack=Jr,this.rtcPeerConnection.onconnectionstatechange=Jr,this.rtcPeerConnection.ondatachannel=Jr,this.rtcPeerConnection.close(),this.rtcPeerConnection=null)}},{key:"_initVideoEvents",value:function(){var e=this,t=this.player.events.proxy,i=t(this.$videoElement,Ei,(function(){e.player.debug.log(e.TAG_NAME,"video canplay"),e.$videoElement.play().then((function(){e.player.debug.log(e.TAG_NAME,"video play"),e._startCanvasRender(),e._initRenderSize()}))["catch"]((function(t){e.player.debug.warn(e.TAG_NAME,"video play error ",t)}))})),r=t(this.$videoElement,xi,(function(){e.player.debug.log("HlsDecoder","video waiting")})),a=t(this.$videoElement,Ci,(function(t){var i=parseInt(t.timeStamp,10);e.player.handleRender(),e.player.updateStats({ts:i}),e.$videoElement.paused&&(e.player.debug.warn("HlsDecoder","video is paused and next try to replay"),e.$videoElement.play().then((function(){e.player.debug.log("HlsDecoder","video is paused and replay success")}))["catch"]((function(t){e.player.debug.warn("HlsDecoder","video is paused and replay error ",t)})))})),n=t(this.$videoElement,Ri,(function(){e.player.debug.log("HlsDecoder","video playback Rate change",e.$videoElement&&e.$videoElement.playbackRate)}));this.eventsDestroy.push(i,r,a,n)}},{key:"_initRtcPeerConnection",value:function(){var e=this,t=new RTCPeerConnection,i=this.player;t.addTransceiver("video",{direction:"recvonly"}),t.addTransceiver("audio",{direction:"recvonly"}),t.onsignalingstatechange=function(t){e.player.debug.log(e.TAG_NAME,"onsignalingstatechange",t)},t.oniceconnectionstatechange=function(r){e.player.debug.log(e.TAG_NAME,"oniceconnectionstatechange",t.iceConnectionState);var a=t.iceConnectionState;switch(e.player.emit(it.webrtcOnIceConnectionStateChange,a),e.isDisconnected="disconnected"===a,t.iceConnectionState){case"new":case"checking":case"closed":case"connected":case"completed":break;case"failed":i.emit(it.webrtcFailed);break;case"disconnected":i.emit(it.webrtcDisconnect);break;case"closed":i.emit(it.webrtcClosed)}},t.onicecandidate=function(t){e.player.debug.log(e.TAG_NAME,"onicecandidate",t),t.candidate&&e.player.debug.log(e.TAG_NAME,"Remote ICE candidate: ",t.candidate.candidate)},t.ontrack=function(t){if(e.player.debug.log(e.TAG_NAME,"ontrack",t),"video"===t.track.kind){e.player.debug.log(e.TAG_NAME,"ontrack audio");var i=t.streams[0];e.$videoElement.autoplay=!0,e.$videoElement.srcObject=i,e.videoStream=i}},t.onicecandidateerror=function(t){e.player.debug.log(e.TAG_NAME,"onicecandidateerror",t),e.player.emitError(nt.webrtcIceCandidateError,t)},t.onconnectionstatechange=function(r){switch(e.player.debug.log(e.TAG_NAME,"onconnectionstatechange",r),e.player.emit(it.webrtcOnConnectionStateChange,t.connectionState),t.connectionState){case"new":case"connecting":case"connected":case"disconnected":break;case"failed":e.isDisconnected&&i.emit(it.webrtcFailed)}},this.rtcPeerConnection=t}},{key:"_startCanvasRender",value:function(){var e=this;un()?this.supportVideoFrameCallbackHandle=this.$videoElement.requestVideoFrameCallback(this.videoFrameCallback.bind(this)):(this._stopCanvasRender(),this.canvasRenderInterval=setInterval((function(){e.player.video.render({$video:e.$videoElement,ts:0})}),40))}},{key:"_stopCanvasRender",value:function(){this.canvasRenderInterval&&(clearInterval(this.canvasRenderInterval),this.canvasRenderInterval=null)}},{key:"videoFrameCallback",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.player.isDestroyed()?this.player.debug.log(this.TAG_NAME,"videoFrameCallback() player is destroyed"):(this.player.video.render({$video:this.$videoElement,ts:t.mediaTime||0}),this.player.updateStats({dts:t.mediaTime||0}),this.supportVideoFrameCallbackHandle=this.$videoElement.requestVideoFrameCallback(this.videoFrameCallback.bind(this)))}},{key:"_initRenderSize",value:function(){this.isInitInfo||(this.player.video.updateVideoInfo({width:this.$videoElement.videoWidth,height:this.$videoElement.videoHeight}),this.player.video.initCanvasViewSize(),this.isInitInfo=!0)}}]),i}(fn),ty=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e),r.rtcPeerConnectionDataChannel=null,r.player.isWebrtcH265()&&(r.streamRate=ra((function(t){e.emit(it.kBps,(t/1024).toFixed(2))}))),r.TAG_NAME="WebrtcDecoder",r.player.debug.log(r.TAG_NAME,"init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){k(Object(b["a"])(i.prototype),"destroy",this).call(this),this.stopStreamRateInterval(),this.rtcPeerConnectionDataChannel&&(this.rtcPeerConnectionDataChannel.onopen=Jr,this.rtcPeerConnectionDataChannel.onclose=Jr,this.rtcPeerConnectionDataChannel.onmessage=Jr,this.rtcPeerConnectionDataChannel.close(),this.rtcPeerConnectionDataChannel=null),this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"_initRtcPeerConnection",value:function(){var e=this,t=new RTCPeerConnection,i=this.player;t.addTransceiver("video",{direction:"recvonly"}),t.addTransceiver("audio",{direction:"recvonly"}),t.onsignalingstatechange=function(t){e.player.debug.log(e.TAG_NAME,"onsignalingstatechange",t)},t.oniceconnectionstatechange=function(r){e.player.debug.log(e.TAG_NAME,"oniceconnectionstatechange",t.iceConnectionState);var a=t.iceConnectionState;switch(e.player.emit(it.webrtcOnIceConnectionStateChange,a),e.isDisconnected="disconnected"===a,t.iceConnectionState){case"new":case"checking":case"closed":case"connected":case"completed":break;case"failed":i.emit(it.webrtcFailed);break;case"disconnected":i.emit(it.webrtcDisconnect);break;case"closed":i.emit(it.webrtcClosed)}},t.onicecandidate=function(t){e.player.debug.log(e.TAG_NAME,"onicecandidate",t),t.candidate&&e.player.debug.log(e.TAG_NAME,"Remote ICE candidate: ",t.candidate.candidate)},t.ontrack=function(t){e.player.debug.log(e.TAG_NAME,"ontrack",t);var r=i.video.$videoElement;if("video"===t.track.kind&&i.isWebrtcH264()){var a=t.streams[0];r.autoplay=!0,r.srcObject=a,e.videoStream=a}},t.onicecandidateerror=function(t){e.player.debug.log(e.TAG_NAME,"onicecandidateerror",t),e.player.emitError(nt.webrtcIceCandidateError,t)},t.onconnectionstatechange=function(r){switch(i.debug.log(e.TAG_NAME,"sdp connect status ".concat(t.connectionState)),t.connectionState){case"new":case"connecting":case"connected":case"disconnected":break;case"failed":e.isDisconnected&&i.emit(it.webrtcFailed)}},t.ondatachannel=function(t){var i=t.channel;e.player.debug.log(e.TAG_NAME,"ondatachannel"),i.onopen=function(){e.player.debug.log(e.TAG_NAME,"ondatachannel and onopen")},i.onmessage=function(t){var i=t.data;if(e.player.isWebrtcH264())return e.player.debug.warn(e.TAG_NAME,"ondatachannel is H265 but decode is h264 so emit webrtcStreamH265 "),void e.player.emit(it.webrtcStreamH265);e.player.isDestroyed()?e.player.debug.warn(e.TAG_NAME,"ondatachannel and player is destroyed"):(e.streamRate&&e.streamRate(i.byteLength),e.player.demux&&e.player.demux.dispatch(i))},i.onclose=function(){e.player.debug.warn(e.TAG_NAME,"ondatachannel and onclose")},e.rtcPeerConnectionDataChannel=i},t.createDataChannel("signal").onmessage=function(t){e.player.debug.log(e.TAG_NAME,"signalChannel,onmessage",t),JSON.parse(t.data).type},this.rtcPeerConnection=t}},{key:"startStreamRateInterval",value:function(){var e=this;this.stopStreamRateInterval(),this.streamRateInterval=setInterval((function(){e.streamRate&&e.streamRate(0)}),1e3)}},{key:"stopStreamRateInterval",value:function(){this.streamRateInterval&&(clearInterval(this.streamRateInterval),this.streamRateInterval=null)}},{key:"loadSource",value:function(e){var t=this;return new Promise((function(i,r){var a=t.rtcPeerConnection;a.createOffer().then((function(n){a.setLocalDescription(n),t.player.debug.log(t.TAG_NAME,"getWebRtcRemoteSdp loadSource"),function(e,t){return fetch(e,{method:"POST",mode:"cors",cache:"no-cache",credentials:"include",redirect:"follow",referrerPolicy:"no-referrer",headers:{"Content-Type":"application/sdp"},body:t})}(e,n.sdp).then((function(e){e.text().then((function(e){t.player.debug.log(t.TAG_NAME,"getWebRtcRemoteSdp response"),a.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:e})).then((function(){t.player.isWebrtcH265()&&t.startStreamRateInterval(),i()}))["catch"]((function(e){r(e)}))}))["catch"]((function(e){t.player.debug.error(t.TAG_NAME,"loadSource response.text() error",e),r(e)}))}))["catch"]((function(e){t.player.debug.error(t.TAG_NAME,"loadSource getWebRtcRemoteSdp response error",e),r(e)}))}))["catch"]((function(e){t.player.debug.error(t.TAG_NAME,"loadSource rtcPeerConnection.createOffer() error",e),r(e)}))}))}}]),i}(ey),iy=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e),r.TAG_NAME="WebrtcForZLMDecoder",r.player.debug.log(r.TAG_NAME,"init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){k(Object(b["a"])(i.prototype),"destroy",this).call(this),this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"loadSource",value:function(e){var t=this;return new Promise((function(i,r){var a=t.rtcPeerConnection;a.createOffer().then((function(n){a.setLocalDescription(n),t.player.debug.log(t.TAG_NAME,"getWebRtcRemoteSdp loadSource"),function(e,t){return mo({url:e,type:"POST",data:t,contentType:"text/plain;charset=utf-8",processData:!1,dataType:"json"})}(e,n.sdp).then((function(e){t.player.debug.log(t.TAG_NAME,"getWebRtcRemoteSdp response and code is ".concat(e.code));var n=e;if(0!==n.code)return r(n.msg);a.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:n.sdp})).then((function(){i()}))["catch"]((function(e){r(e)}))}))["catch"]((function(e){t.player.debug.error(t.TAG_NAME,"loadSource getWebRtcRemoteSdp response error",e),r(e)}))}))["catch"]((function(e){t.player.debug.error(t.TAG_NAME,"loadSource rtcPeerConnection.createOffer() error",e),r(e)}))}))}}]),i}(ey),ry=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e,r){var n;if(Object(T["a"])(this,i),n=t.call(this),n.player=e,n.player.$container.classList.add("jessibuca-container-playback"),n._showPrecision=null,n._startTime=null,n._playStartTime=null,n._playingTimestamp=null,n._fps=parseInt(r.fps,10)||e._opt.playbackFps,n._isUseFpsRender=!!rn(r.isUseFpsRender),n._rate=1,n._audioTimestamp=0,n._videoTimestamp=0,n.controlType=r.controlType||$.normal,r.controlType&&-1===[$.normal,$.simple].indexOf(r.controlType)&&(n.player.debug.warn("Playback","constructor()","controlType is not in [normal,simple]",r.controlType),n.controlType=$.normal),n._currentLocalTimestamp=0,n._localOneFrameTimestamp=r.localOneFrameTimestamp||40,n._localCalculateTimeInterval=null,n._isUseLocalCalculateTime=!!rn(r.isUseLocalCalculateTime),n._isPlaybackPauseClearCache=!an(r.isPlaybackPauseClearCache),n._isCacheBeforeDecodeForFpsRender=!!rn(r.isCacheBeforeDecodeForFpsRender),n._startfpsTime=null,n._startFpsTimestamp=null,n._checkStatsInterval=null,n._playbackTs=0,n._renderFps=0,n._isUseLocalCalculateTime?n._startLocalCalculateTime():n._listen(),n.playbackList=[],n._playbackListStartTimestamp=null,n._totalDuration=0,r.controlType===$.normal)n.initPlaybackList(r.playList,r.showPrecision,r.startTime);else if(r.controlType===$.simple){r.duration&&(n._totalDuration=1e3*r.duration);var s=r.startTime||0;s>n.totalDuration&&(s=n.totalDuration),n.setStartTime(s)}n.player.on(it.playbackPause,(function(e){e?n.pause():n.resume()}));var o={fps:n._fps,isUseFpsRender:n._isUseFpsRender,localOneFrameTimestamp:n._localOneFrameTimestamp,isUseLocalCalculateTime:n._isUseLocalCalculateTime,uiUsePlaybackPause:r.uiUsePlaybackPause,showControl:r.showControl};return e.debug.log("Playback","init",JSON.stringify(o)),Object(a["a"])(n)}return Object(S["a"])(i,[{key:"destroy",value:function(){this._startTime=null,this._showPrecision=null,this._playStartTime=null,this._playingTimestamp=null,this._totalDuration=0,this._audioTimestamp=0,this._videoTimestamp=0,this._fps=null,this._isUseFpsRender=!1,this._rate=1,this.playbackList=[],this._playbackListStartTimestamp=null,this._localCalculateTimeInterval=null,this._currentLocalTimestamp=0,this._startfpsTime=null,this._startFpsTimestamp=null,this._renderFps=0,this._playbackTs=0,this._stopLocalCalculateTime(),this.clearStatsInterval(),this.player.$container&&this.player.$container.classList.remove("jessibuca-container-playback"),this.off(),this.player.debug.log("Playback","destroy")}},{key:"_listen",value:function(){var e=this;this.player.on(it.stats,(function(t){var i=t.ts;e._playStartTime||(e._playStartTime=i-1e3);var r=i-e._playStartTime;e.setPlayingTimestamp(r)}))}},{key:"pause",value:function(){this.clearStatsInterval()}},{key:"resume",value:function(){this.startCheckStatsInterval()}},{key:"updateStats",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._startFpsTimestamp||(this._startFpsTimestamp=$r()),Ta(e.ts)&&(this.player.updateStats({fps:!0,ts:e.ts}),this._playbackTs=e.ts,this._startfpsTime||(this._startfpsTime=e.ts),this._renderFps+=1);var t=$r(),i=t-this._startFpsTimestamp;if(!(i<1e3)){var r=null;this._startfpsTime&&(r=this._playbackTs-this._startfpsTime),this.player.emit(it.playbackStats,{fps:this._renderFps,rate:this.rate,start:this._startfpsTime,end:this._playbackTs,timestamp:i,dataTimestamp:r,audioBufferSize:this.player.audio?this.player.audio.bufferSize:0,videoBufferSize:this.player.video?this.player.video.bufferSize:0,ts:this._playbackTs}),this._renderFps=0,this._startfpsTime=this._playbackTs,this._startFpsTimestamp=t}}},{key:"updateLocalOneFrameTimestamp",value:function(e){this._localOneFrameTimestamp=e}},{key:"_startLocalCalculateTime",value:function(){var e=this;this._stopLocalCalculateTime(),this._localCalculateTimeInterval=setInterval((function(){var t=e._currentLocalTimestamp;e._playStartTime||(e._playStartTime=t-1e3);var i=t-e._playStartTime;e.setPlayingTimestamp(i)}),1e3)}},{key:"startCheckStatsInterval",value:function(){var e=this;this.clearStatsInterval(),this._checkStatsInterval=setInterval((function(){e.updateStats()}),1e3)}},{key:"_stopLocalCalculateTime",value:function(){this._localCalculateTimeInterval&&(clearInterval(this._localCalculateTimeInterval),this._localCalculateTimeInterval=null)}},{key:"clearStatsInterval",value:function(){this._checkStatsInterval&&(clearInterval(this._checkStatsInterval),this._checkStatsInterval=null)}},{key:"increaseLocalTimestamp",value:function(){this._isUseLocalCalculateTime&&(this._currentLocalTimestamp+=this._localOneFrameTimestamp)}},{key:"initPlaybackList",value:function(e,t,i){this.playbackList=e||[];var r=0;if(this.playbackList.forEach((function(e,t){10===Oa(e.start)&&(e.startTimestamp=1e3*e.start,e.startTime=da(e.startTimestamp)),10===Oa(e.end)&&(e.endTimestamp=1e3*e.end,e.endTime=da(e.endTimestamp)),e.duration=e.end-e.start,r+=e.duration})),this._totalDuration=r,this.player.debug.log("Playback",this.playbackList),this.playbackList.length>0){var a=this.playbackList[0].startTimestamp;this._playbackListStartTimestamp=a;var n=a;i&&(10===Oa(i)&&(i*=1e3),this._isTimeInPlaybackList(i)&&(n=i)),this.setStartTime(n)}var s=t||ri;this.setShowPrecision(s)}},{key:"totalDuration",get:function(){return(this._totalDuration||0)/1e3}},{key:"startTime",get:function(){return this._startTime||0}},{key:"setStartTime",value:function(e){this._startTime=e,this._playingTimestamp=e,this._playStartTime=null}},{key:"setRate",value:function(e){this._rate=e,this.player.emit(it.playbackRateChange,e)}},{key:"fps",get:function(){return this._fps}},{key:"rate",get:function(){return this._rate}},{key:"isUseFpsRender",get:function(){return this._isUseFpsRender}},{key:"isUseLocalCalculateTime",get:function(){return this._isUseLocalCalculateTime}},{key:"showPrecision",get:function(){return this._showPrecision}},{key:"is60Min",get:function(){return this.showPrecision===ri}},{key:"is30Min",get:function(){return this.showPrecision===ai}},{key:"is10Min",get:function(){return this.showPrecision===ni}},{key:"is5Min",get:function(){return this.showPrecision===si}},{key:"is1Min",get:function(){return this.showPrecision===si}},{key:"isPlaybackPauseClearCache",get:function(){return this._isPlaybackPauseClearCache}},{key:"isCacheBeforeDecodeForFpsRender",get:function(){return this._isCacheBeforeDecodeForFpsRender}},{key:"setShowPrecision",value:function(e){ci.includes(e)||(this.player.debug.warn("Playback","setShowPrecision()","type is not in PLAYBACK_CONTROL_TIME_PRECISION_ARRAY",e),e=ri),this._showPrecision&&this._showPrecision===e||(this._showPrecision=e,this.player.emit(it.playbackPrecision,this._showPrecision,this.playbackList),this.player.emit(it.playbackShowPrecisionChange,this._showPrecision))}},{key:"setPlayingTimestamp",value:function(e){var t;if(this.controlType===$.normal){t=this.startTime+e,this._playingTimestamp=t,this.player.emit(it.playbackTime,t);var i=new Date(t);this.player.emit(it.playbackTimestamp,{ts:t,hour:i.getHours(),min:i.getMinutes(),second:i.getSeconds()})}else this.controlType===$.simple&&(t=this.startTime+Math.round(e/1e3),t>this.totalDuration&&(this.player.debug.log("Playback","setPlayingTimestamp()","timestamp ".concat(t," > this.totalDuration ").concat(this.totalDuration)),t=this.totalDuration),this._playingTimestamp=t,this.player.emit(it.playbackTime,t),this.player.emit(it.playbackTimestamp,{ts:t}))}},{key:"playingTimestamp",get:function(){return this._playingTimestamp}},{key:"narrowPrecision",value:function(){var e=ci.indexOf(this.showPrecision)-1;if(e>=0){var t=ci[e];this.setShowPrecision(t)}}},{key:"expandPrecision",value:function(){var e=ci.indexOf(this.showPrecision)+1;if(e<=ci.length-1){var t=ci[e];this.setShowPrecision(t)}}},{key:"seek",value:function(e){if(this.player.debug.log("Playback","seek()",e),this.controlType===$.normal){if("true"===e.hasRecord){var t=e.time;"min"===e.type&&(t=60*e.time);var i=function(e){var t={};return e>-1&&(t={hour:Math.floor(e/60/60)%60,min:Math.floor(e/60)%60,second:e%60}),t}(t);if(this._playbackListStartTimestamp){var r=new Date(this._playbackListStartTimestamp).setHours(i.hour,i.min,i.second,0);i.timestamp=r;var a=this._findMoreInfoByTimestamp(r);i&&a.more&&(i.more=a.more)}this.player.emit(it.playbackSeek,i)}}else if(this.controlType===$.simple){var n=e.time;this.player.emit(it.playbackSeek,{ts:n})}}},{key:"currentTimeScroll",value:function(){this.player.emit(it.playbackTimeScroll)}},{key:"_findMoreInfoByTimestamp",value:function(e){var t=null;return this.playbackList.forEach((function(i,r){i.startTimestamp<=e&&i.endTimestamp>=e&&(t=i)})),t}},{key:"_isTimeInPlaybackList",value:function(e){var t=!1;return this.playbackList.forEach((function(i,r){i.startTimestamp<=e&&i.endTimestamp>=e&&(t=!0)})),t}},{key:"getControlType",value:function(){return this.controlType}},{key:"isControlTypeNormal",value:function(){return this.controlType===$.normal}},{key:"isControlTypeSimple",value:function(){return this.controlType===$.simple}}]),i}(fn),ay=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;Object(T["a"])(this,i),r=t.call(this),r.player=e,r.TAG_NAME="zoom",r.bindEvents=[],r.isDragging=!1,r.currentZoom=1,r.prevVideoElementStyleTransform=null,r.prevVideoElementStyleScale=null,r.maxScale=5,r.tempPosition={x:0,y:0},r.videoPosition={left:0,top:0};var a=r.player,n=a.events.proxy;a.debug;r.player.on(it.zooming,(function(e){if(e){r.player.$container.classList.add("jessibuca-zoom-control"),r._bindEvents();var t=r.player.video.$videoElement.style.transform,i=r.player.video.$videoElement.style.left,a=r.player.video.$videoElement.style.top;i=parseFloat(i),a=parseFloat(a),i&&(r.videoPosition.left=i),a&&(r.videoPosition.top=a),r.prevVideoElementStyleTransform=t;var n=t.match(/scale\([0-9., ]*\)/g);if(n&&n[0]){var s=n[0].replace("scale(","").replace(")","");r.prevVideoElementStyleScale=s.split(",")}}else{r.player.$container.classList.remove("jessibuca-zoom-control"),r._unbindEvents(),r._resetVideoPosition(),r.player.$container.style.cursor="auto";var o=r.prevVideoElementStyleTransform;r.player.video.$videoElement.style.transform=o,r.prevVideoElementStyleTransform=null,r.prevVideoElementStyleScale=null,na()&&r.player._opt.useWebFullScreen&&r.player.resize()}}));var s=n(window,na()?"touchend":"mouseup",(function(e){r.handleMouseUp(e)}));return r.bindEvents.push(s),e.debug.log("zoom","init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){this.bindEvents=[],this.isDragging=!1,this.currentZoom=1,this.prevVideoElementStyleTransform=null,this.prevVideoElementStyleScale=null,this.tempPosition={x:0,y:0},this.videoPosition={left:0,top:0},this.off(),this.player.debug.log("zoom","destroy")}},{key:"_bindEvents",value:function(){var e=this,t=this.player,i=t.events.proxy,r=(t.debug,i(this.player.$container,na()?"touchmove":"mousemove",(function(t){e.handleMouseMove(t)})));this.bindEvents.push(r);var a=i(this.player.$container,na()?"touchstart":"mousedown",(function(t){e.handleMouseDown(t)}));this.bindEvents.push(a);var n=i(window,na()?"touchend":"mouseup",(function(t){e.handleMouseUp(t)}));this.bindEvents.push(n)}},{key:"_unbindEvents",value:function(){this.bindEvents.forEach((function(e){e&&e()}))}},{key:"handleMouseMove",value:function(e){if(e.stopPropagation(),this.isDragging&&this.player.zooming){e.preventDefault();var t=Ga(e),i=t.posX,r=t.posY,a=this.tempPosition.x-i,n=this.tempPosition.y-r;this.videoPosition.left=this.videoPosition.left-a,this.videoPosition.top=this.videoPosition.top-n,this.tempPosition.x=i,this.tempPosition.y=r,this.updateVideoPosition()}}},{key:"handleMouseDown",value:function(e){e.stopPropagation();var t=ja(e);if(this.player.zooming&&(t.matches("video")||t.matches("canvas"))){e.preventDefault();var i=Ga(e),r=i.posX,a=i.posY;this.player.$container.style.cursor="grabbing",this.tempPosition.x=r,this.tempPosition.y=a,this.isDragging=!0,this.player.debug.log("zoom","handleMouseDown is dragging true")}}},{key:"handleMouseUp",value:function(e){e.stopPropagation(),this.isDragging&&this.player.zooming&&(e.preventDefault(),this.tempPosition={x:0,y:0},this.isDragging=!1,this.player.$container.style.cursor="grab",this.player.debug.log("zoom","handleMouseUp is dragging false"))}},{key:"updateVideoPosition",value:function(){var e=this.player.video.$videoElement;e.style.left=this.videoPosition.left+"px",e.style.top=this.videoPosition.top+"px"}},{key:"_resetVideoPosition",value:function(){this.player.resize(),this.tempPosition={x:0,y:0},this.videoPosition={left:0,top:0},this.currentZoom=1,this.isDragging=!1}},{key:"narrowPrecision",value:function(){this.currentZoom<=1||(this.currentZoom-=1,this.updateVideoElementScale())}},{key:"expandPrecision",value:function(){this.currentZoom>=this.maxScale||(this.currentZoom+=1,this.updateVideoElementScale())}},{key:"updatePrevVideoElementStyleScale",value:function(e){this.prevVideoElementStyleScale=e}},{key:"updateVideoElementScale",value:function(){var e=this.player.video.$videoElement,t=e.style.transform,i=1,r=1;if(this.prevVideoElementStyleScale){var a=this.prevVideoElementStyleScale[0];void 0!==a&&(i=a,r=a);var n=this.prevVideoElementStyleScale[1];void 0!==n&&(r=n)}r=fa(r),i=fa(i);var s,o=.5*i*(this.currentZoom-1)+i,c=.5*r*(this.currentZoom-1)+r;s=-1===t.indexOf("scale(")?t+" scale(".concat(o,",").concat(c,")"):t.replace(/scale\([0-9., ]*\)/,"scale(".concat(o,",").concat(c,")")),this.player.debug.log("zoom","updateVideoElementScale end is ".concat(o,", ").concat(c," style is ").concat(s)),e.style.transform=s}}]),i}(fn),ny=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this),r.player=e,r.faceDetector=null,r.objectDetector=null,r.initFaceDetector(),r.initObjectDetector(),r.player.debug.log("AiLoader","init"),r}return Object(S["a"])(i,[{key:"initFaceDetector",value:function(){var e=this;if(this.player._opt.useFaceDetector&&window.JessibucaProFaceDetector){var t=new JessibucaProFaceDetector({detectWidth:this.player._opt.aiFaceDetectWidth,showRect:!1});t.load().then((function(){e.player.debug.log("AiLoader","init face detector success"),e.faceDetector=t,e.faceDetector.on("jessibuca-pro-face-detector-info",(function(t){if(e.player.emit(it.aiFaceDetectorInfo,t),e.player._opt.aiFaceDetectShowRect){var i=e.player._opt.aiFaceDetectRectConfig||{},r=(t.list||[]).map((function(e){return e.type="rect",e.color=i.borderColor||"#0000FF",e.lineWidth=i.borderWidth||2,e}));e.player.video&&e.player.video.addAiContentToCanvas(r)}}))}))}}},{key:"initObjectDetector",value:function(){var e=this;if(this.player._opt.useObjectDetector&&window.JessibucaProObjectDetector){var t=new JessibucaProObjectDetector({detectWidth:this.player._opt.aiObjectDetectWidth,showRect:!1});t.load().then((function(){e.player.debug.log("AiLoader","init object detector success"),e.objectDetector=t,e.objectDetector.on("jessibuca-pro-object-detector-info",(function(t){if(e.player.emit(it.aiObjectDetectorInfo,t),e.player._opt.aiObjectDetectShowRect){var i=[],r=e.player._opt.aiObjectDetectRectConfig||{};(t.list||[]).forEach((function(e){var t={type:"rect",color:r.borderColor||"#0000FF",lineWidth:r.borderWidth||2,x:e.rect.x,y:e.rect.y,width:e.rect.width,height:e.rect.height},a={type:"text",color:r.color||"#000",fontSize:r.fontSize||14,text:e.zh,x:e.rect.x,y:e.rect.y-25};i.push(t,a)})),e.player.video&&e.player.video.addAiContentToCanvas(i)}}))}))}}},{key:"updateFaceDetectorConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.faceDetector&&this.faceDetector.updateConfig(e)}},{key:"updateObjectDetectorConfig",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.objectDetector&&this.objectDetector.updateConfig(e)}},{key:"destroy",value:function(){this.off(),this.faceDetector&&(this.faceDetector.destroy(),this.faceDetector=null),this.objectDetector&&(this.objectDetector.destroy(),this.objectDetector=null)}}]),i}(fn),sy=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this),r.player=e,r.LOG_NAME="Contextmenu",r.menuList=[],r.$contextmenus=e.control.$contextmenus,na()?r.player.debug.warn(r.LOG_NAME,"not support mobile"):r.init(),e.debug.log(r.LOG_NAME,"init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){this.menuList=[],this.player.debug.log(this.LOG_NAME,"destroy")}},{key:"isShow",get:function(){return e=this.player.$container,t="jessibuca-contextmenus-show",e.classList.contains(t);var e,t}},{key:"show",value:function(){var e,t;e=this.player.$container,t="jessibuca-contextmenus-show",e.classList.add(t)}},{key:"hide",value:function(){var e,t;e=this.player.$container,t="jessibuca-contextmenus-show",e.classList.remove(t)}},{key:"init",value:function(){var e=this,t=this.player,i=t.events.proxy;t.debug;this.player._opt.contextmenuBtns.length>0&&this.player._opt.contextmenuBtns.forEach((function(t){e.addMenuItem(t)})),i(this.player.$container,"contextmenu",(function(t){t.preventDefault(),e.show();var i=t.clientX,r=t.clientY,a=e.player.$container.getBoundingClientRect(),n=a.height,s=a.width,o=a.left,c=a.top,l=e.$contextmenus.getBoundingClientRect(),u=l.height,d=l.width,h=i-o,f=r-c;i+d>o+s&&(h=s-d),r+u>c+n&&(f=n-u),ea(e.$contextmenus,{left:"".concat(h,"px"),top:"".concat(f,"px")})})),i(this.player.$container,"click",(function(t){Qc(t,e.$contextmenus)||e.hide()})),this.player.on(it.blur,(function(){e.hide()}))}},{key:"_validateMenuItem",value:function(e){var t=!0;return e.content||(this.player.debug.warn(this.LOG_NAME,"content is required"),t=!1),t}},{key:"addMenuItem",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=$a(or);if(t=Object.assign({},i,t),this._validateMenuItem(t)){var r=this.player,a=r.events.proxy,n=(r.debug,pa()),s='\n <div class="jessibuca-contextmenu jessibuca-contextmenu-'.concat(n,'">\n ').concat(t.content,"\n </div>\n "),o=Array.from(this.$contextmenus.children)[t.index];o?o.insertAdjacentHTML("beforebegin",s):Jc(this.$contextmenus,s);var c=this.$contextmenus.querySelector(".jessibuca-contextmenu-".concat(n));t.click&&a(c,"click",(function(i){i.preventDefault(),t.click.call(e.player,e,i),e.hide()})),this.menuList.push({uuid:n,$menuItem:c})}}}]),i}(fn),oy=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e),r.TAG_NAME="WebrtcForSRSDecoder",r.player.debug.log(r.TAG_NAME,"init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){k(Object(b["a"])(i.prototype),"destroy",this).call(this),this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"loadSource",value:function(e){var t=this;return new Promise((function(i,r){var a=t.rtcPeerConnection;a.createOffer().then((function(n){a.setLocalDescription(n),t.player.debug.log(t.TAG_NAME,"getWebRtcRemoteSdp loadSource"),function(e,t){return fetch(e,{method:"POST",mode:"cors",cache:"no-cache",credentials:"include",redirect:"follow",referrerPolicy:"no-referrer",headers:{"Content-Type":"application/sdp"},body:t})}(e,n.sdp).then((function(e){t.player.debug.log(t.TAG_NAME,"getWebRtcRemoteSdp response and code is ".concat(e.code));var n=e;if(0!==n.code)return r(n.msg);a.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:n})).then((function(){i()}))["catch"]((function(e){r(e)}))}))["catch"]((function(e){t.player.debug.error(t.TAG_NAME,"loadSource getWebRtcRemoteSdp response error",e),r(e)}))}))["catch"]((function(e){t.player.debug.error(t.TAG_NAME,"loadSource rtcPeerConnection.createOffer() error",e),r(e)}))}))}}]),i}(ey),cy=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this,e),r.TAG_NAME="WebrtcForOthersDecoder",r.player.debug.log(r.TAG_NAME,"init"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){k(Object(b["a"])(i.prototype),"destroy",this).call(this),this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"loadSource",value:function(e){var t=this;return new Promise((function(i,r){var a=t.rtcPeerConnection;a.createOffer().then((function(n){a.setLocalDescription(n),t.player.debug.log(t.TAG_NAME,"getWebRtcRemoteSdp loadSource"),function(e,t){return fetch(e,{method:"POST",mode:"cors",cache:"no-cache",credentials:"include",redirect:"follow",referrerPolicy:"no-referrer",headers:{"Content-Type":"application/sdp"},body:t})}(e,n.sdp).then((function(e){t.player.debug.log(t.TAG_NAME,"getWebRtcRemoteSdp response and code is ".concat(e.code)),e.text().then((function(e){t.player.debug.log(t.TAG_NAME,"getWebRtcRemoteSdp response"),a.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:e})).then((function(){i()}))["catch"]((function(e){r(e)}))}))["catch"]((function(e){t.player.debug.error(t.TAG_NAME,"loadSource response.text() error",e),r(e)}))}))["catch"]((function(e){t.player.debug.error(t.TAG_NAME,"loadSource getWebRtcRemoteSdp response error",e),r(e)}))}))["catch"]((function(e){t.player.debug.error(t.TAG_NAME,"loadSource rtcPeerConnection.createOffer() error",e),r(e)}))}))}}]),i}(ey),ly=function(){function e(t){Object(T["a"])(this,e),this.player=t,this.TAG_NAME="PressureObserverCpu",this.observer=null,this.latestCpuInfo=null,this.currentLevel=-1,this._init(),this.player.debug.log(this.TAG_NAME,"init")}return Object(S["a"])(e,[{key:"destroy",value:function(){this.observer&&(this.observer.unobserve("cpu"),this.observer=null),this.latestCpuInfo=null,this.currentLevel=-1,this.player.debug.log(this.TAG_NAME,"destroy")}},{key:"getCurrentCpuState",value:function(){return this.currentLevel}},{key:"_init",value:function(){var e=this;an(dn())?this.player.debug.log(this.TAG_NAME,"not support PressureObserver"):(this.observer=new PressureObserver((function(t){var i=(t||[]).find((function(e){return"cpu"===e.source}));if(i){switch(e.latestCpuInfo=i,i.state){case"nominal":e.currentLevel=0;break;case"fair":e.currentLevel=1;break;case"serious":e.currentLevel=2;break;case"critical":e.currentLevel=3;break;default:e.currentLevel=-1}e.player.emit(it.pressureObserverCpu,e.currentLevel)}})),this.observer&&this.observer.observe("cpu"))}}]),e}(),uy=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;Object(T["a"])(this,i);var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r=t.call(this,e),r.TAG_NAME="DynamicWatermark",r.isPauseAnimation=!1,r.isStopAnimation=!1,r.rafID=null,r.speed=a.speed||.2,r.isDynamic=!0,r.shadowRootDynamicDom=null,r.isGhost=!0===a.isGhost,r.ghostConfig={on:a.on||5,off:a.off||5},r.waterMarkWillRemove=!1,r.waterMarkWillAdd=!1,r.player.once(it.start,(function(){var e=an(!1)?decodeURIComponent("JessibucaPro%20%E4%BD%93%E9%AA%8C"):a.content,t=r.player.getVideoInfo();t||(t={width:200,height:200}),r.update({text:{content:e,fontSize:a.fontSize||18,color:a.color||"white"},left:t.width*Math.random(),top:t.height*Math.random(),opacity:a.opacity||.15}),r.startAnimation()})),r.player.debug.log(r.TAG_NAME,"int"),r}return Object(S["a"])(i,[{key:"destroy",value:function(){k(Object(b["a"])(i.prototype),"destroy",this).call(this),this.rafID&&(cancelAnimationFrame(this.rafID),this.rafID=null)}},{key:"startAnimation",value:function(){var e=this;if(!this.rafID){var t=1,i=1,r=Math.random(),a={width:0,height:0},n=function n(){try{if(an(e.isPauseAnimation)&&e.shadowRootDynamicDom&&e.shadowRootInnerDom){var s=e.shadowRootInnerDom,o=e.shadowRootDynamicDom,c=s.getBoundingClientRect(),l=o.getBoundingClientRect();if(l.width&&l.height&&(a.width=l.width,a.height=l.height),!e.shadowRootInnerDom.contains(e.shadowRootDynamicDom))return e.isGhost?an(e.waterMarkWillAdd)&&(e.waterMarkWillAdd=!0,setTimeout((function(){e._addDom(c,a),e.waterMarkWillAdd=!1}),1e3*e.ghostConfig.off)):e._addDom(c,a),void(0!==e.speed&&requestAnimationFrame(n));var u=Math.min(1,0===e.speed?0:e.speed?e.speed:.2),d=l.left-c.left,h=l.top-c.top;d+=u*i*r,h+=u*t*(1-r),d+a.width>c.width?(i=-1,r=Math.random()):d<0&&(i=1,r=Math.random()),h+a.height>c.height?(t=-1,r=Math.random()):h<0&&(t=1,r=Math.random()),d=Math.min(c.width-a.width,d),h=Math.min(c.height-a.height,h);var f=d/c.width*100,p=h/c.height*100;e.shadowRootDynamicDom.style.left="".concat(f,"%"),e.shadowRootDynamicDom.style.top="".concat(p,"%"),an(e.waterMarkWillRemove)&&e.isGhost&&(e.waterMarkWillRemove=!0,setTimeout((function(){e._removeDom(),e.waterMarkWillRemove=!1}),1e3*e.ghostConfig.on))}}catch(m){}if(e.isStopAnimation)return e.isStopAnimation=!1,cancelAnimationFrame(e.rafID),void(e.rafID=null);0!==e.speed&&requestAnimationFrame(n)};this.rafID=requestAnimationFrame(n)}}},{key:"_addDom",value:function(e,t){if(this.shadowRootInnerDom&&this.shadowRootDynamicDom){this.shadowRootInnerDom.appendChild(this.shadowRootDynamicDom);var i=e.width*Math.random(),r=e.height*Math.random();i=Math.min(e.width-2*t.width,i),r=Math.min(e.height-2*t.height,r),this.shadowRootDynamicDom.style.left="".concat(i,"px"),this.shadowRootDynamicDom.style.top="".concat(r,"px")}}},{key:"resumeAnimation",value:function(){this.isPauseAnimation=!1}},{key:"pauseAnimation",value:function(){this.isPauseAnimation=!0}},{key:"stopAnimation",value:function(){this.isStopAnimation=!0}}]),i}(wn),dy=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;Object(T["a"])(this,i);var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r=t.call(this),r._opt={},r.TAG_NAME="Player",r.$container=e;var n,s=en();if(r._opt=Object.assign({},s,a),r.debug=new Ir(Object(v["a"])(r)),r._opt.forceNoOffscreen=!0,na()&&(r._opt.controlAutoHide=!1),sn()&&(r._opt.videoRenderSupportScale=!1),an(r._opt.playFailedAndReplay)&&(r._opt.webglAlignmentErrorReplay=!1,r._opt.webglContextLostErrorReplay=!1,r._opt.autoWasm=!1,r._opt.mseDecodeErrorReplay=!1,r._opt.mediaSourceTsIsMaxDiffReplay=!1,r._opt.wcsDecodeErrorReplay=!1,r._opt.wasmDecodeErrorReplay=!1,r._opt.simdDecodeErrorReplay=!1,r._opt.videoElementPlayingFailedReplay=!1,r._opt.networkDelayTimeoutReplay=!1,r._opt.widthOrHeightChangeReplay=!1,r._opt.simdH264DecodeVideoWidthIsTooLargeReplay=!1,r._opt.heartTimeoutReplay=!1,r._opt.loadingTimeoutReplay=!1),r._opt.forceNoOffscreen||(("undefined"===typeof OffscreenCanvas?"undefined":Object(E["a"])(OffscreenCanvas))>"u"?(r._opt.forceNoOffscreen=!0,r._opt.useOffscreen=!1):r._opt.useOffscreen=!0),r._opt.isMpeg4&&(r._opt.useWCS=!1,r._opt.useMSE=!1,r._opt.isNakedFlow=!1,r._opt.useSIMD=!1,r._opt.isFmp4=!1),(r.isOldHls()||r.isWebrtcH264())&&(r._opt.useWCS=!1,r._opt.useMSE=!1,r._opt.isNakedFlow=!1),r._opt.isNakedFlow,!r.isOldHls()&&!r.isWebrtcH264()){if(r._opt.useWCS){var o="VideoEncoder"in window,c=ba();r._opt.useWCS=o,r._opt.useWCS&&r._opt.isH265&&(r._opt.useWCS=c),r._opt.useWCS||r.debug.warn(r.TAG_NAME,"\n useWCS is true,\n and supportWCS is ".concat(o,", supportHevcWCS is ").concat(c," , _opt.isH265 is ").concat(r._opt.isH265,"\n so set useWCS false")),r._opt.useWCS&&(r._opt.useOffscreen?r._opt.wcsUseVideoRender=!1:r._opt.wcsUseVideoRender&&(r._opt.wcsUseVideoRender=Aa()&&ka(),r._opt.wcsUseVideoRender||r.debug.warn(r.TAG_NAME,"wcsUseVideoRender is true, but not support so set wcsUseVideoRender false")))}if(r._opt.useMSE){var l=function(){var e=!1;return"MediaSource"in window&&window.MediaSource.isTypeSupported(Yt)&&(e=!0),e}(),u=va();r._opt.useMSE=l,r._opt.useMSE&&r._opt.isH265&&(r._opt.useMSE=u),r._opt.useMSE||r.debug.warn(r.TAG_NAME,"\n useMSE is true,\n and supportMSE is ".concat(l,", supportHevcMSE is ").concat(u," , _opt.isH265 is ").concat(r._opt.isH265,"\n so set useMSE false"))}}if(r._opt.useMSE?(r._opt.useWCS&&r.debug.warn(r.TAG_NAME,"useMSE is true and useWCS is true then useWCS set true->false"),r._opt.forceNoOffscreen||r.debug.warn(r.TAG_NAME,"useMSE is true and forceNoOffscreen is false then forceNoOffscreen set false->true"),r._opt.useWCS=!1,r._opt.forceNoOffscreen=!0):r._opt.useWCS,r._opt.isWebrtc&&r._opt.demuxUseWorker&&(r.debug.warn(r.TAG_NAME,"isWebrtc is true and demuxUseWorker is true then demuxUseWorker set true->false"),r._opt.demuxUseWorker=!1),r._opt.isHls&&r._opt.demuxUseWorker&&(r.debug.warn(r.TAG_NAME,"isHls is true and demuxUseWorker is true then demuxUseWorker set true->false"),r._opt.demuxUseWorker=!1),r.isStreamWebTransport()&&r._opt.demuxUseWorker&&(r.debug.warn(r.TAG_NAME,"is stream use webTransport is true and demuxUseWorker is true then demuxUseWorker set true->false"),r._opt.demuxUseWorker=!1),r._opt.useMThreading&&(r._opt.useMThreading=("undefined"===typeof SharedArrayBuffer?"undefined":Object(E["a"])(SharedArrayBuffer))<"u",r._opt.useMThreading||r.debug.warn(r.TAG_NAME,"useMThreading is true, but not support so set useMThreading false")),r._opt.useSIMD||-1!==r._opt.decoder.indexOf("-simd")){var d=WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),h=sn();r._opt.useSIMD=d&&an(h),r._opt.useSIMD||r.debug.warn(r.TAG_NAME,"useSIMD is true, but not support(isSupportSimd is ".concat(d," ,isIphone is ").concat(h,") so set useSIMD false"))}if(r._opt.useSIMD?-1===r._opt.decoder.indexOf("-simd")&&(r._opt.decoder=r._opt.decoder.replace("decoder-pro","decoder-pro-simd")):-1!==r._opt.decoder.indexOf("-simd")&&(r._opt.decoder=r._opt.decoder.replace("decoder-pro-simd","decoder-pro")),-1!==r._opt.decoder.indexOf("-simd")?r._opt.decoderAudio=r._opt.decoder.replace("decoder-pro-simd","decoder-pro-audio"):r._opt.decoderAudio=r._opt.decoder.replace("decoder-pro","decoder-pro-audio"),-1!==r._opt.decoder.indexOf("-simd")?r._opt.decoderHard=r._opt.decoder.replace("decoder-pro-simd","decoder-pro-hard"):r._opt.decoderHard=r._opt.decoder.replace("decoder-pro","decoder-pro-hard"),an(r._opt.hasAudio)&&(r._opt.operateBtns.audio=!1),an(r._opt.hasVideo)&&(r._opt.operateBtns.fullscreen=!1,r._opt.operateBtns.screenshot=!1,r._opt.operateBtns.record=!1,r._opt.operateBtns.ptz=!1,r._opt.operateBtns.quality=!1,r._opt.operateBtns.zoom=!1),r._opt.qualityConfig&&0===r._opt.qualityConfig.length&&r._opt.operateBtns.quality&&(r._opt.operateBtns.quality=!1,r.debug.warn(r.TAG_NAME,"_opt.qualityConfig is empty, so set operateBtns.quality false")),rn(r._opt.useWebGPU)&&(r._opt.useWebGPU=function(){var e=!1;return"gpu"in navigator&&(e=!0),e}(),an(r._opt.useWebGPU)&&r.debug.warn(r.TAG_NAME,"useWebGPU is true, but not support so set useWebGPU false")),r._opt.hasControl=r._hasControl(),r._loading=!1,r._playing=!1,r._playbackPause=!1,r._hasLoaded=!1,r._zooming=!1,r._destroyed=!1,r._checkHeartTimeout=null,r._checkLoadingTimeout=null,r._checkStatsInterval=null,r._checkVisibleHiddenTimeout=null,r._startBpsTime=null,r._isPlayingBeforePageHidden=!1,r._stats={buf:0,netBuf:0,fps:0,maxFps:0,dfps:0,abps:0,vbps:0,ts:0,mseTs:0,currentPts:0,pTs:0,dts:0,mseVideoBufferDelayTime:0,isDropping:!1},r._allStatsData={},r._faceDetectActive=!1,r._objectDetectActive=!1,r._times={playInitStart:"",playStart:"",streamStart:"",streamResponse:"",demuxStart:"",decodeStart:"",videoStart:"",playTimestamp:"",streamTimestamp:"",streamResponseTimestamp:"",demuxTimestamp:"",decodeTimestamp:"",videoTimestamp:"",allTimestamp:""},r._videoTimestamp=0,r._audioTimestamp=0,r._latestAudioTimestamp=0,r._videoIframeIntervalTs=0,r._streamQuality=r._opt.defaultStreamQuality||"",r._visibility=!0,r._lastestVisibilityChangeTimestamp=null,r._tempWorkerStats=null,r._historyFpsList=[],r._tempStreamList=[],r._tempInnerPlayBgobj=null,r._flvMetaData=null,r._flvMetaDataFps=null,an(r._opt.useMSE)&&an(r._opt.useWCS)&&!r.isWebrtcH264()&&!r.isOldHls()&&(r._opt.useWasm=!0),(r.isOldHls()||r.isWebrtcH264())&&(r._opt.hasVideo=!0,r._opt.hasAudio=!0),r._opt.hasVideo||(r._opt.useMSE=!1,r._opt.useWCS=!1),r._opt.useWasm&&(r._opt.useOffscreen?r._opt.wasmUseVideoRender=!1:r._opt.wasmUseVideoRender&&(r._opt.wasmUseVideoRender=ha()&&Aa()&&ka(),r._opt.wasmUseVideoRender||r.debug.warn(r.TAG_NAME,"use wasm video render, but not support so set wasmUseVideoRender false")),r._opt.useSIMD?r.debug.log(r.TAG_NAME,"use simd wasm"):r.debug.log(r.TAG_NAME,"use wasm")),r._opt.useWasm&&(r._opt.useFaceDetector&&window.JessibucaProFaceDetector||r._opt.useObjectDetector&&window.JessibucaProObjectDetector)?(r.ai=new ny(Object(v["a"])(r)),r._opt.useFaceDetector&&window.JessibucaProFaceDetector||(r._opt.operateBtns.aiFace=!1),r._opt.useObjectDetector&&window.JessibucaProObjectDetector||(r._opt.operateBtns.aiObject=!1)):(r._opt.operateBtns.aiObject=!1,r._opt.operateBtns.aiFace=!1),r._opt.useFaceDetector&&(r._opt.useWasm&&window.JessibucaProFaceDetector||r.debug.warn(r.TAG_NAME,"use face detector, useWasm is ".concat(r._opt.useWasm," and window.JessibucaProFaceDetector is ").concat(!!window.JessibucaProFaceDetector))),r._opt.useObjectDetector&&(r._opt.useWasm&&window.JessibucaProObjectDetector||r.debug.warn(r.TAG_NAME,"use object detector, useWasm is ".concat(r._opt.useWasm," and window.JessibucaProObjectDetector is ").concat(!!window.JessibucaProObjectDetector))),r._opt.useVideoRender&&(r._opt.useWasm&&!r._opt.useOffscreen?(r._opt.wasmUseVideoRender=ha()&&Aa()&&ka(),r._opt.wasmUseVideoRender||r.debug.warn(r.TAG_NAME,"use wasm video render, but not support so set wasmUseVideoRender false")):r._opt.useWCS&&!r._opt.useOffscreen&&(r._opt.wcsUseVideoRender=Aa()&&ka(),r._opt.wcsUseVideoRender||r.debug.warn(r.TAG_NAME,"use wcs video render, but not support so set wcsUseVideoRender false"))),r._opt.useCanvasRender&&(r._opt.useMSE&&(r._opt.mseUseCanvasRender=!0),r._opt.useWasm&&(r._opt.wasmUseVideoRender=!1),r._opt.useWCS&&(r._opt.wcsUseVideoRender=!1),r.isOldHls()&&!ua()&&(r._opt.hlsUseCanvasRender=!0),r.isWebrtcH264()&&(r._opt.webrtcUseCanvasRender=!0)),r._opt.useVideoRender=!1,r._opt.useCanvasRender=!1,r._opt.useWasm?r._opt.wasmUseVideoRender?r._opt.useVideoRender=!0:r._opt.useCanvasRender=!0:r._opt.useWCS?r._opt.wcsUseVideoRender?r._opt.useVideoRender=!0:r._opt.useCanvasRender=!0:r._opt.useMSE?r._opt.mseUseCanvasRender?r._opt.useCanvasRender=!0:r._opt.useVideoRender=!0:r.isOldHls()?r._opt.hlsUseCanvasRender?r._opt.useCanvasRender=!0:r._opt.useVideoRender=!0:r.isWebrtcH264()&&(r._opt.webrtcUseCanvasRender?r._opt.useCanvasRender=!0:r._opt.useVideoRender=!0),n=Object(v["a"])(r),Object.defineProperty(n,"rect",{get:function(){var e={};return n.$container&&(e=n.$container.getBoundingClientRect(),e.width=Math.max(e.width,n.$container.clientWidth),e.height=Math.max(e.height,n.$container.clientHeight)),e}}),["bottom","height","left","right","top","width"].forEach((function(e){Object.defineProperty(n,e,{get:function(){return n.rect[e]||0}})})),r.events=new hn(Object(v["a"])(r)),r._opt.hasVideo&&(r.video=new Mn(Object(v["a"])(r)),r.recorder=new Hs(Object(v["a"])(r))),r.isOldHls()?(r.hlsDecoder=new Em(Object(v["a"])(r)),r.loaded=!0):r.isWebrtcH264()?(r._opt.isWebrtcForZLM?r.webrtc=new iy(Object(v["a"])(r)):r._opt.isWebrtcForSRS?r.webrtc=new oy(Object(v["a"])(r)):r._opt.isWebrtcForOthers?r.webrtc=new cy(Object(v["a"])(r)):r.webrtc=new ty(Object(v["a"])(r)),r.loaded=!0):(r.isUseHls265()&&(r.hlsDecoder=new Zg(Object(v["a"])(r))),r.isWebrtcH265()&&(r.webrtc=new ty(Object(v["a"])(r))),Va(r._opt)?r.loaded=!0:r.decoderWorker=new Ys(Object(v["a"])(r))),r._opt.hasAudio&&(r.audio=new is(Object(v["a"])(r))),r.stream=null,r.demux=null,r._lastVolume=null,r._isInZoom=!1,r._playingStartTimestamp=null,r._opt.useWCS&&(r.webcodecsDecoder=new Fc(Object(v["a"])(r)),!r._opt.hasAudio&&an(r._opt.demuxUseWorker)&&(r.loaded=!0)),r._opt.useMSE&&(r._opt.isNewMseDecoder?r.mseDecoder=new al(Object(v["a"])(r)):r.mseDecoder=new rl(Object(v["a"])(r)),!r._opt.hasAudio&&an(r._opt.demuxUseWorker)&&(r.loaded=!0)),r.control=new el(Object(v["a"])(r)),r._opt.contextmenuBtns.length>0&&sa()&&(r.contextmenu=new sy(Object(v["a"])(r))),r.isPlayback()&&(r.playback=new ry(Object(v["a"])(r),r._opt.playbackConfig)),r._opt.operateBtns.zoom&&(r.zoom=new ay(Object(v["a"])(r))),/(iphone|ipad|ipod|ios|android)/i.test(window.navigator.userAgent.toLowerCase())&&an(r._opt.supportLockScreenPlayAudio&&la())&&(r.keepScreenOn=new sl(Object(v["a"])(r))),function(e){try{var t=function(t){ja(t)===e.$container&&(e.emit(rt.fullscreen,e.fullscreen),e.fullscreen?e._opt.useMSE&&e.resize():e.resize())};Br.on("change",t),e.events.destroys.push((function(){Br.off("change",t)}))}catch(a){}if(e.on(it.decoderWorkerInit,(function(){e.debug.log("player","listen decoderWorkerInit and set loaded true"),e.loaded=!0})),e.on(it.play,(function(){e.loading=!1})),e.on(it.fullscreen,(function(t){if(t)try{Br.request(e.$container).then((function(){}))["catch"]((function(t){e.debug.error("player","fullscreen request error",t),na()&&e._opt.useWebFullScreen&&(e.webFullscreen=!0)}))}catch(i){na()&&e._opt.useWebFullScreen&&(e.webFullscreen=!0)}else try{Br.exit().then((function(){e.webFullscreen&&(e.webFullscreen=!1)}))["catch"]((function(t){e.debug.error("player","fullscreen exit error",t),e.webFullscreen&&(e.webFullscreen=!1)}))}catch(r){e.webFullscreen&&(e.webFullscreen=!1)}})),na()&&e.on(it.webFullscreen,(function(t){t?e.$container.classList.add("jessibuca-fullscreen-web"):e.$container.classList.remove("jessibuca-fullscreen-web"),e.emit(rt.fullscreen,e.fullscreen)})),e.on(it.resize,(function(){e.video&&e.video.resize()})),e._opt.debug){var i=[it.timeUpdate,it.currentPts,it.videoSEI],r=[it.stats,it.playbackStats,it.playbackTimestamp,it.flvMetaData,it.playToRenderTimes,it.audioInfo,it.videoInfo];Object.keys(it).forEach((function(t){e.on(it[t],(function(a){i.includes(t)||(r.includes(t)&&(a=JSON.stringify(a)),e.debug.log("player events",it[t],a))}))})),Object.keys(nt).forEach((function(t){e.on(nt[t],(function(i){e.debug.warn("player event error",nt[t],i)}))}))}}(Object(v["a"])(r)),function(e){var t=e._opt,i=e.debug,r=e.events.proxy;if(t.supportDblclickFullscreen&&r(e.$container,"dblclick",(function(t){var i=ja(t).nodeName.toLowerCase();"canvas"!==i&&"video"!==i||(e.fullscreen=!e.fullscreen)})),r(document,"visibilitychange",(function(){e.visibility="visible"===document.visibilityState,i.log("visibilitychange",document.visibilityState),t.hiddenAutoPause&&(i.log("visibilitychange","hiddenAutoPause is true ",document.visibilityState,e._isPlayingBeforePageHidden),"visible"===document.visibilityState?e._isPlayingBeforePageHidden&&e.play():(e._isPlayingBeforePageHidden=e.playing,e.playing&&e.pause()))})),sa()&&r(document,["click","contextmenu"],(function(t){Qc(t,e.$container)?(e.isInput="INPUT"===t.target.tagName,e.isFocus=!0,e.emit(it.focus)):(e.isInput=!1,e.isFocus=!1,e.emit(it.blur))})),t.autoResize){var a=ma((function(){e.resize()}),500);r(window,["resize","orientationchange"],(function(){a()})),screen&&screen.orientation&&screen.orientation.onchange&&r(screen.orientation,"change",(function(){a()}))}}(Object(v["a"])(r)),r.singleWatermark=new wn(Object(v["a"])(r)),r._opt.ghostWatermarkConfig.content){var f=Object.assign({},r._opt.ghostWatermarkConfig,{isGhost:!0});r.ghostWatermark=new uy(Object(v["a"])(r),f)}return r._opt.dynamicWatermarkConfig.content&&(r.dynamicWatermark=new uy(Object(v["a"])(r),r._opt.dynamicWatermarkConfig)),r._opt.watermarkConfig&&r.updateWatermark(r._opt.watermarkConfig),dn()&&(r.pressureObserverCpu=new ly(Object(v["a"])(r))),r._opt.useWCS&&r.debug.log(r.TAG_NAME,"use WCS"),r._opt.useMSE&&r.debug.log(r.TAG_NAME,"use MSE"),r._opt.useOffscreen&&r.debug.log(r.TAG_NAME,"use offscreen"),r._opt.isHls&&(r._opt.supportHls265?r.debug.log(r.TAG_NAME,"use hls 265"):r.debug.log(r.TAG_NAME,"use hls")),r._opt.isWebrtc&&(r._opt.isWebrtcH265?r.debug.log(r.TAG_NAME,"use webrtc h265"):r._opt.isWebrtcForZLM?r.debug.log(r.TAG_NAME,"use webrtc for ZLM"):r._opt.isWebrtcForSRS?r.debug.log(r.TAG_NAME,"use webrtc for SRS"):r._opt.isWebrtcForOthers?r.debug.log(r.TAG_NAME,"use webrtc for Others"):r.debug.log(r.TAG_NAME,"use webrtc for M7S")),r._opt.isFmp4&&r.debug.log(r.TAG_NAME,"use fmp4"),r._opt.isMpeg4&&r.debug.log(r.TAG_NAME,"use mpeg4"),r.isPlayback()&&r.debug.log(r.TAG_NAME,"use playback"),r._opt.hasVideo&&(0===r.width&&r.debug.warn(r.TAG_NAME,"container width is 0, please check the container width"),0===r.height&&r.debug.warn(r.TAG_NAME,"container height is 0, please check the container height")),r.debug.log("Player options",JSON.stringify(r._opt)),r}return Object(S["a"])(i,[{key:"destroy",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this._destroyed=!0,this.emit("destroy"),this.off(),this.events&&(this.events.destroy(),this.events=null),this.clearCheckLoadingTimeout(),this.clearStatsInterval(),this.clearVisibilityHiddenTimeout(),e.t0=this.decoderWorker,!e.t0){e.next=12;break}return e.next=11,this.decoderWorker.destroy();case 11:this.decoderWorker=null;case 12:return e.next=14,this._destroy();case 14:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"_destroy",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this._loading=!1,this._playing=!1,this._playbackPause=!1,this._hasLoaded=!1,this._lastVolume=null,this._zooming=!1,this._faceDetectActive=!1,this._objectDetectActive=!1,this._times={playInitStart:"",playStart:"",streamStart:"",streamResponse:"",demuxStart:"",decodeStart:"",videoStart:"",playTimestamp:"",streamTimestamp:"",streamResponseTimestamp:"",demuxTimestamp:"",decodeTimestamp:"",videoTimestamp:"",allTimestamp:""},this.singleWatermark&&(this.singleWatermark.destroy(),this.singleWatermark=null),this.ghostWatermark&&(this.ghostWatermark.destroy(),this.ghostWatermark=null),this.dynamicWatermark&&(this.dynamicWatermark.destroy(),this.dynamicWatermark=null),this.pressureObserverCpu&&(this.pressureObserverCpu.destroy(),this.pressureObserverCpu=null),this.stream&&(this.stream.destroy(),this.stream=null),e.t0=this.hlsDecoder,!e.t0){e.next=19;break}return e.next=18,this.hlsDecoder.destroy();case 18:this.hlsDecoder=null;case 19:this.mseDecoder&&(this.mseDecoder.destroy(),this.mseDecoder=null),this.webrtc&&(this.webrtc.destroy(),this.webrtc=null),this.video&&(this.video.destroy(),this.video=null),this.audio&&(this.audio.destroy(),this.audio=null),this.recorder&&(this.recorder.destroy(),this.recorder=null),this.control&&(this.control.destroy(),this.control=null),this.webcodecsDecoder&&(this.webcodecsDecoder.destroy(),this.webcodecsDecoder=null),this.demux&&(this.demux.destroy(),this.demux=null),this.playback&&(this.playback.destroy(),this.playback=null),this.zoom&&(this.zoom.destroy(),this.zoom=null),this.ai&&(this.ai.destroy(),this.ai=null),this.keepScreenOn&&(this.releaseWakeLock(),this.keepScreenOn.destroy(),this.keepScreenOn=null),this.resetStats(),this._audioTimestamp=0,this._latestAudioTimestamp=0,this._videoTimestamp=0,this._streamQuality="",this._visibility=!0,this._isInZoom=!1,this._playingStartTimestamp=null,this._lastestVisibilityChangeTimestamp=null,this._videoIframeIntervalTs=null,this._tempWorkerStats=null,this._tempStreamList=[],this._tempInnerPlayBgobj={},this._flvMetaData=null,this._flvMetaDataFps=null,this.debug.log("play","destroy end"),this._opt=en(),this.$container=null;case 49:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"fullscreen",get:function(){return Br.isFullscreen||this.webFullscreen},set:function(e){na()&&this._opt.useWebFullScreen?this.webFullscreen=e:this.emit(it.fullscreen,e)}},{key:"webFullscreen",get:function(){return this.$container.classList.contains("jessibuca-fullscreen-web")},set:function(e){var t=this;this.emit(it.webFullscreen,e),setTimeout((function(){t.updateOption({rotate:e?270:0}),t.resize()}),10)}},{key:"loaded",get:function(){return this._hasLoaded||this.isOldHls()||this.isWebrtcH264()||this._opt.useMSE&&an(this._opt.hasAudio)&&an(this._opt.demuxUseWorker)||this._opt.useWCS&&!this._opt.hasAudio&&an(this._opt.demuxUseWorker)},set:function(e){this._hasLoaded=e}},{key:"playing",get:function(){return this._playing},set:function(e){e&&rn(this.loading)&&(this.loading=!1),this.playing!==e&&(this._playing=e,this.emit(it.playing,e),this.emit(it.volumechange,this.volume),e?this.emit(it.play):this.emit(it.pause))}},{key:"volume",get:function(){return this.audio&&this.audio.volume||0},set:function(e){e!==this.volume&&(this.audio?(this.audio.setVolume(e),this._lastVolume=this.volume):this.debug.warn(this.TAG_NAME,"set volume error, audio is null"))}},{key:"lastVolume",get:function(){return this._lastVolume}},{key:"loading",get:function(){return this._loading},set:function(e){this.loading!==e&&(this._loading=e,this.emit(it.loading,this._loading))}},{key:"zooming",get:function(){return this._zooming},set:function(e){this.zooming!==e&&(this.zoom||(this.zoom=new ay(this)),this._zooming=e,this.emit(it.zooming,this.zooming))}},{key:"recording",get:function(){return!!this.recorder&&this.recorder.isRecording},set:function(e){e?this.playing&&!this.recording&&(this.recorder&&this.recorder.startRecord(),this.isDemuxInWorker()&&this.decoderWorker.updateWorkConfig({key:"isRecording",value:!0})):this.recording&&(this.isDemuxInWorker()&&this.decoderWorker.updateWorkConfig({key:"isRecording",value:!1}),this.recorder&&this.recorder.stopRecordAndSave().then((function(){}))["catch"]((function(e){})))}},{key:"audioTimestamp",get:function(){return this._audioTimestamp},set:function(e){null!==e&&(this._audioTimestamp=e)}},{key:"latestAudioTimestamp",get:function(){return this._latestAudioTimestamp},set:function(e){null!==e&&(this._latestAudioTimestamp=e)}},{key:"videoTimestamp",get:function(){return this._stats.currentPts||this._stats.ts}},{key:"streamQuality",get:function(){return this._streamQuality},set:function(e){this.streamQuality!==e&&(this._streamQuality=e,this.emit(it.streamQualityChange,e))}},{key:"isDebug",get:function(){return rn(this._opt.debug)}},{key:"scaleType",get:function(){var e=this._opt,t=e.isResize,i=e.isFullResize,r=Mt;return an(i)&&an(t)?r=Mt:an(i)&&rn(t)?r=Ft:rn(i)&&rn(t)&&(r=Ut),r}},{key:"visibility",get:function(){return this._visibility},set:function(e){this._visibility!==e&&(this._visibility=e,this.emit(it.visibilityChange,e),this._lastestVisibilityChangeTimestamp=$r(),e?this.clearVisibilityHiddenTimeout():this.startVisibilityHiddenTimeout())}},{key:"playbackPause",get:function(){return this.isPlayback()&&this._playbackPause},set:function(e){this._playbackPause!==e&&(this._playbackPause=e,this.emit(it.playbackPause,e),this.emit(it.playbackPauseOrResume,e))}},{key:"videoIframeIntervalTs",get:function(){return this._videoIframeIntervalTs},set:function(e){this._videoIframeIntervalTs=e}},{key:"faceDetectActive",get:function(){return this._faceDetectActive},set:function(e){this._faceDetectActive!==e&&(this._faceDetectActive=e,this.emit(it.faceDetectActive,e))}},{key:"objectDetectActive",get:function(){return this._objectDetectActive},set:function(e){this._objectDetectActive!==e&&(this._objectDetectActive=e,this.emit(it.objectDetectActive,e))}},{key:"isUseWorkerDemuxAndDecode",get:function(){return this.stream&&this.stream.getStreamType()===l}},{key:"isDestroyed",value:function(){return this._destroyed}},{key:"isPlaying",value:function(){var e=!1;return this._opt.playType===u?e=this.playing:this._opt.playType===A&&(e=an(this.playbackPause)&&this.playing),e}},{key:"updateOption",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this._opt=Object.assign({},this._opt,e),rn(i)&&this.decoderWorker&&Object.keys(e).forEach((function(i){t.decoderWorker.updateWorkConfig({key:i,value:e[i]})}))}},{key:"init",value:function(){var e=this;return new Promise((function(t,i){e.video||e._opt.hasVideo&&(e.video=new Mn(e)),e.audio||e._opt.hasAudio&&(e.audio=new is(e)),e.stream||(e.stream=new us(e)),e.isOldHls()?(e.hlsDecoder||(e.hlsDecoder=new Em(e),e.loaded=!0),t()):e.isWebrtcH264()?(e.webrtc||(e._opt.isWebrtcForZLM?e.webrtc=new iy(e):e._opt.isWebrtcForSRS?e.webrtc=new oy(e):e._opt.isWebrtcForOthers?e.webrtc=new cy(e):e.webrtc=new ty(e),e.loaded=!0),t()):(e.demux||e._opt.hasVideo&&!e.isUseWorkerDemuxAndDecode&&(e.demux=new Mc(e)),e._opt.useWCS&&(e.webcodecsDecoder||(e.webcodecsDecoder=new Fc(e))),e._opt.useMSE&&(e.mseDecoder||(e._opt.isNewMseDecoder?e.mseDecoder=new al(e):e.mseDecoder=new rl(e))),e.isUseHls265()&&(e.hlsDecoder||(e.hlsDecoder=new Zg(e))),e.isWebrtcH265()&&(e.webrtc||(e.webrtc=new ty(e))),e.decoderWorker?e.loaded?t():e.once(it.decoderWorkerInit,(function(){e.isDestroyed()?(e.debug.error(e.TAG_NAME,"init() failed and player is destroyed"),i("init() failed and player is destroyed")):(e.loaded=!0,t())})):Va(e._opt)?t():(e.decoderWorker=new Ys(e),e.once(it.decoderWorkerInit,(function(){e.isDestroyed()?(e.debug.error(e.TAG_NAME,"init() failed and player is destroyed"),i("init() failed and player is destroyed")):(e.loaded=!0,t())}))))}))}},{key:"play",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,a){if(!e&&!t._opt.url)return a("url is empty");t.loading=!0,t.playing=!1,t._times.playInitStart=$r(),e||(e=t._opt.url),t._opt.url=e,t.control&&t._opt.loadingBackground&&t.control.initLoadingBackground(),t.init().then((function(){t.debug.log(t.TAG_NAME,"play() init and next fetch stream"),t._times.playStart=$r(),t._opt.isNotMute&&t.mute(!1),t.webcodecsDecoder&&t.webcodecsDecoder.once(nt.webcodecsH265NotSupport,(function(){t.emitError(nt.webcodecsH265NotSupport)})),t.mseDecoder&&(t.mseDecoder.once(nt.mediaSourceH265NotSupport,(function(){t.emitError(nt.mediaSourceH265NotSupport)})),t.mseDecoder.once(nt.mediaSourceFull,(function(){t.emitError(nt.mediaSourceFull)})),t.mseDecoder.once(nt.mediaSourceAppendBufferError,(function(){t.emitError(nt.mediaSourceAppendBufferError)})),t.mseDecoder.once(nt.mediaSourceDecoderConfigurationError,(function(){t.emitError(nt.mediaSourceDecoderConfigurationError)})),t.mseDecoder.once(nt.mediaSourceTsIsMaxDiff,(function(){t.emitError(nt.mediaSourceTsIsMaxDiff)}))),t.enableWakeLock(),t.checkLoadingTimeout(),t.stream?(t.stream.once(nt.fetchError,(function(e){t.emitError(nt.fetchError,e)})),t.stream.once(nt.websocketError,(function(e){t.emitError(nt.websocketError,e)})),t.stream.once(it.streamEnd,(function(){t.emit(it.streamEnd)})),t.stream.once(nt.hlsError,(function(e){t.emitError(nt.hlsError,e)})),t.stream.once(nt.webrtcError,(function(e){t.emitError(nt.webrtcError,e)})),t.stream.once(it.streamSuccess,(function(){r(),t._times.streamResponse=$r(),t.video&&t.video.play(),t.checkStatsInterval(),t.isPlayback()&&t.playback&&t.playback.startCheckStatsInterval()})),t.stream.fetchStream(e,i)):(t.debug.warn(t.TAG_NAME,"play() this.stream is null and is destroy is ".concat(t.isDestroyed())),a("this.stream is null"))}))["catch"]((function(e){a(e)}))}))}},{key:"playForControl",value:function(){var e=this;return new Promise((function(t,i){e.debug.log(e.TAG_NAME,"playForControl() and pauseAndNextPlayUseLastFrameShow is ".concat(e._opt.pauseAndNextPlayUseLastFrameShow)),e._opt.pauseAndNextPlayUseLastFrameShow&&e._tempInnerPlayBgobj&&e._tempInnerPlayBgobj.loadingBackground&&e.updateOption({loadingBackground:e._tempInnerPlayBgobj.loadingBackground,loadingBackgroundWidth:e._tempInnerPlayBgobj.loadingBackgroundWidth,loadingBackgroundHeight:e._tempInnerPlayBgobj.loadingBackgroundHeight}),e.play().then((function(e){t(e)}))["catch"]((function(e){i(e)}))}))}},{key:"close",value:function(){var e=this;return new Promise((function(t,i){e._close().then((function(){e.video&&e.video.clearView(),t()}))["catch"]((function(e){i(e)}))}))}},{key:"resumeAudioAfterPause",value:function(){this.lastVolume&&(this.volume=this.lastVolume)}},{key:"_close",value:function(){var e=this;return new Promise((function(t,i){e.loading=!1,e.recording=!1,e.zooming=!1,e.playing=!1,e.clearCheckLoadingTimeout(),e.clearStatsInterval(),e.isPlayback()&&e.playback&&e.playback.clearStatsInterval(),e.releaseWakeLock(),e.resetStats(),e._audioTimestamp=0,e._videoTimestamp=0,e._times={playInitStart:"",playStart:"",streamStart:"",streamResponse:"",demuxStart:"",decodeStart:"",videoStart:"",playTimestamp:"",streamTimestamp:"",streamResponseTimestamp:"",demuxTimestamp:"",decodeTimestamp:"",videoTimestamp:"",allTimestamp:""};var r=function(){e.stream&&(e.stream.destroy(),e.stream=null),e.demux&&(e.demux.destroy(),e.demux=null),e.webcodecsDecoder&&(e.webcodecsDecoder.destroy(),e.webcodecsDecoder=null),e.mseDecoder&&(e.mseDecoder.destroy(),e.mseDecoder=null),e.hlsDecoder&&(e.hlsDecoder.destroy(),e.hlsDecoder=null),e.webrtc&&(e.webrtc.destroy(),e.webrtc=null),e.audio&&(e.audio.destroy(),e.audio=null),e.video&&(e.video.resetInit(),e.video.pause(!0))};e.decoderWorker?e.decoderWorker.destroy().then((function(){e.decoderWorker=null,r(),setTimeout((function(){t()}),0)}))["catch"]((function(t){e.debug&&e.debug.error(e.TAG_NAME,"close() decoderWorker.destroy() error",t),i()})):(r(),setTimeout((function(){t()}),0))}))}},{key:"pause",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise((function(i,r){t?e.close().then((function(){i()}))["catch"]((function(e){r(e)})):e._close().then((function(){i()}))["catch"]((function(e){r(e)}))}))}},{key:"pauseForControl",value:function(){var e=this;return new Promise((function(t,i){if(e.debug.log(e.TAG_NAME,"_pauseInner()"),e._opt.pauseAndNextPlayUseLastFrameShow&&e.video){var r=e.video.screenshot("","png",.92,"base64");if(r){var a=e.getVideoInfo();a?(e.debug.log(e.TAG_NAME,"pauseForControl() and loadingBackground width is ".concat(a.width," and height is ").concat(a.height)),e._tempInnerPlayBgobj={loadingBackground:r,loadingBackgroundWidth:a.width,loadingBackgroundHeight:a.height}):e.debug.warn(e.TAG_NAME,"pauseForControl() and videoInfo is null")}else e.debug.warn(e.TAG_NAME,"pauseForControl() and loadingBackground is null")}e.pause().then((function(e){t(e)}))["catch"]((function(e){i(e)}))}))}},{key:"isAudioMute",value:function(){var e=!0;return this.audio&&(e=this.audio.isMute),e}},{key:"isAudioNotMute",value:function(){return!this.isAudioMute()}},{key:"mute",value:function(e){this.audio&&this.audio.mute(e)}},{key:"resize",value:function(){this.video&&this.video.resize()}},{key:"startRecord",value:function(e,t){this.recording||(this.recorder.setFileName(e,t),this.recording=!0)}},{key:"stopRecordAndSave",value:function(e,t){var i=this;return new Promise((function(r,a){i.recorder||a("recorder is null"),i.recording?(i._opt.useWasm&&i.decoderWorker.updateWorkConfig({key:"isRecording",value:!1}),i.recorder.stopRecordAndSave(e,t).then((function(e){r(e)}))["catch"]((function(e){a(e)}))):a("recorder is not recording")}))}},{key:"_hasControl",value:function(){var e=this,t=!1,i=!1;return Object.keys(this._opt.operateBtns).forEach((function(t){e._opt.operateBtns[t]&&-1===(""+t).indexOf("Fn")&&(i=!0)})),(this._opt.showBandwidth||i)&&(t=!0),this.isPlayback()&&this._opt.playbackConfig.showControl&&(t=!0),t}},{key:"useWasmDecode",value:function(){return an(this._opt.useMSE)&&an(this._opt.useWCS)}},{key:"canVideoTrackWritter",value:function(){var e=this._opt;return!this.isOldHls()&&!this.isWebrtcH264()&&an(e.useMSE)&&(e.useWCS&&an(e.useOffscreen)&&e.wcsUseVideoRender||this.useWasmDecode())}},{key:"checkHeartTimeout$2",value:function(){if(an(this.playbackPause)&&this.playing){if(this.isDestroyed())return void(this.debug&&this.debug.warn(this.TAG_NAME,"checkHeartTimeout$2 but player is destroyed"));if(an(this.isHistoryFpsListAllZero()))return void(this.debug&&this.debug.warn(this.TAG_NAME,"checkHeartTimeout$2 but fps is not all zero"));if(0!==this._stats.fps)return void(this.debug&&this.debug.warn(this.TAG_NAME,"checkHeartTimeout$2 but fps is ".concat(this._stats.fps)));if(an(this.visibility)&&0!==this._stats.vbps)return void(this.debug&&this.debug.warn(this.TAG_NAME,"checkHeartTimeout$2 but page is not visibility and vbps is ".concat(this._stats.vbps)));var e=this._historyFpsList.join(",");this.debug.warn(this.TAG_NAME,"checkHeartTimeout$2 and\n pause and emit delayTimeout event and\n current vbps is ".concat(this._stats.vbps," and\n current fps is ").concat(this._stats.fps," and\n history FpsList is ").concat(e," and\n current visibility is ").concat(this.visibility," and")),this.emit(it.timeout,it.delayTimeout),this.emit(it.delayTimeout)}else this.debug.log(this.TAG_NAME,"checkHeartTimeout$2 playbackPause is ".concat(this.playbackPause,", playing is ").concat(this.playing))}},{key:"checkStatsInterval",value:function(){var e=this;this._checkStatsInterval=setInterval((function(){e.updateStats()}),1e3)}},{key:"checkLoadingTimeout",value:function(){var e=this;this._checkLoadingTimeout=setTimeout((function(){e.playing?e.debug.warn(e.TAG_NAME,"checkLoadingTimeout but loading is ".concat(e.loading," and playing is ").concat(e.playing)):e.isDestroyed()?e.debug&&e.debug.warn(e.TAG_NAME,"checkLoadingTimeout but player is destroyed"):(e.debug.warn(e.TAG_NAME,"checkLoadingTimeout and pause and emit loadingTimeout event"),e.emit(it.timeout,it.loadingTimeout),e.emit(it.loadingTimeout))}),1e3*this._opt.loadingTimeout)}},{key:"clearCheckLoadingTimeout",value:function(){this._checkLoadingTimeout&&(this.debug.log(this.TAG_NAME,"clearCheckLoadingTimeout"),clearTimeout(this._checkLoadingTimeout),this._checkLoadingTimeout=null)}},{key:"clearStatsInterval",value:function(){this._checkStatsInterval&&(clearInterval(this._checkStatsInterval),this._checkStatsInterval=null)}},{key:"handleRender",value:function(){this.isDestroyed()?this.debug&&this.debug.warn(this.TAG_NAME,"handleRender but player is destroyed"):(this.loading&&(this.clearCheckLoadingTimeout(),this.loading=!1,this.emit(it.start)),this.playing||(this.playing=!0))}},{key:"updateStats",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._startBpsTime||(this._startBpsTime=$r()),Ta(e.ts)){var t=parseInt(e.ts,10);this._stats.ts=t,null===this._playingStartTimestamp&&t>0&&(this._playingStartTimestamp=t)}Ta(e.dts)&&(this._stats.dts=parseInt(e.dts,10)),Ta(e.mseTs)&&(this._stats.mseTs=e.mseTs),Ta(e.buf)&&(this._stats.buf=e.buf),Ta(e.netBuf)&&(this._stats.netBuf=e.netBuf),Ta(e.currentPts)&&(this._stats.currentPts=e.currentPts),e.fps&&(this._stats.fps+=1),e.dfps&&(this._stats.dfps+=1),e.abps&&(this._stats.abps+=e.abps),e.vbps&&(this._stats.vbps+=e.vbps),e.workerStats&&(this._tempWorkerStats=e.workerStats),e.isDropping&&(this._stats.isDropping=e.isDropping),e.mseVideoBufferDelayTime&&(this._stats.mseVideoBufferDelayTime=parseInt(1e3*e.mseVideoBufferDelayTime,10));var i=$r();if(!(i-this._startBpsTime<1e3)){null!==this._playingStartTimestamp&&this._stats.fps>0&&(this._stats.pTs+=1);var r=0,a=0,n=0,s=0;this._opt.useMSE&&this.mseDecoder&&(r=this.mseDecoder.checkSourceBufferDelay(),r=parseInt(1e3*r,10),a=this.mseDecoder.checkSourceBufferStore(),a=a.toFixed(2),n=this.mseDecoder.getDecodeDiffTimes(),s=this.mseDecoder.getDecodePlaybackRate()),this._opt.useWCS&&this.webcodecsDecoder&&(n=this.webcodecsDecoder.getDecodeDiffTimes()),this.isOldHls()&&this.hlsDecoder&&(r=this.hlsDecoder.checkHlsBufferedDelay(),r=parseInt(1e3*r,10));var o=0,c=0,l=0;this.isUseHls265()&&this.hlsDecoder&&(r=this.hlsDecoder.checkHlsBufferedDelay(),r=r.toFixed(2),o=this.hlsDecoder.getDemuxBufferedListLength(),l=this.hlsDecoder.getDemuxVideoBufferedListLength(),c=this.hlsDecoder.getDemuxAudioBufferedListLength());var u=0,d=0,h=0,f=!1,p=0;this._opt.useWasm||this._opt.demuxUseWorker?this._tempWorkerStats&&(d=this._tempWorkerStats.demuxBufferDelay,h=this._tempWorkerStats.audioDemuxBufferDelay,u=this._tempWorkerStats.flvBufferByteLength,this._stats.netBuf=this._tempWorkerStats.netBuf,p=this._tempWorkerStats.pushLatestDelay,f=this._tempWorkerStats.isStreamTsMoreThanLocal):this.demux&&(u=this.demux.getInputByteLength(),p=this.demux.getPushLatestDelay(),f=this.demux.getIsStreamTsMoreThanLocal(),this.demux.bufferList&&(d=this.demux.bufferList.length));var m=0,g=0;this.audio&&this.audio.bufferList&&(m=this.audio.bufferList.length,g=parseInt(m*this.audio.oneBufferDuration,10));var y=0,v=0;if(this.isPlayback()&&this.video){this._opt.playbackConfig.isUseFpsRender&&(y=this.video.bufferList&&this.video.bufferList.length||0);var b=this.video.getStreamFps(),A=b>0?1e3/b:0;v=parseInt(A*y+A*d,10)}var k=this._stats.dts-this.videoTimestamp,_=k+this._stats.netBuf;this.isOldHls()&&(this._stats.fps=this.hlsDecoder.getFps()),this._stats.fps>this._stats.maxFps&&(this._stats.maxFps=this._stats.fps);var w=this.getVideoCurrentTime(),S=this._stats.videoCurrentTime,T=0;S&&w&&(T=(w-S).toFixed(2),w=w.toFixed(2));var E=0;this.audioTimestamp>0&&(E=this.audioTimestamp-this.getRenderCurrentPts()),this._allStatsData=Object.assign(this._stats,{audioBuffer:m,audioBufferDelayTs:g,audioTs:this.audioTimestamp,latestAudioTs:this.latestAudioTimestamp,playbackVideoBuffer:y,playbackVideoWaitingBuffer:0,playbackAudioWaitingBuffer:0,playbackCacheDataDuration:v,demuxBuffer:d,pushLatestDelay:p,audioDemuxBuffer:h,flvBuffer:u,mseDelay:r,mseStore:a,mseDecodeDiffTimes:n,mseDecodePlaybackRate:s,wcsDecodeDiffTimes:n,hlsDelay:r,hlsDemuxLength:o,hlsDemuxAudioLength:c,hlsDemuxVideoLength:l,delayTs:k,totalDelayTs:_,isStreamTsMoreThanLocal:f,videoCurrentTime:w,videoCurrentTimeDiff:T,audioSyncVideo:E});var x=null,C=null;this.isPlayer()&&this._opt.hasVideo&&this.playing&&(x=function(e,t){var i=3,r=t||25;return e<.33*r?i=0:e<.5*r?i=1:e<.83*r&&(i=2),i}(this._stats.fps,this._flvMetaDataFps),this._allStatsData.performance=x,C=this.checkVideoSmooth(this._allStatsData),this._allStatsData.videoSmooth=C),this.emit(it.stats,this._allStatsData),this._allStatsData.flvBuffer>1048576&&this.emit(nt.flvDemuxBufferSizeTooLarge,this._allStatsData.flvBuffer),this._opt.hasVideo?(this.updateHistoryFpsList(this._stats.fps),Ta(x)&&this.emit(it.performance,x),Ta(C)&&this.emit(it.videoSmooth,C)):this._opt.hasAudio&&this.updateHistoryFpsList(this._stats.abps),this._stats.fps=0,this._stats.dfps=0,this._stats.abps=0,this._stats.vbps=0,this._stats.isDropping=!1,this._startBpsTime=i}}},{key:"resetStats",value:function(){this._startBpsTime=null,this._playingStartTimestamp=null,this._historyFpsList=[],this._stats={buf:0,netBuf:0,fps:0,maxFps:0,dfps:0,abps:0,vbps:0,ts:0,mseTs:0,currentPts:0,pTs:0,dts:0,mseVideoBufferDelayTime:0,isDropping:!1},this._allStatsData={}}},{key:"checkVideoSmooth",value:function(e){var t=!0,i=this._opt.videoBuffer+this._opt.videoBufferDelay;if(0===e.vbps&&(this.debug.log(this.TAG_NAME,"checkVideoSmooth false because vbps is 0"),t=!1),t&&e.isDropping&&(this.debug.log(this.TAG_NAME,"checkVideoSmooth false because isDropping is true"),t=!1),t&&e.pushLatestDelay>i&&(this.debug.log(this.TAG_NAME,"checkVideoSmooth false because pushLatestDelay is ".concat(e.pushLatestDelay," > maxDelay is ").concat(i)),t=!1),t&&this.visibility&&this._historyFpsList.length>=this._opt.heartTimeout){var r=this._historyFpsList.reduce((function(e,t){return e+t}),0)/this._historyFpsList.length,a=.83*r;e.fps<a&&(this.debug.log(this.TAG_NAME,"checkVideoSmooth false because fps is ".concat(e.fps," < choppyFps is ").concat(a," and avgFps is ").concat(r)),t=!1)}return t&&this.visibility&&this._opt.useMSE&&(e.videoCurrentTimeDiff>=1.5||e.videoCurrentTimeDiff<=.5)&&(this.debug.log(this.TAG_NAME,"checkVideoSmooth false because videoCurrentTimeDiff is ".concat(e.videoCurrentTimeDiff)),t=!1),t}},{key:"enableWakeLock",value:function(){this._opt.keepScreenOn&&this.keepScreenOn&&this.keepScreenOn.enable()}},{key:"releaseWakeLock",value:function(){this._opt.keepScreenOn&&this.keepScreenOn&&this.keepScreenOn.disable()}},{key:"clearBufferDelay",value:function(){this._opt.useWasm?this.decoderWorker&&this.decoderWorker.clearWorkBuffer(!0):this.demux&&this.demux.clearBuffer(!0)}},{key:"doDestroy",value:function(){this.emit(it.beforeDestroy)}},{key:"handlePlayToRenderTimes",value:function(){var e=this.getPlayToRenderTimes();this.emit(it.playToRenderTimes,e)}},{key:"getPlayToRenderTimes",value:function(){var e=this._times;return e.playTimestamp=e.playStart-e.playInitStart,e.streamTimestamp=e.streamStart-e.playStart,e.streamResponseTimestamp=e.streamResponse-e.streamStart,e.demuxTimestamp=e.demuxStart-e.streamResponse>0?e.demuxStart-e.streamResponse:0,e.decodeTimestamp=e.decodeStart-e.demuxStart>0?e.decodeStart-e.demuxStart:0,e.videoTimestamp=e.videoStart-e.decodeStart,e.allTimestamp=e.videoStart-e.playInitStart,e}},{key:"getOption",value:function(){return this._opt}},{key:"getPlayType",value:function(){return this._opt.playType}},{key:"isPlayer",value:function(){return this._opt.playType===u}},{key:"isPlayback",value:function(){return this._opt.playType===A}},{key:"isDemuxSetCodecInit",value:function(){var e=!0,t=this._opt;return t.useWCS&&!t.useOffscreen?e=!!this.webcodecsDecoder&&this.webcodecsDecoder.hasInit:t.useMSE&&(e=!!this.mseDecoder&&this.mseDecoder.hasInit),e}},{key:"isDemuxDecodeFirstIIframeInit",value:function(){var e=!0,t=this._opt;return t.useWCS&&!t.useOffscreen?e=!!this.webcodecsDecoder&&this.webcodecsDecoder.isDecodeFirstIIframe:t.useMSE&&(e=!!this.mseDecoder&&this.mseDecoder.isDecodeFirstIIframe),e}},{key:"isAudioPlaybackRateSpeed",value:function(){var e=!1;return this.audio&&(e=this.audio.isPlaybackRateSpeed()),e}},{key:"getPlayingTimestamp",value:function(){return this._stats.pTs}},{key:"getRecordingType",value:function(){var e=null;return this.recorder&&(e=this.recorder.getType()),e}},{key:"getRecordingByteLength",value:function(){var e=0;return this.recording&&(e=this.recorder.getToTalByteLength()),e}},{key:"getRecordingDuration",value:function(){var e=0;return this.recording&&(e=this.recorder.getTotalDuration()),e}},{key:"getDecodeType",value:function(){var e="",t=this.getOption();return t.useMSE&&(e+=N+" "),t.useWCS&&(e+=z+" "),t.useWasm&&(e+=H+" ",t.useSIMD&&(e+=V+" "),t.useMThreading&&(e+=W+" ")),t.useOffscreen&&(e+=G+" "),e}},{key:"getDemuxType",value:function(){var e="";return e=this.getOption().demuxType,e}},{key:"getRenderType",value:function(){var e="";return this.video&&(e=this.video.getType()),e}},{key:"getCanvasRenderType",value:function(){var e="";return this.video&&(e=this.video.getCanvasType()),e}},{key:"getAudioEngineType",value:function(){var e="";return this.audio&&(e=this.audio.getEngineType()),e}},{key:"getStreamType",value:function(){var e="";return this.stream&&(e=this.stream.getStreamType()),e}},{key:"getAllStatsData",value:function(){return this._allStatsData}},{key:"togglePerformancePanel",value:function(e){this.updateOption({showPerformance:e}),this.emit(it.togglePerformancePanel,e)}},{key:"setScaleMode",value:function(e){var t={isFullResize:!1,isResize:!1,aspectRatio:"default"};switch(e=Number(e)){case Mt:t.isFullResize=!1,t.isResize=!1;break;case Ft:t.isFullResize=!1,t.isResize=!0;break;case Ut:t.isFullResize=!0,t.isResize=!0}this.updateOption(t),this.resize(),this.emit(it.viewResizeChange,e)}},{key:"startVisibilityHiddenTimeout",value:function(){var e=this;this.clearVisibilityHiddenTimeout(),this._opt.pageVisibilityHiddenTimeout>0&&(this.visibilityHiddenTimeout=setTimeout((function(){e.emit(it.visibilityHiddenTimeout)}),1e3*this._opt.pageVisibilityHiddenTimeout))}},{key:"clearVisibilityHiddenTimeout",value:function(){this._checkVisibleHiddenTimeout&&(clearTimeout(this._checkVisibleHiddenTimeout),this._checkVisibleHiddenTimeout=null)}},{key:"faceDetect",value:function(e){this.faceDetectActive=e}},{key:"objectDetect",value:function(e){this.objectDetectActive=e}},{key:"downloadNakedFlowFile",value:function(){this.demux&&this.demux.downloadNakedFlowFile&&this.demux.downloadNakedFlowFile()}},{key:"downloadFmp4File",value:function(){this.demux&&this.demux.downloadFmp4File&&this.demux.downloadFmp4File()}},{key:"downloadMpeg4File",value:function(){var e=new Blob([this._tempStreamList]);try{var t=document.createElement("a");t.href=window.URL.createObjectURL(e),t.download=Date.now()+".mpeg4",t.click(),window.URL.revokeObjectURL(t.href)}catch(t){console.error("downloadMpeg4File",t)}}},{key:"hasCacheOnGopBuffer",value:function(){var e=this.videoIframeIntervalTs,t=this._allStatsData.demuxBuffer,i=this._allStatsData.maxFps,r=!1;return e&&t&&i&&(r=1e3/i*t>e),r}},{key:"addContentToCanvas",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.video&&this.video.addContentToCanvas(e)}},{key:"sendWebsocketMessage",value:function(e){var t=this.getStreamType();t===r||t===l+" "+r?this.stream.sendMessage(e):this.debug.warn(this.TAG_NAME,"sendWebsocketMessage: stream type is not websocket, current stream type is ".concat(this.getStreamType()))}},{key:"checkIsInRender",value:function(){var e=this._stats;return e.vbps>0&&e.fps>0}},{key:"setControlHtml",value:function(e){this.control&&this.control.$controlHtml&&(this.control.$controlHtml.innerHTML=e)}},{key:"clearControlHtml",value:function(){this.control&&this.control.$controlHtml&&(this.control.$controlHtml.innerHTML="")}},{key:"updateWatermark",value:function(e){this.singleWatermark&&this.singleWatermark.update(e)}},{key:"removeWatermark",value:function(){this.singleWatermark&&this.singleWatermark.remove()}},{key:"getVideoInfo",value:function(){var e=null;return this.video&&(e=this.video.getVideoInfo()),e}},{key:"getAudioInfo",value:function(){var e=null;return this.audio&&(e=this.audio.getAudioInfo()),e}},{key:"getVideoPlaybackQuality",value:function(){var e=null;return this.video&&(e=this.video.getPlaybackQuality()),e}},{key:"emitError",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this.emit(it.error,e,t),this.emit(e,t)}},{key:"updateHistoryFpsList",value:function(e){this.playbackPause||(this._historyFpsList.length>this._opt.heartTimeout&&this._historyFpsList.shift(),this._historyFpsList.push(e),this.isHistoryFpsListAllZero()&&this.checkHeartTimeout$2())}},{key:"isHistoryFpsListAllZero",value:function(){var e=!0;if(this._historyFpsList.length<this._opt.heartTimeout&&(e=!1),e)for(var t=0;t<this._historyFpsList.length;t++)if(this._historyFpsList[t]>0){e=!1;break}return e}},{key:"isUseHls265",value:function(){return rn(this._opt.isHls)&&rn(this._opt.supportHls265)}},{key:"isOldHls",value:function(){return rn(this._opt.isHls)&&an(this._opt.supportHls265)}},{key:"isWebrtcNotH265",value:function(){return rn(this._opt.isWebrtc)&&an(this._opt.isWebrtcH265)}},{key:"isWebrtcH264",value:function(){return rn(this._opt.isWebrtc)&&an(this._opt.isWebrtcH265)}},{key:"isWebrtcH265",value:function(){return rn(this._opt.isWebrtc)&&rn(this._opt.isWebrtcH265)}},{key:"isStreamWebTransport",value:function(){return this.getStreamType()===c}},{key:"isPlaybackCacheBeforeDecodeForFpsRender",value:function(){return rn(this.isPlayback())&&rn(this._opt.playbackConfig.isCacheBeforeDecodeForFpsRender)&&this._opt.useWCS}},{key:"isPlaybackUseWCS",value:function(){return rn(this.isPlayback())&&this._opt.useWCS}},{key:"isPlaybackUseMSE",value:function(){return rn(this.isPlayback())&&this._opt.useMSE}},{key:"isInWebFullscreen",value:function(){return this._opt.useWebFullScreen&&na()&&this.fullscreen}},{key:"getPlaybackRate",value:function(){var e=1;return rn(this.isPlayback())&&this.playback&&(e=this.playback.rate),e}},{key:"isPlaybackOnlyDecodeIFrame",value:function(){return rn(this.isPlayback())&&this.getPlaybackRate()>=this._opt.playbackForwardMaxRateDecodeIFrame}},{key:"pushTempStream",value:function(e){var t=new Uint8Array(e);this._tempStreamList.push(t)}},{key:"updateLoadingText",value:function(e){this.loading&&this.control&&this.control.updateLoadingText(e)}},{key:"getVideoCurrentTime",value:function(){var e=0;return this.video&&this._opt.useMSE&&this.mseDecoder&&(e=this.mseDecoder.getVideoCurrentTime()),e}},{key:"addMemoryLog",value:function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];this.emit.apply(this,[it.memoryLog," [".concat(e,"] ")].concat(i))}},{key:"downloadMemoryLog",value:function(){this.emit(it.downloadMemoryLog)}},{key:"isInMulti",value:function(){return-1!==this._opt.multiIndex}},{key:"isWebrtcForM7S",value:function(){return an(this._opt.isWebrtcForZLM)&&an(this._opt.isWebrtcForSRS)&&an(this._opt.isWebrtcForOthers)}},{key:"updateMetaData",value:function(e){if(this.debug.log(this.TAG_NAME,"updateMetaData",JSON.stringify(e)),this._flvMetaData=e,this._flvMetaData){var t=this._flvMetaData;if(ya(t.framerate)){var i=Math.floor(1e3*t.framerate);if(i>0){var r=i/1e3;this._flvMetaDataFps=r}}}this.emit(it.flvMetaData,e)}},{key:"getMetaData",value:function(){return this._flvMetaData}},{key:"getExtendBtnList",value:function(){return this.control.getExtendBtnList().map((function(e){return{name:e.name,$container:e.$iconContainer,$btn:e.$iconWrap,$activeBtn:e.$activeIconWrap}}))}},{key:"getCpuLevel",value:function(){var e=null;return this.pressureObserverCpu&&(e=this.pressureObserverCpu.getCurrentCpuState()),e}},{key:"isRecordTypeFlv",value:function(){return this.recorder&&this._opt.recordType===L}},{key:"isRecordTypeMp4",value:function(){return this.recorder&&this._opt.recordType===C}},{key:"isRecordTypeWebm",value:function(){return this.recorder&&this._opt.recordType===R}},{key:"isDemuxInWorker",value:function(){return this._opt.useWasm||this._opt.demuxUseWorker}},{key:"getAudioSyncVideoDiff",value:function(){return this.audioTimestamp-this.getRenderCurrentPts()}},{key:"getMseVideoBufferDelayTime",value:function(){var e=0;return this._opt.useMSE&&this.mseDecoder&&(e=this.mseDecoder.getVideoBufferDelayTime(),e=parseInt(1e3*e,10)),e}},{key:"updateCurrentPts",value:function(e){this.updateStats({currentPts:e}),this.emit(it.currentPts,e)}},{key:"getRenderCurrentPts",value:function(){var e=0;return e=this._stats.currentPts?this._stats.currentPts:this.videoTimestamp-this.getMseVideoBufferDelayTime(),e}},{key:"openSyncAudioAndVideo",value:function(){return this._opt.syncAudioAndVideo&&this._opt.hasVideo}},{key:"decoderCheckFirstIFrame",value:function(){rn(this._opt.checkFirstIFrame)&&(this.mseDecoder?this.mseDecoder.isDecodeFirstIIframe=!1:this.webcodecsDecoder&&(this.webcodecsDecoder.isDecodeFirstIIframe=!1))}}]),i}(fn),hy=function(){function e(t){Object(T["a"])(this,e);var i=t.fromSampleRate,r=t.toSampleRate,a=t.channels,n=t.inputBufferSize;if(!i||!r||!a)throw new Error("Invalid settings specified for the resampler.");this.resampler=null,this.fromSampleRate=i,this.toSampleRate=r,this.channels=a||0,this.inputBufferSize=n,this.initialize()}return Object(S["a"])(e,[{key:"initialize",value:function(){this.fromSampleRate==this.toSampleRate?(this.resampler=function(e){return e},this.ratioWeight=1):(this.fromSampleRate<this.toSampleRate?(this.linearInterpolation(),this.lastWeight=1):(this.multiTap(),this.tailExists=!1,this.lastWeight=0),this.initializeBuffers(),this.ratioWeight=this.fromSampleRate/this.toSampleRate)}},{key:"bufferSlice",value:function(e){try{return this.outputBuffer.subarray(0,e)}catch(t){try{return this.outputBuffer.length=e,this.outputBuffer}catch(i){return this.outputBuffer.slice(0,e)}}}},{key:"initializeBuffers",value:function(){this.outputBufferSize=Math.ceil(this.inputBufferSize*this.toSampleRate/this.fromSampleRate/this.channels*1.0000004768371582)+this.channels+this.channels;try{this.outputBuffer=new Float32Array(this.outputBufferSize),this.lastOutput=new Float32Array(this.channels)}catch(e){this.outputBuffer=[],this.lastOutput=[]}}},{key:"linearInterpolation",value:function(){var e=this;this.resampler=function(t){var i,r,a,n,s,o,c,l,u,d=t.length,h=e.channels;if(d%h!=0)throw new Error("Buffer was of incorrect sample length.");if(d<=0)return[];for(i=e.outputBufferSize,r=e.ratioWeight,a=e.lastWeight,n=0,s=0,o=0,c=0,l=e.outputBuffer;a<1;a+=r)for(s=a%1,n=1-s,e.lastWeight=a%1,u=0;u<e.channels;++u)l[c++]=e.lastOutput[u]*n+t[u]*s;for(a-=1,d-=h,o=Math.floor(a)*h;c<i&&o<d;){for(s=a%1,n=1-s,u=0;u<e.channels;++u)l[c++]=t[o+(u>0?u:0)]*n+t[o+(h+u)]*s;a+=r,o=Math.floor(a)*h}for(u=0;u<h;++u)e.lastOutput[u]=t[o++];return e.bufferSlice(c)}}},{key:"multiTap",value:function(){var e=this;this.resampler=function(t){var i,r,a,n,s,o,c,l,u,d,h,f=t.length,p=e.channels;if(f%p!=0)throw new Error("Buffer was of incorrect sample length.");if(f<=0)return[];for(i=e.outputBufferSize,r=[],a=e.ratioWeight,n=0,o=0,c=0,l=!e.tailExists,e.tailExists=!1,u=e.outputBuffer,d=0,h=0,s=0;s<p;++s)r[s]=0;do{if(l)for(n=a,s=0;s<p;++s)r[s]=0;else{for(n=e.lastWeight,s=0;s<p;++s)r[s]=e.lastOutput[s];l=!0}for(;n>0&&o<f;){if(c=1+o-h,!(n>=c)){for(s=0;s<p;++s)r[s]+=t[o+(s>0?s:0)]*n;h+=n,n=0;break}for(s=0;s<p;++s)r[s]+=t[o++]*c;h=o,n-=c}if(0!==n){for(e.lastWeight=n,s=0;s<p;++s)e.lastOutput[s]=r[s];e.tailExists=!0;break}for(s=0;s<p;++s)u[d++]=r[s]/a}while(o<f&&d<i);return e.bufferSlice(d)}}},{key:"resample",value:function(e){return this.fromSampleRate==this.toSampleRate?this.ratioWeight=1:(this.fromSampleRate<this.toSampleRate?this.lastWeight=1:(this.tailExists=!1,this.lastWeight=0),this.initializeBuffers(),this.ratioWeight=this.fromSampleRate/this.toSampleRate),this.resampler(e)}}]),e}(),fy=[255,511,1023,2047,4095,8191,16383,32767];function py(e,t,i){for(var r=0;r<i;r++)if(e<=t[r])return r;return i}function my(e){var t=[];return Array.prototype.slice.call(e).forEach((function(e,i){t[i]=function(e){var t,i,r;return e>=0?t=213:(t=85,(e=-e-1)<0&&(e=32767)),i=py(e,fy,8),i>=8?127^t:(r=i<<4,r|=i<2?e>>4&15:e>>i+3&15,r^t)}(e)})),t}function gy(e){var t=[];return Array.prototype.slice.call(e).forEach((function(e,i){t[i]=function(e){var t=0;e<0?(e=132-e,t=127):(e+=132,t=255);var i=py(e,fy,8);return i>=8?127^t:(i<<4|e>>i+3&15)^t}(e)})),t}var yy=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;Object(T["a"])(this,i);var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r=t.call(this),r._opt={},e&&(r.player=e),r.tag="talk";var n=$a(ir);return r._opt=Object.assign({},n,a),r._opt.sampleRate=parseInt(r._opt.sampleRate,10),r._opt.sampleBitsWidth=parseInt(r._opt.sampleBitsWidth,10),r.audioContext=null,r.gainNode=null,r.recorder=null,r.workletRecorder=null,r.biquadFilter=null,r.userMediaStream=null,r.clearWorkletUrlTimeout=null,r.bufferSize=512,r._opt.audioBufferLength=r.calcAudioBufferLength(),r.audioBufferList=[],r.socket=null,r.socketStatus=st,r.mediaStreamSource=null,r.heartInterval=null,r.checkGetUserMediaTimeout=null,r.wsUrl=null,r.startTimestamp=0,r.sequenceId=0,r.tempTimestamp=null,r.tempRtpBufferList=[],r.events=new hn(Object(v["a"])(r)),r._initTalk(),r.player||(r.debug=new Ir(Object(v["a"])(r))),r._opt.encType!==vi&&r._opt.encType!==bi||8e3===r._opt.sampleRate&&16===r._opt.sampleBitsWidth||r.warn(r.tag,"\n encType is ".concat(r._opt.encType," and sampleBitsWidth is ").concat(r._opt.sampleBitsWidth,", set sampleBitsWidth to ").concat(r._opt.sampleBitsWidth,"。\n ").concat(r._opt.encType," only support sampleRate 8000 and sampleBitsWidth 16")),r.log(r.tag,"init",JSON.stringify(r._opt)),r}return Object(S["a"])(i,[{key:"destroy",value:function(){this.clearWorkletUrlTimeout&&(clearTimeout(this.clearWorkletUrlTimeout),this.clearWorkletUrlTimeout=null),this.userMediaStream&&(this.userMediaStream.getTracks&&this.userMediaStream.getTracks().forEach((function(e){e.stop()})),this.userMediaStream=null),this.mediaStreamSource&&(this.mediaStreamSource.disconnect(),this.mediaStreamSource=null),this.recorder&&(this.recorder.disconnect(),this.recorder.onaudioprocess=null,this.recorder=null),this.biquadFilter&&(this.biquadFilter.disconnect(),this.biquadFilter=null),this.gainNode&&(this.gainNode.disconnect(),this.gainNode=null),this.workletRecorder&&(this.workletRecorder.disconnect(),this.workletRecorder=null),this.socket&&(this.socketStatus===ot&&this._sendClose(),this.socket.close(),this.socket=null),this._stopHeartInterval(),this._stopCheckGetUserMediaTimeout(),this.audioContext=null,this.gainNode=null,this.recorder=null,this.audioBufferList=[],this.sequenceId=0,this.wsUrl=null,this.tempTimestamp=null,this.tempRtpBufferList=[],this.startTimestamp=0,this.log("talk","destroy")}},{key:"addRtpToBuffer",value:function(e){var t=e.length+this.tempRtpBufferList.length,i=new Uint8Array(t);i.set(this.tempRtpBufferList,0),i.set(e,this.tempRtpBufferList.length),this.tempRtpBufferList=i}},{key:"downloadRtpFile",value:function(){var e=new Blob([this.tempRtpBufferList]);try{var t=document.createElement("a");t.href=window.URL.createObjectURL(e),t.download=Date.now()+".rtp",t.click(),window.URL.revokeObjectURL(t.href)}catch(t){console.error("downloadRtpFile",t)}}},{key:"calcAudioBufferLength",value:function(){var e=this._opt,t=e.sampleRate;e.sampleBitsWidth;return 8*t*.02/8}},{key:"socketStatusOpen",get:function(){return this.socketStatus===ot}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this._log.apply(this,["log"].concat(t))}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this._log.apply(this,["warn"].concat(t))}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];this._log.apply(this,["error"].concat(t))}},{key:"_log",value:function(e){for(var t,i,r,a=arguments.length,n=new Array(a>1?a-1:0),s=1;s<a;s++)n[s-1]=arguments[s];this.player?(t=this.player.debug)[e].apply(t,n):this.debug?(i=this.debug)[e].apply(i,n):(r=console)[e].apply(r,n)}},{key:"_getSequenceId",value:function(){return++this.sequenceId}},{key:"_createWebSocket",value:function(){var e=this;return new Promise((function(t,i){var r=e.events.proxy;e.socket=new WebSocket(e.wsUrl),e.socket.binaryType="arraybuffer",e.emit(it.talkStreamStart),r(e.socket,Qi,(function(){e.socketStatus=ot,e.log(e.tag,"websocket open -> do talk"),e.emit(it.talkStreamOpen),t(),e._doTalk()})),r(e.socket,Zi,(function(t){e.log(e.tag,"websocket message",t.data)})),r(e.socket,Xi,(function(t){e.socketStatus=ct,e.warn(e.tag,"websocket close -> reject",t),e.emit(it.talkStreamClose),i(t)})),r(e.socket,$i,(function(t){e.socketStatus=lt,e.error(e.tag,"websocket error -> reject",t),e.emit(it.talkStreamError,t),i(t)}))}))}},{key:"_sendClose",value:function(){}},{key:"_initTalk",value:function(){this._initMethods(),this._opt.engine===er?this._initWorklet():this._opt.engine===tr&&this._initScriptProcessor(),this.log(this.tag,"audioContext samplerate",this.audioContext.sampleRate)}},{key:"_initMethods",value:function(){this.audioContext=new(window.AudioContext||window.webkitAudioContext)({sampleRate:48e3}),this.gainNode=this.audioContext.createGain(),this.gainNode.gain.value=1,this.biquadFilter=this.audioContext.createBiquadFilter(),this.biquadFilter.type="lowpass",this.biquadFilter.frequency.value=3e3,this.resampler=new hy({fromSampleRate:this.audioContext.sampleRate,toSampleRate:this._opt.sampleRate,channels:this._opt.numberChannels,inputBufferSize:this.bufferSize})}},{key:"_initScriptProcessor",value:function(){var e=this,t=this.audioContext.createScriptProcessor||this.audioContext.createJavaScriptNode;this.recorder=t.apply(this.audioContext,[this.bufferSize,this._opt.numberChannels,this._opt.numberChannels]),this.recorder.onaudioprocess=function(t){return e._onaudioprocess(t)}}},{key:"_initWorklet",value:function(){var e=this,t=Wa((function(){var e=function(e){Object(_["a"])(i,e);var t=Object(w["a"])(i);function i(e){var r;return Object(T["a"])(this,i),r=t.call(this),r._cursor=0,r._bufferSize=e.processorOptions.bufferSize,r._buffer=new Float32Array(r._bufferSize),r}return Object(S["a"])(i,[{key:"process",value:function(e,t,i){if(!e.length||!e[0].length)return!0;for(var r=0;r<e[0][0].length;r++)this._cursor+=1,this._cursor===this._bufferSize&&(this._cursor=0,this.port.postMessage({eventType:"data",buffer:this._buffer})),this._buffer[this._cursor]=e[0][0][r];return!0}}]),i}(Object(y["a"])(AudioWorkletProcessor));registerProcessor("talk-processor",e)}));this.audioContext.audioWorklet&&this.audioContext.audioWorklet.addModule(t).then((function(){var t=new AudioWorkletNode(e.audioContext,"talk-processor",{processorOptions:{bufferSize:e.bufferSize}});t.connect(e.gainNode),t.port.onmessage=function(t){"data"===t.data.eventType&&e._encodeAudioData(t.data.buffer)},e.workletRecorder=t})),this.clearWorkletUrlTimeout=setTimeout((function(){URL.revokeObjectURL(t),e.clearWorkletUrlTimeout=null}),ie)}},{key:"_onaudioprocess",value:function(e){var t=e.inputBuffer.getChannelData(0);this._encodeAudioData(new Float32Array(t))}},{key:"_encodeAudioData",value:function(e){if(0!==e[0]||0!==e[1]){var t=this.resampler.resample(e),i=t;if(16===this._opt.sampleBitsWidth?i=function(e){for(var t=e.length,i=new Int16Array(t);t--;){var r=Math.max(-1,Math.min(1,e[t]));i[t]=r<0?32768*r:32767*r}return i}(t):8===this._opt.sampleBitsWidth&&(i=function(e){for(var t=e.length,i=new Int8Array(t);t--;){var r=Math.max(-1,Math.min(1,e[t])),a=r<0?32768*r:32767*r;i[t]=parseInt(255/(65535/(32768+a)),10)}return i}(t)),null!==i.buffer){var r=null;this._opt.encType===vi?r=my(i):this._opt.encType===bi?r=gy(i):this._opt.encType===Ai&&(r=i);for(var a=new Uint8Array(r),n=0;n<a.length;n++){var s=this.audioBufferList.length;this.audioBufferList[s++]=a[n],this.audioBufferList.length===this._opt.audioBufferLength&&(this._sendTalkMsg(new Uint8Array(this.audioBufferList)),this.audioBufferList=[])}}}else this.log(this.tag,"empty audio data")}},{key:"_parseAudioMsg",value:function(e){var t=null;return this._opt.packetType!==Ji||this._opt.encType!==vi&&this._opt.encType!==bi?this._opt.packetType===Ki&&(t=e):t=this.rtpPacket(e),t}},{key:"rtpPacket",value:function(e){var t=[],i=0,r=0,a=0,n=this._opt.rtpSsrc,s=e.length;this._opt.encType===vi?i=Vi:this._opt.encType===bi?i=Wi:this._opt.encType===ki&&(i=qi),this.startTimestamp||(this.startTimestamp=$r()),a=$r()-this.startTimestamp,r=this._getSequenceId();var o=0;if(this._opt.packetTcpSendType===Yi){var c=s+12;t[o++]=255&c>>8,t[o++]=255&c>>0}t[o++]=128,t[o++]=128+i,t[o++]=r/256,t[o++]=r%256,t[o++]=a/65536/256,t[o++]=a/65536%256,t[o++]=a%65536/256,t[o++]=a%65536%256,t[o++]=n/65536/256,t[o++]=n/65536%256,t[o++]=n%65536/256,t[o++]=n%65536%256;for(var l=t.concat(Object(m["a"])(e)),u=new Uint8Array(l.length),d=0;d<l.length;d++)u[d]=l[d];return u}},{key:"opusPacket",value:function(e){return e}},{key:"_sendTalkMsg",value:function(e){null===this.tempTimestamp&&(this.tempTimestamp=$r());var t=$r(),i=t-this.tempTimestamp,r=this._parseAudioMsg(e);this.log(this.tag,"'send talk msg and diff is ".concat(i," and byteLength is ").concat(r.byteLength," and length is ").concat(r.length,", and g711 length is ").concat(e.length)),rn(this._opt.saveRtpToFile)&&this._opt.packetType===Ji&&this.addRtpToBuffer(r),r&&(this.socketStatusOpen?this.socket.send(r.buffer):this.emit(nt.tallWebsocketClosedByError)),this.tempTimestamp=t}},{key:"_doTalk",value:function(){this._getUserMedia()}},{key:"_getUserMedia",value:function(){var e=this;this.log(this.tag,"getUserMedia"),void 0===window.navigator.mediaDevices&&(window.navigator.mediaDevices={}),void 0===window.navigator.mediaDevices.getUserMedia&&(this.log(this.tag,"window.navigator.mediaDevices.getUserMedia is undefined and init function"),window.navigator.mediaDevices.getUserMedia=function(e){var t=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;return t?new Promise((function(i,r){t.call(navigator,e,i,r)})):Promise.reject(new Error("getUserMedia is not implemented in this browser"))}),this._opt.checkGetUserMediaTimeout&&this._startCheckGetUserMediaTimeout(),window.navigator.mediaDevices.getUserMedia({audio:this._opt.audioConstraints,video:!1}).then((function(t){e.log(e.tag,"getUserMedia success"),e.userMediaStream=t,e.mediaStreamSource=e.audioContext.createMediaStreamSource(t),e.mediaStreamSource.connect(e.biquadFilter),e.recorder?(e.biquadFilter.connect(e.recorder),e.recorder.connect(e.gainNode)):e.workletRecorder&&(e.biquadFilter.connect(e.workletRecorder),e.workletRecorder.connect(e.gainNode)),e.gainNode.connect(e.audioContext.destination),e.emit(it.talkGetUserMediaSuccess),null===t.oninactive&&(t.oninactive=function(t){e._handleStreamInactive(t)})}))["catch"]((function(t){e.error(e.tag,"getUserMedia error",t.toString()),e.emit(it.talkGetUserMediaFail,t.toString())}))["finally"]((function(){e.log(e.tag,"getUserMedia finally"),e._stopCheckGetUserMediaTimeout()}))}},{key:"_getUserMedia2",value:function(){var e=this;this.log(this.tag,"getUserMedia"),navigator.mediaDevices?navigator.mediaDevices.getUserMedia({audio:!0}).then((function(t){e.log(e.tag,"getUserMedia2 success")})):navigator.getUserMedia({audio:!0},this.log(this.tag,"getUserMedia2 success"),this.log(this.tag,"getUserMedia2 fail"))}},{key:"_getUserMedia3",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.log(this.tag,"getUserMedia3"),e.prev=1,e.next=4,navigator.mediaDevices.getUserMedia({audio:{latency:!0,noiseSuppression:!0,autoGainControl:!0,echoCancellation:!0,sampleRate:48e3,channelCount:1},video:!1});case 4:t=e.sent,console.log("getUserMedia() got stream:",t),this.log(this.tag,"getUserMedia3 success"),e.next=11;break;case 8:e.prev=8,e.t0=e["catch"](1),this.log(this.tag,"getUserMedia3 fail");case 11:case"end":return e.stop()}}),e,this,[[1,8]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"_handleStreamInactive",value:function(e){this.userMediaStream&&(this.warn(this.tag,"stream oninactive",e),this.emit(it.talkStreamInactive))}},{key:"_startCheckGetUserMediaTimeout",value:function(){var e=this;this._stopCheckGetUserMediaTimeout(),this.checkGetUserMediaTimeout=setTimeout((function(){e.log(e.tag,"check getUserMedia timeout"),e.emit(it.talkGetUserMediaTimeout)}),this._opt.getUserMediaTimeout)}},{key:"_stopCheckGetUserMediaTimeout",value:function(){this.checkGetUserMediaTimeout&&(this.log(this.tag,"stop checkGetUserMediaTimeout"),clearTimeout(this.checkGetUserMediaTimeout),this.checkGetUserMediaTimeout=null)}},{key:"_startHeartInterval",value:function(){var e=this;this.heartInterval=setInterval((function(){e.log(e.tag,"heart interval");var t=[35,36,0,0,0,0,0,0];t=new Uint8Array(t),e.socket.send(t.buffer)}),15e3)}},{key:"_stopHeartInterval",value:function(){this.heartInterval&&(this.log(this.tag,"stop heart interval"),clearInterval(this.heartInterval),this.heartInterval=null)}},{key:"startTalk",value:function(e){var t=this;return new Promise((function(i,r){if(!function(){var e=!1,t=window.navigator;return t&&(e=!(!t.mediaDevices||!t.mediaDevices.getUserMedia),e||(e=!!(t.getUserMedia||t.webkitGetUserMedia||t.mozGetUserMedia||t.msGetUserMedia))),e}())return r("not support getUserMedia");if(t.wsUrl=e,t._opt.testMicrophone)t._doTalk();else{if(!t.wsUrl)return r("wsUrl is null");t._createWebSocket()["catch"]((function(e){r(e)}))}t.once(it.talkGetUserMediaFail,(function(){r("getUserMedia fail")})),t.once(it.talkGetUserMediaSuccess,(function(){i()}))}))}},{key:"setVolume",value:function(e){e=parseFloat(e).toFixed(2),isNaN(e)||(e=Zr(e,0,1),this.gainNode.gain.value=e)}},{key:"getOption",value:function(){return this._opt}},{key:"volume",get:function(){return this.gainNode?parseFloat(100*this.gainNode.gain.value).toFixed(0):null}}]),i}(fn),vy=function(){function e(t){Object(T["a"])(this,e),this.player=t,this.globalSetting=null;var i=pa();this.defaultSettings={watermark_id:"JessibucaPro_".concat(i),watermark_prefix:"JessibucaPro_mask_".concat(i),watermark_txt:"JessibucaPro 测试水印",watermark_x:0,watermark_y:0,watermark_rows:0,watermark_cols:0,watermark_x_space:0,watermark_y_space:0,watermark_font:"微软雅黑",watermark_color:"black",watermark_fontsize:"18px",watermark_alpha:.15,watermark_width:150,watermark_height:100,watermark_angle:15,watermark_parent_width:0,watermark_parent_height:0,watermark_parent_node:null},this.player.debug.log("Watermark","int")}return Object(S["a"])(e,[{key:"destroy",value:function(){this._removeMark(),this.globalSetting=null,this.defaultSettings={watermark_id:"",watermark_prefix:"",watermark_txt:"JessibucaPro 测试水印",watermark_x:0,watermark_y:0,watermark_rows:0,watermark_cols:0,watermark_x_space:0,watermark_y_space:0,watermark_font:"微软雅黑",watermark_color:"black",watermark_fontsize:"18px",watermark_alpha:.15,watermark_width:150,watermark_height:100,watermark_angle:15,watermark_parent_width:0,watermark_parent_height:0,watermark_parent_node:null},this.player.debug.log("Watermark","destroy")}},{key:"remove",value:function(){this._removeMark()}},{key:"load",value:function(e){this.globalSetting=e,this._loadMark(e)}},{key:"resize",value:function(){this.player.debug.log("Watermark","resize()"),this.globalSetting&&this._loadMark(this.globalSetting)}},{key:"_loadMark",value:function(){var e=this.defaultSettings;if(1===arguments.length&&"object"==Object(E["a"])(arguments[0])){var t=arguments[0]||{};for(var i in t)t[i]&&e[i]&&t[i]===e[i]||(t[i]||0===t[i])&&(e[i]=t[i])}var r=document.getElementById(e.watermark_id);r&&r.parentNode&&r.parentNode.removeChild(r);var a="string"==typeof e.watermark_parent_node?document.getElementById(e.watermark_parent_node):e.watermark_parent_node,n=a||document.body,s=n.getBoundingClientRect(),o=Math.max(n.scrollWidth,n.clientWidth,s.width),c=Math.max(n.scrollHeight,n.clientHeight,s.height),l=arguments[0]||{},u=n;(l.watermark_parent_width||l.watermark_parent_height)&&u&&(e.watermark_x=e.watermark_x+0,e.watermark_y=e.watermark_y+0);var d=document.getElementById(e.watermark_id),h=null;if(d)d.shadowRoot&&(h=d.shadowRoot);else{(d=document.createElement("div")).id=e.watermark_id,d.setAttribute("style","pointer-events: none !important; display: block !important"),h="function"==typeof d.attachShadow?d.attachShadow({mode:"open"}):d;var f=n.children,p=Math.floor(Math.random()*(f.length-1))+1;f[p]?n.insertBefore(d,f[p]):n.appendChild(d)}e.watermark_cols=parseInt((o-e.watermark_x)/(e.watermark_width+e.watermark_x_space));var m,g=parseInt((o-e.watermark_x-e.watermark_width*e.watermark_cols)/e.watermark_cols);e.watermark_x_space=g&&e.watermark_x_space,e.watermark_rows=parseInt((c-e.watermark_y)/(e.watermark_height+e.watermark_y_space));var y,v,b,A=parseInt((c-e.watermark_y-e.watermark_height*e.watermark_rows)/e.watermark_rows);e.watermark_y_space=A&&e.watermark_y_space,a?(m=e.watermark_x+e.watermark_width*e.watermark_cols+e.watermark_x_space*(e.watermark_cols-1),y=e.watermark_y+e.watermark_height*e.watermark_rows+e.watermark_y_space*(e.watermark_rows-1)):(m=0+e.watermark_x+e.watermark_width*e.watermark_cols+e.watermark_x_space*(e.watermark_cols-1),y=0+e.watermark_y+e.watermark_height*e.watermark_rows+e.watermark_y_space*(e.watermark_rows-1));for(var k=0;k<e.watermark_rows;k++){b=a?0+e.watermark_y+(c-y)/2+(e.watermark_y_space+e.watermark_height)*k:e.watermark_y+(c-y)/2+(e.watermark_y_space+e.watermark_height)*k;for(var _=0;_<e.watermark_cols;_++){v=a?0+e.watermark_x+(o-m)/2+(e.watermark_width+e.watermark_x_space)*_:e.watermark_x+(o-m)/2+(e.watermark_width+e.watermark_x_space)*_;var w=document.createElement("div"),S=document.createTextNode(e.watermark_txt);w.appendChild(S),w.id=e.watermark_prefix+k+_,w.style.webkitTransform="rotate(-"+e.watermark_angle+"deg)",w.style.MozTransform="rotate(-"+e.watermark_angle+"deg)",w.style.msTransform="rotate(-"+e.watermark_angle+"deg)",w.style.OTransform="rotate(-"+e.watermark_angle+"deg)",w.style.transform="rotate(-"+e.watermark_angle+"deg)",w.style.visibility="",w.style.position="absolute",w.style.left=v+"px",w.style.top=b+"px",w.style.overflow="hidden",w.style.zIndex="9999999",w.style.opacity=e.watermark_alpha,w.style.fontSize=e.watermark_fontsize,w.style.fontFamily=e.watermark_font,w.style.color=e.watermark_color,w.style.textAlign="center",w.style.width=e.watermark_width+"px",w.style.height=e.watermark_height+"px",w.style.display="block",w.style["-ms-user-select"]="none",h.appendChild(w)}}}},{key:"_removeMark",value:function(){var e=this.defaultSettings,t=document.getElementById(e.watermark_id);if(t){var i=t.parentNode;i&&i.removeChild(t)}}}]),e}(),by="right",Ay="left",ky="up",_y="down",wy="leftUp",Sy="leftDown",Ty="rightUp",Ey="rightDown",xy="zoomExpand",Cy="zoomNarrow",Ry="apertureFar",Ly="apertureNear",Dy="focusFar",Iy="focusNear",Py="setPos",Oy="calPos",By="delPos",My="wiperOpen",Fy="wiperClose",Uy={stop:0,fiStop:0,right:1,left:2,up:8,down:4,leftUp:10,leftDown:6,rightUp:9,rightDown:5,zoomExpand:16,zoomNarrow:32,apertureFar:72,apertureNear:68,focusFar:66,focusNear:65,setPos:129,calPos:130,delPos:131,wiperOpen:140,wiperClose:141},jy=[25,50,75,100,125,150,175,200,225,250],Ny=[1,2,3,4,5,6,7,8,9,16],zy=[16,48,80,112,144,160,176,192,208,224];function Gy(e){var t,i,r,a,n=e.type,s=e.speed,o=void 0===s?5:s,c=e.index,l=void 0===c?0:c,u=function(e){return jy[(e=e||5)-1]||jy[4]}(o);switch(t=Uy[n],n){case ky:case _y:case Ry:case Ly:r=u;break;case by:case Ay:case Dy:case Iy:i=u;break;case wy:case Sy:case Ty:case Ey:i=u,r=u;break;case xy:case Cy:a=function(e){return zy[(e=e||5)-1]||zy[4]}(o);break;case Oy:case By:case Py:r=function(e){return Ny[e-1]}(l);break;case Fy:case My:i=1}return function(e,t,i,r){var a=[];return a[0]=165,a[1]=15,a[2]=1,a[3]=0,a[4]=0,a[5]=0,a[6]=0,e&&(a[3]=e),t&&(a[4]=t),i&&(a[5]=i),r&&(a[6]=r),a[7]=(a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6])%256,function(e){for(var t="",i=0;i<e.length;i++){var r=e[i].toString(16);1===r.length&&(r="0"+r),t+=r.toUpperCase()}return t}(a)}(t,i,r,a)}var Hy=["Boolean","Number","String","Undefined","Null","Date","Object"];function Vy(e){if("object"!=Object(E["a"])(e))return e;var t=Object.prototype.toString.call(e).slice(8,-1);switch(t){case"Array":case"Uint8Array":case"ArrayBuffer":return t+"["+e.length+"]";case"Object":return"{}";default:return t}}function Wy(e,t,i){i||(i=1),t||(t=2);var r={};if(!e||"object"!=Object(E["a"])(e))return e;var a=Object.prototype.toString.call(e).slice(8,-1);if(!Hy.includes(a))return a;if(!(i>t)){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i===t?r[n]=Vy(e[n]):"object"==Object(E["a"])(e[n])?r[n]=Wy(e[n],t,i+1):r[n]=e[n]);return r}}function qy(){return(new Date).toLocaleString()}var Ky=function(){function e(t){Object(T["a"])(this,e);var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.player=t,this.logMaxSize=(null==i?void 0:i.logMaxSize)||204800,this.logSize=0,this.logTextArray=[]}return Object(S["a"])(e,[{key:"destroy",value:function(){this.clear()}},{key:"clear",value:function(){this.logSize=0,this.logTextArray=[]}},{key:"logCache",value:function(){var e="";try{for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];var a=i.map((function(e){return Wy(e)}));e="[JbPro] "+qy()+JSON.stringify(a)}catch(s){return}if(this.logSize+=e.length,this.logTextArray.push(e),this.logSize>this.logMaxSize){var n=this.logTextArray.shift();this.logSize-=n.length}}},{key:"download",value:function(){var e=this.logTextArray.join("\n");this.clear();var t=new Blob([e],{type:"text/plain"});Ln(t,"JbPro-"+qy()+".log")}}]),e}(),Jy=function(t){Object(_["a"])(r,t);var i=Object(w["a"])(r);function r(){var e;Object(T["a"])(this,r);var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e=i.call(this),e._opt={},e.$container=null,Object.keys(t).forEach((function(e){if(void 0===t[e])throw new Error('JbPro option "'.concat(e,'" can not be undefined'))})),e.originalOptions=t;var n=Za(),s=Object.assign({},n,t);s.url="",s.isMulti&&(s.debugUuid="xxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))),e.debug=new Ir(Object(v["a"])(e));var o,c,l,u=t.container;if("string"==typeof t.container&&(u=document.querySelector(t.container)),!u)throw e.debug.error("JbPro","JbPro need container option and now container is",t.container),new Error("JbPro need container option");if(s.decoder&&an(-1!==s.decoder.indexOf("decoder-pro.js")||-1!==s.decoder.indexOf("decoder-pro-simd.js")))throw e.debug.error("JbPro","JbPro decoder ".concat(s.decoder," must be decoder-pro.js or decoder-pro-simd.js")),new Error("JbPro decoder ".concat(s.decoder," must be decoder-pro.js or decoder-pro-simd.js"));if("CANVAS"===u.nodeName||"VIDEO"===u.nodeName)throw e.debug.error("JbPro","JbPro container type can not be ".concat(u.nodeName," type")),new Error("JbPro container type can not be ".concat(u.nodeName," type"));if(s.videoBuffer>=s.heartTimeout)throw e.debug.error("JbPro","JbPro videoBuffer ".concat(s.videoBuffer,"s must be less than heartTimeout ").concat(s.heartTimeout,"s")),new Error("JbPro videoBuffer ".concat(s.videoBuffer,"s must be less than heartTimeout ").concat(s.heartTimeout,"s"));if(e._checkHasCreated(u))throw e.debug.error("JbPro","JbPro container has been created and can not be created again",u),new Error("JbPro container has been created and can not be created again",u);if(u.classList.add("jessibuca-container"),o=u,c=te,l=pa(),o&&(o.dataset?o.dataset[c]=l:o.setAttribute("data-"+c,l)),an(s.isLive)){var d=document.createElement("video");return Object(a["a"])(e,(d.muted=!0,d.setAttribute("controlsList","nodownload"),d.disablePictureInPicture="disablePictureInPicture",d.style.position="absolute",d.style.top=0,d.style.left=0,d.style.height="100%",d.style.width="100%",u.appendChild(d),e.$videoElement=d,e.$container=u,void(e._opt=s)))}if(delete s.container,Ta(s.videoBuffer)&&(s.videoBuffer=1e3*Number(s.videoBuffer)),Ta(s.videoBufferDelay)&&(s.videoBufferDelay=1e3*Number(s.videoBufferDelay)),Ta(s.networkDelay)&&(s.networkDelay=1e3*Number(s.networkDelay)),Ta(s.aiFaceDetectInterval)&&(s.aiFaceDetectInterval=1e3*Number(s.aiFaceDetectInterval)),Ta(s.aiObjectDetectInterval)&&(s.aiObjectDetectInterval=1e3*Number(s.aiObjectDetectInterval)),Ta(s.timeout)&&(wa(s.loadingTimeout)&&(s.loadingTimeout=s.timeout),wa(s.heartTimeout)&&(s.heartTimeout=s.timeout)),Ta(s.autoWasm)&&(wa(s.decoderErrorAutoWasm)&&(s.decoderErrorAutoWasm=s.autoWasm),wa(s.hardDecodingNotSupportAutoWasm)&&(s.hardDecodingNotSupportAutoWasm=s.autoWasm)),Ta(s.aiFaceDetectLevel)&&wa(s.aiFaceDetectWidth)){var h=Cr[s.aiFaceDetectLevel];h&&(s.aiFaceDetectWidth=h)}if(Ta(s.aiObjectDetectLevel)&&wa(s.aiObjectDetectWidth)){var f=Rr[s.aiObjectDetectLevel];f&&(s.aiObjectDetectWidth=f)}return rn(s.isCrypto)&&(s.isM7sCrypto=!0),e._opt=s,e._destroyed=!1,e.$container=u,e._tempPlayBgObj={},e._loadingTimeoutReplayTimes=0,e._heartTimeoutReplayTimes=0,e.events=new hn(Object(v["a"])(e)),e.watermark=new vy(Object(v["a"])(e)),e.memoryLogger=new Ky(Object(v["a"])(e)),e._initPlayer(u,s),e._initWatermark(),e.debug.log("JbPro",'init success and version is "11-28-2023"'),console.log('JbPro Version is "11-28-2023"'),e}return Object(S["a"])(r,[{key:"destroy",value:function(){var e=this;return new Promise((function(t,i){e.debug.log("JbPro","destroy()"),e._destroyed=!0,e.off(),e.$videoElement&&(e.$videoElement.pause(),e.$videoElement.currentTime=0,e.$videoElement.srcObject&&(e.$videoElement.srcObject=null,e.$videoElement.removeAttribute("srcObject")),e.$videoElement.src&&(e.$videoElement.src="",e.$videoElement.removeAttribute("src")),e.$container&&e.$container.removeChild(e.$videoElement),e.$videoElement=null),e.player?e.player.destroy().then((function(){e.player=null,e._destroy(),setTimeout((function(){t()}),0)}))["catch"]((function(){i()})):(e._destroy(),setTimeout((function(){t()}),0))}))}},{key:"_destroy",value:function(){var e,t;this.events&&(this.events.destroy(),this.events=null),this.talk&&(this.talk.destroy(),this.talk=null),this.watermark&&(this.watermark.destroy(),this.watermark=null),this.memoryLogger&&(this.memoryLogger.destroy(),this.memoryLogger=null),this.$container&&(this.$container.classList.remove("jessibuca-container"),this.$container.classList.remove("jessibuca-fullscreen-web"),e=this.$container,t=te,e&&(e.dataset?delete e.dataset[t]:e.removeAttribute("data-"+t)),this.$container=null),this.debug&&this.debug.log("JbPro","destroy end"),this._resetOpt(),this._tempPlayBgObj=null,this._loadingTimeoutReplayTimes=0,this._heartTimeoutReplayTimes=0}},{key:"_resetOpt",value:function(){this._opt=Za()}},{key:"_getOriginalOpt",value:function(){var e=Za();return Object.assign({},e,this.originalOptions)}},{key:"_initPlayer",value:function(e,t){this.player=new dy(e,t),this._bindEvents()}},{key:"_initTalk",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.talk&&(this.talk.destroy(),this.talk=null),this.player&&(e.debug=this.player._opt.debug),this.talk=new yy(this.player,e),this.debug.log("JbPro","_initTalk",this.talk.getOption()),this._bindTalkEvents()}},{key:"_resetPlayer",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise((function(i,r){var a=function(){e._opt.url="",e._opt.playOptions={},e._opt=Object.assign(e._opt,t),e._initPlayer(e.$container,e._opt)};e.player?e.player.destroy().then((function(){e.player=null,a(),setTimeout((function(){i()}),0)})):(a(),setTimeout((function(){i()}),0))}))}},{key:"_bindEvents",value:function(){var e=this,t=this;Object.keys(rt).forEach((function(i){e.player.on(rt[i],(function(){for(var e=arguments.length,r=new Array(e),a=0;a<e;a++)r[a]=arguments[a];t.emit.apply(t,[i].concat(r))}))})),this.player.once(it.beforeDestroy,(function(){e.emit(it.close),e.destroy().then((function(){}))["catch"]((function(e){}))})),this.player.on(it.resize,(function(){e.watermark&&e.watermark.resize()})),this.player.on(it.fullscreen,(function(){e.watermark&&e.watermark.resize()})),this.player.on(it.videoInfo,(function(){e.player&&(e.player.singleWatermark&&e.player.singleWatermark.resize(),e.player.ghostWatermark&&e.player.ghostWatermark.resize(),e.player.dynamicWatermark&&e.player.dynamicWatermark.resize())})),this.player.on(it.memoryLog,(function(){var e;(e=t.memoryLogger).logCache.apply(e,arguments)})),this.player.on(it.downloadMemoryLog,(function(){e.downloadMemoryLog()}))}},{key:"_bindTalkEvents",value:function(){var e=this;Object.keys(at).forEach((function(t){e.player.on(at[t],(function(i){e.emit(t,i)}))}))}},{key:"_initWatermark",value:function(){if(Ba(this._opt.fullscreenWatermarkConfig)){var e=xa(this.$container,this._opt.fullscreenWatermarkConfig);if(!e.watermark_txt)return void this.debug.warn("JbPro","fullscreenWatermarkConfig text is empty");this.watermark.load(e)}}},{key:"_checkHasCreated",value:function(e){return!!e&&!!function(e,t){return e?e.dataset?e.dataset[t]:e.getAttribute("data-"+t):""}(e,te)}},{key:"isDestroyed",value:function(){return this._destroyed}},{key:"getOption",value:function(){return this.player?this.player.getOption():{}}},{key:"setDebug",value:function(e){this.debug.log("JbPro","setDebug() ".concat(e)),this._opt.debug=!!e,this.player?this.player.updateOption({debug:!!e},!0):this.debug.warn("JbPro","player is not init")}},{key:"getIsDebug",value:function(){var e=!1;return this.player&&(e=this.player._opt.debug),e}},{key:"mute",value:function(){this.debug.log("JbPro","mute()"),this.player&&this.player.mute(!0)}},{key:"cancelMute",value:function(){this.debug.log("JbPro","cancelMute()"),this.player&&this.player.mute(!1)}},{key:"setVolume",value:function(e){this.debug.log("JbPro","setVolume() ".concat(e)),this.player&&(this.player.volume=e)}},{key:"getVolume",value:function(){var e=null;return this.player&&(e=this.player.volume,e=parseFloat(e).toFixed(2)),e}},{key:"audioResume",value:function(){this.debug.log("JbPro","audioResume()"),this.player&&this.player.audio?this.player.audio.audioEnabled(!0):this.debug.warn("JbPro","audioResume error")}},{key:"setTimeout",value:function(e){this.debug.log("JbPro","setTimeout() ".concat(e)),e=Number(e),isNaN(e)?this.debug.warn("JbPro","setTimeout error: ".concat(e," is not a number")):(this._opt.timeout=e,this._opt.loadingTimeout=e,this._opt.heartTimeout=e,this.player&&this.player.updateOption({timeout:e,loadingTimeout:e,heartTimeout:e}))}},{key:"setScaleMode",value:function(e){this.debug.log("JbPro","setScaleMode() ".concat(e)),this.player?this.player.setScaleMode(e):this.debug.warn("JbPro","setScaleMode() player is null")}},{key:"pause",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise((function(i,r){e.debug.log("JbPro","pause() ".concat(t)),e._opt.pauseAndNextPlayUseLastFrameShow&&(e._tempPlayBgObj=e._getVideoLastIframeInfo()),e._pause(t).then((function(e){i(e)}))["catch"]((function(e){r(e)}))}))}},{key:"_pause",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise((function(i,r){if(e.debug.log("JbPro","_pause() ".concat(t)),e.isDestroyed())return r("JbPro is destroyed");e.player?e.player.pause(t).then((function(e){i(e)}))["catch"]((function(e){r(e)})):r("player is null")}))}},{key:"close",value:function(){var e=this;return new Promise((function(t,i){e.debug.log("JbPro","close()"),e._opt.url="",e._loadingTimeoutReplayTimes=0,e._heartTimeoutReplayTimes=0,e.player?e.player.close().then((function(){t()}))["catch"]((function(e){i(e)})):i("player is null")}))}},{key:"clearView",value:function(){this.debug.log("JbPro","clearView()"),this.player&&this.player.video?this.getRenderType()===q?this.player.video.clearView():this.debug.warn("JbPro","clearView","render type is video, not support clearView, please use canvas render type"):this.debug.warn("JbPro","clearView","player is null")}},{key:"play",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,a){if(e.debug.log("JbPro","play() ".concat(t),JSON.stringify(i)),!t&&!e._opt.url)return e.emit(it.error,nt.playError),void a("url is null and this._opt.url is null");if(t&&(t=(""+t).trim(),-1===t.indexOf("http:")&&-1===t.indexOf("https:")&&-1===t.indexOf("webrtc:")&&-1===t.indexOf("ws:")&&-1===t.indexOf("wss:")&&-1===t.indexOf("wt:")))return a("url ".concat(t,' must be "http:" or "https:" or "webrtc:" or "ws:" or "wss:" or "wt:" protocol'));if(an(e._opt.isLive))return e.$videoElement.controls="controls",e.$videoElement.muted=!1,e.$videoElement.src=t,e.$videoElement.play(),void r(e.$videoElement);if(e._opt.isM7sCrypto){var n=i.cryptoKey||e._opt.playOptions.cryptoKey,s=i.cryptoIV||e._opt.playOptions.cryptoIV;if(!n||!s){var o=t||e._opt.url;return void e._cryptoPlay(o).then((function(n){var s=n.cryptoIV,o=n.cryptoKey;e._opt.playOptions.cryptoKey=o,e._opt.playOptions.cryptoIV=s,i.cryptoIV=s,i.cryptoKey=o,e._playBefore(t,i).then((function(){r()}))["catch"]((function(e){a(e)}))}))["catch"]((function(e){a(e)}))}e._opt.playOptions.cryptoKey=n,e._opt.playOptions.cryptoIV=s,i.cryptoIV=s,i.cryptoKey=n}e._playBefore(t,i).then((function(){r()}))["catch"]((function(e){a(e)}))}))}},{key:"_playBefore",value:function(e,t){var i=this;return new Promise((function(r,a){if(i.player)if(e)if(i._opt.url)if(e===i._opt.url)if(i.player.playing)i.debug.log("JbPro","_playBefore","playing and resolve()"),r();else{i.debug.log("JbPro","_playBefore","this._opt.url === url and pause -> play");var n=i._opt.playOptions;i._opt.pauseAndNextPlayUseLastFrameShow&&i._tempPlayBgObj&&i._tempPlayBgObj.loadingBackground&&i.player.updateOption(Object(g["a"])({},i._tempPlayBgObj)),i.player.play(i._opt.url,n).then((function(){r(),i.player.resumeAudioAfterPause()}))["catch"]((function(e){i.debug.error("JbPro","_playBefore this.player.play error",e),i.emit(it.crashLog,i.getCrashLog("this.player.play 1",e)),i.player.pause().then((function(){a(e)}))}))}else{i.debug.log("JbPro","_playBefore","\n this._url.url is ".concat(i._opt.url,"\n and new url is ").concat(e,"\n and destroy and play new url"));var s=i._getOriginalOpt();i._resetPlayer(s).then((function(){i._play(e,t).then((function(){r()}))["catch"]((function(e){i.debug.error("JbPro","_play error",e),i.emit(it.crashLog,i.getCrashLog("this.player.play 2",e)),a(e)}))}))["catch"]((function(e){i.debug.error("JbPro","_resetPlayer error",e)}))}else i._play(e,t).then((function(){r()}))["catch"]((function(e){i.debug.error("JbPro","_play error",e),i.emit(it.crashLog,i.getCrashLog("this.player.play 3",e)),a(e)}));else i.player.play(i._opt.url,i._opt.playOptions).then((function(){r(),i.player.resumeAudioAfterPause()}))["catch"]((function(e){i.debug.error("JbPro","this.player.play error",e),i.emit(it.crashLog,i.getCrashLog("this.player.play 4",e)),i.player.pause().then((function(){a(e)}))}));else e?i._play(e,t).then((function(){r()}))["catch"]((function(e){i.debug.error("JbPro","_play error",e),i.emit(it.crashLog,i.getCrashLog("this.player.play 5",e)),a(e)})):i._play(i._opt.url,i._opt.playOptions).then((function(){r()}))["catch"]((function(e){i.debug.error("JbPro","_play error",e),i.emit(it.crashLog,i.getCrashLog("this.player.play 6",e)),a(e)}))}))}},{key:"_cryptoPlay",value:function(e){var t=this;return new Promise((function(i,r){var a,n=function(e){var t=(e||document.location.toString()).split("//"),i=t[1].indexOf("/"),r=t[1].substring(i);return-1!=r.indexOf("?")&&(r=r.split("?")[0]),r}(e),s=t._opt.cryptoKeyUrl,o="",c=Xa(e);s?(o=s,t._opt.isM7sCrypto&&-1===o.indexOf("/crypto/?stream=")&&(o=Xa(s).origin+ee+"?stream=".concat(n))):(s=c.origin+ee,o=s+"?stream=".concat(n)),t.player.debug.log("JbPro","_cryptoPlay() cryptoKeyUrl: ".concat(o," and opt.cryptoKeyUrl: ").concat(t._opt.cryptoKeyUrl)),(a=o,new Promise((function(e,t){mo.get(a).then((function(t){e(t)}))["catch"]((function(e){t(e)}))}))).then((function(e){if(e){var t=e.split("."),a=Qa(t[0]),n=Qa(t[1]);n&&a?i({cryptoIV:n,cryptoKey:a}):r("get cryptoIV or cryptoKey error")}else r("cryptoKeyUrl: getM7SCryptoStreamKey ".concat(o," res is null"))}))["catch"]((function(e){r(e)}))}))}},{key:"playback",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,a){if(t.debug.log("JbPro","playback() ".concat(e,", options: ").concat(JSON.stringify(i))),an(t._opt.isLive))return a("this._opt.isLive is false, can not playback");var n=en(),s=Object.assign({},n.playbackConfig,t._opt.playbackConfig,i);s.isUseFpsRender||s.isCacheBeforeDecodeForFpsRender&&(s.isCacheBeforeDecodeForFpsRender=!1,t.debug.warn("JbPro","playbackConfig.isUseFpsRender is false, isCacheBeforeDecodeForFpsRender can not be ture, isCacheBeforeDecodeForFpsRender is set to false")),0===s.rateConfig.length&&s.showRateBtn&&(s.showRateBtn=!1,t.debug.warn("JbPro","playbackConfig.rateConfig.length is 0, showRateBtn can not be ture, showRateBtn is set to false")),s.controlType,t._resetPlayer({videoBuffer:0,playbackConfig:s,playType:A,openWebglAlignment:!0,useMSE:s.useMSE,useWCS:s.useWCS,useSIMD:!0}).then((function(){t.play(e,i).then((function(){r()}))["catch"]((function(e){a(e)}))}))["catch"]((function(e){a(e)}))}))}},{key:"playbackPause",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.debug.log("JbPro","playbackPause() ".concat(t)),this._opt.playType===u?Promise.reject("playType is player, can not call playbackPause method"):new Promise((function(i,r){if(!e.player)return r("player is null");rn(t)?e._pause().then((function(){i()}))["catch"]((function(e){r(e)})):(e.player.playbackPause=!0,i())}))}},{key:"playbackResume",value:function(){var e=this;return this.debug.log("JbPro","playbackResume()"),this._opt.playType===u?Promise.reject("playType is player, can not call playbackResume method"):new Promise((function(t,i){if(!e.player)return i();e.player.playbackPause=!1,t()}))}},{key:"forward",value:function(e){var t=this;return this.debug.log("JbPro","forward() ".concat(e)),an(this._opt.isLive)||this._opt.playType===u?Promise.reject("forward() method only just for playback type"):ya(Number(e))?new Promise((function(i,r){t.player?(e=Zr(Number(e),.1,32),t.player.decoderWorker&&t.player.decoderWorker.updateWorkConfig({key:"playbackRate",value:e}),t.player.playback.setRate(e),t.player.video&&t.player.video.setRate(e),t.player.audio&&t.player.audio.setRate(e),(t.player.isPlaybackUseWCS()||t.player.isPlaybackUseMSE())&&(t.player.demux.dropBuffer$2(),t.player.isPlaybackCacheBeforeDecodeForFpsRender()&&t.player.demux.initPlaybackCacheLoop()),i()):r("player is not playing")})):Promise.reject('forward() params "rate": '.concat(e," must be number type"))}},{key:"playbackForward",value:function(e){return this.forward(e)}},{key:"normal",value:function(){return this.forward(1)}},{key:"playbackNormal",value:function(){return this.normal()}},{key:"updatePlaybackForwardMaxRateDecodeIFrame",value:function(e){this.debug.log("JbPro","updatePlaybackForwardMaxRateDecodeIFrame() ".concat(e)),e=Number(e),e=Zr(e=parseInt(e,10),1,8),this._opt.playbackForwardMaxRateDecodeIFrame=e,this.player?this.player.updateOption({playbackForwardMaxRateDecodeIFrame:e},!0):this.debug.warn("JbPro","updatePlaybackForwardMaxRateDecodeIFrame() player is null")}},{key:"setPlaybackStartTime",value:function(e){this.debug.log("JbPro","setPlaybackStartTime() ".concat(e));var t=Oa(e);this.player?this.player.isPlayback()?t<10&&0!==e&&this.player.playback.isControlTypeNormal()?this.debug.warn("JbPro","setPlaybackStartTime() control type is normal and timestamp: ".concat(e," is not valid")):this.player.playback.isControlTypeSimple()&&e>this.player.playback.totalDuration?this.debug.warn("JbPro","setPlaybackStartTime() control type is simple and timestamp: ".concat(e," is more than ").concat(this.player.playback.totalDuration)):this.player.playing&&(this.player.playback.isControlTypeNormal()&&10===t&&(e*=1e3),this.player.playback.setStartTime(e),this.playbackClearCacheBuffer()):this.debug.warn("JbPro","setPlaybackStartTime() playType is not playback"):this.debug.warn("JbPro","setPlaybackStartTime() player is null")}},{key:"setPlaybackShowPrecision",value:function(e){this.debug.log("JbPro","setPlaybackShowPrecision() ".concat(e)),this.player?this.player.isPlayback()?this.player.playback.isControlTypeNormal()?this.player.playback.setShowPrecision(e):this.debug.warn("JbPro","control type is not normal , not support!"):this.debug.warn("JbPro","playType is not playback"):this.debug.warn("JbPro","player is null")}},{key:"playbackCurrentTimeScroll",value:function(){this.debug.log("JbPro","playbackCurrentTimeScroll()"),this.player?this.player.isPlayback()?this.player.playback.isControlTypeNormal()?this.player.playback.currentTimeScroll():this.debug.warn("JbPro","control type is not normal , not support!"):this.debug.warn("JbPro","playType is not playback"):this.debug.warn("JbPro","player is null")}},{key:"playbackClearCacheBuffer",value:function(){this.debug.log("JbPro","playbackClearCacheBuffer()"),this.player?this.player.isPlayback()?(this.player.video&&this.player.video.clear(),this.player.audio&&this.player.audio.clear(),this.clearBufferDelay()):this.debug.warn("JbPro","playType is not playback"):this.debug.warn("JbPro","player is null")}},{key:"getPlaybackCurrentRate",value:function(){if(this.player){if(this.player.isPlayback())return this.player.getPlaybackRate();this.debug.warn("JbPro","playType is not playback")}else this.debug.warn("JbPro","player is null")}},{key:"updatePlaybackLocalOneFrameTimestamp",value:function(e){this.debug.log("JbPro","updatePlaybackLocalOneFrameTimestamp() ".concat(e)),this.player?this.player.isPlayback()?this.player.playback.updateLocalOneFrameTimestamp(e):this.debug.warn("JbPro","playType is not playback"):this.debug.warn("JbPro","player is null")}},{key:"setStreamQuality",value:function(e){this.debug.log("JbPro","setStreamQuality() ".concat(e)),this.player?this.player._opt.operateBtns.quality?(this.player._opt.qualityConfig||[]).includes(e)?this.player.streamQuality=e:this.debug.warn("JbPro","quality: ".concat(e," is not in qualityList")):this.debug.warn("JbPro","player._opt.operateBtns.quality is false"):this.debug.warn("JbPro","player is null")}},{key:"_play",value:function(){var t=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(a,n){if(!t.player)return n("player is null");var s=!1;t._opt.url&&t._opt.url!==i&&(s=!0),t._opt.url=i,t._opt.playOptions=r;var o=0===i.indexOf("http"),c=0===i.indexOf("webrtc"),l=0===i.indexOf("wt:"),u=!c&&-1!==i.indexOf(".m3u8"),d=!c&&-1!==i.indexOf(".flv"),h=!c&&-1!==i.indexOf(".fmp4")||!c&&-1!==i.indexOf(".mp4"),f=!c&&-1!==i.indexOf(".mpeg4"),p=!c&&-1!==i.indexOf(".h264")||!c&&-1!==i.indexOf(".h265"),m=t._opt.isWebrtcForZLM||!1,g=t._opt.isWebrtcForSRS||!1,y=t._opt.isWebrtcForOthers||!1;c&&(-1!==i.indexOf("/index/api/webrtc")?(m=!0,g=!1,y=!1):-1!==i.indexOf("/rtc/v1/play/")&&(g=!0,m=!1,y=!1));var v=null,b=null;if(d&&!t._opt.isFlv&&t._resetDemuxType("isFlv"),h&&!t._opt.isFmp4&&t._resetDemuxType("isFmp4"),f&&!t._opt.isMpeg4&&t._resetDemuxType("isMpeg4"),p&&!t._opt.isNakedFlow&&t._resetDemuxType("isNakedFlow"),v=o?u?3:2:l?5:c?4:1,b=t._opt.isNakedFlow?M:t._opt.isFmp4?F:t._opt.isMpeg4?U:o&&!u||d||t._opt.isFlv?D:u?P:c?O:l?B:I,!v||!b)return n("play protocol is ".concat(v,", demuxType is ").concat(b));var A=function(){t.player.once(nt.webglAlignmentError,(function(e){if(t.emit(it.crashLog,t.getCrashLog(nt.webglAlignmentError,e)),t.player&&t.player._opt.webglAlignmentErrorReplay){t.debug.log("JbPro","webglAlignmentError");var i=t._opt.url,r=t._opt.playOptions;t._resetPlayer({openWebglAlignment:!0}).then((function(){t.play(i,r).then((function(){t.debug.log("JbPro","webglAlignmentError and play success")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.webglAlignmentError),t.debug.error("JbPro","webglAlignmentError and play error",e)}))}))["catch"]((function(e){t.debug.error("JbPro","webglAlignmentError and _resetPlayer error",e)}))}else{var a=!1===t._opt.playFailedUseLastFrameShow;t._pause(a).then((function(){t.emit(it.playFailedAndPaused,nt.webglAlignmentError),t.debug.log("JbPro","webglAlignmentError and webglAlignmentErrorReplay is false")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.webglAlignmentError),t.debug.error("JbPro","webglAlignmentError and pause error",e)}))}})),t.player.once(nt.webglContextLostError,(function(e){t.emit(it.crashLog,t.getCrashLog(nt.webglContextLostError,e));var i=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.webglContextLostErrorReplay){t.debug.log("JbPro","webglContextLostError");var r=t._opt.url,a=t._opt.playOptions,n={};t.player._opt.replayUseLastFrameShow&&(n=Object.assign({},n,i,{loadingIcon:t.player._opt.replayShowLoadingIcon})),t._resetPlayer(n).then((function(){t.play(r,a).then((function(){t.debug.log("JbPro","webglContextLostError and play success")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.webglContextLostError,i),t.debug.error("JbPro","webglContextLostError and play error",e)}))}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.webglContextLostError,i),t.debug.error("JbPro","webglContextLostError and _resetPlayer error",e)}))}else{var s=!1===t._opt.playFailedUseLastFrameShow;t._pause(s).then((function(){t.emit(it.playFailedAndPaused,nt.webglContextLostError,i),t.debug.log("JbPro","webglContextLostError and webglContextLostErrorReplay is false")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.webglContextLostError,i),t.debug.error("JbPro","webglAlignmentError and pause error",e)}))}})),t.player.once(nt.mediaSourceH265NotSupport,(function(e){if(t.emit(it.crashLog,t.getCrashLog(nt.mediaSourceH265NotSupport,e)),t.player&&t.player._opt.hardDecodingNotSupportAutoWasm){t.debug.log("JbPro","mediaSourceH265NotSupport auto wasm [mse-> wasm] reset player and play");var i=t._opt.url,r=t._opt.playOptions;t._resetPlayer({useMSE:!1,useWCS:!1}).then((function(){t.play(i,r).then((function(){t.debug.log("JbPro","mediaSourceH265NotSupport auto wasm [mse-> wasm] reset player and play success")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.mediaSourceH265NotSupport),t.debug.error("JbPro","mediaSourceH265NotSupport auto wasm [mse-> wasm] reset player and play error",e)}))}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.mediaSourceH265NotSupport),t.debug.error("JbPro","mediaSourceH265NotSupport auto wasm [mse-> wasm] _resetPlayer error",e)}))}else{var a=!1===t._opt.playFailedUseLastFrameShow;t._pause(a).then((function(){t.emit(it.playFailedAndPaused,nt.mediaSourceH265NotSupport),t.debug.log("JbPro","mediaSourceH265NotSupport and autoWasm is false")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.mediaSourceH265NotSupport),t.debug.error("JbPro","mediaSourceH265NotSupport and pause error",e)}))}})),t.player.once(nt.mediaSourceFull,(function(e){t.emit(it.crashLog,t.getCrashLog(nt.mediaSourceFull,e));var i=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.mseDecodeErrorReplay){var r=t._opt.url,a=t._opt.playOptions,n={};t.player._opt.decoderErrorAutoWasm&&(n={useMSE:!1,useWCS:!1}),t.debug.log("JbPro","mediaSourceFull and auto wasm [mse-> ".concat(t.player._opt.decoderErrorAutoWasm?"wasm":"mse","] reset player and play")),t.player._opt.replayUseLastFrameShow&&(n=Object.assign({},n,i,{loadingIcon:t.player._opt.replayShowLoadingIcon})),t._resetPlayer(n).then((function(){t.play(r,a).then((function(){t.debug.log("JbPro","mediaSourceFull and reset player and play success")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.mediaSourceFull,i),t.debug.error("JbPro","mediaSourceFull and reset player and play error",e)}))}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.mediaSourceFull,i),t.debug.error("JbPro","mediaSourceFull and _resetPlayer error",e)}))}else{var s=!1===t._opt.playFailedUseLastFrameShow;t._pause(s).then((function(){t.emit(it.playFailedAndPaused,nt.mediaSourceFull,i),t.debug.log("JbPro","mediaSourceFull and autoWasm is false")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.mediaSourceFull,i),t.debug.error("JbPro","mediaSourceFull and pause error",e)}))}})),t.player.once(nt.mediaSourceAppendBufferError,(function(e){t.emit(it.crashLog,t.getCrashLog(nt.mediaSourceAppendBufferError,e));var i=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.mseDecodeErrorReplay){var r=t._opt.url,a=t._opt.playOptions,n={};t.player._opt.decoderErrorAutoWasm&&(n={useMSE:!1,useWCS:!1}),t.debug.log("JbPro","mediaSourceAppendBufferError and auto wasm [mse-> ".concat(t.player._opt.decoderErrorAutoWasm?"wasm":"mse","] reset player and play")),t.player._opt.replayUseLastFrameShow&&(n=Object.assign({},n,i,{loadingIcon:t.player._opt.replayShowLoadingIcon})),t._resetPlayer(n).then((function(){t.play(r,a).then((function(){t.debug.log("JbPro","mediaSourceAppendBufferError and reset player and play success")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.mediaSourceAppendBufferError,i),t.debug.error("JbPro","mediaSourceAppendBufferError and reset player and play error",e)}))}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.mediaSourceAppendBufferError,i),t.debug.error("JbPro","mediaSourceAppendBufferError and _resetPlayer error",e)}))}else{var s=!1===t._opt.playFailedUseLastFrameShow;t._pause(s).then((function(){t.emit(it.playFailedAndPaused,nt.mediaSourceAppendBufferError,i),t.debug.log("JbPro","mediaSourceAppendBufferError and autoWasm is false")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.mediaSourceAppendBufferError,i),t.debug.error("JbPro","mediaSourceAppendBufferError and pause error",e)}))}})),t.player.once(nt.mseSourceBufferError,(function(e){t.emit(it.crashLog,t.getCrashLog(nt.mseSourceBufferError,e));var i=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.mseDecodeErrorReplay){var r=t._opt.url,a=t._opt.playOptions,n={};t.player._opt.decoderErrorAutoWasm&&(n={useMSE:!1,useWCS:!1}),t.debug.log("JbPro","mseSourceBufferError auto wasm [mse-> ".concat(t.player._opt.decoderErrorAutoWasm?"wasm":"mse","] reset player and play")),t.player._opt.replayUseLastFrameShow&&(n=Object.assign({},n,i,{loadingIcon:t.player._opt.replayShowLoadingIcon})),t._resetPlayer(n).then((function(){t.play(r,a).then((function(){t.debug.log("JbPro","mseSourceBufferError auto wasm [mse-> wasm] reset player and play success")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.mseSourceBufferError,i),t.debug.error("JbPro","mseSourceBufferError auto wasm [mse-> wasm] reset player and play error",e)}))}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.mseSourceBufferError,i),t.debug.error("JbPro","mseSourceBufferError auto wasm [mse-> wasm] _resetPlayer and play error",e)}))}else{var s=!1===t._opt.playFailedUseLastFrameShow;t._pause(s).then((function(){t.emit(it.playFailedAndPaused,nt.mseSourceBufferError,i),t.debug.log("JbPro","mseSourceBufferError and autoWasm is false")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.mseSourceBufferError,i),t.debug.error("JbPro","mseSourceBufferError and pause error:",e)}))}})),t.player.once(nt.mseAddSourceBufferError,(function(e){t.emit(it.crashLog,t.getCrashLog(nt.mseAddSourceBufferError,e));var i=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.hardDecodingNotSupportAutoWasm){t.debug.log("JbPro","mseAddSourceBufferError auto wasm [mse-> wasm] reset player and play");var r=t._opt.url,a=t._opt.playOptions,n={useMSE:!1,useWCS:!1};t.player._opt.replayUseLastFrameShow&&(n=Object.assign({},n,i,{loadingIcon:t.player._opt.replayShowLoadingIcon})),t._resetPlayer(n).then((function(){t.play(r,a).then((function(){t.debug.log("JbPro","mseAddSourceBufferError auto wasm [mse-> wasm] reset player and play success")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.mseAddSourceBufferError,i),t.debug.error("JbPro","mseAddSourceBufferError auto wasm [mse-> wasm] reset player and play error",e)}))}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.mseAddSourceBufferError,i),t.debug.error("JbPro","mseAddSourceBufferError auto wasm [mse-> wasm] _resetPlayer and play error",e)}))}else{var s=!1===t._opt.playFailedUseLastFrameShow;t._pause(s).then((function(){t.emit(it.playFailedAndPaused,nt.mseAddSourceBufferError,i),t.debug.log("JbPro","mseAddSourceBufferError and autoWasm is false")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.mseAddSourceBufferError,i),t.debug.error("JbPro","mseAddSourceBufferError and pause error",e)}))}})),t.player.once(nt.mediaSourceDecoderConfigurationError,(function(e){if(t.emit(it.crashLog,t.getCrashLog(nt.mediaSourceDecoderConfigurationError,e)),t.player&&t.player._opt.hardDecodingNotSupportAutoWasm){t.debug.log("JbPro","mediaSourceDecoderConfigurationError auto wasm [mse-> wasm] reset player and play");var i=t._opt.url,r=t._opt.playOptions,a={useMSE:!1,useWCS:!1};t._resetPlayer(a).then((function(){t.play(i,r).then((function(){t.debug.log("JbPro","mediaSourceDecoderConfigurationError auto wasm [mse-> wasm] reset player and play success")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.mediaSourceDecoderConfigurationError),t.debug.error("JbPro","mediaSourceDecoderConfigurationError auto wasm [mse-> wasm] reset player and play error",e)}))}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.mediaSourceDecoderConfigurationError),t.debug.error("JbPro","mediaSourceDecoderConfigurationError auto wasm [mse-> wasm] _resetPlayer and play error",e)}))}else{var n=!1===t._opt.playFailedUseLastFrameShow;t._pause(n).then((function(){t.emit(it.playFailedAndPaused,nt.mediaSourceDecoderConfigurationError),t.debug.log("JbPro","mediaSourceDecoderConfigurationError and autoWasm is false")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.mediaSourceDecoderConfigurationError),t.debug.error("JbPro","mediaSourceDecoderConfigurationError and pause error",e)}))}})),t.player.once(nt.mediaSourceTsIsMaxDiff,(function(e){t.emit(it.crashLog,t.getCrashLog(nt.mediaSourceTsIsMaxDiff,e));var i=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.mediaSourceTsIsMaxDiffReplay){t.debug.log("JbPro","mediaSourceTsIsMaxDiff reset player and play");var r=t._opt.url,a=t._opt.playOptions,n={};n=Object.assign({},n,i),t._resetPlayer(n).then((function(){t.play(r,a).then((function(){t.debug.log("JbPro","mediaSourceTsIsMaxDiff replay success")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.mediaSourceTsIsMaxDiff,i),t.debug.error("JbPro","mediaSourceTsIsMaxDiff replay error",e)}))}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.mediaSourceTsIsMaxDiff,i),t.debug.error("JbPro","mediaSourceTsIsMaxDiff _resetPlayer error",e)}))}else{var s=!1===t._opt.playFailedUseLastFrameShow;t._pause(s).then((function(){t.emit(it.playFailedAndPaused,nt.mediaSourceTsIsMaxDiff,i),t.debug.log("JbPro","mediaSourceTsIsMaxDiff and replay is false")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.mediaSourceTsIsMaxDiff,i),t.debug.error("JbPro","mediaSourceTsIsMaxDiff and pause error",e)}))}})),t.player.once(nt.mseWidthOrHeightChange,(function(i){t.emit(it.crashLog,t.getCrashLog(nt.mseWidthOrHeightChange,i));var r=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.widthOrHeightChangeReplay){t.debug.log("JbPro","mseWidthOrHeightChange and reset player and play");var a=t._opt.url,n=t._opt.playOptions,s={};s=Object.assign({},s,r),t._resetPlayer(s).then((function(){t.play(a,n).then((function(){t.debug.log("JbPro","mseWidthOrHeightChange and reset player and play success")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.mseWidthOrHeightChange,r),t.debug.error("JbPro","mseWidthOrHeightChange and reset player and play error",e)}))}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.mseWidthOrHeightChange,r),t.debug.error("JbPro","mseWidthOrHeightChange and _resetPlayer error",e)}))}else{var o=!1===t._opt.playFailedUseLastFrameShow;t._pause(o).then((function(){t.emit(it.playFailedAndPaused,nt.mseWidthOrHeightChange,r),t.debug.error("JbPro","mseWidthOrHeightChange and _resetPlayer error",e)}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.mseWidthOrHeightChange,r),t.debug.error("JbPro","mseWidthOrHeightChange error and pause error",e)}))}})),t.player.once(nt.mediaSourceUseCanvasRenderPlayFailed,(function(e){t.emit(it.crashLog,t.getCrashLog(nt.mediaSourceUseCanvasRenderPlayFailed,e)),t.debug.log("JbPro","mediaSourceUseCanvasRenderPlayFailed and pause player");var i=!1===t._opt.playFailedUseLastFrameShow;t._pause(i).then((function(){t.debug.log("JbPro","mediaSourceUseCanvasRenderPlayFailed and pause player success")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.mediaSourceUseCanvasRenderPlayFailed),t.debug.error("JbPro","mediaSourceUseCanvasRenderPlayFailed and pause",e)}))})),t.player.once(nt.webcodecsH265NotSupport,(function(e){if(t.emit(it.crashLog,t.getCrashLog(nt.webcodecsH265NotSupport,e)),t.player&&t.player._opt.hardDecodingNotSupportAutoWasm){t.debug.log("JbPro","webcodecsH265NotSupport auto wasm [wcs-> wasm] reset player and play");var i=t._opt.url,r=t._opt.playOptions;t._resetPlayer({useMSE:!1,useWCS:!1}).then((function(){t.play(i,r).then((function(){t.debug.log("JbPro","webcodecsH265NotSupport auto wasm [wcs-> wasm] reset player and play success")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.webcodecsH265NotSupport),t.debug.error("JbPro","webcodecsH265NotSupport auto wasm [wcs-> wasm] reset player and play error",e)}))}))["catch"]((function(e){t.debug.error("JbPro","webcodecsH265NotSupport auto wasm [wcs-> wasm] _resetPlayer and play error",e)}))}else{var a=!1===t._opt.playFailedUseLastFrameShow;t._pause(a).then((function(){t.emit(it.playFailedAndPaused,nt.webcodecsH265NotSupport),t.debug.log("JbPro","webcodecsH265NotSupport and autoWasm is false")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.webcodecsH265NotSupport),t.debug.error("JbPro","webcodecsH265NotSupport and pause error",e)}))}})),t.player.once(nt.webcodecsUnsupportedConfigurationError,(function(e){if(t.emit(it.crashLog,t.getCrashLog(nt.webcodecsUnsupportedConfigurationError,e)),t.player&&t.player._opt.hardDecodingNotSupportAutoWasm){t.debug.log("JbPro","webcodecsUnsupportedConfigurationError auto wasm [wcs-> wasm] reset player and play");var i=t._opt.url,r=t._opt.playOptions;t._resetPlayer({useMSE:!1,useWCS:!1}).then((function(){t.play(i,r).then((function(){t.debug.log("JbPro","webcodecsUnsupportedConfigurationError auto wasm [wcs-> wasm] reset player and play success")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.webcodecsUnsupportedConfigurationError),t.debug.error("JbPro","webcodecsUnsupportedConfigurationError auto wasm [wcs-> wasm] reset player and play error",e)}))}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.webcodecsUnsupportedConfigurationError),t.debug.error("JbPro","webcodecsUnsupportedConfigurationError auto wasm [wcs-> wasm] _resetPlayer and play error",e)}))}else{var a=!1===t._opt.playFailedUseLastFrameShow;t._pause(a).then((function(){t.emit(it.playFailedAndPaused,nt.webcodecsUnsupportedConfigurationError),t.debug.log("JbPro","webcodecsUnsupportedConfigurationError and autoWasm is false")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.webcodecsUnsupportedConfigurationError),t.debug.error("JbPro","webcodecsUnsupportedConfigurationError and pause error",e)}))}})),t.player.once(nt.webcodecsDecodeConfigureError,(function(e){if(t.emit(it.crashLog,t.getCrashLog(nt.webcodecsDecodeConfigureError,e)),t.player&&t.player._opt.hardDecodingNotSupportAutoWasm){t.debug.log("JbPro","webcodecsDecodeConfigureError auto wasm [wcs-> wasm] reset player and play");var i=t._opt.url,r=t._opt.playOptions;t._resetPlayer({useMSE:!1,useWCS:!1}).then((function(){t.play(i,r).then((function(){t.debug.log("JbPro","webcodecsDecodeConfigureError auto wasm [wcs-> wasm] reset player and play success")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.webcodecsDecodeConfigureError),t.debug.error("JbPro","webcodecsDecodeConfigureError auto wasm [wcs-> wasm] reset player and play error",e)}))}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.webcodecsDecodeConfigureError),t.debug.error("JbPro","webcodecsDecodeConfigureError auto wasm [wcs-> wasm] _resetPlayer and play error",e)}))}else{var a=!1===t._opt.playFailedUseLastFrameShow;t._pause(a).then((function(){t.emit(it.playFailedAndPaused,nt.webcodecsDecodeConfigureError),t.debug.log("JbPro","webcodecsDecodeConfigureError and autoWasm is false")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.webcodecsDecodeConfigureError),t.debug.error("JbPro","webcodecsDecodeConfigureError and pause error",e)}))}})),t.player.once(nt.webcodecsDecodeError,(function(e){t.emit(it.crashLog,t.getCrashLog(nt.webcodecsDecodeError,e));var i=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.wcsDecodeErrorReplay){var r=t._opt.url,a=t._opt.playOptions,n={};t.player._opt.decoderErrorAutoWasm&&(n={useMSE:!1,useWCS:!1}),t.debug.log("JbPro","webcodecs decode error autoWasm [wcs-> ".concat(t.player._opt.decoderErrorAutoWasm?"wasm":"wcs","] reset player and play")),t.player._opt.replayUseLastFrameShow&&(n=Object.assign({},n,i,{loadingIcon:t.player._opt.replayShowLoadingIcon})),t._resetPlayer(n).then((function(){t.play(r,a).then((function(){t.debug.log("JbPro","webcodecs decode error reset player and play success")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.webcodecsDecodeError,i),t.debug.error("JbPro","webcodecs decode error reset player and play error",e)}))}))["catch"]((function(){t.emit(it.playFailedAndPaused,nt.webcodecsDecodeError,i),t.debug.error("JbPro","webcodecs decode error _resetPlayer error")}))}else{var s=!1===t._opt.playFailedUseLastFrameShow;t._pause(s).then((function(){t.emit(it.playFailedAndPaused,nt.webcodecsDecodeError,i),t.debug.log("JbPro","webcodecs decode error and autoWasm is false")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.webcodecsDecodeError,i),t.debug.error("JbPro","webcodecs decode error and pause error",e)}))}})),t.player.once(nt.wcsWidthOrHeightChange,(function(i){t.emit(it.crashLog,t.getCrashLog(nt.wcsWidthOrHeightChange,i));var r=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.widthOrHeightChangeReplay){t.debug.log("JbPro","wcsWidthOrHeightChange and reset player and play");var a=t._opt.url,n=t._opt.playOptions,s={};s=Object.assign({},s,r),t._resetPlayer(s).then((function(){t.play(a,n).then((function(){t.debug.log("JbPro","wcsWidthOrHeightChange and reset player and play success")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.wcsWidthOrHeightChange,r),t.debug.error("JbPro","wcsWidthOrHeightChange and reset player and play error",e)}))}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.wcsWidthOrHeightChange,r),t.debug.error("JbPro","wcsWidthOrHeightChange and _resetPlayer error",e)}))}else{var o=!1===t._opt.playFailedUseLastFrameShow;t._pause(o).then((function(){t.emit(it.playFailedAndPaused,nt.wcsWidthOrHeightChange,r),t.debug.error("JbPro","wcsWidthOrHeightChange and _resetPlayer error",e)}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.wcsWidthOrHeightChange,r),t.debug.error("JbPro","wcsWidthOrHeightChange error and pause error",e)}))}})),t.player.once(nt.wasmDecodeError,(function(e){t.emit(it.crashLog,t.getCrashLog(nt.wasmDecodeError,e));var i=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.wasmDecodeErrorReplay){t.debug.log("JbPro","wasm decode error and reset player and play");var r=t._opt.url,a=t._opt.playOptions,n={};t.player._opt.replayUseLastFrameShow&&(n=Object.assign({},n,i,{loadingIcon:t.player._opt.replayShowLoadingIcon})),t._resetPlayer(n).then((function(){t.play(r,a).then((function(){t.debug.log("JbPro","wasm decode error and reset player and play success")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.wasmDecodeError,i),t.debug.error("JbPro","wasm decode error and reset player and play error",e)}))}))["catch"]((function(){t.emit(it.playFailedAndPaused,nt.wasmDecodeError,i),t.debug.error("JbPro","wasm decode error and _resetPlayer error")}))}else{var s=!1===t._opt.playFailedUseLastFrameShow;t._pause(s).then((function(){t.emit(it.playFailedAndPaused,nt.wasmDecodeError,i),t.debug.log("JbPro","wasm decode error and wasmDecodeErrorReplay is false")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.wasmDecodeError,i),t.debug.error("JbPro","wasm decode error and pause error",e)}))}})),t.player.once(nt.simdDecodeError,(function(e){t.emit(it.crashLog,t.getCrashLog(nt.simdDecodeError,e));var i=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.simdDecodeErrorReplay){t.debug.log("JbPro","simdDecodeError error and reset player and play");var r=t._opt.url,a=t._opt.playOptions,n={};n=Object.assign({},n,i),t._resetPlayer(n).then((function(){t.play(r,a).then((function(){t.debug.log("JbPro","simdDecodeError and reset player and play success")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.simdDecodeError,i),t.debug.error("JbPro","simdDecodeError and reset player and play error",e)}))}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.simdDecodeError,i),t.debug.error("JbPro","simdDecodeError and _resetPlayer error",e)}))}else{var s=!1===t._opt.playFailedUseLastFrameShow;t._pause(s).then((function(){t.emit(it.playFailedAndPaused,nt.simdDecodeError,i),t.debug.error("JbPro","simdDecodeError and simdDecodeErrorReplay is false")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.simdDecodeError,i),t.debug.error("JbPro","simdDecodeError error and pause error",e)}))}})),t.player.once(nt.wasmWidthOrHeightChange,(function(i){t.emit(it.crashLog,t.getCrashLog(nt.wasmWidthOrHeightChange,i));var r=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.widthOrHeightChangeReplay){t.debug.log("JbPro","wasmWidthOrHeightChange and reset player and play");var a=t._opt.url,n=t._opt.playOptions,s={};s=Object.assign({},s,r),t._resetPlayer(s).then((function(){t.play(a,n).then((function(){t.debug.log("JbPro","wasmWidthOrHeightChange and reset player and play success")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.wasmWidthOrHeightChange,r),t.debug.error("JbPro","wasmWidthOrHeightChange and reset player and play error",e)}))}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.wasmWidthOrHeightChange,r),t.debug.error("JbPro","wasmWidthOrHeightChange and _resetPlayer error",e)}))}else{var o=!1===t._opt.playFailedUseLastFrameShow;t._pause(o).then((function(){t.emit(it.playFailedAndPaused,nt.wasmWidthOrHeightChange,r),t.debug.error("JbPro","wasmWidthOrHeightChange and _resetPlayer error",e)}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.wasmWidthOrHeightChange,r),t.debug.error("JbPro","wasmWidthOrHeightChange error and pause error",e)}))}})),t.player.once(nt.wasmUseVideoRenderError,(function(e){t.emit(it.crashLog,t.getCrashLog(nt.wasmUseVideoRenderError,e)),t.debug.log("JbPro","wasmUseVideoRenderError and reset player and play");var i=t._opt.url,r=t._opt.playOptions;t._resetPlayer({useVideoRender:!1,useCanvasRender:!0}).then((function(){t.play(i,r).then((function(){t.debug.log("JbPro","wasmUseVideoRenderError and reset player and play success")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.wasmUseVideoRenderError),t.debug.error("JbPro","wasmUseVideoRenderError and reset player and play error",e)}))}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.wasmUseVideoRenderError),t.debug.error("JbPro","wasmUseVideoRenderError and _resetPlayer error",e)}))})),t.player.once(nt.videoElementPlayingFailed,(function(e){if(t.emit(it.crashLog,t.getCrashLog(nt.videoElementPlayingFailed,e)),t.player&&t.player._opt.videoElementPlayingFailedReplay){t.debug.log("JbPro","videoElementPlayingFailed and useMSE is ".concat(t._opt.useMSE," and reset player and play"));var i=t._opt.url,r=t._opt.playOptions;t._resetPlayer({useMSE:!1,useVideoRender:!1,useCanvasRender:!0}).then((function(){t.play(i,r).then((function(){t.debug.log("JbPro","videoElementPlayingFailed and reset player and play success")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.videoElementPlayingFailed),t.debug.error("JbPro","videoElementPlayingFailed and reset player and play error",e)}))}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.videoElementPlayingFailed),t.debug.error("JbPro","videoElementPlayingFailed and _resetPlayer error",e)}))}else{var a=!1===t._opt.playFailedUseLastFrameShow;t._pause(a).then((function(){t.emit(it.playFailedAndPaused,nt.videoElementPlayingFailed),t.debug.error("JbPro","videoElementPlayingFailed and videoElementPlayingFailedReplay is false")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.videoElementPlayingFailed),t.debug.error("JbPro","videoElementPlayingFailed and _pause error",e)}))}})),t.player.once(nt.simdH264DecodeVideoWidthIsTooLarge,(function(e){if(t.emit(it.crashLog,t.getCrashLog(nt.simdH264DecodeVideoWidthIsTooLarge,e)),t.player&&t.player._opt.simdH264DecodeVideoWidthIsTooLargeReplay){t.debug.log("JbPro","simdH264DecodeVideoWidthIsTooLarge and reset player and play");var i=t._opt.url,r=t._opt.playOptions;t._resetPlayer({useSIMD:!1}).then((function(){t.play(i,r).then((function(){t.debug.log("JbPro","simdH264DecodeVideoWidthIsTooLarge and reset player and play success")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.simdH264DecodeVideoWidthIsTooLarge),t.debug.error("JbPro","simdH264DecodeVideoWidthIsTooLarge and reset player and play error",e)}))}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.simdH264DecodeVideoWidthIsTooLarge),t.debug.error("JbPro","simdH264DecodeVideoWidthIsTooLarge and _resetPlayer error",e)}))}else{var a=!1===t._opt.playFailedUseLastFrameShow;t._pause(a).then((function(){t.emit(it.playFailedAndPaused,nt.simdH264DecodeVideoWidthIsTooLarge,lastFrameInfo),t.debug.error("JbPro","simdH264DecodeVideoWidthIsTooLarge and simdDecodeErrorReplay is false")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.simdH264DecodeVideoWidthIsTooLarge,lastFrameInfo),t.debug.error("JbPro","simdH264DecodeVideoWidthIsTooLarge and pause error",e)}))}})),t.player.once(it.networkDelayTimeout,(function(e){if(t.player._opt.networkDelayTimeoutReplay){t.emit(it.crashLog,t.getCrashLog(it.networkDelayTimeout,e));var i=t._getVideoLastIframeInfo();t.debug.log("JbPro","network delay time out and reset player and play");var r=t._opt.url,a=t._opt.playOptions,n={};t.player&&t.player._opt.replayUseLastFrameShow&&(n=Object.assign({},n,i,{loadingIcon:t.player._opt.replayShowLoadingIcon})),t._resetPlayer(n).then((function(){t.play(r,a).then((function(){t.debug.log("JbPro","wasm decode error and reset player and play success")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,it.networkDelayTimeout,i),t.debug.error("JbPro","wasm decode error and reset player and play error",e)}))}))["catch"]((function(){t.emit(it.playFailedAndPaused,it.networkDelayTimeout,i),t.debug.error("JbPro","wasm decode error and _resetPlayer error")}))}})),t.player.once(nt.fetchError,(function(e){t.emit(it.crashLog,t.getCrashLog(nt.fetchError,e));var i=t._getVideoLastIframeInfo();t.debug.log("JbPro","fetch error and pause player");var r=!1===t._opt.playFailedUseLastFrameShow;t._pause(r).then((function(){t.emit(it.playFailedAndPaused,nt.fetchError,i)}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.fetchError,i),t.debug.error("JbPro","fetch error and pause",e)}))})),t.player.once(it.streamEnd,(function(e){t.emit(it.crashLog,t.getCrashLog(it.streamEnd,e));var i=t._getVideoLastIframeInfo();t.debug.log("JbPro","streamEnd pause player");var r=!1===t._opt.playFailedUseLastFrameShow;t._pause(r).then((function(){t.emit(it.playFailedAndPaused,it.streamEnd,i)}))["catch"]((function(e){t.emit(it.playFailedAndPaused,it.streamEnd,i),t.debug.error("JbPro","streamEnd pause",e)}))})),t.player.once(nt.websocketError,(function(e){t.emit(it.crashLog,t.getCrashLog(nt.websocketError,e));var i=t._getVideoLastIframeInfo();t.debug.log("JbPro","websocketError and reset player");var r=!1===t._opt.playFailedUseLastFrameShow;t._pause(r).then((function(){t.emit(it.playFailedAndPaused,nt.websocketError,i)}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.websocketError,i),t.debug.error("JbPro","websocketError and pause",e)}))})),t.player.once(nt.webrtcError,(function(e){t.emit(it.crashLog,t.getCrashLog(nt.webrtcError,e));var i=t._getVideoLastIframeInfo();t.debug.log("JbPro","webrtcError and pause player");var r=!1===t._opt.playFailedUseLastFrameShow;t._pause(r).then((function(){t.emit(it.playFailedAndPaused,nt.webrtcError,i)}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.webrtcError,i),t.debug.error("JbPro","webrtcError and pause",e)}))})),t.player.once(nt.hlsError,(function(e){t.emit(it.crashLog,t.getCrashLog(nt.hlsError,e));var i=t._getVideoLastIframeInfo();t.debug.log("JbPro","hlsError and pause player");var r=!1===t._opt.playFailedUseLastFrameShow;t._pause(r).then((function(){t.emit(it.playFailedAndPaused,nt.hlsError,i)}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.hlsError,i),t.debug.error("JbPro","hlsError and pause",e)}))})),t.player.once(nt.decoderWorkerInitError,(function(e){t.emit(it.crashLog,t.getCrashLog(nt.decoderWorkerInitError,e)),t.debug.log("JbPro","decoderWorkerInitError and pause player");var i=!1===t._opt.playFailedUseLastFrameShow;t._pause(i).then((function(){t.emit(it.playFailedAndPaused,nt.decoderWorkerInitError)}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.decoderWorkerInitError),t.debug.error("JbPro","decoderWorkerInitError and pause",e)}))})),t.player.once(nt.videoElementPlayingFailedForWebrtc,(function(e){t.emit(it.crashLog,t.getCrashLog(nt.videoElementPlayingFailedForWebrtc,e)),t.debug.log("JbPro","videoElementPlayingFailedForWebrtc and pause player");var i=!1===t._opt.playFailedUseLastFrameShow;t._pause(i).then((function(){t.emit(it.playFailedAndPaused,nt.videoElementPlayingFailedForWebrtc)}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.videoElementPlayingFailedForWebrtc),t.debug.error("JbPro","videoElementPlayingFailedForWebrtc and pause",e)}))})),t.player.once(nt.videoInfoError,(function(e){t.emit(it.crashLog,t.getCrashLog(nt.videoInfoError,e)),t.debug.log("JbPro","videoInfoError and pause player");var i=!1===t._opt.playFailedUseLastFrameShow;t._pause(i).then((function(){t.emit(it.playFailedAndPaused,nt.videoInfoError)}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.videoInfoError),t.debug.error("JbPro","videoInfoError and pause",e)}))})),t.player.once(it.webrtcStreamH265,(function(e){t.debug.log("JbPro","webrtcStreamH265 and reset player and play");var i=t._opt.url,r=t._opt.playOptions;t._resetPlayer({isWebrtcH265:!0}).then((function(){t.play(i,r).then((function(){t.debug.log("JbPro","webrtcStreamH265 and reset player and play success")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,it.webrtcStreamH265),t.debug.error("JbPro","webrtcStreamH265 and reset player and play error",e)}))}))["catch"]((function(){t.emit(it.playFailedAndPaused,it.webrtcStreamH265),t.debug.error("JbPro","webrtcStreamH265 and _resetPlayer error")}))})),t.player.once(nt.hlsV2Mp4NotSupport,(function(e){t.debug.log("JbPro","hlsV2Mp4NotSupport and reset player and play");var i=t._opt.url,r=t._opt.playOptions;t._resetPlayer({supportHls265:!1}).then((function(){t.play(i,r).then((function(){t.debug.log("JbPro","hlsV2Mp4NotSupport and reset player and play success")}))["catch"]((function(e){t.emit(it.playFailedAndPaused,nt.hlsV2Mp4NotSupport),t.debug.error("JbPro","hlsV2Mp4NotSupport and reset player and play error",e)}))}))["catch"]((function(){t.emit(it.playFailedAndPaused,nt.hlsV2Mp4NotSupport),t.debug.error("JbPro","hlsV2Mp4NotSupport and _resetPlayer error")}))})),t.player.on(it.delayTimeout,(function(e){if(t.isDestroyed())t.debug.log("JbPro","delay timeout but player is destroyed");else{t.emit(it.crashLog,t.getCrashLog(it.delayTimeout,e));var i=t._getVideoLastIframeInfo();if(t.player&&t.player._opt.heartTimeoutReplay&&(t._heartTimeoutReplayTimes<t.player._opt.heartTimeoutReplayTimes||-1===t.player._opt.heartTimeoutReplayTimes)){if(t.debug.log("JbPro","delay timeout replay time is ".concat(t._heartTimeoutReplayTimes," and heartTimeoutReplayTimes is ").concat(t.player._opt.heartTimeoutReplayTimes)),t.isDestroyed())return void(t.debug&&t.debug.warn("JbPro","delay timeout replay but player is destroyed"));t._heartTimeoutReplayTimes+=1;var r=t._opt.url,a=t._opt.playOptions,n={};(t.player._opt.heartTimeoutReplayUseLastFrameShow||t.player._opt.replayUseLastFrameShow)&&(n=Object.assign({},n,i,{loadingIcon:t.player._opt.replayShowLoadingIcon})),t._resetPlayer(n).then((function(){t.play(r,a).then((function(){}))["catch"]((function(e){t.emit(it.playFailedAndPaused,it.delayTimeout,i),t.debug.error("JbPro","delay timeout replay error",e)}))}))["catch"]((function(e){t.emit(it.playFailedAndPaused,it.delayTimeout,i),t.debug.error("JbPro","delay timeout _resetPlayer error",e)}))}else{var s=!1===t._opt.playFailedUseLastFrameShow;t._pause(s).then((function(){t.emit(it.playFailedAndPaused,it.delayTimeout,i),t.player&&t.player.emit(it.delayTimeoutRetryEnd),t.debug.warn("JbPro","delayTimeoutRetryEnd and\n opt.heartTimeout is ".concat(t.player&&t.player._opt.heartTimeout," and\n opt.heartTimeoutReplay is ").concat(t.player&&t.player._opt.heartTimeoutReplay," and\n opt.heartTimeoutReplayTimes is ").concat(t.player&&t.player._opt.heartTimeoutReplayTimes,",and\n local._heartTimeoutReplayTimes is ").concat(t._heartTimeoutReplayTimes))}))["catch"]((function(e){t.emit(it.playFailedAndPaused,it.delayTimeout,i),t.debug.error("JbPro","delay timeout and pause error",e)}))}}})),t.player.on(it.loadingTimeout,(function(e){if(t.emit(it.crashLog,t.getCrashLog(it.loadingTimeout,e)),t.isDestroyed())t.debug.log("JbPro","loading timeout but player is destroyed");else if(t.player&&t.player._opt.loadingTimeoutReplay&&(t._loadingTimeoutReplayTimes<t.player._opt.loadingTimeoutReplayTimes||-1===t.player._opt.loadingTimeoutReplayTimes)){if(t.debug.log("JbPro","loading timeout and\n replay time is ".concat(t._loadingTimeoutReplayTimes," and\n loadingTimeoutReplayTimes is ").concat(t.player._opt.loadingTimeoutReplayTimes)),t.isDestroyed())return void(t.debug&&t.debug.warn("JbPro","delay timeout replay but player is destroyed"));t._loadingTimeoutReplayTimes+=1;var i=t._opt.url,r=t._opt.playOptions;t._resetPlayer().then((function(){t.play(i,r).then((function(){}))["catch"]((function(e){t.emit(it.playFailedAndPaused,it.loadingTimeout),t.debug.error("JbPro","loading timeout replay error",e)}))}))["catch"]((function(e){t.emit(it.playFailedAndPaused,it.loadingTimeout),t.debug.error("JbPro","loading timeout _resetPlayer error",e)}))}else{var a=!1===t._opt.playFailedUseLastFrameShow;t._pause(a).then((function(){t.emit(it.playFailedAndPaused,it.loadingTimeout),t.player&&t.player.emit(it.loadingTimeoutRetryEnd),t.debug.log("JbPro","loadingTimeoutRetryEnd and\n opt.loadingTimeout is ".concat(t.player&&t.player._opt.loadingTimeout," and\n opt.loadingTimeoutReplay is ").concat(t.player&&t.player._opt.loadingTimeoutReplay," and\n local._loadingTimeoutReplayTimes time is ").concat(t._loadingTimeoutReplayTimes," and\n opt.loadingTimeoutReplayTimes is ").concat(t.player&&t.player._opt.loadingTimeoutReplayTimes))}))["catch"]((function(e){t.emit(it.playFailedAndPaused,it.loadingTimeout),t.debug.error("JbPro","loading timeout and pause error",e)}))}})),t._hasLoaded()?t.player.play(i,r).then((function(){a()}))["catch"]((function(e){t.debug.error("JbPro","_hasLoaded() and play error",e),t.emit(it.crashLog,t.getCrashLog("_hasLoaded() and play error",e)),t.player&&t.player.pause().then((function(){n(e)}))["catch"]((function(e){n(e),t.debug.error("JbPro","_hasLoaded() and play error and next pause error",e)}))})):t.player.once(it.decoderWorkerInit,(function(){t.player.play(i,r).then((function(){a()}))["catch"]((function(e){t.debug.error("JbPro","decoderWorkerInit and play error",e),t.emit(it.crashLog,t.getCrashLog("decoderWorkerInit and play error",e)),t.player&&t.player.pause().then((function(){n(e)}))["catch"]((function(e){n(e),t.debug.error("JbPro","decoderWorkerInit and play error and next pause error",e)}))}))}))};u&&an(t._opt.supportHls265)||c&&an(t._opt.isWebrtcH265)||s||f?(t.debug.log("JbPro","need reset player"),t._resetPlayer({protocol:v,demuxType:b,isHls:u,isWebrtc:c,isWebrtcForZLM:m,isWebrtcForSRS:g,isWebrtcForOthers:y,cryptoKey:r.cryptoKey||"",cryptoIV:r.cryptoIV||"",url:i}).then((function(){A()}))["catch"]((function(e){n("reset player error")}))):(t.player.updateOption({protocol:v,demuxType:b,isHls:u,isWebrtc:c,isFlv:t._opt.isFlv,isFmp4:t._opt.isFmp4,isMpeg4:t._opt.isMpeg4,isNakedFlow:t._opt.isNakedFlow,cryptoKey:r.cryptoKey||"",cryptoIV:r.cryptoIV||""}),r.cryptoKey&&r.cryptoIV&&(t.player.decoderWorker&&t.player.decoderWorker.updateWorkConfig({key:"cryptoKey",value:r.cryptoKey}),t.player.decoderWorker&&t.player.decoderWorker.updateWorkConfig({key:"cryptoIV",value:r.cryptoIV})),A())}))}},{key:"_resetDemuxType",value:function(e){this._opt.isFlv=!1,this._opt.isFmp4=!1,this._opt.isMpeg4=!1,this._opt.isNakedFlow=!1,this._opt.isHls=!1,this._opt.isWebrtc=!1,this._opt.isWebrtcForZLM=!1,this._opt.isWebrtcForSRS=!1,this._opt.isWebrtcForOthers=!1,e&&(this._opt[e]=!0),"isFmp4"!==e&&(this._opt.isFmp4Private=!1)}},{key:"resize",value:function(){this.debug.log("JbPro","resize()"),this.player&&this.player.resize()}},{key:"setBufferTime",value:function(e){this.debug.log("JbPro","setBufferTime() ".concat(e)),(e=Number(e))>10&&this.debug.warn("JbPro","setBufferTime() buffer time is ".concat(e," second, is too large, video will show blank screen until cache ").concat(e," second buffer data"));var t=1e3*e;this._opt.videoBuffer=t,this.player?this.player.updateOption({videoBuffer:t},!0):this.debug.warn("JbPro","setBufferTime() player is null")}},{key:"setBufferDelayTime",value:function(e){this.debug.log("JbPro","setBufferDelayTime() ".concat(e)),(e=Number(e))<.2&&this.debug.warn("JbPro","setBufferDelayTime() buffer time delay is ".concat(e," second, is too small"));var t=1e3*(e=Zr(e,.2,100));this._opt.videoBufferDelay=t,this.player?this.player.updateOption({videoBufferDelay:t},!0):this.debug.warn("JbPro","setBufferDelayTime() player is null")}},{key:"setRotate",value:function(e){this.debug.log("JbPro","setRotate() ".concat(e)),e=parseInt(e,10),this._opt.rotate!==e&&-1!==[0,90,180,270].indexOf(e)?(this._opt.rotate=e,this.player?(this.player.updateOption({rotate:e}),this.resize()):this.debug.warn("JbPro","setRotate() player is null")):this.debug.warn("JbPro","setRotate() rotate is ".concat(e," and this._opt.rotate is ").concat(this._opt.rotate))}},{key:"setMirrorRotate",value:function(e){this.debug.log("JbPro","setMirrorRotate() ".concat(e)),e||(e="none"),this._opt.mirrorRotate!==e&&-1!==["none","level","vertical"].indexOf(e)?(this._opt.mirrorRotate=e,this.player?(this.player.updateOption({mirrorRotate:e}),this.resize()):this.debug.warn("JbPro","setMirrorRotate() player is null")):this.debug.warn("JbPro","setMirrorRotate() mirrorRotate is ".concat(e," and this._opt.mirrorRotate is ").concat(this._opt.mirrorRotate))}},{key:"setAspectRatio",value:function(e){this.debug.log("JbPro","setAspectRatio() ".concat(e)),e||(e="default"),this._opt.aspectRatio!==e&&-1!==["default","4:3","16:9"].indexOf(e)?(this._opt.aspectRatio=e,this.player?(this.player.updateOption({aspectRatio:e}),this.resize()):this.debug.warn("JbPro","setAspectRatio() player is null")):this.debug.warn("JbPro","setAspectRatio() aspectRatio is ".concat(e," and this._opt.aspectRatio is ").concat(this._opt.mirrorRotate))}},{key:"hasLoaded",value:function(){return!0}},{key:"_hasLoaded",value:function(){return this.player&&this.player.loaded||!1}},{key:"setKeepScreenOn",value:function(){this.debug.log("JbPro","setKeepScreenOn()"),this._opt.keepScreenOn=!0,this.player?this.player.updateOption({keepScreenOn:!0}):this.debug.warn("JbPro","setKeepScreenOn() player is not ready")}},{key:"setFullscreen",value:function(e){this.debug.log("JbPro","setFullscreen() ".concat(e));var t=!!e;this.player?this.player.fullscreen!==t?this.player.fullscreen=t:this.debug.warn("JbPro","setFullscreen() fullscreen is ".concat(t," and this.player.fullscreen is ").concat(this.player.fullscreen)):this.debug.warn("JbPro","setFullscreen() player is not ready")}},{key:"setWebFullscreen",value:function(e){this.debug.log("JbPro","setWebFullscreen() ".concat(e));var t=!!e;this.player?this.player.webFullscreen=t:this.debug.warn("JbPro","setWebFullscreen() player is not ready")}},{key:"screenshot",value:function(e,t,i,r){return this.debug.log("JbPro","screenshot() ".concat(e," ").concat(t," ").concat(i," ").concat(r)),this.player&&this.player.video?this.player.video.screenshot(e,t,i,r):(this.debug.warn("JbPro","screenshot() player is not ready"),null)}},{key:"screenshotWatermark",value:function(e){var t=this;return new Promise((function(i,r){t.debug.log("JbPro","screenshotWatermark()",e),t.player&&t.player.video?t.player.video.screenshotWatermark(e).then((function(e){i(e)}))["catch"]((function(e){r(e)})):(t.debug.warn("JbPro","screenshotWatermark() player is not ready"),r("player is not ready"))}))}},{key:"startRecord",value:function(e,t){var i=this;return new Promise((function(r,a){if(i.debug.log("JbPro","startRecord() ".concat(e," ").concat(t)),!i.player)return i.debug.warn("JbPro","startRecord() player is not ready"),a("player is not ready");i.player.playing?(i.player.startRecord(e,t),r()):(i.debug.warn("JbPro","startRecord() player is not playing"),a("not playing"))}))}},{key:"stopRecordAndSave",value:function(e,t){var i=this;return new Promise((function(r,a){i.debug.log("JbPro","stopRecordAndSave() ".concat(e," ").concat(t)),i.player&&i.player.recording?i.player.stopRecordAndSave(e,t).then((function(e){r(e)}))["catch"]((function(e){a(e)})):a("not recording")}))}},{key:"isPlaying",value:function(){var e=!1;return this.player&&(e=this.player.isPlaying()),e}},{key:"isLoading",value:function(){return!!this.player&&this.player.loading}},{key:"isPause",value:function(){var e=!1;return this._opt.playType===u?e=!this.isPlaying()&&!this.isLoading():this._opt.playType===A&&this.player&&(e=this.player.playbackPause),e}},{key:"isPaused",value:function(){return this.isPause()}},{key:"isPlaybackPause",value:function(){var e=!1;return this._opt.playType===A&&this.player&&(e=this.player.playbackPause),e}},{key:"isMute",value:function(){var e=!0;return this.player&&(e=this.player.isAudioMute()),e}},{key:"isRecording",value:function(){return this.player&&this.player.recorder&&this.player.recorder.recording||!1}},{key:"isFullscreen",value:function(){var e=!1;return this.player&&(e=this.player.fullscreen),e}},{key:"isWebFullscreen",value:function(){var e=!1;return this.player&&(e=this.player.webFullscreen),e}},{key:"clearBufferDelay",value:function(){this.debug.log("JbPro","clearBufferDelay()"),this.player?this.player.clearBufferDelay():this.debug.warn("JbPro","clearBufferDelay() player is not init")}},{key:"setNetworkDelayTime",value:function(e){this.debug.log("JbPro","setNetworkDelayTime() ".concat(e)),(e=Number(e))<1&&this.debug.warn("JbPro","setNetworkDelayTime() network delay is ".concat(e," second, is too small"));var t=1e3*(e=Zr(e,1,100));this._opt.networkDelay=t,this.player?this.player.updateOption({networkDelay:t},!0):this.debug.warn("JbPro","setNetworkDelayTime() player is null")}},{key:"getDecodeType",value:function(){var e="";return this.player&&(e=this.player.getDecodeType()),e}},{key:"getRenderType",value:function(){var e="";return this.player&&(e=this.player.getRenderType()),e}},{key:"getAudioEngineType",value:function(){var e="";return this.player&&(e=this.player.getAudioEngineType()),e}},{key:"getPlayingTimestamp",value:function(){var e=0;return this.player&&(e=this.player.getPlayingTimestamp()),e}},{key:"getStatus",value:function(){var e=zi;return this.player&&(e=this.player.loading?Ui:this.player.playing?ji:Ni),e}},{key:"getPlayType",value:function(){return this.player?this.player._opt.playType:u}},{key:"togglePerformancePanel",value:function(e){this.debug.log("JbPro","togglePerformancePanel() ".concat(e));var t=this.player._opt.showPerformance,i=!t;Sa(e)&&(i=e),i!==t?this.player?this.player.togglePerformancePanel(i):this.debug.warn("JbPro","togglePerformancePanel() failed, this.player is not init"):this.debug.warn("JbPro","togglePerformancePanel() failed, showPerformance is prev: ".concat(t," === now: ").concat(i))}},{key:"openZoom",value:function(){this.debug.log("JbPro","openZoom()"),this.player?this.player.zooming=!0:this.debug.warn("JbPro","openZoom() failed, this.player is not init")}},{key:"closeZoom",value:function(){this.debug.log("JbPro","closeZoom()"),this.player?this.player.zooming=!1:this.debug.warn("JbPro","closeZoom() failed, this.player is not init")}},{key:"isZoomOpen",value:function(){var e=!1;return this.player&&(e=this.player.zooming),e}},{key:"expandZoom",value:function(){this.debug.log("JbPro","expandZoom()"),this.player&&this.player.zoom&&this.player.zooming?this.player.zoom.expandPrecision():this.debug.warn("JbPro","expandZoom() failed, zoom is not open or not init")}},{key:"narrowZoom",value:function(){this.debug.log("JbPro","narrowZoom()"),this.player&&this.player.zoom&&this.player.zooming?this.player.zoom.narrowPrecision():this.debug.warn("JbPro","narrowZoom failed, zoom is not open or not init")}},{key:"getCurrentZoomIndex",value:function(){var e=1;return this.player&&this.player.zoom&&(e=this.player.zoom.currentZoom),e}},{key:"startTalk",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,a){t.debug.log("JbPro","startTalk()",e,i),t._initTalk(i),t.talk.startTalk(e).then((function(){r(),t.talk.once(it.talkStreamClose,(function(){t.debug.warn("JbPro","talk stream close"),t.stopTalk()["catch"]((function(e){}))})),t.talk.once(it.talkStreamError,(function(e){t.debug.warn("JbPro","talk stream error",e),t.stopTalk()["catch"]((function(e){}))})),t.talk.once(it.talkStreamInactive,(function(){t.debug.warn("JbPro","talk stream inactive"),t.stopTalk()["catch"]((function(e){}))}))}))["catch"]((function(e){a(e)}))}))}},{key:"stopTalk",value:function(){var e=this;return new Promise((function(t,i){if(e.debug.log("JbPro","stopTalk()"),!e.talk)return i("stopTalk() talk is not init");e.talk.destroy(),t()}))}},{key:"getTalkVolume",value:function(){var e=this;return new Promise((function(t,i){if(!e.talk)return i("getTalkVolume() talk is not init");t(e.talk.volume)}))}},{key:"setTalkVolume",value:function(e){var t=this;return new Promise((function(i,r){if(t.debug.log("JbPro","setTalkVolume()",e),!t.talk)return r("setTalkVolume() talk is not init");t.talk.setVolume(e/100),i()}))}},{key:"setNakedFlowFps",value:function(e){var t=this;return new Promise((function(i,r){if(t.debug.log("JbPro","setNakedFlowFps()",e),wa(e))return r("setNakedFlowFps() fps is empty");var a=Number(e);a=Zr(a,1,100),t._opt.nakedFlowFps=a,t.player?t.player.updateOption({nakedFlowFps:a}):t.debug.warn("JbPro","setNakedFlowFps() player is null"),i()}))}},{key:"getCrashLog",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(this.player){var i=this.player.getAllStatsData(),r=this.player,a={url:this._opt.url,playType:r.isPlayback()?"playback":"live",demuxType:r.getDemuxType(),decoderType:r.getDecodeType(),renderType:r.getRenderType(),videoInfo:{encType:"",width:"",height:""},audioInfo:{encType:"",sampleRate:"",channels:""},audioEngine:r.getAudioEngineType(),allTimes:i.pTs,timestamp:$r(),type:e,error:Ja(t)||e};if(r.video){var n=r.video.videoInfo||{};a.videoInfo={encType:n.encType||"",width:n.width||"",height:n.height||""}}if(r.audio){var s=r.audio.audioInfo||{};a.audioInfo={encType:s.encType||"",sampleRate:s.sampleRate||"",channels:s.channels||""}}return a}}},{key:"updateDebugLevel",value:function(e){this.debug.log("JbPro","updateDebugLevel()",e),e===J||e===Y?e!==this.player._opt.debugLevel?(this._opt.debugLevel=e,this.player?this.player.updateOption({debugLevel:e},!0):this.debug.warn("JbPro","updateDebugLevel() player is null")):this.debug.warn("JbPro","updateDebugLevel() level is same, level: ".concat(e)):this.debug.warn("JbPro","updateDebugLevel() level is not valid, level: ".concat(e))}},{key:"updateWatermark",value:function(e){this.debug.log("JbPro","updateWatermark()",e),this.player?this.player.updateWatermark(e):this.debug.warn("JbPro","updateWatermark() player is not init")}},{key:"removeWatermark",value:function(){this.debug.log("JbPro","removeWatermark()"),this.player?this.player.removeWatermark():this.debug.warn("JbPro","removeWatermark() player is not init")}},{key:"updateFullscreenWatermark",value:function(e){if(this.debug.log("JbPro","updateFullscreenWatermark()",e),Ba(e)){this._opt.fullscreenWatermarkConfig=e;var t=xa(this.$container,e);if(!t.watermark_txt)return void this.debug.warn("JbPro","fullscreenWatermarkConfig text is empty");this.watermark.load(t)}else this.debug.warn("JbPro","updateFullscreenWatermark() config is not valid, config: ".concat(e))}},{key:"removeFullscreenWatermark",value:function(){this.debug.log("JbPro","removeFullscreenWatermark()"),this.watermark?this.watermark.remove():this.debug.warn("JbPro","removeFullscreenWatermark() watermark is not init")}},{key:"faceDetectOpen",value:function(){this.debug.log("JbPro","faceDetectOpen()"),this.player?this.player.faceDetect(!0):this.debug.warn("JbPro","faceDetectOpen() player is not init")}},{key:"faceDetectClose",value:function(){this.debug.log("JbPro","faceDetectClose()"),this.player?this.player.faceDetect(!1):this.debug.warn("JbPro","faceDetectClose() player is not init")}},{key:"objectDetectOpen",value:function(){this.debug.log("JbPro","objectDetectOpen()"),this.player?this.player.objectDetect(!0):this.debug.warn("JbPro","objectDetectOpen() player is not init")}},{key:"objectDetectClose",value:function(){this.debug.log("JbPro","objectDetectClose()"),this.player?this.player.objectDetect(!1):this.debug.warn("JbPro","objectDetectClose() player is not init")}},{key:"sendWebsocketMessage",value:function(e){this.debug.log("JbPro","sendWebsocketMessage()",e),this.player?this.player.sendWebsocketMessage(e):this.debug.warn("JbPro","sendWebsocketMessage() player is not init")}},{key:"addContentToCanvas",value:function(e){this.debug.log("JbPro","addContentToCanvas()"),this.player?this.player.addContentToCanvas(e):this.debug.warn("JbPro","addContentToCanvas() player is not init")}},{key:"clearContentToCanvas",value:function(){this.debug.log("JbPro","clearContentToCanvas()"),this.player?this.player.addContentToCanvas([]):this.debug.warn("JbPro","clearContentToCanvas() player is not init")}},{key:"setControlHtml",value:function(e){this.debug.log("JbPro","setControlHtml()",e),this.player?this.player.setControlHtml(e):this.debug.warn("JbPro","setControlHtml() player is not init")}},{key:"clearControlHtml",value:function(){this.debug.log("JbPro","clearControlHtml()"),this.player?this.player.clearControlHtml():this.debug.warn("JbPro","clearControlHtml() player is not init")}},{key:"getVideoInfo",value:function(){var e=null;return this.player&&(e=this.player.getVideoInfo()),e}},{key:"getAudioInfo",value:function(){var e=null;return this.player&&(e=this.player.getAudioInfo()),e}},{key:"setSm4CryptoKey",value:function(e){this.debug.log("JbPro","setSm4CryptoKey()",e),32===(e=""+e).length?(this._opt.sm4CryptoKey=e,this.player?this.player.updateOption({sm4CryptoKey:e},!0):this.debug.warn("JbPro","setSm4CryptoKey() player is null")):this.debug.warn("JbPro","setSm4CryptoKey() key is invalid and length is ".concat(e.length," !== 32"))}},{key:"updateLoadingText",value:function(e){this.debug.log("JbPro","updateLoadingText()",e),this.player?this.player.updateLoadingText(e):this.debug.warn("JbPro","updateLoadingText() player is null")}},{key:"updateIsEmitSEI",value:function(e){this.debug.log("JbPro","updateIsEmitSEI()",e),this._opt.isEmitSEI=e,this.player?this.player.updateOption({isEmitSEI:e},!0):this.debug.warn("JbPro","updateIsEmitSEI() player is null")}},{key:"getPTZCmd",value:function(e,t){if(this.debug.log("JbPro","getPTZCmd()",e),e)return this.player?Gy({type:e,index:0,speed:t}):void this.debug.warn("JbPro","getPTZCmd() player is null");this.debug.warn("JbPro","getPTZCmd() ptz is null")}},{key:"downloadTempNakedFlowFile",value:function(){var e=this;return new Promise((function(t,i){e.player?(e.player.downloadNakedFlowFile(),t()):i("player is not init")}))}},{key:"downloadTempFmp4File",value:function(){var e=this;return new Promise((function(t,i){e.player?(e.player.downloadFmp4File(),t()):i("player is not init")}))}},{key:"downloadTempMpeg4File",value:function(){var e=this;return new Promise((function(t,i){e.player?(e.player.downloadMpeg4File(),t()):i("player is not init")}))}},{key:"downloadTempRtpFile",value:function(){var e=this;return new Promise((function(t,i){e.talk?(e.talk.downloadRtpFile(),t()):i("talk is not init")}))}},{key:"downloadMemoryLog",value:function(){this.memoryLogger&&this.memoryLogger.download()}},{key:"_getVideoLastIframeInfo",value:function(){var e=this.getVideoInfo()||{};return{loadingBackground:this.screenshot("","png",.92,"base64"),loadingBackgroundWidth:e.width||0,loadingBackgroundHeight:e.height||0}}},{key:"getExtendBtnList",value:function(){this.debug.log("JbPro","getExtendBtnList()");var e=[];return this.player?e=this.player.getExtendBtnList():this.debug.warn("JbPro","getExtendBtnList() player is null"),e}},{key:"getFlvMetaData",value:function(){this.debug.log("JbPro","getFlvMetaData()");var e=null;return this.player?e=this.player.getMetaData():this.debug.warn("JbPro","getFlvMetaData() player is null"),e}},{key:"updateAiFaceDetectInterval",value:function(e){this.debug.log("JbPro","updateAiFaceDetectInterval()",e);var t=1e3*(e=Number(e));this._opt.aiFaceDetectInterval=t,this.player?this.player.updateOption({aiFaceDetectInterval:t}):this.debug.warn("JbPro","updateAiFaceDetectInterval() player is null")}},{key:"updateAiFaceDetectLevel",value:function(e){if(this.debug.log("JbPro","updateAiFaceDetectLevel()",e),Cr[e]){var t=Cr[e];this._opt.aiFaceDetectWidth=t,this.player?(this.player.updateOption({aiFaceDetectWidth:t}),this.player.ai&&this.player.ai.updateFaceDetectorConfig({detectWidth:t})):this.debug.warn("JbPro","updateAiFaceDetectLevel() player is null")}else this.debug.warn("JbPro","'updateAiFaceDetectLevel() level ".concat(e," is invalid'"))}},{key:"updateAiObjectDetectInterval",value:function(e){this.debug.log("JbPro","updateAiObjectDetectInterval()",e);var t=1e3*(e=Number(e));this._opt.aiObjectDetectInterval=t,this.player?this.player.updateOption({aiObjectDetectInterval:t}):this.debug.warn("JbPro","updateAiObjectDetectInterval() player is null")}},{key:"updateAiObjectDetectLevel",value:function(e){if(this.debug.log("JbPro","updateAiObjectDetectLevel()",e),Rr[e]){var t=Rr[e];this._opt.aiObjectDetectWidth=t,this.player?(this.player.updateOption({aiObjectDetectWidth:t}),this.player.ai&&this.player.ai.updateObjectDetectorConfig({detectWidth:t})):this.debug.warn("JbPro","updateAiObjectDetectLevel() player is null")}else this.debug.warn("JbPro","'updateAiObjectDetectLevel() level ".concat(e," is invalid'"))}},{key:"setCryptoKeyUrl",value:function(e){this.debug.log("JbPro","setCryptoKeyUrl()",e),e&&(this._opt.cryptoKeyUrl=e)}}]),r}(fn);return Jy.ERROR=nt,Jy.EVENTS=rt,window.JessibucaPro=Jy,window.WebPlayerPro=Jy,Jy}));var C=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));console.log("WexDemoPlayer--\x3e",C);var R=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{rtcServe:"",decUrl:"",videoConfig:{},callBack:new Function};if(Object(T["a"])(this,e),t.rtcServe&&t.decUrl){this.serverUrl=t.rtcServe,this.decUrl=t.decUrl,this.play265Obj={};var i={showBand:!1,fullscreen:!1,screenshot:!1,play:!1,audio:!1,useMSE:!1,title:"",loadingText:"加载中"};this.videoConfig=Object.assign(i,t.videoConfig||{}),this.callBack=t.callBack}else console.error("请先配置服务和加密文件地址")}return Object(S["a"])(e,[{key:"setConfig",value:function(e){this.videoConfig=Object.assign(this.videoConfig,e||{})}},{key:"setTitle",value:function(e){this.videoConfig.title=e}},{key:"play",value:function(e,t,i){if(e&&t){var r=document.getElementById(t),a=this,n=new JessibucaPro({container:r,decoder:a.decUrl,videoBuffer:.2,isResize:!1,text:" ",loadingText:a.videoConfig.loadingText,debug:!0,debugLevel:"debug",showBandwidth:a.videoConfig.showBand,operateBtns:{fullscreen:a.videoConfig.fullscreen,screenshot:a.videoConfig.screenshot,play:a.videoConfig.play,audio:a.videoConfig.audio},useMSE:a.videoConfig.useMSE,watermarkConfig:{text:{content:a.videoConfig.title||""},right:10,top:10}});n.on("fullscreen",(function(e){console.log("fullscreen"),a.callBack&&a.callBack.call(null,{type:"fullscreen",msg:e})})),this.play265Obj[t]=n,this.pullRtsp(this.serverUrl,{rtsp:e,videoId:t},i)}else console.warn("--play--缺少必要参数请注意查看")}},{key:"wbrtc256pull",value:function(e,t,i){var r="";if(i)r=i;else{var a=t.rtsp.split(".");r=a[a.length-1];var n=new RegExp(":","g");r=r.replace(n,"_"),r.indexOf("/")&&(r=r.split("/")[0])}return new Promise((function(a,n){var s=new XMLHttpRequest||new ActiveXObject("Microsoft.XMLHTTP");s.timeout=3e4;var o=i||r,c=e+"/api/rtsp/pull?target=".concat(escape(t.rtsp),"&streamPath=path_").concat(o,"/t").concat(o);s.open("get",c),s.send(null),s.onerror=function(){console.log("请求失败"),n()},s.onprogress=function(){console.log("上传中...")},s.ontimeout=function(){n(),console.log("请求超时")},s.onreadystatechange=function(){4===s.readyState&&"200"==s.status&&a(s.responseText)}}))}},{key:"pullRtsp",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t,i,r){var a,n,s,o,c,l,u,d,h;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.wbrtc256pull(t,i,r);case 2:a=e.sent,n=new RegExp("http","g"),s=t.replace(n,"ws"),console.log("res--\x3e",a,"pUrl--\x3e"+s),o="",r?o=r:(c=i.rtsp.split("."),l=c[c.length-1],l.indexOf(":")>-1&&(u=new RegExp(":","g"),l=l.replace(u,"_")),l.indexOf("/")&&(l=l.split("/")[0]),o=l),console.log("next--\x3e",o),s=s+"/wexplayer/path_"+o+"/t"+o,d=s,console.log("url--\x3e",d),h=this.play265Obj[i.videoId],setTimeout((function(){h.play(d).then((function(e){console.log("then--\x3e",e)}))["catch"]((function(e){console.log("播放错误"),console.log(e)}))}),100);case 13:case"end":return e.stop()}}),e,this)})));function t(t,i,r){return e.apply(this,arguments)}return t}()},{key:"destroy",value:function(e){e?document.getElementById(e)?(this.play265Obj[e].destroy(),delete this.play265Obj[e]):console.log("无法找到该dom"):console.warn("--destroy--缺少必要参数请注意查看")}},{key:"check",value:function(e,t,i){var r=this;e&&t?(this.play265Obj[t]&&this.destroy(t),setTimeout((function(){r.play(e,t,i)}),200)):console.warn("--play--缺少必要参数请注意查看")}},{key:"uuid",value:function(){var e=["000000","00000","0000","000","00","0",""],t=""+parseInt(1e5*Math.random());return t=e[t.length]+t,console.log(t),t}},{key:"pullYt",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t,i,r){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,a){var n=new XMLHttpRequest||new ActiveXObject("Microsoft.XMLHTTP");n.timeout=3e4,"post"==r?(n.open("post",t),n.send(i)):(n.open("get",t),n.send(null)),n.onerror=function(){console.log("请求失败"),a()},n.onprogress=function(){console.log("上传中...")},n.ontimeout=function(){a(),console.log("请求超时")},n.onreadystatechange=function(){4===n.readyState&&"200"==n.status&&e(n.responseText)}})));case 1:case"end":return e.stop()}}),e)})));function t(t,i,r){return e.apply(this,arguments)}return t}()},{key:"controls",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t,i,r,a,n){var s,o,c;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return s=this.uuid(),o=50,o=a||(i.indexOf("ZOOM")>-1?5:50),c='<?xml version="1.0" encoding="utf-8"?><request id="'.concat(n||s,'" type="PTZControl"><tel>').concat(r,"</tel><command>").concat(i,"</command><speed>").concat(o,"</speed></request>]}"),e.next=5,this.pullYt(t,c,"post",!0);case 5:case"end":return e.stop()}}),e,this)})));function t(t,i,r,a,n){return e.apply(this,arguments)}return t}()}]),e}();window.h265=R},f36a:function(e,t,i){var r=i("e330");e.exports=r([].slice)},f5b2:function(e,t,i){"use strict";var r=i("23e7"),a=i("6547").codeAt;r({target:"String",proto:!0},{codePointAt:function(e){return a(this,e)}})},f5df:function(e,t,i){var r=i("da84"),a=i("00ee"),n=i("1626"),s=i("c6b6"),o=i("b622"),c=o("toStringTag"),l=r.Object,u="Arguments"==s(function(){return arguments}()),d=function(e,t){try{return e[t]}catch(i){}};e.exports=a?s:function(e){var t,i,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=d(t=l(e),c))?i:u?s(t):"Object"==(r=s(t))&&n(t.callee)?"Arguments":r}},f6d6:function(e,t,i){var r=i("23e7"),a=i("da84"),n=i("e330"),s=i("23cb"),o=a.RangeError,c=String.fromCharCode,l=String.fromCodePoint,u=n([].join),d=!!l&&1!=l.length;r({target:"String",stat:!0,forced:d},{fromCodePoint:function(e){var t,i=[],r=arguments.length,a=0;while(r>a){if(t=+arguments[a++],s(t,1114111)!==t)throw o(t+" is not a valid code point");i[a]=t<65536?c(t):c(55296+((t-=65536)>>10),t%1024+56320)}return u(i,"")}})},f772:function(e,t,i){var r=i("5692"),a=i("90e3"),n=r("keys");e.exports=function(e){return n[e]||(n[e]=a(e))}},f8c9:function(e,t,i){var r=i("23e7"),a=i("da84"),n=i("d44e");r({global:!0},{Reflect:{}}),n(a.Reflect,"Reflect",!0)},f8cd:function(e,t,i){var r=i("da84"),a=i("5926"),n=r.RangeError;e.exports=function(e){var t=a(e);if(t<0)throw n("The argument can't be less than 0");return t}},fb15:function(e,t,i){"use strict";if(i.r(t),i.d(t,"getUserInfo",(function(){return k})),"undefined"!==typeof window){var r=window.document.currentScript,a=i("8875");r=a(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:a});var n=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);n&&(i.p=n[1])}var s=i("d4ec"),o=i("bee2"),c=i("d5e4"),l=(i("d9e2"),i("d401"),i("cca6"),i("e9c4"),i("e260"),i("d3b7"),i("3ca3"),i("10d1"),i("ddb0"),i("ade3")),u=(i("13d5"),i("ac1f"),i("1276"),i("fb6a"),i("b64b"),i("5180")),d=u.keys().reduce((function(e,t){return Object.assign(e,Object(l["a"])({},t.split("/").slice(-1)[0].split(".")[0],u(t)[Object.keys(u(t))[0]])),e}),{});console.log("=====modulesFiles========"),console.log(d);var h=d,f=i("f299"),p=function(e){console.log(h);var t=h[e];if(console.log(t),!t)throw new Error("未找到对应的请求方法!");return function(){return t.apply(void 0,arguments)}},m=function(e,t){var i=t.onOpen,r=t.onClose,a=t.onMessage,n=t.onError,s=t.onReconnect;e.subscribe("open",(function(){console.log("WebSocket连接成功!"),i&&i()})),e.subscribe("close",(function(e){console.log("WebSocket连接关闭!",e),r&&r(e)})),e.subscribe("message",(function(e){a&&a(e)})),e.subscribe("error",(function(e){console.log("WebSocket捕获错误:",e),n&&n(e)})),e.subscribe("reconnect",(function(e){console.log("WebSocket断开重连:",e),s&&s(e)}))},g=function(e,t,i){var r={showBand:!0,fullscreen:!0,screenshot:!0,play:!0,audio:!0,useMSE:!1},a=new f({rtcServe:e,decUrl:t||"/decoder/decoder-pro.js",videoConfig:i||r});return a},y=function(e,t,i){var r=e||"",a=i||"";return{Action:r,GongHao:t.GongHao,FenJi:t.FenJi,PlatFormCode:t.DepartmentID,Params:a}},v=new WeakMap,b=function(){function e(t,i){var r=this,a=i.onOpen,n=i.onClose,o=i.onMessage,l=i.onError;Object(s["a"])(this,e),Object(c["a"])(this,v,{writable:!0,value:null}),this.config=t,Object.assign(this.config,{checkData:JSON.stringify(y("keeplive",this.config))}),this.socket=p("websocket")(t),m(this.socket,{onOpen:function(e){console.log("====onOpen====="),console.log(r),r.send("Login"),a&&a(e)},onClose:function(e){n&&n(e)},onMessage:function(e){"Back_Login"!==e.data?o&&o(e):r.config.AgentGroupName&&r.send("SetGroupRole",r.config.AgentGroupName)},onError:function(e){l&&l(e)},onReconnect:function(e){r.scoket=e}})}return Object(o["a"])(e,[{key:"send",value:function(e,t){this.socket.send(JSON.stringify(y(e,this.config,t)))}},{key:"getPlayer",value:function(e,t,i){return this.player?this.player:g(e,t,i)}}]),e}(),A=function(e,t){var i=t.onOpen,r=t.onClose,a=t.onMessage,n=t.onError;return window.WebSocket?new b(e,{onOpen:i,onClose:r,onMessage:a,onError:n}):console.error("您的浏览器不支持WebSocket, 请更换浏览器!")};console.log(A);var k=function(){console.log(p)},_=A;t["default"]=_},fb2c:function(e,t,i){var r=i("74e8");r("Uint32",(function(e){return function(t,i,r){return e(this,t,i,r)}}))},fb6a:function(e,t,i){"use strict";var r=i("23e7"),a=i("da84"),n=i("e8b5"),s=i("68ee"),o=i("861d"),c=i("23cb"),l=i("07fa"),u=i("fc6a"),d=i("8418"),h=i("b622"),f=i("1dde"),p=i("f36a"),m=f("slice"),g=h("species"),y=a.Array,v=Math.max;r({target:"Array",proto:!0,forced:!m},{slice:function(e,t){var i,r,a,h=u(this),f=l(h),m=c(e,f),b=c(void 0===t?f:t,f);if(n(h)&&(i=h.constructor,s(i)&&(i===y||n(i.prototype))?i=void 0:o(i)&&(i=i[g],null===i&&(i=void 0)),i===y||void 0===i))return p(h,m,b);for(r=new(void 0===i?y:i)(v(b-m,0)),a=0;m<b;m++,a++)m in h&&d(r,a,h[m]);return r.length=a,r}})},fc6a:function(e,t,i){var r=i("44ad"),a=i("1d80");e.exports=function(e){return r(a(e))}},fce3:function(e,t,i){var r=i("d039"),a=i("da84"),n=a.RegExp;e.exports=r((function(){var e=n(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)}))},fd87:function(e,t,i){var r=i("74e8");r("Int8",(function(e){return function(t,i,r){return e(this,t,i,r)}}))},fdbc:function(e,t){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},fdbf:function(e,t,i){var r=i("4930");e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},fea9:function(e,t,i){var r=i("da84");e.exports=r.Promise}})}));
1
+ (function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["kucservice"]=e():t["kucservice"]=e()})("undefined"!==typeof self?self:this,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="fb15")}({"00b4":function(t,e,n){"use strict";n("ac1f");var r=n("23e7"),o=n("da84"),i=n("c65b"),c=n("e330"),a=n("1626"),u=n("861d"),f=function(){var t=!1,e=/[ac]/;return e.exec=function(){return t=!0,/./.exec.apply(this,arguments)},!0===e.test("abc")&&t}(),s=o.Error,d=c(/./.test);r({target:"RegExp",proto:!0,forced:!f},{test:function(t){var e=this.exec;if(!a(e))return d(this,t);var n=i(e,this,t);if(null!==n&&!u(n))throw new s("RegExp exec method returned something other than an Object or null");return!!n}})},"00ee":function(t,e,n){var r=n("b622"),o=r("toStringTag"),i={};i[o]="z",t.exports="[object z]"===String(i)},"01b4":function(t,e){var n=function(){this.head=null,this.tail=null};n.prototype={add:function(t){var e={item:t,next:null};this.head?this.tail.next=e:this.head=e,this.tail=e},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}},t.exports=n},"0366":function(t,e,n){var r=n("e330"),o=n("59ed"),i=n("40d5"),c=r(r.bind);t.exports=function(t,e){return o(t),void 0===e?t:i?c(t,e):function(){return t.apply(e,arguments)}}},"0538":function(t,e,n){"use strict";var r=n("da84"),o=n("e330"),i=n("59ed"),c=n("861d"),a=n("1a2d"),u=n("f36a"),f=n("40d5"),s=r.Function,d=o([].concat),l=o([].join),p={},v=function(t,e,n){if(!a(p,e)){for(var r=[],o=0;o<e;o++)r[o]="a["+o+"]";p[e]=s("C,a","return new C("+l(r,",")+")")}return p[e](t,n)};t.exports=f?s.bind:function(t){var e=i(this),n=e.prototype,r=u(arguments,1),o=function(){var n=d(r,u(arguments));return this instanceof o?v(e,n.length,n):e.apply(t,n)};return c(n)&&(o.prototype=n),o}},"057f":function(t,e,n){var r=n("c6b6"),o=n("fc6a"),i=n("241c").f,c=n("4dae"),a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],u=function(t){try{return i(t)}catch(e){return c(a)}};t.exports.f=function(t){return a&&"Window"==r(t)?u(t):i(o(t))}},"06cf":function(t,e,n){var r=n("83ab"),o=n("c65b"),i=n("d1e7"),c=n("5c6c"),a=n("fc6a"),u=n("a04b"),f=n("1a2d"),s=n("0cfb"),d=Object.getOwnPropertyDescriptor;e.f=r?d:function(t,e){if(t=a(t),e=u(e),s)try{return d(t,e)}catch(n){}if(f(t,e))return c(!o(i.f,t,e),t[e])}},"07fa":function(t,e,n){var r=n("50c4");t.exports=function(t){return r(t.length)}},"0b42":function(t,e,n){var r=n("da84"),o=n("e8b5"),i=n("68ee"),c=n("861d"),a=n("b622"),u=a("species"),f=r.Array;t.exports=function(t){var e;return o(t)&&(e=t.constructor,i(e)&&(e===f||o(e.prototype))?e=void 0:c(e)&&(e=e[u],null===e&&(e=void 0))),void 0===e?f:e}},"0cfb":function(t,e,n){var r=n("83ab"),o=n("d039"),i=n("cc12");t.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},"0d03":function(t,e,n){var r=n("e330"),o=n("6eeb"),i=Date.prototype,c="Invalid Date",a="toString",u=r(i[a]),f=r(i.getTime);String(new Date(NaN))!=c&&o(i,a,(function(){var t=f(this);return t===t?u(this):c}))},"0d51":function(t,e,n){var r=n("da84"),o=r.String;t.exports=function(t){try{return o(t)}catch(e){return"Object"}}},"107c":function(t,e,n){var r=n("d039"),o=n("da84"),i=o.RegExp;t.exports=r((function(){var t=i("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))},"10d1":function(t,e,n){"use strict";var r,o=n("da84"),i=n("e330"),c=n("e2cc"),a=n("f183"),u=n("6d61"),f=n("acac"),s=n("861d"),d=n("4fad"),l=n("69f3").enforce,p=n("7f9a"),v=!o.ActiveXObject&&"ActiveXObject"in o,h=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},b=u("WeakMap",h,f);if(p&&v){r=f.getConstructor(h,"WeakMap",!0),a.enable();var y=b.prototype,g=i(y["delete"]),m=i(y.has),x=i(y.get),w=i(y.set);c(y,{delete:function(t){if(s(t)&&!d(t)){var e=l(this);return e.frozen||(e.frozen=new r),g(this,t)||e.frozen["delete"](t)}return g(this,t)},has:function(t){if(s(t)&&!d(t)){var e=l(this);return e.frozen||(e.frozen=new r),m(this,t)||e.frozen.has(t)}return m(this,t)},get:function(t){if(s(t)&&!d(t)){var e=l(this);return e.frozen||(e.frozen=new r),m(this,t)?x(this,t):e.frozen.get(t)}return x(this,t)},set:function(t,e){if(s(t)&&!d(t)){var n=l(this);n.frozen||(n.frozen=new r),m(this,t)?w(this,t,e):n.frozen.set(t,e)}else w(this,t,e);return this}})}},1276:function(t,e,n){"use strict";var r=n("2ba4"),o=n("c65b"),i=n("e330"),c=n("d784"),a=n("44e7"),u=n("825a"),f=n("1d80"),s=n("4840"),d=n("8aa5"),l=n("50c4"),p=n("577e"),v=n("dc4a"),h=n("4dae"),b=n("14c3"),y=n("9263"),g=n("9f7f"),m=n("d039"),x=g.UNSUPPORTED_Y,w=4294967295,O=Math.min,j=[].push,S=i(/./.exec),E=i(j),k=i("".slice),P=!m((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));c("split",(function(t,e,n){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,n){var i=p(f(this)),c=void 0===n?w:n>>>0;if(0===c)return[];if(void 0===t)return[i];if(!a(t))return o(e,i,t,c);var u,s,d,l=[],v=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),b=0,g=new RegExp(t.source,v+"g");while(u=o(y,g,i)){if(s=g.lastIndex,s>b&&(E(l,k(i,b,u.index)),u.length>1&&u.index<i.length&&r(j,l,h(u,1)),d=u[0].length,b=s,l.length>=c))break;g.lastIndex===u.index&&g.lastIndex++}return b===i.length?!d&&S(g,"")||E(l,""):E(l,k(i,b)),l.length>c?h(l,0,c):l}:"0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:o(e,this,t,n)}:e,[function(e,n){var r=f(this),c=void 0==e?void 0:v(e,t);return c?o(c,e,r,n):o(i,p(r),e,n)},function(t,r){var o=u(this),c=p(t),a=n(i,o,c,r,i!==e);if(a.done)return a.value;var f=s(o,RegExp),v=o.unicode,h=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(x?"g":"y"),y=new f(x?"^(?:"+o.source+")":o,h),g=void 0===r?w:r>>>0;if(0===g)return[];if(0===c.length)return null===b(y,c)?[c]:[];var m=0,j=0,S=[];while(j<c.length){y.lastIndex=x?0:j;var P,T=b(y,x?k(c,j):c);if(null===T||(P=O(l(y.lastIndex+(x?j:0)),c.length))===m)j=d(c,j,v);else{if(E(S,k(c,m,j)),S.length===g)return S;for(var A=1;A<=T.length-1;A++)if(E(S,T[A]),S.length===g)return S;j=m=P}}return E(S,k(c,m)),S}]}),!P,x)},"131a":function(t,e,n){var r=n("23e7"),o=n("d2bb");r({target:"Object",stat:!0},{setPrototypeOf:o})},"13d5":function(t,e,n){"use strict";var r=n("23e7"),o=n("d58f").left,i=n("a640"),c=n("2d00"),a=n("605d"),u=i("reduce"),f=!a&&c>79&&c<83;r({target:"Array",proto:!0,forced:!u||f},{reduce:function(t){var e=arguments.length;return o(this,t,e,e>1?arguments[1]:void 0)}})},"14c3":function(t,e,n){var r=n("da84"),o=n("c65b"),i=n("825a"),c=n("1626"),a=n("c6b6"),u=n("9263"),f=r.TypeError;t.exports=function(t,e){var n=t.exec;if(c(n)){var r=o(n,t,e);return null!==r&&i(r),r}if("RegExp"===a(t))return o(u,t,e);throw f("RegExp#exec called on incompatible receiver")}},"159b":function(t,e,n){var r=n("da84"),o=n("fdbc"),i=n("785a"),c=n("17c2"),a=n("9112"),u=function(t){if(t&&t.forEach!==c)try{a(t,"forEach",c)}catch(e){t.forEach=c}};for(var f in o)o[f]&&u(r[f]&&r[f].prototype);u(i)},1626:function(t,e){t.exports=function(t){return"function"==typeof t}},"17c2":function(t,e,n){"use strict";var r=n("b727").forEach,o=n("a640"),i=o("forEach");t.exports=i?[].forEach:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}},"19aa":function(t,e,n){var r=n("da84"),o=n("3a9b"),i=r.TypeError;t.exports=function(t,e){if(o(e,t))return t;throw i("Incorrect invocation")}},"1a2d":function(t,e,n){var r=n("e330"),o=n("7b0b"),i=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return i(o(t),e)}},"1be4":function(t,e,n){var r=n("d066");t.exports=r("document","documentElement")},"1c7e":function(t,e,n){var r=n("b622"),o=r("iterator"),i=!1;try{var c=0,a={next:function(){return{done:!!c++}},return:function(){i=!0}};a[o]=function(){return this},Array.from(a,(function(){throw 2}))}catch(u){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var r={};r[o]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(u){}return n}},"1cdc":function(t,e,n){var r=n("342f");t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},"1d1c":function(t,e,n){var r=n("23e7"),o=n("83ab"),i=n("37e8").f;r({target:"Object",stat:!0,forced:Object.defineProperties!==i,sham:!o},{defineProperties:i})},"1d80":function(t,e,n){var r=n("da84"),o=r.TypeError;t.exports=function(t){if(void 0==t)throw o("Can't call method on "+t);return t}},"1dde":function(t,e,n){var r=n("d039"),o=n("b622"),i=n("2d00"),c=o("species");t.exports=function(t){return i>=51||!r((function(){var e=[],n=e.constructor={};return n[c]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},2266:function(t,e,n){var r=n("da84"),o=n("0366"),i=n("c65b"),c=n("825a"),a=n("0d51"),u=n("e95a"),f=n("07fa"),s=n("3a9b"),d=n("9a1f"),l=n("35a1"),p=n("2a62"),v=r.TypeError,h=function(t,e){this.stopped=t,this.result=e},b=h.prototype;t.exports=function(t,e,n){var r,y,g,m,x,w,O,j=n&&n.that,S=!(!n||!n.AS_ENTRIES),E=!(!n||!n.IS_ITERATOR),k=!(!n||!n.INTERRUPTED),P=o(e,j),T=function(t){return r&&p(r,"normal",t),new h(!0,t)},A=function(t){return S?(c(t),k?P(t[0],t[1],T):P(t[0],t[1])):k?P(t,T):P(t)};if(E)r=t;else{if(y=l(t),!y)throw v(a(t)+" is not iterable");if(u(y)){for(g=0,m=f(t);m>g;g++)if(x=A(t[g]),x&&s(b,x))return x;return new h(!1)}r=d(t,y)}w=r.next;while(!(O=i(w,r)).done){try{x=A(O.value)}catch(R){p(r,"throw",R)}if("object"==typeof x&&x&&s(b,x))return x}return new h(!1)}},"23cb":function(t,e,n){var r=n("5926"),o=Math.max,i=Math.min;t.exports=function(t,e){var n=r(t);return n<0?o(n+e,0):i(n,e)}},"23e7":function(t,e,n){var r=n("da84"),o=n("06cf").f,i=n("9112"),c=n("6eeb"),a=n("ce4e"),u=n("e893"),f=n("94ca");t.exports=function(t,e){var n,s,d,l,p,v,h=t.target,b=t.global,y=t.stat;if(s=b?r:y?r[h]||a(h,{}):(r[h]||{}).prototype,s)for(d in e){if(p=e[d],t.noTargetGet?(v=o(s,d),l=v&&v.value):l=s[d],n=f(b?d:h+(y?".":"#")+d,t.forced),!n&&void 0!==l){if(typeof p==typeof l)continue;u(p,l)}(t.sham||l&&l.sham)&&i(p,"sham",!0),c(s,d,p,t)}}},"241c":function(t,e,n){var r=n("ca84"),o=n("7839"),i=o.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},"25f0":function(t,e,n){"use strict";var r=n("e330"),o=n("5e77").PROPER,i=n("6eeb"),c=n("825a"),a=n("3a9b"),u=n("577e"),f=n("d039"),s=n("ad6d"),d="toString",l=RegExp.prototype,p=l[d],v=r(s),h=f((function(){return"/a/b"!=p.call({source:"a",flags:"b"})})),b=o&&p.name!=d;(h||b)&&i(RegExp.prototype,d,(function(){var t=c(this),e=u(t.source),n=t.flags,r=u(void 0===n&&a(l,t)&&!("flags"in l)?v(t):n);return"/"+e+"/"+r}),{unsafe:!0})},2626:function(t,e,n){"use strict";var r=n("d066"),o=n("9bf2"),i=n("b622"),c=n("83ab"),a=i("species");t.exports=function(t){var e=r(t),n=o.f;c&&e&&!e[a]&&n(e,a,{configurable:!0,get:function(){return this}})}},"277d":function(t,e,n){var r=n("23e7"),o=n("e8b5");r({target:"Array",stat:!0},{isArray:o})},"2a62":function(t,e,n){var r=n("c65b"),o=n("825a"),i=n("dc4a");t.exports=function(t,e,n){var c,a;o(t);try{if(c=i(t,"return"),!c){if("throw"===e)throw n;return n}c=r(c,t)}catch(u){a=!0,c=u}if("throw"===e)throw n;if(a)throw c;return o(c),n}},"2ba4":function(t,e,n){var r=n("40d5"),o=Function.prototype,i=o.apply,c=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(r?c.bind(i):function(){return c.apply(i,arguments)})},"2cf4":function(t,e,n){var r,o,i,c,a=n("da84"),u=n("2ba4"),f=n("0366"),s=n("1626"),d=n("1a2d"),l=n("d039"),p=n("1be4"),v=n("f36a"),h=n("cc12"),b=n("d6d6"),y=n("1cdc"),g=n("605d"),m=a.setImmediate,x=a.clearImmediate,w=a.process,O=a.Dispatch,j=a.Function,S=a.MessageChannel,E=a.String,k=0,P={},T="onreadystatechange";try{r=a.location}catch(C){}var A=function(t){if(d(P,t)){var e=P[t];delete P[t],e()}},R=function(t){return function(){A(t)}},I=function(t){A(t.data)},_=function(t){a.postMessage(E(t),r.protocol+"//"+r.host)};m&&x||(m=function(t){b(arguments.length,1);var e=s(t)?t:j(t),n=v(arguments,1);return P[++k]=function(){u(e,void 0,n)},o(k),k},x=function(t){delete P[t]},g?o=function(t){w.nextTick(R(t))}:O&&O.now?o=function(t){O.now(R(t))}:S&&!y?(i=new S,c=i.port2,i.port1.onmessage=I,o=f(c.postMessage,c)):a.addEventListener&&s(a.postMessage)&&!a.importScripts&&r&&"file:"!==r.protocol&&!l(_)?(o=_,a.addEventListener("message",I,!1)):o=T in h("script")?function(t){p.appendChild(h("script"))[T]=function(){p.removeChild(this),A(t)}}:function(t){setTimeout(R(t),0)}),t.exports={set:m,clear:x}},"2d00":function(t,e,n){var r,o,i=n("da84"),c=n("342f"),a=i.process,u=i.Deno,f=a&&a.versions||u&&u.version,s=f&&f.v8;s&&(r=s.split("."),o=r[0]>0&&r[0]<4?1:+(r[0]+r[1])),!o&&c&&(r=c.match(/Edge\/(\d+)/),(!r||r[1]>=74)&&(r=c.match(/Chrome\/(\d+)/),r&&(o=+r[1]))),t.exports=o},3410:function(t,e,n){var r=n("23e7"),o=n("d039"),i=n("7b0b"),c=n("e163"),a=n("e177"),u=o((function(){c(1)}));r({target:"Object",stat:!0,forced:u,sham:!a},{getPrototypeOf:function(t){return c(i(t))}})},"342f":function(t,e,n){var r=n("d066");t.exports=r("navigator","userAgent")||""},"35a1":function(t,e,n){var r=n("f5df"),o=n("dc4a"),i=n("3f8c"),c=n("b622"),a=c("iterator");t.exports=function(t){if(void 0!=t)return o(t,a)||o(t,"@@iterator")||i[r(t)]}},"37e8":function(t,e,n){var r=n("83ab"),o=n("aed9"),i=n("9bf2"),c=n("825a"),a=n("fc6a"),u=n("df75");e.f=r&&!o?Object.defineProperties:function(t,e){c(t);var n,r=a(e),o=u(e),f=o.length,s=0;while(f>s)i.f(t,n=o[s++],r[n]);return t}},"3a9b":function(t,e,n){var r=n("e330");t.exports=r({}.isPrototypeOf)},"3bbe":function(t,e,n){var r=n("da84"),o=n("1626"),i=r.String,c=r.TypeError;t.exports=function(t){if("object"==typeof t||o(t))return t;throw c("Can't set "+i(t)+" as a prototype")}},"3ca3":function(t,e,n){"use strict";var r=n("6547").charAt,o=n("577e"),i=n("69f3"),c=n("7dd0"),a="String Iterator",u=i.set,f=i.getterFor(a);c(String,"String",(function(t){u(this,{type:a,string:o(t),index:0})}),(function(){var t,e=f(this),n=e.string,o=e.index;return o>=n.length?{value:void 0,done:!0}:(t=r(n,o),e.index+=t.length,{value:t,done:!1})}))},"3f8c":function(t,e){t.exports={}},"40d5":function(t,e,n){var r=n("d039");t.exports=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},4160:function(t,e,n){"use strict";var r=n("23e7"),o=n("17c2");r({target:"Array",proto:!0,forced:[].forEach!=o},{forEach:o})},4269:function(t,e,n){"use strict";n.r(e),n.d(e,"useSocket",(function(){return P}));n("d9e2"),n("d401");function r(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}n("b8bf"),n("7a82"),n("131a");function o(t,e){return o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},o(t,e)}function i(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}n("4ae1"),n("d3b7"),n("f8c9"),n("3410");function c(t){return c=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},c(t)}function a(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}n("a4d3"),n("e01a"),n("d28b"),n("e260"),n("3ca3"),n("ddb0");function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function f(t,e){if(e&&("object"===u(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return r(t)}function s(t){var e=a();return function(){var n,r=c(t);if(e){var o=c(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return f(this,n)}}n("4ec9"),n("c975"),n("0d03"),n("25f0");function d(t){return-1!==Function.toString.call(t).indexOf("[native code]")}n("c0b6");function l(t,e,n){return l=a()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=Function.bind.apply(t,r),c=new i;return n&&o(c,n.prototype),c},l.apply(null,arguments)}function p(t){var e="function"===typeof Map?new Map:void 0;return p=function(t){if(null===t||!d(t))return t;if("function"!==typeof t)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return l(t,arguments,c(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),o(n,t)},p(t)}var v=n("d4ec"),h=n("bee2"),b=n("ade3"),y=(n("4160"),n("159b"),n("b64b"),n("13d5"),n("99af"),n("cca6"),n("4795"),n("caad"),n("e9c4"),["open","close","message","error","reconnect"]),g=3e4,m=4e4,x=10,w={Type:1,Parameters:["alive"]},O=1e3;function j(t){if(!t&&"object"!==u(t))throw new Error("error arguments","deepClone");var e=t.constructor===Array?[]:{};return Object.keys(t).forEach((function(n){t[n]&&"object"===u(t[n])?e[n]=j(t[n]):e[n]=t[n]})),e}var S=function(){function t(){Object(v["a"])(this,t),Object(b["a"])(this,"deps",new Map)}return Object(h["a"])(t,[{key:"depend",value:function(t,e){this.deps.set(t,e)}},{key:"notify",value:function(t,e){this.deps.has(t)&&this.deps.get(t)(e)}}]),t}(),E=function(t){i(n,t);var e=s(n);function n(t,o){var i,c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3?arguments[3]:void 0;Object(v["a"])(this,n);var f="",s=t.url,d=t.protocols,l=t.query,p=void 0===l?{}:l,h=t.greet,y=void 0===h?null:h,m=t.customBase,O=void 0===m?null:m,j=t.checkData,S=Object.keys(p).reduce((function(t,e){return"object"!==u(p[e])&&"function"!==typeof p[e]?t+(t.length>0?"&".concat(e,"=").concat(p[e]):"".concat(e,"=").concat(p[e])):t}),"");return O&&(f=O),i=e.call(this,"".concat(f).concat(s).concat(S?"?"+S:""),d),Object(b["a"])(r(i),"heartCheckData",w),Object(b["a"])(r(i),"heartCheckTimeout",g),Object(b["a"])(r(i),"heartCheckInterval",null),Object(b["a"])(r(i),"heartCheckCount",x),Object(b["a"])(r(i),"firstConnect",!1),i.self=a,i._currentOptions=t,i._dep=o,i.heartCheckData=j||w,i._reconnectCount=c,y&&Object.assign(r(i),{heartCheckData:y}),i.initSocket(),i}return Object(h["a"])(n,[{key:"initSocket",value:function(){this.onopen=function(t){this._dep.notify("open",t),this.firstConnect=!0,this.heartCheckStart()},this.onclose=function(t){var e=this;if(this._dep.notify("close",t),t.code!==O){this._reconnectCount++;var r=j(this._currentOptions);this.firstConnect&&(r.query.type="reconnect"),this.self.socketTimer&&clearTimeout(this.self.socketTimer),this.self.socketTimer=setTimeout((function(){var t=new n(r,e._dep,e._reconnectCount,e.self);e._dep.notify("reconnect",t)}),m)}},this.onerror=function(t){this._dep.notify("error",t)},this.onmessage=function(t){var e=this;if(t.data instanceof Blob){var n=new FileReader;n.readAsArrayBuffer(t.data),n.onload=function(t){var n;t.target.readyState===FileReader.DONE&&e._dep.notify("message",null===(n=t.target)||void 0===n?void 0:n.result)}}else try{this._dep.notify("message",t.data)}catch(r){console.log(r)}}}},{key:"subscribe",value:function(t,e){if("function"!==typeof e)throw new Error("The second param is must be a function");if(!y.includes(t))throw new Error("The first param is not supported");this._dep.depend(t,e)}},{key:"sendMessage",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.transformJSON,r=void 0===n||n,o=t;r&&(o=JSON.stringify(t)),this.send(o)}},{key:"closeSocket",value:function(t,e){this.clearHeartCheck(),this.close(t,e)}},{key:"heartCheckStart",value:function(){var t=this;this.heartCheckInterval=setInterval((function(){if(t.readyState===t.OPEN){var e="object"===u(t.heartCheckData);t.sendMessage(t.heartCheckData,{transformJSON:e})}else t.clearHeartCheck()}),this.heartCheckTimeout)}},{key:"clearHeartCheck",value:function(){clearInterval(this.heartCheckInterval)}},{key:"resetHeartCheck",value:function(){clearInterval(this.heartCheckInterval),this.heartCheckStart()}}]),n}(p(WebSocket)),k={url:"",protocols:"",customBase:null,query:{}},P=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:k,e=arguments.length>1?arguments[1]:void 0;if(!window.WebSocket)return console.error("您的浏览器不支持WebSocket, 请更换浏览器!");var n=new S,r=0;return new E(t,n,r,e)}},"428f":function(t,e,n){var r=n("da84");t.exports=r},"44ad":function(t,e,n){var r=n("da84"),o=n("e330"),i=n("d039"),c=n("c6b6"),a=r.Object,u=o("".split);t.exports=i((function(){return!a("z").propertyIsEnumerable(0)}))?function(t){return"String"==c(t)?u(t,""):a(t)}:a},"44d2":function(t,e,n){var r=n("b622"),o=n("7c73"),i=n("9bf2"),c=r("unscopables"),a=Array.prototype;void 0==a[c]&&i.f(a,c,{configurable:!0,value:o(null)}),t.exports=function(t){a[c][t]=!0}},"44de":function(t,e,n){var r=n("da84");t.exports=function(t,e){var n=r.console;n&&n.error&&(1==arguments.length?n.error(t):n.error(t,e))}},"44e7":function(t,e,n){var r=n("861d"),o=n("c6b6"),i=n("b622"),c=i("match");t.exports=function(t){var e;return r(t)&&(void 0!==(e=t[c])?!!e:"RegExp"==o(t))}},4795:function(t,e,n){var r=n("23e7"),o=n("da84"),i=n("2ba4"),c=n("1626"),a=n("342f"),u=n("f36a"),f=n("d6d6"),s=/MSIE .\./.test(a),d=o.Function,l=function(t){return function(e,n){var r=f(arguments.length,1)>2,o=c(e)?e:d(e),a=r?u(arguments,2):void 0;return t(r?function(){i(o,this,a)}:o,n)}};r({global:!0,bind:!0,forced:s},{setTimeout:l(o.setTimeout),setInterval:l(o.setInterval)})},4840:function(t,e,n){var r=n("825a"),o=n("5087"),i=n("b622"),c=i("species");t.exports=function(t,e){var n,i=r(t).constructor;return void 0===i||void 0==(n=r(i)[c])?e:o(n)}},"485a":function(t,e,n){var r=n("da84"),o=n("c65b"),i=n("1626"),c=n("861d"),a=r.TypeError;t.exports=function(t,e){var n,r;if("string"===e&&i(n=t.toString)&&!c(r=o(n,t)))return r;if(i(n=t.valueOf)&&!c(r=o(n,t)))return r;if("string"!==e&&i(n=t.toString)&&!c(r=o(n,t)))return r;throw a("Can't convert object to primitive value")}},4930:function(t,e,n){var r=n("2d00"),o=n("d039");t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},"4ae1":function(t,e,n){var r=n("23e7"),o=n("d066"),i=n("2ba4"),c=n("0538"),a=n("5087"),u=n("825a"),f=n("861d"),s=n("7c73"),d=n("d039"),l=o("Reflect","construct"),p=Object.prototype,v=[].push,h=d((function(){function t(){}return!(l((function(){}),[],t)instanceof t)})),b=!d((function(){l((function(){}))})),y=h||b;r({target:"Reflect",stat:!0,forced:y,sham:y},{construct:function(t,e){a(t),u(e);var n=arguments.length<3?t:a(arguments[2]);if(b&&!h)return l(t,e,n);if(t==n){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var r=[null];return i(v,r,e),new(i(c,t,r))}var o=n.prototype,d=s(f(o)?o:p),y=i(t,d,e);return f(y)?y:d}})},"4d64":function(t,e,n){var r=n("fc6a"),o=n("23cb"),i=n("07fa"),c=function(t){return function(e,n,c){var a,u=r(e),f=i(u),s=o(c,f);if(t&&n!=n){while(f>s)if(a=u[s++],a!=a)return!0}else for(;f>s;s++)if((t||s in u)&&u[s]===n)return t||s||0;return!t&&-1}};t.exports={includes:c(!0),indexOf:c(!1)}},"4dae":function(t,e,n){var r=n("da84"),o=n("23cb"),i=n("07fa"),c=n("8418"),a=r.Array,u=Math.max;t.exports=function(t,e,n){for(var r=i(t),f=o(e,r),s=o(void 0===n?r:n,r),d=a(u(s-f,0)),l=0;f<s;f++,l++)c(d,l,t[f]);return d.length=l,d}},"4de4":function(t,e,n){"use strict";var r=n("23e7"),o=n("b727").filter,i=n("1dde"),c=i("filter");r({target:"Array",proto:!0,forced:!c},{filter:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},"4df4":function(t,e,n){"use strict";var r=n("da84"),o=n("0366"),i=n("c65b"),c=n("7b0b"),a=n("9bdd"),u=n("e95a"),f=n("68ee"),s=n("07fa"),d=n("8418"),l=n("9a1f"),p=n("35a1"),v=r.Array;t.exports=function(t){var e=c(t),n=f(this),r=arguments.length,h=r>1?arguments[1]:void 0,b=void 0!==h;b&&(h=o(h,r>2?arguments[2]:void 0));var y,g,m,x,w,O,j=p(e),S=0;if(!j||this==v&&u(j))for(y=s(e),g=n?new this(y):v(y);y>S;S++)O=b?h(e[S],S):e[S],d(g,S,O);else for(x=l(e,j),w=x.next,g=n?new this:[];!(m=i(w,x)).done;S++)O=b?a(x,h,[m.value,S],!0):m.value,d(g,S,O);return g.length=S,g}},"4ec9":function(t,e,n){"use strict";var r=n("6d61"),o=n("6566");r("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),o)},"4fad":function(t,e,n){var r=n("d039"),o=n("861d"),i=n("c6b6"),c=n("d86b"),a=Object.isExtensible,u=r((function(){a(1)}));t.exports=u||c?function(t){return!!o(t)&&((!c||"ArrayBuffer"!=i(t))&&(!a||a(t)))}:a},5087:function(t,e,n){var r=n("da84"),o=n("68ee"),i=n("0d51"),c=r.TypeError;t.exports=function(t){if(o(t))return t;throw c(i(t)+" is not a constructor")}},"50c4":function(t,e,n){var r=n("5926"),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},5180:function(t,e,n){var r={"./http.js":"8177","./websocket.js":"4269"};function o(t){var e=i(t);return n(e)}function i(t){if(!n.o(r,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return r[t]}o.keys=function(){return Object.keys(r)},o.resolve=i,t.exports=o,o.id="5180"},5692:function(t,e,n){var r=n("c430"),o=n("c6cd");(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.21.1",mode:r?"pure":"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE",source:"https://github.com/zloirock/core-js"})},"56ef":function(t,e,n){var r=n("d066"),o=n("e330"),i=n("241c"),c=n("7418"),a=n("825a"),u=o([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=i.f(a(t)),n=c.f;return n?u(e,n(t)):e}},"577e":function(t,e,n){var r=n("da84"),o=n("f5df"),i=r.String;t.exports=function(t){if("Symbol"===o(t))throw TypeError("Cannot convert a Symbol value to a string");return i(t)}},5926:function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){var e=+t;return e!==e||0===e?0:(e>0?r:n)(e)}},"59ed":function(t,e,n){var r=n("da84"),o=n("1626"),i=n("0d51"),c=r.TypeError;t.exports=function(t){if(o(t))return t;throw c(i(t)+" is not a function")}},"5c6c":function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},"5e77":function(t,e,n){var r=n("83ab"),o=n("1a2d"),i=Function.prototype,c=r&&Object.getOwnPropertyDescriptor,a=o(i,"name"),u=a&&"something"===function(){}.name,f=a&&(!r||r&&c(i,"name").configurable);t.exports={EXISTS:a,PROPER:u,CONFIGURABLE:f}},"605d":function(t,e,n){var r=n("c6b6"),o=n("da84");t.exports="process"==r(o.process)},6069:function(t,e){t.exports="object"==typeof window},"60da":function(t,e,n){"use strict";var r=n("83ab"),o=n("e330"),i=n("c65b"),c=n("d039"),a=n("df75"),u=n("7418"),f=n("d1e7"),s=n("7b0b"),d=n("44ad"),l=Object.assign,p=Object.defineProperty,v=o([].concat);t.exports=!l||c((function(){if(r&&1!==l({b:1},l(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),o="abcdefghijklmnopqrst";return t[n]=7,o.split("").forEach((function(t){e[t]=t})),7!=l({},t)[n]||a(l({},e)).join("")!=o}))?function(t,e){var n=s(t),o=arguments.length,c=1,l=u.f,p=f.f;while(o>c){var h,b=d(arguments[c++]),y=l?v(a(b),l(b)):a(b),g=y.length,m=0;while(g>m)h=y[m++],r&&!i(p,b,h)||(n[h]=b[h])}return n}:l},6547:function(t,e,n){var r=n("e330"),o=n("5926"),i=n("577e"),c=n("1d80"),a=r("".charAt),u=r("".charCodeAt),f=r("".slice),s=function(t){return function(e,n){var r,s,d=i(c(e)),l=o(n),p=d.length;return l<0||l>=p?t?"":void 0:(r=u(d,l),r<55296||r>56319||l+1===p||(s=u(d,l+1))<56320||s>57343?t?a(d,l):r:t?f(d,l,l+2):s-56320+(r-55296<<10)+65536)}};t.exports={codeAt:s(!1),charAt:s(!0)}},6566:function(t,e,n){"use strict";var r=n("9bf2").f,o=n("7c73"),i=n("e2cc"),c=n("0366"),a=n("19aa"),u=n("2266"),f=n("7dd0"),s=n("2626"),d=n("83ab"),l=n("f183").fastKey,p=n("69f3"),v=p.set,h=p.getterFor;t.exports={getConstructor:function(t,e,n,f){var s=t((function(t,r){a(t,p),v(t,{type:e,index:o(null),first:void 0,last:void 0,size:0}),d||(t.size=0),void 0!=r&&u(r,t[f],{that:t,AS_ENTRIES:n})})),p=s.prototype,b=h(e),y=function(t,e,n){var r,o,i=b(t),c=g(t,e);return c?c.value=n:(i.last=c={index:o=l(e,!0),key:e,value:n,previous:r=i.last,next:void 0,removed:!1},i.first||(i.first=c),r&&(r.next=c),d?i.size++:t.size++,"F"!==o&&(i.index[o]=c)),t},g=function(t,e){var n,r=b(t),o=l(e);if("F"!==o)return r.index[o];for(n=r.first;n;n=n.next)if(n.key==e)return n};return i(p,{clear:function(){var t=this,e=b(t),n=e.index,r=e.first;while(r)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete n[r.index],r=r.next;e.first=e.last=void 0,d?e.size=0:t.size=0},delete:function(t){var e=this,n=b(e),r=g(e,t);if(r){var o=r.next,i=r.previous;delete n.index[r.index],r.removed=!0,i&&(i.next=o),o&&(o.previous=i),n.first==r&&(n.first=o),n.last==r&&(n.last=i),d?n.size--:e.size--}return!!r},forEach:function(t){var e,n=b(this),r=c(t,arguments.length>1?arguments[1]:void 0);while(e=e?e.next:n.first){r(e.value,e.key,this);while(e&&e.removed)e=e.previous}},has:function(t){return!!g(this,t)}}),i(p,n?{get:function(t){var e=g(this,t);return e&&e.value},set:function(t,e){return y(this,0===t?0:t,e)}}:{add:function(t){return y(this,t=0===t?0:t,t)}}),d&&r(p,"size",{get:function(){return b(this).size}}),s},setStrong:function(t,e,n){var r=e+" Iterator",o=h(e),i=h(r);f(t,e,(function(t,e){v(this,{type:r,target:t,state:o(t),kind:e,last:void 0})}),(function(){var t=i(this),e=t.kind,n=t.last;while(n&&n.removed)n=n.previous;return t.target&&(t.last=n=n?n.next:t.state.first)?"keys"==e?{value:n.key,done:!1}:"values"==e?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),n?"entries":"values",!n,!0),s(e)}}},"65f0":function(t,e,n){var r=n("0b42");t.exports=function(t,e){return new(r(t))(0===e?0:e)}},"68ee":function(t,e,n){var r=n("e330"),o=n("d039"),i=n("1626"),c=n("f5df"),a=n("d066"),u=n("8925"),f=function(){},s=[],d=a("Reflect","construct"),l=/^\s*(?:class|function)\b/,p=r(l.exec),v=!l.exec(f),h=function(t){if(!i(t))return!1;try{return d(f,s,t),!0}catch(e){return!1}},b=function(t){if(!i(t))return!1;switch(c(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return v||!!p(l,u(t))}catch(e){return!0}};b.sham=!0,t.exports=!d||o((function(){var t;return h(h.call)||!h(Object)||!h((function(){t=!0}))||t}))?b:h},"69f3":function(t,e,n){var r,o,i,c=n("7f9a"),a=n("da84"),u=n("e330"),f=n("861d"),s=n("9112"),d=n("1a2d"),l=n("c6cd"),p=n("f772"),v=n("d012"),h="Object already initialized",b=a.TypeError,y=a.WeakMap,g=function(t){return i(t)?o(t):r(t,{})},m=function(t){return function(e){var n;if(!f(e)||(n=o(e)).type!==t)throw b("Incompatible receiver, "+t+" required");return n}};if(c||l.state){var x=l.state||(l.state=new y),w=u(x.get),O=u(x.has),j=u(x.set);r=function(t,e){if(O(x,t))throw new b(h);return e.facade=t,j(x,t,e),e},o=function(t){return w(x,t)||{}},i=function(t){return O(x,t)}}else{var S=p("state");v[S]=!0,r=function(t,e){if(d(t,S))throw new b(h);return e.facade=t,s(t,S,e),e},o=function(t){return d(t,S)?t[S]:{}},i=function(t){return d(t,S)}}t.exports={set:r,get:o,has:i,enforce:g,getterFor:m}},"6d61":function(t,e,n){"use strict";var r=n("23e7"),o=n("da84"),i=n("e330"),c=n("94ca"),a=n("6eeb"),u=n("f183"),f=n("2266"),s=n("19aa"),d=n("1626"),l=n("861d"),p=n("d039"),v=n("1c7e"),h=n("d44e"),b=n("7156");t.exports=function(t,e,n){var y=-1!==t.indexOf("Map"),g=-1!==t.indexOf("Weak"),m=y?"set":"add",x=o[t],w=x&&x.prototype,O=x,j={},S=function(t){var e=i(w[t]);a(w,t,"add"==t?function(t){return e(this,0===t?0:t),this}:"delete"==t?function(t){return!(g&&!l(t))&&e(this,0===t?0:t)}:"get"==t?function(t){return g&&!l(t)?void 0:e(this,0===t?0:t)}:"has"==t?function(t){return!(g&&!l(t))&&e(this,0===t?0:t)}:function(t,n){return e(this,0===t?0:t,n),this})},E=c(t,!d(x)||!(g||w.forEach&&!p((function(){(new x).entries().next()}))));if(E)O=n.getConstructor(e,t,y,m),u.enable();else if(c(t,!0)){var k=new O,P=k[m](g?{}:-0,1)!=k,T=p((function(){k.has(1)})),A=v((function(t){new x(t)})),R=!g&&p((function(){var t=new x,e=5;while(e--)t[m](e,e);return!t.has(-0)}));A||(O=e((function(t,e){s(t,w);var n=b(new x,t,O);return void 0!=e&&f(e,n[m],{that:n,AS_ENTRIES:y}),n})),O.prototype=w,w.constructor=O),(T||R)&&(S("delete"),S("has"),y&&S("get")),(R||P)&&S(m),g&&w.clear&&delete w.clear}return j[t]=O,r({global:!0,forced:O!=x},j),h(O,t),g||n.setStrong(O,t,y),O}},"6eeb":function(t,e,n){var r=n("da84"),o=n("1626"),i=n("1a2d"),c=n("9112"),a=n("ce4e"),u=n("8925"),f=n("69f3"),s=n("5e77").CONFIGURABLE,d=f.get,l=f.enforce,p=String(String).split("String");(t.exports=function(t,e,n,u){var f,d=!!u&&!!u.unsafe,v=!!u&&!!u.enumerable,h=!!u&&!!u.noTargetGet,b=u&&void 0!==u.name?u.name:e;o(n)&&("Symbol("===String(b).slice(0,7)&&(b="["+String(b).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!i(n,"name")||s&&n.name!==b)&&c(n,"name",b),f=l(n),f.source||(f.source=p.join("string"==typeof b?b:""))),t!==r?(d?!h&&t[e]&&(v=!0):delete t[e],v?t[e]=n:c(t,e,n)):v?t[e]=n:a(e,n)})(Function.prototype,"toString",(function(){return o(this)&&d(this).source||u(this)}))},7156:function(t,e,n){var r=n("1626"),o=n("861d"),i=n("d2bb");t.exports=function(t,e,n){var c,a;return i&&r(c=e.constructor)&&c!==n&&o(a=c.prototype)&&a!==n.prototype&&i(t,a),t}},7418:function(t,e){e.f=Object.getOwnPropertySymbols},"746f":function(t,e,n){var r=n("428f"),o=n("1a2d"),i=n("e538"),c=n("9bf2").f;t.exports=function(t){var e=r.Symbol||(r.Symbol={});o(e,t)||c(e,t,{value:i.f(t)})}},7839:function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"785a":function(t,e,n){var r=n("cc12"),o=r("span").classList,i=o&&o.constructor&&o.constructor.prototype;t.exports=i===Object.prototype?void 0:i},"7a82":function(t,e,n){var r=n("23e7"),o=n("83ab"),i=n("9bf2").f;r({target:"Object",stat:!0,forced:Object.defineProperty!==i,sham:!o},{defineProperty:i})},"7b0b":function(t,e,n){var r=n("da84"),o=n("1d80"),i=r.Object;t.exports=function(t){return i(o(t))}},"7c73":function(t,e,n){var r,o=n("825a"),i=n("37e8"),c=n("7839"),a=n("d012"),u=n("1be4"),f=n("cc12"),s=n("f772"),d=">",l="<",p="prototype",v="script",h=s("IE_PROTO"),b=function(){},y=function(t){return l+v+d+t+l+"/"+v+d},g=function(t){t.write(y("")),t.close();var e=t.parentWindow.Object;return t=null,e},m=function(){var t,e=f("iframe"),n="java"+v+":";return e.style.display="none",u.appendChild(e),e.src=String(n),t=e.contentWindow.document,t.open(),t.write(y("document.F=Object")),t.close(),t.F},x=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}x="undefined"!=typeof document?document.domain&&r?g(r):m():g(r);var t=c.length;while(t--)delete x[p][c[t]];return x()};a[h]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(b[p]=o(t),n=new b,b[p]=null,n[h]=t):n=x(),void 0===e?n:i.f(n,e)}},"7dd0":function(t,e,n){"use strict";var r=n("23e7"),o=n("c65b"),i=n("c430"),c=n("5e77"),a=n("1626"),u=n("9ed3"),f=n("e163"),s=n("d2bb"),d=n("d44e"),l=n("9112"),p=n("6eeb"),v=n("b622"),h=n("3f8c"),b=n("ae93"),y=c.PROPER,g=c.CONFIGURABLE,m=b.IteratorPrototype,x=b.BUGGY_SAFARI_ITERATORS,w=v("iterator"),O="keys",j="values",S="entries",E=function(){return this};t.exports=function(t,e,n,c,v,b,k){u(n,e,c);var P,T,A,R=function(t){if(t===v&&F)return F;if(!x&&t in C)return C[t];switch(t){case O:return function(){return new n(this,t)};case j:return function(){return new n(this,t)};case S:return function(){return new n(this,t)}}return function(){return new n(this)}},I=e+" Iterator",_=!1,C=t.prototype,L=C[w]||C["@@iterator"]||v&&C[v],F=!x&&L||R(v),M="Array"==e&&C.entries||L;if(M&&(P=f(M.call(new t)),P!==Object.prototype&&P.next&&(i||f(P)===m||(s?s(P,m):a(P[w])||p(P,w,E)),d(P,I,!0,!0),i&&(h[I]=E))),y&&v==j&&L&&L.name!==j&&(!i&&g?l(C,"name",j):(_=!0,F=function(){return o(L,this)})),v)if(T={values:R(j),keys:b?F:R(O),entries:R(S)},k)for(A in T)(x||_||!(A in C))&&p(C,A,T[A]);else r({target:e,proto:!0,forced:x||_},T);return i&&!k||C[w]===F||p(C,w,F,{name:v}),h[e]=F,T}},"7f9a":function(t,e,n){var r=n("da84"),o=n("1626"),i=n("8925"),c=r.WeakMap;t.exports=o(c)&&/native code/.test(i(c))},8177:function(t,e,n){"use strict";n.r(e),n.d(e,"useHttp",(function(){return m}));n("d3b7"),n("e6cf");function r(t,e,n,r,o,i,c){try{var a=t[i](c),u=a.value}catch(f){return void n(f)}a.done?e(u):Promise.resolve(u).then(r,o)}function o(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var c=t.apply(e,n);function a(t){r(c,o,i,a,u,"next",t)}function u(t){r(c,o,i,a,u,"throw",t)}a(void 0)}))}}n("277d");function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function c(t){if(Array.isArray(t))return i(t)}n("a4d3"),n("e01a"),n("d28b"),n("e260"),n("3ca3"),n("ddb0"),n("a630");function a(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}n("fb6a"),n("b0c0"),n("ac1f"),n("00b4");function u(t,e){if(t){if("string"===typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}n("d9e2"),n("d401");function f(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(t){return c(t)||a(t)||u(t)||f()}n("b64b"),n("4de4"),n("e439"),n("4160"),n("159b"),n("dbb4"),n("1d1c"),n("7a82");var d=n("ade3");function l(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function p(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?l(Object(n),!0).forEach((function(e){Object(d["a"])(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var v=n("d4ec"),h=n("bee2"),b=n("d5e4"),y=(n("96cf"),n("c975"),n("99af"),n("10d1"),new WeakMap),g=function(){function t(e,n,r,o){var i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],c=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;Object(v["a"])(this,t),Object(b["a"])(this,y,{writable:!0,value:null}),this.url=e,this.method=n,this.data=r,this.headers=headers,this.success=c,this.fail=a,this.abort=new AbortController;var u=[e,p({method:n,body:r,signal:this.abort.signal},o)];if("GET"==n&&r&&Object.keys(r).length>0){var f="?";for(var d in e.indexOf("?")>-1&&(f="&"),r)f+="".concat(d,"=").concat(r[d],"&");e+=f,u=[e,p({method:n,signal:this.abort.signal},o)]}i?fetch.apply(void 0,s(u)).then((function(t){200==t.status?c&&c(t.json()):console.log("请求出错")}))["catch"]((function(t){a&&a()})):this.initAsync(u,c,a)}return Object(h["a"])(t,[{key:"initAsync",value:function(){var t=o(regeneratorRuntime.mark((function t(e,n,r){var o,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,fetch.apply(void 0,s(e));case 2:if(o=t.sent,!(o.status>=200&&o.status<300)){t.next=10;break}return t.next=6,o.text();case 6:i=t.sent,n&&n(i),t.next=12;break;case 10:throw r&&r(o),new Error(o.statusText);case 12:case"end":return t.stop()}}),t)})));function e(e,n,r){return t.apply(this,arguments)}return e}()},{key:"getAbort",value:function(){return this.abort}}]),t}(),m=function(t,e,n,r){var o=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0;return window.fetch?new g(t,e,n,r,!0,o,i):console.error("您的浏览器不支持fetch, 请更换浏览器!")}},"825a":function(t,e,n){var r=n("da84"),o=n("861d"),i=r.String,c=r.TypeError;t.exports=function(t){if(o(t))return t;throw c(i(t)+" is not an object")}},"83ab":function(t,e,n){var r=n("d039");t.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},8418:function(t,e,n){"use strict";var r=n("a04b"),o=n("9bf2"),i=n("5c6c");t.exports=function(t,e,n){var c=r(e);c in t?o.f(t,c,i(0,n)):t[c]=n}},"861d":function(t,e,n){var r=n("1626");t.exports=function(t){return"object"==typeof t?null!==t:r(t)}},8875:function(t,e,n){var r,o,i;(function(n,c){o=[],r=c,i="function"===typeof r?r.apply(e,o):r,void 0===i||(t.exports=i)})("undefined"!==typeof self&&self,(function(){function t(){var e=Object.getOwnPropertyDescriptor(document,"currentScript");if(!e&&"currentScript"in document&&document.currentScript)return document.currentScript;if(e&&e.get!==t&&document.currentScript)return document.currentScript;try{throw new Error}catch(p){var n,r,o,i=/.*at [^(]*\((.*):(.+):(.+)\)$/gi,c=/@([^@]*):(\d+):(\d+)\s*$/gi,a=i.exec(p.stack)||c.exec(p.stack),u=a&&a[1]||!1,f=a&&a[2]||!1,s=document.location.href.replace(document.location.hash,""),d=document.getElementsByTagName("script");u===s&&(n=document.documentElement.outerHTML,r=new RegExp("(?:[^\\n]+?\\n){0,"+(f-2)+"}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),o=n.replace(r,"$1").trim());for(var l=0;l<d.length;l++){if("interactive"===d[l].readyState)return d[l];if(d[l].src===u)return d[l];if(u===s&&d[l].innerHTML&&d[l].innerHTML.trim()===o)return d[l]}return null}}return t}))},8925:function(t,e,n){var r=n("e330"),o=n("1626"),i=n("c6cd"),c=r(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return c(t)}),t.exports=i.inspectSource},"8aa5":function(t,e,n){"use strict";var r=n("6547").charAt;t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},"90e3":function(t,e,n){var r=n("e330"),o=0,i=Math.random(),c=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+c(++o+i,36)}},9112:function(t,e,n){var r=n("83ab"),o=n("9bf2"),i=n("5c6c");t.exports=r?function(t,e,n){return o.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},9263:function(t,e,n){"use strict";var r=n("c65b"),o=n("e330"),i=n("577e"),c=n("ad6d"),a=n("9f7f"),u=n("5692"),f=n("7c73"),s=n("69f3").get,d=n("fce3"),l=n("107c"),p=u("native-string-replace",String.prototype.replace),v=RegExp.prototype.exec,h=v,b=o("".charAt),y=o("".indexOf),g=o("".replace),m=o("".slice),x=function(){var t=/a/,e=/b*/g;return r(v,t,"a"),r(v,e,"a"),0!==t.lastIndex||0!==e.lastIndex}(),w=a.BROKEN_CARET,O=void 0!==/()??/.exec("")[1],j=x||O||w||d||l;j&&(h=function(t){var e,n,o,a,u,d,l,j=this,S=s(j),E=i(t),k=S.raw;if(k)return k.lastIndex=j.lastIndex,e=r(h,k,E),j.lastIndex=k.lastIndex,e;var P=S.groups,T=w&&j.sticky,A=r(c,j),R=j.source,I=0,_=E;if(T&&(A=g(A,"y",""),-1===y(A,"g")&&(A+="g"),_=m(E,j.lastIndex),j.lastIndex>0&&(!j.multiline||j.multiline&&"\n"!==b(E,j.lastIndex-1))&&(R="(?: "+R+")",_=" "+_,I++),n=new RegExp("^(?:"+R+")",A)),O&&(n=new RegExp("^"+R+"$(?!\\s)",A)),x&&(o=j.lastIndex),a=r(v,T?n:j,_),T?a?(a.input=m(a.input,I),a[0]=m(a[0],I),a.index=j.lastIndex,j.lastIndex+=a[0].length):j.lastIndex=0:x&&a&&(j.lastIndex=j.global?a.index+a[0].length:o),O&&a&&a.length>1&&r(p,a[0],n,(function(){for(u=1;u<arguments.length-2;u++)void 0===arguments[u]&&(a[u]=void 0)})),a&&P)for(a.groups=d=f(null),u=0;u<P.length;u++)l=P[u],d[l[0]]=a[l[1]];return a}),t.exports=h},"94ca":function(t,e,n){var r=n("d039"),o=n("1626"),i=/#|\.prototype\./,c=function(t,e){var n=u[a(t)];return n==s||n!=f&&(o(e)?r(e):!!e)},a=c.normalize=function(t){return String(t).replace(i,".").toLowerCase()},u=c.data={},f=c.NATIVE="N",s=c.POLYFILL="P";t.exports=c},"96cf":function(t,e,n){var r=function(t){"use strict";var e,n=Object.prototype,r=n.hasOwnProperty,o="function"===typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",a=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(_){u=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var o=e&&e.prototype instanceof b?e:b,i=Object.create(o.prototype),c=new A(r||[]);return i._invoke=E(t,n,c),i}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(_){return{type:"throw",arg:_}}}t.wrap=f;var d="suspendedStart",l="suspendedYield",p="executing",v="completed",h={};function b(){}function y(){}function g(){}var m={};u(m,i,(function(){return this}));var x=Object.getPrototypeOf,w=x&&x(x(R([])));w&&w!==n&&r.call(w,i)&&(m=w);var O=g.prototype=b.prototype=Object.create(m);function j(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function n(o,i,c,a){var u=s(t[o],t,i);if("throw"!==u.type){var f=u.arg,d=f.value;return d&&"object"===typeof d&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){n("next",t,c,a)}),(function(t){n("throw",t,c,a)})):e.resolve(d).then((function(t){f.value=t,c(f)}),(function(t){return n("throw",t,c,a)}))}a(u.arg)}var o;function i(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}this._invoke=i}function E(t,e,n){var r=d;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===v){if("throw"===o)throw i;return I()}n.method=o,n.arg=i;while(1){var c=n.delegate;if(c){var a=k(c,n);if(a){if(a===h)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===d)throw r=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var u=s(t,e,n);if("normal"===u.type){if(r=n.done?v:l,u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=v,n.method="throw",n.arg=u.arg)}}}function k(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator["return"]&&(n.method="return",n.arg=e,k(t,n),"throw"===n.method))return h;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var o=s(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,h;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function R(t){if(t){var n=t[i];if(n)return n.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var o=-1,c=function n(){while(++o<t.length)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return c.next=c}}return{next:I}}function I(){return{value:e,done:!0}}return y.prototype=g,u(O,"constructor",g),u(g,"constructor",y),y.displayName=u(g,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,u(t,a,"GeneratorFunction")),t.prototype=Object.create(O),t},t.awrap=function(t){return{__await:t}},j(S.prototype),u(S.prototype,c,(function(){return this})),t.AsyncIterator=S,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var c=new S(f(e,n,r,o),i);return t.isGeneratorFunction(n)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},j(O),u(O,a,"Generator"),u(O,i,(function(){return this})),u(O,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){while(e.length){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=R,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return a.type="throw",a.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var c=this.tryEntries[i],a=c.completion;if("root"===c.tryLoc)return o("end");if(c.tryLoc<=this.prev){var u=r.call(c,"catchLoc"),f=r.call(c,"finallyLoc");if(u&&f){if(this.prev<c.catchLoc)return o(c.catchLoc,!0);if(this.prev<c.finallyLoc)return o(c.finallyLoc)}else if(u){if(this.prev<c.catchLoc)return o(c.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<c.finallyLoc)return o(c.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var c=i?i.completion:{};return c.type=t,c.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(c)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:R(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),h}},t}(t.exports);try{regeneratorRuntime=r}catch(o){"object"===typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},"99af":function(t,e,n){"use strict";var r=n("23e7"),o=n("da84"),i=n("d039"),c=n("e8b5"),a=n("861d"),u=n("7b0b"),f=n("07fa"),s=n("8418"),d=n("65f0"),l=n("1dde"),p=n("b622"),v=n("2d00"),h=p("isConcatSpreadable"),b=9007199254740991,y="Maximum allowed index exceeded",g=o.TypeError,m=v>=51||!i((function(){var t=[];return t[h]=!1,t.concat()[0]!==t})),x=l("concat"),w=function(t){if(!a(t))return!1;var e=t[h];return void 0!==e?!!e:c(t)},O=!m||!x;r({target:"Array",proto:!0,forced:O},{concat:function(t){var e,n,r,o,i,c=u(this),a=d(c,0),l=0;for(e=-1,r=arguments.length;e<r;e++)if(i=-1===e?c:arguments[e],w(i)){if(o=f(i),l+o>b)throw g(y);for(n=0;n<o;n++,l++)n in i&&s(a,l,i[n])}else{if(l>=b)throw g(y);s(a,l++,i)}return a.length=l,a}})},"9a1f":function(t,e,n){var r=n("da84"),o=n("c65b"),i=n("59ed"),c=n("825a"),a=n("0d51"),u=n("35a1"),f=r.TypeError;t.exports=function(t,e){var n=arguments.length<2?u(t):e;if(i(n))return c(o(n,t));throw f(a(t)+" is not iterable")}},"9bdd":function(t,e,n){var r=n("825a"),o=n("2a62");t.exports=function(t,e,n,i){try{return i?e(r(n)[0],n[1]):e(n)}catch(c){o(t,"throw",c)}}},"9bf2":function(t,e,n){var r=n("da84"),o=n("83ab"),i=n("0cfb"),c=n("aed9"),a=n("825a"),u=n("a04b"),f=r.TypeError,s=Object.defineProperty,d=Object.getOwnPropertyDescriptor,l="enumerable",p="configurable",v="writable";e.f=o?c?function(t,e,n){if(a(t),e=u(e),a(n),"function"===typeof t&&"prototype"===e&&"value"in n&&v in n&&!n[v]){var r=d(t,e);r&&r[v]&&(t[e]=n.value,n={configurable:p in n?n[p]:r[p],enumerable:l in n?n[l]:r[l],writable:!1})}return s(t,e,n)}:s:function(t,e,n){if(a(t),e=u(e),a(n),i)try{return s(t,e,n)}catch(r){}if("get"in n||"set"in n)throw f("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},"9ed3":function(t,e,n){"use strict";var r=n("ae93").IteratorPrototype,o=n("7c73"),i=n("5c6c"),c=n("d44e"),a=n("3f8c"),u=function(){return this};t.exports=function(t,e,n,f){var s=e+" Iterator";return t.prototype=o(r,{next:i(+!f,n)}),c(t,s,!1,!0),a[s]=u,t}},"9f7f":function(t,e,n){var r=n("d039"),o=n("da84"),i=o.RegExp,c=r((function(){var t=i("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),a=c||r((function(){return!i("a","y").sticky})),u=c||r((function(){var t=i("^r","gy");return t.lastIndex=2,null!=t.exec("str")}));t.exports={BROKEN_CARET:u,MISSED_STICKY:a,UNSUPPORTED_Y:c}},a04b:function(t,e,n){var r=n("c04e"),o=n("d9b5");t.exports=function(t){var e=r(t,"string");return o(e)?e:e+""}},a4b4:function(t,e,n){var r=n("342f");t.exports=/web0s(?!.*chrome)/i.test(r)},a4d3:function(t,e,n){"use strict";var r=n("23e7"),o=n("da84"),i=n("d066"),c=n("2ba4"),a=n("c65b"),u=n("e330"),f=n("c430"),s=n("83ab"),d=n("4930"),l=n("d039"),p=n("1a2d"),v=n("e8b5"),h=n("1626"),b=n("861d"),y=n("3a9b"),g=n("d9b5"),m=n("825a"),x=n("7b0b"),w=n("fc6a"),O=n("a04b"),j=n("577e"),S=n("5c6c"),E=n("7c73"),k=n("df75"),P=n("241c"),T=n("057f"),A=n("7418"),R=n("06cf"),I=n("9bf2"),_=n("37e8"),C=n("d1e7"),L=n("f36a"),F=n("6eeb"),M=n("5692"),D=n("f772"),N=n("d012"),z=n("90e3"),G=n("b622"),B=n("e538"),W=n("746f"),U=n("d44e"),H=n("69f3"),$=n("b727").forEach,J=D("hidden"),V="Symbol",Y="prototype",q=G("toPrimitive"),K=H.set,X=H.getterFor(V),Q=Object[Y],Z=o.Symbol,tt=Z&&Z[Y],et=o.TypeError,nt=o.QObject,rt=i("JSON","stringify"),ot=R.f,it=I.f,ct=T.f,at=C.f,ut=u([].push),ft=M("symbols"),st=M("op-symbols"),dt=M("string-to-symbol-registry"),lt=M("symbol-to-string-registry"),pt=M("wks"),vt=!nt||!nt[Y]||!nt[Y].findChild,ht=s&&l((function(){return 7!=E(it({},"a",{get:function(){return it(this,"a",{value:7}).a}})).a}))?function(t,e,n){var r=ot(Q,e);r&&delete Q[e],it(t,e,n),r&&t!==Q&&it(Q,e,r)}:it,bt=function(t,e){var n=ft[t]=E(tt);return K(n,{type:V,tag:t,description:e}),s||(n.description=e),n},yt=function(t,e,n){t===Q&&yt(st,e,n),m(t);var r=O(e);return m(n),p(ft,r)?(n.enumerable?(p(t,J)&&t[J][r]&&(t[J][r]=!1),n=E(n,{enumerable:S(0,!1)})):(p(t,J)||it(t,J,S(1,{})),t[J][r]=!0),ht(t,r,n)):it(t,r,n)},gt=function(t,e){m(t);var n=w(e),r=k(n).concat(jt(n));return $(r,(function(e){s&&!a(xt,n,e)||yt(t,e,n[e])})),t},mt=function(t,e){return void 0===e?E(t):gt(E(t),e)},xt=function(t){var e=O(t),n=a(at,this,e);return!(this===Q&&p(ft,e)&&!p(st,e))&&(!(n||!p(this,e)||!p(ft,e)||p(this,J)&&this[J][e])||n)},wt=function(t,e){var n=w(t),r=O(e);if(n!==Q||!p(ft,r)||p(st,r)){var o=ot(n,r);return!o||!p(ft,r)||p(n,J)&&n[J][r]||(o.enumerable=!0),o}},Ot=function(t){var e=ct(w(t)),n=[];return $(e,(function(t){p(ft,t)||p(N,t)||ut(n,t)})),n},jt=function(t){var e=t===Q,n=ct(e?st:w(t)),r=[];return $(n,(function(t){!p(ft,t)||e&&!p(Q,t)||ut(r,ft[t])})),r};if(d||(Z=function(){if(y(tt,this))throw et("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?j(arguments[0]):void 0,e=z(t),n=function(t){this===Q&&a(n,st,t),p(this,J)&&p(this[J],e)&&(this[J][e]=!1),ht(this,e,S(1,t))};return s&&vt&&ht(Q,e,{configurable:!0,set:n}),bt(e,t)},tt=Z[Y],F(tt,"toString",(function(){return X(this).tag})),F(Z,"withoutSetter",(function(t){return bt(z(t),t)})),C.f=xt,I.f=yt,_.f=gt,R.f=wt,P.f=T.f=Ot,A.f=jt,B.f=function(t){return bt(G(t),t)},s&&(it(tt,"description",{configurable:!0,get:function(){return X(this).description}}),f||F(Q,"propertyIsEnumerable",xt,{unsafe:!0}))),r({global:!0,wrap:!0,forced:!d,sham:!d},{Symbol:Z}),$(k(pt),(function(t){W(t)})),r({target:V,stat:!0,forced:!d},{for:function(t){var e=j(t);if(p(dt,e))return dt[e];var n=Z(e);return dt[e]=n,lt[n]=e,n},keyFor:function(t){if(!g(t))throw et(t+" is not a symbol");if(p(lt,t))return lt[t]},useSetter:function(){vt=!0},useSimple:function(){vt=!1}}),r({target:"Object",stat:!0,forced:!d,sham:!s},{create:mt,defineProperty:yt,defineProperties:gt,getOwnPropertyDescriptor:wt}),r({target:"Object",stat:!0,forced:!d},{getOwnPropertyNames:Ot,getOwnPropertySymbols:jt}),r({target:"Object",stat:!0,forced:l((function(){A.f(1)}))},{getOwnPropertySymbols:function(t){return A.f(x(t))}}),rt){var St=!d||l((function(){var t=Z();return"[null]"!=rt([t])||"{}"!=rt({a:t})||"{}"!=rt(Object(t))}));r({target:"JSON",stat:!0,forced:St},{stringify:function(t,e,n){var r=L(arguments),o=e;if((b(e)||void 0!==t)&&!g(t))return v(e)||(e=function(t,e){if(h(o)&&(e=a(o,this,t,e)),!g(e))return e}),r[1]=e,c(rt,null,r)}})}if(!tt[q]){var Et=tt.valueOf;F(tt,q,(function(t){return a(Et,this)}))}U(Z,V),N[J]=!0},a630:function(t,e,n){var r=n("23e7"),o=n("4df4"),i=n("1c7e"),c=!i((function(t){Array.from(t)}));r({target:"Array",stat:!0,forced:c},{from:o})},a640:function(t,e,n){"use strict";var r=n("d039");t.exports=function(t,e){var n=[][t];return!!n&&r((function(){n.call(null,e||function(){return 1},1)}))}},aa1f:function(t,e,n){"use strict";var r=n("83ab"),o=n("d039"),i=n("825a"),c=n("7c73"),a=n("e391"),u=Error.prototype.toString,f=o((function(){if(r){var t=c(Object.defineProperty({},"name",{get:function(){return this===t}}));if("true"!==u.call(t))return!0}return"2: 1"!==u.call({message:1,name:2})||"Error"!==u.call({})}));t.exports=f?function(){var t=i(this),e=a(t.name,"Error"),n=a(t.message);return e?n?e+": "+n:e:n}:u},ab36:function(t,e,n){var r=n("861d"),o=n("9112");t.exports=function(t,e){r(e)&&"cause"in e&&o(t,"cause",e.cause)}},ac1f:function(t,e,n){"use strict";var r=n("23e7"),o=n("9263");r({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},acac:function(t,e,n){"use strict";var r=n("e330"),o=n("e2cc"),i=n("f183").getWeakData,c=n("825a"),a=n("861d"),u=n("19aa"),f=n("2266"),s=n("b727"),d=n("1a2d"),l=n("69f3"),p=l.set,v=l.getterFor,h=s.find,b=s.findIndex,y=r([].splice),g=0,m=function(t){return t.frozen||(t.frozen=new x)},x=function(){this.entries=[]},w=function(t,e){return h(t.entries,(function(t){return t[0]===e}))};x.prototype={get:function(t){var e=w(this,t);if(e)return e[1]},has:function(t){return!!w(this,t)},set:function(t,e){var n=w(this,t);n?n[1]=e:this.entries.push([t,e])},delete:function(t){var e=b(this.entries,(function(e){return e[0]===t}));return~e&&y(this.entries,e,1),!!~e}},t.exports={getConstructor:function(t,e,n,r){var s=t((function(t,o){u(t,l),p(t,{type:e,id:g++,frozen:void 0}),void 0!=o&&f(o,t[r],{that:t,AS_ENTRIES:n})})),l=s.prototype,h=v(e),b=function(t,e,n){var r=h(t),o=i(c(e),!0);return!0===o?m(r).set(e,n):o[r.id]=n,t};return o(l,{delete:function(t){var e=h(this);if(!a(t))return!1;var n=i(t);return!0===n?m(e)["delete"](t):n&&d(n,e.id)&&delete n[e.id]},has:function(t){var e=h(this);if(!a(t))return!1;var n=i(t);return!0===n?m(e).has(t):n&&d(n,e.id)}}),o(l,n?{get:function(t){var e=h(this);if(a(t)){var n=i(t);return!0===n?m(e).get(t):n?n[e.id]:void 0}},set:function(t,e){return b(this,t,e)}}:{add:function(t){return b(this,t,!0)}}),s}}},ad6d:function(t,e,n){"use strict";var r=n("825a");t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},ade3:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));n("7a82");function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},ae93:function(t,e,n){"use strict";var r,o,i,c=n("d039"),a=n("1626"),u=n("7c73"),f=n("e163"),s=n("6eeb"),d=n("b622"),l=n("c430"),p=d("iterator"),v=!1;[].keys&&(i=[].keys(),"next"in i?(o=f(f(i)),o!==Object.prototype&&(r=o)):v=!0);var h=void 0==r||c((function(){var t={};return r[p].call(t)!==t}));h?r={}:l&&(r=u(r)),a(r[p])||s(r,p,(function(){return this})),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:v}},aed9:function(t,e,n){var r=n("83ab"),o=n("d039");t.exports=r&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},b041:function(t,e,n){"use strict";var r=n("00ee"),o=n("f5df");t.exports=r?{}.toString:function(){return"[object "+o(this)+"]"}},b0c0:function(t,e,n){var r=n("83ab"),o=n("5e77").EXISTS,i=n("e330"),c=n("9bf2").f,a=Function.prototype,u=i(a.toString),f=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,s=i(f.exec),d="name";r&&!o&&c(a,d,{configurable:!0,get:function(){try{return s(f,u(this))[1]}catch(t){return""}}})},b575:function(t,e,n){var r,o,i,c,a,u,f,s,d=n("da84"),l=n("0366"),p=n("06cf").f,v=n("2cf4").set,h=n("1cdc"),b=n("d4c3"),y=n("a4b4"),g=n("605d"),m=d.MutationObserver||d.WebKitMutationObserver,x=d.document,w=d.process,O=d.Promise,j=p(d,"queueMicrotask"),S=j&&j.value;S||(r=function(){var t,e;g&&(t=w.domain)&&t.exit();while(o){e=o.fn,o=o.next;try{e()}catch(n){throw o?c():i=void 0,n}}i=void 0,t&&t.enter()},h||g||y||!m||!x?!b&&O&&O.resolve?(f=O.resolve(void 0),f.constructor=O,s=l(f.then,f),c=function(){s(r)}):g?c=function(){w.nextTick(r)}:(v=l(v,d),c=function(){v(r)}):(a=!0,u=x.createTextNode(""),new m(r).observe(u,{characterData:!0}),c=function(){u.data=a=!a})),t.exports=S||function(t){var e={fn:t,next:void 0};i&&(i.next=e),o||(o=e,c()),i=e}},b622:function(t,e,n){var r=n("da84"),o=n("5692"),i=n("1a2d"),c=n("90e3"),a=n("4930"),u=n("fdbf"),f=o("wks"),s=r.Symbol,d=s&&s["for"],l=u?s:s&&s.withoutSetter||c;t.exports=function(t){if(!i(f,t)||!a&&"string"!=typeof f[t]){var e="Symbol."+t;a&&i(s,t)?f[t]=s[t]:f[t]=u&&d?d(e):l(e)}return f[t]}},b64b:function(t,e,n){var r=n("23e7"),o=n("7b0b"),i=n("df75"),c=n("d039"),a=c((function(){i(1)}));r({target:"Object",stat:!0,forced:a},{keys:function(t){return i(o(t))}})},b727:function(t,e,n){var r=n("0366"),o=n("e330"),i=n("44ad"),c=n("7b0b"),a=n("07fa"),u=n("65f0"),f=o([].push),s=function(t){var e=1==t,n=2==t,o=3==t,s=4==t,d=6==t,l=7==t,p=5==t||d;return function(v,h,b,y){for(var g,m,x=c(v),w=i(x),O=r(h,b),j=a(w),S=0,E=y||u,k=e?E(v,j):n||l?E(v,0):void 0;j>S;S++)if((p||S in w)&&(g=w[S],m=O(g,S,x),t))if(e)k[S]=m;else if(m)switch(t){case 3:return!0;case 5:return g;case 6:return S;case 2:f(k,g)}else switch(t){case 4:return!1;case 7:f(k,g)}return d?-1:o||s?s:k}};t.exports={forEach:s(0),map:s(1),filter:s(2),some:s(3),every:s(4),find:s(5),findIndex:s(6),filterReject:s(7)}},b8bf:function(t,e,n){var r=n("23e7"),o=n("83ab"),i=n("7c73");r({target:"Object",stat:!0,sham:!o},{create:i})},b980:function(t,e,n){var r=n("d039"),o=n("5c6c");t.exports=!r((function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",o(1,7)),7!==t.stack)}))},bb2f:function(t,e,n){var r=n("d039");t.exports=!r((function(){return Object.isExtensible(Object.preventExtensions({}))}))},bee2:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));n("7a82");function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}},c04e:function(t,e,n){var r=n("da84"),o=n("c65b"),i=n("861d"),c=n("d9b5"),a=n("dc4a"),u=n("485a"),f=n("b622"),s=r.TypeError,d=f("toPrimitive");t.exports=function(t,e){if(!i(t)||c(t))return t;var n,r=a(t,d);if(r){if(void 0===e&&(e="default"),n=o(r,t,e),!i(n)||c(n))return n;throw s("Can't convert object to primitive value")}return void 0===e&&(e="number"),u(t,e)}},c0b6:function(t,e,n){var r=n("23e7"),o=n("0538");r({target:"Function",proto:!0,forced:Function.bind!==o},{bind:o})},c430:function(t,e){t.exports=!1},c65b:function(t,e,n){var r=n("40d5"),o=Function.prototype.call;t.exports=r?o.bind(o):function(){return o.apply(o,arguments)}},c6b6:function(t,e,n){var r=n("e330"),o=r({}.toString),i=r("".slice);t.exports=function(t){return i(o(t),8,-1)}},c6cd:function(t,e,n){var r=n("da84"),o=n("ce4e"),i="__core-js_shared__",c=r[i]||o(i,{});t.exports=c},c770:function(t,e,n){var r=n("e330"),o=r("".replace),i=function(t){return String(Error(t).stack)}("zxcasd"),c=/\n\s*at [^:]*:[^\n]*/,a=c.test(i);t.exports=function(t,e){if(a&&"string"==typeof t)while(e--)t=o(t,c,"");return t}},c8ba:function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}t.exports=n},c975:function(t,e,n){"use strict";var r=n("23e7"),o=n("e330"),i=n("4d64").indexOf,c=n("a640"),a=o([].indexOf),u=!!a&&1/a([1],1,-0)<0,f=c("indexOf");r({target:"Array",proto:!0,forced:u||!f},{indexOf:function(t){var e=arguments.length>1?arguments[1]:void 0;return u?a(this,t,e)||0:i(this,t,e)}})},ca84:function(t,e,n){var r=n("e330"),o=n("1a2d"),i=n("fc6a"),c=n("4d64").indexOf,a=n("d012"),u=r([].push);t.exports=function(t,e){var n,r=i(t),f=0,s=[];for(n in r)!o(a,n)&&o(r,n)&&u(s,n);while(e.length>f)o(r,n=e[f++])&&(~c(s,n)||u(s,n));return s}},caad:function(t,e,n){"use strict";var r=n("23e7"),o=n("4d64").includes,i=n("44d2");r({target:"Array",proto:!0},{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),i("includes")},cc12:function(t,e,n){var r=n("da84"),o=n("861d"),i=r.document,c=o(i)&&o(i.createElement);t.exports=function(t){return c?i.createElement(t):{}}},cca6:function(t,e,n){var r=n("23e7"),o=n("60da");r({target:"Object",stat:!0,forced:Object.assign!==o},{assign:o})},cdf9:function(t,e,n){var r=n("825a"),o=n("861d"),i=n("f069");t.exports=function(t,e){if(r(t),o(e)&&e.constructor===t)return e;var n=i.f(t),c=n.resolve;return c(e),n.promise}},ce4e:function(t,e,n){var r=n("da84"),o=Object.defineProperty;t.exports=function(t,e){try{o(r,t,{value:e,configurable:!0,writable:!0})}catch(n){r[t]=e}return e}},d012:function(t,e){t.exports={}},d039:function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},d066:function(t,e,n){var r=n("da84"),o=n("1626"),i=function(t){return o(t)?t:void 0};t.exports=function(t,e){return arguments.length<2?i(r[t]):r[t]&&r[t][e]}},d1e7:function(t,e,n){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!r.call({1:2},1);e.f=i?function(t){var e=o(this,t);return!!e&&e.enumerable}:r},d28b:function(t,e,n){var r=n("746f");r("iterator")},d2bb:function(t,e,n){var r=n("e330"),o=n("825a"),i=n("3bbe");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{t=r(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set),t(n,[]),e=n instanceof Array}catch(c){}return function(n,r){return o(n),i(r),e?t(n,r):n.__proto__=r,n}}():void 0)},d3b7:function(t,e,n){var r=n("00ee"),o=n("6eeb"),i=n("b041");r||o(Object.prototype,"toString",i,{unsafe:!0})},d401:function(t,e,n){var r=n("6eeb"),o=n("aa1f"),i=Error.prototype;i.toString!==o&&r(i,"toString",o)},d44e:function(t,e,n){var r=n("9bf2").f,o=n("1a2d"),i=n("b622"),c=i("toStringTag");t.exports=function(t,e,n){t&&!n&&(t=t.prototype),t&&!o(t,c)&&r(t,c,{configurable:!0,value:e})}},d4c3:function(t,e,n){var r=n("342f"),o=n("da84");t.exports=/ipad|iphone|ipod/i.test(r)&&void 0!==o.Pebble},d4ec:function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));n("d9e2"),n("d401");function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},d58f:function(t,e,n){var r=n("da84"),o=n("59ed"),i=n("7b0b"),c=n("44ad"),a=n("07fa"),u=r.TypeError,f=function(t){return function(e,n,r,f){o(n);var s=i(e),d=c(s),l=a(s),p=t?l-1:0,v=t?-1:1;if(r<2)while(1){if(p in d){f=d[p],p+=v;break}if(p+=v,t?p<0:l<=p)throw u("Reduce of empty array with no initial value")}for(;t?p>=0:l>p;p+=v)p in d&&(f=n(f,d[p],p,s));return f}};t.exports={left:f(!1),right:f(!0)}},d5e4:function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));n("d9e2"),n("d401");function r(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function o(t,e,n){r(t,e),e.set(t,n)}},d6d6:function(t,e,n){var r=n("da84"),o=r.TypeError;t.exports=function(t,e){if(t<e)throw o("Not enough arguments");return t}},d784:function(t,e,n){"use strict";n("ac1f");var r=n("e330"),o=n("6eeb"),i=n("9263"),c=n("d039"),a=n("b622"),u=n("9112"),f=a("species"),s=RegExp.prototype;t.exports=function(t,e,n,d){var l=a(t),p=!c((function(){var e={};return e[l]=function(){return 7},7!=""[t](e)})),v=p&&!c((function(){var e=!1,n=/a/;return"split"===t&&(n={},n.constructor={},n.constructor[f]=function(){return n},n.flags="",n[l]=/./[l]),n.exec=function(){return e=!0,null},n[l](""),!e}));if(!p||!v||n){var h=r(/./[l]),b=e(l,""[t],(function(t,e,n,o,c){var a=r(t),u=e.exec;return u===i||u===s.exec?p&&!c?{done:!0,value:h(e,n,o)}:{done:!0,value:a(n,e,o)}:{done:!1}}));o(String.prototype,t,b[0]),o(s,l,b[1])}d&&u(s[l],"sham",!0)}},d86b:function(t,e,n){var r=n("d039");t.exports=r((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))},d9b5:function(t,e,n){var r=n("da84"),o=n("d066"),i=n("1626"),c=n("3a9b"),a=n("fdbf"),u=r.Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var e=o("Symbol");return i(e)&&c(e.prototype,u(t))}},d9e2:function(t,e,n){var r=n("23e7"),o=n("da84"),i=n("2ba4"),c=n("e5cb"),a="WebAssembly",u=o[a],f=7!==Error("e",{cause:7}).cause,s=function(t,e){var n={};n[t]=c(t,e,f),r({global:!0,forced:f},n)},d=function(t,e){if(u&&u[t]){var n={};n[t]=c(a+"."+t,e,f),r({target:a,stat:!0,forced:f},n)}};s("Error",(function(t){return function(e){return i(t,this,arguments)}})),s("EvalError",(function(t){return function(e){return i(t,this,arguments)}})),s("RangeError",(function(t){return function(e){return i(t,this,arguments)}})),s("ReferenceError",(function(t){return function(e){return i(t,this,arguments)}})),s("SyntaxError",(function(t){return function(e){return i(t,this,arguments)}})),s("TypeError",(function(t){return function(e){return i(t,this,arguments)}})),s("URIError",(function(t){return function(e){return i(t,this,arguments)}})),d("CompileError",(function(t){return function(e){return i(t,this,arguments)}})),d("LinkError",(function(t){return function(e){return i(t,this,arguments)}})),d("RuntimeError",(function(t){return function(e){return i(t,this,arguments)}}))},da84:function(t,e,n){(function(e){var n=function(t){return t&&t.Math==Math&&t};t.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")()}).call(this,n("c8ba"))},dbb4:function(t,e,n){var r=n("23e7"),o=n("83ab"),i=n("56ef"),c=n("fc6a"),a=n("06cf"),u=n("8418");r({target:"Object",stat:!0,sham:!o},{getOwnPropertyDescriptors:function(t){var e,n,r=c(t),o=a.f,f=i(r),s={},d=0;while(f.length>d)n=o(r,e=f[d++]),void 0!==n&&u(s,e,n);return s}})},dc4a:function(t,e,n){var r=n("59ed");t.exports=function(t,e){var n=t[e];return null==n?void 0:r(n)}},ddb0:function(t,e,n){var r=n("da84"),o=n("fdbc"),i=n("785a"),c=n("e260"),a=n("9112"),u=n("b622"),f=u("iterator"),s=u("toStringTag"),d=c.values,l=function(t,e){if(t){if(t[f]!==d)try{a(t,f,d)}catch(r){t[f]=d}if(t[s]||a(t,s,e),o[e])for(var n in c)if(t[n]!==c[n])try{a(t,n,c[n])}catch(r){t[n]=c[n]}}};for(var p in o)l(r[p]&&r[p].prototype,p);l(i,"DOMTokenList")},df75:function(t,e,n){var r=n("ca84"),o=n("7839");t.exports=Object.keys||function(t){return r(t,o)}},e01a:function(t,e,n){"use strict";var r=n("23e7"),o=n("83ab"),i=n("da84"),c=n("e330"),a=n("1a2d"),u=n("1626"),f=n("3a9b"),s=n("577e"),d=n("9bf2").f,l=n("e893"),p=i.Symbol,v=p&&p.prototype;if(o&&u(p)&&(!("description"in v)||void 0!==p().description)){var h={},b=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:s(arguments[0]),e=f(v,this)?new p(t):void 0===t?p():p(t);return""===t&&(h[e]=!0),e};l(b,p),b.prototype=v,v.constructor=b;var y="Symbol(test)"==String(p("test")),g=c(v.toString),m=c(v.valueOf),x=/^Symbol\((.*)\)[^)]+$/,w=c("".replace),O=c("".slice);d(v,"description",{configurable:!0,get:function(){var t=m(this),e=g(t);if(a(h,t))return"";var n=y?O(e,7,-1):w(e,x,"$1");return""===n?void 0:n}}),r({global:!0,forced:!0},{Symbol:b})}},e163:function(t,e,n){var r=n("da84"),o=n("1a2d"),i=n("1626"),c=n("7b0b"),a=n("f772"),u=n("e177"),f=a("IE_PROTO"),s=r.Object,d=s.prototype;t.exports=u?s.getPrototypeOf:function(t){var e=c(t);if(o(e,f))return e[f];var n=e.constructor;return i(n)&&e instanceof n?n.prototype:e instanceof s?d:null}},e177:function(t,e,n){var r=n("d039");t.exports=!r((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},e260:function(t,e,n){"use strict";var r=n("fc6a"),o=n("44d2"),i=n("3f8c"),c=n("69f3"),a=n("9bf2").f,u=n("7dd0"),f=n("c430"),s=n("83ab"),d="Array Iterator",l=c.set,p=c.getterFor(d);t.exports=u(Array,"Array",(function(t,e){l(this,{type:d,target:r(t),index:0,kind:e})}),(function(){var t=p(this),e=t.target,n=t.kind,r=t.index++;return!e||r>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:e[r],done:!1}:{value:[r,e[r]],done:!1}}),"values");var v=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!f&&s&&"values"!==v.name)try{a(v,"name",{value:"values"})}catch(h){}},e2cc:function(t,e,n){var r=n("6eeb");t.exports=function(t,e,n){for(var o in e)r(t,o,e[o],n);return t}},e330:function(t,e,n){var r=n("40d5"),o=Function.prototype,i=o.bind,c=o.call,a=r&&i.bind(c,c);t.exports=r?function(t){return t&&a(t)}:function(t){return t&&function(){return c.apply(t,arguments)}}},e391:function(t,e,n){var r=n("577e");t.exports=function(t,e){return void 0===t?arguments.length<2?"":e:r(t)}},e439:function(t,e,n){var r=n("23e7"),o=n("d039"),i=n("fc6a"),c=n("06cf").f,a=n("83ab"),u=o((function(){c(1)})),f=!a||u;r({target:"Object",stat:!0,forced:f,sham:!a},{getOwnPropertyDescriptor:function(t,e){return c(i(t),e)}})},e538:function(t,e,n){var r=n("b622");e.f=r},e5cb:function(t,e,n){"use strict";var r=n("d066"),o=n("1a2d"),i=n("9112"),c=n("3a9b"),a=n("d2bb"),u=n("e893"),f=n("7156"),s=n("e391"),d=n("ab36"),l=n("c770"),p=n("b980"),v=n("c430");t.exports=function(t,e,n,h){var b=h?2:1,y=t.split("."),g=y[y.length-1],m=r.apply(null,y);if(m){var x=m.prototype;if(!v&&o(x,"cause")&&delete x.cause,!n)return m;var w=r("Error"),O=e((function(t,e){var n=s(h?e:t,void 0),r=h?new m(t):new m;return void 0!==n&&i(r,"message",n),p&&i(r,"stack",l(r.stack,2)),this&&c(x,this)&&f(r,this,O),arguments.length>b&&d(r,arguments[b]),r}));if(O.prototype=x,"Error"!==g&&(a?a(O,w):u(O,w,{name:!0})),u(O,m),!v)try{x.name!==g&&i(x,"name",g),x.constructor=O}catch(j){}return O}}},e667:function(t,e){t.exports=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}},e6cf:function(t,e,n){"use strict";var r,o,i,c,a=n("23e7"),u=n("c430"),f=n("da84"),s=n("d066"),d=n("c65b"),l=n("fea9"),p=n("6eeb"),v=n("e2cc"),h=n("d2bb"),b=n("d44e"),y=n("2626"),g=n("59ed"),m=n("1626"),x=n("861d"),w=n("19aa"),O=n("8925"),j=n("2266"),S=n("1c7e"),E=n("4840"),k=n("2cf4").set,P=n("b575"),T=n("cdf9"),A=n("44de"),R=n("f069"),I=n("e667"),_=n("01b4"),C=n("69f3"),L=n("94ca"),F=n("b622"),M=n("6069"),D=n("605d"),N=n("2d00"),z=F("species"),G="Promise",B=C.getterFor(G),W=C.set,U=C.getterFor(G),H=l&&l.prototype,$=l,J=H,V=f.TypeError,Y=f.document,q=f.process,K=R.f,X=K,Q=!!(Y&&Y.createEvent&&f.dispatchEvent),Z=m(f.PromiseRejectionEvent),tt="unhandledrejection",et="rejectionhandled",nt=0,rt=1,ot=2,it=1,ct=2,at=!1,ut=L(G,(function(){var t=O($),e=t!==String($);if(!e&&66===N)return!0;if(u&&!J["finally"])return!0;if(N>=51&&/native code/.test(t))return!1;var n=new $((function(t){t(1)})),r=function(t){t((function(){}),(function(){}))},o=n.constructor={};return o[z]=r,at=n.then((function(){}))instanceof r,!at||!e&&M&&!Z})),ft=ut||!S((function(t){$.all(t)["catch"]((function(){}))})),st=function(t){var e;return!(!x(t)||!m(e=t.then))&&e},dt=function(t,e){var n,r,o,i=e.value,c=e.state==rt,a=c?t.ok:t.fail,u=t.resolve,f=t.reject,s=t.domain;try{a?(c||(e.rejection===ct&&bt(e),e.rejection=it),!0===a?n=i:(s&&s.enter(),n=a(i),s&&(s.exit(),o=!0)),n===t.promise?f(V("Promise-chain cycle")):(r=st(n))?d(r,n,u,f):u(n)):f(i)}catch(l){s&&!o&&s.exit(),f(l)}},lt=function(t,e){t.notified||(t.notified=!0,P((function(){var n,r=t.reactions;while(n=r.get())dt(n,t);t.notified=!1,e&&!t.rejection&&vt(t)})))},pt=function(t,e,n){var r,o;Q?(r=Y.createEvent("Event"),r.promise=e,r.reason=n,r.initEvent(t,!1,!0),f.dispatchEvent(r)):r={promise:e,reason:n},!Z&&(o=f["on"+t])?o(r):t===tt&&A("Unhandled promise rejection",n)},vt=function(t){d(k,f,(function(){var e,n=t.facade,r=t.value,o=ht(t);if(o&&(e=I((function(){D?q.emit("unhandledRejection",r,n):pt(tt,n,r)})),t.rejection=D||ht(t)?ct:it,e.error))throw e.value}))},ht=function(t){return t.rejection!==it&&!t.parent},bt=function(t){d(k,f,(function(){var e=t.facade;D?q.emit("rejectionHandled",e):pt(et,e,t.value)}))},yt=function(t,e,n){return function(r){t(e,r,n)}},gt=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=ot,lt(t,!0))},mt=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw V("Promise can't be resolved itself");var r=st(e);r?P((function(){var n={done:!1};try{d(r,e,yt(mt,n,t),yt(gt,n,t))}catch(o){gt(n,o,t)}})):(t.value=e,t.state=rt,lt(t,!1))}catch(o){gt({done:!1},o,t)}}};if(ut&&($=function(t){w(this,J),g(t),d(r,this);var e=B(this);try{t(yt(mt,e),yt(gt,e))}catch(n){gt(e,n)}},J=$.prototype,r=function(t){W(this,{type:G,done:!1,notified:!1,parent:!1,reactions:new _,rejection:!1,state:nt,value:void 0})},r.prototype=v(J,{then:function(t,e){var n=U(this),r=K(E(this,$));return n.parent=!0,r.ok=!m(t)||t,r.fail=m(e)&&e,r.domain=D?q.domain:void 0,n.state==nt?n.reactions.add(r):P((function(){dt(r,n)})),r.promise},catch:function(t){return this.then(void 0,t)}}),o=function(){var t=new r,e=B(t);this.promise=t,this.resolve=yt(mt,e),this.reject=yt(gt,e)},R.f=K=function(t){return t===$||t===i?new o(t):X(t)},!u&&m(l)&&H!==Object.prototype)){c=H.then,at||(p(H,"then",(function(t,e){var n=this;return new $((function(t,e){d(c,n,t,e)})).then(t,e)}),{unsafe:!0}),p(H,"catch",J["catch"],{unsafe:!0}));try{delete H.constructor}catch(xt){}h&&h(H,J)}a({global:!0,wrap:!0,forced:ut},{Promise:$}),b($,G,!1,!0),y(G),i=s(G),a({target:G,stat:!0,forced:ut},{reject:function(t){var e=K(this);return d(e.reject,void 0,t),e.promise}}),a({target:G,stat:!0,forced:u||ut},{resolve:function(t){return T(u&&this===i?$:this,t)}}),a({target:G,stat:!0,forced:ft},{all:function(t){var e=this,n=K(e),r=n.resolve,o=n.reject,i=I((function(){var n=g(e.resolve),i=[],c=0,a=1;j(t,(function(t){var u=c++,f=!1;a++,d(n,e,t).then((function(t){f||(f=!0,i[u]=t,--a||r(i))}),o)})),--a||r(i)}));return i.error&&o(i.value),n.promise},race:function(t){var e=this,n=K(e),r=n.reject,o=I((function(){var o=g(e.resolve);j(t,(function(t){d(o,e,t).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}})},e893:function(t,e,n){var r=n("1a2d"),o=n("56ef"),i=n("06cf"),c=n("9bf2");t.exports=function(t,e,n){for(var a=o(e),u=c.f,f=i.f,s=0;s<a.length;s++){var d=a[s];r(t,d)||n&&r(n,d)||u(t,d,f(e,d))}}},e8b5:function(t,e,n){var r=n("c6b6");t.exports=Array.isArray||function(t){return"Array"==r(t)}},e95a:function(t,e,n){var r=n("b622"),o=n("3f8c"),i=r("iterator"),c=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||c[i]===t)}},e9c4:function(t,e,n){var r=n("23e7"),o=n("da84"),i=n("d066"),c=n("2ba4"),a=n("e330"),u=n("d039"),f=o.Array,s=i("JSON","stringify"),d=a(/./.exec),l=a("".charAt),p=a("".charCodeAt),v=a("".replace),h=a(1..toString),b=/[\uD800-\uDFFF]/g,y=/^[\uD800-\uDBFF]$/,g=/^[\uDC00-\uDFFF]$/,m=function(t,e,n){var r=l(n,e-1),o=l(n,e+1);return d(y,t)&&!d(g,o)||d(g,t)&&!d(y,r)?"\\u"+h(p(t,0),16):t},x=u((function(){return'"\\udf06\\ud834"'!==s("\udf06\ud834")||'"\\udead"'!==s("\udead")}));s&&r({target:"JSON",stat:!0,forced:x},{stringify:function(t,e,n){for(var r=0,o=arguments.length,i=f(o);r<o;r++)i[r]=arguments[r];var a=c(s,null,i);return"string"==typeof a?v(a,b,m):a}})},f069:function(t,e,n){"use strict";var r=n("59ed"),o=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=r(e),this.reject=r(n)};t.exports.f=function(t){return new o(t)}},f183:function(t,e,n){var r=n("23e7"),o=n("e330"),i=n("d012"),c=n("861d"),a=n("1a2d"),u=n("9bf2").f,f=n("241c"),s=n("057f"),d=n("4fad"),l=n("90e3"),p=n("bb2f"),v=!1,h=l("meta"),b=0,y=function(t){u(t,h,{value:{objectID:"O"+b++,weakData:{}}})},g=function(t,e){if(!c(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!a(t,h)){if(!d(t))return"F";if(!e)return"E";y(t)}return t[h].objectID},m=function(t,e){if(!a(t,h)){if(!d(t))return!0;if(!e)return!1;y(t)}return t[h].weakData},x=function(t){return p&&v&&d(t)&&!a(t,h)&&y(t),t},w=function(){O.enable=function(){},v=!0;var t=f.f,e=o([].splice),n={};n[h]=1,t(n).length&&(f.f=function(n){for(var r=t(n),o=0,i=r.length;o<i;o++)if(r[o]===h){e(r,o,1);break}return r},r({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:s.f}))},O=t.exports={enable:w,fastKey:g,getWeakData:m,onFreeze:x};i[h]=!0},f36a:function(t,e,n){var r=n("e330");t.exports=r([].slice)},f5df:function(t,e,n){var r=n("da84"),o=n("00ee"),i=n("1626"),c=n("c6b6"),a=n("b622"),u=a("toStringTag"),f=r.Object,s="Arguments"==c(function(){return arguments}()),d=function(t,e){try{return t[e]}catch(n){}};t.exports=o?c:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=d(e=f(t),u))?n:s?c(e):"Object"==(r=c(e))&&i(e.callee)?"Arguments":r}},f772:function(t,e,n){var r=n("5692"),o=n("90e3"),i=r("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},f8c9:function(t,e,n){var r=n("23e7"),o=n("da84"),i=n("d44e");r({global:!0},{Reflect:{}}),i(o.Reflect,"Reflect",!0)},fb15:function(t,e,n){"use strict";if(n.r(e),n.d(e,"getUserInfo",(function(){return x})),"undefined"!==typeof window){var r=window.document.currentScript,o=n("8875");r=o(),"currentScript"in document||Object.defineProperty(document,"currentScript",{get:o});var i=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}var c=n("d4ec"),a=n("bee2"),u=n("d5e4"),f=(n("d9e2"),n("d401"),n("cca6"),n("e9c4"),n("e260"),n("d3b7"),n("3ca3"),n("10d1"),n("ddb0"),n("ade3")),s=(n("13d5"),n("ac1f"),n("1276"),n("fb6a"),n("b64b"),n("5180")),d=s.keys().reduce((function(t,e){return Object.assign(t,Object(f["a"])({},e.split("/").slice(-1)[0].split(".")[0],s(e)[Object.keys(s(e))[0]])),t}),{});console.log("=====modulesFiles========"),console.log(d);var l=d,p=function(t){console.log(l);var e=l[t];if(console.log(e),!e)throw new Error("未找到对应的请求方法!");return function(){return e.apply(void 0,arguments)}},v=function(t,e){var n=e.onOpen,r=e.onClose,o=e.onMessage,i=e.onError,c=e.onReconnect;t.subscribe("open",(function(){console.log("WebSocket连接成功!"),n&&n()})),t.subscribe("close",(function(t){console.log("WebSocket连接关闭!",t),r&&r(t)})),t.subscribe("message",(function(t){o&&o(t)})),t.subscribe("error",(function(t){console.log("WebSocket捕获错误:",t),i&&i(t)})),t.subscribe("reconnect",(function(t){console.log("WebSocket断开重连:",t),c&&c(t)}))},h=function(t,e,n){var r={showBand:!0,fullscreen:!0,screenshot:!0,play:!0,audio:!0,useMSE:!1},o=new h265({rtcServe:t,decUrl:e||"/decoder/decoder-pro.js",videoConfig:n||r});return o},b=function(t,e,n){var r=t||"",o=n||"";return{Action:r,GongHao:e.GongHao,FenJi:e.FenJi,PlatFormCode:e.DepartmentID,Params:o}},y=new WeakMap,g=function(){function t(e,n){var r=this,o=n.onOpen,i=n.onClose,a=n.onMessage,f=n.onError;Object(c["a"])(this,t),Object(u["a"])(this,y,{writable:!0,value:null}),this.config=e,Object.assign(this.config,{checkData:JSON.stringify(b("keeplive",this.config))}),this.socket=p("websocket")(e),v(this.socket,{onOpen:function(t){console.log("====onOpen====="),console.log(r),r.send("Login"),o&&o(t)},onClose:function(t){i&&i(t)},onMessage:function(t){"Back_Login"!==t.data?a&&a(t):r.config.AgentGroupName&&r.send("SetGroupRole",r.config.AgentGroupName)},onError:function(t){f&&f(t)},onReconnect:function(t){r.scoket=t}})}return Object(a["a"])(t,[{key:"send",value:function(t,e){this.socket.send(JSON.stringify(b(t,this.config,e)))}},{key:"getPlayer",value:function(t,e,n){return this.player?this.player:h(t,e,n)}}]),t}(),m=function(t,e){var n=e.onOpen,r=e.onClose,o=e.onMessage,i=e.onError;return window.WebSocket?new g(t,{onOpen:n,onClose:r,onMessage:o,onError:i}):console.error("您的浏览器不支持WebSocket, 请更换浏览器!")};console.log(m);var x=function(){console.log(p)},w=m;e["default"]=w},fb6a:function(t,e,n){"use strict";var r=n("23e7"),o=n("da84"),i=n("e8b5"),c=n("68ee"),a=n("861d"),u=n("23cb"),f=n("07fa"),s=n("fc6a"),d=n("8418"),l=n("b622"),p=n("1dde"),v=n("f36a"),h=p("slice"),b=l("species"),y=o.Array,g=Math.max;r({target:"Array",proto:!0,forced:!h},{slice:function(t,e){var n,r,o,l=s(this),p=f(l),h=u(t,p),m=u(void 0===e?p:e,p);if(i(l)&&(n=l.constructor,c(n)&&(n===y||i(n.prototype))?n=void 0:a(n)&&(n=n[b],null===n&&(n=void 0)),n===y||void 0===n))return v(l,h,m);for(r=new(void 0===n?y:n)(g(m-h,0)),o=0;h<m;h++,o++)h in l&&d(r,o,l[h]);return r.length=o,r}})},fc6a:function(t,e,n){var r=n("44ad"),o=n("1d80");t.exports=function(t){return r(o(t))}},fce3:function(t,e,n){var r=n("d039"),o=n("da84"),i=o.RegExp;t.exports=r((function(){var t=i(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)}))},fdbc:function(t,e){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},fdbf:function(t,e,n){var r=n("4930");t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},fea9:function(t,e,n){var r=n("da84");t.exports=r.Promise}})}));
2
2
  //# sourceMappingURL=kucservice.umd.min.js.map