bigint-decimal 1.0.20 → 1.0.22

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.
@@ -0,0 +1,268 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BigintDecimalBase = void 0;
4
+ class BigintDecimalBase {
5
+ value = 0n;
6
+ decimals = 0;
7
+ static precision = 20;
8
+ precision = BigintDecimalBase.precision;
9
+ constructor(val = "0") {
10
+ if (val instanceof BigintDecimalBase) {
11
+ this.value = val.value;
12
+ this.decimals = val.decimals;
13
+ return;
14
+ }
15
+ // Fast paths: integers need no parsing
16
+ if (typeof val === "bigint") {
17
+ this.value = val;
18
+ return;
19
+ }
20
+ if (typeof val === "number" && Number.isSafeInteger(val)) {
21
+ this.value = BigInt(val);
22
+ return;
23
+ }
24
+ if (!this.isBigintDecimal(val)) {
25
+ throw new Error(`"${val}" is not safe parameter .`);
26
+ }
27
+ const numberInfo = this.getNumberIFoForBigintDecimal(val);
28
+ this.value = numberInfo.value;
29
+ this.decimals = numberInfo.decimals;
30
+ this.trim();
31
+ }
32
+ static setPrecisionGlobal(newPrecision) {
33
+ // Always the base class, so subclasses share one setting with it
34
+ BigintDecimalBase.precision = BigintDecimalBase.checkDecimals(newPrecision, "precision");
35
+ }
36
+ setPrecision(newPrecision) {
37
+ this.precision = BigintDecimalBase.checkDecimals(newPrecision, "precision");
38
+ }
39
+ // A count of decimal places must be a whole number >= 0 (anything else would corrupt the value)
40
+ static checkDecimals(decimals, name) {
41
+ if (!Number.isSafeInteger(decimals) || decimals < 0) {
42
+ throw new RangeError(`${name} must be a whole number >= 0, got ${decimals}`);
43
+ }
44
+ return decimals;
45
+ }
46
+ // New instance of the same class as `this` (subclasses get their own type back), without parsing
47
+ create(value, decimals) {
48
+ const Constructor = this.constructor;
49
+ const result = new Constructor(this);
50
+ result.value = value;
51
+ result.decimals = decimals;
52
+ return result.trim();
53
+ }
54
+ // Removes trailing zeros after the dot: 1.500 -> 1.5
55
+ trim() {
56
+ if (this.value === 0n) {
57
+ this.decimals = 0;
58
+ return this;
59
+ }
60
+ // Most values have no or only a few trailing zeros: remove those one digit at a time
61
+ for (let i = 0; i < 8; i++) {
62
+ if (this.decimals === 0 || this.value % 10n !== 0n)
63
+ return this;
64
+ this.value /= 10n;
65
+ this.decimals--;
66
+ }
67
+ // Many zeros: strip them in chunks of 2^k digits, largest first. An exact result like
68
+ // 1/8 at 1000 digits has ~1000 zeros, and removing them one by one costs 1000 big divisions.
69
+ const chunks = []; // largest first: ..., [4, 10^4], [2, 10^2], [1, 10]
70
+ for (let size = 1, power = 10n; size <= this.decimals; size *= 2, power *= power)
71
+ chunks.unshift([size, power]);
72
+ for (const [size, power] of chunks) {
73
+ if (size <= this.decimals && this.value % power === 0n) {
74
+ this.value /= power;
75
+ this.decimals -= size;
76
+ }
77
+ }
78
+ return this;
79
+ }
80
+ toSafeValue(val) {
81
+ if (typeof val === "string") {
82
+ return val.trim();
83
+ }
84
+ return `${val}`;
85
+ }
86
+ // Parses a string already checked by isBigintDecimal.
87
+ // All digits go to the native BigInt parser in one call, instead of one bigint operation per digit.
88
+ getNumberIFoForBigintDecimal(val) {
89
+ const safeVal = this.toSafeValue(val);
90
+ // Sign
91
+ const first = safeVal.charCodeAt(0);
92
+ const negative = first === 45;
93
+ const start = negative || first === 43 ? 1 : 0;
94
+ // Scientific Notation Handle
95
+ let end = safeVal.indexOf("e");
96
+ if (end === -1)
97
+ end = safeVal.indexOf("E");
98
+ let exponent = 0;
99
+ if (end === -1) {
100
+ end = safeVal.length;
101
+ }
102
+ else {
103
+ // isBigintDecimal guarantees the exponent has digits
104
+ exponent = parseInt(safeVal.slice(end + 1), 10);
105
+ }
106
+ // Digits around the dot
107
+ const dot = safeVal.indexOf(".");
108
+ const hasDot = dot !== -1; // isBigintDecimal guarantees no dot after the exponent
109
+ const digits = hasDot ? safeVal.slice(start, dot) + safeVal.slice(dot + 1, end) : safeVal.slice(start, end);
110
+ let value = BigInt(digits); // isBigintDecimal guarantees at least one digit
111
+ let decimals = (hasDot ? end - dot - 1 : 0) - exponent;
112
+ // Handle negative decimals (large integers)
113
+ if (decimals < 0) {
114
+ value = value * (10n ** BigInt(-decimals));
115
+ decimals = 0;
116
+ }
117
+ ;
118
+ return { value: negative ? -value : value, decimals };
119
+ }
120
+ toString() {
121
+ // 1. Handle Integer case (Fastest exit, Zero Allocation overhead)
122
+ if (this.decimals === 0)
123
+ return this.value.toString();
124
+ // 2. Separate Sign and Magnitude
125
+ // Check sign using BigInt math (fastest)
126
+ const isNegative = this.value < 0n;
127
+ // Get the string of digits ONLY.
128
+ // isNegative ? -this.value : this.value -> creates a temporary BigInt
129
+ // .toString() -> creates the string of digits "123"
130
+ // This is cheaper than creating "-123" and slicing it.
131
+ const s = (isNegative ? -this.value : this.value).toString();
132
+ const len = s.length;
133
+ // 3. Logic for insertion vs padding
134
+ if (len > this.decimals) {
135
+ // Case A: 12345 (2 dec) -> 123.45
136
+ // splitIndex is purely digits before the dot
137
+ const splitIndex = len - this.decimals;
138
+ // Build the absolute decimal string
139
+ const result = s.substring(0, splitIndex) + "." + s.substring(splitIndex);
140
+ // Add sign if needed
141
+ return isNegative ? "-" + result : result;
142
+ }
143
+ // Case B: 5 (2 dec) -> 0.05
144
+ // Calculate zeros needed: 2 decimals - length 1 = 1 zero
145
+ const zerosNeeded = this.decimals - len;
146
+ // Build the result directly
147
+ // "0." + "0" + "5"
148
+ return (isNegative ? "-0." : "0.") + "0".repeat(zerosNeeded) + s;
149
+ }
150
+ toJSON() {
151
+ return this.toString();
152
+ }
153
+ [Symbol.for('nodejs.util.inspect.custom')]() {
154
+ return this.toString();
155
+ }
156
+ isBigintDecimal(val) {
157
+ const s = this.toSafeValue(val);
158
+ if (s.length === 0)
159
+ return false;
160
+ let dot = false, e = false, mantissaDigits = 0, exponentDigits = 0;
161
+ for (let i = 0; i < s.length; i++) {
162
+ const c = s.charCodeAt(i);
163
+ if (c >= 48 && c <= 57) { // 0-9
164
+ if (e)
165
+ exponentDigits++;
166
+ else
167
+ mantissaDigits++;
168
+ continue;
169
+ }
170
+ if (c === 46 && !dot && !e) {
171
+ dot = true;
172
+ continue;
173
+ } // .
174
+ if (i === 0 && (c === 45 || c === 43))
175
+ continue; // +/- at start
176
+ if ((c === 101 || c === 69) && !e) { // e/E
177
+ e = true;
178
+ const next = s.charCodeAt(i + 1);
179
+ if (next === 45 || next === 43)
180
+ i++; // Skip sign after 'e'
181
+ continue;
182
+ }
183
+ return false;
184
+ }
185
+ // A number needs digits: "-", ".", "e5" and "1e" are not numbers
186
+ return mantissaDigits > 0 && (!e || exponentDigits > 0);
187
+ }
188
+ plus(val) {
189
+ const plusValue = val instanceof BigintDecimalBase ? val : new BigintDecimalBase(val);
190
+ // 1. Determine which number has more decimals
191
+ const d1 = this.decimals;
192
+ const d2 = plusValue.decimals;
193
+ const newDecimal = d1 > d2 ? d1 : d2;
194
+ // 2. Align values (Common Denominator)
195
+ // If 'this' has fewer decimals, scale it up.
196
+ const v1 = d1 < newDecimal ? this.value * (10n ** BigInt(newDecimal - d1)) : this.value;
197
+ // If 'plusValue' has fewer decimals, scale it up.
198
+ const v2 = d2 < newDecimal ? plusValue.value * (10n ** BigInt(newDecimal - d2)) : plusValue.value;
199
+ // 3. Now add and return
200
+ return this.create(v1 + v2, newDecimal);
201
+ }
202
+ minus(val) {
203
+ const other = val instanceof BigintDecimalBase ? val : new BigintDecimalBase(val);
204
+ const d1 = this.decimals;
205
+ const d2 = other.decimals;
206
+ const newDecimal = d1 > d2 ? d1 : d2;
207
+ // Scale values to the same precision
208
+ const v1 = d1 < newDecimal ? this.value * (10n ** BigInt(newDecimal - d1)) : this.value;
209
+ const v2 = d2 < newDecimal ? other.value * (10n ** BigInt(newDecimal - d2)) : other.value;
210
+ return this.create(v1 - v2, newDecimal);
211
+ }
212
+ times(val) {
213
+ const other = val instanceof BigintDecimalBase ? val : new BigintDecimalBase(val);
214
+ // Multiplication: (A * 10^d1) * (B * 10^d2) = (A * B) * 10^(d1 + d2)
215
+ return this.create(this.value * other.value, this.decimals + other.decimals);
216
+ }
217
+ round(toDecimals) {
218
+ const diff = this.decimals - BigintDecimalBase.checkDecimals(toDecimals, "round: decimals");
219
+ if (diff <= 0)
220
+ return this; // Already more precise than requested
221
+ const power = 10n ** BigInt(diff);
222
+ const half = power / 2n;
223
+ // Standard rounding: add half of the divisor before dividing
224
+ // This turns 0.999... into 1.0
225
+ const roundedValue = (this.value >= 0n) ? (this.value + half) / power : (this.value - half) / power;
226
+ return this.create(roundedValue, toDecimals);
227
+ }
228
+ div(val) {
229
+ const other = val instanceof BigintDecimalBase ? val : new BigintDecimalBase(val);
230
+ if (other.value === 0n)
231
+ throw new Error("Division by zero");
232
+ let v1 = this.value;
233
+ const v2 = other.value;
234
+ // 1. Scale up once to your "Max Allowed" precision
235
+ const shift = this.precision + other.decimals - this.decimals;
236
+ if (shift > 0)
237
+ v1 *= 10n ** BigInt(shift);
238
+ else if (shift < 0)
239
+ v1 /= 10n ** BigInt(-shift);
240
+ // 2. create() trims it immediately.
241
+ // This is where 0.500000... becomes 0.5 automatically.
242
+ return this.create(v1 / v2, this.precision);
243
+ }
244
+ compare(val) {
245
+ const other = val instanceof BigintDecimalBase ? val : new BigintDecimalBase(val);
246
+ const maxD = Math.max(this.decimals, other.decimals);
247
+ const v1 = this.decimals < maxD ? this.value * (10n ** BigInt(maxD - this.decimals)) : this.value;
248
+ const v2 = other.decimals < maxD ? other.value * (10n ** BigInt(maxD - other.decimals)) : other.value;
249
+ return v1 > v2 ? 1 : v1 < v2 ? -1 : 0;
250
+ }
251
+ gt(val) {
252
+ return this.compare(val) === 1;
253
+ }
254
+ lt(val) {
255
+ return this.compare(val) === -1;
256
+ }
257
+ gte(val) {
258
+ return this.compare(val) >= 0;
259
+ }
260
+ lte(val) {
261
+ return this.compare(val) <= 0;
262
+ }
263
+ eq(val) {
264
+ return this.compare(val) === 0;
265
+ }
266
+ }
267
+ exports.BigintDecimalBase = BigintDecimalBase;
268
+ //# sourceMappingURL=bigintDecimalBase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bigintDecimalBase.js","sourceRoot":"","sources":["../../bigintDecimalBase.ts"],"names":[],"mappings":";;;AAGA;IAEc,KAAK,GAAW,EAAE,CAAC;IACnB,QAAQ,GAAW,CAAC,CAAC;IAC/B,MAAM,CAAC,SAAS,GAAW,EAAE,CAAA;IAC7B,SAAS,GAAW,iBAAiB,CAAC,SAAS,CAAC;IAEhD,YAAY,GAAG,GAAmC,GAAG;QACjD,IAAI,GAAG,YAAY,iBAAiB,EAAE,CAAC;YACnC,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAA;YACtB,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAA;YAC5B,OAAM;QACV,CAAC;QACD,uCAAuC;QACvC,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;YAC1B,IAAI,CAAC,KAAK,GAAG,GAAG,CAAC;YACjB,OAAM;QACV,CAAC;QACD,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,CAAC;YACvD,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;YACzB,OAAM;QACV,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,IAAI,GAAG,2BAA2B,CAAC,CAAA;QACvD,CAAC;QACD,MAAM,UAAU,GAAG,IAAI,CAAC,4BAA4B,CAAC,GAAG,CAAC,CAAC;QAC1D,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC;QAC9B,IAAI,CAAC,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC;QAEpC,IAAI,CAAC,IAAI,EAAE,CAAC;IAChB,CAAC;IAED,MAAM,CAAC,kBAAkB,CAAC,YA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AAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,GAAG,CAAC,GAAmC;QACnC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,EAAE,CAAC,GAAmC;QAClC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;CACJ"}
@@ -1,29 +1,147 @@
1
- type SafeValues = string | number | bigint;
2
- export declare class BigintDecimal {
3
- private value;
4
- private decimals;
5
- static precision: number;
6
- precision: number;
7
- constructor(val?: SafeValues | BigintDecimal);
8
- static setPrecisionGlobal(newPrecision: number): void;
9
- setPrecision(newPrecision: number): void;
10
- private trim;
11
- private toSafeValue;
12
- private getNumberIFoForBigintDecimal;
13
- toString(): string;
14
- toJSON(): string;
15
- isBigintDecimal(val: unknown): boolean;
16
- plus(val: SafeValues | BigintDecimal): BigintDecimal;
17
- minus(val: SafeValues | BigintDecimal): BigintDecimal;
18
- times(val: SafeValues | BigintDecimal): BigintDecimal;
19
- round(toDecimals: number): BigintDecimal;
20
- div(val: SafeValues | BigintDecimal): BigintDecimal;
21
- private compare;
22
- gt(val: SafeValues | BigintDecimal): boolean;
23
- lt(val: SafeValues | BigintDecimal): boolean;
24
- gte(val: SafeValues | BigintDecimal): boolean;
25
- lte(val: SafeValues | BigintDecimal): boolean;
26
- eq(val: SafeValues | BigintDecimal): boolean;
1
+ import { BigintDecimalBase } from "./bigintDecimalBase.js";
2
+ type DecimalInput = NonNullable<ConstructorParameters<typeof BigintDecimalBase>[0]>;
3
+ /**
4
+ * BigintDecimal with the JS `Math` object's members as statics
5
+ * (except fround, f16round, clz32 and imul, which only make sense for JS floats and 32-bit integers).
6
+ * Functions take the same values as the constructor and return BigintDecimal,
7
+ * computed to `BigintDecimal.precision` decimal places.
8
+ * Where JS Math would return NaN or ±Infinity, they throw a RangeError.
9
+ */
10
+ export declare class BigintDecimal extends BigintDecimalBase {
11
+ constructor(...args: ConstructorParameters<typeof BigintDecimalBase>);
12
+ /** Euler's number, e ≈ 2.718 */
13
+ static get E(): BigintDecimal;
14
+ /** Natural logarithm of 10 ≈ 2.303 */
15
+ static get LN10(): BigintDecimal;
16
+ /** Natural logarithm of 2 ≈ 0.693 */
17
+ static get LN2(): BigintDecimal;
18
+ /** Base-10 logarithm of e ≈ 0.434 */
19
+ static get LOG10E(): BigintDecimal;
20
+ /** Base-2 logarithm of e ≈ 1.443 */
21
+ static get LOG2E(): BigintDecimal;
22
+ /** Ratio of a circle's circumference to its diameter ≈ 3.14159 */
23
+ static get PI(): BigintDecimal;
24
+ /** Square root of 1/2 ≈ 0.707 */
25
+ static get SQRT1_2(): BigintDecimal;
26
+ /** Square root of 2 ≈ 1.414 */
27
+ static get SQRT2(): BigintDecimal;
28
+ /** Absolute value */
29
+ static abs(x: DecimalInput): BigintDecimal;
30
+ /** -1, 0 or 1, depending on the sign of x */
31
+ static sign(x: DecimalInput): BigintDecimal;
32
+ /** Integer part of x (removes the fractional digits) */
33
+ static trunc(x: DecimalInput): BigintDecimal;
34
+ /** Largest integer less than or equal to x */
35
+ static floor(x: DecimalInput): BigintDecimal;
36
+ /** Smallest integer greater than or equal to x */
37
+ static ceil(x: DecimalInput): BigintDecimal;
38
+ /** Rounds to the nearest integer; halves go up (toward +Infinity), like Math.round */
39
+ static round(x: DecimalInput): BigintDecimal;
40
+ /** Largest of the arguments (at least one is required) */
41
+ static max(...values: DecimalInput[]): BigintDecimal;
42
+ /** Smallest of the arguments (at least one is required) */
43
+ static min(...values: DecimalInput[]): BigintDecimal;
44
+ /** Exact sum of all values in an iterable */
45
+ static sumPrecise(values: Iterable<DecimalInput>): BigintDecimal;
46
+ /** Square root of the sum of squares of the arguments */
47
+ static hypot(...values: DecimalInput[]): BigintDecimal;
48
+ /** Square root. Argument must be >= 0. Always correctly rounded. */
49
+ static sqrt(x: DecimalInput): BigintDecimal;
50
+ /** Cube root. Always correctly rounded. */
51
+ static cbrt(x: DecimalInput): BigintDecimal;
52
+ /** base raised to the power of exponent. Integer powers are exact where the result stays reasonably sized. */
53
+ static pow(base: DecimalInput, exponent: DecimalInput): BigintDecimal;
54
+ /** e raised to the power of x */
55
+ static exp(x: DecimalInput): BigintDecimal;
56
+ /** e^x - 1 */
57
+ static expm1(x: DecimalInput): BigintDecimal;
58
+ /** Natural logarithm (base e). Argument must be > 0. */
59
+ static log(x: DecimalInput): BigintDecimal;
60
+ /** Base-10 logarithm. Argument must be > 0. */
61
+ static log10(x: DecimalInput): BigintDecimal;
62
+ /** Base-2 logarithm. Argument must be > 0. */
63
+ static log2(x: DecimalInput): BigintDecimal;
64
+ /** Natural logarithm of 1 + x. Argument must be > -1. */
65
+ static log1p(x: DecimalInput): BigintDecimal;
66
+ /** Sine */
67
+ static sin(x: DecimalInput): BigintDecimal;
68
+ /** Cosine */
69
+ static cos(x: DecimalInput): BigintDecimal;
70
+ /** Tangent */
71
+ static tan(x: DecimalInput): BigintDecimal;
72
+ /** Arcsine. Argument must be in [-1, 1]. */
73
+ static asin(x: DecimalInput): BigintDecimal;
74
+ /** Arccosine. Argument must be in [-1, 1]. */
75
+ static acos(x: DecimalInput): BigintDecimal;
76
+ /** Arctangent */
77
+ static atan(x: DecimalInput): BigintDecimal;
78
+ /** Angle between the positive x-axis and the point (x, y). Note the order: (y, x). */
79
+ static atan2(y: DecimalInput, x: DecimalInput): BigintDecimal;
80
+ /** Hyperbolic sine */
81
+ static sinh(x: DecimalInput): BigintDecimal;
82
+ /** Hyperbolic cosine */
83
+ static cosh(x: DecimalInput): BigintDecimal;
84
+ /** Hyperbolic tangent */
85
+ static tanh(x: DecimalInput): BigintDecimal;
86
+ /** Hyperbolic arcsine */
87
+ static asinh(x: DecimalInput): BigintDecimal;
88
+ /** Hyperbolic arccosine. Argument must be >= 1. */
89
+ static acosh(x: DecimalInput): BigintDecimal;
90
+ /** Hyperbolic arctangent. Argument must be in (-1, 1). */
91
+ static atanh(x: DecimalInput): BigintDecimal;
92
+ /** Random number in [0, 1) with `BigintDecimal.precision` decimal digits */
93
+ static random(): BigintDecimal;
94
+ /**
95
+ * Frees the cached constants (pi, ln2, ln10, the log table) and powers of ten.
96
+ * They are kept at the highest precision used so far and rebuilt on demand, so this is only
97
+ * useful to give memory back after very high precision work. Results do not change.
98
+ */
99
+ static clearCache(): void;
100
+ private static readonly GUARD_BITS;
101
+ private static readonly ATAN_NEWTON_BITS;
102
+ private static readonly RECTANGULAR_BITS;
103
+ private static readonly BINARY_SPLIT_BITS;
104
+ private static readonly constants;
105
+ private static readonly POW10_CACHE_SIZE;
106
+ private static readonly pow10Cache;
107
+ private static compute;
108
+ private static roundDecimal;
109
+ private static parts;
110
+ private static fromParts;
111
+ private static floorScale;
112
+ private static toFixed;
113
+ private static integerPart;
114
+ private static one;
115
+ private static shift;
116
+ private static pow10;
117
+ private static absBig;
118
+ private static bitLength;
119
+ private static floorDiv;
120
+ private static isqrt;
121
+ private static icbrt;
122
+ private static pick;
123
+ private static logBase;
124
+ private static lnPlusRoot;
125
+ private static expPair;
126
+ private static constant;
127
+ private static piFixed;
128
+ private static ln2Fixed;
129
+ private static ln10Fixed;
130
+ private static atanhRatio;
131
+ private static binarySplit;
132
+ private static series;
133
+ private static halvings;
134
+ private static atanRatio;
135
+ private static lnNear1;
136
+ private static lnFixed;
137
+ private static expParts;
138
+ private static expFixed;
139
+ private static sinCosParts;
140
+ private static sinCosLoss;
141
+ private static sinCosFixed;
142
+ private static atanFixed;
143
+ private static atanNewton;
144
+ private static asinFixed;
27
145
  }
28
146
  export { BigintDecimal as default };
29
147
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAEA,KAAK,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;AAC1C,qBAAa,aAAa;IAEtB,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAA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