@livedigital/client 3.54.3-LK-5826-brands-err.1 → 3.54.3-enable-sourcemaps.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -36,3 +36,4 @@ and limitations under the License.
36
36
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
37
37
  */
38
38
  M_=U_,N_=U_.exports,function(){var e,t="Expected a function",r="__lodash_hash_undefined__",n="__lodash_placeholder__",i=16,s=32,o=64,a=128,c=256,d=1/0,u=9007199254740991,p=NaN,h=4294967295,f=[["ary",a],["bind",1],["bindKey",2],["curry",8],["curryRight",i],["flip",512],["partial",s],["partialRight",o],["rearg",c]],m="[object Arguments]",g="[object Array]",v="[object Boolean]",y="[object Date]",_="[object Error]",b="[object Function]",E="[object GeneratorFunction]",w="[object Map]",S="[object Number]",C="[object Object]",P="[object Promise]",T="[object RegExp]",R="[object Set]",k="[object String]",D="[object Symbol]",I="[object WeakMap]",A="[object ArrayBuffer]",O="[object DataView]",M="[object Float32Array]",N="[object Float64Array]",L="[object Int8Array]",x="[object Int16Array]",F="[object Int32Array]",j="[object Uint8Array]",U="[object Uint8ClampedArray]",V="[object Uint16Array]",B="[object Uint32Array]",W=/\b__p \+= '';/g,H=/\b(__p \+=) '' \+/g,q=/(__e\(.*?\)|\b__t\)) \+\n'';/g,z=/&(?:amp|lt|gt|quot|#39);/g,G=/[&<>"']/g,Y=RegExp(z.source),$=RegExp(G.source),J=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,K=/<%=([\s\S]+?)%>/g,Z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,X=/^\w*$/,ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,te=/[\\^$.*+?()[\]{}|]/g,re=RegExp(te.source),ne=/^\s+/,ie=/\s/,se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,oe=/\{\n\/\* \[wrapped with (.+)\] \*/,ae=/,? & /,ce=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,de=/[()=,{}\[\]\/\s]/,ue=/\\(\\)?/g,le=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pe=/\w*$/,he=/^[-+]0x[0-9a-f]+$/i,fe=/^0b[01]+$/i,me=/^\[object .+?Constructor\]$/,ge=/^0o[0-7]+$/i,ve=/^(?:0|[1-9]\d*)$/,ye=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_e=/($^)/,be=/['\n\r\u2028\u2029\\]/g,Ee="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",we="\\u2700-\\u27bf",Se="a-z\\xdf-\\xf6\\xf8-\\xff",Ce="A-Z\\xc0-\\xd6\\xd8-\\xde",Pe="\\ufe0e\\ufe0f",Te="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Re="['’]",ke="[\\ud800-\\udfff]",De="["+Te+"]",Ie="["+Ee+"]",Ae="\\d+",Oe="[\\u2700-\\u27bf]",Me="["+Se+"]",Ne="[^\\ud800-\\udfff"+Te+Ae+we+Se+Ce+"]",Le="\\ud83c[\\udffb-\\udfff]",xe="[^\\ud800-\\udfff]",Fe="(?:\\ud83c[\\udde6-\\uddff]){2}",je="[\\ud800-\\udbff][\\udc00-\\udfff]",Ue="["+Ce+"]",Ve="(?:"+Me+"|"+Ne+")",Be="(?:"+Ue+"|"+Ne+")",We="(?:['’](?:d|ll|m|re|s|t|ve))?",He="(?:['’](?:D|LL|M|RE|S|T|VE))?",qe="(?:"+Ie+"|"+Le+")?",ze="[\\ufe0e\\ufe0f]?",Ge=ze+qe+"(?:\\u200d(?:"+[xe,Fe,je].join("|")+")"+ze+qe+")*",Ye="(?:"+[Oe,Fe,je].join("|")+")"+Ge,$e="(?:"+[xe+Ie+"?",Ie,Fe,je,ke].join("|")+")",Je=RegExp(Re,"g"),Qe=RegExp(Ie,"g"),Ke=RegExp(Le+"(?="+Le+")|"+$e+Ge,"g"),Ze=RegExp([Ue+"?"+Me+"+"+We+"(?="+[De,Ue,"$"].join("|")+")",Be+"+"+He+"(?="+[De,Ue+Ve,"$"].join("|")+")",Ue+"?"+Ve+"+"+We,Ue+"+"+He,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ae,Ye].join("|"),"g"),Xe=RegExp("[\\u200d\\ud800-\\udfff"+Ee+Pe+"]"),et=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,tt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],rt=-1,nt={};nt[M]=nt[N]=nt[L]=nt[x]=nt[F]=nt[j]=nt[U]=nt[V]=nt[B]=!0,nt[m]=nt[g]=nt[A]=nt[v]=nt[O]=nt[y]=nt[_]=nt[b]=nt[w]=nt[S]=nt[C]=nt[T]=nt[R]=nt[k]=nt[I]=!1;var it={};it[m]=it[g]=it[A]=it[O]=it[v]=it[y]=it[M]=it[N]=it[L]=it[x]=it[F]=it[w]=it[S]=it[C]=it[T]=it[R]=it[k]=it[D]=it[j]=it[U]=it[V]=it[B]=!0,it[_]=it[b]=it[I]=!1;var st={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ot=parseFloat,at=parseInt,ct="object"==typeof l&&l&&l.Object===Object&&l,dt="object"==typeof self&&self&&self.Object===Object&&self,ut=ct||dt||Function("return this")(),lt=N_&&!N_.nodeType&&N_,pt=lt&&M_&&!M_.nodeType&&M_,ht=pt&&pt.exports===lt,ft=ht&&ct.process,mt=function(){try{var e=pt&&pt.require&&pt.require("util").types;return e||ft&&ft.binding&&ft.binding("util")}catch(e){}}(),gt=mt&&mt.isArrayBuffer,vt=mt&&mt.isDate,yt=mt&&mt.isMap,_t=mt&&mt.isRegExp,bt=mt&&mt.isSet,Et=mt&&mt.isTypedArray;function wt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function St(e,t,r,n){for(var i=-1,s=null==e?0:e.length;++i<s;){var o=e[i];t(n,o,r(o),e)}return n}function Ct(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function Pt(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function Tt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function Rt(e,t){for(var r=-1,n=null==e?0:e.length,i=0,s=[];++r<n;){var o=e[r];t(o,r,e)&&(s[i++]=o)}return s}function kt(e,t){return!(null==e||!e.length)&&jt(e,t,0)>-1}function Dt(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function It(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function At(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function Ot(e,t,r,n){var i=-1,s=null==e?0:e.length;for(n&&s&&(r=e[++i]);++i<s;)r=t(r,e[i],i,e);return r}function Mt(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function Nt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var Lt=Wt("length");function xt(e,t,r){var n;return r(e,(function(e,r,i){if(t(e,r,i))return n=r,!1})),n}function Ft(e,t,r,n){for(var i=e.length,s=r+(n?1:-1);n?s--:++s<i;)if(t(e[s],s,e))return s;return-1}function jt(e,t,r){return t==t?function(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):Ft(e,Vt,r)}function Ut(e,t,r,n){for(var i=r-1,s=e.length;++i<s;)if(n(e[i],t))return i;return-1}function Vt(e){return e!=e}function Bt(e,t){var r=null==e?0:e.length;return r?zt(e,t)/r:p}function Wt(t){return function(r){return null==r?e:r[t]}}function Ht(t){return function(r){return null==t?e:t[r]}}function qt(e,t,r,n,i){return i(e,(function(e,i,s){r=n?(n=!1,e):t(r,e,i,s)})),r}function zt(t,r){for(var n,i=-1,s=t.length;++i<s;){var o=r(t[i]);o!==e&&(n=n===e?o:n+o)}return n}function Gt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Yt(e){return e?e.slice(0,lr(e)+1).replace(ne,""):e}function $t(e){return function(t){return e(t)}}function Jt(e,t){return It(t,(function(t){return e[t]}))}function Qt(e,t){return e.has(t)}function Kt(e,t){for(var r=-1,n=e.length;++r<n&&jt(t,e[r],0)>-1;);return r}function Zt(e,t){for(var r=e.length;r--&&jt(t,e[r],0)>-1;);return r}function Xt(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}var er=Ht({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),tr=Ht({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function rr(e){return"\\"+st[e]}function nr(e){return Xe.test(e)}function ir(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function sr(e,t){return function(r){return e(t(r))}}function or(e,t){for(var r=-1,i=e.length,s=0,o=[];++r<i;){var a=e[r];a!==t&&a!==n||(e[r]=n,o[s++]=r)}return o}function ar(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function cr(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}function dr(e){return nr(e)?function(e){for(var t=Ke.lastIndex=0;Ke.test(e);)++t;return t}(e):Lt(e)}function ur(e){return nr(e)?function(e){return e.match(Ke)||[]}(e):function(e){return e.split("")}(e)}function lr(e){for(var t=e.length;t--&&ie.test(e.charAt(t)););return t}var pr=Ht({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"}),hr=function l(ie){var Ee,we=(ie=null==ie?ut:hr.defaults(ut.Object(),ie,hr.pick(ut,tt))).Array,Se=ie.Date,Ce=ie.Error,Pe=ie.Function,Te=ie.Math,Re=ie.Object,ke=ie.RegExp,De=ie.String,Ie=ie.TypeError,Ae=we.prototype,Oe=Pe.prototype,Me=Re.prototype,Ne=ie["__core-js_shared__"],Le=Oe.toString,xe=Me.hasOwnProperty,Fe=0,je=(Ee=/[^.]+$/.exec(Ne&&Ne.keys&&Ne.keys.IE_PROTO||""))?"Symbol(src)_1."+Ee:"",Ue=Me.toString,Ve=Le.call(Re),Be=ut._,We=ke("^"+Le.call(xe).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),He=ht?ie.Buffer:e,qe=ie.Symbol,ze=ie.Uint8Array,Ge=He?He.allocUnsafe:e,Ye=sr(Re.getPrototypeOf,Re),$e=Re.create,Ke=Me.propertyIsEnumerable,Xe=Ae.splice,st=qe?qe.isConcatSpreadable:e,ct=qe?qe.iterator:e,dt=qe?qe.toStringTag:e,lt=function(){try{var e=hs(Re,"defineProperty");return e({},"",{}),e}catch(e){}}(),pt=ie.clearTimeout!==ut.clearTimeout&&ie.clearTimeout,ft=Se&&Se.now!==ut.Date.now&&Se.now,mt=ie.setTimeout!==ut.setTimeout&&ie.setTimeout,Lt=Te.ceil,Ht=Te.floor,fr=Re.getOwnPropertySymbols,mr=He?He.isBuffer:e,gr=ie.isFinite,vr=Ae.join,yr=sr(Re.keys,Re),_r=Te.max,br=Te.min,Er=Se.now,wr=ie.parseInt,Sr=Te.random,Cr=Ae.reverse,Pr=hs(ie,"DataView"),Tr=hs(ie,"Map"),Rr=hs(ie,"Promise"),kr=hs(ie,"Set"),Dr=hs(ie,"WeakMap"),Ir=hs(Re,"create"),Ar=Dr&&new Dr,Or={},Mr=Vs(Pr),Nr=Vs(Tr),Lr=Vs(Rr),xr=Vs(kr),Fr=Vs(Dr),jr=qe?qe.prototype:e,Ur=jr?jr.valueOf:e,Vr=jr?jr.toString:e;function Br(e){if(ia(e)&&!Yo(e)&&!(e instanceof zr)){if(e instanceof qr)return e;if(xe.call(e,"__wrapped__"))return Bs(e)}return new qr(e)}var Wr=function(){function t(){}return function(r){if(!na(r))return{};if($e)return $e(r);t.prototype=r;var n=new t;return t.prototype=e,n}}();function Hr(){}function qr(t,r){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!r,this.__index__=0,this.__values__=e}function zr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}function Gr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Yr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function $r(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Jr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new $r;++t<r;)this.add(e[t])}function Qr(e){var t=this.__data__=new Yr(e);this.size=t.size}function Kr(e,t){var r=Yo(e),n=!r&&Go(e),i=!r&&!n&&Ko(e),s=!r&&!n&&!i&&pa(e),o=r||n||i||s,a=o?Gt(e.length,De):[],c=a.length;for(var d in e)!t&&!xe.call(e,d)||o&&("length"==d||i&&("offset"==d||"parent"==d)||s&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||bs(d,c))||a.push(d);return a}function Zr(t){var r=t.length;return r?t[Qn(0,r-1)]:e}function Xr(e,t){return Fs(Ai(e),dn(t,0,e.length))}function en(e){return Fs(Ai(e))}function tn(t,r,n){(n!==e&&!Ho(t[r],n)||n===e&&!(r in t))&&an(t,r,n)}function rn(t,r,n){var i=t[r];xe.call(t,r)&&Ho(i,n)&&(n!==e||r in t)||an(t,r,n)}function nn(e,t){for(var r=e.length;r--;)if(Ho(e[r][0],t))return r;return-1}function sn(e,t,r,n){return fn(e,(function(e,i,s){t(n,e,r(e),s)})),n}function on(e,t){return e&&Oi(t,Na(t),e)}function an(e,t,r){"__proto__"==t&&lt?lt(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function cn(t,r){for(var n=-1,i=r.length,s=we(i),o=null==t;++n<i;)s[n]=o?e:Da(t,r[n]);return s}function dn(t,r,n){return t==t&&(n!==e&&(t=t<=n?t:n),r!==e&&(t=t>=r?t:r)),t}function un(t,r,n,i,s,o){var a,c=1&r,d=2&r,u=4&r;if(n&&(a=s?n(t,i,s,o):n(t)),a!==e)return a;if(!na(t))return t;var l=Yo(t);if(l){if(a=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&xe.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(t),!c)return Ai(t,a)}else{var p=gs(t),h=p==b||p==E;if(Ko(t))return Pi(t,c);if(p==C||p==m||h&&!s){if(a=d||h?{}:ys(t),!c)return d?function(e,t){return Oi(e,ms(e),t)}(t,function(e,t){return e&&Oi(t,La(t),e)}(a,t)):function(e,t){return Oi(e,fs(e),t)}(t,on(a,t))}else{if(!it[p])return s?t:{};a=function(e,t,r){var n=e.constructor;switch(t){case A:return Ti(e);case v:case y:return new n(+e);case O:return function(e,t){var r=t?Ti(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case M:case N:case L:case x:case F:case j:case U:case V:case B:return Ri(e,r);case w:case R:return new n;case S:case k:return new n(e);case T:return function(e){var t=new e.constructor(e.source,pe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case D:return function(e){return Ur?Re(Ur.call(e)):{}}(e)}}(t,p,c)}}o||(o=new Qr);var f=o.get(t);if(f)return f;o.set(t,a),da(t)?t.forEach((function(e){a.add(un(e,r,n,e,t,o))})):sa(t)&&t.forEach((function(e,i){a.set(i,un(e,r,n,i,t,o))}));var g=l?e:(u?d?os:ss:d?La:Na)(t);return Ct(g||t,(function(e,i){g&&(e=t[i=e]),rn(a,i,un(e,r,n,i,t,o))})),a}function ln(t,r,n){var i=n.length;if(null==t)return!i;for(t=Re(t);i--;){var s=n[i],o=r[s],a=t[s];if(a===e&&!(s in t)||!o(a))return!1}return!0}function pn(r,n,i){if("function"!=typeof r)throw new Ie(t);return Ms((function(){r.apply(e,i)}),n)}function hn(e,t,r,n){var i=-1,s=kt,o=!0,a=e.length,c=[],d=t.length;if(!a)return c;r&&(t=It(t,$t(r))),n?(s=Dt,o=!1):t.length>=200&&(s=Qt,o=!1,t=new Jr(t));e:for(;++i<a;){var u=e[i],l=null==r?u:r(u);if(u=n||0!==u?u:0,o&&l==l){for(var p=d;p--;)if(t[p]===l)continue e;c.push(u)}else s(t,l,n)||c.push(u)}return c}Br.templateSettings={escape:J,evaluate:Q,interpolate:K,variable:"",imports:{_:Br}},Br.prototype=Hr.prototype,Br.prototype.constructor=Br,qr.prototype=Wr(Hr.prototype),qr.prototype.constructor=qr,zr.prototype=Wr(Hr.prototype),zr.prototype.constructor=zr,Gr.prototype.clear=function(){this.__data__=Ir?Ir(null):{},this.size=0},Gr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Gr.prototype.get=function(t){var n=this.__data__;if(Ir){var i=n[t];return i===r?e:i}return xe.call(n,t)?n[t]:e},Gr.prototype.has=function(t){var r=this.__data__;return Ir?r[t]!==e:xe.call(r,t)},Gr.prototype.set=function(t,n){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=Ir&&n===e?r:n,this},Yr.prototype.clear=function(){this.__data__=[],this.size=0},Yr.prototype.delete=function(e){var t=this.__data__,r=nn(t,e);return!(r<0||(r==t.length-1?t.pop():Xe.call(t,r,1),--this.size,0))},Yr.prototype.get=function(t){var r=this.__data__,n=nn(r,t);return n<0?e:r[n][1]},Yr.prototype.has=function(e){return nn(this.__data__,e)>-1},Yr.prototype.set=function(e,t){var r=this.__data__,n=nn(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},$r.prototype.clear=function(){this.size=0,this.__data__={hash:new Gr,map:new(Tr||Yr),string:new Gr}},$r.prototype.delete=function(e){var t=ls(this,e).delete(e);return this.size-=t?1:0,t},$r.prototype.get=function(e){return ls(this,e).get(e)},$r.prototype.has=function(e){return ls(this,e).has(e)},$r.prototype.set=function(e,t){var r=ls(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Jr.prototype.add=Jr.prototype.push=function(e){return this.__data__.set(e,r),this},Jr.prototype.has=function(e){return this.__data__.has(e)},Qr.prototype.clear=function(){this.__data__=new Yr,this.size=0},Qr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Qr.prototype.get=function(e){return this.__data__.get(e)},Qr.prototype.has=function(e){return this.__data__.has(e)},Qr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Yr){var n=r.__data__;if(!Tr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new $r(n)}return r.set(e,t),this.size=r.size,this};var fn=Li(wn),mn=Li(Sn,!0);function gn(e,t){var r=!0;return fn(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function vn(t,r,n){for(var i=-1,s=t.length;++i<s;){var o=t[i],a=r(o);if(null!=a&&(c===e?a==a&&!la(a):n(a,c)))var c=a,d=o}return d}function yn(e,t){var r=[];return fn(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function _n(e,t,r,n,i){var s=-1,o=e.length;for(r||(r=_s),i||(i=[]);++s<o;){var a=e[s];t>0&&r(a)?t>1?_n(a,t-1,r,n,i):At(i,a):n||(i[i.length]=a)}return i}var bn=xi(),En=xi(!0);function wn(e,t){return e&&bn(e,t,Na)}function Sn(e,t){return e&&En(e,t,Na)}function Cn(e,t){return Rt(t,(function(t){return ea(e[t])}))}function Pn(t,r){for(var n=0,i=(r=Ei(r,t)).length;null!=t&&n<i;)t=t[Us(r[n++])];return n&&n==i?t:e}function Tn(e,t,r){var n=t(e);return Yo(e)?n:At(n,r(e))}function Rn(t){return null==t?t===e?"[object Undefined]":"[object Null]":dt&&dt in Re(t)?function(t){var r=xe.call(t,dt),n=t[dt];try{t[dt]=e;var i=!0}catch(e){}var s=Ue.call(t);return i&&(r?t[dt]=n:delete t[dt]),s}(t):function(e){return Ue.call(e)}(t)}function kn(e,t){return e>t}function Dn(e,t){return null!=e&&xe.call(e,t)}function In(e,t){return null!=e&&t in Re(e)}function An(t,r,n){for(var i=n?Dt:kt,s=t[0].length,o=t.length,a=o,c=we(o),d=1/0,u=[];a--;){var l=t[a];a&&r&&(l=It(l,$t(r))),d=br(l.length,d),c[a]=!n&&(r||s>=120&&l.length>=120)?new Jr(a&&l):e}l=t[0];var p=-1,h=c[0];e:for(;++p<s&&u.length<d;){var f=l[p],m=r?r(f):f;if(f=n||0!==f?f:0,!(h?Qt(h,m):i(u,m,n))){for(a=o;--a;){var g=c[a];if(!(g?Qt(g,m):i(t[a],m,n)))continue e}h&&h.push(m),u.push(f)}}return u}function On(t,r,n){var i=null==(t=Ds(t,r=Ei(r,t)))?t:t[Us(Zs(r))];return null==i?e:wt(i,t,n)}function Mn(e){return ia(e)&&Rn(e)==m}function Nn(t,r,n,i,s){return t===r||(null==t||null==r||!ia(t)&&!ia(r)?t!=t&&r!=r:function(t,r,n,i,s,o){var a=Yo(t),c=Yo(r),d=a?g:gs(t),u=c?g:gs(r),l=(d=d==m?C:d)==C,p=(u=u==m?C:u)==C,h=d==u;if(h&&Ko(t)){if(!Ko(r))return!1;a=!0,l=!1}if(h&&!l)return o||(o=new Qr),a||pa(t)?ns(t,r,n,i,s,o):function(e,t,r,n,i,s,o){switch(r){case O:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case A:return!(e.byteLength!=t.byteLength||!s(new ze(e),new ze(t)));case v:case y:case S:return Ho(+e,+t);case _:return e.name==t.name&&e.message==t.message;case T:case k:return e==t+"";case w:var a=ir;case R:var c=1&n;if(a||(a=ar),e.size!=t.size&&!c)return!1;var d=o.get(e);if(d)return d==t;n|=2,o.set(e,t);var u=ns(a(e),a(t),n,i,s,o);return o.delete(e),u;case D:if(Ur)return Ur.call(e)==Ur.call(t)}return!1}(t,r,d,n,i,s,o);if(!(1&n)){var f=l&&xe.call(t,"__wrapped__"),b=p&&xe.call(r,"__wrapped__");if(f||b){var E=f?t.value():t,P=b?r.value():r;return o||(o=new Qr),s(E,P,n,i,o)}}return!!h&&(o||(o=new Qr),function(t,r,n,i,s,o){var a=1&n,c=ss(t),d=c.length,u=ss(r).length;if(d!=u&&!a)return!1;for(var l=d;l--;){var p=c[l];if(!(a?p in r:xe.call(r,p)))return!1}var h=o.get(t),f=o.get(r);if(h&&f)return h==r&&f==t;var m=!0;o.set(t,r),o.set(r,t);for(var g=a;++l<d;){var v=t[p=c[l]],y=r[p];if(i)var _=a?i(y,v,p,r,t,o):i(v,y,p,t,r,o);if(!(_===e?v===y||s(v,y,n,i,o):_)){m=!1;break}g||(g="constructor"==p)}if(m&&!g){var b=t.constructor,E=r.constructor;b==E||!("constructor"in t)||!("constructor"in r)||"function"==typeof b&&b instanceof b&&"function"==typeof E&&E instanceof E||(m=!1)}return o.delete(t),o.delete(r),m}(t,r,n,i,s,o))}(t,r,n,i,Nn,s))}function Ln(t,r,n,i){var s=n.length,o=s,a=!i;if(null==t)return!o;for(t=Re(t);s--;){var c=n[s];if(a&&c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++s<o;){var d=(c=n[s])[0],u=t[d],l=c[1];if(a&&c[2]){if(u===e&&!(d in t))return!1}else{var p=new Qr;if(i)var h=i(u,l,d,t,r,p);if(!(h===e?Nn(l,u,3,i,p):h))return!1}}return!0}function xn(e){return!(!na(e)||(t=e,je&&je in t))&&(ea(e)?We:me).test(Vs(e));var t}function Fn(e){return"function"==typeof e?e:null==e?oc:"object"==typeof e?Yo(e)?Hn(e[0],e[1]):Wn(e):mc(e)}function jn(e){if(!Ps(e))return yr(e);var t=[];for(var r in Re(e))xe.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Un(e){if(!na(e))return function(e){var t=[];if(null!=e)for(var r in Re(e))t.push(r);return t}(e);var t=Ps(e),r=[];for(var n in e)("constructor"!=n||!t&&xe.call(e,n))&&r.push(n);return r}function Vn(e,t){return e<t}function Bn(e,t){var r=-1,n=Jo(e)?we(e.length):[];return fn(e,(function(e,i,s){n[++r]=t(e,i,s)})),n}function Wn(e){var t=ps(e);return 1==t.length&&t[0][2]?Rs(t[0][0],t[0][1]):function(r){return r===e||Ln(r,e,t)}}function Hn(t,r){return ws(t)&&Ts(r)?Rs(Us(t),r):function(n){var i=Da(n,t);return i===e&&i===r?Ia(n,t):Nn(r,i,3)}}function qn(t,r,n,i,s){t!==r&&bn(r,(function(o,a){if(s||(s=new Qr),na(o))!function(t,r,n,i,s,o,a){var c=As(t,n),d=As(r,n),u=a.get(d);if(u)tn(t,n,u);else{var l=o?o(c,d,n+"",t,r,a):e,p=l===e;if(p){var h=Yo(d),f=!h&&Ko(d),m=!h&&!f&&pa(d);l=d,h||f||m?Yo(c)?l=c:Qo(c)?l=Ai(c):f?(p=!1,l=Pi(d,!0)):m?(p=!1,l=Ri(d,!0)):l=[]:aa(d)||Go(d)?(l=c,Go(c)?l=ba(c):na(c)&&!ea(c)||(l=ys(d))):p=!1}p&&(a.set(d,l),s(l,d,i,o,a),a.delete(d)),tn(t,n,l)}}(t,r,a,n,qn,i,s);else{var c=i?i(As(t,a),o,a+"",t,r,s):e;c===e&&(c=o),tn(t,a,c)}}),La)}function zn(t,r){var n=t.length;if(n)return bs(r+=r<0?n:0,n)?t[r]:e}function Gn(e,t,r){t=t.length?It(t,(function(e){return Yo(e)?function(t){return Pn(t,1===e.length?e[0]:e)}:e})):[oc];var n=-1;t=It(t,$t(us()));var i=Bn(e,(function(e,r,i){var s=It(t,(function(t){return t(e)}));return{criteria:s,index:++n,value:e}}));return function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}(i,(function(e,t){return function(e,t,r){for(var n=-1,i=e.criteria,s=t.criteria,o=i.length,a=r.length;++n<o;){var c=ki(i[n],s[n]);if(c)return n>=a?c:c*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}))}function Yn(e,t,r){for(var n=-1,i=t.length,s={};++n<i;){var o=t[n],a=Pn(e,o);r(a,o)&&ti(s,Ei(o,e),a)}return s}function $n(e,t,r,n){var i=n?Ut:jt,s=-1,o=t.length,a=e;for(e===t&&(t=Ai(t)),r&&(a=It(e,$t(r)));++s<o;)for(var c=0,d=t[s],u=r?r(d):d;(c=i(a,u,c,n))>-1;)a!==e&&Xe.call(a,c,1),Xe.call(e,c,1);return e}function Jn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==s){var s=i;bs(i)?Xe.call(e,i,1):hi(e,i)}}return e}function Qn(e,t){return e+Ht(Sr()*(t-e+1))}function Kn(e,t){var r="";if(!e||t<1||t>u)return r;do{t%2&&(r+=e),(t=Ht(t/2))&&(e+=e)}while(t);return r}function Zn(e,t){return Ns(ks(e,t,oc),e+"")}function Xn(e){return Zr(Ha(e))}function ei(e,t){var r=Ha(e);return Fs(r,dn(t,0,r.length))}function ti(t,r,n,i){if(!na(t))return t;for(var s=-1,o=(r=Ei(r,t)).length,a=o-1,c=t;null!=c&&++s<o;){var d=Us(r[s]),u=n;if("__proto__"===d||"constructor"===d||"prototype"===d)return t;if(s!=a){var l=c[d];(u=i?i(l,d,c):e)===e&&(u=na(l)?l:bs(r[s+1])?[]:{})}rn(c,d,u),c=c[d]}return t}var ri=Ar?function(e,t){return Ar.set(e,t),e}:oc,ni=lt?function(e,t){return lt(e,"toString",{configurable:!0,enumerable:!1,value:nc(t),writable:!0})}:oc;function ii(e){return Fs(Ha(e))}function si(e,t,r){var n=-1,i=e.length;t<0&&(t=-t>i?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var s=we(i);++n<i;)s[n]=e[n+t];return s}function oi(e,t){var r;return fn(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}function ai(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var s=n+i>>>1,o=e[s];null!==o&&!la(o)&&(r?o<=t:o<t)?n=s+1:i=s}return i}return ci(e,t,oc,r)}function ci(t,r,n,i){var s=0,o=null==t?0:t.length;if(0===o)return 0;for(var a=(r=n(r))!=r,c=null===r,d=la(r),u=r===e;s<o;){var l=Ht((s+o)/2),p=n(t[l]),h=p!==e,f=null===p,m=p==p,g=la(p);if(a)var v=i||m;else v=u?m&&(i||h):c?m&&h&&(i||!f):d?m&&h&&!f&&(i||!g):!f&&!g&&(i?p<=r:p<r);v?s=l+1:o=l}return br(o,4294967294)}function di(e,t){for(var r=-1,n=e.length,i=0,s=[];++r<n;){var o=e[r],a=t?t(o):o;if(!r||!Ho(a,c)){var c=a;s[i++]=0===o?0:o}}return s}function ui(e){return"number"==typeof e?e:la(e)?p:+e}function li(e){if("string"==typeof e)return e;if(Yo(e))return It(e,li)+"";if(la(e))return Vr?Vr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function pi(e,t,r){var n=-1,i=kt,s=e.length,o=!0,a=[],c=a;if(r)o=!1,i=Dt;else if(s>=200){var d=t?null:Ki(e);if(d)return ar(d);o=!1,i=Qt,c=new Jr}else c=t?[]:a;e:for(;++n<s;){var u=e[n],l=t?t(u):u;if(u=r||0!==u?u:0,o&&l==l){for(var p=c.length;p--;)if(c[p]===l)continue e;t&&c.push(l),a.push(u)}else i(c,l,r)||(c!==a&&c.push(l),a.push(u))}return a}function hi(e,t){return null==(e=Ds(e,t=Ei(t,e)))||delete e[Us(Zs(t))]}function fi(e,t,r,n){return ti(e,t,r(Pn(e,t)),n)}function mi(e,t,r,n){for(var i=e.length,s=n?i:-1;(n?s--:++s<i)&&t(e[s],s,e););return r?si(e,n?0:s,n?s+1:i):si(e,n?s+1:0,n?i:s)}function gi(e,t){var r=e;return r instanceof zr&&(r=r.value()),Ot(t,(function(e,t){return t.func.apply(t.thisArg,At([e],t.args))}),r)}function vi(e,t,r){var n=e.length;if(n<2)return n?pi(e[0]):[];for(var i=-1,s=we(n);++i<n;)for(var o=e[i],a=-1;++a<n;)a!=i&&(s[i]=hn(s[i]||o,e[a],t,r));return pi(_n(s,1),t,r)}function yi(t,r,n){for(var i=-1,s=t.length,o=r.length,a={};++i<s;){var c=i<o?r[i]:e;n(a,t[i],c)}return a}function _i(e){return Qo(e)?e:[]}function bi(e){return"function"==typeof e?e:oc}function Ei(e,t){return Yo(e)?e:ws(e,t)?[e]:js(Ea(e))}var wi=Zn;function Si(t,r,n){var i=t.length;return n=n===e?i:n,!r&&n>=i?t:si(t,r,n)}var Ci=pt||function(e){return ut.clearTimeout(e)};function Pi(e,t){if(t)return e.slice();var r=e.length,n=Ge?Ge(r):new e.constructor(r);return e.copy(n),n}function Ti(e){var t=new e.constructor(e.byteLength);return new ze(t).set(new ze(e)),t}function Ri(e,t){var r=t?Ti(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function ki(t,r){if(t!==r){var n=t!==e,i=null===t,s=t==t,o=la(t),a=r!==e,c=null===r,d=r==r,u=la(r);if(!c&&!u&&!o&&t>r||o&&a&&d&&!c&&!u||i&&a&&d||!n&&d||!s)return 1;if(!i&&!o&&!u&&t<r||u&&n&&s&&!i&&!o||c&&n&&s||!a&&s||!d)return-1}return 0}function Di(e,t,r,n){for(var i=-1,s=e.length,o=r.length,a=-1,c=t.length,d=_r(s-o,0),u=we(c+d),l=!n;++a<c;)u[a]=t[a];for(;++i<o;)(l||i<s)&&(u[r[i]]=e[i]);for(;d--;)u[a++]=e[i++];return u}function Ii(e,t,r,n){for(var i=-1,s=e.length,o=-1,a=r.length,c=-1,d=t.length,u=_r(s-a,0),l=we(u+d),p=!n;++i<u;)l[i]=e[i];for(var h=i;++c<d;)l[h+c]=t[c];for(;++o<a;)(p||i<s)&&(l[h+r[o]]=e[i++]);return l}function Ai(e,t){var r=-1,n=e.length;for(t||(t=we(n));++r<n;)t[r]=e[r];return t}function Oi(t,r,n,i){var s=!n;n||(n={});for(var o=-1,a=r.length;++o<a;){var c=r[o],d=i?i(n[c],t[c],c,n,t):e;d===e&&(d=t[c]),s?an(n,c,d):rn(n,c,d)}return n}function Mi(e,t){return function(r,n){var i=Yo(r)?St:sn,s=t?t():{};return i(r,e,us(n,2),s)}}function Ni(t){return Zn((function(r,n){var i=-1,s=n.length,o=s>1?n[s-1]:e,a=s>2?n[2]:e;for(o=t.length>3&&"function"==typeof o?(s--,o):e,a&&Es(n[0],n[1],a)&&(o=s<3?e:o,s=1),r=Re(r);++i<s;){var c=n[i];c&&t(r,c,i,o)}return r}))}function Li(e,t){return function(r,n){if(null==r)return r;if(!Jo(r))return e(r,n);for(var i=r.length,s=t?i:-1,o=Re(r);(t?s--:++s<i)&&!1!==n(o[s],s,o););return r}}function xi(e){return function(t,r,n){for(var i=-1,s=Re(t),o=n(t),a=o.length;a--;){var c=o[e?a:++i];if(!1===r(s[c],c,s))break}return t}}function Fi(t){return function(r){var n=nr(r=Ea(r))?ur(r):e,i=n?n[0]:r.charAt(0),s=n?Si(n,1).join(""):r.slice(1);return i[t]()+s}}function ji(e){return function(t){return Ot(ec(Ga(t).replace(Je,"")),e,"")}}function Ui(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Wr(e.prototype),n=e.apply(r,t);return na(n)?n:r}}function Vi(t){return function(r,n,i){var s=Re(r);if(!Jo(r)){var o=us(n,3);r=Na(r),n=function(e){return o(s[e],e,s)}}var a=t(r,n,i);return a>-1?s[o?r[a]:a]:e}}function Bi(r){return is((function(n){var i=n.length,s=i,o=qr.prototype.thru;for(r&&n.reverse();s--;){var a=n[s];if("function"!=typeof a)throw new Ie(t);if(o&&!c&&"wrapper"==cs(a))var c=new qr([],!0)}for(s=c?s:i;++s<i;){var d=cs(a=n[s]),u="wrapper"==d?as(a):e;c=u&&Ss(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?c[cs(u[0])].apply(c,u[3]):1==a.length&&Ss(a)?c[d]():c.thru(a)}return function(){var e=arguments,t=e[0];if(c&&1==e.length&&Yo(t))return c.plant(t).value();for(var r=0,s=i?n[r].apply(this,e):t;++r<i;)s=n[r].call(this,s);return s}}))}function Wi(t,r,n,i,s,o,c,d,u,l){var p=r&a,h=1&r,f=2&r,m=24&r,g=512&r,v=f?e:Ui(t);return function e(){for(var a=arguments.length,y=we(a),_=a;_--;)y[_]=arguments[_];if(m)var b=ds(e),E=Xt(y,b);if(i&&(y=Di(y,i,s,m)),o&&(y=Ii(y,o,c,m)),a-=E,m&&a<l){var w=or(y,b);return Ji(t,r,Wi,e.placeholder,n,y,w,d,u,l-a)}var S=h?n:this,C=f?S[t]:t;return a=y.length,d?y=Is(y,d):g&&a>1&&y.reverse(),p&&u<a&&(y.length=u),this&&this!==ut&&this instanceof e&&(C=v||Ui(C)),C.apply(S,y)}}function Hi(e,t){return function(r,n){return function(e,t,r,n){return wn(e,(function(e,i,s){t(n,r(e),i,s)})),n}(r,e,t(n),{})}}function qi(t,r){return function(n,i){var s;if(n===e&&i===e)return r;if(n!==e&&(s=n),i!==e){if(s===e)return i;"string"==typeof n||"string"==typeof i?(n=li(n),i=li(i)):(n=ui(n),i=ui(i)),s=t(n,i)}return s}}function zi(e){return is((function(t){return t=It(t,$t(us())),Zn((function(r){var n=this;return e(t,(function(e){return wt(e,n,r)}))}))}))}function Gi(t,r){var n=(r=r===e?" ":li(r)).length;if(n<2)return n?Kn(r,t):r;var i=Kn(r,Lt(t/dr(r)));return nr(r)?Si(ur(i),0,t).join(""):i.slice(0,t)}function Yi(t){return function(r,n,i){return i&&"number"!=typeof i&&Es(r,n,i)&&(n=i=e),r=ga(r),n===e?(n=r,r=0):n=ga(n),function(e,t,r,n){for(var i=-1,s=_r(Lt((t-e)/(r||1)),0),o=we(s);s--;)o[n?s:++i]=e,e+=r;return o}(r,n,i=i===e?r<n?1:-1:ga(i),t)}}function $i(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=_a(t),r=_a(r)),e(t,r)}}function Ji(t,r,n,i,a,c,d,u,l,p){var h=8&r;r|=h?s:o,4&(r&=~(h?o:s))||(r&=-4);var f=[t,r,a,h?c:e,h?d:e,h?e:c,h?e:d,u,l,p],m=n.apply(e,f);return Ss(t)&&Os(m,f),m.placeholder=i,Ls(m,t,r)}function Qi(e){var t=Te[e];return function(e,r){if(e=_a(e),(r=null==r?0:br(va(r),292))&&gr(e)){var n=(Ea(e)+"e").split("e");return+((n=(Ea(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Ki=kr&&1/ar(new kr([,-0]))[1]==d?function(e){return new kr(e)}:lc;function Zi(e){return function(t){var r=gs(t);return r==w?ir(t):r==R?cr(t):function(e,t){return It(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Xi(r,d,u,l,p,h,f,m){var g=2&d;if(!g&&"function"!=typeof r)throw new Ie(t);var v=l?l.length:0;if(v||(d&=-97,l=p=e),f=f===e?f:_r(va(f),0),m=m===e?m:va(m),v-=p?p.length:0,d&o){var y=l,_=p;l=p=e}var b=g?e:as(r),E=[r,d,u,l,p,y,_,h,f,m];if(b&&function(e,t){var r=e[1],i=t[1],s=r|i,o=s<131,d=i==a&&8==r||i==a&&r==c&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==r;if(!o&&!d)return e;1&i&&(e[2]=t[2],s|=1&r?0:4);var u=t[3];if(u){var l=e[3];e[3]=l?Di(l,u,t[4]):u,e[4]=l?or(e[3],n):t[4]}(u=t[5])&&(l=e[5],e[5]=l?Ii(l,u,t[6]):u,e[6]=l?or(e[5],n):t[6]),(u=t[7])&&(e[7]=u),i&a&&(e[8]=null==e[8]?t[8]:br(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=s}(E,b),r=E[0],d=E[1],u=E[2],l=E[3],p=E[4],!(m=E[9]=E[9]===e?g?0:r.length:_r(E[9]-v,0))&&24&d&&(d&=-25),d&&1!=d)w=8==d||d==i?function(t,r,n){var i=Ui(t);return function s(){for(var o=arguments.length,a=we(o),c=o,d=ds(s);c--;)a[c]=arguments[c];var u=o<3&&a[0]!==d&&a[o-1]!==d?[]:or(a,d);return(o-=u.length)<n?Ji(t,r,Wi,s.placeholder,e,a,u,e,e,n-o):wt(this&&this!==ut&&this instanceof s?i:t,this,a)}}(r,d,m):d!=s&&33!=d||p.length?Wi.apply(e,E):function(e,t,r,n){var i=1&t,s=Ui(e);return function t(){for(var o=-1,a=arguments.length,c=-1,d=n.length,u=we(d+a),l=this&&this!==ut&&this instanceof t?s:e;++c<d;)u[c]=n[c];for(;a--;)u[c++]=arguments[++o];return wt(l,i?r:this,u)}}(r,d,u,l);else var w=function(e,t,r){var n=1&t,i=Ui(e);return function t(){return(this&&this!==ut&&this instanceof t?i:e).apply(n?r:this,arguments)}}(r,d,u);return Ls((b?ri:Os)(w,E),r,d)}function es(t,r,n,i){return t===e||Ho(t,Me[n])&&!xe.call(i,n)?r:t}function ts(t,r,n,i,s,o){return na(t)&&na(r)&&(o.set(r,t),qn(t,r,e,ts,o),o.delete(r)),t}function rs(t){return aa(t)?e:t}function ns(t,r,n,i,s,o){var a=1&n,c=t.length,d=r.length;if(c!=d&&!(a&&d>c))return!1;var u=o.get(t),l=o.get(r);if(u&&l)return u==r&&l==t;var p=-1,h=!0,f=2&n?new Jr:e;for(o.set(t,r),o.set(r,t);++p<c;){var m=t[p],g=r[p];if(i)var v=a?i(g,m,p,r,t,o):i(m,g,p,t,r,o);if(v!==e){if(v)continue;h=!1;break}if(f){if(!Nt(r,(function(e,t){if(!Qt(f,t)&&(m===e||s(m,e,n,i,o)))return f.push(t)}))){h=!1;break}}else if(m!==g&&!s(m,g,n,i,o)){h=!1;break}}return o.delete(t),o.delete(r),h}function is(t){return Ns(ks(t,e,Ys),t+"")}function ss(e){return Tn(e,Na,fs)}function os(e){return Tn(e,La,ms)}var as=Ar?function(e){return Ar.get(e)}:lc;function cs(e){for(var t=e.name+"",r=Or[t],n=xe.call(Or,t)?r.length:0;n--;){var i=r[n],s=i.func;if(null==s||s==e)return i.name}return t}function ds(e){return(xe.call(Br,"placeholder")?Br:e).placeholder}function us(){var e=Br.iteratee||ac;return e=e===ac?Fn:e,arguments.length?e(arguments[0],arguments[1]):e}function ls(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function ps(e){for(var t=Na(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Ts(i)]}return t}function hs(t,r){var n=function(t,r){return null==t?e:t[r]}(t,r);return xn(n)?n:e}var fs=fr?function(e){return null==e?[]:(e=Re(e),Rt(fr(e),(function(t){return Ke.call(e,t)})))}:yc,ms=fr?function(e){for(var t=[];e;)At(t,fs(e)),e=Ye(e);return t}:yc,gs=Rn;function vs(e,t,r){for(var n=-1,i=(t=Ei(t,e)).length,s=!1;++n<i;){var o=Us(t[n]);if(!(s=null!=e&&r(e,o)))break;e=e[o]}return s||++n!=i?s:!!(i=null==e?0:e.length)&&ra(i)&&bs(o,i)&&(Yo(e)||Go(e))}function ys(e){return"function"!=typeof e.constructor||Ps(e)?{}:Wr(Ye(e))}function _s(e){return Yo(e)||Go(e)||!!(st&&e&&e[st])}function bs(e,t){var r=typeof e;return!!(t=null==t?u:t)&&("number"==r||"symbol"!=r&&ve.test(e))&&e>-1&&e%1==0&&e<t}function Es(e,t,r){if(!na(r))return!1;var n=typeof t;return!!("number"==n?Jo(r)&&bs(t,r.length):"string"==n&&t in r)&&Ho(r[t],e)}function ws(e,t){if(Yo(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!la(e))||X.test(e)||!Z.test(e)||null!=t&&e in Re(t)}function Ss(e){var t=cs(e),r=Br[t];if("function"!=typeof r||!(t in zr.prototype))return!1;if(e===r)return!0;var n=as(r);return!!n&&e===n[0]}(Pr&&gs(new Pr(new ArrayBuffer(1)))!=O||Tr&&gs(new Tr)!=w||Rr&&gs(Rr.resolve())!=P||kr&&gs(new kr)!=R||Dr&&gs(new Dr)!=I)&&(gs=function(t){var r=Rn(t),n=r==C?t.constructor:e,i=n?Vs(n):"";if(i)switch(i){case Mr:return O;case Nr:return w;case Lr:return P;case xr:return R;case Fr:return I}return r});var Cs=Ne?ea:_c;function Ps(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Me)}function Ts(e){return e==e&&!na(e)}function Rs(t,r){return function(n){return null!=n&&n[t]===r&&(r!==e||t in Re(n))}}function ks(t,r,n){return r=_r(r===e?t.length-1:r,0),function(){for(var e=arguments,i=-1,s=_r(e.length-r,0),o=we(s);++i<s;)o[i]=e[r+i];i=-1;for(var a=we(r+1);++i<r;)a[i]=e[i];return a[r]=n(o),wt(t,this,a)}}function Ds(e,t){return t.length<2?e:Pn(e,si(t,0,-1))}function Is(t,r){for(var n=t.length,i=br(r.length,n),s=Ai(t);i--;){var o=r[i];t[i]=bs(o,n)?s[o]:e}return t}function As(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Os=xs(ri),Ms=mt||function(e,t){return ut.setTimeout(e,t)},Ns=xs(ni);function Ls(e,t,r){var n=t+"";return Ns(e,function(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(se,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Ct(f,(function(r){var n="_."+r[0];t&r[1]&&!kt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(oe);return t?t[1].split(ae):[]}(n),r)))}function xs(t){var r=0,n=0;return function(){var i=Er(),s=16-(i-n);if(n=i,s>0){if(++r>=800)return arguments[0]}else r=0;return t.apply(e,arguments)}}function Fs(t,r){var n=-1,i=t.length,s=i-1;for(r=r===e?i:r;++n<r;){var o=Qn(n,s),a=t[o];t[o]=t[n],t[n]=a}return t.length=r,t}var js=function(e){var t=Fo(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ee,(function(e,r,n,i){t.push(n?i.replace(ue,"$1"):r||e)})),t}));function Us(e){if("string"==typeof e||la(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Vs(e){if(null!=e){try{return Le.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Bs(e){if(e instanceof zr)return e.clone();var t=new qr(e.__wrapped__,e.__chain__);return t.__actions__=Ai(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Ws=Zn((function(e,t){return Qo(e)?hn(e,_n(t,1,Qo,!0)):[]})),Hs=Zn((function(t,r){var n=Zs(r);return Qo(n)&&(n=e),Qo(t)?hn(t,_n(r,1,Qo,!0),us(n,2)):[]})),qs=Zn((function(t,r){var n=Zs(r);return Qo(n)&&(n=e),Qo(t)?hn(t,_n(r,1,Qo,!0),e,n):[]}));function zs(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:va(r);return i<0&&(i=_r(n+i,0)),Ft(e,us(t,3),i)}function Gs(t,r,n){var i=null==t?0:t.length;if(!i)return-1;var s=i-1;return n!==e&&(s=va(n),s=n<0?_r(i+s,0):br(s,i-1)),Ft(t,us(r,3),s,!0)}function Ys(e){return null!=e&&e.length?_n(e,1):[]}function $s(t){return t&&t.length?t[0]:e}var Js=Zn((function(e){var t=It(e,_i);return t.length&&t[0]===e[0]?An(t):[]})),Qs=Zn((function(t){var r=Zs(t),n=It(t,_i);return r===Zs(n)?r=e:n.pop(),n.length&&n[0]===t[0]?An(n,us(r,2)):[]})),Ks=Zn((function(t){var r=Zs(t),n=It(t,_i);return(r="function"==typeof r?r:e)&&n.pop(),n.length&&n[0]===t[0]?An(n,e,r):[]}));function Zs(t){var r=null==t?0:t.length;return r?t[r-1]:e}var Xs=Zn(eo);function eo(e,t){return e&&e.length&&t&&t.length?$n(e,t):e}var to=is((function(e,t){var r=null==e?0:e.length,n=cn(e,t);return Jn(e,It(t,(function(e){return bs(e,r)?+e:e})).sort(ki)),n}));function ro(e){return null==e?e:Cr.call(e)}var no=Zn((function(e){return pi(_n(e,1,Qo,!0))})),io=Zn((function(t){var r=Zs(t);return Qo(r)&&(r=e),pi(_n(t,1,Qo,!0),us(r,2))})),so=Zn((function(t){var r=Zs(t);return r="function"==typeof r?r:e,pi(_n(t,1,Qo,!0),e,r)}));function oo(e){if(!e||!e.length)return[];var t=0;return e=Rt(e,(function(e){if(Qo(e))return t=_r(e.length,t),!0})),Gt(t,(function(t){return It(e,Wt(t))}))}function ao(t,r){if(!t||!t.length)return[];var n=oo(t);return null==r?n:It(n,(function(t){return wt(r,e,t)}))}var co=Zn((function(e,t){return Qo(e)?hn(e,t):[]})),uo=Zn((function(e){return vi(Rt(e,Qo))})),lo=Zn((function(t){var r=Zs(t);return Qo(r)&&(r=e),vi(Rt(t,Qo),us(r,2))})),po=Zn((function(t){var r=Zs(t);return r="function"==typeof r?r:e,vi(Rt(t,Qo),e,r)})),ho=Zn(oo),fo=Zn((function(t){var r=t.length,n=r>1?t[r-1]:e;return n="function"==typeof n?(t.pop(),n):e,ao(t,n)}));function mo(e){var t=Br(e);return t.__chain__=!0,t}function go(e,t){return t(e)}var vo=is((function(t){var r=t.length,n=r?t[0]:0,i=this.__wrapped__,s=function(e){return cn(e,t)};return!(r>1||this.__actions__.length)&&i instanceof zr&&bs(n)?((i=i.slice(n,+n+(r?1:0))).__actions__.push({func:go,args:[s],thisArg:e}),new qr(i,this.__chain__).thru((function(t){return r&&!t.length&&t.push(e),t}))):this.thru(s)})),yo=Mi((function(e,t,r){xe.call(e,r)?++e[r]:an(e,r,1)})),_o=Vi(zs),bo=Vi(Gs);function Eo(e,t){return(Yo(e)?Ct:fn)(e,us(t,3))}function wo(e,t){return(Yo(e)?Pt:mn)(e,us(t,3))}var So=Mi((function(e,t,r){xe.call(e,r)?e[r].push(t):an(e,r,[t])})),Co=Zn((function(e,t,r){var n=-1,i="function"==typeof t,s=Jo(e)?we(e.length):[];return fn(e,(function(e){s[++n]=i?wt(t,e,r):On(e,t,r)})),s})),Po=Mi((function(e,t,r){an(e,r,t)}));function To(e,t){return(Yo(e)?It:Bn)(e,us(t,3))}var Ro=Mi((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]})),ko=Zn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&Es(e,t[0],t[1])?t=[]:r>2&&Es(t[0],t[1],t[2])&&(t=[t[0]]),Gn(e,_n(t,1),[])})),Do=ft||function(){return ut.Date.now()};function Io(t,r,n){return r=n?e:r,r=t&&null==r?t.length:r,Xi(t,a,e,e,e,e,r)}function Ao(r,n){var i;if("function"!=typeof n)throw new Ie(t);return r=va(r),function(){return--r>0&&(i=n.apply(this,arguments)),r<=1&&(n=e),i}}var Oo=Zn((function(e,t,r){var n=1;if(r.length){var i=or(r,ds(Oo));n|=s}return Xi(e,n,t,r,i)})),Mo=Zn((function(e,t,r){var n=3;if(r.length){var i=or(r,ds(Mo));n|=s}return Xi(t,n,e,r,i)}));function No(r,n,i){var s,o,a,c,d,u,l=0,p=!1,h=!1,f=!0;if("function"!=typeof r)throw new Ie(t);function m(t){var n=s,i=o;return s=o=e,l=t,c=r.apply(i,n)}function g(e){return l=e,d=Ms(y,n),p?m(e):c}function v(t){var r=t-u;return u===e||r>=n||r<0||h&&t-l>=a}function y(){var e=Do();if(v(e))return _(e);d=Ms(y,function(e){var t=n-(e-u);return h?br(t,a-(e-l)):t}(e))}function _(t){return d=e,f&&s?m(t):(s=o=e,c)}function b(){var t=Do(),r=v(t);if(s=arguments,o=this,u=t,r){if(d===e)return g(u);if(h)return Ci(d),d=Ms(y,n),m(u)}return d===e&&(d=Ms(y,n)),c}return n=_a(n)||0,na(i)&&(p=!!i.leading,a=(h="maxWait"in i)?_r(_a(i.maxWait)||0,n):a,f="trailing"in i?!!i.trailing:f),b.cancel=function(){d!==e&&Ci(d),l=0,s=u=o=d=e},b.flush=function(){return d===e?c:_(Do())},b}var Lo=Zn((function(e,t){return pn(e,1,t)})),xo=Zn((function(e,t,r){return pn(e,_a(t)||0,r)}));function Fo(e,r){if("function"!=typeof e||null!=r&&"function"!=typeof r)throw new Ie(t);var n=function(){var t=arguments,i=r?r.apply(this,t):t[0],s=n.cache;if(s.has(i))return s.get(i);var o=e.apply(this,t);return n.cache=s.set(i,o)||s,o};return n.cache=new(Fo.Cache||$r),n}function jo(e){if("function"!=typeof e)throw new Ie(t);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Fo.Cache=$r;var Uo=wi((function(e,t){var r=(t=1==t.length&&Yo(t[0])?It(t[0],$t(us())):It(_n(t,1),$t(us()))).length;return Zn((function(n){for(var i=-1,s=br(n.length,r);++i<s;)n[i]=t[i].call(this,n[i]);return wt(e,this,n)}))})),Vo=Zn((function(t,r){var n=or(r,ds(Vo));return Xi(t,s,e,r,n)})),Bo=Zn((function(t,r){var n=or(r,ds(Bo));return Xi(t,o,e,r,n)})),Wo=is((function(t,r){return Xi(t,c,e,e,e,r)}));function Ho(e,t){return e===t||e!=e&&t!=t}var qo=$i(kn),zo=$i((function(e,t){return e>=t})),Go=Mn(function(){return arguments}())?Mn:function(e){return ia(e)&&xe.call(e,"callee")&&!Ke.call(e,"callee")},Yo=we.isArray,$o=gt?$t(gt):function(e){return ia(e)&&Rn(e)==A};function Jo(e){return null!=e&&ra(e.length)&&!ea(e)}function Qo(e){return ia(e)&&Jo(e)}var Ko=mr||_c,Zo=vt?$t(vt):function(e){return ia(e)&&Rn(e)==y};function Xo(e){if(!ia(e))return!1;var t=Rn(e);return t==_||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!aa(e)}function ea(e){if(!na(e))return!1;var t=Rn(e);return t==b||t==E||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ta(e){return"number"==typeof e&&e==va(e)}function ra(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=u}function na(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ia(e){return null!=e&&"object"==typeof e}var sa=yt?$t(yt):function(e){return ia(e)&&gs(e)==w};function oa(e){return"number"==typeof e||ia(e)&&Rn(e)==S}function aa(e){if(!ia(e)||Rn(e)!=C)return!1;var t=Ye(e);if(null===t)return!0;var r=xe.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Le.call(r)==Ve}var ca=_t?$t(_t):function(e){return ia(e)&&Rn(e)==T},da=bt?$t(bt):function(e){return ia(e)&&gs(e)==R};function ua(e){return"string"==typeof e||!Yo(e)&&ia(e)&&Rn(e)==k}function la(e){return"symbol"==typeof e||ia(e)&&Rn(e)==D}var pa=Et?$t(Et):function(e){return ia(e)&&ra(e.length)&&!!nt[Rn(e)]},ha=$i(Vn),fa=$i((function(e,t){return e<=t}));function ma(e){if(!e)return[];if(Jo(e))return ua(e)?ur(e):Ai(e);if(ct&&e[ct])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[ct]());var t=gs(e);return(t==w?ir:t==R?ar:Ha)(e)}function ga(e){return e?(e=_a(e))===d||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function va(e){var t=ga(e),r=t%1;return t==t?r?t-r:t:0}function ya(e){return e?dn(va(e),0,h):0}function _a(e){if("number"==typeof e)return e;if(la(e))return p;if(na(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=na(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Yt(e);var r=fe.test(e);return r||ge.test(e)?at(e.slice(2),r?2:8):he.test(e)?p:+e}function ba(e){return Oi(e,La(e))}function Ea(e){return null==e?"":li(e)}var wa=Ni((function(e,t){if(Ps(t)||Jo(t))Oi(t,Na(t),e);else for(var r in t)xe.call(t,r)&&rn(e,r,t[r])})),Sa=Ni((function(e,t){Oi(t,La(t),e)})),Ca=Ni((function(e,t,r,n){Oi(t,La(t),e,n)})),Pa=Ni((function(e,t,r,n){Oi(t,Na(t),e,n)})),Ta=is(cn),Ra=Zn((function(t,r){t=Re(t);var n=-1,i=r.length,s=i>2?r[2]:e;for(s&&Es(r[0],r[1],s)&&(i=1);++n<i;)for(var o=r[n],a=La(o),c=-1,d=a.length;++c<d;){var u=a[c],l=t[u];(l===e||Ho(l,Me[u])&&!xe.call(t,u))&&(t[u]=o[u])}return t})),ka=Zn((function(t){return t.push(e,ts),wt(Fa,e,t)}));function Da(t,r,n){var i=null==t?e:Pn(t,r);return i===e?n:i}function Ia(e,t){return null!=e&&vs(e,t,In)}var Aa=Hi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Ue.call(t)),e[t]=r}),nc(oc)),Oa=Hi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Ue.call(t)),xe.call(e,t)?e[t].push(r):e[t]=[r]}),us),Ma=Zn(On);function Na(e){return Jo(e)?Kr(e):jn(e)}function La(e){return Jo(e)?Kr(e,!0):Un(e)}var xa=Ni((function(e,t,r){qn(e,t,r)})),Fa=Ni((function(e,t,r,n){qn(e,t,r,n)})),ja=is((function(e,t){var r={};if(null==e)return r;var n=!1;t=It(t,(function(t){return t=Ei(t,e),n||(n=t.length>1),t})),Oi(e,os(e),r),n&&(r=un(r,7,rs));for(var i=t.length;i--;)hi(r,t[i]);return r})),Ua=is((function(e,t){return null==e?{}:function(e,t){return Yn(e,t,(function(t,r){return Ia(e,r)}))}(e,t)}));function Va(e,t){if(null==e)return{};var r=It(os(e),(function(e){return[e]}));return t=us(t),Yn(e,r,(function(e,r){return t(e,r[0])}))}var Ba=Zi(Na),Wa=Zi(La);function Ha(e){return null==e?[]:Jt(e,Na(e))}var qa=ji((function(e,t,r){return t=t.toLowerCase(),e+(r?za(t):t)}));function za(e){return Xa(Ea(e).toLowerCase())}function Ga(e){return(e=Ea(e))&&e.replace(ye,er).replace(Qe,"")}var Ya=ji((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),$a=ji((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Ja=Fi("toLowerCase"),Qa=ji((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()})),Ka=ji((function(e,t,r){return e+(r?" ":"")+Xa(t)})),Za=ji((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Xa=Fi("toUpperCase");function ec(t,r,n){return t=Ea(t),(r=n?e:r)===e?function(e){return et.test(e)}(t)?function(e){return e.match(Ze)||[]}(t):function(e){return e.match(ce)||[]}(t):t.match(r)||[]}var tc=Zn((function(t,r){try{return wt(t,e,r)}catch(e){return Xo(e)?e:new Ce(e)}})),rc=is((function(e,t){return Ct(t,(function(t){t=Us(t),an(e,t,Oo(e[t],e))})),e}));function nc(e){return function(){return e}}var ic=Bi(),sc=Bi(!0);function oc(e){return e}function ac(e){return Fn("function"==typeof e?e:un(e,1))}var cc=Zn((function(e,t){return function(r){return On(r,e,t)}})),dc=Zn((function(e,t){return function(r){return On(e,r,t)}}));function uc(e,t,r){var n=Na(t),i=Cn(t,n);null!=r||na(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=Cn(t,Na(t)));var s=!(na(r)&&"chain"in r&&!r.chain),o=ea(e);return Ct(i,(function(r){var n=t[r];e[r]=n,o&&(e.prototype[r]=function(){var t=this.__chain__;if(s||t){var r=e(this.__wrapped__),i=r.__actions__=Ai(this.__actions__);return i.push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,At([this.value()],arguments))})})),e}function lc(){}var pc=zi(It),hc=zi(Tt),fc=zi(Nt);function mc(e){return ws(e)?Wt(Us(e)):function(e){return function(t){return Pn(t,e)}}(e)}var gc=Yi(),vc=Yi(!0);function yc(){return[]}function _c(){return!1}var bc,Ec=qi((function(e,t){return e+t}),0),wc=Qi("ceil"),Sc=qi((function(e,t){return e/t}),1),Cc=Qi("floor"),Pc=qi((function(e,t){return e*t}),1),Tc=Qi("round"),Rc=qi((function(e,t){return e-t}),0);return Br.after=function(e,r){if("function"!=typeof r)throw new Ie(t);return e=va(e),function(){if(--e<1)return r.apply(this,arguments)}},Br.ary=Io,Br.assign=wa,Br.assignIn=Sa,Br.assignInWith=Ca,Br.assignWith=Pa,Br.at=Ta,Br.before=Ao,Br.bind=Oo,Br.bindAll=rc,Br.bindKey=Mo,Br.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Yo(e)?e:[e]},Br.chain=mo,Br.chunk=function(t,r,n){r=(n?Es(t,r,n):r===e)?1:_r(va(r),0);var i=null==t?0:t.length;if(!i||r<1)return[];for(var s=0,o=0,a=we(Lt(i/r));s<i;)a[o++]=si(t,s,s+=r);return a},Br.compact=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var s=e[t];s&&(i[n++]=s)}return i},Br.concat=function(){var e=arguments.length;if(!e)return[];for(var t=we(e-1),r=arguments[0],n=e;n--;)t[n-1]=arguments[n];return At(Yo(r)?Ai(r):[r],_n(t,1))},Br.cond=function(e){var r=null==e?0:e.length,n=us();return e=r?It(e,(function(e){if("function"!=typeof e[1])throw new Ie(t);return[n(e[0]),e[1]]})):[],Zn((function(t){for(var n=-1;++n<r;){var i=e[n];if(wt(i[0],this,t))return wt(i[1],this,t)}}))},Br.conforms=function(e){return function(e){var t=Na(e);return function(r){return ln(r,e,t)}}(un(e,1))},Br.constant=nc,Br.countBy=yo,Br.create=function(e,t){var r=Wr(e);return null==t?r:on(r,t)},Br.curry=function t(r,n,i){var s=Xi(r,8,e,e,e,e,e,n=i?e:n);return s.placeholder=t.placeholder,s},Br.curryRight=function t(r,n,s){var o=Xi(r,i,e,e,e,e,e,n=s?e:n);return o.placeholder=t.placeholder,o},Br.debounce=No,Br.defaults=Ra,Br.defaultsDeep=ka,Br.defer=Lo,Br.delay=xo,Br.difference=Ws,Br.differenceBy=Hs,Br.differenceWith=qs,Br.drop=function(t,r,n){var i=null==t?0:t.length;return i?si(t,(r=n||r===e?1:va(r))<0?0:r,i):[]},Br.dropRight=function(t,r,n){var i=null==t?0:t.length;return i?si(t,0,(r=i-(r=n||r===e?1:va(r)))<0?0:r):[]},Br.dropRightWhile=function(e,t){return e&&e.length?mi(e,us(t,3),!0,!0):[]},Br.dropWhile=function(e,t){return e&&e.length?mi(e,us(t,3),!0):[]},Br.fill=function(t,r,n,i){var s=null==t?0:t.length;return s?(n&&"number"!=typeof n&&Es(t,r,n)&&(n=0,i=s),function(t,r,n,i){var s=t.length;for((n=va(n))<0&&(n=-n>s?0:s+n),(i=i===e||i>s?s:va(i))<0&&(i+=s),i=n>i?0:ya(i);n<i;)t[n++]=r;return t}(t,r,n,i)):[]},Br.filter=function(e,t){return(Yo(e)?Rt:yn)(e,us(t,3))},Br.flatMap=function(e,t){return _n(To(e,t),1)},Br.flatMapDeep=function(e,t){return _n(To(e,t),d)},Br.flatMapDepth=function(t,r,n){return n=n===e?1:va(n),_n(To(t,r),n)},Br.flatten=Ys,Br.flattenDeep=function(e){return null!=e&&e.length?_n(e,d):[]},Br.flattenDepth=function(t,r){return null!=t&&t.length?_n(t,r=r===e?1:va(r)):[]},Br.flip=function(e){return Xi(e,512)},Br.flow=ic,Br.flowRight=sc,Br.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},Br.functions=function(e){return null==e?[]:Cn(e,Na(e))},Br.functionsIn=function(e){return null==e?[]:Cn(e,La(e))},Br.groupBy=So,Br.initial=function(e){return null!=e&&e.length?si(e,0,-1):[]},Br.intersection=Js,Br.intersectionBy=Qs,Br.intersectionWith=Ks,Br.invert=Aa,Br.invertBy=Oa,Br.invokeMap=Co,Br.iteratee=ac,Br.keyBy=Po,Br.keys=Na,Br.keysIn=La,Br.map=To,Br.mapKeys=function(e,t){var r={};return t=us(t,3),wn(e,(function(e,n,i){an(r,t(e,n,i),e)})),r},Br.mapValues=function(e,t){var r={};return t=us(t,3),wn(e,(function(e,n,i){an(r,n,t(e,n,i))})),r},Br.matches=function(e){return Wn(un(e,1))},Br.matchesProperty=function(e,t){return Hn(e,un(t,1))},Br.memoize=Fo,Br.merge=xa,Br.mergeWith=Fa,Br.method=cc,Br.methodOf=dc,Br.mixin=uc,Br.negate=jo,Br.nthArg=function(e){return e=va(e),Zn((function(t){return zn(t,e)}))},Br.omit=ja,Br.omitBy=function(e,t){return Va(e,jo(us(t)))},Br.once=function(e){return Ao(2,e)},Br.orderBy=function(t,r,n,i){return null==t?[]:(Yo(r)||(r=null==r?[]:[r]),Yo(n=i?e:n)||(n=null==n?[]:[n]),Gn(t,r,n))},Br.over=pc,Br.overArgs=Uo,Br.overEvery=hc,Br.overSome=fc,Br.partial=Vo,Br.partialRight=Bo,Br.partition=Ro,Br.pick=Ua,Br.pickBy=Va,Br.property=mc,Br.propertyOf=function(t){return function(r){return null==t?e:Pn(t,r)}},Br.pull=Xs,Br.pullAll=eo,Br.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?$n(e,t,us(r,2)):e},Br.pullAllWith=function(t,r,n){return t&&t.length&&r&&r.length?$n(t,r,e,n):t},Br.pullAt=to,Br.range=gc,Br.rangeRight=vc,Br.rearg=Wo,Br.reject=function(e,t){return(Yo(e)?Rt:yn)(e,jo(us(t,3)))},Br.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],s=e.length;for(t=us(t,3);++n<s;){var o=e[n];t(o,n,e)&&(r.push(o),i.push(n))}return Jn(e,i),r},Br.rest=function(r,n){if("function"!=typeof r)throw new Ie(t);return Zn(r,n=n===e?n:va(n))},Br.reverse=ro,Br.sampleSize=function(t,r,n){return r=(n?Es(t,r,n):r===e)?1:va(r),(Yo(t)?Xr:ei)(t,r)},Br.set=function(e,t,r){return null==e?e:ti(e,t,r)},Br.setWith=function(t,r,n,i){return i="function"==typeof i?i:e,null==t?t:ti(t,r,n,i)},Br.shuffle=function(e){return(Yo(e)?en:ii)(e)},Br.slice=function(t,r,n){var i=null==t?0:t.length;return i?(n&&"number"!=typeof n&&Es(t,r,n)?(r=0,n=i):(r=null==r?0:va(r),n=n===e?i:va(n)),si(t,r,n)):[]},Br.sortBy=ko,Br.sortedUniq=function(e){return e&&e.length?di(e):[]},Br.sortedUniqBy=function(e,t){return e&&e.length?di(e,us(t,2)):[]},Br.split=function(t,r,n){return n&&"number"!=typeof n&&Es(t,r,n)&&(r=n=e),(n=n===e?h:n>>>0)?(t=Ea(t))&&("string"==typeof r||null!=r&&!ca(r))&&!(r=li(r))&&nr(t)?Si(ur(t),0,n):t.split(r,n):[]},Br.spread=function(e,r){if("function"!=typeof e)throw new Ie(t);return r=null==r?0:_r(va(r),0),Zn((function(t){var n=t[r],i=Si(t,0,r);return n&&At(i,n),wt(e,this,i)}))},Br.tail=function(e){var t=null==e?0:e.length;return t?si(e,1,t):[]},Br.take=function(t,r,n){return t&&t.length?si(t,0,(r=n||r===e?1:va(r))<0?0:r):[]},Br.takeRight=function(t,r,n){var i=null==t?0:t.length;return i?si(t,(r=i-(r=n||r===e?1:va(r)))<0?0:r,i):[]},Br.takeRightWhile=function(e,t){return e&&e.length?mi(e,us(t,3),!1,!0):[]},Br.takeWhile=function(e,t){return e&&e.length?mi(e,us(t,3)):[]},Br.tap=function(e,t){return t(e),e},Br.throttle=function(e,r,n){var i=!0,s=!0;if("function"!=typeof e)throw new Ie(t);return na(n)&&(i="leading"in n?!!n.leading:i,s="trailing"in n?!!n.trailing:s),No(e,r,{leading:i,maxWait:r,trailing:s})},Br.thru=go,Br.toArray=ma,Br.toPairs=Ba,Br.toPairsIn=Wa,Br.toPath=function(e){return Yo(e)?It(e,Us):la(e)?[e]:Ai(js(Ea(e)))},Br.toPlainObject=ba,Br.transform=function(e,t,r){var n=Yo(e),i=n||Ko(e)||pa(e);if(t=us(t,4),null==r){var s=e&&e.constructor;r=i?n?new s:[]:na(e)&&ea(s)?Wr(Ye(e)):{}}return(i?Ct:wn)(e,(function(e,n,i){return t(r,e,n,i)})),r},Br.unary=function(e){return Io(e,1)},Br.union=no,Br.unionBy=io,Br.unionWith=so,Br.uniq=function(e){return e&&e.length?pi(e):[]},Br.uniqBy=function(e,t){return e&&e.length?pi(e,us(t,2)):[]},Br.uniqWith=function(t,r){return r="function"==typeof r?r:e,t&&t.length?pi(t,e,r):[]},Br.unset=function(e,t){return null==e||hi(e,t)},Br.unzip=oo,Br.unzipWith=ao,Br.update=function(e,t,r){return null==e?e:fi(e,t,bi(r))},Br.updateWith=function(t,r,n,i){return i="function"==typeof i?i:e,null==t?t:fi(t,r,bi(n),i)},Br.values=Ha,Br.valuesIn=function(e){return null==e?[]:Jt(e,La(e))},Br.without=co,Br.words=ec,Br.wrap=function(e,t){return Vo(bi(t),e)},Br.xor=uo,Br.xorBy=lo,Br.xorWith=po,Br.zip=ho,Br.zipObject=function(e,t){return yi(e||[],t||[],rn)},Br.zipObjectDeep=function(e,t){return yi(e||[],t||[],ti)},Br.zipWith=fo,Br.entries=Ba,Br.entriesIn=Wa,Br.extend=Sa,Br.extendWith=Ca,uc(Br,Br),Br.add=Ec,Br.attempt=tc,Br.camelCase=qa,Br.capitalize=za,Br.ceil=wc,Br.clamp=function(t,r,n){return n===e&&(n=r,r=e),n!==e&&(n=(n=_a(n))==n?n:0),r!==e&&(r=(r=_a(r))==r?r:0),dn(_a(t),r,n)},Br.clone=function(e){return un(e,4)},Br.cloneDeep=function(e){return un(e,5)},Br.cloneDeepWith=function(t,r){return un(t,5,r="function"==typeof r?r:e)},Br.cloneWith=function(t,r){return un(t,4,r="function"==typeof r?r:e)},Br.conformsTo=function(e,t){return null==t||ln(e,t,Na(t))},Br.deburr=Ga,Br.defaultTo=function(e,t){return null==e||e!=e?t:e},Br.divide=Sc,Br.endsWith=function(t,r,n){t=Ea(t),r=li(r);var i=t.length,s=n=n===e?i:dn(va(n),0,i);return(n-=r.length)>=0&&t.slice(n,s)==r},Br.eq=Ho,Br.escape=function(e){return(e=Ea(e))&&$.test(e)?e.replace(G,tr):e},Br.escapeRegExp=function(e){return(e=Ea(e))&&re.test(e)?e.replace(te,"\\$&"):e},Br.every=function(t,r,n){var i=Yo(t)?Tt:gn;return n&&Es(t,r,n)&&(r=e),i(t,us(r,3))},Br.find=_o,Br.findIndex=zs,Br.findKey=function(e,t){return xt(e,us(t,3),wn)},Br.findLast=bo,Br.findLastIndex=Gs,Br.findLastKey=function(e,t){return xt(e,us(t,3),Sn)},Br.floor=Cc,Br.forEach=Eo,Br.forEachRight=wo,Br.forIn=function(e,t){return null==e?e:bn(e,us(t,3),La)},Br.forInRight=function(e,t){return null==e?e:En(e,us(t,3),La)},Br.forOwn=function(e,t){return e&&wn(e,us(t,3))},Br.forOwnRight=function(e,t){return e&&Sn(e,us(t,3))},Br.get=Da,Br.gt=qo,Br.gte=zo,Br.has=function(e,t){return null!=e&&vs(e,t,Dn)},Br.hasIn=Ia,Br.head=$s,Br.identity=oc,Br.includes=function(e,t,r,n){e=Jo(e)?e:Ha(e),r=r&&!n?va(r):0;var i=e.length;return r<0&&(r=_r(i+r,0)),ua(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&jt(e,t,r)>-1},Br.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:va(r);return i<0&&(i=_r(n+i,0)),jt(e,t,i)},Br.inRange=function(t,r,n){return r=ga(r),n===e?(n=r,r=0):n=ga(n),function(e,t,r){return e>=br(t,r)&&e<_r(t,r)}(t=_a(t),r,n)},Br.invoke=Ma,Br.isArguments=Go,Br.isArray=Yo,Br.isArrayBuffer=$o,Br.isArrayLike=Jo,Br.isArrayLikeObject=Qo,Br.isBoolean=function(e){return!0===e||!1===e||ia(e)&&Rn(e)==v},Br.isBuffer=Ko,Br.isDate=Zo,Br.isElement=function(e){return ia(e)&&1===e.nodeType&&!aa(e)},Br.isEmpty=function(e){if(null==e)return!0;if(Jo(e)&&(Yo(e)||"string"==typeof e||"function"==typeof e.splice||Ko(e)||pa(e)||Go(e)))return!e.length;var t=gs(e);if(t==w||t==R)return!e.size;if(Ps(e))return!jn(e).length;for(var r in e)if(xe.call(e,r))return!1;return!0},Br.isEqual=function(e,t){return Nn(e,t)},Br.isEqualWith=function(t,r,n){var i=(n="function"==typeof n?n:e)?n(t,r):e;return i===e?Nn(t,r,e,n):!!i},Br.isError=Xo,Br.isFinite=function(e){return"number"==typeof e&&gr(e)},Br.isFunction=ea,Br.isInteger=ta,Br.isLength=ra,Br.isMap=sa,Br.isMatch=function(e,t){return e===t||Ln(e,t,ps(t))},Br.isMatchWith=function(t,r,n){return n="function"==typeof n?n:e,Ln(t,r,ps(r),n)},Br.isNaN=function(e){return oa(e)&&e!=+e},Br.isNative=function(e){if(Cs(e))throw new Ce("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return xn(e)},Br.isNil=function(e){return null==e},Br.isNull=function(e){return null===e},Br.isNumber=oa,Br.isObject=na,Br.isObjectLike=ia,Br.isPlainObject=aa,Br.isRegExp=ca,Br.isSafeInteger=function(e){return ta(e)&&e>=-9007199254740991&&e<=u},Br.isSet=da,Br.isString=ua,Br.isSymbol=la,Br.isTypedArray=pa,Br.isUndefined=function(t){return t===e},Br.isWeakMap=function(e){return ia(e)&&gs(e)==I},Br.isWeakSet=function(e){return ia(e)&&"[object WeakSet]"==Rn(e)},Br.join=function(e,t){return null==e?"":vr.call(e,t)},Br.kebabCase=Ya,Br.last=Zs,Br.lastIndexOf=function(t,r,n){var i=null==t?0:t.length;if(!i)return-1;var s=i;return n!==e&&(s=(s=va(n))<0?_r(i+s,0):br(s,i-1)),r==r?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(t,r,s):Ft(t,Vt,s,!0)},Br.lowerCase=$a,Br.lowerFirst=Ja,Br.lt=ha,Br.lte=fa,Br.max=function(t){return t&&t.length?vn(t,oc,kn):e},Br.maxBy=function(t,r){return t&&t.length?vn(t,us(r,2),kn):e},Br.mean=function(e){return Bt(e,oc)},Br.meanBy=function(e,t){return Bt(e,us(t,2))},Br.min=function(t){return t&&t.length?vn(t,oc,Vn):e},Br.minBy=function(t,r){return t&&t.length?vn(t,us(r,2),Vn):e},Br.stubArray=yc,Br.stubFalse=_c,Br.stubObject=function(){return{}},Br.stubString=function(){return""},Br.stubTrue=function(){return!0},Br.multiply=Pc,Br.nth=function(t,r){return t&&t.length?zn(t,va(r)):e},Br.noConflict=function(){return ut._===this&&(ut._=Be),this},Br.noop=lc,Br.now=Do,Br.pad=function(e,t,r){e=Ea(e);var n=(t=va(t))?dr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return Gi(Ht(i),r)+e+Gi(Lt(i),r)},Br.padEnd=function(e,t,r){e=Ea(e);var n=(t=va(t))?dr(e):0;return t&&n<t?e+Gi(t-n,r):e},Br.padStart=function(e,t,r){e=Ea(e);var n=(t=va(t))?dr(e):0;return t&&n<t?Gi(t-n,r)+e:e},Br.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),wr(Ea(e).replace(ne,""),t||0)},Br.random=function(t,r,n){if(n&&"boolean"!=typeof n&&Es(t,r,n)&&(r=n=e),n===e&&("boolean"==typeof r?(n=r,r=e):"boolean"==typeof t&&(n=t,t=e)),t===e&&r===e?(t=0,r=1):(t=ga(t),r===e?(r=t,t=0):r=ga(r)),t>r){var i=t;t=r,r=i}if(n||t%1||r%1){var s=Sr();return br(t+s*(r-t+ot("1e-"+((s+"").length-1))),r)}return Qn(t,r)},Br.reduce=function(e,t,r){var n=Yo(e)?Ot:qt,i=arguments.length<3;return n(e,us(t,4),r,i,fn)},Br.reduceRight=function(e,t,r){var n=Yo(e)?Mt:qt,i=arguments.length<3;return n(e,us(t,4),r,i,mn)},Br.repeat=function(t,r,n){return r=(n?Es(t,r,n):r===e)?1:va(r),Kn(Ea(t),r)},Br.replace=function(){var e=arguments,t=Ea(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Br.result=function(t,r,n){var i=-1,s=(r=Ei(r,t)).length;for(s||(s=1,t=e);++i<s;){var o=null==t?e:t[Us(r[i])];o===e&&(i=s,o=n),t=ea(o)?o.call(t):o}return t},Br.round=Tc,Br.runInContext=l,Br.sample=function(e){return(Yo(e)?Zr:Xn)(e)},Br.size=function(e){if(null==e)return 0;if(Jo(e))return ua(e)?dr(e):e.length;var t=gs(e);return t==w||t==R?e.size:jn(e).length},Br.snakeCase=Qa,Br.some=function(t,r,n){var i=Yo(t)?Nt:oi;return n&&Es(t,r,n)&&(r=e),i(t,us(r,3))},Br.sortedIndex=function(e,t){return ai(e,t)},Br.sortedIndexBy=function(e,t,r){return ci(e,t,us(r,2))},Br.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=ai(e,t);if(n<r&&Ho(e[n],t))return n}return-1},Br.sortedLastIndex=function(e,t){return ai(e,t,!0)},Br.sortedLastIndexBy=function(e,t,r){return ci(e,t,us(r,2),!0)},Br.sortedLastIndexOf=function(e,t){if(null!=e&&e.length){var r=ai(e,t,!0)-1;if(Ho(e[r],t))return r}return-1},Br.startCase=Ka,Br.startsWith=function(e,t,r){return e=Ea(e),r=null==r?0:dn(va(r),0,e.length),t=li(t),e.slice(r,r+t.length)==t},Br.subtract=Rc,Br.sum=function(e){return e&&e.length?zt(e,oc):0},Br.sumBy=function(e,t){return e&&e.length?zt(e,us(t,2)):0},Br.template=function(t,r,n){var i=Br.templateSettings;n&&Es(t,r,n)&&(r=e),t=Ea(t),r=Ca({},r,i,es);var s,o,a=Ca({},r.imports,i.imports,es),c=Na(a),d=Jt(a,c),u=0,l=r.interpolate||_e,p="__p += '",h=ke((r.escape||_e).source+"|"+l.source+"|"+(l===K?le:_e).source+"|"+(r.evaluate||_e).source+"|$","g"),f="//# sourceURL="+(xe.call(r,"sourceURL")?(r.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++rt+"]")+"\n";t.replace(h,(function(e,r,n,i,a,c){return n||(n=i),p+=t.slice(u,c).replace(be,rr),r&&(s=!0,p+="' +\n__e("+r+") +\n'"),a&&(o=!0,p+="';\n"+a+";\n__p += '"),n&&(p+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=c+e.length,e})),p+="';\n";var m=xe.call(r,"variable")&&r.variable;if(m){if(de.test(m))throw new Ce("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(o?p.replace(W,""):p).replace(H,"$1").replace(q,"$1;"),p="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var g=tc((function(){return Pe(c,f+"return "+p).apply(e,d)}));if(g.source=p,Xo(g))throw g;return g},Br.times=function(e,t){if((e=va(e))<1||e>u)return[];var r=h,n=br(e,h);t=us(t),e-=h;for(var i=Gt(n,t);++r<e;)t(r);return i},Br.toFinite=ga,Br.toInteger=va,Br.toLength=ya,Br.toLower=function(e){return Ea(e).toLowerCase()},Br.toNumber=_a,Br.toSafeInteger=function(e){return e?dn(va(e),-9007199254740991,u):0===e?e:0},Br.toString=Ea,Br.toUpper=function(e){return Ea(e).toUpperCase()},Br.trim=function(t,r,n){if((t=Ea(t))&&(n||r===e))return Yt(t);if(!t||!(r=li(r)))return t;var i=ur(t),s=ur(r);return Si(i,Kt(i,s),Zt(i,s)+1).join("")},Br.trimEnd=function(t,r,n){if((t=Ea(t))&&(n||r===e))return t.slice(0,lr(t)+1);if(!t||!(r=li(r)))return t;var i=ur(t);return Si(i,0,Zt(i,ur(r))+1).join("")},Br.trimStart=function(t,r,n){if((t=Ea(t))&&(n||r===e))return t.replace(ne,"");if(!t||!(r=li(r)))return t;var i=ur(t);return Si(i,Kt(i,ur(r))).join("")},Br.truncate=function(t,r){var n=30,i="...";if(na(r)){var s="separator"in r?r.separator:s;n="length"in r?va(r.length):n,i="omission"in r?li(r.omission):i}var o=(t=Ea(t)).length;if(nr(t)){var a=ur(t);o=a.length}if(n>=o)return t;var c=n-dr(i);if(c<1)return i;var d=a?Si(a,0,c).join(""):t.slice(0,c);if(s===e)return d+i;if(a&&(c+=d.length-c),ca(s)){if(t.slice(c).search(s)){var u,l=d;for(s.global||(s=ke(s.source,Ea(pe.exec(s))+"g")),s.lastIndex=0;u=s.exec(l);)var p=u.index;d=d.slice(0,p===e?c:p)}}else if(t.indexOf(li(s),c)!=c){var h=d.lastIndexOf(s);h>-1&&(d=d.slice(0,h))}return d+i},Br.unescape=function(e){return(e=Ea(e))&&Y.test(e)?e.replace(z,pr):e},Br.uniqueId=function(e){var t=++Fe;return Ea(e)+t},Br.upperCase=Za,Br.upperFirst=Xa,Br.each=Eo,Br.eachRight=wo,Br.first=$s,uc(Br,(bc={},wn(Br,(function(e,t){xe.call(Br.prototype,t)||(bc[t]=e)})),bc),{chain:!1}),Br.VERSION="4.17.21",Ct(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Br[e].placeholder=Br})),Ct(["drop","take"],(function(t,r){zr.prototype[t]=function(n){n=n===e?1:_r(va(n),0);var i=this.__filtered__&&!r?new zr(this):this.clone();return i.__filtered__?i.__takeCount__=br(n,i.__takeCount__):i.__views__.push({size:br(n,h),type:t+(i.__dir__<0?"Right":"")}),i},zr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),Ct(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;zr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:us(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),Ct(["head","last"],(function(e,t){var r="take"+(t?"Right":"");zr.prototype[e]=function(){return this[r](1).value()[0]}})),Ct(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");zr.prototype[e]=function(){return this.__filtered__?new zr(this):this[r](1)}})),zr.prototype.compact=function(){return this.filter(oc)},zr.prototype.find=function(e){return this.filter(e).head()},zr.prototype.findLast=function(e){return this.reverse().find(e)},zr.prototype.invokeMap=Zn((function(e,t){return"function"==typeof e?new zr(this):this.map((function(r){return On(r,e,t)}))})),zr.prototype.reject=function(e){return this.filter(jo(us(e)))},zr.prototype.slice=function(t,r){t=va(t);var n=this;return n.__filtered__&&(t>0||r<0)?new zr(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),r!==e&&(n=(r=va(r))<0?n.dropRight(-r):n.take(r-t)),n)},zr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},zr.prototype.toArray=function(){return this.take(h)},wn(zr.prototype,(function(t,r){var n=/^(?:filter|find|map|reject)|While$/.test(r),i=/^(?:head|last)$/.test(r),s=Br[i?"take"+("last"==r?"Right":""):r],o=i||/^find/.test(r);s&&(Br.prototype[r]=function(){var r=this.__wrapped__,a=i?[1]:arguments,c=r instanceof zr,d=a[0],u=c||Yo(r),l=function(e){var t=s.apply(Br,At([e],a));return i&&p?t[0]:t};u&&n&&"function"==typeof d&&1!=d.length&&(c=u=!1);var p=this.__chain__,h=!!this.__actions__.length,f=o&&!p,m=c&&!h;if(!o&&u){r=m?r:new zr(this);var g=t.apply(r,a);return g.__actions__.push({func:go,args:[l],thisArg:e}),new qr(g,p)}return f&&m?t.apply(this,a):(g=this.thru(l),f?i?g.value()[0]:g.value():g)})})),Ct(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Ae[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Br.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Yo(i)?i:[],e)}return this[r]((function(r){return t.apply(Yo(r)?r:[],e)}))}})),wn(zr.prototype,(function(e,t){var r=Br[t];if(r){var n=r.name+"";xe.call(Or,n)||(Or[n]=[]),Or[n].push({name:t,func:r})}})),Or[Wi(e,2).name]=[{name:"wrapper",func:e}],zr.prototype.clone=function(){var e=new zr(this.__wrapped__);return e.__actions__=Ai(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Ai(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Ai(this.__views__),e},zr.prototype.reverse=function(){if(this.__filtered__){var e=new zr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},zr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Yo(e),n=t<0,i=r?e.length:0,s=function(e,t,r){for(var n=-1,i=r.length;++n<i;){var s=r[n],o=s.size;switch(s.type){case"drop":e+=o;break;case"dropRight":t-=o;break;case"take":t=br(t,e+o);break;case"takeRight":e=_r(e,t-o)}}return{start:e,end:t}}(0,i,this.__views__),o=s.start,a=s.end,c=a-o,d=n?a:o-1,u=this.__iteratees__,l=u.length,p=0,h=br(c,this.__takeCount__);if(!r||!n&&i==c&&h==c)return gi(e,this.__actions__);var f=[];e:for(;c--&&p<h;){for(var m=-1,g=e[d+=t];++m<l;){var v=u[m],y=v.iteratee,_=v.type,b=y(g);if(2==_)g=b;else if(!b){if(1==_)continue e;break e}}f[p++]=g}return f},Br.prototype.at=vo,Br.prototype.chain=function(){return mo(this)},Br.prototype.commit=function(){return new qr(this.value(),this.__chain__)},Br.prototype.next=function(){this.__values__===e&&(this.__values__=ma(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?e:this.__values__[this.__index__++]}},Br.prototype.plant=function(t){for(var r,n=this;n instanceof Hr;){var i=Bs(n);i.__index__=0,i.__values__=e,r?s.__wrapped__=i:r=i;var s=i;n=n.__wrapped__}return s.__wrapped__=t,r},Br.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof zr){var r=t;return this.__actions__.length&&(r=new zr(this)),(r=r.reverse()).__actions__.push({func:go,args:[ro],thisArg:e}),new qr(r,this.__chain__)}return this.thru(ro)},Br.prototype.toJSON=Br.prototype.valueOf=Br.prototype.value=function(){return gi(this.__wrapped__,this.__actions__)},Br.prototype.first=Br.prototype.head,ct&&(Br.prototype[ct]=function(){return this}),Br}();pt?((pt.exports=hr)._=hr,lt._=hr):ut._=hr}.call(l);var V_,B_=l&&l.__extends||(V_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}V_(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(j_,"__esModule",{value:!0});var W_,H_,q_,z_,G_,Y_,$_,J_,Q_,K_=U_.exports,Z_=["MaxBatchSize","MaxDelay","MinDelay"],X_=function(e){function t(t){var r=e.call(this)||this;return r.fifo=[],r.firstBatch=!0,function(e){if(Z_.forEach((function(t){if(!e.hasOwnProperty(t))throw new Error("Missing required MessageBatcher option: "+t)})),isNaN(e.MaxBatchSize))throw new Error("MessageBatcher MaxBatchSize option must be a number");if(!isFinite(e.MaxBatchSize))throw new Error("MessageBatcher MaxBatchSize option must be a finite number");if(e.MaxBatchSize<1)throw new Error("MessageBatcher MaxBatchSize option cannot be less than 1");if(isNaN(e.MaxDelay))throw new Error("MessageBatcher MaxDelay option must be a number");if(!isFinite(e.MaxDelay))throw new Error("MessageBatcher MaxDelay option must be a finite number");if(e.MaxDelay<0)throw new Error("MessageBatcher MaxDelay option cannot be less than 0");if(isNaN(e.MinDelay))throw new Error("MessageBatcher MinDelay option must be a number");if(!isFinite(e.MinDelay))throw new Error("MessageBatcher MinDelay option must be a finite number");if(e.MinDelay<0)throw new Error("MessageBatcher MinDelay option cannot be less than 0");if(e.MinDelay>e.MaxDelay)throw new Error("MessageBatcher MinDelay option cannot be greater than MaxDelay")}(t),r.options=t,r.releaseBatchDebouncedMax=K_.debounce(r.releaseBatch.bind(r),r.options.MaxDelay,{maxWait:r.options.MaxDelay}),r.releaseBatchDebouncedMin=K_.debounce(r.releaseBatch.bind(r),r.options.MinDelay,{maxWait:r.options.MinDelay}),r}return B_(t,e),t.prototype.Queue=function(e){var t=this;(e=[].concat(e)).forEach((function(e){t.fifo.push(e),t.debounce(t.fifo,t.options.MaxBatchSize)}),this)},t.prototype.debounce=function(e,t){e.length>0&&(e.length>=t?this.firstBatch?(this.firstBatch=!1,this.releaseBatchDebouncedMax.flush()):(this.releaseBatchDebouncedMax.cancel(),this.releaseBatchDebouncedMin(e,t)):(this.releaseBatchDebouncedMin.cancel(),this.releaseBatchDebouncedMax(e,t)))},t.prototype.releaseBatch=function(e,t){var r=this.drainFIFO(e,t);r&&r.length&&(this.emit("batch",r),this.debounce(e,t))},t.prototype.drainFIFO=function(e,t){return e.length>0?e.splice(0,t):e},t}(e.EventEmitter);j_.MessageBatcher=X_,function(e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(j_)}(F_),function(e){Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(F_)}(x_);class eb{constructor(e){W_.add(this),H_.set(this,void 0),q_.set(this,void 0),z_.set(this,void 0),G_.set(this,void 0),Y_.set(this,void 0),$_.set(this,void 0);const{logLevel:t,namespace:r,onLogMessage:n}=e;d(this,$_,e.clientMetaProvider,"f"),d(this,H_,r,"f"),d(this,q_,t,"f"),this.onLogMessage=n,d(this,G_,new w_,"f"),d(this,z_,new x_.MessageBatcher({MaxBatchSize:50,MaxDelay:1e3,MinDelay:500}),"f"),d(this,Y_,e.sendAnalytics,"f"),c(this,z_,"f").on("batch",(e=>{this.logToApi(e).catch((e=>{this.error("Failed to log to api",{case:"Logger",error:Ct(e)})}))})),this._debug=L_("LiveDigital").extend("debug").extend(c(this,H_,"f")),this._info=L_("LiveDigital").extend("info").extend(c(this,H_,"f")),this._warn=L_("LiveDigital").extend("warn").extend(c(this,H_,"f")),this._error=L_("LiveDigital").extend("error").extend(c(this,H_,"f")),this._debug.log=console.info.bind(console),this._info.log=console.info.bind(console),this._warn.log=console.warn.bind(console),this._error.log=console.error.bind(console)}debug(e,t){this._debug(e,t),c(this,Y_,"f")&&c(this,z_,"f").Queue({level:"debug",message:e,meta:t}),c(this,q_,"f")>=ht&&c(this,W_,"m",J_).call(this,"debug",e,t)}info(e,t){this._info(e,t),c(this,Y_,"f")&&c(this,z_,"f").Queue({level:"info",message:e,meta:t}),c(this,q_,"f")>=pt&&c(this,W_,"m",J_).call(this,"info",e,t)}warn(e,t){this._warn(e,t),c(this,Y_,"f")&&c(this,z_,"f").Queue({level:"warn",message:e,meta:t}),c(this,q_,"f")>=lt&&c(this,W_,"m",J_).call(this,"warn",e,t)}error(e,t){this._error(e,t),c(this,Y_,"f")&&c(this,z_,"f").Queue({level:"error",message:e,meta:t}),c(this,q_,"f")>=ut&&c(this,W_,"m",J_).call(this,"error",e,t)}logToApi(e){return a(this,void 0,void 0,(function*(){try{yield c(this,G_,"f").log.batch({logs:e.map((e=>c(this,W_,"m",Q_).call(this,Object.assign(Object.assign({},e),{meta:this.prepareRecordMeta(e.meta)})))),clientMeta:this.getClientMeta()})}catch(e){this._debug("Log request was not successful",{error:e})}}))}getClientMeta(){return Object.assign(Object.assign({},c(this,$_,"f").meta),{clUId:Df()})}prepareRecordMeta(e){const t=null!=e?e:{},{error:r}=t;return Object.assign(Object.assign(Object.assign({},t),{clientTimestamp:(new Date).toISOString(),from_sdk:!0}),r&&"object"==typeof r?{error:Ct(r)}:{})}}H_=new WeakMap,q_=new WeakMap,z_=new WeakMap,G_=new WeakMap,Y_=new WeakMap,$_=new WeakMap,W_=new WeakSet,J_=function(e,t,...r){"function"==typeof this.onLogMessage&&this.onLogMessage(t,...c(this,W_,"m",Q_).call(this,r),e)},Q_=function(e){const t=new WeakMap;return function e(r,n=[]){if(!wn(r))return r;const i=t.get(r);if(i)return`[Circular *${i.join(".")}]`;t.set(r,n);const s=Array.isArray(r)?[]:{};return Object.entries(r).forEach((([t,r])=>{s[t]=e(r,[...n,t])})),t.delete(r),s}(e)};let tb=class{constructor(e){this.peerTrackFactory=e,this.tracksByConsumerId=new Map}register(e,t){this.tracksByConsumerId.set(e,t)}get(e){return this.tracksByConsumerId.get(e)}delete(e){return this.tracksByConsumerId.delete(e)}reset(){this.tracksByConsumerId.clear()}create(e){const{consumer:t,label:r,muted:n=!1,mediaStreamTrack:i,paused:s,peerEventEmitter:o}=e,a=this.peerTrackFactory({consumer:t,label:r,mediaStreamTrack:i,paused:s,peerEventEmitter:o,muted:n,onClose:()=>{void 0!==a.consumerId&&this.delete(a.consumerId)}});return void 0!==a.consumerId&&this.register(a.consumerId,a),a}};var rb,nb,ib;tb=i([at(),s(0,dt(Mn.PeerTrackFactory)),o("design:paramtypes",[Function])],tb);const sb=["frozen-video-track","network-media-sync-failure","encoder-cpu-throttling","decoder-cpu-throttling","missing-video-stream-data","missing-audio-stream-data"];let ob=class{constructor(e,t,r,n,i,s){this.analyticsApiClient=e,this.peers=t,this.myPeer=r,this.transportsStatsProvider=i,this.clientMetaProvider=s,rb.set(this,void 0),nb.set(this,void 0),ib.set(this,void 0),d(this,ib,n("IntegrationsService"),"f"),d(this,nb,new x_.MessageBatcher({MaxBatchSize:50,MaxDelay:6e4,MinDelay:3e4}),"f"),c(this,nb,"f").on("batch",(e=>{this.analyticsApiClient.metrics.sendWIDMetrics({reasons:e,clientMeta:this.getClientMeta()}).catch((e=>{c(this,ib,"f").debug("Failed to sendWIDMetrics",{error:Ct(e)})}))})),d(this,rb,new x_.MessageBatcher({MaxBatchSize:20,MaxDelay:6e4,MinDelay:2e4}),"f"),c(this,rb,"f").on("batch",(e=>{this.analyticsApiClient.metrics.sendNetworkMetrics({metrics:this.getWorstPerDirectionMetric(e),clientMeta:this.getClientMeta()}).catch((e=>{c(this,ib,"f").debug("Failed to sendNetworkMetrics",{error:Ct(e)})}))}))}handleIssues(e){e.forEach((e=>c(this,ib,"f").info("WebRTCIssue",e)));const t=e.filter((e=>sb.includes(e.reason)));0!==t.length&&t.forEach((e=>c(this,nb,"f").Queue(e.reason)))}handleNetworkScores(e){var t,r,n,i,s,o,a,d,u,l,p,h;const{inbound:f,outbound:m,statsSamples:{inboundStatsSample:g,outboundStatsSample:v}}=e,y=this.getNodeActiveStreamsStat(),_=this.transportsStatsProvider.getStats();if(void 0!==f&&g){const e={jitter:Math.round(g.avgJitter),packetLoss:g.packetsLoss,rtt:g.rtt,mos:Math.round(10*f)/10,streams:y.inboundActiveStreams,direction:"inbound",node:null!==(t=this.clientMetaProvider.meta.datacenterName)&&void 0!==t?t:"unknown node",bitrate:null!==(n=null===(r=null==_?void 0:_.inbound)||void 0===r?void 0:r.bitrate)&&void 0!==n?n:0,timestamp:(new Date).toISOString(),Qa:null===(i=null==_?void 0:_.inbound)||void 0===i?void 0:i.Qa,Qv:null===(s=null==_?void 0:_.inbound)||void 0===s?void 0:s.Qv,Qav:null===(o=null==_?void 0:_.inbound)||void 0===o?void 0:o.Qav};c(this,rb,"f").Queue(e)}if(void 0!==m&&v){const e={jitter:Math.round(v.avgJitter),packetLoss:v.packetsLoss,rtt:v.rtt,mos:Math.round(10*m)/10,streams:y.outboundActiveStreams,direction:"outbound",node:null!==(a=this.clientMetaProvider.meta.datacenterName)&&void 0!==a?a:"unknown node",bitrate:null!==(u=null===(d=null==_?void 0:_.outbound)||void 0===d?void 0:d.bitrate)&&void 0!==u?u:0,timestamp:(new Date).toISOString(),Qa:null===(l=null==_?void 0:_.outbound)||void 0===l?void 0:l.Qa,Qv:null===(p=null==_?void 0:_.outbound)||void 0===p?void 0:p.Qv,Qav:null===(h=null==_?void 0:_.outbound)||void 0===h?void 0:h.Qav};c(this,rb,"f").Queue(e)}}getNodeActiveStreamsStat(){var e;const t=this.peers.hosts().filter((e=>{var t;return e.id!==(null===(t=this.myPeer)||void 0===t?void 0:t.id)})).reduce(((e,t)=>e+t.getActiveTracksCount()),0),r=this.myPeer.get();return{inboundActiveStreams:t,outboundActiveStreams:null!==(e=null==r?void 0:r.getActivePublishersCount())&&void 0!==e?e:0}}getClientMeta(){return Object.assign(Object.assign({},this.clientMetaProvider.meta),{clientUniqueId:Df()})}getWorstPerDirectionMetric(e){return["inbound","outbound"].map((t=>this.pickWorstMetric(e.filter((e=>e.direction===t))))).filter((e=>void 0!==e))}pickWorstMetric(e){if(!e.length)return;const t=e.filter((e=>"number"==typeof e.Qav));return t.length?t.reduce(((e,t)=>t.Qav<e.Qav?t:e)):e.reduce(((e,t)=>t.jitter>e.jitter?t:e))}};rb=new WeakMap,nb=new WeakMap,ib=new WeakMap,ob=i([at(),s(0,dt(Mn.AnalyticsApiClient)),s(1,dt(Mn.Peers)),s(2,dt(Mn.MyPeer)),s(3,dt(Mn.LoggerFactory)),s(4,dt(Mn.TransportsStatsProvider)),s(5,dt(Mn.ClientMetaProvider)),o("design:paramtypes",[w_,Object,Ss,Function,Hg,mr])],ob);var ab,cb,db,ub,lb,pb,hb,fb,mb,gb=ob;!function(e){e.INFO="info",e.WARNING="warning",e.ERROR="error"}(hb||(hb={})),function(e){e[e.PERFORMANCE_STOP=1001]="PERFORMANCE_STOP",e[e.REDUCE_LATENCY=1002]="REDUCE_LATENCY"}(fb||(fb={})),function(e){e.ATSVB="atsvb",e.STREAM_PROCESSOR="stream_processor",e.ML_INFERENCE="ml_inference",e.MODEL="model",e.WORKLET="worklet",e.WORKER="worker",e.MODEL_LOADER="model_loader"}(mb||(mb={}));const vb=()=>{};class yb{constructor(e){ab.set(this,void 0),cb.set(this,void 0),db.set(this,null),ub.set(this,new Map),lb.set(this,void 0),this.type="asdk",pb.set(this,void 0);const{loggerFactory:t}=e;d(this,cb,t("ASDKTrackProcessor"),"f"),d(this,pb,"function"==typeof e.onError?e.onError:vb,"f"),d(this,ab,new window.atsvb(e.asdkCustomerId),"f");const n=e.config.get("staticFilesPath"),{localDir:i,version:s,sdk_url:o,api_url:a}=e.config.get("asdk");let u=`https://effectssdk.ai/sdk/audio/dev/${null!=s?s:"2.4.3"}`;if(i){u=new r(`${i}/${null!=s?s:"2.4.3"}`,n).href}const l={preset:"balanced",sample_rate:48e3,api_url:a,wasmPaths:{"ort-wasm.wasm":`${u}/ort-wasm.wasm`,"ort-wasm-simd.wasm":`${u}/ort-wasm-simd.wasm`}},p=!o&&i,h=p?`${u}/`:o;p&&c(this,cb,"f").warn("Using static ASDK path due to missing config",Object.assign(Object.assign({case:"Denoiser",type:"asdk"},e.config.get("asdk")),{sdkUrl:l.sdk_url})),h&&(l.sdk_url=h),c(this,ab,"f").config(l),c(this,ab,"f").onError(this.onError.bind(this))}setOnError(e){d(this,pb,e,"f")}init(){return a(this,void 0,void 0,(function*(){yield c(this,ab,"f").preload()}))}release(){c(this,ab,"f").stop(),c(this,ab,"f").clear()}get isProcessing(){return!!c(this,lb,"f")}processTrack(e){return a(this,void 0,void 0,(function*(){var t;if(c(this,db,"f")===e||"ended"===e.readyState)return(null===(t=c(this,ab,"f").getStream())||void 0===t?void 0:t.getAudioTracks()[0])||e;this.stopProcessing();try{const t=new Promise(((t,r)=>{c(this,ab,"f").onReady=()=>{try{const r=c(this,ab,"f").getStream(),n=null==r?void 0:r.getAudioTracks()[0];if(!n)return void t(e);d(this,db,e,"f"),d(this,lb,n,"f"),t(n),c(this,ab,"f").run()}catch(e){r(e)}finally{c(this,ab,"f").onReady=void 0}}}));c(this,ab,"f").useStream(new MediaStream([e]));const r=yield t;return c(this,cb,"f").info("processTrack()",{case:"Denoiser",type:this.type,track:e.id}),r}catch(t){throw c(this,cb,"f").error("processTrack()",{error:Ct(t),type:this.type,case:"Denoiser",track:e}),c(this,pb,"f").call(this,"ASDK processTrack() error",t),d(this,pb,vb,"f"),new Error("Can not process this track")}}))}stopProcessing(){try{c(this,ab,"f").stop()}catch(e){c(this,cb,"f").error("stopProcessing()",{type:this.type,case:"Denoiser",error:Ct(e)})}finally{d(this,db,null,"f")}}getUpdatedDebounceCounter(e){var t;let r=null!==(t=c(this,ub,"f").get(e))&&void 0!==t?t:0;return r+=1,c(this,ub,"f").set(e,r),setTimeout((()=>{var t;const r=null!==(t=c(this,ub,"f").get(e))&&void 0!==t?t:0;r<=0?c(this,ub,"f").set(e,0):c(this,ub,"f").set(e,r-1)}),1e4),r}onError(e){const{message:t,type:r,cause:i}=e,s=n(e,["message","type","cause"]);if(r===hb.ERROR)if(c(this,cb,"f").error(t,Object.assign(Object.assign({error:Ct(i),cause:i},s),{type:this.type,case:"Denoiser"})),s.code===fb.REDUCE_LATENCY||s.code===fb.PERFORMANCE_STOP){this.getUpdatedDebounceCounter(s.code)>3&&(c(this,ub,"f").set(s.code,0),c(this,pb,"f").call(this,`ASDK performance issue(${s.code}): ${t}`,i),d(this,pb,vb,"f"))}else c(this,pb,"f").call(this,`ASDK runtime error: ${t}`,i),d(this,pb,vb,"f");r===hb.WARNING&&c(this,cb,"f").warn(t,Object.assign(Object.assign({},s),{type:this.type,case:"Denoiser"})),r===hb.INFO&&c(this,cb,"f").info(t,Object.assign(Object.assign({},s),{type:this.type,case:"Denoiser"}))}}ab=new WeakMap,cb=new WeakMap,db=new WeakMap,ub=new WeakMap,lb=new WeakMap,pb=new WeakMap;class _b extends AudioWorkletNode{constructor(e){super(e.context,"rnnoise",{channelCountMode:"explicit",channelCount:1,channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,outputChannelCount:[1],processorOptions:{module:e.noiseSuppressor.module}}),this.port.onmessage=({data:e})=>{const t=Object.assign(new Event("status"),e);this.dispatchEvent(t)}}update(e){this.port.postMessage(e)}static register(e){return a(this,void 0,void 0,(function*(){const t=RE.get(Mn.Config);yield e.audioWorklet.addModule(`${t.get("staticFilesPath")}/noiseSuppressionWorklet.js`)}))}}var bb,Eb,wb,Sb,Cb,Pb;class Tb{constructor(e){bb.set(this,void 0),Eb.set(this,void 0),wb.set(this,void 0),Sb.set(this,void 0),Cb.set(this,void 0),Pb.set(this,!0),d(this,bb,e.noiseSuppressor.instance.exports,"f"),d(this,Eb,e.context,"f"),d(this,wb,new Float32Array(c(this,bb,"f").memory.buffer),"f"),d(this,Sb,c(this,bb,"f").newState(),"f"),d(this,Cb,c(this,Eb,"f").createScriptProcessor(),"f"),this.setOnAudioProcess()}get noiseSuppressionScriptProcessorNode(){return c(this,Cb,"f")}update(e){e||(d(this,Pb,!1,"f"),c(this,bb,"f").deleteState(c(this,Sb,"f")));const t=Object.assign(new Event("status"),{vadProb:c(this,bb,"f").getVadProb(c(this,Sb,"f"))});c(this,Cb,"f").dispatchEvent(t)}setOnAudioProcess(){c(this,Cb,"f").addEventListener("audioprocess",(({inputBuffer:e,outputBuffer:t})=>{if(!c(this,Pb,"f"))return;c(this,wb,"f").set(e.getChannelData(0),c(this,bb,"f").getInput(c(this,Sb,"f"))/4);const r=t.getChannelData(0),n=c(this,bb,"f").pipe(c(this,Sb,"f"),r.length)/4;n&&r.set(c(this,wb,"f").subarray(n,n+r.length))}))}}var Rb,kb,Db,Ib,Ab,Ob,Mb,Nb,Lb,xb,Fb,jb,Ub,Vb,Bb,Wb,Hb,qb,zb,Gb,Yb,$b,Jb,Qb,Kb,Zb,Xb,eE,tE,rE,nE,iE,sE,oE,aE,cE,dE,uE,lE,pE,hE,fE,mE,gE,vE;bb=new WeakMap,Eb=new WeakMap,wb=new WeakMap,Sb=new WeakMap,Cb=new WeakMap,Pb=new WeakMap;class yE{constructor({context:e,noiseSuppressor:t}){Rb.set(this,void 0),kb.set(this,void 0),Db.set(this,void 0),d(this,Rb,e,"f"),d(this,kb,t,"f")}createNoiseSuppressionNode(){return a(this,void 0,void 0,(function*(){return/apple/i.test(navigator.vendor)?this.createScriptProcessorNode():yield this.createAudioWorkletNode()}))}stop(){var e;null===(e=c(this,Db,"f"))||void 0===e||e.update(!1)}createAudioWorkletNode(){return a(this,void 0,void 0,(function*(){return yield _b.register(c(this,Rb,"f")),d(this,Db,new _b({context:c(this,Rb,"f"),noiseSuppressor:c(this,kb,"f")}),"f"),c(this,Db,"f")}))}createScriptProcessorNode(){return d(this,Db,new Tb({context:c(this,Rb,"f"),noiseSuppressor:c(this,kb,"f")}),"f"),c(this,Db,"f").noiseSuppressionScriptProcessorNode}}Rb=new WeakMap,kb=new WeakMap,Db=new WeakMap;class _E{constructor(e){Ib.set(this,void 0),Ab.set(this,void 0),Ob.set(this,void 0),Mb.set(this,void 0),this.type="rnnoise",d(this,Ib,e.noiseSuppressor,"f"),d(this,Ob,e.loggerFactory("TrackProcessor"),"f")}get isProcessing(){return!!c(this,Mb,"f")}release(){this.stopProcessing()}processTrack(e){return a(this,void 0,void 0,(function*(){const t=(e=>{const t=window.AudioContext||window.webkitAudioContext||!1;return t?new t(e):null})();if(!t)throw new Error("AudioContext is not available");const r=new MediaStreamAudioDestinationNode(t,{channelCountMode:"explicit",channelCount:1,channelInterpretation:"speakers"});yield _b.register(t);const n=t.createMediaStreamSource(new MediaStream([e])),i=new yE({context:t,noiseSuppressor:c(this,Ib,"f")}),s=yield i.createNoiseSuppressionNode();s.connect(r),n.connect(s);const[o]=r.stream.getTracks();return d(this,Ab,{audioContext:t,streamDestination:r,noiseSuppressionNode:s,noiseSuppressionProvider:i},"f"),d(this,Mb,o,"f"),c(this,Ob,"f").info("processTrack()",{case:"Denoiser",type:this.type,track:e.id}),o}))}stopProcessing(){var e;if(this.isProcessing)if(c(this,Ab,"f"))try{c(this,Ab,"f").noiseSuppressionProvider.stop(),c(this,Ab,"f").noiseSuppressionNode.disconnect(),c(this,Ab,"f").streamDestination.disconnect(),c(this,Ab,"f").audioContext.close().catch((e=>{c(this,Ob,"f").error("stopProcessing()",{success:!1,error:Ct(e),case:"Denoiser",type:this.type})})),null===(e=c(this,Mb,"f"))||void 0===e||e.stop(),d(this,Mb,void 0,"f"),c(this,Ob,"f").info("stopProcessing()",{success:!0,case:"Denoiser",type:this.type})}catch(e){c(this,Ob,"f").error("stopProcessing()",{success:!1,error:Ct(e),case:"Denoiser",type:this.type})}else c(this,Ob,"f").warn("stopProcessing()",{success:!1,description:"Processing context is not available",case:"Denoiser",type:this.type});else c(this,Ob,"f").debug("stopProcessing()",{description:"Track is not processed",case:"Denoiser",type:this.type})}}Ib=new WeakMap,Ab=new WeakMap,Ob=new WeakMap,Mb=new WeakMap;class bE extends im{constructor(e){super(e),Nb.set(this,!1),Lb.set(this,void 0),xb.set(this,void 0),Fb.set(this,void 0),d(this,Fb,e.clientEventEmitter,"f")}get isDenoiserRequireActivation(){var e;return!(null===(e=c(this,Lb,"f"))||void 0===e?void 0:e.isProcessing)&&c(this,Nb,"f")}setTrackProcessor(e){if(!e)throw new Pt("track_processor_missing",new Error("trackProcessor must be passed as parameter"));this.logger.debug("Setting trackProcessor to AudioTrack",{case:"Denoiser",type:e.type}),d(this,Lb,e,"f")}unsetTrackProcessor(){d(this,Lb,void 0,"f")}get isEffectsProcessing(){var e;return Boolean(null===(e=c(this,Lb,"f"))||void 0===e?void 0:e.isProcessing)}getEncoderConfig(){return this.encoderConfig}getEncodings(){var e;return null!==(e=this.getEncoderConfig().encodings)&&void 0!==e?e:kc}getCodecOptions(){var e,t;return{opusFec:null===(e=this.getEncoderConfig().enableFec)||void 0===e||e,opusDtx:null===(t=this.getEncoderConfig().enableDtx)||void 0===t||t}}getPreferredCodec(){const{preferredCodec:e}=this.getEncoderConfig();return e||"opus"}enableNoiseSuppression(){return a(this,void 0,void 0,(function*(){var e,t,r;if(d(this,Nb,!0,"f"),!c(this,Lb,"f"))return this.logger.warn("enableNoiseSuppression()",{description:"Track suppressor is not defined"}),void c(this,Fb,"f").emit(Fr,{cause:"Track suppressor is not defined"});try{const n=yield null===(e=c(this,Lb,"f"))||void 0===e?void 0:e.processTrack(this.mediaStreamTrack);d(this,xb,this.mediaStreamTrack,"f"),yield this.replaceTrack(n),this.logger.debug("Denoiser activated",{case:"Denoiser",type:(null===(t=c(this,Lb,"f"))||void 0===t?void 0:t.type)||"none"}),c(this,Fb,"f").emit(Nr,{type:null===(r=c(this,Lb,"f"))||void 0===r?void 0:r.type})}catch(e){throw this.logger.warn("enableNoiseSuppression()",{description:"Can not enable noise suppression",track:this.logCtx,error:Ct(e)}),c(this,Fb,"f").emit(Fr,{cause:"Failed to enable noise suppression",error:e}),new Pt("noise_suppression_enable_failed",e)}}))}disableNoiseSuppression(){return a(this,void 0,void 0,(function*(){var e,t,r,n;d(this,Nb,!1,"f");try{if(!(null===(e=c(this,Lb,"f"))||void 0===e?void 0:e.isProcessing))return void this.logger.debug("stopProcessing()",{description:"Track is not processed"});if(!c(this,xb,"f"))return void this.logger.warn("disableNoiseSuppression()",{description:"Original track missing"});yield this.replaceTrack(c(this,xb,"f")),null===(t=c(this,Lb,"f"))||void 0===t||t.stopProcessing(),this.logger.debug("Denoiser deactivated",{case:"Denoiser",type:(null===(r=c(this,Lb,"f"))||void 0===r?void 0:r.type)||"none"}),c(this,Fb,"f").emit(Lr,{type:null===(n=c(this,Lb,"f"))||void 0===n?void 0:n.type})}catch(e){throw this.logger.warn("disableNoiseSuppression()",{description:"Can not disable noise suppression",track:this.logCtx,error:Ct(e)}),c(this,Fb,"f").emit(Fr,{cause:"Failed to disable noise suppression",error:e}),new Pt("noise_suppression_disable_failed",e)}}))}publish(){return a(this,void 0,void 0,(function*(){yield this.produce({encodings:this.getEncodings(),preferredCodec:this.getPreferredCodec(),codecOptions:this.getCodecOptions()}),this.internalEventEmitter.emit(Ur,this)}))}pause(){return a(this,void 0,void 0,(function*(){yield this.mute()}))}}Nb=new WeakMap,Lb=new WeakMap,xb=new WeakMap,Fb=new WeakMap;class EE extends Mf{constructor({track:e,statsHandler:t,widStatsAdapter:r,scoresCalculator:n,getExpectedVideoParams:i,isStaticContent:s}){super({track:e}),jb.set(this,void 0),Ub.set(this,void 0),Vb.set(this,void 0),Bb.set(this,void 0),Wb.set(this,void 0),Hb.set(this,void 0),qb.set(this,void 0),zb.set(this,void 0),this.handleWebRTCStats(e,t),d(this,Hb,r,"f"),d(this,Wb,n,"f"),d(this,qb,i,"f"),d(this,zb,s,"f")}get videoWebRTCStats(){var e;return null===(e=c(this,jb,"f"))||void 0===e?void 0:e.inbound}get audioWebRTCStats(){var e;return null===(e=c(this,Ub,"f"))||void 0===e?void 0:e.inbound}get scores(){return{Qv:c(this,Vb,"f"),Qa:c(this,Bb,"f")}}handleWebRTCStats(e,t){e.addEventListener("ended",(()=>{t.removeInboundVideoHandler(e.id),t.removeInboundAudioHandler(e.id)}),{once:!0}),"video"!==e.kind?t.addInboundAudioHandler(e.id,this.setAudioWebRTCStats.bind(this)):t.addInboundVideoHandler(e.id,this.setVideoWebRTCStats.bind(this))}setVideoWebRTCStats(e){var t,r;this.touchLastReceivedStatsTimestamp();const n=null===(t=c(this,qb,"f"))||void 0===t?void 0:t.call(this),i=c(this,Hb,"f").adaptInboundVideoStats({stats:e.inbound,connectionStats:e.connection,prevStats:null===(r=c(this,jb,"f"))||void 0===r?void 0:r.inbound,expectedWidth:null==n?void 0:n.width,expectedHeight:null==n?void 0:n.height,expectedFrameRate:null==n?void 0:n.maxFramerate,isStaticContent:c(this,zb,"f")});d(this,Vb,c(this,Wb,"f").calculateVideoMOS(i),"f"),d(this,jb,e,"f")}setAudioWebRTCStats(e){var t,r,n;this.touchLastReceivedStatsTimestamp();const{inbound:i}=e,s=c(this,Hb,"f").adaptInboundAudioStats({stats:i,connectionStats:e.connection,fec:null===(t=Rf("qosInboundFec"))||void 0===t||t,dtx:null===(r=Rf("qosInboundDtx"))||void 0===r||r,prevStats:null===(n=c(this,Ub,"f"))||void 0===n?void 0:n.inbound});d(this,Bb,c(this,Wb,"f").calculateAudioMOS(s),"f"),d(this,Ub,e,"f")}cleanupStats(){d(this,jb,void 0,"f"),d(this,Ub,void 0,"f"),d(this,Vb,void 0,"f"),d(this,Bb,void 0,"f")}}jb=new WeakMap,Ub=new WeakMap,Vb=new WeakMap,Bb=new WeakMap,Wb=new WeakMap,Hb=new WeakMap,qb=new WeakMap,zb=new WeakMap;class wE{constructor(e){this.label=Nn.Unknown,Gb.set(this,void 0),Yb.set(this,void 0),$b.set(this,void 0),Jb.set(this,void 0),Qb.set(this,void 0),Kb.set(this,void 0),Zb.set(this,void 0),Xb.set(this,void 0),eE.set(this,void 0),tE.set(this,!1),rE.set(this,void 0),nE.set(this,!1),iE.set(this,new qm),sE.set(this,!1),oE.set(this,0),aE.set(this,void 0),this.observer=new Et,d(this,Xb,e.mediaStreamTrack,"f"),this.label=e.label,this.consumer=e.consumer,d(this,Jb,e.peerConsumerFactory,"f"),d(this,Kb,e.loggerFactory("PeerTrack"),"f"),d(this,Zb,e.peerEventEmitter,"f"),d(this,sE,e.muted,"f"),d(this,eE,e.paused,"f"),d(this,Gb,e.network,"f"),d(this,Yb,e.media,"f"),d(this,Qb,e.callState,"f"),d(this,$b,e.onClose,"f"),d(this,aE,new EE({track:e.mediaStreamTrack,statsHandler:e.statsHandler,widStatsAdapter:e.widStatsAdapter,scoresCalculator:e.scoresCalculator,getExpectedVideoParams:()=>{var e;return null===(e=this.consumer)||void 0===e?void 0:e.currentSpatialLayerParams}}),"f")}get videoWebRTCStats(){return c(this,aE,"f").videoWebRTCStats}get audioWebRTCStats(){return c(this,aE,"f").audioWebRTCStats}get connectionScores(){return c(this,aE,"f").scores}get logCtx(){var e,t;return{id:c(this,Xb,"f").id,label:this.label,consumerId:null===(e=this.consumer)||void 0===e?void 0:e.id,producerId:null===(t=this.consumer)||void 0===t?void 0:t.producerId,muted:c(this,sE,"f"),paused:c(this,eE,"f"),closed:c(this,nE,"f")}}get volume(){return c(this,oE,"f")}get isRemote(){return!!this.consumer}get mediaStreamTrack(){return c(this,Xb,"f")}get kind(){return this.mediaStreamTrack.kind}get isPaused(){return c(this,eE,"f")}get isMuted(){return c(this,sE,"f")}get consumerId(){var e;return null===(e=this.consumer)||void 0===e?void 0:e.id}get currentSpatialLayer(){var e,t;return null!==(t=null===(e=this.consumer)||void 0===e?void 0:e.currentSpatialLayer)&&void 0!==t?t:Xh}close(){return a(this,arguments,void 0,(function*({closeRemote:e=!0}={}){this.consumer&&(yield this.closeConsumer({closeRemote:e}),this.clearCheckStateTimeout()),c(this,Zb,"f").safeEmit(Kr,this),d(this,nE,!0,"f"),c(this,$b,"f").call(this)}))}mute(){return a(this,void 0,void 0,(function*(){yield c(this,iE,"f").push((()=>a(this,void 0,void 0,(function*(){c(this,Kb,"f").debug("mute()",{track:this.logCtx}),yield this.pauseConsumer(),d(this,sE,!0,"f")}))))}))}unmute(){return a(this,void 0,void 0,(function*(){yield c(this,iE,"f").push((()=>a(this,void 0,void 0,(function*(){c(this,Kb,"f").debug("unmute()",{track:this.logCtx}),yield this.resumeConsumer(),d(this,sE,!1,"f")}))))}))}pause(){return a(this,arguments,void 0,(function*(e=!0){yield c(this,iE,"f").push((()=>a(this,void 0,void 0,(function*(){if(!this.consumer||this.isMuted)return d(this,eE,!0,"f"),c(this,Zb,"f").safeEmit(Zr,this),void c(this,Kb,"f").debug("pause()",{track:this.logCtx});yield this.pauseConsumer(e),d(this,eE,!0,"f"),c(this,Zb,"f").safeEmit(Zr,this)}))))}))}resume(){return a(this,arguments,void 0,(function*(e=!0){yield c(this,iE,"f").push((()=>a(this,void 0,void 0,(function*(){if(!this.consumer||this.isMuted)return d(this,eE,!1,"f"),c(this,Zb,"f").safeEmit(Xr,this),void c(this,Kb,"f").debug("resume()",{track:this.logCtx});yield this.resumeConsumer(e),d(this,eE,!1,"f"),c(this,Zb,"f").safeEmit(Xr,this)}))))}))}resumeConsumer(){return a(this,arguments,void 0,(function*(e=!0){if(this.consumer)try{this.consumer.resume(),e&&(yield c(this,Gb,"f").resumeRemoteConsumer(this.consumer.id)),this.checkConsumerState().catch((e=>{c(this,Kb,"f").warn("Failed to checkConsumerState()",{track:this.logCtx,error:Ct(e)})})),c(this,Kb,"f").debug("resumeConsumer()",{track:this.logCtx})}catch(e){c(this,Kb,"f").warn("resumeConsumer()",{error:e})}}))}pauseConsumer(){return a(this,arguments,void 0,(function*(e=!0){if(this.consumer)try{if(this.clearCheckStateTimeout(),e&&(yield c(this,Gb,"f").pauseRemoteConsumer(this.consumer.id)),"audio"===this.kind)return void c(this,Kb,"f").debug("pauseConsumer() - skipping for audio",{track:this.logCtx});this.consumer.pause(),d(this,tE,!1,"f"),c(this,Kb,"f").debug("pauseConsumer()",{track:this.logCtx})}catch(e){c(this,Kb,"f").warn("pauseConsumer()",{error:e,track:this.logCtx})}}))}requestVideoPreferredLayers(e){return a(this,arguments,void 0,(function*({spatialLayer:e,temporalLayer:t}){if(this.consumer)try{if(this.consumer.isAudio)return void c(this,Kb,"f").warn("Only video consumers support layers",{case:"requestVideoPreferredLayers"});if(e===this.consumer.currentSpatialLayer)return;if(e>this.consumer.spatialLayers)return void c(this,Kb,"f").warn("Invalid spatial layer",{spatialLayer:e,consumerSpatialLayers:this.consumer.spatialLayers,case:"requestVideoPreferredLayers"});if(e>this.consumer.currentMaxSpatialLayer)return void(yield this.requestMaxSpatialLayer(this.consumer.id,e));yield c(this,Gb,"f").updateConsumerPreferredLayers(this.consumer.id,e,t),c(this,Kb,"f").debug("requestVideoPreferredLayers()",{track:this.logCtx,consumer:this.consumer,spatialLayer:e,temporalLayer:t})}catch(e){throw c(this,Kb,"f").error("Failed to request preferred layers",{case:"requestVideoPreferredLayers",track:{id:this.mediaStreamTrack.id,kind:this.mediaStreamTrack.kind,label:this.mediaStreamTrack.label},consumerId:this.consumer.id,spatialLayers:this.consumer.spatialLayers,temporalLayers:this.consumer.temporalLayers,error:e}),new Pt("peer_track_request_preferred_layers_failed",e)}}))}requestKeyFrame(){return a(this,void 0,void 0,(function*(){if(this.consumerId){c(this,Kb,"f").debug("requestKeyFrame()",{track:this.logCtx});try{yield c(this,Gb,"f").requestConsumerKeyFrame(this.consumerId)}catch(e){throw c(this,Kb,"f").error("requestKeyFrame()",{error:e,track:this.logCtx,consumerId:this.consumerId}),new Pt("peer_track_request_key_frame_failed",e)}}}))}getVideoAvailableLayers(){if(this.consumer){if(!this.consumer.isAudio)return this.consumer.availableSpatialLayers;c(this,Kb,"f").warn("Only video consumers support layers",{case:"getVideoAvailableLayers"})}}getInfo(){return a(this,void 0,void 0,(function*(){var e;const{width:t,height:r,frameRate:n,aspectRatio:i}=c(this,Xb,"f").getSettings();return{trackId:c(this,Xb,"f").id,readyState:c(this,Xb,"f").readyState,isRemote:this.isRemote,kind:this.kind,label:this.label,width:t,height:r,frameRate:n,aspectRatio:i,paused:c(this,eE,"f"),trackInboundStats:yield null===(e=this.consumer)||void 0===e?void 0:e.getStats(),trackOutboundStats:yield this.getOutboundStats()}}))}getOutboundStats(){return a(this,void 0,void 0,(function*(){if(this.isRemote)return;const e=c(this,Yb,"f").getAllTracks().find((e=>e.getLabel()===this.label));return e?yield e.getStats():void 0}))}requestMaxSpatialLayer(e,t){return a(this,void 0,void 0,(function*(){try{if(!this.consumer)return;if(this.consumer.isAudio||0===this.consumer.spatialLayers||this.consumer.currentMaxSpatialLayer===t||t<this.consumer.currentMaxSpatialLayer)return void c(this,Kb,"f").warn("Can`t request this spatial layer",{case:"requestMaxSpatialLayer",consumerId:e,spatialLayer:t});this.consumer.setRequestedSpatialLayer(t),yield c(this,Gb,"f").requestProducerMaxSpatialLayer(this.consumer.producerId,t),c(this,Kb,"f").debug("requestMaxSpatialLayer()",{consumerId:e,spatialLayer:t})}catch(r){c(this,Kb,"f").warn("Failed to request max spatial layer",{case:"requestMaxSpatialLayer",consumerId:e,spatialLayer:t,error:r})}}))}checkConsumerState(){return a(this,void 0,void 0,(function*(){try{if(c(this,nE,"f")||"audio"===this.kind)return;c(this,Kb,"f").debug("checkConsumerState()",{track:this.logCtx});if((yield this.isInboundRTPStreamActive())||c(this,nE,"f"))return;yield this.requestKeyFrame();if((yield this.isInboundRTPStreamActive())||c(this,nE,"f"))return;if(c(this,tE,"f"))return c(this,Zb,"f").emit(en,this),void c(this,Kb,"f").debug("trackFail()",{track:this.logCtx});yield this.restartConsumer()}catch(e){c(this,Kb,"f").warn("checkConsumerState()",{track:this,error:e})}}))}setVolume(e){c(this,oE,"f")!==e&&(d(this,oE,e,"f"),this.observer.safeEmit(jr,{value:e}))}closeConsumer(){return a(this,arguments,void 0,(function*({closeRemote:e=!0}={}){this.consumer&&(e&&(yield c(this,Gb,"f").closeRemoteConsumer(this.consumer.id)),this.consumer.close())}))}restartConsumer(){return a(this,void 0,void 0,(function*(){try{if(!this.consumer||c(this,nE,"f"))return;c(this,Kb,"f").debug("restartConsumer()",{track:this.logCtx}),c(this,Zb,"f").emit(Kr,this),d(this,eE,!0,"f"),yield this.closeConsumer();const{consumer:e}=yield c(this,Gb,"f").createConsumer({producerId:this.consumer.producerId,rtpCapabilities:c(this,Yb,"f").mediasoupDevice.rtpCapabilities,producerPeerId:this.consumer.appData.producerData.peerId});d(this,tE,!0,"f"),this.consumer=c(this,Jb,"f").call(this,{consumer:e}),d(this,Xb,e.track,"f"),yield this.resume(),c(this,Zb,"f").emit(Qr,this)}catch(e){d(this,tE,!0,"f"),c(this,Kb,"f").warn("restartConsumer()",{track:this,error:e})}}))}isInboundRTPStreamActive(){return a(this,void 0,void 0,(function*(){if(!this.consumer||c(this,nE,"f"))return!1;const{framesDecoded:e}=yield this.consumer.getInboundRTPStreamStats();return yield new Promise((t=>{d(this,rE,setTimeout((()=>a(this,void 0,void 0,(function*(){try{if(!this.consumer)return void t(!1);const{framesDecoded:r}=yield this.consumer.getInboundRTPStreamStats();if(e===r&&!this.isPaused)return void t(!1);t(!0)}catch(e){c(this,Kb,"f").debug("isInboundRTPStreamActive()",{error:e,track:this.logCtx}),t(!1)}}))),4500),"f")}))}))}clearCheckStateTimeout(){c(this,rE,"f")||clearTimeout(c(this,rE,"f"))}}Gb=new WeakMap,Yb=new WeakMap,$b=new WeakMap,Jb=new WeakMap,Qb=new WeakMap,Kb=new WeakMap,Zb=new WeakMap,Xb=new WeakMap,eE=new WeakMap,tE=new WeakMap,rE=new WeakMap,nE=new WeakMap,iE=new WeakMap,sE=new WeakMap,oE=new WeakMap,aE=new WeakMap;class SE{constructor(e){this.encodings=[],cE.set(this,void 0);const{id:t,kind:r,peerId:n,label:i,paused:s}=e;this.id=t,this.kind=r,this.peerId=n,this.label=i,this.paused=s,this.encodings=e.encodings,this.trackTransformParams=e.trackTransformParams,this.maxSpatialLayer=e.maxSpatialLayer,d(this,cE,Date.now(),"f")}setPaused(e){this.paused=e,d(this,cE,Date.now(),"f")}getStateChangedAt(){return c(this,cE,"f")}}cE=new WeakMap;class CE{constructor({id:e,channelIds:t,groups:r,producePermissions:n,appId:i,loginDate:s,producers:o=[],appData:a,uid:c,role:u,loggerFactory:l,myPeer:p,callState:h,peers:f,remotePeerTracks:m,media:g,network:v,peerConsumerFactory:y}){this.producers=new Map,this.tracks=new Map,dE.set(this,void 0),uE.set(this,void 0),lE.set(this,void 0),pE.set(this,void 0),hE.set(this,void 0),fE.set(this,void 0),mE.set(this,void 0),gE.set(this,void 0),this._observer=new Et,this.id=e,this.channelIds=t,this.groups=r,this.producePermissions=n,this.appId=i,this.loginDate=s,this.applicationData=null!=a?a:{},this.uid=c,this.role=u,d(this,hE,p,"f"),d(this,fE,h,"f"),d(this,dE,f,"f"),d(this,uE,m,"f"),d(this,mE,y,"f"),d(this,lE,v,"f"),d(this,pE,g,"f"),d(this,gE,l("Peer"),"f"),o.forEach(this.handleNewProducer.bind(this)),this.handlePeerEvents()}get appData(){return this.applicationData}get observer(){return this._observer}get isMe(){return this.id===c(this,hE,"f").id}get isModerator(){return this.groups.includes("moderator")}get isUser(){return this.groups.includes("user")}get publishedMedia(){return Array.from(this.producers.values()).map((e=>({producerId:e.id,kind:e.kind,label:e.label,paused:e.paused})))}get shortData(){return{id:this.id,producers:Array.from(this.producers.values()).map((e=>({id:e.id,paused:e.paused}))),appData:this.appData}}hasPermission(e){return this.producePermissions.includes(e)}hasGroup(e){return this.groups.includes(e)}subscribe(e){return a(this,arguments,void 0,(function*({producerId:e,muted:t=!1}){try{const r=this.producers.get(e);if(!r)return void c(this,gE,"f").warn("subscribe()",{error:"Peer does not have a producer",peer:ws(this),producerId:e});if(this.getAllConsumers().find((t=>t.producerId===e)))return void c(this,gE,"f").debug("subscribe()",{error:"Already subscribed to producer",peer:ws(this),producerId:e});const{consumer:n,isProducerPaused:i}=yield c(this,lE,"f").createConsumer({producerId:r.id,rtpCapabilities:c(this,pE,"f").mediasoupDevice.rtpCapabilities,producerPeerId:this.id});if(!this.producePermissions.includes(r.label)&&Object.values(Nn).includes(r.label))return void c(this,gE,"f").debug("subscribe()",{error:"Producer is not allowed anymore",peer:ws(this),producerId:e});const s=c(this,uE,"f").create({mediaStreamTrack:n.track,label:r.label,consumer:c(this,mE,"f").call(this,{consumer:n}),muted:t,paused:i,peerEventEmitter:this.observer});t||(yield s.unmute()),this.tracks.set(s.label,s),c(this,gE,"f").debug(`Subscribed for ${r.kind}`,{peer:ws(this)})}catch(t){throw c(this,gE,"f").error("subscribe()",{producerId:e,error:t,peer:ws(this)}),new Pt("peer_subscribe_failed",t)}}))}unsubscribe(e){return a(this,void 0,void 0,(function*(){try{const t=this.getConsumerByProducerId(e);if(!t)return;const r=this.getTrackByConsumerId(t.id);if(!r)return;yield r.close(),this.tracks.delete(r.label),c(this,gE,"f").debug(`Unsubscribed consumer ${t.kind}`,{peer:ws(this)})}catch(t){throw c(this,gE,"f").error("unsubscribe()",{producerId:e,error:t}),new Pt("peer_unsubscribe_failed",t)}}))}setProducePermissions(e){return a(this,void 0,void 0,(function*(){this.throwIfIamNotModerator();try{yield c(this,lE,"f").changePeerProducePermissions(this.id,e)}catch(e){throw new Pt("peer_set_produce_permissions_failed",e)}c(this,gE,"f").debug("Produce permissions changed",{peerId:this.id,producePermissions:e})}))}addProducePermission(e){return a(this,void 0,void 0,(function*(){this.throwIfIamNotModerator();try{yield c(this,lE,"f").addPeerProducePermission(this.id,e)}catch(e){throw new Pt("peer_add_produce_permission_failed",e)}c(this,gE,"f").debug("Add produce permission requested",{peerId:this.id,label:e})}))}removeProducePermission(e){return a(this,void 0,void 0,(function*(){this.throwIfIamNotModerator();try{yield c(this,lE,"f").removePeerProducePermission(this.id,e)}catch(e){throw new Pt("peer_remove_produce_permission_failed",e)}c(this,gE,"f").debug("Remove produce permission requested",{peerId:this.id,label:e})}))}getInfo(){return a(this,void 0,void 0,(function*(){try{return{id:this.id,appData:this.appData,role:this.role,channelIds:this.channelIds,appId:this.appId,uid:this.uid,loginDate:this.loginDate,tracks:yield Promise.all(Array.from(this.tracks.values()).map((e=>a(this,void 0,void 0,(function*(){return yield e.getInfo()})))))}}catch(e){throw c(this,gE,"f").error("getInfo()",{peer:ws(this),error:e}),new Pt("peer_get_info_failed",e)}}))}getProducers(){return Array.from(this.producers.values())}getConsumersState(){return this.getAllConsumers().map((e=>({id:e.id,paused:e.paused,producerId:e.producerId})))}handleNewProducer(e){if(this.producers.get(e.id))return;const t=new SE(e);this.producers.set(t.id,t),c(this,gE,"f").debug("Peer published media:",{peer:ws(this),producer:t});const r={producerId:t.id,kind:t.kind,label:t.label,paused:t.paused};this.observer.safeEmit(Gr,r)}handlePeerEvents(){this.observer.on(sn,this.handleNewProducer.bind(this)),this.observer.on(on,(e=>a(this,void 0,void 0,(function*(){this.producers.delete(e.id),c(this,gE,"f").debug("Peer unpublished media:",{peer:ws(this),producer:e}),this.observer.safeEmit(Yr,{producerId:e.id,kind:e.kind,label:e.label,paused:e.paused});const t=this.tracks.get(e.label);if(t)try{yield t.close({closeRemote:!1})}catch(e){c(this,gE,"f").warn("Failed to close peer track due to producer closed",{label:t.label,peerId:this.id,error:Ct(e)})}})))),this.observer.on(dn,(e=>a(this,void 0,void 0,(function*(){const t=this.getTrackByConsumerId(e);if(t)try{yield t.close({closeRemote:!1}),this.tracks.delete(t.label),c(this,gE,"f").debug("Peer video track was ended:",{peer:ws(this),track:t.logCtx})}catch(e){c(this,gE,"f").warn("Failed to close peer track due to consumer closed",{label:t.label,peerId:this.id,error:Ct(e)})}})))),this.observer.on(un,(e=>a(this,void 0,void 0,(function*(){const t=this.getTrackByConsumerId(e);t&&(yield t.pause(!1))})))),this.observer.on(ln,(e=>a(this,void 0,void 0,(function*(){const t=this.getTrackByConsumerId(e);t&&(yield t.resume(!1))})))),this.observer.on(pn,(e=>{const t=this.getConsumerById(e.consumerId);(null==t?void 0:t.isVideo)&&(t.applyLayersUpdate({spatialLayer:e.spatialLayer,temporalLayer:e.temporalLayer}),e.spatialLayer===t.requestedSpatialLayer&&t.setRequestedSpatialLayer(void 0),c(this,gE,"f").debug("consumerChangePreferredLayers()",Object.assign({},e)))})),this.observer.on(an,(e=>a(this,void 0,void 0,(function*(){const{producerId:t,spatialLayer:r}=e,n=this.getConsumerByProducerId(t);n?(n.setCurrentMaxSpatialLayer(r),c(this,gE,"f").debug("producerSetMaxSpatialLayer()",{producerId:t,consumerId:n.id,spatialLayer:r}),n.requestedSpatialLayer===r?(yield c(this,lE,"f").updateConsumerPreferredLayers(n.id,r),c(this,gE,"f").debug("requestVideoPreferredLayers()",{producerId:t,consumerId:n.id,spatialLayer:r})):c(this,gE,"f").debug("producerSetMaxSpatialLayer()",{message:"No need to request new preferred layer",currentMaxSpatialLayer:r,requestedMaxSpatialLayer:n.requestedSpatialLayer})):c(this,gE,"f").debug("producerSetMaxSpatialLayer()",{message:"Consumer for producer not created, ignore MaxSpatialLayer change"})})))),this.observer.on(gr,(e=>{try{_n(e),this.setAppData(e),this.observer.emit(tn,e),c(this,gE,"f").debug("updatePeerAppData",{peer:ws(this),appData:e})}catch(t){c(this,gE,"f").error("updatePeerAppData",{peer:ws(this),appData:e,error:t})}}))}reset(){return a(this,void 0,void 0,(function*(){this.producers.clear();try{yield Promise.all(Array.from(this.tracks.values()).map((e=>a(this,void 0,void 0,(function*(){return yield e.close({closeRemote:!1})})))))}catch(e){c(this,gE,"f").debug("Failed to reset peer tracks",{peer:ws(this),error:Ct(e)})}this.tracks.clear();[sn,on,dn,un,ln,pn,an,gr].forEach((e=>this.observer.removeAllListeners(e)))}))}getActiveTracksCount(){return Array.from(this.tracks.values()).map((e=>e.consumer)).filter((e=>!(null==e?void 0:e.paused))).length}getActivePublishersCount(){return Array.from(this.producers.values()).filter((e=>!e.paused)).length}handleProducePermissionsChange(e){this.producePermissions=e,Object.values(Nn).filter((e=>!this.producePermissions.includes(e))).forEach((e=>{const t=this.tracks.get(e);t&&(this.tracks.delete(t.label),t.close({closeRemote:!1}).catch((e=>{c(this,gE,"f").error("Failed to close track",{case:"Peer",error:Ct(e)})})))})),this.observer.safeEmit(rn,{labels:this.producePermissions})}handleGroupsChange(e){this.groups=e,this.observer.safeEmit(nn,{groups:e})}getAllConsumers(){return Array.from(this.tracks.values()).map((e=>e.consumer)).filter((e=>!!e))}getConsumerByProducerId(e){return this.getAllConsumers().find((t=>t.producerId===e))}getConsumerById(e){return this.getAllConsumers().find((t=>t.id===e))}getTrackByConsumerId(e){return Array.from(this.tracks.values()).find((t=>t.consumerId===e))}setAppData(e){this.applicationData=e}throwIfIamNotModerator(){if(!c(this,dE,"f").isModerator(c(this,hE,"f").id))throw new Pt("not_enough_access",new Error("Not enough access"))}}dE=new WeakMap,uE=new WeakMap,lE=new WeakMap,pE=new WeakMap,hE=new WeakMap,fE=new WeakMap,mE=new WeakMap,gE=new WeakMap;class PE{constructor(e){this.spatialLayers=Xh,this.temporalLayers=tf,this.currentSpatialLayer=Xh,this.currentTemporalLayer=tf,this.availableSpatialLayers=[],vE.set(this,void 0);const{consumer:t,loggerFactory:r}=e;this.id=t.id,this.kind=t.kind,this.producerId=t.producerId,this.appData=t.appData,this.consumer=t,d(this,vE,r("PeerConsumer"),"f"),this.currentMaxSpatialLayer=this.appData.producerData.maxSpatialLayer,this.parseScalabilityMode(),this.initAvailableSpatialLayers(),this.setCurrentSpatialLayerParams()}get paused(){return this.consumer.paused}pause(){this.consumer.pause()}resume(){this.consumer.resume()}close(){this.consumer.close()}get isVideo(){return"video"===this.kind}get isAudio(){return"audio"===this.kind}parseScalabilityMode(){if(this.consumer.rtpParameters.encodings){const{scalabilityMode:e}=this.consumer.rtpParameters.encodings[0],{spatialLayers:t,temporalLayers:r}=fd.parseScalabilityMode(e);this.spatialLayers=t,this.temporalLayers=r,c(this,vE,"f").debug("parseScalabilityMode()",{scalabilityMode:e,spatialLayers:t,temporalLayers:r})}}initAvailableSpatialLayers(){const{encodings:e,trackTransformParams:t}=this.appData.producerData;if(!Array.isArray(e))return;if(this.availableSpatialLayers=e.map((e=>this.tryPrepareSpatialLayerParams(e))),!t||this.availableSpatialLayers.length>1||this.spatialLayers<ef)return void c(this,vE,"f").debug("Using available spatial layers",{case:"initAvailableSpatialLayers"});c(this,vE,"f").debug("Pre-generating encodings with spatial layer params",{case:"initAvailableSpatialLayers"});const r=[],n=e[e.length-1];for(let e=this.spatialLayers-1;e>=0;e-=1)r.push(this.tryPrepareSpatialLayerParams(Object.assign(Object.assign({},n),{scaleResolutionDownBy:Math.pow(2,e)})));this.availableSpatialLayers=r}setCurrentSpatialLayerParams(){const{encodings:e}=this.appData.producerData;(null==e?void 0:e[this.currentSpatialLayer])&&(this.currentSpatialLayerParams=this.tryPrepareSpatialLayerParams(e[this.currentSpatialLayer]),c(this,vE,"f").debug("setCurrentSpatialLayerParams()",{currentSpatialLayerParams:this.currentSpatialLayerParams}))}tryPrepareSpatialLayerParams(e){var t;const{trackTransformParams:r}=this.appData.producerData;if(!r)return e;const{width:n,height:i}=r,s=null!==(t=e.scaleResolutionDownBy)&&void 0!==t?t:1;return n&&i?Object.assign({width:n/s,height:i/s},e):e}setCurrentSpatialLayer(e){if(!this.isVideo)throw new Error("setCurrentSpatialLayer applies to video consumers only");this.currentSpatialLayer=e,c(this,vE,"f").debug("setCurrentSpatialLayer()",{currentSpatialLayer:e}),this.setCurrentSpatialLayerParams()}setCurrentTemporalLayer(e){if(!this.isVideo)throw new Error("setCurrentTemporalLayer applies to video consumers only");this.currentTemporalLayer=e,c(this,vE,"f").debug("setCurrentTemporalLayer()",{currentTemporalLayer:e})}applyLayersUpdate(e){if(!this.isVideo)throw new Error("applyLayersUpdate applies to video consumers only");const{spatialLayer:t,temporalLayer:r}=e;void 0!==t&&this.setCurrentSpatialLayer(t),void 0!==r&&this.setCurrentTemporalLayer(r)}setRequestedSpatialLayer(e){this.requestedSpatialLayer=e}setCurrentMaxSpatialLayer(e){this.currentMaxSpatialLayer=e}getStats(){return a(this,void 0,void 0,(function*(){var e,t;try{return{consumerId:this.consumer.id,codec:this.consumer.rtpParameters.codecs.find((e=>Sf(e))),dtlsState:null===(t=null===(e=this.consumer.rtpReceiver)||void 0===e?void 0:e.transport)||void 0===t?void 0:t.state,availableSpatialLayers:this.availableSpatialLayers,currentSpatialLayerParams:this.currentSpatialLayerParams,requestedSpatialLayer:this.requestedSpatialLayer,rtcStats:yield this.getInboundRTPStreamStats()}}catch(e){return void c(this,vE,"f").debug("getStats()",{error:e})}}))}getInboundRTPStreamStats(){return a(this,void 0,void 0,(function*(){return yield new Promise(((e,t)=>{const r=(...n)=>a(this,[...n],void 0,(function*(n=0){try{const i=yield this.consumer.getStats(),s=Array.from(i.values()).find((e=>"inbound-rtp"===e.type));if(!s&&n<5)return void setTimeout((()=>{r(n+1).catch((e=>{c(this,vE,"f").debug("Error getting RTCStatsReport",{attempt:n,error:Ct(e)})}))}),150);n>=5&&!s&&t(new Error("InboundRTPStreamStat not exist")),e(s)}catch(e){t(new Error("Can not get RTCStatsReport")),c(this,vE,"f").debug("getInboundRTPStreamStats()",{error:e})}}));r().catch((e=>{c(this,vE,"f").debug("Error executing getRTCStatsReport",{case:"PeerConsumer",error:Ct(e)})}))}))}))}}vE=new WeakMap;let TE=class{adaptInboundAudioStats(e){const{stats:t,connectionStats:r,fec:n,dtx:i,prevStats:s}=e,o=this.calculateDeltaPacketLoss({packetsLost:t.packetsLost,packetsReceivedOrSent:t.packetsReceived},s?{packetsLost:s.packetsLost,packetsReceivedOrSent:s.packetsReceived}:void 0),a=this.calculateJitterBufferDelay(t.jitterBufferDelay,t.jitterBufferEmittedCount);return{ssrc:t.ssrc,dtx:i,fec:n,packetLoss:o,bufferDelay:a,bitrate:t.bitrate,roundTripTime:1e3*r.currentRoundTripTime}}adaptInboundVideoStats(e){var t,r,n;const{stats:i,connectionStats:s,prevStats:o}=e,a=this.calculateDeltaPacketLoss({packetsLost:i.packetsLost,packetsReceivedOrSent:i.packetsReceived},o?{packetsLost:o.packetsLost,packetsReceivedOrSent:o.packetsReceived}:void 0),c=this.calculateJitterBufferDelay(i.jitterBufferDelay,i.jitterBufferEmittedCount),d=i,u=o,l=this.calculateDeltaAverageQP(d.qpSum,d.framesDecoded,null==u?void 0:u.qpSum,null==u?void 0:u.framesDecoded);return{ssrc:i.ssrc,packetLoss:a,bufferDelay:c,bitrate:i.bitrate,roundTripTime:1e3*s.currentRoundTripTime,width:i.frameWidth,height:i.frameHeight,expectedWidth:null!==(t=e.expectedWidth)&&void 0!==t?t:i.frameWidth,expectedHeight:null!==(r=e.expectedHeight)&&void 0!==r?r:i.frameHeight,frameRate:i.framesPerSecond,expectedFrameRate:null!==(n=e.expectedFrameRate)&&void 0!==n?n:i.framesPerSecond,isStaticContent:e.isStaticContent,averageQP:l}}adaptOutboundAudioStats(e){const{stats:t,remoteInboundStats:r,fec:n,dtx:i,prevStats:s}=e,o=r?this.calculateDeltaPacketLoss({packetsLost:r.packetsLost,packetsReceivedOrSent:t.packetsSent},s?{packetsLost:s.remoteInbound.packetsLost,packetsReceivedOrSent:s.outbound.packetsSent}:void 0):0,a=(null==r?void 0:r.roundTripTime)?1e3*r.roundTripTime:50,c=(null==r?void 0:r.jitter)?1e3*r.jitter:0;return{ssrc:t.ssrc,fec:n,dtx:i,packetLoss:o,bufferDelay:c,roundTripTime:a,bitrate:t.bitrate}}adaptOutboundVideoStats(e){var t,r,n,i,s,o,a;const{stats:c,remoteInboundStats:d,prevStats:u}=e,l=d?this.calculateDeltaPacketLoss({packetsLost:d.packetsLost,packetsReceivedOrSent:c.packetsSent},u?{packetsLost:u.remoteInbound.packetsLost,packetsReceivedOrSent:u.outbound.packetsSent}:void 0):0,p=(null==d?void 0:d.roundTripTime)?1e3*d.roundTripTime:50,h=(null==d?void 0:d.jitter)?1e3*d.jitter:0,f=this.calculateDeltaAverageQP(c.qpSum,c.framesEncoded,null==u?void 0:u.outbound.qpSum,null==u?void 0:u.outbound.framesEncoded);return{ssrc:c.ssrc,packetLoss:l,bufferDelay:h,bitrate:c.bitrate,roundTripTime:p,width:c.frameWidth,height:c.frameHeight,expectedWidth:null!==(t=c.frameWidth)&&void 0!==t?t:null===(r=c.track)||void 0===r?void 0:r.width,expectedHeight:null!==(n=c.frameHeight)&&void 0!==n?n:null===(i=c.track)||void 0===i?void 0:i.height,frameRate:c.framesPerSecond,expectedFrameRate:null!==(s=c.framesPerSecond)&&void 0!==s?s:null===(o=c.track)||void 0===o?void 0:o.framesPerSecond,decreaseOutboundPenalty:null===(a=Rf("qosDecreaseOutboundPenalty"))||void 0===a||a,isStaticContent:e.isStaticContent,averageQP:f,qualityLimitationReason:c.qualityLimitationReason}}calculateDeltaPacketLoss(e,t){var r,n;const i=Sg(e.packetsLost-(null!==(r=null==t?void 0:t.packetsLost)&&void 0!==r?r:0),0,e.packetsLost),s=Sg(e.packetsReceivedOrSent-(null!==(n=null==t?void 0:t.packetsReceivedOrSent)&&void 0!==n?n:0),0,e.packetsReceivedOrSent);return s||i?i/(i+s)*100:0}calculateDeltaAverageQP(e,t,r,n){if(void 0===e||void 0===t)return;const i=t-(null!=n?n:0);return i<=0?void 0:(e-(null!=r?r:0))/i}calculateJitterBufferDelay(e,t){return 0===t?0:e/t*1e3}};TE=i([at()],TE);const RE=new rt({autoBindInjectable:!0});var kE,DE,IE;RE.bind(Mn.ClientMetaProvider).to(mr).inSingletonScope(),RE.bind(Mn.LocalMutex).to(vg).inSingletonScope(),RE.bind(Mn.SignalingApiClient).toDynamicValue((e=>new _c(e.container.get(Mn.Config)))).inSingletonScope(),RE.bind(Mn.CallState).to(xn).inSingletonScope(),RE.bind(Mn.MyPeer).to(Ss).inSingletonScope(),RE.bind(Mn.LoggerFactory).toFactory((e=>{const t=e.container.get(Mn.Config),r=t.get("logLevel"),n=t.get("sendAnalytics"),i=t.get("onLogMessage"),s=e.container.get(Mn.ClientMetaProvider);return e=>new eb({logLevel:r,namespace:e,onLogMessage:i,sendAnalytics:n,clientMetaProvider:s})})),RE.bind(Mn.System).to(bg).inSingletonScope(),RE.bind(Mn.ProcessorsCache).to(df).inSingletonScope(),RE.bind(Mn.IntegrationsService).to(pf).inSingletonScope(),RE.bind(Mn.MediaStreamTrackManager).to(bm).inSingletonScope(),RE.bind(Mn.Media).to(wm).inSingletonScope(),RE.bind(Mn.Network).to(Zc).inSingletonScope(),RE.bind(Mn.NetworkTransportPolicyManager).to(ag).inSingletonScope(),RE.bind(Mn.PendingClosureProducerStorage).to(Qm).inSingletonScope(),RE.bind(Mn.ProducerCloseManager).to(ig).inSingletonScope(),RE.bind(Mn.RemotePeerTracks).to(tb).inSingletonScope(),RE.bind(Mn.Peers).to(Xc).inSingletonScope(),RE.bind(Mn.MediaEventHandler).to(Ym).inSingletonScope(),RE.bind(Mn.ChannelEventHandler).to(Um).inSingletonScope(),RE.bind(Mn.ChannelAudioObserverEventHandler).to(Bc).inSingletonScope(),RE.bind(Mn.ChannelAudioObserverMissingProducerRestorer).to(xc).inSingletonScope(),RE.bind(Mn.EventsQueue).to(Es).inSingletonScope(),RE.bind(Mn.ChannelStateSynchronizer).to(Fm).inSingletonScope(),RE.bind(Mn.ChannelStateSyncEventHandler).to(hd).inSingletonScope(),RE.bind(Mn.StatsHandler).to(Bg).inSingletonScope(),RE.bind(Mn.WIDHandler).to(gb).inSingletonScope(),RE.bind(Mn.WIDIgnoreSsrcList).toConstantValue([1234]),RE.bind(Mn.CompositeStatsParser).toDynamicValue((e=>{const t=e.container.get(Mn.LoggerFactory)("WID"),r=e.container.get(Mn.WIDIgnoreSsrcList);return new ar({statsParser:new cr({ignoreSSRCList:r,logger:t})})})).inSingletonScope(),RE.bind(Mn.PeriodicStatsReporter).toDynamicValue((e=>{const t=e.container.get(Mn.Config),r=e.container.get(Mn.CompositeStatsParser);return new Ht({compositeStatsParser:r,getStatsInterval:t.get("getStatsInterval")})})).inSingletonScope(),RE.bind(Mn.WebRTCIssueDetector).toDynamicValue((e=>{const t=e.container.get(Mn.Config),r=e.container.get(Mn.WIDHandler);if(t.get("disableWid"))return;const n=e.container.get(Mn.StatsHandler),i=e.container.get(Mn.WIDIgnoreSsrcList),s=e.container.get(Mn.LoggerFactory)("WID"),o=e.container.get(Mn.CompositeStatsParser),a=e.container.get(Mn.PeriodicStatsReporter);return new dr({onIssues:e=>{var n;r.handleIssues(e),null===(n=t.get("onIssues"))||void 0===n||n(e)},issueEmitter:new Wt,networkScoresCalculator:new zt,detectors:[new Kt,new $t,new Qt,new Jt,new Yt,new Zt,new rr({minMosQuality:Dt.GOOD,avgFreezeDurationThresholdMs:2e3,frozenDurationThresholdPct:50}),new nr({minMosQuality:Dt.GOOD,volatilityThreshold:10,affectedStreamsPercentThreshold:60})],statsReporter:a,onNetworkScoresUpdated:e=>{var n;r.handleNetworkScores(e),null===(n=t.get("onNetworkScoresUpdated"))||void 0===n||n(e)},onStats:n.handle.bind(n),ignoreSSRCList:i,compositeStatsParser:o,logger:s,autoAddPeerConnections:!1})})).inSingletonScope(),RE.bind(Mn.WIDStatsAdapter).to(TE).inSingletonScope(),RE.bind(Mn.ScoresCalculator).toDynamicValue((()=>new Yg)).inSingletonScope(),RE.bind(Mn.Engine).to(Zg).inSingletonScope(),RE.bind(Mn.PeerTrackFactory).toFactory((function(e){const t=e.container.get(Mn.LoggerFactory),r=e.container.get(Mn.CallState),n=e.container.get(Mn.StatsHandler);return i=>{const s={callState:r,loggerFactory:t,media:e.container.get(Mn.Media),network:e.container.get(Mn.Network),peerConsumerFactory:e.container.get(Mn.PeerConsumerFactory),widStatsAdapter:e.container.get(Mn.WIDStatsAdapter),scoresCalculator:e.container.get(Mn.ScoresCalculator)},{peerEventEmitter:o}=i,a=new wE(Object.assign(Object.assign(Object.assign({},i),s),{statsHandler:n}));return o.safeEmit(Qr,a),a}})),RE.bind(Mn.PeerFactory).toFactory((function(e){const t=e.container.get(Mn.LoggerFactory),r=e.container.get(Mn.CallState);return n=>{const i={callState:r,loggerFactory:t,media:e.container.get(Mn.Media),myPeer:e.container.get(Mn.MyPeer),network:e.container.get(Mn.Network),peers:e.container.get(Mn.Peers),remotePeerTracks:e.container.get(Mn.RemotePeerTracks),peerConsumerFactory:e.container.get(Mn.PeerConsumerFactory)};return new CE(Object.assign(Object.assign({},i),n))}})),RE.bind(Mn.PeerConsumerFactory).toFactory((function(e){const t=e.container.get(Mn.LoggerFactory);return e=>{const r={loggerFactory:t};return new PE(Object.assign(Object.assign({},r),e))}})),RE.bind(Mn.AudioTrackFactory).toFactory((function(e){const t=e.container.get(Mn.LoggerFactory),r=e.container.get(Mn.StatsHandler);return n=>{const i={internalEventEmitter:e.container.get(Mn.InternalEventEmitter),loggerFactory:t,media:e.container.get(Mn.Media),mediaStreamTrackManager:e.container.get(Mn.MediaStreamTrackManager),myPeer:e.container.get(Mn.MyPeer),network:e.container.get(Mn.Network),producerCloseManager:e.container.get(Mn.ProducerCloseManager),mutex:e.container.get(Mn.LocalMutex),processorFactory:e.container.get(Mn.AudioTrackProcessorFactory),clientEventEmitter:e.container.get(Mn.ClientEventEmitter),statsHandler:r,widStatsAdapter:e.container.get(Mn.WIDStatsAdapter),scoresCalculator:e.container.get(Mn.ScoresCalculator)};return new bE(Object.assign(Object.assign({},i),n))}})),RE.bind(Mn.VideoTrackFactory).toFactory((function(e){const t=e.container.get(Mn.LoggerFactory),r=e.container.get(Mn.StatsHandler);return n=>{const i={internalEventEmitter:e.container.get(Mn.InternalEventEmitter),loggerFactory:t,media:e.container.get(Mn.Media),mediaStreamTrackManager:e.container.get(Mn.MediaStreamTrackManager),myPeer:e.container.get(Mn.MyPeer),network:e.container.get(Mn.Network),producerCloseManager:e.container.get(Mn.ProducerCloseManager),mutex:e.container.get(Mn.LocalMutex),statsHandler:r,widStatsAdapter:e.container.get(Mn.WIDStatsAdapter),scoresCalculator:e.container.get(Mn.ScoresCalculator)};return new dm(Object.assign(Object.assign({},i),n))}})),RE.bind(Mn.AudioTrackProcessorFactory).toFactory((function(e){const t=e.container.get(Mn.LoggerFactory),r=e.container.get(Mn.Config),n=e.container.get(Mn.ProcessorsCache),i=r.get("asdk");return e=>{const s=r.get("denoiser");let o=n.get(s,e.trackLabel);if(o)return o;if("rnnoise"===s&&e.noiseSuppressor&&(o=new _E({noiseSuppressor:e.noiseSuppressor,loggerFactory:t})),"asdk"===s&&(null==i?void 0:i.customerId)&&(o=new yb({asdkCustomerId:i.customerId,loggerFactory:t,config:r})),!o)throw new TypeError("Incorrect parameters passed to AudioTrackProcessorFactory");return o}})),RE.bind(Mn.DataChannelsManager).to(zc).inSingletonScope(),RE.bind(Mn.DatachannelHeartbeater).to(wc).inSingletonScope(),RE.bind(Mn.SignalingHeartbeater).to(Qc).inSingletonScope(),RE.bind(Mn.AnalyticsApiClient).to(w_).inSingletonScope(),RE.bind(Mn.PeersStorage).to(Pc).inSingletonScope(),RE.bind(Mn.TransportsStatsProvider).to(Hg).inSingletonScope();class AE{constructor(e){kE.set(this,void 0),DE.set(this,void 0),IE.set(this,void 0),this.canUseNoiseSuppression=!0;const{clientEventEmitter:t,internalEventEmitter:r}=e;RE.bind(Mn.Config).toDynamicValue((()=>new bt(e))).inSingletonScope(),RE.bind(Mn.InternalEventEmitter).toDynamicValue((()=>null!=r?r:new Et)).inSingletonScope(),RE.bind(Mn.ClientEventEmitter).toDynamicValue((()=>null!=t?t:new Et)).inSingletonScope(),RE.get(Mn.IntegrationsService),this.clientEventEmitter=RE.get(Mn.ClientEventEmitter),d(this,kE,RE.get(Mn.Engine),"f"),d(this,DE,RE.get(Mn.NetworkTransportPolicyManager),"f"),d(this,IE,RE.get(Mn.ClientMetaProvider),"f")}get meta(){return c(this,IE,"f").meta}get observer(){return this.clientEventEmitter}get id(){return c(this,kE,"f").myPeerId}get peers(){return c(this,kE,"f").getPeers()}get availableVideoDevices(){return c(this,kE,"f").system.availableVideoDevices}get availableAudioDevices(){return c(this,kE,"f").system.availableAudioDevices}get effectsSDKInitialized(){return c(this,kE,"f").media.effectsSDKInitialized}get scoresCalculator(){return c(this,kE,"f").scoresCalculator}detectDevices(e){return a(this,void 0,void 0,(function*(){try{yield c(this,kE,"f").system.detectDevices(e)}catch(e){const t=e instanceof Error?e.message:"detect_devices_failed";throw new Pt(t,e)}return{video:c(this,kE,"f").system.availableVideoDevices,audio:c(this,kE,"f").system.availableAudioDevices}}))}initEffectsSDK(){return a(this,void 0,void 0,(function*(){return yield c(this,kE,"f").media.initEffectsSDK()}))}join(e){return a(this,void 0,void 0,(function*(){yield c(this,kE,"f").join(e)}))}leave(e){return a(this,void 0,void 0,(function*(){yield c(this,kE,"f").release(e)}))}confirmActivity(){return a(this,void 0,void 0,(function*(){yield c(this,kE,"f").confirmActivity()}))}createCameraVideoTrack(e){return a(this,void 0,void 0,(function*(){return yield c(this,kE,"f").createCameraVideoTrack(e)}))}createMicrophoneAudioTrack(e){return a(this,void 0,void 0,(function*(){return yield c(this,kE,"f").createMicrophoneAudioTrack(e)}))}createScreenMediaTracks(e){return a(this,void 0,void 0,(function*(){return yield c(this,kE,"f").createScreenMediaTracks(e)}))}createCustomAudioTrack(e){return c(this,kE,"f").createCustomAudioTrack(e)}createCustomVideoTrack(e){return c(this,kE,"f").createCustomVideoTrack(e)}deleteTrack(e){return a(this,void 0,void 0,(function*(){yield c(this,kE,"f").deleteTrack(e)}))}loadPeers(e){return a(this,void 0,void 0,(function*(){yield c(this,kE,"f").loadPeers(e)}))}requestChannelStateSync(){c(this,kE,"f").requestChannelStateSync()}updateAppData(e){return a(this,void 0,void 0,(function*(){yield c(this,kE,"f").updateAppData(e)}))}getTransportsInfo(){return a(this,void 0,void 0,(function*(){return yield c(this,kE,"f").network.getTransportsStateInfo()}))}setPreferRelay(e){c(this,kE,"f").network.setPreferRelay(e)}getPreferRelay(){return c(this,kE,"f").network.getPreferRelay()}changeIceTransportPolicy(e){return a(this,void 0,void 0,(function*(){yield c(this,DE,"f").changeIceTransportPolicy(e)}))}restartIce(){return a(this,void 0,void 0,(function*(){const e=[c(this,kE,"f").network.sendTransport,c(this,kE,"f").network.receiveTransport,c(this,kE,"f").network.signalingTransport].filter((e=>!!e));yield Promise.all(e.map((e=>a(this,void 0,void 0,(function*(){return yield c(this,kE,"f").network.restartIce(e)})))))}))}transportsStats(){return c(this,kE,"f").transportsStats()}setSignalingServerUrl(e){c(this,kE,"f").setSignalingServerUrl(e)}}kE=new WeakMap,DE=new WeakMap,IE=new WeakMap;export{AE as default};
39
+ //# sourceMappingURL=index.es.js.map