@argent/x-shared 1.79.1 → 1.79.3
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/.ts-temp/tsconfig.tsbuildinfo +1 -1
- package/dist/node_modules/.pnpm/bignumber.js@10.0.2/node_modules/bignumber.js/dist/bignumber.cjs +1 -0
- package/dist/node_modules/.pnpm/bignumber.js@10.0.2/node_modules/bignumber.js/dist/bignumber.js +528 -0
- package/dist/src/chains/starknet/getAddressFromStarkName.cjs +1 -1
- package/dist/src/chains/starknet/getAddressFromStarkName.js +1 -1
- package/dist/src/features/paymaster/PaymasterService.cjs +1 -1
- package/dist/src/features/paymaster/PaymasterService.js +1 -1
- package/dist/src/utils/number/prettifyNumber.cjs +1 -1
- package/dist/src/utils/number/prettifyNumber.js +1 -1
- package/dist/src/utils/retryUntilInitialised.cjs +1 -1
- package/dist/src/utils/retryUntilInitialised.js +1 -1
- package/package.json +9 -8
- package/dist/.eslintrc.d.cts +0 -39
- package/dist/node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.cjs +0 -1
- package/dist/node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.js +0 -527
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@argent/x-shared",
|
|
3
|
-
"version": "1.79.
|
|
3
|
+
"version": "1.79.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/argentlabs/x-shared.git"
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"scripts": {
|
|
46
46
|
"build": "vite build",
|
|
47
47
|
"dev": "NODE_ENV=development vite build --mode development --watch",
|
|
48
|
-
"lint": "eslint .
|
|
49
|
-
"lint:fix": "pnpm lint --fix",
|
|
48
|
+
"lint": "eslint .",
|
|
49
|
+
"lint:fix": "pnpm lint -- --fix",
|
|
50
50
|
"test": "vitest run",
|
|
51
51
|
"test:watch": "vitest",
|
|
52
52
|
"prepare": "husky",
|
|
@@ -58,19 +58,19 @@
|
|
|
58
58
|
"@amplitude/analytics-types": "2.11.1",
|
|
59
59
|
"@commitlint/cli": "20.5.0",
|
|
60
60
|
"@commitlint/config-conventional": "20.5.0",
|
|
61
|
+
"@eslint/js": "^10.0.1",
|
|
61
62
|
"@rollup/plugin-typescript": "12.3.0",
|
|
62
63
|
"@semantic-release/git": "10.0.1",
|
|
63
64
|
"@types/async-retry": "1.4.9",
|
|
64
65
|
"@types/lodash-es": "4.17.12",
|
|
65
66
|
"@types/numeral": "2.0.5",
|
|
66
67
|
"@types/ua-parser-js": "0.7.39",
|
|
67
|
-
"@typescript-eslint/eslint-plugin": "8.57.1",
|
|
68
|
-
"@typescript-eslint/parser": "8.57.1",
|
|
69
68
|
"esbuild": "0.27.4",
|
|
70
69
|
"esbuild-register": "3.6.0",
|
|
71
|
-
"eslint": "
|
|
70
|
+
"eslint": "10.1.0",
|
|
72
71
|
"eslint-config-prettier": "10.1.8",
|
|
73
72
|
"eslint-plugin-import": "2.32.0",
|
|
73
|
+
"globals": "^17.4.0",
|
|
74
74
|
"husky": "9.1.7",
|
|
75
75
|
"lint-staged": "16.4.0",
|
|
76
76
|
"msw": "2.12.14",
|
|
@@ -80,6 +80,7 @@
|
|
|
80
80
|
"ts-to-zod": "5.1.0",
|
|
81
81
|
"tsx": "4.21.0",
|
|
82
82
|
"typescript": "5.9.3",
|
|
83
|
+
"typescript-eslint": "^8.57.1",
|
|
83
84
|
"vite": "8.0.1",
|
|
84
85
|
"vite-plugin-dts": "4.5.4",
|
|
85
86
|
"vitest": "4.1.0"
|
|
@@ -92,7 +93,7 @@
|
|
|
92
93
|
"@noble/hashes": "^2.0.0",
|
|
93
94
|
"@starknet-io/types-js": "0.10.1",
|
|
94
95
|
"@types/fs-extra": "^11.0.4",
|
|
95
|
-
"big-decimal-number": "npm:bignumber.js@^
|
|
96
|
+
"big-decimal-number": "npm:bignumber.js@^10.0.0",
|
|
96
97
|
"dotenv": "^17.0.0",
|
|
97
98
|
"fs-extra": "^11.3.0",
|
|
98
99
|
"i18next": "^25.0.0",
|
|
@@ -115,6 +116,6 @@
|
|
|
115
116
|
},
|
|
116
117
|
"lint-staged": {
|
|
117
118
|
"*": "prettier --ignore-unknown --write",
|
|
118
|
-
"*.{ts,tsx}": "eslint --
|
|
119
|
+
"*.{ts,tsx}": "eslint --fix"
|
|
119
120
|
}
|
|
120
121
|
}
|
package/dist/.eslintrc.d.cts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
export declare namespace env {
|
|
2
|
-
let browser: boolean;
|
|
3
|
-
let es2021: boolean;
|
|
4
|
-
let node: boolean;
|
|
5
|
-
}
|
|
6
|
-
declare let _extends: string[];
|
|
7
|
-
export { _extends as extends };
|
|
8
|
-
export declare let parser: string;
|
|
9
|
-
export declare namespace parserOptions {
|
|
10
|
-
let project: string;
|
|
11
|
-
}
|
|
12
|
-
export declare let plugins: string[];
|
|
13
|
-
export declare let rules: {
|
|
14
|
-
"import/no-relative-parent-imports": string;
|
|
15
|
-
"import/order": (string | {
|
|
16
|
-
alphabetize: {
|
|
17
|
-
caseInsensitive: boolean;
|
|
18
|
-
order: string;
|
|
19
|
-
};
|
|
20
|
-
groups: string[];
|
|
21
|
-
"newlines-between": string;
|
|
22
|
-
pathGroups: {
|
|
23
|
-
group: string;
|
|
24
|
-
pattern: string;
|
|
25
|
-
position: string;
|
|
26
|
-
}[];
|
|
27
|
-
distinctGroup: boolean;
|
|
28
|
-
})[];
|
|
29
|
-
"no-extra-semi": string;
|
|
30
|
-
"@typescript-eslint/no-misused-promises": string;
|
|
31
|
-
"@typescript-eslint/no-unused-vars": (string | {
|
|
32
|
-
vars: string;
|
|
33
|
-
ignoreRestSiblings: boolean;
|
|
34
|
-
argsIgnorePattern: string;
|
|
35
|
-
})[];
|
|
36
|
-
"@typescript-eslint/consistent-type-exports": string;
|
|
37
|
-
"@typescript-eslint/consistent-type-imports": string;
|
|
38
|
-
};
|
|
39
|
-
export declare let ignorePatterns: string[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,t=Math.ceil,n=Math.floor,r=`[BigNumber Error] `,i=r+`Number primitive has more than 15 significant digits: `,a=0x5af3107a4000,o=14,s=9007199254740991,c=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,0xe8d4a51000,0x9184e72a000],l=1e7,u=1e9;function d(y){var b,x,S,C=L.prototype={constructor:L,toString:null,valueOf:null},w=new L(1),T=20,E=4,D=-7,O=21,k=-1e7,A=1e7,j=!1,M=1,N=0,P={prefix:``,groupSize:3,secondaryGroupSize:0,groupSeparator:`,`,decimalSeparator:`.`,fractionGroupSize:0,fractionGroupSeparator:`\xA0`,suffix:``},F=`0123456789abcdefghijklmnopqrstuvwxyz`,I=!0;function L(t,r){var a,c,l,u,d,f,p,m,g=this;if(!(g instanceof L))return new L(t,r);if(r==null){if(t&&t._isBigNumber===!0){g.s=t.s,!t.c||t.e>A?g.c=g.e=null:t.e<k?g.c=[g.e=0]:(g.e=t.e,g.c=t.c.slice());return}if((f=typeof t==`number`)&&t*0==0){if(g.s=1/t<0?(t=-t,-1):1,t===~~t){for(u=0,d=t;d>=10;d/=10,u++);u>A?g.c=g.e=null:(g.e=u,g.c=[t]);return}m=String(t)}else{if(!e.test(m=String(t)))return S(g,m,f);g.s=m.charCodeAt(0)==45?(m=m.slice(1),-1):1}(u=m.indexOf(`.`))>-1&&(m=m.replace(`.`,``)),(d=m.search(/e/i))>0?(u<0&&(u=d),u+=+m.slice(d+1),m=m.substring(0,d)):u<0&&(u=m.length)}else{if(h(r,2,F.length,`Base`),r==10&&I)return g=new L(t),V(g,T+g.e+1,E);if(m=String(t),f=typeof t==`number`){if(t*0!=0)return S(g,m,f,r);if(g.s=1/t<0?(m=m.slice(1),-1):1,L.DEBUG&&m.replace(/^0\.0*|\./,``).length>15)throw Error(i+t)}else g.s=m.charCodeAt(0)===45?(m=m.slice(1),-1):1;for(a=F.slice(0,r),u=d=0,p=m.length;d<p;d++)if(a.indexOf(c=m.charAt(d))<0){if(c==`.`){if(d>u){u=p;continue}}else if(!l&&(m==m.toUpperCase()&&(m=m.toLowerCase())||m==m.toLowerCase()&&(m=m.toUpperCase()))){l=!0,d=-1,u=0;continue}return S(g,String(t),f,r)}f=!1,m=x(m,r,10,g.s),(u=m.indexOf(`.`))>-1?m=m.replace(`.`,``):u=m.length}for(d=0;m.charCodeAt(d)===48;d++);for(p=m.length;m.charCodeAt(--p)===48;);if(m=m.slice(d,++p)){if(p-=d,f&&L.DEBUG&&p>15&&(t>s||t!==n(t)))throw Error(i+g.s*t);if((u=u-d-1)>A)g.c=g.e=null;else if(u<k)g.c=[g.e=0];else{if(g.e=u,g.c=[],d=(u+1)%o,u<0&&(d+=o),d<p){for(d&&g.c.push(+m.slice(0,d)),p-=o;d<p;)g.c.push(+m.slice(d,d+=o));d=o-(m=m.slice(d)).length}else d-=p;for(;d--;m+=`0`);g.c.push(+m)}}else g.c=[g.e=0]}L.clone=d,L.ROUND_UP=0,L.ROUND_DOWN=1,L.ROUND_CEIL=2,L.ROUND_FLOOR=3,L.ROUND_HALF_UP=4,L.ROUND_HALF_DOWN=5,L.ROUND_HALF_EVEN=6,L.ROUND_HALF_CEIL=7,L.ROUND_HALF_FLOOR=8,L.EUCLID=9,L.config=L.set=function(e){var t,n;if(e!=null)if(typeof e==`object`){if(e.hasOwnProperty(t=`DECIMAL_PLACES`)&&(n=e[t],h(n,0,u,t),T=n),e.hasOwnProperty(t=`ROUNDING_MODE`)&&(n=e[t],h(n,0,8,t),E=n),e.hasOwnProperty(t=`EXPONENTIAL_AT`)&&(n=e[t],n&&n.pop?(h(n[0],-u,0,t),h(n[1],0,u,t),D=n[0],O=n[1]):(h(n,-u,u,t),D=-(O=n<0?-n:n))),e.hasOwnProperty(t=`RANGE`))if(n=e[t],n&&n.pop)h(n[0],-u,-1,t),h(n[1],1,u,t),k=n[0],A=n[1];else if(h(n,-u,u,t),n)k=-(A=n<0?-n:n);else throw Error(r+t+` cannot be zero: `+n);if(e.hasOwnProperty(t=`CRYPTO`))if(n=e[t],n===!!n)if(n)if(typeof crypto<`u`&&crypto&&(crypto.getRandomValues||crypto.randomBytes))j=n;else throw j=!n,Error(r+`crypto unavailable`);else j=n;else throw Error(r+t+` not true or false: `+n);if(e.hasOwnProperty(t=`MODULO_MODE`)&&(n=e[t],h(n,0,9,t),M=n),e.hasOwnProperty(t=`POW_PRECISION`)&&(n=e[t],h(n,0,u,t),N=n),e.hasOwnProperty(t=`FORMAT`))if(n=e[t],typeof n==`object`)P=n;else throw Error(r+t+` not an object: `+n);if(e.hasOwnProperty(t=`ALPHABET`))if(n=e[t],typeof n==`string`&&!/^.?$|[+\-.\s]|(.).*\1/.test(n))I=n.slice(0,10)==`0123456789`,F=n;else throw Error(r+t+` invalid: `+n)}else throw Error(r+`Object expected: `+e);return{DECIMAL_PLACES:T,ROUNDING_MODE:E,EXPONENTIAL_AT:[D,O],RANGE:[k,A],CRYPTO:j,MODULO_MODE:M,POW_PRECISION:N,FORMAT:P,ALPHABET:F}},L.isBigNumber=function(e){if(!e||e._isBigNumber!==!0)return!1;if(!L.DEBUG)return!0;var t,i,s=e.c,c=e.e,l=e.s;out:if({}.toString.call(s)==`[object Array]`){if((l===1||l===-1)&&c>=-u&&c<=u&&c===n(c)){if(s[0]===0){if(c===0&&s.length===1)return!0;break out}if(t=(c+1)%o,t<1&&(t+=o),String(s[0]).length==t){for(t=0;t<s.length;t++)if(i=s[t],i<0||i>=a||i!==n(i))break out;if(i!==0)return!0}}}else if(s===null&&c===null&&(l===null||l===1||l===-1))return!0;throw Error(r+`Invalid BigNumber: `+e)},L.maximum=L.max=function(){return z(arguments,-1)},L.minimum=L.min=function(){return z(arguments,1)},L.random=(function(){var e=9007199254740992,i=Math.random()*e&2097151?function(){return n(Math.random()*e)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(e){var a,s,l,d,f,p=0,m=[],g=new L(w);if(e==null?e=T:h(e,0,u),d=t(e/o),j)if(crypto.getRandomValues){for(a=crypto.getRandomValues(new Uint32Array(d*=2));p<d;)f=a[p]*131072+(a[p+1]>>>11),f>=9e15?(s=crypto.getRandomValues(new Uint32Array(2)),a[p]=s[0],a[p+1]=s[1]):(m.push(f%0x5af3107a4000),p+=2);p=d/2}else if(crypto.randomBytes){for(a=crypto.randomBytes(d*=7);p<d;)f=(a[p]&31)*281474976710656+a[p+1]*1099511627776+a[p+2]*4294967296+a[p+3]*16777216+(a[p+4]<<16)+(a[p+5]<<8)+a[p+6],f>=9e15?crypto.randomBytes(7).copy(a,p):(m.push(f%0x5af3107a4000),p+=7);p=d/7}else throw j=!1,Error(r+`crypto unavailable`);if(!j)for(;p<d;)f=i(),f<9e15&&(m[p++]=f%0x5af3107a4000);for(d=m[--p],e%=o,d&&e&&(f=c[o-e],m[p]=n(d/f)*f);m[p]===0;m.pop(),p--);if(p<0)m=[l=0];else{for(l=-1;m[0]===0;m.splice(0,1),l-=o);for(p=1,f=m[0];f>=10;f/=10,p++);p<o&&(l-=o-p)}return g.e=l,g.c=m,g}})(),L.sum=function(){for(var e=1,t=arguments,n=new L(t[0]);e<t.length;)n=n.plus(t[e++]);return n},x=(function(){var e=`0123456789`;function t(e,t,n,r){for(var i,a=[0],o,s=0,c=e.length;s<c;){for(o=a.length;o--;a[o]*=t);for(a[0]+=r.indexOf(e.charAt(s++)),i=0;i<a.length;i++)a[i]>n-1&&(a[i+1]??(a[i+1]=0),a[i+1]+=a[i]/n|0,a[i]%=n)}return a.reverse()}return function(n,r,i,a,o){var s,c,l,u,d,f,m,h,g=n.indexOf(`.`),_=T,y=E;for(g>=0&&(u=N,N=0,n=n.replace(`.`,``),h=new L(r),f=h.pow(n.length-g),N=u,h.c=t(v(p(f.c),f.e,`0`),10,i,e),h.e=h.c.length),m=t(n,r,i,o?(s=F,e):(s=e,F)),l=u=m.length;m[--u]==0;m.pop());if(!m[0])return s.charAt(0);if(g<0?--l:(f.c=m,f.e=l,f.s=a,f=b(f,h,_,y,i),m=f.c,d=f.r,l=f.e),c=l+_+1,g=m[c],u=i/2,d=d||c<0||m[c+1]!=null,d=y<4?(g!=null||d)&&(y==0||y==(f.s<0?3:2)):g>u||g==u&&(y==4||d||y==6&&m[c-1]&1||y==(f.s<0?8:7)),c<1||!m[0])n=d?v(s.charAt(1),-_,s.charAt(0)):s.charAt(0);else{if(m.length=c,d)for(--i;++m[--c]>i;)m[c]=0,c||(++l,m=[1].concat(m));for(u=m.length;!m[--u];);for(g=0,n=``;g<=u;n+=s.charAt(m[g++]));n=v(n,l,s.charAt(0))}return n}})(),b=(function(){function e(e,t,n){var r,i,a,o,s=0,c=e.length,u=t%l,d=t/l|0;for(e=e.slice();c--;)a=e[c]%l,o=e[c]/l|0,r=d*a+o*u,i=u*a+r%l*l+s,s=(i/n|0)+(r/l|0)+d*o,e[c]=i%n;return s&&(e=[s].concat(e)),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function r(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(i,s,c,l,u){var d,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k=i.s==s.s?1:-1,A=i.c,j=s.c;if(!A||!A[0]||!j||!j[0])return new L(!i.s||!s.s||(A?j&&A[0]==j[0]:!j)?NaN:A&&A[0]==0||!j?k*0:k/0);for(y=new L(k),b=y.c=[],p=i.e-s.e,k=c+p+1,u||(u=a,p=f(i.e/o)-f(s.e/o),k=k/o|0),m=0;j[m]==(A[m]||0);m++);if(j[m]>(A[m]||0)&&p--,k<0)b.push(1),h=!0;else{for(T=A.length,D=j.length,m=0,k+=2,g=n(u/(j[0]+1)),g>1&&(j=e(j,g,u),A=e(A,g,u),D=j.length,T=A.length),w=D,x=A.slice(0,D),S=x.length;S<D;x[S++]=0);O=j.slice(),O=[0].concat(O),E=j[0],j[1]>=u/2&&E++;do{if(g=0,d=t(j,x,D,S),d<0){if(C=x[0],D!=S&&(C=C*u+(x[1]||0)),g=n(C/E),g>1)for(g>=u&&(g=u-1),_=e(j,g,u),v=_.length,S=x.length;t(_,x,v,S)==1;)g--,r(_,D<v?O:j,v,u),v=_.length,d=1;else g==0&&(d=g=1),_=j.slice(),v=_.length;if(v<S&&(_=[0].concat(_)),r(x,_,S,u),S=x.length,d==-1)for(;t(j,x,D,S)<1;)g++,r(x,D<S?O:j,S,u),S=x.length}else d===0&&(g++,x=[0]);b[m++]=g,x[0]?x[S++]=A[w]||0:(x=[A[w]],S=1)}while((w++<T||x[0]!=null)&&k--);h=x[0]!=null,b[0]||b.splice(0,1)}if(u==a){for(m=1,k=b[0];k>=10;k/=10,m++);V(y,c+(y.e=m+p*o-1)+1,l,h)}else y.e=p,y.r=+h;return y}})();function R(e,t,n,r){var i,a,o,s,c;if(n==null?n=E:h(n,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,t==null)c=p(e.c),c=r==1||r==2&&(o<=D||o>=O)?_(c,o):v(c,o,`0`);else if(e=V(new L(e),t,n),a=e.e,c=p(e.c),s=c.length,r==1||r==2&&(t<=a||a<=D)){for(;s<t;c+=`0`,s++);c=_(c,a)}else if(t-=o,c=v(c,a,`0`),a+1>s){if(--t>0)for(c+=`.`;t--;c+=`0`);}else if(t+=a-s,t>0)for(a+1==s&&(c+=`.`);t--;c+=`0`);return e.s<0&&i?`-`+c:c}function z(e,t){for(var n,r,i=1,a=new L(e[0]);i<e.length;i++)r=new L(e[i]),(!r.s||(n=m(a,r))===t||n===0&&a.s===t)&&(a=r);return a}function B(e,t,n){for(var r=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,r++);return(n=r+n*o-1)>A?e.c=e.e=null:n<k?e.c=[e.e=0]:(e.e=n,e.c=t),e}S=(function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,t=/^([^.]+)\.$/,n=/^\.([^.]+)$/,i=/^-?(Infinity|NaN)$/,a=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(o,s,c,l){var u,d=c?s:s.replace(a,``);if(i.test(d))o.s=isNaN(d)?null:d<0?-1:1;else{if(!c&&(d=d.replace(e,function(e,t,n){return u=(n=n.toLowerCase())==`x`?16:n==`b`?2:8,!l||l==u?t:e}),l&&(u=l,d=d.replace(t,`$1`).replace(n,`0.$1`)),s!=d))return new L(d,u);if(L.DEBUG)throw Error(r+`Not a`+(l?` base `+l:``)+` number: `+s);o.s=null}o.c=o.e=null}})();function V(e,r,i,s){var l,u,d,f,p,m,h,g=e.c,_=c;if(g){out:{for(l=1,f=g[0];f>=10;f/=10,l++);if(u=r-l,u<0)u+=o,d=r,p=g[m=0],h=n(p/_[l-d-1]%10);else if(m=t((u+1)/o),m>=g.length)if(s){for(;g.length<=m;g.push(0));p=h=0,l=1,u%=o,d=u-o+1}else break out;else{for(p=f=g[m],l=1;f>=10;f/=10,l++);u%=o,d=u-o+l,h=d<0?0:n(p/_[l-d-1]%10)}if(s=s||r<0||g[m+1]!=null||(d<0?p:p%_[l-d-1]),s=i<4?(h||s)&&(i==0||i==(e.s<0?3:2)):h>5||h==5&&(i==4||s||i==6&&(u>0?d>0?p/_[l-d]:0:g[m-1])%10&1||i==(e.s<0?8:7)),r<1||!g[0])return g.length=0,s?(r-=e.e+1,g[0]=_[(o-r%o)%o],e.e=-r||0):g[0]=e.e=0,e;if(u==0?(g.length=m,f=1,m--):(g.length=m+1,f=_[o-u],g[m]=d>0?n(p/_[l-d]%_[d])*f:0),s)for(;;)if(m==0){for(u=1,d=g[0];d>=10;d/=10,u++);for(d=g[0]+=f,f=1;d>=10;d/=10,f++);u!=f&&(e.e++,g[0]==a&&(g[0]=1));break}else{if(g[m]+=f,g[m]!=a)break;g[m--]=0,f=1}for(u=g.length;g[--u]===0;g.pop());}e.e>A?e.c=e.e=null:e.e<k&&(e.c=[e.e=0])}return e}function H(e){var t,n=e.e;return n===null?e.toString():(t=p(e.c),t=n<=D||n>=O?_(t,n):v(t,n,`0`),e.s<0?`-`+t:t)}return C.absoluteValue=C.abs=function(){var e=new L(this);return e.s<0&&(e.s=1),e},C.comparedTo=function(e,t){return m(this,new L(e,t))},C.decimalPlaces=C.dp=function(e,t){var n,r,i,a=this;if(e!=null)return h(e,0,u),t==null?t=E:h(t,0,8),V(new L(a),e+a.e+1,t);if(!(n=a.c))return null;if(r=((i=n.length-1)-f(this.e/o))*o,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},C.dividedBy=C.div=function(e,t){return b(this,new L(e,t),T,E)},C.dividedToIntegerBy=C.idiv=function(e,t){return b(this,new L(e,t),0,1)},C.exponentiatedBy=C.pow=function(e,i){var a,s,c,l,u,d,f,p,m,h=this;if(e=new L(e),e.c&&!e.isInteger())throw Error(r+`Exponent not an integer: `+H(e));if(i!=null&&(i=new L(i)),d=e.e>14,!h.c||!h.c[0]||h.c[0]==1&&!h.e&&h.c.length==1||!e.c||!e.c[0])return m=new L(H(h)**(d?e.s*(2-g(e)):+H(e))),i?m.mod(i):m;if(f=e.s<0,i){if(i.c?!i.c[0]:!i.s)return new L(NaN);s=!f&&h.isInteger()&&i.isInteger(),s&&(h=h.mod(i))}else if(e.e>9&&(h.e>0||h.e<-1||(h.e==0?h.c[0]>1||d&&h.c[1]>=24e7:h.c[0]<8e13||d&&h.c[0]<=9999975e7)))return l=h.s<0&&g(e)?-0:0,h.e>-1&&(l=1/l),new L(f?1/l:l);else N&&(l=t(N/o+2));for(d?(a=new L(.5),f&&(e.s=1),p=g(e)):(c=Math.abs(+H(e)),p=c%2),m=new L(w);;){if(p){if(m=m.times(h),!m.c)break;l?m.c.length>l&&(m.c.length=l):s&&(m=m.mod(i))}if(c){if(c=n(c/2),c===0)break;p=c%2}else if(e=e.times(a),V(e,e.e+1,1),e.e>14)p=g(e);else{if(c=+H(e),c===0)break;p=c%2}h=h.times(h),l?h.c&&h.c.length>l&&(h.c.length=l):s&&(h=h.mod(i))}return s?m:(f&&(m=w.div(m)),i?m.mod(i):l?V(m,N,E,u):m)},C.integerValue=function(e){var t=new L(this);return e==null?e=E:h(e,0,8),V(t,t.e+1,e)},C.isEqualTo=C.eq=function(e,t){return m(this,new L(e,t))===0},C.isFinite=function(){return!!this.c},C.isGreaterThan=C.gt=function(e,t){return m(this,new L(e,t))>0},C.isGreaterThanOrEqualTo=C.gte=function(e,t){return(t=m(this,new L(e,t)))===1||t===0},C.isInteger=function(){return!!this.c&&f(this.e/o)>this.c.length-2},C.isLessThan=C.lt=function(e,t){return m(this,new L(e,t))<0},C.isLessThanOrEqualTo=C.lte=function(e,t){return(t=m(this,new L(e,t)))===-1||t===0},C.isNaN=function(){return!this.s},C.isNegative=function(){return this.s<0},C.isPositive=function(){return this.s>0},C.isZero=function(){return!!this.c&&this.c[0]==0},C.minus=function(e,t){var n,r,i,s,c=this,l=c.s;if(e=new L(e,t),t=e.s,!l||!t)return new L(NaN);if(l!=t)return e.s=-t,c.plus(e);var u=c.e/o,d=e.e/o,p=c.c,m=e.c;if(!u||!d){if(!p||!m)return p?(e.s=-t,e):new L(m?c:NaN);if(!p[0]||!m[0])return m[0]?(e.s=-t,e):new L(p[0]?c:E==3?-0:0)}if(u=f(u),d=f(d),p=p.slice(),l=u-d){for((s=l<0)?(l=-l,i=p):(d=u,i=m),i.reverse(),t=l;t--;i.push(0));i.reverse()}else for(r=(s=(l=p.length)<(t=m.length))?l:t,l=t=0;t<r;t++)if(p[t]!=m[t]){s=p[t]<m[t];break}if(s&&(i=p,p=m,m=i,e.s=-e.s),t=(r=m.length)-(n=p.length),t>0)for(;t--;p[n++]=0);for(t=a-1;r>l;){if(p[--r]<m[r]){for(n=r;n&&!p[--n];p[n]=t);--p[n],p[r]+=a}p[r]-=m[r]}for(;p[0]==0;p.splice(0,1),--d);return p[0]?B(e,p,d):(e.s=E==3?-1:1,e.c=[e.e=0],e)},C.modulo=C.mod=function(e,t){var n,r,i=this;return e=new L(e,t),!i.c||!e.s||e.c&&!e.c[0]?new L(NaN):!e.c||i.c&&!i.c[0]?new L(i):(M==9?(r=e.s,e.s=1,n=b(i,e,0,3),e.s=r,n.s*=r):n=b(i,e,0,M),e=i.minus(n.times(e)),!e.c[0]&&M==1&&(e.s=i.s),e)},C.multipliedBy=C.times=function(e,t){var n,r,i,s,c,u,d,p,m,h,g,_,v,y,b,x=this,S=x.c,C=(e=new L(e,t)).c;if(!S||!C||!S[0]||!C[0])return!x.s||!e.s||S&&!S[0]&&!C||C&&!C[0]&&!S?e.c=e.e=e.s=null:(e.s*=x.s,!S||!C?e.c=e.e=null:(e.c=[0],e.e=0)),e;for(r=f(x.e/o)+f(e.e/o),e.s*=x.s,d=S.length,h=C.length,d<h&&(v=S,S=C,C=v,i=d,d=h,h=i),i=d+h,v=[];i--;v.push(0));for(y=a,b=l,i=h;--i>=0;){for(n=0,g=C[i]%b,_=C[i]/b|0,c=d,s=i+c;s>i;)p=S[--c]%b,m=S[c]/b|0,u=_*p+m*g,p=g*p+u%b*b+v[s]+n,n=(p/y|0)+(u/b|0)+_*m,v[s--]=p%y;v[s]=n}return n?++r:v.splice(0,1),B(e,v,r)},C.negated=function(){var e=new L(this);return e.s=-e.s||null,e},C.plus=function(e,t){var n,r=this,i=r.s;if(e=new L(e,t),t=e.s,!i||!t)return new L(NaN);if(i!=t)return e.s=-t,r.minus(e);var s=r.e/o,c=e.e/o,l=r.c,u=e.c;if(!s||!c){if(!l||!u)return new L(i/0);if(!l[0]||!u[0])return u[0]?e:new L(l[0]?r:i*0)}if(s=f(s),c=f(c),l=l.slice(),i=s-c){for(i>0?(c=s,n=u):(i=-i,n=l),n.reverse();i--;n.push(0));n.reverse()}for(i=l.length,t=u.length,i-t<0&&(n=u,u=l,l=n,t=i),i=0;t;)i=(l[--t]=l[t]+u[t]+i)/a|0,l[t]=a===l[t]?0:l[t]%a;return i&&(l=[i].concat(l),++c),B(e,l,c)},C.precision=C.sd=function(e,t){var n,r,i,a=this;if(e!=null&&e!==!!e)return h(e,1,u),t==null?t=E:h(t,0,8),V(new L(a),e,t);if(!(n=a.c))return null;if(i=n.length-1,r=i*o+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return e&&a.e+1>r&&(r=a.e+1),r},C.shiftedBy=function(e){return h(e,-s,s),this.times(`1e`+e)},C.squareRoot=C.sqrt=function(){var e,t,n,r,i,a=this,o=a.c,s=a.s,c=a.e,l=T+4,u=new L(`0.5`);if(s!==1||!o||!o[0])return new L(!s||s<0&&(!o||o[0])?NaN:o?a:1/0);if(s=Math.sqrt(+H(a)),s==0||s==1/0?(t=p(o),(t.length+c)%2==0&&(t+=`0`),s=Math.sqrt(+t),c=f((c+1)/2)-(c<0||c%2),s==1/0?t=`5e`+c:(t=s.toExponential(),t=t.slice(0,t.indexOf(`e`)+1)+c),n=new L(t)):n=new L(s+``),n.c[0]){for(c=n.e,s=c+l,s<3&&(s=0);;)if(i=n,n=u.times(i.plus(b(a,i,l,1))),p(i.c).slice(0,s)===(t=p(n.c)).slice(0,s))if(n.e<c&&--s,t=t.slice(s-3,s+1),t==`9999`||!r&&t==`4999`){if(!r&&(V(i,i.e+T+2,0),i.times(i).eq(a))){n=i;break}l+=4,s+=4,r=1}else{(!+t||!+t.slice(1)&&t.charAt(0)==`5`)&&(V(n,n.e+T+2,1),e=!n.times(n).eq(a));break}}return V(n,n.e+T+1,E,e)},C.toExponential=function(e,t){return e!=null&&(h(e,0,u),e++),R(this,e,t,1)},C.toFixed=function(e,t){return e!=null&&(h(e,0,u),e=e+this.e+1),R(this,e,t)},C.toFormat=function(e,t,n){var i,a=this;if(n==null)e!=null&&t&&typeof t==`object`?(n=t,t=null):e&&typeof e==`object`?(n=e,e=t=null):n=P;else if(typeof n!=`object`)throw Error(r+`Argument not an object: `+n);if(i=a.toFixed(e,t),a.c){var o,s=i.split(`.`),c=+n.groupSize,l=+n.secondaryGroupSize,u=n.groupSeparator||``,d=s[0],f=s[1],p=a.s<0,m=p?d.slice(1):d,h=m.length;if(l&&(o=c,c=l,l=o,h-=o),c>0&&h>0){for(o=h%c||c,d=m.substr(0,o);o<h;o+=c)d+=u+m.substr(o,c);l>0&&(d+=u+m.slice(o)),p&&(d=`-`+d)}i=f?d+(n.decimalSeparator||``)+((l=+n.fractionGroupSize)?f.replace(RegExp(`\\d{`+l+`}\\B`,`g`),`$&`+(n.fractionGroupSeparator||``)):f):d}return(n.prefix||``)+i+(n.suffix||``)},C.toFraction=function(e){var t,n,i,a,s,l,u,d,f,m,h,g,_=this,v=_.c;if(e!=null&&(u=new L(e),!u.isInteger()&&(u.c||u.s!==1)||u.lt(w)))throw Error(r+`Argument `+(u.isInteger()?`out of range: `:`not an integer: `)+H(u));if(!v)return new L(_);for(t=new L(w),f=n=new L(w),i=d=new L(w),g=p(v),s=t.e=g.length-_.e-1,t.c[0]=c[(l=s%o)<0?o+l:l],e=!e||u.comparedTo(t)>0?s>0?t:f:u,l=A,A=1/0,u=new L(g),d.c[0]=0;m=b(u,t,0,1),a=n.plus(m.times(i)),a.comparedTo(e)!=1;)n=i,i=a,f=d.plus(m.times(a=f)),d=a,t=u.minus(m.times(a=t)),u=a;return a=b(e.minus(n),i,0,1),d=d.plus(a.times(f)),n=n.plus(a.times(i)),d.s=f.s=_.s,s*=2,h=b(f,i,s,E).minus(_).abs().comparedTo(b(d,n,s,E).minus(_).abs())<1?[f,i]:[d,n],A=l,h},C.toNumber=function(){return+H(this)},C.toPrecision=function(e,t){return e!=null&&h(e,1,u),R(this,e,t,2)},C.toString=function(e){var t,n=this,r=n.s,i=n.e;return i===null?r?(t=`Infinity`,r<0&&(t=`-`+t)):t=`NaN`:(e==null?t=i<=D||i>=O?_(p(n.c),i):v(p(n.c),i,`0`):e===10&&I?(n=V(new L(n),T+i+1,E),t=v(p(n.c),n.e,`0`)):(h(e,2,F.length,`Base`),t=x(v(p(n.c),i,`0`),10,e,r,!0)),r<0&&n.c[0]&&(t=`-`+t)),t},C.valueOf=C.toJSON=function(){return H(this)},C._isBigNumber=!0,C[Symbol.toStringTag]=`BigNumber`,C[Symbol.for(`nodejs.util.inspect.custom`)]=C.valueOf,y!=null&&L.set(y),L}function f(e){var t=e|0;return e>0||e===t?t:t-1}function p(e){for(var t,n,r=1,i=e.length,a=e[0]+``;r<i;){for(t=e[r++]+``,n=o-t.length;n--;t=`0`+t);a+=t}for(i=a.length;a.charCodeAt(--i)===48;);return a.slice(0,i+1||1)}function m(e,t){var n,r,i=e.c,a=t.c,o=e.s,s=t.s,c=e.e,l=t.e;if(!o||!s)return null;if(n=i&&!i[0],r=a&&!a[0],n||r)return n?r?0:-s:o;if(o!=s)return o;if(n=o<0,r=c==l,!i||!a)return r?0:!i^n?1:-1;if(!r)return c>l^n?1:-1;for(s=(c=i.length)<(l=a.length)?c:l,o=0;o<s;o++)if(i[o]!=a[o])return i[o]>a[o]^n?1:-1;return c==l?0:c>l^n?1:-1}function h(e,t,i,a){if(e<t||e>i||e!==n(e))throw Error(r+(a||`Argument`)+(typeof e==`number`?e<t||e>i?` out of range: `:` not an integer: `:` not a primitive number: `)+String(e))}function g(e){var t=e.c.length-1;return f(e.e/o)==t&&e.c[t]%2!=0}function _(e,t){return(e.length>1?e.charAt(0)+`.`+e.slice(1):e)+(t<0?`e`:`e+`)+t}function v(e,t,n){var r,i;if(t<0){for(i=n+`.`;++t;i+=n);e=i+e}else if(r=e.length,++t>r){for(i=n,t-=r;--t;i+=n);e+=i}else t<r&&(e=e.slice(0,t)+`.`+e.slice(t));return e}var y=d();exports.default=y;
|