-
Notifications
You must be signed in to change notification settings - Fork 5
/
long.min.js
224 lines (224 loc) · 13.4 KB
/
long.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
! function o(s, h, u) {
function f(r, t) {
if (!h[r]) {
if (!s[r]) {
var i = "function" == typeof require && require;
if (!t && i) return i(r, !0);
if (g) return g(r, !0);
var n = new Error("Cannot find module '" + r + "'");
throw n.code = "MODULE_NOT_FOUND", n
}
var e = h[r] = {
exports: {}
};
s[r][0].call(e.exports, function(t) {
var i = s[r][1][t];
return f(i || t)
}, e, e.exports, o, s, h, u)
}
return h[r].exports
}
for (var g = "function" == typeof require && require, t = 0; t < u.length; t++) f(u[t]);
return f
}({
1: [function(i, h, u) {
! function(t) {
"use strict";
var p = function(t, i, r) {
this.low = 0 | t, this.high = 0 | i, this.unsigned = !!r
};
p.isLong = function(t) {
return !0 === (t && t instanceof p)
};
var e = {},
o = {};
p.fromInt = function(t, i) {
var r, n;
return i ? 0 <= (t >>>= 0) && t < 256 && (n = o[t]) ? n : (r = new p(t, (0 | t) < 0 ? -1 : 0, !0), 0 <= t && t < 256 && (o[t] = r), r) : -128 <= (t |= 0) && t < 128 && (n = e[t]) ? n : (r = new p(t, t < 0 ? -1 : 0, !1), -128 <= t && t < 128 && (e[t] = r), r)
}, p.fromNumber = function(t, i) {
return i = !!i, isNaN(t) || !isFinite(t) ? p.ZERO : !i && t <= -s ? p.MIN_VALUE : !i && s <= t + 1 ? p.MAX_VALUE : i && n <= t ? p.MAX_UNSIGNED_VALUE : t < 0 ? p.fromNumber(-t, i).negate() : new p(t % r | 0, t / r | 0, i)
}, p.fromBits = function(t, i, r) {
return new p(t, i, r)
}, p.fromString = function(t, i, r) {
if (0 === t.length) throw Error("number format error: empty string");
if ("NaN" === t || "Infinity" === t || "+Infinity" === t || "-Infinity" === t) return p.ZERO;
if ("number" == typeof i && (r = i, i = !1), (r = r || 10) < 2 || 36 < r) throw Error("radix out of range: " + r);
var n;
if (0 < (n = t.indexOf("-"))) throw Error('number format error: interior "-" character: ' + t);
if (0 === n) return p.fromString(t.substring(1), i, r).negate();
for (var e = p.fromNumber(Math.pow(r, 8)), o = p.ZERO, s = 0; s < t.length; s += 8) {
var h = Math.min(8, t.length - s),
u = parseInt(t.substring(s, s + h), r);
if (h < 8) {
var f = p.fromNumber(Math.pow(r, h));
o = o.multiply(f).add(p.fromNumber(u))
} else o = (o = o.multiply(e)).add(p.fromNumber(u))
}
return o.unsigned = i, o
}, p.fromValue = function(t) {
return "number" == typeof t ? p.fromNumber(t) : "string" == typeof t ? p.fromString(t) : p.isLong(t) ? t : new p(t.low, t.high, t.unsigned)
};
var r = 4294967296,
n = r * r,
s = n / 2,
m = p.fromInt(1 << 24);
p.ZERO = p.fromInt(0), p.UZERO = p.fromInt(0, !0), p.ONE = p.fromInt(1), p.UONE = p.fromInt(1, !0), p.NEG_ONE = p.fromInt(-1), p.MAX_VALUE = p.fromBits(-1, 2147483647, !1), p.MAX_UNSIGNED_VALUE = p.fromBits(-1, -1, !0), p.MIN_VALUE = p.fromBits(0, -2147483648, !1), p.prototype.toInt = function() {
return this.unsigned ? this.low >>> 0 : this.low
}, p.prototype.toNumber = function() {
return this.unsigned ? (this.high >>> 0) * r + (this.low >>> 0) : this.high * r + (this.low >>> 0)
}, p.prototype.toString = function(t) {
if ((t = t || 10) < 2 || 36 < t) throw RangeError("radix out of range: " + t);
if (this.isZero()) return "0";
var i;
if (this.isNegative()) {
if (this.equals(p.MIN_VALUE)) {
var r = p.fromNumber(t),
n = this.div(r);
return i = n.multiply(r).subtract(this), n.toString(t) + i.toInt().toString(t)
}
return "-" + this.negate().toString(t)
}
var e = p.fromNumber(Math.pow(t, 6), this.unsigned);
i = this;
for (var o = "";;) {
var s = i.div(e),
h = (i.subtract(s.multiply(e)).toInt() >>> 0).toString(t);
if ((i = s).isZero()) return h + o;
for (; h.length < 6;) h = "0" + h;
o = "" + h + o
}
}, p.prototype.getHighBits = function() {
return this.high
}, p.prototype.getHighBitsUnsigned = function() {
return this.high >>> 0
}, p.prototype.getLowBits = function() {
return this.low
}, p.prototype.getLowBitsUnsigned = function() {
return this.low >>> 0
}, p.prototype.getNumBitsAbs = function() {
if (this.isNegative()) return this.equals(p.MIN_VALUE) ? 64 : this.negate().getNumBitsAbs();
for (var t = 0 != this.high ? this.high : this.low, i = 31; 0 < i && 0 == (t & 1 << i); i--);
return 0 != this.high ? i + 33 : i + 1
}, p.prototype.isZero = function() {
return 0 === this.high && 0 === this.low
}, p.prototype.isNegative = function() {
return !this.unsigned && this.high < 0
}, p.prototype.isPositive = function() {
return this.unsigned || 0 <= this.high
}, p.prototype.isOdd = function() {
return 1 == (1 & this.low)
}, p.prototype.isEven = function() {
return 0 == (1 & this.low)
}, p.prototype.equals = function(t) {
return p.isLong(t) || (t = p.fromValue(t)), (this.unsigned === t.unsigned || this.high >>> 31 != 1 || t.high >>> 31 != 1) && (this.high === t.high && this.low === t.low)
}, p.prototype.notEquals = function(t) {
return p.isLong(t) || (t = p.fromValue(t)), !this.equals(t)
}, p.prototype.lessThan = function(t) {
return p.isLong(t) || (t = p.fromValue(t)), this.compare(t) < 0
}, p.prototype.lessThanOrEqual = function(t) {
return p.isLong(t) || (t = p.fromValue(t)), this.compare(t) <= 0
}, p.prototype.greaterThan = function(t) {
return p.isLong(t) || (t = p.fromValue(t)), 0 < this.compare(t)
}, p.prototype.greaterThanOrEqual = function(t) {
return 0 <= this.compare(t)
}, p.prototype.compare = function(t) {
if (this.equals(t)) return 0;
var i = this.isNegative(),
r = t.isNegative();
return i && !r ? -1 : !i && r ? 1 : this.unsigned ? t.high >>> 0 > this.high >>> 0 || t.high === this.high && t.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.subtract(t).isNegative() ? -1 : 1
}, p.prototype.negate = function() {
return !this.unsigned && this.equals(p.MIN_VALUE) ? p.MIN_VALUE : this.not().add(p.ONE)
}, p.prototype.add = function(t) {
p.isLong(t) || (t = p.fromValue(t));
var i = this.high >>> 16,
r = 65535 & this.high,
n = this.low >>> 16,
e = 65535 & this.low,
o = t.high >>> 16,
s = 65535 & t.high,
h = t.low >>> 16,
u = 0,
f = 0,
g = 0,
a = 0;
return g += (a += e + (65535 & t.low)) >>> 16, f += (g += n + h) >>> 16, u += (f += r + s) >>> 16, u += i + o, p.fromBits((g &= 65535) << 16 | (a &= 65535), (u &= 65535) << 16 | (f &= 65535), this.unsigned)
}, p.prototype.subtract = function(t) {
return p.isLong(t) || (t = p.fromValue(t)), this.add(t.negate())
}, p.prototype.multiply = function(t) {
if (this.isZero()) return p.ZERO;
if (p.isLong(t) || (t = p.fromValue(t)), t.isZero()) return p.ZERO;
if (this.equals(p.MIN_VALUE)) return t.isOdd() ? p.MIN_VALUE : p.ZERO;
if (t.equals(p.MIN_VALUE)) return this.isOdd() ? p.MIN_VALUE : p.ZERO;
if (this.isNegative()) return t.isNegative() ? this.negate().multiply(t.negate()) : this.negate().multiply(t).negate();
if (t.isNegative()) return this.multiply(t.negate()).negate();
if (this.lessThan(m) && t.lessThan(m)) return p.fromNumber(this.toNumber() * t.toNumber(), this.unsigned);
var i = this.high >>> 16,
r = 65535 & this.high,
n = this.low >>> 16,
e = 65535 & this.low,
o = t.high >>> 16,
s = 65535 & t.high,
h = t.low >>> 16,
u = 65535 & t.low,
f = 0,
g = 0,
a = 0,
l = 0;
return a += (l += e * u) >>> 16, g += (a += n * u) >>> 16, a &= 65535, g += (a += e * h) >>> 16, f += (g += r * u) >>> 16, g &= 65535, f += (g += n * h) >>> 16, g &= 65535, f += (g += e * s) >>> 16, f += i * u + r * h + n * s + e * o, p.fromBits((a &= 65535) << 16 | (l &= 65535), (f &= 65535) << 16 | (g &= 65535), this.unsigned)
}, p.prototype.div = function(t) {
if (p.isLong(t) || (t = p.fromValue(t)), t.isZero()) throw new Error("division by zero");
if (this.isZero()) return this.unsigned ? p.UZERO : p.ZERO;
var i, r, n; {
if (this.equals(p.MIN_VALUE)) return t.equals(p.ONE) || t.equals(p.NEG_ONE) ? p.MIN_VALUE : t.equals(p.MIN_VALUE) ? p.ONE : (i = this.shiftRight(1).div(t).shiftLeft(1)).equals(p.ZERO) ? t.isNegative() ? p.ONE : p.NEG_ONE : (r = this.subtract(t.multiply(i)), n = i.add(r.div(t)));
if (t.equals(p.MIN_VALUE)) return this.unsigned ? p.UZERO : p.ZERO
}
if (this.isNegative()) return t.isNegative() ? this.negate().div(t.negate()) : this.negate().div(t).negate();
if (t.isNegative()) return this.div(t.negate()).negate();
for (n = p.ZERO, r = this; r.greaterThanOrEqual(t);) {
i = Math.max(1, Math.floor(r.toNumber() / t.toNumber()));
for (var e = Math.ceil(Math.log(i) / Math.LN2), o = e <= 48 ? 1 : Math.pow(2, e - 48), s = p.fromNumber(i), h = s.multiply(t); h.isNegative() || h.greaterThan(r);) h = (s = p.fromNumber(i -= o, this.unsigned)).multiply(t);
s.isZero() && (s = p.ONE), n = n.add(s), r = r.subtract(h)
}
return n
}, p.prototype.modulo = function(t) {
return p.isLong(t) || (t = p.fromValue(t)), this.subtract(this.div(t).multiply(t))
}, p.prototype.not = function() {
return p.fromBits(~this.low, ~this.high, this.unsigned)
}, p.prototype.and = function(t) {
return p.isLong(t) || (t = p.fromValue(t)), p.fromBits(this.low & t.low, this.high & t.high, this.unsigned)
}, p.prototype.or = function(t) {
return p.isLong(t) || (t = p.fromValue(t)), p.fromBits(this.low | t.low, this.high | t.high, this.unsigned)
}, p.prototype.xor = function(t) {
return p.isLong(t) || (t = p.fromValue(t)), p.fromBits(this.low ^ t.low, this.high ^ t.high, this.unsigned)
}, p.prototype.shiftLeft = function(t) {
return p.isLong(t) && (t = t.toInt()), 0 == (t &= 63) ? this : t < 32 ? p.fromBits(this.low << t, this.high << t | this.low >>> 32 - t, this.unsigned) : p.fromBits(0, this.low << t - 32, this.unsigned)
}, p.prototype.shiftRight = function(t) {
return p.isLong(t) && (t = t.toInt()), 0 == (t &= 63) ? this : t < 32 ? p.fromBits(this.low >>> t | this.high << 32 - t, this.high >> t, this.unsigned) : p.fromBits(this.high >> t - 32, 0 <= this.high ? 0 : -1, this.unsigned)
}, p.prototype.shiftRightUnsigned = function(t) {
if (p.isLong(t) && (t = t.toInt()), 0 === (t &= 63)) return this;
var i = this.high;
if (t < 32) {
var r = this.low;
return p.fromBits(r >>> t | i << 32 - t, i >>> t, this.unsigned)
}
return p.fromBits(32 === t ? i : i >>> t - 32, 0, this.unsigned)
}, p.prototype.toSigned = function() {
return this.unsigned ? new p(this.low, this.high, !1) : this
}, p.prototype.toUnsigned = function() {
return this.unsigned ? this : new p(this.low, this.high, !0)
}, "function" == typeof i && "object" == typeof h && h && "object" == typeof u && u ? h.exports = p : "function" == typeof define && define.amd ? define(function() {
return p
}) : (t.dcodeIO = t.dcodeIO || {}).Long = p
}(this)
}, {}],
2: [function(t, i, r) {
i.exports = t("./dist/Long.js")
}, {
"./dist/Long.js": 1
}],
3: [function(t, i, r) {
window.Long = t("long")
}, {
long: 2
}]
}, {}, [3]);