@fedify/sqlite 2.0.0-pr.433.1601 → 2.0.0-pr.434.1659

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.
@@ -1,1139 +0,0 @@
1
-
2
-
3
-
4
- import { Temporal } from "@js-temporal/polyfill";
5
-
6
- import { __commonJS } from "../../../../../../_virtual/rolldown_runtime.js";
7
-
8
- //#region ../../node_modules/.pnpm/jsbi@4.3.2/node_modules/jsbi/dist/jsbi-cjs.js
9
- var require_jsbi_cjs = __commonJS({ "../../node_modules/.pnpm/jsbi@4.3.2/node_modules/jsbi/dist/jsbi-cjs.js"(exports, module) {
10
- var JSBI = class JSBI extends Array {
11
- constructor(i, _) {
12
- if (super(i), this.sign = _, Object.setPrototypeOf(this, JSBI.prototype), i > JSBI.__kMaxLength) throw new RangeError("Maximum BigInt size exceeded");
13
- }
14
- static BigInt(i) {
15
- var _ = Math.floor, t = Number.isFinite;
16
- if ("number" == typeof i) {
17
- if (0 === i) return JSBI.__zero();
18
- if (JSBI.__isOneDigitInt(i)) return 0 > i ? JSBI.__oneDigit(-i, !0) : JSBI.__oneDigit(i, !1);
19
- if (!t(i) || _(i) !== i) throw new RangeError("The number " + i + " cannot be converted to BigInt because it is not an integer");
20
- return JSBI.__fromDouble(i);
21
- }
22
- if ("string" == typeof i) {
23
- const _$1 = JSBI.__fromString(i);
24
- if (null === _$1) throw new SyntaxError("Cannot convert " + i + " to a BigInt");
25
- return _$1;
26
- }
27
- if ("boolean" == typeof i) return !0 === i ? JSBI.__oneDigit(1, !1) : JSBI.__zero();
28
- if ("object" == typeof i) {
29
- if (i.constructor === JSBI) return i;
30
- const _$1 = JSBI.__toPrimitive(i);
31
- return JSBI.BigInt(_$1);
32
- }
33
- throw new TypeError("Cannot convert " + i + " to a BigInt");
34
- }
35
- toDebugString() {
36
- const i = ["BigInt["];
37
- for (const _ of this) i.push((_ ? (_ >>> 0).toString(16) : _) + ", ");
38
- return i.push("]"), i.join("");
39
- }
40
- toString(i = 10) {
41
- if (2 > i || 36 < i) throw new RangeError("toString() radix argument must be between 2 and 36");
42
- return 0 === this.length ? "0" : 0 == (i & i - 1) ? JSBI.__toStringBasePowerOfTwo(this, i) : JSBI.__toStringGeneric(this, i, !1);
43
- }
44
- valueOf() {
45
- throw new Error("Convert JSBI instances to native numbers using `toNumber`.");
46
- }
47
- static toNumber(i) {
48
- const _ = i.length;
49
- if (0 === _) return 0;
50
- if (1 === _) {
51
- const _$1 = i.__unsignedDigit(0);
52
- return i.sign ? -_$1 : _$1;
53
- }
54
- const t = i.__digit(_ - 1), e = JSBI.__clz30(t), n = 30 * _ - e;
55
- if (1024 < n) return i.sign ? -Infinity : Infinity;
56
- let g = n - 1, o = t, s = _ - 1;
57
- const l = e + 3;
58
- let r = 32 === l ? 0 : o << l;
59
- r >>>= 12;
60
- const a = l - 12;
61
- let u = 12 <= l ? 0 : o << 20 + l, d = 20 + l;
62
- for (0 < a && 0 < s && (s--, o = i.__digit(s), r |= o >>> 30 - a, u = o << a + 2, d = a + 2); 0 < d && 0 < s;) s--, o = i.__digit(s), u |= 30 <= d ? o << d - 30 : o >>> 30 - d, d -= 30;
63
- const h = JSBI.__decideRounding(i, d, s, o);
64
- if ((1 === h || 0 === h && 1 == (1 & u)) && (u = u + 1 >>> 0, 0 === u && (r++, 0 != r >>> 20 && (r = 0, g++, 1023 < g)))) return i.sign ? -Infinity : Infinity;
65
- const m = i.sign ? -2147483648 : 0;
66
- return g = g + 1023 << 20, JSBI.__kBitConversionInts[JSBI.__kBitConversionIntHigh] = m | g | r, JSBI.__kBitConversionInts[JSBI.__kBitConversionIntLow] = u, JSBI.__kBitConversionDouble[0];
67
- }
68
- static unaryMinus(i) {
69
- if (0 === i.length) return i;
70
- const _ = i.__copy();
71
- return _.sign = !i.sign, _;
72
- }
73
- static bitwiseNot(i) {
74
- return i.sign ? JSBI.__absoluteSubOne(i).__trim() : JSBI.__absoluteAddOne(i, !0);
75
- }
76
- static exponentiate(i, _) {
77
- if (_.sign) throw new RangeError("Exponent must be positive");
78
- if (0 === _.length) return JSBI.__oneDigit(1, !1);
79
- if (0 === i.length) return i;
80
- if (1 === i.length && 1 === i.__digit(0)) return i.sign && 0 == (1 & _.__digit(0)) ? JSBI.unaryMinus(i) : i;
81
- if (1 < _.length) throw new RangeError("BigInt too big");
82
- let t = _.__unsignedDigit(0);
83
- if (1 === t) return i;
84
- if (t >= JSBI.__kMaxLengthBits) throw new RangeError("BigInt too big");
85
- if (1 === i.length && 2 === i.__digit(0)) {
86
- const _$1 = 1 + (0 | t / 30), e$1 = i.sign && 0 != (1 & t), n$1 = new JSBI(_$1, e$1);
87
- n$1.__initializeDigits();
88
- const g = 1 << t % 30;
89
- return n$1.__setDigit(_$1 - 1, g), n$1;
90
- }
91
- let e = null, n = i;
92
- for (0 != (1 & t) && (e = i), t >>= 1; 0 !== t; t >>= 1) n = JSBI.multiply(n, n), 0 != (1 & t) && (null === e ? e = n : e = JSBI.multiply(e, n));
93
- return e;
94
- }
95
- static multiply(_, t) {
96
- if (0 === _.length) return _;
97
- if (0 === t.length) return t;
98
- let i = _.length + t.length;
99
- 30 <= _.__clzmsd() + t.__clzmsd() && i--;
100
- const e = new JSBI(i, _.sign !== t.sign);
101
- e.__initializeDigits();
102
- for (let n = 0; n < _.length; n++) JSBI.__multiplyAccumulate(t, _.__digit(n), e, n);
103
- return e.__trim();
104
- }
105
- static divide(i, _) {
106
- if (0 === _.length) throw new RangeError("Division by zero");
107
- if (0 > JSBI.__absoluteCompare(i, _)) return JSBI.__zero();
108
- const t = i.sign !== _.sign, e = _.__unsignedDigit(0);
109
- let n;
110
- if (1 === _.length && 32767 >= e) {
111
- if (1 === e) return t === i.sign ? i : JSBI.unaryMinus(i);
112
- n = JSBI.__absoluteDivSmall(i, e, null);
113
- } else n = JSBI.__absoluteDivLarge(i, _, !0, !1);
114
- return n.sign = t, n.__trim();
115
- }
116
- static remainder(i, _) {
117
- if (0 === _.length) throw new RangeError("Division by zero");
118
- if (0 > JSBI.__absoluteCompare(i, _)) return i;
119
- const t = _.__unsignedDigit(0);
120
- if (1 === _.length && 32767 >= t) {
121
- if (1 === t) return JSBI.__zero();
122
- const _$1 = JSBI.__absoluteModSmall(i, t);
123
- return 0 === _$1 ? JSBI.__zero() : JSBI.__oneDigit(_$1, i.sign);
124
- }
125
- const e = JSBI.__absoluteDivLarge(i, _, !1, !0);
126
- return e.sign = i.sign, e.__trim();
127
- }
128
- static add(i, _) {
129
- const t = i.sign;
130
- return t === _.sign ? JSBI.__absoluteAdd(i, _, t) : 0 <= JSBI.__absoluteCompare(i, _) ? JSBI.__absoluteSub(i, _, t) : JSBI.__absoluteSub(_, i, !t);
131
- }
132
- static subtract(i, _) {
133
- const t = i.sign;
134
- return t === _.sign ? 0 <= JSBI.__absoluteCompare(i, _) ? JSBI.__absoluteSub(i, _, t) : JSBI.__absoluteSub(_, i, !t) : JSBI.__absoluteAdd(i, _, t);
135
- }
136
- static leftShift(i, _) {
137
- return 0 === _.length || 0 === i.length ? i : _.sign ? JSBI.__rightShiftByAbsolute(i, _) : JSBI.__leftShiftByAbsolute(i, _);
138
- }
139
- static signedRightShift(i, _) {
140
- return 0 === _.length || 0 === i.length ? i : _.sign ? JSBI.__leftShiftByAbsolute(i, _) : JSBI.__rightShiftByAbsolute(i, _);
141
- }
142
- static unsignedRightShift() {
143
- throw new TypeError("BigInts have no unsigned right shift; use >> instead");
144
- }
145
- static lessThan(i, _) {
146
- return 0 > JSBI.__compareToBigInt(i, _);
147
- }
148
- static lessThanOrEqual(i, _) {
149
- return 0 >= JSBI.__compareToBigInt(i, _);
150
- }
151
- static greaterThan(i, _) {
152
- return 0 < JSBI.__compareToBigInt(i, _);
153
- }
154
- static greaterThanOrEqual(i, _) {
155
- return 0 <= JSBI.__compareToBigInt(i, _);
156
- }
157
- static equal(_, t) {
158
- if (_.sign !== t.sign) return !1;
159
- if (_.length !== t.length) return !1;
160
- for (let e = 0; e < _.length; e++) if (_.__digit(e) !== t.__digit(e)) return !1;
161
- return !0;
162
- }
163
- static notEqual(i, _) {
164
- return !JSBI.equal(i, _);
165
- }
166
- static bitwiseAnd(i, _) {
167
- var t = Math.max;
168
- if (!i.sign && !_.sign) return JSBI.__absoluteAnd(i, _).__trim();
169
- if (i.sign && _.sign) {
170
- const e = t(i.length, _.length) + 1;
171
- let n = JSBI.__absoluteSubOne(i, e);
172
- const g = JSBI.__absoluteSubOne(_);
173
- return n = JSBI.__absoluteOr(n, g, n), JSBI.__absoluteAddOne(n, !0, n).__trim();
174
- }
175
- return i.sign && ([i, _] = [_, i]), JSBI.__absoluteAndNot(i, JSBI.__absoluteSubOne(_)).__trim();
176
- }
177
- static bitwiseXor(i, _) {
178
- var t = Math.max;
179
- if (!i.sign && !_.sign) return JSBI.__absoluteXor(i, _).__trim();
180
- if (i.sign && _.sign) {
181
- const e$1 = t(i.length, _.length), n$1 = JSBI.__absoluteSubOne(i, e$1), g = JSBI.__absoluteSubOne(_);
182
- return JSBI.__absoluteXor(n$1, g, n$1).__trim();
183
- }
184
- const e = t(i.length, _.length) + 1;
185
- i.sign && ([i, _] = [_, i]);
186
- let n = JSBI.__absoluteSubOne(_, e);
187
- return n = JSBI.__absoluteXor(n, i, n), JSBI.__absoluteAddOne(n, !0, n).__trim();
188
- }
189
- static bitwiseOr(i, _) {
190
- var t = Math.max;
191
- const e = t(i.length, _.length);
192
- if (!i.sign && !_.sign) return JSBI.__absoluteOr(i, _).__trim();
193
- if (i.sign && _.sign) {
194
- let t$1 = JSBI.__absoluteSubOne(i, e);
195
- const n$1 = JSBI.__absoluteSubOne(_);
196
- return t$1 = JSBI.__absoluteAnd(t$1, n$1, t$1), JSBI.__absoluteAddOne(t$1, !0, t$1).__trim();
197
- }
198
- i.sign && ([i, _] = [_, i]);
199
- let n = JSBI.__absoluteSubOne(_, e);
200
- return n = JSBI.__absoluteAndNot(n, i, n), JSBI.__absoluteAddOne(n, !0, n).__trim();
201
- }
202
- static asIntN(_, t) {
203
- var i = Math.floor;
204
- if (0 === t.length) return t;
205
- if (_ = i(_), 0 > _) throw new RangeError("Invalid value: not (convertible to) a safe integer");
206
- if (0 === _) return JSBI.__zero();
207
- if (_ >= JSBI.__kMaxLengthBits) return t;
208
- const e = 0 | (_ + 29) / 30;
209
- if (t.length < e) return t;
210
- const g = t.__unsignedDigit(e - 1), o = 1 << (_ - 1) % 30;
211
- if (t.length === e && g < o) return t;
212
- if (!((g & o) === o)) return JSBI.__truncateToNBits(_, t);
213
- if (!t.sign) return JSBI.__truncateAndSubFromPowerOfTwo(_, t, !0);
214
- if (0 == (g & o - 1)) {
215
- for (let n = e - 2; 0 <= n; n--) if (0 !== t.__digit(n)) return JSBI.__truncateAndSubFromPowerOfTwo(_, t, !1);
216
- return t.length === e && g === o ? t : JSBI.__truncateToNBits(_, t);
217
- }
218
- return JSBI.__truncateAndSubFromPowerOfTwo(_, t, !1);
219
- }
220
- static asUintN(i, _) {
221
- var t = Math.floor;
222
- if (0 === _.length) return _;
223
- if (i = t(i), 0 > i) throw new RangeError("Invalid value: not (convertible to) a safe integer");
224
- if (0 === i) return JSBI.__zero();
225
- if (_.sign) {
226
- if (i > JSBI.__kMaxLengthBits) throw new RangeError("BigInt too big");
227
- return JSBI.__truncateAndSubFromPowerOfTwo(i, _, !1);
228
- }
229
- if (i >= JSBI.__kMaxLengthBits) return _;
230
- const e = 0 | (i + 29) / 30;
231
- if (_.length < e) return _;
232
- const g = i % 30;
233
- if (_.length == e) {
234
- if (0 === g) return _;
235
- const i$1 = _.__digit(e - 1);
236
- if (0 == i$1 >>> g) return _;
237
- }
238
- return JSBI.__truncateToNBits(i, _);
239
- }
240
- static ADD(i, _) {
241
- if (i = JSBI.__toPrimitive(i), _ = JSBI.__toPrimitive(_), "string" == typeof i) return "string" != typeof _ && (_ = _.toString()), i + _;
242
- if ("string" == typeof _) return i.toString() + _;
243
- if (i = JSBI.__toNumeric(i), _ = JSBI.__toNumeric(_), JSBI.__isBigInt(i) && JSBI.__isBigInt(_)) return JSBI.add(i, _);
244
- if ("number" == typeof i && "number" == typeof _) return i + _;
245
- throw new TypeError("Cannot mix BigInt and other types, use explicit conversions");
246
- }
247
- static LT(i, _) {
248
- return JSBI.__compare(i, _, 0);
249
- }
250
- static LE(i, _) {
251
- return JSBI.__compare(i, _, 1);
252
- }
253
- static GT(i, _) {
254
- return JSBI.__compare(i, _, 2);
255
- }
256
- static GE(i, _) {
257
- return JSBI.__compare(i, _, 3);
258
- }
259
- static EQ(i, _) {
260
- for (;;) {
261
- if (JSBI.__isBigInt(i)) return JSBI.__isBigInt(_) ? JSBI.equal(i, _) : JSBI.EQ(_, i);
262
- if ("number" == typeof i) {
263
- if (JSBI.__isBigInt(_)) return JSBI.__equalToNumber(_, i);
264
- if ("object" != typeof _) return i == _;
265
- _ = JSBI.__toPrimitive(_);
266
- } else if ("string" == typeof i) {
267
- if (JSBI.__isBigInt(_)) return i = JSBI.__fromString(i), null !== i && JSBI.equal(i, _);
268
- if ("object" != typeof _) return i == _;
269
- _ = JSBI.__toPrimitive(_);
270
- } else if ("boolean" == typeof i) {
271
- if (JSBI.__isBigInt(_)) return JSBI.__equalToNumber(_, +i);
272
- if ("object" != typeof _) return i == _;
273
- _ = JSBI.__toPrimitive(_);
274
- } else if ("symbol" == typeof i) {
275
- if (JSBI.__isBigInt(_)) return !1;
276
- if ("object" != typeof _) return i == _;
277
- _ = JSBI.__toPrimitive(_);
278
- } else if ("object" == typeof i) {
279
- if ("object" == typeof _ && _.constructor !== JSBI) return i == _;
280
- i = JSBI.__toPrimitive(i);
281
- } else return i == _;
282
- }
283
- }
284
- static NE(i, _) {
285
- return !JSBI.EQ(i, _);
286
- }
287
- static DataViewGetBigInt64(i, _, t = !1) {
288
- return JSBI.asIntN(64, JSBI.DataViewGetBigUint64(i, _, t));
289
- }
290
- static DataViewGetBigUint64(i, _, t = !1) {
291
- const [e, n] = t ? [4, 0] : [0, 4], g = i.getUint32(_ + e, t), o = i.getUint32(_ + n, t), s = new JSBI(3, !1);
292
- return s.__setDigit(0, 1073741823 & o), s.__setDigit(1, (268435455 & g) << 2 | o >>> 30), s.__setDigit(2, g >>> 28), s.__trim();
293
- }
294
- static DataViewSetBigInt64(i, _, t, e = !1) {
295
- JSBI.DataViewSetBigUint64(i, _, t, e);
296
- }
297
- static DataViewSetBigUint64(i, _, t, e = !1) {
298
- t = JSBI.asUintN(64, t);
299
- let n = 0, g = 0;
300
- if (0 < t.length && (g = t.__digit(0), 1 < t.length)) {
301
- const i$1 = t.__digit(1);
302
- g |= i$1 << 30, n = i$1 >>> 2, 2 < t.length && (n |= t.__digit(2) << 28);
303
- }
304
- const [o, s] = e ? [4, 0] : [0, 4];
305
- i.setUint32(_ + o, n, e), i.setUint32(_ + s, g, e);
306
- }
307
- static __zero() {
308
- return new JSBI(0, !1);
309
- }
310
- static __oneDigit(i, _) {
311
- const t = new JSBI(1, _);
312
- return t.__setDigit(0, i), t;
313
- }
314
- __copy() {
315
- const _ = new JSBI(this.length, this.sign);
316
- for (let t = 0; t < this.length; t++) _[t] = this[t];
317
- return _;
318
- }
319
- __trim() {
320
- let i = this.length, _ = this[i - 1];
321
- for (; 0 === _;) i--, _ = this[i - 1], this.pop();
322
- return 0 === i && (this.sign = !1), this;
323
- }
324
- __initializeDigits() {
325
- for (let _ = 0; _ < this.length; _++) this[_] = 0;
326
- }
327
- static __decideRounding(i, _, t, e) {
328
- if (0 < _) return -1;
329
- let n;
330
- if (0 > _) n = -_ - 1;
331
- else {
332
- if (0 === t) return -1;
333
- t--, e = i.__digit(t), n = 29;
334
- }
335
- let g = 1 << n;
336
- if (0 == (e & g)) return -1;
337
- if (g -= 1, 0 != (e & g)) return 1;
338
- for (; 0 < t;) if (t--, 0 !== i.__digit(t)) return 1;
339
- return 0;
340
- }
341
- static __fromDouble(i) {
342
- JSBI.__kBitConversionDouble[0] = i;
343
- const _ = 2047 & JSBI.__kBitConversionInts[JSBI.__kBitConversionIntHigh] >>> 20, t = _ - 1023, e = (0 | t / 30) + 1, n = new JSBI(e, 0 > i);
344
- let g = 1048575 & JSBI.__kBitConversionInts[JSBI.__kBitConversionIntHigh] | 1048576, o = JSBI.__kBitConversionInts[JSBI.__kBitConversionIntLow];
345
- const s = 20, l = t % 30;
346
- let r, a = 0;
347
- if (l < 20) {
348
- const i$1 = s - l;
349
- a = i$1 + 32, r = g >>> i$1, g = g << 32 - i$1 | o >>> i$1, o <<= 32 - i$1;
350
- } else if (l === 20) a = 32, r = g, g = o, o = 0;
351
- else {
352
- const i$1 = l - s;
353
- a = 32 - i$1, r = g << i$1 | o >>> 32 - i$1, g = o << i$1, o = 0;
354
- }
355
- n.__setDigit(e - 1, r);
356
- for (let _$1 = e - 2; 0 <= _$1; _$1--) 0 < a ? (a -= 30, r = g >>> 2, g = g << 30 | o >>> 2, o <<= 30) : r = 0, n.__setDigit(_$1, r);
357
- return n.__trim();
358
- }
359
- static __isWhitespace(i) {
360
- return !!(13 >= i && 9 <= i) || (159 >= i ? 32 == i : 131071 >= i ? 160 == i || 5760 == i : 196607 >= i ? (i &= 131071, 10 >= i || 40 == i || 41 == i || 47 == i || 95 == i || 4096 == i) : 65279 == i);
361
- }
362
- static __fromString(i, _ = 0) {
363
- let t = 0;
364
- const e = i.length;
365
- let n = 0;
366
- if (n === e) return JSBI.__zero();
367
- let g = i.charCodeAt(n);
368
- for (; JSBI.__isWhitespace(g);) {
369
- if (++n === e) return JSBI.__zero();
370
- g = i.charCodeAt(n);
371
- }
372
- if (43 === g) {
373
- if (++n === e) return null;
374
- g = i.charCodeAt(n), t = 1;
375
- } else if (45 === g) {
376
- if (++n === e) return null;
377
- g = i.charCodeAt(n), t = -1;
378
- }
379
- if (0 === _) {
380
- if (_ = 10, 48 === g) {
381
- if (++n === e) return JSBI.__zero();
382
- if (g = i.charCodeAt(n), 88 === g || 120 === g) {
383
- if (_ = 16, ++n === e) return null;
384
- g = i.charCodeAt(n);
385
- } else if (79 === g || 111 === g) {
386
- if (_ = 8, ++n === e) return null;
387
- g = i.charCodeAt(n);
388
- } else if (66 === g || 98 === g) {
389
- if (_ = 2, ++n === e) return null;
390
- g = i.charCodeAt(n);
391
- }
392
- }
393
- } else if (16 === _ && 48 === g) {
394
- if (++n === e) return JSBI.__zero();
395
- if (g = i.charCodeAt(n), 88 === g || 120 === g) {
396
- if (++n === e) return null;
397
- g = i.charCodeAt(n);
398
- }
399
- }
400
- if (0 != t && 10 !== _) return null;
401
- for (; 48 === g;) {
402
- if (++n === e) return JSBI.__zero();
403
- g = i.charCodeAt(n);
404
- }
405
- const o = e - n;
406
- let s = JSBI.__kMaxBitsPerChar[_], l = JSBI.__kBitsPerCharTableMultiplier - 1;
407
- if (o > 1073741824 / s) return null;
408
- const r = s * o + l >>> JSBI.__kBitsPerCharTableShift, a = new JSBI(0 | (r + 29) / 30, !1), u = 10 > _ ? _ : 10, h = 10 < _ ? _ - 10 : 0;
409
- if (0 == (_ & _ - 1)) {
410
- s >>= JSBI.__kBitsPerCharTableShift;
411
- const _$1 = [], t$1 = [];
412
- let o$1 = !1;
413
- do {
414
- let l$1 = 0, r$1 = 0;
415
- for (;;) {
416
- let _$2;
417
- if (g - 48 >>> 0 < u) _$2 = g - 48;
418
- else if ((32 | g) - 97 >>> 0 < h) _$2 = (32 | g) - 87;
419
- else {
420
- o$1 = !0;
421
- break;
422
- }
423
- if (r$1 += s, l$1 = l$1 << s | _$2, ++n === e) {
424
- o$1 = !0;
425
- break;
426
- }
427
- if (g = i.charCodeAt(n), 30 < r$1 + s) break;
428
- }
429
- _$1.push(l$1), t$1.push(r$1);
430
- } while (!o$1);
431
- JSBI.__fillFromParts(a, _$1, t$1);
432
- } else {
433
- a.__initializeDigits();
434
- let t$1 = !1, o$1 = 0;
435
- do {
436
- let r$1 = 0, b = 1;
437
- for (;;) {
438
- let s$1;
439
- if (g - 48 >>> 0 < u) s$1 = g - 48;
440
- else if ((32 | g) - 97 >>> 0 < h) s$1 = (32 | g) - 87;
441
- else {
442
- t$1 = !0;
443
- break;
444
- }
445
- const l$1 = b * _;
446
- if (1073741823 < l$1) break;
447
- if (b = l$1, r$1 = r$1 * _ + s$1, o$1++, ++n === e) {
448
- t$1 = !0;
449
- break;
450
- }
451
- g = i.charCodeAt(n);
452
- }
453
- l = 30 * JSBI.__kBitsPerCharTableMultiplier - 1;
454
- const D = 0 | (s * o$1 + l >>> JSBI.__kBitsPerCharTableShift) / 30;
455
- a.__inplaceMultiplyAdd(b, r$1, D);
456
- } while (!t$1);
457
- }
458
- if (n !== e) {
459
- if (!JSBI.__isWhitespace(g)) return null;
460
- for (n++; n < e; n++) if (g = i.charCodeAt(n), !JSBI.__isWhitespace(g)) return null;
461
- }
462
- return a.sign = -1 == t, a.__trim();
463
- }
464
- static __fillFromParts(_, t, e) {
465
- let n = 0, g = 0, o = 0;
466
- for (let s = t.length - 1; 0 <= s; s--) {
467
- const i = t[s], l = e[s];
468
- g |= i << o, o += l, 30 === o ? (_.__setDigit(n++, g), o = 0, g = 0) : 30 < o && (_.__setDigit(n++, 1073741823 & g), o -= 30, g = i >>> l - o);
469
- }
470
- if (0 !== g) {
471
- if (n >= _.length) throw new Error("implementation bug");
472
- _.__setDigit(n++, g);
473
- }
474
- for (; n < _.length; n++) _.__setDigit(n, 0);
475
- }
476
- static __toStringBasePowerOfTwo(_, i) {
477
- const t = _.length;
478
- let e = i - 1;
479
- e = (85 & e >>> 1) + (85 & e), e = (51 & e >>> 2) + (51 & e), e = (15 & e >>> 4) + (15 & e);
480
- const n = e, g = i - 1, o = _.__digit(t - 1), s = JSBI.__clz30(o);
481
- let l = 0 | (30 * t - s + n - 1) / n;
482
- if (_.sign && l++, 268435456 < l) throw new Error("string too long");
483
- const r = Array(l);
484
- let a = l - 1, u = 0, d = 0;
485
- for (let e$1 = 0; e$1 < t - 1; e$1++) {
486
- const i$1 = _.__digit(e$1), t$1 = (u | i$1 << d) & g;
487
- r[a--] = JSBI.__kConversionChars[t$1];
488
- const o$1 = n - d;
489
- for (u = i$1 >>> o$1, d = 30 - o$1; d >= n;) r[a--] = JSBI.__kConversionChars[u & g], u >>>= n, d -= n;
490
- }
491
- const h = (u | o << d) & g;
492
- for (r[a--] = JSBI.__kConversionChars[h], u = o >>> n - d; 0 !== u;) r[a--] = JSBI.__kConversionChars[u & g], u >>>= n;
493
- if (_.sign && (r[a--] = "-"), -1 != a) throw new Error("implementation bug");
494
- return r.join("");
495
- }
496
- static __toStringGeneric(_, i, t) {
497
- const e = _.length;
498
- if (0 === e) return "";
499
- if (1 === e) {
500
- let e$1 = _.__unsignedDigit(0).toString(i);
501
- return !1 === t && _.sign && (e$1 = "-" + e$1), e$1;
502
- }
503
- const n = 30 * e - JSBI.__clz30(_.__digit(e - 1)), g = JSBI.__kMaxBitsPerChar[i], o = g - 1;
504
- let s = n * JSBI.__kBitsPerCharTableMultiplier;
505
- s += o - 1, s = 0 | s / o;
506
- const l = s + 1 >> 1, r = JSBI.exponentiate(JSBI.__oneDigit(i, !1), JSBI.__oneDigit(l, !1));
507
- let a, u;
508
- const d = r.__unsignedDigit(0);
509
- if (1 === r.length && 32767 >= d) {
510
- a = new JSBI(_.length, !1), a.__initializeDigits();
511
- let t$1 = 0;
512
- for (let e$1 = 2 * _.length - 1; 0 <= e$1; e$1--) {
513
- const i$1 = t$1 << 15 | _.__halfDigit(e$1);
514
- a.__setHalfDigit(e$1, 0 | i$1 / d), t$1 = 0 | i$1 % d;
515
- }
516
- u = t$1.toString(i);
517
- } else {
518
- const t$1 = JSBI.__absoluteDivLarge(_, r, !0, !0);
519
- a = t$1.quotient;
520
- const e$1 = t$1.remainder.__trim();
521
- u = JSBI.__toStringGeneric(e$1, i, !0);
522
- }
523
- a.__trim();
524
- let h = JSBI.__toStringGeneric(a, i, !0);
525
- for (; u.length < l;) u = "0" + u;
526
- return !1 === t && _.sign && (h = "-" + h), h + u;
527
- }
528
- static __unequalSign(i) {
529
- return i ? -1 : 1;
530
- }
531
- static __absoluteGreater(i) {
532
- return i ? -1 : 1;
533
- }
534
- static __absoluteLess(i) {
535
- return i ? 1 : -1;
536
- }
537
- static __compareToBigInt(i, _) {
538
- const t = i.sign;
539
- if (t !== _.sign) return JSBI.__unequalSign(t);
540
- const e = JSBI.__absoluteCompare(i, _);
541
- return 0 < e ? JSBI.__absoluteGreater(t) : 0 > e ? JSBI.__absoluteLess(t) : 0;
542
- }
543
- static __compareToNumber(i, _) {
544
- if (JSBI.__isOneDigitInt(_)) {
545
- const t = i.sign, e = 0 > _;
546
- if (t !== e) return JSBI.__unequalSign(t);
547
- if (0 === i.length) {
548
- if (e) throw new Error("implementation bug");
549
- return 0 === _ ? 0 : -1;
550
- }
551
- if (1 < i.length) return JSBI.__absoluteGreater(t);
552
- const n = Math.abs(_), g = i.__unsignedDigit(0);
553
- return g > n ? JSBI.__absoluteGreater(t) : g < n ? JSBI.__absoluteLess(t) : 0;
554
- }
555
- return JSBI.__compareToDouble(i, _);
556
- }
557
- static __compareToDouble(i, _) {
558
- if (_ !== _) return _;
559
- if (_ === Infinity) return -1;
560
- if (_ === -Infinity) return 1;
561
- const t = i.sign;
562
- if (t !== 0 > _) return JSBI.__unequalSign(t);
563
- if (0 === _) throw new Error("implementation bug: should be handled elsewhere");
564
- if (0 === i.length) return -1;
565
- JSBI.__kBitConversionDouble[0] = _;
566
- const e = 2047 & JSBI.__kBitConversionInts[JSBI.__kBitConversionIntHigh] >>> 20;
567
- if (2047 == e) throw new Error("implementation bug: handled elsewhere");
568
- const n = e - 1023;
569
- if (0 > n) return JSBI.__absoluteGreater(t);
570
- const g = i.length;
571
- let o = i.__digit(g - 1);
572
- const s = JSBI.__clz30(o), l = 30 * g - s, r = n + 1;
573
- if (l < r) return JSBI.__absoluteLess(t);
574
- if (l > r) return JSBI.__absoluteGreater(t);
575
- let a = 1048576 | 1048575 & JSBI.__kBitConversionInts[JSBI.__kBitConversionIntHigh], u = JSBI.__kBitConversionInts[JSBI.__kBitConversionIntLow];
576
- const d = 20, h = 29 - s;
577
- if (h !== (0 | (l - 1) % 30)) throw new Error("implementation bug");
578
- let m, b = 0;
579
- if (20 > h) {
580
- const i$1 = d - h;
581
- b = i$1 + 32, m = a >>> i$1, a = a << 32 - i$1 | u >>> i$1, u <<= 32 - i$1;
582
- } else if (20 === h) b = 32, m = a, a = u, u = 0;
583
- else {
584
- const i$1 = h - d;
585
- b = 32 - i$1, m = a << i$1 | u >>> 32 - i$1, a = u << i$1, u = 0;
586
- }
587
- if (o >>>= 0, m >>>= 0, o > m) return JSBI.__absoluteGreater(t);
588
- if (o < m) return JSBI.__absoluteLess(t);
589
- for (let e$1 = g - 2; 0 <= e$1; e$1--) {
590
- 0 < b ? (b -= 30, m = a >>> 2, a = a << 30 | u >>> 2, u <<= 30) : m = 0;
591
- const _$1 = i.__unsignedDigit(e$1);
592
- if (_$1 > m) return JSBI.__absoluteGreater(t);
593
- if (_$1 < m) return JSBI.__absoluteLess(t);
594
- }
595
- if (0 !== a || 0 !== u) {
596
- if (0 === b) throw new Error("implementation bug");
597
- return JSBI.__absoluteLess(t);
598
- }
599
- return 0;
600
- }
601
- static __equalToNumber(i, _) {
602
- var t = Math.abs;
603
- return JSBI.__isOneDigitInt(_) ? 0 === _ ? 0 === i.length : 1 === i.length && i.sign === 0 > _ && i.__unsignedDigit(0) === t(_) : 0 === JSBI.__compareToDouble(i, _);
604
- }
605
- static __comparisonResultToBool(i, _) {
606
- return 0 === _ ? 0 > i : 1 === _ ? 0 >= i : 2 === _ ? 0 < i : 3 === _ ? 0 <= i : void 0;
607
- }
608
- static __compare(i, _, t) {
609
- if (i = JSBI.__toPrimitive(i), _ = JSBI.__toPrimitive(_), "string" == typeof i && "string" == typeof _) switch (t) {
610
- case 0: return i < _;
611
- case 1: return i <= _;
612
- case 2: return i > _;
613
- case 3: return i >= _;
614
- }
615
- if (JSBI.__isBigInt(i) && "string" == typeof _) return _ = JSBI.__fromString(_), null !== _ && JSBI.__comparisonResultToBool(JSBI.__compareToBigInt(i, _), t);
616
- if ("string" == typeof i && JSBI.__isBigInt(_)) return i = JSBI.__fromString(i), null !== i && JSBI.__comparisonResultToBool(JSBI.__compareToBigInt(i, _), t);
617
- if (i = JSBI.__toNumeric(i), _ = JSBI.__toNumeric(_), JSBI.__isBigInt(i)) {
618
- if (JSBI.__isBigInt(_)) return JSBI.__comparisonResultToBool(JSBI.__compareToBigInt(i, _), t);
619
- if ("number" != typeof _) throw new Error("implementation bug");
620
- return JSBI.__comparisonResultToBool(JSBI.__compareToNumber(i, _), t);
621
- }
622
- if ("number" != typeof i) throw new Error("implementation bug");
623
- if (JSBI.__isBigInt(_)) return JSBI.__comparisonResultToBool(JSBI.__compareToNumber(_, i), 2 ^ t);
624
- if ("number" != typeof _) throw new Error("implementation bug");
625
- return 0 === t ? i < _ : 1 === t ? i <= _ : 2 === t ? i > _ : 3 === t ? i >= _ : void 0;
626
- }
627
- __clzmsd() {
628
- return JSBI.__clz30(this.__digit(this.length - 1));
629
- }
630
- static __absoluteAdd(_, t, e) {
631
- if (_.length < t.length) return JSBI.__absoluteAdd(t, _, e);
632
- if (0 === _.length) return _;
633
- if (0 === t.length) return _.sign === e ? _ : JSBI.unaryMinus(_);
634
- let n = _.length;
635
- (0 === _.__clzmsd() || t.length === _.length && 0 === t.__clzmsd()) && n++;
636
- const g = new JSBI(n, e);
637
- let o = 0, s = 0;
638
- for (; s < t.length; s++) {
639
- const i = _.__digit(s) + t.__digit(s) + o;
640
- o = i >>> 30, g.__setDigit(s, 1073741823 & i);
641
- }
642
- for (; s < _.length; s++) {
643
- const i = _.__digit(s) + o;
644
- o = i >>> 30, g.__setDigit(s, 1073741823 & i);
645
- }
646
- return s < g.length && g.__setDigit(s, o), g.__trim();
647
- }
648
- static __absoluteSub(_, t, e) {
649
- if (0 === _.length) return _;
650
- if (0 === t.length) return _.sign === e ? _ : JSBI.unaryMinus(_);
651
- const n = new JSBI(_.length, e);
652
- let g = 0, o = 0;
653
- for (; o < t.length; o++) {
654
- const i = _.__digit(o) - t.__digit(o) - g;
655
- g = 1 & i >>> 30, n.__setDigit(o, 1073741823 & i);
656
- }
657
- for (; o < _.length; o++) {
658
- const i = _.__digit(o) - g;
659
- g = 1 & i >>> 30, n.__setDigit(o, 1073741823 & i);
660
- }
661
- return n.__trim();
662
- }
663
- static __absoluteAddOne(_, i, t = null) {
664
- const e = _.length;
665
- null === t ? t = new JSBI(e, i) : t.sign = i;
666
- let n = 1;
667
- for (let g = 0; g < e; g++) {
668
- const i$1 = _.__digit(g) + n;
669
- n = i$1 >>> 30, t.__setDigit(g, 1073741823 & i$1);
670
- }
671
- return 0 != n && t.__setDigitGrow(e, 1), t;
672
- }
673
- static __absoluteSubOne(_, t) {
674
- const e = _.length;
675
- t = t || e;
676
- const n = new JSBI(t, !1);
677
- let g = 1;
678
- for (let o = 0; o < e; o++) {
679
- const i = _.__digit(o) - g;
680
- g = 1 & i >>> 30, n.__setDigit(o, 1073741823 & i);
681
- }
682
- if (0 != g) throw new Error("implementation bug");
683
- for (let g$1 = e; g$1 < t; g$1++) n.__setDigit(g$1, 0);
684
- return n;
685
- }
686
- static __absoluteAnd(_, t, e = null) {
687
- let n = _.length, g = t.length, o = g;
688
- if (n < g) {
689
- o = n;
690
- const i = _, e$1 = n;
691
- _ = t, n = g, t = i, g = e$1;
692
- }
693
- let s = o;
694
- null === e ? e = new JSBI(s, !1) : s = e.length;
695
- let l = 0;
696
- for (; l < o; l++) e.__setDigit(l, _.__digit(l) & t.__digit(l));
697
- for (; l < s; l++) e.__setDigit(l, 0);
698
- return e;
699
- }
700
- static __absoluteAndNot(_, t, e = null) {
701
- const n = _.length, g = t.length;
702
- let o = g;
703
- n < g && (o = n);
704
- let s = n;
705
- null === e ? e = new JSBI(s, !1) : s = e.length;
706
- let l = 0;
707
- for (; l < o; l++) e.__setDigit(l, _.__digit(l) & ~t.__digit(l));
708
- for (; l < n; l++) e.__setDigit(l, _.__digit(l));
709
- for (; l < s; l++) e.__setDigit(l, 0);
710
- return e;
711
- }
712
- static __absoluteOr(_, t, e = null) {
713
- let n = _.length, g = t.length, o = g;
714
- if (n < g) {
715
- o = n;
716
- const i = _, e$1 = n;
717
- _ = t, n = g, t = i, g = e$1;
718
- }
719
- let s = n;
720
- null === e ? e = new JSBI(s, !1) : s = e.length;
721
- let l = 0;
722
- for (; l < o; l++) e.__setDigit(l, _.__digit(l) | t.__digit(l));
723
- for (; l < n; l++) e.__setDigit(l, _.__digit(l));
724
- for (; l < s; l++) e.__setDigit(l, 0);
725
- return e;
726
- }
727
- static __absoluteXor(_, t, e = null) {
728
- let n = _.length, g = t.length, o = g;
729
- if (n < g) {
730
- o = n;
731
- const i = _, e$1 = n;
732
- _ = t, n = g, t = i, g = e$1;
733
- }
734
- let s = n;
735
- null === e ? e = new JSBI(s, !1) : s = e.length;
736
- let l = 0;
737
- for (; l < o; l++) e.__setDigit(l, _.__digit(l) ^ t.__digit(l));
738
- for (; l < n; l++) e.__setDigit(l, _.__digit(l));
739
- for (; l < s; l++) e.__setDigit(l, 0);
740
- return e;
741
- }
742
- static __absoluteCompare(_, t) {
743
- const e = _.length - t.length;
744
- if (0 != e) return e;
745
- let n = _.length - 1;
746
- for (; 0 <= n && _.__digit(n) === t.__digit(n);) n--;
747
- return 0 > n ? 0 : _.__unsignedDigit(n) > t.__unsignedDigit(n) ? 1 : -1;
748
- }
749
- static __multiplyAccumulate(_, t, e, n) {
750
- if (0 === t) return;
751
- const g = 32767 & t, o = t >>> 15;
752
- let s = 0, l = 0;
753
- for (let r, a = 0; a < _.length; a++, n++) {
754
- r = e.__digit(n);
755
- const i = _.__digit(a), t$1 = 32767 & i, u = i >>> 15, d = JSBI.__imul(t$1, g), h = JSBI.__imul(t$1, o), m = JSBI.__imul(u, g), b = JSBI.__imul(u, o);
756
- r += l + d + s, s = r >>> 30, r &= 1073741823, r += ((32767 & h) << 15) + ((32767 & m) << 15), s += r >>> 30, l = b + (h >>> 15) + (m >>> 15), e.__setDigit(n, 1073741823 & r);
757
- }
758
- for (; 0 != s || 0 !== l; n++) {
759
- let i = e.__digit(n);
760
- i += s + l, l = 0, s = i >>> 30, e.__setDigit(n, 1073741823 & i);
761
- }
762
- }
763
- static __internalMultiplyAdd(_, t, e, g, o) {
764
- let s = e, l = 0;
765
- for (let n = 0; n < g; n++) {
766
- const i = _.__digit(n), e$1 = JSBI.__imul(32767 & i, t), g$1 = JSBI.__imul(i >>> 15, t), a = e$1 + ((32767 & g$1) << 15) + l + s;
767
- s = a >>> 30, l = g$1 >>> 15, o.__setDigit(n, 1073741823 & a);
768
- }
769
- if (o.length > g) for (o.__setDigit(g++, s + l); g < o.length;) o.__setDigit(g++, 0);
770
- else if (0 !== s + l) throw new Error("implementation bug");
771
- }
772
- __inplaceMultiplyAdd(i, _, t) {
773
- t > this.length && (t = this.length);
774
- const e = 32767 & i, n = i >>> 15;
775
- let g = 0, o = _;
776
- for (let s = 0; s < t; s++) {
777
- const i$1 = this.__digit(s), _$1 = 32767 & i$1, t$1 = i$1 >>> 15, l = JSBI.__imul(_$1, e), r = JSBI.__imul(_$1, n), a = JSBI.__imul(t$1, e), u = JSBI.__imul(t$1, n);
778
- let d = o + l + g;
779
- g = d >>> 30, d &= 1073741823, d += ((32767 & r) << 15) + ((32767 & a) << 15), g += d >>> 30, o = u + (r >>> 15) + (a >>> 15), this.__setDigit(s, 1073741823 & d);
780
- }
781
- if (0 != g || 0 !== o) throw new Error("implementation bug");
782
- }
783
- static __absoluteDivSmall(_, t, e = null) {
784
- null === e && (e = new JSBI(_.length, !1));
785
- let n = 0;
786
- for (let g, o = 2 * _.length - 1; 0 <= o; o -= 2) {
787
- g = (n << 15 | _.__halfDigit(o)) >>> 0;
788
- const i = 0 | g / t;
789
- n = 0 | g % t, g = (n << 15 | _.__halfDigit(o - 1)) >>> 0;
790
- const s = 0 | g / t;
791
- n = 0 | g % t, e.__setDigit(o >>> 1, i << 15 | s);
792
- }
793
- return e;
794
- }
795
- static __absoluteModSmall(_, t) {
796
- let e = 0;
797
- for (let n = 2 * _.length - 1; 0 <= n; n--) {
798
- const i = (e << 15 | _.__halfDigit(n)) >>> 0;
799
- e = 0 | i % t;
800
- }
801
- return e;
802
- }
803
- static __absoluteDivLarge(i, _, t, e) {
804
- const g = _.__halfDigitLength(), n = _.length, o = i.__halfDigitLength() - g;
805
- let s = null;
806
- t && (s = new JSBI(o + 2 >>> 1, !1), s.__initializeDigits());
807
- const l = new JSBI(g + 2 >>> 1, !1);
808
- l.__initializeDigits();
809
- const r = JSBI.__clz15(_.__halfDigit(g - 1));
810
- 0 < r && (_ = JSBI.__specialLeftShift(_, r, 0));
811
- const a = JSBI.__specialLeftShift(i, r, 1), u = _.__halfDigit(g - 1);
812
- let d = 0;
813
- for (let r$1, h = o; 0 <= h; h--) {
814
- r$1 = 32767;
815
- const i$1 = a.__halfDigit(h + g);
816
- if (i$1 !== u) {
817
- const t$1 = (i$1 << 15 | a.__halfDigit(h + g - 1)) >>> 0;
818
- r$1 = 0 | t$1 / u;
819
- let e$2 = 0 | t$1 % u;
820
- const n$1 = _.__halfDigit(g - 2), o$1 = a.__halfDigit(h + g - 2);
821
- for (; JSBI.__imul(r$1, n$1) >>> 0 > (e$2 << 16 | o$1) >>> 0 && (r$1--, e$2 += u, !(32767 < e$2)););
822
- }
823
- JSBI.__internalMultiplyAdd(_, r$1, 0, n, l);
824
- let e$1 = a.__inplaceSub(l, h, g + 1);
825
- 0 !== e$1 && (e$1 = a.__inplaceAdd(_, h, g), a.__setHalfDigit(h + g, 32767 & a.__halfDigit(h + g) + e$1), r$1--), t && (1 & h ? d = r$1 << 15 : s.__setDigit(h >>> 1, d | r$1));
826
- }
827
- if (e) return a.__inplaceRightShift(r), t ? {
828
- quotient: s,
829
- remainder: a
830
- } : a;
831
- if (t) return s;
832
- throw new Error("unreachable");
833
- }
834
- static __clz15(i) {
835
- return JSBI.__clz30(i) - 15;
836
- }
837
- __inplaceAdd(_, t, e) {
838
- let n = 0;
839
- for (let g = 0; g < e; g++) {
840
- const i = this.__halfDigit(t + g) + _.__halfDigit(g) + n;
841
- n = i >>> 15, this.__setHalfDigit(t + g, 32767 & i);
842
- }
843
- return n;
844
- }
845
- __inplaceSub(_, t, e) {
846
- let n = 0;
847
- if (1 & t) {
848
- t >>= 1;
849
- let g = this.__digit(t), o = 32767 & g, s = 0;
850
- for (; s < e - 1 >>> 1; s++) {
851
- const i$1 = _.__digit(s), e$1 = (g >>> 15) - (32767 & i$1) - n;
852
- n = 1 & e$1 >>> 15, this.__setDigit(t + s, (32767 & e$1) << 15 | 32767 & o), g = this.__digit(t + s + 1), o = (32767 & g) - (i$1 >>> 15) - n, n = 1 & o >>> 15;
853
- }
854
- const i = _.__digit(s), l = (g >>> 15) - (32767 & i) - n;
855
- n = 1 & l >>> 15, this.__setDigit(t + s, (32767 & l) << 15 | 32767 & o);
856
- if (t + s + 1 >= this.length) throw new RangeError("out of bounds");
857
- 0 == (1 & e) && (g = this.__digit(t + s + 1), o = (32767 & g) - (i >>> 15) - n, n = 1 & o >>> 15, this.__setDigit(t + _.length, 1073709056 & g | 32767 & o));
858
- } else {
859
- t >>= 1;
860
- let g = 0;
861
- for (; g < _.length - 1; g++) {
862
- const i$1 = this.__digit(t + g), e$1 = _.__digit(g), o$1 = (32767 & i$1) - (32767 & e$1) - n;
863
- n = 1 & o$1 >>> 15;
864
- const s$1 = (i$1 >>> 15) - (e$1 >>> 15) - n;
865
- n = 1 & s$1 >>> 15, this.__setDigit(t + g, (32767 & s$1) << 15 | 32767 & o$1);
866
- }
867
- const i = this.__digit(t + g), o = _.__digit(g), s = (32767 & i) - (32767 & o) - n;
868
- n = 1 & s >>> 15;
869
- let l = 0;
870
- 0 == (1 & e) && (l = (i >>> 15) - (o >>> 15) - n, n = 1 & l >>> 15), this.__setDigit(t + g, (32767 & l) << 15 | 32767 & s);
871
- }
872
- return n;
873
- }
874
- __inplaceRightShift(_) {
875
- if (0 === _) return;
876
- let t = this.__digit(0) >>> _;
877
- const e = this.length - 1;
878
- for (let n = 0; n < e; n++) {
879
- const i = this.__digit(n + 1);
880
- this.__setDigit(n, 1073741823 & i << 30 - _ | t), t = i >>> _;
881
- }
882
- this.__setDigit(e, t);
883
- }
884
- static __specialLeftShift(_, t, e) {
885
- const g = _.length, n = new JSBI(g + e, !1);
886
- if (0 === t) {
887
- for (let t$1 = 0; t$1 < g; t$1++) n.__setDigit(t$1, _.__digit(t$1));
888
- return 0 < e && n.__setDigit(g, 0), n;
889
- }
890
- let o = 0;
891
- for (let s = 0; s < g; s++) {
892
- const i = _.__digit(s);
893
- n.__setDigit(s, 1073741823 & i << t | o), o = i >>> 30 - t;
894
- }
895
- return 0 < e && n.__setDigit(g, o), n;
896
- }
897
- static __leftShiftByAbsolute(_, i) {
898
- const t = JSBI.__toShiftAmount(i);
899
- if (0 > t) throw new RangeError("BigInt too big");
900
- const e = 0 | t / 30, n = t % 30, g = _.length, o = 0 !== n && 0 != _.__digit(g - 1) >>> 30 - n, s = g + e + (o ? 1 : 0), l = new JSBI(s, _.sign);
901
- if (0 === n) {
902
- let t$1 = 0;
903
- for (; t$1 < e; t$1++) l.__setDigit(t$1, 0);
904
- for (; t$1 < s; t$1++) l.__setDigit(t$1, _.__digit(t$1 - e));
905
- } else {
906
- let t$1 = 0;
907
- for (let _$1 = 0; _$1 < e; _$1++) l.__setDigit(_$1, 0);
908
- for (let o$1 = 0; o$1 < g; o$1++) {
909
- const i$1 = _.__digit(o$1);
910
- l.__setDigit(o$1 + e, 1073741823 & i$1 << n | t$1), t$1 = i$1 >>> 30 - n;
911
- }
912
- if (o) l.__setDigit(g + e, t$1);
913
- else if (0 !== t$1) throw new Error("implementation bug");
914
- }
915
- return l.__trim();
916
- }
917
- static __rightShiftByAbsolute(_, i) {
918
- const t = _.length, e = _.sign, n = JSBI.__toShiftAmount(i);
919
- if (0 > n) return JSBI.__rightShiftByMaximum(e);
920
- const g = 0 | n / 30, o = n % 30;
921
- let s = t - g;
922
- if (0 >= s) return JSBI.__rightShiftByMaximum(e);
923
- let l = !1;
924
- if (e) {
925
- if (0 != (_.__digit(g) & (1 << o) - 1)) l = !0;
926
- else for (let t$1 = 0; t$1 < g; t$1++) if (0 !== _.__digit(t$1)) {
927
- l = !0;
928
- break;
929
- }
930
- }
931
- if (l && 0 === o) {
932
- const i$1 = _.__digit(t - 1);
933
- 0 == ~i$1 && s++;
934
- }
935
- let r = new JSBI(s, e);
936
- if (0 === o) {
937
- r.__setDigit(s - 1, 0);
938
- for (let e$1 = g; e$1 < t; e$1++) r.__setDigit(e$1 - g, _.__digit(e$1));
939
- } else {
940
- let e$1 = _.__digit(g) >>> o;
941
- const n$1 = t - g - 1;
942
- for (let t$1 = 0; t$1 < n$1; t$1++) {
943
- const i$1 = _.__digit(t$1 + g + 1);
944
- r.__setDigit(t$1, 1073741823 & i$1 << 30 - o | e$1), e$1 = i$1 >>> o;
945
- }
946
- r.__setDigit(n$1, e$1);
947
- }
948
- return l && (r = JSBI.__absoluteAddOne(r, !0, r)), r.__trim();
949
- }
950
- static __rightShiftByMaximum(i) {
951
- return i ? JSBI.__oneDigit(1, !0) : JSBI.__zero();
952
- }
953
- static __toShiftAmount(i) {
954
- if (1 < i.length) return -1;
955
- const _ = i.__unsignedDigit(0);
956
- return _ > JSBI.__kMaxLengthBits ? -1 : _;
957
- }
958
- static __toPrimitive(i, _ = "default") {
959
- if ("object" != typeof i) return i;
960
- if (i.constructor === JSBI) return i;
961
- if ("undefined" != typeof Symbol && "symbol" == typeof Symbol.toPrimitive && i[Symbol.toPrimitive]) {
962
- const t$1 = i[Symbol.toPrimitive](_);
963
- if ("object" != typeof t$1) return t$1;
964
- throw new TypeError("Cannot convert object to primitive value");
965
- }
966
- const t = i.valueOf;
967
- if (t) {
968
- const _$1 = t.call(i);
969
- if ("object" != typeof _$1) return _$1;
970
- }
971
- const e = i.toString;
972
- if (e) {
973
- const _$1 = e.call(i);
974
- if ("object" != typeof _$1) return _$1;
975
- }
976
- throw new TypeError("Cannot convert object to primitive value");
977
- }
978
- static __toNumeric(i) {
979
- return JSBI.__isBigInt(i) ? i : +i;
980
- }
981
- static __isBigInt(i) {
982
- return "object" == typeof i && null !== i && i.constructor === JSBI;
983
- }
984
- static __truncateToNBits(i, _) {
985
- const t = 0 | (i + 29) / 30, e = new JSBI(t, _.sign), n = t - 1;
986
- for (let t$1 = 0; t$1 < n; t$1++) e.__setDigit(t$1, _.__digit(t$1));
987
- let g = _.__digit(n);
988
- if (0 != i % 30) {
989
- const _$1 = 32 - i % 30;
990
- g = g << _$1 >>> _$1;
991
- }
992
- return e.__setDigit(n, g), e.__trim();
993
- }
994
- static __truncateAndSubFromPowerOfTwo(_, t, e) {
995
- var n = Math.min;
996
- const g = 0 | (_ + 29) / 30, o = new JSBI(g, e);
997
- let s = 0;
998
- const l = g - 1;
999
- let a = 0;
1000
- for (const i = n(l, t.length); s < i; s++) {
1001
- const i$1 = 0 - t.__digit(s) - a;
1002
- a = 1 & i$1 >>> 30, o.__setDigit(s, 1073741823 & i$1);
1003
- }
1004
- for (; s < l; s++) o.__setDigit(s, 0 | 1073741823 & -a);
1005
- let u = l < t.length ? t.__digit(l) : 0;
1006
- const d = _ % 30;
1007
- let h;
1008
- if (0 == d) h = 0 - u - a, h &= 1073741823;
1009
- else {
1010
- const i = 32 - d;
1011
- u = u << i >>> i;
1012
- const _$1 = 1 << 32 - i;
1013
- h = _$1 - u - a, h &= _$1 - 1;
1014
- }
1015
- return o.__setDigit(l, h), o.__trim();
1016
- }
1017
- __digit(_) {
1018
- return this[_];
1019
- }
1020
- __unsignedDigit(_) {
1021
- return this[_] >>> 0;
1022
- }
1023
- __setDigit(_, i) {
1024
- this[_] = 0 | i;
1025
- }
1026
- __setDigitGrow(_, i) {
1027
- this[_] = 0 | i;
1028
- }
1029
- __halfDigitLength() {
1030
- const i = this.length;
1031
- return 32767 >= this.__unsignedDigit(i - 1) ? 2 * i - 1 : 2 * i;
1032
- }
1033
- __halfDigit(_) {
1034
- return 32767 & this[_ >>> 1] >>> 15 * (1 & _);
1035
- }
1036
- __setHalfDigit(_, i) {
1037
- const t = _ >>> 1, e = this.__digit(t), n = 1 & _ ? 32767 & e | i << 15 : 1073709056 & e | 32767 & i;
1038
- this.__setDigit(t, n);
1039
- }
1040
- static __digitPow(i, _) {
1041
- let t = 1;
1042
- for (; 0 < _;) 1 & _ && (t *= i), _ >>>= 1, i *= i;
1043
- return t;
1044
- }
1045
- static __detectBigEndian() {
1046
- return JSBI.__kBitConversionDouble[0] = -0, 0 !== JSBI.__kBitConversionInts[0];
1047
- }
1048
- static __isOneDigitInt(i) {
1049
- return (1073741823 & i) === i;
1050
- }
1051
- };
1052
- JSBI.__kMaxLength = 33554432, JSBI.__kMaxLengthBits = JSBI.__kMaxLength << 5, JSBI.__kMaxBitsPerChar = [
1053
- 0,
1054
- 0,
1055
- 32,
1056
- 51,
1057
- 64,
1058
- 75,
1059
- 83,
1060
- 90,
1061
- 96,
1062
- 102,
1063
- 107,
1064
- 111,
1065
- 115,
1066
- 119,
1067
- 122,
1068
- 126,
1069
- 128,
1070
- 131,
1071
- 134,
1072
- 136,
1073
- 139,
1074
- 141,
1075
- 143,
1076
- 145,
1077
- 147,
1078
- 149,
1079
- 151,
1080
- 153,
1081
- 154,
1082
- 156,
1083
- 158,
1084
- 159,
1085
- 160,
1086
- 162,
1087
- 163,
1088
- 165,
1089
- 166
1090
- ], JSBI.__kBitsPerCharTableShift = 5, JSBI.__kBitsPerCharTableMultiplier = 1 << JSBI.__kBitsPerCharTableShift, JSBI.__kConversionChars = [
1091
- "0",
1092
- "1",
1093
- "2",
1094
- "3",
1095
- "4",
1096
- "5",
1097
- "6",
1098
- "7",
1099
- "8",
1100
- "9",
1101
- "a",
1102
- "b",
1103
- "c",
1104
- "d",
1105
- "e",
1106
- "f",
1107
- "g",
1108
- "h",
1109
- "i",
1110
- "j",
1111
- "k",
1112
- "l",
1113
- "m",
1114
- "n",
1115
- "o",
1116
- "p",
1117
- "q",
1118
- "r",
1119
- "s",
1120
- "t",
1121
- "u",
1122
- "v",
1123
- "w",
1124
- "x",
1125
- "y",
1126
- "z"
1127
- ], JSBI.__kBitConversionBuffer = /* @__PURE__ */ new ArrayBuffer(8), JSBI.__kBitConversionDouble = new Float64Array(JSBI.__kBitConversionBuffer), JSBI.__kBitConversionInts = new Int32Array(JSBI.__kBitConversionBuffer), JSBI.__kBitConversionIntHigh = JSBI.__detectBigEndian() ? 0 : 1, JSBI.__kBitConversionIntLow = JSBI.__detectBigEndian() ? 1 : 0, JSBI.__clz30 = Math.clz32 ? function(i) {
1128
- return Math.clz32(i) - 2;
1129
- } : function(i) {
1130
- return 0 === i ? 30 : 0 | 29 - (0 | Math.log(i >>> 0) / Math.LN2);
1131
- }, JSBI.__imul = Math.imul || function(i, _) {
1132
- return 0 | i * _;
1133
- }, module.exports = JSBI;
1134
- } });
1135
-
1136
- //#endregion
1137
- export default require_jsbi_cjs();
1138
-
1139
- export { require_jsbi_cjs };