@xylink/xy-rtc-sdk 2.0.0 → 2.0.1-1

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.
@@ -0,0 +1 @@
1
+ var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function r(e,t){return e(t={exports:{}},t.exports),t.exports}var n,i,o=function(e){return e&&e.Math==Math&&e},a=o("object"==typeof globalThis&&globalThis)||o("object"==typeof window&&window)||o("object"==typeof self&&self)||o("object"==typeof e&&e)||function(){return this}()||Function("return this")(),s=function(e){try{return!!e()}catch(e){return!0}},u=!s((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),c=Function.prototype.call,l=c.bind?c.bind(c):function(){return c.apply(c,arguments)},f={}.propertyIsEnumerable,h=Object.getOwnPropertyDescriptor,d={f:h&&!f.call({1:2},1)?function(e){var t=h(this,e);return!!t&&t.enumerable}:f},p=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},v=Function.prototype,g=v.bind,m=v.call,y=g&&g.bind(m),b=g?function(e){return e&&y(m,e)}:function(e){return e&&function(){return m.apply(e,arguments)}},w=b({}.toString),k=b("".slice),_=function(e){return k(w(e),8,-1)},S=a.Object,x=b("".split),E=s((function(){return!S("z").propertyIsEnumerable(0)}))?function(e){return"String"==_(e)?x(e,""):S(e)}:S,O=a.TypeError,A=function(e){if(null==e)throw O("Can't call method on "+e);return e},C=function(e){return E(A(e))},I=function(e){return"function"==typeof e},T=function(e){return"object"==typeof e?null!==e:I(e)},R=function(e){return I(e)?e:void 0},L=function(e,t){return arguments.length<2?R(a[e]):a[e]&&a[e][t]},N=b({}.isPrototypeOf),P=L("navigator","userAgent")||"",M=a.process,j=a.Deno,D=M&&M.versions||j&&j.version,B=D&&D.v8;B&&(i=(n=B.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&P&&(!(n=P.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=P.match(/Chrome\/(\d+)/))&&(i=+n[1]);var U=i,F=!!Object.getOwnPropertySymbols&&!s((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&U&&U<41})),z=F&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,H=a.Object,V=z?function(e){return"symbol"==typeof e}:function(e){var t=L("Symbol");return I(t)&&N(t.prototype,H(e))},W=a.String,G=function(e){try{return W(e)}catch(e){return"Object"}},K=a.TypeError,q=function(e){if(I(e))return e;throw K(G(e)+" is not a function")},Y=function(e,t){var r=e[t];return null==r?void 0:q(r)},Z=a.TypeError,J=Object.defineProperty,X=function(e,t){try{J(a,e,{value:t,configurable:!0,writable:!0})}catch(r){a[e]=t}return t},$=a["__core-js_shared__"]||X("__core-js_shared__",{}),Q=r((function(e){(e.exports=function(e,t){return $[e]||($[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.19.2",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),ee=a.Object,te=function(e){return ee(A(e))},re=b({}.hasOwnProperty),ne=Object.hasOwn||function(e,t){return re(te(e),t)},ie=0,oe=Math.random(),ae=b(1..toString),se=function(e){return"Symbol("+(void 0===e?"":e)+")_"+ae(++ie+oe,36)},ue=Q("wks"),ce=a.Symbol,le=ce&&ce.for,fe=z?ce:ce&&ce.withoutSetter||se,he=function(e){if(!ne(ue,e)||!F&&"string"!=typeof ue[e]){var t="Symbol."+e;F&&ne(ce,e)?ue[e]=ce[e]:ue[e]=z&&le?le(t):fe(t)}return ue[e]},de=a.TypeError,pe=he("toPrimitive"),ve=function(e,t){if(!T(e)||V(e))return e;var r,n=Y(e,pe);if(n){if(void 0===t&&(t="default"),r=l(n,e,t),!T(r)||V(r))return r;throw de("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var r,n;if("string"===t&&I(r=e.toString)&&!T(n=l(r,e)))return n;if(I(r=e.valueOf)&&!T(n=l(r,e)))return n;if("string"!==t&&I(r=e.toString)&&!T(n=l(r,e)))return n;throw Z("Can't convert object to primitive value")}(e,t)},ge=function(e){var t=ve(e,"string");return V(t)?t:t+""},me=a.document,ye=T(me)&&T(me.createElement),be=function(e){return ye?me.createElement(e):{}},we=!u&&!s((function(){return 7!=Object.defineProperty(be("div"),"a",{get:function(){return 7}}).a})),ke=Object.getOwnPropertyDescriptor,_e={f:u?ke:function(e,t){if(e=C(e),t=ge(t),we)try{return ke(e,t)}catch(e){}if(ne(e,t))return p(!l(d.f,e,t),e[t])}},Se=a.String,xe=a.TypeError,Ee=function(e){if(T(e))return e;throw xe(Se(e)+" is not an object")},Oe=a.TypeError,Ae=Object.defineProperty,Ce={f:u?Ae:function(e,t,r){if(Ee(e),t=ge(t),Ee(r),we)try{return Ae(e,t,r)}catch(e){}if("get"in r||"set"in r)throw Oe("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},Ie=u?function(e,t,r){return Ce.f(e,t,p(1,r))}:function(e,t,r){return e[t]=r,e},Te=b(Function.toString);I($.inspectSource)||($.inspectSource=function(e){return Te(e)});var Re,Le,Ne,Pe=$.inspectSource,Me=a.WeakMap,je=I(Me)&&/native code/.test(Pe(Me)),De=Q("keys"),Be=function(e){return De[e]||(De[e]=se(e))},Ue={},Fe=a.TypeError,ze=a.WeakMap;if(je||$.state){var He=$.state||($.state=new ze),Ve=b(He.get),We=b(He.has),Ge=b(He.set);Re=function(e,t){if(We(He,e))throw new Fe("Object already initialized");return t.facade=e,Ge(He,e,t),t},Le=function(e){return Ve(He,e)||{}},Ne=function(e){return We(He,e)}}else{var Ke=Be("state");Ue[Ke]=!0,Re=function(e,t){if(ne(e,Ke))throw new Fe("Object already initialized");return t.facade=e,Ie(e,Ke,t),t},Le=function(e){return ne(e,Ke)?e[Ke]:{}},Ne=function(e){return ne(e,Ke)}}var qe={set:Re,get:Le,has:Ne,enforce:function(e){return Ne(e)?Le(e):Re(e,{})},getterFor:function(e){return function(t){var r;if(!T(t)||(r=Le(t)).type!==e)throw Fe("Incompatible receiver, "+e+" required");return r}}},Ye=Function.prototype,Ze=u&&Object.getOwnPropertyDescriptor,Je=ne(Ye,"name"),Xe={EXISTS:Je,PROPER:Je&&"something"===function(){}.name,CONFIGURABLE:Je&&(!u||u&&Ze(Ye,"name").configurable)},$e=r((function(e){var t=Xe.CONFIGURABLE,r=qe.get,n=qe.enforce,i=String(String).split("String");(e.exports=function(e,r,o,s){var u,c=!!s&&!!s.unsafe,l=!!s&&!!s.enumerable,f=!!s&&!!s.noTargetGet,h=s&&void 0!==s.name?s.name:r;I(o)&&("Symbol("===String(h).slice(0,7)&&(h="["+String(h).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!ne(o,"name")||t&&o.name!==h)&&Ie(o,"name",h),(u=n(o)).source||(u.source=i.join("string"==typeof h?h:""))),e!==a?(c?!f&&e[r]&&(l=!0):delete e[r],l?e[r]=o:Ie(e,r,o)):l?e[r]=o:X(r,o)})(Function.prototype,"toString",(function(){return I(this)&&r(this).source||Pe(this)}))})),Qe=Math.ceil,et=Math.floor,tt=function(e){var t=+e;return t!=t||0===t?0:(t>0?et:Qe)(t)},rt=Math.max,nt=Math.min,it=function(e,t){var r=tt(e);return r<0?rt(r+t,0):nt(r,t)},ot=Math.min,at=function(e){return e>0?ot(tt(e),9007199254740991):0},st=function(e){return at(e.length)},ut=function(e){return function(t,r,n){var i,o=C(t),a=st(o),s=it(n,a);if(e&&r!=r){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===r)return e||s||0;return!e&&-1}},ct={includes:ut(!0),indexOf:ut(!1)},lt=ct.indexOf,ft=b([].push),ht=function(e,t){var r,n=C(e),i=0,o=[];for(r in n)!ne(Ue,r)&&ne(n,r)&&ft(o,r);for(;t.length>i;)ne(n,r=t[i++])&&(~lt(o,r)||ft(o,r));return o},dt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],pt=dt.concat("length","prototype"),vt={f:Object.getOwnPropertyNames||function(e){return ht(e,pt)}},gt={f:Object.getOwnPropertySymbols},mt=b([].concat),yt=L("Reflect","ownKeys")||function(e){var t=vt.f(Ee(e)),r=gt.f;return r?mt(t,r(e)):t},bt=function(e,t){for(var r=yt(t),n=Ce.f,i=_e.f,o=0;o<r.length;o++){var a=r[o];ne(e,a)||n(e,a,i(t,a))}},wt=/#|\.prototype\./,kt=function(e,t){var r=St[_t(e)];return r==Et||r!=xt&&(I(t)?s(t):!!t)},_t=kt.normalize=function(e){return String(e).replace(wt,".").toLowerCase()},St=kt.data={},xt=kt.NATIVE="N",Et=kt.POLYFILL="P",Ot=kt,At=_e.f,Ct=function(e,t){var r,n,i,o,s,u=e.target,c=e.global,l=e.stat;if(r=c?a:l?a[u]||X(u,{}):(a[u]||{}).prototype)for(n in t){if(o=t[n],i=e.noTargetGet?(s=At(r,n))&&s.value:r[n],!Ot(c?n:u+(l?".":"#")+n,e.forced)&&void 0!==i){if(typeof o==typeof i)continue;bt(o,i)}(e.sham||i&&i.sham)&&Ie(o,"sham",!0),$e(r,n,o,e)}},It=Object.keys||function(e){return ht(e,dt)},Tt=Object.assign,Rt=Object.defineProperty,Lt=b([].concat),Nt=!Tt||s((function(){if(u&&1!==Tt({b:1},Tt(Rt({},"a",{enumerable:!0,get:function(){Rt(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol();return e[r]=7,"abcdefghijklmnopqrst".split("").forEach((function(e){t[e]=e})),7!=Tt({},e)[r]||"abcdefghijklmnopqrst"!=It(Tt({},t)).join("")}))?function(e,t){for(var r=te(e),n=arguments.length,i=1,o=gt.f,a=d.f;n>i;)for(var s,c=E(arguments[i++]),f=o?Lt(It(c),o(c)):It(c),h=f.length,p=0;h>p;)s=f[p++],u&&!l(a,c,s)||(r[s]=c[s]);return r}:Tt;Ct({target:"Object",stat:!0,forced:Object.assign!==Nt},{assign:Nt});var Pt=Array.isArray||function(e){return"Array"==_(e)},Mt=function(e,t,r){var n=ge(t);n in e?Ce.f(e,n,p(0,r)):e[n]=r},jt={};jt[he("toStringTag")]="z";var Dt="[object z]"===String(jt),Bt=he("toStringTag"),Ut=a.Object,Ft="Arguments"==_(function(){return arguments}()),zt=Dt?_:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=Ut(e),Bt))?r:Ft?_(t):"Object"==(n=_(t))&&I(t.callee)?"Arguments":n},Ht=function(){},Vt=[],Wt=L("Reflect","construct"),Gt=/^\s*(?:class|function)\b/,Kt=b(Gt.exec),qt=!Gt.exec(Ht),Yt=function(e){if(!I(e))return!1;try{return Wt(Ht,Vt,e),!0}catch(e){return!1}},Zt=!Wt||s((function(){var e;return Yt(Yt.call)||!Yt(Object)||!Yt((function(){e=!0}))||e}))?function(e){if(!I(e))return!1;switch(zt(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return qt||!!Kt(Gt,Pe(e))}:Yt,Jt=he("species"),Xt=a.Array,$t=function(e,t){return new(function(e){var t;return Pt(e)&&(t=e.constructor,(Zt(t)&&(t===Xt||Pt(t.prototype))||T(t)&&null===(t=t[Jt]))&&(t=void 0)),void 0===t?Xt:t}(e))(0===t?0:t)},Qt=he("species"),er=function(e){return U>=51||!s((function(){var t=[];return(t.constructor={})[Qt]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},tr=he("isConcatSpreadable"),rr=a.TypeError,nr=U>=51||!s((function(){var e=[];return e[tr]=!1,e.concat()[0]!==e})),ir=er("concat"),or=function(e){if(!T(e))return!1;var t=e[tr];return void 0!==t?!!t:Pt(e)};Ct({target:"Array",proto:!0,forced:!nr||!ir},{concat:function(e){var t,r,n,i,o,a=te(this),s=$t(a,0),u=0;for(t=-1,n=arguments.length;t<n;t++)if(or(o=-1===t?a:arguments[t])){if(u+(i=st(o))>9007199254740991)throw rr("Maximum allowed index exceeded");for(r=0;r<i;r++,u++)r in o&&Mt(s,u,o[r])}else{if(u>=9007199254740991)throw rr("Maximum allowed index exceeded");Mt(s,u++,o)}return s.length=u,s}});var ar=function(e,t){var r=[][e];return!!r&&s((function(){r.call(null,t||function(){throw 1},1)}))},sr=ct.indexOf,ur=b([].indexOf),cr=!!ur&&1/ur([1],1,-0)<0,lr=ar("indexOf");Ct({target:"Array",proto:!0,forced:cr||!lr},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return cr?ur(this,e,t)||0:sr(this,e,t)}});var fr,hr=a.String,dr=function(e){if("Symbol"===zt(e))throw TypeError("Cannot convert a Symbol value to a string");return hr(e)},pr=function(){var e=Ee(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},vr=a.RegExp,gr=s((function(){var e=vr("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),mr=gr||s((function(){return!vr("a","y").sticky})),yr={BROKEN_CARET:gr||s((function(){var e=vr("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:mr,UNSUPPORTED_Y:gr},br=u?Object.defineProperties:function(e,t){Ee(e);for(var r,n=C(t),i=It(t),o=i.length,a=0;o>a;)Ce.f(e,r=i[a++],n[r]);return e},wr=L("document","documentElement"),kr=Be("IE_PROTO"),_r=function(){},Sr=function(e){return"<script>"+e+"<\/script>"},xr=function(e){e.write(Sr("")),e.close();var t=e.parentWindow.Object;return e=null,t},Er=function(){try{fr=new ActiveXObject("htmlfile")}catch(e){}var e,t;Er="undefined"!=typeof document?document.domain&&fr?xr(fr):((t=be("iframe")).style.display="none",wr.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(Sr("document.F=Object")),e.close(),e.F):xr(fr);for(var r=dt.length;r--;)delete Er.prototype[dt[r]];return Er()};Ue[kr]=!0;var Or,Ar,Cr=Object.create||function(e,t){var r;return null!==e?(_r.prototype=Ee(e),r=new _r,_r.prototype=null,r[kr]=e):r=Er(),void 0===t?r:br(r,t)},Ir=a.RegExp,Tr=s((function(){var e=Ir(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Rr=a.RegExp,Lr=s((function(){var e=Rr("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Nr=qe.get,Pr=Q("native-string-replace",String.prototype.replace),Mr=RegExp.prototype.exec,jr=Mr,Dr=b("".charAt),Br=b("".indexOf),Ur=b("".replace),Fr=b("".slice),zr=(Ar=/b*/g,l(Mr,Or=/a/,"a"),l(Mr,Ar,"a"),0!==Or.lastIndex||0!==Ar.lastIndex),Hr=yr.BROKEN_CARET,Vr=void 0!==/()??/.exec("")[1];(zr||Vr||Hr||Tr||Lr)&&(jr=function(e){var t,r,n,i,o,a,s,u=this,c=Nr(u),f=dr(e),h=c.raw;if(h)return h.lastIndex=u.lastIndex,t=l(jr,h,f),u.lastIndex=h.lastIndex,t;var d=c.groups,p=Hr&&u.sticky,v=l(pr,u),g=u.source,m=0,y=f;if(p&&(v=Ur(v,"y",""),-1===Br(v,"g")&&(v+="g"),y=Fr(f,u.lastIndex),u.lastIndex>0&&(!u.multiline||u.multiline&&"\n"!==Dr(f,u.lastIndex-1))&&(g="(?: "+g+")",y=" "+y,m++),r=new RegExp("^(?:"+g+")",v)),Vr&&(r=new RegExp("^"+g+"$(?!\\s)",v)),zr&&(n=u.lastIndex),i=l(Mr,p?r:u,y),p?i?(i.input=Fr(i.input,m),i[0]=Fr(i[0],m),i.index=u.lastIndex,u.lastIndex+=i[0].length):u.lastIndex=0:zr&&i&&(u.lastIndex=u.global?i.index+i[0].length:n),Vr&&i&&i.length>1&&l(Pr,i[0],r,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(i[o]=void 0)})),i&&d)for(i.groups=a=Cr(null),o=0;o<d.length;o++)a[(s=d[o])[0]]=i[s[1]];return i});var Wr=jr;Ct({target:"RegExp",proto:!0,forced:/./.exec!==Wr},{exec:Wr});var Gr=he("species"),Kr=RegExp.prototype,qr=function(e,t,r,n){var i=he(e),o=!s((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),a=o&&!s((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[Gr]=function(){return r},r.flags="",r[i]=/./[i]),r.exec=function(){return t=!0,null},r[i](""),!t}));if(!o||!a||r){var u=b(/./[i]),c=t(i,""[e],(function(e,t,r,n,i){var a=b(e),s=t.exec;return s===Wr||s===Kr.exec?o&&!i?{done:!0,value:u(t,r,n)}:{done:!0,value:a(r,t,n)}:{done:!1}}));$e(String.prototype,e,c[0]),$e(Kr,i,c[1])}n&&Ie(Kr[i],"sham",!0)},Yr=b("".charAt),Zr=b("".charCodeAt),Jr=b("".slice),Xr=function(e){return function(t,r){var n,i,o=dr(A(t)),a=tt(r),s=o.length;return a<0||a>=s?e?"":void 0:(n=Zr(o,a))<55296||n>56319||a+1===s||(i=Zr(o,a+1))<56320||i>57343?e?Yr(o,a):n:e?Jr(o,a,a+2):i-56320+(n-55296<<10)+65536}},$r={codeAt:Xr(!1),charAt:Xr(!0)},Qr=$r.charAt,en=function(e,t,r){return t+(r?Qr(e,t).length:1)},tn=a.TypeError,rn=function(e,t){var r=e.exec;if(I(r)){var n=l(r,e,t);return null!==n&&Ee(n),n}if("RegExp"===_(e))return l(Wr,e,t);throw tn("RegExp#exec called on incompatible receiver")};qr("match",(function(e,t,r){return[function(t){var r=A(this),n=null==t?void 0:Y(t,e);return n?l(n,t,r):new RegExp(t)[e](dr(r))},function(e){var n=Ee(this),i=dr(e),o=r(t,n,i);if(o.done)return o.value;if(!n.global)return rn(n,i);var a=n.unicode;n.lastIndex=0;for(var s,u=[],c=0;null!==(s=rn(n,i));){var l=dr(s[0]);u[c]=l,""===l&&(n.lastIndex=en(i,at(n.lastIndex),a)),c++}return 0===c?null:u}]}));var nn=b(b.bind),on=function(e,t){return q(e),void 0===t?e:nn?nn(e,t):function(){return e.apply(t,arguments)}},an=b([].push),sn=function(e){var t=1==e,r=2==e,n=3==e,i=4==e,o=6==e,a=7==e,s=5==e||o;return function(u,c,l,f){for(var h,d,p=te(u),v=E(p),g=on(c,l),m=st(v),y=0,b=f||$t,w=t?b(u,m):r||a?b(u,0):void 0;m>y;y++)if((s||y in v)&&(d=g(h=v[y],y,p),e))if(t)w[y]=d;else if(d)switch(e){case 3:return!0;case 5:return h;case 6:return y;case 2:an(w,h)}else switch(e){case 4:return!1;case 7:an(w,h)}return o?-1:n||i?i:w}},un={forEach:sn(0),map:sn(1),filter:sn(2),some:sn(3),every:sn(4),find:sn(5),findIndex:sn(6),filterReject:sn(7)},cn=un.map,ln=er("map");Ct({target:"Array",proto:!0,forced:!ln},{map:function(e){return cn(this,e,arguments.length>1?arguments[1]:void 0)}});var fn="\t\n\v\f\r                 \u2028\u2029\ufeff",hn=b("".replace),dn="["+fn+"]",pn=RegExp("^"+dn+dn+"*"),vn=RegExp(dn+dn+"*$"),gn=function(e){return function(t){var r=dr(A(t));return 1&e&&(r=hn(r,pn,"")),2&e&&(r=hn(r,vn,"")),r}},mn={start:gn(1),end:gn(2),trim:gn(3)},yn=mn.trim,bn=a.parseInt,wn=a.Symbol,kn=wn&&wn.iterator,_n=/^[+-]?0x/i,Sn=b(_n.exec),xn=8!==bn(fn+"08")||22!==bn(fn+"0x16")||kn&&!s((function(){bn(Object(kn))}))?function(e,t){var r=yn(dr(e));return bn(r,t>>>0||(Sn(_n,r)?16:10))}:bn;Ct({global:!0,forced:parseInt!=xn},{parseInt:xn});var En,On,An,Cn,In,Tn,Rn,Ln,Nn,Pn,Mn,jn,Dn,Bn,Un,Fn,zn=(En=navigator.userAgent,On=En.toLocaleLowerCase(),An=navigator.platform.toUpperCase().indexOf("MAC")>=0||/macintosh|mac os x/i.test(En),Cn=navigator.platform.toUpperCase().indexOf("LINUX")>=0,In=/(?:Windows Phone)/.test(En),Tn=/(?:SymbianOS)/.test(En)||In,Rn=/(?:Android)/.test(En),Ln=/(?:Firefox)/.test(En),Nn=/(?:Chrome|CriOS)/.test(En)&&!(En.indexOf("Edg")>-1),Pn=En.indexOf("Edg")>-1,Mn=En.indexOf("Safari")>-1&&!(En.indexOf("Chrome")>-1),jn=/iPad/i.test(En),Dn=/(?:iPad|PlayBook)/.test(En)||Rn&&!/(?:Mobile)/.test(En)||Ln&&/(?:Tablet)/.test(En),Bn=/(?:iPhone)/.test(En)&&!Dn,Un=!(Bn||Rn||Tn||jn),Fn=En.indexOf("Baidu")>-1||En.indexOf("BIDUBrowser")>-1||En.indexOf("baiduboxapp")>-1,{isTablet:Dn,isPhone:Bn,isAndroid:Rn,isPc:Un,isMac:An,isChrome:Nn,isLinux:Cn,isFirefox:!!On.match(/firefox/)||En.indexOf("Firefox")>-1,isBaidu:Fn,isQQ:!!On.match(/tencenttraveler/)||!!On.match(/qqbrowse/)||En.indexOf("QQ/")>-1||En.indexOf("MicroMessenger")>-1,isOpera:En.indexOf("Opera")>-1||En.indexOf("OPR")>-1,isZhazha:En.indexOf("QihooBrowser")>-1||En.indexOf("QHBrowser")>-1||En.indexOf("360SE")>-1||En.indexOf("360EE")>-1||En.indexOf("LBBROWSER")>-1||En.indexOf("UC")>-1||En.indexOf("UBrowser")>-1||En.indexOf("UCWEB")>-1||En.indexOf("Quark")>-1||En.indexOf("MiuiBrowser")>-1||En.indexOf("AliApp(TB")>-1||En.indexOf("Weibo")>-1||En.indexOf("IqiyiApp")>-1||En.indexOf("HuaweiBrowser")>-1||En.indexOf("HUAWEI")>-1||En.indexOf("MetaSr")>-1||En.indexOf("Sogou")>-1||En.indexOf("SE")>-1||En.indexOf("Maxthon")>-1||En.indexOf("The world")>-1||En.indexOf("MetaSr")>-1||En.indexOf("2345Explorer")>-1||En.indexOf("TencentTraveler")>-1||En.indexOf("Mb2345Browser")>-1,isEdge:Pn,isSafari:Mn}),Hn={isMinBrowser:function(){var e=!1,t=zn.isEdge,r=zn.isSafari;if(zn.isChrome){var n=function(){var e=navigator.userAgent.match(/Chrom(?:e|ium)\/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/);if(null!=e&&5==e.length)return{major:(e=e.map((function(e){return parseInt(e,10)})))[1],minor:e[2],build:e[3],patch:e[4]}}();e=n&&n.major>=72}else if(t){var i=function(){var e=navigator.userAgent.match(/Ed(?:g)\/([0-9]+)\.([0-9]+)\.([0-9]+)/);if(!(null==e||e.length<4))return{major:(e=e.map((function(e){return parseInt(e,10)})))[1],minor:e[2],build:e[3]}}();e=i&&i.major>=80}else if(r){var o=function(){var e=navigator.userAgent.match(/Version\/([0-9]+)\.([0-9]+)/);if(!(null==e||e.length<3))return{major:(e=e.map((function(e){return parseInt(e,10)})))[1],minor:e[2]}}();e=o&&o.major>=13}return e},isSupportRTC:function(){for(var e=!1,t=["RTCPeerConnection","webkitRTCPeerConnection","mozRTCPeerConnection","RTCIceGatherer"],r=0;r<t.length;r++){if(t[r]in window){e=!0;break}}return e&&(e=Hn.isSupportPeerCB()),e},isSupportPeerCB:function(){if(RTCPeerConnection){var e,t=new RTCPeerConnection({iceServers:[]}),r=zn.isQQ,n=zn.isBaidu,i=zn.isOpera,o=zn.isZhazha,a=zn.isFirefox,s=zn.isSafari;return e=!(!(t.createDataChannel&&t.createAnswer&&t.createOffer&&t.addEventListener&&t.removeEventListener)||(r||n||i||o||a||s)),t.close(),e}return!1},isSupportWebsocket:function(){return!!window.WebSocket},isSupportMedia:function(){return!!navigator.mediaDevices}};function Vn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Gn(e,t,r){return t&&Wn(e.prototype,t),r&&Wn(e,r),e}function Kn(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Yn(e,t)}function qn(e){return(qn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Yn(e,t){return(Yn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Zn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Jn(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Zn(e)}function Xn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=qn(e);if(t){var i=qn(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Jn(this,r)}}function $n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}(e,t)||ei(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qn(e){return function(e){if(Array.isArray(e))return ti(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ei(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ei(e,t){if(e){if("string"==typeof e)return ti(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ti(e,t):void 0}}function ti(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ri(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=ei(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}var ni=he("unscopables"),ii=Array.prototype;null==ii[ni]&&Ce.f(ii,ni,{configurable:!0,value:Cr(null)});var oi,ai,si,ui=function(e){ii[ni][e]=!0},ci={},li=!s((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),fi=Be("IE_PROTO"),hi=a.Object,di=hi.prototype,pi=li?hi.getPrototypeOf:function(e){var t=te(e);if(ne(t,fi))return t[fi];var r=t.constructor;return I(r)&&t instanceof r?r.prototype:t instanceof hi?di:null},vi=he("iterator"),gi=!1;[].keys&&("next"in(si=[].keys())?(ai=pi(pi(si)))!==Object.prototype&&(oi=ai):gi=!0),(null==oi||s((function(){var e={};return oi[vi].call(e)!==e})))&&(oi={}),I(oi[vi])||$e(oi,vi,(function(){return this}));var mi={IteratorPrototype:oi,BUGGY_SAFARI_ITERATORS:gi},yi=Ce.f,bi=he("toStringTag"),wi=function(e,t,r){e&&!ne(e=r?e:e.prototype,bi)&&yi(e,bi,{configurable:!0,value:t})},ki=mi.IteratorPrototype,_i=function(){return this},Si=a.String,xi=a.TypeError,Ei=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=b(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return Ee(r),function(e){if("object"==typeof e||I(e))return e;throw xi("Can't set "+Si(e)+" as a prototype")}(n),t?e(r,n):r.__proto__=n,r}}():void 0),Oi=Xe.PROPER,Ai=Xe.CONFIGURABLE,Ci=mi.IteratorPrototype,Ii=mi.BUGGY_SAFARI_ITERATORS,Ti=he("iterator"),Ri=function(){return this},Li=function(e,t,r,n,i,o,a){!function(e,t,r){var n=t+" Iterator";e.prototype=Cr(ki,{next:p(1,r)}),wi(e,n,!1),ci[n]=_i}(r,t,n);var s,u,c,f=function(e){if(e===i&&m)return m;if(!Ii&&e in v)return v[e];switch(e){case"keys":case"values":case"entries":return function(){return new r(this,e)}}return function(){return new r(this)}},h=t+" Iterator",d=!1,v=e.prototype,g=v[Ti]||v["@@iterator"]||i&&v[i],m=!Ii&&g||f(i),y="Array"==t&&v.entries||g;if(y&&(s=pi(y.call(new e)))!==Object.prototype&&s.next&&(pi(s)!==Ci&&(Ei?Ei(s,Ci):I(s[Ti])||$e(s,Ti,Ri)),wi(s,h,!0)),Oi&&"values"==i&&g&&"values"!==g.name&&(Ai?Ie(v,"name","values"):(d=!0,m=function(){return l(g,this)})),i)if(u={values:f("values"),keys:o?m:f("keys"),entries:f("entries")},a)for(c in u)(Ii||d||!(c in v))&&$e(v,c,u[c]);else Ct({target:t,proto:!0,forced:Ii||d},u);return v[Ti]!==m&&$e(v,Ti,m,{name:i}),ci[t]=m,u},Ni=qe.set,Pi=qe.getterFor("Array Iterator"),Mi=Li(Array,"Array",(function(e,t){Ni(this,{type:"Array Iterator",target:C(e),index:0,kind:t})}),(function(){var e=Pi(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}}),"values");ci.Arguments=ci.Array,ui("keys"),ui("values"),ui("entries");var ji=Dt?{}.toString:function(){return"[object "+zt(this)+"]"};Dt||$e(Object.prototype,"toString",ji,{unsafe:!0});var Di=a.Promise,Bi=function(e,t,r){for(var n in t)$e(e,n,t[n],r);return e},Ui=he("species"),Fi=function(e){var t=L(e),r=Ce.f;u&&t&&!t[Ui]&&r(t,Ui,{configurable:!0,get:function(){return this}})},zi=a.TypeError,Hi=function(e,t){if(N(t,e))return e;throw zi("Incorrect invocation")},Vi=he("iterator"),Wi=Array.prototype,Gi=function(e){return void 0!==e&&(ci.Array===e||Wi[Vi]===e)},Ki=he("iterator"),qi=function(e){if(null!=e)return Y(e,Ki)||Y(e,"@@iterator")||ci[zt(e)]},Yi=a.TypeError,Zi=function(e,t){var r=arguments.length<2?qi(e):t;if(q(r))return Ee(l(r,e));throw Yi(G(e)+" is not iterable")},Ji=function(e,t,r){var n,i;Ee(e);try{if(!(n=Y(e,"return"))){if("throw"===t)throw r;return r}n=l(n,e)}catch(e){i=!0,n=e}if("throw"===t)throw r;if(i)throw n;return Ee(n),r},Xi=a.TypeError,$i=function(e,t){this.stopped=e,this.result=t},Qi=$i.prototype,eo=function(e,t,r){var n,i,o,a,s,u,c,f=r&&r.that,h=!(!r||!r.AS_ENTRIES),d=!(!r||!r.IS_ITERATOR),p=!(!r||!r.INTERRUPTED),v=on(t,f),g=function(e){return n&&Ji(n,"normal",e),new $i(!0,e)},m=function(e){return h?(Ee(e),p?v(e[0],e[1],g):v(e[0],e[1])):p?v(e,g):v(e)};if(d)n=e;else{if(!(i=qi(e)))throw Xi(G(e)+" is not iterable");if(Gi(i)){for(o=0,a=st(e);a>o;o++)if((s=m(e[o]))&&N(Qi,s))return s;return new $i(!1)}n=Zi(e,i)}for(u=n.next;!(c=l(u,n)).done;){try{s=m(c.value)}catch(e){Ji(n,"throw",e)}if("object"==typeof s&&s&&N(Qi,s))return s}return new $i(!1)},to=he("iterator"),ro=!1;try{var no=0,io={next:function(){return{done:!!no++}},return:function(){ro=!0}};io[to]=function(){return this},Array.from(io,(function(){throw 2}))}catch(e){}var oo,ao,so,uo,co=function(e,t){if(!t&&!ro)return!1;var r=!1;try{var n={};n[to]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},lo=a.TypeError,fo=function(e){if(Zt(e))return e;throw lo(G(e)+" is not a constructor")},ho=he("species"),po=function(e,t){var r,n=Ee(e).constructor;return void 0===n||null==(r=Ee(n)[ho])?t:fo(r)},vo=Function.prototype,go=vo.apply,mo=vo.bind,yo=vo.call,bo="object"==typeof Reflect&&Reflect.apply||(mo?yo.bind(go):function(){return yo.apply(go,arguments)}),wo=b([].slice),ko=/(?:ipad|iphone|ipod).*applewebkit/i.test(P),_o="process"==_(a.process),So=a.setImmediate,xo=a.clearImmediate,Eo=a.process,Oo=a.Dispatch,Ao=a.Function,Co=a.MessageChannel,Io=a.String,To=0,Ro={};try{oo=a.location}catch(e){}var Lo=function(e){if(ne(Ro,e)){var t=Ro[e];delete Ro[e],t()}},No=function(e){return function(){Lo(e)}},Po=function(e){Lo(e.data)},Mo=function(e){a.postMessage(Io(e),oo.protocol+"//"+oo.host)};So&&xo||(So=function(e){var t=wo(arguments,1);return Ro[++To]=function(){bo(I(e)?e:Ao(e),void 0,t)},ao(To),To},xo=function(e){delete Ro[e]},_o?ao=function(e){Eo.nextTick(No(e))}:Oo&&Oo.now?ao=function(e){Oo.now(No(e))}:Co&&!ko?(uo=(so=new Co).port2,so.port1.onmessage=Po,ao=on(uo.postMessage,uo)):a.addEventListener&&I(a.postMessage)&&!a.importScripts&&oo&&"file:"!==oo.protocol&&!s(Mo)?(ao=Mo,a.addEventListener("message",Po,!1)):ao="onreadystatechange"in be("script")?function(e){wr.appendChild(be("script")).onreadystatechange=function(){wr.removeChild(this),Lo(e)}}:function(e){setTimeout(No(e),0)});var jo,Do,Bo,Uo,Fo,zo,Ho,Vo,Wo={set:So,clear:xo},Go=/ipad|iphone|ipod/i.test(P)&&void 0!==a.Pebble,Ko=/web0s(?!.*chrome)/i.test(P),qo=_e.f,Yo=Wo.set,Zo=a.MutationObserver||a.WebKitMutationObserver,Jo=a.document,Xo=a.process,$o=a.Promise,Qo=qo(a,"queueMicrotask"),ea=Qo&&Qo.value;ea||(jo=function(){var e,t;for(_o&&(e=Xo.domain)&&e.exit();Do;){t=Do.fn,Do=Do.next;try{t()}catch(e){throw Do?Uo():Bo=void 0,e}}Bo=void 0,e&&e.enter()},ko||_o||Ko||!Zo||!Jo?!Go&&$o&&$o.resolve?((Ho=$o.resolve(void 0)).constructor=$o,Vo=on(Ho.then,Ho),Uo=function(){Vo(jo)}):_o?Uo=function(){Xo.nextTick(jo)}:(Yo=on(Yo,a),Uo=function(){Yo(jo)}):(Fo=!0,zo=Jo.createTextNode(""),new Zo(jo).observe(zo,{characterData:!0}),Uo=function(){zo.data=Fo=!Fo}));var ta,ra,na,ia,oa=ea||function(e){var t={fn:e,next:void 0};Bo&&(Bo.next=t),Do||(Do=t,Uo()),Bo=t},aa=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n})),this.resolve=q(t),this.reject=q(r)},sa={f:function(e){return new aa(e)}},ua=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},ca="object"==typeof window,la=Wo.set,fa=he("species"),ha=qe.get,da=qe.set,pa=qe.getterFor("Promise"),va=Di&&Di.prototype,ga=Di,ma=va,ya=a.TypeError,ba=a.document,wa=a.process,ka=sa.f,_a=ka,Sa=!!(ba&&ba.createEvent&&a.dispatchEvent),xa=I(a.PromiseRejectionEvent),Ea=!1,Oa=Ot("Promise",(function(){var e=Pe(ga),t=e!==String(ga);if(!t&&66===U)return!0;if(U>=51&&/native code/.test(e))return!1;var r=new ga((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};return(r.constructor={})[fa]=n,!(Ea=r.then((function(){}))instanceof n)||!t&&ca&&!xa})),Aa=Oa||!co((function(e){ga.all(e).catch((function(){}))})),Ca=function(e){var t;return!(!T(e)||!I(t=e.then))&&t},Ia=function(e,t){if(!e.notified){e.notified=!0;var r=e.reactions;oa((function(){for(var n=e.value,i=1==e.state,o=0;r.length>o;){var a,s,u,c=r[o++],f=i?c.ok:c.fail,h=c.resolve,d=c.reject,p=c.domain;try{f?(i||(2===e.rejection&&Na(e),e.rejection=1),!0===f?a=n:(p&&p.enter(),a=f(n),p&&(p.exit(),u=!0)),a===c.promise?d(ya("Promise-chain cycle")):(s=Ca(a))?l(s,a,h,d):h(a)):d(n)}catch(e){p&&!u&&p.exit(),d(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&Ra(e)}))}},Ta=function(e,t,r){var n,i;Sa?((n=ba.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),a.dispatchEvent(n)):n={promise:t,reason:r},!xa&&(i=a["on"+e])?i(n):"unhandledrejection"===e&&function(e,t){var r=a.console;r&&r.error&&(1==arguments.length?r.error(e):r.error(e,t))}("Unhandled promise rejection",r)},Ra=function(e){l(la,a,(function(){var t,r=e.facade,n=e.value;if(La(e)&&(t=ua((function(){_o?wa.emit("unhandledRejection",n,r):Ta("unhandledrejection",r,n)})),e.rejection=_o||La(e)?2:1,t.error))throw t.value}))},La=function(e){return 1!==e.rejection&&!e.parent},Na=function(e){l(la,a,(function(){var t=e.facade;_o?wa.emit("rejectionHandled",t):Ta("rejectionhandled",t,e.value)}))},Pa=function(e,t,r){return function(n){e(t,n,r)}},Ma=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,Ia(e,!0))},ja=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw ya("Promise can't be resolved itself");var n=Ca(t);n?oa((function(){var r={done:!1};try{l(n,t,Pa(ja,r,e),Pa(Ma,r,e))}catch(t){Ma(r,t,e)}})):(e.value=t,e.state=1,Ia(e,!1))}catch(t){Ma({done:!1},t,e)}}};if(Oa&&(ma=(ga=function(e){Hi(this,ma),q(e),l(ta,this);var t=ha(this);try{e(Pa(ja,t),Pa(Ma,t))}catch(e){Ma(t,e)}}).prototype,(ta=function(e){da(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=Bi(ma,{then:function(e,t){var r=pa(this),n=r.reactions,i=ka(po(this,ga));return i.ok=!I(e)||e,i.fail=I(t)&&t,i.domain=_o?wa.domain:void 0,r.parent=!0,n[n.length]=i,0!=r.state&&Ia(r,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),ra=function(){var e=new ta,t=ha(e);this.promise=e,this.resolve=Pa(ja,t),this.reject=Pa(Ma,t)},sa.f=ka=function(e){return e===ga||e===na?new ra(e):_a(e)},I(Di)&&va!==Object.prototype)){ia=va.then,Ea||($e(va,"then",(function(e,t){var r=this;return new ga((function(e,t){l(ia,r,e,t)})).then(e,t)}),{unsafe:!0}),$e(va,"catch",ma.catch,{unsafe:!0}));try{delete va.constructor}catch(e){}Ei&&Ei(va,ma)}Ct({global:!0,wrap:!0,forced:Oa},{Promise:ga}),wi(ga,"Promise",!1),Fi("Promise"),na=L("Promise"),Ct({target:"Promise",stat:!0,forced:Oa},{reject:function(e){var t=ka(this);return l(t.reject,void 0,e),t.promise}}),Ct({target:"Promise",stat:!0,forced:Oa},{resolve:function(e){return function(e,t){if(Ee(e),T(t)&&t.constructor===e)return t;var r=sa.f(e);return(0,r.resolve)(t),r.promise}(this,e)}}),Ct({target:"Promise",stat:!0,forced:Aa},{all:function(e){var t=this,r=ka(t),n=r.resolve,i=r.reject,o=ua((function(){var r=q(t.resolve),o=[],a=0,s=1;eo(e,(function(e){var u=a++,c=!1;s++,l(r,t,e).then((function(e){c||(c=!0,o[u]=e,--s||n(o))}),i)})),--s||n(o)}));return o.error&&i(o.value),r.promise},race:function(e){var t=this,r=ka(t),n=r.reject,i=ua((function(){var i=q(t.resolve);eo(e,(function(e){l(i,t,e).then(r.resolve,n)}))}));return i.error&&n(i.value),r.promise}});var Da=$r.charAt,Ba=qe.set,Ua=qe.getterFor("String Iterator");Li(String,"String",(function(e){Ba(this,{type:"String Iterator",string:dr(e),index:0})}),(function(){var e,t=Ua(this),r=t.string,n=t.index;return n>=r.length?{value:void 0,done:!0}:(e=Da(r,n),t.index+=e.length,{value:e,done:!1})}));var Fa={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},za=be("span").classList,Ha=za&&za.constructor&&za.constructor.prototype,Va=Ha===Object.prototype?void 0:Ha,Wa=he("iterator"),Ga=he("toStringTag"),Ka=Mi.values,qa=function(e,t){if(e){if(e[Wa]!==Ka)try{Ie(e,Wa,Ka)}catch(t){e[Wa]=Ka}if(e[Ga]||Ie(e,Ga,t),Fa[t])for(var r in Mi)if(e[r]!==Mi[r])try{Ie(e,r,Mi[r])}catch(t){e[r]=Mi[r]}}};for(var Ya in Fa)qa(a[Ya]&&a[Ya].prototype,Ya);qa(Va,"DOMTokenList");var Za=a.Date,Ja=b(Za.prototype.getTime);Ct({target:"Date",stat:!0},{now:function(){return Ja(new Za)}});var Xa=Date.prototype,$a=b(Xa.toString),Qa=b(Xa.getTime);function es(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}"Invalid Date"!=String(new Date(NaN))&&$e(Xa,"toString",(function(){var e=Qa(this);return e==e?$a(this):"Invalid Date"})),r((function(e){var t=function(e){var t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",o=n.asyncIterator||"@@asyncIterator",a=n.toStringTag||"@@toStringTag";function s(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var i=t&&t.prototype instanceof f?t:f,o=Object.create(i.prototype),a=new S(n||[]);return o._invoke=function(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return E()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=w(a,r);if(s){if(s===l)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=c(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(e,r,a),o}function c(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l={};function f(){}function h(){}function d(){}var p={};s(p,i,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(x([])));g&&g!==t&&r.call(g,i)&&(p=g);var m=d.prototype=f.prototype=Object.create(p);function y(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){var n;this._invoke=function(i,o){function a(){return new t((function(n,a){!function n(i,o,a,s){var u=c(e[i],e,o);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(f).then((function(e){l.value=e,a(l)}),(function(e){return n("throw",e,a,s)}))}s(u.arg)}(i,o,n,a)}))}return n=n?n.then(a,a):a()}}function w(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var n=c(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,l;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function k(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 _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function x(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return h.prototype=d,s(m,"constructor",d),s(d,"constructor",h),h.displayName=s(d,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,s(e,a,"GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},y(b.prototype),s(b.prototype,o,(function(){return this})),e.AsyncIterator=b,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new b(u(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},y(m),s(m,a,"Generator"),s(m,i,(function(){return this})),s(m,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=x,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),l},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),_(r),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;_(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:x(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),l}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}));var ts=Object.keys,rs=Array.isArray,ns="undefined"!=typeof self?self:"undefined"!=typeof window?window:global;function is(e,t){return"object"!=typeof t||ts(t).forEach((function(r){e[r]=t[r]})),e}var os=Object.getPrototypeOf,as={}.hasOwnProperty;function ss(e,t){return as.call(e,t)}function us(e,t){"function"==typeof t&&(t=t(os(e))),ts(t).forEach((function(r){ls(e,r,t[r])}))}var cs=Object.defineProperty;function ls(e,t,r,n){cs(e,t,is(r&&ss(r,"get")&&"function"==typeof r.get?{get:r.get,set:r.set,configurable:!0}:{value:r,configurable:!0,writable:!0},n))}function fs(e){return{from:function(t){return e.prototype=Object.create(t.prototype),ls(e.prototype,"constructor",e),{extend:us.bind(null,e.prototype)}}}}var hs=Object.getOwnPropertyDescriptor;var ds=[].slice;function ps(e,t,r){return ds.call(e,t,r)}function vs(e,t){return t(e)}function gs(e){if(!e)throw new Error("Assertion Failed")}function ms(e){ns.setImmediate?setImmediate(e):setTimeout(e,0)}function ys(e,t){return e.reduce((function(e,r,n){var i=t(r,n);return i&&(e[i[0]]=i[1]),e}),{})}function bs(e,t){return function(){try{e.apply(this,arguments)}catch(e){t(e)}}}function ws(e,t,r){try{e.apply(null,r)}catch(e){t&&t(e)}}function ks(e,t){if(ss(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var r=[],n=0,i=t.length;n<i;++n){var o=ks(e,t[n]);r.push(o)}return r}var a=t.indexOf(".");if(-1!==a){var s=e[t.substr(0,a)];return void 0===s?void 0:ks(s,t.substr(a+1))}}function _s(e,t,r){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){gs("string"!=typeof r&&"length"in r);for(var n=0,i=t.length;n<i;++n)_s(e,t[n],r[n])}else{var o=t.indexOf(".");if(-1!==o){var a=t.substr(0,o),s=t.substr(o+1);if(""===s)void 0===r?delete e[a]:e[a]=r;else{var u=e[a];u||(u=e[a]={}),_s(u,s,r)}}else void 0===r?delete e[t]:e[t]=r}}function Ss(e){var t={};for(var r in e)ss(e,r)&&(t[r]=e[r]);return t}var xs=[].concat;function Es(e){return xs.apply([],e)}var Os="Boolean,String,Date,RegExp,Blob,File,FileList,ArrayBuffer,DataView,Uint8ClampedArray,ImageData,Map,Set".split(",").concat(Es([8,16,32,64].map((function(e){return["Int","Uint","Float"].map((function(t){return t+e+"Array"}))})))).filter((function(e){return ns[e]})).map((function(e){return ns[e]}));function As(e){if(!e||"object"!=typeof e)return e;var t;if(rs(e)){t=[];for(var r=0,n=e.length;r<n;++r)t.push(As(e[r]))}else if(Os.indexOf(e.constructor)>=0)t=e;else for(var i in t=e.constructor?Object.create(e.constructor.prototype):{},e)ss(e,i)&&(t[i]=As(e[i]));return t}function Cs(e,t,r,n){return r=r||{},n=n||"",ts(e).forEach((function(i){if(ss(t,i)){var o=e[i],a=t[i];"object"==typeof o&&"object"==typeof a&&o&&a&&""+o.constructor==""+a.constructor?Cs(o,a,r,n+i+"."):o!==a&&(r[n+i]=t[i])}else r[n+i]=void 0})),ts(t).forEach((function(i){ss(e,i)||(r[n+i]=t[i])})),r}var Is="undefined"!=typeof Symbol&&Symbol.iterator,Ts=Is?function(e){var t;return null!=e&&(t=e[Is])&&t.apply(e)}:function(){return null},Rs={};function Ls(e){var t,r,n,i;if(1===arguments.length){if(rs(e))return e.slice();if(this===Rs&&"string"==typeof e)return[e];if(i=Ts(e)){for(r=[];!(n=i.next()).done;)r.push(n.value);return r}if(null==e)return[e];if("number"==typeof(t=e.length)){for(r=new Array(t);t--;)r[t]=e[t];return r}return[e]}for(t=arguments.length,r=new Array(t);t--;)r[t]=arguments[t];return r}var Ns="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Ps(e,t){Ns=e,Ms=t}var Ms=function(){return!0},js=!new Error("").stack;function Ds(){if(js)try{throw Ds.arguments,new Error}catch(e){return e}return new Error}function Bs(e,t){var r=e.stack;return r?(t=t||0,0===r.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),r.split("\n").slice(t).filter(Ms).map((function(e){return"\n"+e})).join("")):""}var Us=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Fs=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Us),zs={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed"};function Hs(e,t){this._e=Ds(),this.name=e,this.message=t}function Vs(e,t,r,n){this._e=Ds(),this.failures=t,this.failedKeys=n,this.successCount=r}function Ws(e,t){this._e=Ds(),this.name="BulkError",this.failures=t,this.message=function(e,t){return e+". Errors: "+t.map((function(e){return e.toString()})).filter((function(e,t,r){return r.indexOf(e)===t})).join("\n")}(e,t)}fs(Hs).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+Bs(this._e,2))}},toString:function(){return this.name+": "+this.message}}),fs(Vs).from(Hs),fs(Ws).from(Hs);var Gs=Fs.reduce((function(e,t){return e[t]=t+"Error",e}),{}),Ks=Hs,qs=Fs.reduce((function(e,t){var r=t+"Error";function n(e,n){this._e=Ds(),this.name=r,e?"string"==typeof e?(this.message=e,this.inner=n||null):"object"==typeof e&&(this.message=e.name+" "+e.message,this.inner=e):(this.message=zs[t]||r,this.inner=null)}return fs(n).from(Ks),e[t]=n,e}),{});qs.Syntax=SyntaxError,qs.Type=TypeError,qs.Range=RangeError;var Ys=Us.reduce((function(e,t){return e[t+"Error"]=qs[t],e}),{});var Zs=Fs.reduce((function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=qs[t]),e}),{});function Js(){}function Xs(e){return e}function $s(e,t){return null==e||e===Xs?t:function(r){return t(e(r))}}function Qs(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function eu(e,t){return e===Js?t:function(){var r=e.apply(this,arguments);void 0!==r&&(arguments[0]=r);var n=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return n&&(this.onsuccess=this.onsuccess?Qs(n,this.onsuccess):n),i&&(this.onerror=this.onerror?Qs(i,this.onerror):i),void 0!==o?o:r}}function tu(e,t){return e===Js?t:function(){e.apply(this,arguments);var r=this.onsuccess,n=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),r&&(this.onsuccess=this.onsuccess?Qs(r,this.onsuccess):r),n&&(this.onerror=this.onerror?Qs(n,this.onerror):n)}}function ru(e,t){return e===Js?t:function(r){var n=e.apply(this,arguments);is(r,n);var i=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?Qs(i,this.onsuccess):i),o&&(this.onerror=this.onerror?Qs(o,this.onerror):o),void 0===n?void 0===a?void 0:a:is(n,a)}}function nu(e,t){return e===Js?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function iu(e,t){return e===Js?t:function(){var r=e.apply(this,arguments);if(r&&"function"==typeof r.then){for(var n=this,i=arguments.length,o=new Array(i);i--;)o[i]=arguments[i];return r.then((function(){return t.apply(n,o)}))}return t.apply(this,arguments)}}Zs.ModifyError=Vs,Zs.DexieError=Hs,Zs.BulkError=Ws;var ou={},au=function(){try{return new Function("let F=async ()=>{},p=F();return [p,Object.getPrototypeOf(p),Promise.resolve(),F.constructor];")()}catch(t){var e=ns.Promise;return e?[e.resolve(),e.prototype,e.resolve()]:[]}}(),su=au[0],uu=au[1],cu=au[2],lu=uu&&uu.then,fu=su&&su.constructor,hu=au[3],du=!!cu,pu=!1,vu=cu?function(){cu.then(Du)}:ns.setImmediate?setImmediate.bind(null,Du):ns.MutationObserver?function(){var e=document.createElement("div");new MutationObserver((function(){Du(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:function(){setTimeout(Du,0)},gu=function(e,t){Eu.push([e,t]),yu&&(vu(),yu=!1)},mu=!0,yu=!0,bu=[],wu=[],ku=null,_u=Xs,Su={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:ac,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((function(e){try{ac(e[0],e[1])}catch(e){}}))}},xu=Su,Eu=[],Ou=0,Au=[];function Cu(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=Js,this._lib=!1;var t=this._PSD=xu;if(Ns&&(this._stackHolder=Ds(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==ou)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&Lu(this,this._value))}this._state=null,this._value=null,++t.ref,Ru(this,e)}var Iu={get:function(){var e=xu,t=qu;function r(r,n){var i=this,o=!e.global&&(e!==xu||t!==qu);o&&Xu();var a=new Cu((function(t,a){Pu(i,new Tu(ic(r,e,o),ic(n,e,o),t,a,e))}));return Ns&&ju(a,this),a}return r.prototype=ou,r},set:function(e){ls(this,"then",e&&e.prototype===ou?Iu:{get:function(){return e},set:Iu.set})}};function Tu(e,t,r,n,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=r,this.reject=n,this.psd=i}function Ru(e,t){try{t((function(t){if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var r=e._lib&&Bu();t&&"function"==typeof t.then?Ru(e,(function(e,r){t instanceof Cu?t._then(e,r):t.then(e,r)})):(e._state=!0,e._value=t,Nu(e)),r&&Uu()}}),Lu.bind(null,e))}catch(t){Lu(e,t)}}function Lu(e,t){if(wu.push(t),null===e._state){var r=e._lib&&Bu();t=_u(t),e._state=!1,e._value=t,Ns&&null!==t&&"object"==typeof t&&!t._promise&&ws((function(){var r=function e(t,r){var n;return hs(t,r)||(n=os(t))&&e(n,r)}(t,"stack");t._promise=e,ls(t,"stack",{get:function(){return pu?r&&(r.get?r.get.apply(t):r.value):e.stack}})})),function(e){bu.some((function(t){return t._value===e._value}))||bu.push(e)}(e),Nu(e),r&&Uu()}}function Nu(e){var t=e._listeners;e._listeners=[];for(var r=0,n=t.length;r<n;++r)Pu(e,t[r]);var i=e._PSD;--i.ref||i.finalize(),0===Ou&&(++Ou,gu((function(){0==--Ou&&Fu()}),[]))}function Pu(e,t){if(null!==e._state){var r=e._state?t.onFulfilled:t.onRejected;if(null===r)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++Ou,gu(Mu,[r,e,t])}else e._listeners.push(t)}function Mu(e,t,r){try{ku=t;var n,i=t._value;t._state?n=e(i):(wu.length&&(wu=[]),n=e(i),-1===wu.indexOf(i)&&function(e){var t=bu.length;for(;t;)if(bu[--t]._value===e._value)return void bu.splice(t,1)}(t)),r.resolve(n)}catch(e){r.reject(e)}finally{ku=null,0==--Ou&&Fu(),--r.psd.ref||r.psd.finalize()}}function ju(e,t){var r=t?t._numPrev+1:0;r<100&&(e._prev=t,e._numPrev=r)}function Du(){Bu()&&Uu()}function Bu(){var e=mu;return mu=!1,yu=!1,e}function Uu(){var e,t,r;do{for(;Eu.length>0;)for(e=Eu,Eu=[],r=e.length,t=0;t<r;++t){var n=e[t];n[0].apply(null,n[1])}}while(Eu.length>0);mu=!0,yu=!0}function Fu(){var e=bu;bu=[],e.forEach((function(e){e._PSD.onunhandled.call(null,e._value,e)}));for(var t=Au.slice(0),r=t.length;r;)t[--r]()}function zu(e){return new Cu(ou,!1,e)}function Hu(e,t){var r=xu;return function(){var n=Bu(),i=xu;try{return tc(r,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{tc(i,!1),n&&Uu()}}}us(Cu.prototype,{then:Iu,_then:function(e,t){Pu(this,new Tu(null,null,e,t,xu))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=arguments[0],r=arguments[1];return"function"==typeof t?this.then(null,(function(e){return e instanceof t?r(e):zu(e)})):this.then(null,(function(e){return e&&e.name===t?r(e):zu(e)}))},finally:function(e){return this.then((function(t){return e(),t}),(function(t){return e(),zu(t)}))},stack:{get:function(){if(this._stack)return this._stack;try{pu=!0;var e=function e(t,r,n){if(r.length===n)return r;var i="";if(!1===t._state){var o,a,s=t._value;null!=s?(o=s.name||"Error",a=s.message||s,i=Bs(s,0)):(o=s,a=""),r.push(o+(a?": "+a:"")+i)}Ns&&((i=Bs(t._stackHolder,2))&&-1===r.indexOf(i)&&r.push(i),t._prev&&e(t._prev,r,n));return r}(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{pu=!1}}},timeout:function(e,t){var r=this;return e<1/0?new Cu((function(n,i){var o=setTimeout((function(){return i(new qs.Timeout(t))}),e);r.then(n,i).finally(clearTimeout.bind(null,o))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&ls(Cu.prototype,Symbol.toStringTag,"Promise"),Su.env=rc(),us(Cu,{all:function(){var e=Ls.apply(null,arguments).map($u);return new Cu((function(t,r){0===e.length&&t([]);var n=e.length;e.forEach((function(i,o){return Cu.resolve(i).then((function(r){e[o]=r,--n||t(e)}),r)}))}))},resolve:function(e){if(e instanceof Cu)return e;if(e&&"function"==typeof e.then)return new Cu((function(t,r){e.then(t,r)}));var t=new Cu(ou,!0,e);return ju(t,ku),t},reject:zu,race:function(){var e=Ls.apply(null,arguments).map($u);return new Cu((function(t,r){e.map((function(e){return Cu.resolve(e).then(t,r)}))}))},PSD:{get:function(){return xu},set:function(e){return xu=e}},newPSD:Zu,usePSD:nc,scheduler:{get:function(){return gu},set:function(e){gu=e}},rejectionMapper:{get:function(){return _u},set:function(e){_u=e}},follow:function(e,t){return new Cu((function(r,n){return Zu((function(t,r){var n=xu;n.unhandleds=[],n.onunhandled=r,n.finalize=Qs((function(){var e=this;!function(e){Au.push((function t(){e(),Au.splice(Au.indexOf(t),1)})),++Ou,gu((function(){0==--Ou&&Fu()}),[])}((function(){0===e.unhandleds.length?t():r(e.unhandleds[0])}))}),n.finalize),e()}),t,r,n)}))}});var Vu={awaits:0,echoes:0,id:0},Wu=0,Gu=[],Ku=0,qu=0,Yu=0;function Zu(e,t,r,n){var i=xu,o=Object.create(i);o.parent=i,o.ref=0,o.global=!1,o.id=++Yu;var a=Su.env;o.env=du?{Promise:Cu,PromiseProp:{value:Cu,configurable:!0,writable:!0},all:Cu.all,race:Cu.race,resolve:Cu.resolve,reject:Cu.reject,nthen:oc(a.nthen,o),gthen:oc(a.gthen,o)}:{},t&&is(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()};var s=nc(o,e,r,n);return 0===o.ref&&o.finalize(),s}function Ju(){return Vu.id||(Vu.id=++Wu),++Vu.awaits,Vu.echoes+=7,Vu.id}function Xu(e){!Vu.awaits||e&&e!==Vu.id||(0==--Vu.awaits&&(Vu.id=0),Vu.echoes=7*Vu.awaits)}function $u(e){return Vu.echoes&&e&&e.constructor===fu?(Ju(),e.then((function(e){return Xu(),e}),(function(e){return Xu(),sc(e)}))):e}function Qu(e){++qu,Vu.echoes&&0!=--Vu.echoes||(Vu.echoes=Vu.id=0),Gu.push(xu),tc(e,!0)}function ec(){var e=Gu[Gu.length-1];Gu.pop(),tc(e,!1)}function tc(e,t){var r,n=xu;if((t?!Vu.echoes||Ku++&&e===xu:!Ku||--Ku&&e===xu)||(r=t?Qu.bind(null,e):ec,lu.call(su,r)),e!==xu&&(xu=e,n===Su&&(Su.env=rc()),du)){var i=Su.env.Promise,o=e.env;uu.then=o.nthen,i.prototype.then=o.gthen,(n.global||e.global)&&(Object.defineProperty(ns,"Promise",o.PromiseProp),i.all=o.all,i.race=o.race,i.resolve=o.resolve,i.reject=o.reject)}}function rc(){var e=ns.Promise;return du?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(ns,"Promise"),all:e.all,race:e.race,resolve:e.resolve,reject:e.reject,nthen:uu.then,gthen:e.prototype.then}:{}}function nc(e,t,r,n,i){var o=xu;try{return tc(e,!0),t(r,n,i)}finally{tc(o,!1)}}function ic(e,t,r){return"function"!=typeof e?e:function(){var n=xu;r&&Ju(),tc(t,!0);try{return e.apply(this,arguments)}finally{tc(n,!1)}}}function oc(e,t){return function(r,n){return e.call(this,ic(r,t,!1),ic(n,t,!1))}}function ac(e,t){var r;try{r=t.onuncatched(e)}catch(e){}if(!1!==r)try{var n,i={promise:t,reason:e};if(ns.document&&document.createEvent?((n=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),is(n,i)):ns.CustomEvent&&is(n=new CustomEvent("unhandledrejection",{detail:i}),i),n&&ns.dispatchEvent&&(dispatchEvent(n),!ns.PromiseRejectionEvent&&ns.onunhandledrejection))try{ns.onunhandledrejection(n)}catch(e){}n.defaultPrevented||console.warn("Unhandled rejection: "+(e.stack||e))}catch(e){}}var sc=Cu.reject;function uc(e){var t={},r=function(r,n){if(n){for(var i=arguments.length,o=new Array(i-1);--i;)o[i-1]=arguments[i];return t[r].subscribe.apply(null,o),e}if("string"==typeof r)return t[r]};r.addEventType=o;for(var n=1,i=arguments.length;n<i;++n)o(arguments[n]);return r;function o(e,n,i){if("object"==typeof e)return a(e);n||(n=nu),i||(i=Js);var o={subscribers:[],fire:i,subscribe:function(e){-1===o.subscribers.indexOf(e)&&(o.subscribers.push(e),o.fire=n(o.fire,e))},unsubscribe:function(e){o.subscribers=o.subscribers.filter((function(t){return t!==e})),o.fire=o.subscribers.reduce(n,i)}};return t[e]=r[e]=o,o}function a(e){ts(e).forEach((function(t){var r=e[t];if(rs(r))o(t,e[t][0],e[t][1]);else{if("asap"!==r)throw new qs.InvalidArgument("Invalid event config");var n=o(t,Xs,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];n.subscribers.forEach((function(e){ms((function(){e.apply(null,t)}))}))}))}}))}}var cc,lc=String.fromCharCode(65535),fc=function(){try{return IDBKeyRange.only([[]]),[[]]}catch(e){return lc}}(),hc="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",dc=[],pc="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),vc=pc,gc=pc,mc=function(e){return!/(dexie\.js|dexie\.min\.js)/.test(e)};function yc(e,t){var r,n,i,o,a,s=yc.dependencies,u=is({addons:yc.addons,autoOpen:!0,indexedDB:s.indexedDB,IDBKeyRange:s.IDBKeyRange},t),c=u.addons,l=u.autoOpen,f=u.indexedDB,h=u.IDBKeyRange,d=this._dbSchema={},p=[],v=[],g={},m=null,y=null,b=!1,w=null,k=!1,_="readwrite",S=this,x=new Cu((function(e){r=e})),E=new Cu((function(e,t){n=t})),O=!0,A=!!Ic(f);function C(e){this._cfg={version:e,storesSource:null,dbschema:{},tables:{},contentUpgrade:null},this.stores({})}function I(e,t,r){var n=S._createTransaction(_,v,d);n.create(t),n._completion.catch(r);var i=n._reject.bind(n);Zu((function(){xu.trans=n,0===e?(ts(d).forEach((function(e){T(t,e,d[e].primKey,d[e].indexes)})),Cu.follow((function(){return S.on.populate.fire(n)})).catch(i)):function(e,t,r){var n=[],i=p.filter((function(t){return t._cfg.version===e}))[0];if(!i)throw new qs.Upgrade("Dexie specification of currently installed DB version is missing");d=S._dbSchema=i._cfg.dbschema;var o=!1;function a(){return n.length?Cu.resolve(n.shift()(t.idbtrans)).then(a):Cu.resolve()}return p.filter((function(t){return t._cfg.version>e})).forEach((function(e){n.push((function(){var n=d,i=e._cfg.dbschema;J(n,r),J(i,r),d=S._dbSchema=i;var a=function(e,t){var r={del:[],add:[],change:[]};for(var n in e)t[n]||r.del.push(n);for(n in t){var i=e[n],o=t[n];if(i){var a={name:n,def:o,recreate:!1,del:[],add:[],change:[]};if(i.primKey.src!==o.primKey.src)a.recreate=!0,r.change.push(a);else{var s=i.idxByName,u=o.idxByName;for(var c in s)u[c]||a.del.push(c);for(c in u){var l=s[c],f=u[c];l?l.src!==f.src&&a.change.push(f):a.add.push(f)}(a.del.length>0||a.add.length>0||a.change.length>0)&&r.change.push(a)}}else r.add.push([n,o])}return r}(n,i);if(a.add.forEach((function(e){T(r,e[0],e[1].primKey,e[1].indexes)})),a.change.forEach((function(e){if(e.recreate)throw new qs.Upgrade("Not yet support for changing primary key");var t=r.objectStore(e.name);e.add.forEach((function(e){R(t,e)})),e.change.forEach((function(e){t.deleteIndex(e.name),R(t,e)})),e.del.forEach((function(e){t.deleteIndex(e)}))})),e._cfg.contentUpgrade)return o=!0,Cu.follow((function(){e._cfg.contentUpgrade(t)}))})),n.push((function(t){o&&vc||function(e,t){for(var r=0;r<t.db.objectStoreNames.length;++r){var n=t.db.objectStoreNames[r];null==e[n]&&t.db.deleteObjectStore(n)}}(e._cfg.dbschema,t)}))})),a().then((function(){!function(e,t){ts(e).forEach((function(r){t.db.objectStoreNames.contains(r)||T(t,r,e[r].primKey,e[r].indexes)}))}(d,r)}))}(e,n,t).catch(i)}))}function T(e,t,r,n){var i=e.db.createObjectStore(t,r.keyPath?{keyPath:r.keyPath,autoIncrement:r.auto}:{autoIncrement:r.auto});return n.forEach((function(e){R(i,e)})),i}function R(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function L(e,t,r){var n=arguments.length;if(n<2)throw new qs.InvalidArgument("Too few arguments");for(var i=new Array(n-1);--n;)i[n-1]=arguments[n];r=i.pop();var o=Es(i);return[e,o,r]}function N(e,t,r){this.name=e,this.schema=t,this._tx=r,this.hook=g[e]?g[e].hook:uc(null,{creating:[eu,Js],reading:[$s,Xs],updating:[ru,Js],deleting:[tu,Js]})}function P(e,t,r){return(r?Sc:kc)((function(r){e.push(r),t&&t()}))}function M(e,t,r,n,i){return new Cu((function(o,a){var s=r.length,u=s-1;if(0===s)return o();if(n){var c,l=Sc(a),f=wc(null);ws((function(){for(var n=0;n<s;++n){c={onsuccess:null,onerror:null};var a=r[n];i.call(c,a[0],a[1],t);var h=e.delete(a[0]);h._hookCtx=c,h.onerror=l,h.onsuccess=n===u?wc(o):f}}),(function(e){throw c.onerror&&c.onerror(e),e}))}else for(var h=0;h<s;++h){var d=e.delete(r[h]);d.onerror=kc(a),h===u&&(d.onsuccess=Hu((function(){return o()})))}}))}function j(e,t,r,n){var i=this;this.db=S,this.mode=e,this.storeNames=t,this.idbtrans=null,this.on=uc(this,"complete","error","abort"),this.parent=n||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new Cu((function(e,t){i._resolve=e,i._reject=t})),this._completion.then((function(){i.active=!1,i.on.complete.fire()}),(function(e){var t=i.active;return i.active=!1,i.on.error.fire(e),i.parent?i.parent._reject(e):t&&i.idbtrans&&i.idbtrans.abort(),sc(e)}))}function D(e,t,r){this._ctx={table:e,index:":id"===t?null:t,or:r}}function B(e,t){var r=null,n=null;if(t)try{r=t()}catch(e){n=e}var i=e._ctx,o=i.table;this._ctx={table:o,index:i.index,isPrimKey:!i.index||o.schema.primKey.keyPath&&i.index===o.schema.primKey.name,range:r,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:n,or:i.or,valueMapper:o.hook.reading.fire}}function U(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function F(e,t){return e._cfg.version-t._cfg.version}function z(e,t,r){t.forEach((function(t){var n=r[t];e.forEach((function(e){t in e||(e===j.prototype||e instanceof j?ls(e,t,{get:function(){return this.table(t)}}):e[t]=new N(t,n))}))}))}function H(e,t,r,n,i,o){var a=Hu(o?function(e,t,n){return r(o(e),t,n)}:r,i);e.onerror||(e.onerror=kc(i)),e.onsuccess=bs(t?function(){var r=e.result;if(r){var o=function(){r.continue()};t(r,(function(e){o=e}),n,i)&&a(r.value,r,(function(e){o=e})),o()}else n()}:function(){var t=e.result;if(t){var r=function(){t.continue()};a(t.value,t,(function(e){r=e})),r()}else n()},i)}function V(e,t){return f.cmp(e,t)}function W(e,t){return V(e,t)>0?e:t}function G(e,t){return f.cmp(e,t)}function K(e,t){return f.cmp(t,e)}function q(e,t){return e<t?-1:e===t?0:1}function Y(e,t){return e>t?-1:e===t?0:1}function Z(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}function J(e,t){for(var r=t.db.objectStoreNames,n=0;n<r.length;++n){var o=r[n],a=t.objectStore(o);i="getAll"in a;for(var s=0;s<a.indexNames.length;++s){var u=a.indexNames[s],c=a.index(u).keyPath,l="string"==typeof c?c:"["+ps(c).join("+")+"]";if(e[o]){var f=e[o].idxByName[l];f&&(f.name=u)}}}/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&ns.WorkerGlobalScope&&ns instanceof ns.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(i=!1)}function X(e){S.on("blocked").fire(e),dc.filter((function(e){return e.name===S.name&&e!==S&&!e._vcFired})).map((function(t){return t.on("versionchange").fire(e)}))}this.version=function(e){if(m||b)throw new qs.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=p.filter((function(t){return t._cfg.version===e}))[0];return t||(t=new C(e),p.push(t),p.sort(F),O=!1,t)},is(C.prototype,{stores:function(e){this._cfg.storesSource=this._cfg.storesSource?is(this._cfg.storesSource,e):e;var t={};p.forEach((function(e){is(t,e._cfg.storesSource)}));var r=this._cfg.dbschema={};return this._parseStoresSpec(t,r),d=S._dbSchema=r,[g,S,j.prototype].forEach((function(e){for(var t in e)e[t]instanceof N&&delete e[t]})),z([g,S,j.prototype,this._cfg.tables],ts(r),r),v=ts(r),this},upgrade:function(e){return this._cfg.contentUpgrade=e,this},_parseStoresSpec:function(e,t){ts(e).forEach((function(r){if(null!==e[r]){var n={},i=function(e){var t=[];return e.split(",").forEach((function(e){var r=(e=e.trim()).replace(/([&*]|\+\+)/g,""),n=/^\[/.test(r)?r.match(/^\[(.*)\]$/)[1].split("+"):r;t.push(new Oc(r,n||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),rs(n),/\./.test(e)))})),t}(e[r]),o=i.shift();if(o.multi)throw new qs.Schema("Primary key cannot be multi-valued");o.keyPath&&_s(n,o.keyPath,o.auto?0:o.keyPath),i.forEach((function(e){if(e.auto)throw new qs.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new qs.Schema("Index must have a name and cannot be an empty string");_s(n,e.keyPath,e.compound?e.keyPath.map((function(){return""})):"")})),t[r]=new Ac(r,o,i,n)}}))}}),this._allTables=g,this._createTransaction=function(e,t,r,n){return new j(e,t,r,n)},this._whenReady=function(e){return k||xu.letThrough?e():new Cu((function(e,t){if(!b){if(!l)return void t(new qs.DatabaseClosed);S.open().catch(Js)}x.then(e,t)})).then(e)},this.verno=0,this.open=function(){if(b||m)return x.then((function(){return y?sc(y):S}));Ns&&(E._stackHolder=Ds()),b=!0,y=null,k=!1;var t=r,n=null;return Cu.race([E,new Cu((function(t,r){if(!f)throw new qs.MissingAPI("indexedDB API not found. If using IE10+, make sure to run your code on a server URL (not locally). If using old Safari versions, make sure to include indexedDB polyfill.");var i=O?f.open(e):f.open(e,Math.round(10*S.verno));if(!i)throw new qs.MissingAPI("IndexedDB API not available");i.onerror=kc(r),i.onblocked=Hu(X),i.onupgradeneeded=Hu((function(t){if(n=i.transaction,O&&!S._allowEmptyDB){i.onerror=xc,n.abort(),i.result.close();var o=f.deleteDatabase(e);o.onsuccess=o.onerror=Hu((function(){r(new qs.NoSuchDatabase("Database "+e+" doesnt exist"))}))}else{n.onerror=kc(r),I((t.oldVersion>Math.pow(2,62)?0:t.oldVersion)/10,n,r)}}),r),i.onsuccess=Hu((function(){if(n=null,m=i.result,dc.push(S),O)!function(){if(S.verno=m.version/10,S._dbSchema=d={},0===(v=ps(m.objectStoreNames,0)).length)return;var e=m.transaction(Cc(v),"readonly");v.forEach((function(t){for(var r=e.objectStore(t),n=r.keyPath,i=n&&"string"==typeof n&&-1!==n.indexOf("."),o=new Oc(n,n||"",!1,!1,!!r.autoIncrement,n&&"string"!=typeof n,i),a=[],s=0;s<r.indexNames.length;++s){var u=r.index(r.indexNames[s]);i=(n=u.keyPath)&&"string"==typeof n&&-1!==n.indexOf(".");var c=new Oc(u.name,n,!!u.unique,!!u.multiEntry,!1,n&&"string"!=typeof n,i);a.push(c)}d[t]=new Ac(t,o,a,{})})),z([g],ts(d),d)}();else if(m.objectStoreNames.length>0)try{J(d,m.transaction(Cc(m.objectStoreNames),"readonly"))}catch(e){}m.onversionchange=Hu((function(e){S._vcFired=!0,S.on("versionchange").fire(e)})),A||"__dbnames"===e||cc.dbnames.put({name:e}).catch(Js),t()}),r)}))]).then((function(){return w=[],Cu.resolve(yc.vip(S.on.ready.fire)).then((function e(){if(w.length>0){var t=w.reduce(iu,Js);return w=[],Cu.resolve(yc.vip(t)).then(e)}}))})).finally((function(){w=null})).then((function(){return b=!1,S})).catch((function(e){try{n&&n.abort()}catch(e){}return b=!1,S.close(),sc(y=e)})).finally((function(){k=!0,t()}))},this.close=function(){var e=dc.indexOf(S);if(e>=0&&dc.splice(e,1),m){try{m.close()}catch(e){}m=null}l=!1,y=new qs.DatabaseClosed,b&&n(y),x=new Cu((function(e){r=e})),E=new Cu((function(e,t){n=t}))},this.delete=function(){var t=arguments.length>0;return new Cu((function(r,n){if(t)throw new qs.InvalidArgument("Arguments not allowed in db.delete()");function i(){S.close();var t=f.deleteDatabase(e);t.onsuccess=Hu((function(){A||cc.dbnames.delete(e).catch(Js),r()})),t.onerror=kc(n),t.onblocked=X}b?x.then(i):i()}))},this.backendDB=function(){return m},this.isOpen=function(){return null!==m},this.hasBeenClosed=function(){return y&&y instanceof qs.DatabaseClosed},this.hasFailed=function(){return null!==y},this.dynamicallyOpened=function(){return O},this.name=e,us(this,{tables:{get:function(){return ts(g).map((function(e){return g[e]}))}}}),this.on=uc(this,"populate","blocked","versionchange",{ready:[iu,Js]}),this.on.ready.subscribe=vs(this.on.ready.subscribe,(function(e){return function(t,r){yc.vip((function(){k?(y||Cu.resolve().then(t),r&&e(t)):w?(w.push(t),r&&e(t)):(e(t),r||e((function e(){S.on.ready.unsubscribe(t),S.on.ready.unsubscribe(e)})))}))}})),this.transaction=function(){var e=L.apply(this,arguments);return this._transaction.apply(this,e)},this._transaction=function(e,t,r){var n=xu.trans;n&&n.db===S&&-1===e.indexOf("!")||(n=null);var i=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{var o=t.map((function(e){var t=e instanceof N?e.name:e;if("string"!=typeof t)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t}));if("r"==e||"readonly"==e)e="readonly";else{if("rw"!=e&&e!=_)throw new qs.InvalidArgument("Invalid transaction mode: "+e);e=_}if(n){if("readonly"===n.mode&&e===_){if(!i)throw new qs.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");n=null}n&&o.forEach((function(e){if(n&&-1===n.storeNames.indexOf(e)){if(!i)throw new qs.SubTransaction("Table "+e+" not included in parent transaction.");n=null}})),i&&n&&!n.active&&(n=null)}}catch(e){return n?n._promise(null,(function(t,r){r(e)})):sc(e)}return n?n._promise(e,a,"lock"):xu.trans?nc(xu.transless,(function(){return S._whenReady(a)})):S._whenReady(a);function a(){return Cu.resolve().then((function(){var t,i=xu.transless||xu,a=S._createTransaction(e,o,d,n),s={trans:a,transless:i};n?a.idbtrans=n.idbtrans:a.create(),r.constructor===hu&&Ju();var u=Cu.follow((function(){if(t=r.call(a,a))if(t.constructor===fu){var e=Xu.bind(null,null);t.then(e,e)}else"function"==typeof t.next&&"function"==typeof t.throw&&(t=Ec(t))}),s);return(t&&"function"==typeof t.then?Cu.resolve(t).then((function(e){return a.active?e:sc(new qs.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):u.then((function(){return t}))).then((function(e){return n&&a._resolve(),a._completion.then((function(){return e}))})).catch((function(e){return a._reject(e),sc(e)}))}))}},this.table=function(e){if(!ss(g,e))throw new qs.InvalidTable("Table "+e+" does not exist");return g[e]},us(N.prototype,{_trans:function(e,t,r){var n=this._tx||xu.trans;return n&&n.db===S?n===xu.trans?n._promise(e,t,r):Zu((function(){return n._promise(e,t,r)}),{trans:n,transless:xu.transless||xu}):function e(t,r,n){if(k||xu.letThrough){var i=S._createTransaction(t,r,d);try{i.create()}catch(e){return sc(e)}return i._promise(t,(function(e,t){return Zu((function(){return xu.trans=i,n(e,t,i)}))})).then((function(e){return i._completion.then((function(){return e}))}))}if(!b){if(!l)return sc(new qs.DatabaseClosed);S.open().catch(Js)}return x.then((function(){return e(t,r,n)}))}(e,[this.name],t)},_idbstore:function(e,t,r){var n=this.name;return this._trans(e,(function(e,r,i){if(-1===i.storeNames.indexOf(n))throw new qs.NotFound("Table"+n+" not part of transaction");return t(e,r,i.idbtrans.objectStore(n),i)}),r)},get:function(e,t){if(e&&e.constructor===Object)return this.where(e).first(t);var r=this;return this._idbstore("readonly",(function(t,n,i){var o=i.get(e);o.onerror=kc(n),o.onsuccess=Hu((function(){t(r.hook.reading.fire(o.result))}),n)})).then(t)},where:function(e){if("string"==typeof e)return new D(this,e);if(rs(e))return new D(this,"["+e.join("+")+"]");var t=ts(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);var r=this.schema.indexes.concat(this.schema.primKey).filter((function(e){return e.compound&&t.every((function(t){return e.keyPath.indexOf(t)>=0}))&&e.keyPath.every((function(e){return t.indexOf(e)>=0}))}))[0];if(r&&fc!==lc)return this.where(r.name).equals(r.keyPath.map((function(t){return e[t]})));r||console.warn("The query "+JSON.stringify(e)+" on "+this.name+" would benefit of a compound index ["+t.join("+")+"]");var n=this.schema.idxByName,i=t.reduce((function(t,r){return[t[0]||n[r],t[0]||!n[r]?Z(t[1],(function(t){return""+ks(t,r)==""+e[r]})):t[1]]}),[null,null]),o=i[0];return o?this.where(o.name).equals(e[o.keyPath]).filter(i[1]):r?this.filter(i[1]):this.where(t).equals("")},count:function(e){return this.toCollection().count(e)},offset:function(e){return this.toCollection().offset(e)},limit:function(e){return this.toCollection().limit(e)},reverse:function(){return this.toCollection().reverse()},filter:function(e){return this.toCollection().and(e)},each:function(e){return this.toCollection().each(e)},toArray:function(e){return this.toCollection().toArray(e)},orderBy:function(e){return new B(new D(this,rs(e)?"["+e.join("+")+"]":e))},toCollection:function(){return new B(new D(this))},mapToClass:function(e,t){this.schema.mappedClass=e;var r=Object.create(e.prototype);t&&bc(r,t),this.schema.instanceTemplate=r;var n=function(t){if(!t)return t;var r=Object.create(e.prototype);for(var n in t)if(ss(t,n))try{r[n]=t[n]}catch(e){}return r};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=n,this.hook("reading",n),e},defineClass:function(e){return this.mapToClass(yc.defineClass(e),e)},bulkDelete:function(e){return this.hook.deleting.fire===Js?this._idbstore(_,(function(t,r,n,i){t(M(n,i,e,!1,Js))})):this.where(":id").anyOf(e).delete().then((function(){}))},bulkPut:function(e,t){var r=this;return this._idbstore(_,(function(n,i,o){if(!o.keyPath&&!r.schema.primKey.auto&&!t)throw new qs.InvalidArgument("bulkPut() with non-inbound keys requires keys array in second argument");if(o.keyPath&&t)throw new qs.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(t&&t.length!==e.length)throw new qs.InvalidArgument("Arguments objects and keys must have the same length");if(0===e.length)return n();var a,s,u=function(e){0===c.length?n(e):i(new Ws(r.name+".bulkPut(): "+c.length+" of "+l+" operations failed",c))},c=[],l=e.length,f=r;if(r.hook.creating.fire===Js&&r.hook.updating.fire===Js){s=P(c);for(var h=0,d=e.length;h<d;++h)(a=t?o.put(e[h],t[h]):o.put(e[h])).onerror=s;a.onerror=P(c,u),a.onsuccess=_c(u)}else{var p=t||o.keyPath&&e.map((function(e){return ks(e,o.keyPath)})),v=p&&ys(p,(function(t,r){return null!=t&&[t,e[r]]}));(p?f.where(":id").anyOf(p.filter((function(e){return null!=e}))).modify((function(){this.value=v[this.primKey],v[this.primKey]=null})).catch(Vs,(function(e){c=e.failures})).then((function(){for(var r=[],n=t&&[],i=p.length-1;i>=0;--i){var o=p[i];(null==o||v[o])&&(r.push(e[i]),t&&n.push(o),null!=o&&(v[o]=null))}return r.reverse(),t&&n.reverse(),f.bulkAdd(r,n)})).then((function(e){var t=p[p.length-1];return null!=t?t:e})):f.bulkAdd(e)).then(u).catch(Ws,(function(e){c=c.concat(e.failures),u()})).catch(i)}}),"locked")},bulkAdd:function(e,t){var r=this,n=this.hook.creating.fire;return this._idbstore(_,(function(i,o,a,s){if(!a.keyPath&&!r.schema.primKey.auto&&!t)throw new qs.InvalidArgument("bulkAdd() with non-inbound keys requires keys array in second argument");if(a.keyPath&&t)throw new qs.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(t&&t.length!==e.length)throw new qs.InvalidArgument("Arguments objects and keys must have the same length");if(0===e.length)return i();function u(e){0===h.length?i(e):o(new Ws(r.name+".bulkAdd(): "+h.length+" of "+d+" operations failed",h))}var c,l,f,h=[],d=e.length;if(n!==Js){var p,v=a.keyPath;l=P(h,null,!0),f=wc(null),ws((function(){for(var r=0,i=e.length;r<i;++r){p={onerror:null,onsuccess:null};var o=t&&t[r],u=e[r],h=t?o:v?ks(u,v):void 0,d=n.call(p,h,u,s);null==h&&null!=d&&(v?_s(u=As(u),v,d):o=d),(c=null!=o?a.add(u,o):a.add(u))._hookCtx=p,r<i-1&&(c.onerror=l,p.onsuccess&&(c.onsuccess=f))}}),(function(e){throw p.onerror&&p.onerror(e),e})),c.onerror=P(h,u,!0),c.onsuccess=wc(u)}else{l=P(h);for(var g=0,m=e.length;g<m;++g)(c=t?a.add(e[g],t[g]):a.add(e[g])).onerror=l;c.onerror=P(h,u),c.onsuccess=_c(u)}}))},add:function(e,t){var r=this.hook.creating.fire;return this._idbstore(_,(function(n,i,o,a){var s={onsuccess:null,onerror:null};if(r!==Js){var u=null!=t?t:o.keyPath?ks(e,o.keyPath):void 0,c=r.call(s,u,e,a);null==u&&null!=c&&(o.keyPath?_s(e,o.keyPath,c):t=c)}try{var l=null!=t?o.add(e,t):o.add(e);l._hookCtx=s,l.onerror=Sc(i),l.onsuccess=wc((function(t){var r=o.keyPath;r&&_s(e,r,t),n(t)}))}catch(e){throw s.onerror&&s.onerror(e),e}}))},put:function(e,t){var r=this,n=this.hook.creating.fire,i=this.hook.updating.fire;if(n!==Js||i!==Js){var o=this.schema.primKey.keyPath,a=void 0!==t?t:o&&ks(e,o);return null==a?this.add(e):(e=As(e),this._trans(_,(function(){return r.where(":id").equals(a).modify((function(){this.value=e})).then((function(n){return 0===n?r.add(e,t):a}))}),"locked"))}return this._idbstore(_,(function(r,n,i){var o=void 0!==t?i.put(e,t):i.put(e);o.onerror=kc(n),o.onsuccess=Hu((function(t){var n=i.keyPath;n&&_s(e,n,t.target.result),r(o.result)}))}))},delete:function(e){return this.hook.deleting.subscribers.length?this.where(":id").equals(e).delete():this._idbstore(_,(function(t,r,n){var i=n.delete(e);i.onerror=kc(r),i.onsuccess=Hu((function(){t(i.result)}))}))},clear:function(){return this.hook.deleting.subscribers.length?this.toCollection().delete():this._idbstore(_,(function(e,t,r){var n=r.clear();n.onerror=kc(t),n.onsuccess=Hu((function(){e(n.result)}))}))},update:function(e,t){if("object"!=typeof t||rs(t))throw new qs.InvalidArgument("Modifications must be an object.");if("object"!=typeof e||rs(e))return this.where(":id").equals(e).modify(t);ts(t).forEach((function(r){_s(e,r,t[r])}));var r=ks(e,this.schema.primKey.keyPath);return void 0===r?sc(new qs.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(r).modify(t)}}),us(j.prototype,{_lock:function(){return gs(!xu.global),++this._reculock,1!==this._reculock||xu.global||(xu.lockOwnerFor=this),this},_unlock:function(){if(gs(!xu.global),0==--this._reculock)for(xu.global||(xu.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{nc(e[1],e[0])}catch(e){}}return this},_locked:function(){return this._reculock&&xu.lockOwnerFor!==this},create:function(e){var t=this;if(!this.mode)return this;if(gs(!this.idbtrans),!e&&!m)switch(y&&y.name){case"DatabaseClosedError":throw new qs.DatabaseClosed(y);case"MissingAPIError":throw new qs.MissingAPI(y.message,y);default:throw new qs.OpenFailed(y)}if(!this.active)throw new qs.TransactionInactive;return gs(null===this._completion._state),(e=this.idbtrans=e||m.transaction(Cc(this.storeNames),this.mode)).onerror=Hu((function(r){xc(r),t._reject(e.error)})),e.onabort=Hu((function(r){xc(r),t.active&&t._reject(new qs.Abort(e.error)),t.active=!1,t.on("abort").fire(r)})),e.oncomplete=Hu((function(){t.active=!1,t._resolve()})),this},_promise:function(e,t,r){var n=this;if(e===_&&this.mode!==_)return sc(new qs.ReadOnly("Transaction is readonly"));if(!this.active)return sc(new qs.TransactionInactive);if(this._locked())return new Cu((function(i,o){n._blockedFuncs.push([function(){n._promise(e,t,r).then(i,o)},xu])}));if(r)return Zu((function(){var e=new Cu((function(e,r){n._lock();var i=t(e,r,n);i&&i.then&&i.then(e,r)}));return e.finally((function(){return n._unlock()})),e._lib=!0,e}));var i=new Cu((function(e,r){var i=t(e,r,n);i&&i.then&&i.then(e,r)}));return i._lib=!0,i},_root:function(){return this.parent?this.parent._root():this},waitFor:function(e){var t=this._root();if(e=Cu.resolve(e),t._waitingFor)t._waitingFor=t._waitingFor.then((function(){return e}));else{t._waitingFor=e,t._waitingQueue=[];var r=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(r.get(-1/0).onsuccess=e)}()}var n=t._waitingFor;return new Cu((function(r,i){e.then((function(e){return t._waitingQueue.push(Hu(r.bind(null,e)))}),(function(e){return t._waitingQueue.push(Hu(i.bind(null,e)))})).finally((function(){t._waitingFor===n&&(t._waitingFor=null)}))}))},abort:function(){this.active&&this._reject(new qs.Abort),this.active=!1},tables:{get:(o="Transaction.tables",a=function(){return g},function(){return console.warn(o+" is deprecated. See https://github.com/dfahlander/Dexie.js/wiki/Deprecations. "+Bs(Ds(),1)),a.apply(this,arguments)})},table:function(e){return new N(e,S.table(e).schema,this)}}),us(D.prototype,(function(){function e(e,t,r){var n=e instanceof D?new B(e):e;return n._ctx.error=r?new r(t):new TypeError(t),n}function t(e){return new B(e,(function(){return h.only("")})).limit(0)}function r(e,t,r,n,i,o){for(var a=Math.min(e.length,n.length),s=-1,u=0;u<a;++u){var c=t[u];if(c!==n[u])return i(e[u],r[u])<0?e.substr(0,u)+r[u]+r.substr(u+1):i(e[u],n[u])<0?e.substr(0,u)+n[u]+r.substr(u+1):s>=0?e.substr(0,s)+t[s]+r.substr(s+1):null;i(e[u],c)<0&&(s=u)}return a<n.length&&"next"===o?e+r.substr(e.length):a<e.length&&"prev"===o?e.substr(0,r.length):s<0?null:e.substr(0,s)+n[s]+r.substr(s+1)}function n(t,n,i,o){var a,s,u,c,l,f,d,p=i.length;if(!i.every((function(e){return"string"==typeof e})))return e(t,"String expected.");function v(e){a=function(e){return"next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()}}(e),s=function(e){return"next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()}}(e),u="next"===e?q:Y;var t=i.map((function(e){return{lower:s(e),upper:a(e)}})).sort((function(e,t){return u(e.lower,t.lower)}));c=t.map((function(e){return e.upper})),l=t.map((function(e){return e.lower})),f=e,d="next"===e?"":o}v("next");var g=new B(t,(function(){return h.bound(c[0],l[p-1]+o)}));g._ondirectionchange=function(e){v(e)};var m=0;return g._addAlgorithm((function(e,t,i){var o=e.key;if("string"!=typeof o)return!1;var a=s(o);if(n(a,l,m))return!0;for(var h=null,v=m;v<p;++v){var g=r(o,a,c[v],l[v],u,f);null===g&&null===h?m=v+1:(null===h||u(h,g)>0)&&(h=g)}return t(null!==h?function(){e.continue(h+d)}:i),!1})),g}return{between:function(r,n,i,o){i=!1!==i,o=!0===o;try{return V(r,n)>0||0===V(r,n)&&(i||o)&&(!i||!o)?t(this):new B(this,(function(){return h.bound(r,n,!i,!o)}))}catch(t){return e(this,hc)}},equals:function(e){return new B(this,(function(){return h.only(e)}))},above:function(e){return new B(this,(function(){return h.lowerBound(e,!0)}))},aboveOrEqual:function(e){return new B(this,(function(){return h.lowerBound(e)}))},below:function(e){return new B(this,(function(){return h.upperBound(e,!0)}))},belowOrEqual:function(e){return new B(this,(function(){return h.upperBound(e)}))},startsWith:function(t){return"string"!=typeof t?e(this,"String expected."):this.between(t,t+lc,!0,!0)},startsWithIgnoreCase:function(e){return""===e?this.startsWith(e):n(this,(function(e,t){return 0===e.indexOf(t[0])}),[e],lc)},equalsIgnoreCase:function(e){return n(this,(function(e,t){return e===t[0]}),[e],"")},anyOfIgnoreCase:function(){var e=Ls.apply(Rs,arguments);return 0===e.length?t(this):n(this,(function(e,t){return-1!==t.indexOf(e)}),e,"")},startsWithAnyOfIgnoreCase:function(){var e=Ls.apply(Rs,arguments);return 0===e.length?t(this):n(this,(function(e,t){return t.some((function(t){return 0===e.indexOf(t)}))}),e,lc)},anyOf:function(){var r=Ls.apply(Rs,arguments),n=G;try{r.sort(n)}catch(t){return e(this,hc)}if(0===r.length)return t(this);var i=new B(this,(function(){return h.bound(r[0],r[r.length-1])}));i._ondirectionchange=function(e){n="next"===e?G:K,r.sort(n)};var o=0;return i._addAlgorithm((function(e,t,i){for(var a=e.key;n(a,r[o])>0;)if(++o===r.length)return t(i),!1;return 0===n(a,r[o])||(t((function(){e.continue(r[o])})),!1)})),i},notEqual:function(e){return this.inAnyRange([[-1/0,e],[e,fc]],{includeLowers:!1,includeUppers:!1})},noneOf:function(){var t=Ls.apply(Rs,arguments);if(0===t.length)return new B(this);try{t.sort(G)}catch(t){return e(this,hc)}var r=t.reduce((function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]]}),null);return r.push([t[t.length-1],fc]),this.inAnyRange(r,{includeLowers:!1,includeUppers:!1})},inAnyRange:function(r,n){if(0===r.length)return t(this);if(!r.every((function(e){return void 0!==e[0]&&void 0!==e[1]&&G(e[0],e[1])<=0})))return e(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",qs.InvalidArgument);var i=!n||!1!==n.includeLowers,o=n&&!0===n.includeUppers;var a,s=G;function u(e,t){return s(e[0],t[0])}try{(a=r.reduce((function(e,t){for(var r=0,n=e.length;r<n;++r){var i=e[r];if(V(t[0],i[1])<0&&V(t[1],i[0])>0){i[0]=(o=i[0],a=t[0],V(o,a)<0?o:a),i[1]=W(i[1],t[1]);break}}var o,a;return r===n&&e.push(t),e}),[])).sort(u)}catch(t){return e(this,hc)}var c=0,l=o?function(e){return G(e,a[c][1])>0}:function(e){return G(e,a[c][1])>=0},f=i?function(e){return K(e,a[c][0])>0}:function(e){return K(e,a[c][0])>=0};var d=l,p=new B(this,(function(){return h.bound(a[0][0],a[a.length-1][1],!i,!o)}));return p._ondirectionchange=function(e){"next"===e?(d=l,s=G):(d=f,s=K),a.sort(u)},p._addAlgorithm((function(e,t,r){for(var n=e.key;d(n);)if(++c===a.length)return t(r),!1;return!!function(e){return!l(e)&&!f(e)}(n)||(0===V(n,a[c][1])||0===V(n,a[c][0])||t((function(){s===G?e.continue(a[c][0]):e.continue(a[c][1])})),!1)})),p},startsWithAnyOf:function(){var r=Ls.apply(Rs,arguments);return r.every((function(e){return"string"==typeof e}))?0===r.length?t(this):this.inAnyRange(r.map((function(e){return[e,e+lc]}))):e(this,"startsWithAnyOf() only works with strings")}}})),us(B.prototype,(function(){function e(e,t){e.filter=Z(e.filter,t)}function t(e,t,r){var n=e.replayFilter;e.replayFilter=n?function(){return Z(n(),t())}:t,e.justLimit=r&&!n}function r(e,t){if(e.isPrimKey)return t;var r=e.table.schema.idxByName[e.index];if(!r)throw new qs.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return t.index(r.name)}function n(e,t){var n=r(e,t);return e.keysOnly&&"openKeyCursor"in n?n.openKeyCursor(e.range||null,e.dir+e.unique):n.openCursor(e.range||null,e.dir+e.unique)}function o(e,t,r,i,o){var a=e.replayFilter?Z(e.filter,e.replayFilter()):e.filter;e.or?function(){var s={},u=0;function c(){2==++u&&r()}function l(e,r,n){if(!a||a(r,n,c,i)){var o=r.primaryKey,u=""+o;"[object ArrayBuffer]"===u&&(u=""+new Uint8Array(o)),ss(s,u)||(s[u]=!0,t(e,r,n))}}e.or._iterate(l,c,i,o),H(n(e,o),e.algorithm,l,c,i,!e.keysOnly&&e.valueMapper)}():H(n(e,o),Z(e.algorithm,a),t,r,i,!e.keysOnly&&e.valueMapper)}return{_read:function(e,t){var r=this._ctx;return r.error?r.table._trans(null,sc.bind(null,r.error)):r.table._idbstore("readonly",e).then(t)},_write:function(e){var t=this._ctx;return t.error?t.table._trans(null,sc.bind(null,t.error)):t.table._idbstore(_,e,"locked")},_addAlgorithm:function(e){var t=this._ctx;t.algorithm=Z(t.algorithm,e)},_iterate:function(e,t,r,n){return o(this._ctx,e,t,r,n)},clone:function(e){var t=Object.create(this.constructor.prototype),r=Object.create(this._ctx);return e&&is(r,e),t._ctx=r,t},raw:function(){return this._ctx.valueMapper=null,this},each:function(e){var t=this._ctx;return this._read((function(r,n,i){o(t,e,r,n,i)}))},count:function(e){var t=this._ctx;if(U(t,!0))return this._read((function(e,n,i){var o=r(t,i),a=t.range?o.count(t.range):o.count();a.onerror=kc(n),a.onsuccess=function(r){e(Math.min(r.target.result,t.limit))}}),e);var n=0;return this._read((function(e,r,i){o(t,(function(){return++n,!1}),(function(){e(n)}),r,i)}),e)},sortBy:function(e,t){var r=e.split(".").reverse(),n=r[0],i=r.length-1;function o(e,t){return t?o(e[r[t]],t-1):e[n]}var a="next"===this._ctx.dir?1:-1;function s(e,t){var r=o(e,i),n=o(t,i);return r<n?-a:r>n?a:0}return this.toArray((function(e){return e.sort(s)})).then(t)},toArray:function(e){var t=this._ctx;return this._read((function(e,n,a){if(i&&"next"===t.dir&&U(t,!0)&&t.limit>0){var s=t.table.hook.reading.fire,u=r(t,a),c=t.limit<1/0?u.getAll(t.range,t.limit):u.getAll(t.range);c.onerror=kc(n),c.onsuccess=_c(s===Xs?e:function(t){try{e(t.map(s))}catch(e){n(e)}})}else{var l=[];o(t,(function(e){l.push(e)}),(function(){e(l)}),n,a)}}),e)},offset:function(e){var r=this._ctx;return e<=0||(r.offset+=e,U(r)?t(r,(function(){var t=e;return function(e,r){return 0===t||(1===t?(--t,!1):(r((function(){e.advance(t),t=0})),!1))}})):t(r,(function(){var t=e;return function(){return--t<0}}))),this},limit:function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),t(this._ctx,(function(){var t=e;return function(e,r,n){return--t<=0&&r(n),t>=0}}),!0),this},until:function(t,r){return e(this._ctx,(function(e,n,i){return!t(e.value)||(n(i),r)})),this},first:function(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)},last:function(e){return this.reverse().first(e)},filter:function(t){return e(this._ctx,(function(e){return t(e.value)})),function(e,t){e.isMatch=Z(e.isMatch,t)}(this._ctx,t),this},and:function(e){return this.filter(e)},or:function(e){return new D(this._ctx.table,e,this)},reverse:function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},desc:function(){return this.reverse()},eachKey:function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,r){e(r.key,r)}))},eachUniqueKey:function(e){return this._ctx.unique="unique",this.eachKey(e)},eachPrimaryKey:function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,r){e(r.primaryKey,r)}))},keys:function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var r=[];return this.each((function(e,t){r.push(t.key)})).then((function(){return r})).then(e)},primaryKeys:function(e){var t=this._ctx;if(i&&"next"===t.dir&&U(t,!0)&&t.limit>0)return this._read((function(e,n,i){var o=r(t,i),a=t.limit<1/0?o.getAllKeys(t.range,t.limit):o.getAllKeys(t.range);a.onerror=kc(n),a.onsuccess=_c(e)})).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.primaryKey)})).then((function(){return n})).then(e)},uniqueKeys:function(e){return this._ctx.unique="unique",this.keys(e)},firstKey:function(e){return this.limit(1).keys((function(e){return e[0]})).then(e)},lastKey:function(e){return this.reverse().firstKey(e)},distinct:function(){var t=this._ctx,r=t.index&&t.table.schema.idxByName[t.index];if(!r||!r.multi)return this;var n={};return e(this._ctx,(function(e){var t=e.primaryKey.toString(),r=ss(n,t);return n[t]=!0,!r})),this},modify:function(e){var t=this,r=this._ctx.table.hook,n=r.updating.fire,i=r.deleting.fire;return this._write((function(r,o,a,s){var u;if("function"==typeof e)u=n===Js&&i===Js?e:function(t){var r=As(t);if(!1===e.call(this,t,this))return!1;if(ss(this,"value")){var o=Cs(r,this.value),a=n.call(this,o,this.primKey,r,s);a&&(t=this.value,ts(a).forEach((function(e){_s(t,e,a[e])})))}else i.call(this,this.primKey,t,s)};else if(n===Js){var c=ts(e),l=c.length;u=function(t){for(var r=!1,n=0;n<l;++n){var i=c[n],o=e[i];ks(t,i)!==o&&(_s(t,i,o),r=!0)}return r}}else{var f=e;e=Ss(f),u=function(t){var r=!1,i=n.call(this,e,this.primKey,As(t),s);return i&&is(e,i),ts(e).forEach((function(n){var i=e[n];ks(t,n)!==i&&(_s(t,n,i),r=!0)})),i&&(e=Ss(f)),r}}var h=0,d=0,p=!1,v=[],g=[],m=null;function y(e){return e&&(v.push(e),g.push(m)),o(new Vs("Error modifying one or more objects",v,d,g))}function b(){p&&d+v.length===h&&(v.length>0?y():r(d))}t.clone().raw()._iterate((function(e,t){m=t.primaryKey;var r={primKey:t.primaryKey,value:e,onsuccess:null,onerror:null};function n(e){return v.push(e),g.push(r.primKey),b(),!0}if(!1!==u.call(r,e,r)){var i=!ss(r,"value");++h,ws((function(){var e=i?t.delete():t.update(r.value);e._hookCtx=r,e.onerror=Sc(n),e.onsuccess=wc((function(){++d,b()}))}),n)}else r.onsuccess&&r.onsuccess(r.value)}),(function(){p=!0,b()}),y,a)}))},delete:function(){var e=this,t=this._ctx,r=t.range,n=t.table.hook.deleting.fire,i=n!==Js;if(!i&&U(t)&&(t.isPrimKey&&!gc||!r))return this._write((function(e,t,n){var i=kc(t),o=r?n.count(r):n.count();o.onerror=i,o.onsuccess=function(){var a=o.result;ws((function(){var t=r?n.delete(r):n.clear();t.onerror=i,t.onsuccess=function(){return e(a)}}),(function(e){return t(e)}))}}));var o=i?2e3:1e4;return this._write((function(r,a,s,u){var c=0,l=e.clone({keysOnly:!t.isMatch&&!i}).distinct().limit(o).raw(),f=[],h=function(){return l.each(i?function(e,t){f.push([t.primaryKey,t.value])}:function(e,t){f.push(t.primaryKey)}).then((function(){return i?f.sort((function(e,t){return G(e[0],t[0])})):f.sort(G),M(s,u,f,i,n)})).then((function(){var e=f.length;return c+=e,f=[],e<o?c:h()}))};r(h())}))}}})),is(this,{Collection:B,Table:N,Transaction:j,Version:C,WhereClause:D}),S.on("versionchange",(function(e){e.newVersion>0?console.warn("Another connection wants to upgrade database '"+S.name+"'. Closing db now to resume the upgrade."):console.warn("Another connection wants to delete database '"+S.name+"'. Closing db now to resume the delete request."),S.close()})),S.on("blocked",(function(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn("Dexie.delete('"+S.name+"') was blocked"):console.warn("Upgrade '"+S.name+"' blocked by other connection holding version "+e.oldVersion/10)})),c.forEach((function(e){e(S)}))}function bc(e,t){return ts(t).forEach((function(r){var n=function e(t){if("function"==typeof t)return new t;if(rs(t))return[e(t[0])];if(t&&"object"==typeof t){var r={};return bc(r,t),r}return t}(t[r]);e[r]=n})),e}function wc(e){return Hu((function(t){var r=t.target,n=r._hookCtx,i=n.value||r.result,o=n&&n.onsuccess;o&&o(i),e&&e(i)}),e)}function kc(e){return Hu((function(t){return xc(t),e(t.target.error),!1}))}function _c(e){return Hu((function(t){e(t.target.result)}))}function Sc(e){return Hu((function(t){var r=t.target,n=r.error,i=r._hookCtx,o=i&&i.onerror;return o&&o(n),xc(t),e(n),!1}))}function xc(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}function Ec(e){var t=function(t){return e.next(t)},r=i(t),n=i((function(t){return e.throw(t)}));function i(e){return function(t){var i=e(t),o=i.value;return i.done?o:o&&"function"==typeof o.then?o.then(r,n):rs(o)?Cu.all(o).then(r,n):r(o)}}return i(t)()}function Oc(e,t,r,n,i,o,a){this.name=e,this.keyPath=t,this.unique=r,this.multi=n,this.auto=i,this.compound=o,this.dotted=a;var s="string"==typeof t?t:t&&"["+[].join.call(t,"+")+"]";this.src=(r?"&":"")+(n?"*":"")+(i?"++":"")+s}function Ac(e,t,r,n){this.name=e,this.primKey=t||new Oc,this.indexes=r||[new Oc],this.instanceTemplate=n,this.mappedClass=null,this.idxByName=ys(r,(function(e){return[e.name,e]}))}function Cc(e){return 1===e.length?e[0]:e}function Ic(e){var t=e&&(e.getDatabaseNames||e.webkitGetDatabaseNames);return t&&t.bind(e)}Ps(Ns,mc),us(yc,Zs),us(yc,{delete:function(e){var t=new yc(e),r=t.delete();return r.onblocked=function(e){return t.on("blocked",e),this},r},exists:function(e){return new yc(e).open().then((function(e){return e.close(),!0})).catch(yc.NoSuchDatabaseError,(function(){return!1}))},getDatabaseNames:function(e){var t=Ic(yc.dependencies.indexedDB);return t?new Cu((function(e,r){var n=t();n.onsuccess=function(t){e(ps(t.target.result,0))},n.onerror=kc(r)})).then(e):cc.dbnames.toCollection().primaryKeys(e)},defineClass:function(){return function(e){e&&is(this,e)}},applyStructure:bc,ignoreTransaction:function(e){return xu.trans?nc(xu.transless,e):e()},vip:function(e){return Zu((function(){return xu.letThrough=!0,e()}))},async:function(e){return function(){try{var t=Ec(e.apply(this,arguments));return t&&"function"==typeof t.then?t:Cu.resolve(t)}catch(e){return sc(e)}}},spawn:function(e,t,r){try{var n=Ec(e.apply(r,t||[]));return n&&"function"==typeof n.then?n:Cu.resolve(n)}catch(e){return sc(e)}},currentTransaction:{get:function(){return xu.trans||null}},waitFor:function(e,t){var r=Cu.resolve("function"==typeof e?yc.ignoreTransaction(e):e).timeout(t||6e4);return xu.trans?xu.trans.waitFor(r):r},Promise:Cu,debug:{get:function(){return Ns},set:function(e){Ps(e,"dexie"===e?function(){return!0}:mc)}},derive:fs,extend:is,props:us,override:vs,Events:uc,getByKeyPath:ks,setByKeyPath:_s,delByKeyPath:function(e,t){"string"==typeof t?_s(e,t,void 0):"length"in t&&[].map.call(t,(function(t){_s(e,t,void 0)}))},shallowClone:Ss,deepClone:As,getObjectDiff:Cs,asap:ms,maxKey:fc,minKey:-1/0,addons:[],connections:dc,MultiModifyError:qs.Modify,errnames:Gs,IndexSpec:Oc,TableSchema:Ac,dependencies:function(){try{return{indexedDB:ns.indexedDB||ns.mozIndexedDB||ns.webkitIndexedDB||ns.msIndexedDB,IDBKeyRange:ns.IDBKeyRange||ns.webkitIDBKeyRange}}catch(e){return{indexedDB:null,IDBKeyRange:null}}}(),semVer:"{version}",version:"{version}".split(".").map((function(e){return parseInt(e)})).reduce((function(e,t,r){return e+t/Math.pow(10,2*r)})),default:yc,Dexie:yc}),Cu.rejectionMapper=function(e,t){if(!e||e instanceof Hs||e instanceof TypeError||e instanceof SyntaxError||!e.name||!Ys[e.name])return e;var r=new Ys[e.name](t||e.message,e);return"stack"in e&&ls(r,"stack",{get:function(){return this.inner.stack}}),r},(cc=new yc("__dbnames")).version(1).stores({dbnames:"name"}),function(){try{void 0!==typeof localStorage&&void 0!==ns.document&&(JSON.parse(localStorage.getItem("Dexie.DatabaseNames")||"[]").forEach((function(e){return cc.dbnames.put({name:e}).catch(Js)})),localStorage.removeItem("Dexie.DatabaseNames"))}catch(e){}}();var Tc={storage:window.localStorage,set:function(e,t){if(t){var r=Rc(t)||"";this.storage.setItem(e,r)}},get:function(e){if(e){var t=this.storage.getItem(e),r=t||"";try{r=JSON.parse(r)}catch(e){r=t||""}return r}},remove:function(e){e&&this.storage.removeItem(e)},clear:function(){this.storage.clear()},removeList:function(e){var t,r=ri(e);try{for(r.s();!(t=r.n()).done;){var n=t.value;this.storage.removeItem(n)}}catch(e){r.e(e)}finally{r.f()}}},Rc=function(e){if(e){var t=Object.prototype.toString.call(e);return"[object Object]"===t||"[object Array]"===t?JSON.stringify(e):e}};function Lc(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}function Nc(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function Pc(e){return[e.schema.primKey].concat(e.schema.indexes).map((function(e){return e.src})).join(",")}function Mc(e,t){return new Promise((function(r,n){var i=new FileReader;i.onabort=function(e){return n(new Error("file read aborted"))},i.onerror=function(e){return n(e.target.error)},i.onload=function(e){return r(e.target.result)},"binary"===t?i.readAsArrayBuffer(e):i.readAsText(e)}))}function jc(e,t){if("undefined"==typeof FileReaderSync)throw new Error("FileReaderSync missing. Reading blobs synchronously requires code to run from within a web worker. Use TSON.encapsulateAsync() to do it from the main thread.");var r=new FileReaderSync;return"binary"===t?r.readAsArrayBuffer(e):r.readAsText(e)}var Dc="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Bc(e,t){return e(t={exports:{}},t.exports),t.exports}for(var Uc=Bc((function(e,t){e.exports=function(){var e="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},t=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},r=Object.keys,n=Array.isArray,i={}.toString,o=Object.getPrototypeOf,a={}.hasOwnProperty,s=a.toString,u=["type","replaced","iterateIn","iterateUnsetNumeric"];function c(e,t){return p.isObject(e)&&"function"==typeof e.then&&(!t||"function"==typeof e.catch)}function l(e){return i.call(e).slice(8,-1)}function f(t,r){if(!t||"object"!==(void 0===t?"undefined":e(t)))return!1;var n=o(t);if(!n)return!1;var i=a.call(n,"constructor")&&n.constructor;return"function"!=typeof i?null===r:"function"==typeof i&&null!==r&&s.call(i)===s.call(r)}function h(e){return!(!e||"Object"!==l(e))&&(!o(e)||f(e,Object))}function d(t){return t&&"object"===(void 0===t?"undefined":e(t))}function p(i){var o=[],a=[],s={},l=this.types={},m=this.stringify=function(e,t,r,o){o=Object.assign({},i,o,{stringification:!0});var a=_(e,null,o);return n(a)?JSON.stringify(a[0],t,r):a.then((function(e){return JSON.stringify(e,t,r)}))};this.stringifySync=function(e,t,r,n){return m(e,t,r,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!0}))},this.stringifyAsync=function(e,t,r,n){return m(e,t,r,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!1}))};var k=this.parse=function(e,t,r){return r=Object.assign({},i,r,{parse:!0}),S(JSON.parse(e,t),r)};this.parseSync=function(e,t,r){return k(e,t,Object.assign({},{throwOnBadSyncType:!0},r,{sync:!0}))},this.parseAsync=function(e,t,r){return k(e,t,Object.assign({},{throwOnBadSyncType:!0},r,{sync:!1}))},this.specialTypeNames=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.returnTypeNames=!0,this.encapsulate(e,t,r)},this.rootTypeName=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.iterateNone=!0,this.encapsulate(e,t,r)};var _=this.encapsulate=function(c,l,v){var m=(v=Object.assign({sync:!0},i,v)).sync,y={},b=[],k=[],_=[],S=!(v&&"cyclic"in v)||v.cyclic,x=v.encapsulateObserver,E=C("",c,S,l||{},_);function O(e){var t=Object.values(y);if(v.iterateNone)return t.length?t[0]:p.getJSONType(e);if(t.length){if(v.returnTypeNames)return[].concat(function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}(new Set(t)));e&&h(e)&&!e.hasOwnProperty("$types")?e.$types=y:e={$:e,$types:{$:y}}}else d(e)&&e.hasOwnProperty("$types")&&(e={$:e,$types:!0});return!v.returnTypeNames&&e}return _.length?m&&v.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():Promise.resolve(function e(r,n){return Promise.all(n.map((function(e){return e[1].p}))).then((function(i){return Promise.all(i.map((function(i){var o=[],a=n.splice(0,1)[0],s=t(a,7),u=s[0],c=s[2],l=s[3],h=s[4],d=s[5],p=s[6],v=C(u,i,c,l,o,!0,p),g=f(v,w);return u&&g?v.p.then((function(t){return h[d]=t,e(r,o)})):(u?h[d]=v:r=g?v.p:v,e(r,o))})))})).then((function(){return r}))}(E,_)).then(O):!m&&v.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():v.stringification&&m?[O(E)]:m?O(E):Promise.resolve(O(E));function A(e,t,r){Object.assign(e,t);var n=u.map((function(t){var r=e[t];return delete e[t],r}));r(),u.forEach((function(t,r){e[t]=n[r]}))}function C(t,i,a,s,u,c,l){var d=void 0,m={},_=void 0===i?"undefined":e(i),S=x?function(e){var r=l||s.type||p.getJSONType(i);x(Object.assign(e||m,{keypath:t,value:i,cyclic:a,stateObj:s,promisesData:u,resolvingTypesonPromise:c,awaitingTypesonPromise:f(i,w)},void 0!==r?{type:r}:{}))}:null;if(_ in{string:1,boolean:1,number:1,undefined:1})return void 0===i||"number"===_&&(isNaN(i)||i===-1/0||i===1/0)?(d=I(t,i,s,u,!1,c,S))!==i&&(m={replaced:d}):d=i,S&&S(),d;if(null===i)return S&&S(),i;if(a&&!s.iterateIn&&!s.iterateUnsetNumeric){var E=b.indexOf(i);if(!(E<0))return y[t]="#",S&&S({cyclicKeypath:k[E]}),"#"+k[E];!0===a&&(b.push(i),k.push(t))}var O=h(i),T=n(i),R=(O||T)&&(!o.length||s.replaced)||s.iterateIn?i:I(t,i,s,u,O||T,null,S),L=void 0;if(R!==i?(d=R,m={replaced:R}):T||"array"===s.iterateIn?(L=new Array(i.length),m={clone:L}):O||"object"===s.iterateIn?m={clone:L={}}:""===t&&f(i,w)?(u.push([t,i,a,s,void 0,void 0,s.type]),d=i):d=i,S&&S(),v.iterateNone)return L||d;if(!L)return d;if(s.iterateIn){var N=function(e){var r={ownKeys:i.hasOwnProperty(e)};A(s,r,(function(){var r=t+(t?".":"")+g(e),n=C(r,i[e],!!a,s,u,c);f(n,w)?u.push([r,n,!!a,s,L,e,s.type]):void 0!==n&&(L[e]=n)}))};for(var P in i)N(P);S&&S({endIterateIn:!0,end:!0})}else r(i).forEach((function(e){var r=t+(t?".":"")+g(e);A(s,{ownKeys:!0},(function(){var t=C(r,i[e],!!a,s,u,c);f(t,w)?u.push([r,t,!!a,s,L,e,s.type]):void 0!==t&&(L[e]=t)}))})),S&&S({endIterateOwn:!0,end:!0});if(s.iterateUnsetNumeric){for(var M=i.length,j=function(e){if(!(e in i)){var r=t+(t?".":"")+e;A(s,{ownKeys:!1},(function(){var t=C(r,void 0,!!a,s,u,c);f(t,w)?u.push([r,t,!!a,s,L,e,s.type]):void 0!==t&&(L[e]=t)}))}},D=0;D<M;D++)j(D);S&&S({endIterateUnsetNumeric:!0,end:!0})}return L}function I(e,t,r,n,i,u,c){for(var l=i?o:a,f=l.length;f--;){var h=l[f];if(h.test(t,r)){var d=h.type;if(s[d]){var p=y[e];y[e]=p?[d].concat(p):d}return Object.assign(r,{type:d,replaced:!0}),!m&&h.replaceAsync||h.replace?(c&&c({replacing:!0}),C(e,h[m||!h.replaceAsync?"replace":"replaceAsync"](t,r),S&&"readonly",r,n,u,d)):(c&&c({typeDetected:!0}),C(e,t,S&&"readonly",r,n,u,d))}}return t}};this.encapsulateSync=function(e,t,r){return _(e,t,Object.assign({},{throwOnBadSyncType:!0},r,{sync:!0}))},this.encapsulateAsync=function(e,t,r){return _(e,t,Object.assign({},{throwOnBadSyncType:!0},r,{sync:!1}))};var S=this.revive=function(e,o){var a=(o=Object.assign({sync:!0},i,o)).sync,u=e&&e.$types,l=!0;if(!u)return e;if(!0===u)return e.$;u.$&&h(u.$)&&(e=e.$,u=u.$,l=!1);var d=[],p={},v=function e(i,o,a,c,v,m){if(!l||"$types"!==i){var w=u[i];if(n(o)||h(o)){var k=n(o)?new Array(o.length):{};for(r(o).forEach((function(t){var r=e(i+(i?".":"")+g(t),o[t],a||k,c,k,t);f(r,b)?k[t]=void 0:void 0!==r&&(k[t]=r)})),o=k;d.length;){var _=t(d[0],4),S=_[0],x=_[1],E=_[2],O=_[3],A=y(S,x);if(f(A,b))E[O]=void 0;else{if(void 0===A)break;E[O]=A}d.splice(0,1)}}if(!w)return o;if("#"===w){var C=y(a,o.substr(1));return void 0===C&&d.push([a,o.substr(1),v,m]),C}var I=c.sync;return[].concat(w).reduce((function(e,t){var r=s[t];if(!r)throw new Error("Unregistered type: "+t);return r[I&&r.revive?"revive":!I&&r.reviveAsync?"reviveAsync":"revive"](e,p)}),o)}}("",e,null,o);return c(v=f(v,b)?void 0:v)?a&&o.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():v:!a&&o.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():a?v:Promise.resolve(v)};this.reviveSync=function(e,t){return S(e,Object.assign({},{throwOnBadSyncType:!0},t,{sync:!0}))},this.reviveAsync=function(e,t){return S(e,Object.assign({},{throwOnBadSyncType:!0},t,{sync:!1}))},this.register=function(e,t){return t=t||{},[].concat(e).forEach((function e(i){if(n(i))return i.map(e);i&&r(i).forEach((function(e){if("#"===e)throw new TypeError("# cannot be used as a type name as it is reserved for cyclic objects");if(p.JSON_TYPES.includes(e))throw new TypeError("Plain JSON object types are reserved as type names");var r=i[e],u=r.testPlainObjects?o:a,c=u.filter((function(t){return t.type===e}));if(c.length&&(u.splice(u.indexOf(c[0]),1),delete s[e],delete l[e]),r){if("function"==typeof r){var f=r;r={test:function(e){return e&&e.constructor===f},replace:function(e){return v({},e)},revive:function(e){return v(Object.create(f.prototype),e)}}}else n(r)&&(r={test:r[0],replace:r[1],revive:r[2]});var h={type:e,test:r.test.bind(r)};r.replace&&(h.replace=r.replace.bind(r)),r.replaceAsync&&(h.replaceAsync=r.replaceAsync.bind(r));var d="number"==typeof t.fallback?t.fallback:t.fallback?0:1/0;if(r.testPlainObjects?o.splice(d,0,h):a.splice(d,0,h),r.revive||r.reviveAsync){var g={};r.revive&&(g.revive=r.revive.bind(r)),r.reviveAsync&&(g.reviveAsync=r.reviveAsync.bind(r)),s[e]=g}l[e]=r}}))})),this}}function v(e,t){return r(t).map((function(r){e[r]=t[r]})),e}function g(e){return e.replace(/~/g,"~0").replace(/\./g,"~1")}function m(e){return e.replace(/~1/g,".").replace(/~0/g,"~")}function y(e,t){if(""===t)return e;var r=t.indexOf(".");if(r>-1){var n=e[m(t.substr(0,r))];return void 0===n?void 0:y(n,t.substr(r+1))}return e[m(t)]}function b(){}function w(e){this.p=new Promise(e)}return w.prototype.then=function(e,t){var r=this;return new w((function(n,i){r.p.then((function(t){n(e?e(t):t)}),(function(e){r.p.catch((function(e){return t?t(e):Promise.reject(e)})).then(n,i)}))}))},w.prototype.catch=function(e){return this.then(null,e)},w.resolve=function(e){return new w((function(t){t(e)}))},w.reject=function(e){return new w((function(t,r){r(e)}))},["all","race"].map((function(e){w[e]=function(t){return new w((function(r,n){Promise[e](t.map((function(e){return e.p}))).then(r,n)}))}})),p.Undefined=b,p.Promise=w,p.isThenable=c,p.toStringTag=l,p.hasConstructorOf=f,p.isObject=d,p.isPlainObject=h,p.isUserObject=function e(t){if(!t||"Object"!==l(t))return!1;var r=o(t);return!r||f(t,Object)||e(r)},p.escapeKeyPathComponent=g,p.unescapeKeyPathComponent=m,p.getByKeyPath=y,p.getJSONType=function(t){return null===t?"null":n(t)?"array":void 0===t?"undefined":e(t)},p.JSON_TYPES=["null","boolean","number","string","array","object"],p}()})),Fc=Bc((function(e,t){e.exports=function(){var e="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},t=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(i)throw o}}return r}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},r=Object.keys,n=Array.isArray,i={}.toString,o=Object.getPrototypeOf,a={}.hasOwnProperty,s=a.toString,u=["type","replaced","iterateIn","iterateUnsetNumeric"];function c(e,t){return p.isObject(e)&&"function"==typeof e.then&&(!t||"function"==typeof e.catch)}function l(e){return i.call(e).slice(8,-1)}function f(t,r){if(!t||"object"!==(void 0===t?"undefined":e(t)))return!1;var n=o(t);if(!n)return!1;var i=a.call(n,"constructor")&&n.constructor;return"function"!=typeof i?null===r:"function"==typeof i&&null!==r&&s.call(i)===s.call(r)}function h(e){return!(!e||"Object"!==l(e))&&(!o(e)||f(e,Object))}function d(t){return t&&"object"===(void 0===t?"undefined":e(t))}function p(i){var o=[],a=[],s={},l=this.types={},m=this.stringify=function(e,t,r,o){o=Object.assign({},i,o,{stringification:!0});var a=_(e,null,o);return n(a)?JSON.stringify(a[0],t,r):a.then((function(e){return JSON.stringify(e,t,r)}))};this.stringifySync=function(e,t,r,n){return m(e,t,r,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!0}))},this.stringifyAsync=function(e,t,r,n){return m(e,t,r,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!1}))};var k=this.parse=function(e,t,r){return r=Object.assign({},i,r,{parse:!0}),S(JSON.parse(e,t),r)};this.parseSync=function(e,t,r){return k(e,t,Object.assign({},{throwOnBadSyncType:!0},r,{sync:!0}))},this.parseAsync=function(e,t,r){return k(e,t,Object.assign({},{throwOnBadSyncType:!0},r,{sync:!1}))},this.specialTypeNames=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.returnTypeNames=!0,this.encapsulate(e,t,r)},this.rootTypeName=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r.iterateNone=!0,this.encapsulate(e,t,r)};var _=this.encapsulate=function(c,l,v){var m=(v=Object.assign({sync:!0},i,v)).sync,y={},b=[],k=[],_=[],S=!(v&&"cyclic"in v)||v.cyclic,x=v.encapsulateObserver,E=C("",c,S,l||{},_);function O(e){var t=Object.values(y);if(v.iterateNone)return t.length?t[0]:p.getJSONType(e);if(t.length){if(v.returnTypeNames)return[].concat(function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}(new Set(t)));e&&h(e)&&!e.hasOwnProperty("$types")?e.$types=y:e={$:e,$types:{$:y}}}else d(e)&&e.hasOwnProperty("$types")&&(e={$:e,$types:!0});return!v.returnTypeNames&&e}return _.length?m&&v.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():Promise.resolve(function e(r,n){return Promise.all(n.map((function(e){return e[1].p}))).then((function(i){return Promise.all(i.map((function(i){var o=[],a=n.splice(0,1)[0],s=t(a,7),u=s[0],c=s[2],l=s[3],h=s[4],d=s[5],p=s[6],v=C(u,i,c,l,o,!0,p),g=f(v,w);return u&&g?v.p.then((function(t){return h[d]=t,e(r,o)})):(u?h[d]=v:r=g?v.p:v,e(r,o))})))})).then((function(){return r}))}(E,_)).then(O):!m&&v.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():v.stringification&&m?[O(E)]:m?O(E):Promise.resolve(O(E));function A(e,t,r){Object.assign(e,t);var n=u.map((function(t){var r=e[t];return delete e[t],r}));r(),u.forEach((function(t,r){e[t]=n[r]}))}function C(t,i,a,s,u,c,l){var d=void 0,m={},_=void 0===i?"undefined":e(i),S=x?function(e){var r=l||s.type||p.getJSONType(i);x(Object.assign(e||m,{keypath:t,value:i,cyclic:a,stateObj:s,promisesData:u,resolvingTypesonPromise:c,awaitingTypesonPromise:f(i,w)},void 0!==r?{type:r}:{}))}:null;if(_ in{string:1,boolean:1,number:1,undefined:1})return void 0===i||"number"===_&&(isNaN(i)||i===-1/0||i===1/0)?(d=I(t,i,s,u,!1,c,S))!==i&&(m={replaced:d}):d=i,S&&S(),d;if(null===i)return S&&S(),i;if(a&&!s.iterateIn&&!s.iterateUnsetNumeric){var E=b.indexOf(i);if(!(E<0))return y[t]="#",S&&S({cyclicKeypath:k[E]}),"#"+k[E];!0===a&&(b.push(i),k.push(t))}var O=h(i),T=n(i),R=(O||T)&&(!o.length||s.replaced)||s.iterateIn?i:I(t,i,s,u,O||T,null,S),L=void 0;if(R!==i?(d=R,m={replaced:R}):T||"array"===s.iterateIn?(L=new Array(i.length),m={clone:L}):O||"object"===s.iterateIn?m={clone:L={}}:""===t&&f(i,w)?(u.push([t,i,a,s,void 0,void 0,s.type]),d=i):d=i,S&&S(),v.iterateNone)return L||d;if(!L)return d;if(s.iterateIn){var N=function(e){var r={ownKeys:i.hasOwnProperty(e)};A(s,r,(function(){var r=t+(t?".":"")+g(e),n=C(r,i[e],!!a,s,u,c);f(n,w)?u.push([r,n,!!a,s,L,e,s.type]):void 0!==n&&(L[e]=n)}))};for(var P in i)N(P);S&&S({endIterateIn:!0,end:!0})}else r(i).forEach((function(e){var r=t+(t?".":"")+g(e);A(s,{ownKeys:!0},(function(){var t=C(r,i[e],!!a,s,u,c);f(t,w)?u.push([r,t,!!a,s,L,e,s.type]):void 0!==t&&(L[e]=t)}))})),S&&S({endIterateOwn:!0,end:!0});if(s.iterateUnsetNumeric){for(var M=i.length,j=function(e){if(!(e in i)){var r=t+(t?".":"")+e;A(s,{ownKeys:!1},(function(){var t=C(r,void 0,!!a,s,u,c);f(t,w)?u.push([r,t,!!a,s,L,e,s.type]):void 0!==t&&(L[e]=t)}))}},D=0;D<M;D++)j(D);S&&S({endIterateUnsetNumeric:!0,end:!0})}return L}function I(e,t,r,n,i,u,c){for(var l=i?o:a,f=l.length;f--;){var h=l[f];if(h.test(t,r)){var d=h.type;if(s[d]){var p=y[e];y[e]=p?[d].concat(p):d}return Object.assign(r,{type:d,replaced:!0}),!m&&h.replaceAsync||h.replace?(c&&c({replacing:!0}),C(e,h[m||!h.replaceAsync?"replace":"replaceAsync"](t,r),S&&"readonly",r,n,u,d)):(c&&c({typeDetected:!0}),C(e,t,S&&"readonly",r,n,u,d))}}return t}};this.encapsulateSync=function(e,t,r){return _(e,t,Object.assign({},{throwOnBadSyncType:!0},r,{sync:!0}))},this.encapsulateAsync=function(e,t,r){return _(e,t,Object.assign({},{throwOnBadSyncType:!0},r,{sync:!1}))};var S=this.revive=function(e,o){var a=(o=Object.assign({sync:!0},i,o)).sync,u=e&&e.$types,l=!0;if(!u)return e;if(!0===u)return e.$;u.$&&h(u.$)&&(e=e.$,u=u.$,l=!1);var d=[],p={},v=function e(i,o,a,c,v,m){if(!l||"$types"!==i){var w=u[i];if(n(o)||h(o)){var k=n(o)?new Array(o.length):{};for(r(o).forEach((function(t){var r=e(i+(i?".":"")+g(t),o[t],a||k,c,k,t);f(r,b)?k[t]=void 0:void 0!==r&&(k[t]=r)})),o=k;d.length;){var _=t(d[0],4),S=_[0],x=_[1],E=_[2],O=_[3],A=y(S,x);if(f(A,b))E[O]=void 0;else{if(void 0===A)break;E[O]=A}d.splice(0,1)}}if(!w)return o;if("#"===w){var C=y(a,o.substr(1));return void 0===C&&d.push([a,o.substr(1),v,m]),C}var I=c.sync;return[].concat(w).reduce((function(e,t){var r=s[t];if(!r)throw new Error("Unregistered type: "+t);return r[I&&r.revive?"revive":!I&&r.reviveAsync?"reviveAsync":"revive"](e,p)}),o)}}("",e,null,o);return c(v=f(v,b)?void 0:v)?a&&o.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():v:!a&&o.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():a?v:Promise.resolve(v)};this.reviveSync=function(e,t){return S(e,Object.assign({},{throwOnBadSyncType:!0},t,{sync:!0}))},this.reviveAsync=function(e,t){return S(e,Object.assign({},{throwOnBadSyncType:!0},t,{sync:!1}))},this.register=function(e,t){return t=t||{},[].concat(e).forEach((function e(i){if(n(i))return i.map(e);i&&r(i).forEach((function(e){if("#"===e)throw new TypeError("# cannot be used as a type name as it is reserved for cyclic objects");if(p.JSON_TYPES.includes(e))throw new TypeError("Plain JSON object types are reserved as type names");var r=i[e],u=r.testPlainObjects?o:a,c=u.filter((function(t){return t.type===e}));if(c.length&&(u.splice(u.indexOf(c[0]),1),delete s[e],delete l[e]),r){if("function"==typeof r){var f=r;r={test:function(e){return e&&e.constructor===f},replace:function(e){return v({},e)},revive:function(e){return v(Object.create(f.prototype),e)}}}else n(r)&&(r={test:r[0],replace:r[1],revive:r[2]});var h={type:e,test:r.test.bind(r)};r.replace&&(h.replace=r.replace.bind(r)),r.replaceAsync&&(h.replaceAsync=r.replaceAsync.bind(r));var d="number"==typeof t.fallback?t.fallback:t.fallback?0:1/0;if(r.testPlainObjects?o.splice(d,0,h):a.splice(d,0,h),r.revive||r.reviveAsync){var g={};r.revive&&(g.revive=r.revive.bind(r)),r.reviveAsync&&(g.reviveAsync=r.reviveAsync.bind(r)),s[e]=g}l[e]=r}}))})),this}}function v(e,t){return r(t).map((function(r){e[r]=t[r]})),e}function g(e){return e.replace(/~/g,"~0").replace(/\./g,"~1")}function m(e){return e.replace(/~1/g,".").replace(/~0/g,"~")}function y(e,t){if(""===t)return e;var r=t.indexOf(".");if(r>-1){var n=e[m(t.substr(0,r))];return void 0===n?void 0:y(n,t.substr(r+1))}return e[m(t)]}function b(){}function w(e){this.p=new Promise(e)}w.prototype.then=function(e,t){var r=this;return new w((function(n,i){r.p.then((function(t){n(e?e(t):t)}),(function(e){r.p.catch((function(e){return t?t(e):Promise.reject(e)})).then(n,i)}))}))},w.prototype.catch=function(e){return this.then(null,e)},w.resolve=function(e){return new w((function(t){t(e)}))},w.reject=function(e){return new w((function(t,r){r(e)}))},["all","race"].map((function(e){w[e]=function(t){return new w((function(r,n){Promise[e](t.map((function(e){return e.p}))).then(r,n)}))}})),p.Undefined=b,p.Promise=w,p.isThenable=c,p.toStringTag=l,p.hasConstructorOf=f,p.isObject=d,p.isPlainObject=h,p.isUserObject=function e(t){if(!t||"Object"!==l(t))return!1;var r=o(t);return!r||f(t,Object)||e(r)},p.escapeKeyPathComponent=g,p.unescapeKeyPathComponent=m,p.getByKeyPath=y,p.getJSONType=function(t){return null===t?"null":n(t)?"array":void 0===t?"undefined":e(t)},p.JSON_TYPES=["null","boolean","number","string","array","object"];for(var k={userObject:{test:function(e,t){return p.isUserObject(e)},replace:function(e){return Object.assign({},e)},revive:function(e){return e}}},_=[[{sparseArrays:{testPlainObjects:!0,test:function(e){return Array.isArray(e)},replace:function(e,t){return t.iterateUnsetNumeric=!0,e}}},{sparseUndefined:{test:function(e,t){return void 0===e&&!1===t.ownKeys},replace:function(e){return null},revive:function(e){}}}],{undef:{test:function(e,t){return void 0===e&&(t.ownKeys||!("ownKeys"in t))},replace:function(e){return null},revive:function(e){return new p.Undefined}}}],S={StringObject:{test:function(t){return"String"===p.toStringTag(t)&&"object"===(void 0===t?"undefined":e(t))},replace:function(e){return String(e)},revive:function(e){return new String(e)}},BooleanObject:{test:function(t){return"Boolean"===p.toStringTag(t)&&"object"===(void 0===t?"undefined":e(t))},replace:function(e){return Boolean(e)},revive:function(e){return new Boolean(e)}},NumberObject:{test:function(t){return"Number"===p.toStringTag(t)&&"object"===(void 0===t?"undefined":e(t))},replace:function(e){return Number(e)},revive:function(e){return new Number(e)}}},x=[{nan:{test:function(e){return"number"==typeof e&&isNaN(e)},replace:function(e){return"NaN"},revive:function(e){return NaN}}},{infinity:{test:function(e){return e===1/0},replace:function(e){return"Infinity"},revive:function(e){return 1/0}}},{negativeInfinity:{test:function(e){return e===-1/0},replace:function(e){return"-Infinity"},revive:function(e){return-1/0}}}],E={date:{test:function(e){return"Date"===p.toStringTag(e)},replace:function(e){var t=e.getTime();return isNaN(t)?"NaN":t},revive:function(e){return"NaN"===e?new Date(NaN):new Date(e)}}},O={regexp:{test:function(e){return"RegExp"===p.toStringTag(e)},replace:function(e){return{source:e.source,flags:(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.sticky?"y":"")+(e.unicode?"u":"")}},revive:function(e){var t=e.source,r=e.flags;return new RegExp(t,r)}}},A={map:{test:function(e){return"Map"===p.toStringTag(e)},replace:function(e){return Array.from(e.entries())},revive:function(e){return new Map(e)}}},C={set:{test:function(e){return"Set"===p.toStringTag(e)},replace:function(e){return Array.from(e.values())},revive:function(e){return new Set(e)}}},I="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",T=new Uint8Array(256),R=0;R<I.length;R++)T[I.charCodeAt(R)]=R;var L=function(e,t,r){for(var n=new Uint8Array(e,t,r),i=n.length,o="",a=0;a<i;a+=3)o+=I[n[a]>>2],o+=I[(3&n[a])<<4|n[a+1]>>4],o+=I[(15&n[a+1])<<2|n[a+2]>>6],o+=I[63&n[a+2]];return i%3==2?o=o.substring(0,o.length-1)+"=":i%3==1&&(o=o.substring(0,o.length-2)+"=="),o},N=function(e){var t=e.length,r=.75*e.length,n=0,i=void 0,o=void 0,a=void 0,s=void 0;"="===e[e.length-1]&&(r--,"="===e[e.length-2]&&r--);for(var u=new ArrayBuffer(r),c=new Uint8Array(u),l=0;l<t;l+=4)i=T[e.charCodeAt(l)],o=T[e.charCodeAt(l+1)],a=T[e.charCodeAt(l+2)],s=T[e.charCodeAt(l+3)],c[n++]=i<<2|o>>4,c[n++]=(15&o)<<4|a>>2,c[n++]=(3&a)<<6|63&s;return u},P={arraybuffer:{test:function(e){return"ArrayBuffer"===p.toStringTag(e)},replace:function(e,t){t.buffers||(t.buffers=[]);var r=t.buffers.indexOf(e);return r>-1?{index:r}:(t.buffers.push(e),L(e))},revive:function(t,r){if(r.buffers||(r.buffers=[]),"object"===(void 0===t?"undefined":e(t)))return r.buffers[t.index];var n=N(t);return r.buffers.push(n),n}}},M="undefined"==typeof self?Dc:self,j={};["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"].forEach((function(e){var t=e,r=M[t];r&&(j[e.toLowerCase()]={test:function(e){return p.toStringTag(e)===t},replace:function(e,t){var r=e.buffer,n=e.byteOffset,i=e.length;t.buffers||(t.buffers=[]);var o=t.buffers.indexOf(r);return o>-1?{index:o,byteOffset:n,length:i}:(t.buffers.push(r),{encoded:L(r),byteOffset:n,length:i})},revive:function(e,t){t.buffers||(t.buffers=[]);var n=e.byteOffset,i=e.length,o=e.encoded,a=e.index,s=void 0;return"index"in e?s=t.buffers[a]:(s=N(o),t.buffers.push(s)),new r(s,n,i)}})}));var D={dataview:{test:function(e){return"DataView"===p.toStringTag(e)},replace:function(e,t){var r=e.buffer,n=e.byteOffset,i=e.byteLength;t.buffers||(t.buffers=[]);var o=t.buffers.indexOf(r);return o>-1?{index:o,byteOffset:n,byteLength:i}:(t.buffers.push(r),{encoded:L(r),byteOffset:n,byteLength:i})},revive:function(e,t){t.buffers||(t.buffers=[]);var r=e.byteOffset,n=e.byteLength,i=e.encoded,o=e.index,a=void 0;return"index"in e?a=t.buffers[o]:(a=N(i),t.buffers.push(a)),new DataView(a,r,n)}}},B={IntlCollator:{test:function(e){return p.hasConstructorOf(e,Intl.Collator)},replace:function(e){return e.resolvedOptions()},revive:function(e){return new Intl.Collator(e.locale,e)}},IntlDateTimeFormat:{test:function(e){return p.hasConstructorOf(e,Intl.DateTimeFormat)},replace:function(e){return e.resolvedOptions()},revive:function(e){return new Intl.DateTimeFormat(e.locale,e)}},IntlNumberFormat:{test:function(e){return p.hasConstructorOf(e,Intl.NumberFormat)},replace:function(e){return e.resolvedOptions()},revive:function(e){return new Intl.NumberFormat(e.locale,e)}}};function U(e){for(var t=new Uint16Array(e.length),r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t.buffer}var F={file:{test:function(e){return"File"===p.toStringTag(e)},replace:function(e){var t=new XMLHttpRequest;if(t.open("GET",URL.createObjectURL(e),!1),"undefined"!=typeof TextEncoder&&t.overrideMimeType("text/plain; charset=utf-16le"),200!==t.status&&0!==t.status)throw new Error("Bad Blob access: "+t.status);return t.send(),{type:e.type,stringContents:t.responseText,name:e.name,lastModified:e.lastModified}},revive:function(e){var t=e.name,r=e.type,n=e.stringContents,i=e.lastModified,o=U(n);return new File([o],t,{type:r,lastModified:i})},replaceAsync:function(e){return new p.Promise((function(t,r){if(e.isClosed)r(new Error("The File is closed"));else{var n=new FileReader;n.addEventListener("load",(function(){t({type:e.type,stringContents:n.result,name:e.name,lastModified:e.lastModified})})),n.addEventListener("error",(function(){r(n.error)})),n.readAsText(e,"UTF-16")}}))}}};return[k,_,S,x,E,O,{imagedata:{test:function(e){return"ImageData"===p.toStringTag(e)},replace:function(e){return{array:Array.from(e.data),width:e.width,height:e.height}},revive:function(e){return new ImageData(new Uint8ClampedArray(e.array),e.width,e.height)}}},{imagebitmap:{test:function(e){return"ImageBitmap"===p.toStringTag(e)||e&&e.dataset&&"ImageBitmap"===e.dataset.toStringTag},replace:function(e){var t=document.createElement("canvas");return t.getContext("2d").drawImage(e,0,0),t.toDataURL()},revive:function(e){var t=document.createElement("canvas"),r=t.getContext("2d"),n=document.createElement("img");return n.onload=function(){r.drawImage(n,0,0)},n.src=e,t},reviveAsync:function(e){var t=document.createElement("canvas"),r=t.getContext("2d"),n=document.createElement("img");return n.onload=function(){r.drawImage(n,0,0)},n.src=e,createImageBitmap(t)}}},F,{file:F.file,filelist:{test:function(e){return"FileList"===p.toStringTag(e)},replace:function(e){for(var t=[],r=0;r<e.length;r++)t[r]=e.item(r);return t},revive:function(e){function t(){this._files=arguments[0],this.length=this._files.length}return t.prototype.item=function(e){return this._files[e]},t.prototype[Symbol.toStringTag]="FileList",new t(e)}}},{blob:{test:function(e){return"Blob"===p.toStringTag(e)},replace:function(e){var t=new XMLHttpRequest;if(t.open("GET",URL.createObjectURL(e),!1),"undefined"!=typeof TextEncoder&&t.overrideMimeType("text/plain; charset=utf-16le"),200!==t.status&&0!==t.status)throw new Error("Bad Blob access: "+t.status);return t.send(),{type:e.type,stringContents:t.responseText}},revive:function(e){var t=e.type,r=e.stringContents;return new Blob([U(r)],{type:t})},replaceAsync:function(e){return new p.Promise((function(t,r){if(e.isClosed)r(new Error("The Blob is closed"));else{var n=new FileReader;n.addEventListener("load",(function(){t({type:e.type,stringContents:n.result})})),n.addEventListener("error",(function(){r(n.error)})),n.readAsText(e,"UTF-16")}}))}}}].concat("function"==typeof Map?A:[],"function"==typeof Set?C:[],"function"==typeof ArrayBuffer?P:[],"function"==typeof Uint8Array?j:[],"function"==typeof DataView?D:[],"undefined"!=typeof Intl?B:[])}()})),zc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Hc=new Uint8Array(256),Vc=0;Vc<zc.length;Vc++)Hc[zc.charCodeAt(Vc)]=Vc;var Wc=function(e,t,r){null==r&&(r=e.byteLength);for(var n=new Uint8Array(e,t||0,r),i=n.length,o="",a=0;a<i;a+=3)o+=zc[n[a]>>2],o+=zc[(3&n[a])<<4|n[a+1]>>4],o+=zc[(15&n[a+1])<<2|n[a+2]>>6],o+=zc[63&n[a+2]];return i%3==2?o=o.substring(0,o.length-1)+"=":i%3==1&&(o=o.substring(0,o.length-2)+"=="),o},Gc=function(e){var t,r,n,i,o=e.length,a=.75*e.length,s=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);for(var u=new ArrayBuffer(a),c=new Uint8Array(u),l=0;l<o;l+=4)t=Hc[e.charCodeAt(l)],r=Hc[e.charCodeAt(l+1)],n=Hc[e.charCodeAt(l+2)],i=Hc[e.charCodeAt(l+3)],c[s++]=t<<2|r>>4,c[s++]=(15&r)<<4|n>>2,c[s++]=(3&n)<<6|63&i;return u},Kc="undefined"==typeof self?global:self,qc={};["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"].forEach((function(e){var t=e,r=Kc[t];r&&(qc[e.toLowerCase()+"2"]={test:function(e){return Uc.toStringTag(e)===t},replace:function(e){return{buffer:e.buffer,byteOffset:e.byteOffset,length:e.length}},revive:function(e){var t=e.buffer,n=e.byteOffset,i=e.length;return new r(t,n,i)}})}));var Yc={arraybuffer:{test:function(e){return"ArrayBuffer"===Uc.toStringTag(e)},replace:function(e){return Wc(e,0,e.byteLength)},revive:function(e){return Gc(e)}}},Zc=(new Uc).register(Fc),Jc="FileReaderSync"in self,Xc=[],$c=0;Zc.register([Yc,qc,{blob2:{test:function(e){return"Blob"===Uc.toStringTag(e)},replace:function(e){if(e.isClosed)throw new Error("The Blob is closed");if(Jc){var t=jc(e,"binary"),r=Wc(t,0,t.byteLength);return{type:e.type,data:r}}Xc.push(e);var n={type:e.type,data:{start:$c,end:$c+e.size}};return console.log("b.size: "+e.size),$c+=e.size,n},finalize:function(e,t){e.data=Wc(t,0,t.byteLength)},revive:function(e){var t=e.type,r=e.data;return new Blob([Gc(r)],{type:t})}}}]),Zc.mustFinalize=function(){return Xc.length>0},Zc.finalize=function(e){return Lc(void 0,void 0,void 0,(function(){var t,r,n,i,o,a,s,u,c,l;return Nc(this,(function(f){switch(f.label){case 0:return[4,Mc(new Blob(Xc),"binary")];case 1:if(t=f.sent(),e)for(r=0,n=e;r<n.length;r++)if((i=n[r]).$types)for(s in o=i.$types,(a=o.$)&&(o=o.$),o)u=o[s],(c=Zc.types[u])&&c.finalize&&(l=yc.getByKeyPath(i,a?"$."+s:s),c.finalize(l,t.slice(l.start,l.end)));return Xc=[],[2]}}))}))};function Qc(e,t){return Lc(this,void 0,void 0,(function(){function r(){return Lc(this,void 0,void 0,(function(){var r,c,l,f,h,d,p,v,g;return Nc(this,(function(m){switch(m.label){case 0:return[4,Promise.all(e.tables.map((function(e){return e.count()})))];case 1:(r=m.sent()).forEach((function(e,t){return i[t].rowCount=e})),u.totalRows=r.reduce((function(e,t){return e+t})),c=JSON.stringify(a,void 0,o?2:void 0),l=c.lastIndexOf("]"),f=c.substring(0,l),n.push(f),h=t.filter,d=function(r){var i,a,c,l,f,d,p,v,g,m,y;return Nc(this,(function(b){switch(b.label){case 0:i=e.table(r),a=i.schema.primKey,c=!!a.keyPath,l=t.numRowsPerChunk||2e3,f=c?{tableName:i.name,inbound:!0,rows:[]}:{tableName:i.name,inbound:!1,rows:[]},d=JSON.stringify(f,void 0,o?2:void 0),o&&(d=d.split("\n").join("\n ")),p=d.lastIndexOf("]"),n.push(d.substring(0,p)),v=null,g=0,m=!0,y=function(){var e,t,f,d,p,y,b,w;return Nc(this,(function(k){switch(k.label){case 0:return s&&yc.ignoreTransaction((function(){return s(u)})),[4,(e=null==v?i.limit(l):i.where(":id").above(v).limit(l)).toArray()];case 1:return 0===(t=k.sent()).length?[2,"break"]:(null!=v&&g>0&&(n.push(","),o&&n.push("\n ")),m=t.length===l,c?(f=h?t.filter((function(e){return h(r,e)})):t,d=f.map((function(e){return Zc.encapsulate(e)})),Zc.mustFinalize()?[4,yc.waitFor(Zc.finalize(d))]:[3,3]):[3,4]);case 2:k.sent(),k.label=3;case 3:return w=JSON.stringify(d,void 0,o?2:void 0),o&&(w=w.split("\n").join("\n ")),n.push(new Blob([w.substring(1,w.length-1)])),g=f.length,v=t.length>0?yc.getByKeyPath(t[t.length-1],a.keyPath):null,[3,8];case 4:return[4,e.primaryKeys()];case 5:return p=k.sent(),y=p.map((function(e,r){return[e,t[r]]})),h&&(y=y.filter((function(e){var t=e[0],n=e[1];return h(r,n,t)}))),b=y.map((function(e){return Zc.encapsulate(e)})),Zc.mustFinalize()?[4,yc.waitFor(Zc.finalize(b))]:[3,7];case 6:k.sent(),k.label=7;case 7:w=JSON.stringify(b,void 0,o?2:void 0),o&&(w=w.split("\n").join("\n ")),n.push(new Blob([w.substring(1,w.length-1)])),g=y.length,v=p.length>0?p[p.length-1]:null,k.label=8;case 8:return u.completedRows+=t.length,[2]}}))},b.label=1;case 1:return m?[5,y()]:[3,3];case 2:return"break"===b.sent()?[3,3]:[3,1];case 3:return n.push(d.substr(p)),u.completedTables+=1,u.completedTables<u.totalTables&&n.push(","),[2]}}))},p=0,v=i,m.label=2;case 2:return p<v.length?(g=v[p].name,[5,d(g)]):[3,5];case 3:m.sent(),m.label=4;case 4:return p++,[3,2];case 5:return n.push(c.substr(l)),u.done=!0,s&&yc.ignoreTransaction((function(){return s(u)})),[2]}}))}))}var n,i,o,a,s,u;return Nc(this,(function(c){switch(c.label){case 0:t=t||{},n=[],i=e.tables.map((function(e){return{name:e.name,schema:Pc(e),rowCount:0}})),o=t.prettyJson,a={formatName:"dexie",formatVersion:1,data:{databaseName:e.name,databaseVersion:e.verno,tables:i,data:[]}},s=t.progressCallback,u={done:!1,completedRows:0,completedTables:0,totalRows:NaN,totalTables:e.tables.length},c.label=1;case 1:return c.trys.push([1,,6,7]),t.noTransaction?[4,r()]:[3,3];case 2:return c.sent(),[3,5];case 3:return[4,e.transaction("r",e.tables,r)];case 4:c.sent(),c.label=5;case 5:return[3,7];case 6:return Zc.finalize(),[7];case 7:return s&&yc.ignoreTransaction((function(){return s(u)})),[2,new Blob(n,{type:"text/json"})]}}))}))}var el=function(){},tl=Bc((function(e,t){!function(e){var t="object"==typeof process&&process.env?process.env:self;e.parser=function(e){return new D(e)},e.CParser=D,e.CStream=B,e.createStream=function(e){return new B(e)},e.MAX_BUFFER_LENGTH=10485760,e.DEBUG="debug"===t.CDEBUG,e.INFO="debug"===t.CDEBUG||"info"===t.CDEBUG,e.EVENTS=["value","string","key","openobject","closeobject","openarray","closearray","error","end","ready"];var r,n={textNode:void 0,numberNode:""},i=e.EVENTS.filter((function(e){return"error"!==e&&"end"!==e})),o=0;for(var a in e.STATE={BEGIN:o++,VALUE:o++,OPEN_OBJECT:o++,CLOSE_OBJECT:o++,OPEN_ARRAY:o++,CLOSE_ARRAY:o++,TEXT_ESCAPE:o++,STRING:o++,BACKSLASH:o++,END:o++,OPEN_KEY:o++,CLOSE_KEY:o++,TRUE:o++,TRUE2:o++,TRUE3:o++,FALSE:o++,FALSE2:o++,FALSE3:o++,FALSE4:o++,NULL:o++,NULL2:o++,NULL3:o++,NUMBER_DECIMAL_POINT:o++,NUMBER_DIGIT:o++},e.STATE)e.STATE[e.STATE[a]]=a;o=e.STATE;const s=9,u=10,c=13,l=32,f=34,h=43,d=44,p=45,v=46,g=48,m=57,y=58,b=69,w=91,k=92,_=93,S=97,x=98,E=101,O=102,A=108,C=110,I=114,T=115,R=116,L=117,N=123,P=125;function M(e){for(var t in n)e[t]=n[t]}Object.create||(Object.create=function(e){function t(){this.__proto__=e}return t.prototype=e,new t}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__}),Object.keys||(Object.keys=function(e){var t=[];for(var r in e)e.hasOwnProperty(r)&&t.push(r);return t});var j=/[\\"\n]/g;function D(t){if(!(this instanceof D))return new D(t);M(this),this.bufferCheckPosition=e.MAX_BUFFER_LENGTH,this.q=this.c=this.p="",this.opt=t||{},this.closed=this.closedRoot=this.sawRoot=!1,this.tag=this.error=null,this.state=o.BEGIN,this.stack=new Array,this.position=this.column=0,this.line=1,this.slashed=!1,this.unicodeI=0,this.unicodeS=null,this.depth=0,U(this,"onready")}D.prototype={end:function(){W(this)},write:function(t){if(this.error)throw this.error;if(this.closed)return V(this,"Cannot write after close. Assign an onready handler.");if(null===t)return W(this);var r=0,i=t.charCodeAt(0),a=this.p;e.DEBUG&&console.log("write -> ["+t+"]");for(;i&&(a=i,this.c=i=t.charCodeAt(r++),a!==i?this.p=a:a=this.p,i);)switch(e.DEBUG&&console.log(r,i,e.STATE[this.state]),this.position++,i===u?(this.line++,this.column=0):this.column++,this.state){case o.BEGIN:i===N?this.state=o.OPEN_OBJECT:i===w?this.state=o.OPEN_ARRAY:G(i)||V(this,"Non-whitespace before {[.");continue;case o.OPEN_KEY:case o.OPEN_OBJECT:if(G(i))continue;if(this.state===o.OPEN_KEY)this.stack.push(o.CLOSE_KEY);else{if(i===P){U(this,"onopenobject"),this.depth++,U(this,"oncloseobject"),this.depth--,this.state=this.stack.pop()||o.VALUE;continue}this.stack.push(o.CLOSE_OBJECT)}i===f?this.state=o.STRING:V(this,'Malformed object key should start with "');continue;case o.CLOSE_KEY:case o.CLOSE_OBJECT:if(G(i))continue;this.state,o.CLOSE_KEY,i===y?(this.state===o.CLOSE_OBJECT?(this.stack.push(o.CLOSE_OBJECT),z(this,"onopenobject"),this.depth++):z(this,"onkey"),this.state=o.VALUE):i===P?(F(this,"oncloseobject"),this.depth--,this.state=this.stack.pop()||o.VALUE):i===d?(this.state===o.CLOSE_OBJECT&&this.stack.push(o.CLOSE_OBJECT),z(this),this.state=o.OPEN_KEY):V(this,"Bad object");continue;case o.OPEN_ARRAY:case o.VALUE:if(G(i))continue;if(this.state===o.OPEN_ARRAY){if(U(this,"onopenarray"),this.depth++,this.state=o.VALUE,i===_){U(this,"onclosearray"),this.depth--,this.state=this.stack.pop()||o.VALUE;continue}this.stack.push(o.CLOSE_ARRAY)}i===f?this.state=o.STRING:i===N?this.state=o.OPEN_OBJECT:i===w?this.state=o.OPEN_ARRAY:i===R?this.state=o.TRUE:i===O?this.state=o.FALSE:i===C?this.state=o.NULL:i===p?this.numberNode+="-":g<=i&&i<=m?(this.numberNode+=String.fromCharCode(i),this.state=o.NUMBER_DIGIT):V(this,"Bad value");continue;case o.CLOSE_ARRAY:if(i===d)this.stack.push(o.CLOSE_ARRAY),z(this,"onvalue"),this.state=o.VALUE;else if(i===_)F(this,"onclosearray"),this.depth--,this.state=this.stack.pop()||o.VALUE;else{if(G(i))continue;V(this,"Bad array")}continue;case o.STRING:void 0===this.textNode&&(this.textNode="");var s=r-1,c=this.slashed,l=this.unicodeI;e:for(;;){for(e.DEBUG&&console.log(r,i,e.STATE[this.state],c);l>0;)if(this.unicodeS+=String.fromCharCode(i),i=t.charCodeAt(r++),this.position++,4===l?(this.textNode+=String.fromCharCode(parseInt(this.unicodeS,16)),l=0,s=r-1):l++,!i)break e;if(i===f&&!c){this.state=this.stack.pop()||o.VALUE,this.textNode+=t.substring(s,r-1),this.position+=r-1-s;break}if(i===k&&!c&&(c=!0,this.textNode+=t.substring(s,r-1),this.position+=r-1-s,i=t.charCodeAt(r++),this.position++,!i))break;if(c){if(c=!1,i===C?this.textNode+="\n":i===I?this.textNode+="\r":i===R?this.textNode+="\t":i===O?this.textNode+="\f":i===x?this.textNode+="\b":i===L?(l=1,this.unicodeS=""):this.textNode+=String.fromCharCode(i),i=t.charCodeAt(r++),this.position++,s=r-1,i)continue;break}j.lastIndex=r;var M=j.exec(t);if(null===M){r=t.length+1,this.textNode+=t.substring(s,r-1),this.position+=r-1-s;break}if(r=M.index+1,!(i=t.charCodeAt(M.index))){this.textNode+=t.substring(s,r-1),this.position+=r-1-s;break}}this.slashed=c,this.unicodeI=l;continue;case o.TRUE:i===I?this.state=o.TRUE2:V(this,"Invalid true started with t"+i);continue;case o.TRUE2:i===L?this.state=o.TRUE3:V(this,"Invalid true started with tr"+i);continue;case o.TRUE3:i===E?(U(this,"onvalue",!0),this.state=this.stack.pop()||o.VALUE):V(this,"Invalid true started with tru"+i);continue;case o.FALSE:i===S?this.state=o.FALSE2:V(this,"Invalid false started with f"+i);continue;case o.FALSE2:i===A?this.state=o.FALSE3:V(this,"Invalid false started with fa"+i);continue;case o.FALSE3:i===T?this.state=o.FALSE4:V(this,"Invalid false started with fal"+i);continue;case o.FALSE4:i===E?(U(this,"onvalue",!1),this.state=this.stack.pop()||o.VALUE):V(this,"Invalid false started with fals"+i);continue;case o.NULL:i===L?this.state=o.NULL2:V(this,"Invalid null started with n"+i);continue;case o.NULL2:i===A?this.state=o.NULL3:V(this,"Invalid null started with nu"+i);continue;case o.NULL3:i===A?(U(this,"onvalue",null),this.state=this.stack.pop()||o.VALUE):V(this,"Invalid null started with nul"+i);continue;case o.NUMBER_DECIMAL_POINT:i===v?(this.numberNode+=".",this.state=o.NUMBER_DIGIT):V(this,"Leading zero not followed by .");continue;case o.NUMBER_DIGIT:g<=i&&i<=m?this.numberNode+=String.fromCharCode(i):i===v?(-1!==this.numberNode.indexOf(".")&&V(this,"Invalid number has two dots"),this.numberNode+="."):i===E||i===b?(-1===this.numberNode.indexOf("e")&&-1===this.numberNode.indexOf("E")||V(this,"Invalid number has two exponential"),this.numberNode+="e"):i===h||i===p?(a!==E&&a!==b&&V(this,"Invalid symbol in number"),this.numberNode+=String.fromCharCode(i)):(H(this),r--,this.state=this.stack.pop()||o.VALUE);continue;default:V(this,"Unknown state: "+this.state)}this.position>=this.bufferCheckPosition&&function(t){var r=Math.max(e.MAX_BUFFER_LENGTH,10),i=0;for(var o in n){var a=void 0===t[o]?0:t[o].length;if(a>r)switch(o){case"text":closeText(t);break;default:V(t,"Max buffer length exceeded: "+o)}i=Math.max(i,a)}t.bufferCheckPosition=e.MAX_BUFFER_LENGTH-i+t.position}(this);return this},resume:function(){return this.error=null,this},close:function(){return this.write(null)}};try{r=el}catch(e){r=function(){}}function B(e){if(!(this instanceof B))return new B(e);this._parser=new D(e),this.writable=!0,this.readable=!0,this.bytes_remaining=0,this.bytes_in_sequence=0,this.temp_buffs={2:new Buffer(2),3:new Buffer(3),4:new Buffer(4)},this.string="";var t=this;r.apply(t),this._parser.onend=function(){t.emit("end")},this._parser.onerror=function(e){t.emit("error",e),t._parser.error=null},i.forEach((function(e){Object.defineProperty(t,"on"+e,{get:function(){return t._parser["on"+e]},set:function(r){if(!r)return t.removeAllListeners(e),t._parser["on"+e]=r,r;t.on(e,r)},enumerable:!0,configurable:!1})}))}function U(t,r,n){e.INFO&&console.log("-- emit",r,n),t[r]&&t[r](n)}function F(e,t,r){z(e),U(e,t,r)}function z(e,t){e.textNode=function(e,t){if(void 0===t)return t;e.trim&&(t=t.trim());e.normalize&&(t=t.replace(/\s+/g," "));return t}(e.opt,e.textNode),void 0!==e.textNode&&U(e,t||"onvalue",e.textNode),e.textNode=void 0}function H(e){e.numberNode&&U(e,"onvalue",parseFloat(e.numberNode)),e.numberNode=""}function V(e,t){return z(e),t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c,t=new Error(t),e.error=t,U(e,"onerror",t),e}function W(e){return e.state===o.VALUE&&0===e.depth||V(e,"Unexpected end"),z(e),e.c="",e.closed=!0,U(e,"onend"),D.call(e,e.opt),e}function G(e){return e===c||e===u||e===l||e===s}B.prototype=Object.create(r.prototype,{constructor:{value:B}}),B.prototype.write=function(e){e=new Buffer(e);for(var t=0;t<e.length;t++){var r=e[t];if(this.bytes_remaining>0){for(var n=0;n<this.bytes_remaining;n++)this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence-this.bytes_remaining+n]=e[n];this.string=this.temp_buffs[this.bytes_in_sequence].toString(),this.bytes_in_sequence=this.bytes_remaining=0,t=t+n-1,this._parser.write(this.string),this.emit("data",this.string)}else if(0===this.bytes_remaining&&r>=128){if(r>=194&&r<=223&&(this.bytes_in_sequence=2),r>=224&&r<=239&&(this.bytes_in_sequence=3),r>=240&&r<=244&&(this.bytes_in_sequence=4),this.bytes_in_sequence+t>e.length){for(var i=0;i<=e.length-1-t;i++)this.temp_buffs[this.bytes_in_sequence][i]=e[t+i];return this.bytes_remaining=t+this.bytes_in_sequence-e.length,!0}this.string=e.slice(t,t+this.bytes_in_sequence).toString(),t=t+this.bytes_in_sequence-1,this._parser.write(this.string),this.emit("data",this.string)}else{for(var o=t;o<e.length&&!(e[o]>=128);o++);this.string=e.slice(t,o).toString(),this._parser.write(this.string),this.emit("data",this.string),t=o-1}}},B.prototype.end=function(e){return e&&e.length&&this._parser.write(e.toString()),this._parser.end(),!0},B.prototype.on=function(e,t){var n=this;return n._parser["on"+e]||-1===i.indexOf(e)||(n._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),n.emit.apply(n,t)}),r.prototype.on.call(n,e,t)},B.prototype.destroy=function(){M(this._parser),this.emit("close")}}(t)}));function rl(e){var t=0,r=function(e){var t,r,n,i=tl.parser(),o=0,a=[],s=!1,u=!1;return i.onopenobject=function(i){var s={incomplete:!0};t||(t=s),r&&(a.push([n,r,u]),e&&(u?r.push(s):r[n]=s)),r=s,n=i,u=!1,++o},i.onkey=function(e){return n=e},i.onvalue=function(e){return u?r.push(e):r[n]=e},i.oncloseobject=function(){var t;if(delete r.incomplete,n=null,0==--o)s=!0;else{var i=r;t=a.pop(),n=t[0],r=t[1],u=t[2],e||(u?r.push(i):r[n]=i)}},i.onopenarray=function(){var i=[];i.incomplete=!0,t||(t=i),r&&(a.push([n,r,u]),e&&(u?r.push(i):r[n]=i)),r=i,u=!0,n=null,++o},i.onclosearray=function(){var t;if(delete r.incomplete,n=null,0==--o)s=!0;else{var i=r;t=a.pop(),n=t[0],r=t[1],u=t[2],e||(u?r.push(i):r[n]=i)}},{write:function(e){return i.write(e),t},done:function(){return s}}}(!0),n={pullAsync:function(i){return Lc(this,void 0,void 0,(function(){var o,a,s;return Nc(this,(function(u){switch(u.label){case 0:return o=e.slice(t,t+i),t+=i,[4,Mc(o,"text")];case 1:return a=u.sent(),s=r.write(a),n.result=s||{},[2,s]}}))}))},pullSync:function(i){var o=e.slice(t,t+i);t+=i;var a=jc(o,"text"),s=r.write(a);return n.result=s||{},s},done:function(){return r.done()},eof:function(){return t>=e.size},result:{}};return n}function nl(e,t,r){return Lc(this,void 0,void 0,(function(){function n(){return Lc(this,void 0,void 0,(function(){var t,n,a,f;return Nc(this,(function(h){switch(h.label){case 0:t=function(t){var n,i,o,a,s,f,h,d,p,v,g,m;return Nc(this,(function(y){switch(y.label){case 0:if(!t.rows)return[2,"break"];if(!t.rows.incomplete&&0===t.rows.length)return[2,"continue"];if(c&&yc.ignoreTransaction((function(){return c(l)})),n=t.tableName,i=e.table(n),o=u.tables.filter((function(e){return e.name===n}))[0].schema,!i){if(r.acceptMissingTables)return[2,"continue"];throw new Error("Exported table "+t.tableName+" is missing in installed database")}if(!r.acceptChangedPrimaryKey&&o.split(",")[0]!=i.schema.primKey.src)throw new Error("Primary key differs for table "+t.tableName+". ");for(a=t.rows,s=[],f=0;f<a.length&&!(h=a[f]).incomplete;f++)s.push(Zc.revive(h));return d=r.filter,p=d?t.inbound?s.filter((function(e){return d(n,e)})):s.filter((function(e){var t=e[0],r=e[1];return d(n,r,t)})):s,v=t.inbound?[void 0,p]:[p.map((function(e){return e[0]})),s.map((function(e){return e[1]}))],g=v[0],m=v[1],r.overwriteValues?[4,i.bulkPut(m,g)]:[3,2];case 1:return y.sent(),[3,4];case 2:return[4,i.bulkAdd(m,g)];case 3:y.sent(),y.label=4;case 4:return l.completedRows+=s.length,s.incomplete||(l.completedTables+=1),a.splice(0,s.length),[2]}}))},n=0,a=u.data,h.label=1;case 1:return n<a.length?(f=a[n],[5,t(f)]):[3,4];case 2:if("break"===h.sent())return[3,4];h.label=3;case 3:return n++,[3,1];case 4:for(;u.data.length>0&&u.data[0].rows&&!u.data[0].rows.incomplete;)u.data.splice(0,1);return o.done()||o.eof()?[3,8]:s?(o.pullSync(i),[3,7]):[3,5];case 5:return[4,yc.waitFor(o.pullAsync(i))];case 6:h.sent(),h.label=7;case 7:return[3,9];case 8:return[3,10];case 9:return[3,0];case 10:return[2]}}))}))}var i,o,a,s,u,c,l,f,h;return Nc(this,(function(d){switch(d.label){case 0:return i=(r=r||{}).chunkSizeBytes||1048576,[4,il(t,i)];case 1:if(o=d.sent(),a=o.result,s="FileReaderSync"in self,u=a.data,!r.acceptNameDiff&&e.name!==u.databaseName)throw new Error("Name differs. Current database name is "+e.name+" but export is "+u.databaseName);if(!r.acceptVersionDiff&&e.verno!==u.databaseVersion)throw new Error("Database version differs. Current database is in version "+e.verno+" but export is "+u.databaseVersion);if(c=r.progressCallback,l={done:!1,completedRows:0,completedTables:0,totalRows:u.tables.reduce((function(e,t){return e+t.rowCount}),0),totalTables:u.tables.length},c&&yc.ignoreTransaction((function(){return c(l)})),!r.clearTablesBeforeImport)return[3,5];f=0,h=e.tables,d.label=2;case 2:return f<h.length?[4,h[f].clear()]:[3,5];case 3:d.sent(),d.label=4;case 4:return f++,[3,2];case 5:return r.noTransaction?[4,n()]:[3,7];case 6:return d.sent(),[3,9];case 7:return[4,e.transaction("rw",e.tables,n)];case 8:d.sent(),d.label=9;case 9:return l.done=!0,c&&yc.ignoreTransaction((function(){return c(l)})),[2]}}))}))}function il(e,t){return Lc(this,void 0,void 0,(function(){var r,n;return Nc(this,(function(i){switch(i.label){case 0:r="slice"in e?rl(e):e,i.label=1;case 1:return r.eof()?[3,3]:[4,r.pullAsync(t)];case 2:return i.sent(),r.result.data&&r.result.data.data?[3,3]:[3,1];case 3:if(!(n=r.result)||"dexie"!=n.formatName)throw new Error("Given file is not a dexie export");if(n.formatVersion>1)throw new Error("Format version "+n.formatVersion+" not supported");if(!n.data)throw new Error("No data in export file");if(!n.data.databaseName)throw new Error("Missing databaseName in export file");if(!n.data.databaseVersion)throw new Error("Missing databaseVersion in export file");if(!n.data.tables)throw new Error("Missing tables in export file");return[2,r]}}))}))}yc.prototype.export=function(e){return Qc(this,e)},yc.prototype.import=function(e,t){return nl(this,e,t)},yc.import=function(e,t){return function(e,t){return Lc(this,void 0,void 0,(function(){var r,n,i,o;return Nc(this,(function(a){switch(a.label){case 0:return r=(t=t||{}).chunkSizeBytes||1048576,[4,il(e,r)];case 1:return n=a.sent(),i=n.result.data,(o=new yc(i.databaseName)).version(i.databaseVersion).stores(function(e){for(var t={},r=0,n=e.tables;r<n.length;r++){var i=n[r];t[i.name]=i.schema}return t}(i)),[4,nl(o,n,t)];case 2:return a.sent(),[2,o]}}))}))}(e,t)};var ol=r((function(e,t){e.exports=function e(t,r,n){var i,o,a=window,s="application/octet-stream",u=n||s,c=t,l=!r&&!n&&c,f=document.createElement("a"),h=function(e){return String(e)},d=a.Blob||a.MozBlob||a.WebKitBlob||h,p=r||"download";if(d=d.call?d.bind(a):Blob,"true"===String(this)&&(u=(c=[c,u])[0],c=c[1]),l&&l.length<2048&&(p=l.split("/").pop().split("?")[0],f.href=l,-1!==f.href.indexOf(l))){var v=new XMLHttpRequest;return v.open("GET",l,!0),v.responseType="blob",v.onload=function(t){e(t.target.response,p,s)},setTimeout((function(){v.send()}),0),v}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(c)){if(!(c.length>2096103.424&&d!==h))return navigator.msSaveBlob?navigator.msSaveBlob(b(c),p):w(c);u=(c=b(c)).type||s}else if(/([\x80-\xff])/.test(c)){for(var g=0,m=new Uint8Array(c.length),y=m.length;g<y;++g)m[g]=c.charCodeAt(g);c=new d([m],{type:u})}function b(e){for(var t=e.split(/[:;,]/),r=t[1],n=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),i=n.length,o=0,a=new Uint8Array(i);o<i;++o)a[o]=n.charCodeAt(o);return new d([a],{type:r})}function w(e,t){if("download"in f)return f.href=e,f.setAttribute("download",p),f.className="download-js-link",f.innerHTML="downloading...",f.style.display="none",document.body.appendChild(f),setTimeout((function(){f.click(),document.body.removeChild(f),!0===t&&setTimeout((function(){a.URL.revokeObjectURL(f.href)}),250)}),66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),window.open(e)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=e),!0;var r=document.createElement("iframe");document.body.appendChild(r),!t&&/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),r.src=e,setTimeout((function(){document.body.removeChild(r)}),333)}if(i=c instanceof d?c:new d([c],{type:u}),navigator.msSaveBlob)return navigator.msSaveBlob(i,p);if(a.URL)w(a.URL.createObjectURL(i),!0);else{if("string"==typeof i||i.constructor===h)try{return w("data:"+u+";base64,"+a.btoa(i))}catch(e){return w("data:"+u+","+encodeURIComponent(i))}(o=new FileReader).onload=function(e){w(this.result)},o.readAsDataURL(i)}return!0}})),al=r((function(r,n){r.exports=function e(r,n,i){function o(s,u){if(!n[s]){if(!r[s]){if(!u&&t)return t();if(a)return a(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[s]={exports:{}};r[s][0].call(l.exports,(function(e){return o(r[s][1][e]||e)}),l,l.exports,e,r,n,i)}return n[s].exports}for(var a=t,s=0;s<i.length;s++)o(i[s]);return o}({1:[function(e,t,r){var n=e("./utils"),i=e("./support"),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(e){for(var t,r,i,a,s,u,c,l=[],f=0,h=e.length,d=h,p="string"!==n.getTypeOf(e);f<e.length;)d=h-f,i=p?(t=e[f++],r=f<h?e[f++]:0,f<h?e[f++]:0):(t=e.charCodeAt(f++),r=f<h?e.charCodeAt(f++):0,f<h?e.charCodeAt(f++):0),a=t>>2,s=(3&t)<<4|r>>4,u=1<d?(15&r)<<2|i>>6:64,c=2<d?63&i:64,l.push(o.charAt(a)+o.charAt(s)+o.charAt(u)+o.charAt(c));return l.join("")},r.decode=function(e){var t,r,n,a,s,u,c=0,l=0,f="data:";if(e.substr(0,f.length)===f)throw new Error("Invalid base64 input, it looks like a data url.");var h,d=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(e.charAt(e.length-1)===o.charAt(64)&&d--,e.charAt(e.length-2)===o.charAt(64)&&d--,d%1!=0)throw new Error("Invalid base64 input, bad content length.");for(h=i.uint8array?new Uint8Array(0|d):new Array(0|d);c<e.length;)t=o.indexOf(e.charAt(c++))<<2|(a=o.indexOf(e.charAt(c++)))>>4,r=(15&a)<<4|(s=o.indexOf(e.charAt(c++)))>>2,n=(3&s)<<6|(u=o.indexOf(e.charAt(c++))),h[l++]=t,64!==s&&(h[l++]=r),64!==u&&(h[l++]=n);return h}},{"./support":30,"./utils":32}],2:[function(e,t,r){var n=e("./external"),i=e("./stream/DataWorker"),o=e("./stream/Crc32Probe"),a=e("./stream/DataLengthProbe");function s(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i}s.prototype={getContentWorker:function(){var e=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),t=this;return e.on("end",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},s.createWorkerFrom=function(e,t,r){return e.pipe(new o).pipe(new a("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new a("compressedSize")).withStreamInfo("compression",t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,r){var n=e("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(e){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,r){var n=e("./utils"),i=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==n.getTypeOf(e)?function(e,t,r,n){var o=i,a=0+r;e^=-1;for(var s=0;s<a;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}(0|t,e,e.length):function(e,t,r,n){var o=i,a=0+r;e^=-1;for(var s=0;s<a;s++)e=e>>>8^o[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length):0}},{"./utils":32}],5:[function(e,t,r){r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(e,t,r){var n;n="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:n}},{lie:37}],7:[function(e,t,r){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=e("pako"),o=e("./utils"),a=e("./stream/GenericWorker"),s=n?"uint8array":"array";function u(e,t){a.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}r.magic="\b\0",o.inherits(u,a),u.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(s,e.data),!1)},u.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},r.compressWorker=function(e){return new u("Deflate",e)},r.uncompressWorker=function(){return new u("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,r){function n(e,t){var r,n="";for(r=0;r<t;r++)n+=String.fromCharCode(255&e),e>>>=8;return n}function i(e,t,r,i,a,l){var f,h,d=e.file,p=e.compression,v=l!==s.utf8encode,g=o.transformTo("string",l(d.name)),m=o.transformTo("string",s.utf8encode(d.name)),y=d.comment,b=o.transformTo("string",l(y)),w=o.transformTo("string",s.utf8encode(y)),k=m.length!==d.name.length,_=w.length!==y.length,S="",x="",E="",O=d.dir,A=d.date,C={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(C.crc32=e.crc32,C.compressedSize=e.compressedSize,C.uncompressedSize=e.uncompressedSize);var I=0;t&&(I|=8),v||!k&&!_||(I|=2048);var T=0,R=0;O&&(T|=16),"UNIX"===a?(R=798,T|=function(e,t){var r=e;return e||(r=t?16893:33204),(65535&r)<<16}(d.unixPermissions,O)):(R=20,T|=function(e){return 63&(e||0)}(d.dosPermissions)),f=A.getUTCHours(),f<<=6,f|=A.getUTCMinutes(),f<<=5,f|=A.getUTCSeconds()/2,h=A.getUTCFullYear()-1980,h<<=4,h|=A.getUTCMonth()+1,h<<=5,h|=A.getUTCDate(),k&&(x=n(1,1)+n(u(g),4)+m,S+="up"+n(x.length,2)+x),_&&(E=n(1,1)+n(u(b),4)+w,S+="uc"+n(E.length,2)+E);var L="";return L+="\n\0",L+=n(I,2),L+=p.magic,L+=n(f,2),L+=n(h,2),L+=n(C.crc32,4),L+=n(C.compressedSize,4),L+=n(C.uncompressedSize,4),L+=n(g.length,2),L+=n(S.length,2),{fileRecord:c.LOCAL_FILE_HEADER+L+g+S,dirRecord:c.CENTRAL_FILE_HEADER+n(R,2)+L+n(b.length,2)+"\0\0\0\0"+n(T,4)+n(i,4)+g+S+b}}var o=e("../utils"),a=e("../stream/GenericWorker"),s=e("../utf8"),u=e("../crc32"),c=e("../signature");function l(e,t,r,n){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(l,a),l.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,a.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}))},l.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},l.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=i(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:function(e){return c.DATA_DESCRIPTOR+n(e.crc32,4)+n(e.compressedSize,4)+n(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},l.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var r=this.bytesWritten-e,i=function(e,t,r,i,a){var s=o.transformTo("string",a(i));return c.CENTRAL_DIRECTORY_END+"\0\0\0\0"+n(e,2)+n(e,2)+n(t,4)+n(r,4)+n(s.length,2)+s}(this.dirRecords.length,r,e,this.zipComment,this.encodeFileName);this.push({data:i,meta:{percent:100}})},l.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},l.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()})),e.on("error",(function(e){t.error(e)})),this},l.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},l.prototype.error=function(e){var t=this._sources;if(!a.prototype.error.call(this,e))return!1;for(var r=0;r<t.length;r++)try{t[r].error(e)}catch(e){}return!0},l.prototype.lock=function(){a.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()},t.exports=l},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,t,r){var n=e("../compressions"),i=e("./ZipFileWorker");r.generateWorker=function(e,t,r){var o=new i(t.streamFiles,r,t.platform,t.encodeFileName),a=0;try{e.forEach((function(e,r){a++;var i=function(e,t){var r=e||t,i=n[r];if(!i)throw new Error(r+" is not a valid compression method !");return i}(r.options.compression,t.compression),s=r.options.compressionOptions||t.compressionOptions||{},u=r.dir,c=r.date;r._compressWorker(i,s).withStreamInfo("file",{name:e,dir:u,date:c,comment:r.comment||"",unixPermissions:r.unixPermissions,dosPermissions:r.dosPermissions}).pipe(o)})),o.entriesCount=a}catch(e){o.error(e)}return o}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t,r){function n(){if(!(this instanceof n))return new n;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new n;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}(n.prototype=e("./object")).loadAsync=e("./load"),n.support=e("./support"),n.defaults=e("./defaults"),n.version="3.7.1",n.loadAsync=function(e,t){return(new n).loadAsync(e,t)},n.external=e("./external"),t.exports=n},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,t,r){var n=e("./utils"),i=e("./external"),o=e("./utf8"),a=e("./zipEntries"),s=e("./stream/Crc32Probe"),u=e("./nodejsUtils");function c(e){return new i.Promise((function(t,r){var n=e.decompressed.getContentWorker().pipe(new s);n.on("error",(function(e){r(e)})).on("end",(function(){n.streamInfo.crc32!==e.decompressed.crc32?r(new Error("Corrupted zip : CRC32 mismatch")):t()})).resume()}))}t.exports=function(e,t){var r=this;return t=n.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),u.isNode&&u.isStream(e)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):n.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then((function(e){var r=new a(t);return r.load(e),r})).then((function(e){var r=[i.Promise.resolve(e)],n=e.files;if(t.checkCRC32)for(var o=0;o<n.length;o++)r.push(c(n[o]));return i.Promise.all(r)})).then((function(e){for(var n=e.shift(),i=n.files,o=0;o<i.length;o++){var a=i[o];r.file(a.fileNameStr,a.decompressed,{binary:!0,optimizedBinaryString:!0,date:a.date,dir:a.dir,comment:a.fileCommentStr.length?a.fileCommentStr:null,unixPermissions:a.unixPermissions,dosPermissions:a.dosPermissions,createFolders:t.createFolders})}return n.zipComment.length&&(r.comment=n.zipComment),r}))}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,t,r){var n=e("../utils"),i=e("../stream/GenericWorker");function o(e,t){i.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}n.inherits(o,i),o.prototype._bindStream=function(e){var t=this;(this._stream=e).pause(),e.on("data",(function(e){t.push({data:e,meta:{percent:0}})})).on("error",(function(e){t.isPaused?this.generatedError=e:t.error(e)})).on("end",(function(){t.isPaused?t._upstreamEnded=!0:t.end()}))},o.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=o},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,t,r){var n=e("readable-stream").Readable;function i(e,t,r){n.call(this,t),this._helper=e;var i=this;e.on("data",(function(e,t){i.push(e)||i._helper.pause(),r&&r(t)})).on("error",(function(e){i.emit("error",e)})).on("end",(function(){i.push(null)}))}e("../utils").inherits(i,n),i.prototype._read=function(){this._helper.resume()},t.exports=i},{"../utils":32,"readable-stream":16}],14:[function(e,t,r){t.exports={isNode:"undefined"!=typeof Buffer,newBufferFrom:function(e,t){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(e,t);if("number"==typeof e)throw new Error('The "data" argument must not be a number');return new Buffer(e,t)},allocBuffer:function(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t},isBuffer:function(e){return Buffer.isBuffer(e)},isStream:function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume}}},{}],15:[function(e,t,r){function n(e,t,r){var n,i=o.getTypeOf(t),s=o.extend(r||{},u);s.date=s.date||new Date,null!==s.compression&&(s.compression=s.compression.toUpperCase()),"string"==typeof s.unixPermissions&&(s.unixPermissions=parseInt(s.unixPermissions,8)),s.unixPermissions&&16384&s.unixPermissions&&(s.dir=!0),s.dosPermissions&&16&s.dosPermissions&&(s.dir=!0),s.dir&&(e=v(e)),s.createFolders&&(n=p(e))&&g.call(this,n,!0);var f,m="string"===i&&!1===s.binary&&!1===s.base64;r&&void 0!==r.binary||(s.binary=!m),(t instanceof c&&0===t.uncompressedSize||s.dir||!t||0===t.length)&&(s.base64=!1,s.binary=!0,t="",s.compression="STORE",i="string"),f=t instanceof c||t instanceof a?t:h.isNode&&h.isStream(t)?new d(e,t):o.prepareContent(e,t,s.binary,s.optimizedBinaryString,s.base64);var y=new l(e,f,s);this.files[e]=y}var i=e("./utf8"),o=e("./utils"),a=e("./stream/GenericWorker"),s=e("./stream/StreamHelper"),u=e("./defaults"),c=e("./compressedObject"),l=e("./zipObject"),f=e("./generate"),h=e("./nodejsUtils"),d=e("./nodejs/NodejsStreamInputAdapter"),p=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return 0<t?e.substring(0,t):""},v=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},g=function(e,t){return t=void 0!==t?t:u.createFolders,e=v(e),this.files[e]||n.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function m(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var y={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,r,n;for(t in this.files)n=this.files[t],(r=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(r,n)},filter:function(e){var t=[];return this.forEach((function(r,n){e(r,n)&&t.push(n)})),t},file:function(e,t,r){if(1!==arguments.length)return e=this.root+e,n.call(this,e,t,r),this;if(m(e)){var i=e;return this.filter((function(e,t){return!t.dir&&i.test(e)}))}var o=this.files[this.root+e];return o&&!o.dir?o:null},folder:function(e){if(!e)return this;if(m(e))return this.filter((function(t,r){return r.dir&&e.test(t)}));var t=this.root+e,r=g.call(this,t),n=this.clone();return n.root=r.name,n},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var r=this.filter((function(t,r){return r.name.slice(0,e.length)===e})),n=0;n<r.length;n++)delete this.files[r[n].name];return this},generate:function(e){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,r={};try{if((r=o.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=r.type.toLowerCase(),r.compression=r.compression.toUpperCase(),"binarystring"===r.type&&(r.type="string"),!r.type)throw new Error("No output type specified.");o.checkSupport(r.type),"darwin"!==r.platform&&"freebsd"!==r.platform&&"linux"!==r.platform&&"sunos"!==r.platform||(r.platform="UNIX"),"win32"===r.platform&&(r.platform="DOS");var n=r.comment||this.comment||"";t=f.generateWorker(this,r,n)}catch(e){(t=new a("error")).error(e)}return new s(t,r.type||"string",r.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e=e||{}).type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}};t.exports=y},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,t,r){t.exports=e("stream")},{stream:void 0}],17:[function(e,t,r){var n=e("./DataReader");function i(e){n.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}e("../utils").inherits(i,n),i.prototype.byteAt=function(e){return this.data[this.zero+e]},i.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),o=this.length-4;0<=o;--o)if(this.data[o]===t&&this.data[o+1]===r&&this.data[o+2]===n&&this.data[o+3]===i)return o-this.zero;return-1},i.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),i=e.charCodeAt(3),o=this.readData(4);return t===o[0]&&r===o[1]&&n===o[2]&&i===o[3]},i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],18:[function(e,t,r){var n=e("../utils");function i(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(e){},readInt:function(e){var t,r=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return n.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,r){var n=e("./Uint8ArrayReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,r){var n=e("./DataReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,r){var n=e("./ArrayReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,r){var n=e("../utils"),i=e("../support"),o=e("./ArrayReader"),a=e("./StringReader"),s=e("./NodeBufferReader"),u=e("./Uint8ArrayReader");t.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),"string"!==t||i.uint8array?"nodebuffer"===t?new s(e):i.uint8array?new u(n.transformTo("uint8array",e)):new o(n.transformTo("array",e)):new a(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,r){r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b"},{}],24:[function(e,t,r){var n=e("./GenericWorker"),i=e("../utils");function o(e){n.call(this,"ConvertWorker to "+e),this.destType=e}i.inherits(o,n),o.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,r){var n=e("./GenericWorker"),i=e("../crc32");function o(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(o,n),o.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,r){var n=e("../utils"),i=e("./GenericWorker");function o(e){i.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}n.inherits(o,i),o.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,r){var n=e("../utils"),i=e("./GenericWorker");function o(e){i.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=n.getTypeOf(e),t.isPaused||t._tickAndRepeat()}),(function(e){t.error(e)}))}n.inherits(o,i),o.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,r){function n(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r<this._listeners[e].length;r++)this._listeners[e][r].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.end()})),e.on("error",(function(e){t.error(e)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var e=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)this.extraStreamInfo.hasOwnProperty(e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}},t.exports=n},{}],29:[function(e,t,r){var n=e("../utils"),i=e("./ConvertWorker"),o=e("./GenericWorker"),a=e("../base64"),s=e("../support"),u=e("../external"),c=null;if(s.nodestream)try{c=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}function l(e,t,r){var a=t;switch(t){case"blob":case"arraybuffer":a="uint8array";break;case"base64":a="string"}try{this._internalType=a,this._outputType=t,this._mimeType=r,n.checkSupport(a),this._worker=e.pipe(new i(a)),e.lock()}catch(e){this._worker=new o("error"),this._worker.error(e)}}l.prototype={accumulate:function(e){return function(e,t){return new u.Promise((function(r,i){var o=[],s=e._internalType,u=e._outputType,c=e._mimeType;e.on("data",(function(e,r){o.push(e),t&&t(r)})).on("error",(function(e){o=[],i(e)})).on("end",(function(){try{var e=function(e,t,r){switch(e){case"blob":return n.newBlob(n.transformTo("arraybuffer",t),r);case"base64":return a.encode(t);default:return n.transformTo(e,t)}}(u,function(e,t){var r,n=0,i=null,o=0;for(r=0;r<t.length;r++)o+=t[r].length;switch(e){case"string":return t.join("");case"array":return Array.prototype.concat.apply([],t);case"uint8array":for(i=new Uint8Array(o),r=0;r<t.length;r++)i.set(t[r],n),n+=t[r].length;return i;case"nodebuffer":return Buffer.concat(t);default:throw new Error("concat : unsupported type '"+e+"'")}}(s,o),c);r(e)}catch(e){i(e)}o=[]})).resume()}))}(this,e)},on:function(e,t){var r=this;return"data"===e?this._worker.on(e,(function(e){t.call(r,e.data,e.meta)})):this._worker.on(e,(function(){n.delay(t,arguments,r)})),this},resume:function(){return n.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(n.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new c(this,{objectMode:"nodebuffer"!==this._outputType},e)}},t.exports=l},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,t,r){if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,r.nodebuffer="undefined"!=typeof Buffer,r.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)r.blob=!1;else{var n=new ArrayBuffer(0);try{r.blob=0===new Blob([n],{type:"application/zip"}).size}catch(e){try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(n),r.blob=0===i.getBlob("application/zip").size}catch(e){r.blob=!1}}}try{r.nodestream=!!e("readable-stream").Readable}catch(e){r.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,r){for(var n=e("./utils"),i=e("./support"),o=e("./nodejsUtils"),a=e("./stream/GenericWorker"),s=new Array(256),u=0;u<256;u++)s[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;function c(){a.call(this,"utf-8 decode"),this.leftOver=null}function l(){a.call(this,"utf-8 encode")}s[254]=s[254]=1,r.utf8encode=function(e){return i.nodebuffer?o.newBufferFrom(e,"utf-8"):function(e){var t,r,n,o,a,s=e.length,u=0;for(o=0;o<s;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(n=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(n-56320),o++),u+=r<128?1:r<2048?2:r<65536?3:4;for(t=i.uint8array?new Uint8Array(u):new Array(u),o=a=0;a<u;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(n=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(n-56320),o++),r<128?t[a++]=r:(r<2048?t[a++]=192|r>>>6:(r<65536?t[a++]=224|r>>>12:(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63),t[a++]=128|r>>>6&63),t[a++]=128|63&r);return t}(e)},r.utf8decode=function(e){return i.nodebuffer?n.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,r,i,o,a=e.length,u=new Array(2*a);for(t=r=0;t<a;)if((i=e[t++])<128)u[r++]=i;else if(4<(o=s[i]))u[r++]=65533,t+=o-1;else{for(i&=2===o?31:3===o?15:7;1<o&&t<a;)i=i<<6|63&e[t++],o--;1<o?u[r++]=65533:i<65536?u[r++]=i:(i-=65536,u[r++]=55296|i>>10&1023,u[r++]=56320|1023&i)}return u.length!==r&&(u.subarray?u=u.subarray(0,r):u.length=r),n.applyFromCharCode(u)}(e=n.transformTo(i.uint8array?"uint8array":"array",e))},n.inherits(c,a),c.prototype.processChunk=function(e){var t=n.transformTo(i.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var o=t;(t=new Uint8Array(o.length+this.leftOver.length)).set(this.leftOver,0),t.set(o,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var a=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0||0===r?t:r+s[e[r]]>t?r:t}(t),u=t;a!==t.length&&(i.uint8array?(u=t.subarray(0,a),this.leftOver=t.subarray(a,t.length)):(u=t.slice(0,a),this.leftOver=t.slice(a,t.length))),this.push({data:r.utf8decode(u),meta:e.meta})},c.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=c,n.inherits(l,a),l.prototype.processChunk=function(e){this.push({data:r.utf8encode(e.data),meta:e.meta})},r.Utf8EncodeWorker=l},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,r){var n=e("./support"),i=e("./base64"),o=e("./nodejsUtils"),a=e("set-immediate-shim"),s=e("./external");function u(e){return e}function c(e,t){for(var r=0;r<e.length;++r)t[r]=255&e.charCodeAt(r);return t}r.newBlob=function(e,t){r.checkSupport("blob");try{return new Blob([e],{type:t})}catch(r){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return n.append(e),n.getBlob(t)}catch(e){throw new Error("Bug : can't construct the Blob.")}}};var l={stringifyByChunk:function(e,t,r){var n=[],i=0,o=e.length;if(o<=r)return String.fromCharCode.apply(null,e);for(;i<o;)"array"===t||"nodebuffer"===t?n.push(String.fromCharCode.apply(null,e.slice(i,Math.min(i+r,o)))):n.push(String.fromCharCode.apply(null,e.subarray(i,Math.min(i+r,o)))),i+=r;return n.join("")},stringifyByChar:function(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},applyCanBeUsed:{uint8array:function(){try{return n.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return n.nodebuffer&&1===String.fromCharCode.apply(null,o.allocBuffer(1)).length}catch(e){return!1}}()}};function f(e){var t=65536,n=r.getTypeOf(e),i=!0;if("uint8array"===n?i=l.applyCanBeUsed.uint8array:"nodebuffer"===n&&(i=l.applyCanBeUsed.nodebuffer),i)for(;1<t;)try{return l.stringifyByChunk(e,n,t)}catch(e){t=Math.floor(t/2)}return l.stringifyByChar(e)}function h(e,t){for(var r=0;r<e.length;r++)t[r]=e[r];return t}r.applyFromCharCode=f;var d={};d.string={string:u,array:function(e){return c(e,new Array(e.length))},arraybuffer:function(e){return d.string.uint8array(e).buffer},uint8array:function(e){return c(e,new Uint8Array(e.length))},nodebuffer:function(e){return c(e,o.allocBuffer(e.length))}},d.array={string:f,array:u,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return o.newBufferFrom(e)}},d.arraybuffer={string:function(e){return f(new Uint8Array(e))},array:function(e){return h(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:u,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return o.newBufferFrom(new Uint8Array(e))}},d.uint8array={string:f,array:function(e){return h(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:u,nodebuffer:function(e){return o.newBufferFrom(e)}},d.nodebuffer={string:f,array:function(e){return h(e,new Array(e.length))},arraybuffer:function(e){return d.nodebuffer.uint8array(e).buffer},uint8array:function(e){return h(e,new Uint8Array(e.length))},nodebuffer:u},r.transformTo=function(e,t){if(t=t||"",!e)return t;r.checkSupport(e);var n=r.getTypeOf(t);return d[n][e](t)},r.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":n.nodebuffer&&o.isBuffer(e)?"nodebuffer":n.uint8array&&e instanceof Uint8Array?"uint8array":n.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},r.checkSupport=function(e){if(!n[e.toLowerCase()])throw new Error(e+" is not supported by this platform")},r.MAX_VALUE_16BITS=65535,r.MAX_VALUE_32BITS=-1,r.pretty=function(e){var t,r,n="";for(r=0;r<(e||"").length;r++)n+="\\x"+((t=e.charCodeAt(r))<16?"0":"")+t.toString(16).toUpperCase();return n},r.delay=function(e,t,r){a((function(){e.apply(r||null,t||[])}))},r.inherits=function(e,t){function r(){}r.prototype=t.prototype,e.prototype=new r},r.extend=function(){var e,t,r={};for(e=0;e<arguments.length;e++)for(t in arguments[e])arguments[e].hasOwnProperty(t)&&void 0===r[t]&&(r[t]=arguments[e][t]);return r},r.prepareContent=function(e,t,o,a,u){return s.Promise.resolve(t).then((function(e){return n.blob&&(e instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(e)))&&"undefined"!=typeof FileReader?new s.Promise((function(t,r){var n=new FileReader;n.onload=function(e){t(e.target.result)},n.onerror=function(e){r(e.target.error)},n.readAsArrayBuffer(e)})):e})).then((function(t){var l=r.getTypeOf(t);return l?("arraybuffer"===l?t=r.transformTo("uint8array",t):"string"===l&&(u?t=i.decode(t):o&&!0!==a&&(t=function(e){return c(e,n.uint8array?new Uint8Array(e.length):new Array(e.length))}(t))),t):s.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,"set-immediate-shim":54}],33:[function(e,t,r){var n=e("./reader/readerFor"),i=e("./utils"),o=e("./signature"),a=e("./zipEntry"),s=(e("./utf8"),e("./support"));function u(e){this.files=[],this.loadOptions=e}u.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(t)+", expected "+i.pretty(e)+")")}},isSignature:function(e,t){var r=this.reader.index;this.reader.setIndex(e);var n=this.reader.readString(4)===t;return this.reader.setIndex(r),n},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=s.uint8array?"uint8array":"array",r=i.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(r)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,r,n=this.zip64EndOfCentralSize-44;0<n;)e=this.reader.readInt(2),t=this.reader.readInt(4),r=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:r}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)(e=new a({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(e<0)throw this.isSignature(0,o.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(e);var t=e;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,o.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var r=this.centralDirOffset+this.centralDirSize;this.zip64&&(r+=20,r+=12+this.zip64EndOfCentralSize);var n=t-r;if(0<n)this.isSignature(t,o.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n<0)throw new Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(e){this.reader=n(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=u},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(e,t,r){var n=e("./reader/readerFor"),i=e("./utils"),o=e("./compressedObject"),a=e("./crc32"),s=e("./utf8"),u=e("./compressions"),c=e("./support");function l(e,t){this.options=e,this.loadOptions=t}l.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,r;if(e.skip(22),this.fileNameLength=e.readInt(2),r=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in u)if(u.hasOwnProperty(t)&&u[t].magic===e)return u[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=n(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(e){var t,r,n,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4<i;)t=e.readInt(2),r=e.readInt(2),n=e.readData(r),this.extraFields[t]={id:t,length:r,value:n};e.setIndex(i)},handleUTF8:function(){var e=c.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=s.utf8decode(this.fileName),this.fileCommentStr=s.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(null!==t)this.fileNameStr=t;else{var r=i.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var n=this.findExtraFieldUnicodeComment();if(null!==n)this.fileCommentStr=n;else{var o=i.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(o)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=n(e.value);return 1!==t.readInt(1)||a(this.fileName)!==t.readInt(4)?null:s.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=n(e.value);return 1!==t.readInt(1)||a(this.fileComment)!==t.readInt(4)?null:s.utf8decode(t.readData(e.length-5))}return null}},t.exports=l},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,t,r){function n(e,t,r){this.name=e,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=t,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}}var i=e("./stream/StreamHelper"),o=e("./stream/DataWorker"),a=e("./utf8"),s=e("./compressedObject"),u=e("./stream/GenericWorker");n.prototype={internalStream:function(e){var t=null,r="string";try{if(!e)throw new Error("No output type specified.");var n="string"===(r=e.toLowerCase())||"text"===r;"binarystring"!==r&&"text"!==r||(r="string"),t=this._decompressWorker();var o=!this._dataBinary;o&&!n&&(t=t.pipe(new a.Utf8EncodeWorker)),!o&&n&&(t=t.pipe(new a.Utf8DecodeWorker))}catch(e){(t=new u("error")).error(e)}return new i(t,r,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof s&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new a.Utf8EncodeWorker)),s.createWorkerFrom(r,e,t)},_decompressWorker:function(){return this._data instanceof s?this._data.getContentWorker():this._data instanceof u?this._data:new o(this._data)}};for(var c=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],l=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},f=0;f<c.length;f++)n.prototype[c[f]]=l;t.exports=n},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,r,n){(function(e){var t,n,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var o=0,a=new i(l),s=e.document.createTextNode("");a.observe(s,{characterData:!0}),t=function(){s.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)t="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){l(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(l,0)};else{var u=new e.MessageChannel;u.port1.onmessage=l,t=function(){u.port2.postMessage(0)}}var c=[];function l(){var e,t;n=!0;for(var r=c.length;r;){for(t=c,c=[],e=-1;++e<r;)t[e]();r=c.length}n=!1}r.exports=function(e){1!==c.push(e)||n||t()}}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(e,t,r){var n=e("immediate");function i(){}var o={},a=["REJECTED"],s=["FULFILLED"],u=["PENDING"];function c(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,e!==i&&d(this,e)}function l(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function f(e,t,r){n((function(){var n;try{n=t(r)}catch(n){return o.reject(e,n)}n===e?o.reject(e,new TypeError("Cannot resolve promise with itself")):o.resolve(e,n)}))}function h(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function d(e,t){var r=!1;function n(t){r||(r=!0,o.reject(e,t))}function i(t){r||(r=!0,o.resolve(e,t))}var a=p((function(){t(i,n)}));"error"===a.status&&n(a.value)}function p(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}(t.exports=c).prototype.finally=function(e){if("function"!=typeof e)return this;var t=this.constructor;return this.then((function(r){return t.resolve(e()).then((function(){return r}))}),(function(r){return t.resolve(e()).then((function(){throw r}))}))},c.prototype.catch=function(e){return this.then(null,e)},c.prototype.then=function(e,t){if("function"!=typeof e&&this.state===s||"function"!=typeof t&&this.state===a)return this;var r=new this.constructor(i);return this.state!==u?f(r,this.state===s?e:t,this.outcome):this.queue.push(new l(r,e,t)),r},l.prototype.callFulfilled=function(e){o.resolve(this.promise,e)},l.prototype.otherCallFulfilled=function(e){f(this.promise,this.onFulfilled,e)},l.prototype.callRejected=function(e){o.reject(this.promise,e)},l.prototype.otherCallRejected=function(e){f(this.promise,this.onRejected,e)},o.resolve=function(e,t){var r=p(h,t);if("error"===r.status)return o.reject(e,r.value);var n=r.value;if(n)d(e,n);else{e.state=s,e.outcome=t;for(var i=-1,a=e.queue.length;++i<a;)e.queue[i].callFulfilled(t)}return e},o.reject=function(e,t){e.state=a,e.outcome=t;for(var r=-1,n=e.queue.length;++r<n;)e.queue[r].callRejected(t);return e},c.resolve=function(e){return e instanceof this?e:o.resolve(new this(i),e)},c.reject=function(e){var t=new this(i);return o.reject(t,e)},c.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);for(var a=new Array(r),s=0,u=-1,c=new this(i);++u<r;)l(e[u],u);return c;function l(e,i){t.resolve(e).then((function(e){a[i]=e,++s!==r||n||(n=!0,o.resolve(c,a))}),(function(e){n||(n=!0,o.reject(c,e))}))}},c.race=function(e){if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var t=e.length,r=!1;if(!t)return this.resolve([]);for(var n,a=-1,s=new this(i);++a<t;)n=e[a],this.resolve(n).then((function(e){r||(r=!0,o.resolve(s,e))}),(function(e){r||(r=!0,o.reject(s,e))}));return s}},{immediate:36}],38:[function(e,t,r){var n={};(0,e("./lib/utils/common").assign)(n,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),t.exports=n},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,t,r){var n=e("./zlib/deflate"),i=e("./utils/common"),o=e("./utils/strings"),a=e("./zlib/messages"),s=e("./zlib/zstream"),u=Object.prototype.toString;function c(e){if(!(this instanceof c))return new c(e);this.options=i.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&0<t.windowBits?t.windowBits=-t.windowBits:t.gzip&&0<t.windowBits&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var r=n.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==r)throw new Error(a[r]);if(t.header&&n.deflateSetHeader(this.strm,t.header),t.dictionary){var l;if(l="string"==typeof t.dictionary?o.string2buf(t.dictionary):"[object ArrayBuffer]"===u.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(r=n.deflateSetDictionary(this.strm,l)))throw new Error(a[r]);this._dict_set=!0}}function l(e,t){var r=new c(t);if(r.push(e,!0),r.err)throw r.msg||a[r.err];return r.result}c.prototype.push=function(e,t){var r,a,s=this.strm,c=this.options.chunkSize;if(this.ended)return!1;a=t===~~t?t:!0===t?4:0,"string"==typeof e?s.input=o.string2buf(e):"[object ArrayBuffer]"===u.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(c),s.next_out=0,s.avail_out=c),1!==(r=n.deflate(s,a))&&0!==r)return this.onEnd(r),!(this.ended=!0);0!==s.avail_out&&(0!==s.avail_in||4!==a&&2!==a)||("string"===this.options.to?this.onData(o.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((0<s.avail_in||0===s.avail_out)&&1!==r);return 4===a?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):2!==a||(this.onEnd(0),!(s.avail_out=0))},c.prototype.onData=function(e){this.chunks.push(e)},c.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Deflate=c,r.deflate=l,r.deflateRaw=function(e,t){return(t=t||{}).raw=!0,l(e,t)},r.gzip=function(e,t){return(t=t||{}).gzip=!0,l(e,t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,r){var n=e("./zlib/inflate"),i=e("./utils/common"),o=e("./utils/strings"),a=e("./zlib/constants"),s=e("./zlib/messages"),u=e("./zlib/zstream"),c=e("./zlib/gzheader"),l=Object.prototype.toString;function f(e){if(!(this instanceof f))return new f(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==a.Z_OK)throw new Error(s[r]);this.header=new c,n.inflateGetHeader(this.strm,this.header)}function h(e,t){var r=new f(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}f.prototype.push=function(e,t){var r,s,u,c,f,h,d=this.strm,p=this.options.chunkSize,v=this.options.dictionary,g=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof e?d.input=o.binstring2buf(e):"[object ArrayBuffer]"===l.call(e)?d.input=new Uint8Array(e):d.input=e,d.next_in=0,d.avail_in=d.input.length;do{if(0===d.avail_out&&(d.output=new i.Buf8(p),d.next_out=0,d.avail_out=p),(r=n.inflate(d,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&v&&(h="string"==typeof v?o.string2buf(v):"[object ArrayBuffer]"===l.call(v)?new Uint8Array(v):v,r=n.inflateSetDictionary(this.strm,h)),r===a.Z_BUF_ERROR&&!0===g&&(r=a.Z_OK,g=!1),r!==a.Z_STREAM_END&&r!==a.Z_OK)return this.onEnd(r),!(this.ended=!0);d.next_out&&(0!==d.avail_out&&r!==a.Z_STREAM_END&&(0!==d.avail_in||s!==a.Z_FINISH&&s!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(u=o.utf8border(d.output,d.next_out),c=d.next_out-u,f=o.buf2string(d.output,u),d.next_out=c,d.avail_out=p-c,c&&i.arraySet(d.output,d.output,u,c,0),this.onData(f)):this.onData(i.shrinkBuf(d.output,d.next_out)))),0===d.avail_in&&0===d.avail_out&&(g=!0)}while((0<d.avail_in||0===d.avail_out)&&r!==a.Z_STREAM_END);return r===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===a.Z_OK):s!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),!(d.avail_out=0))},f.prototype.onData=function(e){this.chunks.push(e)},f.prototype.onEnd=function(e){e===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Inflate=f,r.inflate=h,r.inflateRaw=function(e,t){return(t=t||{}).raw=!0,h(e,t)},r.ungzip=h},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,t,r){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)r.hasOwnProperty(n)&&(e[n]=r[n])}}return e},r.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){var t,r,n,i,o,a;for(t=n=0,r=e.length;t<r;t++)n+=e[t].length;for(a=new Uint8Array(n),t=i=0,r=e.length;t<r;t++)o=e[t],a.set(o,i),i+=o.length;return a}},o={arraySet:function(e,t,r,n,i){for(var o=0;o<n;o++)e[i+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};r.setTyped=function(e){e?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,i)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,o))},r.setTyped(n)},{}],42:[function(e,t,r){var n=e("./common"),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var a=new n.Buf8(256),s=0;s<256;s++)a[s]=252<=s?6:248<=s?5:240<=s?4:224<=s?3:192<=s?2:1;function u(e,t){if(t<65537&&(e.subarray&&o||!e.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",a=0;a<t;a++)r+=String.fromCharCode(e[a]);return r}a[254]=a[254]=1,r.string2buf=function(e){var t,r,i,o,a,s=e.length,u=0;for(o=0;o<s;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),u+=r<128?1:r<2048?2:r<65536?3:4;for(t=new n.Buf8(u),o=a=0;a<u;o++)55296==(64512&(r=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(r=65536+(r-55296<<10)+(i-56320),o++),r<128?t[a++]=r:(r<2048?t[a++]=192|r>>>6:(r<65536?t[a++]=224|r>>>12:(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63),t[a++]=128|r>>>6&63),t[a++]=128|63&r);return t},r.buf2binstring=function(e){return u(e,e.length)},r.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r<i;r++)t[r]=e.charCodeAt(r);return t},r.buf2string=function(e,t){var r,n,i,o,s=t||e.length,c=new Array(2*s);for(r=n=0;r<s;)if((i=e[r++])<128)c[n++]=i;else if(4<(o=a[i]))c[n++]=65533,r+=o-1;else{for(i&=2===o?31:3===o?15:7;1<o&&r<s;)i=i<<6|63&e[r++],o--;1<o?c[n++]=65533:i<65536?c[n++]=i:(i-=65536,c[n++]=55296|i>>10&1023,c[n++]=56320|1023&i)}return u(c,n)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0||0===r?t:r+a[e[r]]>t?r:t}},{"./common":41}],43:[function(e,t,r){t.exports=function(e,t,r,n){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==r;){for(r-=a=2e3<r?2e3:r;o=o+(i=i+t[n++]|0)|0,--a;);i%=65521,o%=65521}return i|o<<16|0}},{}],44:[function(e,t,r){t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,t,r){var n=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var o=n,a=i+r;e^=-1;for(var s=i;s<a;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}},{}],46:[function(e,t,r){var n,i=e("../utils/common"),o=e("./trees"),a=e("./adler32"),s=e("./crc32"),u=e("./messages"),c=-2,l=258,f=262,h=113;function d(e,t){return e.msg=u[t],t}function p(e){return(e<<1)-(4<e?9:0)}function v(e){for(var t=e.length;0<=--t;)e[t]=0}function g(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function m(e,t){o._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,g(e.strm)}function y(e,t){e.pending_buf[e.pending++]=t}function b(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function w(e,t){var r,n,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,u=e.strstart>e.w_size-f?e.strstart-(e.w_size-f):0,c=e.window,h=e.w_mask,d=e.prev,p=e.strstart+l,v=c[o+a-1],g=c[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(c[(r=t)+a]===g&&c[r+a-1]===v&&c[r]===c[o]&&c[++r]===c[o+1]){o+=2,r++;do{}while(c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&o<p);if(n=l-(p-o),o=p-l,a<n){if(e.match_start=t,s<=(a=n))break;v=c[o+a-1],g=c[o+a]}}}while((t=d[t&h])>u&&0!=--i);return a<=e.lookahead?a:e.lookahead}function k(e){var t,r,n,o,u,c,l,h,d,p,v=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=v+(v-f)){for(i.arraySet(e.window,e.window,v,v,0),e.match_start-=v,e.strstart-=v,e.block_start-=v,t=r=e.hash_size;n=e.head[--t],e.head[t]=v<=n?n-v:0,--r;);for(t=r=v;n=e.prev[--t],e.prev[t]=v<=n?n-v:0,--r;);o+=v}if(0===e.strm.avail_in)break;if(c=e.strm,l=e.window,h=e.strstart+e.lookahead,p=void 0,(d=o)<(p=c.avail_in)&&(p=d),r=0===p?0:(c.avail_in-=p,i.arraySet(l,c.input,c.next_in,p,h),1===c.state.wrap?c.adler=a(c.adler,l,p,h):2===c.state.wrap&&(c.adler=s(c.adler,l,p,h)),c.next_in+=p,c.total_in+=p,p),e.lookahead+=r,e.lookahead+e.insert>=3)for(u=e.strstart-e.insert,e.ins_h=e.window[u],e.ins_h=(e.ins_h<<e.hash_shift^e.window[u+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[u+3-1])&e.hash_mask,e.prev[u&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=u,u++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<f&&0!==e.strm.avail_in)}function _(e,t){for(var r,n;;){if(e.lookahead<f){if(k(e),e.lookahead<f&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-f&&(e.match_length=w(e,r)),e.match_length>=3)if(n=o._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,0!=--e.match_length;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(m(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(m(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(m(e,!1),0===e.strm.avail_out)?1:2}function S(e,t){for(var r,n,i;;){if(e.lookahead<f){if(k(e),e.lookahead<f&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-f&&(e.match_length=w(e,r),e.match_length<=5&&(1===e.strategy||3===e.match_length&&4096<e.strstart-e.match_start)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-3,n=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!=--e.prev_length;);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(m(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((n=o._tr_tally(e,0,e.window[e.strstart-1]))&&m(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=o._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(m(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(m(e,!1),0===e.strm.avail_out)?1:2}function x(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}function E(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(1146),this.dyn_dtree=new i.Buf16(122),this.bl_tree=new i.Buf16(78),v(this.dyn_ltree),v(this.dyn_dtree),v(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(16),this.heap=new i.Buf16(573),v(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(573),v(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function O(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:h,e.adler=2===t.wrap?0:1,t.last_flush=0,o._tr_init(t),0):d(e,c)}function A(e){var t=O(e);return 0===t&&function(e){e.window_size=2*e.w_size,v(e.head),e.max_lazy_match=n[e.level].max_lazy,e.good_match=n[e.level].good_length,e.nice_match=n[e.level].nice_length,e.max_chain_length=n[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0}(e.state),t}function C(e,t,r,n,o,a){if(!e)return c;var s=1;if(-1===t&&(t=6),n<0?(s=0,n=-n):15<n&&(s=2,n-=16),o<1||9<o||8!==r||n<8||15<n||t<0||9<t||a<0||4<a)return d(e,c);8===n&&(n=9);var u=new E;return(e.state=u).strm=e,u.wrap=s,u.gzhead=null,u.w_bits=n,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=o+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+3-1)/3),u.window=new i.Buf8(2*u.w_size),u.head=new i.Buf16(u.hash_size),u.prev=new i.Buf16(u.w_size),u.lit_bufsize=1<<o+6,u.pending_buf_size=4*u.lit_bufsize,u.pending_buf=new i.Buf8(u.pending_buf_size),u.d_buf=1*u.lit_bufsize,u.l_buf=3*u.lit_bufsize,u.level=t,u.strategy=a,u.method=r,A(e)}n=[new x(0,0,0,0,(function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(k(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,m(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-f&&(m(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(m(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(m(e,!1),e.strm.avail_out),1)})),new x(4,4,8,4,_),new x(4,5,16,8,_),new x(4,6,32,32,_),new x(4,4,16,16,S),new x(8,16,32,32,S),new x(8,16,128,128,S),new x(8,32,128,256,S),new x(32,128,258,1024,S),new x(32,258,258,4096,S)],r.deflateInit=function(e,t){return C(e,t,8,15,8,0)},r.deflateInit2=C,r.deflateReset=A,r.deflateResetKeep=O,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?c:(e.state.gzhead=t,0):c},r.deflate=function(e,t){var r,i,a,u;if(!e||!e.state||5<t||t<0)return e?d(e,c):c;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||666===i.status&&4!==t)return d(e,0===e.avail_out?-5:c);if(i.strm=e,r=i.last_flush,i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,y(i,31),y(i,139),y(i,8),i.gzhead?(y(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),y(i,255&i.gzhead.time),y(i,i.gzhead.time>>8&255),y(i,i.gzhead.time>>16&255),y(i,i.gzhead.time>>24&255),y(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),y(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(y(i,255&i.gzhead.extra.length),y(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(y(i,0),y(i,0),y(i,0),y(i,0),y(i,0),y(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),y(i,3),i.status=h);else{var f=8+(i.w_bits-8<<4)<<8;f|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(f|=32),f+=31-f%31,i.status=h,b(i,f),0!==i.strstart&&(b(i,e.adler>>>16),b(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),g(e),a=i.pending,i.pending!==i.pending_buf_size));)y(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),g(e),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,y(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),g(e),a=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,y(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===u&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&g(e),i.pending+2<=i.pending_buf_size&&(y(i,255&e.adler),y(i,e.adler>>8&255),e.adler=0,i.status=h)):i.status=h),0!==i.pending){if(g(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&p(t)<=p(r)&&4!==t)return d(e,-5);if(666===i.status&&0!==e.avail_in)return d(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&666!==i.status){var w=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(k(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(m(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(m(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(m(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var r,n,i,a,s=e.window;;){if(e.lookahead<=l){if(k(e),e.lookahead<=l&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&0<e.strstart&&(n=s[i=e.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){a=e.strstart+l;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<a);e.match_length=l-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=o._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(m(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(m(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(m(e,!1),0===e.strm.avail_out)?1:2}(i,t):n[i.level].func(i,t);if(3!==w&&4!==w||(i.status=666),1===w||3===w)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===w&&(1===t?o._tr_align(i):5!==t&&(o._tr_stored_block(i,0,0,!1),3===t&&(v(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),g(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(y(i,255&e.adler),y(i,e.adler>>8&255),y(i,e.adler>>16&255),y(i,e.adler>>24&255),y(i,255&e.total_in),y(i,e.total_in>>8&255),y(i,e.total_in>>16&255),y(i,e.total_in>>24&255)):(b(i,e.adler>>>16),b(i,65535&e.adler)),g(e),0<i.wrap&&(i.wrap=-i.wrap),0!==i.pending?0:1)},r.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&103!==t&&t!==h&&666!==t?d(e,c):(e.state=null,t===h?d(e,-3):0):c},r.deflateSetDictionary=function(e,t){var r,n,o,s,u,l,f,h,d=t.length;if(!e||!e.state)return c;if(2===(s=(r=e.state).wrap)||1===s&&42!==r.status||r.lookahead)return c;for(1===s&&(e.adler=a(e.adler,t,d,0)),r.wrap=0,d>=r.w_size&&(0===s&&(v(r.head),r.strstart=0,r.block_start=0,r.insert=0),h=new i.Buf8(r.w_size),i.arraySet(h,t,d-r.w_size,r.w_size,0),t=h,d=r.w_size),u=e.avail_in,l=e.next_in,f=e.input,e.avail_in=d,e.next_in=0,e.input=t,k(r);r.lookahead>=3;){for(n=r.strstart,o=r.lookahead-2;r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+3-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++,--o;);r.strstart=n,r.lookahead=2,k(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=l,e.input=f,e.avail_in=u,r.wrap=s,0},r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,t,r){t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(e,t,r){t.exports=function(e,t){var r,n,i,o,a,s,u,c,l,f,h,d,p,v,g,m,y,b,w,k,_,S,x,E,O;r=e.state,n=e.next_in,E=e.input,i=n+(e.avail_in-5),o=e.next_out,O=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),u=r.dmax,c=r.wsize,l=r.whave,f=r.wnext,h=r.window,d=r.hold,p=r.bits,v=r.lencode,g=r.distcode,m=(1<<r.lenbits)-1,y=(1<<r.distbits)-1;e:do{p<15&&(d+=E[n++]<<p,p+=8,d+=E[n++]<<p,p+=8),b=v[d&m];t:for(;;){if(d>>>=w=b>>>24,p-=w,0==(w=b>>>16&255))O[o++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=v[(65535&b)+(d&(1<<w)-1)];continue t}if(32&w){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}k=65535&b,(w&=15)&&(p<w&&(d+=E[n++]<<p,p+=8),k+=d&(1<<w)-1,d>>>=w,p-=w),p<15&&(d+=E[n++]<<p,p+=8,d+=E[n++]<<p,p+=8),b=g[d&y];r:for(;;){if(d>>>=w=b>>>24,p-=w,!(16&(w=b>>>16&255))){if(0==(64&w)){b=g[(65535&b)+(d&(1<<w)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(_=65535&b,p<(w&=15)&&(d+=E[n++]<<p,(p+=8)<w&&(d+=E[n++]<<p,p+=8)),u<(_+=d&(1<<w)-1)){e.msg="invalid distance too far back",r.mode=30;break e}if(d>>>=w,p-=w,(w=o-a)<_){if(l<(w=_-w)&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(x=h,(S=0)===f){if(S+=c-w,w<k){for(k-=w;O[o++]=h[S++],--w;);S=o-_,x=O}}else if(f<w){if(S+=c+f-w,(w-=f)<k){for(k-=w;O[o++]=h[S++],--w;);if(S=0,f<k){for(k-=w=f;O[o++]=h[S++],--w;);S=o-_,x=O}}}else if(S+=f-w,w<k){for(k-=w;O[o++]=h[S++],--w;);S=o-_,x=O}for(;2<k;)O[o++]=x[S++],O[o++]=x[S++],O[o++]=x[S++],k-=3;k&&(O[o++]=x[S++],1<k&&(O[o++]=x[S++]))}else{for(S=o-_;O[o++]=O[S++],O[o++]=O[S++],O[o++]=O[S++],2<(k-=3););k&&(O[o++]=O[S++],1<k&&(O[o++]=O[S++]))}break}}break}}while(n<i&&o<s);n-=k=p>>3,d&=(1<<(p-=k<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=o<s?s-o+257:257-(o-s),r.hold=d,r.bits=p}},{}],49:[function(e,t,r){var n=e("../utils/common"),i=e("./adler32"),o=e("./crc32"),a=e("./inffast"),s=e("./inftrees"),u=-2;function c(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function l(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function f(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):u}function h(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,f(e)):u}function d(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?u:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,h(e))):u}function p(e,t){var r,n;return e?(n=new l,(e.state=n).window=null,0!==(r=d(e,t))&&(e.state=null),r):u}var v,g,m=!0;function y(e){if(m){var t;for(v=new n.Buf32(512),g=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(1,e.lens,0,288,v,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,g,0,e.work,{bits:5}),m=!1}e.lencode=v,e.lenbits=9,e.distcode=g,e.distbits=5}function b(e,t,r,i){var o,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new n.Buf8(a.wsize)),i>=a.wsize?(n.arraySet(a.window,t,r-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i<(o=a.wsize-a.wnext)&&(o=i),n.arraySet(a.window,t,r-i,o,a.wnext),(i-=o)?(n.arraySet(a.window,t,r-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}r.inflateReset=h,r.inflateReset2=d,r.inflateResetKeep=f,r.inflateInit=function(e){return p(e,15)},r.inflateInit2=p,r.inflate=function(e,t){var r,l,f,h,d,p,v,g,m,w,k,_,S,x,E,O,A,C,I,T,R,L,N,P,M=0,j=new n.Buf8(4),D=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return u;12===(r=e.state).mode&&(r.mode=13),d=e.next_out,f=e.output,v=e.avail_out,h=e.next_in,l=e.input,p=e.avail_in,g=r.hold,m=r.bits,w=p,k=v,L=0;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;m<16;){if(0===p)break e;p--,g+=l[h++]<<m,m+=8}if(2&r.wrap&&35615===g){j[r.check=0]=255&g,j[1]=g>>>8&255,r.check=o(r.check,j,2,0),m=g=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&g)<<8)+(g>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&g)){e.msg="unknown compression method",r.mode=30;break}if(m-=4,R=8+(15&(g>>>=4)),0===r.wbits)r.wbits=R;else if(R>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<R,e.adler=r.check=1,r.mode=512&g?10:12,m=g=0;break;case 2:for(;m<16;){if(0===p)break e;p--,g+=l[h++]<<m,m+=8}if(r.flags=g,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=g>>8&1),512&r.flags&&(j[0]=255&g,j[1]=g>>>8&255,r.check=o(r.check,j,2,0)),m=g=0,r.mode=3;case 3:for(;m<32;){if(0===p)break e;p--,g+=l[h++]<<m,m+=8}r.head&&(r.head.time=g),512&r.flags&&(j[0]=255&g,j[1]=g>>>8&255,j[2]=g>>>16&255,j[3]=g>>>24&255,r.check=o(r.check,j,4,0)),m=g=0,r.mode=4;case 4:for(;m<16;){if(0===p)break e;p--,g+=l[h++]<<m,m+=8}r.head&&(r.head.xflags=255&g,r.head.os=g>>8),512&r.flags&&(j[0]=255&g,j[1]=g>>>8&255,r.check=o(r.check,j,2,0)),m=g=0,r.mode=5;case 5:if(1024&r.flags){for(;m<16;){if(0===p)break e;p--,g+=l[h++]<<m,m+=8}r.length=g,r.head&&(r.head.extra_len=g),512&r.flags&&(j[0]=255&g,j[1]=g>>>8&255,r.check=o(r.check,j,2,0)),m=g=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(p<(_=r.length)&&(_=p),_&&(r.head&&(R=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,l,h,_,R)),512&r.flags&&(r.check=o(r.check,l,_,h)),p-=_,h+=_,r.length-=_),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===p)break e;for(_=0;R=l[h+_++],r.head&&R&&r.length<65536&&(r.head.name+=String.fromCharCode(R)),R&&_<p;);if(512&r.flags&&(r.check=o(r.check,l,_,h)),p-=_,h+=_,R)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===p)break e;for(_=0;R=l[h+_++],r.head&&R&&r.length<65536&&(r.head.comment+=String.fromCharCode(R)),R&&_<p;);if(512&r.flags&&(r.check=o(r.check,l,_,h)),p-=_,h+=_,R)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;m<16;){if(0===p)break e;p--,g+=l[h++]<<m,m+=8}if(g!==(65535&r.check)){e.msg="header crc mismatch",r.mode=30;break}m=g=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;m<32;){if(0===p)break e;p--,g+=l[h++]<<m,m+=8}e.adler=r.check=c(g),m=g=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=d,e.avail_out=v,e.next_in=h,e.avail_in=p,r.hold=g,r.bits=m,2;e.adler=r.check=1,r.mode=12;case 12:if(5===t||6===t)break e;case 13:if(r.last){g>>>=7&m,m-=7&m,r.mode=27;break}for(;m<3;){if(0===p)break e;p--,g+=l[h++]<<m,m+=8}switch(r.last=1&g,m-=1,3&(g>>>=1)){case 0:r.mode=14;break;case 1:if(y(r),r.mode=20,6!==t)break;g>>>=2,m-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}g>>>=2,m-=2;break;case 14:for(g>>>=7&m,m-=7&m;m<32;){if(0===p)break e;p--,g+=l[h++]<<m,m+=8}if((65535&g)!=(g>>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&g,m=g=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(_=r.length){if(p<_&&(_=p),v<_&&(_=v),0===_)break e;n.arraySet(f,l,h,_,d),p-=_,h+=_,v-=_,d+=_,r.length-=_;break}r.mode=12;break;case 17:for(;m<14;){if(0===p)break e;p--,g+=l[h++]<<m,m+=8}if(r.nlen=257+(31&g),g>>>=5,m-=5,r.ndist=1+(31&g),g>>>=5,m-=5,r.ncode=4+(15&g),g>>>=4,m-=4,286<r.nlen||30<r.ndist){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;m<3;){if(0===p)break e;p--,g+=l[h++]<<m,m+=8}r.lens[D[r.have++]]=7&g,g>>>=3,m-=3}for(;r.have<19;)r.lens[D[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,N={bits:r.lenbits},L=s(0,r.lens,0,19,r.lencode,0,r.work,N),r.lenbits=N.bits,L){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;O=(M=r.lencode[g&(1<<r.lenbits)-1])>>>16&255,A=65535&M,!((E=M>>>24)<=m);){if(0===p)break e;p--,g+=l[h++]<<m,m+=8}if(A<16)g>>>=E,m-=E,r.lens[r.have++]=A;else{if(16===A){for(P=E+2;m<P;){if(0===p)break e;p--,g+=l[h++]<<m,m+=8}if(g>>>=E,m-=E,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}R=r.lens[r.have-1],_=3+(3&g),g>>>=2,m-=2}else if(17===A){for(P=E+3;m<P;){if(0===p)break e;p--,g+=l[h++]<<m,m+=8}m-=E,R=0,_=3+(7&(g>>>=E)),g>>>=3,m-=3}else{for(P=E+7;m<P;){if(0===p)break e;p--,g+=l[h++]<<m,m+=8}m-=E,R=0,_=11+(127&(g>>>=E)),g>>>=7,m-=7}if(r.have+_>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;_--;)r.lens[r.have++]=R}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,N={bits:r.lenbits},L=s(1,r.lens,0,r.nlen,r.lencode,0,r.work,N),r.lenbits=N.bits,L){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,N={bits:r.distbits},L=s(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,N),r.distbits=N.bits,L){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=p&&258<=v){e.next_out=d,e.avail_out=v,e.next_in=h,e.avail_in=p,r.hold=g,r.bits=m,a(e,k),d=e.next_out,f=e.output,v=e.avail_out,h=e.next_in,l=e.input,p=e.avail_in,g=r.hold,m=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;O=(M=r.lencode[g&(1<<r.lenbits)-1])>>>16&255,A=65535&M,!((E=M>>>24)<=m);){if(0===p)break e;p--,g+=l[h++]<<m,m+=8}if(O&&0==(240&O)){for(C=E,I=O,T=A;O=(M=r.lencode[T+((g&(1<<C+I)-1)>>C)])>>>16&255,A=65535&M,!(C+(E=M>>>24)<=m);){if(0===p)break e;p--,g+=l[h++]<<m,m+=8}g>>>=C,m-=C,r.back+=C}if(g>>>=E,m-=E,r.back+=E,r.length=A,0===O){r.mode=26;break}if(32&O){r.back=-1,r.mode=12;break}if(64&O){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&O,r.mode=22;case 22:if(r.extra){for(P=r.extra;m<P;){if(0===p)break e;p--,g+=l[h++]<<m,m+=8}r.length+=g&(1<<r.extra)-1,g>>>=r.extra,m-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;O=(M=r.distcode[g&(1<<r.distbits)-1])>>>16&255,A=65535&M,!((E=M>>>24)<=m);){if(0===p)break e;p--,g+=l[h++]<<m,m+=8}if(0==(240&O)){for(C=E,I=O,T=A;O=(M=r.distcode[T+((g&(1<<C+I)-1)>>C)])>>>16&255,A=65535&M,!(C+(E=M>>>24)<=m);){if(0===p)break e;p--,g+=l[h++]<<m,m+=8}g>>>=C,m-=C,r.back+=C}if(g>>>=E,m-=E,r.back+=E,64&O){e.msg="invalid distance code",r.mode=30;break}r.offset=A,r.extra=15&O,r.mode=24;case 24:if(r.extra){for(P=r.extra;m<P;){if(0===p)break e;p--,g+=l[h++]<<m,m+=8}r.offset+=g&(1<<r.extra)-1,g>>>=r.extra,m-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===v)break e;if(_=k-v,r.offset>_){if((_=r.offset-_)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}S=_>r.wnext?(_-=r.wnext,r.wsize-_):r.wnext-_,_>r.length&&(_=r.length),x=r.window}else x=f,S=d-r.offset,_=r.length;for(v<_&&(_=v),v-=_,r.length-=_;f[d++]=x[S++],--_;);0===r.length&&(r.mode=21);break;case 26:if(0===v)break e;f[d++]=r.length,v--,r.mode=21;break;case 27:if(r.wrap){for(;m<32;){if(0===p)break e;p--,g|=l[h++]<<m,m+=8}if(k-=v,e.total_out+=k,r.total+=k,k&&(e.adler=r.check=r.flags?o(r.check,f,k,d-k):i(r.check,f,k,d-k)),k=v,(r.flags?g:c(g))!==r.check){e.msg="incorrect data check",r.mode=30;break}m=g=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;m<32;){if(0===p)break e;p--,g+=l[h++]<<m,m+=8}if(g!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=30;break}m=g=0}r.mode=29;case 29:L=1;break e;case 30:L=-3;break e;case 31:return-4;case 32:default:return u}return e.next_out=d,e.avail_out=v,e.next_in=h,e.avail_in=p,r.hold=g,r.bits=m,(r.wsize||k!==e.avail_out&&r.mode<30&&(r.mode<27||4!==t))&&b(e,e.output,e.next_out,k-e.avail_out)?(r.mode=31,-4):(w-=e.avail_in,k-=e.avail_out,e.total_in+=w,e.total_out+=k,r.total+=k,r.wrap&&k&&(e.adler=r.check=r.flags?o(r.check,f,k,e.next_out-k):i(r.check,f,k,e.next_out-k)),e.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0==w&&0===k||4===t)&&0===L&&(L=-5),L)},r.inflateEnd=function(e){if(!e||!e.state)return u;var t=e.state;return t.window&&(t.window=null),e.state=null,0},r.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?u:((r.head=t).done=!1,0):u},r.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?u:11===r.mode&&i(1,t,n,0)!==r.check?-3:b(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,0):u},r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,t,r){var n=e("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,r,u,c,l,f,h){var d,p,v,g,m,y,b,w,k,_=h.bits,S=0,x=0,E=0,O=0,A=0,C=0,I=0,T=0,R=0,L=0,N=null,P=0,M=new n.Buf16(16),j=new n.Buf16(16),D=null,B=0;for(S=0;S<=15;S++)M[S]=0;for(x=0;x<u;x++)M[t[r+x]]++;for(A=_,O=15;1<=O&&0===M[O];O--);if(O<A&&(A=O),0===O)return c[l++]=20971520,c[l++]=20971520,h.bits=1,0;for(E=1;E<O&&0===M[E];E++);for(A<E&&(A=E),S=T=1;S<=15;S++)if(T<<=1,(T-=M[S])<0)return-1;if(0<T&&(0===e||1!==O))return-1;for(j[1]=0,S=1;S<15;S++)j[S+1]=j[S]+M[S];for(x=0;x<u;x++)0!==t[r+x]&&(f[j[t[r+x]]++]=x);if(y=0===e?(N=D=f,19):1===e?(N=i,P-=257,D=o,B-=257,256):(N=a,D=s,-1),S=E,m=l,I=x=L=0,v=-1,g=(R=1<<(C=A))-1,1===e&&852<R||2===e&&592<R)return 1;for(;;){for(b=S-I,k=f[x]<y?(w=0,f[x]):f[x]>y?(w=D[B+f[x]],N[P+f[x]]):(w=96,0),d=1<<S-I,E=p=1<<C;c[m+(L>>I)+(p-=d)]=b<<24|w<<16|k|0,0!==p;);for(d=1<<S-1;L&d;)d>>=1;if(0!==d?(L&=d-1,L+=d):L=0,x++,0==--M[S]){if(S===O)break;S=t[r+f[x]]}if(A<S&&(L&g)!==v){for(0===I&&(I=A),m+=E,T=1<<(C=S-I);C+I<O&&!((T-=M[C+I])<=0);)C++,T<<=1;if(R+=1<<C,1===e&&852<R||2===e&&592<R)return 1;c[v=L&g]=A<<24|C<<16|m-l|0}}return 0!==L&&(c[m+L]=S-I<<24|64<<16|0),h.bits=A,0}},{"../utils/common":41}],51:[function(e,t,r){t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(e,t,r){var n=e("../utils/common");function i(e){for(var t=e.length;0<=--t;)e[t]=0}var o=256,a=286,s=30,u=15,c=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],l=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],h=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],d=new Array(576);i(d);var p=new Array(60);i(p);var v=new Array(512);i(v);var g=new Array(256);i(g);var m=new Array(29);i(m);var y,b,w,k=new Array(s);function _(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function S(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function x(e){return e<256?v[e]:v[256+(e>>>7)]}function E(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function O(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,E(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function A(e,t,r){O(e,r[2*t],r[2*t+1])}function C(e,t){for(var r=0;r|=1&e,e>>>=1,r<<=1,0<--t;);return r>>>1}function I(e,t,r){var n,i,o=new Array(16),a=0;for(n=1;n<=u;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=C(o[s]++,s))}}function T(e){var t;for(t=0;t<a;t++)e.dyn_ltree[2*t]=0;for(t=0;t<s;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function R(e){8<e.bi_valid?E(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function L(e,t,r,n){var i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]}function N(e,t,r){for(var n=e.heap[r],i=r<<1;i<=e.heap_len&&(i<e.heap_len&&L(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!L(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n}function P(e,t,r){var n,i,a,s,u=0;if(0!==e.last_lit)for(;n=e.pending_buf[e.d_buf+2*u]<<8|e.pending_buf[e.d_buf+2*u+1],i=e.pending_buf[e.l_buf+u],u++,0===n?A(e,i,t):(A(e,(a=g[i])+o+1,t),0!==(s=c[a])&&O(e,i-=m[a],s),A(e,a=x(--n),r),0!==(s=l[a])&&O(e,n-=k[a],s)),u<e.last_lit;);A(e,256,t)}function M(e,t){var r,n,i,o=t.dyn_tree,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,c=t.stat_desc.elems,l=-1;for(e.heap_len=0,e.heap_max=573,r=0;r<c;r++)0!==o[2*r]?(e.heap[++e.heap_len]=l=r,e.depth[r]=0):o[2*r+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=l<2?++l:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=a[2*i+1]);for(t.max_code=l,r=e.heap_len>>1;1<=r;r--)N(e,o,r);for(i=c;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],N(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,N(e,o,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,o,a,s,c=t.dyn_tree,l=t.max_code,f=t.stat_desc.static_tree,h=t.stat_desc.has_stree,d=t.stat_desc.extra_bits,p=t.stat_desc.extra_base,v=t.stat_desc.max_length,g=0;for(o=0;o<=u;o++)e.bl_count[o]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)v<(o=c[2*c[2*(n=e.heap[r])+1]+1]+1)&&(o=v,g++),c[2*n+1]=o,l<n||(e.bl_count[o]++,a=0,p<=n&&(a=d[n-p]),s=c[2*n],e.opt_len+=s*(o+a),h&&(e.static_len+=s*(f[2*n+1]+a)));if(0!==g){do{for(o=v-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[v]--,g-=2}while(0<g);for(o=v;0!==o;o--)for(n=e.bl_count[o];0!==n;)l<(i=e.heap[--r])||(c[2*i+1]!==o&&(e.opt_len+=(o-c[2*i+1])*c[2*i],c[2*i+1]=o),n--)}}(e,t),I(o,l,e.bl_count)}function j(e,t,r){var n,i,o=-1,a=t[1],s=0,u=7,c=4;for(0===a&&(u=138,c=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+1)+1],++s<u&&i===a||(s<c?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,o=i,c=(s=0)===a?(u=138,3):i===a?(u=6,3):(u=7,4))}function D(e,t,r){var n,i,o=-1,a=t[1],s=0,u=7,c=4;for(0===a&&(u=138,c=3),n=0;n<=r;n++)if(i=a,a=t[2*(n+1)+1],!(++s<u&&i===a)){if(s<c)for(;A(e,i,e.bl_tree),0!=--s;);else 0!==i?(i!==o&&(A(e,i,e.bl_tree),s--),A(e,16,e.bl_tree),O(e,s-3,2)):s<=10?(A(e,17,e.bl_tree),O(e,s-3,3)):(A(e,18,e.bl_tree),O(e,s-11,7));o=i,c=(s=0)===a?(u=138,3):i===a?(u=6,3):(u=7,4)}}i(k);var B=!1;function U(e,t,r,i){O(e,0+(i?1:0),3),function(e,t,r,i){R(e),E(e,r),E(e,~r),n.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r)}r._tr_init=function(e){B||(function(){var e,t,r,n,i,o=new Array(16);for(n=r=0;n<28;n++)for(m[n]=r,e=0;e<1<<c[n];e++)g[r++]=n;for(g[r-1]=n,n=i=0;n<16;n++)for(k[n]=i,e=0;e<1<<l[n];e++)v[i++]=n;for(i>>=7;n<s;n++)for(k[n]=i<<7,e=0;e<1<<l[n]-7;e++)v[256+i++]=n;for(t=0;t<=u;t++)o[t]=0;for(e=0;e<=143;)d[2*e+1]=8,e++,o[8]++;for(;e<=255;)d[2*e+1]=9,e++,o[9]++;for(;e<=279;)d[2*e+1]=7,e++,o[7]++;for(;e<=287;)d[2*e+1]=8,e++,o[8]++;for(I(d,287,o),e=0;e<s;e++)p[2*e+1]=5,p[2*e]=C(e,5);y=new _(d,c,257,a,u),b=new _(p,l,0,s,u),w=new _(new Array(0),f,0,19,7)}(),B=!0),e.l_desc=new S(e.dyn_ltree,y),e.d_desc=new S(e.dyn_dtree,b),e.bl_desc=new S(e.bl_tree,w),e.bi_buf=0,e.bi_valid=0,T(e)},r._tr_stored_block=U,r._tr_flush_block=function(e,t,r,n){var i,a,s=0;0<e.level?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<o;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),M(e,e.l_desc),M(e,e.d_desc),s=function(e){var t;for(j(e,e.dyn_ltree,e.l_desc.max_code),j(e,e.dyn_dtree,e.d_desc.max_code),M(e,e.bl_desc),t=18;3<=t&&0===e.bl_tree[2*h[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(a=e.static_len+3+7>>>3)<=i&&(i=a)):i=a=r+5,r+4<=i&&-1!==t?U(e,t,r,n):4===e.strategy||a===i?(O(e,2+(n?1:0),3),P(e,d,p)):(O(e,4+(n?1:0),3),function(e,t,r,n){var i;for(O(e,t-257,5),O(e,r-1,5),O(e,n-4,4),i=0;i<n;i++)O(e,e.bl_tree[2*h[i]+1],3);D(e,e.dyn_ltree,t-1),D(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),P(e,e.dyn_ltree,e.dyn_dtree)),T(e),n&&R(e)},r._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(g[r]+o+1)]++,e.dyn_dtree[2*x(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){O(e,2,3),A(e,256,d),function(e){16===e.bi_valid?(E(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,r){t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,r){t.exports="function"==typeof setImmediate?setImmediate:function(){var e=[].slice.apply(arguments);e.splice(1,0,0),setTimeout.apply(null,e)}},{}]},{},[10])(10)})),sl=/MSIE .\./.test(P),ul=a.Function,cl=function(e){return function(t,r){var n=arguments.length>2,i=n?wo(arguments,2):void 0;return e(n?function(){bo(I(t)?t:ul(t),this,i)}:t,r)}};Ct({global:!0,bind:!0,forced:sl},{setTimeout:cl(a.setTimeout),setInterval:cl(a.setInterval)});var ll=un.forEach,fl=ar("forEach")?[].forEach:function(e){return ll(this,e,arguments.length>1?arguments[1]:void 0)};Ct({target:"Array",proto:!0,forced:[].forEach!=fl},{forEach:fl});var hl=function(e){if(e&&e.forEach!==fl)try{Ie(e,"forEach",fl)}catch(t){e.forEach=fl}};for(var dl in Fa)Fa[dl]&&hl(a[dl]&&a[dl].prototype);hl(Va);var pl=a.Array,vl=Math.max,gl=function(e,t,r){for(var n=st(e),i=it(t,n),o=it(void 0===r?n:r,n),a=pl(vl(o-i,0)),s=0;i<o;i++,s++)Mt(a,s,e[i]);return a.length=s,a},ml=vt.f,yl="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],bl={f:function(e){return yl&&"Window"==_(e)?function(e){try{return ml(e)}catch(e){return gl(yl)}}(e):ml(C(e))}},wl=bl.f,kl=s((function(){return!Object.getOwnPropertyNames(1)}));Ct({target:"Object",stat:!0,forced:kl},{getOwnPropertyNames:wl});var _l=function(){var e=new Date;return"".concat(e.getMonth()+1,"-").concat(e.getDate()," ").concat(e.getHours(),":").concat(e.getMinutes(),":").concat(e.getSeconds()," ").concat(e.getMilliseconds())},Sl=function(){var e=new Date;return"".concat(e.getHours(),":").concat(e.getMinutes(),":").concat(e.getSeconds()," ").concat(e.getMilliseconds())},xl=function(e){var t={};return e.forEach((function(e,r){t[r]=e})),t},El=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{code:e,msg:t,detail:r}},Ol=function(){function e(){Vn(this,e),this.db=new yc("webrtc")}return Gn(e,[{key:"add",value:function(e){return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i,o,a,s,u,c,l;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.db){t.next=4;break}return this.db=new yc("webrtc"),t.next=4,this.init();case 4:try{r=e.time,n=void 0===r?"":r,i=e.title,o=void 0===i?"":i,a=e.content,s=void 0===a?"":a,u=e.rest,c=void 0===u?[]:u,l=this.num||1,this.db["webrtc_log"+l].add({t:n+JSON.stringify(o),c:JSON.stringify(s)+" "+JSON.stringify(c)}).then((function(){})).catch((function(e){console.log("add db data failed: ",e)}))}catch(e){console.log("add db data failed: ",e)}case 5:case"end":return t.stop()}}),t,this)})))}},{key:"deleteDB",value:function(){return es(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.db.delete(),yc.delete("webrtc"),Tc.set("xy-webrtc-log",{version:1,num:1}),this.num=1;case 4:case"end":return e.stop()}}),e,this)})))}},{key:"close",value:function(){this.db.close()}},{key:"stop",value:function(){var e=Tc.get("xy-webrtc-log")||{version:1,num:1};Tc.set("xy-webrtc-log",{version:e.version,num:e.num+1>3?1:e.num+1})}},{key:"isOpen",value:function(){return this.db&&this.db.isOpen()}},{key:"export",value:function(){return es(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Qc(this.db,{prettyJson:!0,progressCallback:this.progressCallback});case 3:return t=e.sent,r=_l(),e.next=7,this.generateZipBlobAsync(t,r,"");case 7:return n=e.sent,ol(n,"xy_webrtc_sdk_log_".concat(r,".zip"),"application/zip"),e.abrupt("return",!0);case 12:return e.prev=12,e.t0=e.catch(0),console.error("export db data error: "+e.t0),e.abrupt("return",!1);case 16:case"end":return e.stop()}}),e,this,[[0,12]])})))}},{key:"upload",value:function(e){return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=null,t.prev=1,t.next=4,Qc(this.db,{prettyJson:!0,progressCallback:this.progressCallback});case 4:return n=t.sent,i=_l(),t.next=8,this.generateZipBlobAsync(n,i,e);case 8:r=t.sent,t.next=14;break;case 11:t.prev=11,t.t0=t.catch(1),console.error("export blob error: "+t.t0);case 14:return t.abrupt("return",r);case 15:case"end":return t.stop()}}),t,this,[[1,11]])})))}},{key:"progressCallback",value:function(e){return e.totalRows,e.completedRows,!0}},{key:"open",value:function(){this.db.open()}},{key:"tempStart",value:function(){return es(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=Tc.get("xy-webrtc-log")||{version:1,num:1},this.initStores(t),this.db.isOpen()){e.next=5;break}return e.next=5,this.db.open();case 5:case"end":return e.stop()}}),e,this)})))}},{key:"init",value:function(){return es(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Tc.get("xy-webrtc-log")||{version:1,num:1},this.num=t.num,this.initStores(t),e.next=5,this.db["webrtc_log"+this.num].clear();case 5:if(this.isOpen()){e.next=8;break}return e.next=8,this.db.open();case 8:Tc.set("xy-webrtc-log",t);case 9:case"end":return e.stop()}}),e,this)})))}},{key:"initStores",value:function(e){this.db&&!this.db.isOpen()&&(this.db.version(e.version).stores({webrtc_log1:"++id,time,title,content,rest",webrtc_log2:"++id,time,title,content,rest",webrtc_log3:"++id,time,title,content,rest"}),this.db.version(2).stores({webrtc_log1:"++id,t,c",webrtc_log2:"++id,t,c",webrtc_log3:"++id,t,c"}).upgrade())}},{key:"generateZipBlobAsync",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return es(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=new al,n.next=3,i.file("xy_webrtc_sdk_log_".concat(r,"_").concat(t,".json"),e,{});case 3:return n.next=5,i.generateAsync({type:"blob",mimeType:"application/zip",compression:"DEFLATE",compressionOptions:{level:9}});case 5:return o=n.sent,n.abrupt("return",o);case 7:case"end":return n.stop()}}),n)})))}}]),e}(),Al=b(1..valueOf),Cl=a.RangeError,Il=a.RangeError,Tl=a.String,Rl=Math.floor,Ll=b((function(e){var t=dr(A(this)),r="",n=tt(e);if(n<0||n==1/0)throw Cl("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(t+=t))1&n&&(r+=t);return r})),Nl=b("".slice),Pl=b(1..toFixed),Ml=function(e,t,r){return 0===t?r:t%2==1?Ml(e,t-1,r*e):Ml(e*e,t/2,r)},jl=function(e,t,r){for(var n=-1,i=r;++n<6;)i+=t*e[n],e[n]=i%1e7,i=Rl(i/1e7)},Dl=function(e,t){for(var r=6,n=0;--r>=0;)n+=e[r],e[r]=Rl(n/t),n=n%t*1e7},Bl=function(e){for(var t=6,r="";--t>=0;)if(""!==r||0===t||0!==e[t]){var n=Tl(e[t]);r=""===r?n:r+Ll("0",7-n.length)+n}return r},Ul=s((function(){return"0.000"!==Pl(8e-5,3)||"1"!==Pl(.9,0)||"1.25"!==Pl(1.255,2)||"1000000000000000128"!==Pl(0xde0b6b3a7640080,0)}))||!s((function(){Pl({})}));Ct({target:"Number",proto:!0,forced:Ul},{toFixed:function(e){var t,r,n,i,o=Al(this),a=tt(e),s=[0,0,0,0,0,0],u="",c="0";if(a<0||a>20)throw Il("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return Tl(o);if(o<0&&(u="-",o=-o),o>1e-21)if(r=(t=function(e){for(var t=0,r=e;r>=4096;)t+=12,r/=4096;for(;r>=2;)t+=1,r/=2;return t}(o*Ml(2,69,1))-69)<0?o*Ml(2,-t,1):o/Ml(2,t,1),r*=4503599627370496,(t=52-t)>0){for(jl(s,0,r),n=a;n>=7;)jl(s,1e7,0),n-=7;for(jl(s,Ml(10,n,1),0),n=t-1;n>=23;)Dl(s,1<<23),n-=23;Dl(s,1<<n),jl(s,1,1),Dl(s,2),c=Bl(s)}else jl(s,0,r),jl(s,1<<-t,0),c=Bl(s)+Ll("0",a);return c=a>0?u+((i=c.length)<=a?"0."+Ll("0",a-i)+c:Nl(c,0,i-a)+"."+Nl(c,i-a)):u+c}});var Fl=ct.includes;Ct({target:"Array",proto:!0},{includes:function(e){return Fl(this,e,arguments.length>1?arguments[1]:void 0)}}),ui("includes");var zl=he("match"),Hl=a.TypeError,Vl=function(e){if(function(e){var t;return T(e)&&(void 0!==(t=e[zl])?!!t:"RegExp"==_(e))}(e))throw Hl("The method doesn't accept regular expressions");return e},Wl=he("match"),Gl=b("".indexOf);Ct({target:"String",proto:!0,forced:!function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[Wl]=!1,"/./"[e](t)}catch(e){}}return!1}("includes")},{includes:function(e){return!!~Gl(dr(A(this)),dr(Vl(e)),arguments.length>1?arguments[1]:void 0)}});var Kl=Xe.PROPER,ql=RegExp.prototype,Yl=ql.toString,Zl=b(pr),Jl=s((function(){return"/a/b"!=Yl.call({source:"a",flags:"b"})})),Xl=Kl&&"toString"!=Yl.name;(Jl||Xl)&&$e(RegExp.prototype,"toString",(function(){var e=Ee(this),t=dr(e.source),r=e.flags;return"/"+t+"/"+dr(void 0===r&&N(ql,e)&&!("flags"in ql)?Zl(e):r)}),{unsafe:!0});var $l=function(e,t){return function(){for(var r=new Array(arguments.length),n=0;n<r.length;n++)r[n]=arguments[n];return e.apply(t,r)}},Ql=Object.prototype.toString;function ef(e){return"[object Array]"===Ql.call(e)}function tf(e){return void 0===e}function rf(e){return null!==e&&"object"==typeof e}function nf(e){return"[object Function]"===Ql.call(e)}function of(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),ef(e))for(var r=0,n=e.length;r<n;r++)t.call(null,e[r],r,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}var af={isArray:ef,isArrayBuffer:function(e){return"[object ArrayBuffer]"===Ql.call(e)},isBuffer:function(e){return null!==e&&!tf(e)&&null!==e.constructor&&!tf(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:rf,isUndefined:tf,isDate:function(e){return"[object Date]"===Ql.call(e)},isFile:function(e){return"[object File]"===Ql.call(e)},isBlob:function(e){return"[object Blob]"===Ql.call(e)},isFunction:nf,isStream:function(e){return rf(e)&&nf(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:of,merge:function e(){var t={};function r(r,n){"object"==typeof t[n]&&"object"==typeof r?t[n]=e(t[n],r):t[n]=r}for(var n=0,i=arguments.length;n<i;n++)of(arguments[n],r);return t},deepMerge:function e(){var t={};function r(r,n){"object"==typeof t[n]&&"object"==typeof r?t[n]=e(t[n],r):t[n]="object"==typeof r?e({},r):r}for(var n=0,i=arguments.length;n<i;n++)of(arguments[n],r);return t},extend:function(e,t,r){return of(t,(function(t,n){e[n]=r&&"function"==typeof t?$l(t,r):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}};function sf(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var uf=function(e,t,r){if(!t)return e;var n;if(r)n=r(t);else if(af.isURLSearchParams(t))n=t.toString();else{var i=[];af.forEach(t,(function(e,t){null!=e&&(af.isArray(e)?t+="[]":e=[e],af.forEach(e,(function(e){af.isDate(e)?e=e.toISOString():af.isObject(e)&&(e=JSON.stringify(e)),i.push(sf(t)+"="+sf(e))})))})),n=i.join("&")}if(n){var o=e.indexOf("#");-1!==o&&(e=e.slice(0,o)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e};function cf(){this.handlers=[]}cf.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},cf.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},cf.prototype.forEach=function(e){af.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var lf=cf,ff=function(e,t,r){return af.forEach(r,(function(r){e=r(e,t)})),e},hf=function(e){return!(!e||!e.__CANCEL__)},df=function(e,t){af.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))},pf=function(e,t,r,n,i){return function(e,t,r,n,i){return e.config=t,r&&(e.code=r),e.request=n,e.response=i,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}(new Error(e),t,r,n,i)},vf=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],gf=af.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(e){var n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=n(window.location.href),function(t){var r=af.isString(t)?n(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0},mf=af.isStandardBrowserEnv()?{write:function(e,t,r,n,i,o){var a=[];a.push(e+"="+encodeURIComponent(t)),af.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),af.isString(n)&&a.push("path="+n),af.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},yf=function(e){return new Promise((function(t,r){var n=e.data,i=e.headers;af.isFormData(n)&&delete i["Content-Type"];var o=new XMLHttpRequest;if(e.auth){var a=e.auth.username||"",s=e.auth.password||"";i.Authorization="Basic "+btoa(a+":"+s)}var u,c,l=(u=e.baseURL,c=e.url,u&&!/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(c)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(u,c):c);if(o.open(e.method.toUpperCase(),uf(l,e.params,e.paramsSerializer),!0),o.timeout=e.timeout,o.onreadystatechange=function(){if(o&&4===o.readyState&&(0!==o.status||o.responseURL&&0===o.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in o?function(e){var t,r,n,i={};return e?(af.forEach(e.split("\n"),(function(e){if(n=e.indexOf(":"),t=af.trim(e.substr(0,n)).toLowerCase(),r=af.trim(e.substr(n+1)),t){if(i[t]&&vf.indexOf(t)>=0)return;i[t]="set-cookie"===t?(i[t]?i[t]:[]).concat([r]):i[t]?i[t]+", "+r:r}})),i):i}(o.getAllResponseHeaders()):null,i={data:e.responseType&&"text"!==e.responseType?o.response:o.responseText,status:o.status,statusText:o.statusText,headers:n,config:e,request:o};!function(e,t,r){var n=r.config.validateStatus;!n||n(r.status)?e(r):t(pf("Request failed with status code "+r.status,r.config,null,r.request,r))}(t,r,i),o=null}},o.onabort=function(){o&&(r(pf("Request aborted",e,"ECONNABORTED",o)),o=null)},o.onerror=function(){r(pf("Network Error",e,null,o)),o=null},o.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(pf(t,e,"ECONNABORTED",o)),o=null},af.isStandardBrowserEnv()){var f=mf,h=(e.withCredentials||gf(l))&&e.xsrfCookieName?f.read(e.xsrfCookieName):void 0;h&&(i[e.xsrfHeaderName]=h)}if("setRequestHeader"in o&&af.forEach(i,(function(e,t){void 0===n&&"content-type"===t.toLowerCase()?delete i[t]:o.setRequestHeader(t,e)})),af.isUndefined(e.withCredentials)||(o.withCredentials=!!e.withCredentials),e.responseType)try{o.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&o.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&o.upload&&o.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){o&&(o.abort(),r(e),o=null)})),void 0===n&&(n=null),o.send(n)}))},bf={"Content-Type":"application/x-www-form-urlencoded"};function wf(e,t){!af.isUndefined(e)&&af.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var kf,_f={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(kf=yf),kf),transformRequest:[function(e,t){return df(t,"Accept"),df(t,"Content-Type"),af.isFormData(e)||af.isArrayBuffer(e)||af.isBuffer(e)||af.isStream(e)||af.isFile(e)||af.isBlob(e)?e:af.isArrayBufferView(e)?e.buffer:af.isURLSearchParams(e)?(wf(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):af.isObject(e)?(wf(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};_f.headers={common:{Accept:"application/json, text/plain, */*"}},af.forEach(["delete","get","head"],(function(e){_f.headers[e]={}})),af.forEach(["post","put","patch"],(function(e){_f.headers[e]=af.merge(bf)}));var Sf=_f;function xf(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var Ef=function(e){return xf(e),e.headers=e.headers||{},e.data=ff(e.data,e.headers,e.transformRequest),e.headers=af.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),af.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||Sf.adapter)(e).then((function(t){return xf(e),t.data=ff(t.data,t.headers,e.transformResponse),t}),(function(t){return hf(t)||(xf(e),t&&t.response&&(t.response.data=ff(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},Of=function(e,t){t=t||{};var r={},n=["url","method","params","data"],i=["headers","auth","proxy"],o=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];af.forEach(n,(function(e){void 0!==t[e]&&(r[e]=t[e])})),af.forEach(i,(function(n){af.isObject(t[n])?r[n]=af.deepMerge(e[n],t[n]):void 0!==t[n]?r[n]=t[n]:af.isObject(e[n])?r[n]=af.deepMerge(e[n]):void 0!==e[n]&&(r[n]=e[n])})),af.forEach(o,(function(n){void 0!==t[n]?r[n]=t[n]:void 0!==e[n]&&(r[n]=e[n])}));var a=n.concat(i).concat(o),s=Object.keys(t).filter((function(e){return-1===a.indexOf(e)}));return af.forEach(s,(function(n){void 0!==t[n]?r[n]=t[n]:void 0!==e[n]&&(r[n]=e[n])})),r};function Af(e){this.defaults=e,this.interceptors={request:new lf,response:new lf}}Af.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=Of(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[Ef,void 0],r=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)r=r.then(t.shift(),t.shift());return r},Af.prototype.getUri=function(e){return e=Of(this.defaults,e),uf(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},af.forEach(["delete","get","head","options"],(function(e){Af.prototype[e]=function(t,r){return this.request(af.merge(r||{},{method:e,url:t}))}})),af.forEach(["post","put","patch"],(function(e){Af.prototype[e]=function(t,r,n){return this.request(af.merge(n||{},{method:e,url:t,data:r}))}}));var Cf=Af;function If(e){this.message=e}If.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},If.prototype.__CANCEL__=!0;var Tf=If;function Rf(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new Tf(e),t(r.reason))}))}Rf.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Rf.source=function(){var e;return{token:new Rf((function(t){e=t})),cancel:e}};var Lf=Rf;function Nf(e){var t=new Cf(e),r=$l(Cf.prototype.request,t);return af.extend(r,Cf.prototype,t),af.extend(r,t),r}var Pf=Nf(Sf);Pf.Axios=Cf,Pf.create=function(e){return Nf(Of(Pf.defaults,e))},Pf.Cancel=Tf,Pf.CancelToken=Lf,Pf.isCancel=hf,Pf.all=function(e){return Promise.all(e)},Pf.spread=function(e){return function(t){return e.apply(null,t)}};var Mf=Pf,jf=Pf;Mf.default=jf;var Df,Bf=Mf,Uf=[20400,20401,20402,20403,20404,20405],Ff={muteAudio:{type:"AUDIO_MUTE",status:!1},muteVideo:{type:"VIDEO_MUTE",status:!1},unmuteAudio:{type:"AUDIO_UN_MUTE",status:!0},unmuteVideo:{type:"VIDEO_UN_MUTE",status:!0}},zf={frameRate:{min:15,exact:15,max:15},aspectRatio:1.777777778,resizeMode:"crop-and-scale"},Hf=Object.assign({cursor:"always",frameRate:{ideal:15,max:15},logicalSurface:!0},zf),Vf={720:{min:Object.assign(Object.assign({},Hf),{frameRate:1,width:{ideal:1280,max:1280},height:{ideal:720,max:720}}),max:Object.assign(Object.assign({},Hf),{frameRate:{ideal:8,max:8},width:{ideal:1280,max:1280},height:{ideal:720,max:720}})},1080:{min:Object.assign(Object.assign({},Hf),{frameRate:1,width:{ideal:1920,max:1920},height:{ideal:1080,max:1080}}),max:Object.assign(Object.assign({},Hf),{frameRate:{ideal:8,max:8},width:{ideal:1920,max:1920},height:{ideal:1080,max:1080}})}},Wf={90:{min:Object.assign(Object.assign({},zf),{frameRate:1,width:{min:160,ideal:160,max:160},height:{min:90,ideal:90,max:90}}),max:Object.assign(Object.assign({},zf),{frameRate:{min:15,exact:15,max:15},width:{min:160,ideal:160,max:160},height:{min:90,ideal:90,max:90}})},180:{min:Object.assign(Object.assign({},zf),{frameRate:1,width:{min:320,ideal:320,max:320},height:{min:180,ideal:180,max:180}}),max:Object.assign(Object.assign({},zf),{frameRate:{min:15,exact:15,max:15},width:{min:320,ideal:320,max:320},height:{min:180,ideal:180,max:180}})},360:{min:Object.assign(Object.assign({},zf),{frameRate:1,width:{min:640,ideal:640,max:640},height:{min:360,ideal:360,max:360}}),max:Object.assign(Object.assign({},zf),{frameRate:{min:15,exact:15,max:15},width:{min:640,ideal:640,max:640},height:{min:360,ideal:360,max:360}})},720:{min:Object.assign(Object.assign({},zf),{frameRate:1,width:{min:1280,ideal:1280,max:1280},height:{min:720,ideal:720,max:720}}),max:Object.assign(Object.assign({},zf),{frameRate:{min:5,ideal:30,max:30},width:{min:1280,ideal:1280,max:1280},height:{min:720,ideal:720,max:720}})}},Gf={bundlePolicy:"max-bundle",iceCandidatePoolSize:0,iceServers:[],iceTransportPolicy:"all",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan"},Kf={OK:"STATE:200",SERVER_INNER_ERROR:"SIG:4448",PEER_NET_DISCONNECT:"SIG:403",LOCAL_NET_DISCONNECT:"SIG:499"},qf={CLIENT_TYPE:"webrtc",INIT_INTERNELS:{bytesReceived:0,bytesReceivedSecond:0,bytesSent:0,bytesSentSecond:0,mimeType:"",timestamp:0,receiver:{},sender:{}},RESOLUTION:1,ROSTER:{deviceType:"webrtc",endpointId:"",displayName:"",mediagroupid:0,participantId:0,audioTxMute:!1,videoTxMute:!1,audioRxMute:!1,videoRxMute:!1,videoMuteReason:0,isForceFullScreen:!1,isLastAdd:!1,onHold:!1,isPolling:!1,isContent:!1,isActiveSpeaker:!1,id:""},SELF_MOCK_PID:9999999999,HOR_CONTAINER_RATIO:1.778,VER_CONTAINER_RATIO:.5625,RATIO_MAP:{0:0,1:90,2:180,3:270},MAP_RESOLUTION_INDEX:{90:0,180:1,360:2,720:3,1080:4},RESOLUTION_MAP:{0:90,1:180,2:360,3:720,4:1080},VIDE_BANDWIDTH_BIT:1e3,LOGIN_INFO:{callUri:"",securityKey:"",access_token:"",refresh_token:"",id:0,displayName:""}},Yf=["SPEAKER","GALLERY"],Zf=["MULTI_PIC_CONTENT_HIGH_PRIORITY","MULTI_PIC_ACTIVE_HIGH_PRIORITY","TWO_PIC_PIP","CONTENT_ONLY","TWO_PIC_SYMMETRIC"],Jf="standardWebRtc",Xf="thirdWebrtc",$f={muteAudio:"audioMute",unmuteAudio:"audioUnmute",muteVideo:"videoMute",unmuteVideo:"videoUnmute"},Qf=640,eh=360,th=(Df=Object.freeze({__proto__:null,default:{}}))&&Df.default||Df,rh=r((function(t,r){var n;t.exports=n=n||function(t,r){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==e&&e.crypto&&(n=e.crypto),!n)try{n=th}catch(e){}var i=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),a={},s=a.lib={},u=s.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=s.WordArray=u.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||f).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o<i;o++){var a=r[o>>>2]>>>24-o%4*8&255;t[n+o>>>2]|=a<<24-(n+o)%4*8}else for(var s=0;s<i;s+=4)t[n+s>>>2]=r[s>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var e=u.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(i());return new c.init(t,e)}}),l=a.enc={},f=l.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var o=t[i>>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new c.init(r,t/2)}},h=l.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var o=t[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new c.init(r,t)}},d=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(h.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return h.parse(unescape(encodeURIComponent(e)))}},p=s.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var r,n=this._data,i=n.words,o=n.sigBytes,a=this.blockSize,s=o/(4*a),u=(s=e?t.ceil(s):t.max((0|s)-this._minBufferSize,0))*a,l=t.min(4*u,o);if(u){for(var f=0;f<u;f+=a)this._doProcessBlock(i,f);r=i.splice(0,u),n.sigBytes-=l}return new c.init(r,l)},clone:function(){var e=u.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});s.Hasher=p.extend({cfg:u.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new v.HMAC.init(e,r).finalize(t)}}});var v=a.algo={};return a}(Math)})),nh=(r((function(e,t){var r,n,i,o,a,s;e.exports=(n=(r=s=rh).lib,i=n.Base,o=n.WordArray,(a=r.x64={}).Word=i.extend({init:function(e,t){this.high=e,this.low=t}}),a.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,r=[],n=0;n<t;n++){var i=e[n];r.push(i.high),r.push(i.low)}return o.create(r,this.sigBytes)},clone:function(){for(var e=i.clone.call(this),t=e.words=this.words.slice(0),r=t.length,n=0;n<r;n++)t[n]=t[n].clone();return e}}),s)})),r((function(e,t){var r;e.exports=(r=rh,function(){if("function"==typeof ArrayBuffer){var e=r.lib.WordArray,t=e.init;(e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var r=e.byteLength,n=[],i=0;i<r;i++)n[i>>>2]|=e[i]<<24-i%4*8;t.call(this,n,r)}else t.apply(this,arguments)}).prototype=e}}(),r.lib.WordArray)})),r((function(e,t){var r;e.exports=(r=rh,function(){var e=r,t=e.lib.WordArray,n=e.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i+=2){var o=t[i>>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var r=e.length,n=[],i=0;i<r;i++)n[i>>>1]|=e.charCodeAt(i)<<16-i%2*16;return t.create(n,2*r)}},n.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o<r;o+=2){var a=i(t[o>>>2]>>>16-o%4*8&65535);n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var r=e.length,n=[],o=0;o<r;o++)n[o>>>1]|=i(e.charCodeAt(o)<<16-o%2*16);return t.create(n,2*r)}}}(),r.enc.Utf16)})),r((function(e,t){var r,n,i;e.exports=(n=(r=i=rh).lib.WordArray,r.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],o=0;o<r;o+=3)for(var a=(t[o>>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s<r;s++)i.push(n.charAt(a>>>6*(3-s)&63));var u=n.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(e){var t=e.length,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o<r.length;o++)i[r.charCodeAt(o)]=o}var a=r.charAt(64);if(a){var s=e.indexOf(a);-1!==s&&(t=s)}return function(e,t,r){for(var i=[],o=0,a=0;a<t;a++)if(a%4){var s=r[e.charCodeAt(a-1)]<<a%4*2,u=r[e.charCodeAt(a)]>>>6-a%4*2,c=s|u;i[o>>>2]|=c<<24-o%4*8,o++}return n.create(i,o)}(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},i.enc.Base64)})),r((function(e,t){var r,n,i;e.exports=(n=(r=i=rh).lib.WordArray,r.enc.Base64url={stringify:function(e,t=!0){var r=e.words,n=e.sigBytes,i=t?this._safe_map:this._map;e.clamp();for(var o=[],a=0;a<n;a+=3)for(var s=(r[a>>>2]>>>24-a%4*8&255)<<16|(r[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|r[a+2>>>2]>>>24-(a+2)%4*8&255,u=0;u<4&&a+.75*u<n;u++)o.push(i.charAt(s>>>6*(3-u)&63));var c=i.charAt(64);if(c)for(;o.length%4;)o.push(c);return o.join("")},parse:function(e,t=!0){var r=e.length,i=t?this._safe_map:this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var a=0;a<i.length;a++)o[i.charCodeAt(a)]=a}var s=i.charAt(64);if(s){var u=e.indexOf(s);-1!==u&&(r=u)}return function(e,t,r){for(var i=[],o=0,a=0;a<t;a++)if(a%4){var s=r[e.charCodeAt(a-1)]<<a%4*2,u=r[e.charCodeAt(a)]>>>6-a%4*2,c=s|u;i[o>>>2]|=c<<24-o%4*8,o++}return n.create(i,o)}(e,r,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"},i.enc.Base64url)})),r((function(e,t){var r;e.exports=(r=rh,function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var u=a.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,a=e[t+0],u=e[t+1],d=e[t+2],p=e[t+3],v=e[t+4],g=e[t+5],m=e[t+6],y=e[t+7],b=e[t+8],w=e[t+9],k=e[t+10],_=e[t+11],S=e[t+12],x=e[t+13],E=e[t+14],O=e[t+15],A=o[0],C=o[1],I=o[2],T=o[3];A=c(A,C,I,T,a,7,s[0]),T=c(T,A,C,I,u,12,s[1]),I=c(I,T,A,C,d,17,s[2]),C=c(C,I,T,A,p,22,s[3]),A=c(A,C,I,T,v,7,s[4]),T=c(T,A,C,I,g,12,s[5]),I=c(I,T,A,C,m,17,s[6]),C=c(C,I,T,A,y,22,s[7]),A=c(A,C,I,T,b,7,s[8]),T=c(T,A,C,I,w,12,s[9]),I=c(I,T,A,C,k,17,s[10]),C=c(C,I,T,A,_,22,s[11]),A=c(A,C,I,T,S,7,s[12]),T=c(T,A,C,I,x,12,s[13]),I=c(I,T,A,C,E,17,s[14]),A=l(A,C=c(C,I,T,A,O,22,s[15]),I,T,u,5,s[16]),T=l(T,A,C,I,m,9,s[17]),I=l(I,T,A,C,_,14,s[18]),C=l(C,I,T,A,a,20,s[19]),A=l(A,C,I,T,g,5,s[20]),T=l(T,A,C,I,k,9,s[21]),I=l(I,T,A,C,O,14,s[22]),C=l(C,I,T,A,v,20,s[23]),A=l(A,C,I,T,w,5,s[24]),T=l(T,A,C,I,E,9,s[25]),I=l(I,T,A,C,p,14,s[26]),C=l(C,I,T,A,b,20,s[27]),A=l(A,C,I,T,x,5,s[28]),T=l(T,A,C,I,d,9,s[29]),I=l(I,T,A,C,y,14,s[30]),A=f(A,C=l(C,I,T,A,S,20,s[31]),I,T,g,4,s[32]),T=f(T,A,C,I,b,11,s[33]),I=f(I,T,A,C,_,16,s[34]),C=f(C,I,T,A,E,23,s[35]),A=f(A,C,I,T,u,4,s[36]),T=f(T,A,C,I,v,11,s[37]),I=f(I,T,A,C,y,16,s[38]),C=f(C,I,T,A,k,23,s[39]),A=f(A,C,I,T,x,4,s[40]),T=f(T,A,C,I,a,11,s[41]),I=f(I,T,A,C,p,16,s[42]),C=f(C,I,T,A,m,23,s[43]),A=f(A,C,I,T,w,4,s[44]),T=f(T,A,C,I,S,11,s[45]),I=f(I,T,A,C,O,16,s[46]),A=h(A,C=f(C,I,T,A,d,23,s[47]),I,T,a,6,s[48]),T=h(T,A,C,I,y,10,s[49]),I=h(I,T,A,C,E,15,s[50]),C=h(C,I,T,A,g,21,s[51]),A=h(A,C,I,T,S,6,s[52]),T=h(T,A,C,I,p,10,s[53]),I=h(I,T,A,C,k,15,s[54]),C=h(C,I,T,A,u,21,s[55]),A=h(A,C,I,T,b,6,s[56]),T=h(T,A,C,I,O,10,s[57]),I=h(I,T,A,C,m,15,s[58]),C=h(C,I,T,A,x,21,s[59]),A=h(A,C,I,T,v,6,s[60]),T=h(T,A,C,I,_,10,s[61]),I=h(I,T,A,C,d,15,s[62]),C=h(C,I,T,A,w,21,s[63]),o[0]=o[0]+A|0,o[1]=o[1]+C|0,o[2]=o[2]+I|0,o[3]=o[3]+T|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var o=e.floor(n/4294967296),a=n;r[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,u=s.words,c=0;c<4;c++){var l=u[c];u[c]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return s},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function c(e,t,r,n,i,o,a){var s=e+(t&r|~t&n)+i+a;return(s<<o|s>>>32-o)+t}function l(e,t,r,n,i,o,a){var s=e+(t&n|r&~n)+i+a;return(s<<o|s>>>32-o)+t}function f(e,t,r,n,i,o,a){var s=e+(t^r^n)+i+a;return(s<<o|s>>>32-o)+t}function h(e,t,r,n,i,o,a){var s=e+(r^(t|~n))+i+a;return(s<<o|s>>>32-o)+t}t.MD5=o._createHelper(u),t.HmacMD5=o._createHmacHelper(u)}(Math),r.MD5)})),r((function(e,t){var r,n,i,o,a,s,u,c;e.exports=(n=(r=c=rh).lib,i=n.WordArray,o=n.Hasher,a=r.algo,s=[],u=a.SHA1=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],u=r[4],c=0;c<80;c++){if(c<16)s[c]=0|e[t+c];else{var l=s[c-3]^s[c-8]^s[c-14]^s[c-16];s[c]=l<<1|l>>>31}var f=(n<<5|n>>>27)+u+s[c];f+=c<20?1518500249+(i&o|~i&a):c<40?1859775393+(i^o^a):c<60?(i&o|i&a|o&a)-1894007588:(i^o^a)-899497514,u=a,a=o,o=i<<30|i>>>2,i=n,n=f}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+u|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}}),r.SHA1=o._createHelper(u),r.HmacSHA1=o._createHmacHelper(u),c.SHA1)})),r((function(e,t){var r;e.exports=(r=rh,function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=[],u=[];!function(){function t(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)t(n)&&(i<8&&(s[i]=r(e.pow(n,.5))),u[i]=r(e.pow(n,1/3)),i++),n++}();var c=[],l=a.SHA256=o.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],l=r[5],f=r[6],h=r[7],d=0;d<64;d++){if(d<16)c[d]=0|e[t+d];else{var p=c[d-15],v=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,g=c[d-2],m=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;c[d]=v+c[d-7]+m+c[d-16]}var y=n&i^n&o^i&o,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),w=h+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&f)+u[d]+c[d];h=f,f=l,l=s,s=a+w|0,a=o,o=i,i=n,n=w+(b+y)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0,r[5]=r[5]+l|0,r[6]=r[6]+f|0,r[7]=r[7]+h|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=e.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=o._createHelper(l),t.HmacSHA256=o._createHmacHelper(l)}(Math),r.SHA256)})),r((function(e,t){var r,n,i,o,a,s;e.exports=(n=(r=s=rh).lib.WordArray,i=r.algo,o=i.SHA256,a=i.SHA224=o.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=o._doFinalize.call(this);return e.sigBytes-=4,e}}),r.SHA224=o._createHelper(a),r.HmacSHA224=o._createHmacHelper(a),s.SHA224)})),r((function(e,t){var r;e.exports=(r=rh,function(){var e=r,t=e.lib.Hasher,n=e.x64,i=n.Word,o=n.WordArray,a=e.algo;function s(){return i.create.apply(i,arguments)}var u=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],c=[];!function(){for(var e=0;e<80;e++)c[e]=s()}();var l=a.SHA512=t.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],l=r[5],f=r[6],h=r[7],d=n.high,p=n.low,v=i.high,g=i.low,m=o.high,y=o.low,b=a.high,w=a.low,k=s.high,_=s.low,S=l.high,x=l.low,E=f.high,O=f.low,A=h.high,C=h.low,I=d,T=p,R=v,L=g,N=m,P=y,M=b,j=w,D=k,B=_,U=S,F=x,z=E,H=O,V=A,W=C,G=0;G<80;G++){var K,q,Y=c[G];if(G<16)q=Y.high=0|e[t+2*G],K=Y.low=0|e[t+2*G+1];else{var Z=c[G-15],J=Z.high,X=Z.low,$=(J>>>1|X<<31)^(J>>>8|X<<24)^J>>>7,Q=(X>>>1|J<<31)^(X>>>8|J<<24)^(X>>>7|J<<25),ee=c[G-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),oe=c[G-7],ae=oe.high,se=oe.low,ue=c[G-16],ce=ue.high,le=ue.low;q=(q=(q=$+ae+((K=Q+se)>>>0<Q>>>0?1:0))+ne+((K+=ie)>>>0<ie>>>0?1:0))+ce+((K+=le)>>>0<le>>>0?1:0),Y.high=q,Y.low=K}var fe,he=D&U^~D&z,de=B&F^~B&H,pe=I&R^I&N^R&N,ve=T&L^T&P^L&P,ge=(I>>>28|T<<4)^(I<<30|T>>>2)^(I<<25|T>>>7),me=(T>>>28|I<<4)^(T<<30|I>>>2)^(T<<25|I>>>7),ye=(D>>>14|B<<18)^(D>>>18|B<<14)^(D<<23|B>>>9),be=(B>>>14|D<<18)^(B>>>18|D<<14)^(B<<23|D>>>9),we=u[G],ke=we.high,_e=we.low,Se=V+ye+((fe=W+be)>>>0<W>>>0?1:0),xe=me+ve;V=z,W=H,z=U,H=F,U=D,F=B,D=M+(Se=(Se=(Se=Se+he+((fe+=de)>>>0<de>>>0?1:0))+ke+((fe+=_e)>>>0<_e>>>0?1:0))+q+((fe+=K)>>>0<K>>>0?1:0))+((B=j+fe|0)>>>0<j>>>0?1:0)|0,M=N,j=P,N=R,P=L,R=I,L=T,I=Se+(ge+pe+(xe>>>0<me>>>0?1:0))+((T=fe+xe|0)>>>0<fe>>>0?1:0)|0}p=n.low=p+T,n.high=d+I+(p>>>0<T>>>0?1:0),g=i.low=g+L,i.high=v+R+(g>>>0<L>>>0?1:0),y=o.low=y+P,o.high=m+N+(y>>>0<P>>>0?1:0),w=a.low=w+j,a.high=b+M+(w>>>0<j>>>0?1:0),_=s.low=_+B,s.high=k+D+(_>>>0<B>>>0?1:0),x=l.low=x+F,l.high=S+U+(x>>>0<F>>>0?1:0),O=f.low=O+H,f.high=E+z+(O>>>0<H>>>0?1:0),C=h.low=C+W,h.high=A+V+(C>>>0<W>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(l),e.HmacSHA512=t._createHmacHelper(l)}(),r.SHA512)})),r((function(e,t){var r,n,i,o,a,s,u,c;e.exports=(n=(r=c=rh).x64,i=n.Word,o=n.WordArray,a=r.algo,s=a.SHA512,u=a.SHA384=s.extend({_doReset:function(){this._hash=new o.init([new i.init(3418070365,3238371032),new i.init(1654270250,914150663),new i.init(2438529370,812702999),new i.init(355462360,4144912697),new i.init(1731405415,4290775857),new i.init(2394180231,1750603025),new i.init(3675008525,1694076839),new i.init(1203062813,3204075428)])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=16,e}}),r.SHA384=s._createHelper(u),r.HmacSHA384=s._createHmacHelper(u),c.SHA384)})),r((function(e,t){var r;e.exports=(r=rh,function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.x64.Word,s=t.algo,u=[],c=[],l=[];!function(){for(var e=1,t=0,r=0;r<24;r++){u[e+5*t]=(r+1)*(r+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)c[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,o=0;o<24;o++){for(var s=0,f=0,h=0;h<7;h++){if(1&i){var d=(1<<h)-1;d<32?f^=1<<d:s^=1<<d-32}128&i?i=i<<1^113:i<<=1}l[o]=a.create(s,f)}}();var f=[];!function(){for(var e=0;e<25;e++)f[e]=a.create()}();var h=s.SHA3=o.extend({cfg:o.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new a.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var r=this._state,n=this.blockSize/2,i=0;i<n;i++){var o=e[t+2*i],a=e[t+2*i+1];o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(C=r[i]).high^=a,C.low^=o}for(var s=0;s<24;s++){for(var h=0;h<5;h++){for(var d=0,p=0,v=0;v<5;v++)d^=(C=r[h+5*v]).high,p^=C.low;var g=f[h];g.high=d,g.low=p}for(h=0;h<5;h++){var m=f[(h+4)%5],y=f[(h+1)%5],b=y.high,w=y.low;for(d=m.high^(b<<1|w>>>31),p=m.low^(w<<1|b>>>31),v=0;v<5;v++)(C=r[h+5*v]).high^=d,C.low^=p}for(var k=1;k<25;k++){var _=(C=r[k]).high,S=C.low,x=u[k];x<32?(d=_<<x|S>>>32-x,p=S<<x|_>>>32-x):(d=S<<x-32|_>>>64-x,p=_<<x-32|S>>>64-x);var E=f[c[k]];E.high=d,E.low=p}var O=f[0],A=r[0];for(O.high=A.high,O.low=A.low,h=0;h<5;h++)for(v=0;v<5;v++){var C=r[k=h+5*v],I=f[k],T=f[(h+1)%5+5*v],R=f[(h+2)%5+5*v];C.high=I.high^~T.high&R.high,C.low=I.low^~T.low&R.low}C=r[0];var L=l[s];C.high^=L.high,C.low^=L.low}},_doFinalize:function(){var t=this._data,r=t.words;this._nDataBytes;var n=8*t.sigBytes,o=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(e.ceil((n+1)/o)*o>>>5)-1]|=128,t.sigBytes=4*r.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,u=s/8,c=[],l=0;l<u;l++){var f=a[l],h=f.high,d=f.low;h=16711935&(h<<8|h>>>24)|4278255360&(h<<24|h>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),c.push(d),c.push(h)}return new i.init(c,s)},clone:function(){for(var e=o.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});t.SHA3=o._createHelper(h),t.HmacSHA3=o._createHmacHelper(h)}(Math),r.SHA3)})),r((function(e,t){var r;e.exports=(r=rh,function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),u=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),c=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),l=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),f=i.create([0,1518500249,1859775393,2400959708,2840853838]),h=i.create([1352829926,1548603684,1836072691,2053994217,0]),d=a.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,a,d,w,k,_,S,x,E,O,A,C=this._hash.words,I=f.words,T=h.words,R=s.words,L=u.words,N=c.words,P=l.words;for(_=o=C[0],S=a=C[1],x=d=C[2],E=w=C[3],O=k=C[4],r=0;r<80;r+=1)A=o+e[t+R[r]]|0,A+=r<16?p(a,d,w)+I[0]:r<32?v(a,d,w)+I[1]:r<48?g(a,d,w)+I[2]:r<64?m(a,d,w)+I[3]:y(a,d,w)+I[4],A=(A=b(A|=0,N[r]))+k|0,o=k,k=w,w=b(d,10),d=a,a=A,A=_+e[t+L[r]]|0,A+=r<16?y(S,x,E)+T[0]:r<32?m(S,x,E)+T[1]:r<48?g(S,x,E)+T[2]:r<64?v(S,x,E)+T[3]:p(S,x,E)+T[4],A=(A=b(A|=0,P[r]))+O|0,_=O,O=E,E=b(x,10),x=S,S=A;A=C[1]+d+E|0,C[1]=C[2]+w+O|0,C[2]=C[3]+k+_|0,C[3]=C[4]+o+S|0,C[4]=C[0]+a+x|0,C[0]=A},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,o=i.words,a=0;a<5;a++){var s=o[a];o[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function p(e,t,r){return e^t^r}function v(e,t,r){return e&t|~e&r}function g(e,t,r){return(e|~t)^r}function m(e,t,r){return e&r|t&~r}function y(e,t,r){return e^(t|~r)}function b(e,t){return e<<t|e>>>32-t}t.RIPEMD160=o._createHelper(d),t.HmacRIPEMD160=o._createHmacHelper(d)}(),r.RIPEMD160)})),r((function(e,t){var r,n,i;e.exports=(n=(r=rh).lib.Base,i=r.enc.Utf8,void(r.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=i.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),a=this._iKey=t.clone(),s=o.words,u=a.words,c=0;c<r;c++)s[c]^=1549556828,u[c]^=909522486;o.sigBytes=a.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,r=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(r))}})))})),r((function(e,t){var r,n,i,o,a,s,u,c,l;e.exports=(n=(r=l=rh).lib,i=n.Base,o=n.WordArray,a=r.algo,s=a.SHA1,u=a.HMAC,c=a.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:s,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=u.create(r.hasher,e),i=o.create(),a=o.create([1]),s=i.words,c=a.words,l=r.keySize,f=r.iterations;s.length<l;){var h=n.update(t).finalize(a);n.reset();for(var d=h.words,p=d.length,v=h,g=1;g<f;g++){v=n.finalize(v),n.reset();for(var m=v.words,y=0;y<p;y++)d[y]^=m[y]}i.concat(h),c[0]++}return i.sigBytes=4*l,i}}),r.PBKDF2=function(e,t,r){return c.create(r).compute(e,t)},l.PBKDF2)})),r((function(e,t){var r,n,i,o,a,s,u,c;e.exports=(n=(r=c=rh).lib,i=n.Base,o=n.WordArray,a=r.algo,s=a.MD5,u=a.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:s,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r,n=this.cfg,i=n.hasher.create(),a=o.create(),s=a.words,u=n.keySize,c=n.iterations;s.length<u;){r&&i.update(r),r=i.update(e).finalize(t),i.reset();for(var l=1;l<c;l++)r=i.finalize(r),i.reset();a.concat(r)}return a.sigBytes=4*u,a}}),r.EvpKDF=function(e,t,r){return u.create(r).compute(e,t)},c.EvpKDF)})),r((function(e,t){var r;e.exports=void((r=rh).lib.Cipher||function(e){var t=r,n=t.lib,i=n.Base,o=n.WordArray,a=n.BufferedBlockAlgorithm,s=t.enc;s.Utf8;var u=s.Base64,c=t.algo.EvpKDF,l=n.Cipher=a.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,r){this.cfg=this.cfg.extend(r),this._xformMode=e,this._key=t,this.reset()},reset:function(){a.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?b:m}return function(t){return{encrypt:function(r,n,i){return e(n).encrypt(t,r,n,i)},decrypt:function(r,n,i){return e(n).decrypt(t,r,n,i)}}}}()});n.StreamCipher=l.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var f=t.mode={},h=n.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),d=f.CBC=function(){var e=h.extend();function t(e,t,r){var n,i=this._iv;i?(n=i,this._iv=void 0):n=this._prevBlock;for(var o=0;o<r;o++)e[t+o]^=n[o]}return e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize;t.call(this,e,r,i),n.encryptBlock(e,r),this._prevBlock=e.slice(r,r+i)}}),e.Decryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize,o=e.slice(r,r+i);n.decryptBlock(e,r),t.call(this,e,r,i),this._prevBlock=o}}),e}(),p=(t.pad={}).Pkcs7={pad:function(e,t){for(var r=4*t,n=r-e.sigBytes%r,i=n<<24|n<<16|n<<8|n,a=[],s=0;s<n;s+=4)a.push(i);var u=o.create(a,n);e.concat(u)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}};n.BlockCipher=l.extend({cfg:l.cfg.extend({mode:d,padding:p}),reset:function(){var e;l.reset.call(this);var t=this.cfg,r=t.iv,n=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=n.createEncryptor:(e=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,r&&r.words):(this._mode=e.call(n,this,r&&r.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4});var v=n.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),g=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;return(r?o.create([1398893684,1701076831]).concat(r).concat(t):t).toString(u)},parse:function(e){var t,r=u.parse(e),n=r.words;return 1398893684==n[0]&&1701076831==n[1]&&(t=o.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),v.create({ciphertext:r,salt:t})}},m=n.SerializableCipher=i.extend({cfg:i.extend({format:g}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),o=i.finalize(t),a=i.cfg;return v.create({ciphertext:o,key:r,iv:a.iv,algorithm:e,mode:a.mode,padding:a.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),y=(t.kdf={}).OpenSSL={execute:function(e,t,r,n){n||(n=o.random(8));var i=c.create({keySize:t+r}).compute(e,n),a=o.create(i.words.slice(t),4*r);return i.sigBytes=4*t,v.create({key:i,iv:a,salt:n})}},b=n.PasswordBasedCipher=m.extend({cfg:m.cfg.extend({kdf:y}),encrypt:function(e,t,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize);n.iv=i.iv;var o=m.encrypt.call(this,e,t,i.key,n);return o.mixIn(i),o},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);return n.iv=i.iv,m.decrypt.call(this,e,t,i.key,n)}})}())})),r((function(e,t){var r;e.exports=((r=rh).mode.CFB=function(){var e=r.lib.BlockCipherMode.extend();function t(e,t,r,n){var i,o=this._iv;o?(i=o.slice(0),this._iv=void 0):i=this._prevBlock,n.encryptBlock(i,0);for(var a=0;a<r;a++)e[t+a]^=i[a]}return e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize;t.call(this,e,r,i,n),this._prevBlock=e.slice(r,r+i)}}),e.Decryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize,o=e.slice(r,r+i);t.call(this,e,r,i,n),this._prevBlock=o}}),e}(),r.mode.CFB)})),r((function(e,t){var r,n,i;e.exports=((i=rh).mode.CTR=(r=i.lib.BlockCipherMode.extend(),n=r.Encryptor=r.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,i=this._iv,o=this._counter;i&&(o=this._counter=i.slice(0),this._iv=void 0);var a=o.slice(0);r.encryptBlock(a,0),o[n-1]=o[n-1]+1|0;for(var s=0;s<n;s++)e[t+s]^=a[s]}}),r.Decryptor=n,r),i.mode.CTR)})),r((function(e,t){var r;e.exports=((r=rh).mode.CTRGladman=function(){var e=r.lib.BlockCipherMode.extend();function t(e){if(255==(e>>24&255)){var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}else e+=1<<24;return e}var n=e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0),function(e){0===(e[0]=t(e[0]))&&(e[1]=t(e[1]))}(a);var s=a.slice(0);n.encryptBlock(s,0);for(var u=0;u<i;u++)e[r+u]^=s[u]}});return e.Decryptor=n,e}(),r.mode.CTRGladman)})),r((function(e,t){var r,n,i;e.exports=((i=rh).mode.OFB=(r=i.lib.BlockCipherMode.extend(),n=r.Encryptor=r.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,i=this._iv,o=this._keystream;i&&(o=this._keystream=i.slice(0),this._iv=void 0),r.encryptBlock(o,0);for(var a=0;a<n;a++)e[t+a]^=o[a]}}),r.Decryptor=n,r),i.mode.OFB)})),r((function(e,t){var r,n;e.exports=((n=rh).mode.ECB=((r=n.lib.BlockCipherMode.extend()).Encryptor=r.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),r.Decryptor=r.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),r),n.mode.ECB)})),r((function(e,t){var r;e.exports=((r=rh).pad.AnsiX923={pad:function(e,t){var r=e.sigBytes,n=4*t,i=n-r%n,o=r+i-1;e.clamp(),e.words[o>>>2]|=i<<24-o%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Ansix923)})),r((function(e,t){var r;e.exports=((r=rh).pad.Iso10126={pad:function(e,t){var n=4*t,i=n-e.sigBytes%n;e.concat(r.lib.WordArray.random(i-1)).concat(r.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Iso10126)})),r((function(e,t){var r;e.exports=((r=rh).pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971)})),r((function(e,t){var r;e.exports=((r=rh).pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){var t=e.words,r=e.sigBytes-1;for(r=e.sigBytes-1;r>=0;r--)if(t[r>>>2]>>>24-r%4*8&255){e.sigBytes=r+1;break}}},r.pad.ZeroPadding)})),r((function(e,t){var r;e.exports=((r=rh).pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding)})),r((function(e,t){var r,n,i,o;e.exports=(n=(r=o=rh).lib.CipherParams,i=r.enc.Hex,r.format.Hex={stringify:function(e){return e.ciphertext.toString(i)},parse:function(e){var t=i.parse(e);return n.create({ciphertext:t})}},o.format.Hex)})),r((function(e,t){var r;e.exports=(r=rh,function(){var e=r,t=e.lib.BlockCipher,n=e.algo,i=[],o=[],a=[],s=[],u=[],c=[],l=[],f=[],h=[],d=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,n=0;for(t=0;t<256;t++){var p=n^n<<1^n<<2^n<<3^n<<4;p=p>>>8^255&p^99,i[r]=p,o[p]=r;var v=e[r],g=e[v],m=e[g],y=257*e[p]^16843008*p;a[r]=y<<24|y>>>8,s[r]=y<<16|y>>>16,u[r]=y<<8|y>>>24,c[r]=y,y=16843009*m^65537*g^257*v^16843008*r,l[p]=y<<24|y>>>8,f[p]=y<<16|y>>>16,h[p]=y<<8|y>>>24,d[p]=y,r?(r=v^e[e[e[m^v]]],n^=e[e[n]]):r=n=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],v=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],a=0;a<n;a++)a<r?o[a]=t[a]:(c=o[a-1],a%r?r>6&&a%r==4&&(c=i[c>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c]):(c=i[(c=c<<8|c>>>24)>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c],c^=p[a/r|0]<<24),o[a]=o[a-r]^c);for(var s=this._invKeySchedule=[],u=0;u<n;u++){if(a=n-u,u%4)var c=o[a];else c=o[a-4];s[u]=u<4||a<=4?c:l[i[c>>>24]]^f[i[c>>>16&255]]^h[i[c>>>8&255]]^d[i[255&c]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,u,c,i)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,l,f,h,d,o),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,o,a,s){for(var u=this._nRounds,c=e[t]^r[0],l=e[t+1]^r[1],f=e[t+2]^r[2],h=e[t+3]^r[3],d=4,p=1;p<u;p++){var v=n[c>>>24]^i[l>>>16&255]^o[f>>>8&255]^a[255&h]^r[d++],g=n[l>>>24]^i[f>>>16&255]^o[h>>>8&255]^a[255&c]^r[d++],m=n[f>>>24]^i[h>>>16&255]^o[c>>>8&255]^a[255&l]^r[d++],y=n[h>>>24]^i[c>>>16&255]^o[l>>>8&255]^a[255&f]^r[d++];c=v,l=g,f=m,h=y}v=(s[c>>>24]<<24|s[l>>>16&255]<<16|s[f>>>8&255]<<8|s[255&h])^r[d++],g=(s[l>>>24]<<24|s[f>>>16&255]<<16|s[h>>>8&255]<<8|s[255&c])^r[d++],m=(s[f>>>24]<<24|s[h>>>16&255]<<16|s[c>>>8&255]<<8|s[255&l])^r[d++],y=(s[h>>>24]<<24|s[c>>>16&255]<<16|s[l>>>8&255]<<8|s[255&f])^r[d++],e[t]=v,e[t+1]=g,e[t+2]=m,e[t+3]=y},keySize:8});e.AES=t._createHelper(v)}(),r.AES)})),r((function(e,t){var r;e.exports=(r=rh,function(){var e=r,t=e.lib,n=t.WordArray,i=t.BlockCipher,o=e.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],f=o.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=a[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var c=i[o]=[],l=u[o];for(r=0;r<24;r++)c[r/6|0]|=t[(s[r]-1+l)%28]<<31-r%6,c[4+(r/6|0)]|=t[28+(s[r+24]-1+l)%28]<<31-r%6;for(c[0]=c[0]<<1|c[0]>>>31,r=1;r<7;r++)c[r]=c[r]>>>4*(r-1)+3;c[7]=c[7]<<5|c[7]>>>27}var f=this._invSubKeys=[];for(r=0;r<16;r++)f[r]=i[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],h.call(this,4,252645135),h.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),h.call(this,1,1431655765);for(var n=0;n<16;n++){for(var i=r[n],o=this._lBlock,a=this._rBlock,s=0,u=0;u<8;u++)s|=c[u][((a^i[u])&l[u])>>>0];this._lBlock=a,this._rBlock=o^s}var f=this._lBlock;this._lBlock=this._rBlock,this._rBlock=f,h.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),h.call(this,16,65535),h.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function h(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<<e}function d(e,t){var r=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<<e}e.DES=i._createHelper(f);var p=o.TripleDES=i.extend({_doReset:function(){var e=this._key.words;if(2!==e.length&&4!==e.length&&e.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var t=e.slice(0,2),r=e.length<4?e.slice(0,2):e.slice(2,4),i=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=f.createEncryptor(n.create(t)),this._des2=f.createEncryptor(n.create(r)),this._des3=f.createEncryptor(n.create(i))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=i._createHelper(p)}(),r.TripleDES)})),r((function(e,t){var r;e.exports=(r=rh,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=n.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,n=this._S=[],i=0;i<256;i++)n[i]=i;i=0;for(var o=0;i<256;i++){var a=i%r,s=t[a>>>2]>>>24-a%4*8&255;o=(o+n[i]+s)%256;var u=n[i];n[i]=n[o],n[o]=u}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var e=this._S,t=this._i,r=this._j,n=0,i=0;i<4;i++){r=(r+e[t=(t+1)%256])%256;var o=e[t];e[t]=e[r],e[r]=o,n|=e[(e[t]+e[r])%256]<<24-8*i}return this._i=t,this._j=r,n}e.RC4=t._createHelper(i);var a=n.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)o.call(this)}});e.RC4Drop=t._createHelper(a)}(),r.RC4)})),r((function(e,t){var r;e.exports=(r=rh,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=[],o=[],a=[],s=n.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>8);var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,r=0;r<4;r++)u.call(this);for(r=0;r<8;r++)i[r]^=n[r+4&7];if(t){var o=t.words,a=o[0],s=o[1],c=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&l,h=l<<16|65535&c;for(i[0]^=c,i[1]^=f,i[2]^=l,i[3]^=h,i[4]^=c,i[5]^=f,i[6]^=l,i[7]^=h,r=0;r<4;r++)u.call(this)}},_doProcessBlock:function(e,t){var r=this._X;u.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function u(){for(var e=this._X,t=this._C,r=0;r<8;r++)o[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<o[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<o[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<o[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<o[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<o[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<o[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<o[6]>>>0?1:0)|0,this._b=t[7]>>>0<o[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,s=n>>>16,u=((i*i>>>17)+i*s>>>15)+s*s,c=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=u^c}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.Rabbit=t._createHelper(s)}(),r.Rabbit)})),r((function(e,t){var r;e.exports=(r=rh,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=[],o=[],a=[],s=n.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)u.call(this);for(i=0;i<8;i++)n[i]^=r[i+4&7];if(t){var o=t.words,a=o[0],s=o[1],c=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),f=c>>>16|4294901760&l,h=l<<16|65535&c;for(n[0]^=c,n[1]^=f,n[2]^=l,n[3]^=h,n[4]^=c,n[5]^=f,n[6]^=l,n[7]^=h,i=0;i<4;i++)u.call(this)}},_doProcessBlock:function(e,t){var r=this._X;u.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function u(){for(var e=this._X,t=this._C,r=0;r<8;r++)o[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<o[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<o[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<o[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<o[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<o[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<o[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<o[6]>>>0?1:0)|0,this._b=t[7]>>>0<o[7]>>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,s=n>>>16,u=((i*i>>>17)+i*s>>>15)+s*s,c=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=u^c}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.RabbitLegacy=t._createHelper(s)}(),r.RabbitLegacy)})),r((function(e,t){e.exports=rh}))),ih="undefined"!=typeof Symbol&&Symbol,oh="Function.prototype.bind called on incompatible ",ah=Array.prototype.slice,sh=Object.prototype.toString,uh=Function.prototype.bind||function(e){var t=this;if("function"!=typeof t||"[object Function]"!==sh.call(t))throw new TypeError(oh+t);for(var r,n=ah.call(arguments,1),i=function(){if(this instanceof r){var i=t.apply(this,n.concat(ah.call(arguments)));return Object(i)===i?i:this}return t.apply(e,n.concat(ah.call(arguments)))},o=Math.max(0,t.length-n.length),a=[],s=0;s<o;s++)a.push("$"+s);if(r=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(i),t.prototype){var u=function(){};u.prototype=t.prototype,r.prototype=new u,u.prototype=null}return r},ch=uh.call(Function.call,Object.prototype.hasOwnProperty),lh=SyntaxError,fh=Function,hh=TypeError,dh=function(e){try{return fh('"use strict"; return ('+e+").constructor;")()}catch(e){}},ph=Object.getOwnPropertyDescriptor;if(ph)try{ph({},"")}catch(e){ph=null}var vh=function(){throw new hh},gh=ph?function(){try{return vh}catch(e){try{return ph(arguments,"callee").get}catch(e){return vh}}}():vh,mh="function"==typeof ih&&"function"==typeof Symbol&&"symbol"==typeof ih("foo")&&"symbol"==typeof Symbol("bar")&&function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}(),yh=Object.getPrototypeOf||function(e){return e.__proto__},bh={},wh="undefined"==typeof Uint8Array?void 0:yh(Uint8Array),kh={"%AggregateError%":"undefined"==typeof AggregateError?void 0:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?void 0:ArrayBuffer,"%ArrayIteratorPrototype%":mh?yh([][Symbol.iterator]()):void 0,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":bh,"%AsyncGenerator%":bh,"%AsyncGeneratorFunction%":bh,"%AsyncIteratorPrototype%":bh,"%Atomics%":"undefined"==typeof Atomics?void 0:Atomics,"%BigInt%":"undefined"==typeof BigInt?void 0:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?void 0:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?void 0:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?void 0:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?void 0:FinalizationRegistry,"%Function%":fh,"%GeneratorFunction%":bh,"%Int8Array%":"undefined"==typeof Int8Array?void 0:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?void 0:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?void 0:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":mh?yh(yh([][Symbol.iterator]())):void 0,"%JSON%":"object"==typeof JSON?JSON:void 0,"%Map%":"undefined"==typeof Map?void 0:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&mh?yh((new Map)[Symbol.iterator]()):void 0,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?void 0:Promise,"%Proxy%":"undefined"==typeof Proxy?void 0:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?void 0:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?void 0:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&mh?yh((new Set)[Symbol.iterator]()):void 0,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?void 0:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":mh?yh(""[Symbol.iterator]()):void 0,"%Symbol%":mh?Symbol:void 0,"%SyntaxError%":lh,"%ThrowTypeError%":gh,"%TypedArray%":wh,"%TypeError%":hh,"%Uint8Array%":"undefined"==typeof Uint8Array?void 0:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?void 0:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?void 0:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?void 0:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?void 0:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?void 0:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?void 0:WeakSet},_h={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Sh=uh.call(Function.call,Array.prototype.concat),xh=uh.call(Function.apply,Array.prototype.splice),Eh=uh.call(Function.call,String.prototype.replace),Oh=uh.call(Function.call,String.prototype.slice),Ah=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ch=/\\(\\)?/g,Ih=function(e){var t=Oh(e,0,1),r=Oh(e,-1);if("%"===t&&"%"!==r)throw new lh("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new lh("invalid intrinsic syntax, expected opening `%`");var n=[];return Eh(e,Ah,(function(e,t,r,i){n[n.length]=r?Eh(i,Ch,"$1"):t||e})),n},Th=function(e,t){var r,n=e;if(ch(_h,n)&&(n="%"+(r=_h[n])[0]+"%"),ch(kh,n)){var i=kh[n];if(i===bh&&(i=function e(t){var r;if("%AsyncFunction%"===t)r=dh("async function () {}");else if("%GeneratorFunction%"===t)r=dh("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=dh("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&(r=yh(i.prototype))}return kh[t]=r,r}(n)),void 0===i&&!t)throw new hh("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new lh("intrinsic "+e+" does not exist!")},Rh=function(e,t){if("string"!=typeof e||0===e.length)throw new hh("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new hh('"allowMissing" argument must be a boolean');var r=Ih(e),n=r.length>0?r[0]:"",i=Th("%"+n+"%",t),o=i.name,a=i.value,s=!1,u=i.alias;u&&(n=u[0],xh(r,Sh([0,1],u)));for(var c=1,l=!0;c<r.length;c+=1){var f=r[c],h=Oh(f,0,1),d=Oh(f,-1);if(('"'===h||"'"===h||"`"===h||'"'===d||"'"===d||"`"===d)&&h!==d)throw new lh("property names with quotes must have matching quotes");if("constructor"!==f&&l||(s=!0),ch(kh,o="%"+(n+="."+f)+"%"))a=kh[o];else if(null!=a){if(!(f in a)){if(!t)throw new hh("base intrinsic for "+e+" exists, but the property is not available.");return}if(ph&&c+1>=r.length){var p=ph(a,f);a=(l=!!p)&&"get"in p&&!("originalValue"in p.get)?p.get:a[f]}else l=ch(a,f),a=a[f];l&&!s&&(kh[o]=a)}}return a},Lh=r((function(e){var t=Rh("%Function.prototype.apply%"),r=Rh("%Function.prototype.call%"),n=Rh("%Reflect.apply%",!0)||uh.call(r,t),i=Rh("%Object.getOwnPropertyDescriptor%",!0),o=Rh("%Object.defineProperty%",!0),a=Rh("%Math.max%");if(o)try{o({},"a",{value:1})}catch(e){o=null}e.exports=function(e){var t=n(uh,r,arguments);if(i&&o){var s=i(t,"length");s.configurable&&o(t,"length",{value:1+a(0,e.length-(arguments.length-1))})}return t};var s=function(){return n(uh,t,arguments)};o?o(e.exports,"apply",{value:s}):e.exports.apply=s}));Lh.apply;var Nh=Lh(Rh("String.prototype.indexOf")),Ph=function(e,t){var r=Rh(e,!!t);return"function"==typeof r&&Nh(e,".prototype.")>-1?Lh(r):r},Mh="function"==typeof Map&&Map.prototype,jh=Object.getOwnPropertyDescriptor&&Mh?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Dh=Mh&&jh&&"function"==typeof jh.get?jh.get:null,Bh=Mh&&Map.prototype.forEach,Uh="function"==typeof Set&&Set.prototype,Fh=Object.getOwnPropertyDescriptor&&Uh?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,zh=Uh&&Fh&&"function"==typeof Fh.get?Fh.get:null,Hh=Uh&&Set.prototype.forEach,Vh="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,Wh="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,Gh="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,Kh=Boolean.prototype.valueOf,qh=Object.prototype.toString,Yh=Function.prototype.toString,Zh=String.prototype.match,Jh="function"==typeof BigInt?BigInt.prototype.valueOf:null,Xh=Object.getOwnPropertySymbols,$h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,Qh="function"==typeof Symbol&&"object"==typeof Symbol.iterator,ed=Object.prototype.propertyIsEnumerable,td=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null),rd=th.custom,nd=rd&&cd(rd)?rd:null,id="function"==typeof Symbol&&void 0!==Symbol.toStringTag?Symbol.toStringTag:null,od=function e(t,r,n,i){var o=r||{};if(fd(o,"quoteStyle")&&"single"!==o.quoteStyle&&"double"!==o.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(fd(o,"maxStringLength")&&("number"==typeof o.maxStringLength?o.maxStringLength<0&&o.maxStringLength!==1/0:null!==o.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=!fd(o,"customInspect")||o.customInspect;if("boolean"!=typeof a&&"symbol"!==a)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(fd(o,"indent")&&null!==o.indent&&"\t"!==o.indent&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return function e(t,r){if(t.length>r.maxStringLength){var n=t.length-r.maxStringLength,i="... "+n+" more character"+(n>1?"s":"");return e(t.slice(0,r.maxStringLength),r)+i}return ad(t.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,pd),"single",r)}(t,o);if("number"==typeof t)return 0===t?1/0/t>0?"0":"-0":String(t);if("bigint"==typeof t)return String(t)+"n";var s=void 0===o.depth?5:o.depth;if(void 0===n&&(n=0),n>=s&&s>0&&"object"==typeof t)return ud(t)?"[Array]":"[Object]";var u=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=Array(e.indent+1).join(" ")}return{base:r,prev:Array(t+1).join(r)}}(o,n);if(void 0===i)i=[];else if(dd(i,t)>=0)return"[Circular]";function c(t,r,a){if(r&&(i=i.slice()).push(r),a){var s={depth:o.depth};return fd(o,"quoteStyle")&&(s.quoteStyle=o.quoteStyle),e(t,s,n+1,i)}return e(t,o,n+1,i)}if("function"==typeof t){var l=function(e){if(e.name)return e.name;var t=Zh.call(Yh.call(e),/^function\s*([\w$]+)/);if(t)return t[1];return null}(t),f=bd(t,c);return"[Function"+(l?": "+l:" (anonymous)")+"]"+(f.length>0?" { "+f.join(", ")+" }":"")}if(cd(t)){var h=Qh?String(t).replace(/^(Symbol\(.*\))_[^)]*$/,"$1"):$h.call(t);return"object"!=typeof t||Qh?h:vd(h)}if(function(e){if(!e||"object"!=typeof e)return!1;if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement)return!0;return"string"==typeof e.nodeName&&"function"==typeof e.getAttribute}(t)){for(var d="<"+String(t.nodeName).toLowerCase(),p=t.attributes||[],v=0;v<p.length;v++)d+=" "+p[v].name+"="+ad(sd(p[v].value),"double",o);return d+=">",t.childNodes&&t.childNodes.length&&(d+="..."),d+="</"+String(t.nodeName).toLowerCase()+">"}if(ud(t)){if(0===t.length)return"[]";var g=bd(t,c);return u&&!function(e){for(var t=0;t<e.length;t++)if(dd(e[t],"\n")>=0)return!1;return!0}(g)?"["+yd(g,u)+"]":"[ "+g.join(", ")+" ]"}if(function(e){return!("[object Error]"!==hd(e)||id&&"object"==typeof e&&id in e)}(t)){var m=bd(t,c);return 0===m.length?"["+String(t)+"]":"{ ["+String(t)+"] "+m.join(", ")+" }"}if("object"==typeof t&&a){if(nd&&"function"==typeof t[nd])return t[nd]();if("symbol"!==a&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!Dh||!e||"object"!=typeof e)return!1;try{Dh.call(e);try{zh.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var y=[];return Bh.call(t,(function(e,r){y.push(c(r,t,!0)+" => "+c(e,t))})),md("Map",Dh.call(t),y,u)}if(function(e){if(!zh||!e||"object"!=typeof e)return!1;try{zh.call(e);try{Dh.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var b=[];return Hh.call(t,(function(e){b.push(c(e,t))})),md("Set",zh.call(t),b,u)}if(function(e){if(!Vh||!e||"object"!=typeof e)return!1;try{Vh.call(e,Vh);try{Wh.call(e,Wh)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return gd("WeakMap");if(function(e){if(!Wh||!e||"object"!=typeof e)return!1;try{Wh.call(e,Wh);try{Vh.call(e,Vh)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return gd("WeakSet");if(function(e){if(!Gh||!e||"object"!=typeof e)return!1;try{return Gh.call(e),!0}catch(e){}return!1}(t))return gd("WeakRef");if(function(e){return!("[object Number]"!==hd(e)||id&&"object"==typeof e&&id in e)}(t))return vd(c(Number(t)));if(function(e){if(!e||"object"!=typeof e||!Jh)return!1;try{return Jh.call(e),!0}catch(e){}return!1}(t))return vd(c(Jh.call(t)));if(function(e){return!("[object Boolean]"!==hd(e)||id&&"object"==typeof e&&id in e)}(t))return vd(Kh.call(t));if(function(e){return!("[object String]"!==hd(e)||id&&"object"==typeof e&&id in e)}(t))return vd(c(String(t)));if(!function(e){return!("[object Date]"!==hd(e)||id&&"object"==typeof e&&id in e)}(t)&&!function(e){return!("[object RegExp]"!==hd(e)||id&&"object"==typeof e&&id in e)}(t)){var w=bd(t,c),k=td?td(t)===Object.prototype:t instanceof Object||t.constructor===Object,_=t instanceof Object?"":"null prototype",S=!k&&id&&Object(t)===t&&id in t?hd(t).slice(8,-1):_?"Object":"",x=(k||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(S||_?"["+[].concat(S||[],_||[]).join(": ")+"] ":"");return 0===w.length?x+"{}":u?x+"{"+yd(w,u)+"}":x+"{ "+w.join(", ")+" }"}return String(t)};function ad(e,t,r){var n="double"===(r.quoteStyle||t)?'"':"'";return n+e+n}function sd(e){return String(e).replace(/"/g,"&quot;")}function ud(e){return!("[object Array]"!==hd(e)||id&&"object"==typeof e&&id in e)}function cd(e){if(Qh)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!$h)return!1;try{return $h.call(e),!0}catch(e){}return!1}var ld=Object.prototype.hasOwnProperty||function(e){return e in this};function fd(e,t){return ld.call(e,t)}function hd(e){return qh.call(e)}function dd(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function pd(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+t.toString(16).toUpperCase()}function vd(e){return"Object("+e+")"}function gd(e){return e+" { ? }"}function md(e,t,r,n){return e+" ("+t+") {"+(n?yd(r,n):r.join(", "))+"}"}function yd(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+e.join(","+r)+"\n"+t.prev}function bd(e,t){var r=ud(e),n=[];if(r){n.length=e.length;for(var i=0;i<e.length;i++)n[i]=fd(e,i)?t(e[i],e):""}var o,a="function"==typeof Xh?Xh(e):[];if(Qh){o={};for(var s=0;s<a.length;s++)o["$"+a[s]]=a[s]}for(var u in e)fd(e,u)&&(r&&String(Number(u))===u&&u<e.length||Qh&&o["$"+u]instanceof Symbol||(/[^\w$]/.test(u)?n.push(t(u,e)+": "+t(e[u],e)):n.push(u+": "+t(e[u],e))));if("function"==typeof Xh)for(var c=0;c<a.length;c++)ed.call(e,a[c])&&n.push("["+t(a[c])+"]: "+t(e[a[c]],e));return n}var wd=Rh("%TypeError%"),kd=Rh("%WeakMap%",!0),_d=Rh("%Map%",!0),Sd=Ph("WeakMap.prototype.get",!0),xd=Ph("WeakMap.prototype.set",!0),Ed=Ph("WeakMap.prototype.has",!0),Od=Ph("Map.prototype.get",!0),Ad=Ph("Map.prototype.set",!0),Cd=Ph("Map.prototype.has",!0),Id=function(e,t){for(var r,n=e;null!==(r=n.next);n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r},Td=function(){var e,t,r,n={assert:function(e){if(!n.has(e))throw new wd("Side channel does not contain "+od(e))},get:function(n){if(kd&&n&&("object"==typeof n||"function"==typeof n)){if(e)return Sd(e,n)}else if(_d){if(t)return Od(t,n)}else if(r)return function(e,t){var r=Id(e,t);return r&&r.value}(r,n)},has:function(n){if(kd&&n&&("object"==typeof n||"function"==typeof n)){if(e)return Ed(e,n)}else if(_d){if(t)return Cd(t,n)}else if(r)return function(e,t){return!!Id(e,t)}(r,n);return!1},set:function(n,i){kd&&n&&("object"==typeof n||"function"==typeof n)?(e||(e=new kd),xd(e,n,i)):_d?(t||(t=new _d),Ad(t,n,i)):(r||(r={key:{},next:null}),function(e,t,r){var n=Id(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(r,n,i))}};return n},Rd=String.prototype.replace,Ld=/%20/g,Nd="RFC3986",Pd={default:Nd,formatters:{RFC1738:function(e){return Rd.call(e,Ld,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:Nd},Md=Object.prototype.hasOwnProperty,jd=Array.isArray,Dd=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),Bd=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r},Ud={arrayToObject:Bd,assign:function(e,t){return Object.keys(t).reduce((function(e,r){return e[r]=t[r],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var i=t[n],o=i.obj[i.prop],a=Object.keys(o),s=0;s<a.length;++s){var u=a[s],c=o[u];"object"==typeof c&&null!==c&&-1===r.indexOf(c)&&(t.push({obj:o,prop:u}),r.push(c))}return function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(jd(r)){for(var n=[],i=0;i<r.length;++i)void 0!==r[i]&&n.push(r[i]);t.obj[t.prop]=n}}}(t),e},decode:function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},encode:function(e,t,r,n,i){if(0===e.length)return e;var o=e;if("symbol"==typeof e?o=Symbol.prototype.toString.call(e):"string"!=typeof e&&(o=String(e)),"iso-8859-1"===r)return escape(o).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var a="",s=0;s<o.length;++s){var u=o.charCodeAt(s);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||i===Pd.RFC1738&&(40===u||41===u)?a+=o.charAt(s):u<128?a+=Dd[u]:u<2048?a+=Dd[192|u>>6]+Dd[128|63&u]:u<55296||u>=57344?a+=Dd[224|u>>12]+Dd[128|u>>6&63]+Dd[128|63&u]:(s+=1,u=65536+((1023&u)<<10|1023&o.charCodeAt(s)),a+=Dd[240|u>>18]+Dd[128|u>>12&63]+Dd[128|u>>6&63]+Dd[128|63&u])}return a},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(jd(e)){for(var r=[],n=0;n<e.length;n+=1)r.push(t(e[n]));return r}return t(e)},merge:function e(t,r,n){if(!r)return t;if("object"!=typeof r){if(jd(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(n&&(n.plainObjects||n.allowPrototypes)||!Md.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var i=t;return jd(t)&&!jd(r)&&(i=Bd(t,n)),jd(t)&&jd(r)?(r.forEach((function(r,i){if(Md.call(t,i)){var o=t[i];o&&"object"==typeof o&&r&&"object"==typeof r?t[i]=e(o,r,n):t.push(r)}else t[i]=r})),t):Object.keys(r).reduce((function(t,i){var o=r[i];return Md.call(t,i)?t[i]=e(t[i],o,n):t[i]=o,t}),i)}},Fd=Object.prototype.hasOwnProperty,zd={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},Hd=Array.isArray,Vd=Array.prototype.push,Wd=function(e,t){Vd.apply(e,Hd(t)?t:[t])},Gd=Date.prototype.toISOString,Kd=Pd.default,qd={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Ud.encode,encodeValuesOnly:!1,format:Kd,formatter:Pd.formatters[Kd],indices:!1,serializeDate:function(e){return Gd.call(e)},skipNulls:!1,strictNullHandling:!1},Yd=function e(t,r,n,i,o,a,s,u,c,l,f,h,d,p,v){var g,m=t;if(v.has(t))throw new RangeError("Cyclic object value");if("function"==typeof s?m=s(r,m):m instanceof Date?m=l(m):"comma"===n&&Hd(m)&&(m=Ud.maybeMap(m,(function(e){return e instanceof Date?l(e):e}))),null===m){if(i)return a&&!d?a(r,qd.encoder,p,"key",f):r;m=""}if("string"==typeof(g=m)||"number"==typeof g||"boolean"==typeof g||"symbol"==typeof g||"bigint"==typeof g||Ud.isBuffer(m))return a?[h(d?r:a(r,qd.encoder,p,"key",f))+"="+h(a(m,qd.encoder,p,"value",f))]:[h(r)+"="+h(String(m))];var y,b=[];if(void 0===m)return b;if("comma"===n&&Hd(m))y=[{value:m.length>0?m.join(",")||null:void 0}];else if(Hd(s))y=s;else{var w=Object.keys(m);y=u?w.sort(u):w}for(var k=0;k<y.length;++k){var _=y[k],S="object"==typeof _&&void 0!==_.value?_.value:m[_];if(!o||null!==S){var x=Hd(m)?"function"==typeof n?n(r,_):r:r+(c?"."+_:"["+_+"]");v.set(t,!0);var E=Td();Wd(b,e(S,x,n,i,o,a,s,u,c,l,f,h,d,p,E))}}return b},Zd=(Object.prototype.hasOwnProperty,Array.isArray,function(e,t){var r,n=e,i=function(e){if(!e)return qd;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||qd.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=Pd.default;if(void 0!==e.format){if(!Fd.call(Pd.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n=Pd.formatters[r],i=qd.filter;return("function"==typeof e.filter||Hd(e.filter))&&(i=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:qd.addQueryPrefix,allowDots:void 0===e.allowDots?qd.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:qd.charsetSentinel,delimiter:void 0===e.delimiter?qd.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:qd.encode,encoder:"function"==typeof e.encoder?e.encoder:qd.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:qd.encodeValuesOnly,filter:i,format:r,formatter:n,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:qd.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:qd.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:qd.strictNullHandling}}(t);"function"==typeof i.filter?n=(0,i.filter)("",n):Hd(i.filter)&&(r=i.filter);var o,a=[];if("object"!=typeof n||null===n)return"";o=t&&t.arrayFormat in zd?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var s=zd[o];r||(r=Object.keys(n)),i.sort&&r.sort(i.sort);for(var u=Td(),c=0;c<r.length;++c){var l=r[c];i.skipNulls&&null===n[l]||Wd(a,Yd(n[l],l,s,i.strictNullHandling,i.skipNulls,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,u))}var f=a.join(i.delimiter),h=!0===i.addQueryPrefix?"?":"";return i.charsetSentinel&&("iso-8859-1"===i.charset?h+="utf8=%26%2310003%3B&":h+="utf8=%E2%9C%93&"),f.length>0?h+f:""}),Jd=function(){function e(t){var r=this;Vn(this,e),this.assignOptions=function(e){return Object.assign({},r.commonOption,e,{params:Object.assign({},r.commonOption.params,e&&e.params)})},this.get=function(e,t){return r.axios.get(e,r.assignOptions(t)).catch((function(e){return{err:e}}))},this.put=function(e,t,n){return r.axios.put(e,t,r.assignOptions(n)).catch((function(e){return{err:e}}))},this.post=function(e,t,n){return r.axios.post(e,t,r.assignOptions(n)).catch((function(e){return{err:e}}))},this.delete=function(e,t){return r.axios.delete(e,r.assignOptions(t)).catch((function(e){return{err:e}}))},this.commonOption=t,this.loginInfo=null,this.logger=null,this.baseUrl="",this.clientId="";var n=Object.assign(Object.assign({},t),{headers:{"n-ua":"PL=webrtc-sdk&AV=1.0.0&DR=&RL=&MF=&MO=web&OS=web-sdk&API=&LCLO=&LCLA=&CK="}});Bf.defaults.timeout=1e4,this.axios=Bf.create(n),this.axios.interceptors.request.use((function(e){var t=Math.ceil(1e4*Math.random());if(e.url.includes("?")?e.url+="&random=".concat(t):e.url+="?random=".concat(t),r.loginInfo){var n=e.method,i=e.data,o=e.url,a=e.params,s=Zd(a)?o+"&"+Zd(a):o,u={method:n.toLocaleUpperCase(),data:JSON.stringify(i)||"",url:s};e.headers=Object.assign({},r.setHeader(u))}return r.logger&&r.logger.log("[http] request:",e.url),e})),this.axios.interceptors.response.use((function(e){return r.logger&&r.logger.log("[http] response:",e),e}),(function(e){return r.logger&&r.logger.log("[http] response error:",e),Promise.reject(e)}))}return Gn(e,[{key:"setLogger",value:function(e){this.logger=e}},{key:"setBaseUrl",value:function(e){var t=this;e!==this.baseUrl&&delete this.axios.defaults.headers.authorization,this.baseUrl=e,this.axios.interceptors.request.use((function(e){return e.baseURL=t.baseUrl,e}),(function(e){return Promise.reject(e)}))}},{key:"setClientId",value:function(e){this.clientId=e}},{key:"setHeader",value:function(e){var t=this.loginInfo.access_token,r=e.method,n=e.url,i=e.data,o=void 0===i?"":i,a=Math.random(),s=(new Date).getTime(),u=nh.MD5(o).toString(),c="x-xy-clientid=".concat(this.clientId,"&x-xy-nonce=").concat(a,"&x-xy-signtype=HMAC_SHA256&x-xy-timestamp=").concat(s),l="".concat(r,"\n").concat(c,"\n").concat(n,"\n").concat(u,"\naccess_token=").concat(t),f=nh.HmacSHA256(l,t).toString().toLocaleUpperCase();return Object.assign(Object.assign({},this.axios.defaults.headers),{Authorization:"Bearer ".concat(t||""),"x-xy-clientid":this.clientId,"x-xy-clienttype":qf.CLIENT_TYPE,"x-xy-nonce":a,"x-xy-timestamp":s,"x-xy-signtype":"HMAC_SHA256","x-xy-sign":f})}},{key:"setLoginInfo",value:function(e){this.loginInfo=e}}]),e}(),Xd="2.0.1-1 - build on 2022-01-27 10:37",$d="wss://cloudapi.xylink.com",Qd="https://cloudapi.xylink.com",ep="https://log.xylink.com",tp="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),rp=new Uint8Array(16);function np(){if(!tp)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return tp(rp)}for(var ip=[],op=0;op<256;++op)ip[op]=(op+256).toString(16).substr(1);function ap(e,t,r){var n=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||np)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var o=0;o<16;++o)t[n+o]=i[o];return t||function(e,t){var r=t||0,n=ip;return[n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],"-",n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]],n[e[r++]]].join("")}(i)}var sp=new(function(){function e(){Vn(this,e),this.http=new Jd({baseURL:Qd,timeout:2e4}),this.logHttp=new Jd({baseURL:ep,timeout:2e4}),this.clientId="",this.meetingInfo={meetingId:"",callUri:""}}return Gn(e,[{key:"setBaseUrl",value:function(e,t){this.http.setBaseUrl(e),this.logHttp.setBaseUrl(t)}},{key:"setLogBaseUrl",value:function(e){this.logHttp.setBaseUrl(e)}},{key:"setClientId",value:function(e){this.clientId=e,this.http.setClientId(e)}},{key:"setLogger",value:function(e){this.http.setLogger(e),this.logHttp.setLogger(e)}},{key:"setMeetingInfo",value:function(e){this.meetingInfo=e}},{key:"upload",value:function(e){return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.logHttp.post("/api/rest/v1/log/standardLog",e);case 2:return r=t.sent,t.abrupt("return",r);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"login",value:function(e){return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.http.setLoginInfo(""),r=e.userName,n=e.password,t.next=4,this.http.put("/api/rest/iauth/v5/en/login",{account:r,password:n,deviceType:17,deviceSn:ap()},{headers:{"x-xy-clientid":this.clientId,"x-xy-clienttype":qf.CLIENT_TYPE}});case 4:return(i=t.sent).data&&200===i.status&&this.http.setLoginInfo(i.data.token),t.abrupt("return",i);case 7:case"end":return t.stop()}}),t,this)})))}},{key:"getSdkUserInfo",value:function(e){return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.http.setLoginInfo(""),r=e.displayName,n=e.extId,t.next=4,this.http.post("/api/rest/internal/v1/en/sdk/webRtc/user",{extId:n,displayName:r,externalUserId:""},{headers:{"x-xy-clientid":this.clientId,"x-xy-clienttype":qf.CLIENT_TYPE}});case 4:return i=t.sent,t.abrupt("return",i);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"setLoginInfo",value:function(e){this.http.setLoginInfo(e)}},{key:"getUserInfo",value:function(e){return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.post("/admin/login/current/user",{token:e});case 2:if(!(r=t.sent).data||0!==r.data.code){t.next=5;break}return t.abrupt("return",r.data.data);case 5:return t.abrupt("return",r);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"getCallUri",value:function(e){return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.get("/api/rest/uss/v4/callUrlInfoV2",{params:e});case 2:if(!(r=t.sent)||!r.data){t.next=5;break}return t.abrupt("return",r.data);case 5:return t.abrupt("return",r);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"verifyPassword",value:function(e,t,r){return es(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.http.put("/api/rest/uss/v4/en/cloudmeeting/validation?securitykey=".concat(r),{number:e,passwd:t});case 2:return i=n.sent,n.abrupt("return",i);case 4:case"end":return n.stop()}}),n,this)})))}},{key:"hand",value:function(e,t,r,n){return es(this,void 0,void 0,regeneratorRuntime.mark((function i(){var o;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,this.http.post("/page/api/rest/v2/".concat(e,"?meetingId=").concat(t,"&di=").concat(r,"&conferenceNo=").concat(n));case 2:return o=i.sent,i.abrupt("return",o);case 4:case"end":return i.stop()}}),i,this)})))}},{key:"fetchErrorCode",value:function(e){return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.get("/api/rest/clientConfg/v3/getDefaultServerConfig?configName=errorcode&securityKey=".concat(e));case 2:return r=t.sent,t.abrupt("return",r);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"getErrorCodeByJson",value:function(e){return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,new Jd({baseURL:""}).get(e);case 2:return r=t.sent,t.abrupt("return",r);case 4:case"end":return t.stop()}}),t)})))}},{key:"getConference",value:function(e,t){return es(this,void 0,void 0,regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.http.get("/api/rest/v1/meetingroom/hidden/soft/conference?userProfileId=".concat(e,"&securityKey=").concat(t)));case 1:case"end":return r.stop()}}),r,this)})))}},{key:"setStates",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return es(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,s,u,c;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=this.meetingInfo,o=i.meetingId,a=i.callUri,s={meetingId:o,callUri:a,action:e,eventType:t,timestamp:(new Date).getTime()},u=JSON.stringify(Object.assign({},s,r)),c={device:a,msgVer:"0.0.1",states:[{name:"meetingEvent",version:"1.0",value:u,tag:"audit"}]},n.prev=4,n.next=7,this.http.post("/api/rest/v3/device/states",c);case 7:n.next=11;break;case 9:n.prev=9,n.t0=n.catch(4);case 11:case"end":return n.stop()}}),n,this,[[4,9]])})))}},{key:"igonreMeetingMonito",value:function(e,t){return es(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=(1e3*Math.random()).toFixed(),i="/api/rest/uss/v1/cloudmeeting/monitor?securityKey=".concat(t,"&conferenceNumber=").concat(e,"&nonce=").concat(n),r.next=4,this.http.get(i);case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop()}}),r,this)})))}}]),e}()),up=function(){function e(){var t=this;Vn(this,e),this.stopDB=function(){t.db.stop()},this.openDB=function(){t.db.open()},this.initDB=function(){return es(t,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.db.init();case 2:case"end":return e.stop()}}),e,this)})))},this.setLogLevel=function(e){t.currentLevel=e},this.putLog=function(e,r,n,i){return es(t,void 0,void 0,regeneratorRuntime.mark((function t(){var o,a=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o={time:i,title:e,content:r,rest:n},!this.db||!this.db.isOpen()){t.next=12;break}if(!this.cacheData.length||this.isAddCache){t.next=8;break}return this.isAddCache=!0,t.next=6,Promise.all(this.cacheData.map((function(e){return es(a,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.db.add(e);case 2:case"end":return t.stop()}}),t,this)})))})));case 6:this.cacheData=[],this.isAddCache=!1;case 8:return t.next=10,this.db.add(o);case 10:t.next=14;break;case 12:this.cacheData.length>4&&this.cacheData.shift(),this.cacheData.push(o);case 14:case"end":return t.stop()}}),t,this)})))},this.downloadLog=function(){return es(t,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.db.tempStart();case 2:return e.next=4,this.db.export();case 4:case"end":return e.stop()}}),e,this)})))},this.setLogServer=function(e){sp.setLogBaseUrl(e)},this.db=new Ol,this.LogLevel={INFO:"INFO",DEBUG:"DEBUG",WARNING:"WARNING",ERROR:"ERROR",NONE:"NONE"},this.currentLevel=this.LogLevel.DEBUG,this.isArrowUpload=!0,this.cacheData=[],this.isAddCache=!1}return Gn(e,[{key:"debug",value:function(){for(var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.LogLevel.DEBUG,i=_l(),o=arguments.length,a=new Array(o>2?o-2:0),s=2;s<o;s++)a[s-2]=arguments[s];this.currentLevel===n&&"meeting-stats"!==t&&(e=console).log.apply(e,["[".concat(Sl(),"][DEBUG]"),t,r].concat(a));this.putLog(t,r,a,i)}},{key:"log",value:function(e){for(var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.LogLevel,i=n.INFO,o=n.DEBUG,a=_l(),s=arguments.length,u=new Array(s>2?s-2:0),c=2;c<s;c++)u[c-2]=arguments[c];this.currentLevel!==o&&this.currentLevel!==i||(t=console).log.apply(t,["[".concat(Sl(),"][INFO]"),e,r].concat(u));this.putLog(e,r,u,a)}},{key:"warn",value:function(e){for(var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.LogLevel,i=n.INFO,o=n.DEBUG,a=n.WARNING,s=_l(),u=arguments.length,c=new Array(u>2?u-2:0),l=2;l<u;l++)c[l-2]=arguments[l];this.currentLevel!==o&&this.currentLevel!==i&&this.currentLevel!==a||(t=console).log.apply(t,["[".concat(Sl(),"][WARN]"),e,r].concat(c));this.putLog(e,r,c,s)}},{key:"error",value:function(e){for(var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.LogLevel,i=n.INFO,o=n.DEBUG,a=n.ERROR,s=n.WARNING,u=_l(),c=arguments.length,l=new Array(c>2?c-2:0),f=2;f<c;f++)l[f-2]=arguments[f];this.currentLevel!==o&&this.currentLevel!==a&&this.currentLevel!==i&&this.currentLevel!==s||(t=console).log.apply(t,["[".concat(Sl(),"][ERROR]"),e,r].concat(l));this.putLog(e,r,l,u)}},{key:"enableLogUpload",value:function(){this.isArrowUpload=!0}},{key:"disableLogUpload",value:function(){this.isArrowUpload=!1}},{key:"uploadLog",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return es(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,s,u;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.isArrowUpload){n.next=36;break}return n.next=3,this.db.tempStart();case 3:return n.next=5,this.db.upload(e);case 5:return i=n.sent,o=new FormData,a=Math.ceil(1e4*Math.random())+"",s=Date.now()+"",o.append("comments",r||e),o.append("sn",a),o.append("userId",a),o.append("deviceId",a),o.append("deviceType","WebrtcSDK"),o.append("userDisplayName",e),o.append("deviceDisplayName",navigator.userAgent),o.append("dataType","userSubmit"),o.append("account",t),o.append("number",""),o.append("softwareVersion",""),o.append("osVersion",""),o.append("deviceModel",""),o.append("crashType","UI"),o.append("crashTime",s),o.append("suffixName",".zip"),o.append("file",i,"webrt_log.zip"),n.prev=26,n.next=29,sp.upload(o);case 29:return u=n.sent,n.abrupt("return",u&&(u.status>=200||u.status<300));case 33:return n.prev=33,n.t0=n.catch(26),n.abrupt("return",!1);case 36:case"end":return n.stop()}}),n,this,[[26,33]])})))}}]),e}(),cp=a.Function,lp=b([].concat),fp=b([].join),hp={},dp=function(e,t,r){if(!ne(hp,t)){for(var n=[],i=0;i<t;i++)n[i]="a["+i+"]";hp[t]=cp("C,a","return new C("+fp(n,",")+")")}return hp[t](e,r)},pp=cp.bind||function(e){var t=q(this),r=t.prototype,n=wo(arguments,1),i=function(){var r=lp(n,wo(arguments));return this instanceof i?dp(t,r.length,r):t.apply(e,r)};return T(r)&&(i.prototype=r),i};Ct({target:"Function",proto:!0},{bind:pp});var vp=un.findIndex,gp=!0;"findIndex"in[]&&Array(1).findIndex((function(){gp=!1})),Ct({target:"Array",proto:!0,forced:gp},{findIndex:function(e){return vp(this,e,arguments.length>1?arguments[1]:void 0)}}),ui("findIndex");var mp=un.filter,yp=er("filter");Ct({target:"Array",proto:!0,forced:!yp},{filter:function(e){return mp(this,e,arguments.length>1?arguments[1]:void 0)}});var bp=function(e,t,r){var n,i;return Ei&&I(n=t.constructor)&&n!==r&&T(i=n.prototype)&&i!==r.prototype&&Ei(e,i),e},wp=vt.f,kp=_e.f,_p=Ce.f,Sp=mn.trim,xp=a.Number,Ep=xp.prototype,Op=a.TypeError,Ap=b("".slice),Cp=b("".charCodeAt),Ip=function(e){var t=ve(e,"number");return"bigint"==typeof t?t:Tp(t)},Tp=function(e){var t,r,n,i,o,a,s,u,c=ve(e,"number");if(V(c))throw Op("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=Sp(c),43===(t=Cp(c,0))||45===t){if(88===(r=Cp(c,2))||120===r)return NaN}else if(48===t){switch(Cp(c,1)){case 66:case 98:n=2,i=49;break;case 79:case 111:n=8,i=55;break;default:return+c}for(a=(o=Ap(c,2)).length,s=0;s<a;s++)if((u=Cp(o,s))<48||u>i)return NaN;return parseInt(o,n)}return+c};if(Ot("Number",!xp(" 0o1")||!xp("0b1")||xp("+0x1"))){for(var Rp,Lp=function(e){var t=arguments.length<1?0:xp(Ip(e)),r=this;return N(Ep,r)&&s((function(){Al(r)}))?bp(Object(t),r,Lp):t},Np=u?wp(xp):"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(","),Pp=0;Np.length>Pp;Pp++)ne(xp,Rp=Np[Pp])&&!ne(Lp,Rp)&&_p(Lp,Rp,kp(xp,Rp));Lp.prototype=Ep,Ep.constructor=Lp,$e(a,"Number",Lp)}var Mp,jp=/"/g,Dp=b("".replace);Ct({target:"String",proto:!0,forced:(Mp="link",s((function(){var e=""[Mp]('"');return e!==e.toLowerCase()||e.split('"').length>3})))},{link:function(e){return t="a",r="href",n=e,i=dr(A(this)),o="<"+t,""!==r&&(o+=" "+r+'="'+Dp(dr(n),jp,"&quot;")+'"'),o+">"+i+"</"+t+">";var t,r,n,i,o}});var Bp=s((function(){It(1)}));Ct({target:"Object",stat:!0,forced:Bp},{keys:function(e){return It(te(e))}});var Up={LOCAL_NET_DISCONNECT:"网络中断,呼叫已断开",SIGNAL_TIMEOUT:"网络中断,呼叫已断开",MEDIA_TIMEOUT:"媒体超时",EXCEPTION_CALL_EXIST:"您正在呼叫中,请稍后重试",EXCEPTION_CALL_NOT_EXIST:"呼叫异常,请稍后重试",EXCEPTION_UNKNOWN:"呼叫异常,请稍后重试",TIME_OUT:"对方没有应答,请稍后再试",INVALID_NEMONO:"无效的终端号,请重新输入",USER_NOT_ALLOWED:"对方终端不允许外人拨打,请与对方确认后再拨",NEN_NORMAL_CONF_SESSION_EXCEED:"当前会议人数已超限,请加入企业通讯录,可支持更多方会议。",NOT_ALLOW_NEMO_CALL:"对方终端不允许陌生人呼叫",CONFMGMT_CONFOVER:"主持人结束会议",CONFMGMT_KICKOUT:"主持人移除当前的小程序",MEETING_LOCKED:"会议已经被锁定,无法加入",NORMAL_CONF_SESSION_EXCEED:"您呼叫的会议已达到最大支持人数",NORMAL_EN_NEMO_SESSION_EXCEED:"您呼叫的会议已达到最大支持人数",LARGE_CONF_SESSION_EXCEED:"您呼叫的会议已达到最大支持人数",NOT_ALLOW_CONFERENCE_CALL:"您呼叫的云会议室不允许通讯录外成员呼入,请联系云会议室管理员",NOT_ALLOW_CONFERENCE_ANONYMOUS_CALL:"您呼叫的云会议室不允许匿名用户呼入,请联系云会议室管理员",BUSY:"对方忙",PEER_NOT_FOUND:"对方不在线",STATUS_OK:"通话已结束",OK:"通话已结束",EXCEPTION_PARAM_ERROR:"呼叫失败,请稍后重试",MEETING_DISCONNECT_USER_CONF_SESSION_EXCEED:"此云会议室已达允许呼入的上限",MEETING_DISCONNECT_DEP_CONF_SESSION_EXCEED:"此云会议室已达部门允许呼入的上限",MEETING_DISCONNECT_ENT_CONF_SESSION_EXCEED:"此云会议室已达企业允许呼入的上限",NO_AUTHORITY:"没有呼叫权限",KickoutTipContent:"您的账号在另一地点登录,您被迫下线",UNSUPPORT_CALL:"您的终端目前无法支持此类呼叫",SHARE_CONTENT_FAILED:"分享屏幕失败"},Fp=function(){function e(){Vn(this,e),this.events={}}return Gn(e,[{key:"on",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if("function"!=typeof t)throw new TypeError("The listener not a function");this.events||(this.events={}),this.events[e]||(this.events[e]=[]),this.events[e].push({total:r,listener:t})}},{key:"once",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;this.on(e,t,r)}},{key:"removeListener",value:function(e){this.events[e]&&(this.events[e].length=0)}},{key:"removeAllListener",value:function(){this.events={}}},{key:"emmit",value:function(e){for(var t=this,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];this.events[e]&&this.events[e].forEach((function(r,i){if((-1===r.total||r.total>=1||"function"==typeof r.listener)&&r.listener.apply(t,n),r.total>=1){var o=t.events[e][i].total-1;t.events[e][i].total=o,0===o&&(t.events[e][i].listener=function(){})}}))}}]),e}(),zp=[],Hp=function(){function e(t,r){var n=this;Vn(this,e),this.onOpenSocket=function(e){n.isConnected=!0,n.lockReconnect=!1,n.options.openHeatBeat&&n.sendHeartBeat(),n.emit("open",e)},this.onHandleMessage=function(e){n.options.openHeatBeat&&e.data===n.options.pangData?n.handlePang():n.emit("message",e)},this.onCloseSocket=function(e){var t;n.isConnected=!1,n.isClose=!0,n.logger.log("close websocket success",(t=e,JSON.stringify(t,Object.getOwnPropertyNames(t),2))),n.logger.log("this.messageList: ",n.messageList),n.emit("close",e)},this.onErrorSocket=function(e){n.logger.log("error connection websocket"),n.isConnected=!1,n.emit("error",e)};this.logger=r.logger,this.options=Object.assign(Object.assign({},{protocols:[],pingData:"PING",pangData:"PONG",autoReConnect:!0,openHeatBeat:!0,params:{}}),t),this.heatBeatFrequency=2e4,this.timeOffset=1e4,this.reconnectCount=0,this.reconnectLimit=5,this.lockReconnect=!1,this.messageList={},this.headBeatTimer=null,this.isConnected=!1,this.isClose=!1,this.connect(!1),this.addEvent()}return Gn(e,[{key:"connect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.options,r=t.url,n=t.params,i=r+"?";if(window.WebSocket){for(var o in n)i+=e&&"start"===o?"".concat(o,"=",!1,"&"):"".concat(o,"=").concat(n[o],"&");this.socket=new WebSocket(i,this.options.protocols),zp.push(this.socket),e&&(this.lockReconnect=!1)}else this.emit("error",El(10002,"Current browser cannot support Websocket, please use XyRTC sdk in chrome!"))}},{key:"addEvent",value:function(){this.socket.addEventListener("open",this.onOpenSocket),this.socket.addEventListener("message",this.onHandleMessage),this.socket.addEventListener("close",this.onCloseSocket),this.socket.addEventListener("error",this.onErrorSocket)}},{key:"removeEvent",value:function(){this.socket.removeEventListener("open",this.onOpenSocket),this.socket.removeEventListener("message",this.onHandleMessage),this.socket.removeEventListener("close",this.onCloseSocket),this.socket.removeEventListener("error",this.onErrorSocket)}},{key:"sendHeartBeat",value:function(){var e=this;this.headBeatTimer||(this.socket.send(this.options.pingData),this.creatTimeout()),this.headBeatTimer=setInterval((function(){e.socket.send(e.options.pingData),e.creatTimeout()}),this.heatBeatFrequency)}},{key:"creatTimeout",value:function(){var e=this;this.pangTimer=setTimeout((function(){e.emit("timeout",""),e.options.autoReConnect&&e.reConnect()}),this.timeOffset)}},{key:"handlePang",value:function(){clearTimeout(this.pangTimer)}},{key:"emit",value:function(e,t){this.messageList[e]&&this.messageList[e].forEach((function(e){e(t)}))}},{key:"reset",value:function(){clearInterval(this.headBeatTimer),clearTimeout(this.pangTimer),this.messageList={}}},{key:"on",value:function(e,t){this.messageList[e]?this.messageList[e].push(t):this.messageList[e]=[t]}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.socket&&this.socket.close(),zp.map((function(e){e&&e.close()})),zp=[],clearInterval(this.headBeatTimer),clearTimeout(this.pangTimer),e||(this.messageList={}),this.removeEvent()}},{key:"send",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=e.type&&"PASS_THROUGH"===e.type&&"candidate"===e.body.type,n="string"==typeof e,i=t&&!n?JSON.stringify(e):e,o={0:"connection",1:"open",2:"closing",3:"closed"};r||(this.logger.log("send wss message: ",e),this.isConnected||(this.logger.log("wss connected status: ",this.isConnected),this.logger.log("socket connection status: ",o[this.socket.readyState]||"unknown"))),this.isConnected?this.isClose||(1===this.socket.readyState&&(this.socket.send(i),this.logger.log("send wss message successfully")),"STOP_CALL"===e.type&&this.stopCall()):this.logger.log("send wss message failed, because socket is closed")}},{key:"stopCall",value:function(){var e=this;this.isConnected=!1,setTimeout((function(){e.close()}),10)}},{key:"reConnect",value:function(){this.lockReconnect||(this.reconnectCount>=this.reconnectLimit?this.emit("close",null):(this.lockReconnect=!0,this.reconnectCount+=1,this.logger.log("reconnect is trgger"),this.logger.log("reconnect count:",this.reconnectCount),this.close(!0),this.emit("reconnect",""),this.connect(!0),this.addEvent()))}}]),e}(),Vp=Math.floor,Wp=b("".charAt),Gp=b("".replace),Kp=b("".slice),qp=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Yp=/\$([$&'`]|\d{1,2})/g,Zp=function(e,t,r,n,i,o){var a=r+e.length,s=n.length,u=Yp;return void 0!==i&&(i=te(i),u=qp),Gp(o,u,(function(o,u){var c;switch(Wp(u,0)){case"$":return"$";case"&":return e;case"`":return Kp(t,0,r);case"'":return Kp(t,a);case"<":c=i[Kp(u,1,-1)];break;default:var l=+u;if(0===l)return o;if(l>s){var f=Vp(l/10);return 0===f?o:f<=s?void 0===n[f-1]?Wp(u,1):n[f-1]+Wp(u,1):o}c=n[l-1]}return void 0===c?"":c}))},Jp=he("replace"),Xp=Math.max,$p=Math.min,Qp=b([].concat),ev=b([].push),tv=b("".indexOf),rv=b("".slice),nv="$0"==="a".replace(/./,"$0"),iv=!!/./[Jp]&&""===/./[Jp]("a","$0");qr("replace",(function(e,t,r){var n=iv?"$":"$0";return[function(e,r){var n=A(this),i=null==e?void 0:Y(e,Jp);return i?l(i,e,n,r):l(t,dr(n),e,r)},function(e,i){var o=Ee(this),a=dr(e);if("string"==typeof i&&-1===tv(i,n)&&-1===tv(i,"$<")){var s=r(t,o,a,i);if(s.done)return s.value}var u=I(i);u||(i=dr(i));var c=o.global;if(c){var l=o.unicode;o.lastIndex=0}for(var f=[];;){var h=rn(o,a);if(null===h)break;if(ev(f,h),!c)break;""===dr(h[0])&&(o.lastIndex=en(a,at(o.lastIndex),l))}for(var d,p="",v=0,g=0;g<f.length;g++){for(var m=dr((h=f[g])[0]),y=Xp($p(tt(h.index),a.length),0),b=[],w=1;w<h.length;w++)ev(b,void 0===(d=h[w])?d:String(d));var k=h.groups;if(u){var _=Qp([m],b,y,a);void 0!==k&&ev(_,k);var S=dr(bo(i,void 0,_))}else S=Zp(m,a,y,b,k,i);y>=v&&(p+=rv(a,v,y)+S,v=y+m.length)}return p+rv(a,v)}]}),!!s((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!nv||iv);var ov=un.every,av=ar("every");Ct({target:"Array",proto:!0,forced:!av},{every:function(e){return ov(this,e,arguments.length>1?arguments[1]:void 0)}});var sv=Object.prototype.toString,uv=function(e){if(void 0===e)return"undefined";if(null===e)return"null";var t=typeof e;if("boolean"===t)return"boolean";if("string"===t)return"string";if("number"===t)return"number";if("symbol"===t)return"symbol";if("function"===t)return"GeneratorFunction"===cv(e)?"generatorfunction":"function";if(function(e){return Array.isArray?Array.isArray(e):e instanceof Array}(e))return"array";if(function(e){if(e.constructor&&"function"==typeof e.constructor.isBuffer)return e.constructor.isBuffer(e);return!1}(e))return"buffer";if(function(e){try{if("number"==typeof e.length&&"function"==typeof e.callee)return!0}catch(e){if(-1!==e.message.indexOf("callee"))return!0}return!1}(e))return"arguments";if(function(e){return e instanceof Date||"function"==typeof e.toDateString&&"function"==typeof e.getDate&&"function"==typeof e.setDate}(e))return"date";if(function(e){return e instanceof Error||"string"==typeof e.message&&e.constructor&&"number"==typeof e.constructor.stackTraceLimit}(e))return"error";if(function(e){return e instanceof RegExp||"string"==typeof e.flags&&"boolean"==typeof e.ignoreCase&&"boolean"==typeof e.multiline&&"boolean"==typeof e.global}(e))return"regexp";switch(cv(e)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(function(e){return"function"==typeof e.throw&&"function"==typeof e.return&&"function"==typeof e.next}(e))return"generator";switch(t=sv.call(e)){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")};function cv(e){return"function"==typeof e.constructor?e.constructor.name:null}const lv=Symbol.prototype.valueOf;var fv=function(e,t){switch(uv(e)){case"array":return e.slice();case"object":return Object.assign({},e);case"date":return new e.constructor(Number(e));case"map":return new Map(e);case"set":return new Set(e);case"buffer":return function(e){const t=e.length,r=Buffer.allocUnsafe?Buffer.allocUnsafe(t):Buffer.from(t);return e.copy(r),r}(e);case"symbol":return function(e){return lv?Object(lv.call(e)):{}}(e);case"arraybuffer":return function(e){const t=new e.constructor(e.byteLength);return new Uint8Array(t).set(new Uint8Array(e)),t}(e);case"float32array":case"float64array":case"int16array":case"int32array":case"int8array":case"uint16array":case"uint32array":case"uint8clampedarray":case"uint8array":return function(e,t){return new e.constructor(e.buffer,e.byteOffset,e.length)}(e);case"regexp":return function(e){const t=void 0!==e.flags?e.flags:/\w+$/.exec(e)||void 0,r=new e.constructor(e.source,t);return r.lastIndex=e.lastIndex,r}(e);case"error":return Object.create(e);default:return e}};function hv(e){return!0==(null!=(t=e)&&"object"==typeof t&&!1===Array.isArray(t))&&"[object Object]"===Object.prototype.toString.call(e);var t}function dv(e,t){switch(uv(e)){case"object":return function(e,t){if("function"==typeof t)return t(e);if(t||(r=e,!1!==hv(r)&&"function"==typeof(n=r.constructor)&&!1!==hv(i=n.prototype)&&!1!==i.hasOwnProperty("isPrototypeOf"))){const r=new e.constructor;for(let n in e)r[n]=dv(e[n],t);return r}var r,n,i;return e}(e,t);case"array":return function(e,t){const r=new e.constructor(e.length);for(let n=0;n<e.length;n++)r[n]=dv(e[n],t);return r}(e,t);default:return fv(e)}}var pv=dv,vv=function(){function e(t,r){Vn(this,e);var n=t.logger,i=t.invite;this.client=t,this.peerStatus={peerconnectionStatus:"disconnected",iceConnectionState:"disconnected"},this.invite=i,this.logger=n,this.peerConnection=null,this.connectCount=0,this.stream=r,this.streamSenders=[],this.senderTimmer=null,this.internels=pv(qf.INIT_INTERNELS),this.isShareContent=!1,this.onHandleNegotiationNeeded=this.onHandleNegotiationNeeded.bind(this),this.onHandleIceConnectionStateChange=this.onHandleIceConnectionStateChange.bind(this),this.onHandleConnectionStateChange=this.onHandleConnectionStateChange.bind(this),this.onTrack=this.onTrack.bind(this),this.init()}return Gn(e,[{key:"init",value:function(){this.initTimmer(),this.peerConnection=new RTCPeerConnection(Gf),this.peerConnection.onnegotiationneeded=this.onHandleNegotiationNeeded,this.peerConnection.oniceconnectionstatechange=this.onHandleIceConnectionStateChange,this.peerConnection.onconnectionstatechange=this.onHandleConnectionStateChange,null===this.peerConnection.ontrack?this.peerConnection.ontrack=this.onTrack:this.peerConnection.addEventListener("track",this.onTrack)}},{key:"sendEmmit",value:function(e,t,r,n){10518===t&&this.client.setPeerConnectionStatus(!0),this.client.emmit(e,{code:t,msg:r,detail:n})}},{key:"stopConnectTimmer",value:function(){this.connectTimmer&&clearTimeout(this.connectTimmer),this.connectTimmer=null,this.connectCount=0}},{key:"initTimmer",value:function(){var e=this;this.connectTimmer=setTimeout((function(){var t=e.peerStatus,r=t.peerconnectionStatus,n=t.iceConnectionState,i=pv(e.peerStatus);return e.connectCount>40?(e.sendEmmit("call-status",10517,"呼叫失败","PEER_NET_DISCONNECT"),e.stopConnectTimmer(),void e.logger.log("loop peer status: ",i)):"connected"!==r||"connected"!==n&&"completed"!==n?(20===e.connectCount&&(e.sendEmmit("call-status",10519,"正在呼叫中,请等候","waiting"),e.logger.log("loop peer status: ",i)),e.connectCount++,void e.initTimmer()):(e.sendEmmit("call-status",10518,"入会成功","success"),e.stopConnectTimmer(),void e.logger.log("loop peer status: ",i))}),1e3)}},{key:"onHandleNegotiationNeeded",value:function(){return es(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.createBaseOfferConnection();case 2:case"end":return e.stop()}}),e,this)})))}},{key:"createBaseOfferConnection",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.peerConnection.createOffer(e);case 3:return(r=t.sent).sdp=r.sdp.replace("useinbandfec=1","useinbandfec=0"),t.next=7,this.peerConnection.setLocalDescription(r);case 7:this.sendSocketMessage("offer",{sdp:r.sdp}),this.client.sendPeopleCapability(),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(0),this.logger.error("create offer error: ",t.t0);case 14:case"end":return t.stop()}}),t,this,[[0,11]])})))}},{key:"sendSocketMessage",value:function(e,t){var r=this.invite,n=r.meetingId,i=r.callerUri,o=r.callIndex;this.client.sendSocketMessage({type:"PASS_THROUGH",callIndex:o,body:Object.assign({type:e,meetingId:n,endpointId:i},t)})}},{key:"handleCandidate",value:function(e){return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return delete e.type,t.prev=1,t.next=4,this.peerConnection.addIceCandidate(new RTCIceCandidate(e));case 4:t.next=9;break;case 6:t.prev=6,t.t0=t.catch(1),this.logger.error("peer add ice candidate error: ",t.t0);case 9:case"end":return t.stop()}}),t,this,[[1,6]])})))}},{key:"handleAnswer",value:function(e){return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.peerConnection.setRemoteDescription(new RTCSessionDescription(e));case 2:case"end":return t.stop()}}),t,this)})))}},{key:"setBandWidth",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:qf.VIDE_BANDWIDTH_BIT,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return es(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,s,u,c;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:i=ri(this.streamSenders),n.prev=1,i.s();case 3:if((o=i.n()).done){n.next=21;break}if(a=o.value,!(s=a.sender)||!s.track||"video"!==s.track.kind||e!==s.track.id){n.next=19;break}return u=s.getParameters()||{encodings:[{maxBitrate:qf.VIDE_BANDWIDTH_BIT}]},c=r?1e3*t:t,u.encodings[0]?u.encodings[0].maxBitrate=c:u.encodings[0]={maxBitrate:c},n.prev=10,n.next=13,s.setParameters(u);case 13:this.logger.debug("set bandwidth successfully",{paramas:u,realBandwidth:c,trackId:s.track.id}),n.next=19;break;case 16:n.prev=16,n.t0=n.catch(10),this.logger.error("set bandwidth failed",u,n.t0);case 19:n.next=3;break;case 21:n.next=26;break;case 23:n.prev=23,n.t1=n.catch(1),i.e(n.t1);case 26:return n.prev=26,i.f(),n.finish(26);case 29:case"end":return n.stop()}}),n,this,[[1,23,26,29],[10,16]])})))}},{key:"onHandleIceConnectionStateChange",value:function(e){this.peerStatus=Object.assign(Object.assign({},this.peerStatus),{iceConnectionState:e.target.iceConnectionState}),this.logger.log("ice change status: ",pv(this.peerStatus))}},{key:"onHandleConnectionStateChange",value:function(){return es(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.peerConnection.connectionState,this.logger.log("peerconnection status change: ",{currentStatus:t,previousStatus:this.peerStatus.peerconnectionStatus}),"connected"!==this.peerStatus.peerconnectionStatus||"connected"===t){e.next=6;break}return"STARTING"===this.client.shareContentStatus&&this.client.sendContentCapablityMessage(),e.next=6,this.restartIceConnection();case 6:this.peerStatus=Object.assign(Object.assign({},this.peerStatus),{peerconnectionStatus:t}),this.logger.log("this.peerStatus: ",this.peerStatus);case 8:case"end":return e.stop()}}),e,this)})))}},{key:"restartIceConnection",value:function(){return es(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.createBaseOfferConnection({iceRestart:!0});case 2:case"end":return e.stop()}}),e,this)})))}},{key:"close",value:function(){var e=this;this.stopConnectTimmer(),this.peerConnection&&(this.streamSenders.forEach((function(t){(null==t?void 0:t.sender)&&e.peerConnection.removeTrack(t.sender)})),this.peerConnection.onicecandidate=null,this.peerConnection.removeEventListener&&this.peerConnection.removeEventListener("track",this.onTrack),this.peerConnection.ontrack=null,this.peerConnection.oniceconnectionstatechange=null,this.peerConnection.onsignalingstatechange=null,this.peerConnection.onicegatheringstatechange=null,this.peerConnection.onnegotiationneeded=null,this.peerConnection&&this.peerConnection.close&&this.peerConnection.close(),this.peerConnection=null),this.senderTimmer&&clearInterval(this.senderTimmer),this.senderTimmer=null,this.isShareContent=!1}},{key:"publish",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ALL",r=e.getMediaStreams(),n=r.streams,i=r.pipelineStreams,o=r.contentStreams;"ALL"===t?("NORMAL"!==e.current.type&&"AUDIO_ONLY"!==e.current.type&&"VIDEO_ONLY"!==e.current.type||this.addTransceiver(n,"sendrecv"),this.addTransceiver(i,"recvonly"),this.logger.log("publish people stream successfully")):"CONTENT"===t&&(this.isShareContent?(this.replaceTrack(o),this.logger.log("push content use replaceTrack.")):(this.addTransceiver(o,"sendonly"),this.logger.log("push content use addTransceiver.")),this.isShareContent=!0,this.logger.log("publish content stream successfully: ",this.streamSenders)),this.initSenderStatus()}},{key:"replacePeopleVideoTrack",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"video",r=e.getMediaStreams(),n=r.streams;"audio"===t?this.replaceAudioTrack(n):this.replaceTrack(n)}},{key:"initSenderStatus",value:function(){var e=this;this.senderInterval=0,this.senderTimmer||(this.calcMeetingStats(),this.senderTimmer=setInterval((function(){return es(e,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.senderInterval=this.senderInterval+1,e.next=3,this.calcMeetingStats();case 3:case"end":return e.stop()}}),e,this)})))}),2e3))}},{key:"closeContentStream",value:function(){var e=this;this.streamSenders.forEach((function(t,r){"contentStream"===t.type&&(t.sender.replaceTrack(null),e.streamSenders[r].status="ended")}))}},{key:"getPeerStatus",value:function(){var e=this.peerStatus.peerconnectionStatus;return this.logger.log("get peer status: ",this.peerStatus),"connected"===e}},{key:"setStream",value:function(e,t){var r=this,n=this.peerConnection.getTransceivers(),i=0;e.forEach((function(e){var o;null===(o=e.stream)||void 0===o||o.getTracks().forEach((function(o){if(o.kind===t&&("audio"===t&&"180"===e.resolution||"video"===t))for(;i<n.length;){if(!n[i].sender.track&&"sendrecv"!==n[i].direction&&n[i].receiver.track.kind===o.kind){n[i].direction="sendrecv",n[i].sender.setStreams(e.stream),n[i].sender.replaceTrack(o),r.setStreamSenders(o,e,n[i]),i++;break}i++}}))}))}},{key:"calcMeetingStats",value:function(){return es(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n,i,o,a,s,u,c,l,f,h,d,p,v,g,m,y,b,w,k;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=pv(qf.INIT_INTERNELS),r=!1,n=this.client.invite.callerUri,i=this.client.getLayoutList(),o=ri(i.entries()),e.prev=5,o.s();case 7:if((a=o.n()).done){e.next=24;break}if(s=$n(a.value,2),u=s[1],c=u.roster.endpointId,c===n){e.next=22;break}if(l=u.roster.id,f=this.client.getVideoManagers(),h=f[l],!((d=null==h?void 0:h.getVideoTracks())&&d[0]&&this.peerConnection)){e.next=22;break}return e.next=19,this.peerConnection.getStats(d[0]);case 19:p=e.sent,v=this.getReceiverStatus(p,u),t.receiver[d[0].id]=v;case 22:e.next=7;break;case 24:e.next=29;break;case 26:e.prev=26,e.t0=e.catch(5),o.e(e.t0);case 29:return e.prev=29,o.f(),e.finish(29);case 32:g=ri(this.streamSenders.entries()),e.prev=33,g.s();case 35:if((m=g.n()).done){e.next=46;break}if(y=$n(m.value,2),"active"!==(b=y[1]).status||!b.track||"video"!==b.track.kind){e.next=44;break}return e.next=40,b.sender.getStats();case 40:w=e.sent,k=this.getSenderStatus(w,t,b,!r),t.sender[b.track.id]=k,r=!0;case 44:e.next=35;break;case 46:e.next=51;break;case 48:e.prev=48,e.t1=e.catch(33),g.e(e.t1);case 51:return e.prev=51,g.f(),e.finish(51);case 54:this.internels=t,this.client.debug&&this.client.sendInternels(t),this.senderInterval>=3&&t.bytesSentSecond<500&&(this.logger.debug("meeting-stats",t),this.senderInterval=0);case 57:case"end":return e.stop()}}),e,this,[[5,26,29,32],[33,48,51,54]])})))}},{key:"addTransceiver",value:function(e,t){var r=this;e.forEach((function(e){var n=e.status,i=e.domStream,o=e.stream;"NORMAL"===n?o.getTracks().forEach((function(n){r.addStreamRenders(n,t,e)})):"DOMSTRING"===n&&i.forEach((function(n){r.addStreamRenders(n,t,e)}))})),this.logger.log("transceiver senders: ",this.streamSenders)}},{key:"addStreamRenders",value:function(e,t,r){var n;e.kind;var i={direction:t},o="NORMAL"===r.status,a=e.kind;o&&(i.streams=[r.stream],a=e),n=this.peerConnection.addTransceiver(a,i),this.setStreamSenders(e,r,n)}},{key:"setStreamSenders",value:function(e,t,r){var n="NORMAL"===t.status,i=e.kind,o={resolution:t.resolution,track:n?e:null,sender:r.sender,type:t.type,status:n?"active":"invalid"};("video"===i&&("remoteStream"===t.type||"contentStream"===t.type)||"audio"===i&&"180"===t.resolution)&&this.streamSenders.push(o)}},{key:"replaceAudioTrack",value:function(e){var t,r=this;e.every((function(e){"180"===e.resolution&&(t=e.stream.getAudioTracks()[0])})),this.streamSenders.forEach((function(e,n){"180"===e.resolution&&e.track&&"audio"===e.track.kind&&(e.sender.replaceTrack(t),r.streamSenders[n].status="active",r.streamSenders[n].track=t)}))}},{key:"replaceTrack",value:function(e){var t=this;e.forEach((function(e){var r;null===(r=e.stream)||void 0===r||r.getTracks().forEach((function(r){"video"===r.kind&&t.streamSenders.forEach((function(n,i){"video"===n.track.kind&&n.type===e.type&&e.resolution===n.resolution&&(n.sender.replaceTrack(r),t.streamSenders[i].status="active",t.streamSenders[i].track=r)}))}))}))}},{key:"getSenderStatus",value:function(e,t,r,n){var i=this,o={};return e.forEach((function(e){var a=e.type,s=e.bytesSent,u=void 0===s?0:s,c=e.bytesReceived,l=void 0===c?0:c,f=e.timestamp,h=void 0===f?0:f;if(n&&"transport"===a){var d=i.rateBytesCalculator(e,"bytesSent","timestamp",8,1),p=i.rateBytesCalculator(e,"bytesReceived","timestamp",8,1);t.bytesSent=u,t.bytesReceived=l,t.bytesReceivedSecond=p,t.timestamp=h,t.bytesSentSecond=d}else if("track"===a){var v=e.frameWidth,g=void 0===v?0:v,m=e.frameHeight,y=void 0===m?0:m,b=e.framesSent,w=void 0===b?0:b,k=e.hugeFramesSent,_=void 0===k?0:k,S=e.timestamp,x=void 0===S?0:S,E=i.rateBytesCalculator(e,"framesSent","timestamp",1,1e3,i.internels.sender[r.track.id]);o.frameWidth=g,o.frameHeight=y,o.framesSent=w,o.framesSentSecond=E,o.hugeFramesSent=_,o.timestamp=x,o.type=r.type,o.status=r.status,o.resolution=r.resolution,o.expBandwidth=10}else if("outbound-rtp"===a){var O=e.bytesSent,A=e.framesEncoded,C=e.packetsSent,I=e.keyFramesEncoded,T=void 0===I?"N/A":I,R=e.nackCount,L=e.ssrc,N=e.pliCount,P=void 0===N?0:N,M=i.rateBytesCalculator(e,"framesEncoded","timestamp",1,1e3,i.internels.sender[r.track.id]),j=i.rateBytesCalculator(e,"bytesSent","timestamp",8,1,i.internels.sender[r.track.id]);o.bytesSent=O,o.bytesSentSecond=j,o.framesEncoded=A,o.framesEncodedSecond=M,o.packetsSent=C,o.keyFramesEncoded=T,o.pliCount=P,o.nackCount=R,o.ssrc=L}else if(n&&"codec"===a){var D=e.mimeType;t.mimeType=D}})),o}},{key:"getReceiverStatus",value:function(e,t){var r=this,n={};return e.forEach((function(e){var i,o=e.type,a=t.roster.id,s=r.client.getVideoManagers()[a],u=(null===(i=((null==s?void 0:s.getVideoTracks())||[])[0])||void 0===i?void 0:i.id)||"";if("track"===o){var c=e.frameWidth,l=void 0===c?0:c,f=e.frameHeight,h=void 0===f?0:f,d=e.framesReceived,p=void 0===d?0:d,v=e.jitterBufferDelay,g=void 0===v?0:v,m=e.timestamp,y=void 0===m?0:m,b=r.rateBytesCalculator(e,"framesReceived","timestamp",1,1e3,r.internels.receiver[u]),w=t.roster,k=w.displayName,_=w.endpointId,S=w.isContent;n.frameWidth=l,n.frameHeight=h,n.framesReceived=p,n.framesReceivedSecond=b,n.jitterBufferDelay=g,n.timestamp=y,n.type=_,n.status="active",n.name=k,n.isContent=S,n.expResolution=0}else if("inbound-rtp"===o){var x=e.bytesReceived,E=e.framesDecoded,O=e.packetsReceived,A=e.keyFramesDecoded,C=void 0===A?"N/A":A,I=e.nackCount,T=e.pliCount,R=e.framesPerSecond,L=e.framesDropped,N=e.ssrc,P=r.rateBytesCalculator(e,"framesDecoded","timestamp",1,1e3,r.internels.receiver[u]),M=r.rateBytesCalculator(e,"bytesReceived","timestamp",8,1,r.internels.receiver[u]);n.bytesReceived=x,n.bytesReceivedSecond=M,n.framesDecoded=E,n.framesDecodedSecond=P,n.packetsReceived=O,n.keyFramesDecoded=C,n.nackCount=I,n.pliCount=T,n.framesPerSecond=R,n.framesDropped=L,n.ssrc=N}})),n}},{key:"rateBytesCalculator",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=arguments.length>5?arguments[5]:void 0,a=o||this.internels,s=Number(a[t]),u=Number(e[t]),c=Number(a[r]),l=Number(e[r]);if(!(s&&u&&c&&l))return 0;if("number"!=typeof c||"number"!=typeof l||"number"!=typeof s||"number"!=typeof u)return 0;if(l-c==0)return 0;var f=n*(u-s),h=(l-c)/i;return Math.floor(f/h)}},{key:"onTrack",value:function(e){this.client.emmit("track",e)}}]),e}(),gv=un.find,mv=!0;"find"in[]&&Array(1).find((function(){mv=!1})),Ct({target:"Array",proto:!0,forced:mv},{find:function(e){return gv(this,e,arguments.length>1?arguments[1]:void 0)}}),ui("find");var yv=Xe.EXISTS,bv=Ce.f,wv=Function.prototype,kv=b(wv.toString),_v=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,Sv=b(_v.exec);u&&!yv&&bv(wv,"name",{configurable:!0,get:function(){try{return Sv(_v,kv(this))[1]}catch(e){return""}}});var xv={DEVICES:{audioInputList:[],audioOutputList:[],videoInList:[]},currentSelectedDevice:{deviceId:"",groupId:"",label:""}},Ev=function(e){Kn(r,Fp);var t=Xn(r);function r(e){var n;return Vn(this,r),(n=t.call(this)).logger=e||new up,n.navigator=navigator||window.navigator,n.mediaDevices=n.navigator.mediaDevices,n.currentDeviceList=xv.DEVICES,n.nextDeviceList=xv.DEVICES,n.currentUsedDevice={videoInput:xv.currentSelectedDevice,audioInput:xv.currentSelectedDevice,audioOutput:xv.currentSelectedDevice},n.currentPermission={microphone:"",camera:""},n.handlePermissionCameraStateChanged=n.handlePermissionCameraStateChanged.bind(Zn(n)),n.handlePermissionPhoneStateChanged=n.handlePermissionPhoneStateChanged.bind(Zn(n)),n.mediaDevicesChange=n.mediaDevicesChange.bind(Zn(n)),n.initDeviceEvent(),n}return Gn(r,[{key:"getDevicePermission",value:function(){return this.currentPermission}},{key:"getNextDeviceList",value:function(){return this.nextDeviceList}},{key:"setCurrentUsedDevice",value:function(e){this.currentUsedDevice=e,this.emmit("currentDevice",this.currentUsedDevice),this.logger.log("[DM]current used device in first calling: ",this.currentUsedDevice)}},{key:"setCurrentUsedDeviceByType",value:function(e,t){if("audio"===e){var r=this.currentDeviceList.audioInputList.find((function(e){return e.deviceId===t}));r&&(this.currentUsedDevice.audioInput=r)}else if("video"===e){var n=this.currentDeviceList.videoInList.find((function(e){return e.deviceId===t}));n&&(this.currentUsedDevice.videoInput=n)}}},{key:"setAudioOutputDevice",value:function(e,t){var r=this;e&&void 0!==e.sinkId?e.setSinkId(t).then((function(){r.logger.log("[DM]switch audio output device successfully: ".concat(t))})).catch((function(e){var t=e;"SecurityError"===e.name&&(t="You need to use HTTPS for selecting audio output device: ".concat(e)),r.logger.error(t)})):this.logger.warn("[DM]Browser does not support output device selection.")}},{key:"emmitDevices",value:function(){return es(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.init();case 2:return e.next=4,this.emmitPermission();case 4:return e.next=6,this.mediaDevicesChange();case 6:case"end":return e.stop()}}),e,this)})))}},{key:"init",value:function(){return es(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getDevices();case 2:return t=e.sent,e.prev=3,e.next=6,this.getPermission();case 6:this.currentPermission=e.sent,e.next=12;break;case 9:e.prev=9,e.t0=e.catch(3),this.currentPermission={microphone:"unknow",camera:"unknow"};case 12:this.currentDeviceList=this.nextDeviceList=t,this.logger.log("[DM]current device list: ",this.currentDeviceList),this.logger.log("[DM]current permission: ",this.currentPermission);case 15:case"end":return e.stop()}}),e,this,[[3,9]])})))}},{key:"destroy",value:function(){this.removeDeviceEvent(),this.permissionCameraStatus&&this.permissionCameraStatus.removeEventListener("change",this.handlePermissionCameraStateChanged),this.permissionPhoneStatus&&this.permissionPhoneStatus.removeEventListener("change",this.handlePermissionPhoneStateChanged)}},{key:"getDevices",value:function(){return es(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.navigator.mediaDevices.enumerateDevices();case 3:return t=e.sent,r=[],n=[],i=[],t.forEach((function(e){var t=$n(e.kind.match(/(\w+)(input|output)/i),3),o=t[0],a=t[1],s=t[2];if(!e.label.match(/\(Virtual\)$/)){var u={deviceId:e.deviceId,kind:o,type:a,direction:s,label:e.label,groupId:e.groupId};"audioinput"===e.kind?r.push(u):"audiooutput"===e.kind?n.push(u):"videoinput"===e.kind&&i.push(u)}})),o={audioInputList:r,audioOutputList:n,videoInList:i},e.abrupt("return",o);case 12:return e.prev=12,e.t0=e.catch(0),e.abrupt("return",Promise.reject(El(20521,e.t0)));case 15:case"end":return e.stop()}}),e,this,[[0,12]])})))}},{key:"setPermission",value:function(e){this.currentPermission=e,this.emmit("permission",this.currentPermission)}},{key:"emmitPermission",value:function(){this.currentPermission.camera&&this.emmit("permission",this.currentPermission)}},{key:"query",value:function(e){return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.navigator.permissions.query({name:e});case 3:return r=t.sent,t.abrupt("return",r);case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",Promise.reject(El(20520,t.t0)));case 10:case"end":return t.stop()}}),t,this,[[0,7]])})))}},{key:"handlePermissionCameraStateChanged",value:function(e){return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.logger.log("[DM]camera permission changed: ",e),r=e.target.state,n=this.currentPermission.camera,"granted"!==r||"granted"===n){t.next=10;break}return t.next=6,this.getDevices();case 6:i=t.sent,o={detail:i,nextDevice:{audioInput:void 0,audioOutput:void 0,videoInput:void 0}},this.logger.log("[DM]next used device: ",o),this.emmit("device",o);case 10:"change"===e.type&&(this.currentPermission.camera=r),this.emmit("permission",this.currentPermission);case 12:case"end":return t.stop()}}),t,this)})))}},{key:"handlePermissionPhoneStateChanged",value:function(e){return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.logger.log("[DM]microphone permission changed: ",e),r=e.target.state,n=this.currentPermission.microphone,"granted"!==r||"granted"===n){t.next=10;break}return t.next=6,this.getDevices();case 6:i=t.sent,o={detail:i,nextDevice:{audioInput:void 0,audioOutput:void 0,videoInput:void 0}},this.logger.log("[DM]next used device: ",o),this.emmit("device",o);case 10:"change"===e.type&&(this.currentPermission.microphone=r),this.emmit("permission",this.currentPermission);case 12:case"end":return t.stop()}}),t,this)})))}},{key:"getPermission",value:function(){return es(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.query("camera");case 3:return t=e.sent,e.next=6,this.query("microphone");case 6:return r=e.sent,n={camera:t.state,microphone:r.state},this.permissionCameraStatus||(this.permissionCameraStatus=t,this.permissionCameraStatus.addEventListener("change",this.handlePermissionCameraStateChanged)),this.permissionPhoneStatus||(this.permissionPhoneStatus=r,this.permissionPhoneStatus.addEventListener("change",this.handlePermissionPhoneStateChanged)),e.abrupt("return",n);case 13:return e.prev=13,e.t0=e.catch(0),e.abrupt("return",Promise.reject(e.t0));case 16:case"end":return e.stop()}}),e,this,[[0,13]])})))}},{key:"diffAudioDevice",value:function(e,t){var r;if(e.length===t.length){var n=e[0]&&e[0].deviceId||"default",i=t[0]&&t[0].deviceId||"default",o=e[0]&&e[0].label||"",a=t[0]&&t[0].label||"";n===i&&o===a||(r=t[0])}else r=Qn(t).filter((function(t){return Qn(e).every((function(e){return e.deviceId!==t.deviceId}))}))[0],e.length>t.length&&(r=t[0]);return r}},{key:"diffVideoDevice",value:function(e,t){var r;return r=Qn(t).filter((function(t){return Qn(e).every((function(e){return e.deviceId!==t.deviceId}))}))[0],e.length>t.length&&(r=t[0]),r}},{key:"diffDevices",value:function(e,t){var r=e.audioInputList,n=e.audioOutputList,i=e.videoInList,o=t.audioInputList,a=t.audioOutputList,s=t.videoInList,u=this.diffAudioDevice(r,o),c=this.diffAudioDevice(n,a);return{audioInput:u,videoInput:this.diffVideoDevice(i,s),audioOutput:c}}},{key:"mediaDevicesChange",value:function(){return es(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getDevices();case 2:t=e.sent,r=this.currentUsedDevice.videoInput,this.nextDeviceList=pv(t),n=this.diffDevices(this.currentDeviceList,this.nextDeviceList),i=n.videoInput,o=n.audioInput,i&&i.deviceId!==(null==r?void 0:r.deviceId)?this.currentUsedDevice.videoInput=i:n.videoInput=void 0,this.currentUsedDevice.audioInput=o,this.currentDeviceList=pv(t),a={detail:t,nextDevice:n},this.logger.log("[DM]next used device: ",a),this.emmit("device",a);case 13:case"end":return e.stop()}}),e,this)})))}},{key:"initDeviceEvent",value:function(){this.navigator.mediaDevices.addEventListener("devicechange",this.mediaDevicesChange)}},{key:"removeDeviceEvent",value:function(){this.navigator.mediaDevices.removeEventListener("devicechange",this.mediaDevicesChange)}}]),r}(),Ov=s((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})),Av=Object.isExtensible,Cv=s((function(){Av(1)}))||Ov?function(e){return!!T(e)&&((!Ov||"ArrayBuffer"!=_(e))&&(!Av||Av(e)))}:Av,Iv=!s((function(){return Object.isExtensible(Object.preventExtensions({}))})),Tv=r((function(e){var t=Ce.f,r=!1,n=se("meta"),i=0,o=function(e){t(e,n,{value:{objectID:"O"+i++,weakData:{}}})},a=e.exports={enable:function(){a.enable=function(){},r=!0;var e=vt.f,t=b([].splice),i={};i[n]=1,e(i).length&&(vt.f=function(r){for(var i=e(r),o=0,a=i.length;o<a;o++)if(i[o]===n){t(i,o,1);break}return i},Ct({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:bl.f}))},fastKey:function(e,t){if(!T(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!ne(e,n)){if(!Cv(e))return"F";if(!t)return"E";o(e)}return e[n].objectID},getWeakData:function(e,t){if(!ne(e,n)){if(!Cv(e))return!0;if(!t)return!1;o(e)}return e[n].weakData},onFreeze:function(e){return Iv&&r&&Cv(e)&&!ne(e,n)&&o(e),e}};Ue[n]=!0}));Tv.enable,Tv.fastKey,Tv.getWeakData,Tv.onFreeze;var Rv=Ce.f,Lv=Tv.fastKey,Nv=qe.set,Pv=qe.getterFor,Mv={getConstructor:function(e,t,r,n){var i=e((function(e,i){Hi(e,o),Nv(e,{type:t,index:Cr(null),first:void 0,last:void 0,size:0}),u||(e.size=0),null!=i&&eo(i,e[n],{that:e,AS_ENTRIES:r})})),o=i.prototype,a=Pv(t),s=function(e,t,r){var n,i,o=a(e),s=c(e,t);return s?s.value=r:(o.last=s={index:i=Lv(t,!0),key:t,value:r,previous:n=o.last,next:void 0,removed:!1},o.first||(o.first=s),n&&(n.next=s),u?o.size++:e.size++,"F"!==i&&(o.index[i]=s)),e},c=function(e,t){var r,n=a(e),i=Lv(t);if("F"!==i)return n.index[i];for(r=n.first;r;r=r.next)if(r.key==t)return r};return Bi(o,{clear:function(){for(var e=a(this),t=e.index,r=e.first;r;)r.removed=!0,r.previous&&(r.previous=r.previous.next=void 0),delete t[r.index],r=r.next;e.first=e.last=void 0,u?e.size=0:this.size=0},delete:function(e){var t=a(this),r=c(this,e);if(r){var n=r.next,i=r.previous;delete t.index[r.index],r.removed=!0,i&&(i.next=n),n&&(n.previous=i),t.first==r&&(t.first=n),t.last==r&&(t.last=i),u?t.size--:this.size--}return!!r},forEach:function(e){for(var t,r=a(this),n=on(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!c(this,e)}}),Bi(o,r?{get:function(e){var t=c(this,e);return t&&t.value},set:function(e,t){return s(this,0===e?0:e,t)}}:{add:function(e){return s(this,e=0===e?0:e,e)}}),u&&Rv(o,"size",{get:function(){return a(this).size}}),i},setStrong:function(e,t,r){var n=t+" Iterator",i=Pv(t),o=Pv(n);Li(e,t,(function(e,t){Nv(this,{type:n,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=o(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?"keys"==t?{value:r.key,done:!1}:"values"==t?{value:r.value,done:!1}:{value:[r.key,r.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),r?"entries":"values",!r,!0),Fi(t)}};!function(e,t,r){var n=-1!==e.indexOf("Map"),i=-1!==e.indexOf("Weak"),o=n?"set":"add",u=a[e],c=u&&u.prototype,l=u,f={},h=function(e){var t=b(c[e]);$e(c,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return!(i&&!T(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return i&&!T(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return!(i&&!T(e))&&t(this,0===e?0:e)}:function(e,r){return t(this,0===e?0:e,r),this})};if(Ot(e,!I(u)||!(i||c.forEach&&!s((function(){(new u).entries().next()})))))l=r.getConstructor(t,e,n,o),Tv.enable();else if(Ot(e,!0)){var d=new l,p=d[o](i?{}:-0,1)!=d,v=s((function(){d.has(1)})),g=co((function(e){new u(e)})),m=!i&&s((function(){for(var e=new u,t=5;t--;)e[o](t,t);return!e.has(-0)}));g||((l=t((function(e,t){Hi(e,c);var r=bp(new u,e,l);return null!=t&&eo(t,r[o],{that:r,AS_ENTRIES:n}),r}))).prototype=c,c.constructor=l),(v||m)&&(h("delete"),h("has"),n&&h("get")),(m||p)&&h(o),i&&c.clear&&delete c.clear}f[e]=l,Ct({global:!0,forced:l!=u},f),wi(l,e),i||r.setStrong(l,e,n)}("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),Mv);var jv=er("splice"),Dv=a.TypeError,Bv=Math.max,Uv=Math.min;Ct({target:"Array",proto:!0,forced:!jv},{splice:function(e,t){var r,n,i,o,a,s,u=te(this),c=st(u),l=it(e,c),f=arguments.length;if(0===f?r=n=0:1===f?(r=0,n=c-l):(r=f-2,n=Uv(Bv(tt(t),0),c-l)),c+r-n>9007199254740991)throw Dv("Maximum allowed length exceeded");for(i=$t(u,n),o=0;o<n;o++)(a=l+o)in u&&Mt(i,o,u[a]);if(i.length=n,r<n){for(o=l;o<c-n;o++)s=o+r,(a=o+n)in u?u[s]=u[a]:delete u[s];for(o=c;o>c-n+r;o--)delete u[o-1]}else if(r>n)for(o=c-n;o>l;o--)s=o+r-1,(a=o+n-1)in u?u[s]=u[a]:delete u[s];for(o=0;o<r;o++)u[o+l]=arguments[o+2];return u.length=c-n+r,i}});var Fv=function(){function e(t,r){Vn(this,e),this.key="",this.wrapEleId="",this.videoEle=null,this.stream=null,this.streamId="",this.state="",t&&(this.logger=t),this.isContent=!!r,this.streamTimmerCountDown=500,this.loadStatus="LOAD_START",this.streamStatus="ENABLED",this.streamStatusTimmer=null,this.onCanPlay=this.onCanPlay.bind(this),this.onLoadStart=this.onLoadStart.bind(this),this.onError=this.onError.bind(this),this.onUnmute=this.onUnmute.bind(this),this.onMute=this.onMute.bind(this),this.onEnded=this.onEnded.bind(this),this.onAbort=this.onAbort.bind(this),this.onEmptied=this.onEmptied.bind(this),this.onVideoEnded=this.onVideoEnded.bind(this),this.onLoadeddata=this.onLoadeddata.bind(this),this.onStalled=this.onStalled.bind(this),this.onSuspend=this.onSuspend.bind(this),this.onWainting=this.onWainting.bind(this)}return Gn(e,[{key:"initVideoStreamById",value:function(e,t){var r=(null==t?void 0:t.id)||"";this.key=e,r!==this.streamId&&(this.stream&&this.removeStreamTrackEventListener(),t&&this.initStreamTrackEventListener(t),this.stream=t),this.setSrcObject(r),this.streamId=r}},{key:"getVideoTracks",value:function(){return this.stream?this.stream.getVideoTracks():[]}},{key:"updateLocalTrack",value:function(){this.removeStreamTrackEventListener(),this.initStreamTrackEventListener(this.stream),this.sendVideoStatus()}},{key:"initVideoSource",value:function(e){var t=document.getElementById(e);if(t){var r=t.querySelector("video");if(r)r.autoplay=!0,r.playsInline=!0,r.controls=!1;else{var n=document.createElement("video");n.autoplay=!0,n.playsInline=!0,n.controls=!1,t.appendChild(n),r=n}this.wrapEleId!==e||r!==this.videoEle?(this.videoEle&&this.videoEle!==r&&this.removeEventListener(this.videoEle),this.wrapEleId=e,this.videoEle=r,this.initEventListerner(this.videoEle),this.logger.log("[VM]init video source: ",{key:this.key,wrapEleId:this.wrapEleId}),this.setSrcObject()):this.logger.log("[vm]update video ele",e)}else{var i="Not found wrap video element use id ".concat(this.wrapEleId," selector");this.logger.log(i)}}},{key:"setSrcObject",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(!this.isHaveSrcObject&&this.stream||this.streamId!==e&&this.stream)){t.next=12;break}if(!this.videoEle){t.next=12;break}if(this.videoEle.srcObject=this.stream,!this.videoEle.paused){t.next=11;break}return t.prev=4,t.next=7,this.videoEle.play();case 7:t.next=11;break;case 9:t.prev=9,t.t0=t.catch(4);case 11:this.logger.log("[VM]set video srcObject: ",{key:this.key,streamId:this.streamId});case 12:case"end":return t.stop()}}),t,this,[[4,9]])})))}},{key:"initEventListerner",value:function(e){e.addEventListener("canplay",this.onCanPlay),e.addEventListener("loadstart",this.onLoadStart),e.addEventListener("error",this.onError),e.addEventListener("waiting",this.onWainting),e.addEventListener("suspend",this.onSuspend),e.addEventListener("stalled",this.onStalled),e.addEventListener("loadeddata",this.onLoadeddata),e.addEventListener("ended",this.onVideoEnded),e.addEventListener("emptied",this.onEmptied),e.addEventListener("abort",this.onAbort)}},{key:"removeEventListener",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.videoEle;null==e||e.removeEventListener("canplay",this.onCanPlay),null==e||e.removeEventListener("loadstart",this.onLoadStart),null==e||e.removeEventListener("error",this.onError),null==e||e.removeEventListener("waiting",this.onWainting),null==e||e.removeEventListener("suspend",this.onSuspend),null==e||e.removeEventListener("stalled",this.onStalled),null==e||e.removeEventListener("loadeddata",this.onLoadeddata),null==e||e.removeEventListener("ended",this.onVideoEnded),null==e||e.removeEventListener("emptied",this.onEmptied),null==e||e.removeEventListener("abort",this.onAbort)}},{key:"initStreamTrackEventListener",value:function(e){var t,r,n;null===(t=null==e?void 0:e.getVideoTracks()[0])||void 0===t||t.addEventListener("mute",this.onMute),null===(r=null==e?void 0:e.getVideoTracks()[0])||void 0===r||r.addEventListener("unmute",this.onUnmute),null===(n=null==e?void 0:e.getVideoTracks()[0])||void 0===n||n.addEventListener("ended",this.onEnded)}},{key:"removeStreamTrackEventListener",value:function(){var e,t,r,n,i,o;this.streamStatus="ENABLED",null===(t=null===(e=this.stream)||void 0===e?void 0:e.getVideoTracks()[0])||void 0===t||t.removeEventListener("mute",this.onMute),null===(n=null===(r=this.stream)||void 0===r?void 0:r.getVideoTracks()[0])||void 0===n||n.removeEventListener("unmute",this.onUnmute),null===(o=null===(i=this.stream)||void 0===i?void 0:i.getVideoTracks()[0])||void 0===o||o.removeEventListener("ended",this.onEnded)}},{key:"isHaveSrcObject",value:function(){return this.videoEle&&this.videoEle.srcObject}},{key:"setSource",value:function(e,t){this.logger.log("[vm]set source",{key:e,thisKey:this.key,wrapId:t,thisWrapId:this.wrapEleId}),this.key=e,this.initVideoSource(t)}},{key:"destroy",value:function(){this.clearTrackStatusTimmer(),this.removeEventListener(this.videoEle),this.stream&&this.removeStreamTrackEventListener(),this.key="",this.wrapEleId="",this.videoEle=null,this.stream=null,this.streamId="",this.state=""}},{key:"setVideoStatusChange",value:function(e){this.cb=e}},{key:"onEnded",value:function(){this.streamStatus="ENDED",this.sendVideoStatus()}},{key:"onMute",value:function(){var e=this;this.streamStatus="MUTE",this.clearTrackStatusTimmer(),this.streamStatusTimmer=setTimeout((function(){"MUTE"===e.streamStatus&&e.sendVideoStatus()}),this.streamTimmerCountDown)}},{key:"onUnmute",value:function(){this.clearTrackStatusTimmer(),this.streamStatus="ENABLED",this.sendVideoStatus()}},{key:"onSuspend",value:function(){this.logger.log("video suspend",this.key)}},{key:"onWainting",value:function(){this.logger.log("video wainting",this.key)}},{key:"onStalled",value:function(){this.logger.log("video stalled",this.key)}},{key:"onLoadeddata",value:function(){this.logger.log("video loadeddata",this.key)}},{key:"onVideoEnded",value:function(){this.logger.log("video videoEnded",this.key)}},{key:"onEmptied",value:function(){this.logger.log("video emptied",this.key)}},{key:"onAbort",value:function(){this.logger.log("video abort",this.key)}},{key:"onCanPlay",value:function(e){this.logger.log("video canplay",this.key),this.loadStatus="CANPLAY",this.sendVideoStatus()}},{key:"onLoadStart",value:function(e){this.logger.log("video loadstart",this.key),this.loadStatus="LOAD_START",this.sendVideoStatus()}},{key:"onError",value:function(e){this.logger.log("video error",this.key),this.loadStatus="ERROR"}},{key:"clearTrackStatusTimmer",value:function(){this.streamStatusTimmer&&(clearTimeout(this.streamStatusTimmer),this.streamStatusTimmer=null)}},{key:"sendVideoStatus",value:function(){"CANPLAY"===this.loadStatus&&"ENABLED"===this.streamStatus?("CANPLAY"!==this.state&&(this.streamTimmerCountDown=1e4),this.state="CANPLAY",this.emmit(this.key,{status:"CANPLAY",id:this.key})):"ENDED"===this.streamStatus?(this.state="ENDED",this.emmit(this.key,{status:"ENDED",id:this.key})):"LOAD_START"!==this.loadStatus&&"MUTE"!==this.streamStatus||this.isContent&&"CANPLAY"===this.loadStatus||(this.state="REQUEST",this.emmit(this.key,{status:"REQUEST",id:this.key}))}},{key:"emmit",value:function(e,t){this.cb&&this.cb(e,t)}}]),e}(),zv=mn.trim,Hv=b("".charAt),Vv=a.parseFloat,Wv=a.Symbol,Gv=Wv&&Wv.iterator,Kv=1/Vv(fn+"-0")!=-1/0||Gv&&!s((function(){Vv(Object(Gv))}))?function(e){var t=zv(dr(e)),r=Vv(t);return 0===r&&"-"==Hv(t,0)?-0:r}:Vv;Ct({global:!0,forced:parseFloat!=Kv},{parseFloat:Kv});var qv=function(e,t,r){var n=e.roster,i=n.videoRxMute,o=n.videoTxMute,a=n.deviceType,s=n.isContent,u=n.isLocal;return s?o?"AUDIO_CONTENT":t&&"REQUEST"!==r&&r?"NORMAL":"REQUEST":i&&o?"AUDIO_ONLY":o||"ENDED"===r?"MUTE":"tel"===a||"pstngw"===a?"AUDIO_TEL":t&&"REQUEST"!==r||u?"NORMAL":"REQUEST"},Yv=function(e,t,r,n,i){var o,a,s=parseFloat((e/t).toFixed(3)),u=qf.RATIO_MAP[i];return s<qf.HOR_CONTAINER_RATIO?(o=r,a=parseFloat((r*s).toFixed(3))):(o=parseFloat((n/s).toFixed(3)),a=n),{realWidth:a,realHeight:o,realRotate:u}},Zv=function(e,t,r){var n=e.width,i=void 0===n?16:n,o=e.height,a=void 0===o?9:o,s=e.rotation,u={};if(s>=0&&s<=3){var c=1===s||3===s,l=Yv(c?a:i,c?i:a,r,t,s),f=l.realWidth,h=l.realHeight,d=l.realRotate;u={transform:"rotateZ(".concat(d,"deg)"),width:"".concat(c?h:f,"px"),height:"".concat(c?f:h,"px")}}return u},Jv=[-30,-30,1,1],Xv={"1-1":[{position:[0,0,1,1],resolution:3}],"2-1":[{position:[0,0,.75,1],resolution:3},{position:[.75,0,.25,.333],resolution:1}],"3-1":[{position:[0,0,.75,1],resolution:3},{position:[.75,0,.25,.333],resolution:1},{position:[.75,.333,.25,.333],resolution:1}],"4-1":[{position:[0,0,.75,1],resolution:3},{position:[.75,0,.25,.333],resolution:1},{position:[.75,.333,.25,.333],resolution:1},{position:[.75,.666,.25,.333],resolution:1}],"5-1":[{position:[.125,0,.75,.75],resolution:3},{position:[0,.75,.25,.25],resolution:1},{position:[.25,.75,.25,.25],resolution:1},{position:[.5,.75,.25,.25],resolution:1},{position:[.75,.75,.25,.25],resolution:1}],"6-1":[{position:[0,0,.75,.75],resolution:3},{position:[0,.75,.25,.25],resolution:1},{position:[.25,.75,.25,.25],resolution:1},{position:[.5,.75,.25,.25],resolution:1},{position:[.75,.75,.25,.25],resolution:1},{position:[.75,.5,.25,.25],resolution:1}],"7-1":[{position:[0,0,.75,.75],resolution:3},{position:[0,.75,.25,.25],resolution:1},{position:[.25,.75,.25,.25],resolution:1},{position:[.5,.75,.25,.25],resolution:1},{position:[.75,.75,.25,.25],resolution:1},{position:[.75,.5,.25,.25],resolution:1},{position:[.75,.25,.25,.25],resolution:1}],"8-1":[{position:[0,0,.75,.75],resolution:3},{position:[0,.75,.25,.25],resolution:1},{position:[.25,.75,.25,.25],resolution:1},{position:[.5,.75,.25,.25],resolution:1},{position:[.75,.75,.25,.25],resolution:1},{position:[.75,.5,.25,.25],resolution:1},{position:[.75,.25,.25,.25],resolution:1},{position:[.75,0,.25,.25],resolution:1}]},$v={"1-1":[{position:[0,0,1,1],resolution:3}],"2-1":[{position:[0,0,.5,1],resolution:3},{position:[.5,0,.5,1],resolution:3}],"3-1":[{position:[.25,0,.5,.5],resolution:2},{position:[0,.5,.5,.5],resolution:2},{position:[.5,.5,.5,.5],resolution:2}],"4-1":[{position:[0,0,.5,.5],resolution:2},{position:[0,.5,.5,.5],resolution:2},{position:[.5,.5,.5,.5],resolution:2},{position:[.5,0,.5,.5],resolution:2}],"5-1":[{position:[0,0,.333,.5],resolution:1},{position:[0,.5,.333,.5],resolution:1},{position:[.333,.5,.333,.5],resolution:1},{position:[.333,0,.333,.5],resolution:1},{position:[.666,0,.333,.5],resolution:1}],"6-1":[{position:[0,0,.333,.5],resolution:1},{position:[0,.5,.333,.5],resolution:1},{position:[.333,.5,.333,.5],resolution:1},{position:[.333,0,.333,.5],resolution:1},{position:[.666,0,.333,.5],resolution:1},{position:[.666,.5,.333,.5],resolution:1}],"7-1":[{position:[0,0,.333,.333],resolution:1},{position:[0,.666,.333,.333],resolution:1},{position:[.333,.333,.333,.333],resolution:1},{position:[.333,0,.333,.333],resolution:1},{position:[.666,0,.333,.333],resolution:1},{position:[.666,.333,.333,.333],resolution:1},{position:[0,.333,.333,.333],resolution:1}],"8-1":[{position:[0,0,.333,.333],resolution:1},{position:[0,.666,.333,.333],resolution:1},{position:[.333,.333,.333,.333],resolution:1},{position:[.333,0,.333,.333],resolution:1},{position:[.666,0,.333,.333],resolution:1},{position:[.666,.333,.333,.333],resolution:1},{position:[0,.333,.333,.333],resolution:1},{position:[.333,.666,.333,.333],resolution:1}],"9-1":[{position:[0,0,.333,.333],resolution:1},{position:[0,.666,.333,.333],resolution:1},{position:[.333,.333,.333,.333],resolution:1},{position:[.333,0,.333,.333],resolution:1},{position:[.666,0,.333,.333],resolution:1},{position:[.666,.333,.333,.333],resolution:1},{position:[0,.333,.333,.333],resolution:1},{position:[.333,.666,.333,.333],resolution:1},{position:[.666,.666,.333,.333],resolution:1}]},Qv={SPEAKER:{length:8,temp:{0:Xv["1-1"],1:Xv["1-1"],2:Xv["2-1"],3:Xv["3-1"],4:Xv["4-1"],5:Xv["5-1"],6:Xv["6-1"],7:Xv["7-1"],8:Xv["8-1"]},rate:{0:.5625,1:.5625,2:.4218,3:.4218,4:.4218,5:.5625,6:.5625,7:.5625,8:.5625}},GALLERY:{length:9,temp:{0:$v["1-1"],1:$v["1-1"],2:$v["2-1"],3:$v["3-1"],4:$v["4-1"],5:$v["5-1"],6:$v["6-1"],7:$v["7-1"],8:$v["8-1"],9:$v["9-1"]},rate:{0:.5625,1:.5625,2:.2812,3:.5625,4:.5625,5:.375,6:.375,7:.5625,8:.5625,9:.5625}}},eg={MULTI_PIC_CONTENT_HIGH_PRIORITY:Qv.SPEAKER,MULTI_PIC_ACTIVE_HIGH_PRIORITY:Qv.SPEAKER,TWO_PIC_PIP:{length:2,temp:{2:[{position:[0,0,1,1],resolution:3,zIndex:1},{position:[.75,.75,.25,.25],resolution:1,zIndex:2}]},rate:{2:.5625}},CONTENT_ONLY:{length:1,temp:{1:[{position:[0,0,1,1],resolution:3}]},rate:{1:.5625}},TWO_PIC_SYMMETRIC:{length:2,temp:{2:[{position:[0,0,.5,1],resolution:3},{position:[.5,0,.5,1],resolution:3}]},rate:{2:.2812}}},tg=Object.assign(Object.assign({},Qv),eg),rg=function(){function e(t){var r,n;Vn(this,e),this.client=t,this.logger=t.logger,this.customLayoutList=new Map,this.layoutList=new Map,this.videoManagers={},this.orderRosterList=[],this.selfRoster=Object.assign(Object.assign({},qf.ROSTER),{isLocal:!0}),this.newLayoutList=[],this.initLayout=[],this.templateMode=(null===(r=t.config)||void 0===r?void 0:r.templateMode)||"SPEAKER",this.specifyTemplateMode=null===(n=t.config)||void 0===n?void 0:n.templateMode,this.templateRate={previous:.5625,next:null},this.content={previous:null,next:null},this.screenInfo={width:0,height:0,rateHeight:0,rateWidth:0},this.internelsLayout={},this.forceFullScreenId="",this.chairmanRoster=null,this.localContent=null,this.calculateScreenInfo(),this.onVideoStatusChange=this.onVideoStatusChange.bind(this)}return Gn(e,[{key:"getNewLayout",value:function(){return this.newLayoutList}},{key:"getOrderRosterList",value:function(){return this.orderRosterList}},{key:"getLayoutList",value:function(){return this.layoutList}},{key:"getCustomLayoutList",value:function(){return this.customLayoutList}},{key:"getTemplateRate",value:function(){return this.templateRate}},{key:"getContentRosterItem",value:function(){return this.content.next}},{key:"getSelfRoster",value:function(){return this.selfRoster}},{key:"getScreenInfo",value:function(){return this.screenInfo}},{key:"getVideoManagers",value:function(){return this.videoManagers}},{key:"getForceFullScreenId",value:function(){return this.forceFullScreenId}},{key:"getTemplateMode",value:function(){return this.templateMode}},{key:"getChairmanRoster",value:function(){return this.chairmanRoster}},{key:"rosterRecvMode",value:function(e){var t,r,n,i=this,o=[],a=.5625,s=this.client.getContentSenderPid(),u=this.client.getChairmanUri(),c=this.selfRoster.participantId,l=this.client.invite.callerUri,f=(null===(t=this.localContent)||void 0===t?void 0:t.participantId)===c;this.specifyTemplateMode&&([].concat(Qn(Zf),Qn(Yf)).findIndex((function(e){return e===i.specifyTemplateMode}))<0&&(this.templateMode=s?"MULTI_PIC_CONTENT_HIGH_PRIORITY":"SPEAKER"));s?(Zf.findIndex((function(e){return e===i.templateMode}))<0&&!this.specifyTemplateMode&&(this.templateMode="MULTI_PIC_CONTENT_HIGH_PRIORITY"),f&&(this.templateMode="GALLERY"),"TWO_PIC_PIP"!==this.templateMode&&"TWO_PIC_SYMMETRIC"!==this.templateMode||(this.orderRosterList=this.orderRosterList.filter((function(e){return!e.isLocal}))),"MULTI_PIC_ACTIVE_HIGH_PRIORITY"===this.templateMode&&(this.orderRosterList[0]=this.orderRosterList.splice(2,1,this.orderRosterList[0])[0]),"GALLERY"!==this.templateMode||f||(this.orderRosterList=this.orderRosterList.filter((function(e){return!e.isContent})),this.orderRosterList[0]=this.orderRosterList.splice(1,1,this.orderRosterList[0])[0],e=this.orderRosterList.length),f?e=e>4?4:e:u&&this.chairmanRoster&&(null===(r=this.chairmanRoster)||void 0===r?void 0:r.endpointId)!==l&&e>3&&(e=3)):(Yf.findIndex((function(e){return e===i.templateMode}))<0&&(this.templateMode="SPEAKER"),u&&this.chairmanRoster&&(null===(n=this.chairmanRoster)||void 0===n?void 0:n.endpointId)!==l&&e>2&&(e=2));var h=tg[this.templateMode];switch(this.templateMode){case"TWO_PIC_PIP":o=h.temp[2],a=h.rate[2];break;case"CONTENT_ONLY":o=h.temp[1],a=h.rate[1];break;case"TWO_PIC_SYMMETRIC":o=h.temp[2],a=h.rate[2];break;default:e>=0&&e<=h.length?(o=h.temp[e],a=h.rate[e]):(o=h.temp[h.length],a=h.rate[h.length])}return{tempLayout:o,templateRate:a}}},{key:"getInternelsLayout",value:function(){return this.internelsLayout}},{key:"setOrderRosterList",value:function(e){this.orderRosterList=e}},{key:"initLayoutManager",value:function(){this.orderRosterList=this.calculateOrderRosterList();var e=this.orderRosterList.length,t=this.templateRate.next,r=this.rosterRecvMode(e),n=r.tempLayout,i=r.templateRate;t!==i&&(this.templateRate={next:i,previous:i},this.calculateScreenInfo()),this.initLayout=pv(n),this.newLayoutList=this.calculateNewLayoutList()}},{key:"onVideoStatusChange",value:function(e,t){this.logger.log("[LM]on video status change: ",{key:e,data:t});var r,n="AUTO"===this.client.config.layout,i=n?this.layoutList:this.customLayoutList,o=t.status,a=!1;if(i.has(e)){var s=i.get(e),u=s.state,c=s.roster.isLocal;"NORMAL"!==u&&"REQUEST"!==u||"ENDED"!==o?"NORMAL"!==u||"REQUEST"!==o||c?"REQUEST"!==u&&"INVALID"!==u||"CANPLAY"!==o||(r="NORMAL",a=!0):(r="REQUEST",a=!0):(r="INVALID",a=!0),a&&(i.set(e,Object.assign(Object.assign({},s),{state:r})),n?(this.layoutList=i,this.client.sendLayoutMessage()):(this.customLayoutList=i,this.client.sendCustomLayoutMessage()))}}},{key:"setVideoRenderer",value:function(e,t){this.logger.log("[lm]set video renderer:",{key:e,wrapEleId:t}),this.videoManagers[e]||(this.logger.log("[lm]Not Match VM: ",e),this.videoManagers[e]=new Fv(this.logger)),this.videoManagers[e].setSource(e,t)}},{key:"updateStreams",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],r="AUTO"===this.client.config.layout,n=r?this.layoutList:this.customLayoutList,i=this.client.getLayoutRosters(),o=i.total.length;n.forEach((function(t,r){var a=t.roster,s=a.isLocal,u=a.id,c=a.isContent,l=!1;e.videoManagers[u]||(e.videoManagers[u]=new Fv(e.logger,c),e.videoManagers[u].setVideoStatusChange(e.onVideoStatusChange)),e.videoManagers[u].match=!0;var f=e.videoManagers[u].state;if(s){var h=e.client.getPreviewStreams().previewStreams,d=((void 0===h?[]:h)[0]||{stream:null}).stream;e.videoManagers[u].initVideoStreamById(u,d);var p=qv(t,d,f),v=n.get(r);n.set(r,Object.assign(Object.assign({},v),{state:p}))}else{for(var g=0;g<o;g++){var m=i.total[g],y=m.participantId,b=m.mediagroupid,w=m.videoTrackId;if(t.roster.participantId+t.roster.mediagroupid===y+b){var k=e.getVideoStreamByTrackId(w).videoStream;l=!0,e.videoManagers[u].initVideoStreamById(u,k);var _=qv(t,k,f),S=n.get(r);n.set(r,Object.assign(Object.assign({},S),{state:_}));break}}if(!l){e.videoManagers[u].initVideoStreamById(u,null);var x=qv(t,null,f),E=n.get(r);n.set(r,Object.assign(Object.assign({},E),{state:x}))}}})),this.clearInvalidVideoManagers(),this.logger.log("updated new layout list",xl(n)),r?(this.layoutList=n,t&&this.client.sendLayoutMessage()):(this.customLayoutList=n,t&&this.client.sendCustomLayoutMessage())}},{key:"clearInvalidVideoManagers",value:function(){var e=this;Object.keys(this.videoManagers).forEach((function(t){e.videoManagers[t].match?delete e.videoManagers[t].match:(e.videoManagers[t].destroy(),delete e.videoManagers[t])}))}},{key:"createCustomLayout",value:function(e){var t=this;e.forEach((function(e){var r=e.calluri,n=e.mediagroupid,i=e.isAudioMute,o=e.isVideoMute,a=e.remoteName,s=e.remoteType,u=e.MuteReason,c=r+n,l=Object.assign(Object.assign({},e),{id:c,isLocal:!1,isContent:1===n,displayName:a,endpointId:r,audioTxMute:i,videoTxMute:o,videoRxMute:!1,deviceType:s,audioRxMute:!1,videoMuteReason:u,isForceFullScreen:!1,isLastAdd:!1,onHold:!1,isPolling:!1});if(t.customLayoutList.has(c)){var f=t.customLayoutList.get(c);t.customLayoutList.set(c,Object.assign(Object.assign({},f),{roster:l,resolution:0,quality:0,deal:!0}))}else t.customLayoutList.set(c,{roster:l,rotate:{},state:"NORMAL",resolution:0,quality:0,deal:!0})})),this.clearInvalidLayout(),this.logger.log("[v2]custom layout list: ",this.customLayoutList)}},{key:"requestLayout",value:function(e){var t=this,r=this.orderRosterList;e.forEach((function(e){var n=e.callUri,i=e.isContent,o=e.resolution,a=e.quality,s=n+Number(i),u=t.customLayoutList.has(s),c=r.findIndex((function(e){return e.endpointId+Number(e.isContent)===s})),l=r[c],f=a>0?100*a:100;if(u){var h=t.customLayoutList.get(s);t.customLayoutList.set(s,Object.assign(Object.assign({},h),{roster:l,resolution:o,quality:f,deal:!0}))}else t.customLayoutList.set(s,{roster:l,rotate:{},state:"NORMAL",resolution:o,quality:f,deal:!0})})),this.clearInvalidLayout();var n=this.customLayoutCalculator();this.client.sendCustomLayout(n),this.logger.log("custom layout list: ",this.customLayoutList)}},{key:"clearInvalidLayout",value:function(){var e="AUTO"===this.client.config.layout?this.layoutList:this.customLayoutList;e.forEach((function(t,r){t.deal?e.set(r,Object.assign(Object.assign({},t),{deal:!1})):e.delete(r)}))}},{key:"createBaseLayout",value:function(){var e=this;this.newLayoutList.forEach((function(t){var r=t.roster,n=t.position,i=t.zIndex,o=t.resolution,a=r.endpointId+r.mediagroupid;if(e.layoutList.has(a)){var s=e.layoutList.get(a);e.layoutList.set(a,Object.assign(Object.assign({},s),{roster:r,position:n,zIndex:i,resolution:o,deal:!0}))}else e.layoutList.set(a,{roster:r,position:n,zIndex:i,resolution:o,state:"NORMAL",rotate:{},positionStyle:{},positionInfo:{},deal:!0,quality:100})})),this.clearInvalidLayout()}},{key:"calculatePosition",value:function(){var e=this,t={left:"0px",top:"0px",width:"0px",height:"0px"},r={width:0,height:0};this.layoutList.forEach((function(n,i){var o=e.screenInfo,a=o.rateWidth,s=o.rateHeight,u=$n(n.position,4),c=u[0],l=u[1],f=u[2],h=u[3],d=Math.round(a*c),p=Math.round(s*l),v=Math.round(a*f),g=Math.round(s*h);t={left:"".concat(d,"px"),top:"".concat(p,"px"),width:"".concat(v,"px"),height:"".concat(g,"px")},r={width:v,height:g},n.zIndex&&(t.zIndex=n.zIndex),e.layoutList.set(i,Object.assign(Object.assign({},n),{positionStyle:t,positionInfo:r}))}))}},{key:"requestLayoutCalculator",value:function(){var t=this,r=[],n={};if(this.forceFullScreenId){var i,o=!1,a=ri(this.layoutList);try{for(a.s();!(i=a.n()).done;){var s=$n(i.value,2);s[0];if(s[1].roster.id===this.forceFullScreenId){o=!0;break}}}catch(e){a.e(e)}finally{a.f()}o||(this.forceFullScreenId="")}return this.layoutList.forEach((function(i,o){var a=i.roster,s=a.isContent,u=a.isLocal,c=a.id,l=a.videoTxMute,f=i.resolution;if(t.forceFullScreenId&&t.forceFullScreenId!==c)return!0;if(!u&&!l){var h={index:f,quality:200,resolution:qf.RESOLUTION_MAP[f]};if(t.forceFullScreenId){var d=s?4:3;h={index:d,quality:200,resolution:qf.RESOLUTION_MAP[d]}}else s&&(h=s&&3===f?{index:4,quality:100,resolution:qf.RESOLUTION_MAP[4]}:{index:3,quality:200,resolution:qf.RESOLUTION_MAP[3]});r.push(e.getCustomLayoutItem(i,h.index,h.quality)),n[o]={resolution:h.resolution,quality:h.quality}}})),this.internelsLayout=n,r}},{key:"setForceFullScreenId",value:function(e){this.forceFullScreenId=e}},{key:"customLayoutCalculator",value:function(){var e=[],t={};return this.customLayoutList.forEach((function(r){var n=r.roster||{},i=n.isContent,o=n.id,a=n.isLocal,s=n.participantId,u=r.resolution,c=r.quality,l=c>0?100*c:100;a||(e.push({pid:s,resolution:u,quality:l,mediagroupid:Number(i)}),t[o]={resolution:qf.RESOLUTION_MAP[u],quality:l})})),this.internelsLayout=t,e}},{key:"calculateRotate",value:function(){var e=this;this.client.getRotationInfo().forEach((function(t){var r=t.participantId,n=t.mediagroupid,i=e.getLayoutKeyByRotateInfo(r,n),o={};if(i){var a=e.layoutList.get(i),s=null==a?void 0:a.positionInfo,u=s.width,c=s.height;o=Zv(t,u,c),e.layoutList.set(i,Object.assign(Object.assign({},a),{rotate:o}))}})),this.client.config.localMirror&&this.localMirrorRotate()}},{key:"getLayoutKeyByRotateInfo",value:function(e,t){var r="";return this.layoutList.forEach((function(n){var i=n.roster,o=i.isContent,a=i.endpointId,s=i.mediagroupid;i.participantId===e&&1===t===o&&(r=a+s)})),r}},{key:"localMirrorRotate",value:function(){var e=this.client.invite.callerUri+"0";if(this.layoutList.get(e)){var t=this.layoutList.get(e);this.layoutList.set(e,Object.assign(Object.assign({},t),{rotate:{transform:"rotateY(180deg)"}}))}}},{key:"getVideoStreamByTrackId",value:function(e){for(var t=this.client.getVideoTrackList(),r=t.length,n={videoStream:null,track:null},i=0;i<r;i++){var o=t[i].data,a=t[i].rest,s=o.streams[0].id;if((s=s.replace("-st","-tk-vd"))===e){n={videoStream:o.streams[0],track:a.track};break}}return n}},{key:"calculateNewLayoutList",value:function(){for(var e=this.orderRosterList.length,t=this.initLayout.length,r=[],n=0;n<e;n++){var i=this.orderRosterList[n];if(!(n<t))break;var o=Jv,a=0,s=this.initLayout[n];s&&(o=(null==s?void 0:s.position)||Jv,a=(null==s?void 0:s.zIndex)||0),r.push({seat:n,roster:i,position:o,resolution:(null==s?void 0:s.resolution)||1,zIndex:a})}return r}},{key:"calculateScreenInfo",value:function(){var e=this.client.getClientConfig();if("CUSTOM"===e.layout)return{width:0,height:0,rateHeight:0,rateWidth:0};var t=e.container,r=t.elementId,n=void 0===r?"":r,i=t.offset,o=void 0===i?[]:i,a=n&&document.getElementById(n),s=$n(o,4),u=s[0],c=void 0===u?0:u,l=s[1],f=void 0===l?0:l,h=s[2],d=void 0===h?0:h,p=s[3],v=void 0===p?0:p,g=Number(c)+Number(f),m=Number(d)+Number(v),y=(null==a?void 0:a.clientHeight)||document.body.clientHeight,b=(null==a?void 0:a.clientWidth)||document.body.clientWidth,w=y-g,k=b-m,_=w>0?w:y,S=k>0?k:b,x=Math.floor(S*this.templateRate.next),E=Math.floor(_/this.templateRate.next),O={rateHeight:0,rateWidth:0,width:S,height:_};return O=_>x?{rateWidth:S,rateHeight:x,width:S,height:_}:{rateWidth:E,rateHeight:_,width:S,height:_},this.logger.log("client screen info: ",O),this.screenInfo=O,this.client.sendScreenInfoMessage(O),O}},{key:"requestCustomLayout",value:function(){if(this.client.getOnHold())this.client.sendCustomLayout();else{var e=this.requestLayoutCalculator();this.client.sendCustomLayout(e)}}},{key:"createLayout",value:function(){var e=this.client.getPeerConnectionStatus();if(this.initLayoutManager(),this.createBaseLayout(),this.updateStreams(!1),this.requestCustomLayout(),this.calculatePosition(),this.calculateRotate(),this.client.sendLayoutMessage(),this.logger.log("create layout: ",xl(this.layoutList)),this.logger.log("current template mode:",this.templateMode),"GALLERY"!==this.templateMode&&(this.templateModeTemp=this.templateMode),this.client.sendTemplateMode(this.templateMode),this.client.sendChairmanRosterMessage(this.chairmanRoster),this.client.sendSelfRosterMessage(this.selfRoster),e){var t=this.content,r=t.previous,n=t.next;(!r&&n||r&&n&&r.participantId!==n.participantId||r&&!n)&&(this.content.previous=n,this.client.sendContentRosterMessage(n))}}},{key:"calculateOrderRosterList",value:function(){var e=this.client.getOriginRosters(),t=this.client.getInviteInfo().callerUri,r=this.client.getContentSenderPid(),n=this.client.getSpeakerInfo(),i=this.client.getChairmanUri(),o=e.length,a={content:[],chairmain:[],activeSpeaker:[],audioVideoUnmute:[],audioUnmute:[],videoUnmute:[],audioVideoMute:[]},s=[];this.chairmanRoster=null,this.localContent=null;for(var u=0;u<o;u++){var c=e[u],l=c.mediagroupid,f=c.endpointId;c.isActiveSpeaker=!1,c.isLocal=!1,c.id=f+l,f===i&&0===l&&(this.chairmanRoster=c),c.endpointId!==t?"record"!==c.deviceType&&(c.isContent&&r>0&&c.participantId!==r||(c.isContent&&r>0&&c.participantId===r?(this.content=Object.assign(Object.assign({},this.content),{next:c}),a.content.push(c)):c.isForceFullScreen?a.chairmain.push(c):n.endpointId&&n.endpointId===c.endpointId?(c.isActiveSpeaker=!0,a.activeSpeaker.push(c)):c.audioTxMute||c.videoTxMute?c.audioTxMute||!c.videoTxMute?!c.audioTxMute||c.videoTxMute?c.audioTxMute&&c.videoTxMute&&a.audioVideoMute.push(c):a.videoUnmute.push(c):a.audioUnmute.push(c):a.audioVideoUnmute.push(c))):c.isContent?this.localContent=c:this.selfRoster=Object.assign(Object.assign({},c),{isLocal:!0})}for(var h in this.localContent&&a.content&&(a.content=[],this.content=Object.assign(Object.assign({},this.content),{next:null})),a)s=s.concat(a[h]);return this.setSelfRoster(s)}},{key:"switchLayout",value:function(e){var t=this.client.getContentSenderPid()?Zf:Yf,r=e;if(e)this.specifyTemplateMode=e;else if("GALLERY"===this.templateMode)r=this.templateModeTemp;else{r=this.templateMode;var n=t.findIndex((function(e){return e===r})),i=n+1>=t.length?0:n+1;r=t[i]}return this.templateMode=r,this.createLayout(),this.logger.log("switch layout Mode: ",r),r}},{key:"setTemplateMode",value:function(e){this.templateMode=e}},{key:"setChairmanRoster",value:function(e){this.chairmanRoster=e}},{key:"setContentRosterItem",value:function(e){this.content={previous:e,next:e}}},{key:"clearVideoManagersUseMonitorList",value:function(e){var t=this;e.forEach((function(e){t.videoManagers[e]&&(t.videoManagers[e].destroy(),delete t.videoManagers[e])}))}},{key:"setSelfRoster",value:function(e){var t=this.client.getLocalHide();return 0===e.length?(e.push(this.selfRoster),e):(t||e.splice(1,0,this.selfRoster),e||[])}}],[{key:"getCustomLayoutItem",value:function(e,t,r){var n=e.roster.isContent;return{pid:e.roster.participantId,resolution:t,quality:r,mediagroupid:n?1:0}}}]),e}(),ng=function(e){Kn(r,Fp);var t=Xn(r);function r(e,n,i){var o,a,s,u,c,l;Vn(this,r),(o=t.call(this)).onSetAudioStream=function(e){if(e){var t=o.stream.getMediaStreams().previewStreams;"mute"===e&&t.length&&o.stream.setAudioOrVideoStatus("muteAudio"),"unmute"===e&&t.length&&o.stream.setAudioOrVideoStatus("unmuteAudio")}},o.getSelfRoster=function(){var e;return null===(e=o.layoutManager)||void 0===e?void 0:e.getSelfRoster()},o.logger=i;try{o.logger.initDB(),sp.setLogger(o.logger)}catch(e){o.logger.error("init db error: ",e)}return o.logger.log("init config: ",e),o.config=e,o.autoMode="AUTO"===e.layout.toUpperCase(),o.debug=e.debug,o.localHide=e.localHide,o.hideId=e.__hideId,o.servers=n,o.loginInfo=qf.LOGIN_INFO,o.disconnected=!1,o.clientStatus=!0,o.peerConnectionStatus=!1,o.isAutoBandwidth=!0,o.seq=0,o.token="",o.meetingControl={callIndex:-1,callUri:"",chairmanUri:"",contentIsDisabled:!1,disableMute:!1,muteOperation:"mute",role:"",type:""},o.speakerInfo={endpointId:"",pid:0},o.stream=null,o.rosters=[],o.videoTrackList=[],o.audioTrackList=[],o.layoutManager=new rg(Zn(o)),o.layoutRosters={content:[],people:[],total:[]},o.pushType="ALL",o.cacheMeetingControlMessage=null,o.rotationInfo={people:[],content:[],total:[]},o.customLayoutSeq=0,o.contentSenderPid=0,o.invite={callerUri:"",callIndex:0,automute:"",meetingId:""},o.shareContentTimmer=null,o.shareContentStatus="ENDED",o.streamChangeList={content:[],people:[]},o.autoSwitchDevice=!0,o.audioManagers={},o.limitResolution=[],o.isPermissionDenied={camera:!1,microphone:!1},o.errorcode=Tc.get("xy-error-code"),o.onScreenChangeEvent=o.onScreenChangeEvent.bind(Zn(o)),o.onDocumentChange=(a=o.onScreenChangeEvent,s=500,u=300,c=null,l=null,function(){var e=+new Date,t=this,r=arguments;clearTimeout(c),l||(l=e),e-l>=u?(a.apply(t,r),l=e):c=setTimeout((function(){a.apply(t,r)}),s)}),o.autoMode&&o.initEvent(),o.deviceManager=new Ev(o.logger),o.initDeviceManagerEvent(),o}return Gn(r,[{key:"getClientConfig",value:function(){return this.config}},{key:"getVideoManagers",value:function(){var e;return null===(e=this.layoutManager)||void 0===e?void 0:e.getVideoManagers()}},{key:"getPreviewStreams",value:function(){var e;return(null===(e=this.stream)||void 0===e?void 0:e.getMediaStreams())||{previewStreams:[]}}},{key:"getVideoTrackList",value:function(){return this.videoTrackList}},{key:"getLayoutRosters",value:function(){return this.layoutRosters}},{key:"getOriginRosters",value:function(){return this.rosters}},{key:"getInviteInfo",value:function(){return this.invite}},{key:"getContentSenderPid",value:function(){return this.contentSenderPid}},{key:"getSpeakerInfo",value:function(){return this.speakerInfo}},{key:"getLocalHide",value:function(){return this.localHide}},{key:"getRotationInfo",value:function(){return this.rotationInfo.total}},{key:"getPeerConnectionStatus",value:function(){return this.peerConnectionStatus}},{key:"getOnHold",value:function(){return this.onhold}},{key:"getLayoutList",value:function(){var e=this.config.layout;return"AUTO"===e?this.layoutManager.getLayoutList():"CUSTOM"===e?this.layoutManager.getCustomLayoutList():void 0}},{key:"getChairmanUri",value:function(){return this.meetingControl.chairmanUri}},{key:"toggleLocal",value:function(){var e=this;return new Promise((function(t,r){if(e.autoMode){e.localHide=!e.localHide,e.layoutManager.createLayout();var n=e.layoutManager.getOrderRosterList();e.emmit("roster",{rosters:n}),t({status:e.localHide})}else r(El(10300,"自定义布局模式不支持隐藏本地画面功能"))}))}},{key:"toggleHideId",value:function(){var e=this;return new Promise((function(t,r){e.hideId=e.hideId?"":"HIDE",e.sendSocketMessage({type:"UPDATE_HIDEID",hideId:e.hideId}),t(!!e.hideId)}))}},{key:"setVideoRenderer",value:function(e,t){this.layoutManager.setVideoRenderer(e,t)}},{key:"setAudioRenderer",value:function(e,t){return es(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i,o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(this.audioManagers[e]||(this.audioManagers[e]={ele:t}),!(n=this.audioManagers[e])||!n.ele||n.ele.srcObject){r.next=17;break}if(i=this.audioTrackList.findIndex((function(t){return t.rest.streamId===e})),n.ele.autoPlay=!0,!(i>=0)){r.next=17;break}return n.ele.srcObject=this.audioTrackList[i].data.streams[0],r.prev=7,r.next=10,n.ele.play();case 10:o=this.stream.config.devices,this.stream&&o&&o.audioOutputValue&&"default"!==o.audioOutputValue&&this.deviceManager.setAudioOutputDevice(n.ele,o.audioOutputValue),r.next=17;break;case 14:r.prev=14,r.t0=r.catch(7),this.logger.warn("audio play error: ",r.t0);case 17:case"end":return r.stop()}}),r,this,[[7,14]])})))}},{key:"switchAutoDevice",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return new Promise((function(r,n){e.autoSwitchDevice=!!t,r(e.autoSwitchDevice)}))}},{key:"switchLayout",value:function(e){var t=this;return this.logger.log("switch layout input: ",e),new Promise((function(r,n){t.autoMode?(e=t.layoutManager.switchLayout(e),sp.setStates("click","layout"),r(e)):n(El(10301,"自定义布局模式不支持切换布局"))}))}},{key:"handleSocketMessage",value:function(e,t){var r=this;if(!this.disconnected)switch(e.type){case"CALL_INDEX":var n=e.callIndex,i=e.callerUri,o=void 0===i?"":i;if(this.invite=Object.assign(Object.assign({},this.invite),{callIndex:n,callerUri:o}),this.logger.log("Get callIndex message: ",this.invite),"AUTO"===this.config.layout){var a=this.layoutManager.getScreenInfo();this.sendScreenInfoMessage(a)}break;case"CONNECTED":this.invite=Object.assign(Object.assign({},this.invite),e),this.logger.log("Get connected message: ",this.invite),setTimeout((function(){t(r.clientStatus&&!r.disconnected)}),100),this.config.muteAudio&&this.sendOperationMessage("AUDIO_MUTE"),this.config.muteVideo&&this.sendOperationMessage("VIDEO_MUTE"),sp.setMeetingInfo({meetingId:this.invite.meetingId,callUri:this.invite.callerUri}),sp.setStates("trigger","callIn",{callType:"initiativeJoin",appName:this.config.isThird?Xf:Jf});break;case"confMgmtReport":this.logger.log("Get meeting control confMgmtReport message: ",e),this.onMeetingControlMessage(e);break;case"SUB_TITLE":this.logger.log("Get meeting control SUB_TITLE message: ",e),this.onSubTitle(e);break;case"CANCEL_HANGUP":this.logger.log("Get CANCEL_HANGUP message: ",e),this.emmit("cancel-handup",!0);break;case"PASS_THROUGH":this.onPassThroughMessage(e);break;case"mediaNotifyInfo":break;case"MEDIA_CHANGED":this.logger.log("Get MEDIA_CHANGED message: ",e),this.peer&&this.peer.restartIceConnection(),"STARTING"===this.shareContentStatus&&this.sendContentCapablityMessage(),this.videoTrackList=[],this.audioTrackList=[];break;case"DIS_CONNECTED":this.logger.log("Get disconnected message: ",e);var s=Up[e.detail];"KickoutTipContent"!==e.detail&&"OK"!==e.detail&&e.code&&this.errorcode&&this.errorcode.zh_CN&&(s=this.errorcode.zh_CN[e.code]),s=s||"呼叫异常,请稍后重试",this.disconnected=!0,this.emmit("disconnected",El(10030,"Disconnected meeting",{message:s})),this.clientStatus=!1,this.stream&&this.stream.close(),this.close("SERVER_INNER_ERROR");break;case"CALL_EXCEPTION_REPORT":this.logger.log("Get exception message: ",e);var u=Up[e.exception];e.code&&this.errorcode.zh_CN&&(u=this.errorcode.zh_CN[e.code]),u=u||"呼叫异常,请稍后重试",this.disconnected=!0,this.emmit("disconnected",El(10030,"call meeting exception",{message:u})),this.close("SERVER_INNER_ERROR");break;case"DualStreamReport":this.logger.log("Get share stream message: ",e);var c=e.state,l=function(){clearTimeout(r.shareContentTimmer),r.shareContentTimmer=null};if("SENDING"===c)this.shareContentStatus="STARTING",this.stream.emmit("start-share-content",{}),sp.setStates("click","content",{contentType:"desk"}),l();else if("IDLE"===c){var f=Up.SHARE_CONTENT_FAILED;"STATE:200"===e.code?this.stream.emmit("stop-share-content",{}):(e.code&&this.errorcode&&this.errorcode.zh_CN&&(f=this.errorcode.zh_CN[e.code]),this.stream.emmit("stop-share-content",El(20512,"share content failed",{message:f}))),this.shareContentStatus="ENDED",l()}break;case"MONITOR_STATE_REPORT":this.logger.log("Get monitor state report: ",e);var h=e.code,d=e.monitorInfo;if("STATE:200"===h)this.emmit("start-monitor-report",{monitorInfo:d});else{var p="";h&&this.errorcode&&this.errorcode.zh_CN&&(p=this.errorcode.zh_CN[h]),this.emmit("stop-monitor-report",El(30512,"start monitor failed",{message:p}))}break;default:this.logger.log("接收到其他ws消息",e)}}},{key:"makeCall",value:function(e){return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i,o,a,s,u=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.logger.log("makeCall params: ",e),r=window.location,n=r.protocol,i=r.hostname,"https:"===n||"localhost"===i){t.next=4;break}return t.abrupt("return",Promise.reject(El(10407,"Protocol must be https, or hostname must be localhost")));case 4:if("[object Object]"===Object.prototype.toString.call(e)){t.next=6;break}return t.abrupt("return",Promise.reject(El(10400,"Parameter must be an Object")));case 6:if(o=e.token,a=e.confNumber,this.clientStatus){t.next=9;break}return t.abrupt("return",Promise.reject(El(10009,"Client is closed, it is forbidden to join the conference")));case 9:return t.next=11,this.deviceManager.emmitDevices();case 11:return t.prev=11,t.next=14,this.verifyMeeting(e);case 14:if(!(s=t.sent)||s.success){t.next=17;break}return t.abrupt("return",Promise.reject(s.data));case 17:t.next=22;break;case 19:return t.prev=19,t.t0=t.catch(11),t.abrupt("return",Promise.reject(El(10402,"呼叫失败")));case 22:return t.abrupt("return",new Promise((function(e,t){return o?a?void u.initWss(e,t):(u.logger.log("makeCall must be send confNumber params"),void u.emmit("error",El(10003,"MakeCall must be send confNumber params"))):(u.logger.log("makeCall must be send token params"),void u.emmit("error",El(10004,"MakeCall must be send token params")))})));case 23:case"end":return t.stop()}}),t,this,[[11,19]])})))}},{key:"startCall",value:function(){var e=this.callInfo,t=e.confNumber,r=e.displayName,n=void 0===r?"":r,i=e.password,o=void 0===i?"":i,a=this.config,s=a.__hideId,u=void 0===s?"":s,c=a.__monitorMode,l=void 0===c?"":c;this.invite.callIndex||this.sendSocketMessage({type:"START_CALL",calleeNumber:t+"@CONFNO",displayName:n,pwd:o,callMode:"AUDIO_VIDEO",mediaAppend:{audioEncCapList:[99],videoEncCapList:[106,127]},hideId:u,monitorMode:l},!1)}},{key:"stopCall",value:function(e){if(this.invite.callIndex){var t=this.invite.callIndex;this.disconnected?e="SERVER_INNER_ERROR":"PUBLISH_ERROR"===this.clientErrorState?e="PEER_NET_DISCONNECT":"WS_CLOSE"!==this.clientErrorState&&"WS_ERROR"!==this.clientErrorState||(e="LOCAL_NET_DISCONNECT"),this.sendSocketMessage({type:"STOP_CALL",reason:e,code:Kf[e],callIndex:t},!1)}}},{key:"publish",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{isShareContent:!1,isShareFile:!1,isShareWhiteBoard:!1,isSharePeople:!1};if(this.clientStatus&&!this.disconnected){if(!t.isSharePeople)return t.isShareContent?(this.sendContentCapablityMessage(e),void this.peer.publish(e,"CONTENT")):void 0;try{this.stream=e,this.peer=new vv(this,e),e.setClientObj(this),this.peer.publish(e,"ALL"),"AUTO"===this.config.layout?this.rosters&&this.rosters.length>0&&this.layoutManager.createLayout():"CUSTOM"===this.config.layout&&this.layoutManager.initLayoutManager(),this.initTrackEvent()}catch(e){this.logger.error("publish error: ",e),this.clientErrorState="PUBLISH_ERROR",this.emmit("call-status",El(10517,"呼叫失败",e))}}}},{key:"sendContentCapablityMessage",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.stream,t=this.invite,r=t.callerUri,n=void 0===r?"":r,i=t.meetingId,o=e.getMediaStreams(),a=o.contentStreams,s=a.filter((function(e){return"NORMAL"===e.status})).map((function(e){return{streamId:e.stream.id,resolution:qf.MAP_RESOLUTION_INDEX[e.resolution]}}));s.length?this.sendSocketMessage({type:"PASS_THROUGH",body:{meetingId:i,endpointId:n,type:"contentCapability",streams:s}}):this.logger.log("contentCapability is null"),this.limitResolution=["720"],this.sendPeopleCapability()}},{key:"applyShareContent",value:function(){return es(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.shareContentStatus="PENDING",this.sendSocketMessage({type:"START_CONTENT",mode:"VIDEO",enableAnnotation:!1}),this.shareContentTimmer=setTimeout((function(){"PENDING"===t.shareContentStatus&&(t.shareContentStatus="ENDED",t.stream.emmit("stop-share-content",{}),clearTimeout(t.shareContentTimmer),t.shareContentTimmer=null)}),1e4);case 3:case"end":return e.stop()}}),e,this)})))}},{key:"stopShareContent",value:function(){var e=this;return this.limitResolution=[],this.stream&&this.sendPeopleCapability(),new Promise((function(t,r){try{"STARTING"!==e.shareContentStatus&&"PENDING"!==e.shareContentStatus||e.sendSocketMessage({type:"STOP_CONTENT",mode:"VIDEO"}),e.peer&&e.peer.closeContentStream(),e.stream&&e.stream.closeContentStream(),e.shareContentStatus="ENDED",e.streamChangeList.content=[],t(!0)}catch(e){r(El(20517,"结束分享失败",e))}}))}},{key:"initTrackEvent",value:function(){var e=this;this.on("track",(function(t){var r=t.track,n=r.id,i=r.kind,o=t.streams[0]||{};e.logger.log("client onTrack event: ",{track:{id:n,kind:i},stream:null==o?void 0:o.id}),t&&t.track.kind&&e.mergeTrackList(t),e.logger.log("video and audio track list: ",{video:e.videoTrackList,audio:e.audioTrackList})}))}},{key:"mergeTrackList",value:function(e){var t=e.track,r=t.kind,n=t.id,i={status:"remote",data:e,rest:{streamId:e.streams[0].id,track:t,trackId:n}};"video"===r?(this.videoTrackList.push(i),this.layoutManager.updateStreams(),this.emmit("video-track",this.videoTrackList)):"audio"===r&&(this.audioTrackList.push(i),this.emmit("audio-track",this.audioTrackList))}},{key:"destroy",value:function(){var e=this;return new Promise((function(t,r){try{e.stream&&e.stream.close(),e.close(),t(!0)}catch(e){r(El(10515,"Client destroy failed",e))}}))}},{key:"close",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"OK";this.isPermissionDenied={camera:!1,microphone:!1},this.clientStatus&&(this.clientStatus=!1,this.stopShareContent(),this.stopCall(t),this.peer&&this.peer.close(),this.removeEvent(),this.removeAllListener(),this.layoutManager.clearInvalidVideoManagers(),this.socketTask&&this.socketTask.close(),this.deviceManager&&this.deviceManager.destroy(),this.customLayoutSeq=0,this.audioManagers={},this.layoutManager=null,this.deviceManager=null,this.logger.log("client closed successfully"),setTimeout((function(){e.logger.stopDB()}),100))}},{key:"loginXYlinkAccount",value:function(e,t){return es(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i,o,a,s,u,c,l,f,h;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,sp.login({userName:e,password:t});case 3:if(!(n=r.sent)||200!==n.status){r.next=10;break}return i=n.data,o=i.securityKey,a=i.callUri,s=i.token,u=s.access_token,c=s.refresh_token,l=i.userProfile,f=l.displayName,h=l.id,this.loginInfo={securityKey:o,callUri:a,refresh_token:c,access_token:u,id:h,displayName:f},r.abrupt("return",El(200,"ok",{access_token:u}));case 10:if(!(n&&n.err&&n.err.response&&n.err.response.data&&2001===n.err.response.data.errorCode)){r.next=15;break}return this.logger.error("login err: ",n),r.abrupt("return",El(10104,"account or password error",n));case 15:return r.abrupt("return",El(10100,"login error",n));case 16:r.next=22;break;case 18:return r.prev=18,r.t0=r.catch(0),this.logger.error("login err: ",r.t0),r.abrupt("return",El(10100,"xyrtc login error",r.t0));case 22:case"end":return r.stop()}}),r,this,[[0,18]])})))}},{key:"getExternalLoginInfo",value:function(e,t){return es(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i,o,a,s,u,c,l,f,h,d,p,v,g;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n=t.displayName,i=t.extId,o=e.userName,a=e.password,n||i||a||o){r.next=4;break}return r.abrupt("return",El(10101,"参数有误,请检查",t));case 4:return r.prev=4,r.next=7,sp.login(e);case 7:if(!(s=r.sent)||200!==s.status){r.next=14;break}return u=s.data,c=u.securityKey,l=u.callUri,f=u.token,h=f.access_token,d=f.refresh_token,p=u.userProfile,v=p.displayName,g=p.id,this.loginInfo={securityKey:c,callUri:l,refresh_token:d,access_token:h,id:g,displayName:v},r.abrupt("return",El(200,"ok",{access_token:h}));case 14:return r.abrupt("return",El(10100,"login failed",s));case 15:r.next=21;break;case 17:return r.prev=17,r.t0=r.catch(4),this.logger.error("external login err: ",r.t0),r.abrupt("return",El(10100,"xyrtc login error",r.t0));case 21:case"end":return r.stop()}}),r,this,[[4,17]])})))}},{key:"loginExternalAccount",value:function(e){return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i,o,a,s,u;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.displayName,n=e.extId,r||n){t.next=3;break}return t.abrupt("return",El(10101,"参数有误,请检查",e));case 3:return t.prev=3,t.next=6,sp.getSdkUserInfo(e);case 6:if(i=t.sent,{userName:"",password:""},!i||200!==i.status){t.next=16;break}return a=i.data,s=a.userName,u=a.password,o={userName:s,password:u},t.next=13,this.getExternalLoginInfo(o,e);case 13:return t.abrupt("return",t.sent);case 16:return t.abrupt("return",El(10103,"Get user info failed",i));case 17:t.next=22;break;case 19:return t.prev=19,t.t0=t.catch(3),t.abrupt("return",El(10103,"Get user info failed",t.t0));case 22:case"end":return t.stop()}}),t,this,[[3,19]])})))}},{key:"getConference",value:function(){var e,t,r,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return es(this,void 0,void 0,regeneratorRuntime.mark((function a(){var s,u,c,l,f;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return this.logger.log("get conference:",{id:n,sk:i,token:o}),s=i||(null===(e=this.loginInfo)||void 0===e?void 0:e.securityKey),u=n||(null===(t=this.loginInfo)||void 0===t?void 0:t.id),c=o||(null===(r=this.loginInfo)||void 0===r?void 0:r.access_token),l={securityKey:s,access_token:c,id:u},a.prev=5,sp.setLoginInfo(l),a.next=9,sp.getConference(u,s);case 9:if(200!==(null==(f=a.sent)?void 0:f.status)){a.next=14;break}return a.abrupt("return",f.data);case 14:return a.abrupt("return",Promise.reject({code:500,msg:"获取云会议室失败",detail:{}}));case 15:a.next=20;break;case 17:return a.prev=17,a.t0=a.catch(5),a.abrupt("return",Promise.reject({code:500,msg:"获取云会议室失败",detail:a.t0}));case 20:case"end":return a.stop()}}),a,this,[[5,17]])})))}},{key:"fetchErrorCode",value:function(e){return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i,o,a,s,u,c,l,f;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=Tc.get("xy-error-code"),n=r&&r.version,i=Tc.get("xy-timestamp"),o=(new Date).valueOf(),h=Number(i),d=Number(o),p=void 0,p=d-h,a=Math.floor(p/864e5),!(r&&a<1)){t.next=7;break}return t.abrupt("return");case 7:return t.next=9,sp.fetchErrorCode(e);case 9:if(!(s=t.sent)||200!==s.status||!s.data){t.next=24;break}if(u=s.data.errorcode,c=u.link,l=u.version,f=(new Date).valueOf(),l!==n){t.next=16;break}return t.abrupt("return");case 16:if(t.t0=c,!t.t0){t.next=21;break}return t.next=20,this.getErrorCodeByJson(c);case 20:t.t0=t.sent;case 21:this.errorcode=t.t0,Tc.set("xy-error-code",this.errorcode),Tc.set("xy-timestamp",f);case 24:case"end":return t.stop()}var h,d,p}),t,this)})))}},{key:"getErrorCodeByJson",value:function(e){return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=null,t.prev=1,t.next=4,sp.getErrorCodeByJson(e);case 4:(n=t.sent)&&200===n.status&&n.data&&(r=n.data),t.next=10;break;case 8:t.prev=8,t.t0=t.catch(1);case 10:return t.abrupt("return",r);case 11:case"end":return t.stop()}}),t,null,[[1,8]])})))}},{key:"videoAudioOperate",value:function(e){var t=this;return new Promise((function(r,n){return es(t,void 0,void 0,regeneratorRuntime.mark((function t(){var i,o,a,s,u,c,l,f,h=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=Ff[e].type,o=this.stream.getMediaStreams(),a=o.previewStreams,s=this.stream.current.type,this.logger.log("video or audio operate: ",e),u=this.isPermissionDenied.microphone||"FAILED"===this.stream.current.type,c=this.isPermissionDenied.camera||"FAILED"===this.stream.current.type,"unmuteAudio"!==e||!u){t.next=9;break}return this.logger.log("No permission to do audio operations"),t.abrupt("return",n(El(50224,"没有麦克风权限")));case 9:if("unmuteVideo"!==e||!c){t.next=12;break}return this.logger.log("No permission to do video operations"),t.abrupt("return",n(El(50225,"没有摄像头权限")));case 12:return this.peer||(l="Need to create a peer to do audio and video operations",this.logger.log(l),n(El(10020,l))),a.length||(f="Need to create a stream to do audio and video operations",this.logger.log(f),n(El(10021,f))),t.prev=14,t.next=17,this.stream.setAudioOrVideoStatus(e);case 17:s=this.stream.current.type,"unmuteVideo"!==e?this.sendOperationMessage(i):"NORMAL"!==s&&"VIDEO_ONLY"!==s||setTimeout((function(){h.sendOperationMessage(i),h.stream&&h.isAutoBandwidth&&h.streamChange&&h.stream.handleChangeStream(h.streamChange,h.peer,h.streamChange.mediagroupid||0)}),800),sp.setStates("click",$f[e]),r(e),t.next=26;break;case 23:t.prev=23,t.t0=t.catch(14),n(El(10023,"".concat(e," operate failed"),t.t0));case 26:case"end":return t.stop()}}),t,this,[[14,23]])})))}))}},{key:"muteAudio",value:function(){return this.videoAudioOperate("muteAudio")}},{key:"muteVideo",value:function(){return this.videoAudioOperate("muteVideo")}},{key:"unmuteAudio",value:function(){return this.videoAudioOperate("unmuteAudio")}},{key:"unmuteVideo",value:function(){return this.videoAudioOperate("unmuteVideo")}},{key:"onHandUp",value:function(){return this.onHand("handup",!0)}},{key:"onHandDown",value:function(){return this.onHand("handdown",!1)}},{key:"onMute",value:function(){return this.onHand("mute",!1)}},{key:"onHand",value:function(e,t){var r=this,n=this.invite,i=n.callerUri,o=void 0===i?"":i,a=n.meetingId,s=this.callInfo.confNumber;return new Promise((function(n,i){return es(r,void 0,void 0,regeneratorRuntime.mark((function r(){var u;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,sp.hand(e,a,o,s);case 3:200===(u=r.sent).status&&0===u.data.code?n(t):i(El(10500,"".concat(e," failed"),u)),r.next=10;break;case 7:r.prev=7,r.t0=r.catch(0),i(El(10500,"".concat(e," failed"),r.t0));case 10:case"end":return r.stop()}}),r,null,[[0,7]])})))}))}},{key:"getSendSupportedCodec",value:function(){var e=this;return new Promise((function(t,r){var n=["video/VP8","video/H264"],i=["audio/opus"];try{i=RTCRtpSender.getCapabilities("audio").codecs.filter((function(e){return"audio/opus"===e.mimeType})).map((function(e){return e.mimeType})),t({video:n=(n=RTCRtpSender.getCapabilities("video").codecs.filter((function(e){return"video/H264"===e.mimeType||"video/VP8"===e.mimeType})).map((function(e){return e.mimeType}))).filter((function(e,t){return n.indexOf(e)===t})),audio:i})}catch(t){e.logger.error("get capabilities error: ",t),r(El(20519,"get capabilities error",t))}}))}},{key:"setPeerConnectionStatus",value:function(e){var t,r;this.peerConnectionStatus=e,this.stream.current.type;var n=this.stream.getMediaStreams().previewStreams;if(this.config.muteAudio&&(null===(t=n[0])||void 0===t?void 0:t.stream)&&this.muteAudio(),this.config.muteVideo&&(null===(r=n[0])||void 0===r?void 0:r.stream)&&this.muteVideo(),e){if(this.invite.automute){var i="";this.onSetAudioStream(this.invite.automute),"mute"===this.invite.automute?i="muteAudio":"unmute"===this.invite.automute&&(i="unmuteAudio"),i&&this.emmit("audio-status",{status:i})}this.cacheMeetingControlMessage&&this.cacheMeetingControlMessage.type&&this.onMeetingControlMessage(this.cacheMeetingControlMessage);var o=this.layoutManager.getContentRosterItem();o&&(this.layoutManager.setContentRosterItem(o),this.emmit("content",{data:o})),this.stream.sendStreamStatus()}}},{key:"onMeetingControlMessage",value:function(e){var t=e.muteOperation,r=e.disableMute,n=e.chairmanUri,i=void 0===n?"":n,o=e.contentIsDisabled,a=void 0!==o&&o,s=this.meetingControl&&this.meetingControl.chairmanUri||"",u="";if(this.peerConnectionStatus){if(t){var c=this.stream.getMediaStreams().previewStreams;u="mute"===t?"muteAudio":"unmuteAudio","mute"===t&&c.length&&this.stream.setAudioOrVideoStatus("muteAudio"),"unmute"===t&&c.length&&this.stream.setAudioOrVideoStatus("unmuteAudio"),this.logger.log("emmit audio-status: ",u),this.emmit("audio-status",{status:u}),sp.setStates("msgCallback",$f[u]),this.cacheMeetingControlMessage=null}i||this.layoutManager.setChairmanRoster(null),this.autoMode&&"GALLERY"===this.layoutManager.getTemplateMode()&&(!s&&i||s&&!i)&&this.layoutManager.setTemplateMode(this.contentSenderPid?"MULTI_PIC_CONTENT_HIGH_PRIORITY":"SPEAKER"),s!==i&&this.rosters.length>0&&this.autoMode&&this.layoutManager.createLayout();var l={chairmanUri:i,disableMute:r,muteOperation:u,contentIsDisabled:a};this.logger.log("emmit meeting-control: ",l),this.emmit("meeting-control",l)}else this.cacheMeetingControlMessage=e;this.meetingControl=e}},{key:"onSubTitle",value:function(e){var t=e.content,r=t&&JSON.parse(t);this.emmit("sub-title",r),sp.setStates("msgCallback","subtitle")}},{key:"onPassThroughMessage",value:function(e){switch(e.body.type){case"roster":this.logger.log("roster message: ",e);var t=e.body,r=t.contentSenderPid,n=void 0===r?0:r,i=t.rosterInfo;if(0===i.length)return;this.autoMode&&(1===i.length&&"SPEAKER"!==this.layoutManager.getTemplateMode()&&this.layoutManager.setTemplateMode("SPEAKER"),n&&!this.contentSenderPid&&this.layoutManager.setTemplateMode("MULTI_PIC_CONTENT_HIGH_PRIORITY"),!n&&this.contentSenderPid&&(this.layoutManager.setTemplateMode("SPEAKER"),this.layoutManager.setContentRosterItem(null))),this.contentSenderPid=n,this.rosters=i,this.autoMode?(this.layoutManager.createLayout(),this.sendOrderedRosterListMessage()):this.sendOrderRosterListMessage(),this.sendMeetingStatus();break;case"participantsNum":this.logger.log("particpant message: ",e);var o=e.body.participantsNum;this.emmit("participants-count",{participantsNum:o});break;case"speakersInfo":this.logger.log("speaker info message: ",e);var a=e.body.speaker;this.speakerInfo=a,this.autoMode&&(this.layoutManager.createLayout(),this.sendOrderedRosterListMessage()),this.emmit("speaker-info",{speakerInfo:a});break;case"layoutResult":var s=e.body.layout;0===e.body.mediagroupid?this.layoutRosters.people=s:1===e.body.mediagroupid&&(this.layoutRosters.content=s),this.layoutRosters.total=[].concat(Qn(this.layoutRosters.people),Qn(this.layoutRosters.content)),this.logger.log("layout result message: ",this.layoutRosters.total),this.customLayoutSeq===e.body.rSeq&&this.layoutManager.updateStreams();break;case"streamChange":this.logger.log("stream change message: ",e),this.streamChange=e.body;var u=e.body,c=u.mediagroupid,l=u.streamChangeInfo;this.streamChangeList[0===c?"people":"content"]=l,this.stream&&this.isAutoBandwidth&&this.stream.handleChangeStream(this.streamChange,this.peer,e.body.mediagroupid||0);break;case"rotationChange":this.logger.log("layout rotation message: ",e),this.updateRotationInfo(e),this.logger.log("rotation info: ",this.rotationInfo),this.autoMode&&(this.layoutManager.calculateRotate(),this.sendLayoutMessage()),this.emmit("rotation-change",this.rotationInfo.total);break;case"candidate":this.peer.handleCandidate(e.body);break;case"answer":this.peer.handleAnswer(e.body);break;case"mediaOnhold":this.logger.log("media onhold message: ",e);var f=e.body.onhold;this.onhold=Boolean(f),this.emmit("onhold",this.onhold);break;case"confChangeInfo":if(this.logger.log("[receive]conf change info message: ",e),this.autoMode)return;var h=e.body,d=h.chairManUrl,p=h.totalEpCount,v=h.mediaGroupInfo,g=(void 0===v?[]:v).filter((function(e){return 1===e.mediagroupid})),m=0;g.length&&g[0].endpointCount&&(m=g[0].endpointCount);var y={contentPartCount:m,participantCount:p,chairManUrl:d};this.emmit("conf-change-info",y);break;case"layoutResultEx":if(this.logger.log("[receive][v2]layout result message: ",e),this.autoMode)return;var b=e.body.layout;0===e.body.mediagroupid?this.layoutRosters.people=b:1===e.body.mediagroupid&&(this.layoutRosters.content=b),this.layoutRosters.total=[].concat(Qn(this.layoutRosters.people),Qn(this.layoutRosters.content)),this.logger.log("[v2]layout result: ",this.layoutRosters.total),"CUSTOM"===this.config.layout&&(this.layoutManager.createCustomLayout(this.layoutRosters.total),this.layoutManager.updateStreams());break;default:this.logger.log("get pass though default message: ",e)}}},{key:"switchAutoBandwidth",value:function(){var e=!this.isAutoBandwidth;return this.isAutoBandwidth=e,e}},{key:"disconnectInWssError",value:function(e){this.logger.log("disconnected wss error",e),!this.disconnected&&this.clientStatus&&(this.clientErrorState=2004===e?"WS_CLOSE":"WS_ERROR",this.emmit("disconnected",El(e,"[internel] disconnected meeting",{message:Up.LOCAL_NET_DISCONNECT,key:"LOCAL_NET_DISCONNECT"})))}},{key:"switchDebug",value:function(e){var t=this;return new Promise((function(r,n){"boolean"!=typeof e&&n(El(10400,"Parameter must be boolean"));try{t.debug=e,t.peer&&t.peer.initSenderStatus(),r(t.debug)}catch(e){n(El(30500,"Switch debug error"))}}))}},{key:"requestLayout",value:function(e){var t=this;return new Promise((function(r,n){t.autoMode&&n("Auto mode not support request layout"),t.logger.log("request layout: ",e);var i=e.length>9?9:e.length;e.length=i,"CUSTOM"===t.config.layout&&(t.layoutManager.requestLayout(e),t.layoutManager.updateStreams(),r("successfully"))}))}},{key:"requestNewLayout",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.logger.log("new layout request list: ",e);var t=this.invite,r=t.callerUri,n=void 0===r?"":r,i=t.meetingId;this.sendSocketMessage({type:"PASS_THROUGH",body:{type:"customLayoutEx",conferenceId:i,endpointId:n,layoutMode:0,pageIndex:0,maxViewCountPerPage:9,streams:e}})}},{key:"requestAutoPollingLayout",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5,n=arguments.length>2?arguments[2]:void 0;return new Promise((function(i,o){t.autoMode&&o("Auto mode not support request layout");var a=t.invite,s=a.callerUri,u=a.meetingId;t.logger.log("send request auto pllling layout data: ",{command:e,interval:r,reqList:n}),t.sendSocketMessage({type:"PASS_THROUGH",body:{type:"customLayoutEx",conferenceId:u,endpointId:s,layoutMode:1,pageIndex:0,PollingCommand:e,pollingInterval:Number(r)||0,streams:n}}),i(!0)}))}},{key:"applyVideoOrAudio",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){var r=this.stream.getMediaStreams(),n=r.streams;this.peer.setStream(n,e)}else this.peer.replacePeopleVideoTrack(this.stream,e)}},{key:"sendLayoutMessage",value:function(){var e=this.layoutManager.getLayoutList(),t=[];e.forEach((function(e){t.push(e)})),this.emmit("layout",pv(t))}},{key:"sendOrderedRosterListMessage",value:function(){var e=this.layoutManager.getOrderRosterList();this.emmit("roster",{rosters:e})}},{key:"sendOrderRosterListMessage",value:function(){var e=this.layoutManager.calculateOrderRosterList();this.layoutManager.setOrderRosterList(e),this.emmit("roster",{rosters:e})}},{key:"sendCustomLayoutMessage",value:function(){var e=this.layoutManager.getCustomLayoutList(),t=[];e.forEach((function(e){t.push(e)})),this.emmit("custom-layout",pv(t))}},{key:"sendScreenInfoMessage",value:function(e){this.emmit("screen-info",pv(e))}},{key:"sendContentRosterMessage",value:function(e){this.emmit("content",{data:e})}},{key:"sendChairmanRosterMessage",value:function(e){this.emmit("chairman",e)}},{key:"sendSelfRosterMessage",value:function(e){this.emmit("self-roster",e)}},{key:"sendTemplateMode",value:function(e){this.emmit("template-mode",e)}},{key:"sendOperationMessage",value:function(e){this.sendSocketMessage({type:e})}},{key:"sendMeetingStatus",value:function(){var e=this.layoutManager.getSelfRoster(),t={video:"unmuteVideo",audio:"unmuteAudio"};if(e&&e.endpointId){var r=e.videoTxMute,n=e.audioTxMute;t.video=r?"muteVideo":"unmuteVideo",t.audio=n?"muteAudio":"unmuteAudio",this.logger.log("emmit meeting-status: ",t),this.emmit("audio-status",{status:t.audio}),this.emmit("video-status",{status:t.video})}}},{key:"updateRotationInfo",value:function(e){var t=this,r=e.body.rosterInfo||[],n=0===e.body.mediagroupid?"people":"content";this.rotationInfo[n]=r,this.rotationInfo.total=[];var i=this.rotationInfo,o=i.people,a=i.content,s=function(e,r){e.forEach((function(e){t.rotationInfo.total.push(Object.assign(Object.assign({},e),{mediagroupid:r,id:e.participantId+""+r}))}))};s(o,0),s(a,1)}},{key:"sendCustomLayout",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=this.invite,r=t.callerUri,n=void 0===r?"":r,i=t.meetingId;this.customLayoutSeq=this.customLayoutSeq+1,this.sendSocketMessage({type:"PASS_THROUGH",body:{meetingId:i,endpointId:n,type:"customLayout",streams:e,rSeq:this.customLayoutSeq}})}},{key:"sendInternels",value:function(e){var t=this.layoutManager.getInternelsLayout();Object.keys(e.receiver).forEach((function(r){var n=e.receiver[r],i=n.isContent,o=n.type+Number(i);t[o]&&(e.receiver[r].expResolution=t[o].resolution)}));for(var r=Object.keys(e.sender),n=r.length,i=0;i<n;i++){var o=e.sender[r[i]],a=this.streamChangeList.content.length,s=this.streamChangeList.people.length;if(s)for(var u=0;u<s;u++){var c=this.streamChangeList.people[u];if(qf.RESOLUTION_MAP[c.resolution]===Number(o.resolution)&&"remoteStream"===o.type){e.sender[r[i]].expBandwidth=c.bandwidth;break}}if(a)for(var l=0;l<a;l++){var f=this.streamChangeList.content[l];if(qf.RESOLUTION_MAP[f.resolution]===Number(o.resolution)&&"contentStream"===o.type){e.sender[r[i]].expBandwidth=f.bandwidth;break}}}this.emmit("meeting-stats",e)}},{key:"off",value:function(e){this.removeListener(e)}},{key:"onScreenChangeEvent",value:function(){this.autoMode&&(this.layoutManager.calculateScreenInfo(),this.layoutManager.calculatePosition(),this.layoutManager.calculateRotate(),this.sendLayoutMessage())}},{key:"initEvent",value:function(){window.addEventListener("resize",this.onDocumentChange)}},{key:"removeEvent",value:function(){window.removeEventListener("resize",this.onDocumentChange)}},{key:"sendPeopleCapability",value:function(){var e=this,t=this.invite,r=t.callIndex,n=t.callerUri,i=void 0===n?"":n,o=t.meetingId,a=this.stream.streams.filter((function(t){return"NORMAL"===t.status&&t.resolution!==e.limitResolution[0]})).map((function(e){return{streamId:e.stream.id,resolution:qf.MAP_RESOLUTION_INDEX[e.resolution]}}));this.logger.log("stream resolution info: ",a),this.sendSocketMessage({type:"PASS_THROUGH",callIndex:r,body:{type:"peopleCapability",meetingId:o,endpointId:i,streams:a}})}},{key:"forceFullScreen",value:function(e){var t=this;return new Promise((function(r,n){t.autoMode||n(El(10302,"自定义布局模式不支持此方法")),e&&"string"!=typeof e&&n(El(10400,"Parameter must be string"));try{var i=t.layoutManager.getForceFullScreenId();if(!e&&!i)return void r(e);var o=t.layoutManager.getSelfRoster();e!==o.id&&(t.layoutManager.setForceFullScreenId(e),e?(t.layoutManager.requestCustomLayout(),t.layoutRosters={content:[],people:[],total:[]}):t.layoutManager.createLayout()),r(e)}catch(e){n(El(10530,"Force full screen request stream faild"))}}))}},{key:"sendSocketMessage",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=this.invite,n=r.callIndex,i=r.callerUri,o=void 0===i?"":i,a=r.meetingId,s={callIndex:n,meetingId:a,endpointId:o},u=this.seq+"",c=t?Object.assign(Object.assign(Object.assign({},e),s),{seq:u}):e;this.socketTask&&this.socketTask.send(c),this.seq++}},{key:"verifyMeeting",value:function(e){return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,i,o,a,s,u,c,l,f,h,d,p;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.token,i=e.confNumber,o=e.password,a=void 0===o?"":o,this.callInfo=e,this.token=n,s={success:!1,data:{}},t.prev=4,u=n||this.loginInfo.access_token,t.next=8,sp.getUserInfo(u);case 8:return c=t.sent,l=(c||{}).securityKey,this.fetchErrorCode(l),t.next=13,sp.getCallUri({number:i,securityKey:l,deviceType:17,country:"CN"});case 13:if(!(f=t.sent)||"CONFERENCE"!==f.numberType){t.next=38;break}if(!f.enablePwd||"HIDE"!==this.config.__hideId){t.next=28;break}return t.prev=16,t.next=19,sp.igonreMeetingMonito(i,l);case 19:h=t.sent,s=h&&200===h.status?r.getMeetingStatus(!0):r.getMeetingStatus(!1,10406,"免密入会失败"),t.next=26;break;case 23:t.prev=23,t.t0=t.catch(16),s=r.getMeetingStatus(!1,10406,"免密入会失败");case 26:t.next=36;break;case 28:if(!f.enablePwd||!a){t.next=35;break}return t.next=31,sp.verifyPassword(i,a,l);case 31:d=t.sent,s=200!==d.status&&204!==d.status?r.getMeetingStatus(!1,10404,"入会密码错误"):r.getMeetingStatus(!0),t.next=36;break;case 35:s=f.enablePwd&&!a?r.getMeetingStatus(!1,10403,"需要入会密码"):r.getMeetingStatus(!0);case 36:t.next=39;break;case 38:f&&f.numberType?s=r.getMeetingStatus(!1,10405,"暂不支持呼叫此号码"):f&&f.errorCode?(p=f.errorCode,s=1001===p||2036===p?r.getMeetingStatus(!1,10401,"无效的会议号"):r.getMeetingStatus(!1,10402,"呼叫失败")):s=r.getMeetingStatus(!1,10402,"呼叫失败");case 39:t.next=44;break;case 41:t.prev=41,t.t1=t.catch(4),s=r.getMeetingStatus(!1,10402,"呼叫失败");case 44:return t.abrupt("return",s);case 45:case"end":return t.stop()}}),t,this,[[4,41],[16,23]])})))}},{key:"setAudioOutputDevice",value:function(e){var t=this;Object.keys(this.audioManagers).forEach((function(r){var n=t.audioManagers[r];n.ele&&t.deviceManager.setAudioOutputDevice(n.ele,e)}))}},{key:"startMonitor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.logger.log("[monitor]start monitor:",e),this.invite.callIndex&&this.sendSocketMessage({type:"START_MONITOR",uriList:e})}},{key:"stopMonitor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.logger.log("[monitor]stop monitor:",e),this.invite.callIndex&&(this.layoutManager&&this.layoutManager.clearVideoManagersUseMonitorList(e),this.sendSocketMessage({type:"STOP_MONITOR",uriList:e}))}},{key:"initDeviceManagerEvent",value:function(){var e=this;this.deviceManager.on("permission",(function(t){e.logger.log("deviceManager permission changed: ",t),"denied"===t.camera&&(e.isPermissionDenied.camera=!0),"denied"===t.microphone&&(e.isPermissionDenied.microphone=!0),e.emmit("permission",t)})),this.deviceManager.on("currentDevice",(function(t){e.emmit("currentDevice",t)})),this.deviceManager.on("device",(function(t){var r=t.nextDevice,n=r.audioInput,i=r.videoInput,o=r.audioOutput;try{e.autoSwitchDevice&&(n&&e.stream&&(console.log("switch audio device:",n),e.stream.switchDevice("audio",n.deviceId)),i&&e.stream&&(console.log("switch video device:",n),e.stream.switchDevice("video",i.deviceId)),o&&e.setAudioOutputDevice(o.deviceId)),e.emmit("device",t)}catch(t){e.logger.log("auto switch device faild:",t)}}))}},{key:"initWss",value:function(e,t){var r=this;this.socketTask&&this.socketTask.close(),this.socketTask=new Hp({url:"".concat(this.servers.wssServer,"/websocket/webrtc"),params:{token:this.token,start:!0}},this),this.socketTask.on("open",(function(e){r.logger.log("websocket is conneted"),r.logger.log("user system info: ",navigator.userAgent),r.logger.log("Version: ",Xd),r.startCall(),r.emmit("socket-open",e)})),this.socketTask.on("message",(function(t){var n=t.data;if(n){var i=JSON.parse(n);r.handleSocketMessage(i,e),r.emmit("socket-message",i)}})),this.socketTask.on("close",(function(){r.logger.log("连接已关闭"),r.disconnectInWssError(2004),r.emmit("socket-close",El(2004,"Websocket connect is close")),r.close("LOCAL_NET_DISCONNECT")})),this.socketTask.on("timeout",(function(){r.logger.log("websocket connect timeout"),r.emmit("socket-timeout",El(2002,"Websocket connect is timeout"))})),this.socketTask.on("error",(function(e){r.logger.log("Websocket connect is error",e),r.disconnectInWssError(2005),r.emmit("socket-error",El(2005,"Websocket connect is error",e)),r.close("LOCAL_NET_DISCONNECT")})),this.socketTask.on("reconnect",(function(e){r.logger.log("Websocket reconnect: ","Websocket connected is close, reconect..."),r.emmit("socket-reconnect",El(2003,"Websocket connected is close, reconect...",e))}))}}],[{key:"getClientInstance",value:function(e,t,n){return this.instance||(this.instance=new r(e,t,n)),this.instance}},{key:"getCustomLayoutItem",value:function(e,t,r){var n=e.roster.isContent;return{pid:e.roster.participantId,resolution:t,quality:r,mediagroupid:n?1:0}}},{key:"getMeetingStatus",value:function(e,t,r){return t?{success:e,data:{code:t,msg:r}}:{success:e,data:{}}}}]),r}(),ig=un.some,og=ar("some");Ct({target:"Array",proto:!0,forced:!og},{some:function(e){return ig(this,e,arguments.length>1?arguments[1]:void 0)}});var ag="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,sg=a.RangeError,ug=function(e){if(void 0===e)return 0;var t=tt(e),r=at(t);if(t!==r)throw sg("Wrong length or index");return r},cg=a.Array,lg=Math.abs,fg=Math.pow,hg=Math.floor,dg=Math.log,pg=Math.LN2,vg=function(e,t,r){var n,i,o,a=cg(r),s=8*r-t-1,u=(1<<s)-1,c=u>>1,l=23===t?fg(2,-24)-fg(2,-77):0,f=e<0||0===e&&1/e<0?1:0,h=0;for((e=lg(e))!=e||e===1/0?(i=e!=e?1:0,n=u):(n=hg(dg(e)/pg),e*(o=fg(2,-n))<1&&(n--,o*=2),(e+=n+c>=1?l/o:l*fg(2,1-c))*o>=2&&(n++,o/=2),n+c>=u?(i=0,n=u):n+c>=1?(i=(e*o-1)*fg(2,t),n+=c):(i=e*fg(2,c-1)*fg(2,t),n=0));t>=8;)a[h++]=255&i,i/=256,t-=8;for(n=n<<t|i,s+=t;s>0;)a[h++]=255&n,n/=256,s-=8;return a[--h]|=128*f,a},gg=function(e,t){var r,n=e.length,i=8*n-t-1,o=(1<<i)-1,a=o>>1,s=i-7,u=n-1,c=e[u--],l=127&c;for(c>>=7;s>0;)l=256*l+e[u--],s-=8;for(r=l&(1<<-s)-1,l>>=-s,s+=t;s>0;)r=256*r+e[u--],s-=8;if(0===l)l=1-a;else{if(l===o)return r?NaN:c?-1/0:1/0;r+=fg(2,t),l-=a}return(c?-1:1)*r*fg(2,l-t)},mg=function(e){for(var t=te(this),r=st(t),n=arguments.length,i=it(n>1?arguments[1]:void 0,r),o=n>2?arguments[2]:void 0,a=void 0===o?r:it(o,r);a>i;)t[i++]=e;return t},yg=vt.f,bg=Ce.f,wg=Xe.PROPER,kg=Xe.CONFIGURABLE,_g=qe.get,Sg=qe.set,xg=a.ArrayBuffer,Eg=xg,Og=Eg&&Eg.prototype,Ag=a.DataView,Cg=Ag&&Ag.prototype,Ig=Object.prototype,Tg=a.Array,Rg=a.RangeError,Lg=b(mg),Ng=b([].reverse),Pg=vg,Mg=gg,jg=function(e){return[255&e]},Dg=function(e){return[255&e,e>>8&255]},Bg=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},Ug=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},Fg=function(e){return Pg(e,23,4)},zg=function(e){return Pg(e,52,8)},Hg=function(e,t){bg(e.prototype,t,{get:function(){return _g(this)[t]}})},Vg=function(e,t,r,n){var i=ug(r),o=_g(e);if(i+t>o.byteLength)throw Rg("Wrong index");var a=_g(o.buffer).bytes,s=i+o.byteOffset,u=gl(a,s,s+t);return n?u:Ng(u)},Wg=function(e,t,r,n,i,o){var a=ug(r),s=_g(e);if(a+t>s.byteLength)throw Rg("Wrong index");for(var u=_g(s.buffer).bytes,c=a+s.byteOffset,l=n(+i),f=0;f<t;f++)u[c+f]=l[o?f:t-f-1]};if(ag){var Gg=wg&&"ArrayBuffer"!==xg.name;if(s((function(){xg(1)}))&&s((function(){new xg(-1)}))&&!s((function(){return new xg,new xg(1.5),new xg(NaN),Gg&&!kg})))Gg&&kg&&Ie(xg,"name","ArrayBuffer");else{(Eg=function(e){return Hi(this,Og),new xg(ug(e))}).prototype=Og;for(var Kg,qg=yg(xg),Yg=0;qg.length>Yg;)(Kg=qg[Yg++])in Eg||Ie(Eg,Kg,xg[Kg]);Og.constructor=Eg}Ei&&pi(Cg)!==Ig&&Ei(Cg,Ig);var Zg=new Ag(new Eg(2)),Jg=b(Cg.setInt8);Zg.setInt8(0,2147483648),Zg.setInt8(1,2147483649),!Zg.getInt8(0)&&Zg.getInt8(1)||Bi(Cg,{setInt8:function(e,t){Jg(this,e,t<<24>>24)},setUint8:function(e,t){Jg(this,e,t<<24>>24)}},{unsafe:!0})}else Og=(Eg=function(e){Hi(this,Og);var t=ug(e);Sg(this,{bytes:Lg(Tg(t),0),byteLength:t}),u||(this.byteLength=t)}).prototype,Cg=(Ag=function(e,t,r){Hi(this,Cg),Hi(e,Og);var n=_g(e).byteLength,i=tt(t);if(i<0||i>n)throw Rg("Wrong offset");if(i+(r=void 0===r?n-i:at(r))>n)throw Rg("Wrong length");Sg(this,{buffer:e,byteLength:r,byteOffset:i}),u||(this.buffer=e,this.byteLength=r,this.byteOffset=i)}).prototype,u&&(Hg(Eg,"byteLength"),Hg(Ag,"buffer"),Hg(Ag,"byteLength"),Hg(Ag,"byteOffset")),Bi(Cg,{getInt8:function(e){return Vg(this,1,e)[0]<<24>>24},getUint8:function(e){return Vg(this,1,e)[0]},getInt16:function(e){var t=Vg(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=Vg(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return Ug(Vg(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return Ug(Vg(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return Mg(Vg(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return Mg(Vg(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){Wg(this,1,e,jg,t)},setUint8:function(e,t){Wg(this,1,e,jg,t)},setInt16:function(e,t){Wg(this,2,e,Dg,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){Wg(this,2,e,Dg,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){Wg(this,4,e,Bg,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){Wg(this,4,e,Bg,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){Wg(this,4,e,Fg,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){Wg(this,8,e,zg,t,arguments.length>2?arguments[2]:void 0)}});wi(Eg,"ArrayBuffer"),wi(Ag,"DataView");var Xg={ArrayBuffer:Eg,DataView:Ag},$g=Xg.ArrayBuffer,Qg=Xg.DataView,em=Qg.prototype,tm=b($g.prototype.slice),rm=b(em.getUint8),nm=b(em.setUint8),im=s((function(){return!new $g(2).slice(1,void 0).byteLength}));Ct({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:im},{slice:function(e,t){if(tm&&void 0===t)return tm(Ee(this),e);for(var r=Ee(this).byteLength,n=it(e,r),i=it(void 0===t?r:t,r),o=new(po(this,$g))(at(i-n)),a=new Qg(this),s=new Qg(o),u=0;n<i;)nm(s,u++,rm(a,n++));return o}});var om,am,sm,um=Ce.f,cm=a.Int8Array,lm=cm&&cm.prototype,fm=a.Uint8ClampedArray,hm=fm&&fm.prototype,dm=cm&&pi(cm),pm=lm&&pi(lm),vm=Object.prototype,gm=a.TypeError,mm=he("toStringTag"),ym=se("TYPED_ARRAY_TAG"),bm=se("TYPED_ARRAY_CONSTRUCTOR"),wm=ag&&!!Ei&&"Opera"!==zt(a.opera),km=!1,_m={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Sm={BigInt64Array:8,BigUint64Array:8},xm=function(e){if(!T(e))return!1;var t=zt(e);return ne(_m,t)||ne(Sm,t)};for(om in _m)(sm=(am=a[om])&&am.prototype)?Ie(sm,bm,am):wm=!1;for(om in Sm)(sm=(am=a[om])&&am.prototype)&&Ie(sm,bm,am);if((!wm||!I(dm)||dm===Function.prototype)&&(dm=function(){throw gm("Incorrect invocation")},wm))for(om in _m)a[om]&&Ei(a[om],dm);if((!wm||!pm||pm===vm)&&(pm=dm.prototype,wm))for(om in _m)a[om]&&Ei(a[om].prototype,pm);if(wm&&pi(hm)!==pm&&Ei(hm,pm),u&&!ne(pm,mm))for(om in km=!0,um(pm,mm,{get:function(){return T(this)?this[ym]:void 0}}),_m)a[om]&&Ie(a[om],ym,om);var Em={NATIVE_ARRAY_BUFFER_VIEWS:wm,TYPED_ARRAY_CONSTRUCTOR:bm,TYPED_ARRAY_TAG:km&&ym,aTypedArray:function(e){if(xm(e))return e;throw gm("Target is not a typed array")},aTypedArrayConstructor:function(e){if(I(e)&&(!Ei||N(dm,e)))return e;throw gm(G(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r){if(u){if(r)for(var n in _m){var i=a[n];if(i&&ne(i.prototype,e))try{delete i.prototype[e]}catch(e){}}pm[e]&&!r||$e(pm,e,r?t:wm&&lm[e]||t)}},exportTypedArrayStaticMethod:function(e,t,r){var n,i;if(u){if(Ei){if(r)for(n in _m)if((i=a[n])&&ne(i,e))try{delete i[e]}catch(e){}if(dm[e]&&!r)return;try{return $e(dm,e,r?t:wm&&dm[e]||t)}catch(e){}}for(n in _m)!(i=a[n])||i[e]&&!r||$e(i,e,t)}},isView:function(e){if(!T(e))return!1;var t=zt(e);return"DataView"===t||ne(_m,t)||ne(Sm,t)},isTypedArray:xm,TypedArray:dm,TypedArrayPrototype:pm},Om=Em.NATIVE_ARRAY_BUFFER_VIEWS,Am=a.ArrayBuffer,Cm=a.Int8Array,Im=!Om||!s((function(){Cm(1)}))||!s((function(){new Cm(-1)}))||!co((function(e){new Cm,new Cm(null),new Cm(1.5),new Cm(e)}),!0)||s((function(){return 1!==new Cm(new Am(2),1,void 0).length})),Tm=Math.floor,Rm=Number.isInteger||function(e){return!T(e)&&isFinite(e)&&Tm(e)===e},Lm=a.RangeError,Nm=a.RangeError,Pm=function(e,t){var r=function(e){var t=tt(e);if(t<0)throw Lm("The argument can't be less than 0");return t}(e);if(r%t)throw Nm("Wrong offset");return r},Mm=Em.aTypedArrayConstructor,jm=function(e){var t,r,n,i,o,a,s=fo(this),u=te(e),c=arguments.length,f=c>1?arguments[1]:void 0,h=void 0!==f,d=qi(u);if(d&&!Gi(d))for(a=(o=Zi(u,d)).next,u=[];!(i=l(a,o)).done;)u.push(i.value);for(h&&c>2&&(f=on(f,arguments[2])),r=st(u),n=new(Mm(s))(r),t=0;r>t;t++)n[t]=h?f(u[t],t):u[t];return n};r((function(e){var t=vt.f,r=un.forEach,n=qe.get,i=qe.set,o=Ce.f,s=_e.f,c=Math.round,f=a.RangeError,h=Xg.ArrayBuffer,d=h.prototype,v=Xg.DataView,g=Em.NATIVE_ARRAY_BUFFER_VIEWS,m=Em.TYPED_ARRAY_CONSTRUCTOR,y=Em.TYPED_ARRAY_TAG,b=Em.TypedArray,w=Em.TypedArrayPrototype,k=Em.aTypedArrayConstructor,_=Em.isTypedArray,S=function(e,t){k(e);for(var r=0,n=t.length,i=new e(n);n>r;)i[r]=t[r++];return i},x=function(e,t){o(e,t,{get:function(){return n(this)[t]}})},E=function(e){var t;return N(d,e)||"ArrayBuffer"==(t=zt(e))||"SharedArrayBuffer"==t},O=function(e,t){return _(e)&&!V(t)&&t in e&&Rm(+t)&&t>=0},A=function(e,t){return t=ge(t),O(e,t)?p(2,e[t]):s(e,t)},C=function(e,t,r){return t=ge(t),!(O(e,t)&&T(r)&&ne(r,"value"))||ne(r,"get")||ne(r,"set")||r.configurable||ne(r,"writable")&&!r.writable||ne(r,"enumerable")&&!r.enumerable?o(e,t,r):(e[t]=r.value,e)};u?(g||(_e.f=A,Ce.f=C,x(w,"buffer"),x(w,"byteOffset"),x(w,"byteLength"),x(w,"length")),Ct({target:"Object",stat:!0,forced:!g},{getOwnPropertyDescriptor:A,defineProperty:C}),e.exports=function(e,s,u){var d=e.match(/\d+$/)[0]/8,p=e+(u?"Clamped":"")+"Array",k="get"+e,x="set"+e,O=a[p],A=O,C=A&&A.prototype,I={},R=function(e,t){o(e,t,{get:function(){return function(e,t){var r=n(e);return r.view[k](t*d+r.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,r){var i=n(e);u&&(r=(r=c(r))<0?0:r>255?255:255&r),i.view[x](t*d+i.byteOffset,r,!0)}(this,t,e)},enumerable:!0})};g?Im&&(A=s((function(e,t,r,n){return Hi(e,C),bp(T(t)?E(t)?void 0!==n?new O(t,Pm(r,d),n):void 0!==r?new O(t,Pm(r,d)):new O(t):_(t)?S(A,t):l(jm,A,t):new O(ug(t)),e,A)})),Ei&&Ei(A,b),r(t(O),(function(e){e in A||Ie(A,e,O[e])})),A.prototype=C):(A=s((function(e,t,r,n){Hi(e,C);var o,a,s,u=0,c=0;if(T(t)){if(!E(t))return _(t)?S(A,t):l(jm,A,t);o=t,c=Pm(r,d);var p=t.byteLength;if(void 0===n){if(p%d)throw f("Wrong length");if((a=p-c)<0)throw f("Wrong length")}else if((a=at(n)*d)+c>p)throw f("Wrong length");s=a/d}else s=ug(t),o=new h(a=s*d);for(i(e,{buffer:o,byteOffset:c,byteLength:a,length:s,view:new v(o)});u<s;)R(e,u++)})),Ei&&Ei(A,b),C=A.prototype=Cr(w)),C.constructor!==A&&Ie(C,"constructor",A),Ie(C,m,A),y&&Ie(C,y,p),I[p]=A,Ct({global:!0,forced:A!=O,sham:!g},I),"BYTES_PER_ELEMENT"in A||Ie(A,"BYTES_PER_ELEMENT",d),"BYTES_PER_ELEMENT"in C||Ie(C,"BYTES_PER_ELEMENT",d),Fi(p)}):e.exports=function(){}}))("Uint8",(function(e){return function(t,r,n){return e(this,t,r,n)}}));var Dm=Math.min,Bm=b([].copyWithin||function(e,t){var r=te(this),n=st(r),i=it(e,n),o=it(t,n),a=arguments.length>2?arguments[2]:void 0,s=Dm((void 0===a?n:it(a,n))-o,n-i),u=1;for(o<i&&i<o+s&&(u=-1,o+=s-1,i+=s-1);s-- >0;)o in r?r[i]=r[o]:delete r[i],i+=u,o+=u;return r}),Um=Em.aTypedArray;(0,Em.exportTypedArrayMethod)("copyWithin",(function(e,t){return Bm(Um(this),e,t,arguments.length>2?arguments[2]:void 0)}));var Fm=un.every,zm=Em.aTypedArray;(0,Em.exportTypedArrayMethod)("every",(function(e){return Fm(zm(this),e,arguments.length>1?arguments[1]:void 0)}));var Hm=Em.aTypedArray;(0,Em.exportTypedArrayMethod)("fill",(function(e){var t=arguments.length;return l(mg,Hm(this),e,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}));var Vm=Em.TYPED_ARRAY_CONSTRUCTOR,Wm=Em.aTypedArrayConstructor,Gm=function(e){return Wm(po(e,e[Vm]))},Km=function(e,t){return function(e,t){for(var r=0,n=t.length,i=new e(n);n>r;)i[r]=t[r++];return i}(Gm(e),t)},qm=un.filter,Ym=Em.aTypedArray;(0,Em.exportTypedArrayMethod)("filter",(function(e){var t=qm(Ym(this),e,arguments.length>1?arguments[1]:void 0);return Km(this,t)}));var Zm=un.find,Jm=Em.aTypedArray;(0,Em.exportTypedArrayMethod)("find",(function(e){return Zm(Jm(this),e,arguments.length>1?arguments[1]:void 0)}));var Xm=un.findIndex,$m=Em.aTypedArray;(0,Em.exportTypedArrayMethod)("findIndex",(function(e){return Xm($m(this),e,arguments.length>1?arguments[1]:void 0)}));var Qm=un.forEach,ey=Em.aTypedArray;(0,Em.exportTypedArrayMethod)("forEach",(function(e){Qm(ey(this),e,arguments.length>1?arguments[1]:void 0)}));var ty=ct.includes,ry=Em.aTypedArray;(0,Em.exportTypedArrayMethod)("includes",(function(e){return ty(ry(this),e,arguments.length>1?arguments[1]:void 0)}));var ny=ct.indexOf,iy=Em.aTypedArray;(0,Em.exportTypedArrayMethod)("indexOf",(function(e){return ny(iy(this),e,arguments.length>1?arguments[1]:void 0)}));var oy=Xe.PROPER,ay=he("iterator"),sy=a.Uint8Array,uy=b(Mi.values),cy=b(Mi.keys),ly=b(Mi.entries),fy=Em.aTypedArray,hy=Em.exportTypedArrayMethod,dy=sy&&sy.prototype[ay],py=!!dy&&"values"===dy.name,vy=function(){return uy(fy(this))};hy("entries",(function(){return ly(fy(this))})),hy("keys",(function(){return cy(fy(this))})),hy("values",vy,oy&&!py),hy(ay,vy,oy&&!py);var gy=Em.aTypedArray,my=Em.exportTypedArrayMethod,yy=b([].join);my("join",(function(e){return yy(gy(this),e)}));var by=Math.min,wy=[].lastIndexOf,ky=!!wy&&1/[1].lastIndexOf(1,-0)<0,_y=ar("lastIndexOf"),Sy=ky||!_y?function(e){if(ky)return bo(wy,this,arguments)||0;var t=C(this),r=st(t),n=r-1;for(arguments.length>1&&(n=by(n,tt(arguments[1]))),n<0&&(n=r+n);n>=0;n--)if(n in t&&t[n]===e)return n||0;return-1}:wy,xy=Em.aTypedArray;(0,Em.exportTypedArrayMethod)("lastIndexOf",(function(e){var t=arguments.length;return bo(Sy,xy(this),t>1?[e,arguments[1]]:[e])}));var Ey=un.map,Oy=Em.aTypedArray;(0,Em.exportTypedArrayMethod)("map",(function(e){return Ey(Oy(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(Gm(e))(t)}))}));var Ay=a.TypeError,Cy=function(e){return function(t,r,n,i){q(r);var o=te(t),a=E(o),s=st(o),u=e?s-1:0,c=e?-1:1;if(n<2)for(;;){if(u in a){i=a[u],u+=c;break}if(u+=c,e?u<0:s<=u)throw Ay("Reduce of empty array with no initial value")}for(;e?u>=0:s>u;u+=c)u in a&&(i=r(i,a[u],u,o));return i}},Iy={left:Cy(!1),right:Cy(!0)},Ty=Iy.left,Ry=Em.aTypedArray;(0,Em.exportTypedArrayMethod)("reduce",(function(e){var t=arguments.length;return Ty(Ry(this),e,t,t>1?arguments[1]:void 0)}));var Ly=Iy.right,Ny=Em.aTypedArray;(0,Em.exportTypedArrayMethod)("reduceRight",(function(e){var t=arguments.length;return Ly(Ny(this),e,t,t>1?arguments[1]:void 0)}));var Py=Em.aTypedArray,My=Em.exportTypedArrayMethod,jy=Math.floor;My("reverse",(function(){for(var e,t=Py(this).length,r=jy(t/2),n=0;n<r;)e=this[n],this[n++]=this[--t],this[t]=e;return this}));var Dy=a.RangeError,By=Em.aTypedArray;(0,Em.exportTypedArrayMethod)("set",(function(e){By(this);var t=Pm(arguments.length>1?arguments[1]:void 0,1),r=this.length,n=te(e),i=st(n),o=0;if(i+t>r)throw Dy("Wrong length");for(;o<i;)this[t+o]=n[o++]}),s((function(){new Int8Array(1).set({})})));var Uy=Em.aTypedArray;(0,Em.exportTypedArrayMethod)("slice",(function(e,t){for(var r=wo(Uy(this),e,t),n=Gm(this),i=0,o=r.length,a=new n(o);o>i;)a[i]=r[i++];return a}),s((function(){new Int8Array(1).slice()})));var Fy=un.some,zy=Em.aTypedArray;(0,Em.exportTypedArrayMethod)("some",(function(e){return Fy(zy(this),e,arguments.length>1?arguments[1]:void 0)}));var Hy=Math.floor,Vy=function(e,t){var r=e.length,n=Hy(r/2);return r<8?Wy(e,t):Gy(e,Vy(gl(e,0,n),t),Vy(gl(e,n),t),t)},Wy=function(e,t){for(var r,n,i=e.length,o=1;o<i;){for(n=o,r=e[o];n&&t(e[n-1],r)>0;)e[n]=e[--n];n!==o++&&(e[n]=r)}return e},Gy=function(e,t,r,n){for(var i=t.length,o=r.length,a=0,s=0;a<i||s<o;)e[a+s]=a<i&&s<o?n(t[a],r[s])<=0?t[a++]:r[s++]:a<i?t[a++]:r[s++];return e},Ky=Vy,qy=P.match(/firefox\/(\d+)/i),Yy=!!qy&&+qy[1],Zy=/MSIE|Trident/.test(P),Jy=P.match(/AppleWebKit\/(\d+)\./),Xy=!!Jy&&+Jy[1],$y=a.Array,Qy=Em.aTypedArray,eb=Em.exportTypedArrayMethod,tb=a.Uint16Array,rb=tb&&b(tb.prototype.sort),nb=!(!rb||s((function(){rb(new tb(2),null)}))&&s((function(){rb(new tb(2),{})}))),ib=!!rb&&!s((function(){if(U)return U<74;if(Yy)return Yy<67;if(Zy)return!0;if(Xy)return Xy<602;var e,t,r=new tb(516),n=$y(516);for(e=0;e<516;e++)t=e%4,r[e]=515-e,n[e]=e-2*t+3;for(rb(r,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(r[e]!==n[e])return!0}));eb("sort",(function(e){return void 0!==e&&q(e),ib?rb(this,e):Ky(Qy(this),function(e){return function(t,r){return void 0!==e?+e(t,r)||0:r!=r?-1:t!=t?1:0===t&&0===r?1/t>0&&1/r<0?1:-1:t>r}}(e))}),!ib||nb);var ob=Em.aTypedArray;(0,Em.exportTypedArrayMethod)("subarray",(function(e,t){var r=ob(this),n=r.length,i=it(e,n);return new(Gm(r))(r.buffer,r.byteOffset+i*r.BYTES_PER_ELEMENT,at((void 0===t?n:it(t,n))-i))}));var ab=a.Int8Array,sb=Em.aTypedArray,ub=Em.exportTypedArrayMethod,cb=[].toLocaleString,lb=!!ab&&s((function(){cb.call(new ab(1))}));ub("toLocaleString",(function(){return bo(cb,lb?wo(sb(this)):sb(this),wo(arguments))}),s((function(){return[1,2].toLocaleString()!=new ab([1,2]).toLocaleString()}))||!s((function(){ab.prototype.toLocaleString.call([1,2])})));var fb=Em.exportTypedArrayMethod,hb=a.Uint8Array,db=hb&&hb.prototype||{},pb=[].toString,vb=b([].join);s((function(){pb.call({})}))&&(pb=function(){return vb(this)});var gb=db.toString!=pb;fb("toString",pb,gb);var mb=function(){function e(t){Vn(this,e),this.level=0,this.stream=t}return Gn(e,[{key:"getAudioLevel",value:function(){if(this.analyser){this.analyser.getByteTimeDomainData(this.timeDomainData);var e=0,t=0,r=this.timeDomainData.length;for(t=0;t<r;t++)e=Math.max(e,Math.abs(this.timeDomainData[t]-128));this.level=e}var n=Math.min(100,100*Number((this.level/64).toFixed(2)));return parseInt(n+"")}},{key:"init",value:function(){var e=window.AudioContext||window.webkitAudioContext;e?(this.audioContext=new e,this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=2048,this.sourceNode=this.audioContext.createMediaStreamSource(this.stream),this.timeDomainData=new Uint8Array(this.analyser.frequencyBinCount),this.sourceNode.connect(this.analyser)):console.log("init audio content failed: ",e)}}]),e}(),yb=function(e){Kn(r,Fp);var t=Xn(r);function r(e){var n;Vn(this,r),n=t.call(this);var i=e.logger,o=e.client,a=void 0===o?null:o;return n.streams=[],n.pipelineStreams=[],n.contentStreams=[],n.previewStreams=[],n.logger=i,n.client=a,n.isShareContent=!1,n.streamStatus=!0,n.config={devices:{}},n.current={type:"FAILED",detail:""},n.audioDeviceId="",n.videoDeviceId="",n}return Gn(r,[{key:"getLocalStream",value:function(){return this.previewStreams}},{key:"getIndexFromStreamChange",value:function(e,t){var r=e.id;return t.findIndex((function(e){return e.streamId===r}))}},{key:"off",value:function(e){this.removeListener(e)}},{key:"handleChangeStream",value:function(e,t,r){var n;return es(this,void 0,void 0,regeneratorRuntime.mark((function i(){var o,a,s,u,c,l,f,h,d,p,v,g,m;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:o=e.streamChangeInfo,a=0===r?this.streams:this.contentStreams,s=0===r?Wf:Vf,u=a.length,c=0;case 5:if(!(c<u)){i.next=45;break}if("NORMAL"!==a[c].status){i.next=42;break}l=a[c].stream,f=(null===(n=a[c].stream)||void 0===n?void 0:n.getVideoTracks())||[],h=f.length,d=l?this.getIndexFromStreamChange(l,o):-1,p=0;case 12:if(!(p<h)){i.next=42;break}if(v=f[p],-1===d){i.next=29;break}if(g=o[d],m=g.bandwidth>=100?g.bandwidth:100,!v){i.next=27;break}return i.prev=18,i.next=21,v.applyConstraints(s[a[c].resolution].max);case 21:return i.next=23,t.setBandWidth(v.id,m,!0);case 23:i.next=27;break;case 25:i.prev=25,i.t0=i.catch(18);case 27:i.next=39;break;case 29:if(!v){i.next=39;break}return i.prev=30,i.next=33,v.applyConstraints(s[a[c].resolution].min);case 33:return i.next=35,t.setBandWidth(v.id,5,!0);case 35:i.next=39;break;case 37:i.prev=37,i.t1=i.catch(30);case 39:p++,i.next=12;break;case 42:c++,i.next=5;break;case 45:case"end":return i.stop()}}),i,this,[[18,25],[30,37]])})))}},{key:"setAudioOutput",value:function(e){var t=this;if(this.logger.log("set audio output device: ".concat(e)),"string"!=typeof e){var r="Parameter must be a string";return this.logger.log(r),Promise.reject(El(10400,r))}return new Promise((function(r,n){var i;try{null===(i=t.client)||void 0===i||i.setAudioOutputDevice(e),r({deviceId:e})}catch(e){n(El(20407,"set audioOutput error",e))}}))}},{key:"switchDevice",value:function(e,t){var r;return es(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,s,u;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(this.logger.log("switch device: type: ".concat(e,", deviceId: ").concat(t)),i=["audio","video"],"string"==typeof e&&i.includes(e)){n.next=6;break}return o="Must receive audio or video string in type parameter",this.logger.log(o),n.abrupt("return",Promise.reject(El(10400,o)));case 6:if("string"==typeof t){n.next=10;break}return a="Must receive string in deviceId parameter",this.logger.log(a),n.abrupt("return",Promise.reject(El(10400,a)));case 10:if(s=this.client.getSelfRoster(),u=(s||{videoTxMute:!1}).videoTxMute,n.prev=12,"audio"!==e||!t){n.next=17;break}return this.audioDeviceId=t,n.next=17,this.replaceAudioTrack();case 17:if("video"!==e||!t){n.next=22;break}if(this.videoDeviceId=t,u){n.next=22;break}return n.next=22,this.replaceVideoTrack();case 22:return null===(r=this.client)||void 0===r||r.deviceManager.setCurrentUsedDeviceByType(e,t),n.abrupt("return",!0);case 26:return n.prev=26,n.t0=n.catch(12),n.abrupt("return",Promise.reject(El(20522,"Switch ".concat(e," device failed"),n.t0)));case 29:case"end":return n.stop()}}),n,this,[[12,26]])})))}},{key:"sendStreamStatus",value:function(){this.emmit("stream-status",this.current)}},{key:"replaceAudioTrack",value:function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return es(this,void 0,void 0,regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return this.streams.every((function(e){var t;"180"===e.resolution&&(null===(t=e.stream)||void 0===t||t.getAudioTracks().forEach((function(t){var r;t.stop(),null===(r=e.stream)||void 0===r||r.removeTrack(t)})))})),r.prev=1,r.next=4,this.createNextAudioTracks();case 4:r.next=9;break;case 6:return r.prev=6,r.t0=r.catch(1),r.abrupt("return",Promise.reject(r.t0));case 9:null===(e=this.client)||void 0===e||e.applyVideoOrAudio("audio",!t),this.audioLevel=null;case 11:case"end":return r.stop()}}),r,this,[[1,6]])})))}},{key:"replaceVideoTrack",value:function(){var e,t,r;return es(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(i=null===(e=this.previewStreams[0])||void 0===e?void 0:e.stream,o=i&&i.getVideoTracks().length>0,!i){n.next=16;break}return n.prev=3,n.next=6,this.createNextVideoTracks();case 6:this.removePreviousVideoTracks("muteVideo"),null===(t=this.client)||void 0===t||t.applyVideoOrAudio("video",!o),null===(r=this.client)||void 0===r||r.sendPeopleCapability(),n.next=14;break;case 11:return n.prev=11,n.t0=n.catch(3),n.abrupt("return",Promise.reject(n.t0));case 14:n.next=17;break;case 16:return n.abrupt("return",Promise.reject(El(30409,"当前无媒体流")));case 17:case"end":return n.stop()}}),n,this,[[3,11]])})))}},{key:"setAudioOrVideoStatus",value:function(e){var t,r,n;return es(this,void 0,void 0,regeneratorRuntime.mark((function i(){var o,a,s,u,c=this;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if("unmuteAudio"!==e&&"unmuteVideo"!==e||"SEND_ONLY"!==this.current.type){i.next=10;break}return o={},a="video","unmuteAudio"===e&&(o={muteAudio:!1},a="audio"),"unmuteVideo"===e&&(o={muteVideo:!1},a="video"),i.next=7,this.init(this.config,o);case 7:return null===(t=this.client)||void 0===t||t.applyVideoOrAudio(a,!0),"video"===a&&this.client.sendPeopleCapability(),i.abrupt("return");case 10:if("unmuteAudio"!==e){i.next=23;break}if(s=(null===(n=null===(r=this.streams.find((function(e){return"180"===e.resolution})))||void 0===r?void 0:r.stream)||void 0===n?void 0:n.getAudioTracks())||[],u=s.length>0){i.next=23;break}return i.prev=14,i.next=17,this.replaceAudioTrack(u);case 17:return i.abrupt("return");case 20:return i.prev=20,i.t0=i.catch(14),i.abrupt("return",Promise.reject(i.t0));case 23:if("muteAudio"!==e&&"unmuteAudio"!==e||this.setStreamStatus(e),"muteVideo"===e&&setTimeout((function(){c.setStreamStatus(e)}),250),"unmuteVideo"!==e){i.next=34;break}return i.prev=26,i.next=29,this.replaceVideoTrack();case 29:i.next=34;break;case 31:return i.prev=31,i.t1=i.catch(26),i.abrupt("return",Promise.reject(i.t1));case 34:case"end":return i.stop()}}),i,this,[[14,20],[26,31]])})))}},{key:"setStreamStatus",value:function(e){var t=this;this.previewStreams.forEach((function(r){(null==r?void 0:r.stream)&&t.setStreamTracksStatus(r.stream,e)})),this.streams.forEach((function(r){(null==r?void 0:r.stream)&&t.setStreamTracksStatus(r.stream,e)}))}},{key:"getNextAudioContraints",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.audioDeviceId,t=r.getContraints(!1,!0),n={};return e&&(n={deviceId:{exact:e}}),Object.assign(t.audio,n),this.logger.log("create next audio track contrants:",t),t}},{key:"getNextAudioMedia",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.audioDeviceId;return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.getNextAudioContraints(e),t.prev=1,t.next=4,this.getUserMedia(r);case 4:n=t.sent,t.next=20;break;case 7:return t.prev=7,t.t0=t.catch(1),this.logger.error("create next audio track error:",t.t0),t.prev=10,r=this.getNextAudioContraints(""),t.next=14,this.getUserMedia(r);case 14:n=t.sent,t.next=20;break;case 17:return t.prev=17,t.t1=t.catch(10),t.abrupt("return",Promise.reject(t.t1));case 20:return t.abrupt("return",n);case 21:case"end":return t.stop()}}),t,this,[[1,7],[10,17]])})))}},{key:"createNextAudioTracks",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.audioDeviceId;return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=null,t.prev=1,t.next=4,this.getNextAudioMedia(e);case 4:r=t.sent,t.next=11;break;case 7:return t.prev=7,t.t0=t.catch(1),n=this.handleCreateStreamError(t.t0),t.abrupt("return",Promise.reject(n));case 11:i=r.getAudioTracks()[0],this.streams.some((function(e){var t;if("180"===e.resolution)return null===(t=e.stream)||void 0===t||t.addTrack(i),!0}));case 13:case"end":return t.stop()}}),t,this,[[1,7]])})))}},{key:"getNextVideoContraints",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.videoDeviceId,t=r.getContraints(!0,!1),n={};return e&&(n={deviceId:{exact:e}}),Object.assign(t.video,n),this.logger.log("create next video track contrants:",t),t}},{key:"getNextVideoMedia",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.videoDeviceId;return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.getNextVideoContraints(e),t.prev=1,t.next=4,this.getUserMedia(r);case 4:n=t.sent,t.next=20;break;case 7:return t.prev=7,t.t0=t.catch(1),this.logger.error("create next video track error:",t.t0),t.prev=10,r=this.getNextVideoContraints(""),t.next=14,this.getUserMedia(r);case 14:n=t.sent,t.next=20;break;case 17:return t.prev=17,t.t1=t.catch(10),t.abrupt("return",Promise.reject(t.t1));case 20:return t.abrupt("return",n);case 21:case"end":return t.stop()}}),t,this,[[1,7],[10,17]])})))}},{key:"createNextVideoTracks",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.videoDeviceId;return es(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i,o,a,s,u,c,l=this;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=null,r.prev=1,r.next=4,this.getNextVideoMedia(t);case 4:n=r.sent,r.next=11;break;case 7:return r.prev=7,r.t0=r.catch(1),i=this.handleCreateStreamError(r.t0),r.abrupt("return",Promise.reject(i));case 11:o=n.getVideoTracks()[0],a=[o.clone(),o.clone(),o.clone()],this.previewStreams[0].stream.addTrack(o),s=ri(this.streams.entries()),r.prev=15,c=regeneratorRuntime.mark((function t(){var r,n,i,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=$n(u.value,2),n=r[0],i=r[1],t.prev=1,o=Wf[i.resolution].max,t.next=5,a[n].applyConstraints(o);case 5:i.stream.addTrack(a[n]),l.streams[n].status="NORMAL",l.logger.log("create next remote track constranits:",o,l.streams),t.next=15;break;case 10:t.prev=10,t.t0=t.catch(1),l.logger.error("new video track apply constraints error: ",t.t0),l.streams[n].status="INVALID",null===(e=l.streams[n].stream)||void 0===e||e.getTracks().forEach((function(e){e.stop(),l.logger.log("disabled track",a[n].id)}));case 15:case"end":return t.stop()}}),t,null,[[1,10]])})),s.s();case 18:if((u=s.n()).done){r.next=22;break}return r.delegateYield(c(),"t1",20);case 20:r.next=18;break;case 22:r.next=27;break;case 24:r.prev=24,r.t2=r.catch(15),s.e(r.t2);case 27:return r.prev=27,s.f(),r.finish(27);case 30:case"end":return r.stop()}}),r,this,[[1,7],[15,24,27,30]])})))}},{key:"removePreviousVideoTracks",value:function(e){var t=Ff[e].status,r=this.previewStreams[0].stream.getVideoTracks();if(!(r.length<2)){var n=r[0];n&&(this.previewStreams[0].stream.removeTrack(n),!t&&n.stop()),this.streams.forEach((function(e){var r=e.stream.getVideoTracks()[0];r&&(e.stream.removeTrack(r),!t&&r.stop())}))}}},{key:"setStreamTracksStatus",value:function(e,t){e.getTracks().forEach((function(e){("audio"!==e.kind||"muteAudio"!==t&&"unmuteAudio"!==t||(e.enabled=Ff[t].status),"video"===e.kind&&"muteVideo"===t)&&(Ff[t].status||e.stop())}))}},{key:"close",value:function(){this.streamStatus=!1;var e=0;this.clearAudioLevel(),this.streams&&(e+=this.closeStreams(this.streams)),this.pipelineStreams&&(e+=this.closeStreams(this.pipelineStreams)),this.previewStreams&&(e+=this.closeStreams(this.previewStreams)),this.isShareContent&&this.closeContentStream(),this.streams=[],this.pipelineStreams=[],this.contentStreams=[],this.previewStreams=[],this.logger.log("stream closed successfully: ",e)}},{key:"closeStreams",value:function(e){var t=0;return e.forEach((function(e){var r;"NORMAL"===e.status&&(null===(r=e.stream)||void 0===r||r.getTracks().forEach((function(e){e.stop(),t+=1})))})),t}},{key:"getMediaStreams",value:function(){return{previewStreams:this.previewStreams,streams:this.streams,pipelineStreams:this.pipelineStreams,contentStreams:this.contentStreams}}},{key:"init",value:function(){var e,t,r,n,i,o,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{devices:{}},s=arguments.length>1?arguments[1]:void 0;return es(this,void 0,void 0,regeneratorRuntime.mark((function u(){var c,l,f,h,d,p,v,g,m,y,b,w,k,_,S;return regeneratorRuntime.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:if(this.logger.log("stream init config:",a),this.streamStatus){u.next=3;break}return u.abrupt("return",Promise.reject(El(30524,"Stream status is invalid")));case 3:if(this.client){u.next=5;break}return u.abrupt("return",Promise.reject(El(30528,"The client is null")));case 5:if(this.config=a,c=(null==a?void 0:a.devices)||{audioInputValue:"",videoInValue:""},l=c.audioInputValue,f=void 0===l?"":l,h=c.videoInValue,d=void 0===h?"":h,p=null===(e=this.client.deviceManager)||void 0===e?void 0:e.getDevicePermission(),v=p.camera,g=p.microphone,m=null===(t=this.client.deviceManager)||void 0===t?void 0:t.getNextDeviceList(),y=!0,b=!0,w={type:"NORMAL",detail:"successfully"},y=!(null!==(r=null==s?void 0:s.muteVideo)&&void 0!==r?r:null===(n=this.client)||void 0===n?void 0:n.config.muteVideo),b=!(null!==(i=null==s?void 0:s.muteAudio)&&void 0!==i?i:null===(o=this.client)||void 0===o?void 0:o.config.muteAudio),"denied"!==v&&0!==m.videoInList.length||(y=!1,w={type:"AUDIO_ONLY",detail:"Camera is not found or permission denied"}),"denied"!==g&&0!==m.audioInputList.length||(b=!1,w={type:"VIDEO_ONLY",detail:"Microphone is not found or permission denied"}),this.current=w,y||b){u.next=21;break}return u.next=20,this.dealWithoutStreams();case 20:return u.abrupt("return",u.sent);case 21:return k=this.getInitContraints(y,b,d,f),this.logger.log("init contraints:",k),u.prev=23,u.next=26,this.getStream(y,b,d,f);case 26:return u.abrupt("return",u.sent);case 29:if(u.prev=29,u.t0=u.catch(23),_=this.handleCreateStreamError(u.t0),S=_.code,!y||20405!==S&&20402!==S){u.next=46;break}return this.logger.log("Reduce resolution to get stream..."),u.prev=35,u.next=38,this.getStream(y,b,d,f,!0);case 38:return u.abrupt("return",u.sent);case 41:u.prev=41,u.t1=u.catch(35),_=this.handleCreateStreamError(u.t0),S=_.code,this.logger.log("Reduce resolution to get stream is error:",_);case 46:if(!Uf.includes(S)){u.next=80;break}if(this.logger.log("Init domstream successfully",{status:_,err:u.t0}),!y||!b||20403===S){u.next=75;break}return u.prev=49,this.logger.log("only video stream create..."),this.updatePermission(!0,!1),u.next=54,this.getStream(!0,!1,d,f);case 54:return u.abrupt("return",u.sent);case 57:u.prev=57,u.t2=u.catch(49),this.logger.log("get video stream failed:",u.t2);case 60:return u.prev=60,this.logger.log("only audio stream create..."),this.updatePermission(!1,!0),u.next=65,this.getStream(!1,!0,d,f);case 65:return u.abrupt("return",u.sent);case 68:u.prev=68,u.t3=u.catch(60),this.logger.log("get audio stream failed:",u.t3);case 71:return this.updatePermission(y,b),u.next=74,this.dealWithoutStreams();case 74:return u.abrupt("return",u.sent);case 75:return u.next=77,this.dealWithoutStreams();case 77:return u.abrupt("return",u.sent);case 80:return this.logger.warn("Init stream failed",{status:_,err:u.t0}),this.current={type:"FAILED",detail:_},u.abrupt("return",Promise.reject(El(30527,"Init stream failed",Object.assign({status:_},this.current))));case 83:case"end":return u.stop()}}),u,this,[[23,29],[35,41],[49,57],[60,68]])})))}},{key:"updatePermission",value:function(e,t){var r,n,i,o,a=null===(n=null===(r=this.client)||void 0===r?void 0:r.deviceManager)||void 0===n?void 0:n.getDevicePermission(),s=a.camera,u=a.microphone;null===(o=null===(i=this.client)||void 0===i?void 0:i.deviceManager)||void 0===o||o.setPermission({camera:e&&"unknow"===s?"denied":s,microphone:t&&"unknow"===u?"denied":u})}},{key:"getStream",value:function(e,t,r,n){var i,o,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return es(this,void 0,void 0,regeneratorRuntime.mark((function s(){var u,c,l,f,h;return regeneratorRuntime.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,u=this.getInitContraints(e,t,r,n,a),this.logger.log("init contraints:",u),s.next=5,this.getUserMedia(u);case 5:return c=s.sent,(null===(i=null==u?void 0:u.audio)||void 0===i?void 0:i.echoCancellation)&&c.getAudioTracks()[0].applyConstraints({echoCancellation:!0}),this.logger.log("base remote stream: ",c),s.next=10,this.initStreams(c);case 10:return this.streamStatus||this.close(),(null===(o=this.client)||void 0===o?void 0:o.deviceManager)&&(l=this.client.deviceManager.getDevicePermission(),f=l.camera,h=l.microphone,this.client.deviceManager.setPermission({camera:e?"granted":f,microphone:t?"granted":h})),this.emmit("local-stream",this.previewStreams),s.abrupt("return",El(50206,"Stream is created successfully"));case 16:return s.prev=16,s.t0=s.catch(0),s.abrupt("return",Promise.reject(s.t0));case 19:case"end":return s.stop()}}),s,this,[[0,16]])})))}},{key:"dealWithoutStreams",value:function(e){return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.current={type:"SEND_ONLY",detail:e||"采集流约束设置为空"},t.next=3,this.initStreams(null);case 3:return t.abrupt("return",El(50207,"DomStream is created successfully"));case 4:case"end":return t.stop()}}),t,this)})))}},{key:"getInitContraints",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a={};o&&(a={width:Qf,height:eh});var s=r.getContraints(e,t,a);if(i&&"default"!==i){var u={deviceId:{exact:i}};this.audioDeviceId=i,Object.assign(s.audio,u)}if(n){var c={deviceId:{exact:n}};this.videoDeviceId=n,Object.assign(s.video,c)}return this.logger.log("init remote constraints: ",s),s}},{key:"initStreams",value:function(e){return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.initPreviewStream(e);case 2:return t.next=4,this.initRemoteStreams(e);case 4:this.initPipelineStreams();case 5:case"end":return t.stop()}}),t,this)})))}},{key:"initPipelineStreams",value:function(){for(var e=[],t=this.streams.filter((function(t){var r,n;return"NORMAL"===t.status&&((null===(r=t.stream)||void 0===r?void 0:r.getAudioTracks()[0])||e.push({type:"audio"}),(null===(n=t.stream)||void 0===n?void 0:n.getVideoTracks()[0])||e.push({type:"video"})),"NORMAL"===t.status})).length,r=1;r<=9-t;r++)e.push({type:"all"});var n=0;this.pipelineStreams=e.map((function(e){n++;var t=[{kind:"video"},{kind:"audio"}];return"all"!==e.type&&(t=[{kind:e.type}]),{stream:null,domStream:t,status:"DOMSTRING",type:"pipelineStream",resolution:"90"}})),this.logger.log("temp stream count:",n)}},{key:"initRemoteStreams",value:function(e){var t,r,n,i;return es(this,void 0,void 0,regeneratorRuntime.mark((function o(){var a,s,u,c,l,f,h,d=this;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(!e){o.next=25;break}a=e.clone(),s=e.clone(),a.getAudioTracks().forEach((function(e){e.stop(),a.removeTrack(e)})),s.getAudioTracks().forEach((function(e){e.stop(),s.removeTrack(e)})),u={stream:null,domStream:[],status:"NORMAL",type:"remoteStream",resolution:"180"},this.streams=[Object.assign(Object.assign({},u),{stream:e}),Object.assign(Object.assign({},u),{stream:a,resolution:"360"}),Object.assign(Object.assign({},u),{stream:s,resolution:"720"})],c=ri(this.streams.entries()),o.prev=8,f=regeneratorRuntime.mark((function e(){var o,a,s,u,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=$n(l.value,2),a=o[0],s=o[1],!(u=null===(t=s.stream)||void 0===t?void 0:t.getVideoTracks()[0])){e.next=15;break}return e.prev=3,c=Wf[s.resolution].max,e.next=7,u.applyConstraints(c);case 7:d.logger.log("init remote track constranits:",c,null===(r=s.stream)||void 0===r?void 0:r.id),e.next=15;break;case 10:e.prev=10,e.t0=e.catch(3),d.logger.error("init remote track constranits failed:",e.t0,null===(n=s.stream)||void 0===n?void 0:n.id),d.streams[a].status="INVALID",null===(i=d.streams[a].stream)||void 0===i||i.getTracks().forEach((function(e){e.stop(),d.logger.log("disabled track",u.id)}));case 15:case"end":return e.stop()}}),e,null,[[3,10]])})),c.s();case 11:if((l=c.n()).done){o.next=15;break}return o.delegateYield(f(),"t0",13);case 13:o.next=11;break;case 15:o.next=20;break;case 17:o.prev=17,o.t1=o.catch(8),c.e(o.t1);case 20:return o.prev=20,c.f(),o.finish(20);case 23:o.next=28;break;case 25:h={stream:null,domStream:[{kind:"video"},{kind:"audio"}],status:"DOMSTRING",type:"remoteStream",resolution:"90"},this.streams=[Object.assign(Object.assign({},h),{resolution:"180"}),Object.assign(Object.assign({},h),{resolution:"360"}),Object.assign(Object.assign({},h),{resolution:"720"})],this.logger.log("None remote stream, init dom stream: ",this.streams);case 28:case"end":return o.stop()}}),o,this,[[8,17,20,23]])})))}},{key:"initPreviewStream",value:function(e){var t;return es(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!e){r.next=15;break}return r.prev=1,n={stream:e.clone(),domStream:[],status:"NORMAL",type:"previewStream",resolution:"360"},r.next=5,null===(t=n.stream.getVideoTracks()[0])||void 0===t?void 0:t.applyConstraints(Wf[360].max);case 5:n.stream.getAudioTracks().forEach((function(e){e.stop(),n.stream.removeTrack(e)})),this.logger.log("init local stream succeffully"),this.previewStreams=[n],r.next=13;break;case 10:r.prev=10,r.t0=r.catch(1),this.logger.error("init local constraints failed: ",r.t0);case 13:r.next=17;break;case 15:i={stream:null,domStream:[{kind:"video"}],status:"DOMSTRING",type:"previewStream",resolution:"360"},this.previewStreams=[i];case 17:case"end":return r.stop()}}),r,this,[[1,10]])})))}},{key:"setClientObj",value:function(e){this.client=e,this.updateDeviceByLocalStream()}},{key:"updateDeviceByLocalStream",value:function(){var e,t,r,n,i,o;if("NORMAL"===this.current.type||"AUDIO_ONLY"===this.current.type||"VIDEO_ONLY"===this.current.type){var a=null===(e=this.previewStreams[0].stream)||void 0===e?void 0:e.getAudioTracks()[0],s=null===(t=this.previewStreams[0].stream)||void 0===t?void 0:t.getVideoTracks()[0],u=null==a?void 0:a.getSettings(),c=null==s?void 0:s.getSettings(),l={audioInput:u?{deviceId:u.deviceId||"",groupId:u.groupId||"",label:(null==a?void 0:a.label)||""}:void 0,videoInput:c?{deviceId:c.deviceId||"",groupId:c.groupId||"",label:(null==s?void 0:s.label)||""}:void 0,audioOutput:{deviceId:(null===(n=null===(r=this.config)||void 0===r?void 0:r.devices)||void 0===n?void 0:n.audioOutputValue)||"default",groupId:"",label:""}};this.logger.log("Cache preview stream device info by tracks: ",l),null===(o=null===(i=this.client)||void 0===i?void 0:i.deviceManager)||void 0===o||o.setCurrentUsedDevice(l)}}},{key:"getAudioLevel",value:function(e){var t=this;return new Promise((function(r,n){var i;if(e?i=e:t.streams.length&&(i=t.streams[0].stream),i&&!t.audioLevel)t.audioLevel=new mb(i),t.audioLevel.init(),r(t.audioLevel.getAudioLevel());else if(t.audioLevel){r(t.audioLevel.getAudioLevel())}else if(t.client){var o="GetAudio level must need have local stream!";t.client.logger.warn(o),n(El(20530,o))}}))}},{key:"clearAudioLevel",value:function(){this.audioLevel=null}},{key:"closeContentStream",value:function(){var e=this;if(this.isShareContent){this.streamStatus=!1;this.off("start-share-content"),this.off("stop-share-content"),this.contentStreams.forEach((function(t,r){var n;null===(n=t.stream)||void 0===n||n.getTracks().forEach((function(t){t.stop(),t.onended=null,e.contentStreams[r].stream.removeTrack(t)})),e.contentStreams[r].status="INVALID"})),this.isShareContent=!1,this.logger.log("content stream closed successfully")}}},{key:"createContentStream",value:function(){return es(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isShareContent){e.next=3;break}return this.logger.warn("Already share content!"),e.abrupt("return",Promise.reject(El(20508,"已经在分享屏幕")));case 3:return this.createBaseContentStreams(),e.prev=4,t={video:Vf[1080].max,audio:!1},e.next=8,navigator.mediaDevices.getDisplayMedia(t);case 8:return r=e.sent,e.next=11,this.dealCaptureStream(r);case 11:return e.abrupt("return",this.contentStreams);case 14:return e.prev=14,e.t0=e.catch(4),this.logger.error("capture content stream failed: ",e.t0),this.isShareContent=!1,e.abrupt("return",Promise.reject(this.handleCreateContentStreamError(e.t0)));case 19:case"end":return e.stop()}}),e,this,[[4,14]])})))}},{key:"electronCapture",value:function(e){var t=this;return new Promise((function(r,n){navigator.webkitGetUserMedia({audio:!1,video:{mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:e,minWidth:1920,maxWidth:1920,minHeight:1080,maxHeight:1080}}},(function(e){r(e)}),(function(e){t.logger.log("capture electron err: ",e),n(e)}))}))}},{key:"getElectronContentSources",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["window","screen"];return es(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,e.getSources({types:t});case 3:return n=r.sent,r.abrupt("return",n);case 7:return r.prev=7,r.t0=r.catch(0),r.abrupt("return",r.t0);case 10:case"end":return r.stop()}}),r,null,[[0,7]])})))}},{key:"createElectronContentStream",value:function(e){return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.isShareContent){t.next=3;break}return this.logger.warn("Already share content!"),t.abrupt("return",Promise.reject(El(20508,"已经在分享屏幕")));case 3:if(e){t.next=6;break}return this.logger.warn("No selected sourceId!"),t.abrupt("return",Promise.reject(El(20509,"没有selectedSourceId")));case 6:return this.createBaseContentStreams(),t.prev=7,t.next=10,this.electronCapture(e);case 10:return r=t.sent,t.next=13,this.dealCaptureStream(r);case 13:return t.abrupt("return",this.contentStreams);case 16:return t.prev=16,t.t0=t.catch(7),this.logger.error("capture electron content stream failed: ",t.t0),this.isShareContent=!1,t.abrupt("return",this.handleCreateContentStreamError(t.t0));case 21:case"end":return t.stop()}}),t,this,[[7,16]])})))}},{key:"getPreviewStream",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{video:{},audio:{}};return es(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,s,u,c,l;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,i=r.video,o=void 0===i?{}:i,a=r.audio,s=void 0===a?{}:a,u={},e&&(u.video=Object.assign({},zf,o)),t&&(u.audio=Object.assign({},s)),this.logger.log("get preview stream constraints",u),n.next=8,this.getUserMedia(u);case 8:return c=n.sent,n.abrupt("return",c);case 12:return n.prev=12,n.t0=n.catch(0),l=this.handleCreateStreamError(n.t0),n.abrupt("return",Promise.reject(l));case 16:case"end":return n.stop()}}),n,this,[[0,12]])})))}},{key:"getUserMedia",value:function(e){return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,navigator.mediaDevices.getUserMedia(e);case 3:return t.abrupt("return",t.sent);case 6:return t.prev=6,t.t0=t.catch(0),t.abrupt("return",Promise.reject(t.t0));case 9:case"end":return t.stop()}}),t,null,[[0,6]])})))}},{key:"handleCloseShareContentEvent",value:function(e,t){var r=this,n=!1,i=!1;e.onended=function(){(n=!0)&&i&&r.emmit("stop-share-content",{})},t.onended=function(){i=!0,n&&i&&r.emmit("stop-share-content",{})}}},{key:"dealCaptureStream",value:function(e){return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.getVideoTracks()[0],n=r.clone(),i=Vf[720].max,t.prev=3,t.next=6,n.applyConstraints(i);case 6:t.next=12;break;case 8:t.prev=8,t.t0=t.catch(3),this.streams[1].status="INVALID",this.logger.error("set 720p content stream conts error: ",t.t0);case 12:this.handleCloseShareContentEvent(r,n),this.updateContentStreamTrack(r,n),this.client&&this.client.applyShareContent(),this.logger.log("create share content stream: ",this.contentStreams);case 16:case"end":return t.stop()}}),t,this,[[3,8]])})))}},{key:"createBaseContentStreams",value:function(){if(this.isShareContent=!0,!this.contentStreams.length){var e=new MediaStream,t=new MediaStream;this.contentStreams=[{type:"contentStream",stream:e,domStream:[],status:"NORMAL",resolution:"1080"},{type:"contentStream",stream:t,domStream:[],status:"NORMAL",resolution:"720"}]}}},{key:"updateContentStreamTrack",value:function(e,t){this.contentStreams=this.contentStreams.map((function(r){return"1080"===r.resolution?r.stream.addTrack(e):r.stream.addTrack(t),Object.assign(Object.assign({},r),{isSupport:!0})}))}},{key:"handleCreateContentStreamError",value:function(e){var t=e.name,r=e.message;return"NotAllowedError"===t?"Permission denied by system"===r?El(20507,"用户已拒绝授权采集屏幕操作",e):"Permission denied"===r?El(20500,"用户取消采集屏幕操作",e):El(20510,"用户已拒绝授权或取消采集屏幕操作",e):"InvalidStateError"===t?El(20501,"操作异常采集屏幕失败",e):"AbortError"===t?El(20502,"采集屏幕失败",e):"NotFoundError"===t?El(20503,"没有屏幕视频源可用于捕获",e):"NotReadableError"===t?El(20504,"硬件或操作系统错误或锁定,阻止了采集屏幕共享",e):"OverconstrainedError"===t?El(20505,"采集屏幕-约束设置失败",e):"TypeError"===t?El(20506,"采集屏幕-指定了不允许的约束设置",e):El(20502,"采集屏幕失败",e)}},{key:"handleCreateStreamError",value:function(e){var t={code:0,msg:"",detail:""};return t="NotFoundError"==e.name||"DevicesNotFoundError"==e.name?El(20400,"缺失摄像头或麦克风设备",e):"NotReadableError"==e.name||"TrackStartError"==e.name?El(20401,"摄像头或麦克风设备无法访问",e):"OverconstrainedError"==e.name||"ConstraintNotSatisfiedError"==e.name?El(20402,"约束设置无法被满足",e):"NotAllowedError"==e.name||"PermissionDeniedError"==e.name||e.message.includes("NotAllowedError")?El(20403,"麦克风或摄像头使用权限被拒绝",e):"TypeError"==e.name||"TypeError"==e.name?El(20404,"采集流约束设置为空",e):El(20405,"创建媒体流失败",e),this.logger.error(t),t}}],[{key:"getStreamInstance",value:function(e){return this.instance||(this.instance=new r(e)),this.instance}},{key:"getContraints",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=r.getSupportConstraints(),o={},a={},s={audio:o,video:a},u=n.channelCount,c=void 0===u?1:u,l=n.autoGainControl,f=void 0===l||l,h=n.noiseSuppression,d=void 0===h||h,p=n.echoCancellation,v=void 0===p||p,g=n.frameRate,m=void 0===g?zf.frameRate:g,y=n.aspectRatio,b=void 0===y?zf.aspectRatio:y,w=n.resizeMode,k=void 0===w?zf.resizeMode:w,_=n.width,S=void 0===_?1280:_,x=n.height,E=void 0===x?720:x,O={channelCount:c,autoGainControl:f,noiseSuppression:d,echoCancellation:v},A={frameRate:m,aspectRatio:b,resizeMode:k,width:S,height:E};return Object.keys(O).forEach((function(e){o[e]=O[e]})),Object.keys(A).forEach((function(e){i[e]&&(a[e]=A[e])})),s.audio=!!t&&o,s.video=!!e&&a,s}},{key:"getSupportConstraints",value:function(){var e={channelCount:!0,frameRate:!0,aspectRatio:!0,width:!0,height:!0};return navigator&&navigator.mediaDevices&&navigator.mediaDevices.getSupportedConstraints&&(e=navigator.mediaDevices.getSupportedConstraints()),e}}]),r}(),bb="*********************************************************",wb={version:Xd,client:null,checkSupportWebRTC:function(){var e=Hn.isSupportRTC(),t=Hn.isSupportWebsocket(),r=Hn.isMinBrowser(),n=e&&t&&r;return wb.logger.debug("support result: ",{isSupportRTC:e,isSupportWebsocket:t,isMinBrowser:r}),n},checkSupportShareContent:function(){return!(!navigator.mediaDevices||!navigator.mediaDevices.getDisplayMedia)},logger:new up,createClient:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=wb.logger,r=$d,n=Qd,i=ep,o={wssServer:r,httpServer:n,logServer:i,layout:"AUTO",debug:!1,muteAudio:!1,muteVideo:!1,localHide:!1,localMirror:!0,isThird:!0},a=e.container||{},s=Object.assign(Object.assign(Object.assign({},o),e),{container:a}),u=s.wssServer,c=s.httpServer,l=s.logServer,f=s.clientId,h=void 0===f?"":f;sp.setBaseUrl(c,l),sp.setClientId(h);var d=new ng(s,{wssServer:u,httpServer:c,logServer:l},t);return wb.client=d,d},createStream:function(){var e=wb.logger;return new yb({logger:e,client:wb.client})},setConfig:function(e){sp.setLoginInfo(e),sp.setClientId(e.client_id)},closePreviewStream:function(e){return es(void 0,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e&&e.getTracks().forEach((function(e){e.enabled=!1,e.stop()}));case 1:case"end":return t.stop()}}),t)})))},setOutputAudioDevice:function(e,t){e&&void 0!==e.sinkId?e.setSinkId(t).then((function(){})).catch((function(e){var t=e;"SecurityError"===e.name&&(t="You need to use HTTPS for selecting audio output device: ".concat(e)),console.error(t)})):console.warn("Browser does not support output device selection.")},render:(console.group("小鱼易连 WebRTC SDK"),console.info("%c".concat(bb," \n\t\n * 欢迎使用 XY RTC SDK - 小鱼易连Web云视频 \n\t\n * 版本:").concat(Xd," \n\t\n * 文档地址:http://openapi.xylink.com/doc_web/product/description/ \n\t\n * 体验地址:https://cdn.xylink.com/webrtc/web/index.html \n\t\n * 问题反馈:https://github.com/xylink-com/xylink-rtc-demo/issues \n\t\n * 联系方式:luojinghui(luojinghui424@gmail.com) \n\n").concat(bb),"color: #3876ff;"),console.info("%c[INFO] XY Agent:"+navigator.userAgent+"\n","color: #3876ff;"),void console.groupEnd())};window.xyRTC=wb;export{ng as Client,Ev as DeviceManager,yb as Stream,wb as default,qv as getLayoutItemState,Zv as getLayoutRotateInfo,Yv as getVideoInfoByRotaion};