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
|
@@ -21981,7 +21981,6 @@ var require_safe_buffer = __commonJS({
|
|
|
21981
21981
|
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
21982
21982
|
return Buffer2(arg, encodingOrOffset, length);
|
|
21983
21983
|
}
|
|
21984
|
-
SafeBuffer.prototype = Object.create(Buffer2.prototype);
|
|
21985
21984
|
copyProps(Buffer2, SafeBuffer);
|
|
21986
21985
|
SafeBuffer.from = function(arg, encodingOrOffset, length) {
|
|
21987
21986
|
if (typeof arg === "number") {
|
|
@@ -53953,14 +53952,14 @@ var require_undici = __commonJS({
|
|
|
53953
53952
|
}
|
|
53954
53953
|
});
|
|
53955
53954
|
|
|
53956
|
-
// node_modules/
|
|
53955
|
+
// node_modules/bignumber.js/bignumber.js
|
|
53957
53956
|
var require_bignumber = __commonJS({
|
|
53958
|
-
"node_modules/
|
|
53957
|
+
"node_modules/bignumber.js/bignumber.js"(exports, module) {
|
|
53959
53958
|
(function(globalObject) {
|
|
53960
53959
|
"use strict";
|
|
53961
|
-
var
|
|
53960
|
+
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;
|
|
53962
53961
|
function clone2(configObject) {
|
|
53963
|
-
var div, convertBase, parseNumeric, P =
|
|
53962
|
+
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 = {
|
|
53964
53963
|
prefix: "",
|
|
53965
53964
|
groupSize: 3,
|
|
53966
53965
|
secondaryGroupSize: 0,
|
|
@@ -53971,9 +53970,9 @@ var require_bignumber = __commonJS({
|
|
|
53971
53970
|
// non-breaking space
|
|
53972
53971
|
suffix: ""
|
|
53973
53972
|
}, ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz", alphabetHasNormalDecimalDigits = true;
|
|
53974
|
-
function
|
|
53973
|
+
function BigNumber2(v, b) {
|
|
53975
53974
|
var alphabet, c, caseChanged, e, i, isNum, len, str, x = this;
|
|
53976
|
-
if (!(x instanceof
|
|
53975
|
+
if (!(x instanceof BigNumber2)) return new BigNumber2(v, b);
|
|
53977
53976
|
if (b == null) {
|
|
53978
53977
|
if (v && v._isBigNumber === true) {
|
|
53979
53978
|
x.s = v.s;
|
|
@@ -54015,1774 +54014,14 @@ var require_bignumber = __commonJS({
|
|
|
54015
54014
|
} else {
|
|
54016
54015
|
intCheck(b, 2, ALPHABET.length, "Base");
|
|
54017
54016
|
if (b == 10 && alphabetHasNormalDecimalDigits) {
|
|
54018
|
-
x = new
|
|
54019
|
-
return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE);
|
|
54020
|
-
}
|
|
54021
|
-
str = String(v);
|
|
54022
|
-
if (isNum = typeof v == "number") {
|
|
54023
|
-
if (v * 0 != 0) return parseNumeric(x, str, isNum, b);
|
|
54024
|
-
x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1;
|
|
54025
|
-
if (BigNumber3.DEBUG && str.replace(/^0\.0*|\./, "").length > 15) {
|
|
54026
|
-
throw Error(tooManyDigits + v);
|
|
54027
|
-
}
|
|
54028
|
-
} else {
|
|
54029
|
-
x.s = str.charCodeAt(0) === 45 ? (str = str.slice(1), -1) : 1;
|
|
54030
|
-
}
|
|
54031
|
-
alphabet = ALPHABET.slice(0, b);
|
|
54032
|
-
e = i = 0;
|
|
54033
|
-
for (len = str.length; i < len; i++) {
|
|
54034
|
-
if (alphabet.indexOf(c = str.charAt(i)) < 0) {
|
|
54035
|
-
if (c == ".") {
|
|
54036
|
-
if (i > e) {
|
|
54037
|
-
e = len;
|
|
54038
|
-
continue;
|
|
54039
|
-
}
|
|
54040
|
-
} else if (!caseChanged) {
|
|
54041
|
-
if (str == str.toUpperCase() && (str = str.toLowerCase()) || str == str.toLowerCase() && (str = str.toUpperCase())) {
|
|
54042
|
-
caseChanged = true;
|
|
54043
|
-
i = -1;
|
|
54044
|
-
e = 0;
|
|
54045
|
-
continue;
|
|
54046
|
-
}
|
|
54047
|
-
}
|
|
54048
|
-
return parseNumeric(x, String(v), isNum, b);
|
|
54049
|
-
}
|
|
54050
|
-
}
|
|
54051
|
-
isNum = false;
|
|
54052
|
-
str = convertBase(str, b, 10, x.s);
|
|
54053
|
-
if ((e = str.indexOf(".")) > -1) str = str.replace(".", "");
|
|
54054
|
-
else e = str.length;
|
|
54055
|
-
}
|
|
54056
|
-
for (i = 0; str.charCodeAt(i) === 48; i++) ;
|
|
54057
|
-
for (len = str.length; str.charCodeAt(--len) === 48; ) ;
|
|
54058
|
-
if (str = str.slice(i, ++len)) {
|
|
54059
|
-
len -= i;
|
|
54060
|
-
if (isNum && BigNumber3.DEBUG && len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) {
|
|
54061
|
-
throw Error(tooManyDigits + x.s * v);
|
|
54062
|
-
}
|
|
54063
|
-
if ((e = e - i - 1) > MAX_EXP) {
|
|
54064
|
-
x.c = x.e = null;
|
|
54065
|
-
} else if (e < MIN_EXP) {
|
|
54066
|
-
x.c = [x.e = 0];
|
|
54067
|
-
} else {
|
|
54068
|
-
x.e = e;
|
|
54069
|
-
x.c = [];
|
|
54070
|
-
i = (e + 1) % LOG_BASE;
|
|
54071
|
-
if (e < 0) i += LOG_BASE;
|
|
54072
|
-
if (i < len) {
|
|
54073
|
-
if (i) x.c.push(+str.slice(0, i));
|
|
54074
|
-
for (len -= LOG_BASE; i < len; ) {
|
|
54075
|
-
x.c.push(+str.slice(i, i += LOG_BASE));
|
|
54076
|
-
}
|
|
54077
|
-
i = LOG_BASE - (str = str.slice(i)).length;
|
|
54078
|
-
} else {
|
|
54079
|
-
i -= len;
|
|
54080
|
-
}
|
|
54081
|
-
for (; i--; str += "0") ;
|
|
54082
|
-
x.c.push(+str);
|
|
54083
|
-
}
|
|
54084
|
-
} else {
|
|
54085
|
-
x.c = [x.e = 0];
|
|
54086
|
-
}
|
|
54087
|
-
}
|
|
54088
|
-
BigNumber3.clone = clone2;
|
|
54089
|
-
BigNumber3.ROUND_UP = 0;
|
|
54090
|
-
BigNumber3.ROUND_DOWN = 1;
|
|
54091
|
-
BigNumber3.ROUND_CEIL = 2;
|
|
54092
|
-
BigNumber3.ROUND_FLOOR = 3;
|
|
54093
|
-
BigNumber3.ROUND_HALF_UP = 4;
|
|
54094
|
-
BigNumber3.ROUND_HALF_DOWN = 5;
|
|
54095
|
-
BigNumber3.ROUND_HALF_EVEN = 6;
|
|
54096
|
-
BigNumber3.ROUND_HALF_CEIL = 7;
|
|
54097
|
-
BigNumber3.ROUND_HALF_FLOOR = 8;
|
|
54098
|
-
BigNumber3.EUCLID = 9;
|
|
54099
|
-
BigNumber3.config = BigNumber3.set = function(obj) {
|
|
54100
|
-
var p, v;
|
|
54101
|
-
if (obj != null) {
|
|
54102
|
-
if (typeof obj == "object") {
|
|
54103
|
-
if (obj.hasOwnProperty(p = "DECIMAL_PLACES")) {
|
|
54104
|
-
v = obj[p];
|
|
54105
|
-
intCheck(v, 0, MAX, p);
|
|
54106
|
-
DECIMAL_PLACES = v;
|
|
54107
|
-
}
|
|
54108
|
-
if (obj.hasOwnProperty(p = "ROUNDING_MODE")) {
|
|
54109
|
-
v = obj[p];
|
|
54110
|
-
intCheck(v, 0, 8, p);
|
|
54111
|
-
ROUNDING_MODE = v;
|
|
54112
|
-
}
|
|
54113
|
-
if (obj.hasOwnProperty(p = "EXPONENTIAL_AT")) {
|
|
54114
|
-
v = obj[p];
|
|
54115
|
-
if (v && v.pop) {
|
|
54116
|
-
intCheck(v[0], -MAX, 0, p);
|
|
54117
|
-
intCheck(v[1], 0, MAX, p);
|
|
54118
|
-
TO_EXP_NEG = v[0];
|
|
54119
|
-
TO_EXP_POS = v[1];
|
|
54120
|
-
} else {
|
|
54121
|
-
intCheck(v, -MAX, MAX, p);
|
|
54122
|
-
TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);
|
|
54123
|
-
}
|
|
54124
|
-
}
|
|
54125
|
-
if (obj.hasOwnProperty(p = "RANGE")) {
|
|
54126
|
-
v = obj[p];
|
|
54127
|
-
if (v && v.pop) {
|
|
54128
|
-
intCheck(v[0], -MAX, -1, p);
|
|
54129
|
-
intCheck(v[1], 1, MAX, p);
|
|
54130
|
-
MIN_EXP = v[0];
|
|
54131
|
-
MAX_EXP = v[1];
|
|
54132
|
-
} else {
|
|
54133
|
-
intCheck(v, -MAX, MAX, p);
|
|
54134
|
-
if (v) {
|
|
54135
|
-
MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);
|
|
54136
|
-
} else {
|
|
54137
|
-
throw Error(bignumberError + p + " cannot be zero: " + v);
|
|
54138
|
-
}
|
|
54139
|
-
}
|
|
54140
|
-
}
|
|
54141
|
-
if (obj.hasOwnProperty(p = "CRYPTO")) {
|
|
54142
|
-
v = obj[p];
|
|
54143
|
-
if (v === !!v) {
|
|
54144
|
-
if (v) {
|
|
54145
|
-
if (typeof crypto != "undefined" && crypto && (crypto.getRandomValues || crypto.randomBytes)) {
|
|
54146
|
-
CRYPTO = v;
|
|
54147
|
-
} else {
|
|
54148
|
-
CRYPTO = !v;
|
|
54149
|
-
throw Error(bignumberError + "crypto unavailable");
|
|
54150
|
-
}
|
|
54151
|
-
} else {
|
|
54152
|
-
CRYPTO = v;
|
|
54153
|
-
}
|
|
54154
|
-
} else {
|
|
54155
|
-
throw Error(bignumberError + p + " not true or false: " + v);
|
|
54156
|
-
}
|
|
54157
|
-
}
|
|
54158
|
-
if (obj.hasOwnProperty(p = "MODULO_MODE")) {
|
|
54159
|
-
v = obj[p];
|
|
54160
|
-
intCheck(v, 0, 9, p);
|
|
54161
|
-
MODULO_MODE = v;
|
|
54162
|
-
}
|
|
54163
|
-
if (obj.hasOwnProperty(p = "POW_PRECISION")) {
|
|
54164
|
-
v = obj[p];
|
|
54165
|
-
intCheck(v, 0, MAX, p);
|
|
54166
|
-
POW_PRECISION = v;
|
|
54167
|
-
}
|
|
54168
|
-
if (obj.hasOwnProperty(p = "FORMAT")) {
|
|
54169
|
-
v = obj[p];
|
|
54170
|
-
if (typeof v == "object") FORMAT = v;
|
|
54171
|
-
else throw Error(bignumberError + p + " not an object: " + v);
|
|
54172
|
-
}
|
|
54173
|
-
if (obj.hasOwnProperty(p = "ALPHABET")) {
|
|
54174
|
-
v = obj[p];
|
|
54175
|
-
if (typeof v == "string" && !/^.?$|[+\-.\s]|(.).*\1/.test(v)) {
|
|
54176
|
-
alphabetHasNormalDecimalDigits = v.slice(0, 10) == "0123456789";
|
|
54177
|
-
ALPHABET = v;
|
|
54178
|
-
} else {
|
|
54179
|
-
throw Error(bignumberError + p + " invalid: " + v);
|
|
54180
|
-
}
|
|
54181
|
-
}
|
|
54182
|
-
} else {
|
|
54183
|
-
throw Error(bignumberError + "Object expected: " + obj);
|
|
54184
|
-
}
|
|
54185
|
-
}
|
|
54186
|
-
return {
|
|
54187
|
-
DECIMAL_PLACES,
|
|
54188
|
-
ROUNDING_MODE,
|
|
54189
|
-
EXPONENTIAL_AT: [TO_EXP_NEG, TO_EXP_POS],
|
|
54190
|
-
RANGE: [MIN_EXP, MAX_EXP],
|
|
54191
|
-
CRYPTO,
|
|
54192
|
-
MODULO_MODE,
|
|
54193
|
-
POW_PRECISION,
|
|
54194
|
-
FORMAT,
|
|
54195
|
-
ALPHABET
|
|
54196
|
-
};
|
|
54197
|
-
};
|
|
54198
|
-
BigNumber3.isBigNumber = function(v) {
|
|
54199
|
-
if (!v || v._isBigNumber !== true) return false;
|
|
54200
|
-
if (!BigNumber3.DEBUG) return true;
|
|
54201
|
-
var i, n, c = v.c, e = v.e, s = v.s;
|
|
54202
|
-
out: if ({}.toString.call(c) == "[object Array]") {
|
|
54203
|
-
if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) {
|
|
54204
|
-
if (c[0] === 0) {
|
|
54205
|
-
if (e === 0 && c.length === 1) return true;
|
|
54206
|
-
break out;
|
|
54207
|
-
}
|
|
54208
|
-
i = (e + 1) % LOG_BASE;
|
|
54209
|
-
if (i < 1) i += LOG_BASE;
|
|
54210
|
-
if (String(c[0]).length == i) {
|
|
54211
|
-
for (i = 0; i < c.length; i++) {
|
|
54212
|
-
n = c[i];
|
|
54213
|
-
if (n < 0 || n >= BASE || n !== mathfloor(n)) break out;
|
|
54214
|
-
}
|
|
54215
|
-
if (n !== 0) return true;
|
|
54216
|
-
}
|
|
54217
|
-
}
|
|
54218
|
-
} else if (c === null && e === null && (s === null || s === 1 || s === -1)) {
|
|
54219
|
-
return true;
|
|
54220
|
-
}
|
|
54221
|
-
throw Error(bignumberError + "Invalid BigNumber: " + v);
|
|
54222
|
-
};
|
|
54223
|
-
BigNumber3.maximum = BigNumber3.max = function() {
|
|
54224
|
-
return maxOrMin(arguments, -1);
|
|
54225
|
-
};
|
|
54226
|
-
BigNumber3.minimum = BigNumber3.min = function() {
|
|
54227
|
-
return maxOrMin(arguments, 1);
|
|
54228
|
-
};
|
|
54229
|
-
BigNumber3.random = (function() {
|
|
54230
|
-
var pow2_53 = 9007199254740992;
|
|
54231
|
-
var random53bitInt = Math.random() * pow2_53 & 2097151 ? function() {
|
|
54232
|
-
return mathfloor(Math.random() * pow2_53);
|
|
54233
|
-
} : function() {
|
|
54234
|
-
return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
|
|
54235
|
-
};
|
|
54236
|
-
return function(dp) {
|
|
54237
|
-
var a, b, e, k, v, i = 0, c = [], rand = new BigNumber3(ONE);
|
|
54238
|
-
if (dp == null) dp = DECIMAL_PLACES;
|
|
54239
|
-
else intCheck(dp, 0, MAX);
|
|
54240
|
-
k = mathceil(dp / LOG_BASE);
|
|
54241
|
-
if (CRYPTO) {
|
|
54242
|
-
if (crypto.getRandomValues) {
|
|
54243
|
-
a = crypto.getRandomValues(new Uint32Array(k *= 2));
|
|
54244
|
-
for (; i < k; ) {
|
|
54245
|
-
v = a[i] * 131072 + (a[i + 1] >>> 11);
|
|
54246
|
-
if (v >= 9e15) {
|
|
54247
|
-
b = crypto.getRandomValues(new Uint32Array(2));
|
|
54248
|
-
a[i] = b[0];
|
|
54249
|
-
a[i + 1] = b[1];
|
|
54250
|
-
} else {
|
|
54251
|
-
c.push(v % 1e14);
|
|
54252
|
-
i += 2;
|
|
54253
|
-
}
|
|
54254
|
-
}
|
|
54255
|
-
i = k / 2;
|
|
54256
|
-
} else if (crypto.randomBytes) {
|
|
54257
|
-
a = crypto.randomBytes(k *= 7);
|
|
54258
|
-
for (; i < k; ) {
|
|
54259
|
-
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];
|
|
54260
|
-
if (v >= 9e15) {
|
|
54261
|
-
crypto.randomBytes(7).copy(a, i);
|
|
54262
|
-
} else {
|
|
54263
|
-
c.push(v % 1e14);
|
|
54264
|
-
i += 7;
|
|
54265
|
-
}
|
|
54266
|
-
}
|
|
54267
|
-
i = k / 7;
|
|
54268
|
-
} else {
|
|
54269
|
-
CRYPTO = false;
|
|
54270
|
-
throw Error(bignumberError + "crypto unavailable");
|
|
54271
|
-
}
|
|
54272
|
-
}
|
|
54273
|
-
if (!CRYPTO) {
|
|
54274
|
-
for (; i < k; ) {
|
|
54275
|
-
v = random53bitInt();
|
|
54276
|
-
if (v < 9e15) c[i++] = v % 1e14;
|
|
54277
|
-
}
|
|
54278
|
-
}
|
|
54279
|
-
k = c[--i];
|
|
54280
|
-
dp %= LOG_BASE;
|
|
54281
|
-
if (k && dp) {
|
|
54282
|
-
v = POWS_TEN[LOG_BASE - dp];
|
|
54283
|
-
c[i] = mathfloor(k / v) * v;
|
|
54284
|
-
}
|
|
54285
|
-
for (; c[i] === 0; c.pop(), i--) ;
|
|
54286
|
-
if (i < 0) {
|
|
54287
|
-
c = [e = 0];
|
|
54288
|
-
} else {
|
|
54289
|
-
for (e = -1; c[0] === 0; c.splice(0, 1), e -= LOG_BASE) ;
|
|
54290
|
-
for (i = 1, v = c[0]; v >= 10; v /= 10, i++) ;
|
|
54291
|
-
if (i < LOG_BASE) e -= LOG_BASE - i;
|
|
54292
|
-
}
|
|
54293
|
-
rand.e = e;
|
|
54294
|
-
rand.c = c;
|
|
54295
|
-
return rand;
|
|
54296
|
-
};
|
|
54297
|
-
})();
|
|
54298
|
-
BigNumber3.sum = function() {
|
|
54299
|
-
var i = 1, args = arguments, sum = new BigNumber3(args[0]);
|
|
54300
|
-
for (; i < args.length; ) sum = sum.plus(args[i++]);
|
|
54301
|
-
return sum;
|
|
54302
|
-
};
|
|
54303
|
-
convertBase = /* @__PURE__ */ (function() {
|
|
54304
|
-
var decimal = "0123456789";
|
|
54305
|
-
function toBaseOut(str, baseIn, baseOut, alphabet) {
|
|
54306
|
-
var j, arr = [0], arrL, i = 0, len = str.length;
|
|
54307
|
-
for (; i < len; ) {
|
|
54308
|
-
for (arrL = arr.length; arrL--; arr[arrL] *= baseIn) ;
|
|
54309
|
-
arr[0] += alphabet.indexOf(str.charAt(i++));
|
|
54310
|
-
for (j = 0; j < arr.length; j++) {
|
|
54311
|
-
if (arr[j] > baseOut - 1) {
|
|
54312
|
-
if (arr[j + 1] == null) arr[j + 1] = 0;
|
|
54313
|
-
arr[j + 1] += arr[j] / baseOut | 0;
|
|
54314
|
-
arr[j] %= baseOut;
|
|
54315
|
-
}
|
|
54316
|
-
}
|
|
54317
|
-
}
|
|
54318
|
-
return arr.reverse();
|
|
54319
|
-
}
|
|
54320
|
-
return function(str, baseIn, baseOut, sign, callerIsToString) {
|
|
54321
|
-
var alphabet, d, e, k, r, x, xc, y, i = str.indexOf("."), dp = DECIMAL_PLACES, rm = ROUNDING_MODE;
|
|
54322
|
-
if (i >= 0) {
|
|
54323
|
-
k = POW_PRECISION;
|
|
54324
|
-
POW_PRECISION = 0;
|
|
54325
|
-
str = str.replace(".", "");
|
|
54326
|
-
y = new BigNumber3(baseIn);
|
|
54327
|
-
x = y.pow(str.length - i);
|
|
54328
|
-
POW_PRECISION = k;
|
|
54329
|
-
y.c = toBaseOut(
|
|
54330
|
-
toFixedPoint(coeffToString(x.c), x.e, "0"),
|
|
54331
|
-
10,
|
|
54332
|
-
baseOut,
|
|
54333
|
-
decimal
|
|
54334
|
-
);
|
|
54335
|
-
y.e = y.c.length;
|
|
54336
|
-
}
|
|
54337
|
-
xc = toBaseOut(str, baseIn, baseOut, callerIsToString ? (alphabet = ALPHABET, decimal) : (alphabet = decimal, ALPHABET));
|
|
54338
|
-
e = k = xc.length;
|
|
54339
|
-
for (; xc[--k] == 0; xc.pop()) ;
|
|
54340
|
-
if (!xc[0]) return alphabet.charAt(0);
|
|
54341
|
-
if (i < 0) {
|
|
54342
|
-
--e;
|
|
54343
|
-
} else {
|
|
54344
|
-
x.c = xc;
|
|
54345
|
-
x.e = e;
|
|
54346
|
-
x.s = sign;
|
|
54347
|
-
x = div(x, y, dp, rm, baseOut);
|
|
54348
|
-
xc = x.c;
|
|
54349
|
-
r = x.r;
|
|
54350
|
-
e = x.e;
|
|
54351
|
-
}
|
|
54352
|
-
d = e + dp + 1;
|
|
54353
|
-
i = xc[d];
|
|
54354
|
-
k = baseOut / 2;
|
|
54355
|
-
r = r || d < 0 || xc[d + 1] != null;
|
|
54356
|
-
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));
|
|
54357
|
-
if (d < 1 || !xc[0]) {
|
|
54358
|
-
str = r ? toFixedPoint(alphabet.charAt(1), -dp, alphabet.charAt(0)) : alphabet.charAt(0);
|
|
54359
|
-
} else {
|
|
54360
|
-
xc.length = d;
|
|
54361
|
-
if (r) {
|
|
54362
|
-
for (--baseOut; ++xc[--d] > baseOut; ) {
|
|
54363
|
-
xc[d] = 0;
|
|
54364
|
-
if (!d) {
|
|
54365
|
-
++e;
|
|
54366
|
-
xc = [1].concat(xc);
|
|
54367
|
-
}
|
|
54368
|
-
}
|
|
54369
|
-
}
|
|
54370
|
-
for (k = xc.length; !xc[--k]; ) ;
|
|
54371
|
-
for (i = 0, str = ""; i <= k; str += alphabet.charAt(xc[i++])) ;
|
|
54372
|
-
str = toFixedPoint(str, e, alphabet.charAt(0));
|
|
54373
|
-
}
|
|
54374
|
-
return str;
|
|
54375
|
-
};
|
|
54376
|
-
})();
|
|
54377
|
-
div = /* @__PURE__ */ (function() {
|
|
54378
|
-
function multiply(x, k, base) {
|
|
54379
|
-
var m, temp, xlo, xhi, carry = 0, i = x.length, klo = k % SQRT_BASE, khi = k / SQRT_BASE | 0;
|
|
54380
|
-
for (x = x.slice(); i--; ) {
|
|
54381
|
-
xlo = x[i] % SQRT_BASE;
|
|
54382
|
-
xhi = x[i] / SQRT_BASE | 0;
|
|
54383
|
-
m = khi * xlo + xhi * klo;
|
|
54384
|
-
temp = klo * xlo + m % SQRT_BASE * SQRT_BASE + carry;
|
|
54385
|
-
carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi;
|
|
54386
|
-
x[i] = temp % base;
|
|
54387
|
-
}
|
|
54388
|
-
if (carry) x = [carry].concat(x);
|
|
54389
|
-
return x;
|
|
54390
|
-
}
|
|
54391
|
-
function compare2(a, b, aL, bL) {
|
|
54392
|
-
var i, cmp;
|
|
54393
|
-
if (aL != bL) {
|
|
54394
|
-
cmp = aL > bL ? 1 : -1;
|
|
54395
|
-
} else {
|
|
54396
|
-
for (i = cmp = 0; i < aL; i++) {
|
|
54397
|
-
if (a[i] != b[i]) {
|
|
54398
|
-
cmp = a[i] > b[i] ? 1 : -1;
|
|
54399
|
-
break;
|
|
54400
|
-
}
|
|
54401
|
-
}
|
|
54402
|
-
}
|
|
54403
|
-
return cmp;
|
|
54404
|
-
}
|
|
54405
|
-
function subtract(a, b, aL, base) {
|
|
54406
|
-
var i = 0;
|
|
54407
|
-
for (; aL--; ) {
|
|
54408
|
-
a[aL] -= i;
|
|
54409
|
-
i = a[aL] < b[aL] ? 1 : 0;
|
|
54410
|
-
a[aL] = i * base + a[aL] - b[aL];
|
|
54411
|
-
}
|
|
54412
|
-
for (; !a[0] && a.length > 1; a.splice(0, 1)) ;
|
|
54413
|
-
}
|
|
54414
|
-
return function(x, y, dp, rm, base) {
|
|
54415
|
-
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;
|
|
54416
|
-
if (!xc || !xc[0] || !yc || !yc[0]) {
|
|
54417
|
-
return new BigNumber3(
|
|
54418
|
-
// Return NaN if either NaN, or both Infinity or 0.
|
|
54419
|
-
!x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : (
|
|
54420
|
-
// Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
|
|
54421
|
-
xc && xc[0] == 0 || !yc ? s * 0 : s / 0
|
|
54422
|
-
)
|
|
54423
|
-
);
|
|
54424
|
-
}
|
|
54425
|
-
q = new BigNumber3(s);
|
|
54426
|
-
qc = q.c = [];
|
|
54427
|
-
e = x.e - y.e;
|
|
54428
|
-
s = dp + e + 1;
|
|
54429
|
-
if (!base) {
|
|
54430
|
-
base = BASE;
|
|
54431
|
-
e = bitFloor(x.e / LOG_BASE) - bitFloor(y.e / LOG_BASE);
|
|
54432
|
-
s = s / LOG_BASE | 0;
|
|
54433
|
-
}
|
|
54434
|
-
for (i = 0; yc[i] == (xc[i] || 0); i++) ;
|
|
54435
|
-
if (yc[i] > (xc[i] || 0)) e--;
|
|
54436
|
-
if (s < 0) {
|
|
54437
|
-
qc.push(1);
|
|
54438
|
-
more = true;
|
|
54439
|
-
} else {
|
|
54440
|
-
xL = xc.length;
|
|
54441
|
-
yL = yc.length;
|
|
54442
|
-
i = 0;
|
|
54443
|
-
s += 2;
|
|
54444
|
-
n = mathfloor(base / (yc[0] + 1));
|
|
54445
|
-
if (n > 1) {
|
|
54446
|
-
yc = multiply(yc, n, base);
|
|
54447
|
-
xc = multiply(xc, n, base);
|
|
54448
|
-
yL = yc.length;
|
|
54449
|
-
xL = xc.length;
|
|
54450
|
-
}
|
|
54451
|
-
xi = yL;
|
|
54452
|
-
rem = xc.slice(0, yL);
|
|
54453
|
-
remL = rem.length;
|
|
54454
|
-
for (; remL < yL; rem[remL++] = 0) ;
|
|
54455
|
-
yz = yc.slice();
|
|
54456
|
-
yz = [0].concat(yz);
|
|
54457
|
-
yc0 = yc[0];
|
|
54458
|
-
if (yc[1] >= base / 2) yc0++;
|
|
54459
|
-
do {
|
|
54460
|
-
n = 0;
|
|
54461
|
-
cmp = compare2(yc, rem, yL, remL);
|
|
54462
|
-
if (cmp < 0) {
|
|
54463
|
-
rem0 = rem[0];
|
|
54464
|
-
if (yL != remL) rem0 = rem0 * base + (rem[1] || 0);
|
|
54465
|
-
n = mathfloor(rem0 / yc0);
|
|
54466
|
-
if (n > 1) {
|
|
54467
|
-
if (n >= base) n = base - 1;
|
|
54468
|
-
prod = multiply(yc, n, base);
|
|
54469
|
-
prodL = prod.length;
|
|
54470
|
-
remL = rem.length;
|
|
54471
|
-
while (compare2(prod, rem, prodL, remL) == 1) {
|
|
54472
|
-
n--;
|
|
54473
|
-
subtract(prod, yL < prodL ? yz : yc, prodL, base);
|
|
54474
|
-
prodL = prod.length;
|
|
54475
|
-
cmp = 1;
|
|
54476
|
-
}
|
|
54477
|
-
} else {
|
|
54478
|
-
if (n == 0) {
|
|
54479
|
-
cmp = n = 1;
|
|
54480
|
-
}
|
|
54481
|
-
prod = yc.slice();
|
|
54482
|
-
prodL = prod.length;
|
|
54483
|
-
}
|
|
54484
|
-
if (prodL < remL) prod = [0].concat(prod);
|
|
54485
|
-
subtract(rem, prod, remL, base);
|
|
54486
|
-
remL = rem.length;
|
|
54487
|
-
if (cmp == -1) {
|
|
54488
|
-
while (compare2(yc, rem, yL, remL) < 1) {
|
|
54489
|
-
n++;
|
|
54490
|
-
subtract(rem, yL < remL ? yz : yc, remL, base);
|
|
54491
|
-
remL = rem.length;
|
|
54492
|
-
}
|
|
54493
|
-
}
|
|
54494
|
-
} else if (cmp === 0) {
|
|
54495
|
-
n++;
|
|
54496
|
-
rem = [0];
|
|
54497
|
-
}
|
|
54498
|
-
qc[i++] = n;
|
|
54499
|
-
if (rem[0]) {
|
|
54500
|
-
rem[remL++] = xc[xi] || 0;
|
|
54501
|
-
} else {
|
|
54502
|
-
rem = [xc[xi]];
|
|
54503
|
-
remL = 1;
|
|
54504
|
-
}
|
|
54505
|
-
} while ((xi++ < xL || rem[0] != null) && s--);
|
|
54506
|
-
more = rem[0] != null;
|
|
54507
|
-
if (!qc[0]) qc.splice(0, 1);
|
|
54508
|
-
}
|
|
54509
|
-
if (base == BASE) {
|
|
54510
|
-
for (i = 1, s = qc[0]; s >= 10; s /= 10, i++) ;
|
|
54511
|
-
round(q, dp + (q.e = i + e * LOG_BASE - 1) + 1, rm, more);
|
|
54512
|
-
} else {
|
|
54513
|
-
q.e = e;
|
|
54514
|
-
q.r = +more;
|
|
54515
|
-
}
|
|
54516
|
-
return q;
|
|
54517
|
-
};
|
|
54518
|
-
})();
|
|
54519
|
-
function format(n, i, rm, id) {
|
|
54520
|
-
var c0, e, ne, len, str;
|
|
54521
|
-
if (rm == null) rm = ROUNDING_MODE;
|
|
54522
|
-
else intCheck(rm, 0, 8);
|
|
54523
|
-
if (!n.c) return n.toString();
|
|
54524
|
-
c0 = n.c[0];
|
|
54525
|
-
ne = n.e;
|
|
54526
|
-
if (i == null) {
|
|
54527
|
-
str = coeffToString(n.c);
|
|
54528
|
-
str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS) ? toExponential(str, ne) : toFixedPoint(str, ne, "0");
|
|
54529
|
-
} else {
|
|
54530
|
-
n = round(new BigNumber3(n), i, rm);
|
|
54531
|
-
e = n.e;
|
|
54532
|
-
str = coeffToString(n.c);
|
|
54533
|
-
len = str.length;
|
|
54534
|
-
if (id == 1 || id == 2 && (i <= e || e <= TO_EXP_NEG)) {
|
|
54535
|
-
for (; len < i; str += "0", len++) ;
|
|
54536
|
-
str = toExponential(str, e);
|
|
54537
|
-
} else {
|
|
54538
|
-
i -= ne + (id === 2 && e > ne);
|
|
54539
|
-
str = toFixedPoint(str, e, "0");
|
|
54540
|
-
if (e + 1 > len) {
|
|
54541
|
-
if (--i > 0) for (str += "."; i--; str += "0") ;
|
|
54542
|
-
} else {
|
|
54543
|
-
i += e - len;
|
|
54544
|
-
if (i > 0) {
|
|
54545
|
-
if (e + 1 == len) str += ".";
|
|
54546
|
-
for (; i--; str += "0") ;
|
|
54547
|
-
}
|
|
54548
|
-
}
|
|
54549
|
-
}
|
|
54550
|
-
}
|
|
54551
|
-
return n.s < 0 && c0 ? "-" + str : str;
|
|
54552
|
-
}
|
|
54553
|
-
function maxOrMin(args, n) {
|
|
54554
|
-
var k, y, i = 1, x = new BigNumber3(args[0]);
|
|
54555
|
-
for (; i < args.length; i++) {
|
|
54556
|
-
y = new BigNumber3(args[i]);
|
|
54557
|
-
if (!y.s || (k = compare(x, y)) === n || k === 0 && x.s === n) {
|
|
54558
|
-
x = y;
|
|
54559
|
-
}
|
|
54560
|
-
}
|
|
54561
|
-
return x;
|
|
54562
|
-
}
|
|
54563
|
-
function normalise(n, c, e) {
|
|
54564
|
-
var i = 1, j = c.length;
|
|
54565
|
-
for (; !c[--j]; c.pop()) ;
|
|
54566
|
-
for (j = c[0]; j >= 10; j /= 10, i++) ;
|
|
54567
|
-
if ((e = i + e * LOG_BASE - 1) > MAX_EXP) {
|
|
54568
|
-
n.c = n.e = null;
|
|
54569
|
-
} else if (e < MIN_EXP) {
|
|
54570
|
-
n.c = [n.e = 0];
|
|
54571
|
-
} else {
|
|
54572
|
-
n.e = e;
|
|
54573
|
-
n.c = c;
|
|
54574
|
-
}
|
|
54575
|
-
return n;
|
|
54576
|
-
}
|
|
54577
|
-
parseNumeric = /* @__PURE__ */ (function() {
|
|
54578
|
-
var basePrefix = /^(-?)0([xbo])(?=\w[\w.]*$)/i, dotAfter = /^([^.]+)\.$/, dotBefore = /^\.([^.]+)$/, isInfinityOrNaN = /^-?(Infinity|NaN)$/, whitespaceOrPlus = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
|
|
54579
|
-
return function(x, str, isNum, b) {
|
|
54580
|
-
var base, s = isNum ? str : str.replace(whitespaceOrPlus, "");
|
|
54581
|
-
if (isInfinityOrNaN.test(s)) {
|
|
54582
|
-
x.s = isNaN(s) ? null : s < 0 ? -1 : 1;
|
|
54583
|
-
} else {
|
|
54584
|
-
if (!isNum) {
|
|
54585
|
-
s = s.replace(basePrefix, function(m, p1, p2) {
|
|
54586
|
-
base = (p2 = p2.toLowerCase()) == "x" ? 16 : p2 == "b" ? 2 : 8;
|
|
54587
|
-
return !b || b == base ? p1 : m;
|
|
54588
|
-
});
|
|
54589
|
-
if (b) {
|
|
54590
|
-
base = b;
|
|
54591
|
-
s = s.replace(dotAfter, "$1").replace(dotBefore, "0.$1");
|
|
54592
|
-
}
|
|
54593
|
-
if (str != s) return new BigNumber3(s, base);
|
|
54594
|
-
}
|
|
54595
|
-
if (BigNumber3.DEBUG) {
|
|
54596
|
-
throw Error(bignumberError + "Not a" + (b ? " base " + b : "") + " number: " + str);
|
|
54597
|
-
}
|
|
54598
|
-
x.s = null;
|
|
54599
|
-
}
|
|
54600
|
-
x.c = x.e = null;
|
|
54601
|
-
};
|
|
54602
|
-
})();
|
|
54603
|
-
function round(x, sd, rm, r) {
|
|
54604
|
-
var d, i, j, k, n, ni, rd, xc = x.c, pows10 = POWS_TEN;
|
|
54605
|
-
if (xc) {
|
|
54606
|
-
out: {
|
|
54607
|
-
for (d = 1, k = xc[0]; k >= 10; k /= 10, d++) ;
|
|
54608
|
-
i = sd - d;
|
|
54609
|
-
if (i < 0) {
|
|
54610
|
-
i += LOG_BASE;
|
|
54611
|
-
j = sd;
|
|
54612
|
-
n = xc[ni = 0];
|
|
54613
|
-
rd = mathfloor(n / pows10[d - j - 1] % 10);
|
|
54614
|
-
} else {
|
|
54615
|
-
ni = mathceil((i + 1) / LOG_BASE);
|
|
54616
|
-
if (ni >= xc.length) {
|
|
54617
|
-
if (r) {
|
|
54618
|
-
for (; xc.length <= ni; xc.push(0)) ;
|
|
54619
|
-
n = rd = 0;
|
|
54620
|
-
d = 1;
|
|
54621
|
-
i %= LOG_BASE;
|
|
54622
|
-
j = i - LOG_BASE + 1;
|
|
54623
|
-
} else {
|
|
54624
|
-
break out;
|
|
54625
|
-
}
|
|
54626
|
-
} else {
|
|
54627
|
-
n = k = xc[ni];
|
|
54628
|
-
for (d = 1; k >= 10; k /= 10, d++) ;
|
|
54629
|
-
i %= LOG_BASE;
|
|
54630
|
-
j = i - LOG_BASE + d;
|
|
54631
|
-
rd = j < 0 ? 0 : mathfloor(n / pows10[d - j - 1] % 10);
|
|
54632
|
-
}
|
|
54633
|
-
}
|
|
54634
|
-
r = r || sd < 0 || // Are there any non-zero digits after the rounding digit?
|
|
54635
|
-
// The expression n % pows10[d - j - 1] returns all digits of n to the right
|
|
54636
|
-
// of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.
|
|
54637
|
-
xc[ni + 1] != null || (j < 0 ? n : n % pows10[d - j - 1]);
|
|
54638
|
-
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.
|
|
54639
|
-
(i > 0 ? j > 0 ? n / pows10[d - j] : 0 : xc[ni - 1]) % 10 & 1 || rm == (x.s < 0 ? 8 : 7));
|
|
54640
|
-
if (sd < 1 || !xc[0]) {
|
|
54641
|
-
xc.length = 0;
|
|
54642
|
-
if (r) {
|
|
54643
|
-
sd -= x.e + 1;
|
|
54644
|
-
xc[0] = pows10[(LOG_BASE - sd % LOG_BASE) % LOG_BASE];
|
|
54645
|
-
x.e = -sd || 0;
|
|
54646
|
-
} else {
|
|
54647
|
-
xc[0] = x.e = 0;
|
|
54648
|
-
}
|
|
54649
|
-
return x;
|
|
54650
|
-
}
|
|
54651
|
-
if (i == 0) {
|
|
54652
|
-
xc.length = ni;
|
|
54653
|
-
k = 1;
|
|
54654
|
-
ni--;
|
|
54655
|
-
} else {
|
|
54656
|
-
xc.length = ni + 1;
|
|
54657
|
-
k = pows10[LOG_BASE - i];
|
|
54658
|
-
xc[ni] = j > 0 ? mathfloor(n / pows10[d - j] % pows10[j]) * k : 0;
|
|
54659
|
-
}
|
|
54660
|
-
if (r) {
|
|
54661
|
-
for (; ; ) {
|
|
54662
|
-
if (ni == 0) {
|
|
54663
|
-
for (i = 1, j = xc[0]; j >= 10; j /= 10, i++) ;
|
|
54664
|
-
j = xc[0] += k;
|
|
54665
|
-
for (k = 1; j >= 10; j /= 10, k++) ;
|
|
54666
|
-
if (i != k) {
|
|
54667
|
-
x.e++;
|
|
54668
|
-
if (xc[0] == BASE) xc[0] = 1;
|
|
54669
|
-
}
|
|
54670
|
-
break;
|
|
54671
|
-
} else {
|
|
54672
|
-
xc[ni] += k;
|
|
54673
|
-
if (xc[ni] != BASE) break;
|
|
54674
|
-
xc[ni--] = 0;
|
|
54675
|
-
k = 1;
|
|
54676
|
-
}
|
|
54677
|
-
}
|
|
54678
|
-
}
|
|
54679
|
-
for (i = xc.length; xc[--i] === 0; xc.pop()) ;
|
|
54680
|
-
}
|
|
54681
|
-
if (x.e > MAX_EXP) {
|
|
54682
|
-
x.c = x.e = null;
|
|
54683
|
-
} else if (x.e < MIN_EXP) {
|
|
54684
|
-
x.c = [x.e = 0];
|
|
54685
|
-
}
|
|
54686
|
-
}
|
|
54687
|
-
return x;
|
|
54688
|
-
}
|
|
54689
|
-
function valueOf(n) {
|
|
54690
|
-
var str, e = n.e;
|
|
54691
|
-
if (e === null) return n.toString();
|
|
54692
|
-
str = coeffToString(n.c);
|
|
54693
|
-
str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(str, e) : toFixedPoint(str, e, "0");
|
|
54694
|
-
return n.s < 0 ? "-" + str : str;
|
|
54695
|
-
}
|
|
54696
|
-
P.absoluteValue = P.abs = function() {
|
|
54697
|
-
var x = new BigNumber3(this);
|
|
54698
|
-
if (x.s < 0) x.s = 1;
|
|
54699
|
-
return x;
|
|
54700
|
-
};
|
|
54701
|
-
P.comparedTo = function(y, b) {
|
|
54702
|
-
return compare(this, new BigNumber3(y, b));
|
|
54703
|
-
};
|
|
54704
|
-
P.decimalPlaces = P.dp = function(dp, rm) {
|
|
54705
|
-
var c, n, v, x = this;
|
|
54706
|
-
if (dp != null) {
|
|
54707
|
-
intCheck(dp, 0, MAX);
|
|
54708
|
-
if (rm == null) rm = ROUNDING_MODE;
|
|
54709
|
-
else intCheck(rm, 0, 8);
|
|
54710
|
-
return round(new BigNumber3(x), dp + x.e + 1, rm);
|
|
54711
|
-
}
|
|
54712
|
-
if (!(c = x.c)) return null;
|
|
54713
|
-
n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE;
|
|
54714
|
-
if (v = c[v]) for (; v % 10 == 0; v /= 10, n--) ;
|
|
54715
|
-
if (n < 0) n = 0;
|
|
54716
|
-
return n;
|
|
54717
|
-
};
|
|
54718
|
-
P.dividedBy = P.div = function(y, b) {
|
|
54719
|
-
return div(this, new BigNumber3(y, b), DECIMAL_PLACES, ROUNDING_MODE);
|
|
54720
|
-
};
|
|
54721
|
-
P.dividedToIntegerBy = P.idiv = function(y, b) {
|
|
54722
|
-
return div(this, new BigNumber3(y, b), 0, 1);
|
|
54723
|
-
};
|
|
54724
|
-
P.exponentiatedBy = P.pow = function(n, m) {
|
|
54725
|
-
var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y, x = this;
|
|
54726
|
-
n = new BigNumber3(n);
|
|
54727
|
-
if (n.c && !n.isInteger()) {
|
|
54728
|
-
throw Error(bignumberError + "Exponent not an integer: " + valueOf(n));
|
|
54729
|
-
}
|
|
54730
|
-
if (m != null) m = new BigNumber3(m);
|
|
54731
|
-
nIsBig = n.e > 14;
|
|
54732
|
-
if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) {
|
|
54733
|
-
y = new BigNumber3(Math.pow(+valueOf(x), nIsBig ? n.s * (2 - isOdd(n)) : +valueOf(n)));
|
|
54734
|
-
return m ? y.mod(m) : y;
|
|
54735
|
-
}
|
|
54736
|
-
nIsNeg = n.s < 0;
|
|
54737
|
-
if (m) {
|
|
54738
|
-
if (m.c ? !m.c[0] : !m.s) return new BigNumber3(NaN);
|
|
54739
|
-
isModExp = !nIsNeg && x.isInteger() && m.isInteger();
|
|
54740
|
-
if (isModExp) x = x.mod(m);
|
|
54741
|
-
} 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))) {
|
|
54742
|
-
k = x.s < 0 && isOdd(n) ? -0 : 0;
|
|
54743
|
-
if (x.e > -1) k = 1 / k;
|
|
54744
|
-
return new BigNumber3(nIsNeg ? 1 / k : k);
|
|
54745
|
-
} else if (POW_PRECISION) {
|
|
54746
|
-
k = mathceil(POW_PRECISION / LOG_BASE + 2);
|
|
54747
|
-
}
|
|
54748
|
-
if (nIsBig) {
|
|
54749
|
-
half = new BigNumber3(0.5);
|
|
54750
|
-
if (nIsNeg) n.s = 1;
|
|
54751
|
-
nIsOdd = isOdd(n);
|
|
54752
|
-
} else {
|
|
54753
|
-
i = Math.abs(+valueOf(n));
|
|
54754
|
-
nIsOdd = i % 2;
|
|
54755
|
-
}
|
|
54756
|
-
y = new BigNumber3(ONE);
|
|
54757
|
-
for (; ; ) {
|
|
54758
|
-
if (nIsOdd) {
|
|
54759
|
-
y = y.times(x);
|
|
54760
|
-
if (!y.c) break;
|
|
54761
|
-
if (k) {
|
|
54762
|
-
if (y.c.length > k) y.c.length = k;
|
|
54763
|
-
} else if (isModExp) {
|
|
54764
|
-
y = y.mod(m);
|
|
54765
|
-
}
|
|
54766
|
-
}
|
|
54767
|
-
if (i) {
|
|
54768
|
-
i = mathfloor(i / 2);
|
|
54769
|
-
if (i === 0) break;
|
|
54770
|
-
nIsOdd = i % 2;
|
|
54771
|
-
} else {
|
|
54772
|
-
n = n.times(half);
|
|
54773
|
-
round(n, n.e + 1, 1);
|
|
54774
|
-
if (n.e > 14) {
|
|
54775
|
-
nIsOdd = isOdd(n);
|
|
54776
|
-
} else {
|
|
54777
|
-
i = +valueOf(n);
|
|
54778
|
-
if (i === 0) break;
|
|
54779
|
-
nIsOdd = i % 2;
|
|
54780
|
-
}
|
|
54781
|
-
}
|
|
54782
|
-
x = x.times(x);
|
|
54783
|
-
if (k) {
|
|
54784
|
-
if (x.c && x.c.length > k) x.c.length = k;
|
|
54785
|
-
} else if (isModExp) {
|
|
54786
|
-
x = x.mod(m);
|
|
54787
|
-
}
|
|
54788
|
-
}
|
|
54789
|
-
if (isModExp) return y;
|
|
54790
|
-
if (nIsNeg) y = ONE.div(y);
|
|
54791
|
-
return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y;
|
|
54792
|
-
};
|
|
54793
|
-
P.integerValue = function(rm) {
|
|
54794
|
-
var n = new BigNumber3(this);
|
|
54795
|
-
if (rm == null) rm = ROUNDING_MODE;
|
|
54796
|
-
else intCheck(rm, 0, 8);
|
|
54797
|
-
return round(n, n.e + 1, rm);
|
|
54798
|
-
};
|
|
54799
|
-
P.isEqualTo = P.eq = function(y, b) {
|
|
54800
|
-
return compare(this, new BigNumber3(y, b)) === 0;
|
|
54801
|
-
};
|
|
54802
|
-
P.isFinite = function() {
|
|
54803
|
-
return !!this.c;
|
|
54804
|
-
};
|
|
54805
|
-
P.isGreaterThan = P.gt = function(y, b) {
|
|
54806
|
-
return compare(this, new BigNumber3(y, b)) > 0;
|
|
54807
|
-
};
|
|
54808
|
-
P.isGreaterThanOrEqualTo = P.gte = function(y, b) {
|
|
54809
|
-
return (b = compare(this, new BigNumber3(y, b))) === 1 || b === 0;
|
|
54810
|
-
};
|
|
54811
|
-
P.isInteger = function() {
|
|
54812
|
-
return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2;
|
|
54813
|
-
};
|
|
54814
|
-
P.isLessThan = P.lt = function(y, b) {
|
|
54815
|
-
return compare(this, new BigNumber3(y, b)) < 0;
|
|
54816
|
-
};
|
|
54817
|
-
P.isLessThanOrEqualTo = P.lte = function(y, b) {
|
|
54818
|
-
return (b = compare(this, new BigNumber3(y, b))) === -1 || b === 0;
|
|
54819
|
-
};
|
|
54820
|
-
P.isNaN = function() {
|
|
54821
|
-
return !this.s;
|
|
54822
|
-
};
|
|
54823
|
-
P.isNegative = function() {
|
|
54824
|
-
return this.s < 0;
|
|
54825
|
-
};
|
|
54826
|
-
P.isPositive = function() {
|
|
54827
|
-
return this.s > 0;
|
|
54828
|
-
};
|
|
54829
|
-
P.isZero = function() {
|
|
54830
|
-
return !!this.c && this.c[0] == 0;
|
|
54831
|
-
};
|
|
54832
|
-
P.minus = function(y, b) {
|
|
54833
|
-
var i, j, t, xLTy, x = this, a = x.s;
|
|
54834
|
-
y = new BigNumber3(y, b);
|
|
54835
|
-
b = y.s;
|
|
54836
|
-
if (!a || !b) return new BigNumber3(NaN);
|
|
54837
|
-
if (a != b) {
|
|
54838
|
-
y.s = -b;
|
|
54839
|
-
return x.plus(y);
|
|
54840
|
-
}
|
|
54841
|
-
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
54842
|
-
if (!xe || !ye) {
|
|
54843
|
-
if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber3(yc ? x : NaN);
|
|
54844
|
-
if (!xc[0] || !yc[0]) {
|
|
54845
|
-
return yc[0] ? (y.s = -b, y) : new BigNumber3(xc[0] ? x : (
|
|
54846
|
-
// IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
|
|
54847
|
-
ROUNDING_MODE == 3 ? -0 : 0
|
|
54848
|
-
));
|
|
54849
|
-
}
|
|
54850
|
-
}
|
|
54851
|
-
xe = bitFloor(xe);
|
|
54852
|
-
ye = bitFloor(ye);
|
|
54853
|
-
xc = xc.slice();
|
|
54854
|
-
if (a = xe - ye) {
|
|
54855
|
-
if (xLTy = a < 0) {
|
|
54856
|
-
a = -a;
|
|
54857
|
-
t = xc;
|
|
54858
|
-
} else {
|
|
54859
|
-
ye = xe;
|
|
54860
|
-
t = yc;
|
|
54861
|
-
}
|
|
54862
|
-
t.reverse();
|
|
54863
|
-
for (b = a; b--; t.push(0)) ;
|
|
54864
|
-
t.reverse();
|
|
54865
|
-
} else {
|
|
54866
|
-
j = (xLTy = (a = xc.length) < (b = yc.length)) ? a : b;
|
|
54867
|
-
for (a = b = 0; b < j; b++) {
|
|
54868
|
-
if (xc[b] != yc[b]) {
|
|
54869
|
-
xLTy = xc[b] < yc[b];
|
|
54870
|
-
break;
|
|
54871
|
-
}
|
|
54872
|
-
}
|
|
54873
|
-
}
|
|
54874
|
-
if (xLTy) {
|
|
54875
|
-
t = xc;
|
|
54876
|
-
xc = yc;
|
|
54877
|
-
yc = t;
|
|
54878
|
-
y.s = -y.s;
|
|
54879
|
-
}
|
|
54880
|
-
b = (j = yc.length) - (i = xc.length);
|
|
54881
|
-
if (b > 0) for (; b--; xc[i++] = 0) ;
|
|
54882
|
-
b = BASE - 1;
|
|
54883
|
-
for (; j > a; ) {
|
|
54884
|
-
if (xc[--j] < yc[j]) {
|
|
54885
|
-
for (i = j; i && !xc[--i]; xc[i] = b) ;
|
|
54886
|
-
--xc[i];
|
|
54887
|
-
xc[j] += BASE;
|
|
54888
|
-
}
|
|
54889
|
-
xc[j] -= yc[j];
|
|
54890
|
-
}
|
|
54891
|
-
for (; xc[0] == 0; xc.splice(0, 1), --ye) ;
|
|
54892
|
-
if (!xc[0]) {
|
|
54893
|
-
y.s = ROUNDING_MODE == 3 ? -1 : 1;
|
|
54894
|
-
y.c = [y.e = 0];
|
|
54895
|
-
return y;
|
|
54896
|
-
}
|
|
54897
|
-
return normalise(y, xc, ye);
|
|
54898
|
-
};
|
|
54899
|
-
P.modulo = P.mod = function(y, b) {
|
|
54900
|
-
var q, s, x = this;
|
|
54901
|
-
y = new BigNumber3(y, b);
|
|
54902
|
-
if (!x.c || !y.s || y.c && !y.c[0]) {
|
|
54903
|
-
return new BigNumber3(NaN);
|
|
54904
|
-
} else if (!y.c || x.c && !x.c[0]) {
|
|
54905
|
-
return new BigNumber3(x);
|
|
54906
|
-
}
|
|
54907
|
-
if (MODULO_MODE == 9) {
|
|
54908
|
-
s = y.s;
|
|
54909
|
-
y.s = 1;
|
|
54910
|
-
q = div(x, y, 0, 3);
|
|
54911
|
-
y.s = s;
|
|
54912
|
-
q.s *= s;
|
|
54913
|
-
} else {
|
|
54914
|
-
q = div(x, y, 0, MODULO_MODE);
|
|
54915
|
-
}
|
|
54916
|
-
y = x.minus(q.times(y));
|
|
54917
|
-
if (!y.c[0] && MODULO_MODE == 1) y.s = x.s;
|
|
54918
|
-
return y;
|
|
54919
|
-
};
|
|
54920
|
-
P.multipliedBy = P.times = function(y, b) {
|
|
54921
|
-
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;
|
|
54922
|
-
if (!xc || !yc || !xc[0] || !yc[0]) {
|
|
54923
|
-
if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) {
|
|
54924
|
-
y.c = y.e = y.s = null;
|
|
54925
|
-
} else {
|
|
54926
|
-
y.s *= x.s;
|
|
54927
|
-
if (!xc || !yc) {
|
|
54928
|
-
y.c = y.e = null;
|
|
54929
|
-
} else {
|
|
54930
|
-
y.c = [0];
|
|
54931
|
-
y.e = 0;
|
|
54932
|
-
}
|
|
54933
|
-
}
|
|
54934
|
-
return y;
|
|
54935
|
-
}
|
|
54936
|
-
e = bitFloor(x.e / LOG_BASE) + bitFloor(y.e / LOG_BASE);
|
|
54937
|
-
y.s *= x.s;
|
|
54938
|
-
xcL = xc.length;
|
|
54939
|
-
ycL = yc.length;
|
|
54940
|
-
if (xcL < ycL) {
|
|
54941
|
-
zc = xc;
|
|
54942
|
-
xc = yc;
|
|
54943
|
-
yc = zc;
|
|
54944
|
-
i = xcL;
|
|
54945
|
-
xcL = ycL;
|
|
54946
|
-
ycL = i;
|
|
54947
|
-
}
|
|
54948
|
-
for (i = xcL + ycL, zc = []; i--; zc.push(0)) ;
|
|
54949
|
-
base = BASE;
|
|
54950
|
-
sqrtBase = SQRT_BASE;
|
|
54951
|
-
for (i = ycL; --i >= 0; ) {
|
|
54952
|
-
c = 0;
|
|
54953
|
-
ylo = yc[i] % sqrtBase;
|
|
54954
|
-
yhi = yc[i] / sqrtBase | 0;
|
|
54955
|
-
for (k = xcL, j = i + k; j > i; ) {
|
|
54956
|
-
xlo = xc[--k] % sqrtBase;
|
|
54957
|
-
xhi = xc[k] / sqrtBase | 0;
|
|
54958
|
-
m = yhi * xlo + xhi * ylo;
|
|
54959
|
-
xlo = ylo * xlo + m % sqrtBase * sqrtBase + zc[j] + c;
|
|
54960
|
-
c = (xlo / base | 0) + (m / sqrtBase | 0) + yhi * xhi;
|
|
54961
|
-
zc[j--] = xlo % base;
|
|
54962
|
-
}
|
|
54963
|
-
zc[j] = c;
|
|
54964
|
-
}
|
|
54965
|
-
if (c) {
|
|
54966
|
-
++e;
|
|
54967
|
-
} else {
|
|
54968
|
-
zc.splice(0, 1);
|
|
54969
|
-
}
|
|
54970
|
-
return normalise(y, zc, e);
|
|
54971
|
-
};
|
|
54972
|
-
P.negated = function() {
|
|
54973
|
-
var x = new BigNumber3(this);
|
|
54974
|
-
x.s = -x.s || null;
|
|
54975
|
-
return x;
|
|
54976
|
-
};
|
|
54977
|
-
P.plus = function(y, b) {
|
|
54978
|
-
var t, x = this, a = x.s;
|
|
54979
|
-
y = new BigNumber3(y, b);
|
|
54980
|
-
b = y.s;
|
|
54981
|
-
if (!a || !b) return new BigNumber3(NaN);
|
|
54982
|
-
if (a != b) {
|
|
54983
|
-
y.s = -b;
|
|
54984
|
-
return x.minus(y);
|
|
54985
|
-
}
|
|
54986
|
-
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
54987
|
-
if (!xe || !ye) {
|
|
54988
|
-
if (!xc || !yc) return new BigNumber3(a / 0);
|
|
54989
|
-
if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber3(xc[0] ? x : a * 0);
|
|
54990
|
-
}
|
|
54991
|
-
xe = bitFloor(xe);
|
|
54992
|
-
ye = bitFloor(ye);
|
|
54993
|
-
xc = xc.slice();
|
|
54994
|
-
if (a = xe - ye) {
|
|
54995
|
-
if (a > 0) {
|
|
54996
|
-
ye = xe;
|
|
54997
|
-
t = yc;
|
|
54998
|
-
} else {
|
|
54999
|
-
a = -a;
|
|
55000
|
-
t = xc;
|
|
55001
|
-
}
|
|
55002
|
-
t.reverse();
|
|
55003
|
-
for (; a--; t.push(0)) ;
|
|
55004
|
-
t.reverse();
|
|
55005
|
-
}
|
|
55006
|
-
a = xc.length;
|
|
55007
|
-
b = yc.length;
|
|
55008
|
-
if (a - b < 0) {
|
|
55009
|
-
t = yc;
|
|
55010
|
-
yc = xc;
|
|
55011
|
-
xc = t;
|
|
55012
|
-
b = a;
|
|
55013
|
-
}
|
|
55014
|
-
for (a = 0; b; ) {
|
|
55015
|
-
a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0;
|
|
55016
|
-
xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE;
|
|
55017
|
-
}
|
|
55018
|
-
if (a) {
|
|
55019
|
-
xc = [a].concat(xc);
|
|
55020
|
-
++ye;
|
|
55021
|
-
}
|
|
55022
|
-
return normalise(y, xc, ye);
|
|
55023
|
-
};
|
|
55024
|
-
P.precision = P.sd = function(sd, rm) {
|
|
55025
|
-
var c, n, v, x = this;
|
|
55026
|
-
if (sd != null && sd !== !!sd) {
|
|
55027
|
-
intCheck(sd, 1, MAX);
|
|
55028
|
-
if (rm == null) rm = ROUNDING_MODE;
|
|
55029
|
-
else intCheck(rm, 0, 8);
|
|
55030
|
-
return round(new BigNumber3(x), sd, rm);
|
|
55031
|
-
}
|
|
55032
|
-
if (!(c = x.c)) return null;
|
|
55033
|
-
v = c.length - 1;
|
|
55034
|
-
n = v * LOG_BASE + 1;
|
|
55035
|
-
if (v = c[v]) {
|
|
55036
|
-
for (; v % 10 == 0; v /= 10, n--) ;
|
|
55037
|
-
for (v = c[0]; v >= 10; v /= 10, n++) ;
|
|
55038
|
-
}
|
|
55039
|
-
if (sd && x.e + 1 > n) n = x.e + 1;
|
|
55040
|
-
return n;
|
|
55041
|
-
};
|
|
55042
|
-
P.shiftedBy = function(k) {
|
|
55043
|
-
intCheck(k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER);
|
|
55044
|
-
return this.times("1e" + k);
|
|
55045
|
-
};
|
|
55046
|
-
P.squareRoot = P.sqrt = function() {
|
|
55047
|
-
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");
|
|
55048
|
-
if (s !== 1 || !c || !c[0]) {
|
|
55049
|
-
return new BigNumber3(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0);
|
|
55050
|
-
}
|
|
55051
|
-
s = Math.sqrt(+valueOf(x));
|
|
55052
|
-
if (s == 0 || s == 1 / 0) {
|
|
55053
|
-
n = coeffToString(c);
|
|
55054
|
-
if ((n.length + e) % 2 == 0) n += "0";
|
|
55055
|
-
s = Math.sqrt(+n);
|
|
55056
|
-
e = bitFloor((e + 1) / 2) - (e < 0 || e % 2);
|
|
55057
|
-
if (s == 1 / 0) {
|
|
55058
|
-
n = "5e" + e;
|
|
55059
|
-
} else {
|
|
55060
|
-
n = s.toExponential();
|
|
55061
|
-
n = n.slice(0, n.indexOf("e") + 1) + e;
|
|
55062
|
-
}
|
|
55063
|
-
r = new BigNumber3(n);
|
|
55064
|
-
} else {
|
|
55065
|
-
r = new BigNumber3(s + "");
|
|
55066
|
-
}
|
|
55067
|
-
if (r.c[0]) {
|
|
55068
|
-
e = r.e;
|
|
55069
|
-
s = e + dp;
|
|
55070
|
-
if (s < 3) s = 0;
|
|
55071
|
-
for (; ; ) {
|
|
55072
|
-
t = r;
|
|
55073
|
-
r = half.times(t.plus(div(x, t, dp, 1)));
|
|
55074
|
-
if (coeffToString(t.c).slice(0, s) === (n = coeffToString(r.c)).slice(0, s)) {
|
|
55075
|
-
if (r.e < e) --s;
|
|
55076
|
-
n = n.slice(s - 3, s + 1);
|
|
55077
|
-
if (n == "9999" || !rep && n == "4999") {
|
|
55078
|
-
if (!rep) {
|
|
55079
|
-
round(t, t.e + DECIMAL_PLACES + 2, 0);
|
|
55080
|
-
if (t.times(t).eq(x)) {
|
|
55081
|
-
r = t;
|
|
55082
|
-
break;
|
|
55083
|
-
}
|
|
55084
|
-
}
|
|
55085
|
-
dp += 4;
|
|
55086
|
-
s += 4;
|
|
55087
|
-
rep = 1;
|
|
55088
|
-
} else {
|
|
55089
|
-
if (!+n || !+n.slice(1) && n.charAt(0) == "5") {
|
|
55090
|
-
round(r, r.e + DECIMAL_PLACES + 2, 1);
|
|
55091
|
-
m = !r.times(r).eq(x);
|
|
55092
|
-
}
|
|
55093
|
-
break;
|
|
55094
|
-
}
|
|
55095
|
-
}
|
|
55096
|
-
}
|
|
55097
|
-
}
|
|
55098
|
-
return round(r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m);
|
|
55099
|
-
};
|
|
55100
|
-
P.toExponential = function(dp, rm) {
|
|
55101
|
-
if (dp != null) {
|
|
55102
|
-
intCheck(dp, 0, MAX);
|
|
55103
|
-
dp++;
|
|
55104
|
-
}
|
|
55105
|
-
return format(this, dp, rm, 1);
|
|
55106
|
-
};
|
|
55107
|
-
P.toFixed = function(dp, rm) {
|
|
55108
|
-
if (dp != null) {
|
|
55109
|
-
intCheck(dp, 0, MAX);
|
|
55110
|
-
dp = dp + this.e + 1;
|
|
55111
|
-
}
|
|
55112
|
-
return format(this, dp, rm);
|
|
55113
|
-
};
|
|
55114
|
-
P.toFormat = function(dp, rm, format2) {
|
|
55115
|
-
var str, x = this;
|
|
55116
|
-
if (format2 == null) {
|
|
55117
|
-
if (dp != null && rm && typeof rm == "object") {
|
|
55118
|
-
format2 = rm;
|
|
55119
|
-
rm = null;
|
|
55120
|
-
} else if (dp && typeof dp == "object") {
|
|
55121
|
-
format2 = dp;
|
|
55122
|
-
dp = rm = null;
|
|
55123
|
-
} else {
|
|
55124
|
-
format2 = FORMAT;
|
|
55125
|
-
}
|
|
55126
|
-
} else if (typeof format2 != "object") {
|
|
55127
|
-
throw Error(bignumberError + "Argument not an object: " + format2);
|
|
55128
|
-
}
|
|
55129
|
-
str = x.toFixed(dp, rm);
|
|
55130
|
-
if (x.c) {
|
|
55131
|
-
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;
|
|
55132
|
-
if (g2) {
|
|
55133
|
-
i = g1;
|
|
55134
|
-
g1 = g2;
|
|
55135
|
-
g2 = i;
|
|
55136
|
-
len -= i;
|
|
55137
|
-
}
|
|
55138
|
-
if (g1 > 0 && len > 0) {
|
|
55139
|
-
i = len % g1 || g1;
|
|
55140
|
-
intPart = intDigits.substr(0, i);
|
|
55141
|
-
for (; i < len; i += g1) intPart += groupSeparator + intDigits.substr(i, g1);
|
|
55142
|
-
if (g2 > 0) intPart += groupSeparator + intDigits.slice(i);
|
|
55143
|
-
if (isNeg) intPart = "-" + intPart;
|
|
55144
|
-
}
|
|
55145
|
-
str = fractionPart ? intPart + (format2.decimalSeparator || "") + ((g2 = +format2.fractionGroupSize) ? fractionPart.replace(
|
|
55146
|
-
new RegExp("\\d{" + g2 + "}\\B", "g"),
|
|
55147
|
-
"$&" + (format2.fractionGroupSeparator || "")
|
|
55148
|
-
) : fractionPart) : intPart;
|
|
55149
|
-
}
|
|
55150
|
-
return (format2.prefix || "") + str + (format2.suffix || "");
|
|
55151
|
-
};
|
|
55152
|
-
P.toFraction = function(md) {
|
|
55153
|
-
var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s, x = this, xc = x.c;
|
|
55154
|
-
if (md != null) {
|
|
55155
|
-
n = new BigNumber3(md);
|
|
55156
|
-
if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) {
|
|
55157
|
-
throw Error(bignumberError + "Argument " + (n.isInteger() ? "out of range: " : "not an integer: ") + valueOf(n));
|
|
55158
|
-
}
|
|
55159
|
-
}
|
|
55160
|
-
if (!xc) return new BigNumber3(x);
|
|
55161
|
-
d = new BigNumber3(ONE);
|
|
55162
|
-
n1 = d0 = new BigNumber3(ONE);
|
|
55163
|
-
d1 = n0 = new BigNumber3(ONE);
|
|
55164
|
-
s = coeffToString(xc);
|
|
55165
|
-
e = d.e = s.length - x.e - 1;
|
|
55166
|
-
d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp];
|
|
55167
|
-
md = !md || n.comparedTo(d) > 0 ? e > 0 ? d : n1 : n;
|
|
55168
|
-
exp = MAX_EXP;
|
|
55169
|
-
MAX_EXP = 1 / 0;
|
|
55170
|
-
n = new BigNumber3(s);
|
|
55171
|
-
n0.c[0] = 0;
|
|
55172
|
-
for (; ; ) {
|
|
55173
|
-
q = div(n, d, 0, 1);
|
|
55174
|
-
d2 = d0.plus(q.times(d1));
|
|
55175
|
-
if (d2.comparedTo(md) == 1) break;
|
|
55176
|
-
d0 = d1;
|
|
55177
|
-
d1 = d2;
|
|
55178
|
-
n1 = n0.plus(q.times(d2 = n1));
|
|
55179
|
-
n0 = d2;
|
|
55180
|
-
d = n.minus(q.times(d2 = d));
|
|
55181
|
-
n = d2;
|
|
55182
|
-
}
|
|
55183
|
-
d2 = div(md.minus(d0), d1, 0, 1);
|
|
55184
|
-
n0 = n0.plus(d2.times(n1));
|
|
55185
|
-
d0 = d0.plus(d2.times(d1));
|
|
55186
|
-
n0.s = n1.s = x.s;
|
|
55187
|
-
e = e * 2;
|
|
55188
|
-
r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo(
|
|
55189
|
-
div(n0, d0, e, ROUNDING_MODE).minus(x).abs()
|
|
55190
|
-
) < 1 ? [n1, d1] : [n0, d0];
|
|
55191
|
-
MAX_EXP = exp;
|
|
55192
|
-
return r;
|
|
55193
|
-
};
|
|
55194
|
-
P.toNumber = function() {
|
|
55195
|
-
return +valueOf(this);
|
|
55196
|
-
};
|
|
55197
|
-
P.toPrecision = function(sd, rm) {
|
|
55198
|
-
if (sd != null) intCheck(sd, 1, MAX);
|
|
55199
|
-
return format(this, sd, rm, 2);
|
|
55200
|
-
};
|
|
55201
|
-
P.toString = function(b) {
|
|
55202
|
-
var str, n = this, s = n.s, e = n.e;
|
|
55203
|
-
if (e === null) {
|
|
55204
|
-
if (s) {
|
|
55205
|
-
str = "Infinity";
|
|
55206
|
-
if (s < 0) str = "-" + str;
|
|
55207
|
-
} else {
|
|
55208
|
-
str = "NaN";
|
|
55209
|
-
}
|
|
55210
|
-
} else {
|
|
55211
|
-
if (b == null) {
|
|
55212
|
-
str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(coeffToString(n.c), e) : toFixedPoint(coeffToString(n.c), e, "0");
|
|
55213
|
-
} else if (b === 10 && alphabetHasNormalDecimalDigits) {
|
|
55214
|
-
n = round(new BigNumber3(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE);
|
|
55215
|
-
str = toFixedPoint(coeffToString(n.c), n.e, "0");
|
|
55216
|
-
} else {
|
|
55217
|
-
intCheck(b, 2, ALPHABET.length, "Base");
|
|
55218
|
-
str = convertBase(toFixedPoint(coeffToString(n.c), e, "0"), 10, b, s, true);
|
|
55219
|
-
}
|
|
55220
|
-
if (s < 0 && n.c[0]) str = "-" + str;
|
|
55221
|
-
}
|
|
55222
|
-
return str;
|
|
55223
|
-
};
|
|
55224
|
-
P.valueOf = P.toJSON = function() {
|
|
55225
|
-
return valueOf(this);
|
|
55226
|
-
};
|
|
55227
|
-
P._isBigNumber = true;
|
|
55228
|
-
if (configObject != null) BigNumber3.set(configObject);
|
|
55229
|
-
return BigNumber3;
|
|
55230
|
-
}
|
|
55231
|
-
function bitFloor(n) {
|
|
55232
|
-
var i = n | 0;
|
|
55233
|
-
return n > 0 || n === i ? i : i - 1;
|
|
55234
|
-
}
|
|
55235
|
-
function coeffToString(a) {
|
|
55236
|
-
var s, z3, i = 1, j = a.length, r = a[0] + "";
|
|
55237
|
-
for (; i < j; ) {
|
|
55238
|
-
s = a[i++] + "";
|
|
55239
|
-
z3 = LOG_BASE - s.length;
|
|
55240
|
-
for (; z3--; s = "0" + s) ;
|
|
55241
|
-
r += s;
|
|
55242
|
-
}
|
|
55243
|
-
for (j = r.length; r.charCodeAt(--j) === 48; ) ;
|
|
55244
|
-
return r.slice(0, j + 1 || 1);
|
|
55245
|
-
}
|
|
55246
|
-
function compare(x, y) {
|
|
55247
|
-
var a, b, xc = x.c, yc = y.c, i = x.s, j = y.s, k = x.e, l = y.e;
|
|
55248
|
-
if (!i || !j) return null;
|
|
55249
|
-
a = xc && !xc[0];
|
|
55250
|
-
b = yc && !yc[0];
|
|
55251
|
-
if (a || b) return a ? b ? 0 : -j : i;
|
|
55252
|
-
if (i != j) return i;
|
|
55253
|
-
a = i < 0;
|
|
55254
|
-
b = k == l;
|
|
55255
|
-
if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1;
|
|
55256
|
-
if (!b) return k > l ^ a ? 1 : -1;
|
|
55257
|
-
j = (k = xc.length) < (l = yc.length) ? k : l;
|
|
55258
|
-
for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1;
|
|
55259
|
-
return k == l ? 0 : k > l ^ a ? 1 : -1;
|
|
55260
|
-
}
|
|
55261
|
-
function intCheck(n, min, max, name) {
|
|
55262
|
-
if (n < min || n > max || n !== mathfloor(n)) {
|
|
55263
|
-
throw Error(bignumberError + (name || "Argument") + (typeof n == "number" ? n < min || n > max ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(n));
|
|
55264
|
-
}
|
|
55265
|
-
}
|
|
55266
|
-
function isOdd(n) {
|
|
55267
|
-
var k = n.c.length - 1;
|
|
55268
|
-
return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0;
|
|
55269
|
-
}
|
|
55270
|
-
function toExponential(str, e) {
|
|
55271
|
-
return (str.length > 1 ? str.charAt(0) + "." + str.slice(1) : str) + (e < 0 ? "e" : "e+") + e;
|
|
55272
|
-
}
|
|
55273
|
-
function toFixedPoint(str, e, z3) {
|
|
55274
|
-
var len, zs;
|
|
55275
|
-
if (e < 0) {
|
|
55276
|
-
for (zs = z3 + "."; ++e; zs += z3) ;
|
|
55277
|
-
str = zs + str;
|
|
55278
|
-
} else {
|
|
55279
|
-
len = str.length;
|
|
55280
|
-
if (++e > len) {
|
|
55281
|
-
for (zs = z3, e -= len; --e; zs += z3) ;
|
|
55282
|
-
str += zs;
|
|
55283
|
-
} else if (e < len) {
|
|
55284
|
-
str = str.slice(0, e) + "." + str.slice(e);
|
|
55285
|
-
}
|
|
55286
|
-
}
|
|
55287
|
-
return str;
|
|
55288
|
-
}
|
|
55289
|
-
BigNumber2 = clone2();
|
|
55290
|
-
BigNumber2["default"] = BigNumber2.BigNumber = BigNumber2;
|
|
55291
|
-
if (typeof define == "function" && define.amd) {
|
|
55292
|
-
define(function() {
|
|
55293
|
-
return BigNumber2;
|
|
55294
|
-
});
|
|
55295
|
-
} else if (typeof module != "undefined" && module.exports) {
|
|
55296
|
-
module.exports = BigNumber2;
|
|
55297
|
-
} else {
|
|
55298
|
-
if (!globalObject) {
|
|
55299
|
-
globalObject = typeof self != "undefined" && self ? self : window;
|
|
55300
|
-
}
|
|
55301
|
-
globalObject.BigNumber = BigNumber2;
|
|
55302
|
-
}
|
|
55303
|
-
})(exports);
|
|
55304
|
-
}
|
|
55305
|
-
});
|
|
55306
|
-
|
|
55307
|
-
// node_modules/json-bigint/lib/stringify.js
|
|
55308
|
-
var require_stringify = __commonJS({
|
|
55309
|
-
"node_modules/json-bigint/lib/stringify.js"(exports, module) {
|
|
55310
|
-
var BigNumber2 = require_bignumber();
|
|
55311
|
-
var JSON2 = module.exports;
|
|
55312
|
-
(function() {
|
|
55313
|
-
"use strict";
|
|
55314
|
-
function f(n) {
|
|
55315
|
-
return n < 10 ? "0" + n : n;
|
|
55316
|
-
}
|
|
55317
|
-
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 = {
|
|
55318
|
-
// table of character substitutions
|
|
55319
|
-
"\b": "\\b",
|
|
55320
|
-
" ": "\\t",
|
|
55321
|
-
"\n": "\\n",
|
|
55322
|
-
"\f": "\\f",
|
|
55323
|
-
"\r": "\\r",
|
|
55324
|
-
'"': '\\"',
|
|
55325
|
-
"\\": "\\\\"
|
|
55326
|
-
}, rep;
|
|
55327
|
-
function quote(string4) {
|
|
55328
|
-
escapable.lastIndex = 0;
|
|
55329
|
-
return escapable.test(string4) ? '"' + string4.replace(escapable, function(a) {
|
|
55330
|
-
var c = meta3[a];
|
|
55331
|
-
return typeof c === "string" ? c : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
|
|
55332
|
-
}) + '"' : '"' + string4 + '"';
|
|
55333
|
-
}
|
|
55334
|
-
function str(key, holder) {
|
|
55335
|
-
var i, k, v, length, mind = gap, partial2, value = holder[key], isBigNumber2 = value != null && (value instanceof BigNumber2 || BigNumber2.isBigNumber(value));
|
|
55336
|
-
if (value && typeof value === "object" && typeof value.toJSON === "function") {
|
|
55337
|
-
value = value.toJSON(key);
|
|
55338
|
-
}
|
|
55339
|
-
if (typeof rep === "function") {
|
|
55340
|
-
value = rep.call(holder, key, value);
|
|
55341
|
-
}
|
|
55342
|
-
switch (typeof value) {
|
|
55343
|
-
case "string":
|
|
55344
|
-
if (isBigNumber2) {
|
|
55345
|
-
return value;
|
|
55346
|
-
} else {
|
|
55347
|
-
return quote(value);
|
|
55348
|
-
}
|
|
55349
|
-
case "number":
|
|
55350
|
-
return isFinite(value) ? String(value) : "null";
|
|
55351
|
-
case "boolean":
|
|
55352
|
-
case "null":
|
|
55353
|
-
case "bigint":
|
|
55354
|
-
return String(value);
|
|
55355
|
-
// If the type is 'object', we might be dealing with an object or an array or
|
|
55356
|
-
// null.
|
|
55357
|
-
case "object":
|
|
55358
|
-
if (!value) {
|
|
55359
|
-
return "null";
|
|
55360
|
-
}
|
|
55361
|
-
gap += indent;
|
|
55362
|
-
partial2 = [];
|
|
55363
|
-
if (Object.prototype.toString.apply(value) === "[object Array]") {
|
|
55364
|
-
length = value.length;
|
|
55365
|
-
for (i = 0; i < length; i += 1) {
|
|
55366
|
-
partial2[i] = str(i, value) || "null";
|
|
55367
|
-
}
|
|
55368
|
-
v = partial2.length === 0 ? "[]" : gap ? "[\n" + gap + partial2.join(",\n" + gap) + "\n" + mind + "]" : "[" + partial2.join(",") + "]";
|
|
55369
|
-
gap = mind;
|
|
55370
|
-
return v;
|
|
55371
|
-
}
|
|
55372
|
-
if (rep && typeof rep === "object") {
|
|
55373
|
-
length = rep.length;
|
|
55374
|
-
for (i = 0; i < length; i += 1) {
|
|
55375
|
-
if (typeof rep[i] === "string") {
|
|
55376
|
-
k = rep[i];
|
|
55377
|
-
v = str(k, value);
|
|
55378
|
-
if (v) {
|
|
55379
|
-
partial2.push(quote(k) + (gap ? ": " : ":") + v);
|
|
55380
|
-
}
|
|
55381
|
-
}
|
|
55382
|
-
}
|
|
55383
|
-
} else {
|
|
55384
|
-
Object.keys(value).forEach(function(k2) {
|
|
55385
|
-
var v2 = str(k2, value);
|
|
55386
|
-
if (v2) {
|
|
55387
|
-
partial2.push(quote(k2) + (gap ? ": " : ":") + v2);
|
|
55388
|
-
}
|
|
55389
|
-
});
|
|
55390
|
-
}
|
|
55391
|
-
v = partial2.length === 0 ? "{}" : gap ? "{\n" + gap + partial2.join(",\n" + gap) + "\n" + mind + "}" : "{" + partial2.join(",") + "}";
|
|
55392
|
-
gap = mind;
|
|
55393
|
-
return v;
|
|
55394
|
-
}
|
|
55395
|
-
}
|
|
55396
|
-
if (typeof JSON2.stringify !== "function") {
|
|
55397
|
-
JSON2.stringify = function(value, replacer, space) {
|
|
55398
|
-
var i;
|
|
55399
|
-
gap = "";
|
|
55400
|
-
indent = "";
|
|
55401
|
-
if (typeof space === "number") {
|
|
55402
|
-
for (i = 0; i < space; i += 1) {
|
|
55403
|
-
indent += " ";
|
|
55404
|
-
}
|
|
55405
|
-
} else if (typeof space === "string") {
|
|
55406
|
-
indent = space;
|
|
55407
|
-
}
|
|
55408
|
-
rep = replacer;
|
|
55409
|
-
if (replacer && typeof replacer !== "function" && (typeof replacer !== "object" || typeof replacer.length !== "number")) {
|
|
55410
|
-
throw new Error("JSON.stringify");
|
|
55411
|
-
}
|
|
55412
|
-
return str("", { "": value });
|
|
55413
|
-
};
|
|
55414
|
-
}
|
|
55415
|
-
})();
|
|
55416
|
-
}
|
|
55417
|
-
});
|
|
55418
|
-
|
|
55419
|
-
// node_modules/json-bigint/lib/parse.js
|
|
55420
|
-
var require_parse2 = __commonJS({
|
|
55421
|
-
"node_modules/json-bigint/lib/parse.js"(exports, module) {
|
|
55422
|
-
var BigNumber2 = null;
|
|
55423
|
-
var suspectProtoRx = /(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/;
|
|
55424
|
-
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)/;
|
|
55425
|
-
var json_parse = function(options) {
|
|
55426
|
-
"use strict";
|
|
55427
|
-
var _options = {
|
|
55428
|
-
strict: false,
|
|
55429
|
-
// not being strict means do not generate syntax errors for "duplicate key"
|
|
55430
|
-
storeAsString: false,
|
|
55431
|
-
// toggles whether the values should be stored as BigNumber (default) or a string
|
|
55432
|
-
alwaysParseAsBig: false,
|
|
55433
|
-
// toggles whether all numbers should be Big
|
|
55434
|
-
useNativeBigInt: false,
|
|
55435
|
-
// toggles whether to use native BigInt instead of bignumber.js
|
|
55436
|
-
protoAction: "error",
|
|
55437
|
-
constructorAction: "error"
|
|
55438
|
-
};
|
|
55439
|
-
if (options !== void 0 && options !== null) {
|
|
55440
|
-
if (options.strict === true) {
|
|
55441
|
-
_options.strict = true;
|
|
55442
|
-
}
|
|
55443
|
-
if (options.storeAsString === true) {
|
|
55444
|
-
_options.storeAsString = true;
|
|
55445
|
-
}
|
|
55446
|
-
_options.alwaysParseAsBig = options.alwaysParseAsBig === true ? options.alwaysParseAsBig : false;
|
|
55447
|
-
_options.useNativeBigInt = options.useNativeBigInt === true ? options.useNativeBigInt : false;
|
|
55448
|
-
if (typeof options.constructorAction !== "undefined") {
|
|
55449
|
-
if (options.constructorAction === "error" || options.constructorAction === "ignore" || options.constructorAction === "preserve") {
|
|
55450
|
-
_options.constructorAction = options.constructorAction;
|
|
55451
|
-
} else {
|
|
55452
|
-
throw new Error(
|
|
55453
|
-
`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${options.constructorAction}`
|
|
55454
|
-
);
|
|
55455
|
-
}
|
|
55456
|
-
}
|
|
55457
|
-
if (typeof options.protoAction !== "undefined") {
|
|
55458
|
-
if (options.protoAction === "error" || options.protoAction === "ignore" || options.protoAction === "preserve") {
|
|
55459
|
-
_options.protoAction = options.protoAction;
|
|
55460
|
-
} else {
|
|
55461
|
-
throw new Error(
|
|
55462
|
-
`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${options.protoAction}`
|
|
55463
|
-
);
|
|
55464
|
-
}
|
|
55465
|
-
}
|
|
55466
|
-
}
|
|
55467
|
-
var at, ch, escapee = {
|
|
55468
|
-
'"': '"',
|
|
55469
|
-
"\\": "\\",
|
|
55470
|
-
"/": "/",
|
|
55471
|
-
b: "\b",
|
|
55472
|
-
f: "\f",
|
|
55473
|
-
n: "\n",
|
|
55474
|
-
r: "\r",
|
|
55475
|
-
t: " "
|
|
55476
|
-
}, text, error49 = function(m) {
|
|
55477
|
-
throw {
|
|
55478
|
-
name: "SyntaxError",
|
|
55479
|
-
message: m,
|
|
55480
|
-
at,
|
|
55481
|
-
text
|
|
55482
|
-
};
|
|
55483
|
-
}, next = function(c) {
|
|
55484
|
-
if (c && c !== ch) {
|
|
55485
|
-
error49("Expected '" + c + "' instead of '" + ch + "'");
|
|
55486
|
-
}
|
|
55487
|
-
ch = text.charAt(at);
|
|
55488
|
-
at += 1;
|
|
55489
|
-
return ch;
|
|
55490
|
-
}, number4 = function() {
|
|
55491
|
-
var number5, string5 = "";
|
|
55492
|
-
if (ch === "-") {
|
|
55493
|
-
string5 = "-";
|
|
55494
|
-
next("-");
|
|
55495
|
-
}
|
|
55496
|
-
while (ch >= "0" && ch <= "9") {
|
|
55497
|
-
string5 += ch;
|
|
55498
|
-
next();
|
|
55499
|
-
}
|
|
55500
|
-
if (ch === ".") {
|
|
55501
|
-
string5 += ".";
|
|
55502
|
-
while (next() && ch >= "0" && ch <= "9") {
|
|
55503
|
-
string5 += ch;
|
|
55504
|
-
}
|
|
55505
|
-
}
|
|
55506
|
-
if (ch === "e" || ch === "E") {
|
|
55507
|
-
string5 += ch;
|
|
55508
|
-
next();
|
|
55509
|
-
if (ch === "-" || ch === "+") {
|
|
55510
|
-
string5 += ch;
|
|
55511
|
-
next();
|
|
55512
|
-
}
|
|
55513
|
-
while (ch >= "0" && ch <= "9") {
|
|
55514
|
-
string5 += ch;
|
|
55515
|
-
next();
|
|
55516
|
-
}
|
|
55517
|
-
}
|
|
55518
|
-
number5 = +string5;
|
|
55519
|
-
if (!isFinite(number5)) {
|
|
55520
|
-
error49("Bad number");
|
|
55521
|
-
} else {
|
|
55522
|
-
if (BigNumber2 == null) BigNumber2 = require_bignumber();
|
|
55523
|
-
if (string5.length > 15)
|
|
55524
|
-
return _options.storeAsString ? string5 : _options.useNativeBigInt ? BigInt(string5) : new BigNumber2(string5);
|
|
55525
|
-
else
|
|
55526
|
-
return !_options.alwaysParseAsBig ? number5 : _options.useNativeBigInt ? BigInt(number5) : new BigNumber2(number5);
|
|
55527
|
-
}
|
|
55528
|
-
}, string4 = function() {
|
|
55529
|
-
var hex3, i, string5 = "", uffff;
|
|
55530
|
-
if (ch === '"') {
|
|
55531
|
-
var startAt = at;
|
|
55532
|
-
while (next()) {
|
|
55533
|
-
if (ch === '"') {
|
|
55534
|
-
if (at - 1 > startAt) string5 += text.substring(startAt, at - 1);
|
|
55535
|
-
next();
|
|
55536
|
-
return string5;
|
|
55537
|
-
}
|
|
55538
|
-
if (ch === "\\") {
|
|
55539
|
-
if (at - 1 > startAt) string5 += text.substring(startAt, at - 1);
|
|
55540
|
-
next();
|
|
55541
|
-
if (ch === "u") {
|
|
55542
|
-
uffff = 0;
|
|
55543
|
-
for (i = 0; i < 4; i += 1) {
|
|
55544
|
-
hex3 = parseInt(next(), 16);
|
|
55545
|
-
if (!isFinite(hex3)) {
|
|
55546
|
-
break;
|
|
55547
|
-
}
|
|
55548
|
-
uffff = uffff * 16 + hex3;
|
|
55549
|
-
}
|
|
55550
|
-
string5 += String.fromCharCode(uffff);
|
|
55551
|
-
} else if (typeof escapee[ch] === "string") {
|
|
55552
|
-
string5 += escapee[ch];
|
|
55553
|
-
} else {
|
|
55554
|
-
break;
|
|
55555
|
-
}
|
|
55556
|
-
startAt = at;
|
|
55557
|
-
}
|
|
55558
|
-
}
|
|
55559
|
-
}
|
|
55560
|
-
error49("Bad string");
|
|
55561
|
-
}, white = function() {
|
|
55562
|
-
while (ch && ch <= " ") {
|
|
55563
|
-
next();
|
|
55564
|
-
}
|
|
55565
|
-
}, word = function() {
|
|
55566
|
-
switch (ch) {
|
|
55567
|
-
case "t":
|
|
55568
|
-
next("t");
|
|
55569
|
-
next("r");
|
|
55570
|
-
next("u");
|
|
55571
|
-
next("e");
|
|
55572
|
-
return true;
|
|
55573
|
-
case "f":
|
|
55574
|
-
next("f");
|
|
55575
|
-
next("a");
|
|
55576
|
-
next("l");
|
|
55577
|
-
next("s");
|
|
55578
|
-
next("e");
|
|
55579
|
-
return false;
|
|
55580
|
-
case "n":
|
|
55581
|
-
next("n");
|
|
55582
|
-
next("u");
|
|
55583
|
-
next("l");
|
|
55584
|
-
next("l");
|
|
55585
|
-
return null;
|
|
55586
|
-
}
|
|
55587
|
-
error49("Unexpected '" + ch + "'");
|
|
55588
|
-
}, value, array2 = function() {
|
|
55589
|
-
var array3 = [];
|
|
55590
|
-
if (ch === "[") {
|
|
55591
|
-
next("[");
|
|
55592
|
-
white();
|
|
55593
|
-
if (ch === "]") {
|
|
55594
|
-
next("]");
|
|
55595
|
-
return array3;
|
|
55596
|
-
}
|
|
55597
|
-
while (ch) {
|
|
55598
|
-
array3.push(value());
|
|
55599
|
-
white();
|
|
55600
|
-
if (ch === "]") {
|
|
55601
|
-
next("]");
|
|
55602
|
-
return array3;
|
|
55603
|
-
}
|
|
55604
|
-
next(",");
|
|
55605
|
-
white();
|
|
55606
|
-
}
|
|
55607
|
-
}
|
|
55608
|
-
error49("Bad array");
|
|
55609
|
-
}, object2 = function() {
|
|
55610
|
-
var key, object3 = /* @__PURE__ */ Object.create(null);
|
|
55611
|
-
if (ch === "{") {
|
|
55612
|
-
next("{");
|
|
55613
|
-
white();
|
|
55614
|
-
if (ch === "}") {
|
|
55615
|
-
next("}");
|
|
55616
|
-
return object3;
|
|
55617
|
-
}
|
|
55618
|
-
while (ch) {
|
|
55619
|
-
key = string4();
|
|
55620
|
-
white();
|
|
55621
|
-
next(":");
|
|
55622
|
-
if (_options.strict === true && Object.hasOwnProperty.call(object3, key)) {
|
|
55623
|
-
error49('Duplicate key "' + key + '"');
|
|
55624
|
-
}
|
|
55625
|
-
if (suspectProtoRx.test(key) === true) {
|
|
55626
|
-
if (_options.protoAction === "error") {
|
|
55627
|
-
error49("Object contains forbidden prototype property");
|
|
55628
|
-
} else if (_options.protoAction === "ignore") {
|
|
55629
|
-
value();
|
|
55630
|
-
} else {
|
|
55631
|
-
object3[key] = value();
|
|
55632
|
-
}
|
|
55633
|
-
} else if (suspectConstructorRx.test(key) === true) {
|
|
55634
|
-
if (_options.constructorAction === "error") {
|
|
55635
|
-
error49("Object contains forbidden constructor property");
|
|
55636
|
-
} else if (_options.constructorAction === "ignore") {
|
|
55637
|
-
value();
|
|
55638
|
-
} else {
|
|
55639
|
-
object3[key] = value();
|
|
55640
|
-
}
|
|
55641
|
-
} else {
|
|
55642
|
-
object3[key] = value();
|
|
55643
|
-
}
|
|
55644
|
-
white();
|
|
55645
|
-
if (ch === "}") {
|
|
55646
|
-
next("}");
|
|
55647
|
-
return object3;
|
|
55648
|
-
}
|
|
55649
|
-
next(",");
|
|
55650
|
-
white();
|
|
55651
|
-
}
|
|
55652
|
-
}
|
|
55653
|
-
error49("Bad object");
|
|
55654
|
-
};
|
|
55655
|
-
value = function() {
|
|
55656
|
-
white();
|
|
55657
|
-
switch (ch) {
|
|
55658
|
-
case "{":
|
|
55659
|
-
return object2();
|
|
55660
|
-
case "[":
|
|
55661
|
-
return array2();
|
|
55662
|
-
case '"':
|
|
55663
|
-
return string4();
|
|
55664
|
-
case "-":
|
|
55665
|
-
return number4();
|
|
55666
|
-
default:
|
|
55667
|
-
return ch >= "0" && ch <= "9" ? number4() : word();
|
|
55668
|
-
}
|
|
55669
|
-
};
|
|
55670
|
-
return function(source, reviver3) {
|
|
55671
|
-
var result;
|
|
55672
|
-
text = source + "";
|
|
55673
|
-
at = 0;
|
|
55674
|
-
ch = " ";
|
|
55675
|
-
result = value();
|
|
55676
|
-
white();
|
|
55677
|
-
if (ch) {
|
|
55678
|
-
error49("Syntax error");
|
|
55679
|
-
}
|
|
55680
|
-
return typeof reviver3 === "function" ? (function walk(holder, key) {
|
|
55681
|
-
var k, v, value2 = holder[key];
|
|
55682
|
-
if (value2 && typeof value2 === "object") {
|
|
55683
|
-
Object.keys(value2).forEach(function(k2) {
|
|
55684
|
-
v = walk(value2, k2);
|
|
55685
|
-
if (v !== void 0) {
|
|
55686
|
-
value2[k2] = v;
|
|
55687
|
-
} else {
|
|
55688
|
-
delete value2[k2];
|
|
55689
|
-
}
|
|
55690
|
-
});
|
|
55691
|
-
}
|
|
55692
|
-
return reviver3.call(holder, key, value2);
|
|
55693
|
-
})({ "": result }, "") : result;
|
|
55694
|
-
};
|
|
55695
|
-
};
|
|
55696
|
-
module.exports = json_parse;
|
|
55697
|
-
}
|
|
55698
|
-
});
|
|
55699
|
-
|
|
55700
|
-
// node_modules/json-bigint/index.js
|
|
55701
|
-
var require_json_bigint = __commonJS({
|
|
55702
|
-
"node_modules/json-bigint/index.js"(exports, module) {
|
|
55703
|
-
var json_stringify = require_stringify().stringify;
|
|
55704
|
-
var json_parse = require_parse2();
|
|
55705
|
-
module.exports = function(options) {
|
|
55706
|
-
return {
|
|
55707
|
-
parse: json_parse(options),
|
|
55708
|
-
stringify: json_stringify
|
|
55709
|
-
};
|
|
55710
|
-
};
|
|
55711
|
-
module.exports.parse = json_parse();
|
|
55712
|
-
module.exports.stringify = json_stringify;
|
|
55713
|
-
}
|
|
55714
|
-
});
|
|
55715
|
-
|
|
55716
|
-
// node_modules/bignumber.js/bignumber.js
|
|
55717
|
-
var require_bignumber2 = __commonJS({
|
|
55718
|
-
"node_modules/bignumber.js/bignumber.js"(exports, module) {
|
|
55719
|
-
(function(globalObject) {
|
|
55720
|
-
"use strict";
|
|
55721
|
-
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;
|
|
55722
|
-
function clone2(configObject) {
|
|
55723
|
-
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 = {
|
|
55724
|
-
prefix: "",
|
|
55725
|
-
groupSize: 3,
|
|
55726
|
-
secondaryGroupSize: 0,
|
|
55727
|
-
groupSeparator: ",",
|
|
55728
|
-
decimalSeparator: ".",
|
|
55729
|
-
fractionGroupSize: 0,
|
|
55730
|
-
fractionGroupSeparator: "\xA0",
|
|
55731
|
-
// non-breaking space
|
|
55732
|
-
suffix: ""
|
|
55733
|
-
}, ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz";
|
|
55734
|
-
function BigNumber3(v, b) {
|
|
55735
|
-
var alphabet, c, caseChanged, e, i, isNum, len, str, x = this;
|
|
55736
|
-
if (!(x instanceof BigNumber3)) return new BigNumber3(v, b);
|
|
55737
|
-
if (b == null) {
|
|
55738
|
-
if (v && v._isBigNumber === true) {
|
|
55739
|
-
x.s = v.s;
|
|
55740
|
-
if (!v.c || v.e > MAX_EXP) {
|
|
55741
|
-
x.c = x.e = null;
|
|
55742
|
-
} else if (v.e < MIN_EXP) {
|
|
55743
|
-
x.c = [x.e = 0];
|
|
55744
|
-
} else {
|
|
55745
|
-
x.e = v.e;
|
|
55746
|
-
x.c = v.c.slice();
|
|
55747
|
-
}
|
|
55748
|
-
return;
|
|
55749
|
-
}
|
|
55750
|
-
if ((isNum = typeof v == "number") && v * 0 == 0) {
|
|
55751
|
-
x.s = 1 / v < 0 ? (v = -v, -1) : 1;
|
|
55752
|
-
if (v === ~~v) {
|
|
55753
|
-
for (e = 0, i = v; i >= 10; i /= 10, e++) ;
|
|
55754
|
-
if (e > MAX_EXP) {
|
|
55755
|
-
x.c = x.e = null;
|
|
55756
|
-
} else {
|
|
55757
|
-
x.e = e;
|
|
55758
|
-
x.c = [v];
|
|
55759
|
-
}
|
|
55760
|
-
return;
|
|
55761
|
-
}
|
|
55762
|
-
str = String(v);
|
|
55763
|
-
} else {
|
|
55764
|
-
if (!isNumeric.test(str = String(v))) return parseNumeric(x, str, isNum);
|
|
55765
|
-
x.s = str.charCodeAt(0) == 45 ? (str = str.slice(1), -1) : 1;
|
|
55766
|
-
}
|
|
55767
|
-
if ((e = str.indexOf(".")) > -1) str = str.replace(".", "");
|
|
55768
|
-
if ((i = str.search(/e/i)) > 0) {
|
|
55769
|
-
if (e < 0) e = i;
|
|
55770
|
-
e += +str.slice(i + 1);
|
|
55771
|
-
str = str.substring(0, i);
|
|
55772
|
-
} else if (e < 0) {
|
|
55773
|
-
e = str.length;
|
|
55774
|
-
}
|
|
55775
|
-
} else {
|
|
55776
|
-
intCheck(b, 2, ALPHABET.length, "Base");
|
|
55777
|
-
if (b == 10) {
|
|
55778
|
-
x = new BigNumber3(v);
|
|
54017
|
+
x = new BigNumber2(v);
|
|
55779
54018
|
return round(x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE);
|
|
55780
54019
|
}
|
|
55781
54020
|
str = String(v);
|
|
55782
54021
|
if (isNum = typeof v == "number") {
|
|
55783
54022
|
if (v * 0 != 0) return parseNumeric(x, str, isNum, b);
|
|
55784
54023
|
x.s = 1 / v < 0 ? (str = str.slice(1), -1) : 1;
|
|
55785
|
-
if (
|
|
54024
|
+
if (BigNumber2.DEBUG && str.replace(/^0\.0*|\./, "").length > 15) {
|
|
55786
54025
|
throw Error(tooManyDigits + v);
|
|
55787
54026
|
}
|
|
55788
54027
|
} else {
|
|
@@ -55817,7 +54056,7 @@ var require_bignumber2 = __commonJS({
|
|
|
55817
54056
|
for (len = str.length; str.charCodeAt(--len) === 48; ) ;
|
|
55818
54057
|
if (str = str.slice(i, ++len)) {
|
|
55819
54058
|
len -= i;
|
|
55820
|
-
if (isNum &&
|
|
54059
|
+
if (isNum && BigNumber2.DEBUG && len > 15 && (v > MAX_SAFE_INTEGER || v !== mathfloor(v))) {
|
|
55821
54060
|
throw Error(tooManyDigits + x.s * v);
|
|
55822
54061
|
}
|
|
55823
54062
|
if ((e = e - i - 1) > MAX_EXP) {
|
|
@@ -55845,18 +54084,18 @@ var require_bignumber2 = __commonJS({
|
|
|
55845
54084
|
x.c = [x.e = 0];
|
|
55846
54085
|
}
|
|
55847
54086
|
}
|
|
55848
|
-
|
|
55849
|
-
|
|
55850
|
-
|
|
55851
|
-
|
|
55852
|
-
|
|
55853
|
-
|
|
55854
|
-
|
|
55855
|
-
|
|
55856
|
-
|
|
55857
|
-
|
|
55858
|
-
|
|
55859
|
-
|
|
54087
|
+
BigNumber2.clone = clone2;
|
|
54088
|
+
BigNumber2.ROUND_UP = 0;
|
|
54089
|
+
BigNumber2.ROUND_DOWN = 1;
|
|
54090
|
+
BigNumber2.ROUND_CEIL = 2;
|
|
54091
|
+
BigNumber2.ROUND_FLOOR = 3;
|
|
54092
|
+
BigNumber2.ROUND_HALF_UP = 4;
|
|
54093
|
+
BigNumber2.ROUND_HALF_DOWN = 5;
|
|
54094
|
+
BigNumber2.ROUND_HALF_EVEN = 6;
|
|
54095
|
+
BigNumber2.ROUND_HALF_CEIL = 7;
|
|
54096
|
+
BigNumber2.ROUND_HALF_FLOOR = 8;
|
|
54097
|
+
BigNumber2.EUCLID = 9;
|
|
54098
|
+
BigNumber2.config = BigNumber2.set = function(obj) {
|
|
55860
54099
|
var p, v;
|
|
55861
54100
|
if (obj != null) {
|
|
55862
54101
|
if (typeof obj == "object") {
|
|
@@ -55932,7 +54171,8 @@ var require_bignumber2 = __commonJS({
|
|
|
55932
54171
|
}
|
|
55933
54172
|
if (obj.hasOwnProperty(p = "ALPHABET")) {
|
|
55934
54173
|
v = obj[p];
|
|
55935
|
-
if (typeof v == "string" &&
|
|
54174
|
+
if (typeof v == "string" && !/^.?$|[+\-.\s]|(.).*\1/.test(v)) {
|
|
54175
|
+
alphabetHasNormalDecimalDigits = v.slice(0, 10) == "0123456789";
|
|
55936
54176
|
ALPHABET = v;
|
|
55937
54177
|
} else {
|
|
55938
54178
|
throw Error(bignumberError + p + " invalid: " + v);
|
|
@@ -55954,9 +54194,9 @@ var require_bignumber2 = __commonJS({
|
|
|
55954
54194
|
ALPHABET
|
|
55955
54195
|
};
|
|
55956
54196
|
};
|
|
55957
|
-
|
|
54197
|
+
BigNumber2.isBigNumber = function(v) {
|
|
55958
54198
|
if (!v || v._isBigNumber !== true) return false;
|
|
55959
|
-
if (!
|
|
54199
|
+
if (!BigNumber2.DEBUG) return true;
|
|
55960
54200
|
var i, n, c = v.c, e = v.e, s = v.s;
|
|
55961
54201
|
out: if ({}.toString.call(c) == "[object Array]") {
|
|
55962
54202
|
if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) {
|
|
@@ -55979,13 +54219,13 @@ var require_bignumber2 = __commonJS({
|
|
|
55979
54219
|
}
|
|
55980
54220
|
throw Error(bignumberError + "Invalid BigNumber: " + v);
|
|
55981
54221
|
};
|
|
55982
|
-
|
|
55983
|
-
return maxOrMin(arguments,
|
|
54222
|
+
BigNumber2.maximum = BigNumber2.max = function() {
|
|
54223
|
+
return maxOrMin(arguments, -1);
|
|
55984
54224
|
};
|
|
55985
|
-
|
|
55986
|
-
return maxOrMin(arguments,
|
|
54225
|
+
BigNumber2.minimum = BigNumber2.min = function() {
|
|
54226
|
+
return maxOrMin(arguments, 1);
|
|
55987
54227
|
};
|
|
55988
|
-
|
|
54228
|
+
BigNumber2.random = (function() {
|
|
55989
54229
|
var pow2_53 = 9007199254740992;
|
|
55990
54230
|
var random53bitInt = Math.random() * pow2_53 & 2097151 ? function() {
|
|
55991
54231
|
return mathfloor(Math.random() * pow2_53);
|
|
@@ -55993,7 +54233,7 @@ var require_bignumber2 = __commonJS({
|
|
|
55993
54233
|
return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
|
|
55994
54234
|
};
|
|
55995
54235
|
return function(dp) {
|
|
55996
|
-
var a, b, e, k, v, i = 0, c = [], rand = new
|
|
54236
|
+
var a, b, e, k, v, i = 0, c = [], rand = new BigNumber2(ONE);
|
|
55997
54237
|
if (dp == null) dp = DECIMAL_PLACES;
|
|
55998
54238
|
else intCheck(dp, 0, MAX);
|
|
55999
54239
|
k = mathceil(dp / LOG_BASE);
|
|
@@ -56054,8 +54294,8 @@ var require_bignumber2 = __commonJS({
|
|
|
56054
54294
|
return rand;
|
|
56055
54295
|
};
|
|
56056
54296
|
})();
|
|
56057
|
-
|
|
56058
|
-
var i = 1, args = arguments, sum = new
|
|
54297
|
+
BigNumber2.sum = function() {
|
|
54298
|
+
var i = 1, args = arguments, sum = new BigNumber2(args[0]);
|
|
56059
54299
|
for (; i < args.length; ) sum = sum.plus(args[i++]);
|
|
56060
54300
|
return sum;
|
|
56061
54301
|
};
|
|
@@ -56082,7 +54322,7 @@ var require_bignumber2 = __commonJS({
|
|
|
56082
54322
|
k = POW_PRECISION;
|
|
56083
54323
|
POW_PRECISION = 0;
|
|
56084
54324
|
str = str.replace(".", "");
|
|
56085
|
-
y = new
|
|
54325
|
+
y = new BigNumber2(baseIn);
|
|
56086
54326
|
x = y.pow(str.length - i);
|
|
56087
54327
|
POW_PRECISION = k;
|
|
56088
54328
|
y.c = toBaseOut(
|
|
@@ -56173,7 +54413,7 @@ var require_bignumber2 = __commonJS({
|
|
|
56173
54413
|
return function(x, y, dp, rm, base) {
|
|
56174
54414
|
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;
|
|
56175
54415
|
if (!xc || !xc[0] || !yc || !yc[0]) {
|
|
56176
|
-
return new
|
|
54416
|
+
return new BigNumber2(
|
|
56177
54417
|
// Return NaN if either NaN, or both Infinity or 0.
|
|
56178
54418
|
!x.s || !y.s || (xc ? yc && xc[0] == yc[0] : !yc) ? NaN : (
|
|
56179
54419
|
// Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
|
|
@@ -56181,7 +54421,7 @@ var require_bignumber2 = __commonJS({
|
|
|
56181
54421
|
)
|
|
56182
54422
|
);
|
|
56183
54423
|
}
|
|
56184
|
-
q = new
|
|
54424
|
+
q = new BigNumber2(s);
|
|
56185
54425
|
qc = q.c = [];
|
|
56186
54426
|
e = x.e - y.e;
|
|
56187
54427
|
s = dp + e + 1;
|
|
@@ -56286,7 +54526,7 @@ var require_bignumber2 = __commonJS({
|
|
|
56286
54526
|
str = coeffToString(n.c);
|
|
56287
54527
|
str = id == 1 || id == 2 && (ne <= TO_EXP_NEG || ne >= TO_EXP_POS) ? toExponential(str, ne) : toFixedPoint(str, ne, "0");
|
|
56288
54528
|
} else {
|
|
56289
|
-
n = round(new
|
|
54529
|
+
n = round(new BigNumber2(n), i, rm);
|
|
56290
54530
|
e = n.e;
|
|
56291
54531
|
str = coeffToString(n.c);
|
|
56292
54532
|
len = str.length;
|
|
@@ -56294,7 +54534,7 @@ var require_bignumber2 = __commonJS({
|
|
|
56294
54534
|
for (; len < i; str += "0", len++) ;
|
|
56295
54535
|
str = toExponential(str, e);
|
|
56296
54536
|
} else {
|
|
56297
|
-
i -= ne;
|
|
54537
|
+
i -= ne + (id === 2 && e > ne);
|
|
56298
54538
|
str = toFixedPoint(str, e, "0");
|
|
56299
54539
|
if (e + 1 > len) {
|
|
56300
54540
|
if (--i > 0) for (str += "."; i--; str += "0") ;
|
|
@@ -56309,18 +54549,15 @@ var require_bignumber2 = __commonJS({
|
|
|
56309
54549
|
}
|
|
56310
54550
|
return n.s < 0 && c0 ? "-" + str : str;
|
|
56311
54551
|
}
|
|
56312
|
-
function maxOrMin(args,
|
|
56313
|
-
var
|
|
54552
|
+
function maxOrMin(args, n) {
|
|
54553
|
+
var k, y, i = 1, x = new BigNumber2(args[0]);
|
|
56314
54554
|
for (; i < args.length; i++) {
|
|
56315
|
-
|
|
56316
|
-
if (!n.s) {
|
|
56317
|
-
|
|
56318
|
-
break;
|
|
56319
|
-
} else if (method.call(m, n)) {
|
|
56320
|
-
m = n;
|
|
54555
|
+
y = new BigNumber2(args[i]);
|
|
54556
|
+
if (!y.s || (k = compare(x, y)) === n || k === 0 && x.s === n) {
|
|
54557
|
+
x = y;
|
|
56321
54558
|
}
|
|
56322
54559
|
}
|
|
56323
|
-
return
|
|
54560
|
+
return x;
|
|
56324
54561
|
}
|
|
56325
54562
|
function normalise(n, c, e) {
|
|
56326
54563
|
var i = 1, j = c.length;
|
|
@@ -56352,9 +54589,9 @@ var require_bignumber2 = __commonJS({
|
|
|
56352
54589
|
base = b;
|
|
56353
54590
|
s = s.replace(dotAfter, "$1").replace(dotBefore, "0.$1");
|
|
56354
54591
|
}
|
|
56355
|
-
if (str != s) return new
|
|
54592
|
+
if (str != s) return new BigNumber2(s, base);
|
|
56356
54593
|
}
|
|
56357
|
-
if (
|
|
54594
|
+
if (BigNumber2.DEBUG) {
|
|
56358
54595
|
throw Error(bignumberError + "Not a" + (b ? " base " + b : "") + " number: " + str);
|
|
56359
54596
|
}
|
|
56360
54597
|
x.s = null;
|
|
@@ -56372,7 +54609,7 @@ var require_bignumber2 = __commonJS({
|
|
|
56372
54609
|
i += LOG_BASE;
|
|
56373
54610
|
j = sd;
|
|
56374
54611
|
n = xc[ni = 0];
|
|
56375
|
-
rd = n / pows10[d - j - 1] % 10
|
|
54612
|
+
rd = mathfloor(n / pows10[d - j - 1] % 10);
|
|
56376
54613
|
} else {
|
|
56377
54614
|
ni = mathceil((i + 1) / LOG_BASE);
|
|
56378
54615
|
if (ni >= xc.length) {
|
|
@@ -56390,7 +54627,7 @@ var require_bignumber2 = __commonJS({
|
|
|
56390
54627
|
for (d = 1; k >= 10; k /= 10, d++) ;
|
|
56391
54628
|
i %= LOG_BASE;
|
|
56392
54629
|
j = i - LOG_BASE + d;
|
|
56393
|
-
rd = j < 0 ? 0 : n / pows10[d - j - 1] % 10
|
|
54630
|
+
rd = j < 0 ? 0 : mathfloor(n / pows10[d - j - 1] % 10);
|
|
56394
54631
|
}
|
|
56395
54632
|
}
|
|
56396
54633
|
r = r || sd < 0 || // Are there any non-zero digits after the rounding digit?
|
|
@@ -56456,12 +54693,12 @@ var require_bignumber2 = __commonJS({
|
|
|
56456
54693
|
return n.s < 0 ? "-" + str : str;
|
|
56457
54694
|
}
|
|
56458
54695
|
P.absoluteValue = P.abs = function() {
|
|
56459
|
-
var x = new
|
|
54696
|
+
var x = new BigNumber2(this);
|
|
56460
54697
|
if (x.s < 0) x.s = 1;
|
|
56461
54698
|
return x;
|
|
56462
54699
|
};
|
|
56463
54700
|
P.comparedTo = function(y, b) {
|
|
56464
|
-
return compare(this, new
|
|
54701
|
+
return compare(this, new BigNumber2(y, b));
|
|
56465
54702
|
};
|
|
56466
54703
|
P.decimalPlaces = P.dp = function(dp, rm) {
|
|
56467
54704
|
var c, n, v, x = this;
|
|
@@ -56469,7 +54706,7 @@ var require_bignumber2 = __commonJS({
|
|
|
56469
54706
|
intCheck(dp, 0, MAX);
|
|
56470
54707
|
if (rm == null) rm = ROUNDING_MODE;
|
|
56471
54708
|
else intCheck(rm, 0, 8);
|
|
56472
|
-
return round(new
|
|
54709
|
+
return round(new BigNumber2(x), dp + x.e + 1, rm);
|
|
56473
54710
|
}
|
|
56474
54711
|
if (!(c = x.c)) return null;
|
|
56475
54712
|
n = ((v = c.length - 1) - bitFloor(this.e / LOG_BASE)) * LOG_BASE;
|
|
@@ -56478,44 +54715,44 @@ var require_bignumber2 = __commonJS({
|
|
|
56478
54715
|
return n;
|
|
56479
54716
|
};
|
|
56480
54717
|
P.dividedBy = P.div = function(y, b) {
|
|
56481
|
-
return div(this, new
|
|
54718
|
+
return div(this, new BigNumber2(y, b), DECIMAL_PLACES, ROUNDING_MODE);
|
|
56482
54719
|
};
|
|
56483
54720
|
P.dividedToIntegerBy = P.idiv = function(y, b) {
|
|
56484
|
-
return div(this, new
|
|
54721
|
+
return div(this, new BigNumber2(y, b), 0, 1);
|
|
56485
54722
|
};
|
|
56486
54723
|
P.exponentiatedBy = P.pow = function(n, m) {
|
|
56487
54724
|
var half, isModExp, i, k, more, nIsBig, nIsNeg, nIsOdd, y, x = this;
|
|
56488
|
-
n = new
|
|
54725
|
+
n = new BigNumber2(n);
|
|
56489
54726
|
if (n.c && !n.isInteger()) {
|
|
56490
54727
|
throw Error(bignumberError + "Exponent not an integer: " + valueOf(n));
|
|
56491
54728
|
}
|
|
56492
|
-
if (m != null) m = new
|
|
54729
|
+
if (m != null) m = new BigNumber2(m);
|
|
56493
54730
|
nIsBig = n.e > 14;
|
|
56494
54731
|
if (!x.c || !x.c[0] || x.c[0] == 1 && !x.e && x.c.length == 1 || !n.c || !n.c[0]) {
|
|
56495
|
-
y = new
|
|
54732
|
+
y = new BigNumber2(Math.pow(+valueOf(x), nIsBig ? n.s * (2 - isOdd(n)) : +valueOf(n)));
|
|
56496
54733
|
return m ? y.mod(m) : y;
|
|
56497
54734
|
}
|
|
56498
54735
|
nIsNeg = n.s < 0;
|
|
56499
54736
|
if (m) {
|
|
56500
|
-
if (m.c ? !m.c[0] : !m.s) return new
|
|
54737
|
+
if (m.c ? !m.c[0] : !m.s) return new BigNumber2(NaN);
|
|
56501
54738
|
isModExp = !nIsNeg && x.isInteger() && m.isInteger();
|
|
56502
54739
|
if (isModExp) x = x.mod(m);
|
|
56503
54740
|
} 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))) {
|
|
56504
54741
|
k = x.s < 0 && isOdd(n) ? -0 : 0;
|
|
56505
54742
|
if (x.e > -1) k = 1 / k;
|
|
56506
|
-
return new
|
|
54743
|
+
return new BigNumber2(nIsNeg ? 1 / k : k);
|
|
56507
54744
|
} else if (POW_PRECISION) {
|
|
56508
54745
|
k = mathceil(POW_PRECISION / LOG_BASE + 2);
|
|
56509
54746
|
}
|
|
56510
54747
|
if (nIsBig) {
|
|
56511
|
-
half = new
|
|
54748
|
+
half = new BigNumber2(0.5);
|
|
56512
54749
|
if (nIsNeg) n.s = 1;
|
|
56513
54750
|
nIsOdd = isOdd(n);
|
|
56514
54751
|
} else {
|
|
56515
54752
|
i = Math.abs(+valueOf(n));
|
|
56516
54753
|
nIsOdd = i % 2;
|
|
56517
54754
|
}
|
|
56518
|
-
y = new
|
|
54755
|
+
y = new BigNumber2(ONE);
|
|
56519
54756
|
for (; ; ) {
|
|
56520
54757
|
if (nIsOdd) {
|
|
56521
54758
|
y = y.times(x);
|
|
@@ -56553,31 +54790,31 @@ var require_bignumber2 = __commonJS({
|
|
|
56553
54790
|
return m ? y.mod(m) : k ? round(y, POW_PRECISION, ROUNDING_MODE, more) : y;
|
|
56554
54791
|
};
|
|
56555
54792
|
P.integerValue = function(rm) {
|
|
56556
|
-
var n = new
|
|
54793
|
+
var n = new BigNumber2(this);
|
|
56557
54794
|
if (rm == null) rm = ROUNDING_MODE;
|
|
56558
54795
|
else intCheck(rm, 0, 8);
|
|
56559
54796
|
return round(n, n.e + 1, rm);
|
|
56560
54797
|
};
|
|
56561
54798
|
P.isEqualTo = P.eq = function(y, b) {
|
|
56562
|
-
return compare(this, new
|
|
54799
|
+
return compare(this, new BigNumber2(y, b)) === 0;
|
|
56563
54800
|
};
|
|
56564
54801
|
P.isFinite = function() {
|
|
56565
54802
|
return !!this.c;
|
|
56566
54803
|
};
|
|
56567
54804
|
P.isGreaterThan = P.gt = function(y, b) {
|
|
56568
|
-
return compare(this, new
|
|
54805
|
+
return compare(this, new BigNumber2(y, b)) > 0;
|
|
56569
54806
|
};
|
|
56570
54807
|
P.isGreaterThanOrEqualTo = P.gte = function(y, b) {
|
|
56571
|
-
return (b = compare(this, new
|
|
54808
|
+
return (b = compare(this, new BigNumber2(y, b))) === 1 || b === 0;
|
|
56572
54809
|
};
|
|
56573
54810
|
P.isInteger = function() {
|
|
56574
54811
|
return !!this.c && bitFloor(this.e / LOG_BASE) > this.c.length - 2;
|
|
56575
54812
|
};
|
|
56576
54813
|
P.isLessThan = P.lt = function(y, b) {
|
|
56577
|
-
return compare(this, new
|
|
54814
|
+
return compare(this, new BigNumber2(y, b)) < 0;
|
|
56578
54815
|
};
|
|
56579
54816
|
P.isLessThanOrEqualTo = P.lte = function(y, b) {
|
|
56580
|
-
return (b = compare(this, new
|
|
54817
|
+
return (b = compare(this, new BigNumber2(y, b))) === -1 || b === 0;
|
|
56581
54818
|
};
|
|
56582
54819
|
P.isNaN = function() {
|
|
56583
54820
|
return !this.s;
|
|
@@ -56593,18 +54830,18 @@ var require_bignumber2 = __commonJS({
|
|
|
56593
54830
|
};
|
|
56594
54831
|
P.minus = function(y, b) {
|
|
56595
54832
|
var i, j, t, xLTy, x = this, a = x.s;
|
|
56596
|
-
y = new
|
|
54833
|
+
y = new BigNumber2(y, b);
|
|
56597
54834
|
b = y.s;
|
|
56598
|
-
if (!a || !b) return new
|
|
54835
|
+
if (!a || !b) return new BigNumber2(NaN);
|
|
56599
54836
|
if (a != b) {
|
|
56600
54837
|
y.s = -b;
|
|
56601
54838
|
return x.plus(y);
|
|
56602
54839
|
}
|
|
56603
54840
|
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
56604
54841
|
if (!xe || !ye) {
|
|
56605
|
-
if (!xc || !yc) return xc ? (y.s = -b, y) : new
|
|
54842
|
+
if (!xc || !yc) return xc ? (y.s = -b, y) : new BigNumber2(yc ? x : NaN);
|
|
56606
54843
|
if (!xc[0] || !yc[0]) {
|
|
56607
|
-
return yc[0] ? (y.s = -b, y) : new
|
|
54844
|
+
return yc[0] ? (y.s = -b, y) : new BigNumber2(xc[0] ? x : (
|
|
56608
54845
|
// IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
|
|
56609
54846
|
ROUNDING_MODE == 3 ? -0 : 0
|
|
56610
54847
|
));
|
|
@@ -56633,7 +54870,12 @@ var require_bignumber2 = __commonJS({
|
|
|
56633
54870
|
}
|
|
56634
54871
|
}
|
|
56635
54872
|
}
|
|
56636
|
-
if (xLTy)
|
|
54873
|
+
if (xLTy) {
|
|
54874
|
+
t = xc;
|
|
54875
|
+
xc = yc;
|
|
54876
|
+
yc = t;
|
|
54877
|
+
y.s = -y.s;
|
|
54878
|
+
}
|
|
56637
54879
|
b = (j = yc.length) - (i = xc.length);
|
|
56638
54880
|
if (b > 0) for (; b--; xc[i++] = 0) ;
|
|
56639
54881
|
b = BASE - 1;
|
|
@@ -56655,11 +54897,11 @@ var require_bignumber2 = __commonJS({
|
|
|
56655
54897
|
};
|
|
56656
54898
|
P.modulo = P.mod = function(y, b) {
|
|
56657
54899
|
var q, s, x = this;
|
|
56658
|
-
y = new
|
|
54900
|
+
y = new BigNumber2(y, b);
|
|
56659
54901
|
if (!x.c || !y.s || y.c && !y.c[0]) {
|
|
56660
|
-
return new
|
|
54902
|
+
return new BigNumber2(NaN);
|
|
56661
54903
|
} else if (!y.c || x.c && !x.c[0]) {
|
|
56662
|
-
return new
|
|
54904
|
+
return new BigNumber2(x);
|
|
56663
54905
|
}
|
|
56664
54906
|
if (MODULO_MODE == 9) {
|
|
56665
54907
|
s = y.s;
|
|
@@ -56675,7 +54917,7 @@ var require_bignumber2 = __commonJS({
|
|
|
56675
54917
|
return y;
|
|
56676
54918
|
};
|
|
56677
54919
|
P.multipliedBy = P.times = function(y, b) {
|
|
56678
|
-
var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc, base, sqrtBase, x = this, xc = x.c, yc = (y = new
|
|
54920
|
+
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;
|
|
56679
54921
|
if (!xc || !yc || !xc[0] || !yc[0]) {
|
|
56680
54922
|
if (!x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc) {
|
|
56681
54923
|
y.c = y.e = y.s = null;
|
|
@@ -56694,7 +54936,14 @@ var require_bignumber2 = __commonJS({
|
|
|
56694
54936
|
y.s *= x.s;
|
|
56695
54937
|
xcL = xc.length;
|
|
56696
54938
|
ycL = yc.length;
|
|
56697
|
-
if (xcL < ycL)
|
|
54939
|
+
if (xcL < ycL) {
|
|
54940
|
+
zc = xc;
|
|
54941
|
+
xc = yc;
|
|
54942
|
+
yc = zc;
|
|
54943
|
+
i = xcL;
|
|
54944
|
+
xcL = ycL;
|
|
54945
|
+
ycL = i;
|
|
54946
|
+
}
|
|
56698
54947
|
for (i = xcL + ycL, zc = []; i--; zc.push(0)) ;
|
|
56699
54948
|
base = BASE;
|
|
56700
54949
|
sqrtBase = SQRT_BASE;
|
|
@@ -56720,23 +54969,23 @@ var require_bignumber2 = __commonJS({
|
|
|
56720
54969
|
return normalise(y, zc, e);
|
|
56721
54970
|
};
|
|
56722
54971
|
P.negated = function() {
|
|
56723
|
-
var x = new
|
|
54972
|
+
var x = new BigNumber2(this);
|
|
56724
54973
|
x.s = -x.s || null;
|
|
56725
54974
|
return x;
|
|
56726
54975
|
};
|
|
56727
54976
|
P.plus = function(y, b) {
|
|
56728
54977
|
var t, x = this, a = x.s;
|
|
56729
|
-
y = new
|
|
54978
|
+
y = new BigNumber2(y, b);
|
|
56730
54979
|
b = y.s;
|
|
56731
|
-
if (!a || !b) return new
|
|
54980
|
+
if (!a || !b) return new BigNumber2(NaN);
|
|
56732
54981
|
if (a != b) {
|
|
56733
54982
|
y.s = -b;
|
|
56734
54983
|
return x.minus(y);
|
|
56735
54984
|
}
|
|
56736
54985
|
var xe = x.e / LOG_BASE, ye = y.e / LOG_BASE, xc = x.c, yc = y.c;
|
|
56737
54986
|
if (!xe || !ye) {
|
|
56738
|
-
if (!xc || !yc) return new
|
|
56739
|
-
if (!xc[0] || !yc[0]) return yc[0] ? y : new
|
|
54987
|
+
if (!xc || !yc) return new BigNumber2(a / 0);
|
|
54988
|
+
if (!xc[0] || !yc[0]) return yc[0] ? y : new BigNumber2(xc[0] ? x : a * 0);
|
|
56740
54989
|
}
|
|
56741
54990
|
xe = bitFloor(xe);
|
|
56742
54991
|
ye = bitFloor(ye);
|
|
@@ -56755,7 +55004,12 @@ var require_bignumber2 = __commonJS({
|
|
|
56755
55004
|
}
|
|
56756
55005
|
a = xc.length;
|
|
56757
55006
|
b = yc.length;
|
|
56758
|
-
if (a - b < 0)
|
|
55007
|
+
if (a - b < 0) {
|
|
55008
|
+
t = yc;
|
|
55009
|
+
yc = xc;
|
|
55010
|
+
xc = t;
|
|
55011
|
+
b = a;
|
|
55012
|
+
}
|
|
56759
55013
|
for (a = 0; b; ) {
|
|
56760
55014
|
a = (xc[--b] = xc[b] + yc[b] + a) / BASE | 0;
|
|
56761
55015
|
xc[b] = BASE === xc[b] ? 0 : xc[b] % BASE;
|
|
@@ -56772,7 +55026,7 @@ var require_bignumber2 = __commonJS({
|
|
|
56772
55026
|
intCheck(sd, 1, MAX);
|
|
56773
55027
|
if (rm == null) rm = ROUNDING_MODE;
|
|
56774
55028
|
else intCheck(rm, 0, 8);
|
|
56775
|
-
return round(new
|
|
55029
|
+
return round(new BigNumber2(x), sd, rm);
|
|
56776
55030
|
}
|
|
56777
55031
|
if (!(c = x.c)) return null;
|
|
56778
55032
|
v = c.length - 1;
|
|
@@ -56789,9 +55043,9 @@ var require_bignumber2 = __commonJS({
|
|
|
56789
55043
|
return this.times("1e" + k);
|
|
56790
55044
|
};
|
|
56791
55045
|
P.squareRoot = P.sqrt = function() {
|
|
56792
|
-
var m, n, r, rep, t, x = this, c = x.c, s = x.s, e = x.e, dp = DECIMAL_PLACES + 4, half = new
|
|
55046
|
+
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");
|
|
56793
55047
|
if (s !== 1 || !c || !c[0]) {
|
|
56794
|
-
return new
|
|
55048
|
+
return new BigNumber2(!s || s < 0 && (!c || c[0]) ? NaN : c ? x : 1 / 0);
|
|
56795
55049
|
}
|
|
56796
55050
|
s = Math.sqrt(+valueOf(x));
|
|
56797
55051
|
if (s == 0 || s == 1 / 0) {
|
|
@@ -56800,14 +55054,14 @@ var require_bignumber2 = __commonJS({
|
|
|
56800
55054
|
s = Math.sqrt(+n);
|
|
56801
55055
|
e = bitFloor((e + 1) / 2) - (e < 0 || e % 2);
|
|
56802
55056
|
if (s == 1 / 0) {
|
|
56803
|
-
n = "
|
|
55057
|
+
n = "5e" + e;
|
|
56804
55058
|
} else {
|
|
56805
55059
|
n = s.toExponential();
|
|
56806
55060
|
n = n.slice(0, n.indexOf("e") + 1) + e;
|
|
56807
55061
|
}
|
|
56808
|
-
r = new
|
|
55062
|
+
r = new BigNumber2(n);
|
|
56809
55063
|
} else {
|
|
56810
|
-
r = new
|
|
55064
|
+
r = new BigNumber2(s + "");
|
|
56811
55065
|
}
|
|
56812
55066
|
if (r.c[0]) {
|
|
56813
55067
|
e = r.e;
|
|
@@ -56854,193 +55108,607 @@ var require_bignumber2 = __commonJS({
|
|
|
56854
55108
|
intCheck(dp, 0, MAX);
|
|
56855
55109
|
dp = dp + this.e + 1;
|
|
56856
55110
|
}
|
|
56857
|
-
return format(this, dp, rm);
|
|
56858
|
-
};
|
|
56859
|
-
P.toFormat = function(dp, rm, format2) {
|
|
56860
|
-
var str, x = this;
|
|
56861
|
-
if (format2 == null) {
|
|
56862
|
-
if (dp != null && rm && typeof rm == "object") {
|
|
56863
|
-
format2 = rm;
|
|
56864
|
-
rm = null;
|
|
56865
|
-
} else if (dp && typeof dp == "object") {
|
|
56866
|
-
format2 = dp;
|
|
56867
|
-
dp = rm = null;
|
|
56868
|
-
} else {
|
|
56869
|
-
format2 = FORMAT;
|
|
55111
|
+
return format(this, dp, rm);
|
|
55112
|
+
};
|
|
55113
|
+
P.toFormat = function(dp, rm, format2) {
|
|
55114
|
+
var str, x = this;
|
|
55115
|
+
if (format2 == null) {
|
|
55116
|
+
if (dp != null && rm && typeof rm == "object") {
|
|
55117
|
+
format2 = rm;
|
|
55118
|
+
rm = null;
|
|
55119
|
+
} else if (dp && typeof dp == "object") {
|
|
55120
|
+
format2 = dp;
|
|
55121
|
+
dp = rm = null;
|
|
55122
|
+
} else {
|
|
55123
|
+
format2 = FORMAT;
|
|
55124
|
+
}
|
|
55125
|
+
} else if (typeof format2 != "object") {
|
|
55126
|
+
throw Error(bignumberError + "Argument not an object: " + format2);
|
|
55127
|
+
}
|
|
55128
|
+
str = x.toFixed(dp, rm);
|
|
55129
|
+
if (x.c) {
|
|
55130
|
+
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;
|
|
55131
|
+
if (g2) {
|
|
55132
|
+
i = g1;
|
|
55133
|
+
g1 = g2;
|
|
55134
|
+
g2 = i;
|
|
55135
|
+
len -= i;
|
|
55136
|
+
}
|
|
55137
|
+
if (g1 > 0 && len > 0) {
|
|
55138
|
+
i = len % g1 || g1;
|
|
55139
|
+
intPart = intDigits.substr(0, i);
|
|
55140
|
+
for (; i < len; i += g1) intPart += groupSeparator + intDigits.substr(i, g1);
|
|
55141
|
+
if (g2 > 0) intPart += groupSeparator + intDigits.slice(i);
|
|
55142
|
+
if (isNeg) intPart = "-" + intPart;
|
|
55143
|
+
}
|
|
55144
|
+
str = fractionPart ? intPart + (format2.decimalSeparator || "") + ((g2 = +format2.fractionGroupSize) ? fractionPart.replace(
|
|
55145
|
+
new RegExp("\\d{" + g2 + "}\\B", "g"),
|
|
55146
|
+
"$&" + (format2.fractionGroupSeparator || "")
|
|
55147
|
+
) : fractionPart) : intPart;
|
|
55148
|
+
}
|
|
55149
|
+
return (format2.prefix || "") + str + (format2.suffix || "");
|
|
55150
|
+
};
|
|
55151
|
+
P.toFraction = function(md) {
|
|
55152
|
+
var d, d0, d1, d2, e, exp, n, n0, n1, q, r, s, x = this, xc = x.c;
|
|
55153
|
+
if (md != null) {
|
|
55154
|
+
n = new BigNumber2(md);
|
|
55155
|
+
if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) {
|
|
55156
|
+
throw Error(bignumberError + "Argument " + (n.isInteger() ? "out of range: " : "not an integer: ") + valueOf(n));
|
|
55157
|
+
}
|
|
55158
|
+
}
|
|
55159
|
+
if (!xc) return new BigNumber2(x);
|
|
55160
|
+
d = new BigNumber2(ONE);
|
|
55161
|
+
n1 = d0 = new BigNumber2(ONE);
|
|
55162
|
+
d1 = n0 = new BigNumber2(ONE);
|
|
55163
|
+
s = coeffToString(xc);
|
|
55164
|
+
e = d.e = s.length - x.e - 1;
|
|
55165
|
+
d.c[0] = POWS_TEN[(exp = e % LOG_BASE) < 0 ? LOG_BASE + exp : exp];
|
|
55166
|
+
md = !md || n.comparedTo(d) > 0 ? e > 0 ? d : n1 : n;
|
|
55167
|
+
exp = MAX_EXP;
|
|
55168
|
+
MAX_EXP = 1 / 0;
|
|
55169
|
+
n = new BigNumber2(s);
|
|
55170
|
+
n0.c[0] = 0;
|
|
55171
|
+
for (; ; ) {
|
|
55172
|
+
q = div(n, d, 0, 1);
|
|
55173
|
+
d2 = d0.plus(q.times(d1));
|
|
55174
|
+
if (d2.comparedTo(md) == 1) break;
|
|
55175
|
+
d0 = d1;
|
|
55176
|
+
d1 = d2;
|
|
55177
|
+
n1 = n0.plus(q.times(d2 = n1));
|
|
55178
|
+
n0 = d2;
|
|
55179
|
+
d = n.minus(q.times(d2 = d));
|
|
55180
|
+
n = d2;
|
|
55181
|
+
}
|
|
55182
|
+
d2 = div(md.minus(d0), d1, 0, 1);
|
|
55183
|
+
n0 = n0.plus(d2.times(n1));
|
|
55184
|
+
d0 = d0.plus(d2.times(d1));
|
|
55185
|
+
n0.s = n1.s = x.s;
|
|
55186
|
+
e = e * 2;
|
|
55187
|
+
r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo(
|
|
55188
|
+
div(n0, d0, e, ROUNDING_MODE).minus(x).abs()
|
|
55189
|
+
) < 1 ? [n1, d1] : [n0, d0];
|
|
55190
|
+
MAX_EXP = exp;
|
|
55191
|
+
return r;
|
|
55192
|
+
};
|
|
55193
|
+
P.toNumber = function() {
|
|
55194
|
+
return +valueOf(this);
|
|
55195
|
+
};
|
|
55196
|
+
P.toPrecision = function(sd, rm) {
|
|
55197
|
+
if (sd != null) intCheck(sd, 1, MAX);
|
|
55198
|
+
return format(this, sd, rm, 2);
|
|
55199
|
+
};
|
|
55200
|
+
P.toString = function(b) {
|
|
55201
|
+
var str, n = this, s = n.s, e = n.e;
|
|
55202
|
+
if (e === null) {
|
|
55203
|
+
if (s) {
|
|
55204
|
+
str = "Infinity";
|
|
55205
|
+
if (s < 0) str = "-" + str;
|
|
55206
|
+
} else {
|
|
55207
|
+
str = "NaN";
|
|
55208
|
+
}
|
|
55209
|
+
} else {
|
|
55210
|
+
if (b == null) {
|
|
55211
|
+
str = e <= TO_EXP_NEG || e >= TO_EXP_POS ? toExponential(coeffToString(n.c), e) : toFixedPoint(coeffToString(n.c), e, "0");
|
|
55212
|
+
} else if (b === 10 && alphabetHasNormalDecimalDigits) {
|
|
55213
|
+
n = round(new BigNumber2(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE);
|
|
55214
|
+
str = toFixedPoint(coeffToString(n.c), n.e, "0");
|
|
55215
|
+
} else {
|
|
55216
|
+
intCheck(b, 2, ALPHABET.length, "Base");
|
|
55217
|
+
str = convertBase(toFixedPoint(coeffToString(n.c), e, "0"), 10, b, s, true);
|
|
55218
|
+
}
|
|
55219
|
+
if (s < 0 && n.c[0]) str = "-" + str;
|
|
55220
|
+
}
|
|
55221
|
+
return str;
|
|
55222
|
+
};
|
|
55223
|
+
P.valueOf = P.toJSON = function() {
|
|
55224
|
+
return valueOf(this);
|
|
55225
|
+
};
|
|
55226
|
+
P._isBigNumber = true;
|
|
55227
|
+
if (configObject != null) BigNumber2.set(configObject);
|
|
55228
|
+
return BigNumber2;
|
|
55229
|
+
}
|
|
55230
|
+
function bitFloor(n) {
|
|
55231
|
+
var i = n | 0;
|
|
55232
|
+
return n > 0 || n === i ? i : i - 1;
|
|
55233
|
+
}
|
|
55234
|
+
function coeffToString(a) {
|
|
55235
|
+
var s, z3, i = 1, j = a.length, r = a[0] + "";
|
|
55236
|
+
for (; i < j; ) {
|
|
55237
|
+
s = a[i++] + "";
|
|
55238
|
+
z3 = LOG_BASE - s.length;
|
|
55239
|
+
for (; z3--; s = "0" + s) ;
|
|
55240
|
+
r += s;
|
|
55241
|
+
}
|
|
55242
|
+
for (j = r.length; r.charCodeAt(--j) === 48; ) ;
|
|
55243
|
+
return r.slice(0, j + 1 || 1);
|
|
55244
|
+
}
|
|
55245
|
+
function compare(x, y) {
|
|
55246
|
+
var a, b, xc = x.c, yc = y.c, i = x.s, j = y.s, k = x.e, l = y.e;
|
|
55247
|
+
if (!i || !j) return null;
|
|
55248
|
+
a = xc && !xc[0];
|
|
55249
|
+
b = yc && !yc[0];
|
|
55250
|
+
if (a || b) return a ? b ? 0 : -j : i;
|
|
55251
|
+
if (i != j) return i;
|
|
55252
|
+
a = i < 0;
|
|
55253
|
+
b = k == l;
|
|
55254
|
+
if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1;
|
|
55255
|
+
if (!b) return k > l ^ a ? 1 : -1;
|
|
55256
|
+
j = (k = xc.length) < (l = yc.length) ? k : l;
|
|
55257
|
+
for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1;
|
|
55258
|
+
return k == l ? 0 : k > l ^ a ? 1 : -1;
|
|
55259
|
+
}
|
|
55260
|
+
function intCheck(n, min, max, name) {
|
|
55261
|
+
if (n < min || n > max || n !== mathfloor(n)) {
|
|
55262
|
+
throw Error(bignumberError + (name || "Argument") + (typeof n == "number" ? n < min || n > max ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(n));
|
|
55263
|
+
}
|
|
55264
|
+
}
|
|
55265
|
+
function isOdd(n) {
|
|
55266
|
+
var k = n.c.length - 1;
|
|
55267
|
+
return bitFloor(n.e / LOG_BASE) == k && n.c[k] % 2 != 0;
|
|
55268
|
+
}
|
|
55269
|
+
function toExponential(str, e) {
|
|
55270
|
+
return (str.length > 1 ? str.charAt(0) + "." + str.slice(1) : str) + (e < 0 ? "e" : "e+") + e;
|
|
55271
|
+
}
|
|
55272
|
+
function toFixedPoint(str, e, z3) {
|
|
55273
|
+
var len, zs;
|
|
55274
|
+
if (e < 0) {
|
|
55275
|
+
for (zs = z3 + "."; ++e; zs += z3) ;
|
|
55276
|
+
str = zs + str;
|
|
55277
|
+
} else {
|
|
55278
|
+
len = str.length;
|
|
55279
|
+
if (++e > len) {
|
|
55280
|
+
for (zs = z3, e -= len; --e; zs += z3) ;
|
|
55281
|
+
str += zs;
|
|
55282
|
+
} else if (e < len) {
|
|
55283
|
+
str = str.slice(0, e) + "." + str.slice(e);
|
|
55284
|
+
}
|
|
55285
|
+
}
|
|
55286
|
+
return str;
|
|
55287
|
+
}
|
|
55288
|
+
BigNumber = clone2();
|
|
55289
|
+
BigNumber["default"] = BigNumber.BigNumber = BigNumber;
|
|
55290
|
+
if (typeof define == "function" && define.amd) {
|
|
55291
|
+
define(function() {
|
|
55292
|
+
return BigNumber;
|
|
55293
|
+
});
|
|
55294
|
+
} else if (typeof module != "undefined" && module.exports) {
|
|
55295
|
+
module.exports = BigNumber;
|
|
55296
|
+
} else {
|
|
55297
|
+
if (!globalObject) {
|
|
55298
|
+
globalObject = typeof self != "undefined" && self ? self : window;
|
|
55299
|
+
}
|
|
55300
|
+
globalObject.BigNumber = BigNumber;
|
|
55301
|
+
}
|
|
55302
|
+
})(exports);
|
|
55303
|
+
}
|
|
55304
|
+
});
|
|
55305
|
+
|
|
55306
|
+
// node_modules/json-bigint/lib/stringify.js
|
|
55307
|
+
var require_stringify = __commonJS({
|
|
55308
|
+
"node_modules/json-bigint/lib/stringify.js"(exports, module) {
|
|
55309
|
+
var BigNumber = require_bignumber();
|
|
55310
|
+
var JSON2 = module.exports;
|
|
55311
|
+
(function() {
|
|
55312
|
+
"use strict";
|
|
55313
|
+
function f(n) {
|
|
55314
|
+
return n < 10 ? "0" + n : n;
|
|
55315
|
+
}
|
|
55316
|
+
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 = {
|
|
55317
|
+
// table of character substitutions
|
|
55318
|
+
"\b": "\\b",
|
|
55319
|
+
" ": "\\t",
|
|
55320
|
+
"\n": "\\n",
|
|
55321
|
+
"\f": "\\f",
|
|
55322
|
+
"\r": "\\r",
|
|
55323
|
+
'"': '\\"',
|
|
55324
|
+
"\\": "\\\\"
|
|
55325
|
+
}, rep;
|
|
55326
|
+
function quote(string4) {
|
|
55327
|
+
escapable.lastIndex = 0;
|
|
55328
|
+
return escapable.test(string4) ? '"' + string4.replace(escapable, function(a) {
|
|
55329
|
+
var c = meta3[a];
|
|
55330
|
+
return typeof c === "string" ? c : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
|
|
55331
|
+
}) + '"' : '"' + string4 + '"';
|
|
55332
|
+
}
|
|
55333
|
+
function str(key, holder) {
|
|
55334
|
+
var i, k, v, length, mind = gap, partial2, value = holder[key], isBigNumber3 = value != null && (value instanceof BigNumber || BigNumber.isBigNumber(value));
|
|
55335
|
+
if (value && typeof value === "object" && typeof value.toJSON === "function") {
|
|
55336
|
+
value = value.toJSON(key);
|
|
55337
|
+
}
|
|
55338
|
+
if (typeof rep === "function") {
|
|
55339
|
+
value = rep.call(holder, key, value);
|
|
55340
|
+
}
|
|
55341
|
+
switch (typeof value) {
|
|
55342
|
+
case "string":
|
|
55343
|
+
if (isBigNumber3) {
|
|
55344
|
+
return value;
|
|
55345
|
+
} else {
|
|
55346
|
+
return quote(value);
|
|
55347
|
+
}
|
|
55348
|
+
case "number":
|
|
55349
|
+
return isFinite(value) ? String(value) : "null";
|
|
55350
|
+
case "boolean":
|
|
55351
|
+
case "null":
|
|
55352
|
+
case "bigint":
|
|
55353
|
+
return String(value);
|
|
55354
|
+
// If the type is 'object', we might be dealing with an object or an array or
|
|
55355
|
+
// null.
|
|
55356
|
+
case "object":
|
|
55357
|
+
if (!value) {
|
|
55358
|
+
return "null";
|
|
55359
|
+
}
|
|
55360
|
+
gap += indent;
|
|
55361
|
+
partial2 = [];
|
|
55362
|
+
if (Object.prototype.toString.apply(value) === "[object Array]") {
|
|
55363
|
+
length = value.length;
|
|
55364
|
+
for (i = 0; i < length; i += 1) {
|
|
55365
|
+
partial2[i] = str(i, value) || "null";
|
|
55366
|
+
}
|
|
55367
|
+
v = partial2.length === 0 ? "[]" : gap ? "[\n" + gap + partial2.join(",\n" + gap) + "\n" + mind + "]" : "[" + partial2.join(",") + "]";
|
|
55368
|
+
gap = mind;
|
|
55369
|
+
return v;
|
|
55370
|
+
}
|
|
55371
|
+
if (rep && typeof rep === "object") {
|
|
55372
|
+
length = rep.length;
|
|
55373
|
+
for (i = 0; i < length; i += 1) {
|
|
55374
|
+
if (typeof rep[i] === "string") {
|
|
55375
|
+
k = rep[i];
|
|
55376
|
+
v = str(k, value);
|
|
55377
|
+
if (v) {
|
|
55378
|
+
partial2.push(quote(k) + (gap ? ": " : ":") + v);
|
|
55379
|
+
}
|
|
55380
|
+
}
|
|
55381
|
+
}
|
|
55382
|
+
} else {
|
|
55383
|
+
Object.keys(value).forEach(function(k2) {
|
|
55384
|
+
var v2 = str(k2, value);
|
|
55385
|
+
if (v2) {
|
|
55386
|
+
partial2.push(quote(k2) + (gap ? ": " : ":") + v2);
|
|
55387
|
+
}
|
|
55388
|
+
});
|
|
55389
|
+
}
|
|
55390
|
+
v = partial2.length === 0 ? "{}" : gap ? "{\n" + gap + partial2.join(",\n" + gap) + "\n" + mind + "}" : "{" + partial2.join(",") + "}";
|
|
55391
|
+
gap = mind;
|
|
55392
|
+
return v;
|
|
55393
|
+
}
|
|
55394
|
+
}
|
|
55395
|
+
if (typeof JSON2.stringify !== "function") {
|
|
55396
|
+
JSON2.stringify = function(value, replacer, space) {
|
|
55397
|
+
var i;
|
|
55398
|
+
gap = "";
|
|
55399
|
+
indent = "";
|
|
55400
|
+
if (typeof space === "number") {
|
|
55401
|
+
for (i = 0; i < space; i += 1) {
|
|
55402
|
+
indent += " ";
|
|
55403
|
+
}
|
|
55404
|
+
} else if (typeof space === "string") {
|
|
55405
|
+
indent = space;
|
|
55406
|
+
}
|
|
55407
|
+
rep = replacer;
|
|
55408
|
+
if (replacer && typeof replacer !== "function" && (typeof replacer !== "object" || typeof replacer.length !== "number")) {
|
|
55409
|
+
throw new Error("JSON.stringify");
|
|
55410
|
+
}
|
|
55411
|
+
return str("", { "": value });
|
|
55412
|
+
};
|
|
55413
|
+
}
|
|
55414
|
+
})();
|
|
55415
|
+
}
|
|
55416
|
+
});
|
|
55417
|
+
|
|
55418
|
+
// node_modules/json-bigint/lib/parse.js
|
|
55419
|
+
var require_parse2 = __commonJS({
|
|
55420
|
+
"node_modules/json-bigint/lib/parse.js"(exports, module) {
|
|
55421
|
+
var BigNumber = null;
|
|
55422
|
+
var suspectProtoRx = /(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/;
|
|
55423
|
+
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)/;
|
|
55424
|
+
var json_parse = function(options) {
|
|
55425
|
+
"use strict";
|
|
55426
|
+
var _options = {
|
|
55427
|
+
strict: false,
|
|
55428
|
+
// not being strict means do not generate syntax errors for "duplicate key"
|
|
55429
|
+
storeAsString: false,
|
|
55430
|
+
// toggles whether the values should be stored as BigNumber (default) or a string
|
|
55431
|
+
alwaysParseAsBig: false,
|
|
55432
|
+
// toggles whether all numbers should be Big
|
|
55433
|
+
useNativeBigInt: false,
|
|
55434
|
+
// toggles whether to use native BigInt instead of bignumber.js
|
|
55435
|
+
protoAction: "error",
|
|
55436
|
+
constructorAction: "error"
|
|
55437
|
+
};
|
|
55438
|
+
if (options !== void 0 && options !== null) {
|
|
55439
|
+
if (options.strict === true) {
|
|
55440
|
+
_options.strict = true;
|
|
55441
|
+
}
|
|
55442
|
+
if (options.storeAsString === true) {
|
|
55443
|
+
_options.storeAsString = true;
|
|
55444
|
+
}
|
|
55445
|
+
_options.alwaysParseAsBig = options.alwaysParseAsBig === true ? options.alwaysParseAsBig : false;
|
|
55446
|
+
_options.useNativeBigInt = options.useNativeBigInt === true ? options.useNativeBigInt : false;
|
|
55447
|
+
if (typeof options.constructorAction !== "undefined") {
|
|
55448
|
+
if (options.constructorAction === "error" || options.constructorAction === "ignore" || options.constructorAction === "preserve") {
|
|
55449
|
+
_options.constructorAction = options.constructorAction;
|
|
55450
|
+
} else {
|
|
55451
|
+
throw new Error(
|
|
55452
|
+
`Incorrect value for constructorAction option, must be "error", "ignore" or undefined but passed ${options.constructorAction}`
|
|
55453
|
+
);
|
|
55454
|
+
}
|
|
55455
|
+
}
|
|
55456
|
+
if (typeof options.protoAction !== "undefined") {
|
|
55457
|
+
if (options.protoAction === "error" || options.protoAction === "ignore" || options.protoAction === "preserve") {
|
|
55458
|
+
_options.protoAction = options.protoAction;
|
|
55459
|
+
} else {
|
|
55460
|
+
throw new Error(
|
|
55461
|
+
`Incorrect value for protoAction option, must be "error", "ignore" or undefined but passed ${options.protoAction}`
|
|
55462
|
+
);
|
|
55463
|
+
}
|
|
55464
|
+
}
|
|
55465
|
+
}
|
|
55466
|
+
var at, ch, escapee = {
|
|
55467
|
+
'"': '"',
|
|
55468
|
+
"\\": "\\",
|
|
55469
|
+
"/": "/",
|
|
55470
|
+
b: "\b",
|
|
55471
|
+
f: "\f",
|
|
55472
|
+
n: "\n",
|
|
55473
|
+
r: "\r",
|
|
55474
|
+
t: " "
|
|
55475
|
+
}, text, error49 = function(m) {
|
|
55476
|
+
throw {
|
|
55477
|
+
name: "SyntaxError",
|
|
55478
|
+
message: m,
|
|
55479
|
+
at,
|
|
55480
|
+
text
|
|
55481
|
+
};
|
|
55482
|
+
}, next = function(c) {
|
|
55483
|
+
if (c && c !== ch) {
|
|
55484
|
+
error49("Expected '" + c + "' instead of '" + ch + "'");
|
|
55485
|
+
}
|
|
55486
|
+
ch = text.charAt(at);
|
|
55487
|
+
at += 1;
|
|
55488
|
+
return ch;
|
|
55489
|
+
}, number4 = function() {
|
|
55490
|
+
var number5, string5 = "";
|
|
55491
|
+
if (ch === "-") {
|
|
55492
|
+
string5 = "-";
|
|
55493
|
+
next("-");
|
|
55494
|
+
}
|
|
55495
|
+
while (ch >= "0" && ch <= "9") {
|
|
55496
|
+
string5 += ch;
|
|
55497
|
+
next();
|
|
55498
|
+
}
|
|
55499
|
+
if (ch === ".") {
|
|
55500
|
+
string5 += ".";
|
|
55501
|
+
while (next() && ch >= "0" && ch <= "9") {
|
|
55502
|
+
string5 += ch;
|
|
55503
|
+
}
|
|
55504
|
+
}
|
|
55505
|
+
if (ch === "e" || ch === "E") {
|
|
55506
|
+
string5 += ch;
|
|
55507
|
+
next();
|
|
55508
|
+
if (ch === "-" || ch === "+") {
|
|
55509
|
+
string5 += ch;
|
|
55510
|
+
next();
|
|
55511
|
+
}
|
|
55512
|
+
while (ch >= "0" && ch <= "9") {
|
|
55513
|
+
string5 += ch;
|
|
55514
|
+
next();
|
|
55515
|
+
}
|
|
55516
|
+
}
|
|
55517
|
+
number5 = +string5;
|
|
55518
|
+
if (!isFinite(number5)) {
|
|
55519
|
+
error49("Bad number");
|
|
55520
|
+
} else {
|
|
55521
|
+
if (BigNumber == null) BigNumber = require_bignumber();
|
|
55522
|
+
if (string5.length > 15)
|
|
55523
|
+
return _options.storeAsString ? string5 : _options.useNativeBigInt ? BigInt(string5) : new BigNumber(string5);
|
|
55524
|
+
else
|
|
55525
|
+
return !_options.alwaysParseAsBig ? number5 : _options.useNativeBigInt ? BigInt(number5) : new BigNumber(number5);
|
|
55526
|
+
}
|
|
55527
|
+
}, string4 = function() {
|
|
55528
|
+
var hex3, i, string5 = "", uffff;
|
|
55529
|
+
if (ch === '"') {
|
|
55530
|
+
var startAt = at;
|
|
55531
|
+
while (next()) {
|
|
55532
|
+
if (ch === '"') {
|
|
55533
|
+
if (at - 1 > startAt) string5 += text.substring(startAt, at - 1);
|
|
55534
|
+
next();
|
|
55535
|
+
return string5;
|
|
55536
|
+
}
|
|
55537
|
+
if (ch === "\\") {
|
|
55538
|
+
if (at - 1 > startAt) string5 += text.substring(startAt, at - 1);
|
|
55539
|
+
next();
|
|
55540
|
+
if (ch === "u") {
|
|
55541
|
+
uffff = 0;
|
|
55542
|
+
for (i = 0; i < 4; i += 1) {
|
|
55543
|
+
hex3 = parseInt(next(), 16);
|
|
55544
|
+
if (!isFinite(hex3)) {
|
|
55545
|
+
break;
|
|
55546
|
+
}
|
|
55547
|
+
uffff = uffff * 16 + hex3;
|
|
55548
|
+
}
|
|
55549
|
+
string5 += String.fromCharCode(uffff);
|
|
55550
|
+
} else if (typeof escapee[ch] === "string") {
|
|
55551
|
+
string5 += escapee[ch];
|
|
55552
|
+
} else {
|
|
55553
|
+
break;
|
|
55554
|
+
}
|
|
55555
|
+
startAt = at;
|
|
55556
|
+
}
|
|
55557
|
+
}
|
|
55558
|
+
}
|
|
55559
|
+
error49("Bad string");
|
|
55560
|
+
}, white = function() {
|
|
55561
|
+
while (ch && ch <= " ") {
|
|
55562
|
+
next();
|
|
55563
|
+
}
|
|
55564
|
+
}, word = function() {
|
|
55565
|
+
switch (ch) {
|
|
55566
|
+
case "t":
|
|
55567
|
+
next("t");
|
|
55568
|
+
next("r");
|
|
55569
|
+
next("u");
|
|
55570
|
+
next("e");
|
|
55571
|
+
return true;
|
|
55572
|
+
case "f":
|
|
55573
|
+
next("f");
|
|
55574
|
+
next("a");
|
|
55575
|
+
next("l");
|
|
55576
|
+
next("s");
|
|
55577
|
+
next("e");
|
|
55578
|
+
return false;
|
|
55579
|
+
case "n":
|
|
55580
|
+
next("n");
|
|
55581
|
+
next("u");
|
|
55582
|
+
next("l");
|
|
55583
|
+
next("l");
|
|
55584
|
+
return null;
|
|
55585
|
+
}
|
|
55586
|
+
error49("Unexpected '" + ch + "'");
|
|
55587
|
+
}, value, array2 = function() {
|
|
55588
|
+
var array3 = [];
|
|
55589
|
+
if (ch === "[") {
|
|
55590
|
+
next("[");
|
|
55591
|
+
white();
|
|
55592
|
+
if (ch === "]") {
|
|
55593
|
+
next("]");
|
|
55594
|
+
return array3;
|
|
55595
|
+
}
|
|
55596
|
+
while (ch) {
|
|
55597
|
+
array3.push(value());
|
|
55598
|
+
white();
|
|
55599
|
+
if (ch === "]") {
|
|
55600
|
+
next("]");
|
|
55601
|
+
return array3;
|
|
56870
55602
|
}
|
|
56871
|
-
|
|
56872
|
-
|
|
55603
|
+
next(",");
|
|
55604
|
+
white();
|
|
56873
55605
|
}
|
|
56874
|
-
|
|
56875
|
-
|
|
56876
|
-
|
|
56877
|
-
|
|
56878
|
-
|
|
56879
|
-
|
|
56880
|
-
|
|
56881
|
-
|
|
56882
|
-
|
|
56883
|
-
|
|
56884
|
-
}
|
|
56885
|
-
str = fractionPart ? intPart + (format2.decimalSeparator || "") + ((g2 = +format2.fractionGroupSize) ? fractionPart.replace(
|
|
56886
|
-
new RegExp("\\d{" + g2 + "}\\B", "g"),
|
|
56887
|
-
"$&" + (format2.fractionGroupSeparator || "")
|
|
56888
|
-
) : fractionPart) : intPart;
|
|
55606
|
+
}
|
|
55607
|
+
error49("Bad array");
|
|
55608
|
+
}, object2 = function() {
|
|
55609
|
+
var key, object3 = /* @__PURE__ */ Object.create(null);
|
|
55610
|
+
if (ch === "{") {
|
|
55611
|
+
next("{");
|
|
55612
|
+
white();
|
|
55613
|
+
if (ch === "}") {
|
|
55614
|
+
next("}");
|
|
55615
|
+
return object3;
|
|
56889
55616
|
}
|
|
56890
|
-
|
|
56891
|
-
|
|
56892
|
-
|
|
56893
|
-
|
|
56894
|
-
|
|
56895
|
-
|
|
56896
|
-
if (!n.isInteger() && (n.c || n.s !== 1) || n.lt(ONE)) {
|
|
56897
|
-
throw Error(bignumberError + "Argument " + (n.isInteger() ? "out of range: " : "not an integer: ") + valueOf(n));
|
|
55617
|
+
while (ch) {
|
|
55618
|
+
key = string4();
|
|
55619
|
+
white();
|
|
55620
|
+
next(":");
|
|
55621
|
+
if (_options.strict === true && Object.hasOwnProperty.call(object3, key)) {
|
|
55622
|
+
error49('Duplicate key "' + key + '"');
|
|
56898
55623
|
}
|
|
56899
|
-
|
|
56900
|
-
|
|
56901
|
-
|
|
56902
|
-
|
|
56903
|
-
|
|
56904
|
-
|
|
56905
|
-
|
|
56906
|
-
|
|
56907
|
-
|
|
56908
|
-
|
|
56909
|
-
|
|
56910
|
-
|
|
56911
|
-
|
|
56912
|
-
|
|
56913
|
-
|
|
56914
|
-
|
|
56915
|
-
if (d2.comparedTo(md) == 1) break;
|
|
56916
|
-
d0 = d1;
|
|
56917
|
-
d1 = d2;
|
|
56918
|
-
n1 = n0.plus(q.times(d2 = n1));
|
|
56919
|
-
n0 = d2;
|
|
56920
|
-
d = n.minus(q.times(d2 = d));
|
|
56921
|
-
n = d2;
|
|
56922
|
-
}
|
|
56923
|
-
d2 = div(md.minus(d0), d1, 0, 1);
|
|
56924
|
-
n0 = n0.plus(d2.times(n1));
|
|
56925
|
-
d0 = d0.plus(d2.times(d1));
|
|
56926
|
-
n0.s = n1.s = x.s;
|
|
56927
|
-
e = e * 2;
|
|
56928
|
-
r = div(n1, d1, e, ROUNDING_MODE).minus(x).abs().comparedTo(
|
|
56929
|
-
div(n0, d0, e, ROUNDING_MODE).minus(x).abs()
|
|
56930
|
-
) < 1 ? [n1, d1] : [n0, d0];
|
|
56931
|
-
MAX_EXP = exp;
|
|
56932
|
-
return r;
|
|
56933
|
-
};
|
|
56934
|
-
P.toNumber = function() {
|
|
56935
|
-
return +valueOf(this);
|
|
56936
|
-
};
|
|
56937
|
-
P.toPrecision = function(sd, rm) {
|
|
56938
|
-
if (sd != null) intCheck(sd, 1, MAX);
|
|
56939
|
-
return format(this, sd, rm, 2);
|
|
56940
|
-
};
|
|
56941
|
-
P.toString = function(b) {
|
|
56942
|
-
var str, n = this, s = n.s, e = n.e;
|
|
56943
|
-
if (e === null) {
|
|
56944
|
-
if (s) {
|
|
56945
|
-
str = "Infinity";
|
|
56946
|
-
if (s < 0) str = "-" + str;
|
|
55624
|
+
if (suspectProtoRx.test(key) === true) {
|
|
55625
|
+
if (_options.protoAction === "error") {
|
|
55626
|
+
error49("Object contains forbidden prototype property");
|
|
55627
|
+
} else if (_options.protoAction === "ignore") {
|
|
55628
|
+
value();
|
|
55629
|
+
} else {
|
|
55630
|
+
object3[key] = value();
|
|
55631
|
+
}
|
|
55632
|
+
} else if (suspectConstructorRx.test(key) === true) {
|
|
55633
|
+
if (_options.constructorAction === "error") {
|
|
55634
|
+
error49("Object contains forbidden constructor property");
|
|
55635
|
+
} else if (_options.constructorAction === "ignore") {
|
|
55636
|
+
value();
|
|
55637
|
+
} else {
|
|
55638
|
+
object3[key] = value();
|
|
55639
|
+
}
|
|
56947
55640
|
} else {
|
|
56948
|
-
|
|
55641
|
+
object3[key] = value();
|
|
56949
55642
|
}
|
|
56950
|
-
|
|
56951
|
-
if (
|
|
56952
|
-
|
|
56953
|
-
|
|
56954
|
-
n = round(new BigNumber3(n), DECIMAL_PLACES + e + 1, ROUNDING_MODE);
|
|
56955
|
-
str = toFixedPoint(coeffToString(n.c), n.e, "0");
|
|
56956
|
-
} else {
|
|
56957
|
-
intCheck(b, 2, ALPHABET.length, "Base");
|
|
56958
|
-
str = convertBase(toFixedPoint(coeffToString(n.c), e, "0"), 10, b, s, true);
|
|
55643
|
+
white();
|
|
55644
|
+
if (ch === "}") {
|
|
55645
|
+
next("}");
|
|
55646
|
+
return object3;
|
|
56959
55647
|
}
|
|
56960
|
-
|
|
55648
|
+
next(",");
|
|
55649
|
+
white();
|
|
56961
55650
|
}
|
|
56962
|
-
return str;
|
|
56963
|
-
};
|
|
56964
|
-
P.valueOf = P.toJSON = function() {
|
|
56965
|
-
return valueOf(this);
|
|
56966
|
-
};
|
|
56967
|
-
P._isBigNumber = true;
|
|
56968
|
-
if (configObject != null) BigNumber3.set(configObject);
|
|
56969
|
-
return BigNumber3;
|
|
56970
|
-
}
|
|
56971
|
-
function bitFloor(n) {
|
|
56972
|
-
var i = n | 0;
|
|
56973
|
-
return n > 0 || n === i ? i : i - 1;
|
|
56974
|
-
}
|
|
56975
|
-
function coeffToString(a) {
|
|
56976
|
-
var s, z3, i = 1, j = a.length, r = a[0] + "";
|
|
56977
|
-
for (; i < j; ) {
|
|
56978
|
-
s = a[i++] + "";
|
|
56979
|
-
z3 = LOG_BASE - s.length;
|
|
56980
|
-
for (; z3--; s = "0" + s) ;
|
|
56981
|
-
r += s;
|
|
56982
|
-
}
|
|
56983
|
-
for (j = r.length; r.charCodeAt(--j) === 48; ) ;
|
|
56984
|
-
return r.slice(0, j + 1 || 1);
|
|
56985
|
-
}
|
|
56986
|
-
function compare(x, y) {
|
|
56987
|
-
var a, b, xc = x.c, yc = y.c, i = x.s, j = y.s, k = x.e, l = y.e;
|
|
56988
|
-
if (!i || !j) return null;
|
|
56989
|
-
a = xc && !xc[0];
|
|
56990
|
-
b = yc && !yc[0];
|
|
56991
|
-
if (a || b) return a ? b ? 0 : -j : i;
|
|
56992
|
-
if (i != j) return i;
|
|
56993
|
-
a = i < 0;
|
|
56994
|
-
b = k == l;
|
|
56995
|
-
if (!xc || !yc) return b ? 0 : !xc ^ a ? 1 : -1;
|
|
56996
|
-
if (!b) return k > l ^ a ? 1 : -1;
|
|
56997
|
-
j = (k = xc.length) < (l = yc.length) ? k : l;
|
|
56998
|
-
for (i = 0; i < j; i++) if (xc[i] != yc[i]) return xc[i] > yc[i] ^ a ? 1 : -1;
|
|
56999
|
-
return k == l ? 0 : k > l ^ a ? 1 : -1;
|
|
57000
|
-
}
|
|
57001
|
-
function intCheck(n, min, max, name) {
|
|
57002
|
-
if (n < min || n > max || n !== mathfloor(n)) {
|
|
57003
|
-
throw Error(bignumberError + (name || "Argument") + (typeof n == "number" ? n < min || n > max ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(n));
|
|
57004
55651
|
}
|
|
57005
|
-
|
|
57006
|
-
|
|
57007
|
-
|
|
57008
|
-
|
|
57009
|
-
|
|
57010
|
-
|
|
57011
|
-
|
|
57012
|
-
|
|
57013
|
-
|
|
57014
|
-
|
|
57015
|
-
|
|
57016
|
-
|
|
57017
|
-
|
|
57018
|
-
|
|
57019
|
-
|
|
57020
|
-
if (++e > len) {
|
|
57021
|
-
for (zs = z3, e -= len; --e; zs += z3) ;
|
|
57022
|
-
str += zs;
|
|
57023
|
-
} else if (e < len) {
|
|
57024
|
-
str = str.slice(0, e) + "." + str.slice(e);
|
|
57025
|
-
}
|
|
55652
|
+
error49("Bad object");
|
|
55653
|
+
};
|
|
55654
|
+
value = function() {
|
|
55655
|
+
white();
|
|
55656
|
+
switch (ch) {
|
|
55657
|
+
case "{":
|
|
55658
|
+
return object2();
|
|
55659
|
+
case "[":
|
|
55660
|
+
return array2();
|
|
55661
|
+
case '"':
|
|
55662
|
+
return string4();
|
|
55663
|
+
case "-":
|
|
55664
|
+
return number4();
|
|
55665
|
+
default:
|
|
55666
|
+
return ch >= "0" && ch <= "9" ? number4() : word();
|
|
57026
55667
|
}
|
|
57027
|
-
|
|
57028
|
-
|
|
57029
|
-
|
|
57030
|
-
|
|
57031
|
-
|
|
57032
|
-
|
|
57033
|
-
|
|
57034
|
-
|
|
57035
|
-
|
|
57036
|
-
|
|
57037
|
-
} else {
|
|
57038
|
-
if (!globalObject) {
|
|
57039
|
-
globalObject = typeof self != "undefined" && self ? self : window;
|
|
55668
|
+
};
|
|
55669
|
+
return function(source, reviver3) {
|
|
55670
|
+
var result;
|
|
55671
|
+
text = source + "";
|
|
55672
|
+
at = 0;
|
|
55673
|
+
ch = " ";
|
|
55674
|
+
result = value();
|
|
55675
|
+
white();
|
|
55676
|
+
if (ch) {
|
|
55677
|
+
error49("Syntax error");
|
|
57040
55678
|
}
|
|
57041
|
-
|
|
57042
|
-
|
|
57043
|
-
|
|
55679
|
+
return typeof reviver3 === "function" ? (function walk(holder, key) {
|
|
55680
|
+
var k, v, value2 = holder[key];
|
|
55681
|
+
if (value2 && typeof value2 === "object") {
|
|
55682
|
+
Object.keys(value2).forEach(function(k2) {
|
|
55683
|
+
v = walk(value2, k2);
|
|
55684
|
+
if (v !== void 0) {
|
|
55685
|
+
value2[k2] = v;
|
|
55686
|
+
} else {
|
|
55687
|
+
delete value2[k2];
|
|
55688
|
+
}
|
|
55689
|
+
});
|
|
55690
|
+
}
|
|
55691
|
+
return reviver3.call(holder, key, value2);
|
|
55692
|
+
})({ "": result }, "") : result;
|
|
55693
|
+
};
|
|
55694
|
+
};
|
|
55695
|
+
module.exports = json_parse;
|
|
55696
|
+
}
|
|
55697
|
+
});
|
|
55698
|
+
|
|
55699
|
+
// node_modules/json-bigint/index.js
|
|
55700
|
+
var require_json_bigint = __commonJS({
|
|
55701
|
+
"node_modules/json-bigint/index.js"(exports, module) {
|
|
55702
|
+
var json_stringify = require_stringify().stringify;
|
|
55703
|
+
var json_parse = require_parse2();
|
|
55704
|
+
module.exports = function(options) {
|
|
55705
|
+
return {
|
|
55706
|
+
parse: json_parse(options),
|
|
55707
|
+
stringify: json_stringify
|
|
55708
|
+
};
|
|
55709
|
+
};
|
|
55710
|
+
module.exports.parse = json_parse();
|
|
55711
|
+
module.exports.stringify = json_stringify;
|
|
57044
55712
|
}
|
|
57045
55713
|
});
|
|
57046
55714
|
|
|
@@ -93398,10 +92066,23 @@ var package_default = {
|
|
|
93398
92066
|
type: "module",
|
|
93399
92067
|
homepage: "https://appwrite.io/support",
|
|
93400
92068
|
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",
|
|
93401
|
-
version: "13.
|
|
92069
|
+
version: "13.5.0",
|
|
93402
92070
|
license: "BSD-3-Clause",
|
|
93403
|
-
main: "dist/index.
|
|
92071
|
+
main: "dist/index.cjs",
|
|
92072
|
+
module: "dist/index.js",
|
|
93404
92073
|
types: "dist/index.d.ts",
|
|
92074
|
+
exports: {
|
|
92075
|
+
".": {
|
|
92076
|
+
import: {
|
|
92077
|
+
types: "./dist/index.d.ts",
|
|
92078
|
+
default: "./dist/index.js"
|
|
92079
|
+
},
|
|
92080
|
+
require: {
|
|
92081
|
+
types: "./dist/index.d.ts",
|
|
92082
|
+
default: "./dist/index.cjs"
|
|
92083
|
+
}
|
|
92084
|
+
}
|
|
92085
|
+
},
|
|
93405
92086
|
bin: {
|
|
93406
92087
|
appwrite: "dist/cli.cjs"
|
|
93407
92088
|
},
|
|
@@ -93412,8 +92093,9 @@ var package_default = {
|
|
|
93412
92093
|
scripts: {
|
|
93413
92094
|
build: "npm run build:types && npm run build:runtime",
|
|
93414
92095
|
"build:types": "tsc -p tsconfig.json --emitDeclarationOnly",
|
|
93415
|
-
"build:runtime": "npm run build:lib:
|
|
93416
|
-
"build:lib:
|
|
92096
|
+
"build:runtime": "npm run build:lib:esm && npm run build:lib:cjs && npm run build:cli",
|
|
92097
|
+
"build:lib:esm": "esbuild index.ts --bundle --platform=node --target=node18 --format=esm --loader:.hbs=text --outfile=dist/index.js",
|
|
92098
|
+
"build:lib:cjs": "esbuild index.ts --bundle --platform=node --target=node18 --format=cjs --loader:.hbs=text --outfile=dist/index.cjs",
|
|
93417
92099
|
"build:cli": "esbuild cli.ts --bundle --platform=node --target=node18 --format=cjs --loader:.hbs=text --external:fsevents --outfile=dist/cli.cjs",
|
|
93418
92100
|
format: 'prettier --write "**/*.{js,ts,json,md}"',
|
|
93419
92101
|
generate: "tsx scripts/generate-commands.ts",
|
|
@@ -93427,7 +92109,7 @@ var package_default = {
|
|
|
93427
92109
|
"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"
|
|
93428
92110
|
},
|
|
93429
92111
|
dependencies: {
|
|
93430
|
-
"@appwrite.io/console": "^
|
|
92112
|
+
"@appwrite.io/console": "^3.0.0",
|
|
93431
92113
|
chalk: "4.1.2",
|
|
93432
92114
|
chokidar: "^3.6.0",
|
|
93433
92115
|
"cli-progress": "^3.12.0",
|
|
@@ -107661,7 +106343,7 @@ import childProcess from "child_process";
|
|
|
107661
106343
|
// lib/constants.ts
|
|
107662
106344
|
var SDK_TITLE = "Appwrite";
|
|
107663
106345
|
var SDK_TITLE_LOWER = "appwrite";
|
|
107664
|
-
var SDK_VERSION = "13.
|
|
106346
|
+
var SDK_VERSION = "13.5.0";
|
|
107665
106347
|
var SDK_NAME = "Command Line";
|
|
107666
106348
|
var SDK_PLATFORM = "console";
|
|
107667
106349
|
var SDK_LANGUAGE = "cli";
|
|
@@ -107799,6 +106481,14 @@ function isCloud() {
|
|
|
107799
106481
|
const hostname3 = new URL(endpoint).hostname;
|
|
107800
106482
|
return hostname3.endsWith("appwrite.io");
|
|
107801
106483
|
}
|
|
106484
|
+
function arrayEqualsUnordered(left, right) {
|
|
106485
|
+
const a = Array.isArray(left) ? [...left].map((item) => String(item)).sort() : [];
|
|
106486
|
+
const b = Array.isArray(right) ? [...right].map((item) => String(item)).sort() : [];
|
|
106487
|
+
if (a.length !== b.length) {
|
|
106488
|
+
return false;
|
|
106489
|
+
}
|
|
106490
|
+
return a.every((value, index) => value === b[index]);
|
|
106491
|
+
}
|
|
107802
106492
|
function filterBySchema(data, schema) {
|
|
107803
106493
|
const allowedKeys = Object.keys(schema.shape);
|
|
107804
106494
|
const result = {};
|
|
@@ -108497,7 +107187,6 @@ import os2 from "os";
|
|
|
108497
107187
|
|
|
108498
107188
|
// node_modules/@appwrite.io/console/dist/esm/sdk.js
|
|
108499
107189
|
var import_json_bigint2 = __toESM(require_json_bigint(), 1);
|
|
108500
|
-
var import_bignumber = __toESM(require_bignumber2(), 1);
|
|
108501
107190
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
108502
107191
|
function adopt(value) {
|
|
108503
107192
|
return value instanceof P ? value : new P(function(resolve3) {
|
|
@@ -108617,8 +107306,11 @@ var JSONbigParser2 = (0, import_json_bigint2.default)({ storeAsString: false });
|
|
|
108617
107306
|
var JSONbigSerializer2 = (0, import_json_bigint2.default)({ useNativeBigInt: true });
|
|
108618
107307
|
var MAX_SAFE2 = BigInt(Number.MAX_SAFE_INTEGER);
|
|
108619
107308
|
var MIN_SAFE2 = BigInt(Number.MIN_SAFE_INTEGER);
|
|
107309
|
+
function isBigNumber2(value) {
|
|
107310
|
+
return value !== null && typeof value === "object" && value._isBigNumber === true && typeof value.isInteger === "function" && typeof value.toFixed === "function" && typeof value.toNumber === "function";
|
|
107311
|
+
}
|
|
108620
107312
|
function reviver2(_key, value) {
|
|
108621
|
-
if (
|
|
107313
|
+
if (isBigNumber2(value)) {
|
|
108622
107314
|
if (value.isInteger()) {
|
|
108623
107315
|
const str = value.toFixed();
|
|
108624
107316
|
const bi = BigInt(str);
|
|
@@ -108672,7 +107364,7 @@ var Client = class _Client {
|
|
|
108672
107364
|
"x-sdk-name": "Console",
|
|
108673
107365
|
"x-sdk-platform": "console",
|
|
108674
107366
|
"x-sdk-language": "web",
|
|
108675
|
-
"x-sdk-version": "
|
|
107367
|
+
"x-sdk-version": "3.0.0",
|
|
108676
107368
|
"X-Appwrite-Response-Format": "1.8.0"
|
|
108677
107369
|
};
|
|
108678
107370
|
this.realtime = {
|
|
@@ -122661,6 +121353,114 @@ var Projects = class {
|
|
|
122661
121353
|
};
|
|
122662
121354
|
return this.client.call("delete", uri, apiHeaders, payload);
|
|
122663
121355
|
}
|
|
121356
|
+
listSchedules(paramsOrFirst, ...rest) {
|
|
121357
|
+
let params;
|
|
121358
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
121359
|
+
params = paramsOrFirst || {};
|
|
121360
|
+
} else {
|
|
121361
|
+
params = {
|
|
121362
|
+
projectId: paramsOrFirst,
|
|
121363
|
+
queries: rest[0],
|
|
121364
|
+
total: rest[1]
|
|
121365
|
+
};
|
|
121366
|
+
}
|
|
121367
|
+
const projectId = params.projectId;
|
|
121368
|
+
const queries = params.queries;
|
|
121369
|
+
const total = params.total;
|
|
121370
|
+
if (typeof projectId === "undefined") {
|
|
121371
|
+
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
121372
|
+
}
|
|
121373
|
+
const apiPath = "/projects/{projectId}/schedules".replace("{projectId}", projectId);
|
|
121374
|
+
const payload = {};
|
|
121375
|
+
if (typeof queries !== "undefined") {
|
|
121376
|
+
payload["queries"] = queries;
|
|
121377
|
+
}
|
|
121378
|
+
if (typeof total !== "undefined") {
|
|
121379
|
+
payload["total"] = total;
|
|
121380
|
+
}
|
|
121381
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
121382
|
+
const apiHeaders = {};
|
|
121383
|
+
return this.client.call("get", uri, apiHeaders, payload);
|
|
121384
|
+
}
|
|
121385
|
+
createSchedule(paramsOrFirst, ...rest) {
|
|
121386
|
+
let params;
|
|
121387
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
121388
|
+
params = paramsOrFirst || {};
|
|
121389
|
+
} else {
|
|
121390
|
+
params = {
|
|
121391
|
+
projectId: paramsOrFirst,
|
|
121392
|
+
resourceType: rest[0],
|
|
121393
|
+
resourceId: rest[1],
|
|
121394
|
+
schedule: rest[2],
|
|
121395
|
+
active: rest[3],
|
|
121396
|
+
data: rest[4]
|
|
121397
|
+
};
|
|
121398
|
+
}
|
|
121399
|
+
const projectId = params.projectId;
|
|
121400
|
+
const resourceType = params.resourceType;
|
|
121401
|
+
const resourceId = params.resourceId;
|
|
121402
|
+
const schedule = params.schedule;
|
|
121403
|
+
const active = params.active;
|
|
121404
|
+
const data = params.data;
|
|
121405
|
+
if (typeof projectId === "undefined") {
|
|
121406
|
+
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
121407
|
+
}
|
|
121408
|
+
if (typeof resourceType === "undefined") {
|
|
121409
|
+
throw new AppwriteException('Missing required parameter: "resourceType"');
|
|
121410
|
+
}
|
|
121411
|
+
if (typeof resourceId === "undefined") {
|
|
121412
|
+
throw new AppwriteException('Missing required parameter: "resourceId"');
|
|
121413
|
+
}
|
|
121414
|
+
if (typeof schedule === "undefined") {
|
|
121415
|
+
throw new AppwriteException('Missing required parameter: "schedule"');
|
|
121416
|
+
}
|
|
121417
|
+
const apiPath = "/projects/{projectId}/schedules".replace("{projectId}", projectId);
|
|
121418
|
+
const payload = {};
|
|
121419
|
+
if (typeof resourceType !== "undefined") {
|
|
121420
|
+
payload["resourceType"] = resourceType;
|
|
121421
|
+
}
|
|
121422
|
+
if (typeof resourceId !== "undefined") {
|
|
121423
|
+
payload["resourceId"] = resourceId;
|
|
121424
|
+
}
|
|
121425
|
+
if (typeof schedule !== "undefined") {
|
|
121426
|
+
payload["schedule"] = schedule;
|
|
121427
|
+
}
|
|
121428
|
+
if (typeof active !== "undefined") {
|
|
121429
|
+
payload["active"] = active;
|
|
121430
|
+
}
|
|
121431
|
+
if (typeof data !== "undefined") {
|
|
121432
|
+
payload["data"] = data;
|
|
121433
|
+
}
|
|
121434
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
121435
|
+
const apiHeaders = {
|
|
121436
|
+
"content-type": "application/json"
|
|
121437
|
+
};
|
|
121438
|
+
return this.client.call("post", uri, apiHeaders, payload);
|
|
121439
|
+
}
|
|
121440
|
+
getSchedule(paramsOrFirst, ...rest) {
|
|
121441
|
+
let params;
|
|
121442
|
+
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
121443
|
+
params = paramsOrFirst || {};
|
|
121444
|
+
} else {
|
|
121445
|
+
params = {
|
|
121446
|
+
projectId: paramsOrFirst,
|
|
121447
|
+
scheduleId: rest[0]
|
|
121448
|
+
};
|
|
121449
|
+
}
|
|
121450
|
+
const projectId = params.projectId;
|
|
121451
|
+
const scheduleId = params.scheduleId;
|
|
121452
|
+
if (typeof projectId === "undefined") {
|
|
121453
|
+
throw new AppwriteException('Missing required parameter: "projectId"');
|
|
121454
|
+
}
|
|
121455
|
+
if (typeof scheduleId === "undefined") {
|
|
121456
|
+
throw new AppwriteException('Missing required parameter: "scheduleId"');
|
|
121457
|
+
}
|
|
121458
|
+
const apiPath = "/projects/{projectId}/schedules/{scheduleId}".replace("{projectId}", projectId).replace("{scheduleId}", scheduleId);
|
|
121459
|
+
const payload = {};
|
|
121460
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
121461
|
+
const apiHeaders = {};
|
|
121462
|
+
return this.client.call("get", uri, apiHeaders, payload);
|
|
121463
|
+
}
|
|
122664
121464
|
updateServiceStatus(paramsOrFirst, ...rest) {
|
|
122665
121465
|
let params;
|
|
122666
121466
|
if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
|
|
@@ -131316,6 +130116,8 @@ var Scopes;
|
|
|
131316
130116
|
Scopes3["TargetsWrite"] = "targets.write";
|
|
131317
130117
|
Scopes3["RulesRead"] = "rules.read";
|
|
131318
130118
|
Scopes3["RulesWrite"] = "rules.write";
|
|
130119
|
+
Scopes3["SchedulesRead"] = "schedules.read";
|
|
130120
|
+
Scopes3["SchedulesWrite"] = "schedules.write";
|
|
131319
130121
|
Scopes3["MigrationsRead"] = "migrations.read";
|
|
131320
130122
|
Scopes3["MigrationsWrite"] = "migrations.write";
|
|
131321
130123
|
Scopes3["VcsRead"] = "vcs.read";
|
|
@@ -131385,8 +130187,6 @@ var OAuthProvider;
|
|
|
131385
130187
|
OAuthProvider2["Yandex"] = "yandex";
|
|
131386
130188
|
OAuthProvider2["Zoho"] = "zoho";
|
|
131387
130189
|
OAuthProvider2["Zoom"] = "zoom";
|
|
131388
|
-
OAuthProvider2["GithubImagine"] = "githubImagine";
|
|
131389
|
-
OAuthProvider2["GoogleImagine"] = "googleImagine";
|
|
131390
130190
|
})(OAuthProvider || (OAuthProvider = {}));
|
|
131391
130191
|
var Browser;
|
|
131392
130192
|
(function(Browser2) {
|
|
@@ -132150,24 +130950,35 @@ var Runtime;
|
|
|
132150
130950
|
Runtime2["Node200"] = "node-20.0";
|
|
132151
130951
|
Runtime2["Node210"] = "node-21.0";
|
|
132152
130952
|
Runtime2["Node22"] = "node-22";
|
|
130953
|
+
Runtime2["Node23"] = "node-23";
|
|
130954
|
+
Runtime2["Node24"] = "node-24";
|
|
130955
|
+
Runtime2["Node25"] = "node-25";
|
|
132153
130956
|
Runtime2["Php80"] = "php-8.0";
|
|
132154
130957
|
Runtime2["Php81"] = "php-8.1";
|
|
132155
130958
|
Runtime2["Php82"] = "php-8.2";
|
|
132156
130959
|
Runtime2["Php83"] = "php-8.3";
|
|
130960
|
+
Runtime2["Php84"] = "php-8.4";
|
|
132157
130961
|
Runtime2["Ruby30"] = "ruby-3.0";
|
|
132158
130962
|
Runtime2["Ruby31"] = "ruby-3.1";
|
|
132159
130963
|
Runtime2["Ruby32"] = "ruby-3.2";
|
|
132160
130964
|
Runtime2["Ruby33"] = "ruby-3.3";
|
|
130965
|
+
Runtime2["Ruby34"] = "ruby-3.4";
|
|
130966
|
+
Runtime2["Ruby40"] = "ruby-4.0";
|
|
132161
130967
|
Runtime2["Python38"] = "python-3.8";
|
|
132162
130968
|
Runtime2["Python39"] = "python-3.9";
|
|
132163
130969
|
Runtime2["Python310"] = "python-3.10";
|
|
132164
130970
|
Runtime2["Python311"] = "python-3.11";
|
|
132165
130971
|
Runtime2["Python312"] = "python-3.12";
|
|
130972
|
+
Runtime2["Python313"] = "python-3.13";
|
|
130973
|
+
Runtime2["Python314"] = "python-3.14";
|
|
132166
130974
|
Runtime2["Pythonml311"] = "python-ml-3.11";
|
|
132167
130975
|
Runtime2["Pythonml312"] = "python-ml-3.12";
|
|
130976
|
+
Runtime2["Pythonml313"] = "python-ml-3.13";
|
|
132168
130977
|
Runtime2["Deno140"] = "deno-1.40";
|
|
132169
130978
|
Runtime2["Deno146"] = "deno-1.46";
|
|
132170
130979
|
Runtime2["Deno20"] = "deno-2.0";
|
|
130980
|
+
Runtime2["Deno25"] = "deno-2.5";
|
|
130981
|
+
Runtime2["Deno26"] = "deno-2.6";
|
|
132171
130982
|
Runtime2["Dart215"] = "dart-2.15";
|
|
132172
130983
|
Runtime2["Dart216"] = "dart-2.16";
|
|
132173
130984
|
Runtime2["Dart217"] = "dart-2.17";
|
|
@@ -132183,25 +130994,34 @@ var Runtime;
|
|
|
132183
130994
|
Runtime2["Dotnet60"] = "dotnet-6.0";
|
|
132184
130995
|
Runtime2["Dotnet70"] = "dotnet-7.0";
|
|
132185
130996
|
Runtime2["Dotnet80"] = "dotnet-8.0";
|
|
130997
|
+
Runtime2["Dotnet10"] = "dotnet-10";
|
|
132186
130998
|
Runtime2["Java80"] = "java-8.0";
|
|
132187
130999
|
Runtime2["Java110"] = "java-11.0";
|
|
132188
131000
|
Runtime2["Java170"] = "java-17.0";
|
|
132189
131001
|
Runtime2["Java180"] = "java-18.0";
|
|
132190
131002
|
Runtime2["Java210"] = "java-21.0";
|
|
132191
131003
|
Runtime2["Java22"] = "java-22";
|
|
131004
|
+
Runtime2["Java25"] = "java-25";
|
|
132192
131005
|
Runtime2["Swift55"] = "swift-5.5";
|
|
132193
131006
|
Runtime2["Swift58"] = "swift-5.8";
|
|
132194
131007
|
Runtime2["Swift59"] = "swift-5.9";
|
|
132195
131008
|
Runtime2["Swift510"] = "swift-5.10";
|
|
131009
|
+
Runtime2["Swift62"] = "swift-6.2";
|
|
132196
131010
|
Runtime2["Kotlin16"] = "kotlin-1.6";
|
|
132197
131011
|
Runtime2["Kotlin18"] = "kotlin-1.8";
|
|
132198
131012
|
Runtime2["Kotlin19"] = "kotlin-1.9";
|
|
132199
131013
|
Runtime2["Kotlin20"] = "kotlin-2.0";
|
|
131014
|
+
Runtime2["Kotlin23"] = "kotlin-2.3";
|
|
132200
131015
|
Runtime2["Cpp17"] = "cpp-17";
|
|
132201
131016
|
Runtime2["Cpp20"] = "cpp-20";
|
|
132202
131017
|
Runtime2["Bun10"] = "bun-1.0";
|
|
132203
131018
|
Runtime2["Bun11"] = "bun-1.1";
|
|
131019
|
+
Runtime2["Bun12"] = "bun-1.2";
|
|
131020
|
+
Runtime2["Bun13"] = "bun-1.3";
|
|
132204
131021
|
Runtime2["Go123"] = "go-1.23";
|
|
131022
|
+
Runtime2["Go124"] = "go-1.24";
|
|
131023
|
+
Runtime2["Go125"] = "go-1.25";
|
|
131024
|
+
Runtime2["Go126"] = "go-1.26";
|
|
132205
131025
|
Runtime2["Static1"] = "static-1";
|
|
132206
131026
|
Runtime2["Flutter324"] = "flutter-3.24";
|
|
132207
131027
|
Runtime2["Flutter327"] = "flutter-3.27";
|
|
@@ -132219,24 +131039,35 @@ var Runtimes;
|
|
|
132219
131039
|
Runtimes2["Node200"] = "node-20.0";
|
|
132220
131040
|
Runtimes2["Node210"] = "node-21.0";
|
|
132221
131041
|
Runtimes2["Node22"] = "node-22";
|
|
131042
|
+
Runtimes2["Node23"] = "node-23";
|
|
131043
|
+
Runtimes2["Node24"] = "node-24";
|
|
131044
|
+
Runtimes2["Node25"] = "node-25";
|
|
132222
131045
|
Runtimes2["Php80"] = "php-8.0";
|
|
132223
131046
|
Runtimes2["Php81"] = "php-8.1";
|
|
132224
131047
|
Runtimes2["Php82"] = "php-8.2";
|
|
132225
131048
|
Runtimes2["Php83"] = "php-8.3";
|
|
131049
|
+
Runtimes2["Php84"] = "php-8.4";
|
|
132226
131050
|
Runtimes2["Ruby30"] = "ruby-3.0";
|
|
132227
131051
|
Runtimes2["Ruby31"] = "ruby-3.1";
|
|
132228
131052
|
Runtimes2["Ruby32"] = "ruby-3.2";
|
|
132229
131053
|
Runtimes2["Ruby33"] = "ruby-3.3";
|
|
131054
|
+
Runtimes2["Ruby34"] = "ruby-3.4";
|
|
131055
|
+
Runtimes2["Ruby40"] = "ruby-4.0";
|
|
132230
131056
|
Runtimes2["Python38"] = "python-3.8";
|
|
132231
131057
|
Runtimes2["Python39"] = "python-3.9";
|
|
132232
131058
|
Runtimes2["Python310"] = "python-3.10";
|
|
132233
131059
|
Runtimes2["Python311"] = "python-3.11";
|
|
132234
131060
|
Runtimes2["Python312"] = "python-3.12";
|
|
131061
|
+
Runtimes2["Python313"] = "python-3.13";
|
|
131062
|
+
Runtimes2["Python314"] = "python-3.14";
|
|
132235
131063
|
Runtimes2["Pythonml311"] = "python-ml-3.11";
|
|
132236
131064
|
Runtimes2["Pythonml312"] = "python-ml-3.12";
|
|
131065
|
+
Runtimes2["Pythonml313"] = "python-ml-3.13";
|
|
132237
131066
|
Runtimes2["Deno140"] = "deno-1.40";
|
|
132238
131067
|
Runtimes2["Deno146"] = "deno-1.46";
|
|
132239
131068
|
Runtimes2["Deno20"] = "deno-2.0";
|
|
131069
|
+
Runtimes2["Deno25"] = "deno-2.5";
|
|
131070
|
+
Runtimes2["Deno26"] = "deno-2.6";
|
|
132240
131071
|
Runtimes2["Dart215"] = "dart-2.15";
|
|
132241
131072
|
Runtimes2["Dart216"] = "dart-2.16";
|
|
132242
131073
|
Runtimes2["Dart217"] = "dart-2.17";
|
|
@@ -132252,25 +131083,34 @@ var Runtimes;
|
|
|
132252
131083
|
Runtimes2["Dotnet60"] = "dotnet-6.0";
|
|
132253
131084
|
Runtimes2["Dotnet70"] = "dotnet-7.0";
|
|
132254
131085
|
Runtimes2["Dotnet80"] = "dotnet-8.0";
|
|
131086
|
+
Runtimes2["Dotnet10"] = "dotnet-10";
|
|
132255
131087
|
Runtimes2["Java80"] = "java-8.0";
|
|
132256
131088
|
Runtimes2["Java110"] = "java-11.0";
|
|
132257
131089
|
Runtimes2["Java170"] = "java-17.0";
|
|
132258
131090
|
Runtimes2["Java180"] = "java-18.0";
|
|
132259
131091
|
Runtimes2["Java210"] = "java-21.0";
|
|
132260
131092
|
Runtimes2["Java22"] = "java-22";
|
|
131093
|
+
Runtimes2["Java25"] = "java-25";
|
|
132261
131094
|
Runtimes2["Swift55"] = "swift-5.5";
|
|
132262
131095
|
Runtimes2["Swift58"] = "swift-5.8";
|
|
132263
131096
|
Runtimes2["Swift59"] = "swift-5.9";
|
|
132264
131097
|
Runtimes2["Swift510"] = "swift-5.10";
|
|
131098
|
+
Runtimes2["Swift62"] = "swift-6.2";
|
|
132265
131099
|
Runtimes2["Kotlin16"] = "kotlin-1.6";
|
|
132266
131100
|
Runtimes2["Kotlin18"] = "kotlin-1.8";
|
|
132267
131101
|
Runtimes2["Kotlin19"] = "kotlin-1.9";
|
|
132268
131102
|
Runtimes2["Kotlin20"] = "kotlin-2.0";
|
|
131103
|
+
Runtimes2["Kotlin23"] = "kotlin-2.3";
|
|
132269
131104
|
Runtimes2["Cpp17"] = "cpp-17";
|
|
132270
131105
|
Runtimes2["Cpp20"] = "cpp-20";
|
|
132271
131106
|
Runtimes2["Bun10"] = "bun-1.0";
|
|
132272
131107
|
Runtimes2["Bun11"] = "bun-1.1";
|
|
131108
|
+
Runtimes2["Bun12"] = "bun-1.2";
|
|
131109
|
+
Runtimes2["Bun13"] = "bun-1.3";
|
|
132273
131110
|
Runtimes2["Go123"] = "go-1.23";
|
|
131111
|
+
Runtimes2["Go124"] = "go-1.24";
|
|
131112
|
+
Runtimes2["Go125"] = "go-1.25";
|
|
131113
|
+
Runtimes2["Go126"] = "go-1.26";
|
|
132274
131114
|
Runtimes2["Static1"] = "static-1";
|
|
132275
131115
|
Runtimes2["Flutter324"] = "flutter-3.24";
|
|
132276
131116
|
Runtimes2["Flutter327"] = "flutter-3.27";
|
|
@@ -132407,6 +131247,13 @@ var PlatformType;
|
|
|
132407
131247
|
PlatformType2["Reactnativeios"] = "react-native-ios";
|
|
132408
131248
|
PlatformType2["Reactnativeandroid"] = "react-native-android";
|
|
132409
131249
|
})(PlatformType || (PlatformType = {}));
|
|
131250
|
+
var ResourceType;
|
|
131251
|
+
(function(ResourceType2) {
|
|
131252
|
+
ResourceType2["Function"] = "function";
|
|
131253
|
+
ResourceType2["Execution"] = "execution";
|
|
131254
|
+
ResourceType2["Message"] = "message";
|
|
131255
|
+
ResourceType2["Backup"] = "backup";
|
|
131256
|
+
})(ResourceType || (ResourceType = {}));
|
|
132410
131257
|
var ApiService;
|
|
132411
131258
|
(function(ApiService3) {
|
|
132412
131259
|
ApiService3["Account"] = "account";
|
|
@@ -132431,12 +131278,12 @@ var SMTPSecure;
|
|
|
132431
131278
|
var EmailTemplateType;
|
|
132432
131279
|
(function(EmailTemplateType2) {
|
|
132433
131280
|
EmailTemplateType2["Verification"] = "verification";
|
|
132434
|
-
EmailTemplateType2["
|
|
131281
|
+
EmailTemplateType2["MagicSession"] = "magicSession";
|
|
132435
131282
|
EmailTemplateType2["Recovery"] = "recovery";
|
|
132436
131283
|
EmailTemplateType2["Invitation"] = "invitation";
|
|
132437
|
-
EmailTemplateType2["
|
|
132438
|
-
EmailTemplateType2["
|
|
132439
|
-
EmailTemplateType2["
|
|
131284
|
+
EmailTemplateType2["MfaChallenge"] = "mfaChallenge";
|
|
131285
|
+
EmailTemplateType2["SessionAlert"] = "sessionAlert";
|
|
131286
|
+
EmailTemplateType2["OtpSession"] = "otpSession";
|
|
132440
131287
|
})(EmailTemplateType || (EmailTemplateType = {}));
|
|
132441
131288
|
var EmailTemplateLocale;
|
|
132442
131289
|
(function(EmailTemplateLocale2) {
|
|
@@ -132577,7 +131424,7 @@ var SmsTemplateType;
|
|
|
132577
131424
|
SmsTemplateType2["Verification"] = "verification";
|
|
132578
131425
|
SmsTemplateType2["Login"] = "login";
|
|
132579
131426
|
SmsTemplateType2["Invitation"] = "invitation";
|
|
132580
|
-
SmsTemplateType2["
|
|
131427
|
+
SmsTemplateType2["MfaChallenge"] = "mfaChallenge";
|
|
132581
131428
|
})(SmsTemplateType || (SmsTemplateType = {}));
|
|
132582
131429
|
var SmsTemplateLocale;
|
|
132583
131430
|
(function(SmsTemplateLocale2) {
|
|
@@ -132752,24 +131599,35 @@ var BuildRuntime;
|
|
|
132752
131599
|
BuildRuntime2["Node200"] = "node-20.0";
|
|
132753
131600
|
BuildRuntime2["Node210"] = "node-21.0";
|
|
132754
131601
|
BuildRuntime2["Node22"] = "node-22";
|
|
131602
|
+
BuildRuntime2["Node23"] = "node-23";
|
|
131603
|
+
BuildRuntime2["Node24"] = "node-24";
|
|
131604
|
+
BuildRuntime2["Node25"] = "node-25";
|
|
132755
131605
|
BuildRuntime2["Php80"] = "php-8.0";
|
|
132756
131606
|
BuildRuntime2["Php81"] = "php-8.1";
|
|
132757
131607
|
BuildRuntime2["Php82"] = "php-8.2";
|
|
132758
131608
|
BuildRuntime2["Php83"] = "php-8.3";
|
|
131609
|
+
BuildRuntime2["Php84"] = "php-8.4";
|
|
132759
131610
|
BuildRuntime2["Ruby30"] = "ruby-3.0";
|
|
132760
131611
|
BuildRuntime2["Ruby31"] = "ruby-3.1";
|
|
132761
131612
|
BuildRuntime2["Ruby32"] = "ruby-3.2";
|
|
132762
131613
|
BuildRuntime2["Ruby33"] = "ruby-3.3";
|
|
131614
|
+
BuildRuntime2["Ruby34"] = "ruby-3.4";
|
|
131615
|
+
BuildRuntime2["Ruby40"] = "ruby-4.0";
|
|
132763
131616
|
BuildRuntime2["Python38"] = "python-3.8";
|
|
132764
131617
|
BuildRuntime2["Python39"] = "python-3.9";
|
|
132765
131618
|
BuildRuntime2["Python310"] = "python-3.10";
|
|
132766
131619
|
BuildRuntime2["Python311"] = "python-3.11";
|
|
132767
131620
|
BuildRuntime2["Python312"] = "python-3.12";
|
|
131621
|
+
BuildRuntime2["Python313"] = "python-3.13";
|
|
131622
|
+
BuildRuntime2["Python314"] = "python-3.14";
|
|
132768
131623
|
BuildRuntime2["Pythonml311"] = "python-ml-3.11";
|
|
132769
131624
|
BuildRuntime2["Pythonml312"] = "python-ml-3.12";
|
|
131625
|
+
BuildRuntime2["Pythonml313"] = "python-ml-3.13";
|
|
132770
131626
|
BuildRuntime2["Deno140"] = "deno-1.40";
|
|
132771
131627
|
BuildRuntime2["Deno146"] = "deno-1.46";
|
|
132772
131628
|
BuildRuntime2["Deno20"] = "deno-2.0";
|
|
131629
|
+
BuildRuntime2["Deno25"] = "deno-2.5";
|
|
131630
|
+
BuildRuntime2["Deno26"] = "deno-2.6";
|
|
132773
131631
|
BuildRuntime2["Dart215"] = "dart-2.15";
|
|
132774
131632
|
BuildRuntime2["Dart216"] = "dart-2.16";
|
|
132775
131633
|
BuildRuntime2["Dart217"] = "dart-2.17";
|
|
@@ -132785,25 +131643,34 @@ var BuildRuntime;
|
|
|
132785
131643
|
BuildRuntime2["Dotnet60"] = "dotnet-6.0";
|
|
132786
131644
|
BuildRuntime2["Dotnet70"] = "dotnet-7.0";
|
|
132787
131645
|
BuildRuntime2["Dotnet80"] = "dotnet-8.0";
|
|
131646
|
+
BuildRuntime2["Dotnet10"] = "dotnet-10";
|
|
132788
131647
|
BuildRuntime2["Java80"] = "java-8.0";
|
|
132789
131648
|
BuildRuntime2["Java110"] = "java-11.0";
|
|
132790
131649
|
BuildRuntime2["Java170"] = "java-17.0";
|
|
132791
131650
|
BuildRuntime2["Java180"] = "java-18.0";
|
|
132792
131651
|
BuildRuntime2["Java210"] = "java-21.0";
|
|
132793
131652
|
BuildRuntime2["Java22"] = "java-22";
|
|
131653
|
+
BuildRuntime2["Java25"] = "java-25";
|
|
132794
131654
|
BuildRuntime2["Swift55"] = "swift-5.5";
|
|
132795
131655
|
BuildRuntime2["Swift58"] = "swift-5.8";
|
|
132796
131656
|
BuildRuntime2["Swift59"] = "swift-5.9";
|
|
132797
131657
|
BuildRuntime2["Swift510"] = "swift-5.10";
|
|
131658
|
+
BuildRuntime2["Swift62"] = "swift-6.2";
|
|
132798
131659
|
BuildRuntime2["Kotlin16"] = "kotlin-1.6";
|
|
132799
131660
|
BuildRuntime2["Kotlin18"] = "kotlin-1.8";
|
|
132800
131661
|
BuildRuntime2["Kotlin19"] = "kotlin-1.9";
|
|
132801
131662
|
BuildRuntime2["Kotlin20"] = "kotlin-2.0";
|
|
131663
|
+
BuildRuntime2["Kotlin23"] = "kotlin-2.3";
|
|
132802
131664
|
BuildRuntime2["Cpp17"] = "cpp-17";
|
|
132803
131665
|
BuildRuntime2["Cpp20"] = "cpp-20";
|
|
132804
131666
|
BuildRuntime2["Bun10"] = "bun-1.0";
|
|
132805
131667
|
BuildRuntime2["Bun11"] = "bun-1.1";
|
|
131668
|
+
BuildRuntime2["Bun12"] = "bun-1.2";
|
|
131669
|
+
BuildRuntime2["Bun13"] = "bun-1.3";
|
|
132806
131670
|
BuildRuntime2["Go123"] = "go-1.23";
|
|
131671
|
+
BuildRuntime2["Go124"] = "go-1.24";
|
|
131672
|
+
BuildRuntime2["Go125"] = "go-1.25";
|
|
131673
|
+
BuildRuntime2["Go126"] = "go-1.26";
|
|
132807
131674
|
BuildRuntime2["Static1"] = "static-1";
|
|
132808
131675
|
BuildRuntime2["Flutter324"] = "flutter-3.24";
|
|
132809
131676
|
BuildRuntime2["Flutter327"] = "flutter-3.27";
|
|
@@ -139172,7 +138039,9 @@ var Pools = class {
|
|
|
139172
138039
|
// Milliseconds
|
|
139173
138040
|
pollMaxDebounces = 30;
|
|
139174
138041
|
POLL_DEFAULT_VALUE = 30;
|
|
139175
|
-
|
|
138042
|
+
client;
|
|
138043
|
+
constructor(pollMaxDebounces, client2) {
|
|
138044
|
+
this.client = client2;
|
|
139176
138045
|
if (pollMaxDebounces) {
|
|
139177
138046
|
this.pollMaxDebounces = pollMaxDebounces;
|
|
139178
138047
|
}
|
|
@@ -139181,7 +138050,7 @@ var Pools = class {
|
|
|
139181
138050
|
if (iteration > this.pollMaxDebounces) {
|
|
139182
138051
|
return false;
|
|
139183
138052
|
}
|
|
139184
|
-
const databasesService = await getDatabasesService();
|
|
138053
|
+
const databasesService = await getDatabasesService(this.client);
|
|
139185
138054
|
const response = await databasesService.listAttributes(
|
|
139186
138055
|
databaseId,
|
|
139187
138056
|
collectionId,
|
|
@@ -139207,7 +138076,7 @@ var Pools = class {
|
|
|
139207
138076
|
if (iteration > this.pollMaxDebounces) {
|
|
139208
138077
|
return false;
|
|
139209
138078
|
}
|
|
139210
|
-
const databasesService = await getDatabasesService();
|
|
138079
|
+
const databasesService = await getDatabasesService(this.client);
|
|
139211
138080
|
const response = await databasesService.listIndexes(
|
|
139212
138081
|
databaseId,
|
|
139213
138082
|
collectionId,
|
|
@@ -139244,7 +138113,7 @@ var Pools = class {
|
|
|
139244
138113
|
}
|
|
139245
138114
|
const { attributes } = await paginate(
|
|
139246
138115
|
async (args) => {
|
|
139247
|
-
const databasesService = await getDatabasesService();
|
|
138116
|
+
const databasesService = await getDatabasesService(this.client);
|
|
139248
138117
|
return await databasesService.listAttributes({
|
|
139249
138118
|
databaseId: args.databaseId,
|
|
139250
138119
|
collectionId: args.collectionId,
|
|
@@ -139287,7 +138156,7 @@ var Pools = class {
|
|
|
139287
138156
|
}
|
|
139288
138157
|
const { attributes } = await paginate(
|
|
139289
138158
|
async (args) => {
|
|
139290
|
-
const databasesService = await getDatabasesService();
|
|
138159
|
+
const databasesService = await getDatabasesService(this.client);
|
|
139291
138160
|
return await databasesService.listAttributes(
|
|
139292
138161
|
args.databaseId,
|
|
139293
138162
|
args.collectionId,
|
|
@@ -139336,7 +138205,7 @@ var Pools = class {
|
|
|
139336
138205
|
}
|
|
139337
138206
|
const { indexes } = await paginate(
|
|
139338
138207
|
async (args) => {
|
|
139339
|
-
const databasesService = await getDatabasesService();
|
|
138208
|
+
const databasesService = await getDatabasesService(this.client);
|
|
139340
138209
|
return await databasesService.listIndexes(
|
|
139341
138210
|
args.databaseId,
|
|
139342
138211
|
args.collectionId,
|
|
@@ -139402,8 +138271,10 @@ var questionPushChangesConfirmation2 = [
|
|
|
139402
138271
|
var Attributes = class {
|
|
139403
138272
|
pools;
|
|
139404
138273
|
skipConfirmation;
|
|
139405
|
-
|
|
139406
|
-
|
|
138274
|
+
client;
|
|
138275
|
+
constructor(pools, skipConfirmation = false, client2) {
|
|
138276
|
+
this.client = client2;
|
|
138277
|
+
this.pools = pools || new Pools(void 0, client2);
|
|
139407
138278
|
this.skipConfirmation = skipConfirmation;
|
|
139408
138279
|
}
|
|
139409
138280
|
getConfirmation = async () => {
|
|
@@ -139491,7 +138362,7 @@ var Attributes = class {
|
|
|
139491
138362
|
};
|
|
139492
138363
|
};
|
|
139493
138364
|
createAttribute = async (databaseId, collectionId, attribute) => {
|
|
139494
|
-
const databasesService = await getDatabasesService();
|
|
138365
|
+
const databasesService = await getDatabasesService(this.client);
|
|
139495
138366
|
switch (attribute.type) {
|
|
139496
138367
|
case "string":
|
|
139497
138368
|
switch (attribute.format) {
|
|
@@ -139661,7 +138532,7 @@ var Attributes = class {
|
|
|
139661
138532
|
}
|
|
139662
138533
|
};
|
|
139663
138534
|
updateAttribute = async (databaseId, collectionId, attribute) => {
|
|
139664
|
-
const databasesService = await getDatabasesService();
|
|
138535
|
+
const databasesService = await getDatabasesService(this.client);
|
|
139665
138536
|
switch (attribute.type) {
|
|
139666
138537
|
case "string":
|
|
139667
138538
|
switch (attribute.format) {
|
|
@@ -139815,7 +138686,7 @@ var Attributes = class {
|
|
|
139815
138686
|
log(
|
|
139816
138687
|
`Deleting ${isIndex ? "index" : "attribute"} ${attribute.key} of ${collection.name} ( ${collection["$id"]} )`
|
|
139817
138688
|
);
|
|
139818
|
-
const databasesService = await getDatabasesService();
|
|
138689
|
+
const databasesService = await getDatabasesService(this.client);
|
|
139819
138690
|
if (isIndex) {
|
|
139820
138691
|
await databasesService.deleteIndex(
|
|
139821
138692
|
collection["databaseId"],
|
|
@@ -139970,7 +138841,7 @@ var Attributes = class {
|
|
|
139970
138841
|
};
|
|
139971
138842
|
createIndexes = async (indexes, collection) => {
|
|
139972
138843
|
log(`Creating indexes ...`);
|
|
139973
|
-
const databasesService = await getDatabasesService();
|
|
138844
|
+
const databasesService = await getDatabasesService(this.client);
|
|
139974
138845
|
for (let index of indexes) {
|
|
139975
138846
|
await databasesService.createIndex({
|
|
139976
138847
|
databaseId: collection["databaseId"],
|
|
@@ -140229,158 +139100,169 @@ var Push = class {
|
|
|
140229
139100
|
}
|
|
140230
139101
|
}
|
|
140231
139102
|
async pushResources(config2, options = { all: true, skipDeprecated: true }) {
|
|
140232
|
-
const
|
|
140233
|
-
|
|
140234
|
-
|
|
140235
|
-
const shouldPushAll = options.all === true;
|
|
140236
|
-
if ((shouldPushAll || options.settings) && (config2.projectName || config2.settings)) {
|
|
140237
|
-
try {
|
|
140238
|
-
this.log("Pushing settings ...");
|
|
140239
|
-
await this.pushSettings({
|
|
140240
|
-
projectId: config2.projectId,
|
|
140241
|
-
projectName: config2.projectName,
|
|
140242
|
-
settings: config2.settings
|
|
140243
|
-
});
|
|
140244
|
-
this.success(
|
|
140245
|
-
`Successfully pushed ${import_chalk11.default.bold("all")} project settings.`
|
|
140246
|
-
);
|
|
140247
|
-
results.settings = { success: true };
|
|
140248
|
-
} catch (e) {
|
|
140249
|
-
allErrors.push(e);
|
|
140250
|
-
results.settings = { success: false, error: e.message };
|
|
140251
|
-
}
|
|
139103
|
+
const previousForce = cliConfig.force;
|
|
139104
|
+
if (options.force !== void 0) {
|
|
139105
|
+
cliConfig.force = options.force;
|
|
140252
139106
|
}
|
|
140253
|
-
|
|
140254
|
-
|
|
140255
|
-
|
|
140256
|
-
|
|
140257
|
-
|
|
140258
|
-
|
|
140259
|
-
|
|
140260
|
-
|
|
140261
|
-
|
|
140262
|
-
|
|
140263
|
-
|
|
140264
|
-
|
|
139107
|
+
try {
|
|
139108
|
+
const { skipDeprecated = true } = options;
|
|
139109
|
+
const results = {};
|
|
139110
|
+
const allErrors = [];
|
|
139111
|
+
const shouldPushAll = options.all === true;
|
|
139112
|
+
if ((shouldPushAll || options.settings) && (config2.projectName || config2.settings)) {
|
|
139113
|
+
try {
|
|
139114
|
+
this.log("Pushing settings ...");
|
|
139115
|
+
await this.pushSettings({
|
|
139116
|
+
projectId: config2.projectId,
|
|
139117
|
+
projectName: config2.projectName,
|
|
139118
|
+
settings: config2.settings
|
|
139119
|
+
});
|
|
139120
|
+
this.success(
|
|
139121
|
+
`Successfully pushed ${import_chalk11.default.bold("all")} project settings.`
|
|
139122
|
+
);
|
|
139123
|
+
results.settings = { success: true };
|
|
139124
|
+
} catch (e) {
|
|
139125
|
+
allErrors.push(e);
|
|
139126
|
+
results.settings = { success: false, error: e.message };
|
|
139127
|
+
}
|
|
140265
139128
|
}
|
|
140266
|
-
|
|
140267
|
-
|
|
140268
|
-
|
|
140269
|
-
|
|
140270
|
-
|
|
140271
|
-
|
|
140272
|
-
|
|
140273
|
-
|
|
140274
|
-
|
|
140275
|
-
|
|
140276
|
-
|
|
140277
|
-
|
|
140278
|
-
|
|
139129
|
+
if ((shouldPushAll || options.buckets) && config2.buckets && config2.buckets.length > 0) {
|
|
139130
|
+
try {
|
|
139131
|
+
this.log("Pushing buckets ...");
|
|
139132
|
+
const result = await this.pushBuckets(config2.buckets);
|
|
139133
|
+
this.success(
|
|
139134
|
+
`Successfully pushed ${import_chalk11.default.bold(result.successfullyPushed)} buckets.`
|
|
139135
|
+
);
|
|
139136
|
+
results.buckets = result;
|
|
139137
|
+
allErrors.push(...result.errors);
|
|
139138
|
+
} catch (e) {
|
|
139139
|
+
allErrors.push(e);
|
|
139140
|
+
results.buckets = { successfullyPushed: 0, errors: [e] };
|
|
139141
|
+
}
|
|
140279
139142
|
}
|
|
140280
|
-
|
|
140281
|
-
|
|
140282
|
-
|
|
140283
|
-
|
|
140284
|
-
|
|
140285
|
-
|
|
140286
|
-
|
|
140287
|
-
|
|
140288
|
-
|
|
140289
|
-
|
|
140290
|
-
|
|
140291
|
-
|
|
140292
|
-
|
|
139143
|
+
if ((shouldPushAll || options.teams) && config2.teams && config2.teams.length > 0) {
|
|
139144
|
+
try {
|
|
139145
|
+
this.log("Pushing teams ...");
|
|
139146
|
+
const result = await this.pushTeams(config2.teams);
|
|
139147
|
+
this.success(
|
|
139148
|
+
`Successfully pushed ${import_chalk11.default.bold(result.successfullyPushed)} teams.`
|
|
139149
|
+
);
|
|
139150
|
+
results.teams = result;
|
|
139151
|
+
allErrors.push(...result.errors);
|
|
139152
|
+
} catch (e) {
|
|
139153
|
+
allErrors.push(e);
|
|
139154
|
+
results.teams = { successfullyPushed: 0, errors: [e] };
|
|
139155
|
+
}
|
|
140293
139156
|
}
|
|
140294
|
-
|
|
140295
|
-
|
|
140296
|
-
|
|
140297
|
-
|
|
140298
|
-
|
|
140299
|
-
|
|
140300
|
-
|
|
140301
|
-
|
|
140302
|
-
|
|
140303
|
-
|
|
140304
|
-
|
|
140305
|
-
|
|
140306
|
-
|
|
140307
|
-
} catch (e) {
|
|
140308
|
-
allErrors.push(e);
|
|
140309
|
-
results.functions = {
|
|
140310
|
-
successfullyPushed: 0,
|
|
140311
|
-
successfullyDeployed: 0,
|
|
140312
|
-
failedDeployments: [],
|
|
140313
|
-
errors: [e]
|
|
140314
|
-
};
|
|
139157
|
+
if ((shouldPushAll || options.topics) && config2.topics && config2.topics.length > 0) {
|
|
139158
|
+
try {
|
|
139159
|
+
this.log("Pushing topics ...");
|
|
139160
|
+
const result = await this.pushMessagingTopics(config2.topics);
|
|
139161
|
+
this.success(
|
|
139162
|
+
`Successfully pushed ${import_chalk11.default.bold(result.successfullyPushed)} topics.`
|
|
139163
|
+
);
|
|
139164
|
+
results.topics = result;
|
|
139165
|
+
allErrors.push(...result.errors);
|
|
139166
|
+
} catch (e) {
|
|
139167
|
+
allErrors.push(e);
|
|
139168
|
+
results.topics = { successfullyPushed: 0, errors: [e] };
|
|
139169
|
+
}
|
|
140315
139170
|
}
|
|
140316
|
-
|
|
140317
|
-
|
|
140318
|
-
|
|
140319
|
-
|
|
140320
|
-
|
|
140321
|
-
|
|
140322
|
-
|
|
140323
|
-
|
|
140324
|
-
|
|
140325
|
-
|
|
140326
|
-
|
|
140327
|
-
|
|
140328
|
-
|
|
140329
|
-
|
|
140330
|
-
|
|
140331
|
-
|
|
140332
|
-
|
|
140333
|
-
|
|
139171
|
+
if ((shouldPushAll || options.functions) && config2.functions && config2.functions.length > 0) {
|
|
139172
|
+
try {
|
|
139173
|
+
this.log("Pushing functions ...");
|
|
139174
|
+
const result = await this.pushFunctions(
|
|
139175
|
+
config2.functions,
|
|
139176
|
+
options.functionOptions
|
|
139177
|
+
);
|
|
139178
|
+
this.success(
|
|
139179
|
+
`Successfully pushed ${import_chalk11.default.bold(result.successfullyPushed)} functions.`
|
|
139180
|
+
);
|
|
139181
|
+
results.functions = result;
|
|
139182
|
+
allErrors.push(...result.errors);
|
|
139183
|
+
} catch (e) {
|
|
139184
|
+
allErrors.push(e);
|
|
139185
|
+
results.functions = {
|
|
139186
|
+
successfullyPushed: 0,
|
|
139187
|
+
successfullyDeployed: 0,
|
|
139188
|
+
failedDeployments: [],
|
|
139189
|
+
errors: [e]
|
|
139190
|
+
};
|
|
139191
|
+
}
|
|
140334
139192
|
}
|
|
140335
|
-
|
|
140336
|
-
|
|
140337
|
-
|
|
140338
|
-
|
|
140339
|
-
|
|
140340
|
-
|
|
140341
|
-
|
|
140342
|
-
|
|
140343
|
-
|
|
140344
|
-
|
|
140345
|
-
|
|
140346
|
-
|
|
140347
|
-
|
|
140348
|
-
|
|
140349
|
-
|
|
140350
|
-
|
|
139193
|
+
if ((shouldPushAll || options.sites) && config2.sites && config2.sites.length > 0) {
|
|
139194
|
+
try {
|
|
139195
|
+
this.log("Pushing sites ...");
|
|
139196
|
+
const result = await this.pushSites(
|
|
139197
|
+
config2.sites,
|
|
139198
|
+
options.siteOptions
|
|
139199
|
+
);
|
|
139200
|
+
this.success(
|
|
139201
|
+
`Successfully pushed ${import_chalk11.default.bold(result.successfullyPushed)} sites.`
|
|
139202
|
+
);
|
|
139203
|
+
results.sites = result;
|
|
139204
|
+
allErrors.push(...result.errors);
|
|
139205
|
+
} catch (e) {
|
|
139206
|
+
allErrors.push(e);
|
|
139207
|
+
results.sites = {
|
|
139208
|
+
successfullyPushed: 0,
|
|
139209
|
+
successfullyDeployed: 0,
|
|
139210
|
+
failedDeployments: [],
|
|
139211
|
+
errors: [e]
|
|
139212
|
+
};
|
|
139213
|
+
}
|
|
140351
139214
|
}
|
|
140352
|
-
|
|
140353
|
-
|
|
140354
|
-
|
|
140355
|
-
|
|
140356
|
-
|
|
140357
|
-
|
|
140358
|
-
|
|
140359
|
-
|
|
140360
|
-
)
|
|
140361
|
-
|
|
140362
|
-
|
|
140363
|
-
|
|
140364
|
-
|
|
140365
|
-
|
|
140366
|
-
|
|
140367
|
-
|
|
140368
|
-
|
|
140369
|
-
|
|
140370
|
-
|
|
140371
|
-
|
|
140372
|
-
|
|
140373
|
-
|
|
140374
|
-
|
|
140375
|
-
|
|
140376
|
-
|
|
140377
|
-
|
|
139215
|
+
if ((shouldPushAll || options.tables) && config2.tables && config2.tables.length > 0) {
|
|
139216
|
+
try {
|
|
139217
|
+
this.log("Pushing tables ...");
|
|
139218
|
+
const result = await this.pushTables(config2.tables, {
|
|
139219
|
+
attempts: options.tableOptions?.attempts,
|
|
139220
|
+
skipConfirmation: options.skipConfirmation
|
|
139221
|
+
});
|
|
139222
|
+
this.success(
|
|
139223
|
+
`Successfully pushed ${import_chalk11.default.bold(result.successfullyPushed)} tables.`
|
|
139224
|
+
);
|
|
139225
|
+
results.tables = result;
|
|
139226
|
+
allErrors.push(...result.errors);
|
|
139227
|
+
} catch (e) {
|
|
139228
|
+
allErrors.push(e);
|
|
139229
|
+
results.tables = { successfullyPushed: 0, errors: [e] };
|
|
139230
|
+
}
|
|
139231
|
+
}
|
|
139232
|
+
if ((options.collections || shouldPushAll && !skipDeprecated) && config2.collections && config2.collections.length > 0) {
|
|
139233
|
+
try {
|
|
139234
|
+
this.log("Pushing collections ...");
|
|
139235
|
+
const collectionsWithDbNames = config2.collections.map(
|
|
139236
|
+
(collection) => {
|
|
139237
|
+
const database = config2.databases?.find(
|
|
139238
|
+
(db) => db.$id === collection.databaseId
|
|
139239
|
+
);
|
|
139240
|
+
return {
|
|
139241
|
+
...collection,
|
|
139242
|
+
databaseName: database?.name ?? collection.databaseId
|
|
139243
|
+
};
|
|
139244
|
+
}
|
|
139245
|
+
);
|
|
139246
|
+
const result = await this.pushCollections(collectionsWithDbNames, {
|
|
139247
|
+
skipConfirmation: options.skipConfirmation
|
|
139248
|
+
});
|
|
139249
|
+
this.success(
|
|
139250
|
+
`Successfully pushed ${import_chalk11.default.bold(result.successfullyPushed)} collections.`
|
|
139251
|
+
);
|
|
139252
|
+
results.collections = result;
|
|
139253
|
+
allErrors.push(...result.errors);
|
|
139254
|
+
} catch (e) {
|
|
139255
|
+
allErrors.push(e);
|
|
139256
|
+
results.collections = { successfullyPushed: 0, errors: [e] };
|
|
139257
|
+
}
|
|
140378
139258
|
}
|
|
139259
|
+
return {
|
|
139260
|
+
results,
|
|
139261
|
+
errors: allErrors
|
|
139262
|
+
};
|
|
139263
|
+
} finally {
|
|
139264
|
+
cliConfig.force = previousForce;
|
|
140379
139265
|
}
|
|
140380
|
-
return {
|
|
140381
|
-
results,
|
|
140382
|
-
errors: allErrors
|
|
140383
|
-
};
|
|
140384
139266
|
}
|
|
140385
139267
|
async pushSettings(config2) {
|
|
140386
139268
|
const projectsService = await getProjectsService(this.consoleClient);
|
|
@@ -140455,12 +139337,43 @@ var Push = class {
|
|
|
140455
139337
|
async pushBuckets(buckets) {
|
|
140456
139338
|
let successfullyPushed = 0;
|
|
140457
139339
|
const errors = [];
|
|
139340
|
+
const hasBucketChanges = (remoteBucket, localBucket) => {
|
|
139341
|
+
const scalarFields = [
|
|
139342
|
+
"name",
|
|
139343
|
+
"fileSecurity",
|
|
139344
|
+
"enabled",
|
|
139345
|
+
"maximumFileSize",
|
|
139346
|
+
"encryption",
|
|
139347
|
+
"antivirus",
|
|
139348
|
+
"compression"
|
|
139349
|
+
];
|
|
139350
|
+
if (scalarFields.some((field) => remoteBucket[field] !== localBucket[field])) {
|
|
139351
|
+
return true;
|
|
139352
|
+
}
|
|
139353
|
+
if (!arrayEqualsUnordered(
|
|
139354
|
+
remoteBucket["$permissions"],
|
|
139355
|
+
localBucket["$permissions"]
|
|
139356
|
+
)) {
|
|
139357
|
+
return true;
|
|
139358
|
+
}
|
|
139359
|
+
return !arrayEqualsUnordered(
|
|
139360
|
+
remoteBucket.allowedFileExtensions,
|
|
139361
|
+
localBucket.allowedFileExtensions
|
|
139362
|
+
);
|
|
139363
|
+
};
|
|
140458
139364
|
for (const bucket of buckets) {
|
|
140459
139365
|
try {
|
|
140460
139366
|
this.log(`Pushing bucket ${import_chalk11.default.bold(bucket["name"])} ...`);
|
|
140461
139367
|
const storageService = await getStorageService(this.projectClient);
|
|
140462
139368
|
try {
|
|
140463
|
-
await storageService.getBucket(bucket["$id"]);
|
|
139369
|
+
const remoteBucket = await storageService.getBucket(bucket["$id"]);
|
|
139370
|
+
const hasChanges = hasBucketChanges(remoteBucket, bucket);
|
|
139371
|
+
if (!hasChanges) {
|
|
139372
|
+
this.log(
|
|
139373
|
+
`No changes detected for bucket ${import_chalk11.default.bold(bucket["name"])}. Skipping.`
|
|
139374
|
+
);
|
|
139375
|
+
continue;
|
|
139376
|
+
}
|
|
140464
139377
|
await storageService.updateBucket({
|
|
140465
139378
|
bucketId: bucket["$id"],
|
|
140466
139379
|
name: bucket.name,
|
|
@@ -140473,6 +139386,7 @@ var Push = class {
|
|
|
140473
139386
|
antivirus: bucket.antivirus,
|
|
140474
139387
|
compression: bucket.compression
|
|
140475
139388
|
});
|
|
139389
|
+
successfullyPushed++;
|
|
140476
139390
|
} catch (e) {
|
|
140477
139391
|
if (e instanceof AppwriteException && Number(e.code) === 404) {
|
|
140478
139392
|
await storageService.createBucket({
|
|
@@ -140487,11 +139401,11 @@ var Push = class {
|
|
|
140487
139401
|
encryption: bucket.encryption,
|
|
140488
139402
|
antivirus: bucket.antivirus
|
|
140489
139403
|
});
|
|
139404
|
+
successfullyPushed++;
|
|
140490
139405
|
} else {
|
|
140491
139406
|
throw e;
|
|
140492
139407
|
}
|
|
140493
139408
|
}
|
|
140494
|
-
successfullyPushed++;
|
|
140495
139409
|
} catch (e) {
|
|
140496
139410
|
errors.push(e);
|
|
140497
139411
|
this.error(`Failed to push bucket ${bucket["name"]}: ${e.message}`);
|
|
@@ -141172,8 +140086,12 @@ var Push = class {
|
|
|
141172
140086
|
async pushTables(tables, options = {}) {
|
|
141173
140087
|
const { attempts, skipConfirmation = false } = options;
|
|
141174
140088
|
const pollMaxDebounces = attempts ?? POLL_DEFAULT_VALUE;
|
|
141175
|
-
const pools = new Pools(pollMaxDebounces);
|
|
141176
|
-
const attributes = new Attributes(
|
|
140089
|
+
const pools = new Pools(pollMaxDebounces, this.projectClient);
|
|
140090
|
+
const attributes = new Attributes(
|
|
140091
|
+
pools,
|
|
140092
|
+
skipConfirmation,
|
|
140093
|
+
this.projectClient
|
|
140094
|
+
);
|
|
141177
140095
|
let tablesChanged = /* @__PURE__ */ new Set();
|
|
141178
140096
|
const errors = [];
|
|
141179
140097
|
await Promise.all(
|
|
@@ -141248,6 +140166,11 @@ var Push = class {
|
|
|
141248
140166
|
indexes = indexesResult.attributes;
|
|
141249
140167
|
hadChanges = columnsResult.hasChanges || indexesResult.hasChanges;
|
|
141250
140168
|
if (!hadChanges && columns.length <= 0 && indexes.length <= 0) {
|
|
140169
|
+
if (!tablesChanged.has(table["$id"])) {
|
|
140170
|
+
this.log(
|
|
140171
|
+
`No changes detected for table ${import_chalk11.default.bold(table["name"])}. Skipping.`
|
|
140172
|
+
);
|
|
140173
|
+
}
|
|
141251
140174
|
continue;
|
|
141252
140175
|
}
|
|
141253
140176
|
}
|
|
@@ -141276,8 +140199,12 @@ var Push = class {
|
|
|
141276
140199
|
}
|
|
141277
140200
|
async pushCollections(collections, options = {}) {
|
|
141278
140201
|
const { skipConfirmation = false } = options;
|
|
141279
|
-
const pools = new Pools(POLL_DEFAULT_VALUE);
|
|
141280
|
-
const attributesHelper = new Attributes(
|
|
140202
|
+
const pools = new Pools(POLL_DEFAULT_VALUE, this.projectClient);
|
|
140203
|
+
const attributesHelper = new Attributes(
|
|
140204
|
+
pools,
|
|
140205
|
+
skipConfirmation,
|
|
140206
|
+
this.projectClient
|
|
140207
|
+
);
|
|
141281
140208
|
const errors = [];
|
|
141282
140209
|
const collectionsWithState = collections;
|
|
141283
140210
|
const databases2 = Array.from(
|
|
@@ -141965,10 +140892,11 @@ var pushCollection = async () => {
|
|
|
141965
140892
|
const localDatabase = localConfig.getDatabase(collection.databaseId);
|
|
141966
140893
|
collection.databaseName = localDatabase.name ?? collection.databaseId;
|
|
141967
140894
|
});
|
|
140895
|
+
const projectClient2 = await sdkForProject();
|
|
141968
140896
|
if (!await approveChanges(
|
|
141969
140897
|
collections,
|
|
141970
140898
|
async (args) => {
|
|
141971
|
-
const databasesService = await getDatabasesService();
|
|
140899
|
+
const databasesService = await getDatabasesService(projectClient2);
|
|
141972
140900
|
return await databasesService.getCollection(
|
|
141973
140901
|
args.databaseId,
|
|
141974
140902
|
args.collectionId
|
|
@@ -142471,7 +141399,13 @@ var BaseDatabasesGenerator = class {
|
|
|
142471
141399
|
if (!fs15.existsSync(sdkDir)) {
|
|
142472
141400
|
fs15.mkdirSync(sdkDir, { recursive: true });
|
|
142473
141401
|
}
|
|
142474
|
-
|
|
141402
|
+
const fileEntries = [
|
|
141403
|
+
["databases.ts", result.dbContent],
|
|
141404
|
+
["types.ts", result.typesContent],
|
|
141405
|
+
["index.ts", result.indexContent],
|
|
141406
|
+
["constants.ts", result.constantsContent]
|
|
141407
|
+
];
|
|
141408
|
+
for (const [relativePath, content] of fileEntries) {
|
|
142475
141409
|
const filePath = path14.join(sdkDir, relativePath);
|
|
142476
141410
|
const fileDir = path14.dirname(filePath);
|
|
142477
141411
|
if (!fs15.existsSync(fileDir)) {
|
|
@@ -142483,10 +141417,13 @@ var BaseDatabasesGenerator = class {
|
|
|
142483
141417
|
fs15.writeFileSync(filePath, content, "utf-8");
|
|
142484
141418
|
}
|
|
142485
141419
|
}
|
|
142486
|
-
getGeneratedFilePaths(
|
|
142487
|
-
return
|
|
142488
|
-
|
|
142489
|
-
|
|
141420
|
+
getGeneratedFilePaths(_result) {
|
|
141421
|
+
return [
|
|
141422
|
+
path14.join(SDK_TITLE_LOWER, "databases.ts"),
|
|
141423
|
+
path14.join(SDK_TITLE_LOWER, "types.ts"),
|
|
141424
|
+
path14.join(SDK_TITLE_LOWER, "index.ts"),
|
|
141425
|
+
path14.join(SDK_TITLE_LOWER, "constants.ts")
|
|
141426
|
+
];
|
|
142490
141427
|
}
|
|
142491
141428
|
};
|
|
142492
141429
|
|
|
@@ -142813,29 +141750,24 @@ ${supportsServerSide ? ` create: (databaseId: string, name: string, options?: {
|
|
|
142813
141750
|
throw new Error("Project ID is required in configuration");
|
|
142814
141751
|
}
|
|
142815
141752
|
const importExt = detectImportExtension();
|
|
142816
|
-
const files = /* @__PURE__ */ new Map();
|
|
142817
141753
|
const hasEntities = config2.tables && config2.tables.length > 0 || config2.collections && config2.collections.length > 0;
|
|
142818
141754
|
if (!hasEntities) {
|
|
142819
141755
|
console.log(
|
|
142820
141756
|
"No tables or collections found in configuration. Skipping database generation."
|
|
142821
141757
|
);
|
|
142822
|
-
|
|
142823
|
-
"
|
|
142824
|
-
"// No tables or collections found in configuration\n"
|
|
142825
|
-
|
|
142826
|
-
|
|
142827
|
-
|
|
142828
|
-
"// No tables or collections found in configuration\n"
|
|
142829
|
-
);
|
|
142830
|
-
files.set("index.ts", this.generateIndexFile(importExt));
|
|
142831
|
-
files.set("constants.ts", this.generateConstantsFile(config2));
|
|
142832
|
-
return { files };
|
|
141758
|
+
return {
|
|
141759
|
+
dbContent: "// No tables or collections found in configuration\n",
|
|
141760
|
+
typesContent: "// No tables or collections found in configuration\n",
|
|
141761
|
+
indexContent: this.generateIndexFile(importExt),
|
|
141762
|
+
constantsContent: this.generateConstantsFile(config2)
|
|
141763
|
+
};
|
|
142833
141764
|
}
|
|
142834
|
-
|
|
142835
|
-
|
|
142836
|
-
|
|
142837
|
-
|
|
142838
|
-
|
|
141765
|
+
return {
|
|
141766
|
+
dbContent: this.generateDatabasesFile(config2, importExt),
|
|
141767
|
+
typesContent: this.generateTypesFile(config2),
|
|
141768
|
+
indexContent: this.generateIndexFile(importExt),
|
|
141769
|
+
constantsContent: this.generateConstantsFile(config2)
|
|
141770
|
+
};
|
|
142839
141771
|
}
|
|
142840
141772
|
};
|
|
142841
141773
|
|
|
@@ -144802,7 +143734,7 @@ var getMigrationsClient = async () => {
|
|
|
144802
143734
|
var migrations = new Command("migrations").description(commandDescriptions["migrations"] ?? "").configureHelp({
|
|
144803
143735
|
helpWidth: process.stdout.columns || 80
|
|
144804
143736
|
});
|
|
144805
|
-
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(
|
|
143737
|
+
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(
|
|
144806
143738
|
`--total [value]`,
|
|
144807
143739
|
`When set to false, the total count returned will be 0 and will not be calculated.`,
|
|
144808
143740
|
(value) => value === void 0 ? true : parseBool(value)
|
|
@@ -145148,6 +144080,29 @@ projects.command(`delete-platform`).description(`Delete a platform by its unique
|
|
|
145148
144080
|
async ({ projectId, platformId }) => parse3(await (await getProjectsClient()).deletePlatform(projectId, platformId))
|
|
145149
144081
|
)
|
|
145150
144082
|
);
|
|
144083
|
+
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(
|
|
144084
|
+
`--total [value]`,
|
|
144085
|
+
`When set to false, the total count returned will be 0 and will not be calculated.`,
|
|
144086
|
+
(value) => value === void 0 ? true : parseBool(value)
|
|
144087
|
+
).action(
|
|
144088
|
+
actionRunner(
|
|
144089
|
+
async ({ projectId, queries, total }) => parse3(await (await getProjectsClient()).listSchedules(projectId, queries, total))
|
|
144090
|
+
)
|
|
144091
|
+
);
|
|
144092
|
+
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(
|
|
144093
|
+
`--active [value]`,
|
|
144094
|
+
`Whether the schedule is active.`,
|
|
144095
|
+
(value) => value === void 0 ? true : parseBool(value)
|
|
144096
|
+
).option(`--data <data>`, `Schedule data as a JSON string. Used to store resource-specific context needed for execution.`).action(
|
|
144097
|
+
actionRunner(
|
|
144098
|
+
async ({ projectId, resourceType, resourceId, schedule, active, data }) => parse3(await (await getProjectsClient()).createSchedule(projectId, resourceType, resourceId, schedule, active, JSON.parse(data)))
|
|
144099
|
+
)
|
|
144100
|
+
);
|
|
144101
|
+
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(
|
|
144102
|
+
actionRunner(
|
|
144103
|
+
async ({ projectId, scheduleId }) => parse3(await (await getProjectsClient()).getSchedule(projectId, scheduleId))
|
|
144104
|
+
)
|
|
144105
|
+
);
|
|
145151
144106
|
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(
|
|
145152
144107
|
actionRunner(
|
|
145153
144108
|
async ({ projectId, service, status }) => parse3(await (await getProjectsClient()).updateServiceStatus(projectId, service, status))
|
|
@@ -146761,9 +145716,6 @@ if (process.argv.includes("-v") || process.argv.includes("--version")) {
|
|
|
146761
145716
|
}
|
|
146762
145717
|
/*! Bundled license information:
|
|
146763
145718
|
|
|
146764
|
-
safe-buffer/index.js:
|
|
146765
|
-
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
146766
|
-
|
|
146767
145719
|
undici/lib/fetch/body.js:
|
|
146768
145720
|
(*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
|
|
146769
145721
|
|