appwrite-cli 13.4.0 → 13.5.0
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/CHANGELOG.md +5 -0
- package/README.md +2 -2
- package/dist/bundle-win-arm64.mjs +1183 -2231
- package/dist/cli.cjs +1183 -2231
- package/dist/index.cjs +109626 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +762 -1832
- package/dist/lib/commands/generators/base.d.ts +16 -5
- package/dist/lib/commands/generators/base.d.ts.map +1 -1
- package/dist/lib/commands/generators/typescript/databases.d.ts.map +1 -1
- package/dist/lib/commands/push.d.ts +1 -0
- package/dist/lib/commands/push.d.ts.map +1 -1
- package/dist/lib/commands/utils/attributes.d.ts +3 -1
- package/dist/lib/commands/utils/attributes.d.ts.map +1 -1
- package/dist/lib/commands/utils/pools.d.ts +3 -1
- package/dist/lib/commands/utils/pools.d.ts.map +1 -1
- package/dist/lib/constants.d.ts +1 -1
- package/dist/lib/json.d.ts.map +1 -1
- package/dist/lib/utils.d.ts +1 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/docs/examples/projects/create-schedule.md +7 -0
- package/docs/examples/projects/get-schedule.md +5 -0
- package/docs/examples/projects/list-schedules.md +4 -0
- package/index.ts +1 -0
- package/install.ps1 +2 -2
- package/install.sh +1 -1
- package/lib/commands/generators/base.ts +30 -9
- package/lib/commands/generators/typescript/databases.ts +12 -18
- package/lib/commands/push.ts +276 -201
- package/lib/commands/services/migrations.ts +1 -1
- package/lib/commands/services/projects.ts +51 -0
- package/lib/commands/utils/attributes.ts +9 -6
- package/lib/commands/utils/pools.ts +9 -6
- package/lib/constants.ts +1 -1
- package/lib/json.ts +8 -6
- package/lib/utils.ts +15 -0
- package/package.json +19 -5
- package/scoop/appwrite.config.json +3 -3
package/dist/cli.cjs
CHANGED
|
@@ -21975,7 +21975,6 @@ var require_safe_buffer = __commonJS({
|
|
|
21975
21975
|
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
21976
21976
|
return Buffer2(arg, encodingOrOffset, length);
|
|
21977
21977
|
}
|
|
21978
|
-
SafeBuffer.prototype = Object.create(Buffer2.prototype);
|
|
21979
21978
|
copyProps(Buffer2, SafeBuffer);
|
|
21980
21979
|
SafeBuffer.from = function(arg, encodingOrOffset, length) {
|
|
21981
21980
|
if (typeof arg === "number") {
|
|
@@ -53947,14 +53946,14 @@ var require_undici = __commonJS({
|
|
|
53947
53946
|
}
|
|
53948
53947
|
});
|
|
53949
53948
|
|
|
53950
|
-
// node_modules/
|
|
53949
|
+
// node_modules/bignumber.js/bignumber.js
|
|
53951
53950
|
var require_bignumber = __commonJS({
|
|
53952
|
-
"node_modules/
|
|
53951
|
+
"node_modules/bignumber.js/bignumber.js"(exports2, module2) {
|
|
53953
53952
|
(function(globalObject) {
|
|
53954
53953
|
"use strict";
|
|
53955
|
-
var
|
|
53954
|
+
var BigNumber, isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, mathceil = Math.ceil, mathfloor = Math.floor, bignumberError = "[BigNumber Error] ", tooManyDigits = bignumberError + "Number primitive has more than 15 significant digits: ", BASE = 1e14, LOG_BASE = 14, MAX_SAFE_INTEGER = 9007199254740991, POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], SQRT_BASE = 1e7, MAX = 1e9;
|
|
53956
53955
|
function clone2(configObject) {
|
|
53957
|
-
var div, convertBase, parseNumeric, P =
|
|
53956
|
+
var div, convertBase, parseNumeric, P = BigNumber2.prototype = { constructor: BigNumber2, toString: null, valueOf: null }, ONE = new BigNumber2(1), DECIMAL_PLACES = 20, ROUNDING_MODE = 4, TO_EXP_NEG = -7, TO_EXP_POS = 21, MIN_EXP = -1e7, MAX_EXP = 1e7, CRYPTO = false, MODULO_MODE = 1, POW_PRECISION = 0, FORMAT = {
|
|
53958
53957
|
prefix: "",
|
|
53959
53958
|
groupSize: 3,
|
|
53960
53959
|
secondaryGroupSize: 0,
|
|
@@ -53965,9 +53964,9 @@ var require_bignumber = __commonJS({
|
|
|
53965
53964
|
// non-breaking space
|
|
53966
53965
|
suffix: ""
|
|
53967
53966
|
}, ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz", alphabetHasNormalDecimalDigits = true;
|
|
53968
|
-
function
|
|
53967
|
+
function BigNumber2(v, b) {
|
|
53969
53968
|
var alphabet, c, caseChanged, e, i, isNum, len, str, x = this;
|
|
53970
|
-
if (!(x instanceof
|
|
53969
|
+
if (!(x instanceof BigNumber2)) return new BigNumber2(v, b);
|
|
53971
53970
|
if (b == null) {
|
|
53972
53971
|
if (v && v._isBigNumber === true) {
|
|
53973
53972
|
x.s = v.s;
|
|
@@ -54009,1774 +54008,14 @@ var require_bignumber = __commonJS({
|
|
|
54009
54008
|
} else {
|
|
54010
54009
|
intCheck(b, 2, ALPHABET.length, "Base");
|
|
54011
54010
|
if (b == 10 && alphabetHasNormalDecimalDigits) {
|
|
54012
|
-
x = new
|
|
54013
|
-
return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE);
|
|
54014
|
-
}
|
|
54015
|
-
str = String(v);
|
|
54016
|
-
if (isNum = typeof v == "number") {
|
|
54017
|
-
if (v * 0 != 0) return parseNumeric(x, str, isNum, b);
|
|
54018
|
-
x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1;
|
|
54019
|
-
if (BigNumber3.DEBUG && str.replace(/^0\.0*|\./, "").length > 15) {
|
|
54020
|
-
throw Error(tooManyDigits + v);
|
|
54021
|
-
}
|
|
54022
|
-
} else {
|
|
54023
|
-
x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;
|
|
54024
|
-
}
|
|
54025
|
-
alphabet = ALPHABET.slice(0, b);
|
|
54026
|
-
e = i = 0;
|
|
54027
|
-
for (len = str.length; i < len; i++) {
|
|
54028
|
-
if (alphabet.indexOf(c = str.charAt(i)) < 0) {
|
|
54029
|
-
if (c == ".") {
|
|
54030
|
-
if (i > e) {
|
|
54031
|
-
e = len;
|
|
54032
|
-
continue;
|
|
54033
|
-
}
|
|
54034
|
-
} else if (!caseChanged) {
|
|
54035
|
-
if (str == str.toUpperCase() && (str = str.toLowerCase()) || str == str.toLowerCase() && (str = str.toUpperCase())) {
|
|
54036
|
-
caseChanged = true;
|
|
54037
|
-
i = -1;
|
|
54038
|
-
e = 0;
|
|
54039
|
-
continue;
|
|
54040
|
-
}
|
|
54041
|
-
}
|
|
54042
|
-
return parseNumeric(x, String(v), isNum, b);
|
|
54043
|
-
}
|
|
54044
|
-
}
|
|
54045
|
-
isNum = false;
|
|
54046
|
-
str = convertBase(str, b, 10, x.s);
|
|
54047
|
-
if ((e = str.indexOf(".")) > -1) str = str.replace(".", "");
|
|
54048
|
-
else e = str.length;
|
|
54049
|
-
}
|
|
54050
|
-
for (i = 0; str.charCodeAt(i) === 48; i++) ;
|
|
54051
|
-
for (len = str.length; str.charCodeAt(--len) === 48; ) ;
|
|
54052
|
-
if (str = str.slice(i, ++len)) {
|
|
54053
|
-
len -= i;
|
|
54054
|
-
if (isNum && BigNumber3.DEBUG && len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) {
|
|
54055
|
-
throw Error(tooManyDigits + x.s * v);
|
|
54056
|
-
}
|
|
54057
|
-
if ((e = e - i - 1) > MAX_EXP) {
|
|
54058
|
-
x.c = x.e = null;
|
|
54059
|
-
} else if (e < MIN_EXP) {
|
|
54060
|
-
x.c = [x.e = 0];
|
|
54061
|
-
} else {
|
|
54062
|
-
x.e = e;
|
|
54063
|
-
x.c = [];
|
|
54064
|
-
i = (e + 1) % LOG_BASE;
|
|
54065
|
-
if (e < 0) i += LOG_BASE;
|
|
54066
|
-
if (i < len) {
|
|
54067
|
-
if (i) x.c.push(+str.slice(0, i));
|
|
54068
|
-
for (len -= LOG_BASE; i < len; ) {
|
|
54069
|
-
x.c.push(+str.slice(i, i += LOG_BASE));
|
|
54070
|
-
}
|
|
54071
|
-
i = LOG_BASE - (str = str.slice(i)).length;
|
|
54072
|
-
} else {
|
|
54073
|
-
i -= len;
|
|
54074
|
-
}
|
|
54075
|
-
for (; i--; str += "0") ;
|
|
54076
|
-
x.c.push(+str);
|
|
54077
|
-
}
|
|
54078
|
-
} else {
|
|
54079
|
-
x.c = [x.e = 0];
|
|
54080
|
-
}
|
|
54081
|
-
}
|
|
54082
|
-
BigNumber3.clone = clone2;
|
|
54083
|
-
BigNumber3.ROUND_UP = 0;
|
|
54084
|
-
BigNumber3.ROUND_DOWN = 1;
|
|
54085
|
-
BigNumber3.ROUND_CEIL = 2;
|
|
54086
|
-
BigNumber3.ROUND_FLOOR = 3;
|
|
54087
|
-
BigNumber3.ROUND_HALF_UP = 4;
|
|
54088
|
-
BigNumber3.ROUND_HALF_DOWN = 5;
|
|
54089
|
-
BigNumber3.ROUND_HALF_EVEN = 6;
|
|
54090
|
-
BigNumber3.ROUND_HALF_CEIL = 7;
|
|
54091
|
-
BigNumber3.ROUND_HALF_FLOOR = 8;
|
|
54092
|
-
BigNumber3.EUCLID = 9;
|
|
54093
|
-
BigNumber3.config = BigNumber3.set = function(obj) {
|
|
54094
|
-
var p, v;
|
|
54095
|
-
if (obj != null) {
|
|
54096
|
-
if (typeof obj == "object") {
|
|
54097
|
-
if (obj.hasOwnProperty(p = "DECIMAL_PLACES")) {
|
|
54098
|
-
v = obj[p];
|
|
54099
|
-
intCheck(v, 0, MAX, p);
|
|
54100
|
-
DECIMAL_PLACES = v;
|
|
54101
|
-
}
|
|
54102
|
-
if (obj.hasOwnProperty(p = "ROUNDING_MODE")) {
|
|
54103
|
-
v = obj[p];
|
|
54104
|
-
intCheck(v, 0, 8, p);
|
|
54105
|
-
ROUNDING_MODE = v;
|
|
54106
|
-
}
|
|
54107
|
-
if (obj.hasOwnProperty(p = "EXPONENTIAL_AT")) {
|
|
54108
|
-
v = obj[p];
|
|
54109
|
-
if (v && v.pop) {
|
|
54110
|
-
intCheck(v[0], -MAX, 0, p);
|
|
54111
|
-
intCheck(v[1], 0, MAX, p);
|
|
54112
|
-
TO_EXP_NEG = v[0];
|
|
54113
|
-
TO_EXP_POS = v[1];
|
|
54114
|
-
} else {
|
|
54115
|
-
intCheck(v, -MAX, MAX, p);
|
|
54116
|
-
TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);
|
|
54117
|
-
}
|
|
54118
|
-
}
|
|
54119
|
-
if (obj.hasOwnProperty(p = "RANGE")) {
|
|
54120
|
-
v = obj[p];
|
|
54121
|
-
if (v && v.pop) {
|
|
54122
|
-
intCheck(v[0], -MAX, -1, p);
|
|
54123
|
-
intCheck(v[1], 1, MAX, p);
|
|
54124
|
-
MIN_EXP = v[0];
|
|
54125
|
-
MAX_EXP = v[1];
|
|
54126
|
-
} else {
|
|
54127
|
-
intCheck(v, -MAX, MAX, p);
|
|
54128
|
-
if (v) {
|
|
54129
|
-
MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);
|
|
54130
|
-
} else {
|
|
54131
|
-
throw Error(bignumberError + p + " cannot be zero: " + v);
|
|
54132
|
-
}
|
|
54133
|
-
}
|
|
54134
|
-
}
|
|
54135
|
-
if (obj.hasOwnProperty(p = "CRYPTO")) {
|
|
54136
|
-
v = obj[p];
|
|
54137
|
-
if (v === !!v) {
|
|
54138
|
-
if (v) {
|
|
54139
|
-
if (typeof crypto != "undefined" && crypto && (crypto.getRandomValues || crypto.randomBytes)) {
|
|
54140
|
-
CRYPTO = v;
|
|
54141
|
-
} else {
|
|
54142
|
-
CRYPTO = !v;
|
|
54143
|
-
throw Error(bignumberError + "crypto unavailable");
|
|
54144
|
-
}
|
|
54145
|
-
} else {
|
|
54146
|
-
CRYPTO = v;
|
|
54147
|
-
}
|
|
54148
|
-
} else {
|
|
54149
|
-
throw Error(bignumberError + p + " not true or false: " + v);
|
|
54150
|
-
}
|
|
54151
|
-
}
|
|
54152
|
-
if (obj.hasOwnProperty(p = "MODULO_MODE")) {
|
|
54153
|
-
v = obj[p];
|
|
54154
|
-
intCheck(v, 0, 9, p);
|
|
54155
|
-
MODULO_MODE = v;
|
|
54156
|
-
}
|
|
54157
|
-
if (obj.hasOwnProperty(p = "POW_PRECISION")) {
|
|
54158
|
-
v = obj[p];
|
|
54159
|
-
intCheck(v, 0, MAX, p);
|
|
54160
|
-
POW_PRECISION = v;
|
|
54161
|
-
}
|
|
54162
|
-
if (obj.hasOwnProperty(p = "FORMAT")) {
|
|
54163
|
-
v = obj[p];
|
|
54164
|
-
if (typeof v == "object") FORMAT = v;
|
|
54165
|
-
else throw Error(bignumberError + p + " not an object: " + v);
|
|
54166
|
-
}
|
|
54167
|
-
if (obj.hasOwnProperty(p = "ALPHABET")) {
|
|
54168
|
-
v = obj[p];
|
|
54169
|
-
if (typeof v == "string" && !/^.?$|[+\-.\s]|(.).*\1/.test(v)) {
|
|
54170
|
-
alphabetHasNormalDecimalDigits = v.slice(0, 10) == "0123456789";
|
|
54171
|
-
ALPHABET = v;
|
|
54172
|
-
} else {
|
|
54173
|
-
throw Error(bignumberError + p + " invalid: " + v);
|
|
54174
|
-
}
|
|
54175
|
-
}
|
|
54176
|
-
} else {
|
|
54177
|
-
throw Error(bignumberError + "Object expected: " + obj);
|
|
54178
|
-
}
|
|
54179
|
-
}
|
|
54180
|
-
return {
|
|
54181
|
-
DECIMAL_PLACES,
|
|
54182
|
-
ROUNDING_MODE,
|
|
54183
|
-
EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS],
|
|
54184
|
-
RANGE: [MIN_EXP, MAX_EXP],
|
|
54185
|
-
CRYPTO,
|
|
54186
|
-
MODULO_MODE,
|
|
54187
|
-
POW_PRECISION,
|
|
54188
|
-
FORMAT,
|
|
54189
|
-
ALPHABET
|
|
54190
|
-
};
|
|
54191
|
-
};
|
|
54192
|
-
BigNumber3.isBigNumber = function(v) {
|
|
54193
|
-
if (!v || v._isBigNumber !== true) return false;
|
|
54194
|
-
if (!BigNumber3.DEBUG) return true;
|
|
54195
|
-
var i, n, c = v.c, e = v.e, s = v.s;
|
|
54196
|
-
out: if ({}.toString.call(c) == "[object Array]") {
|
|
54197
|
-
if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) {
|
|
54198
|
-
if (c[0] === 0) {
|
|
54199
|
-
if (e === 0 && c.length === 1) return true;
|
|
54200
|
-
break out;
|
|
54201
|
-
}
|
|
54202
|
-
i = (e + 1) % LOG_BASE;
|
|
54203
|
-
if (i < 1) i += LOG_BASE;
|
|
54204
|
-
if (String(c[0]).length == i) {
|
|
54205
|
-
for (i = 0; i < c.length; i++) {
|
|
54206
|
-
n = c[i];
|
|
54207
|
-
if (n < 0 || n >= BASE || n !== mathfloor(n)) break out;
|
|
54208
|
-
}
|
|
54209
|
-
if (n !== 0) return true;
|
|
54210
|
-
}
|
|
54211
|
-
}
|
|
54212
|
-
} else if (c === null && e === null && (s === null || s === 1 || s === -1)) {
|
|
54213
|
-
return true;
|
|
54214
|
-
}
|
|
54215
|
-
throw Error(bignumberError + "Invalid BigNumber: " + v);
|
|
54216
|
-
};
|
|
54217
|
-
BigNumber3.maximum = BigNumber3.max = function() {
|
|
54218
|
-
return maxOrMin(arguments, -1);
|
|
54219
|
-
};
|
|
54220
|
-
BigNumber3.minimum = BigNumber3.min = function() {
|
|
54221
|
-
return maxOrMin(arguments, 1);
|
|
54222
|
-
};
|
|
54223
|
-
BigNumber3.random = (function() {
|
|
54224
|
-
var pow2_53 = 9007199254740992;
|
|
54225
|
-
var random53bitInt = Math.random() * pow2_53 & 2097151 ? function() {
|
|
54226
|
-
return mathfloor(Math.random() * pow2_53);
|
|
54227
|
-
} : function() {
|
|
54228
|
-
return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
|
|
54229
|
-
};
|
|
54230
|
-
return function(dp) {
|
|
54231
|
-
var a, b, e, k, v, i = 0, c = [], rand = new BigNumber3(ONE);
|
|
54232
|
-
if (dp == null) dp = DECIMAL_PLACES;
|
|
54233
|
-
else intCheck(dp, 0, MAX);
|
|
54234
|
-
k = mathceil(dp / LOG_BASE);
|
|
54235
|
-
if (CRYPTO) {
|
|
54236
|
-
if (crypto.getRandomValues) {
|
|
54237
|
-
a = crypto.getRandomValues(new Uint32Array(k *= 2));
|
|
54238
|
-
for (; i < k; ) {
|
|
54239
|
-
v = a[i] * 131072 + (a[i + 1] >>> 11);
|
|
54240
|
-
if (v >= 9e15) {
|
|
54241
|
-
b = crypto.getRandomValues(new Uint32Array(2));
|
|
54242
|
-
a[i] = b[0];
|
|
54243
|
-
a[i + 1] = b[1];
|
|
54244
|
-
} else {
|
|
54245
|
-
c.push(v % 1e14);
|
|
54246
|
-
i += 2;
|
|
54247
|
-
}
|
|
54248
|
-
}
|
|
54249
|
-
i = k / 2;
|
|
54250
|
-
} else if (crypto.randomBytes) {
|
|
54251
|
-
a = crypto.randomBytes(k *= 7);
|
|
54252
|
-
for (; i < k; ) {
|
|
54253
|
-
v = (a[i] & 31) * 281474976710656 + a[i + 1] * 1099511627776 + a[i + 2] * 4294967296 + a[i + 3] * 16777216 + (a[i + 4] << 16) + (a[i + 5] << 8) + a[i + 6];
|
|
54254
|
-
if (v >= 9e15) {
|
|
54255
|
-
crypto.randomBytes(7).copy(a, i);
|
|
54256
|
-
} else {
|
|
54257
|
-
c.push(v % 1e14);
|
|
54258
|
-
i += 7;
|
|
54259
|
-
}
|
|
54260
|
-
}
|
|
54261
|
-
i = k / 7;
|
|
54262
|
-
} else {
|
|
54263
|
-
CRYPTO = false;
|
|
54264
|
-
throw Error(bignumberError + "crypto unavailable");
|
|
54265
|
-
}
|
|
54266
|
-
}
|
|
54267
|
-
if (!CRYPTO) {
|
|
54268
|
-
for (; i < k; ) {
|
|
54269
|
-
v = random53bitInt();
|
|
54270
|
-
if (v < 9e15) c[i++] = v % 1e14;
|
|
54271
|
-
}
|
|
54272
|
-
}
|
|
54273
|
-
k = c[--i];
|
|
54274
|
-
dp %= LOG_BASE;
|
|
54275
|
-
if (k && dp) {
|
|
54276
|
-
v = POWS_TEN[LOG_BASE - dp];
|
|
54277
|
-
c[i] = mathfloor(k / v) * v;
|
|
54278
|
-
}
|
|
54279
|
-
for (; c[i] === 0; c.pop(), i--) ;
|
|
54280
|
-
if (i < 0) {
|
|
54281
|
-
c = [e = 0];
|
|
54282
|
-
} else {
|
|
54283
|
-
for (e = -1; c[0] === 0; c.splice(0, 1), e -= LOG_BASE) ;
|
|
54284
|
-
for (i = 1, v = c[0]; v >= 10; v /= 10, i++) ;
|
|
54285
|
-
if (i < LOG_BASE) e -= LOG_BASE - i;
|
|
54286
|
-
}
|
|
54287
|
-
rand.e = e;
|
|
54288
|
-
rand.c = c;
|
|
54289
|
-
return rand;
|
|
54290
|
-
};
|
|
54291
|
-
})();
|
|
54292
|
-
BigNumber3.sum = function() {
|
|
54293
|
-
var i = 1, args = arguments, sum = new BigNumber3(args[0]);
|
|
54294
|
-
for (; i < args.length; ) sum = sum.plus(args[i++]);
|
|
54295
|
-
return sum;
|
|
54296
|
-
};
|
|
54297
|
-
convertBase = /* @__PURE__ */ (function() {
|
|
54298
|
-
var decimal = "0123456789";
|
|
54299
|
-
function toBaseOut(str, baseIn, baseOut, alphabet) {
|
|
54300
|
-
var j, arr = [0], arrL, i = 0, len = str.length;
|
|
54301
|
-
for (; i < len; ) {
|
|
54302
|
-
for (arrL = arr.length; arrL--; arr[arrL] *= baseIn) ;
|
|
54303
|
-
arr[0] += alphabet.indexOf(str.charAt(i++));
|
|
54304
|
-
for (j = 0; j < arr.length; j++) {
|
|
54305
|
-
if (arr[j] > baseOut - 1) {
|
|
54306
|
-
if (arr[j + 1] == null) arr[j + 1] = 0;
|
|
54307
|
-
arr[j + 1] += arr[j] / baseOut | 0;
|
|
54308
|
-
arr[j] %= baseOut;
|
|
54309
|
-
}
|
|
54310
|
-
}
|
|
54311
|
-
}
|
|
54312
|
-
return arr.reverse();
|
|
54313
|
-
}
|
|
54314
|
-
return function(str, baseIn, baseOut, sign, callerIsToString) {
|
|
54315
|
-
var alphabet, d, e, k, r, x, xc, y, i = str.indexOf("."), dp = DECIMAL_PLACES, rm = ROUNDING_MODE;
|
|
54316
|
-
if (i >= 0) {
|
|
54317
|
-
k = POW_PRECISION;
|
|
54318
|
-
POW_PRECISION = 0;
|
|
54319
|
-
str = str.replace(".", "");
|
|
54320
|
-
y = new BigNumber3(baseIn);
|
|
54321
|
-
x = y.pow(str.length - i);
|
|
54322
|
-
POW_PRECISION = k;
|
|
54323
|
-
y.c = toBaseOut(
|
|
54324
|
-
toFixedPoint(coeffToString(x.c), x.e, "0"),
|
|
54325
|
-
10,
|
|
54326
|
-
baseOut,
|
|
54327
|
-
decimal
|
|
54328
|
-
);
|
|
54329
|
-
y.e = y.c.length;
|
|
54330
|
-
}
|
|
54331
|
-
xc = toBaseOut(str, baseIn, baseOut, callerIsToString ? (alphabet = ALPHABET, decimal) : (alphabet = decimal, ALPHABET));
|
|
54332
|
-
e = k = xc.length;
|
|
54333
|
-
for (; xc[--k] == 0; xc.pop()) ;
|
|
54334
|
-
if (!xc[0]) return alphabet.charAt(0);
|
|
54335
|
-
if (i < 0) {
|
|
54336
|
-
--e;
|
|
54337
|
-
} else {
|
|
54338
|
-
x.c = xc;
|
|
54339
|
-
x.e = e;
|
|
54340
|
-
x.s = sign;
|
|
54341
|
-
x = div(x, y, dp, rm, baseOut);
|
|
54342
|
-
xc = x.c;
|
|
54343
|
-
r = x.r;
|
|
54344
|
-
e = x.e;
|
|
54345
|
-
}
|
|
54346
|
-
d = e + dp + 1;
|
|
54347
|
-
i = xc[d];
|
|
54348
|
-
k = baseOut / 2;
|
|
54349
|
-
r = r || d < 0 || xc[d + 1] != null;
|
|
54350
|
-
r = rm < 4 ? (i != null || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : i > k || i == k && (rm == 4 || r || rm == 6 && xc[d - 1] & 1 || rm == (x.s < 0 ? 8 : 7));
|
|
54351
|
-
if (d < 1 || !xc[0]) {
|
|
54352
|
-
str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0);
|
|
54353
|
-
} else {
|
|
54354
|
-
xc.length = d;
|
|
54355
|
-
if (r) {
|
|
54356
|
-
for (--baseOut; ++xc[--d] > baseOut; ) {
|
|
54357
|
-
xc[d] = 0;
|
|
54358
|
-
if (!d) {
|
|
54359
|
-
++e;
|
|
54360
|
-
xc = [1].concat(xc);
|
|
54361
|
-
}
|
|
54362
|
-
}
|
|
54363
|
-
}
|
|
54364
|
-
for (k = xc.length; !xc[--k]; ) ;
|
|
54365
|
-
for (i = 0, str = ""; i <= k; str += alphabet.charAt(xc[i++])) ;
|
|
54366
|
-
str = toFixedPoint(str, e, alphabet.charAt(0));
|
|
54367
|
-
}
|
|
54368
|
-
return str;
|
|
54369
|
-
};
|
|
54370
|
-
})();
|
|
54371
|
-
div = /* @__PURE__ */ (function() {
|
|
54372
|
-
function multiply(x, k, base) {
|
|
54373
|
-
var m, temp, xlo, xhi, carry = 0, i = x.length, klo = k % SQRT_BASE, khi = k / SQRT_BASE | 0;
|
|
54374
|
-
for (x = x.slice(); i--; ) {
|
|
54375
|
-
xlo = x[i] % SQRT_BASE;
|
|
54376
|
-
xhi = x[i] / SQRT_BASE | 0;
|
|
54377
|
-
m = khi * xlo + xhi * klo;
|
|
54378
|
-
temp = klo * xlo + m % SQRT_BASE * SQRT_BASE + carry;
|
|
54379
|
-
carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi;
|
|
54380
|
-
x[i] = temp % base;
|
|
54381
|
-
}
|
|
54382
|
-
if (carry) x = [carry].concat(x);
|
|
54383
|
-
return x;
|
|
54384
|
-
}
|
|
54385
|
-
function compare2(a, b, aL, bL) {
|
|
54386
|
-
var i, cmp;
|
|
54387
|
-
if (aL != bL) {
|
|
54388
|
-
cmp = aL > bL ? 1 : -1;
|
|
54389
|
-
} else {
|
|
54390
|
-
for (i = cmp = 0; i < aL; i++) {
|
|
54391
|
-
if (a[i] != b[i]) {
|
|
54392
|
-
cmp = a[i] > b[i] ? 1 : -1;
|
|
54393
|
-
break;
|
|
54394
|
-
}
|
|
54395
|
-
}
|
|
54396
|
-
}
|
|
54397
|
-
return cmp;
|
|
54398
|
-
}
|
|
54399
|
-
function subtract(a, b, aL, base) {
|
|
54400
|
-
var i = 0;
|
|
54401
|
-
for (; aL--; ) {
|
|
54402
|
-
a[aL] -= i;
|
|
54403
|
-
i = a[aL] < b[aL] ? 1 : 0;
|
|
54404
|
-
a[aL] = i * base + a[aL] - b[aL];
|
|
54405
|
-
}
|
|
54406
|
-
for (; !a[0] && a.length > 1; a.splice(0, 1)) ;
|
|
54407
|
-
}
|
|
54408
|
-
return function(x, y, dp, rm, base) {
|
|
54409
|
-
var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0, yL, yz, s = x.s == y.s ? 1 : -1, xc = x.c, yc = y.c;
|
|
54410
|
-
if (!xc || !xc[0] || !yc || !yc[0]) {
|
|
54411
|
-
return new BigNumber3(
|
|
54412
|
-
// Return NaN if either NaN, or both Infinity or 0.
|
|
54413
|
-
!x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : (
|
|
54414
|
-
// Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
|
|
54415
|
-
xc && xc[0] == 0 || !yc ? s * 0 : s / 0
|
|
54416
|
-
)
|
|
54417
|
-
);
|
|
54418
|
-
}
|
|
54419
|
-
q = new BigNumber3(s);
|
|
54420
|
-
qc = q.c = [];
|
|
54421
|
-
e = x.e - y.e;
|
|
54422
|
-
s = dp + e + 1;
|
|
54423
|
-
if (!base) {
|
|
54424
|
-
base = BASE;
|
|
54425
|
-
e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE);
|
|
54426
|
-
s = s / LOG_BASE | 0;
|
|
54427
|
-
}
|
|
54428
|
-
for (i = 0; yc[i] == (xc[i] || 0); i++) ;
|
|
54429
|
-
if (yc[i] > (xc[i] || 0)) e--;
|
|
54430
|
-
if (s < 0) {
|
|
54431
|
-
qc.push(1);
|
|
54432
|
-
more = true;
|
|
54433
|
-
} else {
|
|
54434
|
-
xL = xc.length;
|
|
54435
|
-
yL = yc.length;
|
|
54436
|
-
i = 0;
|
|
54437
|
-
s += 2;
|
|
54438
|
-
n = mathfloor(base / (yc[0] + 1));
|
|
54439
|
-
if (n > 1) {
|
|
54440
|
-
yc = multiply(yc, n, base);
|
|
54441
|
-
xc = multiply(xc, n, base);
|
|
54442
|
-
yL = yc.length;
|
|
54443
|
-
xL = xc.length;
|
|
54444
|
-
}
|
|
54445
|
-
xi = yL;
|
|
54446
|
-
rem = xc.slice(0, yL);
|
|
54447
|
-
remL = rem.length;
|
|
54448
|
-
for (; remL < yL; rem[remL++] = 0) ;
|
|
54449
|
-
yz = yc.slice();
|
|
54450
|
-
yz = [0].concat(yz);
|
|
54451
|
-
yc0 = yc[0];
|
|
54452
|
-
if (yc[1] >= base / 2) yc0++;
|
|
54453
|
-
do {
|
|
54454
|
-
n = 0;
|
|
54455
|
-
cmp = compare2(yc, rem, yL, remL);
|
|
54456
|
-
if (cmp < 0) {
|
|
54457
|
-
rem0 = rem[0];
|
|
54458
|
-
if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);
|
|
54459
|
-
n = mathfloor(rem0 / yc0);
|
|
54460
|
-
if (n > 1) {
|
|
54461
|
-
if (n >= base) n = base - 1;
|
|
54462
|
-
prod = multiply(yc, n, base);
|
|
54463
|
-
prodL = prod.length;
|
|
54464
|
-
remL = rem.length;
|
|
54465
|
-
while (compare2(prod, rem, prodL, remL) == 1) {
|
|
54466
|
-
n--;
|
|
54467
|
-
subtract(prod, yL < prodL ? yz : yc, prodL, base);
|
|
54468
|
-
prodL = prod.length;
|
|
54469
|
-
cmp = 1;
|
|
54470
|
-
}
|
|
54471
|
-
} else {
|
|
54472
|
-
if (n == 0) {
|
|
54473
|
-
cmp = n = 1;
|
|
54474
|
-
}
|
|
54475
|
-
prod = yc.slice();
|
|
54476
|
-
prodL = prod.length;
|
|
54477
|
-
}
|
|
54478
|
-
if (prodL < remL) prod = [0].concat(prod);
|
|
54479
|
-
subtract(rem, prod, remL, base);
|
|
54480
|
-
remL = rem.length;
|
|
54481
|
-
if (cmp == -1) {
|
|
54482
|
-
while (compare2(yc, rem, yL, remL) < 1) {
|
|
54483
|
-
n++;
|
|
54484
|
-
subtract(rem, yL < remL ? yz : yc, remL, base);
|
|
54485
|
-
remL = rem.length;
|
|
54486
|
-
}
|
|
54487
|
-
}
|
|
54488
|
-
} else if (cmp === 0) {
|
|
54489
|
-
n++;
|
|
54490
|
-
rem = [0];
|
|
54491
|
-
}
|
|
54492
|
-
qc[i++] = n;
|
|
54493
|
-
if (rem[0]) {
|
|
54494
|
-
rem[remL++] = xc[xi] || 0;
|
|
54495
|
-
} else {
|
|
54496
|
-
rem = [xc[xi]];
|
|
54497
|
-
remL = 1;
|
|
54498
|
-
}
|
|
54499
|
-
} while ((xi++ < xL || rem[0] != null) && s--);
|
|
54500
|
-
more = rem[0] != null;
|
|
54501
|
-
if (!qc[0]) qc.splice(0, 1);
|
|
54502
|
-
}
|
|
54503
|
-
if (base == BASE) {
|
|
54504
|
-
for (i = 1, s = qc[0]; s >= 10; s /= 10, i++) ;
|
|
54505
|
-
round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more);
|
|
54506
|
-
} else {
|
|
54507
|
-
q.e = e;
|
|
54508
|
-
q.r = +more;
|
|
54509
|
-
}
|
|
54510
|
-
return q;
|
|
54511
|
-
};
|
|
54512
|
-
})();
|
|
54513
|
-
function format(n, i, rm, id) {
|
|
54514
|
-
var c0, e, ne, len, str;
|
|
54515
|
-
if (rm == null) rm = ROUNDING_MODE;
|
|
54516
|
-
else intCheck(rm, 0, 8);
|
|
54517
|
-
if (!n.c) return n.toString();
|
|
54518
|
-
c0 = n.c[0];
|
|
54519
|
-
ne = n.e;
|
|
54520
|
-
if (i == null) {
|
|
54521
|
-
str = coeffToString(n.c);
|
|
54522
|
-
str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS) ? toExponential(str, ne) : toFixedPoint(str, ne, "0");
|
|
54523
|
-
} else {
|
|
54524
|
-
n = round(new BigNumber3(n), i, rm);
|
|
54525
|
-
e = n.e;
|
|
54526
|
-
str = coeffToString(n.c);
|
|
54527
|
-
len = str.length;
|
|
54528
|
-
if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) {
|
|
54529
|
-
for (; len < i; str += "0", len++) ;
|
|
54530
|
-
str = toExponential(str, e);
|
|
54531
|
-
} else {
|
|
54532
|
-
i -= ne + (id === 2 && e > ne);
|
|
54533
|
-
str = toFixedPoint(str, e, "0");
|
|
54534
|
-
if (e + 1 > len) {
|
|
54535
|
-
if (--i > 0) for (str += "."; i--; str += "0") ;
|
|
54536
|
-
} else {
|
|
54537
|
-
i += e - len;
|
|
54538
|
-
if (i > 0) {
|
|
54539
|
-
if (e + 1 == len) str += ".";
|
|
54540
|
-
for (; i--; str += "0") ;
|
|
54541
|
-
}
|
|
54542
|
-
}
|
|
54543
|
-
}
|
|
54544
|
-
}
|
|
54545
|
-
return n.s < 0 && c0 ? "-" + str : str;
|
|
54546
|
-
}
|
|
54547
|
-
function maxOrMin(args, n) {
|
|
54548
|
-
var k, y, i = 1, x = new BigNumber3(args[0]);
|
|
54549
|
-
for (; i < args.length; i++) {
|
|
54550
|
-
y = new BigNumber3(args[i]);
|
|
54551
|
-
if (!y.s || (k = compare(x, y)) === n || k === 0 && x.s === n) {
|
|
54552
|
-
x = y;
|
|
54553
|
-
}
|
|
54554
|
-
}
|
|
54555
|
-
return x;
|
|
54556
|
-
}
|
|
54557
|
-
function normalise(n, c, e) {
|
|
54558
|
-
var i = 1, j = c.length;
|
|
54559
|
-
for (; !c[--j]; c.pop()) ;
|
|
54560
|
-
for (j = c[0]; j >= 10; j /= 10, i++) ;
|
|
54561
|
-
if ((e = i + e * LOG_BASE - 1) > MAX_EXP) {
|
|
54562
|
-
n.c = n.e = null;
|
|
54563
|
-
} else if (e < MIN_EXP) {
|
|
54564
|
-
n.c = [n.e = 0];
|
|
54565
|
-
} else {
|
|
54566
|
-
n.e = e;
|
|
54567
|
-
n.c = c;
|
|
54568
|
-
}
|
|
54569
|
-
return n;
|
|
54570
|
-
}
|
|
54571
|
-
parseNumeric = /* @__PURE__ */ (function() {
|
|
54572
|
-
var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, dotAfter = /^([^.]+)\.$/, dotBefore = /^\.([^.]+)$/, isInfinityOrNaN = /^-?(Infinity|NaN)$/, whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
|
|
54573
|
-
return function(x, str, isNum, b) {
|
|
54574
|
-
var base, s = isNum ? str : str.replace(whitespaceOrPlus, "");
|
|
54575
|
-
if (isInfinityOrNaN.test(s)) {
|
|
54576
|
-
x.s = isNaN(s) ? null : s < 0 ? -1 : 1;
|
|
54577
|
-
} else {
|
|
54578
|
-
if (!isNum) {
|
|
54579
|
-
s = s.replace(basePrefix, function(m, p1, p2) {
|
|
54580
|
-
base = (p2 = p2.toLowerCase()) == "x" ? 16 : p2 == "b" ? 2 : 8;
|
|
54581
|
-
return !b || b == base ? p1 : m;
|
|
54582
|
-
});
|
|
54583
|
-
if (b) {
|
|
54584
|
-
base = b;
|
|
54585
|
-
s = s.replace(dotAfter, "$1").replace(dotBefore, "0.$1");
|
|
54586
|
-
}
|
|
54587
|
-
if (str != s) return new BigNumber3(s, base);
|
|
54588
|
-
}
|
|
54589
|
-
if (BigNumber3.DEBUG) {
|
|
54590
|
-
throw Error(bignumberError + "Not a" + (b ? " base " + b : "") + " number: " + str);
|
|
54591
|
-
}
|
|
54592
|
-
x.s = null;
|
|
54593
|
-
}
|
|
54594
|
-
x.c = x.e = null;
|
|
54595
|
-
};
|
|
54596
|
-
})();
|
|
54597
|
-
function round(x, sd, rm, r) {
|
|
54598
|
-
var d, i, j, k, n, ni, rd, xc = x.c, pows10 = POWS_TEN;
|
|
54599
|
-
if (xc) {
|
|
54600
|
-
out: {
|
|
54601
|
-
for (d = 1, k = xc[0]; k >= 10; k /= 10, d++) ;
|
|
54602
|
-
i = sd - d;
|
|
54603
|
-
if (i < 0) {
|
|
54604
|
-
i += LOG_BASE;
|
|
54605
|
-
j = sd;
|
|
54606
|
-
n = xc[ni = 0];
|
|
54607
|
-
rd = mathfloor(n / pows10[d - j - 1] % 10);
|
|
54608
|
-
} else {
|
|
54609
|
-
ni = mathceil((i + 1) / LOG_BASE);
|
|
54610
|
-
if (ni >= xc.length) {
|
|
54611
|
-
if (r) {
|
|
54612
|
-
for (; xc.length <= ni; xc.push(0)) ;
|
|
54613
|
-
n = rd = 0;
|
|
54614
|
-
d = 1;
|
|
54615
|
-
i %= LOG_BASE;
|
|
54616
|
-
j = i - LOG_BASE + 1;
|
|
54617
|
-
} else {
|
|
54618
|
-
break out;
|
|
54619
|
-
}
|
|
54620
|
-
} else {
|
|
54621
|
-
n = k = xc[ni];
|
|
54622
|
-
for (d = 1; k >= 10; k /= 10, d++) ;
|
|
54623
|
-
i %= LOG_BASE;
|
|
54624
|
-
j = i - LOG_BASE + d;
|
|
54625
|
-
rd = j < 0 ? 0 : mathfloor(n / pows10[d - j - 1] % 10);
|
|
54626
|
-
}
|
|
54627
|
-
}
|
|
54628
|
-
r = r || sd < 0 || // Are there any non-zero digits after the rounding digit?
|
|
54629
|
-
// The expression n % pows10[d - j - 1] returns all digits of n to the right
|
|
54630
|
-
// of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.
|
|
54631
|
-
xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]);
|
|
54632
|
-
r = rm < 4 ? (rd || r) && (rm == 0 || rm == (x.s < 0 ? 3 : 2)) : rd > 5 || rd == 5 && (rm == 4 || r || rm == 6 && // Check whether the digit to the left of the rounding digit is odd.
|
|
54633
|
-
(i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10 & 1 || rm == (x.s < 0 ? 8 : 7));
|
|
54634
|
-
if (sd < 1 || !xc[0]) {
|
|
54635
|
-
xc.length = 0;
|
|
54636
|
-
if (r) {
|
|
54637
|
-
sd -= x.e + 1;
|
|
54638
|
-
xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE];
|
|
54639
|
-
x.e = -sd || 0;
|
|
54640
|
-
} else {
|
|
54641
|
-
xc[0] = x.e = 0;
|
|
54642
|
-
}
|
|
54643
|
-
return x;
|
|
54644
|
-
}
|
|
54645
|
-
if (i == 0) {
|
|
54646
|
-
xc.length = ni;
|
|
54647
|
-
k = 1;
|
|
54648
|
-
ni--;
|
|
54649
|
-
} else {
|
|
54650
|
-
xc.length = ni + 1;
|
|
54651
|
-
k = pows10[LOG_BASE - i];
|
|
54652
|
-
xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0;
|
|
54653
|
-
}
|
|
54654
|
-
if (r) {
|
|
54655
|
-
for (; ; ) {
|
|
54656
|
-
if (ni == 0) {
|
|
54657
|
-
for (i = 1, j = xc[0]; j >= 10; j /= 10, i++) ;
|
|
54658
|
-
j = xc[0] += k;
|
|
54659
|
-
for (k = 1; j >= 10; j /= 10, k++) ;
|
|
54660
|
-
if (i != k) {
|
|
54661
|
-
x.e++;
|
|
54662
|
-
if (xc[0] == BASE) xc[0] = 1;
|
|
54663
|
-
}
|
|
54664
|
-
break;
|
|
54665
|
-
} else {
|
|
54666
|
-
xc[ni] += k;
|
|
54667
|
-
if (xc[ni] != BASE) break;
|
|
54668
|
-
xc[ni--] = 0;
|
|
54669
|
-
k = 1;
|
|
54670
|
-
}
|
|
54671
|
-
}
|
|
54672
|
-
}
|
|
54673
|
-
for (i = xc.length; xc[--i] === 0; xc.pop()) ;
|
|
54674
|
-
}
|
|
54675
|
-
if (x.e > MAX_EXP) {
|
|
54676
|
-
x.c = x.e = null;
|
|
54677
|
-
} else if (x.e < MIN_EXP) {
|
|
54678
|
-
x.c = [x.e = 0];
|
|
54679
|
-
}
|
|
54680
|
-
}
|
|
54681
|
-
return x;
|
|
54682
|
-
}
|
|
54683
|
-
function valueOf(n) {
|
|
54684
|
-
var str, e = n.e;
|
|
54685
|
-
if (e === null) return n.toString();
|
|
54686
|
-
str = coeffToString(n.c);
|
|
54687
|
-
str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(str, e) : toFixedPoint(str, e, "0");
|
|
54688
|
-
return n.s < 0 ? "-" + str : str;
|
|
54689
|
-
}
|
|
54690
|
-
P.absoluteValue = P.abs = function() {
|
|
54691
|
-
var x = new BigNumber3(this);
|
|
54692
|
-
if (x.s < 0) x.s = 1;
|
|
54693
|
-
return x;
|
|
54694
|
-
};
|
|
54695
|
-
P.comparedTo = function(y, b) {
|
|
54696
|
-
return compare(this, new BigNumber3(y, b));
|
|
54697
|
-
};
|
|
54698
|
-
P.decimalPlaces = P.dp = function(dp, rm) {
|
|
54699
|
-
var c, n, v, x = this;
|
|
54700
|
-
if (dp != null) {
|
|
54701
|
-
intCheck(dp, 0, MAX);
|
|
54702
|
-
if (rm == null) rm = ROUNDING_MODE;
|
|
54703
|
-
else intCheck(rm, 0, 8);
|
|
54704
|
-
return round(new BigNumber3(x), dp + x.e + 1, rm);
|
|
54705
|
-
}
|
|
54706
|
-
if (!(c = x.c)) return null;
|
|
54707
|
-
n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE;
|
|
54708
|
-
if (v = c[v]) for (; v % 10 == 0; v /= 10, n--) ;
|
|
54709
|
-
if (n < 0) n = 0;
|
|
54710
|
-
return n;
|
|
54711
|
-
};
|
|
54712
|
-
P.dividedBy = P.div = function(y, b) {
|
|
54713
|
-
return div(this, new BigNumber3(y, b), DECIMAL_PLACES, ROUNDING_MODE);
|
|
54714
|
-
};
|
|
54715
|
-
P.dividedToIntegerBy = P.idiv = function(y, b) {
|
|
54716
|
-
return div(this, new BigNumber3(y, b), 0, 1);
|
|
54717
|
-
};
|
|
54718
|
-
P.exponentiatedBy = P.pow = function(n, m) {
|
|
54719
|
-
var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y, x = this;
|
|
54720
|
-
n = new BigNumber3(n);
|
|
54721
|
-
if (n.c && !n.isInteger()) {
|
|
54722
|
-
throw Error(bignumberError + "Exponent not an integer: " + valueOf(n));
|
|
54723
|
-
}
|
|
54724
|
-
if (m != null) m = new BigNumber3(m);
|
|
54725
|
-
nIsBig = n.e > 14;
|
|
54726
|
-
if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) {
|
|
54727
|
-
y = new BigNumber3(Math.pow(+valueOf(x), nIsBig ? n.s * (2 - isOdd(n)) : +valueOf(n)));
|
|
54728
|
-
return m ? y.mod(m) : y;
|
|
54729
|
-
}
|
|
54730
|
-
nIsNeg = n.s < 0;
|
|
54731
|
-
if (m) {
|
|
54732
|
-
if (m.c ? !m.c[0] : !m.s) return new BigNumber3(NaN);
|
|
54733
|
-
isModExp = !nIsNeg && x.isInteger() && m.isInteger();
|
|
54734
|
-
if (isModExp) x = x.mod(m);
|
|
54735
|
-
} else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0 ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7 : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) {
|
|
54736
|
-
k = x.s < 0 && isOdd(n) ? -0 : 0;
|
|
54737
|
-
if (x.e > -1) k = 1 / k;
|
|
54738
|
-
return new BigNumber3(nIsNeg ? 1 / k : k);
|
|
54739
|
-
} else if (POW_PRECISION) {
|
|
54740
|
-
k = mathceil(POW_PRECISION / LOG_BASE + 2);
|
|
54741
|
-
}
|
|
54742
|
-
if (nIsBig) {
|
|
54743
|
-
half = new BigNumber3(0.5);
|
|
54744
|
-
if (nIsNeg) n.s = 1;
|
|
54745
|
-
nIsOdd = isOdd(n);
|
|
54746
|
-
} else {
|
|
54747
|
-
i = Math.abs(+valueOf(n));
|
|
54748
|
-
nIsOdd = i % 2;
|
|
54749
|
-
}
|
|
54750
|
-
y = new BigNumber3(ONE);
|
|
54751
|
-
for (; ; ) {
|
|
54752
|
-
if (nIsOdd) {
|
|
54753
|
-
y = y.times(x);
|
|
54754
|
-
if (!y.c) break;
|
|
54755
|
-
if (k) {
|
|
54756
|
-
if (y.c.length > k) y.c.length = k;
|
|
54757
|
-
} else if (isModExp) {
|
|
54758
|
-
y = y.mod(m);
|
|
54759
|
-
}
|
|
54760
|
-
}
|
|
54761
|
-
if (i) {
|
|
54762
|
-
i = mathfloor(i / 2);
|
|
54763
|
-
if (i === 0) break;
|
|
54764
|
-
nIsOdd = i % 2;
|
|
54765
|
-
} else {
|
|
54766
|
-
n = n.times(half);
|
|
54767
|
-
round(n, n.e + 1, 1);
|
|
54768
|
-
if (n.e > 14) {
|
|
54769
|
-
nIsOdd = isOdd(n);
|
|
54770
|
-
} else {
|
|
54771
|
-
i = +valueOf(n);
|
|
54772
|
-
if (i === 0) break;
|
|
54773
|
-
nIsOdd = i % 2;
|
|
54774
|
-
}
|
|
54775
|
-
}
|
|
54776
|
-
x = x.times(x);
|
|
54777
|
-
if (k) {
|
|
54778
|
-
if (x.c && x.c.length > k) x.c.length = k;
|
|
54779
|
-
} else if (isModExp) {
|
|
54780
|
-
x = x.mod(m);
|
|
54781
|
-
}
|
|
54782
|
-
}
|
|
54783
|
-
if (isModExp) return y;
|
|
54784
|
-
if (nIsNeg) y = ONE.div(y);
|
|
54785
|
-
return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y;
|
|
54786
|
-
};
|
|
54787
|
-
P.integerValue = function(rm) {
|
|
54788
|
-
var n = new BigNumber3(this);
|
|
54789
|
-
if (rm == null) rm = ROUNDING_MODE;
|
|
54790
|
-
else intCheck(rm, 0, 8);
|
|
54791
|
-
return round(n, n.e + 1, rm);
|
|
54792
|
-
};
|
|
54793
|
-
P.isEqualTo = P.eq = function(y, b) {
|
|
54794
|
-
return compare(this, new BigNumber3(y, b)) === 0;
|
|
54795
|
-
};
|
|
54796
|
-
P.isFinite = function() {
|
|
54797
|
-
return !!this.c;
|
|
54798
|
-
};
|
|
54799
|
-
P.isGreaterThan = P.gt = function(y, b) {
|
|
54800
|
-
return compare(this, new BigNumber3(y, b)) > 0;
|
|
54801
|
-
};
|
|
54802
|
-
P.isGreaterThanOrEqualTo = P.gte = function(y, b) {
|
|
54803
|
-
return (b = compare(this, new BigNumber3(y, b))) === 1 || b === 0;
|
|
54804
|
-
};
|
|
54805
|
-
P.isInteger = function() {
|
|
54806
|
-
return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2;
|
|
54807
|
-
};
|
|
54808
|
-
P.isLessThan = P.lt = function(y, b) {
|
|
54809
|
-
return compare(this, new BigNumber3(y, b)) < 0;
|
|
54810
|
-
};
|
|
54811
|
-
P.isLessThanOrEqualTo = P.lte = function(y, b) {
|
|
54812
|
-
return (b = compare(this, new BigNumber3(y, b))) === -1 || b === 0;
|
|
54813
|
-
};
|
|
54814
|
-
P.isNaN = function() {
|
|
54815
|
-
return !this.s;
|
|
54816
|
-
};
|
|
54817
|
-
P.isNegative = function() {
|
|
54818
|
-
return this.s < 0;
|
|
54819
|
-
};
|
|
54820
|
-
P.isPositive = function() {
|
|
54821
|
-
return this.s > 0;
|
|
54822
|
-
};
|
|
54823
|
-
P.isZero = function() {
|
|
54824
|
-
return !!this.c && this.c[0] == 0;
|
|
54825
|
-
};
|
|
54826
|
-
P.minus = function(y, b) {
|
|
54827
|
-
var i, j, t, xLTy, x = this, a = x.s;
|
|
54828
|
-
y = new BigNumber3(y, b);
|
|
54829
|
-
b = y.s;
|
|
54830
|
-
if (!a || !b) return new BigNumber3(NaN);
|
|
54831
|
-
if (a != b) {
|
|
54832
|
-
y.s = -b;
|
|
54833
|
-
return x.plus(y);
|
|
54834
|
-
}
|
|
54835
|
-
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
54836
|
-
if (!xe || !ye) {
|
|
54837
|
-
if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber3(yc ? x : NaN);
|
|
54838
|
-
if (!xc[0] || !yc[0]) {
|
|
54839
|
-
return yc[0] ? (y.s = -b, y) : new BigNumber3(xc[0] ? x : (
|
|
54840
|
-
// IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
|
|
54841
|
-
ROUNDING_MODE == 3 ? -0 : 0
|
|
54842
|
-
));
|
|
54843
|
-
}
|
|
54844
|
-
}
|
|
54845
|
-
xe = bitFloor(xe);
|
|
54846
|
-
ye = bitFloor(ye);
|
|
54847
|
-
xc = xc.slice();
|
|
54848
|
-
if (a = xe - ye) {
|
|
54849
|
-
if (xLTy = a < 0) {
|
|
54850
|
-
a = -a;
|
|
54851
|
-
t = xc;
|
|
54852
|
-
} else {
|
|
54853
|
-
ye = xe;
|
|
54854
|
-
t = yc;
|
|
54855
|
-
}
|
|
54856
|
-
t.reverse();
|
|
54857
|
-
for (b = a; b--; t.push(0)) ;
|
|
54858
|
-
t.reverse();
|
|
54859
|
-
} else {
|
|
54860
|
-
j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b;
|
|
54861
|
-
for (a = b = 0; b < j; b++) {
|
|
54862
|
-
if (xc[b] != yc[b]) {
|
|
54863
|
-
xLTy = xc[b] < yc[b];
|
|
54864
|
-
break;
|
|
54865
|
-
}
|
|
54866
|
-
}
|
|
54867
|
-
}
|
|
54868
|
-
if (xLTy) {
|
|
54869
|
-
t = xc;
|
|
54870
|
-
xc = yc;
|
|
54871
|
-
yc = t;
|
|
54872
|
-
y.s = -y.s;
|
|
54873
|
-
}
|
|
54874
|
-
b = (j = yc.length) - (i = xc.length);
|
|
54875
|
-
if (b > 0) for (; b--; xc[i++] = 0) ;
|
|
54876
|
-
b = BASE - 1;
|
|
54877
|
-
for (; j > a; ) {
|
|
54878
|
-
if (xc[--j] < yc[j]) {
|
|
54879
|
-
for (i = j; i && !xc[--i]; xc[i] = b) ;
|
|
54880
|
-
--xc[i];
|
|
54881
|
-
xc[j] += BASE;
|
|
54882
|
-
}
|
|
54883
|
-
xc[j] -= yc[j];
|
|
54884
|
-
}
|
|
54885
|
-
for (; xc[0] == 0; xc.splice(0, 1), --ye) ;
|
|
54886
|
-
if (!xc[0]) {
|
|
54887
|
-
y.s = ROUNDING_MODE == 3 ? -1 : 1;
|
|
54888
|
-
y.c = [y.e = 0];
|
|
54889
|
-
return y;
|
|
54890
|
-
}
|
|
54891
|
-
return normalise(y, xc, ye);
|
|
54892
|
-
};
|
|
54893
|
-
P.modulo = P.mod = function(y, b) {
|
|
54894
|
-
var q, s, x = this;
|
|
54895
|
-
y = new BigNumber3(y, b);
|
|
54896
|
-
if (!x.c || !y.s || y.c && !y.c[0]) {
|
|
54897
|
-
return new BigNumber3(NaN);
|
|
54898
|
-
} else if (!y.c || x.c && !x.c[0]) {
|
|
54899
|
-
return new BigNumber3(x);
|
|
54900
|
-
}
|
|
54901
|
-
if (MODULO_MODE == 9) {
|
|
54902
|
-
s = y.s;
|
|
54903
|
-
y.s = 1;
|
|
54904
|
-
q = div(x, y, 0, 3);
|
|
54905
|
-
y.s = s;
|
|
54906
|
-
q.s *= s;
|
|
54907
|
-
} else {
|
|
54908
|
-
q = div(x, y, 0, MODULO_MODE);
|
|
54909
|
-
}
|
|
54910
|
-
y = x.minus(q.times(y));
|
|
54911
|
-
if (!y.c[0] && MODULO_MODE == 1) y.s = x.s;
|
|
54912
|
-
return y;
|
|
54913
|
-
};
|
|
54914
|
-
P.multipliedBy = P.times = function(y, b) {
|
|
54915
|
-
var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, base, sqrtBase, x = this, xc = x.c, yc = (y = new BigNumber3(y, b)).c;
|
|
54916
|
-
if (!xc || !yc || !xc[0] || !yc[0]) {
|
|
54917
|
-
if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) {
|
|
54918
|
-
y.c = y.e = y.s = null;
|
|
54919
|
-
} else {
|
|
54920
|
-
y.s *= x.s;
|
|
54921
|
-
if (!xc || !yc) {
|
|
54922
|
-
y.c = y.e = null;
|
|
54923
|
-
} else {
|
|
54924
|
-
y.c = [0];
|
|
54925
|
-
y.e = 0;
|
|
54926
|
-
}
|
|
54927
|
-
}
|
|
54928
|
-
return y;
|
|
54929
|
-
}
|
|
54930
|
-
e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE);
|
|
54931
|
-
y.s *= x.s;
|
|
54932
|
-
xcL = xc.length;
|
|
54933
|
-
ycL = yc.length;
|
|
54934
|
-
if (xcL < ycL) {
|
|
54935
|
-
zc = xc;
|
|
54936
|
-
xc = yc;
|
|
54937
|
-
yc = zc;
|
|
54938
|
-
i = xcL;
|
|
54939
|
-
xcL = ycL;
|
|
54940
|
-
ycL = i;
|
|
54941
|
-
}
|
|
54942
|
-
for (i = xcL + ycL, zc = []; i--; zc.push(0)) ;
|
|
54943
|
-
base = BASE;
|
|
54944
|
-
sqrtBase = SQRT_BASE;
|
|
54945
|
-
for (i = ycL; --i >= 0; ) {
|
|
54946
|
-
c = 0;
|
|
54947
|
-
ylo = yc[i] % sqrtBase;
|
|
54948
|
-
yhi = yc[i] / sqrtBase | 0;
|
|
54949
|
-
for (k = xcL, j = i + k; j > i; ) {
|
|
54950
|
-
xlo = xc[--k] % sqrtBase;
|
|
54951
|
-
xhi = xc[k] / sqrtBase | 0;
|
|
54952
|
-
m = yhi * xlo + xhi * ylo;
|
|
54953
|
-
xlo = ylo * xlo + m % sqrtBase * sqrtBase + zc[j] + c;
|
|
54954
|
-
c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi;
|
|
54955
|
-
zc[j--] = xlo % base;
|
|
54956
|
-
}
|
|
54957
|
-
zc[j] = c;
|
|
54958
|
-
}
|
|
54959
|
-
if (c) {
|
|
54960
|
-
++e;
|
|
54961
|
-
} else {
|
|
54962
|
-
zc.splice(0, 1);
|
|
54963
|
-
}
|
|
54964
|
-
return normalise(y, zc, e);
|
|
54965
|
-
};
|
|
54966
|
-
P.negated = function() {
|
|
54967
|
-
var x = new BigNumber3(this);
|
|
54968
|
-
x.s = -x.s || null;
|
|
54969
|
-
return x;
|
|
54970
|
-
};
|
|
54971
|
-
P.plus = function(y, b) {
|
|
54972
|
-
var t, x = this, a = x.s;
|
|
54973
|
-
y = new BigNumber3(y, b);
|
|
54974
|
-
b = y.s;
|
|
54975
|
-
if (!a || !b) return new BigNumber3(NaN);
|
|
54976
|
-
if (a != b) {
|
|
54977
|
-
y.s = -b;
|
|
54978
|
-
return x.minus(y);
|
|
54979
|
-
}
|
|
54980
|
-
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
54981
|
-
if (!xe || !ye) {
|
|
54982
|
-
if (!xc || !yc) return new BigNumber3(a / 0);
|
|
54983
|
-
if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber3(xc[0] ? x : a * 0);
|
|
54984
|
-
}
|
|
54985
|
-
xe = bitFloor(xe);
|
|
54986
|
-
ye = bitFloor(ye);
|
|
54987
|
-
xc = xc.slice();
|
|
54988
|
-
if (a = xe - ye) {
|
|
54989
|
-
if (a > 0) {
|
|
54990
|
-
ye = xe;
|
|
54991
|
-
t = yc;
|
|
54992
|
-
} else {
|
|
54993
|
-
a = -a;
|
|
54994
|
-
t = xc;
|
|
54995
|
-
}
|
|
54996
|
-
t.reverse();
|
|
54997
|
-
for (; a--; t.push(0)) ;
|
|
54998
|
-
t.reverse();
|
|
54999
|
-
}
|
|
55000
|
-
a = xc.length;
|
|
55001
|
-
b = yc.length;
|
|
55002
|
-
if (a - b < 0) {
|
|
55003
|
-
t = yc;
|
|
55004
|
-
yc = xc;
|
|
55005
|
-
xc = t;
|
|
55006
|
-
b = a;
|
|
55007
|
-
}
|
|
55008
|
-
for (a = 0; b; ) {
|
|
55009
|
-
a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0;
|
|
55010
|
-
xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE;
|
|
55011
|
-
}
|
|
55012
|
-
if (a) {
|
|
55013
|
-
xc = [a].concat(xc);
|
|
55014
|
-
++ye;
|
|
55015
|
-
}
|
|
55016
|
-
return normalise(y, xc, ye);
|
|
55017
|
-
};
|
|
55018
|
-
P.precision = P.sd = function(sd, rm) {
|
|
55019
|
-
var c, n, v, x = this;
|
|
55020
|
-
if (sd != null && sd !== !!sd) {
|
|
55021
|
-
intCheck(sd, 1, MAX);
|
|
55022
|
-
if (rm == null) rm = ROUNDING_MODE;
|
|
55023
|
-
else intCheck(rm, 0, 8);
|
|
55024
|
-
return round(new BigNumber3(x), sd, rm);
|
|
55025
|
-
}
|
|
55026
|
-
if (!(c = x.c)) return null;
|
|
55027
|
-
v = c.length - 1;
|
|
55028
|
-
n = v * LOG_BASE + 1;
|
|
55029
|
-
if (v = c[v]) {
|
|
55030
|
-
for (; v % 10 == 0; v /= 10, n--) ;
|
|
55031
|
-
for (v = c[0]; v >= 10; v /= 10, n++) ;
|
|
55032
|
-
}
|
|
55033
|
-
if (sd && x.e + 1 > n) n = x.e + 1;
|
|
55034
|
-
return n;
|
|
55035
|
-
};
|
|
55036
|
-
P.shiftedBy = function(k) {
|
|
55037
|
-
intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);
|
|
55038
|
-
return this.times("1e" + k);
|
|
55039
|
-
};
|
|
55040
|
-
P.squareRoot = P.sqrt = function() {
|
|
55041
|
-
var m, n, r, rep, t, x = this, c = x.c, s = x.s, e = x.e, dp = DECIMAL_PLACES + 4, half = new BigNumber3("0.5");
|
|
55042
|
-
if (s !== 1 || !c || !c[0]) {
|
|
55043
|
-
return new BigNumber3(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0);
|
|
55044
|
-
}
|
|
55045
|
-
s = Math.sqrt(+valueOf(x));
|
|
55046
|
-
if (s == 0 || s == 1 / 0) {
|
|
55047
|
-
n = coeffToString(c);
|
|
55048
|
-
if ((n.length + e) % 2 == 0) n += "0";
|
|
55049
|
-
s = Math.sqrt(+n);
|
|
55050
|
-
e = bitFloor((e + 1) / 2) - (e < 0 || e % 2);
|
|
55051
|
-
if (s == 1 / 0) {
|
|
55052
|
-
n = "5e" + e;
|
|
55053
|
-
} else {
|
|
55054
|
-
n = s.toExponential();
|
|
55055
|
-
n = n.slice(0, n.indexOf("e") + 1) + e;
|
|
55056
|
-
}
|
|
55057
|
-
r = new BigNumber3(n);
|
|
55058
|
-
} else {
|
|
55059
|
-
r = new BigNumber3(s + "");
|
|
55060
|
-
}
|
|
55061
|
-
if (r.c[0]) {
|
|
55062
|
-
e = r.e;
|
|
55063
|
-
s = e + dp;
|
|
55064
|
-
if (s < 3) s = 0;
|
|
55065
|
-
for (; ; ) {
|
|
55066
|
-
t = r;
|
|
55067
|
-
r = half.times(t.plus(div(x, t, dp, 1)));
|
|
55068
|
-
if (coeffToString(t.c).slice(0, s) === (n = coeffToString(r.c)).slice(0, s)) {
|
|
55069
|
-
if (r.e < e) --s;
|
|
55070
|
-
n = n.slice(s - 3, s + 1);
|
|
55071
|
-
if (n == "9999" || !rep && n == "4999") {
|
|
55072
|
-
if (!rep) {
|
|
55073
|
-
round(t, t.e + DECIMAL_PLACES + 2, 0);
|
|
55074
|
-
if (t.times(t).eq(x)) {
|
|
55075
|
-
r = t;
|
|
55076
|
-
break;
|
|
55077
|
-
}
|
|
55078
|
-
}
|
|
55079
|
-
dp += 4;
|
|
55080
|
-
s += 4;
|
|
55081
|
-
rep = 1;
|
|
55082
|
-
} else {
|
|
55083
|
-
if (!+n || !+n.slice(1) && n.charAt(0) == "5") {
|
|
55084
|
-
round(r, r.e + DECIMAL_PLACES + 2, 1);
|
|
55085
|
-
m = !r.times(r).eq(x);
|
|
55086
|
-
}
|
|
55087
|
-
break;
|
|
55088
|
-
}
|
|
55089
|
-
}
|
|
55090
|
-
}
|
|
55091
|
-
}
|
|
55092
|
-
return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m);
|
|
55093
|
-
};
|
|
55094
|
-
P.toExponential = function(dp, rm) {
|
|
55095
|
-
if (dp != null) {
|
|
55096
|
-
intCheck(dp, 0, MAX);
|
|
55097
|
-
dp++;
|
|
55098
|
-
}
|
|
55099
|
-
return format(this, dp, rm, 1);
|
|
55100
|
-
};
|
|
55101
|
-
P.toFixed = function(dp, rm) {
|
|
55102
|
-
if (dp != null) {
|
|
55103
|
-
intCheck(dp, 0, MAX);
|
|
55104
|
-
dp = dp + this.e + 1;
|
|
55105
|
-
}
|
|
55106
|
-
return format(this, dp, rm);
|
|
55107
|
-
};
|
|
55108
|
-
P.toFormat = function(dp, rm, format2) {
|
|
55109
|
-
var str, x = this;
|
|
55110
|
-
if (format2 == null) {
|
|
55111
|
-
if (dp != null && rm && typeof rm == "object") {
|
|
55112
|
-
format2 = rm;
|
|
55113
|
-
rm = null;
|
|
55114
|
-
} else if (dp && typeof dp == "object") {
|
|
55115
|
-
format2 = dp;
|
|
55116
|
-
dp = rm = null;
|
|
55117
|
-
} else {
|
|
55118
|
-
format2 = FORMAT;
|
|
55119
|
-
}
|
|
55120
|
-
} else if (typeof format2 != "object") {
|
|
55121
|
-
throw Error(bignumberError + "Argument not an object: " + format2);
|
|
55122
|
-
}
|
|
55123
|
-
str = x.toFixed(dp, rm);
|
|
55124
|
-
if (x.c) {
|
|
55125
|
-
var i, arr = str.split("."), g1 = +format2.groupSize, g2 = +format2.secondaryGroupSize, groupSeparator = format2.groupSeparator || "", intPart = arr[0], fractionPart = arr[1], isNeg = x.s < 0, intDigits = isNeg ? intPart.slice(1) : intPart, len = intDigits.length;
|
|
55126
|
-
if (g2) {
|
|
55127
|
-
i = g1;
|
|
55128
|
-
g1 = g2;
|
|
55129
|
-
g2 = i;
|
|
55130
|
-
len -= i;
|
|
55131
|
-
}
|
|
55132
|
-
if (g1 > 0 && len > 0) {
|
|
55133
|
-
i = len % g1 || g1;
|
|
55134
|
-
intPart = intDigits.substr(0, i);
|
|
55135
|
-
for (; i < len; i += g1) intPart += groupSeparator + intDigits.substr(i, g1);
|
|
55136
|
-
if (g2 > 0) intPart += groupSeparator + intDigits.slice(i);
|
|
55137
|
-
if (isNeg) intPart = "-" + intPart;
|
|
55138
|
-
}
|
|
55139
|
-
str = fractionPart ? intPart + (format2.decimalSeparator || "") + ((g2 = +format2.fractionGroupSize) ? fractionPart.replace(
|
|
55140
|
-
new RegExp("\\d{" + g2 + "}\\B", "g"),
|
|
55141
|
-
"$&" + (format2.fractionGroupSeparator || "")
|
|
55142
|
-
) : fractionPart) : intPart;
|
|
55143
|
-
}
|
|
55144
|
-
return (format2.prefix || "") + str + (format2.suffix || "");
|
|
55145
|
-
};
|
|
55146
|
-
P.toFraction = function(md) {
|
|
55147
|
-
var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s, x = this, xc = x.c;
|
|
55148
|
-
if (md != null) {
|
|
55149
|
-
n = new BigNumber3(md);
|
|
55150
|
-
if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) {
|
|
55151
|
-
throw Error(bignumberError + "Argument " + (n.isInteger() ? "out of range: " : "not an integer: ") + valueOf(n));
|
|
55152
|
-
}
|
|
55153
|
-
}
|
|
55154
|
-
if (!xc) return new BigNumber3(x);
|
|
55155
|
-
d = new BigNumber3(ONE);
|
|
55156
|
-
n1 = d0 = new BigNumber3(ONE);
|
|
55157
|
-
d1 = n0 = new BigNumber3(ONE);
|
|
55158
|
-
s = coeffToString(xc);
|
|
55159
|
-
e = d.e = s.length - x.e - 1;
|
|
55160
|
-
d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp];
|
|
55161
|
-
md = !md || n.comparedTo(d) > 0 ? e > 0 ? d : n1 : n;
|
|
55162
|
-
exp = MAX_EXP;
|
|
55163
|
-
MAX_EXP = 1 / 0;
|
|
55164
|
-
n = new BigNumber3(s);
|
|
55165
|
-
n0.c[0] = 0;
|
|
55166
|
-
for (; ; ) {
|
|
55167
|
-
q = div(n, d, 0, 1);
|
|
55168
|
-
d2 = d0.plus(q.times(d1));
|
|
55169
|
-
if (d2.comparedTo(md) == 1) break;
|
|
55170
|
-
d0 = d1;
|
|
55171
|
-
d1 = d2;
|
|
55172
|
-
n1 = n0.plus(q.times(d2 = n1));
|
|
55173
|
-
n0 = d2;
|
|
55174
|
-
d = n.minus(q.times(d2 = d));
|
|
55175
|
-
n = d2;
|
|
55176
|
-
}
|
|
55177
|
-
d2 = div(md.minus(d0), d1, 0, 1);
|
|
55178
|
-
n0 = n0.plus(d2.times(n1));
|
|
55179
|
-
d0 = d0.plus(d2.times(d1));
|
|
55180
|
-
n0.s = n1.s = x.s;
|
|
55181
|
-
e = e * 2;
|
|
55182
|
-
r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo(
|
|
55183
|
-
div(n0, d0, e, ROUNDING_MODE).minus(x).abs()
|
|
55184
|
-
) < 1 ? [n1, d1] : [n0, d0];
|
|
55185
|
-
MAX_EXP = exp;
|
|
55186
|
-
return r;
|
|
55187
|
-
};
|
|
55188
|
-
P.toNumber = function() {
|
|
55189
|
-
return +valueOf(this);
|
|
55190
|
-
};
|
|
55191
|
-
P.toPrecision = function(sd, rm) {
|
|
55192
|
-
if (sd != null) intCheck(sd, 1, MAX);
|
|
55193
|
-
return format(this, sd, rm, 2);
|
|
55194
|
-
};
|
|
55195
|
-
P.toString = function(b) {
|
|
55196
|
-
var str, n = this, s = n.s, e = n.e;
|
|
55197
|
-
if (e === null) {
|
|
55198
|
-
if (s) {
|
|
55199
|
-
str = "Infinity";
|
|
55200
|
-
if (s < 0) str = "-" + str;
|
|
55201
|
-
} else {
|
|
55202
|
-
str = "NaN";
|
|
55203
|
-
}
|
|
55204
|
-
} else {
|
|
55205
|
-
if (b == null) {
|
|
55206
|
-
str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(coeffToString(n.c), e) : toFixedPoint(coeffToString(n.c), e, "0");
|
|
55207
|
-
} else if (b === 10 && alphabetHasNormalDecimalDigits) {
|
|
55208
|
-
n = round(new BigNumber3(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE);
|
|
55209
|
-
str = toFixedPoint(coeffToString(n.c), n.e, "0");
|
|
55210
|
-
} else {
|
|
55211
|
-
intCheck(b, 2, ALPHABET.length, "Base");
|
|
55212
|
-
str = convertBase(toFixedPoint(coeffToString(n.c), e, "0"), 10, b, s, true);
|
|
55213
|
-
}
|
|
55214
|
-
if (s < 0 && n.c[0]) str = "-" + str;
|
|
55215
|
-
}
|
|
55216
|
-
return str;
|
|
55217
|
-
};
|
|
55218
|
-
P.valueOf = P.toJSON = function() {
|
|
55219
|
-
return valueOf(this);
|
|
55220
|
-
};
|
|
55221
|
-
P._isBigNumber = true;
|
|
55222
|
-
if (configObject != null) BigNumber3.set(configObject);
|
|
55223
|
-
return BigNumber3;
|
|
55224
|
-
}
|
|
55225
|
-
function bitFloor(n) {
|
|
55226
|
-
var i = n | 0;
|
|
55227
|
-
return n > 0 || n === i ? i : i - 1;
|
|
55228
|
-
}
|
|
55229
|
-
function coeffToString(a) {
|
|
55230
|
-
var s, z3, i = 1, j = a.length, r = a[0] + "";
|
|
55231
|
-
for (; i < j; ) {
|
|
55232
|
-
s = a[i++] + "";
|
|
55233
|
-
z3 = LOG_BASE - s.length;
|
|
55234
|
-
for (; z3--; s = "0" + s) ;
|
|
55235
|
-
r += s;
|
|
55236
|
-
}
|
|
55237
|
-
for (j = r.length; r.charCodeAt(--j) === 48; ) ;
|
|
55238
|
-
return r.slice(0, j + 1 || 1);
|
|
55239
|
-
}
|
|
55240
|
-
function compare(x, y) {
|
|
55241
|
-
var a, b, xc = x.c, yc = y.c, i = x.s, j = y.s, k = x.e, l = y.e;
|
|
55242
|
-
if (!i || !j) return null;
|
|
55243
|
-
a = xc && !xc[0];
|
|
55244
|
-
b = yc && !yc[0];
|
|
55245
|
-
if (a || b) return a ? b ? 0 : -j : i;
|
|
55246
|
-
if (i != j) return i;
|
|
55247
|
-
a = i < 0;
|
|
55248
|
-
b = k == l;
|
|
55249
|
-
if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1;
|
|
55250
|
-
if (!b) return k > l ^ a ? 1 : -1;
|
|
55251
|
-
j = (k = xc.length) < (l = yc.length) ? k : l;
|
|
55252
|
-
for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1;
|
|
55253
|
-
return k == l ? 0 : k > l ^ a ? 1 : -1;
|
|
55254
|
-
}
|
|
55255
|
-
function intCheck(n, min, max, name) {
|
|
55256
|
-
if (n < min || n > max || n !== mathfloor(n)) {
|
|
55257
|
-
throw Error(bignumberError + (name || "Argument") + (typeof n == "number" ? n < min || n > max ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(n));
|
|
55258
|
-
}
|
|
55259
|
-
}
|
|
55260
|
-
function isOdd(n) {
|
|
55261
|
-
var k = n.c.length - 1;
|
|
55262
|
-
return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0;
|
|
55263
|
-
}
|
|
55264
|
-
function toExponential(str, e) {
|
|
55265
|
-
return (str.length > 1 ? str.charAt(0) + "." + str.slice(1) : str) + (e < 0 ? "e" : "e+") + e;
|
|
55266
|
-
}
|
|
55267
|
-
function toFixedPoint(str, e, z3) {
|
|
55268
|
-
var len, zs;
|
|
55269
|
-
if (e < 0) {
|
|
55270
|
-
for (zs = z3 + "."; ++e; zs += z3) ;
|
|
55271
|
-
str = zs + str;
|
|
55272
|
-
} else {
|
|
55273
|
-
len = str.length;
|
|
55274
|
-
if (++e > len) {
|
|
55275
|
-
for (zs = z3, e -= len; --e; zs += z3) ;
|
|
55276
|
-
str += zs;
|
|
55277
|
-
} else if (e < len) {
|
|
55278
|
-
str = str.slice(0, e) + "." + str.slice(e);
|
|
55279
|
-
}
|
|
55280
|
-
}
|
|
55281
|
-
return str;
|
|
55282
|
-
}
|
|
55283
|
-
BigNumber2 = clone2();
|
|
55284
|
-
BigNumber2["default"] = BigNumber2.BigNumber = BigNumber2;
|
|
55285
|
-
if (typeof define == "function" && define.amd) {
|
|
55286
|
-
define(function() {
|
|
55287
|
-
return BigNumber2;
|
|
55288
|
-
});
|
|
55289
|
-
} else if (typeof module2 != "undefined" && module2.exports) {
|
|
55290
|
-
module2.exports = BigNumber2;
|
|
55291
|
-
} else {
|
|
55292
|
-
if (!globalObject) {
|
|
55293
|
-
globalObject = typeof self != "undefined" && self ? self : window;
|
|
55294
|
-
}
|
|
55295
|
-
globalObject.BigNumber = BigNumber2;
|
|
55296
|
-
}
|
|
55297
|
-
})(exports2);
|
|
55298
|
-
}
|
|
55299
|
-
});
|
|
55300
|
-
|
|
55301
|
-
// node_modules/json-bigint/lib/stringify.js
|
|
55302
|
-
var require_stringify = __commonJS({
|
|
55303
|
-
"node_modules/json-bigint/lib/stringify.js"(exports2, module2) {
|
|
55304
|
-
var BigNumber2 = require_bignumber();
|
|
55305
|
-
var JSON2 = module2.exports;
|
|
55306
|
-
(function() {
|
|
55307
|
-
"use strict";
|
|
55308
|
-
function f(n) {
|
|
55309
|
-
return n < 10 ? "0" + n : n;
|
|
55310
|
-
}
|
|
55311
|
-
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta3 = {
|
|
55312
|
-
// table of character substitutions
|
|
55313
|
-
"\b": "\\b",
|
|
55314
|
-
" ": "\\t",
|
|
55315
|
-
"\n": "\\n",
|
|
55316
|
-
"\f": "\\f",
|
|
55317
|
-
"\r": "\\r",
|
|
55318
|
-
'"': '\\"',
|
|
55319
|
-
"\\": "\\\\"
|
|
55320
|
-
}, rep;
|
|
55321
|
-
function quote(string4) {
|
|
55322
|
-
escapable.lastIndex = 0;
|
|
55323
|
-
return escapable.test(string4) ? '"' + string4.replace(escapable, function(a) {
|
|
55324
|
-
var c = meta3[a];
|
|
55325
|
-
return typeof c === "string" ? c : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
|
|
55326
|
-
}) + '"' : '"' + string4 + '"';
|
|
55327
|
-
}
|
|
55328
|
-
function str(key, holder) {
|
|
55329
|
-
var i, k, v, length, mind = gap, partial2, value = holder[key], isBigNumber2 = value != null && (value instanceof BigNumber2 || BigNumber2.isBigNumber(value));
|
|
55330
|
-
if (value && typeof value === "object" && typeof value.toJSON === "function") {
|
|
55331
|
-
value = value.toJSON(key);
|
|
55332
|
-
}
|
|
55333
|
-
if (typeof rep === "function") {
|
|
55334
|
-
value = rep.call(holder, key, value);
|
|
55335
|
-
}
|
|
55336
|
-
switch (typeof value) {
|
|
55337
|
-
case "string":
|
|
55338
|
-
if (isBigNumber2) {
|
|
55339
|
-
return value;
|
|
55340
|
-
} else {
|
|
55341
|
-
return quote(value);
|
|
55342
|
-
}
|
|
55343
|
-
case "number":
|
|
55344
|
-
return isFinite(value) ? String(value) : "null";
|
|
55345
|
-
case "boolean":
|
|
55346
|
-
case "null":
|
|
55347
|
-
case "bigint":
|
|
55348
|
-
return String(value);
|
|
55349
|
-
// If the type is 'object', we might be dealing with an object or an array or
|
|
55350
|
-
// null.
|
|
55351
|
-
case "object":
|
|
55352
|
-
if (!value) {
|
|
55353
|
-
return "null";
|
|
55354
|
-
}
|
|
55355
|
-
gap += indent;
|
|
55356
|
-
partial2 = [];
|
|
55357
|
-
if (Object.prototype.toString.apply(value) === "[object Array]") {
|
|
55358
|
-
length = value.length;
|
|
55359
|
-
for (i = 0; i < length; i += 1) {
|
|
55360
|
-
partial2[i] = str(i, value) || "null";
|
|
55361
|
-
}
|
|
55362
|
-
v = partial2.length === 0 ? "[]" : gap ? "[\n" + gap + partial2.join(",\n" + gap) + "\n" + mind + "]" : "[" + partial2.join(",") + "]";
|
|
55363
|
-
gap = mind;
|
|
55364
|
-
return v;
|
|
55365
|
-
}
|
|
55366
|
-
if (rep && typeof rep === "object") {
|
|
55367
|
-
length = rep.length;
|
|
55368
|
-
for (i = 0; i < length; i += 1) {
|
|
55369
|
-
if (typeof rep[i] === "string") {
|
|
55370
|
-
k = rep[i];
|
|
55371
|
-
v = str(k, value);
|
|
55372
|
-
if (v) {
|
|
55373
|
-
partial2.push(quote(k) + (gap ? ": " : ":") + v);
|
|
55374
|
-
}
|
|
55375
|
-
}
|
|
55376
|
-
}
|
|
55377
|
-
} else {
|
|
55378
|
-
Object.keys(value).forEach(function(k2) {
|
|
55379
|
-
var v2 = str(k2, value);
|
|
55380
|
-
if (v2) {
|
|
55381
|
-
partial2.push(quote(k2) + (gap ? ": " : ":") + v2);
|
|
55382
|
-
}
|
|
55383
|
-
});
|
|
55384
|
-
}
|
|
55385
|
-
v = partial2.length === 0 ? "{}" : gap ? "{\n" + gap + partial2.join(",\n" + gap) + "\n" + mind + "}" : "{" + partial2.join(",") + "}";
|
|
55386
|
-
gap = mind;
|
|
55387
|
-
return v;
|
|
55388
|
-
}
|
|
55389
|
-
}
|
|
55390
|
-
if (typeof JSON2.stringify !== "function") {
|
|
55391
|
-
JSON2.stringify = function(value, replacer, space) {
|
|
55392
|
-
var i;
|
|
55393
|
-
gap = "";
|
|
55394
|
-
indent = "";
|
|
55395
|
-
if (typeof space === "number") {
|
|
55396
|
-
for (i = 0; i < space; i += 1) {
|
|
55397
|
-
indent += " ";
|
|
55398
|
-
}
|
|
55399
|
-
} else if (typeof space === "string") {
|
|
55400
|
-
indent = space;
|
|
55401
|
-
}
|
|
55402
|
-
rep = replacer;
|
|
55403
|
-
if (replacer && typeof replacer !== "function" && (typeof replacer !== "object" || typeof replacer.length !== "number")) {
|
|
55404
|
-
throw new Error("JSON.stringify");
|
|
55405
|
-
}
|
|
55406
|
-
return str("", { "": value });
|
|
55407
|
-
};
|
|
55408
|
-
}
|
|
55409
|
-
})();
|
|
55410
|
-
}
|
|
55411
|
-
});
|
|
55412
|
-
|
|
55413
|
-
// node_modules/json-bigint/lib/parse.js
|
|
55414
|
-
var require_parse2 = __commonJS({
|
|
55415
|
-
"node_modules/json-bigint/lib/parse.js"(exports2, module2) {
|
|
55416
|
-
var BigNumber2 = null;
|
|
55417
|
-
var suspectProtoRx = /(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/;
|
|
55418
|
-
var suspectConstructorRx = /(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;
|
|
55419
|
-
var json_parse = function(options) {
|
|
55420
|
-
"use strict";
|
|
55421
|
-
var _options = {
|
|
55422
|
-
strict: false,
|
|
55423
|
-
// not being strict means do not generate syntax errors for "duplicate key"
|
|
55424
|
-
storeAsString: false,
|
|
55425
|
-
// toggles whether the values should be stored as BigNumber (default) or a string
|
|
55426
|
-
alwaysParseAsBig: false,
|
|
55427
|
-
// toggles whether all numbers should be Big
|
|
55428
|
-
useNativeBigInt: false,
|
|
55429
|
-
// toggles whether to use native BigInt instead of bignumber.js
|
|
55430
|
-
protoAction: "error",
|
|
55431
|
-
constructorAction: "error"
|
|
55432
|
-
};
|
|
55433
|
-
if (options !== void 0 && options !== null) {
|
|
55434
|
-
if (options.strict === true) {
|
|
55435
|
-
_options.strict = true;
|
|
55436
|
-
}
|
|
55437
|
-
if (options.storeAsString === true) {
|
|
55438
|
-
_options.storeAsString = true;
|
|
55439
|
-
}
|
|
55440
|
-
_options.alwaysParseAsBig = options.alwaysParseAsBig === true ? options.alwaysParseAsBig : false;
|
|
55441
|
-
_options.useNativeBigInt = options.useNativeBigInt === true ? options.useNativeBigInt : false;
|
|
55442
|
-
if (typeof options.constructorAction !== "undefined") {
|
|
55443
|
-
if (options.constructorAction === "error" || options.constructorAction === "ignore" || options.constructorAction === "preserve") {
|
|
55444
|
-
_options.constructorAction = options.constructorAction;
|
|
55445
|
-
} else {
|
|
55446
|
-
throw new Error(
|
|
55447
|
-
`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${options.constructorAction}`
|
|
55448
|
-
);
|
|
55449
|
-
}
|
|
55450
|
-
}
|
|
55451
|
-
if (typeof options.protoAction !== "undefined") {
|
|
55452
|
-
if (options.protoAction === "error" || options.protoAction === "ignore" || options.protoAction === "preserve") {
|
|
55453
|
-
_options.protoAction = options.protoAction;
|
|
55454
|
-
} else {
|
|
55455
|
-
throw new Error(
|
|
55456
|
-
`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${options.protoAction}`
|
|
55457
|
-
);
|
|
55458
|
-
}
|
|
55459
|
-
}
|
|
55460
|
-
}
|
|
55461
|
-
var at, ch, escapee = {
|
|
55462
|
-
'"': '"',
|
|
55463
|
-
"\\": "\\",
|
|
55464
|
-
"/": "/",
|
|
55465
|
-
b: "\b",
|
|
55466
|
-
f: "\f",
|
|
55467
|
-
n: "\n",
|
|
55468
|
-
r: "\r",
|
|
55469
|
-
t: " "
|
|
55470
|
-
}, text, error49 = function(m) {
|
|
55471
|
-
throw {
|
|
55472
|
-
name: "SyntaxError",
|
|
55473
|
-
message: m,
|
|
55474
|
-
at,
|
|
55475
|
-
text
|
|
55476
|
-
};
|
|
55477
|
-
}, next = function(c) {
|
|
55478
|
-
if (c && c !== ch) {
|
|
55479
|
-
error49("Expected '" + c + "' instead of '" + ch + "'");
|
|
55480
|
-
}
|
|
55481
|
-
ch = text.charAt(at);
|
|
55482
|
-
at += 1;
|
|
55483
|
-
return ch;
|
|
55484
|
-
}, number4 = function() {
|
|
55485
|
-
var number5, string5 = "";
|
|
55486
|
-
if (ch === "-") {
|
|
55487
|
-
string5 = "-";
|
|
55488
|
-
next("-");
|
|
55489
|
-
}
|
|
55490
|
-
while (ch >= "0" && ch <= "9") {
|
|
55491
|
-
string5 += ch;
|
|
55492
|
-
next();
|
|
55493
|
-
}
|
|
55494
|
-
if (ch === ".") {
|
|
55495
|
-
string5 += ".";
|
|
55496
|
-
while (next() && ch >= "0" && ch <= "9") {
|
|
55497
|
-
string5 += ch;
|
|
55498
|
-
}
|
|
55499
|
-
}
|
|
55500
|
-
if (ch === "e" || ch === "E") {
|
|
55501
|
-
string5 += ch;
|
|
55502
|
-
next();
|
|
55503
|
-
if (ch === "-" || ch === "+") {
|
|
55504
|
-
string5 += ch;
|
|
55505
|
-
next();
|
|
55506
|
-
}
|
|
55507
|
-
while (ch >= "0" && ch <= "9") {
|
|
55508
|
-
string5 += ch;
|
|
55509
|
-
next();
|
|
55510
|
-
}
|
|
55511
|
-
}
|
|
55512
|
-
number5 = +string5;
|
|
55513
|
-
if (!isFinite(number5)) {
|
|
55514
|
-
error49("Bad number");
|
|
55515
|
-
} else {
|
|
55516
|
-
if (BigNumber2 == null) BigNumber2 = require_bignumber();
|
|
55517
|
-
if (string5.length > 15)
|
|
55518
|
-
return _options.storeAsString ? string5 : _options.useNativeBigInt ? BigInt(string5) : new BigNumber2(string5);
|
|
55519
|
-
else
|
|
55520
|
-
return !_options.alwaysParseAsBig ? number5 : _options.useNativeBigInt ? BigInt(number5) : new BigNumber2(number5);
|
|
55521
|
-
}
|
|
55522
|
-
}, string4 = function() {
|
|
55523
|
-
var hex3, i, string5 = "", uffff;
|
|
55524
|
-
if (ch === '"') {
|
|
55525
|
-
var startAt = at;
|
|
55526
|
-
while (next()) {
|
|
55527
|
-
if (ch === '"') {
|
|
55528
|
-
if (at - 1 > startAt) string5 += text.substring(startAt, at - 1);
|
|
55529
|
-
next();
|
|
55530
|
-
return string5;
|
|
55531
|
-
}
|
|
55532
|
-
if (ch === "\\") {
|
|
55533
|
-
if (at - 1 > startAt) string5 += text.substring(startAt, at - 1);
|
|
55534
|
-
next();
|
|
55535
|
-
if (ch === "u") {
|
|
55536
|
-
uffff = 0;
|
|
55537
|
-
for (i = 0; i < 4; i += 1) {
|
|
55538
|
-
hex3 = parseInt(next(), 16);
|
|
55539
|
-
if (!isFinite(hex3)) {
|
|
55540
|
-
break;
|
|
55541
|
-
}
|
|
55542
|
-
uffff = uffff * 16 + hex3;
|
|
55543
|
-
}
|
|
55544
|
-
string5 += String.fromCharCode(uffff);
|
|
55545
|
-
} else if (typeof escapee[ch] === "string") {
|
|
55546
|
-
string5 += escapee[ch];
|
|
55547
|
-
} else {
|
|
55548
|
-
break;
|
|
55549
|
-
}
|
|
55550
|
-
startAt = at;
|
|
55551
|
-
}
|
|
55552
|
-
}
|
|
55553
|
-
}
|
|
55554
|
-
error49("Bad string");
|
|
55555
|
-
}, white = function() {
|
|
55556
|
-
while (ch && ch <= " ") {
|
|
55557
|
-
next();
|
|
55558
|
-
}
|
|
55559
|
-
}, word = function() {
|
|
55560
|
-
switch (ch) {
|
|
55561
|
-
case "t":
|
|
55562
|
-
next("t");
|
|
55563
|
-
next("r");
|
|
55564
|
-
next("u");
|
|
55565
|
-
next("e");
|
|
55566
|
-
return true;
|
|
55567
|
-
case "f":
|
|
55568
|
-
next("f");
|
|
55569
|
-
next("a");
|
|
55570
|
-
next("l");
|
|
55571
|
-
next("s");
|
|
55572
|
-
next("e");
|
|
55573
|
-
return false;
|
|
55574
|
-
case "n":
|
|
55575
|
-
next("n");
|
|
55576
|
-
next("u");
|
|
55577
|
-
next("l");
|
|
55578
|
-
next("l");
|
|
55579
|
-
return null;
|
|
55580
|
-
}
|
|
55581
|
-
error49("Unexpected '" + ch + "'");
|
|
55582
|
-
}, value, array2 = function() {
|
|
55583
|
-
var array3 = [];
|
|
55584
|
-
if (ch === "[") {
|
|
55585
|
-
next("[");
|
|
55586
|
-
white();
|
|
55587
|
-
if (ch === "]") {
|
|
55588
|
-
next("]");
|
|
55589
|
-
return array3;
|
|
55590
|
-
}
|
|
55591
|
-
while (ch) {
|
|
55592
|
-
array3.push(value());
|
|
55593
|
-
white();
|
|
55594
|
-
if (ch === "]") {
|
|
55595
|
-
next("]");
|
|
55596
|
-
return array3;
|
|
55597
|
-
}
|
|
55598
|
-
next(",");
|
|
55599
|
-
white();
|
|
55600
|
-
}
|
|
55601
|
-
}
|
|
55602
|
-
error49("Bad array");
|
|
55603
|
-
}, object2 = function() {
|
|
55604
|
-
var key, object3 = /* @__PURE__ */ Object.create(null);
|
|
55605
|
-
if (ch === "{") {
|
|
55606
|
-
next("{");
|
|
55607
|
-
white();
|
|
55608
|
-
if (ch === "}") {
|
|
55609
|
-
next("}");
|
|
55610
|
-
return object3;
|
|
55611
|
-
}
|
|
55612
|
-
while (ch) {
|
|
55613
|
-
key = string4();
|
|
55614
|
-
white();
|
|
55615
|
-
next(":");
|
|
55616
|
-
if (_options.strict === true && Object.hasOwnProperty.call(object3, key)) {
|
|
55617
|
-
error49('Duplicate key "' + key + '"');
|
|
55618
|
-
}
|
|
55619
|
-
if (suspectProtoRx.test(key) === true) {
|
|
55620
|
-
if (_options.protoAction === "error") {
|
|
55621
|
-
error49("Object contains forbidden prototype property");
|
|
55622
|
-
} else if (_options.protoAction === "ignore") {
|
|
55623
|
-
value();
|
|
55624
|
-
} else {
|
|
55625
|
-
object3[key] = value();
|
|
55626
|
-
}
|
|
55627
|
-
} else if (suspectConstructorRx.test(key) === true) {
|
|
55628
|
-
if (_options.constructorAction === "error") {
|
|
55629
|
-
error49("Object contains forbidden constructor property");
|
|
55630
|
-
} else if (_options.constructorAction === "ignore") {
|
|
55631
|
-
value();
|
|
55632
|
-
} else {
|
|
55633
|
-
object3[key] = value();
|
|
55634
|
-
}
|
|
55635
|
-
} else {
|
|
55636
|
-
object3[key] = value();
|
|
55637
|
-
}
|
|
55638
|
-
white();
|
|
55639
|
-
if (ch === "}") {
|
|
55640
|
-
next("}");
|
|
55641
|
-
return object3;
|
|
55642
|
-
}
|
|
55643
|
-
next(",");
|
|
55644
|
-
white();
|
|
55645
|
-
}
|
|
55646
|
-
}
|
|
55647
|
-
error49("Bad object");
|
|
55648
|
-
};
|
|
55649
|
-
value = function() {
|
|
55650
|
-
white();
|
|
55651
|
-
switch (ch) {
|
|
55652
|
-
case "{":
|
|
55653
|
-
return object2();
|
|
55654
|
-
case "[":
|
|
55655
|
-
return array2();
|
|
55656
|
-
case '"':
|
|
55657
|
-
return string4();
|
|
55658
|
-
case "-":
|
|
55659
|
-
return number4();
|
|
55660
|
-
default:
|
|
55661
|
-
return ch >= "0" && ch <= "9" ? number4() : word();
|
|
55662
|
-
}
|
|
55663
|
-
};
|
|
55664
|
-
return function(source, reviver3) {
|
|
55665
|
-
var result;
|
|
55666
|
-
text = source + "";
|
|
55667
|
-
at = 0;
|
|
55668
|
-
ch = " ";
|
|
55669
|
-
result = value();
|
|
55670
|
-
white();
|
|
55671
|
-
if (ch) {
|
|
55672
|
-
error49("Syntax error");
|
|
55673
|
-
}
|
|
55674
|
-
return typeof reviver3 === "function" ? (function walk(holder, key) {
|
|
55675
|
-
var k, v, value2 = holder[key];
|
|
55676
|
-
if (value2 && typeof value2 === "object") {
|
|
55677
|
-
Object.keys(value2).forEach(function(k2) {
|
|
55678
|
-
v = walk(value2, k2);
|
|
55679
|
-
if (v !== void 0) {
|
|
55680
|
-
value2[k2] = v;
|
|
55681
|
-
} else {
|
|
55682
|
-
delete value2[k2];
|
|
55683
|
-
}
|
|
55684
|
-
});
|
|
55685
|
-
}
|
|
55686
|
-
return reviver3.call(holder, key, value2);
|
|
55687
|
-
})({ "": result }, "") : result;
|
|
55688
|
-
};
|
|
55689
|
-
};
|
|
55690
|
-
module2.exports = json_parse;
|
|
55691
|
-
}
|
|
55692
|
-
});
|
|
55693
|
-
|
|
55694
|
-
// node_modules/json-bigint/index.js
|
|
55695
|
-
var require_json_bigint = __commonJS({
|
|
55696
|
-
"node_modules/json-bigint/index.js"(exports2, module2) {
|
|
55697
|
-
var json_stringify = require_stringify().stringify;
|
|
55698
|
-
var json_parse = require_parse2();
|
|
55699
|
-
module2.exports = function(options) {
|
|
55700
|
-
return {
|
|
55701
|
-
parse: json_parse(options),
|
|
55702
|
-
stringify: json_stringify
|
|
55703
|
-
};
|
|
55704
|
-
};
|
|
55705
|
-
module2.exports.parse = json_parse();
|
|
55706
|
-
module2.exports.stringify = json_stringify;
|
|
55707
|
-
}
|
|
55708
|
-
});
|
|
55709
|
-
|
|
55710
|
-
// node_modules/bignumber.js/bignumber.js
|
|
55711
|
-
var require_bignumber2 = __commonJS({
|
|
55712
|
-
"node_modules/bignumber.js/bignumber.js"(exports2, module2) {
|
|
55713
|
-
(function(globalObject) {
|
|
55714
|
-
"use strict";
|
|
55715
|
-
var BigNumber2, isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, mathceil = Math.ceil, mathfloor = Math.floor, bignumberError = "[BigNumber Error] ", tooManyDigits = bignumberError + "Number primitive has more than 15 significant digits: ", BASE = 1e14, LOG_BASE = 14, MAX_SAFE_INTEGER = 9007199254740991, POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], SQRT_BASE = 1e7, MAX = 1e9;
|
|
55716
|
-
function clone2(configObject) {
|
|
55717
|
-
var div, convertBase, parseNumeric, P = BigNumber3.prototype = { constructor: BigNumber3, toString: null, valueOf: null }, ONE = new BigNumber3(1), DECIMAL_PLACES = 20, ROUNDING_MODE = 4, TO_EXP_NEG = -7, TO_EXP_POS = 21, MIN_EXP = -1e7, MAX_EXP = 1e7, CRYPTO = false, MODULO_MODE = 1, POW_PRECISION = 0, FORMAT = {
|
|
55718
|
-
prefix: "",
|
|
55719
|
-
groupSize: 3,
|
|
55720
|
-
secondaryGroupSize: 0,
|
|
55721
|
-
groupSeparator: ",",
|
|
55722
|
-
decimalSeparator: ".",
|
|
55723
|
-
fractionGroupSize: 0,
|
|
55724
|
-
fractionGroupSeparator: "\xA0",
|
|
55725
|
-
// non-breaking space
|
|
55726
|
-
suffix: ""
|
|
55727
|
-
}, ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz";
|
|
55728
|
-
function BigNumber3(v, b) {
|
|
55729
|
-
var alphabet, c, caseChanged, e, i, isNum, len, str, x = this;
|
|
55730
|
-
if (!(x instanceof BigNumber3)) return new BigNumber3(v, b);
|
|
55731
|
-
if (b == null) {
|
|
55732
|
-
if (v && v._isBigNumber === true) {
|
|
55733
|
-
x.s = v.s;
|
|
55734
|
-
if (!v.c || v.e > MAX_EXP) {
|
|
55735
|
-
x.c = x.e = null;
|
|
55736
|
-
} else if (v.e < MIN_EXP) {
|
|
55737
|
-
x.c = [x.e = 0];
|
|
55738
|
-
} else {
|
|
55739
|
-
x.e = v.e;
|
|
55740
|
-
x.c = v.c.slice();
|
|
55741
|
-
}
|
|
55742
|
-
return;
|
|
55743
|
-
}
|
|
55744
|
-
if ((isNum = typeof v == "number") && v * 0 == 0) {
|
|
55745
|
-
x.s = 1 / v < 0 ? (v = -v, -1) : 1;
|
|
55746
|
-
if (v === ~~v) {
|
|
55747
|
-
for (e = 0, i = v; i >= 10; i /= 10, e++) ;
|
|
55748
|
-
if (e > MAX_EXP) {
|
|
55749
|
-
x.c = x.e = null;
|
|
55750
|
-
} else {
|
|
55751
|
-
x.e = e;
|
|
55752
|
-
x.c = [v];
|
|
55753
|
-
}
|
|
55754
|
-
return;
|
|
55755
|
-
}
|
|
55756
|
-
str = String(v);
|
|
55757
|
-
} else {
|
|
55758
|
-
if (!isNumeric.test(str = String(v))) return parseNumeric(x, str, isNum);
|
|
55759
|
-
x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1;
|
|
55760
|
-
}
|
|
55761
|
-
if ((e = str.indexOf(".")) > -1) str = str.replace(".", "");
|
|
55762
|
-
if ((i = str.search(/e/i)) > 0) {
|
|
55763
|
-
if (e < 0) e = i;
|
|
55764
|
-
e += +str.slice(i + 1);
|
|
55765
|
-
str = str.substring(0, i);
|
|
55766
|
-
} else if (e < 0) {
|
|
55767
|
-
e = str.length;
|
|
55768
|
-
}
|
|
55769
|
-
} else {
|
|
55770
|
-
intCheck(b, 2, ALPHABET.length, "Base");
|
|
55771
|
-
if (b == 10) {
|
|
55772
|
-
x = new BigNumber3(v);
|
|
54011
|
+
x = new BigNumber2(v);
|
|
55773
54012
|
return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE);
|
|
55774
54013
|
}
|
|
55775
54014
|
str = String(v);
|
|
55776
54015
|
if (isNum = typeof v == "number") {
|
|
55777
54016
|
if (v * 0 != 0) return parseNumeric(x, str, isNum, b);
|
|
55778
54017
|
x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1;
|
|
55779
|
-
if (
|
|
54018
|
+
if (BigNumber2.DEBUG && str.replace(/^0\.0*|\./, "").length > 15) {
|
|
55780
54019
|
throw Error(tooManyDigits + v);
|
|
55781
54020
|
}
|
|
55782
54021
|
} else {
|
|
@@ -55811,7 +54050,7 @@ var require_bignumber2 = __commonJS({
|
|
|
55811
54050
|
for (len = str.length; str.charCodeAt(--len) === 48; ) ;
|
|
55812
54051
|
if (str = str.slice(i, ++len)) {
|
|
55813
54052
|
len -= i;
|
|
55814
|
-
if (isNum &&
|
|
54053
|
+
if (isNum && BigNumber2.DEBUG && len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) {
|
|
55815
54054
|
throw Error(tooManyDigits + x.s * v);
|
|
55816
54055
|
}
|
|
55817
54056
|
if ((e = e - i - 1) > MAX_EXP) {
|
|
@@ -55839,18 +54078,18 @@ var require_bignumber2 = __commonJS({
|
|
|
55839
54078
|
x.c = [x.e = 0];
|
|
55840
54079
|
}
|
|
55841
54080
|
}
|
|
55842
|
-
|
|
55843
|
-
|
|
55844
|
-
|
|
55845
|
-
|
|
55846
|
-
|
|
55847
|
-
|
|
55848
|
-
|
|
55849
|
-
|
|
55850
|
-
|
|
55851
|
-
|
|
55852
|
-
|
|
55853
|
-
|
|
54081
|
+
BigNumber2.clone = clone2;
|
|
54082
|
+
BigNumber2.ROUND_UP = 0;
|
|
54083
|
+
BigNumber2.ROUND_DOWN = 1;
|
|
54084
|
+
BigNumber2.ROUND_CEIL = 2;
|
|
54085
|
+
BigNumber2.ROUND_FLOOR = 3;
|
|
54086
|
+
BigNumber2.ROUND_HALF_UP = 4;
|
|
54087
|
+
BigNumber2.ROUND_HALF_DOWN = 5;
|
|
54088
|
+
BigNumber2.ROUND_HALF_EVEN = 6;
|
|
54089
|
+
BigNumber2.ROUND_HALF_CEIL = 7;
|
|
54090
|
+
BigNumber2.ROUND_HALF_FLOOR = 8;
|
|
54091
|
+
BigNumber2.EUCLID = 9;
|
|
54092
|
+
BigNumber2.config = BigNumber2.set = function(obj) {
|
|
55854
54093
|
var p, v;
|
|
55855
54094
|
if (obj != null) {
|
|
55856
54095
|
if (typeof obj == "object") {
|
|
@@ -55926,7 +54165,8 @@ var require_bignumber2 = __commonJS({
|
|
|
55926
54165
|
}
|
|
55927
54166
|
if (obj.hasOwnProperty(p = "ALPHABET")) {
|
|
55928
54167
|
v = obj[p];
|
|
55929
|
-
if (typeof v == "string" &&
|
|
54168
|
+
if (typeof v == "string" && !/^.?$|[+\-.\s]|(.).*\1/.test(v)) {
|
|
54169
|
+
alphabetHasNormalDecimalDigits = v.slice(0, 10) == "0123456789";
|
|
55930
54170
|
ALPHABET = v;
|
|
55931
54171
|
} else {
|
|
55932
54172
|
throw Error(bignumberError + p + " invalid: " + v);
|
|
@@ -55948,9 +54188,9 @@ var require_bignumber2 = __commonJS({
|
|
|
55948
54188
|
ALPHABET
|
|
55949
54189
|
};
|
|
55950
54190
|
};
|
|
55951
|
-
|
|
54191
|
+
BigNumber2.isBigNumber = function(v) {
|
|
55952
54192
|
if (!v || v._isBigNumber !== true) return false;
|
|
55953
|
-
if (!
|
|
54193
|
+
if (!BigNumber2.DEBUG) return true;
|
|
55954
54194
|
var i, n, c = v.c, e = v.e, s = v.s;
|
|
55955
54195
|
out: if ({}.toString.call(c) == "[object Array]") {
|
|
55956
54196
|
if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) {
|
|
@@ -55973,13 +54213,13 @@ var require_bignumber2 = __commonJS({
|
|
|
55973
54213
|
}
|
|
55974
54214
|
throw Error(bignumberError + "Invalid BigNumber: " + v);
|
|
55975
54215
|
};
|
|
55976
|
-
|
|
55977
|
-
return maxOrMin(arguments,
|
|
54216
|
+
BigNumber2.maximum = BigNumber2.max = function() {
|
|
54217
|
+
return maxOrMin(arguments, -1);
|
|
55978
54218
|
};
|
|
55979
|
-
|
|
55980
|
-
return maxOrMin(arguments,
|
|
54219
|
+
BigNumber2.minimum = BigNumber2.min = function() {
|
|
54220
|
+
return maxOrMin(arguments, 1);
|
|
55981
54221
|
};
|
|
55982
|
-
|
|
54222
|
+
BigNumber2.random = (function() {
|
|
55983
54223
|
var pow2_53 = 9007199254740992;
|
|
55984
54224
|
var random53bitInt = Math.random() * pow2_53 & 2097151 ? function() {
|
|
55985
54225
|
return mathfloor(Math.random() * pow2_53);
|
|
@@ -55987,7 +54227,7 @@ var require_bignumber2 = __commonJS({
|
|
|
55987
54227
|
return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
|
|
55988
54228
|
};
|
|
55989
54229
|
return function(dp) {
|
|
55990
|
-
var a, b, e, k, v, i = 0, c = [], rand = new
|
|
54230
|
+
var a, b, e, k, v, i = 0, c = [], rand = new BigNumber2(ONE);
|
|
55991
54231
|
if (dp == null) dp = DECIMAL_PLACES;
|
|
55992
54232
|
else intCheck(dp, 0, MAX);
|
|
55993
54233
|
k = mathceil(dp / LOG_BASE);
|
|
@@ -56048,8 +54288,8 @@ var require_bignumber2 = __commonJS({
|
|
|
56048
54288
|
return rand;
|
|
56049
54289
|
};
|
|
56050
54290
|
})();
|
|
56051
|
-
|
|
56052
|
-
var i = 1, args = arguments, sum = new
|
|
54291
|
+
BigNumber2.sum = function() {
|
|
54292
|
+
var i = 1, args = arguments, sum = new BigNumber2(args[0]);
|
|
56053
54293
|
for (; i < args.length; ) sum = sum.plus(args[i++]);
|
|
56054
54294
|
return sum;
|
|
56055
54295
|
};
|
|
@@ -56076,7 +54316,7 @@ var require_bignumber2 = __commonJS({
|
|
|
56076
54316
|
k = POW_PRECISION;
|
|
56077
54317
|
POW_PRECISION = 0;
|
|
56078
54318
|
str = str.replace(".", "");
|
|
56079
|
-
y = new
|
|
54319
|
+
y = new BigNumber2(baseIn);
|
|
56080
54320
|
x = y.pow(str.length - i);
|
|
56081
54321
|
POW_PRECISION = k;
|
|
56082
54322
|
y.c = toBaseOut(
|
|
@@ -56167,7 +54407,7 @@ var require_bignumber2 = __commonJS({
|
|
|
56167
54407
|
return function(x, y, dp, rm, base) {
|
|
56168
54408
|
var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0, yL, yz, s = x.s == y.s ? 1 : -1, xc = x.c, yc = y.c;
|
|
56169
54409
|
if (!xc || !xc[0] || !yc || !yc[0]) {
|
|
56170
|
-
return new
|
|
54410
|
+
return new BigNumber2(
|
|
56171
54411
|
// Return NaN if either NaN, or both Infinity or 0.
|
|
56172
54412
|
!x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : (
|
|
56173
54413
|
// Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
|
|
@@ -56175,7 +54415,7 @@ var require_bignumber2 = __commonJS({
|
|
|
56175
54415
|
)
|
|
56176
54416
|
);
|
|
56177
54417
|
}
|
|
56178
|
-
q = new
|
|
54418
|
+
q = new BigNumber2(s);
|
|
56179
54419
|
qc = q.c = [];
|
|
56180
54420
|
e = x.e - y.e;
|
|
56181
54421
|
s = dp + e + 1;
|
|
@@ -56280,7 +54520,7 @@ var require_bignumber2 = __commonJS({
|
|
|
56280
54520
|
str = coeffToString(n.c);
|
|
56281
54521
|
str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS) ? toExponential(str, ne) : toFixedPoint(str, ne, "0");
|
|
56282
54522
|
} else {
|
|
56283
|
-
n = round(new
|
|
54523
|
+
n = round(new BigNumber2(n), i, rm);
|
|
56284
54524
|
e = n.e;
|
|
56285
54525
|
str = coeffToString(n.c);
|
|
56286
54526
|
len = str.length;
|
|
@@ -56288,7 +54528,7 @@ var require_bignumber2 = __commonJS({
|
|
|
56288
54528
|
for (; len < i; str += "0", len++) ;
|
|
56289
54529
|
str = toExponential(str, e);
|
|
56290
54530
|
} else {
|
|
56291
|
-
i -= ne;
|
|
54531
|
+
i -= ne + (id === 2 && e > ne);
|
|
56292
54532
|
str = toFixedPoint(str, e, "0");
|
|
56293
54533
|
if (e + 1 > len) {
|
|
56294
54534
|
if (--i > 0) for (str += "."; i--; str += "0") ;
|
|
@@ -56303,18 +54543,15 @@ var require_bignumber2 = __commonJS({
|
|
|
56303
54543
|
}
|
|
56304
54544
|
return n.s < 0 && c0 ? "-" + str : str;
|
|
56305
54545
|
}
|
|
56306
|
-
function maxOrMin(args,
|
|
56307
|
-
var
|
|
54546
|
+
function maxOrMin(args, n) {
|
|
54547
|
+
var k, y, i = 1, x = new BigNumber2(args[0]);
|
|
56308
54548
|
for (; i < args.length; i++) {
|
|
56309
|
-
|
|
56310
|
-
if (!n.s) {
|
|
56311
|
-
|
|
56312
|
-
break;
|
|
56313
|
-
} else if (method.call(m, n)) {
|
|
56314
|
-
m = n;
|
|
54549
|
+
y = new BigNumber2(args[i]);
|
|
54550
|
+
if (!y.s || (k = compare(x, y)) === n || k === 0 && x.s === n) {
|
|
54551
|
+
x = y;
|
|
56315
54552
|
}
|
|
56316
54553
|
}
|
|
56317
|
-
return
|
|
54554
|
+
return x;
|
|
56318
54555
|
}
|
|
56319
54556
|
function normalise(n, c, e) {
|
|
56320
54557
|
var i = 1, j = c.length;
|
|
@@ -56346,9 +54583,9 @@ var require_bignumber2 = __commonJS({
|
|
|
56346
54583
|
base = b;
|
|
56347
54584
|
s = s.replace(dotAfter, "$1").replace(dotBefore, "0.$1");
|
|
56348
54585
|
}
|
|
56349
|
-
if (str != s) return new
|
|
54586
|
+
if (str != s) return new BigNumber2(s, base);
|
|
56350
54587
|
}
|
|
56351
|
-
if (
|
|
54588
|
+
if (BigNumber2.DEBUG) {
|
|
56352
54589
|
throw Error(bignumberError + "Not a" + (b ? " base " + b : "") + " number: " + str);
|
|
56353
54590
|
}
|
|
56354
54591
|
x.s = null;
|
|
@@ -56366,7 +54603,7 @@ var require_bignumber2 = __commonJS({
|
|
|
56366
54603
|
i += LOG_BASE;
|
|
56367
54604
|
j = sd;
|
|
56368
54605
|
n = xc[ni = 0];
|
|
56369
|
-
rd = n / pows10[d - j - 1] % 10
|
|
54606
|
+
rd = mathfloor(n / pows10[d - j - 1] % 10);
|
|
56370
54607
|
} else {
|
|
56371
54608
|
ni = mathceil((i + 1) / LOG_BASE);
|
|
56372
54609
|
if (ni >= xc.length) {
|
|
@@ -56384,7 +54621,7 @@ var require_bignumber2 = __commonJS({
|
|
|
56384
54621
|
for (d = 1; k >= 10; k /= 10, d++) ;
|
|
56385
54622
|
i %= LOG_BASE;
|
|
56386
54623
|
j = i - LOG_BASE + d;
|
|
56387
|
-
rd = j < 0 ? 0 : n / pows10[d - j - 1] % 10
|
|
54624
|
+
rd = j < 0 ? 0 : mathfloor(n / pows10[d - j - 1] % 10);
|
|
56388
54625
|
}
|
|
56389
54626
|
}
|
|
56390
54627
|
r = r || sd < 0 || // Are there any non-zero digits after the rounding digit?
|
|
@@ -56450,12 +54687,12 @@ var require_bignumber2 = __commonJS({
|
|
|
56450
54687
|
return n.s < 0 ? "-" + str : str;
|
|
56451
54688
|
}
|
|
56452
54689
|
P.absoluteValue = P.abs = function() {
|
|
56453
|
-
var x = new
|
|
54690
|
+
var x = new BigNumber2(this);
|
|
56454
54691
|
if (x.s < 0) x.s = 1;
|
|
56455
54692
|
return x;
|
|
56456
54693
|
};
|
|
56457
54694
|
P.comparedTo = function(y, b) {
|
|
56458
|
-
return compare(this, new
|
|
54695
|
+
return compare(this, new BigNumber2(y, b));
|
|
56459
54696
|
};
|
|
56460
54697
|
P.decimalPlaces = P.dp = function(dp, rm) {
|
|
56461
54698
|
var c, n, v, x = this;
|
|
@@ -56463,7 +54700,7 @@ var require_bignumber2 = __commonJS({
|
|
|
56463
54700
|
intCheck(dp, 0, MAX);
|
|
56464
54701
|
if (rm == null) rm = ROUNDING_MODE;
|
|
56465
54702
|
else intCheck(rm, 0, 8);
|
|
56466
|
-
return round(new
|
|
54703
|
+
return round(new BigNumber2(x), dp + x.e + 1, rm);
|
|
56467
54704
|
}
|
|
56468
54705
|
if (!(c = x.c)) return null;
|
|
56469
54706
|
n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE;
|
|
@@ -56472,44 +54709,44 @@ var require_bignumber2 = __commonJS({
|
|
|
56472
54709
|
return n;
|
|
56473
54710
|
};
|
|
56474
54711
|
P.dividedBy = P.div = function(y, b) {
|
|
56475
|
-
return div(this, new
|
|
54712
|
+
return div(this, new BigNumber2(y, b), DECIMAL_PLACES, ROUNDING_MODE);
|
|
56476
54713
|
};
|
|
56477
54714
|
P.dividedToIntegerBy = P.idiv = function(y, b) {
|
|
56478
|
-
return div(this, new
|
|
54715
|
+
return div(this, new BigNumber2(y, b), 0, 1);
|
|
56479
54716
|
};
|
|
56480
54717
|
P.exponentiatedBy = P.pow = function(n, m) {
|
|
56481
54718
|
var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y, x = this;
|
|
56482
|
-
n = new
|
|
54719
|
+
n = new BigNumber2(n);
|
|
56483
54720
|
if (n.c && !n.isInteger()) {
|
|
56484
54721
|
throw Error(bignumberError + "Exponent not an integer: " + valueOf(n));
|
|
56485
54722
|
}
|
|
56486
|
-
if (m != null) m = new
|
|
54723
|
+
if (m != null) m = new BigNumber2(m);
|
|
56487
54724
|
nIsBig = n.e > 14;
|
|
56488
54725
|
if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) {
|
|
56489
|
-
y = new
|
|
54726
|
+
y = new BigNumber2(Math.pow(+valueOf(x), nIsBig ? n.s * (2 - isOdd(n)) : +valueOf(n)));
|
|
56490
54727
|
return m ? y.mod(m) : y;
|
|
56491
54728
|
}
|
|
56492
54729
|
nIsNeg = n.s < 0;
|
|
56493
54730
|
if (m) {
|
|
56494
|
-
if (m.c ? !m.c[0] : !m.s) return new
|
|
54731
|
+
if (m.c ? !m.c[0] : !m.s) return new BigNumber2(NaN);
|
|
56495
54732
|
isModExp = !nIsNeg && x.isInteger() && m.isInteger();
|
|
56496
54733
|
if (isModExp) x = x.mod(m);
|
|
56497
54734
|
} else if (n.e > 9 && (x.e > 0 || x.e < -1 || (x.e == 0 ? x.c[0] > 1 || nIsBig && x.c[1] >= 24e7 : x.c[0] < 8e13 || nIsBig && x.c[0] <= 9999975e7))) {
|
|
56498
54735
|
k = x.s < 0 && isOdd(n) ? -0 : 0;
|
|
56499
54736
|
if (x.e > -1) k = 1 / k;
|
|
56500
|
-
return new
|
|
54737
|
+
return new BigNumber2(nIsNeg ? 1 / k : k);
|
|
56501
54738
|
} else if (POW_PRECISION) {
|
|
56502
54739
|
k = mathceil(POW_PRECISION / LOG_BASE + 2);
|
|
56503
54740
|
}
|
|
56504
54741
|
if (nIsBig) {
|
|
56505
|
-
half = new
|
|
54742
|
+
half = new BigNumber2(0.5);
|
|
56506
54743
|
if (nIsNeg) n.s = 1;
|
|
56507
54744
|
nIsOdd = isOdd(n);
|
|
56508
54745
|
} else {
|
|
56509
54746
|
i = Math.abs(+valueOf(n));
|
|
56510
54747
|
nIsOdd = i % 2;
|
|
56511
54748
|
}
|
|
56512
|
-
y = new
|
|
54749
|
+
y = new BigNumber2(ONE);
|
|
56513
54750
|
for (; ; ) {
|
|
56514
54751
|
if (nIsOdd) {
|
|
56515
54752
|
y = y.times(x);
|
|
@@ -56547,31 +54784,31 @@ var require_bignumber2 = __commonJS({
|
|
|
56547
54784
|
return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y;
|
|
56548
54785
|
};
|
|
56549
54786
|
P.integerValue = function(rm) {
|
|
56550
|
-
var n = new
|
|
54787
|
+
var n = new BigNumber2(this);
|
|
56551
54788
|
if (rm == null) rm = ROUNDING_MODE;
|
|
56552
54789
|
else intCheck(rm, 0, 8);
|
|
56553
54790
|
return round(n, n.e + 1, rm);
|
|
56554
54791
|
};
|
|
56555
54792
|
P.isEqualTo = P.eq = function(y, b) {
|
|
56556
|
-
return compare(this, new
|
|
54793
|
+
return compare(this, new BigNumber2(y, b)) === 0;
|
|
56557
54794
|
};
|
|
56558
54795
|
P.isFinite = function() {
|
|
56559
54796
|
return !!this.c;
|
|
56560
54797
|
};
|
|
56561
54798
|
P.isGreaterThan = P.gt = function(y, b) {
|
|
56562
|
-
return compare(this, new
|
|
54799
|
+
return compare(this, new BigNumber2(y, b)) > 0;
|
|
56563
54800
|
};
|
|
56564
54801
|
P.isGreaterThanOrEqualTo = P.gte = function(y, b) {
|
|
56565
|
-
return (b = compare(this, new
|
|
54802
|
+
return (b = compare(this, new BigNumber2(y, b))) === 1 || b === 0;
|
|
56566
54803
|
};
|
|
56567
54804
|
P.isInteger = function() {
|
|
56568
54805
|
return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2;
|
|
56569
54806
|
};
|
|
56570
54807
|
P.isLessThan = P.lt = function(y, b) {
|
|
56571
|
-
return compare(this, new
|
|
54808
|
+
return compare(this, new BigNumber2(y, b)) < 0;
|
|
56572
54809
|
};
|
|
56573
54810
|
P.isLessThanOrEqualTo = P.lte = function(y, b) {
|
|
56574
|
-
return (b = compare(this, new
|
|
54811
|
+
return (b = compare(this, new BigNumber2(y, b))) === -1 || b === 0;
|
|
56575
54812
|
};
|
|
56576
54813
|
P.isNaN = function() {
|
|
56577
54814
|
return !this.s;
|
|
@@ -56587,18 +54824,18 @@ var require_bignumber2 = __commonJS({
|
|
|
56587
54824
|
};
|
|
56588
54825
|
P.minus = function(y, b) {
|
|
56589
54826
|
var i, j, t, xLTy, x = this, a = x.s;
|
|
56590
|
-
y = new
|
|
54827
|
+
y = new BigNumber2(y, b);
|
|
56591
54828
|
b = y.s;
|
|
56592
|
-
if (!a || !b) return new
|
|
54829
|
+
if (!a || !b) return new BigNumber2(NaN);
|
|
56593
54830
|
if (a != b) {
|
|
56594
54831
|
y.s = -b;
|
|
56595
54832
|
return x.plus(y);
|
|
56596
54833
|
}
|
|
56597
54834
|
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
56598
54835
|
if (!xe || !ye) {
|
|
56599
|
-
if (!xc || !yc) return xc ? (y.s = -b, y) : new
|
|
54836
|
+
if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber2(yc ? x : NaN);
|
|
56600
54837
|
if (!xc[0] || !yc[0]) {
|
|
56601
|
-
return yc[0] ? (y.s = -b, y) : new
|
|
54838
|
+
return yc[0] ? (y.s = -b, y) : new BigNumber2(xc[0] ? x : (
|
|
56602
54839
|
// IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
|
|
56603
54840
|
ROUNDING_MODE == 3 ? -0 : 0
|
|
56604
54841
|
));
|
|
@@ -56627,7 +54864,12 @@ var require_bignumber2 = __commonJS({
|
|
|
56627
54864
|
}
|
|
56628
54865
|
}
|
|
56629
54866
|
}
|
|
56630
|
-
if (xLTy)
|
|
54867
|
+
if (xLTy) {
|
|
54868
|
+
t = xc;
|
|
54869
|
+
xc = yc;
|
|
54870
|
+
yc = t;
|
|
54871
|
+
y.s = -y.s;
|
|
54872
|
+
}
|
|
56631
54873
|
b = (j = yc.length) - (i = xc.length);
|
|
56632
54874
|
if (b > 0) for (; b--; xc[i++] = 0) ;
|
|
56633
54875
|
b = BASE - 1;
|
|
@@ -56649,11 +54891,11 @@ var require_bignumber2 = __commonJS({
|
|
|
56649
54891
|
};
|
|
56650
54892
|
P.modulo = P.mod = function(y, b) {
|
|
56651
54893
|
var q, s, x = this;
|
|
56652
|
-
y = new
|
|
54894
|
+
y = new BigNumber2(y, b);
|
|
56653
54895
|
if (!x.c || !y.s || y.c && !y.c[0]) {
|
|
56654
|
-
return new
|
|
54896
|
+
return new BigNumber2(NaN);
|
|
56655
54897
|
} else if (!y.c || x.c && !x.c[0]) {
|
|
56656
|
-
return new
|
|
54898
|
+
return new BigNumber2(x);
|
|
56657
54899
|
}
|
|
56658
54900
|
if (MODULO_MODE == 9) {
|
|
56659
54901
|
s = y.s;
|
|
@@ -56669,7 +54911,7 @@ var require_bignumber2 = __commonJS({
|
|
|
56669
54911
|
return y;
|
|
56670
54912
|
};
|
|
56671
54913
|
P.multipliedBy = P.times = function(y, b) {
|
|
56672
|
-
var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, base, sqrtBase, x = this, xc = x.c, yc = (y = new
|
|
54914
|
+
var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, base, sqrtBase, x = this, xc = x.c, yc = (y = new BigNumber2(y, b)).c;
|
|
56673
54915
|
if (!xc || !yc || !xc[0] || !yc[0]) {
|
|
56674
54916
|
if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) {
|
|
56675
54917
|
y.c = y.e = y.s = null;
|
|
@@ -56688,7 +54930,14 @@ var require_bignumber2 = __commonJS({
|
|
|
56688
54930
|
y.s *= x.s;
|
|
56689
54931
|
xcL = xc.length;
|
|
56690
54932
|
ycL = yc.length;
|
|
56691
|
-
if (xcL < ycL)
|
|
54933
|
+
if (xcL < ycL) {
|
|
54934
|
+
zc = xc;
|
|
54935
|
+
xc = yc;
|
|
54936
|
+
yc = zc;
|
|
54937
|
+
i = xcL;
|
|
54938
|
+
xcL = ycL;
|
|
54939
|
+
ycL = i;
|
|
54940
|
+
}
|
|
56692
54941
|
for (i = xcL + ycL, zc = []; i--; zc.push(0)) ;
|
|
56693
54942
|
base = BASE;
|
|
56694
54943
|
sqrtBase = SQRT_BASE;
|
|
@@ -56714,23 +54963,23 @@ var require_bignumber2 = __commonJS({
|
|
|
56714
54963
|
return normalise(y, zc, e);
|
|
56715
54964
|
};
|
|
56716
54965
|
P.negated = function() {
|
|
56717
|
-
var x = new
|
|
54966
|
+
var x = new BigNumber2(this);
|
|
56718
54967
|
x.s = -x.s || null;
|
|
56719
54968
|
return x;
|
|
56720
54969
|
};
|
|
56721
54970
|
P.plus = function(y, b) {
|
|
56722
54971
|
var t, x = this, a = x.s;
|
|
56723
|
-
y = new
|
|
54972
|
+
y = new BigNumber2(y, b);
|
|
56724
54973
|
b = y.s;
|
|
56725
|
-
if (!a || !b) return new
|
|
54974
|
+
if (!a || !b) return new BigNumber2(NaN);
|
|
56726
54975
|
if (a != b) {
|
|
56727
54976
|
y.s = -b;
|
|
56728
54977
|
return x.minus(y);
|
|
56729
54978
|
}
|
|
56730
54979
|
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
56731
54980
|
if (!xe || !ye) {
|
|
56732
|
-
if (!xc || !yc) return new
|
|
56733
|
-
if (!xc[0] || !yc[0]) return yc[0] ? y : new
|
|
54981
|
+
if (!xc || !yc) return new BigNumber2(a / 0);
|
|
54982
|
+
if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber2(xc[0] ? x : a * 0);
|
|
56734
54983
|
}
|
|
56735
54984
|
xe = bitFloor(xe);
|
|
56736
54985
|
ye = bitFloor(ye);
|
|
@@ -56749,7 +54998,12 @@ var require_bignumber2 = __commonJS({
|
|
|
56749
54998
|
}
|
|
56750
54999
|
a = xc.length;
|
|
56751
55000
|
b = yc.length;
|
|
56752
|
-
if (a - b < 0)
|
|
55001
|
+
if (a - b < 0) {
|
|
55002
|
+
t = yc;
|
|
55003
|
+
yc = xc;
|
|
55004
|
+
xc = t;
|
|
55005
|
+
b = a;
|
|
55006
|
+
}
|
|
56753
55007
|
for (a = 0; b; ) {
|
|
56754
55008
|
a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0;
|
|
56755
55009
|
xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE;
|
|
@@ -56766,7 +55020,7 @@ var require_bignumber2 = __commonJS({
|
|
|
56766
55020
|
intCheck(sd, 1, MAX);
|
|
56767
55021
|
if (rm == null) rm = ROUNDING_MODE;
|
|
56768
55022
|
else intCheck(rm, 0, 8);
|
|
56769
|
-
return round(new
|
|
55023
|
+
return round(new BigNumber2(x), sd, rm);
|
|
56770
55024
|
}
|
|
56771
55025
|
if (!(c = x.c)) return null;
|
|
56772
55026
|
v = c.length - 1;
|
|
@@ -56783,9 +55037,9 @@ var require_bignumber2 = __commonJS({
|
|
|
56783
55037
|
return this.times("1e" + k);
|
|
56784
55038
|
};
|
|
56785
55039
|
P.squareRoot = P.sqrt = function() {
|
|
56786
|
-
var m, n, r, rep, t, x = this, c = x.c, s = x.s, e = x.e, dp = DECIMAL_PLACES + 4, half = new
|
|
55040
|
+
var m, n, r, rep, t, x = this, c = x.c, s = x.s, e = x.e, dp = DECIMAL_PLACES + 4, half = new BigNumber2("0.5");
|
|
56787
55041
|
if (s !== 1 || !c || !c[0]) {
|
|
56788
|
-
return new
|
|
55042
|
+
return new BigNumber2(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0);
|
|
56789
55043
|
}
|
|
56790
55044
|
s = Math.sqrt(+valueOf(x));
|
|
56791
55045
|
if (s == 0 || s == 1 / 0) {
|
|
@@ -56794,14 +55048,14 @@ var require_bignumber2 = __commonJS({
|
|
|
56794
55048
|
s = Math.sqrt(+n);
|
|
56795
55049
|
e = bitFloor((e + 1) / 2) - (e < 0 || e % 2);
|
|
56796
55050
|
if (s == 1 / 0) {
|
|
56797
|
-
n = "
|
|
55051
|
+
n = "5e" + e;
|
|
56798
55052
|
} else {
|
|
56799
55053
|
n = s.toExponential();
|
|
56800
55054
|
n = n.slice(0, n.indexOf("e") + 1) + e;
|
|
56801
55055
|
}
|
|
56802
|
-
r = new
|
|
55056
|
+
r = new BigNumber2(n);
|
|
56803
55057
|
} else {
|
|
56804
|
-
r = new
|
|
55058
|
+
r = new BigNumber2(s + "");
|
|
56805
55059
|
}
|
|
56806
55060
|
if (r.c[0]) {
|
|
56807
55061
|
e = r.e;
|
|
@@ -56848,193 +55102,607 @@ var require_bignumber2 = __commonJS({
|
|
|
56848
55102
|
intCheck(dp, 0, MAX);
|
|
56849
55103
|
dp = dp + this.e + 1;
|
|
56850
55104
|
}
|
|
56851
|
-
return format(this, dp, rm);
|
|
56852
|
-
};
|
|
56853
|
-
P.toFormat = function(dp, rm, format2) {
|
|
56854
|
-
var str, x = this;
|
|
56855
|
-
if (format2 == null) {
|
|
56856
|
-
if (dp != null && rm && typeof rm == "object") {
|
|
56857
|
-
format2 = rm;
|
|
56858
|
-
rm = null;
|
|
56859
|
-
} else if (dp && typeof dp == "object") {
|
|
56860
|
-
format2 = dp;
|
|
56861
|
-
dp = rm = null;
|
|
56862
|
-
} else {
|
|
56863
|
-
format2 = FORMAT;
|
|
55105
|
+
return format(this, dp, rm);
|
|
55106
|
+
};
|
|
55107
|
+
P.toFormat = function(dp, rm, format2) {
|
|
55108
|
+
var str, x = this;
|
|
55109
|
+
if (format2 == null) {
|
|
55110
|
+
if (dp != null && rm && typeof rm == "object") {
|
|
55111
|
+
format2 = rm;
|
|
55112
|
+
rm = null;
|
|
55113
|
+
} else if (dp && typeof dp == "object") {
|
|
55114
|
+
format2 = dp;
|
|
55115
|
+
dp = rm = null;
|
|
55116
|
+
} else {
|
|
55117
|
+
format2 = FORMAT;
|
|
55118
|
+
}
|
|
55119
|
+
} else if (typeof format2 != "object") {
|
|
55120
|
+
throw Error(bignumberError + "Argument not an object: " + format2);
|
|
55121
|
+
}
|
|
55122
|
+
str = x.toFixed(dp, rm);
|
|
55123
|
+
if (x.c) {
|
|
55124
|
+
var i, arr = str.split("."), g1 = +format2.groupSize, g2 = +format2.secondaryGroupSize, groupSeparator = format2.groupSeparator || "", intPart = arr[0], fractionPart = arr[1], isNeg = x.s < 0, intDigits = isNeg ? intPart.slice(1) : intPart, len = intDigits.length;
|
|
55125
|
+
if (g2) {
|
|
55126
|
+
i = g1;
|
|
55127
|
+
g1 = g2;
|
|
55128
|
+
g2 = i;
|
|
55129
|
+
len -= i;
|
|
55130
|
+
}
|
|
55131
|
+
if (g1 > 0 && len > 0) {
|
|
55132
|
+
i = len % g1 || g1;
|
|
55133
|
+
intPart = intDigits.substr(0, i);
|
|
55134
|
+
for (; i < len; i += g1) intPart += groupSeparator + intDigits.substr(i, g1);
|
|
55135
|
+
if (g2 > 0) intPart += groupSeparator + intDigits.slice(i);
|
|
55136
|
+
if (isNeg) intPart = "-" + intPart;
|
|
55137
|
+
}
|
|
55138
|
+
str = fractionPart ? intPart + (format2.decimalSeparator || "") + ((g2 = +format2.fractionGroupSize) ? fractionPart.replace(
|
|
55139
|
+
new RegExp("\\d{" + g2 + "}\\B", "g"),
|
|
55140
|
+
"$&" + (format2.fractionGroupSeparator || "")
|
|
55141
|
+
) : fractionPart) : intPart;
|
|
55142
|
+
}
|
|
55143
|
+
return (format2.prefix || "") + str + (format2.suffix || "");
|
|
55144
|
+
};
|
|
55145
|
+
P.toFraction = function(md) {
|
|
55146
|
+
var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s, x = this, xc = x.c;
|
|
55147
|
+
if (md != null) {
|
|
55148
|
+
n = new BigNumber2(md);
|
|
55149
|
+
if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) {
|
|
55150
|
+
throw Error(bignumberError + "Argument " + (n.isInteger() ? "out of range: " : "not an integer: ") + valueOf(n));
|
|
55151
|
+
}
|
|
55152
|
+
}
|
|
55153
|
+
if (!xc) return new BigNumber2(x);
|
|
55154
|
+
d = new BigNumber2(ONE);
|
|
55155
|
+
n1 = d0 = new BigNumber2(ONE);
|
|
55156
|
+
d1 = n0 = new BigNumber2(ONE);
|
|
55157
|
+
s = coeffToString(xc);
|
|
55158
|
+
e = d.e = s.length - x.e - 1;
|
|
55159
|
+
d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp];
|
|
55160
|
+
md = !md || n.comparedTo(d) > 0 ? e > 0 ? d : n1 : n;
|
|
55161
|
+
exp = MAX_EXP;
|
|
55162
|
+
MAX_EXP = 1 / 0;
|
|
55163
|
+
n = new BigNumber2(s);
|
|
55164
|
+
n0.c[0] = 0;
|
|
55165
|
+
for (; ; ) {
|
|
55166
|
+
q = div(n, d, 0, 1);
|
|
55167
|
+
d2 = d0.plus(q.times(d1));
|
|
55168
|
+
if (d2.comparedTo(md) == 1) break;
|
|
55169
|
+
d0 = d1;
|
|
55170
|
+
d1 = d2;
|
|
55171
|
+
n1 = n0.plus(q.times(d2 = n1));
|
|
55172
|
+
n0 = d2;
|
|
55173
|
+
d = n.minus(q.times(d2 = d));
|
|
55174
|
+
n = d2;
|
|
55175
|
+
}
|
|
55176
|
+
d2 = div(md.minus(d0), d1, 0, 1);
|
|
55177
|
+
n0 = n0.plus(d2.times(n1));
|
|
55178
|
+
d0 = d0.plus(d2.times(d1));
|
|
55179
|
+
n0.s = n1.s = x.s;
|
|
55180
|
+
e = e * 2;
|
|
55181
|
+
r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo(
|
|
55182
|
+
div(n0, d0, e, ROUNDING_MODE).minus(x).abs()
|
|
55183
|
+
) < 1 ? [n1, d1] : [n0, d0];
|
|
55184
|
+
MAX_EXP = exp;
|
|
55185
|
+
return r;
|
|
55186
|
+
};
|
|
55187
|
+
P.toNumber = function() {
|
|
55188
|
+
return +valueOf(this);
|
|
55189
|
+
};
|
|
55190
|
+
P.toPrecision = function(sd, rm) {
|
|
55191
|
+
if (sd != null) intCheck(sd, 1, MAX);
|
|
55192
|
+
return format(this, sd, rm, 2);
|
|
55193
|
+
};
|
|
55194
|
+
P.toString = function(b) {
|
|
55195
|
+
var str, n = this, s = n.s, e = n.e;
|
|
55196
|
+
if (e === null) {
|
|
55197
|
+
if (s) {
|
|
55198
|
+
str = "Infinity";
|
|
55199
|
+
if (s < 0) str = "-" + str;
|
|
55200
|
+
} else {
|
|
55201
|
+
str = "NaN";
|
|
55202
|
+
}
|
|
55203
|
+
} else {
|
|
55204
|
+
if (b == null) {
|
|
55205
|
+
str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(coeffToString(n.c), e) : toFixedPoint(coeffToString(n.c), e, "0");
|
|
55206
|
+
} else if (b === 10 && alphabetHasNormalDecimalDigits) {
|
|
55207
|
+
n = round(new BigNumber2(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE);
|
|
55208
|
+
str = toFixedPoint(coeffToString(n.c), n.e, "0");
|
|
55209
|
+
} else {
|
|
55210
|
+
intCheck(b, 2, ALPHABET.length, "Base");
|
|
55211
|
+
str = convertBase(toFixedPoint(coeffToString(n.c), e, "0"), 10, b, s, true);
|
|
55212
|
+
}
|
|
55213
|
+
if (s < 0 && n.c[0]) str = "-" + str;
|
|
55214
|
+
}
|
|
55215
|
+
return str;
|
|
55216
|
+
};
|
|
55217
|
+
P.valueOf = P.toJSON = function() {
|
|
55218
|
+
return valueOf(this);
|
|
55219
|
+
};
|
|
55220
|
+
P._isBigNumber = true;
|
|
55221
|
+
if (configObject != null) BigNumber2.set(configObject);
|
|
55222
|
+
return BigNumber2;
|
|
55223
|
+
}
|
|
55224
|
+
function bitFloor(n) {
|
|
55225
|
+
var i = n | 0;
|
|
55226
|
+
return n > 0 || n === i ? i : i - 1;
|
|
55227
|
+
}
|
|
55228
|
+
function coeffToString(a) {
|
|
55229
|
+
var s, z3, i = 1, j = a.length, r = a[0] + "";
|
|
55230
|
+
for (; i < j; ) {
|
|
55231
|
+
s = a[i++] + "";
|
|
55232
|
+
z3 = LOG_BASE - s.length;
|
|
55233
|
+
for (; z3--; s = "0" + s) ;
|
|
55234
|
+
r += s;
|
|
55235
|
+
}
|
|
55236
|
+
for (j = r.length; r.charCodeAt(--j) === 48; ) ;
|
|
55237
|
+
return r.slice(0, j + 1 || 1);
|
|
55238
|
+
}
|
|
55239
|
+
function compare(x, y) {
|
|
55240
|
+
var a, b, xc = x.c, yc = y.c, i = x.s, j = y.s, k = x.e, l = y.e;
|
|
55241
|
+
if (!i || !j) return null;
|
|
55242
|
+
a = xc && !xc[0];
|
|
55243
|
+
b = yc && !yc[0];
|
|
55244
|
+
if (a || b) return a ? b ? 0 : -j : i;
|
|
55245
|
+
if (i != j) return i;
|
|
55246
|
+
a = i < 0;
|
|
55247
|
+
b = k == l;
|
|
55248
|
+
if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1;
|
|
55249
|
+
if (!b) return k > l ^ a ? 1 : -1;
|
|
55250
|
+
j = (k = xc.length) < (l = yc.length) ? k : l;
|
|
55251
|
+
for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1;
|
|
55252
|
+
return k == l ? 0 : k > l ^ a ? 1 : -1;
|
|
55253
|
+
}
|
|
55254
|
+
function intCheck(n, min, max, name) {
|
|
55255
|
+
if (n < min || n > max || n !== mathfloor(n)) {
|
|
55256
|
+
throw Error(bignumberError + (name || "Argument") + (typeof n == "number" ? n < min || n > max ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(n));
|
|
55257
|
+
}
|
|
55258
|
+
}
|
|
55259
|
+
function isOdd(n) {
|
|
55260
|
+
var k = n.c.length - 1;
|
|
55261
|
+
return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0;
|
|
55262
|
+
}
|
|
55263
|
+
function toExponential(str, e) {
|
|
55264
|
+
return (str.length > 1 ? str.charAt(0) + "." + str.slice(1) : str) + (e < 0 ? "e" : "e+") + e;
|
|
55265
|
+
}
|
|
55266
|
+
function toFixedPoint(str, e, z3) {
|
|
55267
|
+
var len, zs;
|
|
55268
|
+
if (e < 0) {
|
|
55269
|
+
for (zs = z3 + "."; ++e; zs += z3) ;
|
|
55270
|
+
str = zs + str;
|
|
55271
|
+
} else {
|
|
55272
|
+
len = str.length;
|
|
55273
|
+
if (++e > len) {
|
|
55274
|
+
for (zs = z3, e -= len; --e; zs += z3) ;
|
|
55275
|
+
str += zs;
|
|
55276
|
+
} else if (e < len) {
|
|
55277
|
+
str = str.slice(0, e) + "." + str.slice(e);
|
|
55278
|
+
}
|
|
55279
|
+
}
|
|
55280
|
+
return str;
|
|
55281
|
+
}
|
|
55282
|
+
BigNumber = clone2();
|
|
55283
|
+
BigNumber["default"] = BigNumber.BigNumber = BigNumber;
|
|
55284
|
+
if (typeof define == "function" && define.amd) {
|
|
55285
|
+
define(function() {
|
|
55286
|
+
return BigNumber;
|
|
55287
|
+
});
|
|
55288
|
+
} else if (typeof module2 != "undefined" && module2.exports) {
|
|
55289
|
+
module2.exports = BigNumber;
|
|
55290
|
+
} else {
|
|
55291
|
+
if (!globalObject) {
|
|
55292
|
+
globalObject = typeof self != "undefined" && self ? self : window;
|
|
55293
|
+
}
|
|
55294
|
+
globalObject.BigNumber = BigNumber;
|
|
55295
|
+
}
|
|
55296
|
+
})(exports2);
|
|
55297
|
+
}
|
|
55298
|
+
});
|
|
55299
|
+
|
|
55300
|
+
// node_modules/json-bigint/lib/stringify.js
|
|
55301
|
+
var require_stringify = __commonJS({
|
|
55302
|
+
"node_modules/json-bigint/lib/stringify.js"(exports2, module2) {
|
|
55303
|
+
var BigNumber = require_bignumber();
|
|
55304
|
+
var JSON2 = module2.exports;
|
|
55305
|
+
(function() {
|
|
55306
|
+
"use strict";
|
|
55307
|
+
function f(n) {
|
|
55308
|
+
return n < 10 ? "0" + n : n;
|
|
55309
|
+
}
|
|
55310
|
+
var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta3 = {
|
|
55311
|
+
// table of character substitutions
|
|
55312
|
+
"\b": "\\b",
|
|
55313
|
+
" ": "\\t",
|
|
55314
|
+
"\n": "\\n",
|
|
55315
|
+
"\f": "\\f",
|
|
55316
|
+
"\r": "\\r",
|
|
55317
|
+
'"': '\\"',
|
|
55318
|
+
"\\": "\\\\"
|
|
55319
|
+
}, rep;
|
|
55320
|
+
function quote(string4) {
|
|
55321
|
+
escapable.lastIndex = 0;
|
|
55322
|
+
return escapable.test(string4) ? '"' + string4.replace(escapable, function(a) {
|
|
55323
|
+
var c = meta3[a];
|
|
55324
|
+
return typeof c === "string" ? c : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
|
|
55325
|
+
}) + '"' : '"' + string4 + '"';
|
|
55326
|
+
}
|
|
55327
|
+
function str(key, holder) {
|
|
55328
|
+
var i, k, v, length, mind = gap, partial2, value = holder[key], isBigNumber3 = value != null && (value instanceof BigNumber || BigNumber.isBigNumber(value));
|
|
55329
|
+
if (value && typeof value === "object" && typeof value.toJSON === "function") {
|
|
55330
|
+
value = value.toJSON(key);
|
|
55331
|
+
}
|
|
55332
|
+
if (typeof rep === "function") {
|
|
55333
|
+
value = rep.call(holder, key, value);
|
|
55334
|
+
}
|
|
55335
|
+
switch (typeof value) {
|
|
55336
|
+
case "string":
|
|
55337
|
+
if (isBigNumber3) {
|
|
55338
|
+
return value;
|
|
55339
|
+
} else {
|
|
55340
|
+
return quote(value);
|
|
55341
|
+
}
|
|
55342
|
+
case "number":
|
|
55343
|
+
return isFinite(value) ? String(value) : "null";
|
|
55344
|
+
case "boolean":
|
|
55345
|
+
case "null":
|
|
55346
|
+
case "bigint":
|
|
55347
|
+
return String(value);
|
|
55348
|
+
// If the type is 'object', we might be dealing with an object or an array or
|
|
55349
|
+
// null.
|
|
55350
|
+
case "object":
|
|
55351
|
+
if (!value) {
|
|
55352
|
+
return "null";
|
|
55353
|
+
}
|
|
55354
|
+
gap += indent;
|
|
55355
|
+
partial2 = [];
|
|
55356
|
+
if (Object.prototype.toString.apply(value) === "[object Array]") {
|
|
55357
|
+
length = value.length;
|
|
55358
|
+
for (i = 0; i < length; i += 1) {
|
|
55359
|
+
partial2[i] = str(i, value) || "null";
|
|
55360
|
+
}
|
|
55361
|
+
v = partial2.length === 0 ? "[]" : gap ? "[\n" + gap + partial2.join(",\n" + gap) + "\n" + mind + "]" : "[" + partial2.join(",") + "]";
|
|
55362
|
+
gap = mind;
|
|
55363
|
+
return v;
|
|
55364
|
+
}
|
|
55365
|
+
if (rep && typeof rep === "object") {
|
|
55366
|
+
length = rep.length;
|
|
55367
|
+
for (i = 0; i < length; i += 1) {
|
|
55368
|
+
if (typeof rep[i] === "string") {
|
|
55369
|
+
k = rep[i];
|
|
55370
|
+
v = str(k, value);
|
|
55371
|
+
if (v) {
|
|
55372
|
+
partial2.push(quote(k) + (gap ? ": " : ":") + v);
|
|
55373
|
+
}
|
|
55374
|
+
}
|
|
55375
|
+
}
|
|
55376
|
+
} else {
|
|
55377
|
+
Object.keys(value).forEach(function(k2) {
|
|
55378
|
+
var v2 = str(k2, value);
|
|
55379
|
+
if (v2) {
|
|
55380
|
+
partial2.push(quote(k2) + (gap ? ": " : ":") + v2);
|
|
55381
|
+
}
|
|
55382
|
+
});
|
|
55383
|
+
}
|
|
55384
|
+
v = partial2.length === 0 ? "{}" : gap ? "{\n" + gap + partial2.join(",\n" + gap) + "\n" + mind + "}" : "{" + partial2.join(",") + "}";
|
|
55385
|
+
gap = mind;
|
|
55386
|
+
return v;
|
|
55387
|
+
}
|
|
55388
|
+
}
|
|
55389
|
+
if (typeof JSON2.stringify !== "function") {
|
|
55390
|
+
JSON2.stringify = function(value, replacer, space) {
|
|
55391
|
+
var i;
|
|
55392
|
+
gap = "";
|
|
55393
|
+
indent = "";
|
|
55394
|
+
if (typeof space === "number") {
|
|
55395
|
+
for (i = 0; i < space; i += 1) {
|
|
55396
|
+
indent += " ";
|
|
55397
|
+
}
|
|
55398
|
+
} else if (typeof space === "string") {
|
|
55399
|
+
indent = space;
|
|
55400
|
+
}
|
|
55401
|
+
rep = replacer;
|
|
55402
|
+
if (replacer && typeof replacer !== "function" && (typeof replacer !== "object" || typeof replacer.length !== "number")) {
|
|
55403
|
+
throw new Error("JSON.stringify");
|
|
55404
|
+
}
|
|
55405
|
+
return str("", { "": value });
|
|
55406
|
+
};
|
|
55407
|
+
}
|
|
55408
|
+
})();
|
|
55409
|
+
}
|
|
55410
|
+
});
|
|
55411
|
+
|
|
55412
|
+
// node_modules/json-bigint/lib/parse.js
|
|
55413
|
+
var require_parse2 = __commonJS({
|
|
55414
|
+
"node_modules/json-bigint/lib/parse.js"(exports2, module2) {
|
|
55415
|
+
var BigNumber = null;
|
|
55416
|
+
var suspectProtoRx = /(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/;
|
|
55417
|
+
var suspectConstructorRx = /(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;
|
|
55418
|
+
var json_parse = function(options) {
|
|
55419
|
+
"use strict";
|
|
55420
|
+
var _options = {
|
|
55421
|
+
strict: false,
|
|
55422
|
+
// not being strict means do not generate syntax errors for "duplicate key"
|
|
55423
|
+
storeAsString: false,
|
|
55424
|
+
// toggles whether the values should be stored as BigNumber (default) or a string
|
|
55425
|
+
alwaysParseAsBig: false,
|
|
55426
|
+
// toggles whether all numbers should be Big
|
|
55427
|
+
useNativeBigInt: false,
|
|
55428
|
+
// toggles whether to use native BigInt instead of bignumber.js
|
|
55429
|
+
protoAction: "error",
|
|
55430
|
+
constructorAction: "error"
|
|
55431
|
+
};
|
|
55432
|
+
if (options !== void 0 && options !== null) {
|
|
55433
|
+
if (options.strict === true) {
|
|
55434
|
+
_options.strict = true;
|
|
55435
|
+
}
|
|
55436
|
+
if (options.storeAsString === true) {
|
|
55437
|
+
_options.storeAsString = true;
|
|
55438
|
+
}
|
|
55439
|
+
_options.alwaysParseAsBig = options.alwaysParseAsBig === true ? options.alwaysParseAsBig : false;
|
|
55440
|
+
_options.useNativeBigInt = options.useNativeBigInt === true ? options.useNativeBigInt : false;
|
|
55441
|
+
if (typeof options.constructorAction !== "undefined") {
|
|
55442
|
+
if (options.constructorAction === "error" || options.constructorAction === "ignore" || options.constructorAction === "preserve") {
|
|
55443
|
+
_options.constructorAction = options.constructorAction;
|
|
55444
|
+
} else {
|
|
55445
|
+
throw new Error(
|
|
55446
|
+
`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${options.constructorAction}`
|
|
55447
|
+
);
|
|
55448
|
+
}
|
|
55449
|
+
}
|
|
55450
|
+
if (typeof options.protoAction !== "undefined") {
|
|
55451
|
+
if (options.protoAction === "error" || options.protoAction === "ignore" || options.protoAction === "preserve") {
|
|
55452
|
+
_options.protoAction = options.protoAction;
|
|
55453
|
+
} else {
|
|
55454
|
+
throw new Error(
|
|
55455
|
+
`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${options.protoAction}`
|
|
55456
|
+
);
|
|
55457
|
+
}
|
|
55458
|
+
}
|
|
55459
|
+
}
|
|
55460
|
+
var at, ch, escapee = {
|
|
55461
|
+
'"': '"',
|
|
55462
|
+
"\\": "\\",
|
|
55463
|
+
"/": "/",
|
|
55464
|
+
b: "\b",
|
|
55465
|
+
f: "\f",
|
|
55466
|
+
n: "\n",
|
|
55467
|
+
r: "\r",
|
|
55468
|
+
t: " "
|
|
55469
|
+
}, text, error49 = function(m) {
|
|
55470
|
+
throw {
|
|
55471
|
+
name: "SyntaxError",
|
|
55472
|
+
message: m,
|
|
55473
|
+
at,
|
|
55474
|
+
text
|
|
55475
|
+
};
|
|
55476
|
+
}, next = function(c) {
|
|
55477
|
+
if (c && c !== ch) {
|
|
55478
|
+
error49("Expected '" + c + "' instead of '" + ch + "'");
|
|
55479
|
+
}
|
|
55480
|
+
ch = text.charAt(at);
|
|
55481
|
+
at += 1;
|
|
55482
|
+
return ch;
|
|
55483
|
+
}, number4 = function() {
|
|
55484
|
+
var number5, string5 = "";
|
|
55485
|
+
if (ch === "-") {
|
|
55486
|
+
string5 = "-";
|
|
55487
|
+
next("-");
|
|
55488
|
+
}
|
|
55489
|
+
while (ch >= "0" && ch <= "9") {
|
|
55490
|
+
string5 += ch;
|
|
55491
|
+
next();
|
|
55492
|
+
}
|
|
55493
|
+
if (ch === ".") {
|
|
55494
|
+
string5 += ".";
|
|
55495
|
+
while (next() && ch >= "0" && ch <= "9") {
|
|
55496
|
+
string5 += ch;
|
|
55497
|
+
}
|
|
55498
|
+
}
|
|
55499
|
+
if (ch === "e" || ch === "E") {
|
|
55500
|
+
string5 += ch;
|
|
55501
|
+
next();
|
|
55502
|
+
if (ch === "-" || ch === "+") {
|
|
55503
|
+
string5 += ch;
|
|
55504
|
+
next();
|
|
55505
|
+
}
|
|
55506
|
+
while (ch >= "0" && ch <= "9") {
|
|
55507
|
+
string5 += ch;
|
|
55508
|
+
next();
|
|
55509
|
+
}
|
|
55510
|
+
}
|
|
55511
|
+
number5 = +string5;
|
|
55512
|
+
if (!isFinite(number5)) {
|
|
55513
|
+
error49("Bad number");
|
|
55514
|
+
} else {
|
|
55515
|
+
if (BigNumber == null) BigNumber = require_bignumber();
|
|
55516
|
+
if (string5.length > 15)
|
|
55517
|
+
return _options.storeAsString ? string5 : _options.useNativeBigInt ? BigInt(string5) : new BigNumber(string5);
|
|
55518
|
+
else
|
|
55519
|
+
return !_options.alwaysParseAsBig ? number5 : _options.useNativeBigInt ? BigInt(number5) : new BigNumber(number5);
|
|
55520
|
+
}
|
|
55521
|
+
}, string4 = function() {
|
|
55522
|
+
var hex3, i, string5 = "", uffff;
|
|
55523
|
+
if (ch === '"') {
|
|
55524
|
+
var startAt = at;
|
|
55525
|
+
while (next()) {
|
|
55526
|
+
if (ch === '"') {
|
|
55527
|
+
if (at - 1 > startAt) string5 += text.substring(startAt, at - 1);
|
|
55528
|
+
next();
|
|
55529
|
+
return string5;
|
|
55530
|
+
}
|
|
55531
|
+
if (ch === "\\") {
|
|
55532
|
+
if (at - 1 > startAt) string5 += text.substring(startAt, at - 1);
|
|
55533
|
+
next();
|
|
55534
|
+
if (ch === "u") {
|
|
55535
|
+
uffff = 0;
|
|
55536
|
+
for (i = 0; i < 4; i += 1) {
|
|
55537
|
+
hex3 = parseInt(next(), 16);
|
|
55538
|
+
if (!isFinite(hex3)) {
|
|
55539
|
+
break;
|
|
55540
|
+
}
|
|
55541
|
+
uffff = uffff * 16 + hex3;
|
|
55542
|
+
}
|
|
55543
|
+
string5 += String.fromCharCode(uffff);
|
|
55544
|
+
} else if (typeof escapee[ch] === "string") {
|
|
55545
|
+
string5 += escapee[ch];
|
|
55546
|
+
} else {
|
|
55547
|
+
break;
|
|
55548
|
+
}
|
|
55549
|
+
startAt = at;
|
|
55550
|
+
}
|
|
55551
|
+
}
|
|
55552
|
+
}
|
|
55553
|
+
error49("Bad string");
|
|
55554
|
+
}, white = function() {
|
|
55555
|
+
while (ch && ch <= " ") {
|
|
55556
|
+
next();
|
|
55557
|
+
}
|
|
55558
|
+
}, word = function() {
|
|
55559
|
+
switch (ch) {
|
|
55560
|
+
case "t":
|
|
55561
|
+
next("t");
|
|
55562
|
+
next("r");
|
|
55563
|
+
next("u");
|
|
55564
|
+
next("e");
|
|
55565
|
+
return true;
|
|
55566
|
+
case "f":
|
|
55567
|
+
next("f");
|
|
55568
|
+
next("a");
|
|
55569
|
+
next("l");
|
|
55570
|
+
next("s");
|
|
55571
|
+
next("e");
|
|
55572
|
+
return false;
|
|
55573
|
+
case "n":
|
|
55574
|
+
next("n");
|
|
55575
|
+
next("u");
|
|
55576
|
+
next("l");
|
|
55577
|
+
next("l");
|
|
55578
|
+
return null;
|
|
55579
|
+
}
|
|
55580
|
+
error49("Unexpected '" + ch + "'");
|
|
55581
|
+
}, value, array2 = function() {
|
|
55582
|
+
var array3 = [];
|
|
55583
|
+
if (ch === "[") {
|
|
55584
|
+
next("[");
|
|
55585
|
+
white();
|
|
55586
|
+
if (ch === "]") {
|
|
55587
|
+
next("]");
|
|
55588
|
+
return array3;
|
|
55589
|
+
}
|
|
55590
|
+
while (ch) {
|
|
55591
|
+
array3.push(value());
|
|
55592
|
+
white();
|
|
55593
|
+
if (ch === "]") {
|
|
55594
|
+
next("]");
|
|
55595
|
+
return array3;
|
|
56864
55596
|
}
|
|
56865
|
-
|
|
56866
|
-
|
|
55597
|
+
next(",");
|
|
55598
|
+
white();
|
|
56867
55599
|
}
|
|
56868
|
-
|
|
56869
|
-
|
|
56870
|
-
|
|
56871
|
-
|
|
56872
|
-
|
|
56873
|
-
|
|
56874
|
-
|
|
56875
|
-
|
|
56876
|
-
|
|
56877
|
-
|
|
56878
|
-
}
|
|
56879
|
-
str = fractionPart ? intPart + (format2.decimalSeparator || "") + ((g2 = +format2.fractionGroupSize) ? fractionPart.replace(
|
|
56880
|
-
new RegExp("\\d{" + g2 + "}\\B", "g"),
|
|
56881
|
-
"$&" + (format2.fractionGroupSeparator || "")
|
|
56882
|
-
) : fractionPart) : intPart;
|
|
55600
|
+
}
|
|
55601
|
+
error49("Bad array");
|
|
55602
|
+
}, object2 = function() {
|
|
55603
|
+
var key, object3 = /* @__PURE__ */ Object.create(null);
|
|
55604
|
+
if (ch === "{") {
|
|
55605
|
+
next("{");
|
|
55606
|
+
white();
|
|
55607
|
+
if (ch === "}") {
|
|
55608
|
+
next("}");
|
|
55609
|
+
return object3;
|
|
56883
55610
|
}
|
|
56884
|
-
|
|
56885
|
-
|
|
56886
|
-
|
|
56887
|
-
|
|
56888
|
-
|
|
56889
|
-
|
|
56890
|
-
if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) {
|
|
56891
|
-
throw Error(bignumberError + "Argument " + (n.isInteger() ? "out of range: " : "not an integer: ") + valueOf(n));
|
|
55611
|
+
while (ch) {
|
|
55612
|
+
key = string4();
|
|
55613
|
+
white();
|
|
55614
|
+
next(":");
|
|
55615
|
+
if (_options.strict === true && Object.hasOwnProperty.call(object3, key)) {
|
|
55616
|
+
error49('Duplicate key "' + key + '"');
|
|
56892
55617
|
}
|
|
56893
|
-
|
|
56894
|
-
|
|
56895
|
-
|
|
56896
|
-
|
|
56897
|
-
|
|
56898
|
-
|
|
56899
|
-
|
|
56900
|
-
|
|
56901
|
-
|
|
56902
|
-
|
|
56903
|
-
|
|
56904
|
-
|
|
56905
|
-
|
|
56906
|
-
|
|
56907
|
-
|
|
56908
|
-
|
|
56909
|
-
if (d2.comparedTo(md) == 1) break;
|
|
56910
|
-
d0 = d1;
|
|
56911
|
-
d1 = d2;
|
|
56912
|
-
n1 = n0.plus(q.times(d2 = n1));
|
|
56913
|
-
n0 = d2;
|
|
56914
|
-
d = n.minus(q.times(d2 = d));
|
|
56915
|
-
n = d2;
|
|
56916
|
-
}
|
|
56917
|
-
d2 = div(md.minus(d0), d1, 0, 1);
|
|
56918
|
-
n0 = n0.plus(d2.times(n1));
|
|
56919
|
-
d0 = d0.plus(d2.times(d1));
|
|
56920
|
-
n0.s = n1.s = x.s;
|
|
56921
|
-
e = e * 2;
|
|
56922
|
-
r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo(
|
|
56923
|
-
div(n0, d0, e, ROUNDING_MODE).minus(x).abs()
|
|
56924
|
-
) < 1 ? [n1, d1] : [n0, d0];
|
|
56925
|
-
MAX_EXP = exp;
|
|
56926
|
-
return r;
|
|
56927
|
-
};
|
|
56928
|
-
P.toNumber = function() {
|
|
56929
|
-
return +valueOf(this);
|
|
56930
|
-
};
|
|
56931
|
-
P.toPrecision = function(sd, rm) {
|
|
56932
|
-
if (sd != null) intCheck(sd, 1, MAX);
|
|
56933
|
-
return format(this, sd, rm, 2);
|
|
56934
|
-
};
|
|
56935
|
-
P.toString = function(b) {
|
|
56936
|
-
var str, n = this, s = n.s, e = n.e;
|
|
56937
|
-
if (e === null) {
|
|
56938
|
-
if (s) {
|
|
56939
|
-
str = "Infinity";
|
|
56940
|
-
if (s < 0) str = "-" + str;
|
|
55618
|
+
if (suspectProtoRx.test(key) === true) {
|
|
55619
|
+
if (_options.protoAction === "error") {
|
|
55620
|
+
error49("Object contains forbidden prototype property");
|
|
55621
|
+
} else if (_options.protoAction === "ignore") {
|
|
55622
|
+
value();
|
|
55623
|
+
} else {
|
|
55624
|
+
object3[key] = value();
|
|
55625
|
+
}
|
|
55626
|
+
} else if (suspectConstructorRx.test(key) === true) {
|
|
55627
|
+
if (_options.constructorAction === "error") {
|
|
55628
|
+
error49("Object contains forbidden constructor property");
|
|
55629
|
+
} else if (_options.constructorAction === "ignore") {
|
|
55630
|
+
value();
|
|
55631
|
+
} else {
|
|
55632
|
+
object3[key] = value();
|
|
55633
|
+
}
|
|
56941
55634
|
} else {
|
|
56942
|
-
|
|
55635
|
+
object3[key] = value();
|
|
56943
55636
|
}
|
|
56944
|
-
|
|
56945
|
-
if (
|
|
56946
|
-
|
|
56947
|
-
|
|
56948
|
-
n = round(new BigNumber3(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE);
|
|
56949
|
-
str = toFixedPoint(coeffToString(n.c), n.e, "0");
|
|
56950
|
-
} else {
|
|
56951
|
-
intCheck(b, 2, ALPHABET.length, "Base");
|
|
56952
|
-
str = convertBase(toFixedPoint(coeffToString(n.c), e, "0"), 10, b, s, true);
|
|
55637
|
+
white();
|
|
55638
|
+
if (ch === "}") {
|
|
55639
|
+
next("}");
|
|
55640
|
+
return object3;
|
|
56953
55641
|
}
|
|
56954
|
-
|
|
55642
|
+
next(",");
|
|
55643
|
+
white();
|
|
56955
55644
|
}
|
|
56956
|
-
return str;
|
|
56957
|
-
};
|
|
56958
|
-
P.valueOf = P.toJSON = function() {
|
|
56959
|
-
return valueOf(this);
|
|
56960
|
-
};
|
|
56961
|
-
P._isBigNumber = true;
|
|
56962
|
-
if (configObject != null) BigNumber3.set(configObject);
|
|
56963
|
-
return BigNumber3;
|
|
56964
|
-
}
|
|
56965
|
-
function bitFloor(n) {
|
|
56966
|
-
var i = n | 0;
|
|
56967
|
-
return n > 0 || n === i ? i : i - 1;
|
|
56968
|
-
}
|
|
56969
|
-
function coeffToString(a) {
|
|
56970
|
-
var s, z3, i = 1, j = a.length, r = a[0] + "";
|
|
56971
|
-
for (; i < j; ) {
|
|
56972
|
-
s = a[i++] + "";
|
|
56973
|
-
z3 = LOG_BASE - s.length;
|
|
56974
|
-
for (; z3--; s = "0" + s) ;
|
|
56975
|
-
r += s;
|
|
56976
|
-
}
|
|
56977
|
-
for (j = r.length; r.charCodeAt(--j) === 48; ) ;
|
|
56978
|
-
return r.slice(0, j + 1 || 1);
|
|
56979
|
-
}
|
|
56980
|
-
function compare(x, y) {
|
|
56981
|
-
var a, b, xc = x.c, yc = y.c, i = x.s, j = y.s, k = x.e, l = y.e;
|
|
56982
|
-
if (!i || !j) return null;
|
|
56983
|
-
a = xc && !xc[0];
|
|
56984
|
-
b = yc && !yc[0];
|
|
56985
|
-
if (a || b) return a ? b ? 0 : -j : i;
|
|
56986
|
-
if (i != j) return i;
|
|
56987
|
-
a = i < 0;
|
|
56988
|
-
b = k == l;
|
|
56989
|
-
if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1;
|
|
56990
|
-
if (!b) return k > l ^ a ? 1 : -1;
|
|
56991
|
-
j = (k = xc.length) < (l = yc.length) ? k : l;
|
|
56992
|
-
for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1;
|
|
56993
|
-
return k == l ? 0 : k > l ^ a ? 1 : -1;
|
|
56994
|
-
}
|
|
56995
|
-
function intCheck(n, min, max, name) {
|
|
56996
|
-
if (n < min || n > max || n !== mathfloor(n)) {
|
|
56997
|
-
throw Error(bignumberError + (name || "Argument") + (typeof n == "number" ? n < min || n > max ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(n));
|
|
56998
55645
|
}
|
|
56999
|
-
|
|
57000
|
-
|
|
57001
|
-
|
|
57002
|
-
|
|
57003
|
-
|
|
57004
|
-
|
|
57005
|
-
|
|
57006
|
-
|
|
57007
|
-
|
|
57008
|
-
|
|
57009
|
-
|
|
57010
|
-
|
|
57011
|
-
|
|
57012
|
-
|
|
57013
|
-
|
|
57014
|
-
if (++e > len) {
|
|
57015
|
-
for (zs = z3, e -= len; --e; zs += z3) ;
|
|
57016
|
-
str += zs;
|
|
57017
|
-
} else if (e < len) {
|
|
57018
|
-
str = str.slice(0, e) + "." + str.slice(e);
|
|
57019
|
-
}
|
|
55646
|
+
error49("Bad object");
|
|
55647
|
+
};
|
|
55648
|
+
value = function() {
|
|
55649
|
+
white();
|
|
55650
|
+
switch (ch) {
|
|
55651
|
+
case "{":
|
|
55652
|
+
return object2();
|
|
55653
|
+
case "[":
|
|
55654
|
+
return array2();
|
|
55655
|
+
case '"':
|
|
55656
|
+
return string4();
|
|
55657
|
+
case "-":
|
|
55658
|
+
return number4();
|
|
55659
|
+
default:
|
|
55660
|
+
return ch >= "0" && ch <= "9" ? number4() : word();
|
|
57020
55661
|
}
|
|
57021
|
-
|
|
57022
|
-
|
|
57023
|
-
|
|
57024
|
-
|
|
57025
|
-
|
|
57026
|
-
|
|
57027
|
-
|
|
57028
|
-
|
|
57029
|
-
|
|
57030
|
-
|
|
57031
|
-
} else {
|
|
57032
|
-
if (!globalObject) {
|
|
57033
|
-
globalObject = typeof self != "undefined" && self ? self : window;
|
|
55662
|
+
};
|
|
55663
|
+
return function(source, reviver3) {
|
|
55664
|
+
var result;
|
|
55665
|
+
text = source + "";
|
|
55666
|
+
at = 0;
|
|
55667
|
+
ch = " ";
|
|
55668
|
+
result = value();
|
|
55669
|
+
white();
|
|
55670
|
+
if (ch) {
|
|
55671
|
+
error49("Syntax error");
|
|
57034
55672
|
}
|
|
57035
|
-
|
|
57036
|
-
|
|
57037
|
-
|
|
55673
|
+
return typeof reviver3 === "function" ? (function walk(holder, key) {
|
|
55674
|
+
var k, v, value2 = holder[key];
|
|
55675
|
+
if (value2 && typeof value2 === "object") {
|
|
55676
|
+
Object.keys(value2).forEach(function(k2) {
|
|
55677
|
+
v = walk(value2, k2);
|
|
55678
|
+
if (v !== void 0) {
|
|
55679
|
+
value2[k2] = v;
|
|
55680
|
+
} else {
|
|
55681
|
+
delete value2[k2];
|
|
55682
|
+
}
|
|
55683
|
+
});
|
|
55684
|
+
}
|
|
55685
|
+
return reviver3.call(holder, key, value2);
|
|
55686
|
+
})({ "": result }, "") : result;
|
|
55687
|
+
};
|
|
55688
|
+
};
|
|
55689
|
+
module2.exports = json_parse;
|
|
55690
|
+
}
|
|
55691
|
+
});
|
|
55692
|
+
|
|
55693
|
+
// node_modules/json-bigint/index.js
|
|
55694
|
+
var require_json_bigint = __commonJS({
|
|
55695
|
+
"node_modules/json-bigint/index.js"(exports2, module2) {
|
|
55696
|
+
var json_stringify = require_stringify().stringify;
|
|
55697
|
+
var json_parse = require_parse2();
|
|
55698
|
+
module2.exports = function(options) {
|
|
55699
|
+
return {
|
|
55700
|
+
parse: json_parse(options),
|
|
55701
|
+
stringify: json_stringify
|
|
55702
|
+
};
|
|
55703
|
+
};
|
|
55704
|
+
module2.exports.parse = json_parse();
|
|
55705
|
+
module2.exports.stringify = json_stringify;
|
|
57038
55706
|
}
|
|
57039
55707
|
});
|
|
57040
55708
|
|
|
@@ -93392,10 +92060,23 @@ var package_default = {
|
|
|
93392
92060
|
type: "module",
|
|
93393
92061
|
homepage: "https://appwrite.io/support",
|
|
93394
92062
|
description: "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API",
|
|
93395
|
-
version: "13.
|
|
92063
|
+
version: "13.5.0",
|
|
93396
92064
|
license: "BSD-3-Clause",
|
|
93397
|
-
main: "dist/index.
|
|
92065
|
+
main: "dist/index.cjs",
|
|
92066
|
+
module: "dist/index.js",
|
|
93398
92067
|
types: "dist/index.d.ts",
|
|
92068
|
+
exports: {
|
|
92069
|
+
".": {
|
|
92070
|
+
import: {
|
|
92071
|
+
types: "./dist/index.d.ts",
|
|
92072
|
+
default: "./dist/index.js"
|
|
92073
|
+
},
|
|
92074
|
+
require: {
|
|
92075
|
+
types: "./dist/index.d.ts",
|
|
92076
|
+
default: "./dist/index.cjs"
|
|
92077
|
+
}
|
|
92078
|
+
}
|
|
92079
|
+
},
|
|
93399
92080
|
bin: {
|
|
93400
92081
|
appwrite: "dist/cli.cjs"
|
|
93401
92082
|
},
|
|
@@ -93406,8 +92087,9 @@ var package_default = {
|
|
|
93406
92087
|
scripts: {
|
|
93407
92088
|
build: "npm run build:types && npm run build:runtime",
|
|
93408
92089
|
"build:types": "tsc -p tsconfig.json --emitDeclarationOnly",
|
|
93409
|
-
"build:runtime": "npm run build:lib:
|
|
93410
|
-
"build:lib:
|
|
92090
|
+
"build:runtime": "npm run build:lib:esm && npm run build:lib:cjs && npm run build:cli",
|
|
92091
|
+
"build:lib:esm": "esbuild index.ts --bundle --platform=node --target=node18 --format=esm --loader:.hbs=text --outfile=dist/index.js",
|
|
92092
|
+
"build:lib:cjs": "esbuild index.ts --bundle --platform=node --target=node18 --format=cjs --loader:.hbs=text --outfile=dist/index.cjs",
|
|
93411
92093
|
"build:cli": "esbuild cli.ts --bundle --platform=node --target=node18 --format=cjs --loader:.hbs=text --external:fsevents --outfile=dist/cli.cjs",
|
|
93412
92094
|
format: 'prettier --write "**/*.{js,ts,json,md}"',
|
|
93413
92095
|
generate: "tsx scripts/generate-commands.ts",
|
|
@@ -93421,7 +92103,7 @@ var package_default = {
|
|
|
93421
92103
|
"windows-arm64": "esbuild cli.ts --bundle --loader:.hbs=text --platform=node --target=node18 --format=esm --external:fsevents --outfile=dist/bundle-win-arm64.mjs && pkg dist/bundle-win-arm64.mjs -t node18-win-arm64 -o build/appwrite-cli-win-arm64.exe"
|
|
93422
92104
|
},
|
|
93423
92105
|
dependencies: {
|
|
93424
|
-
"@appwrite.io/console": "^
|
|
92106
|
+
"@appwrite.io/console": "^3.0.0",
|
|
93425
92107
|
chalk: "4.1.2",
|
|
93426
92108
|
chokidar: "^3.6.0",
|
|
93427
92109
|
"cli-progress": "^3.12.0",
|
|
@@ -107655,7 +106337,7 @@ var import_undici = __toESM(require_undici(), 1);
|
|
|
107655
106337
|
// lib/constants.ts
|
|
107656
106338
|
var SDK_TITLE = "Appwrite";
|
|
107657
106339
|
var SDK_TITLE_LOWER = "appwrite";
|
|
107658
|
-
var SDK_VERSION = "13.
|
|
106340
|
+
var SDK_VERSION = "13.5.0";
|
|
107659
106341
|
var SDK_NAME = "Command Line";
|
|
107660
106342
|
var SDK_PLATFORM = "console";
|
|
107661
106343
|
var SDK_LANGUAGE = "cli";
|
|
@@ -107793,6 +106475,14 @@ function isCloud() {
|
|
|
107793
106475
|
const hostname3 = new URL(endpoint).hostname;
|
|
107794
106476
|
return hostname3.endsWith("appwrite.io");
|
|
107795
106477
|
}
|
|
106478
|
+
function arrayEqualsUnordered(left, right) {
|
|
106479
|
+
const a = Array.isArray(left) ? [...left].map((item) => String(item)).sort() : [];
|
|
106480
|
+
const b = Array.isArray(right) ? [...right].map((item) => String(item)).sort() : [];
|
|
106481
|
+
if (a.length !== b.length) {
|
|
106482
|
+
return false;
|
|
106483
|
+
}
|
|
106484
|
+
return a.every((value, index) => value === b[index]);
|
|
106485
|
+
}
|
|
107796
106486
|
function filterBySchema(data, schema) {
|
|
107797
106487
|
const allowedKeys = Object.keys(schema.shape);
|
|
107798
106488
|
const result = {};
|
|
@@ -108491,7 +107181,6 @@ var import_os2 = __toESM(require("os"), 1);
|
|
|
108491
107181
|
|
|
108492
107182
|
// node_modules/@appwrite.io/console/dist/esm/sdk.js
|
|
108493
107183
|
var import_json_bigint2 = __toESM(require_json_bigint(), 1);
|
|
108494
|
-
var import_bignumber = __toESM(require_bignumber2(), 1);
|
|
108495
107184
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
108496
107185
|
function adopt(value) {
|
|
108497
107186
|
return value instanceof P ? value : new P(function(resolve3) {
|
|
@@ -108611,8 +107300,11 @@ var JSONbigParser2 = (0, import_json_bigint2.default)({ storeAsString: false });
|
|
|
108611
107300
|
var JSONbigSerializer2 = (0, import_json_bigint2.default)({ useNativeBigInt: true });
|
|
108612
107301
|
var MAX_SAFE2 = BigInt(Number.MAX_SAFE_INTEGER);
|
|
108613
107302
|
var MIN_SAFE2 = BigInt(Number.MIN_SAFE_INTEGER);
|
|
107303
|
+
function isBigNumber2(value) {
|
|
107304
|
+
return value !== null && typeof value === "object" && value._isBigNumber === true && typeof value.isInteger === "function" && typeof value.toFixed === "function" && typeof value.toNumber === "function";
|
|
107305
|
+
}
|
|
108614
107306
|
function reviver2(_key, value) {
|
|
108615
|
-
if (
|
|
107307
|
+
if (isBigNumber2(value)) {
|
|
108616
107308
|
if (value.isInteger()) {
|
|
108617
107309
|
const str = value.toFixed();
|
|
108618
107310
|
const bi = BigInt(str);
|
|
@@ -108666,7 +107358,7 @@ var Client = class _Client {
|
|
|
108666
107358
|
"x-sdk-name": "Console",
|
|
108667
107359
|
"x-sdk-platform": "console",
|
|
108668
107360
|
"x-sdk-language": "web",
|
|
108669
|
-
"x-sdk-version": "
|
|
107361
|
+
"x-sdk-version": "3.0.0",
|
|
108670
107362
|
"X-Appwrite-Response-Format": "1.8.0"
|
|
108671
107363
|
};
|
|
108672
107364
|
this.realtime = {
|
|
@@ -122655,6 +121347,114 @@ var Projects = class {
|
|
|
122655
121347
|
};
|
|
122656
121348
|
return this.client.call("delete", uri, apiHeaders, payload);
|
|
122657
121349
|
}
|
|
121350
|
+
listSchedules(paramsOrFirst, ...rest) {
|
|
121351
|
+
let params;
|
|
121352
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
121353
|
+
params = paramsOrFirst || {};
|
|
121354
|
+
} else {
|
|
121355
|
+
params = {
|
|
121356
|
+
projectId: paramsOrFirst,
|
|
121357
|
+
queries: rest[0],
|
|
121358
|
+
total: rest[1]
|
|
121359
|
+
};
|
|
121360
|
+
}
|
|
121361
|
+
const projectId = params.projectId;
|
|
121362
|
+
const queries = params.queries;
|
|
121363
|
+
const total = params.total;
|
|
121364
|
+
if (typeof projectId === "undefined") {
|
|
121365
|
+
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
121366
|
+
}
|
|
121367
|
+
const apiPath = "/projects/{projectId}/schedules".replace("{projectId}", projectId);
|
|
121368
|
+
const payload = {};
|
|
121369
|
+
if (typeof queries !== "undefined") {
|
|
121370
|
+
payload["queries"] = queries;
|
|
121371
|
+
}
|
|
121372
|
+
if (typeof total !== "undefined") {
|
|
121373
|
+
payload["total"] = total;
|
|
121374
|
+
}
|
|
121375
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
121376
|
+
const apiHeaders = {};
|
|
121377
|
+
return this.client.call("get", uri, apiHeaders, payload);
|
|
121378
|
+
}
|
|
121379
|
+
createSchedule(paramsOrFirst, ...rest) {
|
|
121380
|
+
let params;
|
|
121381
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
121382
|
+
params = paramsOrFirst || {};
|
|
121383
|
+
} else {
|
|
121384
|
+
params = {
|
|
121385
|
+
projectId: paramsOrFirst,
|
|
121386
|
+
resourceType: rest[0],
|
|
121387
|
+
resourceId: rest[1],
|
|
121388
|
+
schedule: rest[2],
|
|
121389
|
+
active: rest[3],
|
|
121390
|
+
data: rest[4]
|
|
121391
|
+
};
|
|
121392
|
+
}
|
|
121393
|
+
const projectId = params.projectId;
|
|
121394
|
+
const resourceType = params.resourceType;
|
|
121395
|
+
const resourceId = params.resourceId;
|
|
121396
|
+
const schedule = params.schedule;
|
|
121397
|
+
const active = params.active;
|
|
121398
|
+
const data = params.data;
|
|
121399
|
+
if (typeof projectId === "undefined") {
|
|
121400
|
+
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
121401
|
+
}
|
|
121402
|
+
if (typeof resourceType === "undefined") {
|
|
121403
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
121404
|
+
}
|
|
121405
|
+
if (typeof resourceId === "undefined") {
|
|
121406
|
+
throw new AppwriteException('Missing required parameter: "resourceId"');
|
|
121407
|
+
}
|
|
121408
|
+
if (typeof schedule === "undefined") {
|
|
121409
|
+
throw new AppwriteException('Missing required parameter: "schedule"');
|
|
121410
|
+
}
|
|
121411
|
+
const apiPath = "/projects/{projectId}/schedules".replace("{projectId}", projectId);
|
|
121412
|
+
const payload = {};
|
|
121413
|
+
if (typeof resourceType !== "undefined") {
|
|
121414
|
+
payload["resourceType"] = resourceType;
|
|
121415
|
+
}
|
|
121416
|
+
if (typeof resourceId !== "undefined") {
|
|
121417
|
+
payload["resourceId"] = resourceId;
|
|
121418
|
+
}
|
|
121419
|
+
if (typeof schedule !== "undefined") {
|
|
121420
|
+
payload["schedule"] = schedule;
|
|
121421
|
+
}
|
|
121422
|
+
if (typeof active !== "undefined") {
|
|
121423
|
+
payload["active"] = active;
|
|
121424
|
+
}
|
|
121425
|
+
if (typeof data !== "undefined") {
|
|
121426
|
+
payload["data"] = data;
|
|
121427
|
+
}
|
|
121428
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
121429
|
+
const apiHeaders = {
|
|
121430
|
+
"content-type": "application/json"
|
|
121431
|
+
};
|
|
121432
|
+
return this.client.call("post", uri, apiHeaders, payload);
|
|
121433
|
+
}
|
|
121434
|
+
getSchedule(paramsOrFirst, ...rest) {
|
|
121435
|
+
let params;
|
|
121436
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
121437
|
+
params = paramsOrFirst || {};
|
|
121438
|
+
} else {
|
|
121439
|
+
params = {
|
|
121440
|
+
projectId: paramsOrFirst,
|
|
121441
|
+
scheduleId: rest[0]
|
|
121442
|
+
};
|
|
121443
|
+
}
|
|
121444
|
+
const projectId = params.projectId;
|
|
121445
|
+
const scheduleId = params.scheduleId;
|
|
121446
|
+
if (typeof projectId === "undefined") {
|
|
121447
|
+
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
121448
|
+
}
|
|
121449
|
+
if (typeof scheduleId === "undefined") {
|
|
121450
|
+
throw new AppwriteException('Missing required parameter: "scheduleId"');
|
|
121451
|
+
}
|
|
121452
|
+
const apiPath = "/projects/{projectId}/schedules/{scheduleId}".replace("{projectId}", projectId).replace("{scheduleId}", scheduleId);
|
|
121453
|
+
const payload = {};
|
|
121454
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
121455
|
+
const apiHeaders = {};
|
|
121456
|
+
return this.client.call("get", uri, apiHeaders, payload);
|
|
121457
|
+
}
|
|
122658
121458
|
updateServiceStatus(paramsOrFirst, ...rest) {
|
|
122659
121459
|
let params;
|
|
122660
121460
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
@@ -131310,6 +130110,8 @@ var Scopes;
|
|
|
131310
130110
|
Scopes3["TargetsWrite"] = "targets.write";
|
|
131311
130111
|
Scopes3["RulesRead"] = "rules.read";
|
|
131312
130112
|
Scopes3["RulesWrite"] = "rules.write";
|
|
130113
|
+
Scopes3["SchedulesRead"] = "schedules.read";
|
|
130114
|
+
Scopes3["SchedulesWrite"] = "schedules.write";
|
|
131313
130115
|
Scopes3["MigrationsRead"] = "migrations.read";
|
|
131314
130116
|
Scopes3["MigrationsWrite"] = "migrations.write";
|
|
131315
130117
|
Scopes3["VcsRead"] = "vcs.read";
|
|
@@ -131379,8 +130181,6 @@ var OAuthProvider;
|
|
|
131379
130181
|
OAuthProvider2["Yandex"] = "yandex";
|
|
131380
130182
|
OAuthProvider2["Zoho"] = "zoho";
|
|
131381
130183
|
OAuthProvider2["Zoom"] = "zoom";
|
|
131382
|
-
OAuthProvider2["GithubImagine"] = "githubImagine";
|
|
131383
|
-
OAuthProvider2["GoogleImagine"] = "googleImagine";
|
|
131384
130184
|
})(OAuthProvider || (OAuthProvider = {}));
|
|
131385
130185
|
var Browser;
|
|
131386
130186
|
(function(Browser2) {
|
|
@@ -132144,24 +130944,35 @@ var Runtime;
|
|
|
132144
130944
|
Runtime2["Node200"] = "node-20.0";
|
|
132145
130945
|
Runtime2["Node210"] = "node-21.0";
|
|
132146
130946
|
Runtime2["Node22"] = "node-22";
|
|
130947
|
+
Runtime2["Node23"] = "node-23";
|
|
130948
|
+
Runtime2["Node24"] = "node-24";
|
|
130949
|
+
Runtime2["Node25"] = "node-25";
|
|
132147
130950
|
Runtime2["Php80"] = "php-8.0";
|
|
132148
130951
|
Runtime2["Php81"] = "php-8.1";
|
|
132149
130952
|
Runtime2["Php82"] = "php-8.2";
|
|
132150
130953
|
Runtime2["Php83"] = "php-8.3";
|
|
130954
|
+
Runtime2["Php84"] = "php-8.4";
|
|
132151
130955
|
Runtime2["Ruby30"] = "ruby-3.0";
|
|
132152
130956
|
Runtime2["Ruby31"] = "ruby-3.1";
|
|
132153
130957
|
Runtime2["Ruby32"] = "ruby-3.2";
|
|
132154
130958
|
Runtime2["Ruby33"] = "ruby-3.3";
|
|
130959
|
+
Runtime2["Ruby34"] = "ruby-3.4";
|
|
130960
|
+
Runtime2["Ruby40"] = "ruby-4.0";
|
|
132155
130961
|
Runtime2["Python38"] = "python-3.8";
|
|
132156
130962
|
Runtime2["Python39"] = "python-3.9";
|
|
132157
130963
|
Runtime2["Python310"] = "python-3.10";
|
|
132158
130964
|
Runtime2["Python311"] = "python-3.11";
|
|
132159
130965
|
Runtime2["Python312"] = "python-3.12";
|
|
130966
|
+
Runtime2["Python313"] = "python-3.13";
|
|
130967
|
+
Runtime2["Python314"] = "python-3.14";
|
|
132160
130968
|
Runtime2["Pythonml311"] = "python-ml-3.11";
|
|
132161
130969
|
Runtime2["Pythonml312"] = "python-ml-3.12";
|
|
130970
|
+
Runtime2["Pythonml313"] = "python-ml-3.13";
|
|
132162
130971
|
Runtime2["Deno140"] = "deno-1.40";
|
|
132163
130972
|
Runtime2["Deno146"] = "deno-1.46";
|
|
132164
130973
|
Runtime2["Deno20"] = "deno-2.0";
|
|
130974
|
+
Runtime2["Deno25"] = "deno-2.5";
|
|
130975
|
+
Runtime2["Deno26"] = "deno-2.6";
|
|
132165
130976
|
Runtime2["Dart215"] = "dart-2.15";
|
|
132166
130977
|
Runtime2["Dart216"] = "dart-2.16";
|
|
132167
130978
|
Runtime2["Dart217"] = "dart-2.17";
|
|
@@ -132177,25 +130988,34 @@ var Runtime;
|
|
|
132177
130988
|
Runtime2["Dotnet60"] = "dotnet-6.0";
|
|
132178
130989
|
Runtime2["Dotnet70"] = "dotnet-7.0";
|
|
132179
130990
|
Runtime2["Dotnet80"] = "dotnet-8.0";
|
|
130991
|
+
Runtime2["Dotnet10"] = "dotnet-10";
|
|
132180
130992
|
Runtime2["Java80"] = "java-8.0";
|
|
132181
130993
|
Runtime2["Java110"] = "java-11.0";
|
|
132182
130994
|
Runtime2["Java170"] = "java-17.0";
|
|
132183
130995
|
Runtime2["Java180"] = "java-18.0";
|
|
132184
130996
|
Runtime2["Java210"] = "java-21.0";
|
|
132185
130997
|
Runtime2["Java22"] = "java-22";
|
|
130998
|
+
Runtime2["Java25"] = "java-25";
|
|
132186
130999
|
Runtime2["Swift55"] = "swift-5.5";
|
|
132187
131000
|
Runtime2["Swift58"] = "swift-5.8";
|
|
132188
131001
|
Runtime2["Swift59"] = "swift-5.9";
|
|
132189
131002
|
Runtime2["Swift510"] = "swift-5.10";
|
|
131003
|
+
Runtime2["Swift62"] = "swift-6.2";
|
|
132190
131004
|
Runtime2["Kotlin16"] = "kotlin-1.6";
|
|
132191
131005
|
Runtime2["Kotlin18"] = "kotlin-1.8";
|
|
132192
131006
|
Runtime2["Kotlin19"] = "kotlin-1.9";
|
|
132193
131007
|
Runtime2["Kotlin20"] = "kotlin-2.0";
|
|
131008
|
+
Runtime2["Kotlin23"] = "kotlin-2.3";
|
|
132194
131009
|
Runtime2["Cpp17"] = "cpp-17";
|
|
132195
131010
|
Runtime2["Cpp20"] = "cpp-20";
|
|
132196
131011
|
Runtime2["Bun10"] = "bun-1.0";
|
|
132197
131012
|
Runtime2["Bun11"] = "bun-1.1";
|
|
131013
|
+
Runtime2["Bun12"] = "bun-1.2";
|
|
131014
|
+
Runtime2["Bun13"] = "bun-1.3";
|
|
132198
131015
|
Runtime2["Go123"] = "go-1.23";
|
|
131016
|
+
Runtime2["Go124"] = "go-1.24";
|
|
131017
|
+
Runtime2["Go125"] = "go-1.25";
|
|
131018
|
+
Runtime2["Go126"] = "go-1.26";
|
|
132199
131019
|
Runtime2["Static1"] = "static-1";
|
|
132200
131020
|
Runtime2["Flutter324"] = "flutter-3.24";
|
|
132201
131021
|
Runtime2["Flutter327"] = "flutter-3.27";
|
|
@@ -132213,24 +131033,35 @@ var Runtimes;
|
|
|
132213
131033
|
Runtimes2["Node200"] = "node-20.0";
|
|
132214
131034
|
Runtimes2["Node210"] = "node-21.0";
|
|
132215
131035
|
Runtimes2["Node22"] = "node-22";
|
|
131036
|
+
Runtimes2["Node23"] = "node-23";
|
|
131037
|
+
Runtimes2["Node24"] = "node-24";
|
|
131038
|
+
Runtimes2["Node25"] = "node-25";
|
|
132216
131039
|
Runtimes2["Php80"] = "php-8.0";
|
|
132217
131040
|
Runtimes2["Php81"] = "php-8.1";
|
|
132218
131041
|
Runtimes2["Php82"] = "php-8.2";
|
|
132219
131042
|
Runtimes2["Php83"] = "php-8.3";
|
|
131043
|
+
Runtimes2["Php84"] = "php-8.4";
|
|
132220
131044
|
Runtimes2["Ruby30"] = "ruby-3.0";
|
|
132221
131045
|
Runtimes2["Ruby31"] = "ruby-3.1";
|
|
132222
131046
|
Runtimes2["Ruby32"] = "ruby-3.2";
|
|
132223
131047
|
Runtimes2["Ruby33"] = "ruby-3.3";
|
|
131048
|
+
Runtimes2["Ruby34"] = "ruby-3.4";
|
|
131049
|
+
Runtimes2["Ruby40"] = "ruby-4.0";
|
|
132224
131050
|
Runtimes2["Python38"] = "python-3.8";
|
|
132225
131051
|
Runtimes2["Python39"] = "python-3.9";
|
|
132226
131052
|
Runtimes2["Python310"] = "python-3.10";
|
|
132227
131053
|
Runtimes2["Python311"] = "python-3.11";
|
|
132228
131054
|
Runtimes2["Python312"] = "python-3.12";
|
|
131055
|
+
Runtimes2["Python313"] = "python-3.13";
|
|
131056
|
+
Runtimes2["Python314"] = "python-3.14";
|
|
132229
131057
|
Runtimes2["Pythonml311"] = "python-ml-3.11";
|
|
132230
131058
|
Runtimes2["Pythonml312"] = "python-ml-3.12";
|
|
131059
|
+
Runtimes2["Pythonml313"] = "python-ml-3.13";
|
|
132231
131060
|
Runtimes2["Deno140"] = "deno-1.40";
|
|
132232
131061
|
Runtimes2["Deno146"] = "deno-1.46";
|
|
132233
131062
|
Runtimes2["Deno20"] = "deno-2.0";
|
|
131063
|
+
Runtimes2["Deno25"] = "deno-2.5";
|
|
131064
|
+
Runtimes2["Deno26"] = "deno-2.6";
|
|
132234
131065
|
Runtimes2["Dart215"] = "dart-2.15";
|
|
132235
131066
|
Runtimes2["Dart216"] = "dart-2.16";
|
|
132236
131067
|
Runtimes2["Dart217"] = "dart-2.17";
|
|
@@ -132246,25 +131077,34 @@ var Runtimes;
|
|
|
132246
131077
|
Runtimes2["Dotnet60"] = "dotnet-6.0";
|
|
132247
131078
|
Runtimes2["Dotnet70"] = "dotnet-7.0";
|
|
132248
131079
|
Runtimes2["Dotnet80"] = "dotnet-8.0";
|
|
131080
|
+
Runtimes2["Dotnet10"] = "dotnet-10";
|
|
132249
131081
|
Runtimes2["Java80"] = "java-8.0";
|
|
132250
131082
|
Runtimes2["Java110"] = "java-11.0";
|
|
132251
131083
|
Runtimes2["Java170"] = "java-17.0";
|
|
132252
131084
|
Runtimes2["Java180"] = "java-18.0";
|
|
132253
131085
|
Runtimes2["Java210"] = "java-21.0";
|
|
132254
131086
|
Runtimes2["Java22"] = "java-22";
|
|
131087
|
+
Runtimes2["Java25"] = "java-25";
|
|
132255
131088
|
Runtimes2["Swift55"] = "swift-5.5";
|
|
132256
131089
|
Runtimes2["Swift58"] = "swift-5.8";
|
|
132257
131090
|
Runtimes2["Swift59"] = "swift-5.9";
|
|
132258
131091
|
Runtimes2["Swift510"] = "swift-5.10";
|
|
131092
|
+
Runtimes2["Swift62"] = "swift-6.2";
|
|
132259
131093
|
Runtimes2["Kotlin16"] = "kotlin-1.6";
|
|
132260
131094
|
Runtimes2["Kotlin18"] = "kotlin-1.8";
|
|
132261
131095
|
Runtimes2["Kotlin19"] = "kotlin-1.9";
|
|
132262
131096
|
Runtimes2["Kotlin20"] = "kotlin-2.0";
|
|
131097
|
+
Runtimes2["Kotlin23"] = "kotlin-2.3";
|
|
132263
131098
|
Runtimes2["Cpp17"] = "cpp-17";
|
|
132264
131099
|
Runtimes2["Cpp20"] = "cpp-20";
|
|
132265
131100
|
Runtimes2["Bun10"] = "bun-1.0";
|
|
132266
131101
|
Runtimes2["Bun11"] = "bun-1.1";
|
|
131102
|
+
Runtimes2["Bun12"] = "bun-1.2";
|
|
131103
|
+
Runtimes2["Bun13"] = "bun-1.3";
|
|
132267
131104
|
Runtimes2["Go123"] = "go-1.23";
|
|
131105
|
+
Runtimes2["Go124"] = "go-1.24";
|
|
131106
|
+
Runtimes2["Go125"] = "go-1.25";
|
|
131107
|
+
Runtimes2["Go126"] = "go-1.26";
|
|
132268
131108
|
Runtimes2["Static1"] = "static-1";
|
|
132269
131109
|
Runtimes2["Flutter324"] = "flutter-3.24";
|
|
132270
131110
|
Runtimes2["Flutter327"] = "flutter-3.27";
|
|
@@ -132401,6 +131241,13 @@ var PlatformType;
|
|
|
132401
131241
|
PlatformType2["Reactnativeios"] = "react-native-ios";
|
|
132402
131242
|
PlatformType2["Reactnativeandroid"] = "react-native-android";
|
|
132403
131243
|
})(PlatformType || (PlatformType = {}));
|
|
131244
|
+
var ResourceType;
|
|
131245
|
+
(function(ResourceType2) {
|
|
131246
|
+
ResourceType2["Function"] = "function";
|
|
131247
|
+
ResourceType2["Execution"] = "execution";
|
|
131248
|
+
ResourceType2["Message"] = "message";
|
|
131249
|
+
ResourceType2["Backup"] = "backup";
|
|
131250
|
+
})(ResourceType || (ResourceType = {}));
|
|
132404
131251
|
var ApiService;
|
|
132405
131252
|
(function(ApiService3) {
|
|
132406
131253
|
ApiService3["Account"] = "account";
|
|
@@ -132425,12 +131272,12 @@ var SMTPSecure;
|
|
|
132425
131272
|
var EmailTemplateType;
|
|
132426
131273
|
(function(EmailTemplateType2) {
|
|
132427
131274
|
EmailTemplateType2["Verification"] = "verification";
|
|
132428
|
-
EmailTemplateType2["
|
|
131275
|
+
EmailTemplateType2["MagicSession"] = "magicSession";
|
|
132429
131276
|
EmailTemplateType2["Recovery"] = "recovery";
|
|
132430
131277
|
EmailTemplateType2["Invitation"] = "invitation";
|
|
132431
|
-
EmailTemplateType2["
|
|
132432
|
-
EmailTemplateType2["
|
|
132433
|
-
EmailTemplateType2["
|
|
131278
|
+
EmailTemplateType2["MfaChallenge"] = "mfaChallenge";
|
|
131279
|
+
EmailTemplateType2["SessionAlert"] = "sessionAlert";
|
|
131280
|
+
EmailTemplateType2["OtpSession"] = "otpSession";
|
|
132434
131281
|
})(EmailTemplateType || (EmailTemplateType = {}));
|
|
132435
131282
|
var EmailTemplateLocale;
|
|
132436
131283
|
(function(EmailTemplateLocale2) {
|
|
@@ -132571,7 +131418,7 @@ var SmsTemplateType;
|
|
|
132571
131418
|
SmsTemplateType2["Verification"] = "verification";
|
|
132572
131419
|
SmsTemplateType2["Login"] = "login";
|
|
132573
131420
|
SmsTemplateType2["Invitation"] = "invitation";
|
|
132574
|
-
SmsTemplateType2["
|
|
131421
|
+
SmsTemplateType2["MfaChallenge"] = "mfaChallenge";
|
|
132575
131422
|
})(SmsTemplateType || (SmsTemplateType = {}));
|
|
132576
131423
|
var SmsTemplateLocale;
|
|
132577
131424
|
(function(SmsTemplateLocale2) {
|
|
@@ -132746,24 +131593,35 @@ var BuildRuntime;
|
|
|
132746
131593
|
BuildRuntime2["Node200"] = "node-20.0";
|
|
132747
131594
|
BuildRuntime2["Node210"] = "node-21.0";
|
|
132748
131595
|
BuildRuntime2["Node22"] = "node-22";
|
|
131596
|
+
BuildRuntime2["Node23"] = "node-23";
|
|
131597
|
+
BuildRuntime2["Node24"] = "node-24";
|
|
131598
|
+
BuildRuntime2["Node25"] = "node-25";
|
|
132749
131599
|
BuildRuntime2["Php80"] = "php-8.0";
|
|
132750
131600
|
BuildRuntime2["Php81"] = "php-8.1";
|
|
132751
131601
|
BuildRuntime2["Php82"] = "php-8.2";
|
|
132752
131602
|
BuildRuntime2["Php83"] = "php-8.3";
|
|
131603
|
+
BuildRuntime2["Php84"] = "php-8.4";
|
|
132753
131604
|
BuildRuntime2["Ruby30"] = "ruby-3.0";
|
|
132754
131605
|
BuildRuntime2["Ruby31"] = "ruby-3.1";
|
|
132755
131606
|
BuildRuntime2["Ruby32"] = "ruby-3.2";
|
|
132756
131607
|
BuildRuntime2["Ruby33"] = "ruby-3.3";
|
|
131608
|
+
BuildRuntime2["Ruby34"] = "ruby-3.4";
|
|
131609
|
+
BuildRuntime2["Ruby40"] = "ruby-4.0";
|
|
132757
131610
|
BuildRuntime2["Python38"] = "python-3.8";
|
|
132758
131611
|
BuildRuntime2["Python39"] = "python-3.9";
|
|
132759
131612
|
BuildRuntime2["Python310"] = "python-3.10";
|
|
132760
131613
|
BuildRuntime2["Python311"] = "python-3.11";
|
|
132761
131614
|
BuildRuntime2["Python312"] = "python-3.12";
|
|
131615
|
+
BuildRuntime2["Python313"] = "python-3.13";
|
|
131616
|
+
BuildRuntime2["Python314"] = "python-3.14";
|
|
132762
131617
|
BuildRuntime2["Pythonml311"] = "python-ml-3.11";
|
|
132763
131618
|
BuildRuntime2["Pythonml312"] = "python-ml-3.12";
|
|
131619
|
+
BuildRuntime2["Pythonml313"] = "python-ml-3.13";
|
|
132764
131620
|
BuildRuntime2["Deno140"] = "deno-1.40";
|
|
132765
131621
|
BuildRuntime2["Deno146"] = "deno-1.46";
|
|
132766
131622
|
BuildRuntime2["Deno20"] = "deno-2.0";
|
|
131623
|
+
BuildRuntime2["Deno25"] = "deno-2.5";
|
|
131624
|
+
BuildRuntime2["Deno26"] = "deno-2.6";
|
|
132767
131625
|
BuildRuntime2["Dart215"] = "dart-2.15";
|
|
132768
131626
|
BuildRuntime2["Dart216"] = "dart-2.16";
|
|
132769
131627
|
BuildRuntime2["Dart217"] = "dart-2.17";
|
|
@@ -132779,25 +131637,34 @@ var BuildRuntime;
|
|
|
132779
131637
|
BuildRuntime2["Dotnet60"] = "dotnet-6.0";
|
|
132780
131638
|
BuildRuntime2["Dotnet70"] = "dotnet-7.0";
|
|
132781
131639
|
BuildRuntime2["Dotnet80"] = "dotnet-8.0";
|
|
131640
|
+
BuildRuntime2["Dotnet10"] = "dotnet-10";
|
|
132782
131641
|
BuildRuntime2["Java80"] = "java-8.0";
|
|
132783
131642
|
BuildRuntime2["Java110"] = "java-11.0";
|
|
132784
131643
|
BuildRuntime2["Java170"] = "java-17.0";
|
|
132785
131644
|
BuildRuntime2["Java180"] = "java-18.0";
|
|
132786
131645
|
BuildRuntime2["Java210"] = "java-21.0";
|
|
132787
131646
|
BuildRuntime2["Java22"] = "java-22";
|
|
131647
|
+
BuildRuntime2["Java25"] = "java-25";
|
|
132788
131648
|
BuildRuntime2["Swift55"] = "swift-5.5";
|
|
132789
131649
|
BuildRuntime2["Swift58"] = "swift-5.8";
|
|
132790
131650
|
BuildRuntime2["Swift59"] = "swift-5.9";
|
|
132791
131651
|
BuildRuntime2["Swift510"] = "swift-5.10";
|
|
131652
|
+
BuildRuntime2["Swift62"] = "swift-6.2";
|
|
132792
131653
|
BuildRuntime2["Kotlin16"] = "kotlin-1.6";
|
|
132793
131654
|
BuildRuntime2["Kotlin18"] = "kotlin-1.8";
|
|
132794
131655
|
BuildRuntime2["Kotlin19"] = "kotlin-1.9";
|
|
132795
131656
|
BuildRuntime2["Kotlin20"] = "kotlin-2.0";
|
|
131657
|
+
BuildRuntime2["Kotlin23"] = "kotlin-2.3";
|
|
132796
131658
|
BuildRuntime2["Cpp17"] = "cpp-17";
|
|
132797
131659
|
BuildRuntime2["Cpp20"] = "cpp-20";
|
|
132798
131660
|
BuildRuntime2["Bun10"] = "bun-1.0";
|
|
132799
131661
|
BuildRuntime2["Bun11"] = "bun-1.1";
|
|
131662
|
+
BuildRuntime2["Bun12"] = "bun-1.2";
|
|
131663
|
+
BuildRuntime2["Bun13"] = "bun-1.3";
|
|
132800
131664
|
BuildRuntime2["Go123"] = "go-1.23";
|
|
131665
|
+
BuildRuntime2["Go124"] = "go-1.24";
|
|
131666
|
+
BuildRuntime2["Go125"] = "go-1.25";
|
|
131667
|
+
BuildRuntime2["Go126"] = "go-1.26";
|
|
132801
131668
|
BuildRuntime2["Static1"] = "static-1";
|
|
132802
131669
|
BuildRuntime2["Flutter324"] = "flutter-3.24";
|
|
132803
131670
|
BuildRuntime2["Flutter327"] = "flutter-3.27";
|
|
@@ -139166,7 +138033,9 @@ var Pools = class {
|
|
|
139166
138033
|
// Milliseconds
|
|
139167
138034
|
pollMaxDebounces = 30;
|
|
139168
138035
|
POLL_DEFAULT_VALUE = 30;
|
|
139169
|
-
|
|
138036
|
+
client;
|
|
138037
|
+
constructor(pollMaxDebounces, client2) {
|
|
138038
|
+
this.client = client2;
|
|
139170
138039
|
if (pollMaxDebounces) {
|
|
139171
138040
|
this.pollMaxDebounces = pollMaxDebounces;
|
|
139172
138041
|
}
|
|
@@ -139175,7 +138044,7 @@ var Pools = class {
|
|
|
139175
138044
|
if (iteration > this.pollMaxDebounces) {
|
|
139176
138045
|
return false;
|
|
139177
138046
|
}
|
|
139178
|
-
const databasesService = await getDatabasesService();
|
|
138047
|
+
const databasesService = await getDatabasesService(this.client);
|
|
139179
138048
|
const response = await databasesService.listAttributes(
|
|
139180
138049
|
databaseId,
|
|
139181
138050
|
collectionId,
|
|
@@ -139201,7 +138070,7 @@ var Pools = class {
|
|
|
139201
138070
|
if (iteration > this.pollMaxDebounces) {
|
|
139202
138071
|
return false;
|
|
139203
138072
|
}
|
|
139204
|
-
const databasesService = await getDatabasesService();
|
|
138073
|
+
const databasesService = await getDatabasesService(this.client);
|
|
139205
138074
|
const response = await databasesService.listIndexes(
|
|
139206
138075
|
databaseId,
|
|
139207
138076
|
collectionId,
|
|
@@ -139238,7 +138107,7 @@ var Pools = class {
|
|
|
139238
138107
|
}
|
|
139239
138108
|
const { attributes } = await paginate(
|
|
139240
138109
|
async (args) => {
|
|
139241
|
-
const databasesService = await getDatabasesService();
|
|
138110
|
+
const databasesService = await getDatabasesService(this.client);
|
|
139242
138111
|
return await databasesService.listAttributes({
|
|
139243
138112
|
databaseId: args.databaseId,
|
|
139244
138113
|
collectionId: args.collectionId,
|
|
@@ -139281,7 +138150,7 @@ var Pools = class {
|
|
|
139281
138150
|
}
|
|
139282
138151
|
const { attributes } = await paginate(
|
|
139283
138152
|
async (args) => {
|
|
139284
|
-
const databasesService = await getDatabasesService();
|
|
138153
|
+
const databasesService = await getDatabasesService(this.client);
|
|
139285
138154
|
return await databasesService.listAttributes(
|
|
139286
138155
|
args.databaseId,
|
|
139287
138156
|
args.collectionId,
|
|
@@ -139330,7 +138199,7 @@ var Pools = class {
|
|
|
139330
138199
|
}
|
|
139331
138200
|
const { indexes } = await paginate(
|
|
139332
138201
|
async (args) => {
|
|
139333
|
-
const databasesService = await getDatabasesService();
|
|
138202
|
+
const databasesService = await getDatabasesService(this.client);
|
|
139334
138203
|
return await databasesService.listIndexes(
|
|
139335
138204
|
args.databaseId,
|
|
139336
138205
|
args.collectionId,
|
|
@@ -139396,8 +138265,10 @@ var questionPushChangesConfirmation2 = [
|
|
|
139396
138265
|
var Attributes = class {
|
|
139397
138266
|
pools;
|
|
139398
138267
|
skipConfirmation;
|
|
139399
|
-
|
|
139400
|
-
|
|
138268
|
+
client;
|
|
138269
|
+
constructor(pools, skipConfirmation = false, client2) {
|
|
138270
|
+
this.client = client2;
|
|
138271
|
+
this.pools = pools || new Pools(void 0, client2);
|
|
139401
138272
|
this.skipConfirmation = skipConfirmation;
|
|
139402
138273
|
}
|
|
139403
138274
|
getConfirmation = async () => {
|
|
@@ -139485,7 +138356,7 @@ var Attributes = class {
|
|
|
139485
138356
|
};
|
|
139486
138357
|
};
|
|
139487
138358
|
createAttribute = async (databaseId, collectionId, attribute) => {
|
|
139488
|
-
const databasesService = await getDatabasesService();
|
|
138359
|
+
const databasesService = await getDatabasesService(this.client);
|
|
139489
138360
|
switch (attribute.type) {
|
|
139490
138361
|
case "string":
|
|
139491
138362
|
switch (attribute.format) {
|
|
@@ -139655,7 +138526,7 @@ var Attributes = class {
|
|
|
139655
138526
|
}
|
|
139656
138527
|
};
|
|
139657
138528
|
updateAttribute = async (databaseId, collectionId, attribute) => {
|
|
139658
|
-
const databasesService = await getDatabasesService();
|
|
138529
|
+
const databasesService = await getDatabasesService(this.client);
|
|
139659
138530
|
switch (attribute.type) {
|
|
139660
138531
|
case "string":
|
|
139661
138532
|
switch (attribute.format) {
|
|
@@ -139809,7 +138680,7 @@ var Attributes = class {
|
|
|
139809
138680
|
log(
|
|
139810
138681
|
`Deleting ${isIndex ? "index" : "attribute"} ${attribute.key} of ${collection.name} ( ${collection["$id"]} )`
|
|
139811
138682
|
);
|
|
139812
|
-
const databasesService = await getDatabasesService();
|
|
138683
|
+
const databasesService = await getDatabasesService(this.client);
|
|
139813
138684
|
if (isIndex) {
|
|
139814
138685
|
await databasesService.deleteIndex(
|
|
139815
138686
|
collection["databaseId"],
|
|
@@ -139964,7 +138835,7 @@ var Attributes = class {
|
|
|
139964
138835
|
};
|
|
139965
138836
|
createIndexes = async (indexes, collection) => {
|
|
139966
138837
|
log(`Creating indexes ...`);
|
|
139967
|
-
const databasesService = await getDatabasesService();
|
|
138838
|
+
const databasesService = await getDatabasesService(this.client);
|
|
139968
138839
|
for (let index of indexes) {
|
|
139969
138840
|
await databasesService.createIndex({
|
|
139970
138841
|
databaseId: collection["databaseId"],
|
|
@@ -140223,158 +139094,169 @@ var Push = class {
|
|
|
140223
139094
|
}
|
|
140224
139095
|
}
|
|
140225
139096
|
async pushResources(config2, options = { all: true, skipDeprecated: true }) {
|
|
140226
|
-
const
|
|
140227
|
-
|
|
140228
|
-
|
|
140229
|
-
const shouldPushAll = options.all === true;
|
|
140230
|
-
if ((shouldPushAll || options.settings) && (config2.projectName || config2.settings)) {
|
|
140231
|
-
try {
|
|
140232
|
-
this.log("Pushing settings ...");
|
|
140233
|
-
await this.pushSettings({
|
|
140234
|
-
projectId: config2.projectId,
|
|
140235
|
-
projectName: config2.projectName,
|
|
140236
|
-
settings: config2.settings
|
|
140237
|
-
});
|
|
140238
|
-
this.success(
|
|
140239
|
-
`Successfully pushed ${import_chalk11.default.bold("all")} project settings.`
|
|
140240
|
-
);
|
|
140241
|
-
results.settings = { success: true };
|
|
140242
|
-
} catch (e) {
|
|
140243
|
-
allErrors.push(e);
|
|
140244
|
-
results.settings = { success: false, error: e.message };
|
|
140245
|
-
}
|
|
139097
|
+
const previousForce = cliConfig.force;
|
|
139098
|
+
if (options.force !== void 0) {
|
|
139099
|
+
cliConfig.force = options.force;
|
|
140246
139100
|
}
|
|
140247
|
-
|
|
140248
|
-
|
|
140249
|
-
|
|
140250
|
-
|
|
140251
|
-
|
|
140252
|
-
|
|
140253
|
-
|
|
140254
|
-
|
|
140255
|
-
|
|
140256
|
-
|
|
140257
|
-
|
|
140258
|
-
|
|
139101
|
+
try {
|
|
139102
|
+
const { skipDeprecated = true } = options;
|
|
139103
|
+
const results = {};
|
|
139104
|
+
const allErrors = [];
|
|
139105
|
+
const shouldPushAll = options.all === true;
|
|
139106
|
+
if ((shouldPushAll || options.settings) && (config2.projectName || config2.settings)) {
|
|
139107
|
+
try {
|
|
139108
|
+
this.log("Pushing settings ...");
|
|
139109
|
+
await this.pushSettings({
|
|
139110
|
+
projectId: config2.projectId,
|
|
139111
|
+
projectName: config2.projectName,
|
|
139112
|
+
settings: config2.settings
|
|
139113
|
+
});
|
|
139114
|
+
this.success(
|
|
139115
|
+
`Successfully pushed ${import_chalk11.default.bold("all")} project settings.`
|
|
139116
|
+
);
|
|
139117
|
+
results.settings = { success: true };
|
|
139118
|
+
} catch (e) {
|
|
139119
|
+
allErrors.push(e);
|
|
139120
|
+
results.settings = { success: false, error: e.message };
|
|
139121
|
+
}
|
|
140259
139122
|
}
|
|
140260
|
-
|
|
140261
|
-
|
|
140262
|
-
|
|
140263
|
-
|
|
140264
|
-
|
|
140265
|
-
|
|
140266
|
-
|
|
140267
|
-
|
|
140268
|
-
|
|
140269
|
-
|
|
140270
|
-
|
|
140271
|
-
|
|
140272
|
-
|
|
139123
|
+
if ((shouldPushAll || options.buckets) && config2.buckets && config2.buckets.length > 0) {
|
|
139124
|
+
try {
|
|
139125
|
+
this.log("Pushing buckets ...");
|
|
139126
|
+
const result = await this.pushBuckets(config2.buckets);
|
|
139127
|
+
this.success(
|
|
139128
|
+
`Successfully pushed ${import_chalk11.default.bold(result.successfullyPushed)} buckets.`
|
|
139129
|
+
);
|
|
139130
|
+
results.buckets = result;
|
|
139131
|
+
allErrors.push(...result.errors);
|
|
139132
|
+
} catch (e) {
|
|
139133
|
+
allErrors.push(e);
|
|
139134
|
+
results.buckets = { successfullyPushed: 0, errors: [e] };
|
|
139135
|
+
}
|
|
140273
139136
|
}
|
|
140274
|
-
|
|
140275
|
-
|
|
140276
|
-
|
|
140277
|
-
|
|
140278
|
-
|
|
140279
|
-
|
|
140280
|
-
|
|
140281
|
-
|
|
140282
|
-
|
|
140283
|
-
|
|
140284
|
-
|
|
140285
|
-
|
|
140286
|
-
|
|
139137
|
+
if ((shouldPushAll || options.teams) && config2.teams && config2.teams.length > 0) {
|
|
139138
|
+
try {
|
|
139139
|
+
this.log("Pushing teams ...");
|
|
139140
|
+
const result = await this.pushTeams(config2.teams);
|
|
139141
|
+
this.success(
|
|
139142
|
+
`Successfully pushed ${import_chalk11.default.bold(result.successfullyPushed)} teams.`
|
|
139143
|
+
);
|
|
139144
|
+
results.teams = result;
|
|
139145
|
+
allErrors.push(...result.errors);
|
|
139146
|
+
} catch (e) {
|
|
139147
|
+
allErrors.push(e);
|
|
139148
|
+
results.teams = { successfullyPushed: 0, errors: [e] };
|
|
139149
|
+
}
|
|
140287
139150
|
}
|
|
140288
|
-
|
|
140289
|
-
|
|
140290
|
-
|
|
140291
|
-
|
|
140292
|
-
|
|
140293
|
-
|
|
140294
|
-
|
|
140295
|
-
|
|
140296
|
-
|
|
140297
|
-
|
|
140298
|
-
|
|
140299
|
-
|
|
140300
|
-
|
|
140301
|
-
} catch (e) {
|
|
140302
|
-
allErrors.push(e);
|
|
140303
|
-
results.functions = {
|
|
140304
|
-
successfullyPushed: 0,
|
|
140305
|
-
successfullyDeployed: 0,
|
|
140306
|
-
failedDeployments: [],
|
|
140307
|
-
errors: [e]
|
|
140308
|
-
};
|
|
139151
|
+
if ((shouldPushAll || options.topics) && config2.topics && config2.topics.length > 0) {
|
|
139152
|
+
try {
|
|
139153
|
+
this.log("Pushing topics ...");
|
|
139154
|
+
const result = await this.pushMessagingTopics(config2.topics);
|
|
139155
|
+
this.success(
|
|
139156
|
+
`Successfully pushed ${import_chalk11.default.bold(result.successfullyPushed)} topics.`
|
|
139157
|
+
);
|
|
139158
|
+
results.topics = result;
|
|
139159
|
+
allErrors.push(...result.errors);
|
|
139160
|
+
} catch (e) {
|
|
139161
|
+
allErrors.push(e);
|
|
139162
|
+
results.topics = { successfullyPushed: 0, errors: [e] };
|
|
139163
|
+
}
|
|
140309
139164
|
}
|
|
140310
|
-
|
|
140311
|
-
|
|
140312
|
-
|
|
140313
|
-
|
|
140314
|
-
|
|
140315
|
-
|
|
140316
|
-
|
|
140317
|
-
|
|
140318
|
-
|
|
140319
|
-
|
|
140320
|
-
|
|
140321
|
-
|
|
140322
|
-
|
|
140323
|
-
|
|
140324
|
-
|
|
140325
|
-
|
|
140326
|
-
|
|
140327
|
-
|
|
139165
|
+
if ((shouldPushAll || options.functions) && config2.functions && config2.functions.length > 0) {
|
|
139166
|
+
try {
|
|
139167
|
+
this.log("Pushing functions ...");
|
|
139168
|
+
const result = await this.pushFunctions(
|
|
139169
|
+
config2.functions,
|
|
139170
|
+
options.functionOptions
|
|
139171
|
+
);
|
|
139172
|
+
this.success(
|
|
139173
|
+
`Successfully pushed ${import_chalk11.default.bold(result.successfullyPushed)} functions.`
|
|
139174
|
+
);
|
|
139175
|
+
results.functions = result;
|
|
139176
|
+
allErrors.push(...result.errors);
|
|
139177
|
+
} catch (e) {
|
|
139178
|
+
allErrors.push(e);
|
|
139179
|
+
results.functions = {
|
|
139180
|
+
successfullyPushed: 0,
|
|
139181
|
+
successfullyDeployed: 0,
|
|
139182
|
+
failedDeployments: [],
|
|
139183
|
+
errors: [e]
|
|
139184
|
+
};
|
|
139185
|
+
}
|
|
140328
139186
|
}
|
|
140329
|
-
|
|
140330
|
-
|
|
140331
|
-
|
|
140332
|
-
|
|
140333
|
-
|
|
140334
|
-
|
|
140335
|
-
|
|
140336
|
-
|
|
140337
|
-
|
|
140338
|
-
|
|
140339
|
-
|
|
140340
|
-
|
|
140341
|
-
|
|
140342
|
-
|
|
140343
|
-
|
|
140344
|
-
|
|
139187
|
+
if ((shouldPushAll || options.sites) && config2.sites && config2.sites.length > 0) {
|
|
139188
|
+
try {
|
|
139189
|
+
this.log("Pushing sites ...");
|
|
139190
|
+
const result = await this.pushSites(
|
|
139191
|
+
config2.sites,
|
|
139192
|
+
options.siteOptions
|
|
139193
|
+
);
|
|
139194
|
+
this.success(
|
|
139195
|
+
`Successfully pushed ${import_chalk11.default.bold(result.successfullyPushed)} sites.`
|
|
139196
|
+
);
|
|
139197
|
+
results.sites = result;
|
|
139198
|
+
allErrors.push(...result.errors);
|
|
139199
|
+
} catch (e) {
|
|
139200
|
+
allErrors.push(e);
|
|
139201
|
+
results.sites = {
|
|
139202
|
+
successfullyPushed: 0,
|
|
139203
|
+
successfullyDeployed: 0,
|
|
139204
|
+
failedDeployments: [],
|
|
139205
|
+
errors: [e]
|
|
139206
|
+
};
|
|
139207
|
+
}
|
|
140345
139208
|
}
|
|
140346
|
-
|
|
140347
|
-
|
|
140348
|
-
|
|
140349
|
-
|
|
140350
|
-
|
|
140351
|
-
|
|
140352
|
-
|
|
140353
|
-
|
|
140354
|
-
)
|
|
140355
|
-
|
|
140356
|
-
|
|
140357
|
-
|
|
140358
|
-
|
|
140359
|
-
|
|
140360
|
-
|
|
140361
|
-
|
|
140362
|
-
|
|
140363
|
-
|
|
140364
|
-
|
|
140365
|
-
|
|
140366
|
-
|
|
140367
|
-
|
|
140368
|
-
|
|
140369
|
-
|
|
140370
|
-
|
|
140371
|
-
|
|
139209
|
+
if ((shouldPushAll || options.tables) && config2.tables && config2.tables.length > 0) {
|
|
139210
|
+
try {
|
|
139211
|
+
this.log("Pushing tables ...");
|
|
139212
|
+
const result = await this.pushTables(config2.tables, {
|
|
139213
|
+
attempts: options.tableOptions?.attempts,
|
|
139214
|
+
skipConfirmation: options.skipConfirmation
|
|
139215
|
+
});
|
|
139216
|
+
this.success(
|
|
139217
|
+
`Successfully pushed ${import_chalk11.default.bold(result.successfullyPushed)} tables.`
|
|
139218
|
+
);
|
|
139219
|
+
results.tables = result;
|
|
139220
|
+
allErrors.push(...result.errors);
|
|
139221
|
+
} catch (e) {
|
|
139222
|
+
allErrors.push(e);
|
|
139223
|
+
results.tables = { successfullyPushed: 0, errors: [e] };
|
|
139224
|
+
}
|
|
139225
|
+
}
|
|
139226
|
+
if ((options.collections || shouldPushAll && !skipDeprecated) && config2.collections && config2.collections.length > 0) {
|
|
139227
|
+
try {
|
|
139228
|
+
this.log("Pushing collections ...");
|
|
139229
|
+
const collectionsWithDbNames = config2.collections.map(
|
|
139230
|
+
(collection) => {
|
|
139231
|
+
const database = config2.databases?.find(
|
|
139232
|
+
(db) => db.$id === collection.databaseId
|
|
139233
|
+
);
|
|
139234
|
+
return {
|
|
139235
|
+
...collection,
|
|
139236
|
+
databaseName: database?.name ?? collection.databaseId
|
|
139237
|
+
};
|
|
139238
|
+
}
|
|
139239
|
+
);
|
|
139240
|
+
const result = await this.pushCollections(collectionsWithDbNames, {
|
|
139241
|
+
skipConfirmation: options.skipConfirmation
|
|
139242
|
+
});
|
|
139243
|
+
this.success(
|
|
139244
|
+
`Successfully pushed ${import_chalk11.default.bold(result.successfullyPushed)} collections.`
|
|
139245
|
+
);
|
|
139246
|
+
results.collections = result;
|
|
139247
|
+
allErrors.push(...result.errors);
|
|
139248
|
+
} catch (e) {
|
|
139249
|
+
allErrors.push(e);
|
|
139250
|
+
results.collections = { successfullyPushed: 0, errors: [e] };
|
|
139251
|
+
}
|
|
140372
139252
|
}
|
|
139253
|
+
return {
|
|
139254
|
+
results,
|
|
139255
|
+
errors: allErrors
|
|
139256
|
+
};
|
|
139257
|
+
} finally {
|
|
139258
|
+
cliConfig.force = previousForce;
|
|
140373
139259
|
}
|
|
140374
|
-
return {
|
|
140375
|
-
results,
|
|
140376
|
-
errors: allErrors
|
|
140377
|
-
};
|
|
140378
139260
|
}
|
|
140379
139261
|
async pushSettings(config2) {
|
|
140380
139262
|
const projectsService = await getProjectsService(this.consoleClient);
|
|
@@ -140449,12 +139331,43 @@ var Push = class {
|
|
|
140449
139331
|
async pushBuckets(buckets) {
|
|
140450
139332
|
let successfullyPushed = 0;
|
|
140451
139333
|
const errors = [];
|
|
139334
|
+
const hasBucketChanges = (remoteBucket, localBucket) => {
|
|
139335
|
+
const scalarFields = [
|
|
139336
|
+
"name",
|
|
139337
|
+
"fileSecurity",
|
|
139338
|
+
"enabled",
|
|
139339
|
+
"maximumFileSize",
|
|
139340
|
+
"encryption",
|
|
139341
|
+
"antivirus",
|
|
139342
|
+
"compression"
|
|
139343
|
+
];
|
|
139344
|
+
if (scalarFields.some((field) => remoteBucket[field] !== localBucket[field])) {
|
|
139345
|
+
return true;
|
|
139346
|
+
}
|
|
139347
|
+
if (!arrayEqualsUnordered(
|
|
139348
|
+
remoteBucket["$permissions"],
|
|
139349
|
+
localBucket["$permissions"]
|
|
139350
|
+
)) {
|
|
139351
|
+
return true;
|
|
139352
|
+
}
|
|
139353
|
+
return !arrayEqualsUnordered(
|
|
139354
|
+
remoteBucket.allowedFileExtensions,
|
|
139355
|
+
localBucket.allowedFileExtensions
|
|
139356
|
+
);
|
|
139357
|
+
};
|
|
140452
139358
|
for (const bucket of buckets) {
|
|
140453
139359
|
try {
|
|
140454
139360
|
this.log(`Pushing bucket ${import_chalk11.default.bold(bucket["name"])} ...`);
|
|
140455
139361
|
const storageService = await getStorageService(this.projectClient);
|
|
140456
139362
|
try {
|
|
140457
|
-
await storageService.getBucket(bucket["$id"]);
|
|
139363
|
+
const remoteBucket = await storageService.getBucket(bucket["$id"]);
|
|
139364
|
+
const hasChanges = hasBucketChanges(remoteBucket, bucket);
|
|
139365
|
+
if (!hasChanges) {
|
|
139366
|
+
this.log(
|
|
139367
|
+
`No changes detected for bucket ${import_chalk11.default.bold(bucket["name"])}. Skipping.`
|
|
139368
|
+
);
|
|
139369
|
+
continue;
|
|
139370
|
+
}
|
|
140458
139371
|
await storageService.updateBucket({
|
|
140459
139372
|
bucketId: bucket["$id"],
|
|
140460
139373
|
name: bucket.name,
|
|
@@ -140467,6 +139380,7 @@ var Push = class {
|
|
|
140467
139380
|
antivirus: bucket.antivirus,
|
|
140468
139381
|
compression: bucket.compression
|
|
140469
139382
|
});
|
|
139383
|
+
successfullyPushed++;
|
|
140470
139384
|
} catch (e) {
|
|
140471
139385
|
if (e instanceof AppwriteException && Number(e.code) === 404) {
|
|
140472
139386
|
await storageService.createBucket({
|
|
@@ -140481,11 +139395,11 @@ var Push = class {
|
|
|
140481
139395
|
encryption: bucket.encryption,
|
|
140482
139396
|
antivirus: bucket.antivirus
|
|
140483
139397
|
});
|
|
139398
|
+
successfullyPushed++;
|
|
140484
139399
|
} else {
|
|
140485
139400
|
throw e;
|
|
140486
139401
|
}
|
|
140487
139402
|
}
|
|
140488
|
-
successfullyPushed++;
|
|
140489
139403
|
} catch (e) {
|
|
140490
139404
|
errors.push(e);
|
|
140491
139405
|
this.error(`Failed to push bucket ${bucket["name"]}: ${e.message}`);
|
|
@@ -141166,8 +140080,12 @@ var Push = class {
|
|
|
141166
140080
|
async pushTables(tables, options = {}) {
|
|
141167
140081
|
const { attempts, skipConfirmation = false } = options;
|
|
141168
140082
|
const pollMaxDebounces = attempts ?? POLL_DEFAULT_VALUE;
|
|
141169
|
-
const pools = new Pools(pollMaxDebounces);
|
|
141170
|
-
const attributes = new Attributes(
|
|
140083
|
+
const pools = new Pools(pollMaxDebounces, this.projectClient);
|
|
140084
|
+
const attributes = new Attributes(
|
|
140085
|
+
pools,
|
|
140086
|
+
skipConfirmation,
|
|
140087
|
+
this.projectClient
|
|
140088
|
+
);
|
|
141171
140089
|
let tablesChanged = /* @__PURE__ */ new Set();
|
|
141172
140090
|
const errors = [];
|
|
141173
140091
|
await Promise.all(
|
|
@@ -141242,6 +140160,11 @@ var Push = class {
|
|
|
141242
140160
|
indexes = indexesResult.attributes;
|
|
141243
140161
|
hadChanges = columnsResult.hasChanges || indexesResult.hasChanges;
|
|
141244
140162
|
if (!hadChanges && columns.length <= 0 && indexes.length <= 0) {
|
|
140163
|
+
if (!tablesChanged.has(table["$id"])) {
|
|
140164
|
+
this.log(
|
|
140165
|
+
`No changes detected for table ${import_chalk11.default.bold(table["name"])}. Skipping.`
|
|
140166
|
+
);
|
|
140167
|
+
}
|
|
141245
140168
|
continue;
|
|
141246
140169
|
}
|
|
141247
140170
|
}
|
|
@@ -141270,8 +140193,12 @@ var Push = class {
|
|
|
141270
140193
|
}
|
|
141271
140194
|
async pushCollections(collections, options = {}) {
|
|
141272
140195
|
const { skipConfirmation = false } = options;
|
|
141273
|
-
const pools = new Pools(POLL_DEFAULT_VALUE);
|
|
141274
|
-
const attributesHelper = new Attributes(
|
|
140196
|
+
const pools = new Pools(POLL_DEFAULT_VALUE, this.projectClient);
|
|
140197
|
+
const attributesHelper = new Attributes(
|
|
140198
|
+
pools,
|
|
140199
|
+
skipConfirmation,
|
|
140200
|
+
this.projectClient
|
|
140201
|
+
);
|
|
141275
140202
|
const errors = [];
|
|
141276
140203
|
const collectionsWithState = collections;
|
|
141277
140204
|
const databases2 = Array.from(
|
|
@@ -141959,10 +140886,11 @@ var pushCollection = async () => {
|
|
|
141959
140886
|
const localDatabase = localConfig.getDatabase(collection.databaseId);
|
|
141960
140887
|
collection.databaseName = localDatabase.name ?? collection.databaseId;
|
|
141961
140888
|
});
|
|
140889
|
+
const projectClient2 = await sdkForProject();
|
|
141962
140890
|
if (!await approveChanges(
|
|
141963
140891
|
collections,
|
|
141964
140892
|
async (args) => {
|
|
141965
|
-
const databasesService = await getDatabasesService();
|
|
140893
|
+
const databasesService = await getDatabasesService(projectClient2);
|
|
141966
140894
|
return await databasesService.getCollection(
|
|
141967
140895
|
args.databaseId,
|
|
141968
140896
|
args.collectionId
|
|
@@ -142465,7 +141393,13 @@ var BaseDatabasesGenerator = class {
|
|
|
142465
141393
|
if (!fs15.existsSync(sdkDir)) {
|
|
142466
141394
|
fs15.mkdirSync(sdkDir, { recursive: true });
|
|
142467
141395
|
}
|
|
142468
|
-
|
|
141396
|
+
const fileEntries = [
|
|
141397
|
+
["databases.ts", result.dbContent],
|
|
141398
|
+
["types.ts", result.typesContent],
|
|
141399
|
+
["index.ts", result.indexContent],
|
|
141400
|
+
["constants.ts", result.constantsContent]
|
|
141401
|
+
];
|
|
141402
|
+
for (const [relativePath, content] of fileEntries) {
|
|
142469
141403
|
const filePath = path14.join(sdkDir, relativePath);
|
|
142470
141404
|
const fileDir = path14.dirname(filePath);
|
|
142471
141405
|
if (!fs15.existsSync(fileDir)) {
|
|
@@ -142477,10 +141411,13 @@ var BaseDatabasesGenerator = class {
|
|
|
142477
141411
|
fs15.writeFileSync(filePath, content, "utf-8");
|
|
142478
141412
|
}
|
|
142479
141413
|
}
|
|
142480
|
-
getGeneratedFilePaths(
|
|
142481
|
-
return
|
|
142482
|
-
|
|
142483
|
-
|
|
141414
|
+
getGeneratedFilePaths(_result) {
|
|
141415
|
+
return [
|
|
141416
|
+
path14.join(SDK_TITLE_LOWER, "databases.ts"),
|
|
141417
|
+
path14.join(SDK_TITLE_LOWER, "types.ts"),
|
|
141418
|
+
path14.join(SDK_TITLE_LOWER, "index.ts"),
|
|
141419
|
+
path14.join(SDK_TITLE_LOWER, "constants.ts")
|
|
141420
|
+
];
|
|
142484
141421
|
}
|
|
142485
141422
|
};
|
|
142486
141423
|
|
|
@@ -142807,29 +141744,24 @@ ${supportsServerSide ? ` create: (databaseId: string, name: string, options?: {
|
|
|
142807
141744
|
throw new Error("Project ID is required in configuration");
|
|
142808
141745
|
}
|
|
142809
141746
|
const importExt = detectImportExtension();
|
|
142810
|
-
const files = /* @__PURE__ */ new Map();
|
|
142811
141747
|
const hasEntities = config2.tables && config2.tables.length > 0 || config2.collections && config2.collections.length > 0;
|
|
142812
141748
|
if (!hasEntities) {
|
|
142813
141749
|
console.log(
|
|
142814
141750
|
"No tables or collections found in configuration. Skipping database generation."
|
|
142815
141751
|
);
|
|
142816
|
-
|
|
142817
|
-
"
|
|
142818
|
-
"// No tables or collections found in configuration\n"
|
|
142819
|
-
|
|
142820
|
-
|
|
142821
|
-
|
|
142822
|
-
"// No tables or collections found in configuration\n"
|
|
142823
|
-
);
|
|
142824
|
-
files.set("index.ts", this.generateIndexFile(importExt));
|
|
142825
|
-
files.set("constants.ts", this.generateConstantsFile(config2));
|
|
142826
|
-
return { files };
|
|
141752
|
+
return {
|
|
141753
|
+
dbContent: "// No tables or collections found in configuration\n",
|
|
141754
|
+
typesContent: "// No tables or collections found in configuration\n",
|
|
141755
|
+
indexContent: this.generateIndexFile(importExt),
|
|
141756
|
+
constantsContent: this.generateConstantsFile(config2)
|
|
141757
|
+
};
|
|
142827
141758
|
}
|
|
142828
|
-
|
|
142829
|
-
|
|
142830
|
-
|
|
142831
|
-
|
|
142832
|
-
|
|
141759
|
+
return {
|
|
141760
|
+
dbContent: this.generateDatabasesFile(config2, importExt),
|
|
141761
|
+
typesContent: this.generateTypesFile(config2),
|
|
141762
|
+
indexContent: this.generateIndexFile(importExt),
|
|
141763
|
+
constantsContent: this.generateConstantsFile(config2)
|
|
141764
|
+
};
|
|
142833
141765
|
}
|
|
142834
141766
|
};
|
|
142835
141767
|
|
|
@@ -144796,7 +143728,7 @@ var getMigrationsClient = async () => {
|
|
|
144796
143728
|
var migrations = new Command("migrations").description(commandDescriptions["migrations"] ?? "").configureHelp({
|
|
144797
143729
|
helpWidth: process.stdout.columns || 80
|
|
144798
143730
|
});
|
|
144799
|
-
migrations.command(`list`).description(`List all migrations in the current project. This endpoint returns a list of all migrations including their status, progress, and any errors that occurred during the migration process.`).option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, destination, resources, statusCounters, resourceData, errors`).option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`).option(
|
|
143731
|
+
migrations.command(`list`).description(`List all migrations in the current project. This endpoint returns a list of all migrations including their status, progress, and any errors that occurred during the migration process.`).option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, stage, source, destination, resources, resourceId, resourceType, statusCounters, resourceData, errors`).option(`--search <search>`, `Search term to filter your list results. Max length: 256 chars.`).option(
|
|
144800
143732
|
`--total [value]`,
|
|
144801
143733
|
`When set to false, the total count returned will be 0 and will not be calculated.`,
|
|
144802
143734
|
(value) => value === void 0 ? true : parseBool(value)
|
|
@@ -145142,6 +144074,29 @@ projects.command(`delete-platform`).description(`Delete a platform by its unique
|
|
|
145142
144074
|
async ({ projectId, platformId }) => parse3(await (await getProjectsClient()).deletePlatform(projectId, platformId))
|
|
145143
144075
|
)
|
|
145144
144076
|
);
|
|
144077
|
+
projects.command(`list-schedules`).description(`Get a list of all the project's schedules. You can use the query params to filter your results.`).requiredOption(`--project-id <project-id>`, `Project unique ID.`).option(`--queries [queries...]`, `Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: resourceType, resourceId, projectId, schedule, active, region`).option(
|
|
144078
|
+
`--total [value]`,
|
|
144079
|
+
`When set to false, the total count returned will be 0 and will not be calculated.`,
|
|
144080
|
+
(value) => value === void 0 ? true : parseBool(value)
|
|
144081
|
+
).action(
|
|
144082
|
+
actionRunner(
|
|
144083
|
+
async ({ projectId, queries, total }) => parse3(await (await getProjectsClient()).listSchedules(projectId, queries, total))
|
|
144084
|
+
)
|
|
144085
|
+
);
|
|
144086
|
+
projects.command(`create-schedule`).description(`Create a new schedule for a resource.`).requiredOption(`--project-id <project-id>`, `Project unique ID.`).requiredOption(`--resource-type <resource-type>`, `The resource type for the schedule. Possible values: function, execution, message.`).requiredOption(`--resource-id <resource-id>`, `The resource ID to associate with this schedule.`).requiredOption(`--schedule <schedule>`, `Schedule CRON expression.`).option(
|
|
144087
|
+
`--active [value]`,
|
|
144088
|
+
`Whether the schedule is active.`,
|
|
144089
|
+
(value) => value === void 0 ? true : parseBool(value)
|
|
144090
|
+
).option(`--data <data>`, `Schedule data as a JSON string. Used to store resource-specific context needed for execution.`).action(
|
|
144091
|
+
actionRunner(
|
|
144092
|
+
async ({ projectId, resourceType, resourceId, schedule, active, data }) => parse3(await (await getProjectsClient()).createSchedule(projectId, resourceType, resourceId, schedule, active, JSON.parse(data)))
|
|
144093
|
+
)
|
|
144094
|
+
);
|
|
144095
|
+
projects.command(`get-schedule`).description(`Get a schedule by its unique ID.`).requiredOption(`--project-id <project-id>`, `Project unique ID.`).requiredOption(`--schedule-id <schedule-id>`, `Schedule ID.`).action(
|
|
144096
|
+
actionRunner(
|
|
144097
|
+
async ({ projectId, scheduleId }) => parse3(await (await getProjectsClient()).getSchedule(projectId, scheduleId))
|
|
144098
|
+
)
|
|
144099
|
+
);
|
|
145145
144100
|
projects.command(`update-service-status`).description(`Update the status of a specific service. Use this endpoint to enable or disable a service in your project. `).requiredOption(`--project-id <project-id>`, `Project unique ID.`).requiredOption(`--service <service>`, `Service name.`).requiredOption(`--status <status>`, `Service status.`, parseBool).action(
|
|
145146
144101
|
actionRunner(
|
|
145147
144102
|
async ({ projectId, service, status }) => parse3(await (await getProjectsClient()).updateServiceStatus(projectId, service, status))
|
|
@@ -146755,9 +145710,6 @@ if (process.argv.includes("-v") || process.argv.includes("--version")) {
|
|
|
146755
145710
|
}
|
|
146756
145711
|
/*! Bundled license information:
|
|
146757
145712
|
|
|
146758
|
-
safe-buffer/index.js:
|
|
146759
|
-
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
146760
|
-
|
|
146761
145713
|
undici/lib/fetch/body.js:
|
|
146762
145714
|
(*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
|
|
146763
145715
|
|