@argent/x-shared 1.75.4 → 1.75.6
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/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/_md.cjs +1 -0
- package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/_md.js +85 -0
- package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/_u64.cjs +1 -0
- package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/_u64.js +22 -0
- package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/sha2.cjs +1 -0
- package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/sha2.js +124 -0
- package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/sha3.cjs +1 -0
- package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/sha3.js +118 -0
- package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/utils.cjs +1 -0
- package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/utils.js +92 -0
- package/dist/node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.cjs +1 -1
- package/dist/node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.js +7 -7
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isMasked.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isMasked.js +2 -2
- package/dist/node_modules/.pnpm/numeral@2.0.6/node_modules/numeral/numeral.cjs +1 -1
- package/dist/node_modules/.pnpm/numeral@2.0.6/node_modules/numeral/numeral.js +10 -10
- package/dist/node_modules/.pnpm/semver@6.3.1/node_modules/semver/semver.cjs +1 -1
- package/dist/node_modules/.pnpm/semver@6.3.1/node_modules/semver/semver.js +2 -2
- package/dist/src/accountNameGenerator/index.cjs +1 -1
- package/dist/src/accountNameGenerator/index.js +1 -1
- package/dist/src/utils/id.cjs +1 -1
- package/dist/src/utils/id.js +2 -2
- package/package.json +13 -13
- package/dist/node_modules/.pnpm/@noble_hashes@1.5.0/node_modules/@noble/hashes/esm/_assert.cjs +0 -1
- package/dist/node_modules/.pnpm/@noble_hashes@1.5.0/node_modules/@noble/hashes/esm/_assert.js +0 -32
- package/dist/node_modules/.pnpm/@noble_hashes@1.5.0/node_modules/@noble/hashes/esm/_md.cjs +0 -1
- package/dist/node_modules/.pnpm/@noble_hashes@1.5.0/node_modules/@noble/hashes/esm/_md.js +0 -64
- package/dist/node_modules/.pnpm/@noble_hashes@1.5.0/node_modules/@noble/hashes/esm/_u64.cjs +0 -1
- package/dist/node_modules/.pnpm/@noble_hashes@1.5.0/node_modules/@noble/hashes/esm/_u64.js +0 -21
- package/dist/node_modules/.pnpm/@noble_hashes@1.5.0/node_modules/@noble/hashes/esm/sha256.cjs +0 -1
- package/dist/node_modules/.pnpm/@noble_hashes@1.5.0/node_modules/@noble/hashes/esm/sha256.js +0 -115
- package/dist/node_modules/.pnpm/@noble_hashes@1.5.0/node_modules/@noble/hashes/esm/sha3.cjs +0 -1
- package/dist/node_modules/.pnpm/@noble_hashes@1.5.0/node_modules/@noble/hashes/esm/sha3.js +0 -107
- package/dist/node_modules/.pnpm/@noble_hashes@1.5.0/node_modules/@noble/hashes/esm/utils.cjs +0 -1
- package/dist/node_modules/.pnpm/@noble_hashes@1.5.0/node_modules/@noble/hashes/esm/utils.js +0 -46
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./utils.cjs");function b(u,t,s){return u&t^~u&s}function p(u,t,s){return u&t^u&s^t&s}class d{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(t,s,n,i){this.blockLen=t,this.outputLen=s,this.padOffset=n,this.isLE=i,this.buffer=new Uint8Array(t),this.view=f.createView(this.buffer)}update(t){f.aexists(this),f.abytes(t);const{view:s,buffer:n,blockLen:i}=this,r=t.length;for(let e=0;e<r;){const o=Math.min(i-this.pos,r-e);if(o===i){const c=f.createView(t);for(;i<=r-e;e+=i)this.process(c,e);continue}n.set(t.subarray(e,e+o),this.pos),this.pos+=o,e+=o,this.pos===i&&(this.process(s,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){f.aexists(this),f.aoutput(t,this),this.finished=!0;const{buffer:s,view:n,blockLen:i,isLE:r}=this;let{pos:e}=this;s[e++]=128,f.clean(this.buffer.subarray(e)),this.padOffset>i-e&&(this.process(n,0),e=0);for(let h=e;h<i;h++)s[h]=0;n.setBigUint64(i-8,BigInt(this.length*8),r),this.process(n,0);const o=f.createView(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const a=c/4,l=this.get();if(a>l.length)throw new Error("_sha2: outputLen bigger than state");for(let h=0;h<a;h++)o.setUint32(4*h,l[h],r)}digest(){const{buffer:t,outputLen:s}=this;this.digestInto(t);const n=t.slice(0,s);return this.destroy(),n}_cloneInto(t){t||=new this.constructor,t.set(...this.get());const{blockLen:s,buffer:n,length:i,finished:r,destroyed:e,pos:o}=this;return t.destroyed=e,t.finished=r,t.length=i,t.pos=o,i%s&&t.buffer.set(n),t}clone(){return this._cloneInto()}}const g=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);exports.Chi=b;exports.HashMD=d;exports.Maj=p;exports.SHA256_IV=g;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { createView as c, aexists as a, abytes as b, aoutput as d, clean as g } from "./utils.js";
|
|
2
|
+
function w(f, t, e) {
|
|
3
|
+
return f & t ^ ~f & e;
|
|
4
|
+
}
|
|
5
|
+
function x(f, t, e) {
|
|
6
|
+
return f & t ^ f & e ^ t & e;
|
|
7
|
+
}
|
|
8
|
+
class y {
|
|
9
|
+
blockLen;
|
|
10
|
+
outputLen;
|
|
11
|
+
padOffset;
|
|
12
|
+
isLE;
|
|
13
|
+
// For partial updates less than block size
|
|
14
|
+
buffer;
|
|
15
|
+
view;
|
|
16
|
+
finished = !1;
|
|
17
|
+
length = 0;
|
|
18
|
+
pos = 0;
|
|
19
|
+
destroyed = !1;
|
|
20
|
+
constructor(t, e, n, i) {
|
|
21
|
+
this.blockLen = t, this.outputLen = e, this.padOffset = n, this.isLE = i, this.buffer = new Uint8Array(t), this.view = c(this.buffer);
|
|
22
|
+
}
|
|
23
|
+
update(t) {
|
|
24
|
+
a(this), b(t);
|
|
25
|
+
const { view: e, buffer: n, blockLen: i } = this, o = t.length;
|
|
26
|
+
for (let s = 0; s < o; ) {
|
|
27
|
+
const r = Math.min(i - this.pos, o - s);
|
|
28
|
+
if (r === i) {
|
|
29
|
+
const u = c(t);
|
|
30
|
+
for (; i <= o - s; s += i)
|
|
31
|
+
this.process(u, s);
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
n.set(t.subarray(s, s + r), this.pos), this.pos += r, s += r, this.pos === i && (this.process(e, 0), this.pos = 0);
|
|
35
|
+
}
|
|
36
|
+
return this.length += t.length, this.roundClean(), this;
|
|
37
|
+
}
|
|
38
|
+
digestInto(t) {
|
|
39
|
+
a(this), d(t, this), this.finished = !0;
|
|
40
|
+
const { buffer: e, view: n, blockLen: i, isLE: o } = this;
|
|
41
|
+
let { pos: s } = this;
|
|
42
|
+
e[s++] = 128, g(this.buffer.subarray(s)), this.padOffset > i - s && (this.process(n, 0), s = 0);
|
|
43
|
+
for (let h = s; h < i; h++)
|
|
44
|
+
e[h] = 0;
|
|
45
|
+
n.setBigUint64(i - 8, BigInt(this.length * 8), o), this.process(n, 0);
|
|
46
|
+
const r = c(t), u = this.outputLen;
|
|
47
|
+
if (u % 4)
|
|
48
|
+
throw new Error("_sha2: outputLen must be aligned to 32bit");
|
|
49
|
+
const l = u / 4, p = this.get();
|
|
50
|
+
if (l > p.length)
|
|
51
|
+
throw new Error("_sha2: outputLen bigger than state");
|
|
52
|
+
for (let h = 0; h < l; h++)
|
|
53
|
+
r.setUint32(4 * h, p[h], o);
|
|
54
|
+
}
|
|
55
|
+
digest() {
|
|
56
|
+
const { buffer: t, outputLen: e } = this;
|
|
57
|
+
this.digestInto(t);
|
|
58
|
+
const n = t.slice(0, e);
|
|
59
|
+
return this.destroy(), n;
|
|
60
|
+
}
|
|
61
|
+
_cloneInto(t) {
|
|
62
|
+
t ||= new this.constructor(), t.set(...this.get());
|
|
63
|
+
const { blockLen: e, buffer: n, length: i, finished: o, destroyed: s, pos: r } = this;
|
|
64
|
+
return t.destroyed = s, t.finished = o, t.length = i, t.pos = r, i % e && t.buffer.set(n), t;
|
|
65
|
+
}
|
|
66
|
+
clone() {
|
|
67
|
+
return this._cloneInto();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
const I = /* @__PURE__ */ Uint32Array.from([
|
|
71
|
+
1779033703,
|
|
72
|
+
3144134277,
|
|
73
|
+
1013904242,
|
|
74
|
+
2773480762,
|
|
75
|
+
1359893119,
|
|
76
|
+
2600822924,
|
|
77
|
+
528734635,
|
|
78
|
+
1541459225
|
|
79
|
+
]);
|
|
80
|
+
export {
|
|
81
|
+
w as Chi,
|
|
82
|
+
y as HashMD,
|
|
83
|
+
x as Maj,
|
|
84
|
+
I as SHA256_IV
|
|
85
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=BigInt(2**32-1),c=BigInt(32);function u(t,o=!1){return o?{h:Number(t&l),l:Number(t>>c&l)}:{h:Number(t>>c&l)|0,l:Number(t&l)|0}}function B(t,o=!1){const r=t.length;let n=new Uint32Array(r),i=new Uint32Array(r);for(let e=0;e<r;e++){const{h:f,l:s}=u(t[e],o);[n[e],i[e]]=[f,s]}return[n,i]}const g=(t,o,r)=>t<<r|o>>>32-r,m=(t,o,r)=>o<<r|t>>>32-r,S=(t,o,r)=>o<<r-32|t>>>64-r,a=(t,o,r)=>t<<r-32|o>>>64-r;exports.fromBig=u;exports.rotlBH=S;exports.rotlBL=a;exports.rotlSH=g;exports.rotlSL=m;exports.split=B;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const o = /* @__PURE__ */ BigInt(4294967295), i = /* @__PURE__ */ BigInt(32);
|
|
2
|
+
function s(t, r = !1) {
|
|
3
|
+
return r ? { h: Number(t & o), l: Number(t >> i & o) } : { h: Number(t >> i & o) | 0, l: Number(t & o) | 0 };
|
|
4
|
+
}
|
|
5
|
+
function h(t, r = !1) {
|
|
6
|
+
const n = t.length;
|
|
7
|
+
let l = new Uint32Array(n), c = new Uint32Array(n);
|
|
8
|
+
for (let e = 0; e < n; e++) {
|
|
9
|
+
const { h: u, l: f } = s(t[e], r);
|
|
10
|
+
[l[e], c[e]] = [u, f];
|
|
11
|
+
}
|
|
12
|
+
return [l, c];
|
|
13
|
+
}
|
|
14
|
+
const m = (t, r, n) => t << n | r >>> 32 - n, A = (t, r, n) => r << n | t >>> 32 - n, B = (t, r, n) => r << n - 32 | t >>> 64 - n, a = (t, r, n) => t << n - 32 | r >>> 64 - n;
|
|
15
|
+
export {
|
|
16
|
+
s as fromBig,
|
|
17
|
+
B as rotlBH,
|
|
18
|
+
a as rotlBL,
|
|
19
|
+
m as rotlSH,
|
|
20
|
+
A as rotlSL,
|
|
21
|
+
h as split
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./_md.cjs"),c=require("./utils.cjs"),I=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),b=new Uint32Array(64);class V extends e.HashMD{constructor(f){super(64,f,8,!1)}get(){const{A:f,B:n,C:x,D:a,E:r,F:o,G:s,H:i}=this;return[f,n,x,a,r,o,s,i]}set(f,n,x,a,r,o,s,i){this.A=f|0,this.B=n|0,this.C=x|0,this.D=a|0,this.E=r|0,this.F=o|0,this.G=s|0,this.H=i|0}process(f,n){for(let t=0;t<16;t++,n+=4)b[t]=f.getUint32(n,!1);for(let t=16;t<64;t++){const H=b[t-15],h=b[t-2],S=c.rotr(H,7)^c.rotr(H,18)^H>>>3,l=c.rotr(h,17)^c.rotr(h,19)^h>>>10;b[t]=l+b[t-7]+S+b[t-16]|0}let{A:x,B:a,C:r,D:o,E:s,F:i,G:d,H:A}=this;for(let t=0;t<64;t++){const H=c.rotr(s,6)^c.rotr(s,11)^c.rotr(s,25),h=A+H+e.Chi(s,i,d)+I[t]+b[t]|0,l=(c.rotr(x,2)^c.rotr(x,13)^c.rotr(x,22))+e.Maj(x,a,r)|0;A=d,d=i,i=s,s=o+h|0,o=r,r=a,a=x,x=h+l|0}x=x+this.A|0,a=a+this.B|0,r=r+this.C|0,o=o+this.D|0,s=s+this.E|0,i=i+this.F|0,d=d+this.G|0,A=A+this.H|0,this.set(x,a,r,o,s,i,d,A)}roundClean(){c.clean(b)}destroy(){this.set(0,0,0,0,0,0,0,0),c.clean(this.buffer)}}class _ extends V{A=e.SHA256_IV[0]|0;B=e.SHA256_IV[1]|0;C=e.SHA256_IV[2]|0;D=e.SHA256_IV[3]|0;E=e.SHA256_IV[4]|0;F=e.SHA256_IV[5]|0;G=e.SHA256_IV[6]|0;H=e.SHA256_IV[7]|0;constructor(){super(32)}}const g=c.createHasher(()=>new _,c.oidNist(1));exports._SHA256=_;exports.sha256=g;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { SHA256_IV as i, HashMD as p, Chi as B, Maj as D } from "./_md.js";
|
|
2
|
+
import { createHasher as g, oidNist as E, clean as u, rotr as f } from "./utils.js";
|
|
3
|
+
const F = /* @__PURE__ */ Uint32Array.from([
|
|
4
|
+
1116352408,
|
|
5
|
+
1899447441,
|
|
6
|
+
3049323471,
|
|
7
|
+
3921009573,
|
|
8
|
+
961987163,
|
|
9
|
+
1508970993,
|
|
10
|
+
2453635748,
|
|
11
|
+
2870763221,
|
|
12
|
+
3624381080,
|
|
13
|
+
310598401,
|
|
14
|
+
607225278,
|
|
15
|
+
1426881987,
|
|
16
|
+
1925078388,
|
|
17
|
+
2162078206,
|
|
18
|
+
2614888103,
|
|
19
|
+
3248222580,
|
|
20
|
+
3835390401,
|
|
21
|
+
4022224774,
|
|
22
|
+
264347078,
|
|
23
|
+
604807628,
|
|
24
|
+
770255983,
|
|
25
|
+
1249150122,
|
|
26
|
+
1555081692,
|
|
27
|
+
1996064986,
|
|
28
|
+
2554220882,
|
|
29
|
+
2821834349,
|
|
30
|
+
2952996808,
|
|
31
|
+
3210313671,
|
|
32
|
+
3336571891,
|
|
33
|
+
3584528711,
|
|
34
|
+
113926993,
|
|
35
|
+
338241895,
|
|
36
|
+
666307205,
|
|
37
|
+
773529912,
|
|
38
|
+
1294757372,
|
|
39
|
+
1396182291,
|
|
40
|
+
1695183700,
|
|
41
|
+
1986661051,
|
|
42
|
+
2177026350,
|
|
43
|
+
2456956037,
|
|
44
|
+
2730485921,
|
|
45
|
+
2820302411,
|
|
46
|
+
3259730800,
|
|
47
|
+
3345764771,
|
|
48
|
+
3516065817,
|
|
49
|
+
3600352804,
|
|
50
|
+
4094571909,
|
|
51
|
+
275423344,
|
|
52
|
+
430227734,
|
|
53
|
+
506948616,
|
|
54
|
+
659060556,
|
|
55
|
+
883997877,
|
|
56
|
+
958139571,
|
|
57
|
+
1322822218,
|
|
58
|
+
1537002063,
|
|
59
|
+
1747873779,
|
|
60
|
+
1955562222,
|
|
61
|
+
2024104815,
|
|
62
|
+
2227730452,
|
|
63
|
+
2361852424,
|
|
64
|
+
2428436474,
|
|
65
|
+
2756734187,
|
|
66
|
+
3204031479,
|
|
67
|
+
3329325298
|
|
68
|
+
]), o = /* @__PURE__ */ new Uint32Array(64);
|
|
69
|
+
class G extends p {
|
|
70
|
+
constructor(r) {
|
|
71
|
+
super(64, r, 8, !1);
|
|
72
|
+
}
|
|
73
|
+
get() {
|
|
74
|
+
const { A: r, B: h, C: c, D: t, E: e, F: b, G: s, H: a } = this;
|
|
75
|
+
return [r, h, c, t, e, b, s, a];
|
|
76
|
+
}
|
|
77
|
+
// prettier-ignore
|
|
78
|
+
set(r, h, c, t, e, b, s, a) {
|
|
79
|
+
this.A = r | 0, this.B = h | 0, this.C = c | 0, this.D = t | 0, this.E = e | 0, this.F = b | 0, this.G = s | 0, this.H = a | 0;
|
|
80
|
+
}
|
|
81
|
+
process(r, h) {
|
|
82
|
+
for (let x = 0; x < 16; x++, h += 4)
|
|
83
|
+
o[x] = r.getUint32(h, !1);
|
|
84
|
+
for (let x = 16; x < 64; x++) {
|
|
85
|
+
const H = o[x - 15], d = o[x - 2], m = f(H, 7) ^ f(H, 18) ^ H >>> 3, l = f(d, 17) ^ f(d, 19) ^ d >>> 10;
|
|
86
|
+
o[x] = l + o[x - 7] + m + o[x - 16] | 0;
|
|
87
|
+
}
|
|
88
|
+
let { A: c, B: t, C: e, D: b, E: s, F: a, G: n, H: A } = this;
|
|
89
|
+
for (let x = 0; x < 64; x++) {
|
|
90
|
+
const H = f(s, 6) ^ f(s, 11) ^ f(s, 25), d = A + H + B(s, a, n) + F[x] + o[x] | 0, l = (f(c, 2) ^ f(c, 13) ^ f(c, 22)) + D(c, t, e) | 0;
|
|
91
|
+
A = n, n = a, a = s, s = b + d | 0, b = e, e = t, t = c, c = d + l | 0;
|
|
92
|
+
}
|
|
93
|
+
c = c + this.A | 0, t = t + this.B | 0, e = e + this.C | 0, b = b + this.D | 0, s = s + this.E | 0, a = a + this.F | 0, n = n + this.G | 0, A = A + this.H | 0, this.set(c, t, e, b, s, a, n, A);
|
|
94
|
+
}
|
|
95
|
+
roundClean() {
|
|
96
|
+
u(o);
|
|
97
|
+
}
|
|
98
|
+
destroy() {
|
|
99
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0), u(this.buffer);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
class S extends G {
|
|
103
|
+
// We cannot use array here since array allows indexing by variable
|
|
104
|
+
// which means optimizer/compiler cannot use registers.
|
|
105
|
+
A = i[0] | 0;
|
|
106
|
+
B = i[1] | 0;
|
|
107
|
+
C = i[2] | 0;
|
|
108
|
+
D = i[3] | 0;
|
|
109
|
+
E = i[4] | 0;
|
|
110
|
+
F = i[5] | 0;
|
|
111
|
+
G = i[6] | 0;
|
|
112
|
+
H = i[7] | 0;
|
|
113
|
+
constructor() {
|
|
114
|
+
super(32);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
const U = /* @__PURE__ */ g(
|
|
118
|
+
() => new S(),
|
|
119
|
+
/* @__PURE__ */ E(1)
|
|
120
|
+
);
|
|
121
|
+
export {
|
|
122
|
+
S as _SHA256,
|
|
123
|
+
U as sha256
|
|
124
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./_u64.cjs"),h=require("./utils.cjs"),B=BigInt(0),u=BigInt(1),A=BigInt(2),H=BigInt(7),S=BigInt(256),T=BigInt(113),O=[],y=[],w=[];for(let n=0,t=u,s=1,i=0;n<24;n++){[s,i]=[i,(2*s+3*i)%5],O.push(2*(5*i+s)),y.push((n+1)*(n+2)/2%64);let o=B;for(let r=0;r<7;r++)t=(t<<u^(t>>H)*T)%S,t&A&&(o^=u<<(u<<BigInt(r))-u);w.push(o)}const _=f.split(w,!0),F=_[0],X=_[1],I=(n,t,s)=>s>32?f.rotlBH(n,t,s):f.rotlSH(n,t,s),x=(n,t,s)=>s>32?f.rotlBL(n,t,s):f.rotlSL(n,t,s);function b(n,t=24){const s=new Uint32Array(10);for(let i=24-t;i<24;i++){for(let e=0;e<10;e++)s[e]=n[e]^n[e+10]^n[e+20]^n[e+30]^n[e+40];for(let e=0;e<10;e+=2){const c=(e+8)%10,l=(e+2)%10,p=s[l],a=s[l+1],g=I(p,a,1)^s[c],L=x(p,a,1)^s[c+1];for(let d=0;d<50;d+=10)n[e+d]^=g,n[e+d+1]^=L}let o=n[2],r=n[3];for(let e=0;e<24;e++){const c=y[e],l=I(o,r,c),p=x(o,r,c),a=O[e];o=n[a],r=n[a+1],n[a]=l,n[a+1]=p}for(let e=0;e<50;e+=10){for(let c=0;c<10;c++)s[c]=n[e+c];for(let c=0;c<10;c++)n[e+c]^=~s[(c+2)%10]&s[(c+4)%10]}n[0]^=F[i],n[1]^=X[i]}h.clean(s)}class k{state;pos=0;posOut=0;finished=!1;state32;destroyed=!1;blockLen;suffix;outputLen;enableXOF=!1;rounds;constructor(t,s,i,o=!1,r=24){if(this.blockLen=t,this.suffix=s,this.outputLen=i,this.enableXOF=o,this.rounds=r,h.anumber(i,"outputLen"),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=h.u32(this.state)}clone(){return this._cloneInto()}keccak(){h.swap32IfBE(this.state32),b(this.state32,this.rounds),h.swap32IfBE(this.state32),this.posOut=0,this.pos=0}update(t){h.aexists(this),h.abytes(t);const{blockLen:s,state:i}=this,o=t.length;for(let r=0;r<o;){const e=Math.min(s-this.pos,o-r);for(let c=0;c<e;c++)i[this.pos++]^=t[r++];this.pos===s&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:s,pos:i,blockLen:o}=this;t[i]^=s,(s&128)!==0&&i===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){h.aexists(this,!1),h.abytes(t),this.finish();const s=this.state,{blockLen:i}=this;for(let o=0,r=t.length;o<r;){this.posOut>=i&&this.keccak();const e=Math.min(i-this.posOut,r-o);t.set(s.subarray(this.posOut,this.posOut+e),o),this.posOut+=e,o+=e}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return h.anumber(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(h.aoutput(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,h.clean(this.state)}_cloneInto(t){const{blockLen:s,suffix:i,outputLen:o,rounds:r,enableXOF:e}=this;return t||=new k(s,i,o,e,r),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=r,t.suffix=i,t.outputLen=o,t.enableXOF=e,t.destroyed=this.destroyed,t}}const m=(n,t,s,i={})=>h.createHasher(()=>new k(t,n,s),i),E=m(1,136,32);exports.Keccak=k;exports.keccakP=b;exports.keccak_256=E;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { split as H, rotlSH as T, rotlSL as S, rotlBH as m, rotlBL as F } from "./_u64.js";
|
|
2
|
+
import { createHasher as X, anumber as d, u32 as E, swap32IfBE as k, aexists as I, abytes as x, aoutput as U, clean as y } from "./utils.js";
|
|
3
|
+
const P = BigInt(0), f = BigInt(1), M = BigInt(2), R = BigInt(7), j = BigInt(256), K = BigInt(113), _ = [], L = [], g = [];
|
|
4
|
+
for (let n = 0, t = f, s = 1, i = 0; n < 24; n++) {
|
|
5
|
+
[s, i] = [i, (2 * s + 3 * i) % 5], _.push(2 * (5 * i + s)), L.push((n + 1) * (n + 2) / 2 % 64);
|
|
6
|
+
let o = P;
|
|
7
|
+
for (let r = 0; r < 7; r++)
|
|
8
|
+
t = (t << f ^ (t >> R) * K) % j, t & M && (o ^= f << (f << BigInt(r)) - f);
|
|
9
|
+
g.push(o);
|
|
10
|
+
}
|
|
11
|
+
const b = H(g, !0), q = b[0], v = b[1], O = (n, t, s) => s > 32 ? m(n, t, s) : T(n, t, s), w = (n, t, s) => s > 32 ? F(n, t, s) : S(n, t, s);
|
|
12
|
+
function z(n, t = 24) {
|
|
13
|
+
const s = new Uint32Array(10);
|
|
14
|
+
for (let i = 24 - t; i < 24; i++) {
|
|
15
|
+
for (let e = 0; e < 10; e++)
|
|
16
|
+
s[e] = n[e] ^ n[e + 10] ^ n[e + 20] ^ n[e + 30] ^ n[e + 40];
|
|
17
|
+
for (let e = 0; e < 10; e += 2) {
|
|
18
|
+
const h = (e + 8) % 10, u = (e + 2) % 10, a = s[u], c = s[u + 1], A = O(a, c, 1) ^ s[h], B = w(a, c, 1) ^ s[h + 1];
|
|
19
|
+
for (let l = 0; l < 50; l += 10)
|
|
20
|
+
n[e + l] ^= A, n[e + l + 1] ^= B;
|
|
21
|
+
}
|
|
22
|
+
let o = n[2], r = n[3];
|
|
23
|
+
for (let e = 0; e < 24; e++) {
|
|
24
|
+
const h = L[e], u = O(o, r, h), a = w(o, r, h), c = _[e];
|
|
25
|
+
o = n[c], r = n[c + 1], n[c] = u, n[c + 1] = a;
|
|
26
|
+
}
|
|
27
|
+
for (let e = 0; e < 50; e += 10) {
|
|
28
|
+
for (let h = 0; h < 10; h++)
|
|
29
|
+
s[h] = n[e + h];
|
|
30
|
+
for (let h = 0; h < 10; h++)
|
|
31
|
+
n[e + h] ^= ~s[(h + 2) % 10] & s[(h + 4) % 10];
|
|
32
|
+
}
|
|
33
|
+
n[0] ^= q[i], n[1] ^= v[i];
|
|
34
|
+
}
|
|
35
|
+
y(s);
|
|
36
|
+
}
|
|
37
|
+
class p {
|
|
38
|
+
state;
|
|
39
|
+
pos = 0;
|
|
40
|
+
posOut = 0;
|
|
41
|
+
finished = !1;
|
|
42
|
+
state32;
|
|
43
|
+
destroyed = !1;
|
|
44
|
+
blockLen;
|
|
45
|
+
suffix;
|
|
46
|
+
outputLen;
|
|
47
|
+
enableXOF = !1;
|
|
48
|
+
rounds;
|
|
49
|
+
// NOTE: we accept arguments in bytes instead of bits here.
|
|
50
|
+
constructor(t, s, i, o = !1, r = 24) {
|
|
51
|
+
if (this.blockLen = t, this.suffix = s, this.outputLen = i, this.enableXOF = o, this.rounds = r, d(i, "outputLen"), !(0 < t && t < 200))
|
|
52
|
+
throw new Error("only keccak-f1600 function is supported");
|
|
53
|
+
this.state = new Uint8Array(200), this.state32 = E(this.state);
|
|
54
|
+
}
|
|
55
|
+
clone() {
|
|
56
|
+
return this._cloneInto();
|
|
57
|
+
}
|
|
58
|
+
keccak() {
|
|
59
|
+
k(this.state32), z(this.state32, this.rounds), k(this.state32), this.posOut = 0, this.pos = 0;
|
|
60
|
+
}
|
|
61
|
+
update(t) {
|
|
62
|
+
I(this), x(t);
|
|
63
|
+
const { blockLen: s, state: i } = this, o = t.length;
|
|
64
|
+
for (let r = 0; r < o; ) {
|
|
65
|
+
const e = Math.min(s - this.pos, o - r);
|
|
66
|
+
for (let h = 0; h < e; h++)
|
|
67
|
+
i[this.pos++] ^= t[r++];
|
|
68
|
+
this.pos === s && this.keccak();
|
|
69
|
+
}
|
|
70
|
+
return this;
|
|
71
|
+
}
|
|
72
|
+
finish() {
|
|
73
|
+
if (this.finished)
|
|
74
|
+
return;
|
|
75
|
+
this.finished = !0;
|
|
76
|
+
const { state: t, suffix: s, pos: i, blockLen: o } = this;
|
|
77
|
+
t[i] ^= s, (s & 128) !== 0 && i === o - 1 && this.keccak(), t[o - 1] ^= 128, this.keccak();
|
|
78
|
+
}
|
|
79
|
+
writeInto(t) {
|
|
80
|
+
I(this, !1), x(t), this.finish();
|
|
81
|
+
const s = this.state, { blockLen: i } = this;
|
|
82
|
+
for (let o = 0, r = t.length; o < r; ) {
|
|
83
|
+
this.posOut >= i && this.keccak();
|
|
84
|
+
const e = Math.min(i - this.posOut, r - o);
|
|
85
|
+
t.set(s.subarray(this.posOut, this.posOut + e), o), this.posOut += e, o += e;
|
|
86
|
+
}
|
|
87
|
+
return t;
|
|
88
|
+
}
|
|
89
|
+
xofInto(t) {
|
|
90
|
+
if (!this.enableXOF)
|
|
91
|
+
throw new Error("XOF is not possible for this instance");
|
|
92
|
+
return this.writeInto(t);
|
|
93
|
+
}
|
|
94
|
+
xof(t) {
|
|
95
|
+
return d(t), this.xofInto(new Uint8Array(t));
|
|
96
|
+
}
|
|
97
|
+
digestInto(t) {
|
|
98
|
+
if (U(t, this), this.finished)
|
|
99
|
+
throw new Error("digest() was already called");
|
|
100
|
+
return this.writeInto(t), this.destroy(), t;
|
|
101
|
+
}
|
|
102
|
+
digest() {
|
|
103
|
+
return this.digestInto(new Uint8Array(this.outputLen));
|
|
104
|
+
}
|
|
105
|
+
destroy() {
|
|
106
|
+
this.destroyed = !0, y(this.state);
|
|
107
|
+
}
|
|
108
|
+
_cloneInto(t) {
|
|
109
|
+
const { blockLen: s, suffix: i, outputLen: o, rounds: r, enableXOF: e } = this;
|
|
110
|
+
return t ||= new p(s, i, o, e, r), t.state32.set(this.state32), t.pos = this.pos, t.posOut = this.posOut, t.finished = this.finished, t.rounds = r, t.suffix = i, t.outputLen = o, t.enableXOF = e, t.destroyed = this.destroyed, t;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
const C = (n, t, s, i = {}) => X(() => new p(t, n, s), i), J = /* @__PURE__ */ C(1, 136, 32);
|
|
114
|
+
export {
|
|
115
|
+
p as Keccak,
|
|
116
|
+
z as keccakP,
|
|
117
|
+
J as keccak_256
|
|
118
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function u(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function p(e,t=""){if(!Number.isSafeInteger(e)||e<0){const n=t&&`"${t}" `;throw new Error(`${n}expected integer >0, got ${e}`)}}function i(e,t,n=""){const r=u(e),o=e?.length;if(!r||t!==void 0){const y=n&&`"${n}" `,x="",d=r?`length=${o}`:`type=${typeof e}`;throw new Error(y+"expected Uint8Array"+x+", got "+d)}return e}function b(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function g(e,t){i(e,void 0,"digestInto() output");const n=t.outputLen;if(e.length<n)throw new Error('"digestInto() output" expected to be of length >='+n)}function h(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function w(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function l(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function A(e,t){return e<<32-t|e>>>t}const s=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function c(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function a(e){for(let t=0;t<e.length;t++)e[t]=c(e[t]);return e}const L=s?e=>e:a,m=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",E=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function H(e){if(i(e),m)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=E[e[n]];return t}function U(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function S(e,t={}){const n=(o,f)=>e(f).update(o).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.create=o=>e(o),Object.assign(n,t),Object.freeze(n)}const B=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});exports.abytes=i;exports.aexists=b;exports.anumber=p;exports.aoutput=g;exports.byteSwap=c;exports.byteSwap32=a;exports.bytesToHex=H;exports.clean=w;exports.createHasher=S;exports.createView=l;exports.isBytes=u;exports.isLE=s;exports.oidNist=B;exports.rotr=A;exports.swap32IfBE=L;exports.u32=h;exports.utf8ToBytes=U;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
2
|
+
function x(e) {
|
|
3
|
+
return e instanceof Uint8Array || ArrayBuffer.isView(e) && e.constructor.name === "Uint8Array";
|
|
4
|
+
}
|
|
5
|
+
function h(e, t = "") {
|
|
6
|
+
if (!Number.isSafeInteger(e) || e < 0) {
|
|
7
|
+
const n = t && `"${t}" `;
|
|
8
|
+
throw new Error(`${n}expected integer >0, got ${e}`);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function i(e, t, n = "") {
|
|
12
|
+
const r = x(e), o = e?.length;
|
|
13
|
+
if (!r || t !== void 0) {
|
|
14
|
+
const u = n && `"${n}" `, c = "", s = r ? `length=${o}` : `type=${typeof e}`;
|
|
15
|
+
throw new Error(u + "expected Uint8Array" + c + ", got " + s);
|
|
16
|
+
}
|
|
17
|
+
return e;
|
|
18
|
+
}
|
|
19
|
+
function w(e, t = !0) {
|
|
20
|
+
if (e.destroyed)
|
|
21
|
+
throw new Error("Hash instance has been destroyed");
|
|
22
|
+
if (t && e.finished)
|
|
23
|
+
throw new Error("Hash#digest() has already been called");
|
|
24
|
+
}
|
|
25
|
+
function b(e, t) {
|
|
26
|
+
i(e, void 0, "digestInto() output");
|
|
27
|
+
const n = t.outputLen;
|
|
28
|
+
if (e.length < n)
|
|
29
|
+
throw new Error('"digestInto() output" expected to be of length >=' + n);
|
|
30
|
+
}
|
|
31
|
+
function l(e) {
|
|
32
|
+
return new Uint32Array(e.buffer, e.byteOffset, Math.floor(e.byteLength / 4));
|
|
33
|
+
}
|
|
34
|
+
function A(...e) {
|
|
35
|
+
for (let t = 0; t < e.length; t++)
|
|
36
|
+
e[t].fill(0);
|
|
37
|
+
}
|
|
38
|
+
function L(e) {
|
|
39
|
+
return new DataView(e.buffer, e.byteOffset, e.byteLength);
|
|
40
|
+
}
|
|
41
|
+
function U(e, t) {
|
|
42
|
+
return e << 32 - t | e >>> t;
|
|
43
|
+
}
|
|
44
|
+
const a = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68;
|
|
45
|
+
function y(e) {
|
|
46
|
+
return e << 24 & 4278190080 | e << 8 & 16711680 | e >>> 8 & 65280 | e >>> 24 & 255;
|
|
47
|
+
}
|
|
48
|
+
function d(e) {
|
|
49
|
+
for (let t = 0; t < e.length; t++)
|
|
50
|
+
e[t] = y(e[t]);
|
|
51
|
+
return e;
|
|
52
|
+
}
|
|
53
|
+
const m = a ? (e) => e : d, p = /* @ts-ignore */ typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", g = /* @__PURE__ */ Array.from({ length: 256 }, (e, t) => t.toString(16).padStart(2, "0"));
|
|
54
|
+
function E(e) {
|
|
55
|
+
if (i(e), p)
|
|
56
|
+
return e.toHex();
|
|
57
|
+
let t = "";
|
|
58
|
+
for (let n = 0; n < e.length; n++)
|
|
59
|
+
t += g[e[n]];
|
|
60
|
+
return t;
|
|
61
|
+
}
|
|
62
|
+
function H(e) {
|
|
63
|
+
if (typeof e != "string")
|
|
64
|
+
throw new Error("string expected");
|
|
65
|
+
return new Uint8Array(new TextEncoder().encode(e));
|
|
66
|
+
}
|
|
67
|
+
function $(e, t = {}) {
|
|
68
|
+
const n = (o, f) => e(f).update(o).digest(), r = e(void 0);
|
|
69
|
+
return n.outputLen = r.outputLen, n.blockLen = r.blockLen, n.create = (o) => e(o), Object.assign(n, t), Object.freeze(n);
|
|
70
|
+
}
|
|
71
|
+
const B = (e) => ({
|
|
72
|
+
oid: Uint8Array.from([6, 9, 96, 134, 72, 1, 101, 3, 4, 2, e])
|
|
73
|
+
});
|
|
74
|
+
export {
|
|
75
|
+
i as abytes,
|
|
76
|
+
w as aexists,
|
|
77
|
+
h as anumber,
|
|
78
|
+
b as aoutput,
|
|
79
|
+
y as byteSwap,
|
|
80
|
+
d as byteSwap32,
|
|
81
|
+
E as bytesToHex,
|
|
82
|
+
A as clean,
|
|
83
|
+
$ as createHasher,
|
|
84
|
+
L as createView,
|
|
85
|
+
x as isBytes,
|
|
86
|
+
a as isLE,
|
|
87
|
+
B as oidNist,
|
|
88
|
+
U as rotr,
|
|
89
|
+
m as swap32IfBE,
|
|
90
|
+
l as u32,
|
|
91
|
+
H as utf8ToBytes
|
|
92
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var Ee=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,ce=Math.ceil,y=Math.floor,U="[BigNumber Error] ",pe=U+"Number primitive has more than 15 significant digits: ",H=1e14,E=14,ae=9007199254740991,he=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],J=1e7,P=1e9;function we(O){var N,v,T,g=h.prototype={constructor:h,toString:null,valueOf:null},I=new h(1),_=20,S=4,C=-7,k=21,Q=-1e7,z=1e7,Z=!1,b=1,Y=0,te={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},K="0123456789abcdefghijklmnopqrstuvwxyz",fe=!0;function h(e,r){var i,s,t,l,c,n,f,u,o=this;if(!(o instanceof h))return new h(e,r);if(r==null){if(e&&e._isBigNumber===!0){o.s=e.s,!e.c||e.e>z?o.c=o.e=null:e.e<Q?o.c=[o.e=0]:(o.e=e.e,o.c=e.c.slice());return}if((n=typeof e=="number")&&e*0==0){if(o.s=1/e<0?(e=-e,-1):1,e===~~e){for(l=0,c=e;c>=10;c/=10,l++);l>z?o.c=o.e=null:(o.e=l,o.c=[e]);return}u=String(e)}else{if(!Ee.test(u=String(e)))return T(o,u,n);o.s=u.charCodeAt(0)==45?(u=u.slice(1),-1):1}(l=u.indexOf("."))>-1&&(u=u.replace(".","")),(c=u.search(/e/i))>0?(l<0&&(l=c),l+=+u.slice(c+1),u=u.substring(0,c)):l<0&&(l=u.length)}else{if(x(r,2,K.length,"Base"),r==10&&fe)return o=new h(e),G(o,_+o.e+1,S);if(u=String(e),n=typeof e=="number"){if(e*0!=0)return T(o,u,n,r);if(o.s=1/e<0?(u=u.slice(1),-1):1,h.DEBUG&&u.replace(/^0\.0*|\./,"").length>15)throw Error(pe+e)}else o.s=u.charCodeAt(0)===45?(u=u.slice(1),-1):1;for(i=K.slice(0,r),l=c=0,f=u.length;c<f;c++)if(i.indexOf(s=u.charAt(c))<0){if(s=="."){if(c>l){l=f;continue}}else if(!t&&(u==u.toUpperCase()&&(u=u.toLowerCase())||u==u.toLowerCase()&&(u=u.toUpperCase()))){t=!0,c=-1,l=0;continue}return T(o,String(e),n,r)}n=!1,u=v(u,r,10,o.s),(l=u.indexOf("."))>-1?u=u.replace(".",""):l=u.length}for(c=0;u.charCodeAt(c)===48;c++);for(f=u.length;u.charCodeAt(--f)===48;);if(u=u.slice(c,++f)){if(f-=c,n&&h.DEBUG&&f>15&&(e>ae||e!==y(e)))throw Error(pe+o.s*e);if((l=l-c-1)>z)o.c=o.e=null;else if(l<Q)o.c=[o.e=0];else{if(o.e=l,o.c=[],c=(l+1)%E,l<0&&(c+=E),c<f){for(c&&o.c.push(+u.slice(0,c)),f-=E;c<f;)o.c.push(+u.slice(c,c+=E));c=E-(u=u.slice(c)).length}else c-=f;for(;c--;u+="0");o.c.push(+u)}}else o.c=[o.e=0]}h.clone=we,h.ROUND_UP=0,h.ROUND_DOWN=1,h.ROUND_CEIL=2,h.ROUND_FLOOR=3,h.ROUND_HALF_UP=4,h.ROUND_HALF_DOWN=5,h.ROUND_HALF_EVEN=6,h.ROUND_HALF_CEIL=7,h.ROUND_HALF_FLOOR=8,h.EUCLID=9,h.config=h.set=function(e){var r,i;if(e!=null)if(typeof e=="object"){if(e.hasOwnProperty(r="DECIMAL_PLACES")&&(i=e[r],x(i,0,P,r),_=i),e.hasOwnProperty(r="ROUNDING_MODE")&&(i=e[r],x(i,0,8,r),S=i),e.hasOwnProperty(r="EXPONENTIAL_AT")&&(i=e[r],i&&i.pop?(x(i[0],-P,0,r),x(i[1],0,P,r),C=i[0],k=i[1]):(x(i,-P,P,r),C=-(k=i<0?-i:i))),e.hasOwnProperty(r="RANGE"))if(i=e[r],i&&i.pop)x(i[0],-P,-1,r),x(i[1],1,P,r),Q=i[0],z=i[1];else if(x(i,-P,P,r),i)Q=-(z=i<0?-i:i);else throw Error(U+r+" cannot be zero: "+i);if(e.hasOwnProperty(r="CRYPTO"))if(i=e[r],i===!!i)if(i)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))Z=i;else throw Z=!i,Error(U+"crypto unavailable");else Z=i;else throw Error(U+r+" not true or false: "+i);if(e.hasOwnProperty(r="MODULO_MODE")&&(i=e[r],x(i,0,9,r),b=i),e.hasOwnProperty(r="POW_PRECISION")&&(i=e[r],x(i,0,P,r),Y=i),e.hasOwnProperty(r="FORMAT"))if(i=e[r],typeof i=="object")te=i;else throw Error(U+r+" not an object: "+i);if(e.hasOwnProperty(r="ALPHABET"))if(i=e[r],typeof i=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(i))fe=i.slice(0,10)=="0123456789",K=i;else throw Error(U+r+" invalid: "+i)}else throw Error(U+"Object expected: "+e);return{DECIMAL_PLACES:_,ROUNDING_MODE:S,EXPONENTIAL_AT:[C,k],RANGE:[Q,z],CRYPTO:Z,MODULO_MODE:b,POW_PRECISION:Y,FORMAT:te,ALPHABET:K}},h.isBigNumber=function(e){if(!e||e._isBigNumber!==!0)return!1;if(!h.DEBUG)return!0;var r,i,s=e.c,t=e.e,l=e.s;e:if({}.toString.call(s)=="[object Array]"){if((l===1||l===-1)&&t>=-P&&t<=P&&t===y(t)){if(s[0]===0){if(t===0&&s.length===1)return!0;break e}if(r=(t+1)%E,r<1&&(r+=E),String(s[0]).length==r){for(r=0;r<s.length;r++)if(i=s[r],i<0||i>=H||i!==y(i))break e;if(i!==0)return!0}}}else if(s===null&&t===null&&(l===null||l===1||l===-1))return!0;throw Error(U+"Invalid BigNumber: "+e)},h.maximum=h.max=function(){return ge(arguments,-1)},h.minimum=h.min=function(){return ge(arguments,1)},h.random=function(){var e=9007199254740992,r=Math.random()*e&2097151?function(){return y(Math.random()*e)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(i){var s,t,l,c,n,f=0,u=[],o=new h(I);if(i==null?i=_:x(i,0,P),c=ce(i/E),Z)if(crypto.getRandomValues){for(s=crypto.getRandomValues(new Uint32Array(c*=2));f<c;)n=s[f]*131072+(s[f+1]>>>11),n>=9e15?(t=crypto.getRandomValues(new Uint32Array(2)),s[f]=t[0],s[f+1]=t[1]):(u.push(n%1e14),f+=2);f=c/2}else if(crypto.randomBytes){for(s=crypto.randomBytes(c*=7);f<c;)n=(s[f]&31)*281474976710656+s[f+1]*1099511627776+s[f+2]*4294967296+s[f+3]*16777216+(s[f+4]<<16)+(s[f+5]<<8)+s[f+6],n>=9e15?crypto.randomBytes(7).copy(s,f):(u.push(n%1e14),f+=7);f=c/7}else throw Z=!1,Error(U+"crypto unavailable");if(!Z)for(;f<c;)n=r(),n<9e15&&(u[f++]=n%1e14);for(c=u[--f],i%=E,c&&i&&(n=he[E-i],u[f]=y(c/n)*n);u[f]===0;u.pop(),f--);if(f<0)u=[l=0];else{for(l=-1;u[0]===0;u.splice(0,1),l-=E);for(f=1,n=u[0];n>=10;n/=10,f++);f<E&&(l-=E-f)}return o.e=l,o.c=u,o}}(),h.sum=function(){for(var e=1,r=arguments,i=new h(r[0]);e<r.length;)i=i.plus(r[e++]);return i},v=function(){var e="0123456789";function r(i,s,t,l){for(var c,n=[0],f,u=0,o=i.length;u<o;){for(f=n.length;f--;n[f]*=s);for(n[0]+=l.indexOf(i.charAt(u++)),c=0;c<n.length;c++)n[c]>t-1&&(n[c+1]==null&&(n[c+1]=0),n[c+1]+=n[c]/t|0,n[c]%=t)}return n.reverse()}return function(i,s,t,l,c){var n,f,u,o,a,p,w,d,B=i.indexOf("."),R=_,m=S;for(B>=0&&(o=Y,Y=0,i=i.replace(".",""),d=new h(s),p=d.pow(i.length-B),Y=o,d.c=r(W(q(p.c),p.e,"0"),10,t,e),d.e=d.c.length),w=r(i,s,t,c?(n=K,e):(n=e,K)),u=o=w.length;w[--o]==0;w.pop());if(!w[0])return n.charAt(0);if(B<0?--u:(p.c=w,p.e=u,p.s=l,p=N(p,d,R,m,t),w=p.c,a=p.r,u=p.e),f=u+R+1,B=w[f],o=t/2,a=a||f<0||w[f+1]!=null,a=m<4?(B!=null||a)&&(m==0||m==(p.s<0?3:2)):B>o||B==o&&(m==4||a||m==6&&w[f-1]&1||m==(p.s<0?8:7)),f<1||!w[0])i=a?W(n.charAt(1),-R,n.charAt(0)):n.charAt(0);else{if(w.length=f,a)for(--t;++w[--f]>t;)w[f]=0,f||(++u,w=[1].concat(w));for(o=w.length;!w[--o];);for(B=0,i="";B<=o;i+=n.charAt(w[B++]));i=W(i,u,n.charAt(0))}return i}}(),N=function(){function e(s,t,l){var c,n,f,u,o=0,a=s.length,p=t%J,w=t/J|0;for(s=s.slice();a--;)f=s[a]%J,u=s[a]/J|0,c=w*f+u*p,n=p*f+c%J*J+o,o=(n/l|0)+(c/J|0)+w*u,s[a]=n%l;return o&&(s=[o].concat(s)),s}function r(s,t,l,c){var n,f;if(l!=c)f=l>c?1:-1;else for(n=f=0;n<l;n++)if(s[n]!=t[n]){f=s[n]>t[n]?1:-1;break}return f}function i(s,t,l,c){for(var n=0;l--;)s[l]-=n,n=s[l]<t[l]?1:0,s[l]=n*c+s[l]-t[l];for(;!s[0]&&s.length>1;s.splice(0,1));}return function(s,t,l,c,n){var f,u,o,a,p,w,d,B,R,m,A,D,re,se,ue,X,ee,F=s.s==t.s?1:-1,L=s.c,M=t.c;if(!L||!L[0]||!M||!M[0])return new h(!s.s||!t.s||(L?M&&L[0]==M[0]:!M)?NaN:L&&L[0]==0||!M?F*0:F/0);for(B=new h(F),R=B.c=[],u=s.e-t.e,F=l+u+1,n||(n=H,u=$(s.e/E)-$(t.e/E),F=F/E|0),o=0;M[o]==(L[o]||0);o++);if(M[o]>(L[o]||0)&&u--,F<0)R.push(1),a=!0;else{for(se=L.length,X=M.length,o=0,F+=2,p=y(n/(M[0]+1)),p>1&&(M=e(M,p,n),L=e(L,p,n),X=M.length,se=L.length),re=X,m=L.slice(0,X),A=m.length;A<X;m[A++]=0);ee=M.slice(),ee=[0].concat(ee),ue=M[0],M[1]>=n/2&&ue++;do{if(p=0,f=r(M,m,X,A),f<0){if(D=m[0],X!=A&&(D=D*n+(m[1]||0)),p=y(D/ue),p>1)for(p>=n&&(p=n-1),w=e(M,p,n),d=w.length,A=m.length;r(w,m,d,A)==1;)p--,i(w,X<d?ee:M,d,n),d=w.length,f=1;else p==0&&(f=p=1),w=M.slice(),d=w.length;if(d<A&&(w=[0].concat(w)),i(m,w,A,n),A=m.length,f==-1)for(;r(M,m,X,A)<1;)p++,i(m,X<A?ee:M,A,n),A=m.length}else f===0&&(p++,m=[0]);R[o++]=p,m[0]?m[A++]=L[re]||0:(m=[L[re]],A=1)}while((re++<se||m[0]!=null)&&F--);a=m[0]!=null,R[0]||R.splice(0,1)}if(n==H){for(o=1,F=R[0];F>=10;F/=10,o++);G(B,l+(B.e=o+u*E-1)+1,c,a)}else B.e=u,B.r=+a;return B}}();function le(e,r,i,s){var t,l,c,n,f;if(i==null?i=S:x(i,0,8),!e.c)return e.toString();if(t=e.c[0],c=e.e,r==null)f=q(e.c),f=s==1||s==2&&(c<=C||c>=k)?ne(f,c):W(f,c,"0");else if(e=G(new h(e),r,i),l=e.e,f=q(e.c),n=f.length,s==1||s==2&&(r<=l||l<=C)){for(;n<r;f+="0",n++);f=ne(f,l)}else if(r-=c,f=W(f,l,"0"),l+1>n){if(--r>0)for(f+=".";r--;f+="0");}else if(r+=l-n,r>0)for(l+1==n&&(f+=".");r--;f+="0");return e.s<0&&t?"-"+f:f}function ge(e,r){for(var i,s,t=1,l=new h(e[0]);t<e.length;t++)s=new h(e[t]),(!s.s||(i=j(l,s))===r||i===0&&l.s===r)&&(l=s);return l}function oe(e,r,i){for(var s=1,t=r.length;!r[--t];r.pop());for(t=r[0];t>=10;t/=10,s++);return(i=s+i*E-1)>z?e.c=e.e=null:i<Q?e.c=[e.e=0]:(e.e=i,e.c=r),e}T=function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,r=/^([^.]+)\.$/,i=/^\.([^.]+)$/,s=/^-?(Infinity|NaN)$/,t=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(l,c,n,f){var u,o=n?c:c.replace(t,"");if(s.test(o))l.s=isNaN(o)?null:o<0?-1:1;else{if(!n&&(o=o.replace(e,function(a,p,w){return u=(w=w.toLowerCase())=="x"?16:w=="b"?2:8,!f||f==u?p:a}),f&&(u=f,o=o.replace(r,"$1").replace(i,"0.$1")),c!=o))return new h(o,u);if(h.DEBUG)throw Error(U+"Not a"+(f?" base "+f:"")+" number: "+c);l.s=null}l.c=l.e=null}}();function G(e,r,i,s){var t,l,c,n,f,u,o,a=e.c,p=he;if(a){e:{for(t=1,n=a[0];n>=10;n/=10,t++);if(l=r-t,l<0)l+=E,c=r,f=a[u=0],o=y(f/p[t-c-1]%10);else if(u=ce((l+1)/E),u>=a.length)if(s){for(;a.length<=u;a.push(0));f=o=0,t=1,l%=E,c=l-E+1}else break e;else{for(f=n=a[u],t=1;n>=10;n/=10,t++);l%=E,c=l-E+t,o=c<0?0:y(f/p[t-c-1]%10)}if(s=s||r<0||a[u+1]!=null||(c<0?f:f%p[t-c-1]),s=i<4?(o||s)&&(i==0||i==(e.s<0?3:2)):o>5||o==5&&(i==4||s||i==6&&(l>0?c>0?f/p[t-c]:0:a[u-1])%10&1||i==(e.s<0?8:7)),r<1||!a[0])return a.length=0,s?(r-=e.e+1,a[0]=p[(E-r%E)%E],e.e=-r||0):a[0]=e.e=0,e;if(l==0?(a.length=u,n=1,u--):(a.length=u+1,n=p[E-l],a[u]=c>0?y(f/p[t-c]%p[c])*n:0),s)for(;;)if(u==0){for(l=1,c=a[0];c>=10;c/=10,l++);for(c=a[0]+=n,n=1;c>=10;c/=10,n++);l!=n&&(e.e++,a[0]==H&&(a[0]=1));break}else{if(a[u]+=n,a[u]!=H)break;a[u--]=0,n=1}for(l=a.length;a[--l]===0;a.pop());}e.e>z?e.c=e.e=null:e.e<Q&&(e.c=[e.e=0])}return e}function V(e){var r,i=e.e;return i===null?e.toString():(r=q(e.c),r=i<=C||i>=k?ne(r,i):W(r,i,"0"),e.s<0?"-"+r:r)}return g.absoluteValue=g.abs=function(){var e=new h(this);return e.s<0&&(e.s=1),e},g.comparedTo=function(e,r){return j(this,new h(e,r))},g.decimalPlaces=g.dp=function(e,r){var i,s,t,l=this;if(e!=null)return x(e,0,P),r==null?r=S:x(r,0,8),G(new h(l),e+l.e+1,r);if(!(i=l.c))return null;if(s=((t=i.length-1)-$(this.e/E))*E,t=i[t])for(;t%10==0;t/=10,s--);return s<0&&(s=0),s},g.dividedBy=g.div=function(e,r){return N(this,new h(e,r),_,S)},g.dividedToIntegerBy=g.idiv=function(e,r){return N(this,new h(e,r),0,1)},g.exponentiatedBy=g.pow=function(e,r){var i,s,t,l,c,n,f,u,o,a=this;if(e=new h(e),e.c&&!e.isInteger())throw Error(U+"Exponent not an integer: "+V(e));if(r!=null&&(r=new h(r)),n=e.e>14,!a.c||!a.c[0]||a.c[0]==1&&!a.e&&a.c.length==1||!e.c||!e.c[0])return o=new h(Math.pow(+V(a),n?e.s*(2-ie(e)):+V(e))),r?o.mod(r):o;if(f=e.s<0,r){if(r.c?!r.c[0]:!r.s)return new h(NaN);s=!f&&a.isInteger()&&r.isInteger(),s&&(a=a.mod(r))}else{if(e.e>9&&(a.e>0||a.e<-1||(a.e==0?a.c[0]>1||n&&a.c[1]>=24e7:a.c[0]<8e13||n&&a.c[0]<=9999975e7)))return l=a.s<0&&ie(e)?-0:0,a.e>-1&&(l=1/l),new h(f?1/l:l);Y&&(l=ce(Y/E+2))}for(n?(i=new h(.5),f&&(e.s=1),u=ie(e)):(t=Math.abs(+V(e)),u=t%2),o=new h(I);;){if(u){if(o=o.times(a),!o.c)break;l?o.c.length>l&&(o.c.length=l):s&&(o=o.mod(r))}if(t){if(t=y(t/2),t===0)break;u=t%2}else if(e=e.times(i),G(e,e.e+1,1),e.e>14)u=ie(e);else{if(t=+V(e),t===0)break;u=t%2}a=a.times(a),l?a.c&&a.c.length>l&&(a.c.length=l):s&&(a=a.mod(r))}return s?o:(f&&(o=I.div(o)),r?o.mod(r):l?G(o,Y,S,c):o)},g.integerValue=function(e){var r=new h(this);return e==null?e=S:x(e,0,8),G(r,r.e+1,e)},g.isEqualTo=g.eq=function(e,r){return j(this,new h(e,r))===0},g.isFinite=function(){return!!this.c},g.isGreaterThan=g.gt=function(e,r){return j(this,new h(e,r))>0},g.isGreaterThanOrEqualTo=g.gte=function(e,r){return(r=j(this,new h(e,r)))===1||r===0},g.isInteger=function(){return!!this.c&&$(this.e/E)>this.c.length-2},g.isLessThan=g.lt=function(e,r){return j(this,new h(e,r))<0},g.isLessThanOrEqualTo=g.lte=function(e,r){return(r=j(this,new h(e,r)))===-1||r===0},g.isNaN=function(){return!this.s},g.isNegative=function(){return this.s<0},g.isPositive=function(){return this.s>0},g.isZero=function(){return!!this.c&&this.c[0]==0},g.minus=function(e,r){var i,s,t,l,c=this,n=c.s;if(e=new h(e,r),r=e.s,!n||!r)return new h(NaN);if(n!=r)return e.s=-r,c.plus(e);var f=c.e/E,u=e.e/E,o=c.c,a=e.c;if(!f||!u){if(!o||!a)return o?(e.s=-r,e):new h(a?c:NaN);if(!o[0]||!a[0])return a[0]?(e.s=-r,e):new h(o[0]?c:S==3?-0:0)}if(f=$(f),u=$(u),o=o.slice(),n=f-u){for((l=n<0)?(n=-n,t=o):(u=f,t=a),t.reverse(),r=n;r--;t.push(0));t.reverse()}else for(s=(l=(n=o.length)<(r=a.length))?n:r,n=r=0;r<s;r++)if(o[r]!=a[r]){l=o[r]<a[r];break}if(l&&(t=o,o=a,a=t,e.s=-e.s),r=(s=a.length)-(i=o.length),r>0)for(;r--;o[i++]=0);for(r=H-1;s>n;){if(o[--s]<a[s]){for(i=s;i&&!o[--i];o[i]=r);--o[i],o[s]+=H}o[s]-=a[s]}for(;o[0]==0;o.splice(0,1),--u);return o[0]?oe(e,o,u):(e.s=S==3?-1:1,e.c=[e.e=0],e)},g.modulo=g.mod=function(e,r){var i,s,t=this;return e=new h(e,r),!t.c||!e.s||e.c&&!e.c[0]?new h(NaN):!e.c||t.c&&!t.c[0]?new h(t):(b==9?(s=e.s,e.s=1,i=N(t,e,0,3),e.s=s,i.s*=s):i=N(t,e,0,b),e=t.minus(i.times(e)),!e.c[0]&&b==1&&(e.s=t.s),e)},g.multipliedBy=g.times=function(e,r){var i,s,t,l,c,n,f,u,o,a,p,w,d,B,R,m=this,A=m.c,D=(e=new h(e,r)).c;if(!A||!D||!A[0]||!D[0])return!m.s||!e.s||A&&!A[0]&&!D||D&&!D[0]&&!A?e.c=e.e=e.s=null:(e.s*=m.s,!A||!D?e.c=e.e=null:(e.c=[0],e.e=0)),e;for(s=$(m.e/E)+$(e.e/E),e.s*=m.s,f=A.length,a=D.length,f<a&&(d=A,A=D,D=d,t=f,f=a,a=t),t=f+a,d=[];t--;d.push(0));for(B=H,R=J,t=a;--t>=0;){for(i=0,p=D[t]%R,w=D[t]/R|0,c=f,l=t+c;l>t;)u=A[--c]%R,o=A[c]/R|0,n=w*u+o*p,u=p*u+n%R*R+d[l]+i,i=(u/B|0)+(n/R|0)+w*o,d[l--]=u%B;d[l]=i}return i?++s:d.splice(0,1),oe(e,d,s)},g.negated=function(){var e=new h(this);return e.s=-e.s||null,e},g.plus=function(e,r){var i,s=this,t=s.s;if(e=new h(e,r),r=e.s,!t||!r)return new h(NaN);if(t!=r)return e.s=-r,s.minus(e);var l=s.e/E,c=e.e/E,n=s.c,f=e.c;if(!l||!c){if(!n||!f)return new h(t/0);if(!n[0]||!f[0])return f[0]?e:new h(n[0]?s:t*0)}if(l=$(l),c=$(c),n=n.slice(),t=l-c){for(t>0?(c=l,i=f):(t=-t,i=n),i.reverse();t--;i.push(0));i.reverse()}for(t=n.length,r=f.length,t-r<0&&(i=f,f=n,n=i,r=t),t=0;r;)t=(n[--r]=n[r]+f[r]+t)/H|0,n[r]=H===n[r]?0:n[r]%H;return t&&(n=[t].concat(n),++c),oe(e,n,c)},g.precision=g.sd=function(e,r){var i,s,t,l=this;if(e!=null&&e!==!!e)return x(e,1,P),r==null?r=S:x(r,0,8),G(new h(l),e,r);if(!(i=l.c))return null;if(t=i.length-1,s=t*E+1,t=i[t]){for(;t%10==0;t/=10,s--);for(t=i[0];t>=10;t/=10,s++);}return e&&l.e+1>s&&(s=l.e+1),s},g.shiftedBy=function(e){return x(e,-ae,ae),this.times("1e"+e)},g.squareRoot=g.sqrt=function(){var e,r,i,s,t,l=this,c=l.c,n=l.s,f=l.e,u=_+4,o=new h("0.5");if(n!==1||!c||!c[0])return new h(!n||n<0&&(!c||c[0])?NaN:c?l:1/0);if(n=Math.sqrt(+V(l)),n==0||n==1/0?(r=q(c),(r.length+f)%2==0&&(r+="0"),n=Math.sqrt(+r),f=$((f+1)/2)-(f<0||f%2),n==1/0?r="5e"+f:(r=n.toExponential(),r=r.slice(0,r.indexOf("e")+1)+f),i=new h(r)):i=new h(n+""),i.c[0]){for(f=i.e,n=f+u,n<3&&(n=0);;)if(t=i,i=o.times(t.plus(N(l,t,u,1))),q(t.c).slice(0,n)===(r=q(i.c)).slice(0,n))if(i.e<f&&--n,r=r.slice(n-3,n+1),r=="9999"||!s&&r=="4999"){if(!s&&(G(t,t.e+_+2,0),t.times(t).eq(l))){i=t;break}u+=4,n+=4,s=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(G(i,i.e+_+2,1),e=!i.times(i).eq(l));break}}return G(i,i.e+_+1,S,e)},g.toExponential=function(e,r){return e!=null&&(x(e,0,P),e++),le(this,e,r,1)},g.toFixed=function(e,r){return e!=null&&(x(e,0,P),e=e+this.e+1),le(this,e,r)},g.toFormat=function(e,r,i){var s,t=this;if(i==null)e!=null&&r&&typeof r=="object"?(i=r,r=null):e&&typeof e=="object"?(i=e,e=r=null):i=te;else if(typeof i!="object")throw Error(U+"Argument not an object: "+i);if(s=t.toFixed(e,r),t.c){var l,c=s.split("."),n=+i.groupSize,f=+i.secondaryGroupSize,u=i.groupSeparator||"",o=c[0],a=c[1],p=t.s<0,w=p?o.slice(1):o,d=w.length;if(f&&(l=n,n=f,f=l,d-=l),n>0&&d>0){for(l=d%n||n,o=w.substr(0,l);l<d;l+=n)o+=u+w.substr(l,n);f>0&&(o+=u+w.slice(l)),p&&(o="-"+o)}s=a?o+(i.decimalSeparator||"")+((f=+i.fractionGroupSize)?a.replace(new RegExp("\\d{"+f+"}\\B","g"),"$&"+(i.fractionGroupSeparator||"")):a):o}return(i.prefix||"")+s+(i.suffix||"")},g.toFraction=function(e){var r,i,s,t,l,c,n,f,u,o,a,p,w=this,d=w.c;if(e!=null&&(n=new h(e),!n.isInteger()&&(n.c||n.s!==1)||n.lt(I)))throw Error(U+"Argument "+(n.isInteger()?"out of range: ":"not an integer: ")+V(n));if(!d)return new h(w);for(r=new h(I),u=i=new h(I),s=f=new h(I),p=q(d),l=r.e=p.length-w.e-1,r.c[0]=he[(c=l%E)<0?E+c:c],e=!e||n.comparedTo(r)>0?l>0?r:u:n,c=z,z=1/0,n=new h(p),f.c[0]=0;o=N(n,r,0,1),t=i.plus(o.times(s)),t.comparedTo(e)!=1;)i=s,s=t,u=f.plus(o.times(t=u)),f=t,r=n.minus(o.times(t=r)),n=t;return t=N(e.minus(i),s,0,1),f=f.plus(t.times(u)),i=i.plus(t.times(s)),f.s=u.s=w.s,l=l*2,a=N(u,s,l,S).minus(w).abs().comparedTo(N(f,i,l,S).minus(w).abs())<1?[u,s]:[f,i],z=c,a},g.toNumber=function(){return+V(this)},g.toPrecision=function(e,r){return e!=null&&x(e,1,P),le(this,e,r,2)},g.toString=function(e){var r,i=this,s=i.s,t=i.e;return t===null?s?(r="Infinity",s<0&&(r="-"+r)):r="NaN":(e==null?r=t<=C||t>=k?ne(q(i.c),t):W(q(i.c),t,"0"):e===10&&fe?(i=G(new h(i),_+t+1,S),r=W(q(i.c),i.e,"0")):(x(e,2,K.length,"Base"),r=v(W(q(i.c),t,"0"),10,e,s,!0)),s<0&&i.c[0]&&(r="-"+r)),r},g.valueOf=g.toJSON=function(){return V(this)},g._isBigNumber=!0,g[Symbol.toStringTag]="BigNumber",g[Symbol.for("nodejs.util.inspect.custom")]=g.valueOf,O!=null&&h.set(O),h}function $(O){var N=O|0;return O>0||O===N?N:N-1}function q(O){for(var N,v,T=1,g=O.length,I=O[0]+"";T<g;){for(N=O[T++]+"",v=E-N.length;v--;N="0"+N);I+=N}for(g=I.length;I.charCodeAt(--g)===48;);return I.slice(0,g+1||1)}function j(O,N){var v,T,g=O.c,I=N.c,_=O.s,S=N.s,C=O.e,k=N.e;if(!_||!S)return null;if(v=g&&!g[0],T=I&&!I[0],v||T)return v?T?0:-S:_;if(_!=S)return _;if(v=_<0,T=C==k,!g||!I)return T?0:!g^v?1:-1;if(!T)return C>k^v?1:-1;for(S=(C=g.length)<(k=I.length)?C:k,_=0;_<S;_++)if(g[_]!=I[_])return g[_]>I[_]^v?1:-1;return C==k?0:C>k^v?1:-1}function x(O,N,v,T){if(O<N||O>v||O!==y(O))throw Error(U+(T||"Argument")+(typeof O=="number"?O<N||O>v?" out of range: ":" not an integer: ":" not a primitive number: ")+String(O))}function ie(O){var N=O.c.length-1;return $(O.e/E)==N&&O.c[N]%2!=0}function ne(O,N){return(O.length>1?O.charAt(0)+"."+O.slice(1):O)+(N<0?"e":"e+")+N}function W(O,N,v){var T,g;if(N<0){for(g=v+".";++N;g+=v);O=g+O}else if(T=O.length,++N>T){for(g=v,N-=T;--N;g+=v);O+=g}else N<T&&(O=O.slice(0,N)+"."+O.slice(N));return O}var Ne=we();exports.BigNumber=Ne;exports.default=Ne;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var Ee=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,ce=Math.ceil,y=Math.floor,U="[BigNumber Error] ",pe=U+"Number primitive has more than 15 significant digits: ",H=1e14,E=14,ae=9007199254740991,he=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],J=1e7,P=1e9;function we(O){var N,v,T,g=h.prototype={constructor:h,toString:null,valueOf:null},I=new h(1),_=20,S=4,C=-7,k=21,Q=-1e7,z=1e7,Z=!1,b=1,Y=0,te={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},K="0123456789abcdefghijklmnopqrstuvwxyz",fe=!0;function h(e,r){var i,s,t,l,c,n,f,u,o=this;if(!(o instanceof h))return new h(e,r);if(r==null){if(e&&e._isBigNumber===!0){o.s=e.s,!e.c||e.e>z?o.c=o.e=null:e.e<Q?o.c=[o.e=0]:(o.e=e.e,o.c=e.c.slice());return}if((n=typeof e=="number")&&e*0==0){if(o.s=1/e<0?(e=-e,-1):1,e===~~e){for(l=0,c=e;c>=10;c/=10,l++);l>z?o.c=o.e=null:(o.e=l,o.c=[e]);return}u=String(e)}else{if(!Ee.test(u=String(e)))return T(o,u,n);o.s=u.charCodeAt(0)==45?(u=u.slice(1),-1):1}(l=u.indexOf("."))>-1&&(u=u.replace(".","")),(c=u.search(/e/i))>0?(l<0&&(l=c),l+=+u.slice(c+1),u=u.substring(0,c)):l<0&&(l=u.length)}else{if(x(r,2,K.length,"Base"),r==10&&fe)return o=new h(e),G(o,_+o.e+1,S);if(u=String(e),n=typeof e=="number"){if(e*0!=0)return T(o,u,n,r);if(o.s=1/e<0?(u=u.slice(1),-1):1,h.DEBUG&&u.replace(/^0\.0*|\./,"").length>15)throw Error(pe+e)}else o.s=u.charCodeAt(0)===45?(u=u.slice(1),-1):1;for(i=K.slice(0,r),l=c=0,f=u.length;c<f;c++)if(i.indexOf(s=u.charAt(c))<0){if(s=="."){if(c>l){l=f;continue}}else if(!t&&(u==u.toUpperCase()&&(u=u.toLowerCase())||u==u.toLowerCase()&&(u=u.toUpperCase()))){t=!0,c=-1,l=0;continue}return T(o,String(e),n,r)}n=!1,u=v(u,r,10,o.s),(l=u.indexOf("."))>-1?u=u.replace(".",""):l=u.length}for(c=0;u.charCodeAt(c)===48;c++);for(f=u.length;u.charCodeAt(--f)===48;);if(u=u.slice(c,++f)){if(f-=c,n&&h.DEBUG&&f>15&&(e>ae||e!==y(e)))throw Error(pe+o.s*e);if((l=l-c-1)>z)o.c=o.e=null;else if(l<Q)o.c=[o.e=0];else{if(o.e=l,o.c=[],c=(l+1)%E,l<0&&(c+=E),c<f){for(c&&o.c.push(+u.slice(0,c)),f-=E;c<f;)o.c.push(+u.slice(c,c+=E));c=E-(u=u.slice(c)).length}else c-=f;for(;c--;u+="0");o.c.push(+u)}}else o.c=[o.e=0]}h.clone=we,h.ROUND_UP=0,h.ROUND_DOWN=1,h.ROUND_CEIL=2,h.ROUND_FLOOR=3,h.ROUND_HALF_UP=4,h.ROUND_HALF_DOWN=5,h.ROUND_HALF_EVEN=6,h.ROUND_HALF_CEIL=7,h.ROUND_HALF_FLOOR=8,h.EUCLID=9,h.config=h.set=function(e){var r,i;if(e!=null)if(typeof e=="object"){if(e.hasOwnProperty(r="DECIMAL_PLACES")&&(i=e[r],x(i,0,P,r),_=i),e.hasOwnProperty(r="ROUNDING_MODE")&&(i=e[r],x(i,0,8,r),S=i),e.hasOwnProperty(r="EXPONENTIAL_AT")&&(i=e[r],i&&i.pop?(x(i[0],-P,0,r),x(i[1],0,P,r),C=i[0],k=i[1]):(x(i,-P,P,r),C=-(k=i<0?-i:i))),e.hasOwnProperty(r="RANGE"))if(i=e[r],i&&i.pop)x(i[0],-P,-1,r),x(i[1],1,P,r),Q=i[0],z=i[1];else if(x(i,-P,P,r),i)Q=-(z=i<0?-i:i);else throw Error(U+r+" cannot be zero: "+i);if(e.hasOwnProperty(r="CRYPTO"))if(i=e[r],i===!!i)if(i)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))Z=i;else throw Z=!i,Error(U+"crypto unavailable");else Z=i;else throw Error(U+r+" not true or false: "+i);if(e.hasOwnProperty(r="MODULO_MODE")&&(i=e[r],x(i,0,9,r),b=i),e.hasOwnProperty(r="POW_PRECISION")&&(i=e[r],x(i,0,P,r),Y=i),e.hasOwnProperty(r="FORMAT"))if(i=e[r],typeof i=="object")te=i;else throw Error(U+r+" not an object: "+i);if(e.hasOwnProperty(r="ALPHABET"))if(i=e[r],typeof i=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(i))fe=i.slice(0,10)=="0123456789",K=i;else throw Error(U+r+" invalid: "+i)}else throw Error(U+"Object expected: "+e);return{DECIMAL_PLACES:_,ROUNDING_MODE:S,EXPONENTIAL_AT:[C,k],RANGE:[Q,z],CRYPTO:Z,MODULO_MODE:b,POW_PRECISION:Y,FORMAT:te,ALPHABET:K}},h.isBigNumber=function(e){if(!e||e._isBigNumber!==!0)return!1;if(!h.DEBUG)return!0;var r,i,s=e.c,t=e.e,l=e.s;e:if({}.toString.call(s)=="[object Array]"){if((l===1||l===-1)&&t>=-P&&t<=P&&t===y(t)){if(s[0]===0){if(t===0&&s.length===1)return!0;break e}if(r=(t+1)%E,r<1&&(r+=E),String(s[0]).length==r){for(r=0;r<s.length;r++)if(i=s[r],i<0||i>=H||i!==y(i))break e;if(i!==0)return!0}}}else if(s===null&&t===null&&(l===null||l===1||l===-1))return!0;throw Error(U+"Invalid BigNumber: "+e)},h.maximum=h.max=function(){return ge(arguments,-1)},h.minimum=h.min=function(){return ge(arguments,1)},h.random=(function(){var e=9007199254740992,r=Math.random()*e&2097151?function(){return y(Math.random()*e)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(i){var s,t,l,c,n,f=0,u=[],o=new h(I);if(i==null?i=_:x(i,0,P),c=ce(i/E),Z)if(crypto.getRandomValues){for(s=crypto.getRandomValues(new Uint32Array(c*=2));f<c;)n=s[f]*131072+(s[f+1]>>>11),n>=9e15?(t=crypto.getRandomValues(new Uint32Array(2)),s[f]=t[0],s[f+1]=t[1]):(u.push(n%1e14),f+=2);f=c/2}else if(crypto.randomBytes){for(s=crypto.randomBytes(c*=7);f<c;)n=(s[f]&31)*281474976710656+s[f+1]*1099511627776+s[f+2]*4294967296+s[f+3]*16777216+(s[f+4]<<16)+(s[f+5]<<8)+s[f+6],n>=9e15?crypto.randomBytes(7).copy(s,f):(u.push(n%1e14),f+=7);f=c/7}else throw Z=!1,Error(U+"crypto unavailable");if(!Z)for(;f<c;)n=r(),n<9e15&&(u[f++]=n%1e14);for(c=u[--f],i%=E,c&&i&&(n=he[E-i],u[f]=y(c/n)*n);u[f]===0;u.pop(),f--);if(f<0)u=[l=0];else{for(l=-1;u[0]===0;u.splice(0,1),l-=E);for(f=1,n=u[0];n>=10;n/=10,f++);f<E&&(l-=E-f)}return o.e=l,o.c=u,o}})(),h.sum=function(){for(var e=1,r=arguments,i=new h(r[0]);e<r.length;)i=i.plus(r[e++]);return i},v=(function(){var e="0123456789";function r(i,s,t,l){for(var c,n=[0],f,u=0,o=i.length;u<o;){for(f=n.length;f--;n[f]*=s);for(n[0]+=l.indexOf(i.charAt(u++)),c=0;c<n.length;c++)n[c]>t-1&&(n[c+1]==null&&(n[c+1]=0),n[c+1]+=n[c]/t|0,n[c]%=t)}return n.reverse()}return function(i,s,t,l,c){var n,f,u,o,a,p,w,d,B=i.indexOf("."),R=_,m=S;for(B>=0&&(o=Y,Y=0,i=i.replace(".",""),d=new h(s),p=d.pow(i.length-B),Y=o,d.c=r(W(q(p.c),p.e,"0"),10,t,e),d.e=d.c.length),w=r(i,s,t,c?(n=K,e):(n=e,K)),u=o=w.length;w[--o]==0;w.pop());if(!w[0])return n.charAt(0);if(B<0?--u:(p.c=w,p.e=u,p.s=l,p=N(p,d,R,m,t),w=p.c,a=p.r,u=p.e),f=u+R+1,B=w[f],o=t/2,a=a||f<0||w[f+1]!=null,a=m<4?(B!=null||a)&&(m==0||m==(p.s<0?3:2)):B>o||B==o&&(m==4||a||m==6&&w[f-1]&1||m==(p.s<0?8:7)),f<1||!w[0])i=a?W(n.charAt(1),-R,n.charAt(0)):n.charAt(0);else{if(w.length=f,a)for(--t;++w[--f]>t;)w[f]=0,f||(++u,w=[1].concat(w));for(o=w.length;!w[--o];);for(B=0,i="";B<=o;i+=n.charAt(w[B++]));i=W(i,u,n.charAt(0))}return i}})(),N=(function(){function e(s,t,l){var c,n,f,u,o=0,a=s.length,p=t%J,w=t/J|0;for(s=s.slice();a--;)f=s[a]%J,u=s[a]/J|0,c=w*f+u*p,n=p*f+c%J*J+o,o=(n/l|0)+(c/J|0)+w*u,s[a]=n%l;return o&&(s=[o].concat(s)),s}function r(s,t,l,c){var n,f;if(l!=c)f=l>c?1:-1;else for(n=f=0;n<l;n++)if(s[n]!=t[n]){f=s[n]>t[n]?1:-1;break}return f}function i(s,t,l,c){for(var n=0;l--;)s[l]-=n,n=s[l]<t[l]?1:0,s[l]=n*c+s[l]-t[l];for(;!s[0]&&s.length>1;s.splice(0,1));}return function(s,t,l,c,n){var f,u,o,a,p,w,d,B,R,m,A,D,re,se,ue,X,ee,F=s.s==t.s?1:-1,L=s.c,M=t.c;if(!L||!L[0]||!M||!M[0])return new h(!s.s||!t.s||(L?M&&L[0]==M[0]:!M)?NaN:L&&L[0]==0||!M?F*0:F/0);for(B=new h(F),R=B.c=[],u=s.e-t.e,F=l+u+1,n||(n=H,u=$(s.e/E)-$(t.e/E),F=F/E|0),o=0;M[o]==(L[o]||0);o++);if(M[o]>(L[o]||0)&&u--,F<0)R.push(1),a=!0;else{for(se=L.length,X=M.length,o=0,F+=2,p=y(n/(M[0]+1)),p>1&&(M=e(M,p,n),L=e(L,p,n),X=M.length,se=L.length),re=X,m=L.slice(0,X),A=m.length;A<X;m[A++]=0);ee=M.slice(),ee=[0].concat(ee),ue=M[0],M[1]>=n/2&&ue++;do{if(p=0,f=r(M,m,X,A),f<0){if(D=m[0],X!=A&&(D=D*n+(m[1]||0)),p=y(D/ue),p>1)for(p>=n&&(p=n-1),w=e(M,p,n),d=w.length,A=m.length;r(w,m,d,A)==1;)p--,i(w,X<d?ee:M,d,n),d=w.length,f=1;else p==0&&(f=p=1),w=M.slice(),d=w.length;if(d<A&&(w=[0].concat(w)),i(m,w,A,n),A=m.length,f==-1)for(;r(M,m,X,A)<1;)p++,i(m,X<A?ee:M,A,n),A=m.length}else f===0&&(p++,m=[0]);R[o++]=p,m[0]?m[A++]=L[re]||0:(m=[L[re]],A=1)}while((re++<se||m[0]!=null)&&F--);a=m[0]!=null,R[0]||R.splice(0,1)}if(n==H){for(o=1,F=R[0];F>=10;F/=10,o++);G(B,l+(B.e=o+u*E-1)+1,c,a)}else B.e=u,B.r=+a;return B}})();function le(e,r,i,s){var t,l,c,n,f;if(i==null?i=S:x(i,0,8),!e.c)return e.toString();if(t=e.c[0],c=e.e,r==null)f=q(e.c),f=s==1||s==2&&(c<=C||c>=k)?ne(f,c):W(f,c,"0");else if(e=G(new h(e),r,i),l=e.e,f=q(e.c),n=f.length,s==1||s==2&&(r<=l||l<=C)){for(;n<r;f+="0",n++);f=ne(f,l)}else if(r-=c,f=W(f,l,"0"),l+1>n){if(--r>0)for(f+=".";r--;f+="0");}else if(r+=l-n,r>0)for(l+1==n&&(f+=".");r--;f+="0");return e.s<0&&t?"-"+f:f}function ge(e,r){for(var i,s,t=1,l=new h(e[0]);t<e.length;t++)s=new h(e[t]),(!s.s||(i=j(l,s))===r||i===0&&l.s===r)&&(l=s);return l}function oe(e,r,i){for(var s=1,t=r.length;!r[--t];r.pop());for(t=r[0];t>=10;t/=10,s++);return(i=s+i*E-1)>z?e.c=e.e=null:i<Q?e.c=[e.e=0]:(e.e=i,e.c=r),e}T=(function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,r=/^([^.]+)\.$/,i=/^\.([^.]+)$/,s=/^-?(Infinity|NaN)$/,t=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(l,c,n,f){var u,o=n?c:c.replace(t,"");if(s.test(o))l.s=isNaN(o)?null:o<0?-1:1;else{if(!n&&(o=o.replace(e,function(a,p,w){return u=(w=w.toLowerCase())=="x"?16:w=="b"?2:8,!f||f==u?p:a}),f&&(u=f,o=o.replace(r,"$1").replace(i,"0.$1")),c!=o))return new h(o,u);if(h.DEBUG)throw Error(U+"Not a"+(f?" base "+f:"")+" number: "+c);l.s=null}l.c=l.e=null}})();function G(e,r,i,s){var t,l,c,n,f,u,o,a=e.c,p=he;if(a){e:{for(t=1,n=a[0];n>=10;n/=10,t++);if(l=r-t,l<0)l+=E,c=r,f=a[u=0],o=y(f/p[t-c-1]%10);else if(u=ce((l+1)/E),u>=a.length)if(s){for(;a.length<=u;a.push(0));f=o=0,t=1,l%=E,c=l-E+1}else break e;else{for(f=n=a[u],t=1;n>=10;n/=10,t++);l%=E,c=l-E+t,o=c<0?0:y(f/p[t-c-1]%10)}if(s=s||r<0||a[u+1]!=null||(c<0?f:f%p[t-c-1]),s=i<4?(o||s)&&(i==0||i==(e.s<0?3:2)):o>5||o==5&&(i==4||s||i==6&&(l>0?c>0?f/p[t-c]:0:a[u-1])%10&1||i==(e.s<0?8:7)),r<1||!a[0])return a.length=0,s?(r-=e.e+1,a[0]=p[(E-r%E)%E],e.e=-r||0):a[0]=e.e=0,e;if(l==0?(a.length=u,n=1,u--):(a.length=u+1,n=p[E-l],a[u]=c>0?y(f/p[t-c]%p[c])*n:0),s)for(;;)if(u==0){for(l=1,c=a[0];c>=10;c/=10,l++);for(c=a[0]+=n,n=1;c>=10;c/=10,n++);l!=n&&(e.e++,a[0]==H&&(a[0]=1));break}else{if(a[u]+=n,a[u]!=H)break;a[u--]=0,n=1}for(l=a.length;a[--l]===0;a.pop());}e.e>z?e.c=e.e=null:e.e<Q&&(e.c=[e.e=0])}return e}function V(e){var r,i=e.e;return i===null?e.toString():(r=q(e.c),r=i<=C||i>=k?ne(r,i):W(r,i,"0"),e.s<0?"-"+r:r)}return g.absoluteValue=g.abs=function(){var e=new h(this);return e.s<0&&(e.s=1),e},g.comparedTo=function(e,r){return j(this,new h(e,r))},g.decimalPlaces=g.dp=function(e,r){var i,s,t,l=this;if(e!=null)return x(e,0,P),r==null?r=S:x(r,0,8),G(new h(l),e+l.e+1,r);if(!(i=l.c))return null;if(s=((t=i.length-1)-$(this.e/E))*E,t=i[t])for(;t%10==0;t/=10,s--);return s<0&&(s=0),s},g.dividedBy=g.div=function(e,r){return N(this,new h(e,r),_,S)},g.dividedToIntegerBy=g.idiv=function(e,r){return N(this,new h(e,r),0,1)},g.exponentiatedBy=g.pow=function(e,r){var i,s,t,l,c,n,f,u,o,a=this;if(e=new h(e),e.c&&!e.isInteger())throw Error(U+"Exponent not an integer: "+V(e));if(r!=null&&(r=new h(r)),n=e.e>14,!a.c||!a.c[0]||a.c[0]==1&&!a.e&&a.c.length==1||!e.c||!e.c[0])return o=new h(Math.pow(+V(a),n?e.s*(2-ie(e)):+V(e))),r?o.mod(r):o;if(f=e.s<0,r){if(r.c?!r.c[0]:!r.s)return new h(NaN);s=!f&&a.isInteger()&&r.isInteger(),s&&(a=a.mod(r))}else{if(e.e>9&&(a.e>0||a.e<-1||(a.e==0?a.c[0]>1||n&&a.c[1]>=24e7:a.c[0]<8e13||n&&a.c[0]<=9999975e7)))return l=a.s<0&&ie(e)?-0:0,a.e>-1&&(l=1/l),new h(f?1/l:l);Y&&(l=ce(Y/E+2))}for(n?(i=new h(.5),f&&(e.s=1),u=ie(e)):(t=Math.abs(+V(e)),u=t%2),o=new h(I);;){if(u){if(o=o.times(a),!o.c)break;l?o.c.length>l&&(o.c.length=l):s&&(o=o.mod(r))}if(t){if(t=y(t/2),t===0)break;u=t%2}else if(e=e.times(i),G(e,e.e+1,1),e.e>14)u=ie(e);else{if(t=+V(e),t===0)break;u=t%2}a=a.times(a),l?a.c&&a.c.length>l&&(a.c.length=l):s&&(a=a.mod(r))}return s?o:(f&&(o=I.div(o)),r?o.mod(r):l?G(o,Y,S,c):o)},g.integerValue=function(e){var r=new h(this);return e==null?e=S:x(e,0,8),G(r,r.e+1,e)},g.isEqualTo=g.eq=function(e,r){return j(this,new h(e,r))===0},g.isFinite=function(){return!!this.c},g.isGreaterThan=g.gt=function(e,r){return j(this,new h(e,r))>0},g.isGreaterThanOrEqualTo=g.gte=function(e,r){return(r=j(this,new h(e,r)))===1||r===0},g.isInteger=function(){return!!this.c&&$(this.e/E)>this.c.length-2},g.isLessThan=g.lt=function(e,r){return j(this,new h(e,r))<0},g.isLessThanOrEqualTo=g.lte=function(e,r){return(r=j(this,new h(e,r)))===-1||r===0},g.isNaN=function(){return!this.s},g.isNegative=function(){return this.s<0},g.isPositive=function(){return this.s>0},g.isZero=function(){return!!this.c&&this.c[0]==0},g.minus=function(e,r){var i,s,t,l,c=this,n=c.s;if(e=new h(e,r),r=e.s,!n||!r)return new h(NaN);if(n!=r)return e.s=-r,c.plus(e);var f=c.e/E,u=e.e/E,o=c.c,a=e.c;if(!f||!u){if(!o||!a)return o?(e.s=-r,e):new h(a?c:NaN);if(!o[0]||!a[0])return a[0]?(e.s=-r,e):new h(o[0]?c:S==3?-0:0)}if(f=$(f),u=$(u),o=o.slice(),n=f-u){for((l=n<0)?(n=-n,t=o):(u=f,t=a),t.reverse(),r=n;r--;t.push(0));t.reverse()}else for(s=(l=(n=o.length)<(r=a.length))?n:r,n=r=0;r<s;r++)if(o[r]!=a[r]){l=o[r]<a[r];break}if(l&&(t=o,o=a,a=t,e.s=-e.s),r=(s=a.length)-(i=o.length),r>0)for(;r--;o[i++]=0);for(r=H-1;s>n;){if(o[--s]<a[s]){for(i=s;i&&!o[--i];o[i]=r);--o[i],o[s]+=H}o[s]-=a[s]}for(;o[0]==0;o.splice(0,1),--u);return o[0]?oe(e,o,u):(e.s=S==3?-1:1,e.c=[e.e=0],e)},g.modulo=g.mod=function(e,r){var i,s,t=this;return e=new h(e,r),!t.c||!e.s||e.c&&!e.c[0]?new h(NaN):!e.c||t.c&&!t.c[0]?new h(t):(b==9?(s=e.s,e.s=1,i=N(t,e,0,3),e.s=s,i.s*=s):i=N(t,e,0,b),e=t.minus(i.times(e)),!e.c[0]&&b==1&&(e.s=t.s),e)},g.multipliedBy=g.times=function(e,r){var i,s,t,l,c,n,f,u,o,a,p,w,d,B,R,m=this,A=m.c,D=(e=new h(e,r)).c;if(!A||!D||!A[0]||!D[0])return!m.s||!e.s||A&&!A[0]&&!D||D&&!D[0]&&!A?e.c=e.e=e.s=null:(e.s*=m.s,!A||!D?e.c=e.e=null:(e.c=[0],e.e=0)),e;for(s=$(m.e/E)+$(e.e/E),e.s*=m.s,f=A.length,a=D.length,f<a&&(d=A,A=D,D=d,t=f,f=a,a=t),t=f+a,d=[];t--;d.push(0));for(B=H,R=J,t=a;--t>=0;){for(i=0,p=D[t]%R,w=D[t]/R|0,c=f,l=t+c;l>t;)u=A[--c]%R,o=A[c]/R|0,n=w*u+o*p,u=p*u+n%R*R+d[l]+i,i=(u/B|0)+(n/R|0)+w*o,d[l--]=u%B;d[l]=i}return i?++s:d.splice(0,1),oe(e,d,s)},g.negated=function(){var e=new h(this);return e.s=-e.s||null,e},g.plus=function(e,r){var i,s=this,t=s.s;if(e=new h(e,r),r=e.s,!t||!r)return new h(NaN);if(t!=r)return e.s=-r,s.minus(e);var l=s.e/E,c=e.e/E,n=s.c,f=e.c;if(!l||!c){if(!n||!f)return new h(t/0);if(!n[0]||!f[0])return f[0]?e:new h(n[0]?s:t*0)}if(l=$(l),c=$(c),n=n.slice(),t=l-c){for(t>0?(c=l,i=f):(t=-t,i=n),i.reverse();t--;i.push(0));i.reverse()}for(t=n.length,r=f.length,t-r<0&&(i=f,f=n,n=i,r=t),t=0;r;)t=(n[--r]=n[r]+f[r]+t)/H|0,n[r]=H===n[r]?0:n[r]%H;return t&&(n=[t].concat(n),++c),oe(e,n,c)},g.precision=g.sd=function(e,r){var i,s,t,l=this;if(e!=null&&e!==!!e)return x(e,1,P),r==null?r=S:x(r,0,8),G(new h(l),e,r);if(!(i=l.c))return null;if(t=i.length-1,s=t*E+1,t=i[t]){for(;t%10==0;t/=10,s--);for(t=i[0];t>=10;t/=10,s++);}return e&&l.e+1>s&&(s=l.e+1),s},g.shiftedBy=function(e){return x(e,-ae,ae),this.times("1e"+e)},g.squareRoot=g.sqrt=function(){var e,r,i,s,t,l=this,c=l.c,n=l.s,f=l.e,u=_+4,o=new h("0.5");if(n!==1||!c||!c[0])return new h(!n||n<0&&(!c||c[0])?NaN:c?l:1/0);if(n=Math.sqrt(+V(l)),n==0||n==1/0?(r=q(c),(r.length+f)%2==0&&(r+="0"),n=Math.sqrt(+r),f=$((f+1)/2)-(f<0||f%2),n==1/0?r="5e"+f:(r=n.toExponential(),r=r.slice(0,r.indexOf("e")+1)+f),i=new h(r)):i=new h(n+""),i.c[0]){for(f=i.e,n=f+u,n<3&&(n=0);;)if(t=i,i=o.times(t.plus(N(l,t,u,1))),q(t.c).slice(0,n)===(r=q(i.c)).slice(0,n))if(i.e<f&&--n,r=r.slice(n-3,n+1),r=="9999"||!s&&r=="4999"){if(!s&&(G(t,t.e+_+2,0),t.times(t).eq(l))){i=t;break}u+=4,n+=4,s=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(G(i,i.e+_+2,1),e=!i.times(i).eq(l));break}}return G(i,i.e+_+1,S,e)},g.toExponential=function(e,r){return e!=null&&(x(e,0,P),e++),le(this,e,r,1)},g.toFixed=function(e,r){return e!=null&&(x(e,0,P),e=e+this.e+1),le(this,e,r)},g.toFormat=function(e,r,i){var s,t=this;if(i==null)e!=null&&r&&typeof r=="object"?(i=r,r=null):e&&typeof e=="object"?(i=e,e=r=null):i=te;else if(typeof i!="object")throw Error(U+"Argument not an object: "+i);if(s=t.toFixed(e,r),t.c){var l,c=s.split("."),n=+i.groupSize,f=+i.secondaryGroupSize,u=i.groupSeparator||"",o=c[0],a=c[1],p=t.s<0,w=p?o.slice(1):o,d=w.length;if(f&&(l=n,n=f,f=l,d-=l),n>0&&d>0){for(l=d%n||n,o=w.substr(0,l);l<d;l+=n)o+=u+w.substr(l,n);f>0&&(o+=u+w.slice(l)),p&&(o="-"+o)}s=a?o+(i.decimalSeparator||"")+((f=+i.fractionGroupSize)?a.replace(new RegExp("\\d{"+f+"}\\B","g"),"$&"+(i.fractionGroupSeparator||"")):a):o}return(i.prefix||"")+s+(i.suffix||"")},g.toFraction=function(e){var r,i,s,t,l,c,n,f,u,o,a,p,w=this,d=w.c;if(e!=null&&(n=new h(e),!n.isInteger()&&(n.c||n.s!==1)||n.lt(I)))throw Error(U+"Argument "+(n.isInteger()?"out of range: ":"not an integer: ")+V(n));if(!d)return new h(w);for(r=new h(I),u=i=new h(I),s=f=new h(I),p=q(d),l=r.e=p.length-w.e-1,r.c[0]=he[(c=l%E)<0?E+c:c],e=!e||n.comparedTo(r)>0?l>0?r:u:n,c=z,z=1/0,n=new h(p),f.c[0]=0;o=N(n,r,0,1),t=i.plus(o.times(s)),t.comparedTo(e)!=1;)i=s,s=t,u=f.plus(o.times(t=u)),f=t,r=n.minus(o.times(t=r)),n=t;return t=N(e.minus(i),s,0,1),f=f.plus(t.times(u)),i=i.plus(t.times(s)),f.s=u.s=w.s,l=l*2,a=N(u,s,l,S).minus(w).abs().comparedTo(N(f,i,l,S).minus(w).abs())<1?[u,s]:[f,i],z=c,a},g.toNumber=function(){return+V(this)},g.toPrecision=function(e,r){return e!=null&&x(e,1,P),le(this,e,r,2)},g.toString=function(e){var r,i=this,s=i.s,t=i.e;return t===null?s?(r="Infinity",s<0&&(r="-"+r)):r="NaN":(e==null?r=t<=C||t>=k?ne(q(i.c),t):W(q(i.c),t,"0"):e===10&&fe?(i=G(new h(i),_+t+1,S),r=W(q(i.c),i.e,"0")):(x(e,2,K.length,"Base"),r=v(W(q(i.c),t,"0"),10,e,s,!0)),s<0&&i.c[0]&&(r="-"+r)),r},g.valueOf=g.toJSON=function(){return V(this)},g._isBigNumber=!0,g[Symbol.toStringTag]="BigNumber",g[Symbol.for("nodejs.util.inspect.custom")]=g.valueOf,O!=null&&h.set(O),h}function $(O){var N=O|0;return O>0||O===N?N:N-1}function q(O){for(var N,v,T=1,g=O.length,I=O[0]+"";T<g;){for(N=O[T++]+"",v=E-N.length;v--;N="0"+N);I+=N}for(g=I.length;I.charCodeAt(--g)===48;);return I.slice(0,g+1||1)}function j(O,N){var v,T,g=O.c,I=N.c,_=O.s,S=N.s,C=O.e,k=N.e;if(!_||!S)return null;if(v=g&&!g[0],T=I&&!I[0],v||T)return v?T?0:-S:_;if(_!=S)return _;if(v=_<0,T=C==k,!g||!I)return T?0:!g^v?1:-1;if(!T)return C>k^v?1:-1;for(S=(C=g.length)<(k=I.length)?C:k,_=0;_<S;_++)if(g[_]!=I[_])return g[_]>I[_]^v?1:-1;return C==k?0:C>k^v?1:-1}function x(O,N,v,T){if(O<N||O>v||O!==y(O))throw Error(U+(T||"Argument")+(typeof O=="number"?O<N||O>v?" out of range: ":" not an integer: ":" not a primitive number: ")+String(O))}function ie(O){var N=O.c.length-1;return $(O.e/E)==N&&O.c[N]%2!=0}function ne(O,N){return(O.length>1?O.charAt(0)+"."+O.slice(1):O)+(N<0?"e":"e+")+N}function W(O,N,v){var T,g;if(N<0){for(g=v+".";++N;g+=v);O=g+O}else if(T=O.length,++N>T){for(g=v,N-=T;--N;g+=v);O+=g}else N<T&&(O=O.slice(0,N)+"."+O.slice(N));return O}var Ne=we();exports.BigNumber=Ne;exports.default=Ne;
|
|
@@ -143,7 +143,7 @@ function we(O) {
|
|
|
143
143
|
return ge(arguments, -1);
|
|
144
144
|
}, h.minimum = h.min = function() {
|
|
145
145
|
return ge(arguments, 1);
|
|
146
|
-
}, h.random = function() {
|
|
146
|
+
}, h.random = (function() {
|
|
147
147
|
var e = 9007199254740992, r = Math.random() * e & 2097151 ? function() {
|
|
148
148
|
return y(Math.random() * e);
|
|
149
149
|
} : function() {
|
|
@@ -175,10 +175,10 @@ function we(O) {
|
|
|
175
175
|
}
|
|
176
176
|
return o.e = l, o.c = u, o;
|
|
177
177
|
};
|
|
178
|
-
}(), h.sum = function() {
|
|
178
|
+
})(), h.sum = function() {
|
|
179
179
|
for (var e = 1, r = arguments, i = new h(r[0]); e < r.length; ) i = i.plus(r[e++]);
|
|
180
180
|
return i;
|
|
181
|
-
}, _ = /* @__PURE__ */ function() {
|
|
181
|
+
}, _ = /* @__PURE__ */ (function() {
|
|
182
182
|
var e = "0123456789";
|
|
183
183
|
function r(i, s, t, l) {
|
|
184
184
|
for (var c, n = [0], f, u = 0, o = i.length; u < o; ) {
|
|
@@ -209,7 +209,7 @@ function we(O) {
|
|
|
209
209
|
}
|
|
210
210
|
return i;
|
|
211
211
|
};
|
|
212
|
-
}(), E = /* @__PURE__ */ function() {
|
|
212
|
+
})(), E = /* @__PURE__ */ (function() {
|
|
213
213
|
function e(s, t, l) {
|
|
214
214
|
var c, n, f, u, o = 0, a = s.length, p = t % J, w = t / J | 0;
|
|
215
215
|
for (s = s.slice(); a--; )
|
|
@@ -271,7 +271,7 @@ function we(O) {
|
|
|
271
271
|
B.e = u, B.r = +a;
|
|
272
272
|
return B;
|
|
273
273
|
};
|
|
274
|
-
}();
|
|
274
|
+
})();
|
|
275
275
|
function le(e, r, i, s) {
|
|
276
276
|
var t, l, c, n, f;
|
|
277
277
|
if (i == null ? i = S : v(i, 0, 8), !e.c) return e.toString();
|
|
@@ -296,7 +296,7 @@ function we(O) {
|
|
|
296
296
|
for (t = r[0]; t >= 10; t /= 10, s++) ;
|
|
297
297
|
return (i = s + i * N - 1) > z ? e.c = e.e = null : i < Q ? e.c = [e.e = 0] : (e.e = i, e.c = r), e;
|
|
298
298
|
}
|
|
299
|
-
R = /* @__PURE__ */ function() {
|
|
299
|
+
R = /* @__PURE__ */ (function() {
|
|
300
300
|
var e = /^(-?)0([xbo])(?=\w[\w.]*$)/i, r = /^([^.]+)\.$/, i = /^\.([^.]+)$/, s = /^-?(Infinity|NaN)$/, t = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
|
|
301
301
|
return function(l, c, n, f) {
|
|
302
302
|
var u, o = n ? c : c.replace(t, "");
|
|
@@ -313,7 +313,7 @@ function we(O) {
|
|
|
313
313
|
}
|
|
314
314
|
l.c = l.e = null;
|
|
315
315
|
};
|
|
316
|
-
}();
|
|
316
|
+
})();
|
|
317
317
|
function G(e, r, i, s) {
|
|
318
318
|
var t, l, c, n, f, u, o, a = e.c, p = he;
|
|
319
319
|
if (a) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./_coreJsData.cjs");var r=function(){var e=/[^.]+$/.exec(t.default&&t.default.keys&&t.default.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function u(e){return!!r&&r in e}exports.default=u;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("./_coreJsData.cjs");var r=(function(){var e=/[^.]+$/.exec(t.default&&t.default.keys&&t.default.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function u(e){return!!r&&r in e}exports.default=u;
|