Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@poker-apprentice/hand-history-analyzer

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@poker-apprentice/hand-history-analyzer - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

dist/cjs/index.js

@@ -1,2 +0,2 @@

"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var r="object"==typeof t&&t&&t.Object===Object&&t,n=r,o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")(),i=a.Symbol,u=i,c=Object.prototype,s=c.hasOwnProperty,l=c.toString,f=u?u.toStringTag:void 0;var p=function(t){var e=s.call(t,f),r=t[f];try{t[f]=void 0;var n=!0}catch(t){}var o=l.call(t);return n&&(e?t[f]=r:delete t[f]),o},h=Object.prototype.toString;var v=p,d=function(t){return h.call(t)},y=i?i.toStringTag:void 0;var b=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":y&&y in Object(t)?v(t):d(t)};var g=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},w=b,_=g;var m,O=function(t){if(!_(t))return!1;var e=w(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},S=a["__core-js_shared__"],j=(m=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||""))?"Symbol(src)_1."+m:"";var A=function(t){return!!j&&j in t},C=Function.prototype.toString;var N=function(t){if(null!=t){try{return C.call(t)}catch(t){}try{return t+""}catch(t){}}return""},E=O,P=A,x=g,R=N,k=/^\[object .+?Constructor\]$/,T=Function.prototype,z=Object.prototype,D=T.toString,B=z.hasOwnProperty,I=RegExp("^"+D.call(B).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var U=function(t){return!(!x(t)||P(t))&&(E(t)?I:k).test(R(t))},L=function(t,e){return null==t?void 0:t[e]};var M=function(t,e){var r=L(t,e);return U(r)?r:void 0},F=M,W=function(){try{var t=F(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),$=W;var G=function(t,e,r){"__proto__"==e&&$?$(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r};var q=function(t){return function(e,r,n){for(var o=-1,a=Object(e),i=n(e),u=i.length;u--;){var c=i[t?u:++o];if(!1===r(a[c],c,a))break}return e}}();var V=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n};var H=function(t){return null!=t&&"object"==typeof t},J=b,X=H;var Y=function(t){return X(t)&&"[object Arguments]"==J(t)},Z=H,K=Object.prototype,Q=K.hasOwnProperty,tt=K.propertyIsEnumerable,et=Y(function(){return arguments}())?Y:function(t){return Z(t)&&Q.call(t,"callee")&&!tt.call(t,"callee")},rt=Array.isArray,nt={exports:{}};var ot=function(){return!1};!function(t,e){var r=a,n=ot,o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,u=i&&i.exports===o?r.Buffer:void 0,c=(u?u.isBuffer:void 0)||n;t.exports=c}(nt,nt.exports);var at=nt.exports,it=/^(?:0|[1-9]\d*)$/;var ut=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&it.test(t))&&t>-1&&t%1==0&&t<e};var ct=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},st=b,lt=ct,ft=H,pt={};pt["[object Float32Array]"]=pt["[object Float64Array]"]=pt["[object Int8Array]"]=pt["[object Int16Array]"]=pt["[object Int32Array]"]=pt["[object Uint8Array]"]=pt["[object Uint8ClampedArray]"]=pt["[object Uint16Array]"]=pt["[object Uint32Array]"]=!0,pt["[object Arguments]"]=pt["[object Array]"]=pt["[object ArrayBuffer]"]=pt["[object Boolean]"]=pt["[object DataView]"]=pt["[object Date]"]=pt["[object Error]"]=pt["[object Function]"]=pt["[object Map]"]=pt["[object Number]"]=pt["[object Object]"]=pt["[object RegExp]"]=pt["[object Set]"]=pt["[object String]"]=pt["[object WeakMap]"]=!1;var ht=function(t){return ft(t)&&lt(t.length)&&!!pt[st(t)]};var vt=function(t){return function(e){return t(e)}},dt={exports:{}};!function(t,e){var n=r,o=e&&!e.nodeType&&e,a=o&&t&&!t.nodeType&&t,i=a&&a.exports===o&&n.process,u=function(){try{var t=a&&a.require&&a.require("util").types;return t||i&&i.binding&&i.binding("util")}catch(t){}}();t.exports=u}(dt,dt.exports);var yt=dt.exports,bt=ht,gt=vt,wt=yt&&yt.isTypedArray,_t=wt?gt(wt):bt,mt=V,Ot=et,St=rt,jt=at,At=ut,Ct=_t,Nt=Object.prototype.hasOwnProperty;var Et=function(t,e){var r=St(t),n=!r&&Ot(t),o=!r&&!n&&jt(t),a=!r&&!n&&!o&&Ct(t),i=r||n||o||a,u=i?mt(t.length,String):[],c=u.length;for(var s in t)!e&&!Nt.call(t,s)||i&&("length"==s||o&&("offset"==s||"parent"==s)||a&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||At(s,c))||u.push(s);return u},Pt=Object.prototype;var xt=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Pt)};var Rt=function(t,e){return function(r){return t(e(r))}},kt=Rt(Object.keys,Object),Tt=xt,zt=kt,Dt=Object.prototype.hasOwnProperty;var Bt=O,It=ct;var Ut=function(t){return null!=t&&It(t.length)&&!Bt(t)},Lt=Et,Mt=function(t){if(!Tt(t))return zt(t);var e=[];for(var r in Object(t))Dt.call(t,r)&&"constructor"!=r&&e.push(r);return e},Ft=Ut;var Wt=function(t){return Ft(t)?Lt(t):Mt(t)},$t=q,Gt=Wt;var qt=function(t,e){return t&&$t(t,e,Gt)};var Vt=function(){this.__data__=[],this.size=0};var Ht=function(t,e){return t===e||t!=t&&e!=e},Jt=Ht;var Xt=function(t,e){for(var r=t.length;r--;)if(Jt(t[r][0],e))return r;return-1},Yt=Xt,Zt=Array.prototype.splice;var Kt=Xt;var Qt=Xt;var te=Xt;var ee=Vt,re=function(t){var e=this.__data__,r=Yt(e,t);return!(r<0)&&(r==e.length-1?e.pop():Zt.call(e,r,1),--this.size,!0)},ne=function(t){var e=this.__data__,r=Kt(e,t);return r<0?void 0:e[r][1]},oe=function(t){return Qt(this.__data__,t)>-1},ae=function(t,e){var r=this.__data__,n=te(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function ie(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ie.prototype.clear=ee,ie.prototype.delete=re,ie.prototype.get=ne,ie.prototype.has=oe,ie.prototype.set=ae;var ue=ie,ce=ue;var se=function(){this.__data__=new ce,this.size=0};var le=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};var fe=function(t){return this.__data__.get(t)};var pe=function(t){return this.__data__.has(t)},he=M(a,"Map"),ve=M(Object,"create"),de=ve;var ye=function(){this.__data__=de?de(null):{},this.size=0};var be=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},ge=ve,we=Object.prototype.hasOwnProperty;var _e=function(t){var e=this.__data__;if(ge){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return we.call(e,t)?e[t]:void 0},me=ve,Oe=Object.prototype.hasOwnProperty;var Se=ve;var je=ye,Ae=be,Ce=_e,Ne=function(t){var e=this.__data__;return me?void 0!==e[t]:Oe.call(e,t)},Ee=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Se&&void 0===e?"__lodash_hash_undefined__":e,this};function Pe(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Pe.prototype.clear=je,Pe.prototype.delete=Ae,Pe.prototype.get=Ce,Pe.prototype.has=Ne,Pe.prototype.set=Ee;var xe=Pe,Re=ue,ke=he;var Te=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var ze=function(t,e){var r=t.__data__;return Te(e)?r["string"==typeof e?"string":"hash"]:r.map},De=ze;var Be=ze;var Ie=ze;var Ue=ze;var Le=function(){this.size=0,this.__data__={hash:new xe,map:new(ke||Re),string:new xe}},Me=function(t){var e=De(this,t).delete(t);return this.size-=e?1:0,e},Fe=function(t){return Be(this,t).get(t)},We=function(t){return Ie(this,t).has(t)},$e=function(t,e){var r=Ue(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function Ge(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Ge.prototype.clear=Le,Ge.prototype.delete=Me,Ge.prototype.get=Fe,Ge.prototype.has=We,Ge.prototype.set=$e;var qe=Ge,Ve=ue,He=he,Je=qe;var Xe=ue,Ye=se,Ze=le,Ke=fe,Qe=pe,tr=function(t,e){var r=this.__data__;if(r instanceof Ve){var n=r.__data__;if(!He||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Je(n)}return r.set(t,e),this.size=r.size,this};function er(t){var e=this.__data__=new Xe(t);this.size=e.size}er.prototype.clear=Ye,er.prototype.delete=Ze,er.prototype.get=Ke,er.prototype.has=Qe,er.prototype.set=tr;var rr=er;var nr=qe,or=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},ar=function(t){return this.__data__.has(t)};function ir(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new nr;++e<r;)this.add(t[e])}ir.prototype.add=ir.prototype.push=or,ir.prototype.has=ar;var ur=ir,cr=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1},sr=function(t,e){return t.has(e)};var lr=function(t,e,r,n,o,a){var i=1&r,u=t.length,c=e.length;if(u!=c&&!(i&&c>u))return!1;var s=a.get(t),l=a.get(e);if(s&&l)return s==e&&l==t;var f=-1,p=!0,h=2&r?new ur:void 0;for(a.set(t,e),a.set(e,t);++f<u;){var v=t[f],d=e[f];if(n)var y=i?n(d,v,f,e,t,a):n(v,d,f,t,e,a);if(void 0!==y){if(y)continue;p=!1;break}if(h){if(!cr(e,(function(t,e){if(!sr(h,e)&&(v===t||o(v,t,r,n,a)))return h.push(e)}))){p=!1;break}}else if(v!==d&&!o(v,d,r,n,a)){p=!1;break}}return a.delete(t),a.delete(e),p},fr=a.Uint8Array;var pr=fr,hr=Ht,vr=lr,dr=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r},yr=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},br=i?i.prototype:void 0,gr=br?br.valueOf:void 0;var wr=function(t,e,r,n,o,a,i){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!a(new pr(t),new pr(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return hr(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var u=dr;case"[object Set]":var c=1&n;if(u||(u=yr),t.size!=e.size&&!c)return!1;var s=i.get(t);if(s)return s==e;n|=2,i.set(t,e);var l=vr(u(t),u(e),n,o,a,i);return i.delete(t),l;case"[object Symbol]":if(gr)return gr.call(t)==gr.call(e)}return!1};var _r=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t},mr=_r,Or=rt;var Sr=function(t,e,r){var n=e(t);return Or(t)?n:mr(n,r(t))};var jr=function(){return[]},Ar=function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,a=[];++r<n;){var i=t[r];e(i,r,t)&&(a[o++]=i)}return a},Cr=jr,Nr=Object.prototype.propertyIsEnumerable,Er=Object.getOwnPropertySymbols,Pr=Er?function(t){return null==t?[]:(t=Object(t),Ar(Er(t),(function(e){return Nr.call(t,e)})))}:Cr,xr=Sr,Rr=Pr,kr=Wt;var Tr=function(t){return xr(t,kr,Rr)},zr=Object.prototype.hasOwnProperty;var Dr=function(t,e,r,n,o,a){var i=1&r,u=Tr(t),c=u.length;if(c!=Tr(e).length&&!i)return!1;for(var s=c;s--;){var l=u[s];if(!(i?l in e:zr.call(e,l)))return!1}var f=a.get(t),p=a.get(e);if(f&&p)return f==e&&p==t;var h=!0;a.set(t,e),a.set(e,t);for(var v=i;++s<c;){var d=t[l=u[s]],y=e[l];if(n)var b=i?n(y,d,l,e,t,a):n(d,y,l,t,e,a);if(!(void 0===b?d===y||o(d,y,r,n,a):b)){h=!1;break}v||(v="constructor"==l)}if(h&&!v){var g=t.constructor,w=e.constructor;g==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof g&&g instanceof g&&"function"==typeof w&&w instanceof w||(h=!1)}return a.delete(t),a.delete(e),h},Br=M(a,"DataView"),Ir=he,Ur=M(a,"Promise"),Lr=M(a,"Set"),Mr=M(a,"WeakMap"),Fr=b,Wr=N,$r="[object Map]",Gr="[object Promise]",qr="[object Set]",Vr="[object WeakMap]",Hr="[object DataView]",Jr=Wr(Br),Xr=Wr(Ir),Yr=Wr(Ur),Zr=Wr(Lr),Kr=Wr(Mr),Qr=Fr;(Br&&Qr(new Br(new ArrayBuffer(1)))!=Hr||Ir&&Qr(new Ir)!=$r||Ur&&Qr(Ur.resolve())!=Gr||Lr&&Qr(new Lr)!=qr||Mr&&Qr(new Mr)!=Vr)&&(Qr=function(t){var e=Fr(t),r="[object Object]"==e?t.constructor:void 0,n=r?Wr(r):"";if(n)switch(n){case Jr:return Hr;case Xr:return $r;case Yr:return Gr;case Zr:return qr;case Kr:return Vr}return e});var tn=rr,en=lr,rn=wr,nn=Dr,on=Qr,an=rt,un=at,cn=_t,sn="[object Arguments]",ln="[object Array]",fn="[object Object]",pn=Object.prototype.hasOwnProperty;var hn=function(t,e,r,n,o,a){var i=an(t),u=an(e),c=i?ln:on(t),s=u?ln:on(e),l=(c=c==sn?fn:c)==fn,f=(s=s==sn?fn:s)==fn,p=c==s;if(p&&un(t)){if(!un(e))return!1;i=!0,l=!1}if(p&&!l)return a||(a=new tn),i||cn(t)?en(t,e,r,n,o,a):rn(t,e,c,r,n,o,a);if(!(1&r)){var h=l&&pn.call(t,"__wrapped__"),v=f&&pn.call(e,"__wrapped__");if(h||v){var d=h?t.value():t,y=v?e.value():e;return a||(a=new tn),o(d,y,r,n,a)}}return!!p&&(a||(a=new tn),nn(t,e,r,n,o,a))},vn=H;var dn=function t(e,r,n,o,a){return e===r||(null==e||null==r||!vn(e)&&!vn(r)?e!=e&&r!=r:hn(e,r,n,o,t,a))},yn=rr,bn=dn;var gn=g;var wn=function(t){return t==t&&!gn(t)},_n=wn,mn=Wt;var On=function(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}},Sn=function(t,e,r,n){var o=r.length,a=o,i=!n;if(null==t)return!a;for(t=Object(t);o--;){var u=r[o];if(i&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<a;){var c=(u=r[o])[0],s=t[c],l=u[1];if(i&&u[2]){if(void 0===s&&!(c in t))return!1}else{var f=new yn;if(n)var p=n(s,l,c,t,e,f);if(!(void 0===p?bn(l,s,3,n,f):p))return!1}}return!0},jn=function(t){for(var e=mn(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,_n(o)]}return e},An=On;var Cn=function(t){var e=jn(t);return 1==e.length&&e[0][2]?An(e[0][0],e[0][1]):function(r){return r===t||Sn(r,t,e)}},Nn=b,En=H;var Pn=function(t){return"symbol"==typeof t||En(t)&&"[object Symbol]"==Nn(t)},xn=rt,Rn=Pn,kn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Tn=/^\w*$/;var zn=function(t,e){if(xn(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!Rn(t))||(Tn.test(t)||!kn.test(t)||null!=e&&t in Object(e))},Dn=qe;function Bn(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=t.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(Bn.Cache||Dn),r}Bn.Cache=Dn;var In=Bn;var Un=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ln=/\\(\\)?/g,Mn=function(t){var e=In(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Un,(function(t,r,n,o){e.push(n?o.replace(Ln,"$1"):r||t)})),e}));var Fn=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o},Wn=Fn,$n=rt,Gn=Pn,qn=i?i.prototype:void 0,Vn=qn?qn.toString:void 0;var Hn=function t(e){if("string"==typeof e)return e;if($n(e))return Wn(e,t)+"";if(Gn(e))return Vn?Vn.call(e):"";var r=e+"";return"0"==r&&1/e==-Infinity?"-0":r},Jn=Hn;var Xn=rt,Yn=zn,Zn=Mn,Kn=function(t){return null==t?"":Jn(t)};var Qn=function(t,e){return Xn(t)?t:Yn(t,e)?[t]:Zn(Kn(t))},to=Pn;var eo=function(t){if("string"==typeof t||to(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e},ro=Qn,no=eo;var oo=function(t,e){for(var r=0,n=(e=ro(e,t)).length;null!=t&&r<n;)t=t[no(e[r++])];return r&&r==n?t:void 0},ao=oo;var io=Qn,uo=et,co=rt,so=ut,lo=ct,fo=eo;var po=function(t,e){return null!=t&&e in Object(t)},ho=function(t,e,r){for(var n=-1,o=(e=io(e,t)).length,a=!1;++n<o;){var i=fo(e[n]);if(!(a=null!=t&&r(t,i)))break;t=t[i]}return a||++n!=o?a:!!(o=null==t?0:t.length)&&lo(o)&&so(i,o)&&(co(t)||uo(t))};var vo=dn,yo=function(t,e,r){var n=null==t?void 0:ao(t,e);return void 0===n?r:n},bo=function(t,e){return null!=t&&ho(t,e,po)},go=zn,wo=wn,_o=On,mo=eo;var Oo=function(t){return t};var So=oo;var jo=function(t){return function(e){return null==e?void 0:e[t]}},Ao=function(t){return function(e){return So(e,t)}},Co=zn,No=eo;var Eo=Cn,Po=function(t,e){return go(t)&&wo(e)?_o(mo(t),e):function(r){var n=yo(r,t);return void 0===n&&n===e?bo(r,t):vo(e,n,3)}},xo=Oo,Ro=rt,ko=function(t){return Co(t)?jo(No(t)):Ao(t)};var To=function(t){return"function"==typeof t?t:null==t?xo:"object"==typeof t?Ro(t)?Po(t[0],t[1]):Eo(t):ko(t)},zo=G,Do=qt,Bo=To;var Io=e((function(t,e){var r={};return e=Bo(e),Do(t,(function(t,n,o){zo(r,n,e(t,n,o))})),r})),Uo=G,Lo=Ht,Mo=Object.prototype.hasOwnProperty;var Fo=function(t,e,r){var n=t[e];Mo.call(t,e)&&Lo(n,r)&&(void 0!==r||e in t)||Uo(t,e,r)},Wo=Fo,$o=Qn,Go=ut,qo=g,Vo=eo;var Ho=oo,Jo=function(t,e,r,n){if(!qo(t))return t;for(var o=-1,a=(e=$o(e,t)).length,i=a-1,u=t;null!=u&&++o<a;){var c=Vo(e[o]),s=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return t;if(o!=i){var l=u[c];void 0===(s=n?n(l,c,u):void 0)&&(s=qo(l)?l:Go(e[o+1])?[]:{})}Wo(u,c,s),u=u[c]}return t},Xo=Qn;var Yo=function(t,e,r){for(var n=-1,o=e.length,a={};++n<o;){var i=e[n],u=Ho(t,i);r(u,i)&&Jo(a,Xo(i,t),u)}return a},Zo=Rt(Object.getPrototypeOf,Object),Ko=_r,Qo=Zo,ta=Pr,ea=jr,ra=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)Ko(e,ta(t)),t=Qo(t);return e}:ea;var na=g,oa=xt,aa=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e},ia=Object.prototype.hasOwnProperty;var ua=Et,ca=function(t){if(!na(t))return aa(t);var e=oa(t),r=[];for(var n in t)("constructor"!=n||!e&&ia.call(t,n))&&r.push(n);return r},sa=Ut;var la=function(t){return sa(t)?ua(t,!0):ca(t)},fa=Sr,pa=ra,ha=la;var va=Fn,da=To,ya=Yo,ba=function(t){return fa(t,ha,pa)};var ga=e((function(t,e){if(null==t)return{};var r=va(ba(t),(function(t){return[t]}));return e=da(e),ya(t,r,(function(t,r){return e(t,r[0])}))}));class wa extends Error{}var _a={};function ma(t,e){if(e)return t;throw new Error("Unhandled discriminated union member: "+JSON.stringify(t))}Object.defineProperty(_a,"__esModule",{value:!0}),_a.assertNever=ma;var Oa=_a.default=ma,Sa=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,ja=Math.ceil,Aa=Math.floor,Ca="[BigNumber Error] ",Na=Ca+"Number primitive has more than 15 significant digits: ",Ea=1e14,Pa=14,xa=9007199254740991,Ra=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],ka=1e7,Ta=1e9;function za(t){var e=0|t;return t>0||t===e?e:e-1}function Da(t){for(var e,r,n=1,o=t.length,a=t[0]+"";n<o;){for(e=t[n++]+"",r=Pa-e.length;r--;e="0"+e);a+=e}for(o=a.length;48===a.charCodeAt(--o););return a.slice(0,o+1||1)}function Ba(t,e){var r,n,o=t.c,a=e.c,i=t.s,u=e.s,c=t.e,s=e.e;if(!i||!u)return null;if(r=o&&!o[0],n=a&&!a[0],r||n)return r?n?0:-u:i;if(i!=u)return i;if(r=i<0,n=c==s,!o||!a)return n?0:!o^r?1:-1;if(!n)return c>s^r?1:-1;for(u=(c=o.length)<(s=a.length)?c:s,i=0;i<u;i++)if(o[i]!=a[i])return o[i]>a[i]^r?1:-1;return c==s?0:c>s^r?1:-1}function Ia(t,e,r,n){if(t<e||t>r||t!==Aa(t))throw Error(Ca+(n||"Argument")+("number"==typeof t?t<e||t>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function Ua(t){var e=t.c.length-1;return za(t.e/Pa)==e&&t.c[e]%2!=0}function La(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function Ma(t,e,r){var n,o;if(e<0){for(o=r+".";++e;o+=r);t=o+t}else if(++e>(n=t.length)){for(o=r,e-=n;--e;o+=r);t+=o}else e<n&&(t=t.slice(0,e)+"."+t.slice(e));return t}var Fa=function t(e){var r,n,o,a,i,u,c,s,l,f,p=C.prototype={constructor:C,toString:null,valueOf:null},h=new C(1),v=20,d=4,y=-7,b=21,g=-1e7,w=1e7,_=!1,m=1,O=0,S={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},j="0123456789abcdefghijklmnopqrstuvwxyz",A=!0;function C(t,e){var r,a,i,u,c,s,l,f,p=this;if(!(p instanceof C))return new C(t,e);if(null==e){if(t&&!0===t._isBigNumber)return p.s=t.s,void(!t.c||t.e>w?p.c=p.e=null:t.e<g?p.c=[p.e=0]:(p.e=t.e,p.c=t.c.slice()));if((s="number"==typeof t)&&0*t==0){if(p.s=1/t<0?(t=-t,-1):1,t===~~t){for(u=0,c=t;c>=10;c/=10,u++);return void(u>w?p.c=p.e=null:(p.e=u,p.c=[t]))}f=String(t)}else{if(!Sa.test(f=String(t)))return o(p,f,s);p.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(u=f.indexOf("."))>-1&&(f=f.replace(".","")),(c=f.search(/e/i))>0?(u<0&&(u=c),u+=+f.slice(c+1),f=f.substring(0,c)):u<0&&(u=f.length)}else{if(Ia(e,2,j.length,"Base"),10==e&&A)return x(p=new C(t),v+p.e+1,d);if(f=String(t),s="number"==typeof t){if(0*t!=0)return o(p,f,s,e);if(p.s=1/t<0?(f=f.slice(1),-1):1,C.DEBUG&&f.replace(/^0\.0*|\./,"").length>15)throw Error(Na+t)}else p.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(r=j.slice(0,e),u=c=0,l=f.length;c<l;c++)if(r.indexOf(a=f.charAt(c))<0){if("."==a){if(c>u){u=l;continue}}else if(!i&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){i=!0,c=-1,u=0;continue}return o(p,String(t),s,e)}s=!1,(u=(f=n(f,e,10,p.s)).indexOf("."))>-1?f=f.replace(".",""):u=f.length}for(c=0;48===f.charCodeAt(c);c++);for(l=f.length;48===f.charCodeAt(--l););if(f=f.slice(c,++l)){if(l-=c,s&&C.DEBUG&&l>15&&(t>xa||t!==Aa(t)))throw Error(Na+p.s*t);if((u=u-c-1)>w)p.c=p.e=null;else if(u<g)p.c=[p.e=0];else{if(p.e=u,p.c=[],c=(u+1)%Pa,u<0&&(c+=Pa),c<l){for(c&&p.c.push(+f.slice(0,c)),l-=Pa;c<l;)p.c.push(+f.slice(c,c+=Pa));c=Pa-(f=f.slice(c)).length}else c-=l;for(;c--;f+="0");p.c.push(+f)}}else p.c=[p.e=0]}function N(t,e,r,n){var o,a,i,u,c;if(null==r?r=d:Ia(r,0,8),!t.c)return t.toString();if(o=t.c[0],i=t.e,null==e)c=Da(t.c),c=1==n||2==n&&(i<=y||i>=b)?La(c,i):Ma(c,i,"0");else if(a=(t=x(new C(t),e,r)).e,u=(c=Da(t.c)).length,1==n||2==n&&(e<=a||a<=y)){for(;u<e;c+="0",u++);c=La(c,a)}else if(e-=i,c=Ma(c,a,"0"),a+1>u){if(--e>0)for(c+=".";e--;c+="0");}else if((e+=a-u)>0)for(a+1==u&&(c+=".");e--;c+="0");return t.s<0&&o?"-"+c:c}function E(t,e){for(var r,n,o=1,a=new C(t[0]);o<t.length;o++)(!(n=new C(t[o])).s||(r=Ba(a,n))===e||0===r&&a.s===e)&&(a=n);return a}function P(t,e,r){for(var n=1,o=e.length;!e[--o];e.pop());for(o=e[0];o>=10;o/=10,n++);return(r=n+r*Pa-1)>w?t.c=t.e=null:r<g?t.c=[t.e=0]:(t.e=r,t.c=e),t}function x(t,e,r,n){var o,a,i,u,c,s,l,f=t.c,p=Ra;if(f){t:{for(o=1,u=f[0];u>=10;u/=10,o++);if((a=e-o)<0)a+=Pa,i=e,c=f[s=0],l=Aa(c/p[o-i-1]%10);else if((s=ja((a+1)/Pa))>=f.length){if(!n)break t;for(;f.length<=s;f.push(0));c=l=0,o=1,i=(a%=Pa)-Pa+1}else{for(c=u=f[s],o=1;u>=10;u/=10,o++);l=(i=(a%=Pa)-Pa+o)<0?0:Aa(c/p[o-i-1]%10)}if(n=n||e<0||null!=f[s+1]||(i<0?c:c%p[o-i-1]),n=r<4?(l||n)&&(0==r||r==(t.s<0?3:2)):l>5||5==l&&(4==r||n||6==r&&(a>0?i>0?c/p[o-i]:0:f[s-1])%10&1||r==(t.s<0?8:7)),e<1||!f[0])return f.length=0,n?(e-=t.e+1,f[0]=p[(Pa-e%Pa)%Pa],t.e=-e||0):f[0]=t.e=0,t;if(0==a?(f.length=s,u=1,s--):(f.length=s+1,u=p[Pa-a],f[s]=i>0?Aa(c/p[o-i]%p[i])*u:0),n)for(;;){if(0==s){for(a=1,i=f[0];i>=10;i/=10,a++);for(i=f[0]+=u,u=1;i>=10;i/=10,u++);a!=u&&(t.e++,f[0]==Ea&&(f[0]=1));break}if(f[s]+=u,f[s]!=Ea)break;f[s--]=0,u=1}for(a=f.length;0===f[--a];f.pop());}t.e>w?t.c=t.e=null:t.e<g&&(t.c=[t.e=0])}return t}function R(t){var e,r=t.e;return null===r?t.toString():(e=Da(t.c),e=r<=y||r>=b?La(e,r):Ma(e,r,"0"),t.s<0?"-"+e:e)}return C.clone=t,C.ROUND_UP=0,C.ROUND_DOWN=1,C.ROUND_CEIL=2,C.ROUND_FLOOR=3,C.ROUND_HALF_UP=4,C.ROUND_HALF_DOWN=5,C.ROUND_HALF_EVEN=6,C.ROUND_HALF_CEIL=7,C.ROUND_HALF_FLOOR=8,C.EUCLID=9,C.config=C.set=function(t){var e,r;if(null!=t){if("object"!=typeof t)throw Error(Ca+"Object expected: "+t);if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(Ia(r=t[e],0,Ta,e),v=r),t.hasOwnProperty(e="ROUNDING_MODE")&&(Ia(r=t[e],0,8,e),d=r),t.hasOwnProperty(e="EXPONENTIAL_AT")&&((r=t[e])&&r.pop?(Ia(r[0],-Ta,0,e),Ia(r[1],0,Ta,e),y=r[0],b=r[1]):(Ia(r,-Ta,Ta,e),y=-(b=r<0?-r:r))),t.hasOwnProperty(e="RANGE"))if((r=t[e])&&r.pop)Ia(r[0],-Ta,-1,e),Ia(r[1],1,Ta,e),g=r[0],w=r[1];else{if(Ia(r,-Ta,Ta,e),!r)throw Error(Ca+e+" cannot be zero: "+r);g=-(w=r<0?-r:r)}if(t.hasOwnProperty(e="CRYPTO")){if((r=t[e])!==!!r)throw Error(Ca+e+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw _=!r,Error(Ca+"crypto unavailable");_=r}else _=r}if(t.hasOwnProperty(e="MODULO_MODE")&&(Ia(r=t[e],0,9,e),m=r),t.hasOwnProperty(e="POW_PRECISION")&&(Ia(r=t[e],0,Ta,e),O=r),t.hasOwnProperty(e="FORMAT")){if("object"!=typeof(r=t[e]))throw Error(Ca+e+" not an object: "+r);S=r}if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(r=t[e])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(Ca+e+" invalid: "+r);A="0123456789"==r.slice(0,10),j=r}}return{DECIMAL_PLACES:v,ROUNDING_MODE:d,EXPONENTIAL_AT:[y,b],RANGE:[g,w],CRYPTO:_,MODULO_MODE:m,POW_PRECISION:O,FORMAT:S,ALPHABET:j}},C.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!C.DEBUG)return!0;var e,r,n=t.c,o=t.e,a=t.s;t:if("[object Array]"=={}.toString.call(n)){if((1===a||-1===a)&&o>=-Ta&&o<=Ta&&o===Aa(o)){if(0===n[0]){if(0===o&&1===n.length)return!0;break t}if((e=(o+1)%Pa)<1&&(e+=Pa),String(n[0]).length==e){for(e=0;e<n.length;e++)if((r=n[e])<0||r>=Ea||r!==Aa(r))break t;if(0!==r)return!0}}}else if(null===n&&null===o&&(null===a||1===a||-1===a))return!0;throw Error(Ca+"Invalid BigNumber: "+t)},C.maximum=C.max=function(){return E(arguments,-1)},C.minimum=C.min=function(){return E(arguments,1)},C.random=(a=9007199254740992,i=Math.random()*a&2097151?function(){return Aa(Math.random()*a)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,r,n,o,a,u=0,c=[],s=new C(h);if(null==t?t=v:Ia(t,0,Ta),o=ja(t/Pa),_)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(o*=2));u<o;)(a=131072*e[u]+(e[u+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),e[u]=r[0],e[u+1]=r[1]):(c.push(a%1e14),u+=2);u=o/2}else{if(!crypto.randomBytes)throw _=!1,Error(Ca+"crypto unavailable");for(e=crypto.randomBytes(o*=7);u<o;)(a=281474976710656*(31&e[u])+1099511627776*e[u+1]+4294967296*e[u+2]+16777216*e[u+3]+(e[u+4]<<16)+(e[u+5]<<8)+e[u+6])>=9e15?crypto.randomBytes(7).copy(e,u):(c.push(a%1e14),u+=7);u=o/7}if(!_)for(;u<o;)(a=i())<9e15&&(c[u++]=a%1e14);for(o=c[--u],t%=Pa,o&&t&&(a=Ra[Pa-t],c[u]=Aa(o/a)*a);0===c[u];c.pop(),u--);if(u<0)c=[n=0];else{for(n=-1;0===c[0];c.splice(0,1),n-=Pa);for(u=1,a=c[0];a>=10;a/=10,u++);u<Pa&&(n-=Pa-u)}return s.e=n,s.c=c,s}),C.sum=function(){for(var t=1,e=arguments,r=new C(e[0]);t<e.length;)r=r.plus(e[t++]);return r},n=function(){var t="0123456789";function e(t,e,r,n){for(var o,a,i=[0],u=0,c=t.length;u<c;){for(a=i.length;a--;i[a]*=e);for(i[0]+=n.indexOf(t.charAt(u++)),o=0;o<i.length;o++)i[o]>r-1&&(null==i[o+1]&&(i[o+1]=0),i[o+1]+=i[o]/r|0,i[o]%=r)}return i.reverse()}return function(n,o,a,i,u){var c,s,l,f,p,h,y,b,g=n.indexOf("."),w=v,_=d;for(g>=0&&(f=O,O=0,n=n.replace(".",""),h=(b=new C(o)).pow(n.length-g),O=f,b.c=e(Ma(Da(h.c),h.e,"0"),10,a,t),b.e=b.c.length),l=f=(y=e(n,o,a,u?(c=j,t):(c=t,j))).length;0==y[--f];y.pop());if(!y[0])return c.charAt(0);if(g<0?--l:(h.c=y,h.e=l,h.s=i,y=(h=r(h,b,w,_,a)).c,p=h.r,l=h.e),g=y[s=l+w+1],f=a/2,p=p||s<0||null!=y[s+1],p=_<4?(null!=g||p)&&(0==_||_==(h.s<0?3:2)):g>f||g==f&&(4==_||p||6==_&&1&y[s-1]||_==(h.s<0?8:7)),s<1||!y[0])n=p?Ma(c.charAt(1),-w,c.charAt(0)):c.charAt(0);else{if(y.length=s,p)for(--a;++y[--s]>a;)y[s]=0,s||(++l,y=[1].concat(y));for(f=y.length;!y[--f];);for(g=0,n="";g<=f;n+=c.charAt(y[g++]));n=Ma(n,l,c.charAt(0))}return n}}(),r=function(){function t(t,e,r){var n,o,a,i,u=0,c=t.length,s=e%ka,l=e/ka|0;for(t=t.slice();c--;)u=((o=s*(a=t[c]%ka)+(n=l*a+(i=t[c]/ka|0)*s)%ka*ka+u)/r|0)+(n/ka|0)+l*i,t[c]=o%r;return u&&(t=[u].concat(t)),t}function e(t,e,r,n){var o,a;if(r!=n)a=r>n?1:-1;else for(o=a=0;o<r;o++)if(t[o]!=e[o]){a=t[o]>e[o]?1:-1;break}return a}function r(t,e,r,n){for(var o=0;r--;)t[r]-=o,o=t[r]<e[r]?1:0,t[r]=o*n+t[r]-e[r];for(;!t[0]&&t.length>1;t.splice(0,1));}return function(n,o,a,i,u){var c,s,l,f,p,h,v,d,y,b,g,w,_,m,O,S,j,A=n.s==o.s?1:-1,N=n.c,E=o.c;if(!(N&&N[0]&&E&&E[0]))return new C(n.s&&o.s&&(N?!E||N[0]!=E[0]:E)?N&&0==N[0]||!E?0*A:A/0:NaN);for(y=(d=new C(A)).c=[],A=a+(s=n.e-o.e)+1,u||(u=Ea,s=za(n.e/Pa)-za(o.e/Pa),A=A/Pa|0),l=0;E[l]==(N[l]||0);l++);if(E[l]>(N[l]||0)&&s--,A<0)y.push(1),f=!0;else{for(m=N.length,S=E.length,l=0,A+=2,(p=Aa(u/(E[0]+1)))>1&&(E=t(E,p,u),N=t(N,p,u),S=E.length,m=N.length),_=S,g=(b=N.slice(0,S)).length;g<S;b[g++]=0);j=E.slice(),j=[0].concat(j),O=E[0],E[1]>=u/2&&O++;do{if(p=0,(c=e(E,b,S,g))<0){if(w=b[0],S!=g&&(w=w*u+(b[1]||0)),(p=Aa(w/O))>1)for(p>=u&&(p=u-1),v=(h=t(E,p,u)).length,g=b.length;1==e(h,b,v,g);)p--,r(h,S<v?j:E,v,u),v=h.length,c=1;else 0==p&&(c=p=1),v=(h=E.slice()).length;if(v<g&&(h=[0].concat(h)),r(b,h,g,u),g=b.length,-1==c)for(;e(E,b,S,g)<1;)p++,r(b,S<g?j:E,g,u),g=b.length}else 0===c&&(p++,b=[0]);y[l++]=p,b[0]?b[g++]=N[_]||0:(b=[N[_]],g=1)}while((_++<m||null!=b[0])&&A--);f=null!=b[0],y[0]||y.splice(0,1)}if(u==Ea){for(l=1,A=y[0];A>=10;A/=10,l++);x(d,a+(d.e=l+s*Pa-1)+1,i,f)}else d.e=s,d.r=+f;return d}}(),u=/^(-?)0([xbo])(?=\w[\w.]*$)/i,c=/^([^.]+)\.$/,s=/^\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,f=/^\s*\+(?=[\w.])|^\s+|\s+$/g,o=function(t,e,r,n){var o,a=r?e:e.replace(f,"");if(l.test(a))t.s=isNaN(a)?null:a<0?-1:1;else{if(!r&&(a=a.replace(u,(function(t,e,r){return o="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=o?t:e})),n&&(o=n,a=a.replace(c,"$1").replace(s,"0.$1")),e!=a))return new C(a,o);if(C.DEBUG)throw Error(Ca+"Not a"+(n?" base "+n:"")+" number: "+e);t.s=null}t.c=t.e=null},p.absoluteValue=p.abs=function(){var t=new C(this);return t.s<0&&(t.s=1),t},p.comparedTo=function(t,e){return Ba(this,new C(t,e))},p.decimalPlaces=p.dp=function(t,e){var r,n,o,a=this;if(null!=t)return Ia(t,0,Ta),null==e?e=d:Ia(e,0,8),x(new C(a),t+a.e+1,e);if(!(r=a.c))return null;if(n=((o=r.length-1)-za(this.e/Pa))*Pa,o=r[o])for(;o%10==0;o/=10,n--);return n<0&&(n=0),n},p.dividedBy=p.div=function(t,e){return r(this,new C(t,e),v,d)},p.dividedToIntegerBy=p.idiv=function(t,e){return r(this,new C(t,e),0,1)},p.exponentiatedBy=p.pow=function(t,e){var r,n,o,a,i,u,c,s,l=this;if((t=new C(t)).c&&!t.isInteger())throw Error(Ca+"Exponent not an integer: "+R(t));if(null!=e&&(e=new C(e)),i=t.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!t.c||!t.c[0])return s=new C(Math.pow(+R(l),i?t.s*(2-Ua(t)):+R(t))),e?s.mod(e):s;if(u=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new C(NaN);(n=!u&&l.isInteger()&&e.isInteger())&&(l=l.mod(e))}else{if(t.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||i&&l.c[1]>=24e7:l.c[0]<8e13||i&&l.c[0]<=9999975e7)))return a=l.s<0&&Ua(t)?-0:0,l.e>-1&&(a=1/a),new C(u?1/a:a);O&&(a=ja(O/Pa+2))}for(i?(r=new C(.5),u&&(t.s=1),c=Ua(t)):c=(o=Math.abs(+R(t)))%2,s=new C(h);;){if(c){if(!(s=s.times(l)).c)break;a?s.c.length>a&&(s.c.length=a):n&&(s=s.mod(e))}if(o){if(0===(o=Aa(o/2)))break;c=o%2}else if(x(t=t.times(r),t.e+1,1),t.e>14)c=Ua(t);else{if(0===(o=+R(t)))break;c=o%2}l=l.times(l),a?l.c&&l.c.length>a&&(l.c.length=a):n&&(l=l.mod(e))}return n?s:(u&&(s=h.div(s)),e?s.mod(e):a?x(s,O,d,undefined):s)},p.integerValue=function(t){var e=new C(this);return null==t?t=d:Ia(t,0,8),x(e,e.e+1,t)},p.isEqualTo=p.eq=function(t,e){return 0===Ba(this,new C(t,e))},p.isFinite=function(){return!!this.c},p.isGreaterThan=p.gt=function(t,e){return Ba(this,new C(t,e))>0},p.isGreaterThanOrEqualTo=p.gte=function(t,e){return 1===(e=Ba(this,new C(t,e)))||0===e},p.isInteger=function(){return!!this.c&&za(this.e/Pa)>this.c.length-2},p.isLessThan=p.lt=function(t,e){return Ba(this,new C(t,e))<0},p.isLessThanOrEqualTo=p.lte=function(t,e){return-1===(e=Ba(this,new C(t,e)))||0===e},p.isNaN=function(){return!this.s},p.isNegative=function(){return this.s<0},p.isPositive=function(){return this.s>0},p.isZero=function(){return!!this.c&&0==this.c[0]},p.minus=function(t,e){var r,n,o,a,i=this,u=i.s;if(e=(t=new C(t,e)).s,!u||!e)return new C(NaN);if(u!=e)return t.s=-e,i.plus(t);var c=i.e/Pa,s=t.e/Pa,l=i.c,f=t.c;if(!c||!s){if(!l||!f)return l?(t.s=-e,t):new C(f?i:NaN);if(!l[0]||!f[0])return f[0]?(t.s=-e,t):new C(l[0]?i:3==d?-0:0)}if(c=za(c),s=za(s),l=l.slice(),u=c-s){for((a=u<0)?(u=-u,o=l):(s=c,o=f),o.reverse(),e=u;e--;o.push(0));o.reverse()}else for(n=(a=(u=l.length)<(e=f.length))?u:e,u=e=0;e<n;e++)if(l[e]!=f[e]){a=l[e]<f[e];break}if(a&&(o=l,l=f,f=o,t.s=-t.s),(e=(n=f.length)-(r=l.length))>0)for(;e--;l[r++]=0);for(e=Ea-1;n>u;){if(l[--n]<f[n]){for(r=n;r&&!l[--r];l[r]=e);--l[r],l[n]+=Ea}l[n]-=f[n]}for(;0==l[0];l.splice(0,1),--s);return l[0]?P(t,l,s):(t.s=3==d?-1:1,t.c=[t.e=0],t)},p.modulo=p.mod=function(t,e){var n,o,a=this;return t=new C(t,e),!a.c||!t.s||t.c&&!t.c[0]?new C(NaN):!t.c||a.c&&!a.c[0]?new C(a):(9==m?(o=t.s,t.s=1,n=r(a,t,0,3),t.s=o,n.s*=o):n=r(a,t,0,m),(t=a.minus(n.times(t))).c[0]||1!=m||(t.s=a.s),t)},p.multipliedBy=p.times=function(t,e){var r,n,o,a,i,u,c,s,l,f,p,h,v,d,y,b=this,g=b.c,w=(t=new C(t,e)).c;if(!(g&&w&&g[0]&&w[0]))return!b.s||!t.s||g&&!g[0]&&!w||w&&!w[0]&&!g?t.c=t.e=t.s=null:(t.s*=b.s,g&&w?(t.c=[0],t.e=0):t.c=t.e=null),t;for(n=za(b.e/Pa)+za(t.e/Pa),t.s*=b.s,(c=g.length)<(f=w.length)&&(v=g,g=w,w=v,o=c,c=f,f=o),o=c+f,v=[];o--;v.push(0));for(d=Ea,y=ka,o=f;--o>=0;){for(r=0,p=w[o]%y,h=w[o]/y|0,a=o+(i=c);a>o;)r=((s=p*(s=g[--i]%y)+(u=h*s+(l=g[i]/y|0)*p)%y*y+v[a]+r)/d|0)+(u/y|0)+h*l,v[a--]=s%d;v[a]=r}return r?++n:v.splice(0,1),P(t,v,n)},p.negated=function(){var t=new C(this);return t.s=-t.s||null,t},p.plus=function(t,e){var r,n=this,o=n.s;if(e=(t=new C(t,e)).s,!o||!e)return new C(NaN);if(o!=e)return t.s=-e,n.minus(t);var a=n.e/Pa,i=t.e/Pa,u=n.c,c=t.c;if(!a||!i){if(!u||!c)return new C(o/0);if(!u[0]||!c[0])return c[0]?t:new C(u[0]?n:0*o)}if(a=za(a),i=za(i),u=u.slice(),o=a-i){for(o>0?(i=a,r=c):(o=-o,r=u),r.reverse();o--;r.push(0));r.reverse()}for((o=u.length)-(e=c.length)<0&&(r=c,c=u,u=r,e=o),o=0;e;)o=(u[--e]=u[e]+c[e]+o)/Ea|0,u[e]=Ea===u[e]?0:u[e]%Ea;return o&&(u=[o].concat(u),++i),P(t,u,i)},p.precision=p.sd=function(t,e){var r,n,o,a=this;if(null!=t&&t!==!!t)return Ia(t,1,Ta),null==e?e=d:Ia(e,0,8),x(new C(a),t,e);if(!(r=a.c))return null;if(n=(o=r.length-1)*Pa+1,o=r[o]){for(;o%10==0;o/=10,n--);for(o=r[0];o>=10;o/=10,n++);}return t&&a.e+1>n&&(n=a.e+1),n},p.shiftedBy=function(t){return Ia(t,-9007199254740991,xa),this.times("1e"+t)},p.squareRoot=p.sqrt=function(){var t,e,n,o,a,i=this,u=i.c,c=i.s,s=i.e,l=v+4,f=new C("0.5");if(1!==c||!u||!u[0])return new C(!c||c<0&&(!u||u[0])?NaN:u?i:1/0);if(0==(c=Math.sqrt(+R(i)))||c==1/0?(((e=Da(u)).length+s)%2==0&&(e+="0"),c=Math.sqrt(+e),s=za((s+1)/2)-(s<0||s%2),n=new C(e=c==1/0?"5e"+s:(e=c.toExponential()).slice(0,e.indexOf("e")+1)+s)):n=new C(c+""),n.c[0])for((c=(s=n.e)+l)<3&&(c=0);;)if(a=n,n=f.times(a.plus(r(i,a,l,1))),Da(a.c).slice(0,c)===(e=Da(n.c)).slice(0,c)){if(n.e<s&&--c,"9999"!=(e=e.slice(c-3,c+1))&&(o||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(x(n,n.e+v+2,1),t=!n.times(n).eq(i));break}if(!o&&(x(a,a.e+v+2,0),a.times(a).eq(i))){n=a;break}l+=4,c+=4,o=1}return x(n,n.e+v+1,d,t)},p.toExponential=function(t,e){return null!=t&&(Ia(t,0,Ta),t++),N(this,t,e,1)},p.toFixed=function(t,e){return null!=t&&(Ia(t,0,Ta),t=t+this.e+1),N(this,t,e)},p.toFormat=function(t,e,r){var n,o=this;if(null==r)null!=t&&e&&"object"==typeof e?(r=e,e=null):t&&"object"==typeof t?(r=t,t=e=null):r=S;else if("object"!=typeof r)throw Error(Ca+"Argument not an object: "+r);if(n=o.toFixed(t,e),o.c){var a,i=n.split("."),u=+r.groupSize,c=+r.secondaryGroupSize,s=r.groupSeparator||"",l=i[0],f=i[1],p=o.s<0,h=p?l.slice(1):l,v=h.length;if(c&&(a=u,u=c,c=a,v-=a),u>0&&v>0){for(a=v%u||u,l=h.substr(0,a);a<v;a+=u)l+=s+h.substr(a,u);c>0&&(l+=s+h.slice(a)),p&&(l="-"+l)}n=f?l+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):l}return(r.prefix||"")+n+(r.suffix||"")},p.toFraction=function(t){var e,n,o,a,i,u,c,s,l,f,p,v,y=this,b=y.c;if(null!=t&&(!(c=new C(t)).isInteger()&&(c.c||1!==c.s)||c.lt(h)))throw Error(Ca+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+R(c));if(!b)return new C(y);for(e=new C(h),l=n=new C(h),o=s=new C(h),v=Da(b),i=e.e=v.length-y.e-1,e.c[0]=Ra[(u=i%Pa)<0?Pa+u:u],t=!t||c.comparedTo(e)>0?i>0?e:l:c,u=w,w=1/0,c=new C(v),s.c[0]=0;f=r(c,e,0,1),1!=(a=n.plus(f.times(o))).comparedTo(t);)n=o,o=a,l=s.plus(f.times(a=l)),s=a,e=c.minus(f.times(a=e)),c=a;return a=r(t.minus(n),o,0,1),s=s.plus(a.times(l)),n=n.plus(a.times(o)),s.s=l.s=y.s,p=r(l,o,i*=2,d).minus(y).abs().comparedTo(r(s,n,i,d).minus(y).abs())<1?[l,o]:[s,n],w=u,p},p.toNumber=function(){return+R(this)},p.toPrecision=function(t,e){return null!=t&&Ia(t,1,Ta),N(this,t,e,2)},p.toString=function(t){var e,r=this,o=r.s,a=r.e;return null===a?o?(e="Infinity",o<0&&(e="-"+e)):e="NaN":(null==t?e=a<=y||a>=b?La(Da(r.c),a):Ma(Da(r.c),a,"0"):10===t&&A?e=Ma(Da((r=x(new C(r),v+a+1,d)).c),r.e,"0"):(Ia(t,2,j.length,"Base"),e=n(Ma(Da(r.c),a,"0"),10,t,o,!0)),o<0&&r.c[0]&&(e="-"+e)),e},p.valueOf=p.toJSON=function(){return R(this)},p._isBigNumber=!0,p[Symbol.toStringTag]="BigNumber",p[Symbol.for("nodejs.util.inspect.custom")]=p.valueOf,null!=e&&C.set(e),C}(),Wa=G,$a=Ht;var Ga=function(t,e,r){(void 0!==r&&!$a(t[e],r)||void 0===r&&!(e in t))&&Wa(t,e,r)},qa={exports:{}};!function(t,e){var r=a,n=e&&!e.nodeType&&e,o=n&&t&&!t.nodeType&&t,i=o&&o.exports===n?r.Buffer:void 0,u=i?i.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var r=t.length,n=u?u(r):new t.constructor(r);return t.copy(n),n}}(qa,qa.exports);var Va=qa.exports,Ha=fr;var Ja=function(t){var e=new t.constructor(t.byteLength);return new Ha(e).set(new Ha(t)),e};var Xa=function(t,e){var r=e?Ja(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)};var Ya=function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e},Za=g,Ka=Object.create,Qa=function(){function t(){}return function(e){if(!Za(e))return{};if(Ka)return Ka(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),ti=Zo,ei=xt;var ri=function(t){return"function"!=typeof t.constructor||ei(t)?{}:Qa(ti(t))},ni=Ut,oi=H;var ai=function(t){return oi(t)&&ni(t)},ii=b,ui=Zo,ci=H,si=Function.prototype,li=Object.prototype,fi=si.toString,pi=li.hasOwnProperty,hi=fi.call(Object);var vi=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]},di=Fo,yi=G;var bi=function(t,e,r,n){var o=!r;r||(r={});for(var a=-1,i=e.length;++a<i;){var u=e[a],c=n?n(r[u],t[u],u,r,t):void 0;void 0===c&&(c=t[u]),o?yi(r,u,c):di(r,u,c)}return r},gi=la;var wi=Ga,_i=Va,mi=Xa,Oi=Ya,Si=ri,ji=et,Ai=rt,Ci=ai,Ni=at,Ei=O,Pi=g,xi=function(t){if(!ci(t)||"[object Object]"!=ii(t))return!1;var e=ui(t);if(null===e)return!0;var r=pi.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&fi.call(r)==hi},Ri=_t,ki=vi,Ti=function(t){return bi(t,gi(t))};var zi=rr,Di=Ga,Bi=q,Ii=function(t,e,r,n,o,a,i){var u=ki(t,r),c=ki(e,r),s=i.get(c);if(s)wi(t,r,s);else{var l=a?a(u,c,r+"",t,e,i):void 0,f=void 0===l;if(f){var p=Ai(c),h=!p&&Ni(c),v=!p&&!h&&Ri(c);l=c,p||h||v?Ai(u)?l=u:Ci(u)?l=Oi(u):h?(f=!1,l=_i(c,!0)):v?(f=!1,l=mi(c,!0)):l=[]:xi(c)||ji(c)?(l=u,ji(u)?l=Ti(u):Pi(u)&&!Ei(u)||(l=Si(c))):f=!1}f&&(i.set(c,l),o(l,c,n,a,i),i.delete(c)),wi(t,r,l)}},Ui=g,Li=la,Mi=vi;var Fi=function t(e,r,n,o,a){e!==r&&Bi(r,(function(i,u){if(a||(a=new zi),Ui(i))Ii(e,r,u,n,t,o,a);else{var c=o?o(Mi(e,u),i,u+"",e,r,a):void 0;void 0===c&&(c=i),Di(e,u,c)}}),Li)};var Wi=function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)},$i=Math.max;var Gi=function(t,e,r){return e=$i(void 0===e?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=$i(n.length-e,0),i=Array(a);++o<a;)i[o]=n[e+o];o=-1;for(var u=Array(e+1);++o<e;)u[o]=n[o];return u[e]=r(i),Wi(t,this,u)}};var qi=function(t){return function(){return t}},Vi=W,Hi=Vi?function(t,e){return Vi(t,"toString",{configurable:!0,enumerable:!1,value:qi(e),writable:!0})}:Oo,Ji=Date.now;var Xi=function(t){var e=0,r=0;return function(){var n=Ji(),o=16-(n-r);if(r=n,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Hi),Yi=Oo,Zi=Gi,Ki=Xi;var Qi=Ht,tu=Ut,eu=ut,ru=g;var nu=function(t,e){return Ki(Zi(t,e,Yi),t+"")},ou=function(t,e,r){if(!ru(r))return!1;var n=typeof e;return!!("number"==n?tu(r)&&eu(e,r.length):"string"==n&&e in r)&&Qi(r[e],t)};var au=Fi,iu=e(function(t){return nu((function(e,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,i=o>2?r[2]:void 0;for(a=t.length>3&&"function"==typeof a?(o--,a):void 0,i&&ou(r[0],r[1],i)&&(a=o<3?void 0:a,o=1),e=Object(e);++n<o;){var u=r[n];u&&t(e,u,n,a)}return e}))}((function(t,e,r){au(t,e,r)})));const uu={betCount:0,callCount:0,checkCount:0,foldCount:0,raiseCount:0,bets:{}},cu=(t,e,r)=>{const n=t.playerStats[e];return void 0===n?t.playerStats:{...t.playerStats,[e]:iu(n,r(n))}},su=({state:t,action:e})=>{const{type:r}=e;switch(r){case"award-pot":return(({state:t,action:e})=>({...t,playerStats:cu(t,e.playerName,(({totalAwarded:t,totalWon:r})=>({totalAwarded:t.plus(e.amount),totalWon:r.plus(e.amount)})))}))({state:t,action:e});case"bet":return(({state:t,action:e})=>({...t,handStats:{...t.handStats,totalPot:t.handStats.totalPot.plus(e.amount)},playerStats:cu(t,e.playerName,(({streets:r,totalActionCount:n,totalContributed:o,totalWon:a})=>({totalActionCount:n+1,totalContributed:o.plus(e.amount),totalWon:a.minus(e.amount),vpip:!0,streets:{[t.currentStreet]:{...uu,...r[t.currentStreet],betCount:(r[t.currentStreet]?.betCount??0)+1}}})))}))({state:t,action:e});case"call":return(({state:t,action:e})=>({...t,handStats:{...t.handStats,totalPot:t.handStats.totalPot.plus(e.amount)},playerStats:cu(t,e.playerName,(({streets:r,totalActionCount:n,totalContributed:o,totalWon:a})=>({totalActionCount:n+1,totalContributed:o.plus(e.amount),totalWon:a.minus(e.amount),vpip:!0,streets:{[t.currentStreet]:{...uu,...r[t.currentStreet],callCount:(r[t.currentStreet]?.callCount??0)+1}}})))}))({state:t,action:e});case"check":return(({state:t,action:e})=>({...t,playerStats:cu(t,e.playerName,(({streets:e,totalActionCount:r})=>({totalActionCount:r+1,streets:{[t.currentStreet]:{...uu,...e[t.currentStreet],checkCount:(e[t.currentStreet]?.checkCount??0)+1}}})))}))({state:t,action:e});case"deal-board":return(({state:t,action:e})=>({...t,currentStreet:e.street,currentStreetRaiseCount:0}))({state:t,action:e});case"fold":return(({state:t,action:e})=>({...t,playerStats:cu(t,e.playerName,(({streets:e,totalActionCount:r})=>({totalActionCount:r+1,streets:{[t.currentStreet]:{...uu,...e[t.currentStreet],foldCount:(e[t.currentStreet]?.foldCount??0)+1}}})))}))({state:t,action:e});case"muck":case"showdown":return(({state:t,action:e})=>({...t,playerStats:cu(t,e.playerName,(()=>({wentToShowdown:!0})))}))({state:t,action:e});case"post":return(({state:t,action:e})=>({...t,handStats:{...t.handStats,totalPot:t.handStats.totalPot.plus(e.amount)},playerStats:cu(t,e.playerName,(({totalContributed:t,totalWon:r})=>({totalContributed:t.plus(e.amount),totalWon:r.minus(e.amount)})))}))({state:t,action:e});case"raise":return(({state:t,action:e})=>({...t,currentStreetRaiseCount:t.currentStreetRaiseCount+1,handStats:{...t.handStats,totalPot:t.handStats.totalPot.plus(e.amount)},playerStats:cu(t,e.playerName,(({streets:r,totalActionCount:n,totalContributed:o,totalWon:a})=>({totalActionCount:n+1,totalContributed:o.plus(e.amount),totalWon:a.minus(e.amount),vpip:!0,streets:{[t.currentStreet]:{...uu,...r[t.currentStreet],raiseCount:(r[t.currentStreet]?.raiseCount??0)+1,bets:{...r[t.currentStreet]?.bets,[t.currentStreetRaiseCount+1]:1}}}})))}))({state:t,action:e});case"return-bet":return(({state:t,action:e})=>({...t,handStats:{...t.handStats,totalPot:t.handStats.totalPot.minus(e.amount)},playerStats:cu(t,e.playerName,(({totalContributed:t,totalWon:r})=>({totalContributed:t.minus(e.amount),totalWon:r.plus(e.amount)})))}))({state:t,action:e});case"board":case"deal-hand":return t;default:return Oa(r)}},lu=t=>{const e=(t=>t.handStats.totalPot.minus(Object.values(t.playerStats).reduce(((t,e)=>t.plus(e.totalAwarded)),new Fa(0))))(t),r=(t=>Object.values(t.playerStats).reduce(((t,e)=>t.plus(e.totalAwarded)),new Fa(0)))(t);return{...t,handStats:{...t.handStats,totalRake:e},playerStats:Io(t.playerStats,(t=>({...t,totalRakeContributed:e.times(t.totalAwarded.div(r))})))}};exports.InvalidDataError=wa,exports.analyzeHand=({actions:t,players:e})=>{if(1!==e.filter((t=>t.isHero)).length)throw new wa("Hand histories should only involve one hero.");let r=((t=[])=>({currentStreet:"preflop",currentStreetRaiseCount:1,handStats:{totalPot:new Fa(0),totalRake:new Fa(0)},playerStats:Object.fromEntries(t.map((t=>[t.name,{streets:{},aggressiveActionCount:0,totalActionCount:0,totalAwarded:new Fa(0),totalContributed:new Fa(0),totalRakeContributed:new Fa(0),totalWon:new Fa(0),vpip:!1,wentToShowdown:!1}])))}))(e);t.forEach((t=>{r=su({state:r,action:t})})),r=lu(r);const n={...r.handStats,totalPot:r.handStats.totalPot.toString(),totalRake:r.handStats.totalRake.toString()},o=Io(r.playerStats,(t=>({...t,totalAwarded:t.totalAwarded.toString(),totalContributed:t.totalContributed.toString(),totalRakeContributed:t.totalRakeContributed.toString(),totalWon:t.totalWon.toString()}))),a=new Set(e.filter((t=>!t.isAnonymous)).map((t=>t.name)));return{hand:n,players:ga(o,((t,e)=>a.has(e)))}};
"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var r="object"==typeof t&&t&&t.Object===Object&&t,n=r,o="object"==typeof self&&self&&self.Object===Object&&self,a=n||o||Function("return this")(),i=a.Symbol,u=i,c=Object.prototype,s=c.hasOwnProperty,l=c.toString,f=u?u.toStringTag:void 0;var p=function(t){var e=s.call(t,f),r=t[f];try{t[f]=void 0;var n=!0}catch(t){}var o=l.call(t);return n&&(e?t[f]=r:delete t[f]),o},h=Object.prototype.toString;var v=p,d=function(t){return h.call(t)},y=i?i.toStringTag:void 0;var b=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":y&&y in Object(t)?v(t):d(t)};var g=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},w=b,_=g;var m,O=function(t){if(!_(t))return!1;var e=w(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},S=a["__core-js_shared__"],j=(m=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||""))?"Symbol(src)_1."+m:"";var A=function(t){return!!j&&j in t},C=Function.prototype.toString;var N=function(t){if(null!=t){try{return C.call(t)}catch(t){}try{return t+""}catch(t){}}return""},E=O,P=A,x=g,R=N,T=/^\[object .+?Constructor\]$/,k=Function.prototype,z=Object.prototype,D=k.toString,B=z.hasOwnProperty,I=RegExp("^"+D.call(B).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var U=function(t){return!(!x(t)||P(t))&&(E(t)?I:T).test(R(t))},L=function(t,e){return null==t?void 0:t[e]};var M=function(t,e){var r=L(t,e);return U(r)?r:void 0},F=M,W=function(){try{var t=F(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),$=W;var G=function(t,e,r){"__proto__"==e&&$?$(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r};var q=function(t){return function(e,r,n){for(var o=-1,a=Object(e),i=n(e),u=i.length;u--;){var c=i[t?u:++o];if(!1===r(a[c],c,a))break}return e}}();var V=function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n};var H=function(t){return null!=t&&"object"==typeof t},J=b,X=H;var Y=function(t){return X(t)&&"[object Arguments]"==J(t)},Z=H,K=Object.prototype,Q=K.hasOwnProperty,tt=K.propertyIsEnumerable,et=Y(function(){return arguments}())?Y:function(t){return Z(t)&&Q.call(t,"callee")&&!tt.call(t,"callee")},rt=Array.isArray,nt={exports:{}};var ot=function(){return!1};!function(t,e){var r=a,n=ot,o=e&&!e.nodeType&&e,i=o&&t&&!t.nodeType&&t,u=i&&i.exports===o?r.Buffer:void 0,c=(u?u.isBuffer:void 0)||n;t.exports=c}(nt,nt.exports);var at=nt.exports,it=/^(?:0|[1-9]\d*)$/;var ut=function(t,e){var r=typeof t;return!!(e=null==e?9007199254740991:e)&&("number"==r||"symbol"!=r&&it.test(t))&&t>-1&&t%1==0&&t<e};var ct=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},st=b,lt=ct,ft=H,pt={};pt["[object Float32Array]"]=pt["[object Float64Array]"]=pt["[object Int8Array]"]=pt["[object Int16Array]"]=pt["[object Int32Array]"]=pt["[object Uint8Array]"]=pt["[object Uint8ClampedArray]"]=pt["[object Uint16Array]"]=pt["[object Uint32Array]"]=!0,pt["[object Arguments]"]=pt["[object Array]"]=pt["[object ArrayBuffer]"]=pt["[object Boolean]"]=pt["[object DataView]"]=pt["[object Date]"]=pt["[object Error]"]=pt["[object Function]"]=pt["[object Map]"]=pt["[object Number]"]=pt["[object Object]"]=pt["[object RegExp]"]=pt["[object Set]"]=pt["[object String]"]=pt["[object WeakMap]"]=!1;var ht=function(t){return ft(t)&&lt(t.length)&&!!pt[st(t)]};var vt=function(t){return function(e){return t(e)}},dt={exports:{}};!function(t,e){var n=r,o=e&&!e.nodeType&&e,a=o&&t&&!t.nodeType&&t,i=a&&a.exports===o&&n.process,u=function(){try{var t=a&&a.require&&a.require("util").types;return t||i&&i.binding&&i.binding("util")}catch(t){}}();t.exports=u}(dt,dt.exports);var yt=dt.exports,bt=ht,gt=vt,wt=yt&&yt.isTypedArray,_t=wt?gt(wt):bt,mt=V,Ot=et,St=rt,jt=at,At=ut,Ct=_t,Nt=Object.prototype.hasOwnProperty;var Et=function(t,e){var r=St(t),n=!r&&Ot(t),o=!r&&!n&&jt(t),a=!r&&!n&&!o&&Ct(t),i=r||n||o||a,u=i?mt(t.length,String):[],c=u.length;for(var s in t)!e&&!Nt.call(t,s)||i&&("length"==s||o&&("offset"==s||"parent"==s)||a&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||At(s,c))||u.push(s);return u},Pt=Object.prototype;var xt=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Pt)};var Rt=function(t,e){return function(r){return t(e(r))}},Tt=Rt(Object.keys,Object),kt=xt,zt=Tt,Dt=Object.prototype.hasOwnProperty;var Bt=O,It=ct;var Ut=function(t){return null!=t&&It(t.length)&&!Bt(t)},Lt=Et,Mt=function(t){if(!kt(t))return zt(t);var e=[];for(var r in Object(t))Dt.call(t,r)&&"constructor"!=r&&e.push(r);return e},Ft=Ut;var Wt=function(t){return Ft(t)?Lt(t):Mt(t)},$t=q,Gt=Wt;var qt=function(t,e){return t&&$t(t,e,Gt)};var Vt=function(){this.__data__=[],this.size=0};var Ht=function(t,e){return t===e||t!=t&&e!=e},Jt=Ht;var Xt=function(t,e){for(var r=t.length;r--;)if(Jt(t[r][0],e))return r;return-1},Yt=Xt,Zt=Array.prototype.splice;var Kt=Xt;var Qt=Xt;var te=Xt;var ee=Vt,re=function(t){var e=this.__data__,r=Yt(e,t);return!(r<0)&&(r==e.length-1?e.pop():Zt.call(e,r,1),--this.size,!0)},ne=function(t){var e=this.__data__,r=Kt(e,t);return r<0?void 0:e[r][1]},oe=function(t){return Qt(this.__data__,t)>-1},ae=function(t,e){var r=this.__data__,n=te(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function ie(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ie.prototype.clear=ee,ie.prototype.delete=re,ie.prototype.get=ne,ie.prototype.has=oe,ie.prototype.set=ae;var ue=ie,ce=ue;var se=function(){this.__data__=new ce,this.size=0};var le=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r};var fe=function(t){return this.__data__.get(t)};var pe=function(t){return this.__data__.has(t)},he=M(a,"Map"),ve=M(Object,"create"),de=ve;var ye=function(){this.__data__=de?de(null):{},this.size=0};var be=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},ge=ve,we=Object.prototype.hasOwnProperty;var _e=function(t){var e=this.__data__;if(ge){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return we.call(e,t)?e[t]:void 0},me=ve,Oe=Object.prototype.hasOwnProperty;var Se=ve;var je=ye,Ae=be,Ce=_e,Ne=function(t){var e=this.__data__;return me?void 0!==e[t]:Oe.call(e,t)},Ee=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Se&&void 0===e?"__lodash_hash_undefined__":e,this};function Pe(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Pe.prototype.clear=je,Pe.prototype.delete=Ae,Pe.prototype.get=Ce,Pe.prototype.has=Ne,Pe.prototype.set=Ee;var xe=Pe,Re=ue,Te=he;var ke=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var ze=function(t,e){var r=t.__data__;return ke(e)?r["string"==typeof e?"string":"hash"]:r.map},De=ze;var Be=ze;var Ie=ze;var Ue=ze;var Le=function(){this.size=0,this.__data__={hash:new xe,map:new(Te||Re),string:new xe}},Me=function(t){var e=De(this,t).delete(t);return this.size-=e?1:0,e},Fe=function(t){return Be(this,t).get(t)},We=function(t){return Ie(this,t).has(t)},$e=function(t,e){var r=Ue(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function Ge(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Ge.prototype.clear=Le,Ge.prototype.delete=Me,Ge.prototype.get=Fe,Ge.prototype.has=We,Ge.prototype.set=$e;var qe=Ge,Ve=ue,He=he,Je=qe;var Xe=ue,Ye=se,Ze=le,Ke=fe,Qe=pe,tr=function(t,e){var r=this.__data__;if(r instanceof Ve){var n=r.__data__;if(!He||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Je(n)}return r.set(t,e),this.size=r.size,this};function er(t){var e=this.__data__=new Xe(t);this.size=e.size}er.prototype.clear=Ye,er.prototype.delete=Ze,er.prototype.get=Ke,er.prototype.has=Qe,er.prototype.set=tr;var rr=er;var nr=qe,or=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},ar=function(t){return this.__data__.has(t)};function ir(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new nr;++e<r;)this.add(t[e])}ir.prototype.add=ir.prototype.push=or,ir.prototype.has=ar;var ur=ir,cr=function(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1},sr=function(t,e){return t.has(e)};var lr=function(t,e,r,n,o,a){var i=1&r,u=t.length,c=e.length;if(u!=c&&!(i&&c>u))return!1;var s=a.get(t),l=a.get(e);if(s&&l)return s==e&&l==t;var f=-1,p=!0,h=2&r?new ur:void 0;for(a.set(t,e),a.set(e,t);++f<u;){var v=t[f],d=e[f];if(n)var y=i?n(d,v,f,e,t,a):n(v,d,f,t,e,a);if(void 0!==y){if(y)continue;p=!1;break}if(h){if(!cr(e,(function(t,e){if(!sr(h,e)&&(v===t||o(v,t,r,n,a)))return h.push(e)}))){p=!1;break}}else if(v!==d&&!o(v,d,r,n,a)){p=!1;break}}return a.delete(t),a.delete(e),p},fr=a.Uint8Array;var pr=fr,hr=Ht,vr=lr,dr=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r},yr=function(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r},br=i?i.prototype:void 0,gr=br?br.valueOf:void 0;var wr=function(t,e,r,n,o,a,i){switch(r){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!a(new pr(t),new pr(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return hr(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case"[object Map]":var u=dr;case"[object Set]":var c=1&n;if(u||(u=yr),t.size!=e.size&&!c)return!1;var s=i.get(t);if(s)return s==e;n|=2,i.set(t,e);var l=vr(u(t),u(e),n,o,a,i);return i.delete(t),l;case"[object Symbol]":if(gr)return gr.call(t)==gr.call(e)}return!1};var _r=function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t},mr=_r,Or=rt;var Sr=function(t,e,r){var n=e(t);return Or(t)?n:mr(n,r(t))};var jr=function(){return[]},Ar=function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,a=[];++r<n;){var i=t[r];e(i,r,t)&&(a[o++]=i)}return a},Cr=jr,Nr=Object.prototype.propertyIsEnumerable,Er=Object.getOwnPropertySymbols,Pr=Er?function(t){return null==t?[]:(t=Object(t),Ar(Er(t),(function(e){return Nr.call(t,e)})))}:Cr,xr=Sr,Rr=Pr,Tr=Wt;var kr=function(t){return xr(t,Tr,Rr)},zr=Object.prototype.hasOwnProperty;var Dr=function(t,e,r,n,o,a){var i=1&r,u=kr(t),c=u.length;if(c!=kr(e).length&&!i)return!1;for(var s=c;s--;){var l=u[s];if(!(i?l in e:zr.call(e,l)))return!1}var f=a.get(t),p=a.get(e);if(f&&p)return f==e&&p==t;var h=!0;a.set(t,e),a.set(e,t);for(var v=i;++s<c;){var d=t[l=u[s]],y=e[l];if(n)var b=i?n(y,d,l,e,t,a):n(d,y,l,t,e,a);if(!(void 0===b?d===y||o(d,y,r,n,a):b)){h=!1;break}v||(v="constructor"==l)}if(h&&!v){var g=t.constructor,w=e.constructor;g==w||!("constructor"in t)||!("constructor"in e)||"function"==typeof g&&g instanceof g&&"function"==typeof w&&w instanceof w||(h=!1)}return a.delete(t),a.delete(e),h},Br=M(a,"DataView"),Ir=he,Ur=M(a,"Promise"),Lr=M(a,"Set"),Mr=M(a,"WeakMap"),Fr=b,Wr=N,$r="[object Map]",Gr="[object Promise]",qr="[object Set]",Vr="[object WeakMap]",Hr="[object DataView]",Jr=Wr(Br),Xr=Wr(Ir),Yr=Wr(Ur),Zr=Wr(Lr),Kr=Wr(Mr),Qr=Fr;(Br&&Qr(new Br(new ArrayBuffer(1)))!=Hr||Ir&&Qr(new Ir)!=$r||Ur&&Qr(Ur.resolve())!=Gr||Lr&&Qr(new Lr)!=qr||Mr&&Qr(new Mr)!=Vr)&&(Qr=function(t){var e=Fr(t),r="[object Object]"==e?t.constructor:void 0,n=r?Wr(r):"";if(n)switch(n){case Jr:return Hr;case Xr:return $r;case Yr:return Gr;case Zr:return qr;case Kr:return Vr}return e});var tn=rr,en=lr,rn=wr,nn=Dr,on=Qr,an=rt,un=at,cn=_t,sn="[object Arguments]",ln="[object Array]",fn="[object Object]",pn=Object.prototype.hasOwnProperty;var hn=function(t,e,r,n,o,a){var i=an(t),u=an(e),c=i?ln:on(t),s=u?ln:on(e),l=(c=c==sn?fn:c)==fn,f=(s=s==sn?fn:s)==fn,p=c==s;if(p&&un(t)){if(!un(e))return!1;i=!0,l=!1}if(p&&!l)return a||(a=new tn),i||cn(t)?en(t,e,r,n,o,a):rn(t,e,c,r,n,o,a);if(!(1&r)){var h=l&&pn.call(t,"__wrapped__"),v=f&&pn.call(e,"__wrapped__");if(h||v){var d=h?t.value():t,y=v?e.value():e;return a||(a=new tn),o(d,y,r,n,a)}}return!!p&&(a||(a=new tn),nn(t,e,r,n,o,a))},vn=H;var dn=function t(e,r,n,o,a){return e===r||(null==e||null==r||!vn(e)&&!vn(r)?e!=e&&r!=r:hn(e,r,n,o,t,a))},yn=rr,bn=dn;var gn=g;var wn=function(t){return t==t&&!gn(t)},_n=wn,mn=Wt;var On=function(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}},Sn=function(t,e,r,n){var o=r.length,a=o,i=!n;if(null==t)return!a;for(t=Object(t);o--;){var u=r[o];if(i&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<a;){var c=(u=r[o])[0],s=t[c],l=u[1];if(i&&u[2]){if(void 0===s&&!(c in t))return!1}else{var f=new yn;if(n)var p=n(s,l,c,t,e,f);if(!(void 0===p?bn(l,s,3,n,f):p))return!1}}return!0},jn=function(t){for(var e=mn(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,_n(o)]}return e},An=On;var Cn=function(t){var e=jn(t);return 1==e.length&&e[0][2]?An(e[0][0],e[0][1]):function(r){return r===t||Sn(r,t,e)}},Nn=b,En=H;var Pn=function(t){return"symbol"==typeof t||En(t)&&"[object Symbol]"==Nn(t)},xn=rt,Rn=Pn,Tn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,kn=/^\w*$/;var zn=function(t,e){if(xn(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!Rn(t))||(kn.test(t)||!Tn.test(t)||null!=e&&t in Object(e))},Dn=qe;function Bn(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=t.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(Bn.Cache||Dn),r}Bn.Cache=Dn;var In=Bn;var Un=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ln=/\\(\\)?/g,Mn=function(t){var e=In(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Un,(function(t,r,n,o){e.push(n?o.replace(Ln,"$1"):r||t)})),e}));var Fn=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o},Wn=Fn,$n=rt,Gn=Pn,qn=i?i.prototype:void 0,Vn=qn?qn.toString:void 0;var Hn=function t(e){if("string"==typeof e)return e;if($n(e))return Wn(e,t)+"";if(Gn(e))return Vn?Vn.call(e):"";var r=e+"";return"0"==r&&1/e==-Infinity?"-0":r},Jn=Hn;var Xn=rt,Yn=zn,Zn=Mn,Kn=function(t){return null==t?"":Jn(t)};var Qn=function(t,e){return Xn(t)?t:Yn(t,e)?[t]:Zn(Kn(t))},to=Pn;var eo=function(t){if("string"==typeof t||to(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e},ro=Qn,no=eo;var oo=function(t,e){for(var r=0,n=(e=ro(e,t)).length;null!=t&&r<n;)t=t[no(e[r++])];return r&&r==n?t:void 0},ao=oo;var io=Qn,uo=et,co=rt,so=ut,lo=ct,fo=eo;var po=function(t,e){return null!=t&&e in Object(t)},ho=function(t,e,r){for(var n=-1,o=(e=io(e,t)).length,a=!1;++n<o;){var i=fo(e[n]);if(!(a=null!=t&&r(t,i)))break;t=t[i]}return a||++n!=o?a:!!(o=null==t?0:t.length)&&lo(o)&&so(i,o)&&(co(t)||uo(t))};var vo=dn,yo=function(t,e,r){var n=null==t?void 0:ao(t,e);return void 0===n?r:n},bo=function(t,e){return null!=t&&ho(t,e,po)},go=zn,wo=wn,_o=On,mo=eo;var Oo=function(t){return t};var So=oo;var jo=function(t){return function(e){return null==e?void 0:e[t]}},Ao=function(t){return function(e){return So(e,t)}},Co=zn,No=eo;var Eo=Cn,Po=function(t,e){return go(t)&&wo(e)?_o(mo(t),e):function(r){var n=yo(r,t);return void 0===n&&n===e?bo(r,t):vo(e,n,3)}},xo=Oo,Ro=rt,To=function(t){return Co(t)?jo(No(t)):Ao(t)};var ko=function(t){return"function"==typeof t?t:null==t?xo:"object"==typeof t?Ro(t)?Po(t[0],t[1]):Eo(t):To(t)},zo=G,Do=qt,Bo=ko;var Io=e((function(t,e){var r={};return e=Bo(e),Do(t,(function(t,n,o){zo(r,n,e(t,n,o))})),r})),Uo=G,Lo=Ht,Mo=Object.prototype.hasOwnProperty;var Fo=function(t,e,r){var n=t[e];Mo.call(t,e)&&Lo(n,r)&&(void 0!==r||e in t)||Uo(t,e,r)},Wo=Fo,$o=Qn,Go=ut,qo=g,Vo=eo;var Ho=oo,Jo=function(t,e,r,n){if(!qo(t))return t;for(var o=-1,a=(e=$o(e,t)).length,i=a-1,u=t;null!=u&&++o<a;){var c=Vo(e[o]),s=r;if("__proto__"===c||"constructor"===c||"prototype"===c)return t;if(o!=i){var l=u[c];void 0===(s=n?n(l,c,u):void 0)&&(s=qo(l)?l:Go(e[o+1])?[]:{})}Wo(u,c,s),u=u[c]}return t},Xo=Qn;var Yo=function(t,e,r){for(var n=-1,o=e.length,a={};++n<o;){var i=e[n],u=Ho(t,i);r(u,i)&&Jo(a,Xo(i,t),u)}return a},Zo=Rt(Object.getPrototypeOf,Object),Ko=_r,Qo=Zo,ta=Pr,ea=jr,ra=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)Ko(e,ta(t)),t=Qo(t);return e}:ea;var na=g,oa=xt,aa=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e},ia=Object.prototype.hasOwnProperty;var ua=Et,ca=function(t){if(!na(t))return aa(t);var e=oa(t),r=[];for(var n in t)("constructor"!=n||!e&&ia.call(t,n))&&r.push(n);return r},sa=Ut;var la=function(t){return sa(t)?ua(t,!0):ca(t)},fa=Sr,pa=ra,ha=la;var va=Fn,da=ko,ya=Yo,ba=function(t){return fa(t,ha,pa)};var ga=e((function(t,e){if(null==t)return{};var r=va(ba(t),(function(t){return[t]}));return e=da(e),ya(t,r,(function(t,r){return e(t,r[0])}))}));class wa extends Error{}var _a={};function ma(t,e){if(e)return t;throw new Error("Unhandled discriminated union member: "+JSON.stringify(t))}Object.defineProperty(_a,"__esModule",{value:!0}),_a.assertNever=ma;var Oa=_a.default=ma,Sa=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,ja=Math.ceil,Aa=Math.floor,Ca="[BigNumber Error] ",Na=Ca+"Number primitive has more than 15 significant digits: ",Ea=1e14,Pa=14,xa=9007199254740991,Ra=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Ta=1e7,ka=1e9;function za(t){var e=0|t;return t>0||t===e?e:e-1}function Da(t){for(var e,r,n=1,o=t.length,a=t[0]+"";n<o;){for(e=t[n++]+"",r=Pa-e.length;r--;e="0"+e);a+=e}for(o=a.length;48===a.charCodeAt(--o););return a.slice(0,o+1||1)}function Ba(t,e){var r,n,o=t.c,a=e.c,i=t.s,u=e.s,c=t.e,s=e.e;if(!i||!u)return null;if(r=o&&!o[0],n=a&&!a[0],r||n)return r?n?0:-u:i;if(i!=u)return i;if(r=i<0,n=c==s,!o||!a)return n?0:!o^r?1:-1;if(!n)return c>s^r?1:-1;for(u=(c=o.length)<(s=a.length)?c:s,i=0;i<u;i++)if(o[i]!=a[i])return o[i]>a[i]^r?1:-1;return c==s?0:c>s^r?1:-1}function Ia(t,e,r,n){if(t<e||t>r||t!==Aa(t))throw Error(Ca+(n||"Argument")+("number"==typeof t?t<e||t>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function Ua(t){var e=t.c.length-1;return za(t.e/Pa)==e&&t.c[e]%2!=0}function La(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function Ma(t,e,r){var n,o;if(e<0){for(o=r+".";++e;o+=r);t=o+t}else if(++e>(n=t.length)){for(o=r,e-=n;--e;o+=r);t+=o}else e<n&&(t=t.slice(0,e)+"."+t.slice(e));return t}var Fa=function t(e){var r,n,o,a,i,u,c,s,l,f,p=C.prototype={constructor:C,toString:null,valueOf:null},h=new C(1),v=20,d=4,y=-7,b=21,g=-1e7,w=1e7,_=!1,m=1,O=0,S={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},j="0123456789abcdefghijklmnopqrstuvwxyz",A=!0;function C(t,e){var r,a,i,u,c,s,l,f,p=this;if(!(p instanceof C))return new C(t,e);if(null==e){if(t&&!0===t._isBigNumber)return p.s=t.s,void(!t.c||t.e>w?p.c=p.e=null:t.e<g?p.c=[p.e=0]:(p.e=t.e,p.c=t.c.slice()));if((s="number"==typeof t)&&0*t==0){if(p.s=1/t<0?(t=-t,-1):1,t===~~t){for(u=0,c=t;c>=10;c/=10,u++);return void(u>w?p.c=p.e=null:(p.e=u,p.c=[t]))}f=String(t)}else{if(!Sa.test(f=String(t)))return o(p,f,s);p.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(u=f.indexOf("."))>-1&&(f=f.replace(".","")),(c=f.search(/e/i))>0?(u<0&&(u=c),u+=+f.slice(c+1),f=f.substring(0,c)):u<0&&(u=f.length)}else{if(Ia(e,2,j.length,"Base"),10==e&&A)return x(p=new C(t),v+p.e+1,d);if(f=String(t),s="number"==typeof t){if(0*t!=0)return o(p,f,s,e);if(p.s=1/t<0?(f=f.slice(1),-1):1,C.DEBUG&&f.replace(/^0\.0*|\./,"").length>15)throw Error(Na+t)}else p.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(r=j.slice(0,e),u=c=0,l=f.length;c<l;c++)if(r.indexOf(a=f.charAt(c))<0){if("."==a){if(c>u){u=l;continue}}else if(!i&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){i=!0,c=-1,u=0;continue}return o(p,String(t),s,e)}s=!1,(u=(f=n(f,e,10,p.s)).indexOf("."))>-1?f=f.replace(".",""):u=f.length}for(c=0;48===f.charCodeAt(c);c++);for(l=f.length;48===f.charCodeAt(--l););if(f=f.slice(c,++l)){if(l-=c,s&&C.DEBUG&&l>15&&(t>xa||t!==Aa(t)))throw Error(Na+p.s*t);if((u=u-c-1)>w)p.c=p.e=null;else if(u<g)p.c=[p.e=0];else{if(p.e=u,p.c=[],c=(u+1)%Pa,u<0&&(c+=Pa),c<l){for(c&&p.c.push(+f.slice(0,c)),l-=Pa;c<l;)p.c.push(+f.slice(c,c+=Pa));c=Pa-(f=f.slice(c)).length}else c-=l;for(;c--;f+="0");p.c.push(+f)}}else p.c=[p.e=0]}function N(t,e,r,n){var o,a,i,u,c;if(null==r?r=d:Ia(r,0,8),!t.c)return t.toString();if(o=t.c[0],i=t.e,null==e)c=Da(t.c),c=1==n||2==n&&(i<=y||i>=b)?La(c,i):Ma(c,i,"0");else if(a=(t=x(new C(t),e,r)).e,u=(c=Da(t.c)).length,1==n||2==n&&(e<=a||a<=y)){for(;u<e;c+="0",u++);c=La(c,a)}else if(e-=i,c=Ma(c,a,"0"),a+1>u){if(--e>0)for(c+=".";e--;c+="0");}else if((e+=a-u)>0)for(a+1==u&&(c+=".");e--;c+="0");return t.s<0&&o?"-"+c:c}function E(t,e){for(var r,n,o=1,a=new C(t[0]);o<t.length;o++)(!(n=new C(t[o])).s||(r=Ba(a,n))===e||0===r&&a.s===e)&&(a=n);return a}function P(t,e,r){for(var n=1,o=e.length;!e[--o];e.pop());for(o=e[0];o>=10;o/=10,n++);return(r=n+r*Pa-1)>w?t.c=t.e=null:r<g?t.c=[t.e=0]:(t.e=r,t.c=e),t}function x(t,e,r,n){var o,a,i,u,c,s,l,f=t.c,p=Ra;if(f){t:{for(o=1,u=f[0];u>=10;u/=10,o++);if((a=e-o)<0)a+=Pa,i=e,c=f[s=0],l=Aa(c/p[o-i-1]%10);else if((s=ja((a+1)/Pa))>=f.length){if(!n)break t;for(;f.length<=s;f.push(0));c=l=0,o=1,i=(a%=Pa)-Pa+1}else{for(c=u=f[s],o=1;u>=10;u/=10,o++);l=(i=(a%=Pa)-Pa+o)<0?0:Aa(c/p[o-i-1]%10)}if(n=n||e<0||null!=f[s+1]||(i<0?c:c%p[o-i-1]),n=r<4?(l||n)&&(0==r||r==(t.s<0?3:2)):l>5||5==l&&(4==r||n||6==r&&(a>0?i>0?c/p[o-i]:0:f[s-1])%10&1||r==(t.s<0?8:7)),e<1||!f[0])return f.length=0,n?(e-=t.e+1,f[0]=p[(Pa-e%Pa)%Pa],t.e=-e||0):f[0]=t.e=0,t;if(0==a?(f.length=s,u=1,s--):(f.length=s+1,u=p[Pa-a],f[s]=i>0?Aa(c/p[o-i]%p[i])*u:0),n)for(;;){if(0==s){for(a=1,i=f[0];i>=10;i/=10,a++);for(i=f[0]+=u,u=1;i>=10;i/=10,u++);a!=u&&(t.e++,f[0]==Ea&&(f[0]=1));break}if(f[s]+=u,f[s]!=Ea)break;f[s--]=0,u=1}for(a=f.length;0===f[--a];f.pop());}t.e>w?t.c=t.e=null:t.e<g&&(t.c=[t.e=0])}return t}function R(t){var e,r=t.e;return null===r?t.toString():(e=Da(t.c),e=r<=y||r>=b?La(e,r):Ma(e,r,"0"),t.s<0?"-"+e:e)}return C.clone=t,C.ROUND_UP=0,C.ROUND_DOWN=1,C.ROUND_CEIL=2,C.ROUND_FLOOR=3,C.ROUND_HALF_UP=4,C.ROUND_HALF_DOWN=5,C.ROUND_HALF_EVEN=6,C.ROUND_HALF_CEIL=7,C.ROUND_HALF_FLOOR=8,C.EUCLID=9,C.config=C.set=function(t){var e,r;if(null!=t){if("object"!=typeof t)throw Error(Ca+"Object expected: "+t);if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(Ia(r=t[e],0,ka,e),v=r),t.hasOwnProperty(e="ROUNDING_MODE")&&(Ia(r=t[e],0,8,e),d=r),t.hasOwnProperty(e="EXPONENTIAL_AT")&&((r=t[e])&&r.pop?(Ia(r[0],-ka,0,e),Ia(r[1],0,ka,e),y=r[0],b=r[1]):(Ia(r,-ka,ka,e),y=-(b=r<0?-r:r))),t.hasOwnProperty(e="RANGE"))if((r=t[e])&&r.pop)Ia(r[0],-ka,-1,e),Ia(r[1],1,ka,e),g=r[0],w=r[1];else{if(Ia(r,-ka,ka,e),!r)throw Error(Ca+e+" cannot be zero: "+r);g=-(w=r<0?-r:r)}if(t.hasOwnProperty(e="CRYPTO")){if((r=t[e])!==!!r)throw Error(Ca+e+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw _=!r,Error(Ca+"crypto unavailable");_=r}else _=r}if(t.hasOwnProperty(e="MODULO_MODE")&&(Ia(r=t[e],0,9,e),m=r),t.hasOwnProperty(e="POW_PRECISION")&&(Ia(r=t[e],0,ka,e),O=r),t.hasOwnProperty(e="FORMAT")){if("object"!=typeof(r=t[e]))throw Error(Ca+e+" not an object: "+r);S=r}if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(r=t[e])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(Ca+e+" invalid: "+r);A="0123456789"==r.slice(0,10),j=r}}return{DECIMAL_PLACES:v,ROUNDING_MODE:d,EXPONENTIAL_AT:[y,b],RANGE:[g,w],CRYPTO:_,MODULO_MODE:m,POW_PRECISION:O,FORMAT:S,ALPHABET:j}},C.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!C.DEBUG)return!0;var e,r,n=t.c,o=t.e,a=t.s;t:if("[object Array]"=={}.toString.call(n)){if((1===a||-1===a)&&o>=-ka&&o<=ka&&o===Aa(o)){if(0===n[0]){if(0===o&&1===n.length)return!0;break t}if((e=(o+1)%Pa)<1&&(e+=Pa),String(n[0]).length==e){for(e=0;e<n.length;e++)if((r=n[e])<0||r>=Ea||r!==Aa(r))break t;if(0!==r)return!0}}}else if(null===n&&null===o&&(null===a||1===a||-1===a))return!0;throw Error(Ca+"Invalid BigNumber: "+t)},C.maximum=C.max=function(){return E(arguments,-1)},C.minimum=C.min=function(){return E(arguments,1)},C.random=(a=9007199254740992,i=Math.random()*a&2097151?function(){return Aa(Math.random()*a)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,r,n,o,a,u=0,c=[],s=new C(h);if(null==t?t=v:Ia(t,0,ka),o=ja(t/Pa),_)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(o*=2));u<o;)(a=131072*e[u]+(e[u+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),e[u]=r[0],e[u+1]=r[1]):(c.push(a%1e14),u+=2);u=o/2}else{if(!crypto.randomBytes)throw _=!1,Error(Ca+"crypto unavailable");for(e=crypto.randomBytes(o*=7);u<o;)(a=281474976710656*(31&e[u])+1099511627776*e[u+1]+4294967296*e[u+2]+16777216*e[u+3]+(e[u+4]<<16)+(e[u+5]<<8)+e[u+6])>=9e15?crypto.randomBytes(7).copy(e,u):(c.push(a%1e14),u+=7);u=o/7}if(!_)for(;u<o;)(a=i())<9e15&&(c[u++]=a%1e14);for(o=c[--u],t%=Pa,o&&t&&(a=Ra[Pa-t],c[u]=Aa(o/a)*a);0===c[u];c.pop(),u--);if(u<0)c=[n=0];else{for(n=-1;0===c[0];c.splice(0,1),n-=Pa);for(u=1,a=c[0];a>=10;a/=10,u++);u<Pa&&(n-=Pa-u)}return s.e=n,s.c=c,s}),C.sum=function(){for(var t=1,e=arguments,r=new C(e[0]);t<e.length;)r=r.plus(e[t++]);return r},n=function(){var t="0123456789";function e(t,e,r,n){for(var o,a,i=[0],u=0,c=t.length;u<c;){for(a=i.length;a--;i[a]*=e);for(i[0]+=n.indexOf(t.charAt(u++)),o=0;o<i.length;o++)i[o]>r-1&&(null==i[o+1]&&(i[o+1]=0),i[o+1]+=i[o]/r|0,i[o]%=r)}return i.reverse()}return function(n,o,a,i,u){var c,s,l,f,p,h,y,b,g=n.indexOf("."),w=v,_=d;for(g>=0&&(f=O,O=0,n=n.replace(".",""),h=(b=new C(o)).pow(n.length-g),O=f,b.c=e(Ma(Da(h.c),h.e,"0"),10,a,t),b.e=b.c.length),l=f=(y=e(n,o,a,u?(c=j,t):(c=t,j))).length;0==y[--f];y.pop());if(!y[0])return c.charAt(0);if(g<0?--l:(h.c=y,h.e=l,h.s=i,y=(h=r(h,b,w,_,a)).c,p=h.r,l=h.e),g=y[s=l+w+1],f=a/2,p=p||s<0||null!=y[s+1],p=_<4?(null!=g||p)&&(0==_||_==(h.s<0?3:2)):g>f||g==f&&(4==_||p||6==_&&1&y[s-1]||_==(h.s<0?8:7)),s<1||!y[0])n=p?Ma(c.charAt(1),-w,c.charAt(0)):c.charAt(0);else{if(y.length=s,p)for(--a;++y[--s]>a;)y[s]=0,s||(++l,y=[1].concat(y));for(f=y.length;!y[--f];);for(g=0,n="";g<=f;n+=c.charAt(y[g++]));n=Ma(n,l,c.charAt(0))}return n}}(),r=function(){function t(t,e,r){var n,o,a,i,u=0,c=t.length,s=e%Ta,l=e/Ta|0;for(t=t.slice();c--;)u=((o=s*(a=t[c]%Ta)+(n=l*a+(i=t[c]/Ta|0)*s)%Ta*Ta+u)/r|0)+(n/Ta|0)+l*i,t[c]=o%r;return u&&(t=[u].concat(t)),t}function e(t,e,r,n){var o,a;if(r!=n)a=r>n?1:-1;else for(o=a=0;o<r;o++)if(t[o]!=e[o]){a=t[o]>e[o]?1:-1;break}return a}function r(t,e,r,n){for(var o=0;r--;)t[r]-=o,o=t[r]<e[r]?1:0,t[r]=o*n+t[r]-e[r];for(;!t[0]&&t.length>1;t.splice(0,1));}return function(n,o,a,i,u){var c,s,l,f,p,h,v,d,y,b,g,w,_,m,O,S,j,A=n.s==o.s?1:-1,N=n.c,E=o.c;if(!(N&&N[0]&&E&&E[0]))return new C(n.s&&o.s&&(N?!E||N[0]!=E[0]:E)?N&&0==N[0]||!E?0*A:A/0:NaN);for(y=(d=new C(A)).c=[],A=a+(s=n.e-o.e)+1,u||(u=Ea,s=za(n.e/Pa)-za(o.e/Pa),A=A/Pa|0),l=0;E[l]==(N[l]||0);l++);if(E[l]>(N[l]||0)&&s--,A<0)y.push(1),f=!0;else{for(m=N.length,S=E.length,l=0,A+=2,(p=Aa(u/(E[0]+1)))>1&&(E=t(E,p,u),N=t(N,p,u),S=E.length,m=N.length),_=S,g=(b=N.slice(0,S)).length;g<S;b[g++]=0);j=E.slice(),j=[0].concat(j),O=E[0],E[1]>=u/2&&O++;do{if(p=0,(c=e(E,b,S,g))<0){if(w=b[0],S!=g&&(w=w*u+(b[1]||0)),(p=Aa(w/O))>1)for(p>=u&&(p=u-1),v=(h=t(E,p,u)).length,g=b.length;1==e(h,b,v,g);)p--,r(h,S<v?j:E,v,u),v=h.length,c=1;else 0==p&&(c=p=1),v=(h=E.slice()).length;if(v<g&&(h=[0].concat(h)),r(b,h,g,u),g=b.length,-1==c)for(;e(E,b,S,g)<1;)p++,r(b,S<g?j:E,g,u),g=b.length}else 0===c&&(p++,b=[0]);y[l++]=p,b[0]?b[g++]=N[_]||0:(b=[N[_]],g=1)}while((_++<m||null!=b[0])&&A--);f=null!=b[0],y[0]||y.splice(0,1)}if(u==Ea){for(l=1,A=y[0];A>=10;A/=10,l++);x(d,a+(d.e=l+s*Pa-1)+1,i,f)}else d.e=s,d.r=+f;return d}}(),u=/^(-?)0([xbo])(?=\w[\w.]*$)/i,c=/^([^.]+)\.$/,s=/^\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,f=/^\s*\+(?=[\w.])|^\s+|\s+$/g,o=function(t,e,r,n){var o,a=r?e:e.replace(f,"");if(l.test(a))t.s=isNaN(a)?null:a<0?-1:1;else{if(!r&&(a=a.replace(u,(function(t,e,r){return o="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=o?t:e})),n&&(o=n,a=a.replace(c,"$1").replace(s,"0.$1")),e!=a))return new C(a,o);if(C.DEBUG)throw Error(Ca+"Not a"+(n?" base "+n:"")+" number: "+e);t.s=null}t.c=t.e=null},p.absoluteValue=p.abs=function(){var t=new C(this);return t.s<0&&(t.s=1),t},p.comparedTo=function(t,e){return Ba(this,new C(t,e))},p.decimalPlaces=p.dp=function(t,e){var r,n,o,a=this;if(null!=t)return Ia(t,0,ka),null==e?e=d:Ia(e,0,8),x(new C(a),t+a.e+1,e);if(!(r=a.c))return null;if(n=((o=r.length-1)-za(this.e/Pa))*Pa,o=r[o])for(;o%10==0;o/=10,n--);return n<0&&(n=0),n},p.dividedBy=p.div=function(t,e){return r(this,new C(t,e),v,d)},p.dividedToIntegerBy=p.idiv=function(t,e){return r(this,new C(t,e),0,1)},p.exponentiatedBy=p.pow=function(t,e){var r,n,o,a,i,u,c,s,l=this;if((t=new C(t)).c&&!t.isInteger())throw Error(Ca+"Exponent not an integer: "+R(t));if(null!=e&&(e=new C(e)),i=t.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!t.c||!t.c[0])return s=new C(Math.pow(+R(l),i?t.s*(2-Ua(t)):+R(t))),e?s.mod(e):s;if(u=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new C(NaN);(n=!u&&l.isInteger()&&e.isInteger())&&(l=l.mod(e))}else{if(t.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||i&&l.c[1]>=24e7:l.c[0]<8e13||i&&l.c[0]<=9999975e7)))return a=l.s<0&&Ua(t)?-0:0,l.e>-1&&(a=1/a),new C(u?1/a:a);O&&(a=ja(O/Pa+2))}for(i?(r=new C(.5),u&&(t.s=1),c=Ua(t)):c=(o=Math.abs(+R(t)))%2,s=new C(h);;){if(c){if(!(s=s.times(l)).c)break;a?s.c.length>a&&(s.c.length=a):n&&(s=s.mod(e))}if(o){if(0===(o=Aa(o/2)))break;c=o%2}else if(x(t=t.times(r),t.e+1,1),t.e>14)c=Ua(t);else{if(0===(o=+R(t)))break;c=o%2}l=l.times(l),a?l.c&&l.c.length>a&&(l.c.length=a):n&&(l=l.mod(e))}return n?s:(u&&(s=h.div(s)),e?s.mod(e):a?x(s,O,d,undefined):s)},p.integerValue=function(t){var e=new C(this);return null==t?t=d:Ia(t,0,8),x(e,e.e+1,t)},p.isEqualTo=p.eq=function(t,e){return 0===Ba(this,new C(t,e))},p.isFinite=function(){return!!this.c},p.isGreaterThan=p.gt=function(t,e){return Ba(this,new C(t,e))>0},p.isGreaterThanOrEqualTo=p.gte=function(t,e){return 1===(e=Ba(this,new C(t,e)))||0===e},p.isInteger=function(){return!!this.c&&za(this.e/Pa)>this.c.length-2},p.isLessThan=p.lt=function(t,e){return Ba(this,new C(t,e))<0},p.isLessThanOrEqualTo=p.lte=function(t,e){return-1===(e=Ba(this,new C(t,e)))||0===e},p.isNaN=function(){return!this.s},p.isNegative=function(){return this.s<0},p.isPositive=function(){return this.s>0},p.isZero=function(){return!!this.c&&0==this.c[0]},p.minus=function(t,e){var r,n,o,a,i=this,u=i.s;if(e=(t=new C(t,e)).s,!u||!e)return new C(NaN);if(u!=e)return t.s=-e,i.plus(t);var c=i.e/Pa,s=t.e/Pa,l=i.c,f=t.c;if(!c||!s){if(!l||!f)return l?(t.s=-e,t):new C(f?i:NaN);if(!l[0]||!f[0])return f[0]?(t.s=-e,t):new C(l[0]?i:3==d?-0:0)}if(c=za(c),s=za(s),l=l.slice(),u=c-s){for((a=u<0)?(u=-u,o=l):(s=c,o=f),o.reverse(),e=u;e--;o.push(0));o.reverse()}else for(n=(a=(u=l.length)<(e=f.length))?u:e,u=e=0;e<n;e++)if(l[e]!=f[e]){a=l[e]<f[e];break}if(a&&(o=l,l=f,f=o,t.s=-t.s),(e=(n=f.length)-(r=l.length))>0)for(;e--;l[r++]=0);for(e=Ea-1;n>u;){if(l[--n]<f[n]){for(r=n;r&&!l[--r];l[r]=e);--l[r],l[n]+=Ea}l[n]-=f[n]}for(;0==l[0];l.splice(0,1),--s);return l[0]?P(t,l,s):(t.s=3==d?-1:1,t.c=[t.e=0],t)},p.modulo=p.mod=function(t,e){var n,o,a=this;return t=new C(t,e),!a.c||!t.s||t.c&&!t.c[0]?new C(NaN):!t.c||a.c&&!a.c[0]?new C(a):(9==m?(o=t.s,t.s=1,n=r(a,t,0,3),t.s=o,n.s*=o):n=r(a,t,0,m),(t=a.minus(n.times(t))).c[0]||1!=m||(t.s=a.s),t)},p.multipliedBy=p.times=function(t,e){var r,n,o,a,i,u,c,s,l,f,p,h,v,d,y,b=this,g=b.c,w=(t=new C(t,e)).c;if(!(g&&w&&g[0]&&w[0]))return!b.s||!t.s||g&&!g[0]&&!w||w&&!w[0]&&!g?t.c=t.e=t.s=null:(t.s*=b.s,g&&w?(t.c=[0],t.e=0):t.c=t.e=null),t;for(n=za(b.e/Pa)+za(t.e/Pa),t.s*=b.s,(c=g.length)<(f=w.length)&&(v=g,g=w,w=v,o=c,c=f,f=o),o=c+f,v=[];o--;v.push(0));for(d=Ea,y=Ta,o=f;--o>=0;){for(r=0,p=w[o]%y,h=w[o]/y|0,a=o+(i=c);a>o;)r=((s=p*(s=g[--i]%y)+(u=h*s+(l=g[i]/y|0)*p)%y*y+v[a]+r)/d|0)+(u/y|0)+h*l,v[a--]=s%d;v[a]=r}return r?++n:v.splice(0,1),P(t,v,n)},p.negated=function(){var t=new C(this);return t.s=-t.s||null,t},p.plus=function(t,e){var r,n=this,o=n.s;if(e=(t=new C(t,e)).s,!o||!e)return new C(NaN);if(o!=e)return t.s=-e,n.minus(t);var a=n.e/Pa,i=t.e/Pa,u=n.c,c=t.c;if(!a||!i){if(!u||!c)return new C(o/0);if(!u[0]||!c[0])return c[0]?t:new C(u[0]?n:0*o)}if(a=za(a),i=za(i),u=u.slice(),o=a-i){for(o>0?(i=a,r=c):(o=-o,r=u),r.reverse();o--;r.push(0));r.reverse()}for((o=u.length)-(e=c.length)<0&&(r=c,c=u,u=r,e=o),o=0;e;)o=(u[--e]=u[e]+c[e]+o)/Ea|0,u[e]=Ea===u[e]?0:u[e]%Ea;return o&&(u=[o].concat(u),++i),P(t,u,i)},p.precision=p.sd=function(t,e){var r,n,o,a=this;if(null!=t&&t!==!!t)return Ia(t,1,ka),null==e?e=d:Ia(e,0,8),x(new C(a),t,e);if(!(r=a.c))return null;if(n=(o=r.length-1)*Pa+1,o=r[o]){for(;o%10==0;o/=10,n--);for(o=r[0];o>=10;o/=10,n++);}return t&&a.e+1>n&&(n=a.e+1),n},p.shiftedBy=function(t){return Ia(t,-9007199254740991,xa),this.times("1e"+t)},p.squareRoot=p.sqrt=function(){var t,e,n,o,a,i=this,u=i.c,c=i.s,s=i.e,l=v+4,f=new C("0.5");if(1!==c||!u||!u[0])return new C(!c||c<0&&(!u||u[0])?NaN:u?i:1/0);if(0==(c=Math.sqrt(+R(i)))||c==1/0?(((e=Da(u)).length+s)%2==0&&(e+="0"),c=Math.sqrt(+e),s=za((s+1)/2)-(s<0||s%2),n=new C(e=c==1/0?"5e"+s:(e=c.toExponential()).slice(0,e.indexOf("e")+1)+s)):n=new C(c+""),n.c[0])for((c=(s=n.e)+l)<3&&(c=0);;)if(a=n,n=f.times(a.plus(r(i,a,l,1))),Da(a.c).slice(0,c)===(e=Da(n.c)).slice(0,c)){if(n.e<s&&--c,"9999"!=(e=e.slice(c-3,c+1))&&(o||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(x(n,n.e+v+2,1),t=!n.times(n).eq(i));break}if(!o&&(x(a,a.e+v+2,0),a.times(a).eq(i))){n=a;break}l+=4,c+=4,o=1}return x(n,n.e+v+1,d,t)},p.toExponential=function(t,e){return null!=t&&(Ia(t,0,ka),t++),N(this,t,e,1)},p.toFixed=function(t,e){return null!=t&&(Ia(t,0,ka),t=t+this.e+1),N(this,t,e)},p.toFormat=function(t,e,r){var n,o=this;if(null==r)null!=t&&e&&"object"==typeof e?(r=e,e=null):t&&"object"==typeof t?(r=t,t=e=null):r=S;else if("object"!=typeof r)throw Error(Ca+"Argument not an object: "+r);if(n=o.toFixed(t,e),o.c){var a,i=n.split("."),u=+r.groupSize,c=+r.secondaryGroupSize,s=r.groupSeparator||"",l=i[0],f=i[1],p=o.s<0,h=p?l.slice(1):l,v=h.length;if(c&&(a=u,u=c,c=a,v-=a),u>0&&v>0){for(a=v%u||u,l=h.substr(0,a);a<v;a+=u)l+=s+h.substr(a,u);c>0&&(l+=s+h.slice(a)),p&&(l="-"+l)}n=f?l+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):l}return(r.prefix||"")+n+(r.suffix||"")},p.toFraction=function(t){var e,n,o,a,i,u,c,s,l,f,p,v,y=this,b=y.c;if(null!=t&&(!(c=new C(t)).isInteger()&&(c.c||1!==c.s)||c.lt(h)))throw Error(Ca+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+R(c));if(!b)return new C(y);for(e=new C(h),l=n=new C(h),o=s=new C(h),v=Da(b),i=e.e=v.length-y.e-1,e.c[0]=Ra[(u=i%Pa)<0?Pa+u:u],t=!t||c.comparedTo(e)>0?i>0?e:l:c,u=w,w=1/0,c=new C(v),s.c[0]=0;f=r(c,e,0,1),1!=(a=n.plus(f.times(o))).comparedTo(t);)n=o,o=a,l=s.plus(f.times(a=l)),s=a,e=c.minus(f.times(a=e)),c=a;return a=r(t.minus(n),o,0,1),s=s.plus(a.times(l)),n=n.plus(a.times(o)),s.s=l.s=y.s,p=r(l,o,i*=2,d).minus(y).abs().comparedTo(r(s,n,i,d).minus(y).abs())<1?[l,o]:[s,n],w=u,p},p.toNumber=function(){return+R(this)},p.toPrecision=function(t,e){return null!=t&&Ia(t,1,ka),N(this,t,e,2)},p.toString=function(t){var e,r=this,o=r.s,a=r.e;return null===a?o?(e="Infinity",o<0&&(e="-"+e)):e="NaN":(null==t?e=a<=y||a>=b?La(Da(r.c),a):Ma(Da(r.c),a,"0"):10===t&&A?e=Ma(Da((r=x(new C(r),v+a+1,d)).c),r.e,"0"):(Ia(t,2,j.length,"Base"),e=n(Ma(Da(r.c),a,"0"),10,t,o,!0)),o<0&&r.c[0]&&(e="-"+e)),e},p.valueOf=p.toJSON=function(){return R(this)},p._isBigNumber=!0,p[Symbol.toStringTag]="BigNumber",p[Symbol.for("nodejs.util.inspect.custom")]=p.valueOf,null!=e&&C.set(e),C}(),Wa=G,$a=Ht;var Ga=function(t,e,r){(void 0!==r&&!$a(t[e],r)||void 0===r&&!(e in t))&&Wa(t,e,r)},qa={exports:{}};!function(t,e){var r=a,n=e&&!e.nodeType&&e,o=n&&t&&!t.nodeType&&t,i=o&&o.exports===n?r.Buffer:void 0,u=i?i.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var r=t.length,n=u?u(r):new t.constructor(r);return t.copy(n),n}}(qa,qa.exports);var Va=qa.exports,Ha=fr;var Ja=function(t){var e=new t.constructor(t.byteLength);return new Ha(e).set(new Ha(t)),e};var Xa=function(t,e){var r=e?Ja(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)};var Ya=function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e},Za=g,Ka=Object.create,Qa=function(){function t(){}return function(e){if(!Za(e))return{};if(Ka)return Ka(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),ti=Zo,ei=xt;var ri=function(t){return"function"!=typeof t.constructor||ei(t)?{}:Qa(ti(t))},ni=Ut,oi=H;var ai=function(t){return oi(t)&&ni(t)},ii=b,ui=Zo,ci=H,si=Function.prototype,li=Object.prototype,fi=si.toString,pi=li.hasOwnProperty,hi=fi.call(Object);var vi=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]},di=Fo,yi=G;var bi=function(t,e,r,n){var o=!r;r||(r={});for(var a=-1,i=e.length;++a<i;){var u=e[a],c=n?n(r[u],t[u],u,r,t):void 0;void 0===c&&(c=t[u]),o?yi(r,u,c):di(r,u,c)}return r},gi=la;var wi=Ga,_i=Va,mi=Xa,Oi=Ya,Si=ri,ji=et,Ai=rt,Ci=ai,Ni=at,Ei=O,Pi=g,xi=function(t){if(!ci(t)||"[object Object]"!=ii(t))return!1;var e=ui(t);if(null===e)return!0;var r=pi.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&fi.call(r)==hi},Ri=_t,Ti=vi,ki=function(t){return bi(t,gi(t))};var zi=rr,Di=Ga,Bi=q,Ii=function(t,e,r,n,o,a,i){var u=Ti(t,r),c=Ti(e,r),s=i.get(c);if(s)wi(t,r,s);else{var l=a?a(u,c,r+"",t,e,i):void 0,f=void 0===l;if(f){var p=Ai(c),h=!p&&Ni(c),v=!p&&!h&&Ri(c);l=c,p||h||v?Ai(u)?l=u:Ci(u)?l=Oi(u):h?(f=!1,l=_i(c,!0)):v?(f=!1,l=mi(c,!0)):l=[]:xi(c)||ji(c)?(l=u,ji(u)?l=ki(u):Pi(u)&&!Ei(u)||(l=Si(c))):f=!1}f&&(i.set(c,l),o(l,c,n,a,i),i.delete(c)),wi(t,r,l)}},Ui=g,Li=la,Mi=vi;var Fi=function t(e,r,n,o,a){e!==r&&Bi(r,(function(i,u){if(a||(a=new zi),Ui(i))Ii(e,r,u,n,t,o,a);else{var c=o?o(Mi(e,u),i,u+"",e,r,a):void 0;void 0===c&&(c=i),Di(e,u,c)}}),Li)};var Wi=function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)},$i=Math.max;var Gi=function(t,e,r){return e=$i(void 0===e?t.length-1:e,0),function(){for(var n=arguments,o=-1,a=$i(n.length-e,0),i=Array(a);++o<a;)i[o]=n[e+o];o=-1;for(var u=Array(e+1);++o<e;)u[o]=n[o];return u[e]=r(i),Wi(t,this,u)}};var qi=function(t){return function(){return t}},Vi=W,Hi=Vi?function(t,e){return Vi(t,"toString",{configurable:!0,enumerable:!1,value:qi(e),writable:!0})}:Oo,Ji=Date.now;var Xi=function(t){var e=0,r=0;return function(){var n=Ji(),o=16-(n-r);if(r=n,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Hi),Yi=Oo,Zi=Gi,Ki=Xi;var Qi=Ht,tu=Ut,eu=ut,ru=g;var nu=function(t,e){return Ki(Zi(t,e,Yi),t+"")},ou=function(t,e,r){if(!ru(r))return!1;var n=typeof e;return!!("number"==n?tu(r)&&eu(e,r.length):"string"==n&&e in r)&&Qi(r[e],t)};var au=Fi,iu=e(function(t){return nu((function(e,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,i=o>2?r[2]:void 0;for(a=t.length>3&&"function"==typeof a?(o--,a):void 0,i&&ou(r[0],r[1],i)&&(a=o<3?void 0:a,o=1),e=Object(e);++n<o;){var u=r[n];u&&t(e,u,n,a)}return e}))}((function(t,e,r){au(t,e,r)})));const uu={betCount:0,callCount:0,checkCount:0,foldCount:0,raiseCount:0,bets:{}},cu=(t,e,r)=>{const n=t.playerStats[e];return void 0===n?t.playerStats:{...t.playerStats,[e]:iu(n,r(n))}},su=({state:t,action:e})=>{const{type:r}=e;switch(r){case"award-pot":return(({state:t,action:e})=>({...t,playerStats:cu(t,e.playerName,(({totalAwarded:t,totalWon:r})=>({totalAwarded:t.plus(e.amount),totalWon:r.plus(e.amount)})))}))({state:t,action:e});case"bet":return(({state:t,action:e})=>({...t,handStats:{...t.handStats,totalPot:t.handStats.totalPot.plus(e.amount)},playerStats:cu(t,e.playerName,(({streets:r,totalActionCount:n,totalContributed:o,totalWon:a})=>({totalActionCount:n+1,totalContributed:o.plus(e.amount),totalWon:a.minus(e.amount),vpip:!0,streets:{[t.currentStreet]:{...uu,...r[t.currentStreet],betCount:(r[t.currentStreet]?.betCount??0)+1}}})))}))({state:t,action:e});case"call":return(({state:t,action:e})=>({...t,handStats:{...t.handStats,totalPot:t.handStats.totalPot.plus(e.amount)},playerStats:cu(t,e.playerName,(({streets:r,totalActionCount:n,totalContributed:o,totalWon:a})=>({totalActionCount:n+1,totalContributed:o.plus(e.amount),totalWon:a.minus(e.amount),vpip:!0,streets:{[t.currentStreet]:{...uu,...r[t.currentStreet],callCount:(r[t.currentStreet]?.callCount??0)+1}}})))}))({state:t,action:e});case"check":return(({state:t,action:e})=>({...t,playerStats:cu(t,e.playerName,(({streets:e,totalActionCount:r})=>({totalActionCount:r+1,streets:{[t.currentStreet]:{...uu,...e[t.currentStreet],checkCount:(e[t.currentStreet]?.checkCount??0)+1}}})))}))({state:t,action:e});case"deal-board":return(({state:t,action:e})=>({...t,currentStreet:e.street,currentStreetRaiseCount:0}))({state:t,action:e});case"fold":return(({state:t,action:e})=>({...t,playerStats:cu(t,e.playerName,(({streets:e,totalActionCount:r})=>({totalActionCount:r+1,streets:{[t.currentStreet]:{...uu,...e[t.currentStreet],foldCount:(e[t.currentStreet]?.foldCount??0)+1}}})))}))({state:t,action:e});case"post":return(({state:t,action:e})=>({...t,handStats:{...t.handStats,totalPot:t.handStats.totalPot.plus(e.amount)},playerStats:cu(t,e.playerName,(({totalContributed:t,totalWon:r})=>({totalContributed:t.plus(e.amount),totalWon:r.minus(e.amount)})))}))({state:t,action:e});case"raise":return(({state:t,action:e})=>({...t,currentStreetRaiseCount:t.currentStreetRaiseCount+1,handStats:{...t.handStats,totalPot:t.handStats.totalPot.plus(e.amount)},playerStats:cu(t,e.playerName,(({streets:r,totalActionCount:n,totalContributed:o,totalWon:a})=>({totalActionCount:n+1,totalContributed:o.plus(e.amount),totalWon:a.minus(e.amount),vpip:!0,streets:{[t.currentStreet]:{...uu,...r[t.currentStreet],raiseCount:(r[t.currentStreet]?.raiseCount??0)+1,bets:{...r[t.currentStreet]?.bets,[t.currentStreetRaiseCount+1]:1}}}})))}))({state:t,action:e});case"return-bet":return(({state:t,action:e})=>({...t,handStats:{...t.handStats,totalPot:t.handStats.totalPot.minus(e.amount)},playerStats:cu(t,e.playerName,(({totalContributed:t,totalWon:r})=>({totalContributed:t.minus(e.amount),totalWon:r.plus(e.amount)})))}))({state:t,action:e});case"showdown":return(({state:t,action:e})=>({...t,playerStats:cu(t,e.playerName,(()=>({wentToShowdown:!0})))}))({state:t,action:e});case"deal-hand":return t;default:return Oa(r)}},lu=t=>{const e=(t=>t.handStats.totalPot.minus(Object.values(t.playerStats).reduce(((t,e)=>t.plus(e.totalAwarded)),new Fa(0))))(t),r=(t=>Object.values(t.playerStats).reduce(((t,e)=>t.plus(e.totalAwarded)),new Fa(0)))(t);return{...t,handStats:{...t.handStats,totalRake:e},playerStats:Io(t.playerStats,(t=>({...t,totalRakeContributed:e.times(t.totalAwarded.div(r))})))}};exports.InvalidDataError=wa,exports.analyzeHand=({actions:t,players:e})=>{if(1!==e.filter((t=>t.isHero)).length)throw new wa("Hand histories should only involve one hero.");let r=((t=[])=>({currentStreet:"preflop",currentStreetRaiseCount:1,handStats:{totalPot:new Fa(0),totalRake:new Fa(0)},playerStats:Object.fromEntries(t.map((t=>[t.name,{streets:{},aggressiveActionCount:0,totalActionCount:0,totalAwarded:new Fa(0),totalContributed:new Fa(0),totalRakeContributed:new Fa(0),totalWon:new Fa(0),vpip:!1,wentToShowdown:!1}])))}))(e);t.forEach((t=>{r=su({state:r,action:t})})),r=lu(r);const n={...r.handStats,totalPot:r.handStats.totalPot.toString(),totalRake:r.handStats.totalRake.toString()},o=Io(r.playerStats,(t=>({...t,totalAwarded:t.totalAwarded.toString(),totalContributed:t.totalContributed.toString(),totalRakeContributed:t.totalRakeContributed.toString(),totalWon:t.totalWon.toString()}))),a=new Set(e.filter((t=>!t.isAnonymous)).map((t=>t.name)));return{hand:n,players:ga(o,((t,e)=>a.has(e)))}};
//# sourceMappingURL=index.js.map
{
"name": "@poker-apprentice/hand-history-analyzer",
"version": "1.0.1",
"version": "1.0.2",
"description": "Extract helpful statistics about a poker player's tendencies from a hand history",

@@ -51,3 +51,3 @@ "main": "dist/cjs/index.js",

"@babel/preset-typescript": "^7.22.11",
"@poker-apprentice/hand-history-parser": "^1.1.4",
"@poker-apprentice/hand-history-parser": "^1.2.0",
"@rollup/plugin-babel": "^6.0.3",

@@ -54,0 +54,0 @@ "@rollup/plugin-commonjs": "^25.0.4",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc