@stonecrop/graphql-client 0.2.21 → 0.2.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/graphql-client.js +2120 -1003
- package/dist/graphql-client.js.map +1 -1
- package/dist/graphql-client.umd.cjs +39 -33
- package/dist/graphql-client.umd.cjs.map +1 -1
- package/package.json +3 -2
- package/src/index.ts +49 -4
package/dist/graphql-client.js
CHANGED
|
@@ -1,108 +1,1209 @@
|
|
|
1
|
-
function
|
|
1
|
+
function Dt(e, t) {
|
|
2
2
|
for (var n = 0; n < t.length; n++) {
|
|
3
|
-
const
|
|
4
|
-
if (typeof
|
|
5
|
-
for (const
|
|
6
|
-
if (
|
|
7
|
-
const s = Object.getOwnPropertyDescriptor(
|
|
8
|
-
s && Object.defineProperty(e,
|
|
3
|
+
const i = t[n];
|
|
4
|
+
if (typeof i != "string" && !Array.isArray(i)) {
|
|
5
|
+
for (const r in i)
|
|
6
|
+
if (r !== "default" && !(r in e)) {
|
|
7
|
+
const s = Object.getOwnPropertyDescriptor(i, r);
|
|
8
|
+
s && Object.defineProperty(e, r, s.get ? s : {
|
|
9
9
|
enumerable: !0,
|
|
10
|
-
get: () => r
|
|
10
|
+
get: () => i[r]
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }));
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
/*!
|
|
18
|
+
* decimal.js v10.4.3
|
|
19
|
+
* An arbitrary-precision Decimal type for JavaScript.
|
|
20
|
+
* https://github.com/MikeMcl/decimal.js
|
|
21
|
+
* Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
22
|
+
* MIT Licence
|
|
23
|
+
*/
|
|
24
|
+
var ae = 9e15, ne = 1e9, Be = "0123456789abcdef", Ie = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058", Oe = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789", Ue = {
|
|
25
|
+
// These values must be integers within the stated ranges (inclusive).
|
|
26
|
+
// Most of these values can be changed at run-time using the `Decimal.config` method.
|
|
27
|
+
// The maximum number of significant digits of the result of a calculation or base conversion.
|
|
28
|
+
// E.g. `Decimal.config({ precision: 20 });`
|
|
29
|
+
precision: 20,
|
|
30
|
+
// 1 to MAX_DIGITS
|
|
31
|
+
// The rounding mode used when rounding to `precision`.
|
|
32
|
+
//
|
|
33
|
+
// ROUND_UP 0 Away from zero.
|
|
34
|
+
// ROUND_DOWN 1 Towards zero.
|
|
35
|
+
// ROUND_CEIL 2 Towards +Infinity.
|
|
36
|
+
// ROUND_FLOOR 3 Towards -Infinity.
|
|
37
|
+
// ROUND_HALF_UP 4 Towards nearest neighbour. If equidistant, up.
|
|
38
|
+
// ROUND_HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.
|
|
39
|
+
// ROUND_HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.
|
|
40
|
+
// ROUND_HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.
|
|
41
|
+
// ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.
|
|
42
|
+
//
|
|
43
|
+
// E.g.
|
|
44
|
+
// `Decimal.rounding = 4;`
|
|
45
|
+
// `Decimal.rounding = Decimal.ROUND_HALF_UP;`
|
|
46
|
+
rounding: 4,
|
|
47
|
+
// 0 to 8
|
|
48
|
+
// The modulo mode used when calculating the modulus: a mod n.
|
|
49
|
+
// The quotient (q = a / n) is calculated according to the corresponding rounding mode.
|
|
50
|
+
// The remainder (r) is calculated as: r = a - n * q.
|
|
51
|
+
//
|
|
52
|
+
// UP 0 The remainder is positive if the dividend is negative, else is negative.
|
|
53
|
+
// DOWN 1 The remainder has the same sign as the dividend (JavaScript %).
|
|
54
|
+
// FLOOR 3 The remainder has the same sign as the divisor (Python %).
|
|
55
|
+
// HALF_EVEN 6 The IEEE 754 remainder function.
|
|
56
|
+
// EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). Always positive.
|
|
57
|
+
//
|
|
58
|
+
// Truncated division (1), floored division (3), the IEEE 754 remainder (6), and Euclidian
|
|
59
|
+
// division (9) are commonly used for the modulus operation. The other rounding modes can also
|
|
60
|
+
// be used, but they may not give useful results.
|
|
61
|
+
modulo: 1,
|
|
62
|
+
// 0 to 9
|
|
63
|
+
// The exponent value at and beneath which `toString` returns exponential notation.
|
|
64
|
+
// JavaScript numbers: -7
|
|
65
|
+
toExpNeg: -7,
|
|
66
|
+
// 0 to -EXP_LIMIT
|
|
67
|
+
// The exponent value at and above which `toString` returns exponential notation.
|
|
68
|
+
// JavaScript numbers: 21
|
|
69
|
+
toExpPos: 21,
|
|
70
|
+
// 0 to EXP_LIMIT
|
|
71
|
+
// The minimum exponent value, beneath which underflow to zero occurs.
|
|
72
|
+
// JavaScript numbers: -324 (5e-324)
|
|
73
|
+
minE: -ae,
|
|
74
|
+
// -1 to -EXP_LIMIT
|
|
75
|
+
// The maximum exponent value, above which overflow to Infinity occurs.
|
|
76
|
+
// JavaScript numbers: 308 (1.7976931348623157e+308)
|
|
77
|
+
maxE: ae,
|
|
78
|
+
// 1 to EXP_LIMIT
|
|
79
|
+
// Whether to use cryptographically-secure random number generation, if available.
|
|
80
|
+
crypto: !1
|
|
81
|
+
// true/false
|
|
82
|
+
}, at, Z, O = !0, De = "[DecimalError] ", te = De + "Invalid argument: ", ct = De + "Precision limit exceeded", ut = De + "crypto unavailable", lt = "[object Decimal]", V = Math.floor, F = Math.pow, xt = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i, St = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i, Ct = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i, ft = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, z = 1e7, A = 7, kt = 9007199254740991, Rt = Ie.length - 1, qe = Oe.length - 1, m = { toStringTag: lt };
|
|
83
|
+
m.absoluteValue = m.abs = function() {
|
|
84
|
+
var e = new this.constructor(this);
|
|
85
|
+
return e.s < 0 && (e.s = 1), T(e);
|
|
86
|
+
};
|
|
87
|
+
m.ceil = function() {
|
|
88
|
+
return T(new this.constructor(this), this.e + 1, 2);
|
|
89
|
+
};
|
|
90
|
+
m.clampedTo = m.clamp = function(e, t) {
|
|
91
|
+
var n, i = this, r = i.constructor;
|
|
92
|
+
if (e = new r(e), t = new r(t), !e.s || !t.s)
|
|
93
|
+
return new r(NaN);
|
|
94
|
+
if (e.gt(t))
|
|
95
|
+
throw Error(te + t);
|
|
96
|
+
return n = i.cmp(e), n < 0 ? e : i.cmp(t) > 0 ? t : new r(i);
|
|
97
|
+
};
|
|
98
|
+
m.comparedTo = m.cmp = function(e) {
|
|
99
|
+
var t, n, i, r, s = this, o = s.d, a = (e = new s.constructor(e)).d, u = s.s, c = e.s;
|
|
100
|
+
if (!o || !a)
|
|
101
|
+
return !u || !c ? NaN : u !== c ? u : o === a ? 0 : !o ^ u < 0 ? 1 : -1;
|
|
102
|
+
if (!o[0] || !a[0])
|
|
103
|
+
return o[0] ? u : a[0] ? -c : 0;
|
|
104
|
+
if (u !== c)
|
|
105
|
+
return u;
|
|
106
|
+
if (s.e !== e.e)
|
|
107
|
+
return s.e > e.e ^ u < 0 ? 1 : -1;
|
|
108
|
+
for (i = o.length, r = a.length, t = 0, n = i < r ? i : r; t < n; ++t)
|
|
109
|
+
if (o[t] !== a[t])
|
|
110
|
+
return o[t] > a[t] ^ u < 0 ? 1 : -1;
|
|
111
|
+
return i === r ? 0 : i > r ^ u < 0 ? 1 : -1;
|
|
112
|
+
};
|
|
113
|
+
m.cosine = m.cos = function() {
|
|
114
|
+
var e, t, n = this, i = n.constructor;
|
|
115
|
+
return n.d ? n.d[0] ? (e = i.precision, t = i.rounding, i.precision = e + Math.max(n.e, n.sd()) + A, i.rounding = 1, n = Lt(i, gt(i, n)), i.precision = e, i.rounding = t, T(Z == 2 || Z == 3 ? n.neg() : n, e, t, !0)) : new i(1) : new i(NaN);
|
|
116
|
+
};
|
|
117
|
+
m.cubeRoot = m.cbrt = function() {
|
|
118
|
+
var e, t, n, i, r, s, o, a, u, c, l = this, f = l.constructor;
|
|
119
|
+
if (!l.isFinite() || l.isZero())
|
|
120
|
+
return new f(l);
|
|
121
|
+
for (O = !1, s = l.s * F(l.s * l, 1 / 3), !s || Math.abs(s) == 1 / 0 ? (n = B(l.d), e = l.e, (s = (e - n.length + 1) % 3) && (n += s == 1 || s == -2 ? "0" : "00"), s = F(n, 1 / 3), e = V((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2)), s == 1 / 0 ? n = "5e" + e : (n = s.toExponential(), n = n.slice(0, n.indexOf("e") + 1) + e), i = new f(n), i.s = l.s) : i = new f(s.toString()), o = (e = f.precision) + 3; ; )
|
|
122
|
+
if (a = i, u = a.times(a).times(a), c = u.plus(l), i = k(c.plus(l).times(a), c.plus(u), o + 2, 1), B(a.d).slice(0, o) === (n = B(i.d)).slice(0, o))
|
|
123
|
+
if (n = n.slice(o - 3, o + 1), n == "9999" || !r && n == "4999") {
|
|
124
|
+
if (!r && (T(a, e + 1, 0), a.times(a).times(a).eq(l))) {
|
|
125
|
+
i = a;
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
o += 4, r = 1;
|
|
129
|
+
} else {
|
|
130
|
+
(!+n || !+n.slice(1) && n.charAt(0) == "5") && (T(i, e + 1, 1), t = !i.times(i).times(i).eq(l));
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
return O = !0, T(i, e, f.rounding, t);
|
|
134
|
+
};
|
|
135
|
+
m.decimalPlaces = m.dp = function() {
|
|
136
|
+
var e, t = this.d, n = NaN;
|
|
137
|
+
if (t) {
|
|
138
|
+
if (e = t.length - 1, n = (e - V(this.e / A)) * A, e = t[e], e)
|
|
139
|
+
for (; e % 10 == 0; e /= 10)
|
|
140
|
+
n--;
|
|
141
|
+
n < 0 && (n = 0);
|
|
142
|
+
}
|
|
143
|
+
return n;
|
|
144
|
+
};
|
|
145
|
+
m.dividedBy = m.div = function(e) {
|
|
146
|
+
return k(this, new this.constructor(e));
|
|
147
|
+
};
|
|
148
|
+
m.dividedToIntegerBy = m.divToInt = function(e) {
|
|
149
|
+
var t = this, n = t.constructor;
|
|
150
|
+
return T(k(t, new n(e), 0, 1, 1), n.precision, n.rounding);
|
|
151
|
+
};
|
|
152
|
+
m.equals = m.eq = function(e) {
|
|
153
|
+
return this.cmp(e) === 0;
|
|
154
|
+
};
|
|
155
|
+
m.floor = function() {
|
|
156
|
+
return T(new this.constructor(this), this.e + 1, 3);
|
|
157
|
+
};
|
|
158
|
+
m.greaterThan = m.gt = function(e) {
|
|
159
|
+
return this.cmp(e) > 0;
|
|
160
|
+
};
|
|
161
|
+
m.greaterThanOrEqualTo = m.gte = function(e) {
|
|
162
|
+
var t = this.cmp(e);
|
|
163
|
+
return t == 1 || t === 0;
|
|
164
|
+
};
|
|
165
|
+
m.hyperbolicCosine = m.cosh = function() {
|
|
166
|
+
var e, t, n, i, r, s = this, o = s.constructor, a = new o(1);
|
|
167
|
+
if (!s.isFinite())
|
|
168
|
+
return new o(s.s ? 1 / 0 : NaN);
|
|
169
|
+
if (s.isZero())
|
|
170
|
+
return a;
|
|
171
|
+
n = o.precision, i = o.rounding, o.precision = n + Math.max(s.e, s.sd()) + 4, o.rounding = 1, r = s.d.length, r < 32 ? (e = Math.ceil(r / 3), t = (1 / Se(4, e)).toString()) : (e = 16, t = "2.3283064365386962890625e-10"), s = ue(o, 1, s.times(t), new o(1), !0);
|
|
172
|
+
for (var u, c = e, l = new o(8); c--; )
|
|
173
|
+
u = s.times(s), s = a.minus(u.times(l.minus(u.times(l))));
|
|
174
|
+
return T(s, o.precision = n, o.rounding = i, !0);
|
|
175
|
+
};
|
|
176
|
+
m.hyperbolicSine = m.sinh = function() {
|
|
177
|
+
var e, t, n, i, r = this, s = r.constructor;
|
|
178
|
+
if (!r.isFinite() || r.isZero())
|
|
179
|
+
return new s(r);
|
|
180
|
+
if (t = s.precision, n = s.rounding, s.precision = t + Math.max(r.e, r.sd()) + 4, s.rounding = 1, i = r.d.length, i < 3)
|
|
181
|
+
r = ue(s, 2, r, r, !0);
|
|
182
|
+
else {
|
|
183
|
+
e = 1.4 * Math.sqrt(i), e = e > 16 ? 16 : e | 0, r = r.times(1 / Se(5, e)), r = ue(s, 2, r, r, !0);
|
|
184
|
+
for (var o, a = new s(5), u = new s(16), c = new s(20); e--; )
|
|
185
|
+
o = r.times(r), r = r.times(a.plus(o.times(u.times(o).plus(c))));
|
|
186
|
+
}
|
|
187
|
+
return s.precision = t, s.rounding = n, T(r, t, n, !0);
|
|
188
|
+
};
|
|
189
|
+
m.hyperbolicTangent = m.tanh = function() {
|
|
190
|
+
var e, t, n = this, i = n.constructor;
|
|
191
|
+
return n.isFinite() ? n.isZero() ? new i(n) : (e = i.precision, t = i.rounding, i.precision = e + 7, i.rounding = 1, k(n.sinh(), n.cosh(), i.precision = e, i.rounding = t)) : new i(n.s);
|
|
192
|
+
};
|
|
193
|
+
m.inverseCosine = m.acos = function() {
|
|
194
|
+
var e, t = this, n = t.constructor, i = t.abs().cmp(1), r = n.precision, s = n.rounding;
|
|
195
|
+
return i !== -1 ? i === 0 ? t.isNeg() ? J(n, r, s) : new n(0) : new n(NaN) : t.isZero() ? J(n, r + 4, s).times(0.5) : (n.precision = r + 6, n.rounding = 1, t = t.asin(), e = J(n, r + 4, s).times(0.5), n.precision = r, n.rounding = s, e.minus(t));
|
|
196
|
+
};
|
|
197
|
+
m.inverseHyperbolicCosine = m.acosh = function() {
|
|
198
|
+
var e, t, n = this, i = n.constructor;
|
|
199
|
+
return n.lte(1) ? new i(n.eq(1) ? 0 : NaN) : n.isFinite() ? (e = i.precision, t = i.rounding, i.precision = e + Math.max(Math.abs(n.e), n.sd()) + 4, i.rounding = 1, O = !1, n = n.times(n).minus(1).sqrt().plus(n), O = !0, i.precision = e, i.rounding = t, n.ln()) : new i(n);
|
|
200
|
+
};
|
|
201
|
+
m.inverseHyperbolicSine = m.asinh = function() {
|
|
202
|
+
var e, t, n = this, i = n.constructor;
|
|
203
|
+
return !n.isFinite() || n.isZero() ? new i(n) : (e = i.precision, t = i.rounding, i.precision = e + 2 * Math.max(Math.abs(n.e), n.sd()) + 6, i.rounding = 1, O = !1, n = n.times(n).plus(1).sqrt().plus(n), O = !0, i.precision = e, i.rounding = t, n.ln());
|
|
204
|
+
};
|
|
205
|
+
m.inverseHyperbolicTangent = m.atanh = function() {
|
|
206
|
+
var e, t, n, i, r = this, s = r.constructor;
|
|
207
|
+
return r.isFinite() ? r.e >= 0 ? new s(r.abs().eq(1) ? r.s / 0 : r.isZero() ? r : NaN) : (e = s.precision, t = s.rounding, i = r.sd(), Math.max(i, e) < 2 * -r.e - 1 ? T(new s(r), e, t, !0) : (s.precision = n = i - r.e, r = k(r.plus(1), new s(1).minus(r), n + e, 1), s.precision = e + 4, s.rounding = 1, r = r.ln(), s.precision = e, s.rounding = t, r.times(0.5))) : new s(NaN);
|
|
208
|
+
};
|
|
209
|
+
m.inverseSine = m.asin = function() {
|
|
210
|
+
var e, t, n, i, r = this, s = r.constructor;
|
|
211
|
+
return r.isZero() ? new s(r) : (t = r.abs().cmp(1), n = s.precision, i = s.rounding, t !== -1 ? t === 0 ? (e = J(s, n + 4, i).times(0.5), e.s = r.s, e) : new s(NaN) : (s.precision = n + 6, s.rounding = 1, r = r.div(new s(1).minus(r.times(r)).sqrt().plus(1)).atan(), s.precision = n, s.rounding = i, r.times(2)));
|
|
212
|
+
};
|
|
213
|
+
m.inverseTangent = m.atan = function() {
|
|
214
|
+
var e, t, n, i, r, s, o, a, u, c = this, l = c.constructor, f = l.precision, h = l.rounding;
|
|
215
|
+
if (c.isFinite()) {
|
|
216
|
+
if (c.isZero())
|
|
217
|
+
return new l(c);
|
|
218
|
+
if (c.abs().eq(1) && f + 4 <= qe)
|
|
219
|
+
return o = J(l, f + 4, h).times(0.25), o.s = c.s, o;
|
|
220
|
+
} else {
|
|
221
|
+
if (!c.s)
|
|
222
|
+
return new l(NaN);
|
|
223
|
+
if (f + 4 <= qe)
|
|
224
|
+
return o = J(l, f + 4, h).times(0.5), o.s = c.s, o;
|
|
225
|
+
}
|
|
226
|
+
for (l.precision = a = f + 10, l.rounding = 1, n = Math.min(28, a / A + 2 | 0), e = n; e; --e)
|
|
227
|
+
c = c.div(c.times(c).plus(1).sqrt().plus(1));
|
|
228
|
+
for (O = !1, t = Math.ceil(a / A), i = 1, u = c.times(c), o = new l(c), r = c; e !== -1; )
|
|
229
|
+
if (r = r.times(u), s = o.minus(r.div(i += 2)), r = r.times(u), o = s.plus(r.div(i += 2)), o.d[t] !== void 0)
|
|
230
|
+
for (e = t; o.d[e] === s.d[e] && e--; )
|
|
231
|
+
;
|
|
232
|
+
return n && (o = o.times(2 << n - 1)), O = !0, T(o, l.precision = f, l.rounding = h, !0);
|
|
233
|
+
};
|
|
234
|
+
m.isFinite = function() {
|
|
235
|
+
return !!this.d;
|
|
236
|
+
};
|
|
237
|
+
m.isInteger = m.isInt = function() {
|
|
238
|
+
return !!this.d && V(this.e / A) > this.d.length - 2;
|
|
239
|
+
};
|
|
240
|
+
m.isNaN = function() {
|
|
241
|
+
return !this.s;
|
|
242
|
+
};
|
|
243
|
+
m.isNegative = m.isNeg = function() {
|
|
244
|
+
return this.s < 0;
|
|
245
|
+
};
|
|
246
|
+
m.isPositive = m.isPos = function() {
|
|
247
|
+
return this.s > 0;
|
|
248
|
+
};
|
|
249
|
+
m.isZero = function() {
|
|
250
|
+
return !!this.d && this.d[0] === 0;
|
|
251
|
+
};
|
|
252
|
+
m.lessThan = m.lt = function(e) {
|
|
253
|
+
return this.cmp(e) < 0;
|
|
254
|
+
};
|
|
255
|
+
m.lessThanOrEqualTo = m.lte = function(e) {
|
|
256
|
+
return this.cmp(e) < 1;
|
|
257
|
+
};
|
|
258
|
+
m.logarithm = m.log = function(e) {
|
|
259
|
+
var t, n, i, r, s, o, a, u, c = this, l = c.constructor, f = l.precision, h = l.rounding, E = 5;
|
|
260
|
+
if (e == null)
|
|
261
|
+
e = new l(10), t = !0;
|
|
262
|
+
else {
|
|
263
|
+
if (e = new l(e), n = e.d, e.s < 0 || !n || !n[0] || e.eq(1))
|
|
264
|
+
return new l(NaN);
|
|
265
|
+
t = e.eq(10);
|
|
266
|
+
}
|
|
267
|
+
if (n = c.d, c.s < 0 || !n || !n[0] || c.eq(1))
|
|
268
|
+
return new l(n && !n[0] ? -1 / 0 : c.s != 1 ? NaN : n ? 0 : 1 / 0);
|
|
269
|
+
if (t)
|
|
270
|
+
if (n.length > 1)
|
|
271
|
+
s = !0;
|
|
272
|
+
else {
|
|
273
|
+
for (r = n[0]; r % 10 === 0; )
|
|
274
|
+
r /= 10;
|
|
275
|
+
s = r !== 1;
|
|
276
|
+
}
|
|
277
|
+
if (O = !1, a = f + E, o = ee(c, a), i = t ? _e(l, a + 10) : ee(e, a), u = k(o, i, a, 1), ge(u.d, r = f, h))
|
|
278
|
+
do
|
|
279
|
+
if (a += 10, o = ee(c, a), i = t ? _e(l, a + 10) : ee(e, a), u = k(o, i, a, 1), !s) {
|
|
280
|
+
+B(u.d).slice(r + 1, r + 15) + 1 == 1e14 && (u = T(u, f + 1, 0));
|
|
281
|
+
break;
|
|
282
|
+
}
|
|
283
|
+
while (ge(u.d, r += 10, h));
|
|
284
|
+
return O = !0, T(u, f, h);
|
|
285
|
+
};
|
|
286
|
+
m.minus = m.sub = function(e) {
|
|
287
|
+
var t, n, i, r, s, o, a, u, c, l, f, h, E = this, N = E.constructor;
|
|
288
|
+
if (e = new N(e), !E.d || !e.d)
|
|
289
|
+
return !E.s || !e.s ? e = new N(NaN) : E.d ? e.s = -e.s : e = new N(e.d || E.s !== e.s ? E : NaN), e;
|
|
290
|
+
if (E.s != e.s)
|
|
291
|
+
return e.s = -e.s, E.plus(e);
|
|
292
|
+
if (c = E.d, h = e.d, a = N.precision, u = N.rounding, !c[0] || !h[0]) {
|
|
293
|
+
if (h[0])
|
|
294
|
+
e.s = -e.s;
|
|
295
|
+
else if (c[0])
|
|
296
|
+
e = new N(E);
|
|
297
|
+
else
|
|
298
|
+
return new N(u === 3 ? -0 : 0);
|
|
299
|
+
return O ? T(e, a, u) : e;
|
|
300
|
+
}
|
|
301
|
+
if (n = V(e.e / A), l = V(E.e / A), c = c.slice(), s = l - n, s) {
|
|
302
|
+
for (f = s < 0, f ? (t = c, s = -s, o = h.length) : (t = h, n = l, o = c.length), i = Math.max(Math.ceil(a / A), o) + 2, s > i && (s = i, t.length = 1), t.reverse(), i = s; i--; )
|
|
303
|
+
t.push(0);
|
|
304
|
+
t.reverse();
|
|
305
|
+
} else {
|
|
306
|
+
for (i = c.length, o = h.length, f = i < o, f && (o = i), i = 0; i < o; i++)
|
|
307
|
+
if (c[i] != h[i]) {
|
|
308
|
+
f = c[i] < h[i];
|
|
309
|
+
break;
|
|
310
|
+
}
|
|
311
|
+
s = 0;
|
|
312
|
+
}
|
|
313
|
+
for (f && (t = c, c = h, h = t, e.s = -e.s), o = c.length, i = h.length - o; i > 0; --i)
|
|
314
|
+
c[o++] = 0;
|
|
315
|
+
for (i = h.length; i > s; ) {
|
|
316
|
+
if (c[--i] < h[i]) {
|
|
317
|
+
for (r = i; r && c[--r] === 0; )
|
|
318
|
+
c[r] = z - 1;
|
|
319
|
+
--c[r], c[i] += z;
|
|
320
|
+
}
|
|
321
|
+
c[i] -= h[i];
|
|
322
|
+
}
|
|
323
|
+
for (; c[--o] === 0; )
|
|
324
|
+
c.pop();
|
|
325
|
+
for (; c[0] === 0; c.shift())
|
|
326
|
+
--n;
|
|
327
|
+
return c[0] ? (e.d = c, e.e = xe(c, n), O ? T(e, a, u) : e) : new N(u === 3 ? -0 : 0);
|
|
328
|
+
};
|
|
329
|
+
m.modulo = m.mod = function(e) {
|
|
330
|
+
var t, n = this, i = n.constructor;
|
|
331
|
+
return e = new i(e), !n.d || !e.s || e.d && !e.d[0] ? new i(NaN) : !e.d || n.d && !n.d[0] ? T(new i(n), i.precision, i.rounding) : (O = !1, i.modulo == 9 ? (t = k(n, e.abs(), 0, 3, 1), t.s *= e.s) : t = k(n, e, 0, i.modulo, 1), t = t.times(e), O = !0, n.minus(t));
|
|
332
|
+
};
|
|
333
|
+
m.naturalExponential = m.exp = function() {
|
|
334
|
+
return Ve(this);
|
|
335
|
+
};
|
|
336
|
+
m.naturalLogarithm = m.ln = function() {
|
|
337
|
+
return ee(this);
|
|
338
|
+
};
|
|
339
|
+
m.negated = m.neg = function() {
|
|
340
|
+
var e = new this.constructor(this);
|
|
341
|
+
return e.s = -e.s, T(e);
|
|
342
|
+
};
|
|
343
|
+
m.plus = m.add = function(e) {
|
|
344
|
+
var t, n, i, r, s, o, a, u, c, l, f = this, h = f.constructor;
|
|
345
|
+
if (e = new h(e), !f.d || !e.d)
|
|
346
|
+
return !f.s || !e.s ? e = new h(NaN) : f.d || (e = new h(e.d || f.s === e.s ? f : NaN)), e;
|
|
347
|
+
if (f.s != e.s)
|
|
348
|
+
return e.s = -e.s, f.minus(e);
|
|
349
|
+
if (c = f.d, l = e.d, a = h.precision, u = h.rounding, !c[0] || !l[0])
|
|
350
|
+
return l[0] || (e = new h(f)), O ? T(e, a, u) : e;
|
|
351
|
+
if (s = V(f.e / A), i = V(e.e / A), c = c.slice(), r = s - i, r) {
|
|
352
|
+
for (r < 0 ? (n = c, r = -r, o = l.length) : (n = l, i = s, o = c.length), s = Math.ceil(a / A), o = s > o ? s + 1 : o + 1, r > o && (r = o, n.length = 1), n.reverse(); r--; )
|
|
353
|
+
n.push(0);
|
|
354
|
+
n.reverse();
|
|
355
|
+
}
|
|
356
|
+
for (o = c.length, r = l.length, o - r < 0 && (r = o, n = l, l = c, c = n), t = 0; r; )
|
|
357
|
+
t = (c[--r] = c[r] + l[r] + t) / z | 0, c[r] %= z;
|
|
358
|
+
for (t && (c.unshift(t), ++i), o = c.length; c[--o] == 0; )
|
|
359
|
+
c.pop();
|
|
360
|
+
return e.d = c, e.e = xe(c, i), O ? T(e, a, u) : e;
|
|
361
|
+
};
|
|
362
|
+
m.precision = m.sd = function(e) {
|
|
363
|
+
var t, n = this;
|
|
364
|
+
if (e !== void 0 && e !== !!e && e !== 1 && e !== 0)
|
|
365
|
+
throw Error(te + e);
|
|
366
|
+
return n.d ? (t = ht(n.d), e && n.e + 1 > t && (t = n.e + 1)) : t = NaN, t;
|
|
367
|
+
};
|
|
368
|
+
m.round = function() {
|
|
369
|
+
var e = this, t = e.constructor;
|
|
370
|
+
return T(new t(e), e.e + 1, t.rounding);
|
|
371
|
+
};
|
|
372
|
+
m.sine = m.sin = function() {
|
|
373
|
+
var e, t, n = this, i = n.constructor;
|
|
374
|
+
return n.isFinite() ? n.isZero() ? new i(n) : (e = i.precision, t = i.rounding, i.precision = e + Math.max(n.e, n.sd()) + A, i.rounding = 1, n = Pt(i, gt(i, n)), i.precision = e, i.rounding = t, T(Z > 2 ? n.neg() : n, e, t, !0)) : new i(NaN);
|
|
375
|
+
};
|
|
376
|
+
m.squareRoot = m.sqrt = function() {
|
|
377
|
+
var e, t, n, i, r, s, o = this, a = o.d, u = o.e, c = o.s, l = o.constructor;
|
|
378
|
+
if (c !== 1 || !a || !a[0])
|
|
379
|
+
return new l(!c || c < 0 && (!a || a[0]) ? NaN : a ? o : 1 / 0);
|
|
380
|
+
for (O = !1, c = Math.sqrt(+o), c == 0 || c == 1 / 0 ? (t = B(a), (t.length + u) % 2 == 0 && (t += "0"), c = Math.sqrt(t), u = V((u + 1) / 2) - (u < 0 || u % 2), c == 1 / 0 ? t = "5e" + u : (t = c.toExponential(), t = t.slice(0, t.indexOf("e") + 1) + u), i = new l(t)) : i = new l(c.toString()), n = (u = l.precision) + 3; ; )
|
|
381
|
+
if (s = i, i = s.plus(k(o, s, n + 2, 1)).times(0.5), B(s.d).slice(0, n) === (t = B(i.d)).slice(0, n))
|
|
382
|
+
if (t = t.slice(n - 3, n + 1), t == "9999" || !r && t == "4999") {
|
|
383
|
+
if (!r && (T(s, u + 1, 0), s.times(s).eq(o))) {
|
|
384
|
+
i = s;
|
|
385
|
+
break;
|
|
386
|
+
}
|
|
387
|
+
n += 4, r = 1;
|
|
388
|
+
} else {
|
|
389
|
+
(!+t || !+t.slice(1) && t.charAt(0) == "5") && (T(i, u + 1, 1), e = !i.times(i).eq(o));
|
|
390
|
+
break;
|
|
391
|
+
}
|
|
392
|
+
return O = !0, T(i, u, l.rounding, e);
|
|
393
|
+
};
|
|
394
|
+
m.tangent = m.tan = function() {
|
|
395
|
+
var e, t, n = this, i = n.constructor;
|
|
396
|
+
return n.isFinite() ? n.isZero() ? new i(n) : (e = i.precision, t = i.rounding, i.precision = e + 10, i.rounding = 1, n = n.sin(), n.s = 1, n = k(n, new i(1).minus(n.times(n)).sqrt(), e + 10, 0), i.precision = e, i.rounding = t, T(Z == 2 || Z == 4 ? n.neg() : n, e, t, !0)) : new i(NaN);
|
|
397
|
+
};
|
|
398
|
+
m.times = m.mul = function(e) {
|
|
399
|
+
var t, n, i, r, s, o, a, u, c, l = this, f = l.constructor, h = l.d, E = (e = new f(e)).d;
|
|
400
|
+
if (e.s *= l.s, !h || !h[0] || !E || !E[0])
|
|
401
|
+
return new f(!e.s || h && !h[0] && !E || E && !E[0] && !h ? NaN : !h || !E ? e.s / 0 : e.s * 0);
|
|
402
|
+
for (n = V(l.e / A) + V(e.e / A), u = h.length, c = E.length, u < c && (s = h, h = E, E = s, o = u, u = c, c = o), s = [], o = u + c, i = o; i--; )
|
|
403
|
+
s.push(0);
|
|
404
|
+
for (i = c; --i >= 0; ) {
|
|
405
|
+
for (t = 0, r = u + i; r > i; )
|
|
406
|
+
a = s[r] + E[i] * h[r - i - 1] + t, s[r--] = a % z | 0, t = a / z | 0;
|
|
407
|
+
s[r] = (s[r] + t) % z | 0;
|
|
408
|
+
}
|
|
409
|
+
for (; !s[--o]; )
|
|
410
|
+
s.pop();
|
|
411
|
+
return t ? ++n : s.shift(), e.d = s, e.e = xe(s, n), O ? T(e, f.precision, f.rounding) : e;
|
|
412
|
+
};
|
|
413
|
+
m.toBinary = function(e, t) {
|
|
414
|
+
return Je(this, 2, e, t);
|
|
415
|
+
};
|
|
416
|
+
m.toDecimalPlaces = m.toDP = function(e, t) {
|
|
417
|
+
var n = this, i = n.constructor;
|
|
418
|
+
return n = new i(n), e === void 0 ? n : ($(e, 0, ne), t === void 0 ? t = i.rounding : $(t, 0, 8), T(n, e + n.e + 1, t));
|
|
419
|
+
};
|
|
420
|
+
m.toExponential = function(e, t) {
|
|
421
|
+
var n, i = this, r = i.constructor;
|
|
422
|
+
return e === void 0 ? n = X(i, !0) : ($(e, 0, ne), t === void 0 ? t = r.rounding : $(t, 0, 8), i = T(new r(i), e + 1, t), n = X(i, !0, e + 1)), i.isNeg() && !i.isZero() ? "-" + n : n;
|
|
423
|
+
};
|
|
424
|
+
m.toFixed = function(e, t) {
|
|
425
|
+
var n, i, r = this, s = r.constructor;
|
|
426
|
+
return e === void 0 ? n = X(r) : ($(e, 0, ne), t === void 0 ? t = s.rounding : $(t, 0, 8), i = T(new s(r), e + r.e + 1, t), n = X(i, !1, e + i.e + 1)), r.isNeg() && !r.isZero() ? "-" + n : n;
|
|
427
|
+
};
|
|
428
|
+
m.toFraction = function(e) {
|
|
429
|
+
var t, n, i, r, s, o, a, u, c, l, f, h, E = this, N = E.d, y = E.constructor;
|
|
430
|
+
if (!N)
|
|
431
|
+
return new y(E);
|
|
432
|
+
if (c = n = new y(1), i = u = new y(0), t = new y(i), s = t.e = ht(N) - E.e - 1, o = s % A, t.d[0] = F(10, o < 0 ? A + o : o), e == null)
|
|
433
|
+
e = s > 0 ? t : c;
|
|
434
|
+
else {
|
|
435
|
+
if (a = new y(e), !a.isInt() || a.lt(c))
|
|
436
|
+
throw Error(te + a);
|
|
437
|
+
e = a.gt(t) ? s > 0 ? t : c : a;
|
|
438
|
+
}
|
|
439
|
+
for (O = !1, a = new y(B(N)), l = y.precision, y.precision = s = N.length * A * 2; f = k(a, t, 0, 1, 1), r = n.plus(f.times(i)), r.cmp(e) != 1; )
|
|
440
|
+
n = i, i = r, r = c, c = u.plus(f.times(r)), u = r, r = t, t = a.minus(f.times(r)), a = r;
|
|
441
|
+
return r = k(e.minus(n), i, 0, 1, 1), u = u.plus(r.times(c)), n = n.plus(r.times(i)), u.s = c.s = E.s, h = k(c, i, s, 1).minus(E).abs().cmp(k(u, n, s, 1).minus(E).abs()) < 1 ? [c, i] : [u, n], y.precision = l, O = !0, h;
|
|
442
|
+
};
|
|
443
|
+
m.toHexadecimal = m.toHex = function(e, t) {
|
|
444
|
+
return Je(this, 16, e, t);
|
|
445
|
+
};
|
|
446
|
+
m.toNearest = function(e, t) {
|
|
447
|
+
var n = this, i = n.constructor;
|
|
448
|
+
if (n = new i(n), e == null) {
|
|
449
|
+
if (!n.d)
|
|
450
|
+
return n;
|
|
451
|
+
e = new i(1), t = i.rounding;
|
|
452
|
+
} else {
|
|
453
|
+
if (e = new i(e), t === void 0 ? t = i.rounding : $(t, 0, 8), !n.d)
|
|
454
|
+
return e.s ? n : e;
|
|
455
|
+
if (!e.d)
|
|
456
|
+
return e.s && (e.s = n.s), e;
|
|
457
|
+
}
|
|
458
|
+
return e.d[0] ? (O = !1, n = k(n, e, 0, t, 1).times(e), O = !0, T(n)) : (e.s = n.s, n = e), n;
|
|
459
|
+
};
|
|
460
|
+
m.toNumber = function() {
|
|
461
|
+
return +this;
|
|
462
|
+
};
|
|
463
|
+
m.toOctal = function(e, t) {
|
|
464
|
+
return Je(this, 8, e, t);
|
|
465
|
+
};
|
|
466
|
+
m.toPower = m.pow = function(e) {
|
|
467
|
+
var t, n, i, r, s, o, a = this, u = a.constructor, c = +(e = new u(e));
|
|
468
|
+
if (!a.d || !e.d || !a.d[0] || !e.d[0])
|
|
469
|
+
return new u(F(+a, c));
|
|
470
|
+
if (a = new u(a), a.eq(1))
|
|
471
|
+
return a;
|
|
472
|
+
if (i = u.precision, s = u.rounding, e.eq(1))
|
|
473
|
+
return T(a, i, s);
|
|
474
|
+
if (t = V(e.e / A), t >= e.d.length - 1 && (n = c < 0 ? -c : c) <= kt)
|
|
475
|
+
return r = dt(u, a, n, i), e.s < 0 ? new u(1).div(r) : T(r, i, s);
|
|
476
|
+
if (o = a.s, o < 0) {
|
|
477
|
+
if (t < e.d.length - 1)
|
|
478
|
+
return new u(NaN);
|
|
479
|
+
if (e.d[t] & 1 || (o = 1), a.e == 0 && a.d[0] == 1 && a.d.length == 1)
|
|
480
|
+
return a.s = o, a;
|
|
481
|
+
}
|
|
482
|
+
return n = F(+a, c), t = n == 0 || !isFinite(n) ? V(c * (Math.log("0." + B(a.d)) / Math.LN10 + a.e + 1)) : new u(n + "").e, t > u.maxE + 1 || t < u.minE - 1 ? new u(t > 0 ? o / 0 : 0) : (O = !1, u.rounding = a.s = 1, n = Math.min(12, (t + "").length), r = Ve(e.times(ee(a, i + n)), i), r.d && (r = T(r, i + 5, 1), ge(r.d, i, s) && (t = i + 10, r = T(Ve(e.times(ee(a, t + n)), t), t + 5, 1), +B(r.d).slice(i + 1, i + 15) + 1 == 1e14 && (r = T(r, i + 1, 0)))), r.s = o, O = !0, u.rounding = s, T(r, i, s));
|
|
483
|
+
};
|
|
484
|
+
m.toPrecision = function(e, t) {
|
|
485
|
+
var n, i = this, r = i.constructor;
|
|
486
|
+
return e === void 0 ? n = X(i, i.e <= r.toExpNeg || i.e >= r.toExpPos) : ($(e, 1, ne), t === void 0 ? t = r.rounding : $(t, 0, 8), i = T(new r(i), e, t), n = X(i, e <= i.e || i.e <= r.toExpNeg, e)), i.isNeg() && !i.isZero() ? "-" + n : n;
|
|
487
|
+
};
|
|
488
|
+
m.toSignificantDigits = m.toSD = function(e, t) {
|
|
489
|
+
var n = this, i = n.constructor;
|
|
490
|
+
return e === void 0 ? (e = i.precision, t = i.rounding) : ($(e, 1, ne), t === void 0 ? t = i.rounding : $(t, 0, 8)), T(new i(n), e, t);
|
|
491
|
+
};
|
|
492
|
+
m.toString = function() {
|
|
493
|
+
var e = this, t = e.constructor, n = X(e, e.e <= t.toExpNeg || e.e >= t.toExpPos);
|
|
494
|
+
return e.isNeg() && !e.isZero() ? "-" + n : n;
|
|
495
|
+
};
|
|
496
|
+
m.truncated = m.trunc = function() {
|
|
497
|
+
return T(new this.constructor(this), this.e + 1, 1);
|
|
498
|
+
};
|
|
499
|
+
m.valueOf = m.toJSON = function() {
|
|
500
|
+
var e = this, t = e.constructor, n = X(e, e.e <= t.toExpNeg || e.e >= t.toExpPos);
|
|
501
|
+
return e.isNeg() ? "-" + n : n;
|
|
502
|
+
};
|
|
503
|
+
function B(e) {
|
|
504
|
+
var t, n, i, r = e.length - 1, s = "", o = e[0];
|
|
505
|
+
if (r > 0) {
|
|
506
|
+
for (s += o, t = 1; t < r; t++)
|
|
507
|
+
i = e[t] + "", n = A - i.length, n && (s += K(n)), s += i;
|
|
508
|
+
o = e[t], i = o + "", n = A - i.length, n && (s += K(n));
|
|
509
|
+
} else if (o === 0)
|
|
510
|
+
return "0";
|
|
511
|
+
for (; o % 10 === 0; )
|
|
512
|
+
o /= 10;
|
|
513
|
+
return s + o;
|
|
514
|
+
}
|
|
515
|
+
function $(e, t, n) {
|
|
516
|
+
if (e !== ~~e || e < t || e > n)
|
|
517
|
+
throw Error(te + e);
|
|
518
|
+
}
|
|
519
|
+
function ge(e, t, n, i) {
|
|
520
|
+
var r, s, o, a;
|
|
521
|
+
for (s = e[0]; s >= 10; s /= 10)
|
|
522
|
+
--t;
|
|
523
|
+
return --t < 0 ? (t += A, r = 0) : (r = Math.ceil((t + 1) / A), t %= A), s = F(10, A - t), a = e[r] % s | 0, i == null ? t < 3 ? (t == 0 ? a = a / 100 | 0 : t == 1 && (a = a / 10 | 0), o = n < 4 && a == 99999 || n > 3 && a == 49999 || a == 5e4 || a == 0) : o = (n < 4 && a + 1 == s || n > 3 && a + 1 == s / 2) && (e[r + 1] / s / 100 | 0) == F(10, t - 2) - 1 || (a == s / 2 || a == 0) && (e[r + 1] / s / 100 | 0) == 0 : t < 4 ? (t == 0 ? a = a / 1e3 | 0 : t == 1 ? a = a / 100 | 0 : t == 2 && (a = a / 10 | 0), o = (i || n < 4) && a == 9999 || !i && n > 3 && a == 4999) : o = ((i || n < 4) && a + 1 == s || !i && n > 3 && a + 1 == s / 2) && (e[r + 1] / s / 1e3 | 0) == F(10, t - 3) - 1, o;
|
|
524
|
+
}
|
|
525
|
+
function ve(e, t, n) {
|
|
526
|
+
for (var i, r = [0], s, o = 0, a = e.length; o < a; ) {
|
|
527
|
+
for (s = r.length; s--; )
|
|
528
|
+
r[s] *= t;
|
|
529
|
+
for (r[0] += Be.indexOf(e.charAt(o++)), i = 0; i < r.length; i++)
|
|
530
|
+
r[i] > n - 1 && (r[i + 1] === void 0 && (r[i + 1] = 0), r[i + 1] += r[i] / n | 0, r[i] %= n);
|
|
531
|
+
}
|
|
532
|
+
return r.reverse();
|
|
533
|
+
}
|
|
534
|
+
function Lt(e, t) {
|
|
535
|
+
var n, i, r;
|
|
536
|
+
if (t.isZero())
|
|
537
|
+
return t;
|
|
538
|
+
i = t.d.length, i < 32 ? (n = Math.ceil(i / 3), r = (1 / Se(4, n)).toString()) : (n = 16, r = "2.3283064365386962890625e-10"), e.precision += n, t = ue(e, 1, t.times(r), new e(1));
|
|
539
|
+
for (var s = n; s--; ) {
|
|
540
|
+
var o = t.times(t);
|
|
541
|
+
t = o.times(o).minus(o).times(8).plus(1);
|
|
542
|
+
}
|
|
543
|
+
return e.precision -= n, t;
|
|
544
|
+
}
|
|
545
|
+
var k = /* @__PURE__ */ function() {
|
|
546
|
+
function e(i, r, s) {
|
|
547
|
+
var o, a = 0, u = i.length;
|
|
548
|
+
for (i = i.slice(); u--; )
|
|
549
|
+
o = i[u] * r + a, i[u] = o % s | 0, a = o / s | 0;
|
|
550
|
+
return a && i.unshift(a), i;
|
|
551
|
+
}
|
|
552
|
+
function t(i, r, s, o) {
|
|
553
|
+
var a, u;
|
|
554
|
+
if (s != o)
|
|
555
|
+
u = s > o ? 1 : -1;
|
|
556
|
+
else
|
|
557
|
+
for (a = u = 0; a < s; a++)
|
|
558
|
+
if (i[a] != r[a]) {
|
|
559
|
+
u = i[a] > r[a] ? 1 : -1;
|
|
560
|
+
break;
|
|
561
|
+
}
|
|
562
|
+
return u;
|
|
563
|
+
}
|
|
564
|
+
function n(i, r, s, o) {
|
|
565
|
+
for (var a = 0; s--; )
|
|
566
|
+
i[s] -= a, a = i[s] < r[s] ? 1 : 0, i[s] = a * o + i[s] - r[s];
|
|
567
|
+
for (; !i[0] && i.length > 1; )
|
|
568
|
+
i.shift();
|
|
569
|
+
}
|
|
570
|
+
return function(i, r, s, o, a, u) {
|
|
571
|
+
var c, l, f, h, E, N, y, x, b, U, _, S, G, j, Q, H, ie, he, R, se, W = i.constructor, d = i.s == r.s ? 1 : -1, g = i.d, v = r.d;
|
|
572
|
+
if (!g || !g[0] || !v || !v[0])
|
|
573
|
+
return new W(
|
|
574
|
+
// Return NaN if either NaN, or both Infinity or 0.
|
|
575
|
+
!i.s || !r.s || (g ? v && g[0] == v[0] : !v) ? NaN : (
|
|
576
|
+
// Return ±0 if x is 0 or y is ±Infinity, or return ±Infinity as y is 0.
|
|
577
|
+
g && g[0] == 0 || !v ? d * 0 : d / 0
|
|
578
|
+
)
|
|
579
|
+
);
|
|
580
|
+
for (u ? (E = 1, l = i.e - r.e) : (u = z, E = A, l = V(i.e / E) - V(r.e / E)), R = v.length, ie = g.length, b = new W(d), U = b.d = [], f = 0; v[f] == (g[f] || 0); f++)
|
|
581
|
+
;
|
|
582
|
+
if (v[f] > (g[f] || 0) && l--, s == null ? (j = s = W.precision, o = W.rounding) : a ? j = s + (i.e - r.e) + 1 : j = s, j < 0)
|
|
583
|
+
U.push(1), N = !0;
|
|
584
|
+
else {
|
|
585
|
+
if (j = j / E + 2 | 0, f = 0, R == 1) {
|
|
586
|
+
for (h = 0, v = v[0], j++; (f < ie || h) && j--; f++)
|
|
587
|
+
Q = h * u + (g[f] || 0), U[f] = Q / v | 0, h = Q % v | 0;
|
|
588
|
+
N = h || f < ie;
|
|
589
|
+
} else {
|
|
590
|
+
for (h = u / (v[0] + 1) | 0, h > 1 && (v = e(v, h, u), g = e(g, h, u), R = v.length, ie = g.length), H = R, _ = g.slice(0, R), S = _.length; S < R; )
|
|
591
|
+
_[S++] = 0;
|
|
592
|
+
se = v.slice(), se.unshift(0), he = v[0], v[1] >= u / 2 && ++he;
|
|
593
|
+
do
|
|
594
|
+
h = 0, c = t(v, _, R, S), c < 0 ? (G = _[0], R != S && (G = G * u + (_[1] || 0)), h = G / he | 0, h > 1 ? (h >= u && (h = u - 1), y = e(v, h, u), x = y.length, S = _.length, c = t(y, _, x, S), c == 1 && (h--, n(y, R < x ? se : v, x, u))) : (h == 0 && (c = h = 1), y = v.slice()), x = y.length, x < S && y.unshift(0), n(_, y, S, u), c == -1 && (S = _.length, c = t(v, _, R, S), c < 1 && (h++, n(_, R < S ? se : v, S, u))), S = _.length) : c === 0 && (h++, _ = [0]), U[f++] = h, c && _[0] ? _[S++] = g[H] || 0 : (_ = [g[H]], S = 1);
|
|
595
|
+
while ((H++ < ie || _[0] !== void 0) && j--);
|
|
596
|
+
N = _[0] !== void 0;
|
|
597
|
+
}
|
|
598
|
+
U[0] || U.shift();
|
|
599
|
+
}
|
|
600
|
+
if (E == 1)
|
|
601
|
+
b.e = l, at = N;
|
|
602
|
+
else {
|
|
603
|
+
for (f = 1, h = U[0]; h >= 10; h /= 10)
|
|
604
|
+
f++;
|
|
605
|
+
b.e = f + l * E - 1, T(b, a ? s + b.e + 1 : s, o, N);
|
|
606
|
+
}
|
|
607
|
+
return b;
|
|
608
|
+
};
|
|
609
|
+
}();
|
|
610
|
+
function T(e, t, n, i) {
|
|
611
|
+
var r, s, o, a, u, c, l, f, h, E = e.constructor;
|
|
612
|
+
e:
|
|
613
|
+
if (t != null) {
|
|
614
|
+
if (f = e.d, !f)
|
|
615
|
+
return e;
|
|
616
|
+
for (r = 1, a = f[0]; a >= 10; a /= 10)
|
|
617
|
+
r++;
|
|
618
|
+
if (s = t - r, s < 0)
|
|
619
|
+
s += A, o = t, l = f[h = 0], u = l / F(10, r - o - 1) % 10 | 0;
|
|
620
|
+
else if (h = Math.ceil((s + 1) / A), a = f.length, h >= a)
|
|
621
|
+
if (i) {
|
|
622
|
+
for (; a++ <= h; )
|
|
623
|
+
f.push(0);
|
|
624
|
+
l = u = 0, r = 1, s %= A, o = s - A + 1;
|
|
625
|
+
} else
|
|
626
|
+
break e;
|
|
627
|
+
else {
|
|
628
|
+
for (l = a = f[h], r = 1; a >= 10; a /= 10)
|
|
629
|
+
r++;
|
|
630
|
+
s %= A, o = s - A + r, u = o < 0 ? 0 : l / F(10, r - o - 1) % 10 | 0;
|
|
631
|
+
}
|
|
632
|
+
if (i = i || t < 0 || f[h + 1] !== void 0 || (o < 0 ? l : l % F(10, r - o - 1)), c = n < 4 ? (u || i) && (n == 0 || n == (e.s < 0 ? 3 : 2)) : u > 5 || u == 5 && (n == 4 || i || n == 6 && // Check whether the digit to the left of the rounding digit is odd.
|
|
633
|
+
(s > 0 ? o > 0 ? l / F(10, r - o) : 0 : f[h - 1]) % 10 & 1 || n == (e.s < 0 ? 8 : 7)), t < 1 || !f[0])
|
|
634
|
+
return f.length = 0, c ? (t -= e.e + 1, f[0] = F(10, (A - t % A) % A), e.e = -t || 0) : f[0] = e.e = 0, e;
|
|
635
|
+
if (s == 0 ? (f.length = h, a = 1, h--) : (f.length = h + 1, a = F(10, A - s), f[h] = o > 0 ? (l / F(10, r - o) % F(10, o) | 0) * a : 0), c)
|
|
636
|
+
for (; ; )
|
|
637
|
+
if (h == 0) {
|
|
638
|
+
for (s = 1, o = f[0]; o >= 10; o /= 10)
|
|
639
|
+
s++;
|
|
640
|
+
for (o = f[0] += a, a = 1; o >= 10; o /= 10)
|
|
641
|
+
a++;
|
|
642
|
+
s != a && (e.e++, f[0] == z && (f[0] = 1));
|
|
643
|
+
break;
|
|
644
|
+
} else {
|
|
645
|
+
if (f[h] += a, f[h] != z)
|
|
646
|
+
break;
|
|
647
|
+
f[h--] = 0, a = 1;
|
|
648
|
+
}
|
|
649
|
+
for (s = f.length; f[--s] === 0; )
|
|
650
|
+
f.pop();
|
|
651
|
+
}
|
|
652
|
+
return O && (e.e > E.maxE ? (e.d = null, e.e = NaN) : e.e < E.minE && (e.e = 0, e.d = [0])), e;
|
|
653
|
+
}
|
|
654
|
+
function X(e, t, n) {
|
|
655
|
+
if (!e.isFinite())
|
|
656
|
+
return mt(e);
|
|
657
|
+
var i, r = e.e, s = B(e.d), o = s.length;
|
|
658
|
+
return t ? (n && (i = n - o) > 0 ? s = s.charAt(0) + "." + s.slice(1) + K(i) : o > 1 && (s = s.charAt(0) + "." + s.slice(1)), s = s + (e.e < 0 ? "e" : "e+") + e.e) : r < 0 ? (s = "0." + K(-r - 1) + s, n && (i = n - o) > 0 && (s += K(i))) : r >= o ? (s += K(r + 1 - o), n && (i = n - r - 1) > 0 && (s = s + "." + K(i))) : ((i = r + 1) < o && (s = s.slice(0, i) + "." + s.slice(i)), n && (i = n - o) > 0 && (r + 1 === o && (s += "."), s += K(i))), s;
|
|
659
|
+
}
|
|
660
|
+
function xe(e, t) {
|
|
661
|
+
var n = e[0];
|
|
662
|
+
for (t *= A; n >= 10; n /= 10)
|
|
663
|
+
t++;
|
|
664
|
+
return t;
|
|
665
|
+
}
|
|
666
|
+
function _e(e, t, n) {
|
|
667
|
+
if (t > Rt)
|
|
668
|
+
throw O = !0, n && (e.precision = n), Error(ct);
|
|
669
|
+
return T(new e(Ie), t, 1, !0);
|
|
670
|
+
}
|
|
671
|
+
function J(e, t, n) {
|
|
672
|
+
if (t > qe)
|
|
673
|
+
throw Error(ct);
|
|
674
|
+
return T(new e(Oe), t, n, !0);
|
|
675
|
+
}
|
|
676
|
+
function ht(e) {
|
|
677
|
+
var t = e.length - 1, n = t * A + 1;
|
|
678
|
+
if (t = e[t], t) {
|
|
679
|
+
for (; t % 10 == 0; t /= 10)
|
|
680
|
+
n--;
|
|
681
|
+
for (t = e[0]; t >= 10; t /= 10)
|
|
682
|
+
n++;
|
|
683
|
+
}
|
|
684
|
+
return n;
|
|
685
|
+
}
|
|
686
|
+
function K(e) {
|
|
687
|
+
for (var t = ""; e--; )
|
|
688
|
+
t += "0";
|
|
689
|
+
return t;
|
|
690
|
+
}
|
|
691
|
+
function dt(e, t, n, i) {
|
|
692
|
+
var r, s = new e(1), o = Math.ceil(i / A + 4);
|
|
693
|
+
for (O = !1; ; ) {
|
|
694
|
+
if (n % 2 && (s = s.times(t), We(s.d, o) && (r = !0)), n = V(n / 2), n === 0) {
|
|
695
|
+
n = s.d.length - 1, r && s.d[n] === 0 && ++s.d[n];
|
|
696
|
+
break;
|
|
697
|
+
}
|
|
698
|
+
t = t.times(t), We(t.d, o);
|
|
699
|
+
}
|
|
700
|
+
return O = !0, s;
|
|
701
|
+
}
|
|
702
|
+
function Qe(e) {
|
|
703
|
+
return e.d[e.d.length - 1] & 1;
|
|
704
|
+
}
|
|
705
|
+
function pt(e, t, n) {
|
|
706
|
+
for (var i, r = new e(t[0]), s = 0; ++s < t.length; )
|
|
707
|
+
if (i = new e(t[s]), i.s)
|
|
708
|
+
r[n](i) && (r = i);
|
|
709
|
+
else {
|
|
710
|
+
r = i;
|
|
711
|
+
break;
|
|
712
|
+
}
|
|
713
|
+
return r;
|
|
714
|
+
}
|
|
715
|
+
function Ve(e, t) {
|
|
716
|
+
var n, i, r, s, o, a, u, c = 0, l = 0, f = 0, h = e.constructor, E = h.rounding, N = h.precision;
|
|
717
|
+
if (!e.d || !e.d[0] || e.e > 17)
|
|
718
|
+
return new h(e.d ? e.d[0] ? e.s < 0 ? 0 : 1 / 0 : 1 : e.s ? e.s < 0 ? 0 : e : NaN);
|
|
719
|
+
for (t == null ? (O = !1, u = N) : u = t, a = new h(0.03125); e.e > -2; )
|
|
720
|
+
e = e.times(a), f += 5;
|
|
721
|
+
for (i = Math.log(F(2, f)) / Math.LN10 * 2 + 5 | 0, u += i, n = s = o = new h(1), h.precision = u; ; ) {
|
|
722
|
+
if (s = T(s.times(e), u, 1), n = n.times(++l), a = o.plus(k(s, n, u, 1)), B(a.d).slice(0, u) === B(o.d).slice(0, u)) {
|
|
723
|
+
for (r = f; r--; )
|
|
724
|
+
o = T(o.times(o), u, 1);
|
|
725
|
+
if (t == null)
|
|
726
|
+
if (c < 3 && ge(o.d, u - i, E, c))
|
|
727
|
+
h.precision = u += 10, n = s = a = new h(1), l = 0, c++;
|
|
728
|
+
else
|
|
729
|
+
return T(o, h.precision = N, E, O = !0);
|
|
730
|
+
else
|
|
731
|
+
return h.precision = N, o;
|
|
732
|
+
}
|
|
733
|
+
o = a;
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
function ee(e, t) {
|
|
737
|
+
var n, i, r, s, o, a, u, c, l, f, h, E = 1, N = 10, y = e, x = y.d, b = y.constructor, U = b.rounding, _ = b.precision;
|
|
738
|
+
if (y.s < 0 || !x || !x[0] || !y.e && x[0] == 1 && x.length == 1)
|
|
739
|
+
return new b(x && !x[0] ? -1 / 0 : y.s != 1 ? NaN : x ? 0 : y);
|
|
740
|
+
if (t == null ? (O = !1, l = _) : l = t, b.precision = l += N, n = B(x), i = n.charAt(0), Math.abs(s = y.e) < 15e14) {
|
|
741
|
+
for (; i < 7 && i != 1 || i == 1 && n.charAt(1) > 3; )
|
|
742
|
+
y = y.times(e), n = B(y.d), i = n.charAt(0), E++;
|
|
743
|
+
s = y.e, i > 1 ? (y = new b("0." + n), s++) : y = new b(i + "." + n.slice(1));
|
|
744
|
+
} else
|
|
745
|
+
return c = _e(b, l + 2, _).times(s + ""), y = ee(new b(i + "." + n.slice(1)), l - N).plus(c), b.precision = _, t == null ? T(y, _, U, O = !0) : y;
|
|
746
|
+
for (f = y, u = o = y = k(y.minus(1), y.plus(1), l, 1), h = T(y.times(y), l, 1), r = 3; ; ) {
|
|
747
|
+
if (o = T(o.times(h), l, 1), c = u.plus(k(o, new b(r), l, 1)), B(c.d).slice(0, l) === B(u.d).slice(0, l))
|
|
748
|
+
if (u = u.times(2), s !== 0 && (u = u.plus(_e(b, l + 2, _).times(s + ""))), u = k(u, new b(E), l, 1), t == null)
|
|
749
|
+
if (ge(u.d, l - N, U, a))
|
|
750
|
+
b.precision = l += N, c = o = y = k(f.minus(1), f.plus(1), l, 1), h = T(y.times(y), l, 1), r = a = 1;
|
|
751
|
+
else
|
|
752
|
+
return T(u, b.precision = _, U, O = !0);
|
|
753
|
+
else
|
|
754
|
+
return b.precision = _, u;
|
|
755
|
+
u = c, r += 2;
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
function mt(e) {
|
|
759
|
+
return String(e.s * e.s / 0);
|
|
760
|
+
}
|
|
761
|
+
function je(e, t) {
|
|
762
|
+
var n, i, r;
|
|
763
|
+
for ((n = t.indexOf(".")) > -1 && (t = t.replace(".", "")), (i = t.search(/e/i)) > 0 ? (n < 0 && (n = i), n += +t.slice(i + 1), t = t.substring(0, i)) : n < 0 && (n = t.length), i = 0; t.charCodeAt(i) === 48; i++)
|
|
764
|
+
;
|
|
765
|
+
for (r = t.length; t.charCodeAt(r - 1) === 48; --r)
|
|
766
|
+
;
|
|
767
|
+
if (t = t.slice(i, r), t) {
|
|
768
|
+
if (r -= i, e.e = n = n - i - 1, e.d = [], i = (n + 1) % A, n < 0 && (i += A), i < r) {
|
|
769
|
+
for (i && e.d.push(+t.slice(0, i)), r -= A; i < r; )
|
|
770
|
+
e.d.push(+t.slice(i, i += A));
|
|
771
|
+
t = t.slice(i), i = A - t.length;
|
|
772
|
+
} else
|
|
773
|
+
i -= r;
|
|
774
|
+
for (; i--; )
|
|
775
|
+
t += "0";
|
|
776
|
+
e.d.push(+t), O && (e.e > e.constructor.maxE ? (e.d = null, e.e = NaN) : e.e < e.constructor.minE && (e.e = 0, e.d = [0]));
|
|
777
|
+
} else
|
|
778
|
+
e.e = 0, e.d = [0];
|
|
779
|
+
return e;
|
|
780
|
+
}
|
|
781
|
+
function Ft(e, t) {
|
|
782
|
+
var n, i, r, s, o, a, u, c, l;
|
|
783
|
+
if (t.indexOf("_") > -1) {
|
|
784
|
+
if (t = t.replace(/(\d)_(?=\d)/g, "$1"), ft.test(t))
|
|
785
|
+
return je(e, t);
|
|
786
|
+
} else if (t === "Infinity" || t === "NaN")
|
|
787
|
+
return +t || (e.s = NaN), e.e = NaN, e.d = null, e;
|
|
788
|
+
if (St.test(t))
|
|
789
|
+
n = 16, t = t.toLowerCase();
|
|
790
|
+
else if (xt.test(t))
|
|
791
|
+
n = 2;
|
|
792
|
+
else if (Ct.test(t))
|
|
793
|
+
n = 8;
|
|
794
|
+
else
|
|
795
|
+
throw Error(te + t);
|
|
796
|
+
for (s = t.search(/p/i), s > 0 ? (u = +t.slice(s + 1), t = t.substring(2, s)) : t = t.slice(2), s = t.indexOf("."), o = s >= 0, i = e.constructor, o && (t = t.replace(".", ""), a = t.length, s = a - s, r = dt(i, new i(n), s, s * 2)), c = ve(t, n, z), l = c.length - 1, s = l; c[s] === 0; --s)
|
|
797
|
+
c.pop();
|
|
798
|
+
return s < 0 ? new i(e.s * 0) : (e.e = xe(c, l), e.d = c, O = !1, o && (e = k(e, r, a * 4)), u && (e = e.times(Math.abs(u) < 54 ? F(2, u) : le.pow(2, u))), O = !0, e);
|
|
799
|
+
}
|
|
800
|
+
function Pt(e, t) {
|
|
801
|
+
var n, i = t.d.length;
|
|
802
|
+
if (i < 3)
|
|
803
|
+
return t.isZero() ? t : ue(e, 2, t, t);
|
|
804
|
+
n = 1.4 * Math.sqrt(i), n = n > 16 ? 16 : n | 0, t = t.times(1 / Se(5, n)), t = ue(e, 2, t, t);
|
|
805
|
+
for (var r, s = new e(5), o = new e(16), a = new e(20); n--; )
|
|
806
|
+
r = t.times(t), t = t.times(s.plus(r.times(o.times(r).minus(a))));
|
|
807
|
+
return t;
|
|
808
|
+
}
|
|
809
|
+
function ue(e, t, n, i, r) {
|
|
810
|
+
var s, o, a, u, c = e.precision, l = Math.ceil(c / A);
|
|
811
|
+
for (O = !1, u = n.times(n), a = new e(i); ; ) {
|
|
812
|
+
if (o = k(a.times(u), new e(t++ * t++), c, 1), a = r ? i.plus(o) : i.minus(o), i = k(o.times(u), new e(t++ * t++), c, 1), o = a.plus(i), o.d[l] !== void 0) {
|
|
813
|
+
for (s = l; o.d[s] === a.d[s] && s--; )
|
|
814
|
+
;
|
|
815
|
+
if (s == -1)
|
|
816
|
+
break;
|
|
817
|
+
}
|
|
818
|
+
s = a, a = i, i = o, o = s;
|
|
819
|
+
}
|
|
820
|
+
return O = !0, o.d.length = l + 1, o;
|
|
821
|
+
}
|
|
822
|
+
function Se(e, t) {
|
|
823
|
+
for (var n = e; --t; )
|
|
824
|
+
n *= e;
|
|
825
|
+
return n;
|
|
826
|
+
}
|
|
827
|
+
function gt(e, t) {
|
|
828
|
+
var n, i = t.s < 0, r = J(e, e.precision, 1), s = r.times(0.5);
|
|
829
|
+
if (t = t.abs(), t.lte(s))
|
|
830
|
+
return Z = i ? 4 : 1, t;
|
|
831
|
+
if (n = t.divToInt(r), n.isZero())
|
|
832
|
+
Z = i ? 3 : 2;
|
|
833
|
+
else {
|
|
834
|
+
if (t = t.minus(n.times(r)), t.lte(s))
|
|
835
|
+
return Z = Qe(n) ? i ? 2 : 3 : i ? 4 : 1, t;
|
|
836
|
+
Z = Qe(n) ? i ? 1 : 4 : i ? 3 : 2;
|
|
837
|
+
}
|
|
838
|
+
return t.minus(r).abs();
|
|
839
|
+
}
|
|
840
|
+
function Je(e, t, n, i) {
|
|
841
|
+
var r, s, o, a, u, c, l, f, h, E = e.constructor, N = n !== void 0;
|
|
842
|
+
if (N ? ($(n, 1, ne), i === void 0 ? i = E.rounding : $(i, 0, 8)) : (n = E.precision, i = E.rounding), !e.isFinite())
|
|
843
|
+
l = mt(e);
|
|
844
|
+
else {
|
|
845
|
+
for (l = X(e), o = l.indexOf("."), N ? (r = 2, t == 16 ? n = n * 4 - 3 : t == 8 && (n = n * 3 - 2)) : r = t, o >= 0 && (l = l.replace(".", ""), h = new E(1), h.e = l.length - o, h.d = ve(X(h), 10, r), h.e = h.d.length), f = ve(l, 10, r), s = u = f.length; f[--u] == 0; )
|
|
846
|
+
f.pop();
|
|
847
|
+
if (!f[0])
|
|
848
|
+
l = N ? "0p+0" : "0";
|
|
849
|
+
else {
|
|
850
|
+
if (o < 0 ? s-- : (e = new E(e), e.d = f, e.e = s, e = k(e, h, n, i, 0, r), f = e.d, s = e.e, c = at), o = f[n], a = r / 2, c = c || f[n + 1] !== void 0, c = i < 4 ? (o !== void 0 || c) && (i === 0 || i === (e.s < 0 ? 3 : 2)) : o > a || o === a && (i === 4 || c || i === 6 && f[n - 1] & 1 || i === (e.s < 0 ? 8 : 7)), f.length = n, c)
|
|
851
|
+
for (; ++f[--n] > r - 1; )
|
|
852
|
+
f[n] = 0, n || (++s, f.unshift(1));
|
|
853
|
+
for (u = f.length; !f[u - 1]; --u)
|
|
854
|
+
;
|
|
855
|
+
for (o = 0, l = ""; o < u; o++)
|
|
856
|
+
l += Be.charAt(f[o]);
|
|
857
|
+
if (N) {
|
|
858
|
+
if (u > 1)
|
|
859
|
+
if (t == 16 || t == 8) {
|
|
860
|
+
for (o = t == 16 ? 4 : 3, --u; u % o; u++)
|
|
861
|
+
l += "0";
|
|
862
|
+
for (f = ve(l, r, t), u = f.length; !f[u - 1]; --u)
|
|
863
|
+
;
|
|
864
|
+
for (o = 1, l = "1."; o < u; o++)
|
|
865
|
+
l += Be.charAt(f[o]);
|
|
866
|
+
} else
|
|
867
|
+
l = l.charAt(0) + "." + l.slice(1);
|
|
868
|
+
l = l + (s < 0 ? "p" : "p+") + s;
|
|
869
|
+
} else if (s < 0) {
|
|
870
|
+
for (; ++s; )
|
|
871
|
+
l = "0" + l;
|
|
872
|
+
l = "0." + l;
|
|
873
|
+
} else if (++s > u)
|
|
874
|
+
for (s -= u; s--; )
|
|
875
|
+
l += "0";
|
|
876
|
+
else
|
|
877
|
+
s < u && (l = l.slice(0, s) + "." + l.slice(s));
|
|
878
|
+
}
|
|
879
|
+
l = (t == 16 ? "0x" : t == 2 ? "0b" : t == 8 ? "0o" : "") + l;
|
|
880
|
+
}
|
|
881
|
+
return e.s < 0 ? "-" + l : l;
|
|
882
|
+
}
|
|
883
|
+
function We(e, t) {
|
|
884
|
+
if (e.length > t)
|
|
885
|
+
return e.length = t, !0;
|
|
886
|
+
}
|
|
887
|
+
function Mt(e) {
|
|
888
|
+
return new this(e).abs();
|
|
889
|
+
}
|
|
890
|
+
function Bt(e) {
|
|
891
|
+
return new this(e).acos();
|
|
892
|
+
}
|
|
893
|
+
function Ut(e) {
|
|
894
|
+
return new this(e).acosh();
|
|
895
|
+
}
|
|
896
|
+
function qt(e, t) {
|
|
897
|
+
return new this(e).plus(t);
|
|
898
|
+
}
|
|
899
|
+
function Vt(e) {
|
|
900
|
+
return new this(e).asin();
|
|
901
|
+
}
|
|
902
|
+
function jt(e) {
|
|
903
|
+
return new this(e).asinh();
|
|
904
|
+
}
|
|
905
|
+
function $t(e) {
|
|
906
|
+
return new this(e).atan();
|
|
907
|
+
}
|
|
908
|
+
function Ht(e) {
|
|
909
|
+
return new this(e).atanh();
|
|
910
|
+
}
|
|
911
|
+
function Gt(e, t) {
|
|
912
|
+
e = new this(e), t = new this(t);
|
|
913
|
+
var n, i = this.precision, r = this.rounding, s = i + 4;
|
|
914
|
+
return !e.s || !t.s ? n = new this(NaN) : !e.d && !t.d ? (n = J(this, s, 1).times(t.s > 0 ? 0.25 : 0.75), n.s = e.s) : !t.d || e.isZero() ? (n = t.s < 0 ? J(this, i, r) : new this(0), n.s = e.s) : !e.d || t.isZero() ? (n = J(this, s, 1).times(0.5), n.s = e.s) : t.s < 0 ? (this.precision = s, this.rounding = 1, n = this.atan(k(e, t, s, 1)), t = J(this, s, 1), this.precision = i, this.rounding = r, n = e.s < 0 ? n.minus(t) : n.plus(t)) : n = this.atan(k(e, t, s, 1)), n;
|
|
915
|
+
}
|
|
916
|
+
function Yt(e) {
|
|
917
|
+
return new this(e).cbrt();
|
|
918
|
+
}
|
|
919
|
+
function Jt(e) {
|
|
920
|
+
return T(e = new this(e), e.e + 1, 2);
|
|
921
|
+
}
|
|
922
|
+
function zt(e, t, n) {
|
|
923
|
+
return new this(e).clamp(t, n);
|
|
924
|
+
}
|
|
925
|
+
function Xt(e) {
|
|
926
|
+
if (!e || typeof e != "object")
|
|
927
|
+
throw Error(De + "Object expected");
|
|
928
|
+
var t, n, i, r = e.defaults === !0, s = [
|
|
929
|
+
"precision",
|
|
930
|
+
1,
|
|
931
|
+
ne,
|
|
932
|
+
"rounding",
|
|
933
|
+
0,
|
|
934
|
+
8,
|
|
935
|
+
"toExpNeg",
|
|
936
|
+
-ae,
|
|
937
|
+
0,
|
|
938
|
+
"toExpPos",
|
|
939
|
+
0,
|
|
940
|
+
ae,
|
|
941
|
+
"maxE",
|
|
942
|
+
0,
|
|
943
|
+
ae,
|
|
944
|
+
"minE",
|
|
945
|
+
-ae,
|
|
946
|
+
0,
|
|
947
|
+
"modulo",
|
|
948
|
+
0,
|
|
949
|
+
9
|
|
950
|
+
];
|
|
951
|
+
for (t = 0; t < s.length; t += 3)
|
|
952
|
+
if (n = s[t], r && (this[n] = Ue[n]), (i = e[n]) !== void 0)
|
|
953
|
+
if (V(i) === i && i >= s[t + 1] && i <= s[t + 2])
|
|
954
|
+
this[n] = i;
|
|
955
|
+
else
|
|
956
|
+
throw Error(te + n + ": " + i);
|
|
957
|
+
if (n = "crypto", r && (this[n] = Ue[n]), (i = e[n]) !== void 0)
|
|
958
|
+
if (i === !0 || i === !1 || i === 0 || i === 1)
|
|
959
|
+
if (i)
|
|
960
|
+
if (typeof crypto < "u" && crypto && (crypto.getRandomValues || crypto.randomBytes))
|
|
961
|
+
this[n] = !0;
|
|
962
|
+
else
|
|
963
|
+
throw Error(ut);
|
|
964
|
+
else
|
|
965
|
+
this[n] = !1;
|
|
966
|
+
else
|
|
967
|
+
throw Error(te + n + ": " + i);
|
|
968
|
+
return this;
|
|
969
|
+
}
|
|
970
|
+
function Zt(e) {
|
|
971
|
+
return new this(e).cos();
|
|
972
|
+
}
|
|
973
|
+
function Qt(e) {
|
|
974
|
+
return new this(e).cosh();
|
|
975
|
+
}
|
|
976
|
+
function Et(e) {
|
|
977
|
+
var t, n, i;
|
|
978
|
+
function r(s) {
|
|
979
|
+
var o, a, u, c = this;
|
|
980
|
+
if (!(c instanceof r))
|
|
981
|
+
return new r(s);
|
|
982
|
+
if (c.constructor = r, Ke(s)) {
|
|
983
|
+
c.s = s.s, O ? !s.d || s.e > r.maxE ? (c.e = NaN, c.d = null) : s.e < r.minE ? (c.e = 0, c.d = [0]) : (c.e = s.e, c.d = s.d.slice()) : (c.e = s.e, c.d = s.d ? s.d.slice() : s.d);
|
|
984
|
+
return;
|
|
985
|
+
}
|
|
986
|
+
if (u = typeof s, u === "number") {
|
|
987
|
+
if (s === 0) {
|
|
988
|
+
c.s = 1 / s < 0 ? -1 : 1, c.e = 0, c.d = [0];
|
|
989
|
+
return;
|
|
990
|
+
}
|
|
991
|
+
if (s < 0 ? (s = -s, c.s = -1) : c.s = 1, s === ~~s && s < 1e7) {
|
|
992
|
+
for (o = 0, a = s; a >= 10; a /= 10)
|
|
993
|
+
o++;
|
|
994
|
+
O ? o > r.maxE ? (c.e = NaN, c.d = null) : o < r.minE ? (c.e = 0, c.d = [0]) : (c.e = o, c.d = [s]) : (c.e = o, c.d = [s]);
|
|
995
|
+
return;
|
|
996
|
+
} else if (s * 0 !== 0) {
|
|
997
|
+
s || (c.s = NaN), c.e = NaN, c.d = null;
|
|
998
|
+
return;
|
|
999
|
+
}
|
|
1000
|
+
return je(c, s.toString());
|
|
1001
|
+
} else if (u !== "string")
|
|
1002
|
+
throw Error(te + s);
|
|
1003
|
+
return (a = s.charCodeAt(0)) === 45 ? (s = s.slice(1), c.s = -1) : (a === 43 && (s = s.slice(1)), c.s = 1), ft.test(s) ? je(c, s) : Ft(c, s);
|
|
1004
|
+
}
|
|
1005
|
+
if (r.prototype = m, r.ROUND_UP = 0, r.ROUND_DOWN = 1, r.ROUND_CEIL = 2, r.ROUND_FLOOR = 3, r.ROUND_HALF_UP = 4, r.ROUND_HALF_DOWN = 5, r.ROUND_HALF_EVEN = 6, r.ROUND_HALF_CEIL = 7, r.ROUND_HALF_FLOOR = 8, r.EUCLID = 9, r.config = r.set = Xt, r.clone = Et, r.isDecimal = Ke, r.abs = Mt, r.acos = Bt, r.acosh = Ut, r.add = qt, r.asin = Vt, r.asinh = jt, r.atan = $t, r.atanh = Ht, r.atan2 = Gt, r.cbrt = Yt, r.ceil = Jt, r.clamp = zt, r.cos = Zt, r.cosh = Qt, r.div = Wt, r.exp = Kt, r.floor = en, r.hypot = tn, r.ln = nn, r.log = rn, r.log10 = on, r.log2 = sn, r.max = an, r.min = cn, r.mod = un, r.mul = ln, r.pow = fn, r.random = hn, r.round = dn, r.sign = pn, r.sin = mn, r.sinh = gn, r.sqrt = En, r.sub = Nn, r.sum = yn, r.tan = vn, r.tanh = wn, r.trunc = Tn, e === void 0 && (e = {}), e && e.defaults !== !0)
|
|
1006
|
+
for (i = ["precision", "rounding", "toExpNeg", "toExpPos", "maxE", "minE", "modulo", "crypto"], t = 0; t < i.length; )
|
|
1007
|
+
e.hasOwnProperty(n = i[t++]) || (e[n] = this[n]);
|
|
1008
|
+
return r.config(e), r;
|
|
1009
|
+
}
|
|
1010
|
+
function Wt(e, t) {
|
|
1011
|
+
return new this(e).div(t);
|
|
1012
|
+
}
|
|
1013
|
+
function Kt(e) {
|
|
1014
|
+
return new this(e).exp();
|
|
1015
|
+
}
|
|
1016
|
+
function en(e) {
|
|
1017
|
+
return T(e = new this(e), e.e + 1, 3);
|
|
1018
|
+
}
|
|
1019
|
+
function tn() {
|
|
1020
|
+
var e, t, n = new this(0);
|
|
1021
|
+
for (O = !1, e = 0; e < arguments.length; )
|
|
1022
|
+
if (t = new this(arguments[e++]), t.d)
|
|
1023
|
+
n.d && (n = n.plus(t.times(t)));
|
|
1024
|
+
else {
|
|
1025
|
+
if (t.s)
|
|
1026
|
+
return O = !0, new this(1 / 0);
|
|
1027
|
+
n = t;
|
|
1028
|
+
}
|
|
1029
|
+
return O = !0, n.sqrt();
|
|
1030
|
+
}
|
|
1031
|
+
function Ke(e) {
|
|
1032
|
+
return e instanceof le || e && e.toStringTag === lt || !1;
|
|
1033
|
+
}
|
|
1034
|
+
function nn(e) {
|
|
1035
|
+
return new this(e).ln();
|
|
1036
|
+
}
|
|
1037
|
+
function rn(e, t) {
|
|
1038
|
+
return new this(e).log(t);
|
|
1039
|
+
}
|
|
1040
|
+
function sn(e) {
|
|
1041
|
+
return new this(e).log(2);
|
|
1042
|
+
}
|
|
1043
|
+
function on(e) {
|
|
1044
|
+
return new this(e).log(10);
|
|
1045
|
+
}
|
|
1046
|
+
function an() {
|
|
1047
|
+
return pt(this, arguments, "lt");
|
|
1048
|
+
}
|
|
1049
|
+
function cn() {
|
|
1050
|
+
return pt(this, arguments, "gt");
|
|
1051
|
+
}
|
|
1052
|
+
function un(e, t) {
|
|
1053
|
+
return new this(e).mod(t);
|
|
1054
|
+
}
|
|
1055
|
+
function ln(e, t) {
|
|
1056
|
+
return new this(e).mul(t);
|
|
1057
|
+
}
|
|
1058
|
+
function fn(e, t) {
|
|
1059
|
+
return new this(e).pow(t);
|
|
1060
|
+
}
|
|
1061
|
+
function hn(e) {
|
|
1062
|
+
var t, n, i, r, s = 0, o = new this(1), a = [];
|
|
1063
|
+
if (e === void 0 ? e = this.precision : $(e, 1, ne), i = Math.ceil(e / A), this.crypto)
|
|
1064
|
+
if (crypto.getRandomValues)
|
|
1065
|
+
for (t = crypto.getRandomValues(new Uint32Array(i)); s < i; )
|
|
1066
|
+
r = t[s], r >= 429e7 ? t[s] = crypto.getRandomValues(new Uint32Array(1))[0] : a[s++] = r % 1e7;
|
|
1067
|
+
else if (crypto.randomBytes) {
|
|
1068
|
+
for (t = crypto.randomBytes(i *= 4); s < i; )
|
|
1069
|
+
r = t[s] + (t[s + 1] << 8) + (t[s + 2] << 16) + ((t[s + 3] & 127) << 24), r >= 214e7 ? crypto.randomBytes(4).copy(t, s) : (a.push(r % 1e7), s += 4);
|
|
1070
|
+
s = i / 4;
|
|
1071
|
+
} else
|
|
1072
|
+
throw Error(ut);
|
|
1073
|
+
else
|
|
1074
|
+
for (; s < i; )
|
|
1075
|
+
a[s++] = Math.random() * 1e7 | 0;
|
|
1076
|
+
for (i = a[--s], e %= A, i && e && (r = F(10, A - e), a[s] = (i / r | 0) * r); a[s] === 0; s--)
|
|
1077
|
+
a.pop();
|
|
1078
|
+
if (s < 0)
|
|
1079
|
+
n = 0, a = [0];
|
|
1080
|
+
else {
|
|
1081
|
+
for (n = -1; a[0] === 0; n -= A)
|
|
1082
|
+
a.shift();
|
|
1083
|
+
for (i = 1, r = a[0]; r >= 10; r /= 10)
|
|
1084
|
+
i++;
|
|
1085
|
+
i < A && (n -= A - i);
|
|
1086
|
+
}
|
|
1087
|
+
return o.e = n, o.d = a, o;
|
|
1088
|
+
}
|
|
1089
|
+
function dn(e) {
|
|
1090
|
+
return T(e = new this(e), e.e + 1, this.rounding);
|
|
1091
|
+
}
|
|
1092
|
+
function pn(e) {
|
|
1093
|
+
return e = new this(e), e.d ? e.d[0] ? e.s : 0 * e.s : e.s || NaN;
|
|
1094
|
+
}
|
|
1095
|
+
function mn(e) {
|
|
1096
|
+
return new this(e).sin();
|
|
1097
|
+
}
|
|
1098
|
+
function gn(e) {
|
|
1099
|
+
return new this(e).sinh();
|
|
1100
|
+
}
|
|
1101
|
+
function En(e) {
|
|
1102
|
+
return new this(e).sqrt();
|
|
1103
|
+
}
|
|
1104
|
+
function Nn(e, t) {
|
|
1105
|
+
return new this(e).sub(t);
|
|
1106
|
+
}
|
|
1107
|
+
function yn() {
|
|
1108
|
+
var e = 0, t = arguments, n = new this(t[e]);
|
|
1109
|
+
for (O = !1; n.s && ++e < t.length; )
|
|
1110
|
+
n = n.plus(t[e]);
|
|
1111
|
+
return O = !0, T(n, this.precision, this.rounding);
|
|
1112
|
+
}
|
|
1113
|
+
function vn(e) {
|
|
1114
|
+
return new this(e).tan();
|
|
1115
|
+
}
|
|
1116
|
+
function wn(e) {
|
|
1117
|
+
return new this(e).tanh();
|
|
1118
|
+
}
|
|
1119
|
+
function Tn(e) {
|
|
1120
|
+
return T(e = new this(e), e.e + 1, 1);
|
|
1121
|
+
}
|
|
1122
|
+
m[Symbol.for("nodejs.util.inspect.custom")] = m.toString;
|
|
1123
|
+
m[Symbol.toStringTag] = "Decimal";
|
|
1124
|
+
var le = m.constructor = Et(Ue);
|
|
1125
|
+
Ie = new le(Ie);
|
|
1126
|
+
Oe = new le(Oe);
|
|
1127
|
+
const ze = JSON, An = (e) => e.toUpperCase(), In = (e) => {
|
|
18
1128
|
const t = {};
|
|
19
|
-
return e.forEach((n,
|
|
20
|
-
t[
|
|
1129
|
+
return e.forEach((n, i) => {
|
|
1130
|
+
t[i] = n;
|
|
21
1131
|
}), t;
|
|
22
|
-
},
|
|
1132
|
+
}, On = (e, t, n) => e.document ? e : {
|
|
23
1133
|
document: e,
|
|
24
1134
|
variables: t,
|
|
25
1135
|
requestHeaders: n,
|
|
26
1136
|
signal: void 0
|
|
27
|
-
},
|
|
1137
|
+
}, _n = (e, t, n) => e.query ? e : {
|
|
28
1138
|
query: e,
|
|
29
1139
|
variables: t,
|
|
30
1140
|
requestHeaders: n,
|
|
31
1141
|
signal: void 0
|
|
32
|
-
},
|
|
1142
|
+
}, bn = (e, t) => e.documents ? e : {
|
|
33
1143
|
documents: e,
|
|
34
1144
|
requestHeaders: t,
|
|
35
1145
|
signal: void 0
|
|
36
|
-
}, Ve = (e, t, ...n) => {
|
|
37
|
-
const [r, i] = n;
|
|
38
|
-
return e.document ? e : {
|
|
39
|
-
url: e,
|
|
40
|
-
document: t,
|
|
41
|
-
variables: r,
|
|
42
|
-
requestHeaders: i,
|
|
43
|
-
signal: void 0
|
|
44
|
-
};
|
|
45
1146
|
};
|
|
46
|
-
function
|
|
1147
|
+
function we(e, t) {
|
|
47
1148
|
if (!!!e)
|
|
48
1149
|
throw new Error(t);
|
|
49
1150
|
}
|
|
50
|
-
function
|
|
1151
|
+
function Dn(e) {
|
|
51
1152
|
return typeof e == "object" && e !== null;
|
|
52
1153
|
}
|
|
53
|
-
function
|
|
1154
|
+
function xn(e, t) {
|
|
54
1155
|
if (!!!e)
|
|
55
1156
|
throw new Error(
|
|
56
1157
|
t ?? "Unexpected invariant triggered."
|
|
57
1158
|
);
|
|
58
1159
|
}
|
|
59
|
-
const
|
|
60
|
-
function
|
|
61
|
-
let n = 0,
|
|
62
|
-
for (const
|
|
63
|
-
if (typeof
|
|
1160
|
+
const Sn = /\r\n|[\n\r]/g;
|
|
1161
|
+
function $e(e, t) {
|
|
1162
|
+
let n = 0, i = 1;
|
|
1163
|
+
for (const r of e.body.matchAll(Sn)) {
|
|
1164
|
+
if (typeof r.index == "number" || xn(!1), r.index >= t)
|
|
64
1165
|
break;
|
|
65
|
-
n =
|
|
1166
|
+
n = r.index + r[0].length, i += 1;
|
|
66
1167
|
}
|
|
67
1168
|
return {
|
|
68
|
-
line:
|
|
1169
|
+
line: i,
|
|
69
1170
|
column: t + 1 - n
|
|
70
1171
|
};
|
|
71
1172
|
}
|
|
72
|
-
function
|
|
73
|
-
return
|
|
1173
|
+
function Cn(e) {
|
|
1174
|
+
return Nt(
|
|
74
1175
|
e.source,
|
|
75
|
-
|
|
1176
|
+
$e(e.source, e.start)
|
|
76
1177
|
);
|
|
77
1178
|
}
|
|
78
|
-
function
|
|
79
|
-
const n = e.locationOffset.column - 1,
|
|
80
|
-
`,
|
|
81
|
-
if (
|
|
82
|
-
const
|
|
83
|
-
for (let
|
|
84
|
-
|
|
85
|
-
return
|
|
86
|
-
[`${
|
|
87
|
-
...
|
|
88
|
-
["|", "^".padStart(
|
|
89
|
-
["|",
|
|
1179
|
+
function Nt(e, t) {
|
|
1180
|
+
const n = e.locationOffset.column - 1, i = "".padStart(n) + e.body, r = t.line - 1, s = e.locationOffset.line - 1, o = t.line + s, a = t.line === 1 ? n : 0, u = t.column + a, c = `${e.name}:${o}:${u}
|
|
1181
|
+
`, l = i.split(/\r\n|[\n\r]/g), f = l[r];
|
|
1182
|
+
if (f.length > 120) {
|
|
1183
|
+
const h = Math.floor(u / 80), E = u % 80, N = [];
|
|
1184
|
+
for (let y = 0; y < f.length; y += 80)
|
|
1185
|
+
N.push(f.slice(y, y + 80));
|
|
1186
|
+
return c + et([
|
|
1187
|
+
[`${o} |`, N[0]],
|
|
1188
|
+
...N.slice(1, h + 1).map((y) => ["|", y]),
|
|
1189
|
+
["|", "^".padStart(E)],
|
|
1190
|
+
["|", N[h + 1]]
|
|
90
1191
|
]);
|
|
91
1192
|
}
|
|
92
|
-
return
|
|
1193
|
+
return c + et([
|
|
93
1194
|
// Lines specified like this: ["prefix", "string"],
|
|
94
|
-
[`${
|
|
95
|
-
[`${
|
|
96
|
-
["|", "^".padStart(
|
|
97
|
-
[`${
|
|
1195
|
+
[`${o - 1} |`, l[r - 1]],
|
|
1196
|
+
[`${o} |`, f],
|
|
1197
|
+
["|", "^".padStart(u)],
|
|
1198
|
+
[`${o + 1} |`, l[r + 1]]
|
|
98
1199
|
]);
|
|
99
1200
|
}
|
|
100
|
-
function
|
|
101
|
-
const t = e.filter(([
|
|
102
|
-
return t.map(([
|
|
1201
|
+
function et(e) {
|
|
1202
|
+
const t = e.filter(([i, r]) => r !== void 0), n = Math.max(...t.map(([i]) => i.length));
|
|
1203
|
+
return t.map(([i, r]) => i.padStart(n) + (r ? " " + r : "")).join(`
|
|
103
1204
|
`);
|
|
104
1205
|
}
|
|
105
|
-
function
|
|
1206
|
+
function kn(e) {
|
|
106
1207
|
const t = e[0];
|
|
107
1208
|
return t == null || "kind" in t || "length" in t ? {
|
|
108
1209
|
nodes: t,
|
|
@@ -113,7 +1214,7 @@ function He(e) {
|
|
|
113
1214
|
extensions: e[5]
|
|
114
1215
|
} : t;
|
|
115
1216
|
}
|
|
116
|
-
class
|
|
1217
|
+
class Xe extends Error {
|
|
117
1218
|
/**
|
|
118
1219
|
* An array of `{ line, column }` locations within the source GraphQL document
|
|
119
1220
|
* which correspond to this error.
|
|
@@ -153,19 +1254,19 @@ class pe extends Error {
|
|
|
153
1254
|
* @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
|
|
154
1255
|
*/
|
|
155
1256
|
constructor(t, ...n) {
|
|
156
|
-
var
|
|
157
|
-
const { nodes:
|
|
158
|
-
super(t), this.name = "GraphQLError", this.path =
|
|
159
|
-
Array.isArray(
|
|
1257
|
+
var i, r, s;
|
|
1258
|
+
const { nodes: o, source: a, positions: u, path: c, originalError: l, extensions: f } = kn(n);
|
|
1259
|
+
super(t), this.name = "GraphQLError", this.path = c ?? void 0, this.originalError = l ?? void 0, this.nodes = tt(
|
|
1260
|
+
Array.isArray(o) ? o : o ? [o] : void 0
|
|
160
1261
|
);
|
|
161
|
-
const
|
|
162
|
-
(
|
|
1262
|
+
const h = tt(
|
|
1263
|
+
(i = this.nodes) === null || i === void 0 ? void 0 : i.map((N) => N.loc).filter((N) => N != null)
|
|
163
1264
|
);
|
|
164
|
-
this.source =
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
) ?
|
|
168
|
-
this.extensions = (s =
|
|
1265
|
+
this.source = a ?? (h == null || (r = h[0]) === null || r === void 0 ? void 0 : r.source), this.positions = u ?? (h == null ? void 0 : h.map((N) => N.start)), this.locations = u && a ? u.map((N) => $e(a, N)) : h == null ? void 0 : h.map((N) => $e(N.source, N.start));
|
|
1266
|
+
const E = Dn(
|
|
1267
|
+
l == null ? void 0 : l.extensions
|
|
1268
|
+
) ? l == null ? void 0 : l.extensions : void 0;
|
|
1269
|
+
this.extensions = (s = f ?? E) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
|
|
169
1270
|
message: {
|
|
170
1271
|
writable: !0,
|
|
171
1272
|
enumerable: !0
|
|
@@ -185,11 +1286,11 @@ class pe extends Error {
|
|
|
185
1286
|
originalError: {
|
|
186
1287
|
enumerable: !1
|
|
187
1288
|
}
|
|
188
|
-
}),
|
|
189
|
-
value:
|
|
1289
|
+
}), l != null && l.stack ? Object.defineProperty(this, "stack", {
|
|
1290
|
+
value: l.stack,
|
|
190
1291
|
writable: !0,
|
|
191
1292
|
configurable: !0
|
|
192
|
-
}) : Error.captureStackTrace ? Error.captureStackTrace(this,
|
|
1293
|
+
}) : Error.captureStackTrace ? Error.captureStackTrace(this, Xe) : Object.defineProperty(this, "stack", {
|
|
193
1294
|
value: Error().stack,
|
|
194
1295
|
writable: !0,
|
|
195
1296
|
configurable: !0
|
|
@@ -204,12 +1305,12 @@ class pe extends Error {
|
|
|
204
1305
|
for (const n of this.nodes)
|
|
205
1306
|
n.loc && (t += `
|
|
206
1307
|
|
|
207
|
-
` +
|
|
1308
|
+
` + Cn(n.loc));
|
|
208
1309
|
else if (this.source && this.locations)
|
|
209
1310
|
for (const n of this.locations)
|
|
210
1311
|
t += `
|
|
211
1312
|
|
|
212
|
-
` +
|
|
1313
|
+
` + Nt(this.source, n);
|
|
213
1314
|
return t;
|
|
214
1315
|
}
|
|
215
1316
|
toJSON() {
|
|
@@ -219,16 +1320,16 @@ class pe extends Error {
|
|
|
219
1320
|
return this.locations != null && (t.locations = this.locations), this.path != null && (t.path = this.path), this.extensions != null && Object.keys(this.extensions).length > 0 && (t.extensions = this.extensions), t;
|
|
220
1321
|
}
|
|
221
1322
|
}
|
|
222
|
-
function
|
|
1323
|
+
function tt(e) {
|
|
223
1324
|
return e === void 0 || e.length === 0 ? void 0 : e;
|
|
224
1325
|
}
|
|
225
|
-
function
|
|
226
|
-
return new
|
|
1326
|
+
function P(e, t, n) {
|
|
1327
|
+
return new Xe(`Syntax Error: ${n}`, {
|
|
227
1328
|
source: e,
|
|
228
1329
|
positions: [t]
|
|
229
1330
|
});
|
|
230
1331
|
}
|
|
231
|
-
class
|
|
1332
|
+
class Rn {
|
|
232
1333
|
/**
|
|
233
1334
|
* The character offset at which this Node begins.
|
|
234
1335
|
*/
|
|
@@ -244,8 +1345,8 @@ class Ye {
|
|
|
244
1345
|
/**
|
|
245
1346
|
* The Source document the AST represents.
|
|
246
1347
|
*/
|
|
247
|
-
constructor(t, n,
|
|
248
|
-
this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source =
|
|
1348
|
+
constructor(t, n, i) {
|
|
1349
|
+
this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source = i;
|
|
249
1350
|
}
|
|
250
1351
|
get [Symbol.toStringTag]() {
|
|
251
1352
|
return "Location";
|
|
@@ -257,7 +1358,7 @@ class Ye {
|
|
|
257
1358
|
};
|
|
258
1359
|
}
|
|
259
1360
|
}
|
|
260
|
-
class
|
|
1361
|
+
class yt {
|
|
261
1362
|
/**
|
|
262
1363
|
* The kind of Token.
|
|
263
1364
|
*/
|
|
@@ -284,8 +1385,8 @@ class Ae {
|
|
|
284
1385
|
* including ignored tokens. <SOF> is always the first node and <EOF>
|
|
285
1386
|
* the last.
|
|
286
1387
|
*/
|
|
287
|
-
constructor(t, n,
|
|
288
|
-
this.kind = t, this.start = n, this.end =
|
|
1388
|
+
constructor(t, n, i, r, s, o) {
|
|
1389
|
+
this.kind = t, this.start = n, this.end = i, this.line = r, this.column = s, this.value = o, this.prev = null, this.next = null;
|
|
289
1390
|
}
|
|
290
1391
|
get [Symbol.toStringTag]() {
|
|
291
1392
|
return "Token";
|
|
@@ -299,7 +1400,7 @@ class Ae {
|
|
|
299
1400
|
};
|
|
300
1401
|
}
|
|
301
1402
|
}
|
|
302
|
-
const
|
|
1403
|
+
const vt = {
|
|
303
1404
|
Name: [],
|
|
304
1405
|
Document: ["definitions"],
|
|
305
1406
|
OperationDefinition: [
|
|
@@ -373,72 +1474,72 @@ const Ie = {
|
|
|
373
1474
|
UnionTypeExtension: ["name", "directives", "types"],
|
|
374
1475
|
EnumTypeExtension: ["name", "directives", "values"],
|
|
375
1476
|
InputObjectTypeExtension: ["name", "directives", "fields"]
|
|
376
|
-
},
|
|
377
|
-
function
|
|
1477
|
+
}, Ln = new Set(Object.keys(vt));
|
|
1478
|
+
function nt(e) {
|
|
378
1479
|
const t = e == null ? void 0 : e.kind;
|
|
379
|
-
return typeof t == "string" &&
|
|
1480
|
+
return typeof t == "string" && Ln.has(t);
|
|
380
1481
|
}
|
|
381
|
-
var
|
|
1482
|
+
var ce;
|
|
382
1483
|
(function(e) {
|
|
383
1484
|
e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
|
|
384
|
-
})(
|
|
385
|
-
var
|
|
1485
|
+
})(ce || (ce = {}));
|
|
1486
|
+
var He;
|
|
386
1487
|
(function(e) {
|
|
387
1488
|
e.QUERY = "QUERY", e.MUTATION = "MUTATION", e.SUBSCRIPTION = "SUBSCRIPTION", e.FIELD = "FIELD", e.FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", e.FRAGMENT_SPREAD = "FRAGMENT_SPREAD", e.INLINE_FRAGMENT = "INLINE_FRAGMENT", e.VARIABLE_DEFINITION = "VARIABLE_DEFINITION", e.SCHEMA = "SCHEMA", e.SCALAR = "SCALAR", e.OBJECT = "OBJECT", e.FIELD_DEFINITION = "FIELD_DEFINITION", e.ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", e.INTERFACE = "INTERFACE", e.UNION = "UNION", e.ENUM = "ENUM", e.ENUM_VALUE = "ENUM_VALUE", e.INPUT_OBJECT = "INPUT_OBJECT", e.INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION";
|
|
388
|
-
})(
|
|
389
|
-
var
|
|
1489
|
+
})(He || (He = {}));
|
|
1490
|
+
var I;
|
|
390
1491
|
(function(e) {
|
|
391
1492
|
e.NAME = "Name", e.DOCUMENT = "Document", e.OPERATION_DEFINITION = "OperationDefinition", e.VARIABLE_DEFINITION = "VariableDefinition", e.SELECTION_SET = "SelectionSet", e.FIELD = "Field", e.ARGUMENT = "Argument", e.FRAGMENT_SPREAD = "FragmentSpread", e.INLINE_FRAGMENT = "InlineFragment", e.FRAGMENT_DEFINITION = "FragmentDefinition", e.VARIABLE = "Variable", e.INT = "IntValue", e.FLOAT = "FloatValue", e.STRING = "StringValue", e.BOOLEAN = "BooleanValue", e.NULL = "NullValue", e.ENUM = "EnumValue", e.LIST = "ListValue", e.OBJECT = "ObjectValue", e.OBJECT_FIELD = "ObjectField", e.DIRECTIVE = "Directive", e.NAMED_TYPE = "NamedType", e.LIST_TYPE = "ListType", e.NON_NULL_TYPE = "NonNullType", e.SCHEMA_DEFINITION = "SchemaDefinition", e.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", e.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", e.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", e.FIELD_DEFINITION = "FieldDefinition", e.INPUT_VALUE_DEFINITION = "InputValueDefinition", e.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", e.UNION_TYPE_DEFINITION = "UnionTypeDefinition", e.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", e.ENUM_VALUE_DEFINITION = "EnumValueDefinition", e.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", e.DIRECTIVE_DEFINITION = "DirectiveDefinition", e.SCHEMA_EXTENSION = "SchemaExtension", e.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", e.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", e.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", e.UNION_TYPE_EXTENSION = "UnionTypeExtension", e.ENUM_TYPE_EXTENSION = "EnumTypeExtension", e.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension";
|
|
392
|
-
})(
|
|
393
|
-
function
|
|
1493
|
+
})(I || (I = {}));
|
|
1494
|
+
function Ge(e) {
|
|
394
1495
|
return e === 9 || e === 32;
|
|
395
1496
|
}
|
|
396
|
-
function
|
|
1497
|
+
function Ee(e) {
|
|
397
1498
|
return e >= 48 && e <= 57;
|
|
398
1499
|
}
|
|
399
|
-
function
|
|
1500
|
+
function wt(e) {
|
|
400
1501
|
return e >= 97 && e <= 122 || // A-Z
|
|
401
1502
|
e >= 65 && e <= 90;
|
|
402
1503
|
}
|
|
403
|
-
function
|
|
404
|
-
return
|
|
1504
|
+
function Tt(e) {
|
|
1505
|
+
return wt(e) || e === 95;
|
|
405
1506
|
}
|
|
406
|
-
function
|
|
407
|
-
return
|
|
1507
|
+
function Fn(e) {
|
|
1508
|
+
return wt(e) || Ee(e) || e === 95;
|
|
408
1509
|
}
|
|
409
|
-
function
|
|
1510
|
+
function Pn(e) {
|
|
410
1511
|
var t;
|
|
411
|
-
let n = Number.MAX_SAFE_INTEGER,
|
|
412
|
-
for (let
|
|
1512
|
+
let n = Number.MAX_SAFE_INTEGER, i = null, r = -1;
|
|
1513
|
+
for (let o = 0; o < e.length; ++o) {
|
|
413
1514
|
var s;
|
|
414
|
-
const
|
|
415
|
-
|
|
1515
|
+
const a = e[o], u = Mn(a);
|
|
1516
|
+
u !== a.length && (i = (s = i) !== null && s !== void 0 ? s : o, r = o, o !== 0 && u < n && (n = u));
|
|
416
1517
|
}
|
|
417
|
-
return e.map((
|
|
418
|
-
(t =
|
|
419
|
-
|
|
1518
|
+
return e.map((o, a) => a === 0 ? o : o.slice(n)).slice(
|
|
1519
|
+
(t = i) !== null && t !== void 0 ? t : 0,
|
|
1520
|
+
r + 1
|
|
420
1521
|
);
|
|
421
1522
|
}
|
|
422
|
-
function
|
|
1523
|
+
function Mn(e) {
|
|
423
1524
|
let t = 0;
|
|
424
|
-
for (; t < e.length &&
|
|
1525
|
+
for (; t < e.length && Ge(e.charCodeAt(t)); )
|
|
425
1526
|
++t;
|
|
426
1527
|
return t;
|
|
427
1528
|
}
|
|
428
|
-
function
|
|
429
|
-
const n = e.replace(/"""/g, '\\"""'),
|
|
430
|
-
(!
|
|
431
|
-
let
|
|
432
|
-
const
|
|
433
|
-
return (
|
|
434
|
-
`),
|
|
435
|
-
`), '"""' +
|
|
436
|
-
}
|
|
437
|
-
var
|
|
1529
|
+
function Bn(e, t) {
|
|
1530
|
+
const n = e.replace(/"""/g, '\\"""'), i = n.split(/\r\n|[\n\r]/g), r = i.length === 1, s = i.length > 1 && i.slice(1).every((E) => E.length === 0 || Ge(E.charCodeAt(0))), o = n.endsWith('\\"""'), a = e.endsWith('"') && !o, u = e.endsWith("\\"), c = a || u, l = !(t != null && t.minimize) && // add leading and trailing new lines only if it improves readability
|
|
1531
|
+
(!r || e.length > 70 || c || s || o);
|
|
1532
|
+
let f = "";
|
|
1533
|
+
const h = r && Ge(e.charCodeAt(0));
|
|
1534
|
+
return (l && !h || s) && (f += `
|
|
1535
|
+
`), f += n, (l || c) && (f += `
|
|
1536
|
+
`), '"""' + f + '"""';
|
|
1537
|
+
}
|
|
1538
|
+
var p;
|
|
438
1539
|
(function(e) {
|
|
439
1540
|
e.SOF = "<SOF>", e.EOF = "<EOF>", e.BANG = "!", e.DOLLAR = "$", e.AMP = "&", e.PAREN_L = "(", e.PAREN_R = ")", e.SPREAD = "...", e.COLON = ":", e.EQUALS = "=", e.AT = "@", e.BRACKET_L = "[", e.BRACKET_R = "]", e.BRACE_L = "{", e.PIPE = "|", e.BRACE_R = "}", e.NAME = "Name", e.INT = "Int", e.FLOAT = "Float", e.STRING = "String", e.BLOCK_STRING = "BlockString", e.COMMENT = "Comment";
|
|
440
|
-
})(
|
|
441
|
-
class
|
|
1541
|
+
})(p || (p = {}));
|
|
1542
|
+
class Un {
|
|
442
1543
|
/**
|
|
443
1544
|
* The previously focused non-ignored token.
|
|
444
1545
|
*/
|
|
@@ -452,7 +1553,7 @@ class Ze {
|
|
|
452
1553
|
* The character offset at which the current line begins.
|
|
453
1554
|
*/
|
|
454
1555
|
constructor(t) {
|
|
455
|
-
const n = new
|
|
1556
|
+
const n = new yt(p.SOF, 0, 0, 0, 0);
|
|
456
1557
|
this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
|
|
457
1558
|
}
|
|
458
1559
|
get [Symbol.toStringTag]() {
|
|
@@ -470,266 +1571,266 @@ class Ze {
|
|
|
470
1571
|
*/
|
|
471
1572
|
lookahead() {
|
|
472
1573
|
let t = this.token;
|
|
473
|
-
if (t.kind !==
|
|
1574
|
+
if (t.kind !== p.EOF)
|
|
474
1575
|
do
|
|
475
1576
|
if (t.next)
|
|
476
1577
|
t = t.next;
|
|
477
1578
|
else {
|
|
478
|
-
const n =
|
|
1579
|
+
const n = Vn(this, t.end);
|
|
479
1580
|
t.next = n, n.prev = t, t = n;
|
|
480
1581
|
}
|
|
481
|
-
while (t.kind ===
|
|
1582
|
+
while (t.kind === p.COMMENT);
|
|
482
1583
|
return t;
|
|
483
1584
|
}
|
|
484
1585
|
}
|
|
485
|
-
function
|
|
486
|
-
return e ===
|
|
1586
|
+
function qn(e) {
|
|
1587
|
+
return e === p.BANG || e === p.DOLLAR || e === p.AMP || e === p.PAREN_L || e === p.PAREN_R || e === p.SPREAD || e === p.COLON || e === p.EQUALS || e === p.AT || e === p.BRACKET_L || e === p.BRACKET_R || e === p.BRACE_L || e === p.PIPE || e === p.BRACE_R;
|
|
487
1588
|
}
|
|
488
|
-
function
|
|
1589
|
+
function fe(e) {
|
|
489
1590
|
return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
|
|
490
1591
|
}
|
|
491
|
-
function
|
|
492
|
-
return
|
|
1592
|
+
function Ce(e, t) {
|
|
1593
|
+
return At(e.charCodeAt(t)) && It(e.charCodeAt(t + 1));
|
|
493
1594
|
}
|
|
494
|
-
function
|
|
1595
|
+
function At(e) {
|
|
495
1596
|
return e >= 55296 && e <= 56319;
|
|
496
1597
|
}
|
|
497
|
-
function
|
|
1598
|
+
function It(e) {
|
|
498
1599
|
return e >= 56320 && e <= 57343;
|
|
499
1600
|
}
|
|
500
|
-
function
|
|
1601
|
+
function re(e, t) {
|
|
501
1602
|
const n = e.source.body.codePointAt(t);
|
|
502
1603
|
if (n === void 0)
|
|
503
|
-
return
|
|
1604
|
+
return p.EOF;
|
|
504
1605
|
if (n >= 32 && n <= 126) {
|
|
505
|
-
const
|
|
506
|
-
return
|
|
1606
|
+
const i = String.fromCodePoint(n);
|
|
1607
|
+
return i === '"' ? `'"'` : `"${i}"`;
|
|
507
1608
|
}
|
|
508
1609
|
return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
|
|
509
1610
|
}
|
|
510
|
-
function
|
|
511
|
-
const s = e.line,
|
|
512
|
-
return new
|
|
1611
|
+
function L(e, t, n, i, r) {
|
|
1612
|
+
const s = e.line, o = 1 + n - e.lineStart;
|
|
1613
|
+
return new yt(t, n, i, s, o, r);
|
|
513
1614
|
}
|
|
514
|
-
function
|
|
515
|
-
const n = e.source.body,
|
|
516
|
-
let
|
|
517
|
-
for (;
|
|
518
|
-
const s = n.charCodeAt(
|
|
1615
|
+
function Vn(e, t) {
|
|
1616
|
+
const n = e.source.body, i = n.length;
|
|
1617
|
+
let r = t;
|
|
1618
|
+
for (; r < i; ) {
|
|
1619
|
+
const s = n.charCodeAt(r);
|
|
519
1620
|
switch (s) {
|
|
520
1621
|
case 65279:
|
|
521
1622
|
case 9:
|
|
522
1623
|
case 32:
|
|
523
1624
|
case 44:
|
|
524
|
-
++
|
|
1625
|
+
++r;
|
|
525
1626
|
continue;
|
|
526
1627
|
case 10:
|
|
527
|
-
++
|
|
1628
|
+
++r, ++e.line, e.lineStart = r;
|
|
528
1629
|
continue;
|
|
529
1630
|
case 13:
|
|
530
|
-
n.charCodeAt(
|
|
1631
|
+
n.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++e.line, e.lineStart = r;
|
|
531
1632
|
continue;
|
|
532
1633
|
case 35:
|
|
533
|
-
return
|
|
1634
|
+
return jn(e, r);
|
|
534
1635
|
case 33:
|
|
535
|
-
return
|
|
1636
|
+
return L(e, p.BANG, r, r + 1);
|
|
536
1637
|
case 36:
|
|
537
|
-
return
|
|
1638
|
+
return L(e, p.DOLLAR, r, r + 1);
|
|
538
1639
|
case 38:
|
|
539
|
-
return
|
|
1640
|
+
return L(e, p.AMP, r, r + 1);
|
|
540
1641
|
case 40:
|
|
541
|
-
return
|
|
1642
|
+
return L(e, p.PAREN_L, r, r + 1);
|
|
542
1643
|
case 41:
|
|
543
|
-
return
|
|
1644
|
+
return L(e, p.PAREN_R, r, r + 1);
|
|
544
1645
|
case 46:
|
|
545
|
-
if (n.charCodeAt(
|
|
546
|
-
return
|
|
1646
|
+
if (n.charCodeAt(r + 1) === 46 && n.charCodeAt(r + 2) === 46)
|
|
1647
|
+
return L(e, p.SPREAD, r, r + 3);
|
|
547
1648
|
break;
|
|
548
1649
|
case 58:
|
|
549
|
-
return
|
|
1650
|
+
return L(e, p.COLON, r, r + 1);
|
|
550
1651
|
case 61:
|
|
551
|
-
return
|
|
1652
|
+
return L(e, p.EQUALS, r, r + 1);
|
|
552
1653
|
case 64:
|
|
553
|
-
return
|
|
1654
|
+
return L(e, p.AT, r, r + 1);
|
|
554
1655
|
case 91:
|
|
555
|
-
return
|
|
1656
|
+
return L(e, p.BRACKET_L, r, r + 1);
|
|
556
1657
|
case 93:
|
|
557
|
-
return
|
|
1658
|
+
return L(e, p.BRACKET_R, r, r + 1);
|
|
558
1659
|
case 123:
|
|
559
|
-
return
|
|
1660
|
+
return L(e, p.BRACE_L, r, r + 1);
|
|
560
1661
|
case 124:
|
|
561
|
-
return
|
|
1662
|
+
return L(e, p.PIPE, r, r + 1);
|
|
562
1663
|
case 125:
|
|
563
|
-
return
|
|
1664
|
+
return L(e, p.BRACE_R, r, r + 1);
|
|
564
1665
|
case 34:
|
|
565
|
-
return n.charCodeAt(
|
|
1666
|
+
return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? zn(e, r) : Hn(e, r);
|
|
566
1667
|
}
|
|
567
|
-
if (
|
|
568
|
-
return
|
|
569
|
-
if (
|
|
570
|
-
return
|
|
571
|
-
throw
|
|
1668
|
+
if (Ee(s) || s === 45)
|
|
1669
|
+
return $n(e, r, s);
|
|
1670
|
+
if (Tt(s))
|
|
1671
|
+
return Xn(e, r);
|
|
1672
|
+
throw P(
|
|
572
1673
|
e.source,
|
|
573
|
-
|
|
574
|
-
s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` :
|
|
1674
|
+
r,
|
|
1675
|
+
s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : fe(s) || Ce(n, r) ? `Unexpected character: ${re(e, r)}.` : `Invalid character: ${re(e, r)}.`
|
|
575
1676
|
);
|
|
576
1677
|
}
|
|
577
|
-
return
|
|
1678
|
+
return L(e, p.EOF, i, i);
|
|
578
1679
|
}
|
|
579
|
-
function
|
|
580
|
-
const n = e.source.body,
|
|
581
|
-
let
|
|
582
|
-
for (;
|
|
583
|
-
const s = n.charCodeAt(
|
|
1680
|
+
function jn(e, t) {
|
|
1681
|
+
const n = e.source.body, i = n.length;
|
|
1682
|
+
let r = t + 1;
|
|
1683
|
+
for (; r < i; ) {
|
|
1684
|
+
const s = n.charCodeAt(r);
|
|
584
1685
|
if (s === 10 || s === 13)
|
|
585
1686
|
break;
|
|
586
|
-
if (
|
|
587
|
-
++
|
|
588
|
-
else if (
|
|
589
|
-
|
|
1687
|
+
if (fe(s))
|
|
1688
|
+
++r;
|
|
1689
|
+
else if (Ce(n, r))
|
|
1690
|
+
r += 2;
|
|
590
1691
|
else
|
|
591
1692
|
break;
|
|
592
1693
|
}
|
|
593
|
-
return
|
|
1694
|
+
return L(
|
|
594
1695
|
e,
|
|
595
|
-
|
|
1696
|
+
p.COMMENT,
|
|
596
1697
|
t,
|
|
597
|
-
|
|
598
|
-
n.slice(t + 1,
|
|
1698
|
+
r,
|
|
1699
|
+
n.slice(t + 1, r)
|
|
599
1700
|
);
|
|
600
1701
|
}
|
|
601
|
-
function
|
|
602
|
-
const
|
|
603
|
-
let
|
|
604
|
-
if (s === 45 && (s =
|
|
605
|
-
if (s =
|
|
606
|
-
throw
|
|
1702
|
+
function $n(e, t, n) {
|
|
1703
|
+
const i = e.source.body;
|
|
1704
|
+
let r = t, s = n, o = !1;
|
|
1705
|
+
if (s === 45 && (s = i.charCodeAt(++r)), s === 48) {
|
|
1706
|
+
if (s = i.charCodeAt(++r), Ee(s))
|
|
1707
|
+
throw P(
|
|
607
1708
|
e.source,
|
|
608
|
-
|
|
609
|
-
`Invalid number, unexpected digit after 0: ${
|
|
1709
|
+
r,
|
|
1710
|
+
`Invalid number, unexpected digit after 0: ${re(
|
|
610
1711
|
e,
|
|
611
|
-
|
|
1712
|
+
r
|
|
612
1713
|
)}.`
|
|
613
1714
|
);
|
|
614
1715
|
} else
|
|
615
|
-
|
|
616
|
-
if (s === 46 && (
|
|
617
|
-
throw
|
|
1716
|
+
r = Le(e, r, s), s = i.charCodeAt(r);
|
|
1717
|
+
if (s === 46 && (o = !0, s = i.charCodeAt(++r), r = Le(e, r, s), s = i.charCodeAt(r)), (s === 69 || s === 101) && (o = !0, s = i.charCodeAt(++r), (s === 43 || s === 45) && (s = i.charCodeAt(++r)), r = Le(e, r, s), s = i.charCodeAt(r)), s === 46 || Tt(s))
|
|
1718
|
+
throw P(
|
|
618
1719
|
e.source,
|
|
619
|
-
|
|
620
|
-
`Invalid number, expected digit but got: ${
|
|
1720
|
+
r,
|
|
1721
|
+
`Invalid number, expected digit but got: ${re(
|
|
621
1722
|
e,
|
|
622
|
-
|
|
1723
|
+
r
|
|
623
1724
|
)}.`
|
|
624
1725
|
);
|
|
625
|
-
return
|
|
1726
|
+
return L(
|
|
626
1727
|
e,
|
|
627
|
-
|
|
1728
|
+
o ? p.FLOAT : p.INT,
|
|
628
1729
|
t,
|
|
629
|
-
|
|
630
|
-
|
|
1730
|
+
r,
|
|
1731
|
+
i.slice(t, r)
|
|
631
1732
|
);
|
|
632
1733
|
}
|
|
633
|
-
function
|
|
634
|
-
if (
|
|
635
|
-
throw
|
|
1734
|
+
function Le(e, t, n) {
|
|
1735
|
+
if (!Ee(n))
|
|
1736
|
+
throw P(
|
|
636
1737
|
e.source,
|
|
637
1738
|
t,
|
|
638
|
-
`Invalid number, expected digit but got: ${
|
|
1739
|
+
`Invalid number, expected digit but got: ${re(
|
|
639
1740
|
e,
|
|
640
1741
|
t
|
|
641
1742
|
)}.`
|
|
642
1743
|
);
|
|
643
|
-
const
|
|
644
|
-
let
|
|
645
|
-
for (;
|
|
646
|
-
++
|
|
647
|
-
return
|
|
1744
|
+
const i = e.source.body;
|
|
1745
|
+
let r = t + 1;
|
|
1746
|
+
for (; Ee(i.charCodeAt(r)); )
|
|
1747
|
+
++r;
|
|
1748
|
+
return r;
|
|
648
1749
|
}
|
|
649
|
-
function
|
|
650
|
-
const n = e.source.body,
|
|
651
|
-
let
|
|
652
|
-
for (;
|
|
653
|
-
const
|
|
654
|
-
if (
|
|
655
|
-
return
|
|
656
|
-
if (
|
|
657
|
-
|
|
658
|
-
const
|
|
659
|
-
|
|
1750
|
+
function Hn(e, t) {
|
|
1751
|
+
const n = e.source.body, i = n.length;
|
|
1752
|
+
let r = t + 1, s = r, o = "";
|
|
1753
|
+
for (; r < i; ) {
|
|
1754
|
+
const a = n.charCodeAt(r);
|
|
1755
|
+
if (a === 34)
|
|
1756
|
+
return o += n.slice(s, r), L(e, p.STRING, t, r + 1, o);
|
|
1757
|
+
if (a === 92) {
|
|
1758
|
+
o += n.slice(s, r);
|
|
1759
|
+
const u = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ? Gn(e, r) : Yn(e, r) : Jn(e, r);
|
|
1760
|
+
o += u.value, r += u.size, s = r;
|
|
660
1761
|
continue;
|
|
661
1762
|
}
|
|
662
|
-
if (
|
|
1763
|
+
if (a === 10 || a === 13)
|
|
663
1764
|
break;
|
|
664
|
-
if (
|
|
665
|
-
++
|
|
666
|
-
else if (
|
|
667
|
-
|
|
1765
|
+
if (fe(a))
|
|
1766
|
+
++r;
|
|
1767
|
+
else if (Ce(n, r))
|
|
1768
|
+
r += 2;
|
|
668
1769
|
else
|
|
669
|
-
throw
|
|
1770
|
+
throw P(
|
|
670
1771
|
e.source,
|
|
671
|
-
|
|
672
|
-
`Invalid character within String: ${
|
|
1772
|
+
r,
|
|
1773
|
+
`Invalid character within String: ${re(
|
|
673
1774
|
e,
|
|
674
|
-
|
|
1775
|
+
r
|
|
675
1776
|
)}.`
|
|
676
1777
|
);
|
|
677
1778
|
}
|
|
678
|
-
throw
|
|
1779
|
+
throw P(e.source, r, "Unterminated string.");
|
|
679
1780
|
}
|
|
680
|
-
function
|
|
1781
|
+
function Gn(e, t) {
|
|
681
1782
|
const n = e.source.body;
|
|
682
|
-
let
|
|
683
|
-
for (;
|
|
684
|
-
const s = n.charCodeAt(t +
|
|
1783
|
+
let i = 0, r = 3;
|
|
1784
|
+
for (; r < 12; ) {
|
|
1785
|
+
const s = n.charCodeAt(t + r++);
|
|
685
1786
|
if (s === 125) {
|
|
686
|
-
if (
|
|
1787
|
+
if (r < 5 || !fe(i))
|
|
687
1788
|
break;
|
|
688
1789
|
return {
|
|
689
|
-
value: String.fromCodePoint(
|
|
690
|
-
size:
|
|
1790
|
+
value: String.fromCodePoint(i),
|
|
1791
|
+
size: r
|
|
691
1792
|
};
|
|
692
1793
|
}
|
|
693
|
-
if (
|
|
1794
|
+
if (i = i << 4 | pe(s), i < 0)
|
|
694
1795
|
break;
|
|
695
1796
|
}
|
|
696
|
-
throw
|
|
1797
|
+
throw P(
|
|
697
1798
|
e.source,
|
|
698
1799
|
t,
|
|
699
1800
|
`Invalid Unicode escape sequence: "${n.slice(
|
|
700
1801
|
t,
|
|
701
|
-
t +
|
|
1802
|
+
t + r
|
|
702
1803
|
)}".`
|
|
703
1804
|
);
|
|
704
1805
|
}
|
|
705
|
-
function
|
|
706
|
-
const n = e.source.body,
|
|
707
|
-
if (
|
|
1806
|
+
function Yn(e, t) {
|
|
1807
|
+
const n = e.source.body, i = it(n, t + 2);
|
|
1808
|
+
if (fe(i))
|
|
708
1809
|
return {
|
|
709
|
-
value: String.fromCodePoint(
|
|
1810
|
+
value: String.fromCodePoint(i),
|
|
710
1811
|
size: 6
|
|
711
1812
|
};
|
|
712
|
-
if (
|
|
713
|
-
const
|
|
714
|
-
if (
|
|
1813
|
+
if (At(i) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
|
|
1814
|
+
const r = it(n, t + 8);
|
|
1815
|
+
if (It(r))
|
|
715
1816
|
return {
|
|
716
|
-
value: String.fromCodePoint(
|
|
1817
|
+
value: String.fromCodePoint(i, r),
|
|
717
1818
|
size: 12
|
|
718
1819
|
};
|
|
719
1820
|
}
|
|
720
|
-
throw
|
|
1821
|
+
throw P(
|
|
721
1822
|
e.source,
|
|
722
1823
|
t,
|
|
723
1824
|
`Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`
|
|
724
1825
|
);
|
|
725
1826
|
}
|
|
726
|
-
function
|
|
727
|
-
return
|
|
1827
|
+
function it(e, t) {
|
|
1828
|
+
return pe(e.charCodeAt(t)) << 12 | pe(e.charCodeAt(t + 1)) << 8 | pe(e.charCodeAt(t + 2)) << 4 | pe(e.charCodeAt(t + 3));
|
|
728
1829
|
}
|
|
729
|
-
function
|
|
1830
|
+
function pe(e) {
|
|
730
1831
|
return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
|
|
731
1832
|
}
|
|
732
|
-
function
|
|
1833
|
+
function Jn(e, t) {
|
|
733
1834
|
const n = e.source.body;
|
|
734
1835
|
switch (n.charCodeAt(t + 1)) {
|
|
735
1836
|
case 34:
|
|
@@ -774,7 +1875,7 @@ function ot(e, t) {
|
|
|
774
1875
|
size: 2
|
|
775
1876
|
};
|
|
776
1877
|
}
|
|
777
|
-
throw
|
|
1878
|
+
throw P(
|
|
778
1879
|
e.source,
|
|
779
1880
|
t,
|
|
780
1881
|
`Invalid character escape sequence: "${n.slice(
|
|
@@ -783,117 +1884,117 @@ function ot(e, t) {
|
|
|
783
1884
|
)}".`
|
|
784
1885
|
);
|
|
785
1886
|
}
|
|
786
|
-
function
|
|
787
|
-
const n = e.source.body,
|
|
788
|
-
let
|
|
789
|
-
const
|
|
790
|
-
for (; s <
|
|
791
|
-
const
|
|
792
|
-
if (
|
|
793
|
-
|
|
794
|
-
const
|
|
1887
|
+
function zn(e, t) {
|
|
1888
|
+
const n = e.source.body, i = n.length;
|
|
1889
|
+
let r = e.lineStart, s = t + 3, o = s, a = "";
|
|
1890
|
+
const u = [];
|
|
1891
|
+
for (; s < i; ) {
|
|
1892
|
+
const c = n.charCodeAt(s);
|
|
1893
|
+
if (c === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
|
|
1894
|
+
a += n.slice(o, s), u.push(a);
|
|
1895
|
+
const l = L(
|
|
795
1896
|
e,
|
|
796
|
-
|
|
1897
|
+
p.BLOCK_STRING,
|
|
797
1898
|
t,
|
|
798
1899
|
s + 3,
|
|
799
1900
|
// Return a string of the lines joined with U+000A.
|
|
800
|
-
|
|
1901
|
+
Pn(u).join(`
|
|
801
1902
|
`)
|
|
802
1903
|
);
|
|
803
|
-
return e.line +=
|
|
1904
|
+
return e.line += u.length - 1, e.lineStart = r, l;
|
|
804
1905
|
}
|
|
805
|
-
if (
|
|
806
|
-
|
|
1906
|
+
if (c === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
|
|
1907
|
+
a += n.slice(o, s), o = s + 1, s += 4;
|
|
807
1908
|
continue;
|
|
808
1909
|
}
|
|
809
|
-
if (
|
|
810
|
-
|
|
1910
|
+
if (c === 10 || c === 13) {
|
|
1911
|
+
a += n.slice(o, s), u.push(a), c === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, a = "", o = s, r = s;
|
|
811
1912
|
continue;
|
|
812
1913
|
}
|
|
813
|
-
if (
|
|
1914
|
+
if (fe(c))
|
|
814
1915
|
++s;
|
|
815
|
-
else if (
|
|
1916
|
+
else if (Ce(n, s))
|
|
816
1917
|
s += 2;
|
|
817
1918
|
else
|
|
818
|
-
throw
|
|
1919
|
+
throw P(
|
|
819
1920
|
e.source,
|
|
820
1921
|
s,
|
|
821
|
-
`Invalid character within String: ${
|
|
1922
|
+
`Invalid character within String: ${re(
|
|
822
1923
|
e,
|
|
823
1924
|
s
|
|
824
1925
|
)}.`
|
|
825
1926
|
);
|
|
826
1927
|
}
|
|
827
|
-
throw
|
|
1928
|
+
throw P(e.source, s, "Unterminated string.");
|
|
828
1929
|
}
|
|
829
|
-
function
|
|
830
|
-
const n = e.source.body,
|
|
831
|
-
let
|
|
832
|
-
for (;
|
|
833
|
-
const s = n.charCodeAt(
|
|
834
|
-
if (
|
|
835
|
-
++
|
|
1930
|
+
function Xn(e, t) {
|
|
1931
|
+
const n = e.source.body, i = n.length;
|
|
1932
|
+
let r = t + 1;
|
|
1933
|
+
for (; r < i; ) {
|
|
1934
|
+
const s = n.charCodeAt(r);
|
|
1935
|
+
if (Fn(s))
|
|
1936
|
+
++r;
|
|
836
1937
|
else
|
|
837
1938
|
break;
|
|
838
1939
|
}
|
|
839
|
-
return
|
|
1940
|
+
return L(
|
|
840
1941
|
e,
|
|
841
|
-
|
|
1942
|
+
p.NAME,
|
|
842
1943
|
t,
|
|
843
|
-
|
|
844
|
-
n.slice(t,
|
|
1944
|
+
r,
|
|
1945
|
+
n.slice(t, r)
|
|
845
1946
|
);
|
|
846
1947
|
}
|
|
847
|
-
const
|
|
848
|
-
function
|
|
849
|
-
return
|
|
1948
|
+
const Zn = 10, Ot = 2;
|
|
1949
|
+
function Ze(e) {
|
|
1950
|
+
return ke(e, []);
|
|
850
1951
|
}
|
|
851
|
-
function
|
|
1952
|
+
function ke(e, t) {
|
|
852
1953
|
switch (typeof e) {
|
|
853
1954
|
case "string":
|
|
854
1955
|
return JSON.stringify(e);
|
|
855
1956
|
case "function":
|
|
856
1957
|
return e.name ? `[function ${e.name}]` : "[function]";
|
|
857
1958
|
case "object":
|
|
858
|
-
return
|
|
1959
|
+
return Qn(e, t);
|
|
859
1960
|
default:
|
|
860
1961
|
return String(e);
|
|
861
1962
|
}
|
|
862
1963
|
}
|
|
863
|
-
function
|
|
1964
|
+
function Qn(e, t) {
|
|
864
1965
|
if (e === null)
|
|
865
1966
|
return "null";
|
|
866
1967
|
if (t.includes(e))
|
|
867
1968
|
return "[Circular]";
|
|
868
1969
|
const n = [...t, e];
|
|
869
|
-
if (
|
|
870
|
-
const
|
|
871
|
-
if (
|
|
872
|
-
return typeof
|
|
1970
|
+
if (Wn(e)) {
|
|
1971
|
+
const i = e.toJSON();
|
|
1972
|
+
if (i !== e)
|
|
1973
|
+
return typeof i == "string" ? i : ke(i, n);
|
|
873
1974
|
} else if (Array.isArray(e))
|
|
874
|
-
return
|
|
875
|
-
return
|
|
1975
|
+
return ei(e, n);
|
|
1976
|
+
return Kn(e, n);
|
|
876
1977
|
}
|
|
877
|
-
function
|
|
1978
|
+
function Wn(e) {
|
|
878
1979
|
return typeof e.toJSON == "function";
|
|
879
1980
|
}
|
|
880
|
-
function
|
|
1981
|
+
function Kn(e, t) {
|
|
881
1982
|
const n = Object.entries(e);
|
|
882
|
-
return n.length === 0 ? "{}" : t.length >
|
|
883
|
-
([
|
|
1983
|
+
return n.length === 0 ? "{}" : t.length > Ot ? "[" + ti(e) + "]" : "{ " + n.map(
|
|
1984
|
+
([r, s]) => r + ": " + ke(s, t)
|
|
884
1985
|
).join(", ") + " }";
|
|
885
1986
|
}
|
|
886
|
-
function
|
|
1987
|
+
function ei(e, t) {
|
|
887
1988
|
if (e.length === 0)
|
|
888
1989
|
return "[]";
|
|
889
|
-
if (t.length >
|
|
1990
|
+
if (t.length > Ot)
|
|
890
1991
|
return "[Array]";
|
|
891
|
-
const n = Math.min(
|
|
1992
|
+
const n = Math.min(Zn, e.length), i = e.length - n, r = [];
|
|
892
1993
|
for (let s = 0; s < n; ++s)
|
|
893
|
-
|
|
894
|
-
return
|
|
1994
|
+
r.push(ke(e[s], t));
|
|
1995
|
+
return i === 1 ? r.push("... 1 more item") : i > 1 && r.push(`... ${i} more items`), "[" + r.join(", ") + "]";
|
|
895
1996
|
}
|
|
896
|
-
function
|
|
1997
|
+
function ti(e) {
|
|
897
1998
|
const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
|
|
898
1999
|
if (t === "Object" && typeof e.constructor == "function") {
|
|
899
2000
|
const n = e.constructor.name;
|
|
@@ -902,7 +2003,7 @@ function ft(e) {
|
|
|
902
2003
|
}
|
|
903
2004
|
return t;
|
|
904
2005
|
}
|
|
905
|
-
const
|
|
2006
|
+
const ni = (
|
|
906
2007
|
/* c8 ignore next 6 */
|
|
907
2008
|
// FIXME: https://github.com/graphql/graphql-js/issues/2317
|
|
908
2009
|
// eslint-disable-next-line no-undef
|
|
@@ -912,14 +2013,14 @@ const yt = (
|
|
|
912
2013
|
if (t instanceof n)
|
|
913
2014
|
return !0;
|
|
914
2015
|
if (typeof t == "object" && t !== null) {
|
|
915
|
-
var
|
|
916
|
-
const
|
|
2016
|
+
var i;
|
|
2017
|
+
const r = n.prototype[Symbol.toStringTag], s = (
|
|
917
2018
|
// We still need to support constructor's name to detect conflicts with older versions of this library.
|
|
918
|
-
Symbol.toStringTag in t ? t[Symbol.toStringTag] : (
|
|
2019
|
+
Symbol.toStringTag in t ? t[Symbol.toStringTag] : (i = t.constructor) === null || i === void 0 ? void 0 : i.name
|
|
919
2020
|
);
|
|
920
|
-
if (
|
|
921
|
-
const
|
|
922
|
-
throw new Error(`Cannot use ${
|
|
2021
|
+
if (r === s) {
|
|
2022
|
+
const o = Ze(t);
|
|
2023
|
+
throw new Error(`Cannot use ${r} "${o}" from another module or realm.
|
|
923
2024
|
|
|
924
2025
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
925
2026
|
directory. If different versions of "graphql" are the dependencies of other
|
|
@@ -936,15 +2037,15 @@ spurious results.`);
|
|
|
936
2037
|
return !1;
|
|
937
2038
|
}
|
|
938
2039
|
);
|
|
939
|
-
class
|
|
940
|
-
constructor(t, n = "GraphQL request",
|
|
2040
|
+
class _t {
|
|
2041
|
+
constructor(t, n = "GraphQL request", i = {
|
|
941
2042
|
line: 1,
|
|
942
2043
|
column: 1
|
|
943
2044
|
}) {
|
|
944
|
-
typeof t == "string" ||
|
|
2045
|
+
typeof t == "string" || we(!1, `Body must be a string. Received: ${Ze(t)}.`), this.body = t, this.name = n, this.locationOffset = i, this.locationOffset.line > 0 || we(
|
|
945
2046
|
!1,
|
|
946
2047
|
"line in locationOffset is 1-indexed and must be positive."
|
|
947
|
-
), this.locationOffset.column > 0 ||
|
|
2048
|
+
), this.locationOffset.column > 0 || we(
|
|
948
2049
|
!1,
|
|
949
2050
|
"column in locationOffset is 1-indexed and must be positive."
|
|
950
2051
|
);
|
|
@@ -953,24 +2054,24 @@ class Se {
|
|
|
953
2054
|
return "Source";
|
|
954
2055
|
}
|
|
955
2056
|
}
|
|
956
|
-
function
|
|
957
|
-
return
|
|
2057
|
+
function ii(e) {
|
|
2058
|
+
return ni(e, _t);
|
|
958
2059
|
}
|
|
959
|
-
function
|
|
960
|
-
return new
|
|
2060
|
+
function ri(e, t) {
|
|
2061
|
+
return new si(e, t).parseDocument();
|
|
961
2062
|
}
|
|
962
|
-
class
|
|
2063
|
+
class si {
|
|
963
2064
|
constructor(t, n = {}) {
|
|
964
|
-
const
|
|
965
|
-
this._lexer = new
|
|
2065
|
+
const i = ii(t) ? t : new _t(t);
|
|
2066
|
+
this._lexer = new Un(i), this._options = n, this._tokenCounter = 0;
|
|
966
2067
|
}
|
|
967
2068
|
/**
|
|
968
2069
|
* Converts a name lex token into a name parse node.
|
|
969
2070
|
*/
|
|
970
2071
|
parseName() {
|
|
971
|
-
const t = this.expectToken(
|
|
2072
|
+
const t = this.expectToken(p.NAME);
|
|
972
2073
|
return this.node(t, {
|
|
973
|
-
kind:
|
|
2074
|
+
kind: I.NAME,
|
|
974
2075
|
value: t.value
|
|
975
2076
|
});
|
|
976
2077
|
}
|
|
@@ -980,11 +2081,11 @@ class Tt {
|
|
|
980
2081
|
*/
|
|
981
2082
|
parseDocument() {
|
|
982
2083
|
return this.node(this._lexer.token, {
|
|
983
|
-
kind:
|
|
2084
|
+
kind: I.DOCUMENT,
|
|
984
2085
|
definitions: this.many(
|
|
985
|
-
|
|
2086
|
+
p.SOF,
|
|
986
2087
|
this.parseDefinition,
|
|
987
|
-
|
|
2088
|
+
p.EOF
|
|
988
2089
|
)
|
|
989
2090
|
});
|
|
990
2091
|
}
|
|
@@ -1012,10 +2113,10 @@ class Tt {
|
|
|
1012
2113
|
* - InputObjectTypeDefinition
|
|
1013
2114
|
*/
|
|
1014
2115
|
parseDefinition() {
|
|
1015
|
-
if (this.peek(
|
|
2116
|
+
if (this.peek(p.BRACE_L))
|
|
1016
2117
|
return this.parseOperationDefinition();
|
|
1017
2118
|
const t = this.peekDescription(), n = t ? this._lexer.lookahead() : this._lexer.token;
|
|
1018
|
-
if (n.kind ===
|
|
2119
|
+
if (n.kind === p.NAME) {
|
|
1019
2120
|
switch (n.value) {
|
|
1020
2121
|
case "schema":
|
|
1021
2122
|
return this.parseSchemaDefinition();
|
|
@@ -1035,7 +2136,7 @@ class Tt {
|
|
|
1035
2136
|
return this.parseDirectiveDefinition();
|
|
1036
2137
|
}
|
|
1037
2138
|
if (t)
|
|
1038
|
-
throw
|
|
2139
|
+
throw P(
|
|
1039
2140
|
this._lexer.source,
|
|
1040
2141
|
this._lexer.token.start,
|
|
1041
2142
|
"Unexpected description, descriptions are supported only on type definitions."
|
|
@@ -1061,21 +2162,21 @@ class Tt {
|
|
|
1061
2162
|
*/
|
|
1062
2163
|
parseOperationDefinition() {
|
|
1063
2164
|
const t = this._lexer.token;
|
|
1064
|
-
if (this.peek(
|
|
2165
|
+
if (this.peek(p.BRACE_L))
|
|
1065
2166
|
return this.node(t, {
|
|
1066
|
-
kind:
|
|
1067
|
-
operation:
|
|
2167
|
+
kind: I.OPERATION_DEFINITION,
|
|
2168
|
+
operation: ce.QUERY,
|
|
1068
2169
|
name: void 0,
|
|
1069
2170
|
variableDefinitions: [],
|
|
1070
2171
|
directives: [],
|
|
1071
2172
|
selectionSet: this.parseSelectionSet()
|
|
1072
2173
|
});
|
|
1073
2174
|
const n = this.parseOperationType();
|
|
1074
|
-
let
|
|
1075
|
-
return this.peek(
|
|
1076
|
-
kind:
|
|
2175
|
+
let i;
|
|
2176
|
+
return this.peek(p.NAME) && (i = this.parseName()), this.node(t, {
|
|
2177
|
+
kind: I.OPERATION_DEFINITION,
|
|
1077
2178
|
operation: n,
|
|
1078
|
-
name:
|
|
2179
|
+
name: i,
|
|
1079
2180
|
variableDefinitions: this.parseVariableDefinitions(),
|
|
1080
2181
|
directives: this.parseDirectives(!1),
|
|
1081
2182
|
selectionSet: this.parseSelectionSet()
|
|
@@ -1085,14 +2186,14 @@ class Tt {
|
|
|
1085
2186
|
* OperationType : one of query mutation subscription
|
|
1086
2187
|
*/
|
|
1087
2188
|
parseOperationType() {
|
|
1088
|
-
const t = this.expectToken(
|
|
2189
|
+
const t = this.expectToken(p.NAME);
|
|
1089
2190
|
switch (t.value) {
|
|
1090
2191
|
case "query":
|
|
1091
|
-
return
|
|
2192
|
+
return ce.QUERY;
|
|
1092
2193
|
case "mutation":
|
|
1093
|
-
return
|
|
2194
|
+
return ce.MUTATION;
|
|
1094
2195
|
case "subscription":
|
|
1095
|
-
return
|
|
2196
|
+
return ce.SUBSCRIPTION;
|
|
1096
2197
|
}
|
|
1097
2198
|
throw this.unexpected(t);
|
|
1098
2199
|
}
|
|
@@ -1101,9 +2202,9 @@ class Tt {
|
|
|
1101
2202
|
*/
|
|
1102
2203
|
parseVariableDefinitions() {
|
|
1103
2204
|
return this.optionalMany(
|
|
1104
|
-
|
|
2205
|
+
p.PAREN_L,
|
|
1105
2206
|
this.parseVariableDefinition,
|
|
1106
|
-
|
|
2207
|
+
p.PAREN_R
|
|
1107
2208
|
);
|
|
1108
2209
|
}
|
|
1109
2210
|
/**
|
|
@@ -1111,10 +2212,10 @@ class Tt {
|
|
|
1111
2212
|
*/
|
|
1112
2213
|
parseVariableDefinition() {
|
|
1113
2214
|
return this.node(this._lexer.token, {
|
|
1114
|
-
kind:
|
|
2215
|
+
kind: I.VARIABLE_DEFINITION,
|
|
1115
2216
|
variable: this.parseVariable(),
|
|
1116
|
-
type: (this.expectToken(
|
|
1117
|
-
defaultValue: this.expectOptionalToken(
|
|
2217
|
+
type: (this.expectToken(p.COLON), this.parseTypeReference()),
|
|
2218
|
+
defaultValue: this.expectOptionalToken(p.EQUALS) ? this.parseConstValueLiteral() : void 0,
|
|
1118
2219
|
directives: this.parseConstDirectives()
|
|
1119
2220
|
});
|
|
1120
2221
|
}
|
|
@@ -1123,8 +2224,8 @@ class Tt {
|
|
|
1123
2224
|
*/
|
|
1124
2225
|
parseVariable() {
|
|
1125
2226
|
const t = this._lexer.token;
|
|
1126
|
-
return this.expectToken(
|
|
1127
|
-
kind:
|
|
2227
|
+
return this.expectToken(p.DOLLAR), this.node(t, {
|
|
2228
|
+
kind: I.VARIABLE,
|
|
1128
2229
|
name: this.parseName()
|
|
1129
2230
|
});
|
|
1130
2231
|
}
|
|
@@ -1135,11 +2236,11 @@ class Tt {
|
|
|
1135
2236
|
*/
|
|
1136
2237
|
parseSelectionSet() {
|
|
1137
2238
|
return this.node(this._lexer.token, {
|
|
1138
|
-
kind:
|
|
2239
|
+
kind: I.SELECTION_SET,
|
|
1139
2240
|
selections: this.many(
|
|
1140
|
-
|
|
2241
|
+
p.BRACE_L,
|
|
1141
2242
|
this.parseSelection,
|
|
1142
|
-
|
|
2243
|
+
p.BRACE_R
|
|
1143
2244
|
)
|
|
1144
2245
|
});
|
|
1145
2246
|
}
|
|
@@ -1150,7 +2251,7 @@ class Tt {
|
|
|
1150
2251
|
* - InlineFragment
|
|
1151
2252
|
*/
|
|
1152
2253
|
parseSelection() {
|
|
1153
|
-
return this.peek(
|
|
2254
|
+
return this.peek(p.SPREAD) ? this.parseFragment() : this.parseField();
|
|
1154
2255
|
}
|
|
1155
2256
|
/**
|
|
1156
2257
|
* Field : Alias? Name Arguments? Directives? SelectionSet?
|
|
@@ -1159,14 +2260,14 @@ class Tt {
|
|
|
1159
2260
|
*/
|
|
1160
2261
|
parseField() {
|
|
1161
2262
|
const t = this._lexer.token, n = this.parseName();
|
|
1162
|
-
let
|
|
1163
|
-
return this.expectOptionalToken(
|
|
1164
|
-
kind:
|
|
1165
|
-
alias:
|
|
1166
|
-
name:
|
|
2263
|
+
let i, r;
|
|
2264
|
+
return this.expectOptionalToken(p.COLON) ? (i = n, r = this.parseName()) : r = n, this.node(t, {
|
|
2265
|
+
kind: I.FIELD,
|
|
2266
|
+
alias: i,
|
|
2267
|
+
name: r,
|
|
1167
2268
|
arguments: this.parseArguments(!1),
|
|
1168
2269
|
directives: this.parseDirectives(!1),
|
|
1169
|
-
selectionSet: this.peek(
|
|
2270
|
+
selectionSet: this.peek(p.BRACE_L) ? this.parseSelectionSet() : void 0
|
|
1170
2271
|
});
|
|
1171
2272
|
}
|
|
1172
2273
|
/**
|
|
@@ -1174,16 +2275,16 @@ class Tt {
|
|
|
1174
2275
|
*/
|
|
1175
2276
|
parseArguments(t) {
|
|
1176
2277
|
const n = t ? this.parseConstArgument : this.parseArgument;
|
|
1177
|
-
return this.optionalMany(
|
|
2278
|
+
return this.optionalMany(p.PAREN_L, n, p.PAREN_R);
|
|
1178
2279
|
}
|
|
1179
2280
|
/**
|
|
1180
2281
|
* Argument[Const] : Name : Value[?Const]
|
|
1181
2282
|
*/
|
|
1182
2283
|
parseArgument(t = !1) {
|
|
1183
|
-
const n = this._lexer.token,
|
|
1184
|
-
return this.expectToken(
|
|
1185
|
-
kind:
|
|
1186
|
-
name:
|
|
2284
|
+
const n = this._lexer.token, i = this.parseName();
|
|
2285
|
+
return this.expectToken(p.COLON), this.node(n, {
|
|
2286
|
+
kind: I.ARGUMENT,
|
|
2287
|
+
name: i,
|
|
1187
2288
|
value: this.parseValueLiteral(t)
|
|
1188
2289
|
});
|
|
1189
2290
|
}
|
|
@@ -1200,14 +2301,14 @@ class Tt {
|
|
|
1200
2301
|
*/
|
|
1201
2302
|
parseFragment() {
|
|
1202
2303
|
const t = this._lexer.token;
|
|
1203
|
-
this.expectToken(
|
|
2304
|
+
this.expectToken(p.SPREAD);
|
|
1204
2305
|
const n = this.expectOptionalKeyword("on");
|
|
1205
|
-
return !n && this.peek(
|
|
1206
|
-
kind:
|
|
2306
|
+
return !n && this.peek(p.NAME) ? this.node(t, {
|
|
2307
|
+
kind: I.FRAGMENT_SPREAD,
|
|
1207
2308
|
name: this.parseFragmentName(),
|
|
1208
2309
|
directives: this.parseDirectives(!1)
|
|
1209
2310
|
}) : this.node(t, {
|
|
1210
|
-
kind:
|
|
2311
|
+
kind: I.INLINE_FRAGMENT,
|
|
1211
2312
|
typeCondition: n ? this.parseNamedType() : void 0,
|
|
1212
2313
|
directives: this.parseDirectives(!1),
|
|
1213
2314
|
selectionSet: this.parseSelectionSet()
|
|
@@ -1222,14 +2323,14 @@ class Tt {
|
|
|
1222
2323
|
parseFragmentDefinition() {
|
|
1223
2324
|
const t = this._lexer.token;
|
|
1224
2325
|
return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(t, {
|
|
1225
|
-
kind:
|
|
2326
|
+
kind: I.FRAGMENT_DEFINITION,
|
|
1226
2327
|
name: this.parseFragmentName(),
|
|
1227
2328
|
variableDefinitions: this.parseVariableDefinitions(),
|
|
1228
2329
|
typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
|
|
1229
2330
|
directives: this.parseDirectives(!1),
|
|
1230
2331
|
selectionSet: this.parseSelectionSet()
|
|
1231
2332
|
}) : this.node(t, {
|
|
1232
|
-
kind:
|
|
2333
|
+
kind: I.FRAGMENT_DEFINITION,
|
|
1233
2334
|
name: this.parseFragmentName(),
|
|
1234
2335
|
typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
|
|
1235
2336
|
directives: this.parseDirectives(!1),
|
|
@@ -1266,53 +2367,53 @@ class Tt {
|
|
|
1266
2367
|
parseValueLiteral(t) {
|
|
1267
2368
|
const n = this._lexer.token;
|
|
1268
2369
|
switch (n.kind) {
|
|
1269
|
-
case
|
|
2370
|
+
case p.BRACKET_L:
|
|
1270
2371
|
return this.parseList(t);
|
|
1271
|
-
case
|
|
2372
|
+
case p.BRACE_L:
|
|
1272
2373
|
return this.parseObject(t);
|
|
1273
|
-
case
|
|
2374
|
+
case p.INT:
|
|
1274
2375
|
return this.advanceLexer(), this.node(n, {
|
|
1275
|
-
kind:
|
|
2376
|
+
kind: I.INT,
|
|
1276
2377
|
value: n.value
|
|
1277
2378
|
});
|
|
1278
|
-
case
|
|
2379
|
+
case p.FLOAT:
|
|
1279
2380
|
return this.advanceLexer(), this.node(n, {
|
|
1280
|
-
kind:
|
|
2381
|
+
kind: I.FLOAT,
|
|
1281
2382
|
value: n.value
|
|
1282
2383
|
});
|
|
1283
|
-
case
|
|
1284
|
-
case
|
|
2384
|
+
case p.STRING:
|
|
2385
|
+
case p.BLOCK_STRING:
|
|
1285
2386
|
return this.parseStringLiteral();
|
|
1286
|
-
case
|
|
2387
|
+
case p.NAME:
|
|
1287
2388
|
switch (this.advanceLexer(), n.value) {
|
|
1288
2389
|
case "true":
|
|
1289
2390
|
return this.node(n, {
|
|
1290
|
-
kind:
|
|
2391
|
+
kind: I.BOOLEAN,
|
|
1291
2392
|
value: !0
|
|
1292
2393
|
});
|
|
1293
2394
|
case "false":
|
|
1294
2395
|
return this.node(n, {
|
|
1295
|
-
kind:
|
|
2396
|
+
kind: I.BOOLEAN,
|
|
1296
2397
|
value: !1
|
|
1297
2398
|
});
|
|
1298
2399
|
case "null":
|
|
1299
2400
|
return this.node(n, {
|
|
1300
|
-
kind:
|
|
2401
|
+
kind: I.NULL
|
|
1301
2402
|
});
|
|
1302
2403
|
default:
|
|
1303
2404
|
return this.node(n, {
|
|
1304
|
-
kind:
|
|
2405
|
+
kind: I.ENUM,
|
|
1305
2406
|
value: n.value
|
|
1306
2407
|
});
|
|
1307
2408
|
}
|
|
1308
|
-
case
|
|
2409
|
+
case p.DOLLAR:
|
|
1309
2410
|
if (t)
|
|
1310
|
-
if (this.expectToken(
|
|
1311
|
-
const
|
|
1312
|
-
throw
|
|
2411
|
+
if (this.expectToken(p.DOLLAR), this._lexer.token.kind === p.NAME) {
|
|
2412
|
+
const i = this._lexer.token.value;
|
|
2413
|
+
throw P(
|
|
1313
2414
|
this._lexer.source,
|
|
1314
2415
|
n.start,
|
|
1315
|
-
`Unexpected variable "$${
|
|
2416
|
+
`Unexpected variable "$${i}" in constant value.`
|
|
1316
2417
|
);
|
|
1317
2418
|
} else
|
|
1318
2419
|
throw this.unexpected(n);
|
|
@@ -1327,9 +2428,9 @@ class Tt {
|
|
|
1327
2428
|
parseStringLiteral() {
|
|
1328
2429
|
const t = this._lexer.token;
|
|
1329
2430
|
return this.advanceLexer(), this.node(t, {
|
|
1330
|
-
kind:
|
|
2431
|
+
kind: I.STRING,
|
|
1331
2432
|
value: t.value,
|
|
1332
|
-
block: t.kind ===
|
|
2433
|
+
block: t.kind === p.BLOCK_STRING
|
|
1333
2434
|
});
|
|
1334
2435
|
}
|
|
1335
2436
|
/**
|
|
@@ -1340,8 +2441,8 @@ class Tt {
|
|
|
1340
2441
|
parseList(t) {
|
|
1341
2442
|
const n = () => this.parseValueLiteral(t);
|
|
1342
2443
|
return this.node(this._lexer.token, {
|
|
1343
|
-
kind:
|
|
1344
|
-
values: this.any(
|
|
2444
|
+
kind: I.LIST,
|
|
2445
|
+
values: this.any(p.BRACKET_L, n, p.BRACKET_R)
|
|
1345
2446
|
});
|
|
1346
2447
|
}
|
|
1347
2448
|
/**
|
|
@@ -1354,18 +2455,18 @@ class Tt {
|
|
|
1354
2455
|
parseObject(t) {
|
|
1355
2456
|
const n = () => this.parseObjectField(t);
|
|
1356
2457
|
return this.node(this._lexer.token, {
|
|
1357
|
-
kind:
|
|
1358
|
-
fields: this.any(
|
|
2458
|
+
kind: I.OBJECT,
|
|
2459
|
+
fields: this.any(p.BRACE_L, n, p.BRACE_R)
|
|
1359
2460
|
});
|
|
1360
2461
|
}
|
|
1361
2462
|
/**
|
|
1362
2463
|
* ObjectField[Const] : Name : Value[?Const]
|
|
1363
2464
|
*/
|
|
1364
2465
|
parseObjectField(t) {
|
|
1365
|
-
const n = this._lexer.token,
|
|
1366
|
-
return this.expectToken(
|
|
1367
|
-
kind:
|
|
1368
|
-
name:
|
|
2466
|
+
const n = this._lexer.token, i = this.parseName();
|
|
2467
|
+
return this.expectToken(p.COLON), this.node(n, {
|
|
2468
|
+
kind: I.OBJECT_FIELD,
|
|
2469
|
+
name: i,
|
|
1369
2470
|
value: this.parseValueLiteral(t)
|
|
1370
2471
|
});
|
|
1371
2472
|
}
|
|
@@ -1375,7 +2476,7 @@ class Tt {
|
|
|
1375
2476
|
*/
|
|
1376
2477
|
parseDirectives(t) {
|
|
1377
2478
|
const n = [];
|
|
1378
|
-
for (; this.peek(
|
|
2479
|
+
for (; this.peek(p.AT); )
|
|
1379
2480
|
n.push(this.parseDirective(t));
|
|
1380
2481
|
return n;
|
|
1381
2482
|
}
|
|
@@ -1389,8 +2490,8 @@ class Tt {
|
|
|
1389
2490
|
*/
|
|
1390
2491
|
parseDirective(t) {
|
|
1391
2492
|
const n = this._lexer.token;
|
|
1392
|
-
return this.expectToken(
|
|
1393
|
-
kind:
|
|
2493
|
+
return this.expectToken(p.AT), this.node(n, {
|
|
2494
|
+
kind: I.DIRECTIVE,
|
|
1394
2495
|
name: this.parseName(),
|
|
1395
2496
|
arguments: this.parseArguments(t)
|
|
1396
2497
|
});
|
|
@@ -1405,16 +2506,16 @@ class Tt {
|
|
|
1405
2506
|
parseTypeReference() {
|
|
1406
2507
|
const t = this._lexer.token;
|
|
1407
2508
|
let n;
|
|
1408
|
-
if (this.expectOptionalToken(
|
|
1409
|
-
const
|
|
1410
|
-
this.expectToken(
|
|
1411
|
-
kind:
|
|
1412
|
-
type:
|
|
2509
|
+
if (this.expectOptionalToken(p.BRACKET_L)) {
|
|
2510
|
+
const i = this.parseTypeReference();
|
|
2511
|
+
this.expectToken(p.BRACKET_R), n = this.node(t, {
|
|
2512
|
+
kind: I.LIST_TYPE,
|
|
2513
|
+
type: i
|
|
1413
2514
|
});
|
|
1414
2515
|
} else
|
|
1415
2516
|
n = this.parseNamedType();
|
|
1416
|
-
return this.expectOptionalToken(
|
|
1417
|
-
kind:
|
|
2517
|
+
return this.expectOptionalToken(p.BANG) ? this.node(t, {
|
|
2518
|
+
kind: I.NON_NULL_TYPE,
|
|
1418
2519
|
type: n
|
|
1419
2520
|
}) : n;
|
|
1420
2521
|
}
|
|
@@ -1423,13 +2524,13 @@ class Tt {
|
|
|
1423
2524
|
*/
|
|
1424
2525
|
parseNamedType() {
|
|
1425
2526
|
return this.node(this._lexer.token, {
|
|
1426
|
-
kind:
|
|
2527
|
+
kind: I.NAMED_TYPE,
|
|
1427
2528
|
name: this.parseName()
|
|
1428
2529
|
});
|
|
1429
2530
|
}
|
|
1430
2531
|
// Implements the parsing rules in the Type Definition section.
|
|
1431
2532
|
peekDescription() {
|
|
1432
|
-
return this.peek(
|
|
2533
|
+
return this.peek(p.STRING) || this.peek(p.BLOCK_STRING);
|
|
1433
2534
|
}
|
|
1434
2535
|
/**
|
|
1435
2536
|
* Description : StringValue
|
|
@@ -1446,16 +2547,16 @@ class Tt {
|
|
|
1446
2547
|
parseSchemaDefinition() {
|
|
1447
2548
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1448
2549
|
this.expectKeyword("schema");
|
|
1449
|
-
const
|
|
1450
|
-
|
|
2550
|
+
const i = this.parseConstDirectives(), r = this.many(
|
|
2551
|
+
p.BRACE_L,
|
|
1451
2552
|
this.parseOperationTypeDefinition,
|
|
1452
|
-
|
|
2553
|
+
p.BRACE_R
|
|
1453
2554
|
);
|
|
1454
2555
|
return this.node(t, {
|
|
1455
|
-
kind:
|
|
2556
|
+
kind: I.SCHEMA_DEFINITION,
|
|
1456
2557
|
description: n,
|
|
1457
|
-
directives:
|
|
1458
|
-
operationTypes:
|
|
2558
|
+
directives: i,
|
|
2559
|
+
operationTypes: r
|
|
1459
2560
|
});
|
|
1460
2561
|
}
|
|
1461
2562
|
/**
|
|
@@ -1463,12 +2564,12 @@ class Tt {
|
|
|
1463
2564
|
*/
|
|
1464
2565
|
parseOperationTypeDefinition() {
|
|
1465
2566
|
const t = this._lexer.token, n = this.parseOperationType();
|
|
1466
|
-
this.expectToken(
|
|
1467
|
-
const
|
|
2567
|
+
this.expectToken(p.COLON);
|
|
2568
|
+
const i = this.parseNamedType();
|
|
1468
2569
|
return this.node(t, {
|
|
1469
|
-
kind:
|
|
2570
|
+
kind: I.OPERATION_TYPE_DEFINITION,
|
|
1470
2571
|
operation: n,
|
|
1471
|
-
type:
|
|
2572
|
+
type: i
|
|
1472
2573
|
});
|
|
1473
2574
|
}
|
|
1474
2575
|
/**
|
|
@@ -1477,12 +2578,12 @@ class Tt {
|
|
|
1477
2578
|
parseScalarTypeDefinition() {
|
|
1478
2579
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1479
2580
|
this.expectKeyword("scalar");
|
|
1480
|
-
const
|
|
2581
|
+
const i = this.parseName(), r = this.parseConstDirectives();
|
|
1481
2582
|
return this.node(t, {
|
|
1482
|
-
kind:
|
|
2583
|
+
kind: I.SCALAR_TYPE_DEFINITION,
|
|
1483
2584
|
description: n,
|
|
1484
|
-
name:
|
|
1485
|
-
directives:
|
|
2585
|
+
name: i,
|
|
2586
|
+
directives: r
|
|
1486
2587
|
});
|
|
1487
2588
|
}
|
|
1488
2589
|
/**
|
|
@@ -1493,14 +2594,14 @@ class Tt {
|
|
|
1493
2594
|
parseObjectTypeDefinition() {
|
|
1494
2595
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1495
2596
|
this.expectKeyword("type");
|
|
1496
|
-
const
|
|
2597
|
+
const i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
|
|
1497
2598
|
return this.node(t, {
|
|
1498
|
-
kind:
|
|
2599
|
+
kind: I.OBJECT_TYPE_DEFINITION,
|
|
1499
2600
|
description: n,
|
|
1500
|
-
name:
|
|
1501
|
-
interfaces:
|
|
2601
|
+
name: i,
|
|
2602
|
+
interfaces: r,
|
|
1502
2603
|
directives: s,
|
|
1503
|
-
fields:
|
|
2604
|
+
fields: o
|
|
1504
2605
|
});
|
|
1505
2606
|
}
|
|
1506
2607
|
/**
|
|
@@ -1509,7 +2610,7 @@ class Tt {
|
|
|
1509
2610
|
* - ImplementsInterfaces & NamedType
|
|
1510
2611
|
*/
|
|
1511
2612
|
parseImplementsInterfaces() {
|
|
1512
|
-
return this.expectOptionalKeyword("implements") ? this.delimitedMany(
|
|
2613
|
+
return this.expectOptionalKeyword("implements") ? this.delimitedMany(p.AMP, this.parseNamedType) : [];
|
|
1513
2614
|
}
|
|
1514
2615
|
/**
|
|
1515
2616
|
* ```
|
|
@@ -1518,9 +2619,9 @@ class Tt {
|
|
|
1518
2619
|
*/
|
|
1519
2620
|
parseFieldsDefinition() {
|
|
1520
2621
|
return this.optionalMany(
|
|
1521
|
-
|
|
2622
|
+
p.BRACE_L,
|
|
1522
2623
|
this.parseFieldDefinition,
|
|
1523
|
-
|
|
2624
|
+
p.BRACE_R
|
|
1524
2625
|
);
|
|
1525
2626
|
}
|
|
1526
2627
|
/**
|
|
@@ -1528,16 +2629,16 @@ class Tt {
|
|
|
1528
2629
|
* - Description? Name ArgumentsDefinition? : Type Directives[Const]?
|
|
1529
2630
|
*/
|
|
1530
2631
|
parseFieldDefinition() {
|
|
1531
|
-
const t = this._lexer.token, n = this.parseDescription(),
|
|
1532
|
-
this.expectToken(
|
|
1533
|
-
const s = this.parseTypeReference(),
|
|
2632
|
+
const t = this._lexer.token, n = this.parseDescription(), i = this.parseName(), r = this.parseArgumentDefs();
|
|
2633
|
+
this.expectToken(p.COLON);
|
|
2634
|
+
const s = this.parseTypeReference(), o = this.parseConstDirectives();
|
|
1534
2635
|
return this.node(t, {
|
|
1535
|
-
kind:
|
|
2636
|
+
kind: I.FIELD_DEFINITION,
|
|
1536
2637
|
description: n,
|
|
1537
|
-
name:
|
|
1538
|
-
arguments:
|
|
2638
|
+
name: i,
|
|
2639
|
+
arguments: r,
|
|
1539
2640
|
type: s,
|
|
1540
|
-
directives:
|
|
2641
|
+
directives: o
|
|
1541
2642
|
});
|
|
1542
2643
|
}
|
|
1543
2644
|
/**
|
|
@@ -1545,9 +2646,9 @@ class Tt {
|
|
|
1545
2646
|
*/
|
|
1546
2647
|
parseArgumentDefs() {
|
|
1547
2648
|
return this.optionalMany(
|
|
1548
|
-
|
|
2649
|
+
p.PAREN_L,
|
|
1549
2650
|
this.parseInputValueDef,
|
|
1550
|
-
|
|
2651
|
+
p.PAREN_R
|
|
1551
2652
|
);
|
|
1552
2653
|
}
|
|
1553
2654
|
/**
|
|
@@ -1555,19 +2656,19 @@ class Tt {
|
|
|
1555
2656
|
* - Description? Name : Type DefaultValue? Directives[Const]?
|
|
1556
2657
|
*/
|
|
1557
2658
|
parseInputValueDef() {
|
|
1558
|
-
const t = this._lexer.token, n = this.parseDescription(),
|
|
1559
|
-
this.expectToken(
|
|
1560
|
-
const
|
|
2659
|
+
const t = this._lexer.token, n = this.parseDescription(), i = this.parseName();
|
|
2660
|
+
this.expectToken(p.COLON);
|
|
2661
|
+
const r = this.parseTypeReference();
|
|
1561
2662
|
let s;
|
|
1562
|
-
this.expectOptionalToken(
|
|
1563
|
-
const
|
|
2663
|
+
this.expectOptionalToken(p.EQUALS) && (s = this.parseConstValueLiteral());
|
|
2664
|
+
const o = this.parseConstDirectives();
|
|
1564
2665
|
return this.node(t, {
|
|
1565
|
-
kind:
|
|
2666
|
+
kind: I.INPUT_VALUE_DEFINITION,
|
|
1566
2667
|
description: n,
|
|
1567
|
-
name:
|
|
1568
|
-
type:
|
|
2668
|
+
name: i,
|
|
2669
|
+
type: r,
|
|
1569
2670
|
defaultValue: s,
|
|
1570
|
-
directives:
|
|
2671
|
+
directives: o
|
|
1571
2672
|
});
|
|
1572
2673
|
}
|
|
1573
2674
|
/**
|
|
@@ -1577,14 +2678,14 @@ class Tt {
|
|
|
1577
2678
|
parseInterfaceTypeDefinition() {
|
|
1578
2679
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1579
2680
|
this.expectKeyword("interface");
|
|
1580
|
-
const
|
|
2681
|
+
const i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
|
|
1581
2682
|
return this.node(t, {
|
|
1582
|
-
kind:
|
|
2683
|
+
kind: I.INTERFACE_TYPE_DEFINITION,
|
|
1583
2684
|
description: n,
|
|
1584
|
-
name:
|
|
1585
|
-
interfaces:
|
|
2685
|
+
name: i,
|
|
2686
|
+
interfaces: r,
|
|
1586
2687
|
directives: s,
|
|
1587
|
-
fields:
|
|
2688
|
+
fields: o
|
|
1588
2689
|
});
|
|
1589
2690
|
}
|
|
1590
2691
|
/**
|
|
@@ -1594,12 +2695,12 @@ class Tt {
|
|
|
1594
2695
|
parseUnionTypeDefinition() {
|
|
1595
2696
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1596
2697
|
this.expectKeyword("union");
|
|
1597
|
-
const
|
|
2698
|
+
const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
|
|
1598
2699
|
return this.node(t, {
|
|
1599
|
-
kind:
|
|
2700
|
+
kind: I.UNION_TYPE_DEFINITION,
|
|
1600
2701
|
description: n,
|
|
1601
|
-
name:
|
|
1602
|
-
directives:
|
|
2702
|
+
name: i,
|
|
2703
|
+
directives: r,
|
|
1603
2704
|
types: s
|
|
1604
2705
|
});
|
|
1605
2706
|
}
|
|
@@ -1609,7 +2710,7 @@ class Tt {
|
|
|
1609
2710
|
* - UnionMemberTypes | NamedType
|
|
1610
2711
|
*/
|
|
1611
2712
|
parseUnionMemberTypes() {
|
|
1612
|
-
return this.expectOptionalToken(
|
|
2713
|
+
return this.expectOptionalToken(p.EQUALS) ? this.delimitedMany(p.PIPE, this.parseNamedType) : [];
|
|
1613
2714
|
}
|
|
1614
2715
|
/**
|
|
1615
2716
|
* EnumTypeDefinition :
|
|
@@ -1618,12 +2719,12 @@ class Tt {
|
|
|
1618
2719
|
parseEnumTypeDefinition() {
|
|
1619
2720
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1620
2721
|
this.expectKeyword("enum");
|
|
1621
|
-
const
|
|
2722
|
+
const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
|
|
1622
2723
|
return this.node(t, {
|
|
1623
|
-
kind:
|
|
2724
|
+
kind: I.ENUM_TYPE_DEFINITION,
|
|
1624
2725
|
description: n,
|
|
1625
|
-
name:
|
|
1626
|
-
directives:
|
|
2726
|
+
name: i,
|
|
2727
|
+
directives: r,
|
|
1627
2728
|
values: s
|
|
1628
2729
|
});
|
|
1629
2730
|
}
|
|
@@ -1634,21 +2735,21 @@ class Tt {
|
|
|
1634
2735
|
*/
|
|
1635
2736
|
parseEnumValuesDefinition() {
|
|
1636
2737
|
return this.optionalMany(
|
|
1637
|
-
|
|
2738
|
+
p.BRACE_L,
|
|
1638
2739
|
this.parseEnumValueDefinition,
|
|
1639
|
-
|
|
2740
|
+
p.BRACE_R
|
|
1640
2741
|
);
|
|
1641
2742
|
}
|
|
1642
2743
|
/**
|
|
1643
2744
|
* EnumValueDefinition : Description? EnumValue Directives[Const]?
|
|
1644
2745
|
*/
|
|
1645
2746
|
parseEnumValueDefinition() {
|
|
1646
|
-
const t = this._lexer.token, n = this.parseDescription(),
|
|
2747
|
+
const t = this._lexer.token, n = this.parseDescription(), i = this.parseEnumValueName(), r = this.parseConstDirectives();
|
|
1647
2748
|
return this.node(t, {
|
|
1648
|
-
kind:
|
|
2749
|
+
kind: I.ENUM_VALUE_DEFINITION,
|
|
1649
2750
|
description: n,
|
|
1650
|
-
name:
|
|
1651
|
-
directives:
|
|
2751
|
+
name: i,
|
|
2752
|
+
directives: r
|
|
1652
2753
|
});
|
|
1653
2754
|
}
|
|
1654
2755
|
/**
|
|
@@ -1656,10 +2757,10 @@ class Tt {
|
|
|
1656
2757
|
*/
|
|
1657
2758
|
parseEnumValueName() {
|
|
1658
2759
|
if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null")
|
|
1659
|
-
throw
|
|
2760
|
+
throw P(
|
|
1660
2761
|
this._lexer.source,
|
|
1661
2762
|
this._lexer.token.start,
|
|
1662
|
-
`${
|
|
2763
|
+
`${ye(
|
|
1663
2764
|
this._lexer.token
|
|
1664
2765
|
)} is reserved and cannot be used for an enum value.`
|
|
1665
2766
|
);
|
|
@@ -1672,12 +2773,12 @@ class Tt {
|
|
|
1672
2773
|
parseInputObjectTypeDefinition() {
|
|
1673
2774
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1674
2775
|
this.expectKeyword("input");
|
|
1675
|
-
const
|
|
2776
|
+
const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
|
|
1676
2777
|
return this.node(t, {
|
|
1677
|
-
kind:
|
|
2778
|
+
kind: I.INPUT_OBJECT_TYPE_DEFINITION,
|
|
1678
2779
|
description: n,
|
|
1679
|
-
name:
|
|
1680
|
-
directives:
|
|
2780
|
+
name: i,
|
|
2781
|
+
directives: r,
|
|
1681
2782
|
fields: s
|
|
1682
2783
|
});
|
|
1683
2784
|
}
|
|
@@ -1688,9 +2789,9 @@ class Tt {
|
|
|
1688
2789
|
*/
|
|
1689
2790
|
parseInputFieldsDefinition() {
|
|
1690
2791
|
return this.optionalMany(
|
|
1691
|
-
|
|
2792
|
+
p.BRACE_L,
|
|
1692
2793
|
this.parseInputValueDef,
|
|
1693
|
-
|
|
2794
|
+
p.BRACE_R
|
|
1694
2795
|
);
|
|
1695
2796
|
}
|
|
1696
2797
|
/**
|
|
@@ -1708,7 +2809,7 @@ class Tt {
|
|
|
1708
2809
|
*/
|
|
1709
2810
|
parseTypeSystemExtension() {
|
|
1710
2811
|
const t = this._lexer.lookahead();
|
|
1711
|
-
if (t.kind ===
|
|
2812
|
+
if (t.kind === p.NAME)
|
|
1712
2813
|
switch (t.value) {
|
|
1713
2814
|
case "schema":
|
|
1714
2815
|
return this.parseSchemaExtension();
|
|
@@ -1737,17 +2838,17 @@ class Tt {
|
|
|
1737
2838
|
parseSchemaExtension() {
|
|
1738
2839
|
const t = this._lexer.token;
|
|
1739
2840
|
this.expectKeyword("extend"), this.expectKeyword("schema");
|
|
1740
|
-
const n = this.parseConstDirectives(),
|
|
1741
|
-
|
|
2841
|
+
const n = this.parseConstDirectives(), i = this.optionalMany(
|
|
2842
|
+
p.BRACE_L,
|
|
1742
2843
|
this.parseOperationTypeDefinition,
|
|
1743
|
-
|
|
2844
|
+
p.BRACE_R
|
|
1744
2845
|
);
|
|
1745
|
-
if (n.length === 0 &&
|
|
2846
|
+
if (n.length === 0 && i.length === 0)
|
|
1746
2847
|
throw this.unexpected();
|
|
1747
2848
|
return this.node(t, {
|
|
1748
|
-
kind:
|
|
2849
|
+
kind: I.SCHEMA_EXTENSION,
|
|
1749
2850
|
directives: n,
|
|
1750
|
-
operationTypes:
|
|
2851
|
+
operationTypes: i
|
|
1751
2852
|
});
|
|
1752
2853
|
}
|
|
1753
2854
|
/**
|
|
@@ -1757,13 +2858,13 @@ class Tt {
|
|
|
1757
2858
|
parseScalarTypeExtension() {
|
|
1758
2859
|
const t = this._lexer.token;
|
|
1759
2860
|
this.expectKeyword("extend"), this.expectKeyword("scalar");
|
|
1760
|
-
const n = this.parseName(),
|
|
1761
|
-
if (
|
|
2861
|
+
const n = this.parseName(), i = this.parseConstDirectives();
|
|
2862
|
+
if (i.length === 0)
|
|
1762
2863
|
throw this.unexpected();
|
|
1763
2864
|
return this.node(t, {
|
|
1764
|
-
kind:
|
|
2865
|
+
kind: I.SCALAR_TYPE_EXTENSION,
|
|
1765
2866
|
name: n,
|
|
1766
|
-
directives:
|
|
2867
|
+
directives: i
|
|
1767
2868
|
});
|
|
1768
2869
|
}
|
|
1769
2870
|
/**
|
|
@@ -1775,14 +2876,14 @@ class Tt {
|
|
|
1775
2876
|
parseObjectTypeExtension() {
|
|
1776
2877
|
const t = this._lexer.token;
|
|
1777
2878
|
this.expectKeyword("extend"), this.expectKeyword("type");
|
|
1778
|
-
const n = this.parseName(),
|
|
1779
|
-
if (
|
|
2879
|
+
const n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
|
|
2880
|
+
if (i.length === 0 && r.length === 0 && s.length === 0)
|
|
1780
2881
|
throw this.unexpected();
|
|
1781
2882
|
return this.node(t, {
|
|
1782
|
-
kind:
|
|
2883
|
+
kind: I.OBJECT_TYPE_EXTENSION,
|
|
1783
2884
|
name: n,
|
|
1784
|
-
interfaces:
|
|
1785
|
-
directives:
|
|
2885
|
+
interfaces: i,
|
|
2886
|
+
directives: r,
|
|
1786
2887
|
fields: s
|
|
1787
2888
|
});
|
|
1788
2889
|
}
|
|
@@ -1795,14 +2896,14 @@ class Tt {
|
|
|
1795
2896
|
parseInterfaceTypeExtension() {
|
|
1796
2897
|
const t = this._lexer.token;
|
|
1797
2898
|
this.expectKeyword("extend"), this.expectKeyword("interface");
|
|
1798
|
-
const n = this.parseName(),
|
|
1799
|
-
if (
|
|
2899
|
+
const n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
|
|
2900
|
+
if (i.length === 0 && r.length === 0 && s.length === 0)
|
|
1800
2901
|
throw this.unexpected();
|
|
1801
2902
|
return this.node(t, {
|
|
1802
|
-
kind:
|
|
2903
|
+
kind: I.INTERFACE_TYPE_EXTENSION,
|
|
1803
2904
|
name: n,
|
|
1804
|
-
interfaces:
|
|
1805
|
-
directives:
|
|
2905
|
+
interfaces: i,
|
|
2906
|
+
directives: r,
|
|
1806
2907
|
fields: s
|
|
1807
2908
|
});
|
|
1808
2909
|
}
|
|
@@ -1814,14 +2915,14 @@ class Tt {
|
|
|
1814
2915
|
parseUnionTypeExtension() {
|
|
1815
2916
|
const t = this._lexer.token;
|
|
1816
2917
|
this.expectKeyword("extend"), this.expectKeyword("union");
|
|
1817
|
-
const n = this.parseName(),
|
|
1818
|
-
if (
|
|
2918
|
+
const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseUnionMemberTypes();
|
|
2919
|
+
if (i.length === 0 && r.length === 0)
|
|
1819
2920
|
throw this.unexpected();
|
|
1820
2921
|
return this.node(t, {
|
|
1821
|
-
kind:
|
|
2922
|
+
kind: I.UNION_TYPE_EXTENSION,
|
|
1822
2923
|
name: n,
|
|
1823
|
-
directives:
|
|
1824
|
-
types:
|
|
2924
|
+
directives: i,
|
|
2925
|
+
types: r
|
|
1825
2926
|
});
|
|
1826
2927
|
}
|
|
1827
2928
|
/**
|
|
@@ -1832,14 +2933,14 @@ class Tt {
|
|
|
1832
2933
|
parseEnumTypeExtension() {
|
|
1833
2934
|
const t = this._lexer.token;
|
|
1834
2935
|
this.expectKeyword("extend"), this.expectKeyword("enum");
|
|
1835
|
-
const n = this.parseName(),
|
|
1836
|
-
if (
|
|
2936
|
+
const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseEnumValuesDefinition();
|
|
2937
|
+
if (i.length === 0 && r.length === 0)
|
|
1837
2938
|
throw this.unexpected();
|
|
1838
2939
|
return this.node(t, {
|
|
1839
|
-
kind:
|
|
2940
|
+
kind: I.ENUM_TYPE_EXTENSION,
|
|
1840
2941
|
name: n,
|
|
1841
|
-
directives:
|
|
1842
|
-
values:
|
|
2942
|
+
directives: i,
|
|
2943
|
+
values: r
|
|
1843
2944
|
});
|
|
1844
2945
|
}
|
|
1845
2946
|
/**
|
|
@@ -1850,14 +2951,14 @@ class Tt {
|
|
|
1850
2951
|
parseInputObjectTypeExtension() {
|
|
1851
2952
|
const t = this._lexer.token;
|
|
1852
2953
|
this.expectKeyword("extend"), this.expectKeyword("input");
|
|
1853
|
-
const n = this.parseName(),
|
|
1854
|
-
if (
|
|
2954
|
+
const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseInputFieldsDefinition();
|
|
2955
|
+
if (i.length === 0 && r.length === 0)
|
|
1855
2956
|
throw this.unexpected();
|
|
1856
2957
|
return this.node(t, {
|
|
1857
|
-
kind:
|
|
2958
|
+
kind: I.INPUT_OBJECT_TYPE_EXTENSION,
|
|
1858
2959
|
name: n,
|
|
1859
|
-
directives:
|
|
1860
|
-
fields:
|
|
2960
|
+
directives: i,
|
|
2961
|
+
fields: r
|
|
1861
2962
|
});
|
|
1862
2963
|
}
|
|
1863
2964
|
/**
|
|
@@ -1868,17 +2969,17 @@ class Tt {
|
|
|
1868
2969
|
*/
|
|
1869
2970
|
parseDirectiveDefinition() {
|
|
1870
2971
|
const t = this._lexer.token, n = this.parseDescription();
|
|
1871
|
-
this.expectKeyword("directive"), this.expectToken(
|
|
1872
|
-
const
|
|
2972
|
+
this.expectKeyword("directive"), this.expectToken(p.AT);
|
|
2973
|
+
const i = this.parseName(), r = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
|
|
1873
2974
|
this.expectKeyword("on");
|
|
1874
|
-
const
|
|
2975
|
+
const o = this.parseDirectiveLocations();
|
|
1875
2976
|
return this.node(t, {
|
|
1876
|
-
kind:
|
|
2977
|
+
kind: I.DIRECTIVE_DEFINITION,
|
|
1877
2978
|
description: n,
|
|
1878
|
-
name:
|
|
1879
|
-
arguments:
|
|
2979
|
+
name: i,
|
|
2980
|
+
arguments: r,
|
|
1880
2981
|
repeatable: s,
|
|
1881
|
-
locations:
|
|
2982
|
+
locations: o
|
|
1882
2983
|
});
|
|
1883
2984
|
}
|
|
1884
2985
|
/**
|
|
@@ -1887,7 +2988,7 @@ class Tt {
|
|
|
1887
2988
|
* - DirectiveLocations | DirectiveLocation
|
|
1888
2989
|
*/
|
|
1889
2990
|
parseDirectiveLocations() {
|
|
1890
|
-
return this.delimitedMany(
|
|
2991
|
+
return this.delimitedMany(p.PIPE, this.parseDirectiveLocation);
|
|
1891
2992
|
}
|
|
1892
2993
|
/*
|
|
1893
2994
|
* DirectiveLocation :
|
|
@@ -1918,7 +3019,7 @@ class Tt {
|
|
|
1918
3019
|
*/
|
|
1919
3020
|
parseDirectiveLocation() {
|
|
1920
3021
|
const t = this._lexer.token, n = this.parseName();
|
|
1921
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
3022
|
+
if (Object.prototype.hasOwnProperty.call(He, n.value))
|
|
1922
3023
|
return n;
|
|
1923
3024
|
throw this.unexpected(t);
|
|
1924
3025
|
}
|
|
@@ -1929,7 +3030,7 @@ class Tt {
|
|
|
1929
3030
|
* given parsed object.
|
|
1930
3031
|
*/
|
|
1931
3032
|
node(t, n) {
|
|
1932
|
-
return this._options.noLocation !== !0 && (n.loc = new
|
|
3033
|
+
return this._options.noLocation !== !0 && (n.loc = new Rn(
|
|
1933
3034
|
t,
|
|
1934
3035
|
this._lexer.lastToken,
|
|
1935
3036
|
this._lexer.source
|
|
@@ -1949,10 +3050,10 @@ class Tt {
|
|
|
1949
3050
|
const n = this._lexer.token;
|
|
1950
3051
|
if (n.kind === t)
|
|
1951
3052
|
return this.advanceLexer(), n;
|
|
1952
|
-
throw
|
|
3053
|
+
throw P(
|
|
1953
3054
|
this._lexer.source,
|
|
1954
3055
|
n.start,
|
|
1955
|
-
`Expected ${
|
|
3056
|
+
`Expected ${bt(t)}, found ${ye(n)}.`
|
|
1956
3057
|
);
|
|
1957
3058
|
}
|
|
1958
3059
|
/**
|
|
@@ -1968,13 +3069,13 @@ class Tt {
|
|
|
1968
3069
|
*/
|
|
1969
3070
|
expectKeyword(t) {
|
|
1970
3071
|
const n = this._lexer.token;
|
|
1971
|
-
if (n.kind ===
|
|
3072
|
+
if (n.kind === p.NAME && n.value === t)
|
|
1972
3073
|
this.advanceLexer();
|
|
1973
3074
|
else
|
|
1974
|
-
throw
|
|
3075
|
+
throw P(
|
|
1975
3076
|
this._lexer.source,
|
|
1976
3077
|
n.start,
|
|
1977
|
-
`Expected "${t}", found ${
|
|
3078
|
+
`Expected "${t}", found ${ye(n)}.`
|
|
1978
3079
|
);
|
|
1979
3080
|
}
|
|
1980
3081
|
/**
|
|
@@ -1983,17 +3084,17 @@ class Tt {
|
|
|
1983
3084
|
*/
|
|
1984
3085
|
expectOptionalKeyword(t) {
|
|
1985
3086
|
const n = this._lexer.token;
|
|
1986
|
-
return n.kind ===
|
|
3087
|
+
return n.kind === p.NAME && n.value === t ? (this.advanceLexer(), !0) : !1;
|
|
1987
3088
|
}
|
|
1988
3089
|
/**
|
|
1989
3090
|
* Helper function for creating an error when an unexpected lexed token is encountered.
|
|
1990
3091
|
*/
|
|
1991
3092
|
unexpected(t) {
|
|
1992
3093
|
const n = t ?? this._lexer.token;
|
|
1993
|
-
return
|
|
3094
|
+
return P(
|
|
1994
3095
|
this._lexer.source,
|
|
1995
3096
|
n.start,
|
|
1996
|
-
`Unexpected ${
|
|
3097
|
+
`Unexpected ${ye(n)}.`
|
|
1997
3098
|
);
|
|
1998
3099
|
}
|
|
1999
3100
|
/**
|
|
@@ -2001,12 +3102,12 @@ class Tt {
|
|
|
2001
3102
|
* This list begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
2002
3103
|
* Advances the parser to the next lex token after the closing token.
|
|
2003
3104
|
*/
|
|
2004
|
-
any(t, n,
|
|
3105
|
+
any(t, n, i) {
|
|
2005
3106
|
this.expectToken(t);
|
|
2006
|
-
const
|
|
2007
|
-
for (; !this.expectOptionalToken(
|
|
2008
|
-
|
|
2009
|
-
return
|
|
3107
|
+
const r = [];
|
|
3108
|
+
for (; !this.expectOptionalToken(i); )
|
|
3109
|
+
r.push(n.call(this));
|
|
3110
|
+
return r;
|
|
2010
3111
|
}
|
|
2011
3112
|
/**
|
|
2012
3113
|
* Returns a list of parse nodes, determined by the parseFn.
|
|
@@ -2014,13 +3115,13 @@ class Tt {
|
|
|
2014
3115
|
* that begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
2015
3116
|
* Advances the parser to the next lex token after the closing token.
|
|
2016
3117
|
*/
|
|
2017
|
-
optionalMany(t, n,
|
|
3118
|
+
optionalMany(t, n, i) {
|
|
2018
3119
|
if (this.expectOptionalToken(t)) {
|
|
2019
|
-
const
|
|
3120
|
+
const r = [];
|
|
2020
3121
|
do
|
|
2021
|
-
|
|
2022
|
-
while (!this.expectOptionalToken(
|
|
2023
|
-
return
|
|
3122
|
+
r.push(n.call(this));
|
|
3123
|
+
while (!this.expectOptionalToken(i));
|
|
3124
|
+
return r;
|
|
2024
3125
|
}
|
|
2025
3126
|
return [];
|
|
2026
3127
|
}
|
|
@@ -2029,13 +3130,13 @@ class Tt {
|
|
|
2029
3130
|
* This list begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
2030
3131
|
* Advances the parser to the next lex token after the closing token.
|
|
2031
3132
|
*/
|
|
2032
|
-
many(t, n,
|
|
3133
|
+
many(t, n, i) {
|
|
2033
3134
|
this.expectToken(t);
|
|
2034
|
-
const
|
|
3135
|
+
const r = [];
|
|
2035
3136
|
do
|
|
2036
|
-
|
|
2037
|
-
while (!this.expectOptionalToken(
|
|
2038
|
-
return
|
|
3137
|
+
r.push(n.call(this));
|
|
3138
|
+
while (!this.expectOptionalToken(i));
|
|
3139
|
+
return r;
|
|
2039
3140
|
}
|
|
2040
3141
|
/**
|
|
2041
3142
|
* Returns a non-empty list of parse nodes, determined by the parseFn.
|
|
@@ -2044,37 +3145,37 @@ class Tt {
|
|
|
2044
3145
|
*/
|
|
2045
3146
|
delimitedMany(t, n) {
|
|
2046
3147
|
this.expectOptionalToken(t);
|
|
2047
|
-
const
|
|
3148
|
+
const i = [];
|
|
2048
3149
|
do
|
|
2049
|
-
|
|
3150
|
+
i.push(n.call(this));
|
|
2050
3151
|
while (this.expectOptionalToken(t));
|
|
2051
|
-
return
|
|
3152
|
+
return i;
|
|
2052
3153
|
}
|
|
2053
3154
|
advanceLexer() {
|
|
2054
3155
|
const { maxTokens: t } = this._options, n = this._lexer.advance();
|
|
2055
|
-
if (t !== void 0 && n.kind !==
|
|
2056
|
-
throw
|
|
3156
|
+
if (t !== void 0 && n.kind !== p.EOF && (++this._tokenCounter, this._tokenCounter > t))
|
|
3157
|
+
throw P(
|
|
2057
3158
|
this._lexer.source,
|
|
2058
3159
|
n.start,
|
|
2059
3160
|
`Document contains more that ${t} tokens. Parsing aborted.`
|
|
2060
3161
|
);
|
|
2061
3162
|
}
|
|
2062
3163
|
}
|
|
2063
|
-
function
|
|
3164
|
+
function ye(e) {
|
|
2064
3165
|
const t = e.value;
|
|
2065
|
-
return
|
|
3166
|
+
return bt(e.kind) + (t != null ? ` "${t}"` : "");
|
|
2066
3167
|
}
|
|
2067
|
-
function
|
|
2068
|
-
return
|
|
3168
|
+
function bt(e) {
|
|
3169
|
+
return qn(e) ? `"${e}"` : e;
|
|
2069
3170
|
}
|
|
2070
|
-
function
|
|
2071
|
-
return `"${e.replace(
|
|
3171
|
+
function oi(e) {
|
|
3172
|
+
return `"${e.replace(ai, ci)}"`;
|
|
2072
3173
|
}
|
|
2073
|
-
const
|
|
2074
|
-
function
|
|
2075
|
-
return
|
|
3174
|
+
const ai = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
|
|
3175
|
+
function ci(e) {
|
|
3176
|
+
return ui[e.charCodeAt(0)];
|
|
2076
3177
|
}
|
|
2077
|
-
const
|
|
3178
|
+
const ui = [
|
|
2078
3179
|
"\\u0000",
|
|
2079
3180
|
"\\u0001",
|
|
2080
3181
|
"\\u0002",
|
|
@@ -2240,75 +3341,75 @@ const At = [
|
|
|
2240
3341
|
"\\u009D",
|
|
2241
3342
|
"\\u009E",
|
|
2242
3343
|
"\\u009F"
|
|
2243
|
-
],
|
|
2244
|
-
function
|
|
2245
|
-
const
|
|
2246
|
-
for (const
|
|
2247
|
-
|
|
2248
|
-
let
|
|
2249
|
-
const
|
|
3344
|
+
], li = Object.freeze({});
|
|
3345
|
+
function fi(e, t, n = vt) {
|
|
3346
|
+
const i = /* @__PURE__ */ new Map();
|
|
3347
|
+
for (const b of Object.values(I))
|
|
3348
|
+
i.set(b, hi(t, b));
|
|
3349
|
+
let r, s = Array.isArray(e), o = [e], a = -1, u = [], c = e, l, f;
|
|
3350
|
+
const h = [], E = [];
|
|
2250
3351
|
do {
|
|
2251
|
-
|
|
2252
|
-
const
|
|
2253
|
-
if (
|
|
2254
|
-
if (
|
|
3352
|
+
a++;
|
|
3353
|
+
const b = a === o.length, U = b && u.length !== 0;
|
|
3354
|
+
if (b) {
|
|
3355
|
+
if (l = E.length === 0 ? void 0 : h[h.length - 1], c = f, f = E.pop(), U)
|
|
2255
3356
|
if (s) {
|
|
2256
|
-
|
|
2257
|
-
let
|
|
2258
|
-
for (const [
|
|
2259
|
-
const
|
|
2260
|
-
|
|
3357
|
+
c = c.slice();
|
|
3358
|
+
let S = 0;
|
|
3359
|
+
for (const [G, j] of u) {
|
|
3360
|
+
const Q = G - S;
|
|
3361
|
+
j === null ? (c.splice(Q, 1), S++) : c[Q] = j;
|
|
2261
3362
|
}
|
|
2262
3363
|
} else {
|
|
2263
|
-
|
|
3364
|
+
c = Object.defineProperties(
|
|
2264
3365
|
{},
|
|
2265
|
-
Object.getOwnPropertyDescriptors(
|
|
3366
|
+
Object.getOwnPropertyDescriptors(c)
|
|
2266
3367
|
);
|
|
2267
|
-
for (const [
|
|
2268
|
-
|
|
3368
|
+
for (const [S, G] of u)
|
|
3369
|
+
c[S] = G;
|
|
2269
3370
|
}
|
|
2270
|
-
|
|
2271
|
-
} else if (
|
|
2272
|
-
if (
|
|
3371
|
+
a = r.index, o = r.keys, u = r.edits, s = r.inArray, r = r.prev;
|
|
3372
|
+
} else if (f) {
|
|
3373
|
+
if (l = s ? a : o[a], c = f[l], c == null)
|
|
2273
3374
|
continue;
|
|
2274
|
-
|
|
3375
|
+
h.push(l);
|
|
2275
3376
|
}
|
|
2276
|
-
let
|
|
2277
|
-
if (!Array.isArray(
|
|
2278
|
-
var
|
|
2279
|
-
|
|
2280
|
-
const
|
|
2281
|
-
if (
|
|
3377
|
+
let _;
|
|
3378
|
+
if (!Array.isArray(c)) {
|
|
3379
|
+
var N, y;
|
|
3380
|
+
nt(c) || we(!1, `Invalid AST Node: ${Ze(c)}.`);
|
|
3381
|
+
const S = b ? (N = i.get(c.kind)) === null || N === void 0 ? void 0 : N.leave : (y = i.get(c.kind)) === null || y === void 0 ? void 0 : y.enter;
|
|
3382
|
+
if (_ = S == null ? void 0 : S.call(t, c, l, f, h, E), _ === li)
|
|
2282
3383
|
break;
|
|
2283
|
-
if (
|
|
2284
|
-
if (!
|
|
2285
|
-
|
|
3384
|
+
if (_ === !1) {
|
|
3385
|
+
if (!b) {
|
|
3386
|
+
h.pop();
|
|
2286
3387
|
continue;
|
|
2287
3388
|
}
|
|
2288
|
-
} else if (
|
|
2289
|
-
if (
|
|
2290
|
-
|
|
3389
|
+
} else if (_ !== void 0 && (u.push([l, _]), !b))
|
|
3390
|
+
if (nt(_))
|
|
3391
|
+
c = _;
|
|
2291
3392
|
else {
|
|
2292
|
-
|
|
3393
|
+
h.pop();
|
|
2293
3394
|
continue;
|
|
2294
3395
|
}
|
|
2295
3396
|
}
|
|
2296
|
-
if (
|
|
2297
|
-
|
|
3397
|
+
if (_ === void 0 && U && u.push([l, c]), b)
|
|
3398
|
+
h.pop();
|
|
2298
3399
|
else {
|
|
2299
|
-
var
|
|
2300
|
-
|
|
3400
|
+
var x;
|
|
3401
|
+
r = {
|
|
2301
3402
|
inArray: s,
|
|
2302
|
-
index:
|
|
2303
|
-
keys:
|
|
2304
|
-
edits:
|
|
2305
|
-
prev:
|
|
2306
|
-
}, s = Array.isArray(
|
|
3403
|
+
index: a,
|
|
3404
|
+
keys: o,
|
|
3405
|
+
edits: u,
|
|
3406
|
+
prev: r
|
|
3407
|
+
}, s = Array.isArray(c), o = s ? c : (x = n[c.kind]) !== null && x !== void 0 ? x : [], a = -1, u = [], f && E.push(f), f = c;
|
|
2307
3408
|
}
|
|
2308
|
-
} while (
|
|
2309
|
-
return
|
|
3409
|
+
} while (r !== void 0);
|
|
3410
|
+
return u.length !== 0 ? u[u.length - 1][1] : e;
|
|
2310
3411
|
}
|
|
2311
|
-
function
|
|
3412
|
+
function hi(e, t) {
|
|
2312
3413
|
const n = e[t];
|
|
2313
3414
|
return typeof n == "object" ? n : typeof n == "function" ? {
|
|
2314
3415
|
enter: n,
|
|
@@ -2318,10 +3419,10 @@ function Ot(e, t) {
|
|
|
2318
3419
|
leave: e.leave
|
|
2319
3420
|
};
|
|
2320
3421
|
}
|
|
2321
|
-
function
|
|
2322
|
-
return
|
|
3422
|
+
function di(e) {
|
|
3423
|
+
return fi(e, mi);
|
|
2323
3424
|
}
|
|
2324
|
-
const
|
|
3425
|
+
const pi = 80, mi = {
|
|
2325
3426
|
Name: {
|
|
2326
3427
|
leave: (e) => e.value
|
|
2327
3428
|
},
|
|
@@ -2330,17 +3431,17 @@ const bt = 80, Dt = {
|
|
|
2330
3431
|
},
|
|
2331
3432
|
// Document
|
|
2332
3433
|
Document: {
|
|
2333
|
-
leave: (e) =>
|
|
3434
|
+
leave: (e) => w(e.definitions, `
|
|
2334
3435
|
|
|
2335
3436
|
`)
|
|
2336
3437
|
},
|
|
2337
3438
|
OperationDefinition: {
|
|
2338
3439
|
leave(e) {
|
|
2339
|
-
const t =
|
|
3440
|
+
const t = D("(", w(e.variableDefinitions, ", "), ")"), n = w(
|
|
2340
3441
|
[
|
|
2341
3442
|
e.operation,
|
|
2342
|
-
|
|
2343
|
-
|
|
3443
|
+
w([e.name, t]),
|
|
3444
|
+
w(e.directives, " ")
|
|
2344
3445
|
],
|
|
2345
3446
|
" "
|
|
2346
3447
|
);
|
|
@@ -2348,19 +3449,19 @@ const bt = 80, Dt = {
|
|
|
2348
3449
|
}
|
|
2349
3450
|
},
|
|
2350
3451
|
VariableDefinition: {
|
|
2351
|
-
leave: ({ variable: e, type: t, defaultValue: n, directives:
|
|
3452
|
+
leave: ({ variable: e, type: t, defaultValue: n, directives: i }) => e + ": " + t + D(" = ", n) + D(" ", w(i, " "))
|
|
2352
3453
|
},
|
|
2353
3454
|
SelectionSet: {
|
|
2354
|
-
leave: ({ selections: e }) =>
|
|
3455
|
+
leave: ({ selections: e }) => Y(e)
|
|
2355
3456
|
},
|
|
2356
3457
|
Field: {
|
|
2357
|
-
leave({ alias: e, name: t, arguments: n, directives:
|
|
2358
|
-
const s =
|
|
2359
|
-
let
|
|
2360
|
-
return
|
|
2361
|
-
`,
|
|
3458
|
+
leave({ alias: e, name: t, arguments: n, directives: i, selectionSet: r }) {
|
|
3459
|
+
const s = D("", e, ": ") + t;
|
|
3460
|
+
let o = s + D("(", w(n, ", "), ")");
|
|
3461
|
+
return o.length > pi && (o = s + D(`(
|
|
3462
|
+
`, Te(w(n, `
|
|
2362
3463
|
`)), `
|
|
2363
|
-
)`)),
|
|
3464
|
+
)`)), w([o, w(i, " "), r], " ");
|
|
2364
3465
|
}
|
|
2365
3466
|
},
|
|
2366
3467
|
Argument: {
|
|
@@ -2368,23 +3469,23 @@ const bt = 80, Dt = {
|
|
|
2368
3469
|
},
|
|
2369
3470
|
// Fragments
|
|
2370
3471
|
FragmentSpread: {
|
|
2371
|
-
leave: ({ name: e, directives: t }) => "..." + e +
|
|
3472
|
+
leave: ({ name: e, directives: t }) => "..." + e + D(" ", w(t, " "))
|
|
2372
3473
|
},
|
|
2373
3474
|
InlineFragment: {
|
|
2374
|
-
leave: ({ typeCondition: e, directives: t, selectionSet: n }) =>
|
|
3475
|
+
leave: ({ typeCondition: e, directives: t, selectionSet: n }) => w(
|
|
2375
3476
|
[
|
|
2376
3477
|
"...",
|
|
2377
|
-
|
|
2378
|
-
|
|
3478
|
+
D("on ", e),
|
|
3479
|
+
w(t, " "),
|
|
2379
3480
|
n
|
|
2380
3481
|
],
|
|
2381
3482
|
" "
|
|
2382
3483
|
)
|
|
2383
3484
|
},
|
|
2384
3485
|
FragmentDefinition: {
|
|
2385
|
-
leave: ({ name: e, typeCondition: t, variableDefinitions: n, directives:
|
|
3486
|
+
leave: ({ name: e, typeCondition: t, variableDefinitions: n, directives: i, selectionSet: r }) => (
|
|
2386
3487
|
// or removed in the future.
|
|
2387
|
-
`fragment ${e}${
|
|
3488
|
+
`fragment ${e}${D("(", w(n, ", "), ")")} on ${t} ${D("", w(i, " "), " ")}` + r
|
|
2388
3489
|
)
|
|
2389
3490
|
},
|
|
2390
3491
|
// Value
|
|
@@ -2395,7 +3496,7 @@ const bt = 80, Dt = {
|
|
|
2395
3496
|
leave: ({ value: e }) => e
|
|
2396
3497
|
},
|
|
2397
3498
|
StringValue: {
|
|
2398
|
-
leave: ({ value: e, block: t }) => t ?
|
|
3499
|
+
leave: ({ value: e, block: t }) => t ? Bn(e) : oi(e)
|
|
2399
3500
|
},
|
|
2400
3501
|
BooleanValue: {
|
|
2401
3502
|
leave: ({ value: e }) => e ? "true" : "false"
|
|
@@ -2407,17 +3508,17 @@ const bt = 80, Dt = {
|
|
|
2407
3508
|
leave: ({ value: e }) => e
|
|
2408
3509
|
},
|
|
2409
3510
|
ListValue: {
|
|
2410
|
-
leave: ({ values: e }) => "[" +
|
|
3511
|
+
leave: ({ values: e }) => "[" + w(e, ", ") + "]"
|
|
2411
3512
|
},
|
|
2412
3513
|
ObjectValue: {
|
|
2413
|
-
leave: ({ fields: e }) => "{" +
|
|
3514
|
+
leave: ({ fields: e }) => "{" + w(e, ", ") + "}"
|
|
2414
3515
|
},
|
|
2415
3516
|
ObjectField: {
|
|
2416
3517
|
leave: ({ name: e, value: t }) => e + ": " + t
|
|
2417
3518
|
},
|
|
2418
3519
|
// Directive
|
|
2419
3520
|
Directive: {
|
|
2420
|
-
leave: ({ name: e, arguments: t }) => "@" + e +
|
|
3521
|
+
leave: ({ name: e, arguments: t }) => "@" + e + D("(", w(t, ", "), ")")
|
|
2421
3522
|
},
|
|
2422
3523
|
// Type
|
|
2423
3524
|
NamedType: {
|
|
@@ -2431,201 +3532,201 @@ const bt = 80, Dt = {
|
|
|
2431
3532
|
},
|
|
2432
3533
|
// Type System Definitions
|
|
2433
3534
|
SchemaDefinition: {
|
|
2434
|
-
leave: ({ description: e, directives: t, operationTypes: n }) =>
|
|
2435
|
-
`) +
|
|
3535
|
+
leave: ({ description: e, directives: t, operationTypes: n }) => D("", e, `
|
|
3536
|
+
`) + w(["schema", w(t, " "), Y(n)], " ")
|
|
2436
3537
|
},
|
|
2437
3538
|
OperationTypeDefinition: {
|
|
2438
3539
|
leave: ({ operation: e, type: t }) => e + ": " + t
|
|
2439
3540
|
},
|
|
2440
3541
|
ScalarTypeDefinition: {
|
|
2441
|
-
leave: ({ description: e, name: t, directives: n }) =>
|
|
2442
|
-
`) +
|
|
3542
|
+
leave: ({ description: e, name: t, directives: n }) => D("", e, `
|
|
3543
|
+
`) + w(["scalar", t, w(n, " ")], " ")
|
|
2443
3544
|
},
|
|
2444
3545
|
ObjectTypeDefinition: {
|
|
2445
|
-
leave: ({ description: e, name: t, interfaces: n, directives:
|
|
2446
|
-
`) +
|
|
3546
|
+
leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => D("", e, `
|
|
3547
|
+
`) + w(
|
|
2447
3548
|
[
|
|
2448
3549
|
"type",
|
|
2449
3550
|
t,
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
3551
|
+
D("implements ", w(n, " & ")),
|
|
3552
|
+
w(i, " "),
|
|
3553
|
+
Y(r)
|
|
2453
3554
|
],
|
|
2454
3555
|
" "
|
|
2455
3556
|
)
|
|
2456
3557
|
},
|
|
2457
3558
|
FieldDefinition: {
|
|
2458
|
-
leave: ({ description: e, name: t, arguments: n, type:
|
|
2459
|
-
`) + t + (
|
|
2460
|
-
`,
|
|
3559
|
+
leave: ({ description: e, name: t, arguments: n, type: i, directives: r }) => D("", e, `
|
|
3560
|
+
`) + t + (rt(n) ? D(`(
|
|
3561
|
+
`, Te(w(n, `
|
|
2461
3562
|
`)), `
|
|
2462
|
-
)`) :
|
|
3563
|
+
)`) : D("(", w(n, ", "), ")")) + ": " + i + D(" ", w(r, " "))
|
|
2463
3564
|
},
|
|
2464
3565
|
InputValueDefinition: {
|
|
2465
|
-
leave: ({ description: e, name: t, type: n, defaultValue:
|
|
2466
|
-
`) +
|
|
2467
|
-
[t + ": " + n,
|
|
3566
|
+
leave: ({ description: e, name: t, type: n, defaultValue: i, directives: r }) => D("", e, `
|
|
3567
|
+
`) + w(
|
|
3568
|
+
[t + ": " + n, D("= ", i), w(r, " ")],
|
|
2468
3569
|
" "
|
|
2469
3570
|
)
|
|
2470
3571
|
},
|
|
2471
3572
|
InterfaceTypeDefinition: {
|
|
2472
|
-
leave: ({ description: e, name: t, interfaces: n, directives:
|
|
2473
|
-
`) +
|
|
3573
|
+
leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => D("", e, `
|
|
3574
|
+
`) + w(
|
|
2474
3575
|
[
|
|
2475
3576
|
"interface",
|
|
2476
3577
|
t,
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
3578
|
+
D("implements ", w(n, " & ")),
|
|
3579
|
+
w(i, " "),
|
|
3580
|
+
Y(r)
|
|
2480
3581
|
],
|
|
2481
3582
|
" "
|
|
2482
3583
|
)
|
|
2483
3584
|
},
|
|
2484
3585
|
UnionTypeDefinition: {
|
|
2485
|
-
leave: ({ description: e, name: t, directives: n, types:
|
|
2486
|
-
`) +
|
|
2487
|
-
["union", t,
|
|
3586
|
+
leave: ({ description: e, name: t, directives: n, types: i }) => D("", e, `
|
|
3587
|
+
`) + w(
|
|
3588
|
+
["union", t, w(n, " "), D("= ", w(i, " | "))],
|
|
2488
3589
|
" "
|
|
2489
3590
|
)
|
|
2490
3591
|
},
|
|
2491
3592
|
EnumTypeDefinition: {
|
|
2492
|
-
leave: ({ description: e, name: t, directives: n, values:
|
|
2493
|
-
`) +
|
|
3593
|
+
leave: ({ description: e, name: t, directives: n, values: i }) => D("", e, `
|
|
3594
|
+
`) + w(["enum", t, w(n, " "), Y(i)], " ")
|
|
2494
3595
|
},
|
|
2495
3596
|
EnumValueDefinition: {
|
|
2496
|
-
leave: ({ description: e, name: t, directives: n }) =>
|
|
2497
|
-
`) +
|
|
3597
|
+
leave: ({ description: e, name: t, directives: n }) => D("", e, `
|
|
3598
|
+
`) + w([t, w(n, " ")], " ")
|
|
2498
3599
|
},
|
|
2499
3600
|
InputObjectTypeDefinition: {
|
|
2500
|
-
leave: ({ description: e, name: t, directives: n, fields:
|
|
2501
|
-
`) +
|
|
3601
|
+
leave: ({ description: e, name: t, directives: n, fields: i }) => D("", e, `
|
|
3602
|
+
`) + w(["input", t, w(n, " "), Y(i)], " ")
|
|
2502
3603
|
},
|
|
2503
3604
|
DirectiveDefinition: {
|
|
2504
|
-
leave: ({ description: e, name: t, arguments: n, repeatable:
|
|
2505
|
-
`) + "directive @" + t + (
|
|
2506
|
-
`,
|
|
3605
|
+
leave: ({ description: e, name: t, arguments: n, repeatable: i, locations: r }) => D("", e, `
|
|
3606
|
+
`) + "directive @" + t + (rt(n) ? D(`(
|
|
3607
|
+
`, Te(w(n, `
|
|
2507
3608
|
`)), `
|
|
2508
|
-
)`) :
|
|
3609
|
+
)`) : D("(", w(n, ", "), ")")) + (i ? " repeatable" : "") + " on " + w(r, " | ")
|
|
2509
3610
|
},
|
|
2510
3611
|
SchemaExtension: {
|
|
2511
|
-
leave: ({ directives: e, operationTypes: t }) =>
|
|
2512
|
-
["extend schema",
|
|
3612
|
+
leave: ({ directives: e, operationTypes: t }) => w(
|
|
3613
|
+
["extend schema", w(e, " "), Y(t)],
|
|
2513
3614
|
" "
|
|
2514
3615
|
)
|
|
2515
3616
|
},
|
|
2516
3617
|
ScalarTypeExtension: {
|
|
2517
|
-
leave: ({ name: e, directives: t }) =>
|
|
3618
|
+
leave: ({ name: e, directives: t }) => w(["extend scalar", e, w(t, " ")], " ")
|
|
2518
3619
|
},
|
|
2519
3620
|
ObjectTypeExtension: {
|
|
2520
|
-
leave: ({ name: e, interfaces: t, directives: n, fields:
|
|
3621
|
+
leave: ({ name: e, interfaces: t, directives: n, fields: i }) => w(
|
|
2521
3622
|
[
|
|
2522
3623
|
"extend type",
|
|
2523
3624
|
e,
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
3625
|
+
D("implements ", w(t, " & ")),
|
|
3626
|
+
w(n, " "),
|
|
3627
|
+
Y(i)
|
|
2527
3628
|
],
|
|
2528
3629
|
" "
|
|
2529
3630
|
)
|
|
2530
3631
|
},
|
|
2531
3632
|
InterfaceTypeExtension: {
|
|
2532
|
-
leave: ({ name: e, interfaces: t, directives: n, fields:
|
|
3633
|
+
leave: ({ name: e, interfaces: t, directives: n, fields: i }) => w(
|
|
2533
3634
|
[
|
|
2534
3635
|
"extend interface",
|
|
2535
3636
|
e,
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
3637
|
+
D("implements ", w(t, " & ")),
|
|
3638
|
+
w(n, " "),
|
|
3639
|
+
Y(i)
|
|
2539
3640
|
],
|
|
2540
3641
|
" "
|
|
2541
3642
|
)
|
|
2542
3643
|
},
|
|
2543
3644
|
UnionTypeExtension: {
|
|
2544
|
-
leave: ({ name: e, directives: t, types: n }) =>
|
|
3645
|
+
leave: ({ name: e, directives: t, types: n }) => w(
|
|
2545
3646
|
[
|
|
2546
3647
|
"extend union",
|
|
2547
3648
|
e,
|
|
2548
|
-
|
|
2549
|
-
|
|
3649
|
+
w(t, " "),
|
|
3650
|
+
D("= ", w(n, " | "))
|
|
2550
3651
|
],
|
|
2551
3652
|
" "
|
|
2552
3653
|
)
|
|
2553
3654
|
},
|
|
2554
3655
|
EnumTypeExtension: {
|
|
2555
|
-
leave: ({ name: e, directives: t, values: n }) =>
|
|
3656
|
+
leave: ({ name: e, directives: t, values: n }) => w(["extend enum", e, w(t, " "), Y(n)], " ")
|
|
2556
3657
|
},
|
|
2557
3658
|
InputObjectTypeExtension: {
|
|
2558
|
-
leave: ({ name: e, directives: t, fields: n }) =>
|
|
3659
|
+
leave: ({ name: e, directives: t, fields: n }) => w(["extend input", e, w(t, " "), Y(n)], " ")
|
|
2559
3660
|
}
|
|
2560
3661
|
};
|
|
2561
|
-
function
|
|
3662
|
+
function w(e, t = "") {
|
|
2562
3663
|
var n;
|
|
2563
|
-
return (n = e == null ? void 0 : e.filter((
|
|
3664
|
+
return (n = e == null ? void 0 : e.filter((i) => i).join(t)) !== null && n !== void 0 ? n : "";
|
|
2564
3665
|
}
|
|
2565
|
-
function
|
|
2566
|
-
return
|
|
2567
|
-
`,
|
|
3666
|
+
function Y(e) {
|
|
3667
|
+
return D(`{
|
|
3668
|
+
`, Te(w(e, `
|
|
2568
3669
|
`)), `
|
|
2569
3670
|
}`);
|
|
2570
3671
|
}
|
|
2571
|
-
function
|
|
3672
|
+
function D(e, t, n = "") {
|
|
2572
3673
|
return t != null && t !== "" ? e + t + n : "";
|
|
2573
3674
|
}
|
|
2574
|
-
function
|
|
2575
|
-
return
|
|
3675
|
+
function Te(e) {
|
|
3676
|
+
return D(" ", e.replace(/\n/g, `
|
|
2576
3677
|
`));
|
|
2577
3678
|
}
|
|
2578
|
-
function
|
|
3679
|
+
function rt(e) {
|
|
2579
3680
|
var t;
|
|
2580
3681
|
return (t = e == null ? void 0 : e.some((n) => n.includes(`
|
|
2581
3682
|
`))) !== null && t !== void 0 ? t : !1;
|
|
2582
3683
|
}
|
|
2583
|
-
const
|
|
2584
|
-
var
|
|
3684
|
+
const st = (e) => {
|
|
3685
|
+
var i, r;
|
|
2585
3686
|
let t;
|
|
2586
3687
|
const n = e.definitions.filter((s) => s.kind === "OperationDefinition");
|
|
2587
|
-
return n.length === 1 && (t = (
|
|
2588
|
-
},
|
|
3688
|
+
return n.length === 1 && (t = (r = (i = n[0]) == null ? void 0 : i.name) == null ? void 0 : r.value), t;
|
|
3689
|
+
}, Fe = (e) => {
|
|
2589
3690
|
if (typeof e == "string") {
|
|
2590
3691
|
let n;
|
|
2591
3692
|
try {
|
|
2592
|
-
const
|
|
2593
|
-
n =
|
|
3693
|
+
const i = ri(e);
|
|
3694
|
+
n = st(i);
|
|
2594
3695
|
} catch {
|
|
2595
3696
|
}
|
|
2596
3697
|
return { query: e, operationName: n };
|
|
2597
3698
|
}
|
|
2598
|
-
const t =
|
|
2599
|
-
return { query:
|
|
3699
|
+
const t = st(e);
|
|
3700
|
+
return { query: di(e), operationName: t };
|
|
2600
3701
|
};
|
|
2601
|
-
class
|
|
3702
|
+
class me extends Error {
|
|
2602
3703
|
constructor(t, n) {
|
|
2603
|
-
const
|
|
3704
|
+
const i = `${me.extractMessage(t)}: ${JSON.stringify({
|
|
2604
3705
|
response: t,
|
|
2605
3706
|
request: n
|
|
2606
3707
|
})}`;
|
|
2607
|
-
super(
|
|
3708
|
+
super(i), Object.setPrototypeOf(this, me.prototype), this.response = t, this.request = n, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(this, me);
|
|
2608
3709
|
}
|
|
2609
3710
|
static extractMessage(t) {
|
|
2610
|
-
var n,
|
|
2611
|
-
return ((
|
|
3711
|
+
var n, i;
|
|
3712
|
+
return ((i = (n = t.errors) == null ? void 0 : n[0]) == null ? void 0 : i.message) ?? `GraphQL Error (Code: ${t.status})`;
|
|
2612
3713
|
}
|
|
2613
3714
|
}
|
|
2614
|
-
var
|
|
2615
|
-
function
|
|
3715
|
+
var gi = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
3716
|
+
function Ei(e) {
|
|
2616
3717
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
2617
3718
|
}
|
|
2618
|
-
var
|
|
3719
|
+
var Ye = { exports: {} };
|
|
2619
3720
|
(function(e, t) {
|
|
2620
|
-
var n = typeof self < "u" ? self :
|
|
3721
|
+
var n = typeof self < "u" ? self : gi, i = function() {
|
|
2621
3722
|
function s() {
|
|
2622
3723
|
this.fetch = !1, this.DOMException = n.DOMException;
|
|
2623
3724
|
}
|
|
2624
3725
|
return s.prototype = n, new s();
|
|
2625
3726
|
}();
|
|
2626
3727
|
(function(s) {
|
|
2627
|
-
(function(
|
|
2628
|
-
var
|
|
3728
|
+
(function(o) {
|
|
3729
|
+
var a = {
|
|
2629
3730
|
searchParams: "URLSearchParams" in s,
|
|
2630
3731
|
iterable: "Symbol" in s && "iterator" in Symbol,
|
|
2631
3732
|
blob: "FileReader" in s && "Blob" in s && function() {
|
|
@@ -2638,11 +3739,11 @@ var le = { exports: {} };
|
|
|
2638
3739
|
formData: "FormData" in s,
|
|
2639
3740
|
arrayBuffer: "ArrayBuffer" in s
|
|
2640
3741
|
};
|
|
2641
|
-
function
|
|
2642
|
-
return
|
|
3742
|
+
function u(d) {
|
|
3743
|
+
return d && DataView.prototype.isPrototypeOf(d);
|
|
2643
3744
|
}
|
|
2644
|
-
if (
|
|
2645
|
-
var
|
|
3745
|
+
if (a.arrayBuffer)
|
|
3746
|
+
var c = [
|
|
2646
3747
|
"[object Int8Array]",
|
|
2647
3748
|
"[object Uint8Array]",
|
|
2648
3749
|
"[object Uint8ClampedArray]",
|
|
@@ -2652,108 +3753,108 @@ var le = { exports: {} };
|
|
|
2652
3753
|
"[object Uint32Array]",
|
|
2653
3754
|
"[object Float32Array]",
|
|
2654
3755
|
"[object Float64Array]"
|
|
2655
|
-
],
|
|
2656
|
-
return
|
|
3756
|
+
], l = ArrayBuffer.isView || function(d) {
|
|
3757
|
+
return d && c.indexOf(Object.prototype.toString.call(d)) > -1;
|
|
2657
3758
|
};
|
|
2658
|
-
function
|
|
2659
|
-
if (typeof
|
|
3759
|
+
function f(d) {
|
|
3760
|
+
if (typeof d != "string" && (d = String(d)), /[^a-z0-9\-#$%&'*+.^_`|~]/i.test(d))
|
|
2660
3761
|
throw new TypeError("Invalid character in header field name");
|
|
2661
|
-
return
|
|
3762
|
+
return d.toLowerCase();
|
|
2662
3763
|
}
|
|
2663
|
-
function
|
|
2664
|
-
return typeof
|
|
3764
|
+
function h(d) {
|
|
3765
|
+
return typeof d != "string" && (d = String(d)), d;
|
|
2665
3766
|
}
|
|
2666
|
-
function
|
|
2667
|
-
var
|
|
3767
|
+
function E(d) {
|
|
3768
|
+
var g = {
|
|
2668
3769
|
next: function() {
|
|
2669
|
-
var
|
|
2670
|
-
return { done:
|
|
3770
|
+
var v = d.shift();
|
|
3771
|
+
return { done: v === void 0, value: v };
|
|
2671
3772
|
}
|
|
2672
3773
|
};
|
|
2673
|
-
return
|
|
2674
|
-
return
|
|
2675
|
-
}),
|
|
3774
|
+
return a.iterable && (g[Symbol.iterator] = function() {
|
|
3775
|
+
return g;
|
|
3776
|
+
}), g;
|
|
2676
3777
|
}
|
|
2677
|
-
function
|
|
2678
|
-
this.map = {},
|
|
2679
|
-
this.append(
|
|
2680
|
-
}, this) : Array.isArray(
|
|
2681
|
-
this.append(
|
|
2682
|
-
}, this) :
|
|
2683
|
-
this.append(
|
|
3778
|
+
function N(d) {
|
|
3779
|
+
this.map = {}, d instanceof N ? d.forEach(function(g, v) {
|
|
3780
|
+
this.append(v, g);
|
|
3781
|
+
}, this) : Array.isArray(d) ? d.forEach(function(g) {
|
|
3782
|
+
this.append(g[0], g[1]);
|
|
3783
|
+
}, this) : d && Object.getOwnPropertyNames(d).forEach(function(g) {
|
|
3784
|
+
this.append(g, d[g]);
|
|
2684
3785
|
}, this);
|
|
2685
3786
|
}
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
var
|
|
2689
|
-
this.map[
|
|
2690
|
-
},
|
|
2691
|
-
delete this.map[
|
|
2692
|
-
},
|
|
2693
|
-
return
|
|
2694
|
-
},
|
|
2695
|
-
return this.map.hasOwnProperty(
|
|
2696
|
-
},
|
|
2697
|
-
this.map[
|
|
2698
|
-
},
|
|
2699
|
-
for (var
|
|
2700
|
-
this.map.hasOwnProperty(
|
|
2701
|
-
},
|
|
2702
|
-
var
|
|
2703
|
-
return this.forEach(function(
|
|
2704
|
-
|
|
2705
|
-
}),
|
|
2706
|
-
},
|
|
2707
|
-
var
|
|
2708
|
-
return this.forEach(function(
|
|
2709
|
-
|
|
2710
|
-
}),
|
|
2711
|
-
},
|
|
2712
|
-
var
|
|
2713
|
-
return this.forEach(function(
|
|
2714
|
-
|
|
2715
|
-
}),
|
|
2716
|
-
},
|
|
2717
|
-
function
|
|
2718
|
-
if (
|
|
3787
|
+
N.prototype.append = function(d, g) {
|
|
3788
|
+
d = f(d), g = h(g);
|
|
3789
|
+
var v = this.map[d];
|
|
3790
|
+
this.map[d] = v ? v + ", " + g : g;
|
|
3791
|
+
}, N.prototype.delete = function(d) {
|
|
3792
|
+
delete this.map[f(d)];
|
|
3793
|
+
}, N.prototype.get = function(d) {
|
|
3794
|
+
return d = f(d), this.has(d) ? this.map[d] : null;
|
|
3795
|
+
}, N.prototype.has = function(d) {
|
|
3796
|
+
return this.map.hasOwnProperty(f(d));
|
|
3797
|
+
}, N.prototype.set = function(d, g) {
|
|
3798
|
+
this.map[f(d)] = h(g);
|
|
3799
|
+
}, N.prototype.forEach = function(d, g) {
|
|
3800
|
+
for (var v in this.map)
|
|
3801
|
+
this.map.hasOwnProperty(v) && d.call(g, this.map[v], v, this);
|
|
3802
|
+
}, N.prototype.keys = function() {
|
|
3803
|
+
var d = [];
|
|
3804
|
+
return this.forEach(function(g, v) {
|
|
3805
|
+
d.push(v);
|
|
3806
|
+
}), E(d);
|
|
3807
|
+
}, N.prototype.values = function() {
|
|
3808
|
+
var d = [];
|
|
3809
|
+
return this.forEach(function(g) {
|
|
3810
|
+
d.push(g);
|
|
3811
|
+
}), E(d);
|
|
3812
|
+
}, N.prototype.entries = function() {
|
|
3813
|
+
var d = [];
|
|
3814
|
+
return this.forEach(function(g, v) {
|
|
3815
|
+
d.push([v, g]);
|
|
3816
|
+
}), E(d);
|
|
3817
|
+
}, a.iterable && (N.prototype[Symbol.iterator] = N.prototype.entries);
|
|
3818
|
+
function y(d) {
|
|
3819
|
+
if (d.bodyUsed)
|
|
2719
3820
|
return Promise.reject(new TypeError("Already read"));
|
|
2720
|
-
|
|
3821
|
+
d.bodyUsed = !0;
|
|
2721
3822
|
}
|
|
2722
|
-
function
|
|
2723
|
-
return new Promise(function(
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
},
|
|
2727
|
-
|
|
3823
|
+
function x(d) {
|
|
3824
|
+
return new Promise(function(g, v) {
|
|
3825
|
+
d.onload = function() {
|
|
3826
|
+
g(d.result);
|
|
3827
|
+
}, d.onerror = function() {
|
|
3828
|
+
v(d.error);
|
|
2728
3829
|
};
|
|
2729
3830
|
});
|
|
2730
3831
|
}
|
|
2731
|
-
function
|
|
2732
|
-
var
|
|
2733
|
-
return
|
|
3832
|
+
function b(d) {
|
|
3833
|
+
var g = new FileReader(), v = x(g);
|
|
3834
|
+
return g.readAsArrayBuffer(d), v;
|
|
2734
3835
|
}
|
|
2735
|
-
function
|
|
2736
|
-
var
|
|
2737
|
-
return
|
|
3836
|
+
function U(d) {
|
|
3837
|
+
var g = new FileReader(), v = x(g);
|
|
3838
|
+
return g.readAsText(d), v;
|
|
2738
3839
|
}
|
|
2739
|
-
function
|
|
2740
|
-
for (var
|
|
2741
|
-
|
|
2742
|
-
return
|
|
3840
|
+
function _(d) {
|
|
3841
|
+
for (var g = new Uint8Array(d), v = new Array(g.length), q = 0; q < g.length; q++)
|
|
3842
|
+
v[q] = String.fromCharCode(g[q]);
|
|
3843
|
+
return v.join("");
|
|
2743
3844
|
}
|
|
2744
|
-
function
|
|
2745
|
-
if (
|
|
2746
|
-
return
|
|
2747
|
-
var
|
|
2748
|
-
return
|
|
3845
|
+
function S(d) {
|
|
3846
|
+
if (d.slice)
|
|
3847
|
+
return d.slice(0);
|
|
3848
|
+
var g = new Uint8Array(d.byteLength);
|
|
3849
|
+
return g.set(new Uint8Array(d)), g.buffer;
|
|
2749
3850
|
}
|
|
2750
|
-
function
|
|
2751
|
-
return this.bodyUsed = !1, this._initBody = function(
|
|
2752
|
-
this._bodyInit =
|
|
2753
|
-
},
|
|
2754
|
-
var
|
|
2755
|
-
if (
|
|
2756
|
-
return
|
|
3851
|
+
function G() {
|
|
3852
|
+
return this.bodyUsed = !1, this._initBody = function(d) {
|
|
3853
|
+
this._bodyInit = d, d ? typeof d == "string" ? this._bodyText = d : a.blob && Blob.prototype.isPrototypeOf(d) ? this._bodyBlob = d : a.formData && FormData.prototype.isPrototypeOf(d) ? this._bodyFormData = d : a.searchParams && URLSearchParams.prototype.isPrototypeOf(d) ? this._bodyText = d.toString() : a.arrayBuffer && a.blob && u(d) ? (this._bodyArrayBuffer = S(d.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : a.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(d) || l(d)) ? this._bodyArrayBuffer = S(d) : this._bodyText = d = Object.prototype.toString.call(d) : this._bodyText = "", this.headers.get("content-type") || (typeof d == "string" ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : a.searchParams && URLSearchParams.prototype.isPrototypeOf(d) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
|
|
3854
|
+
}, a.blob && (this.blob = function() {
|
|
3855
|
+
var d = y(this);
|
|
3856
|
+
if (d)
|
|
3857
|
+
return d;
|
|
2757
3858
|
if (this._bodyBlob)
|
|
2758
3859
|
return Promise.resolve(this._bodyBlob);
|
|
2759
3860
|
if (this._bodyArrayBuffer)
|
|
@@ -2762,240 +3863,240 @@ var le = { exports: {} };
|
|
|
2762
3863
|
throw new Error("could not read FormData body as blob");
|
|
2763
3864
|
return Promise.resolve(new Blob([this._bodyText]));
|
|
2764
3865
|
}, this.arrayBuffer = function() {
|
|
2765
|
-
return this._bodyArrayBuffer ?
|
|
3866
|
+
return this._bodyArrayBuffer ? y(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(b);
|
|
2766
3867
|
}), this.text = function() {
|
|
2767
|
-
var
|
|
2768
|
-
if (
|
|
2769
|
-
return
|
|
3868
|
+
var d = y(this);
|
|
3869
|
+
if (d)
|
|
3870
|
+
return d;
|
|
2770
3871
|
if (this._bodyBlob)
|
|
2771
|
-
return
|
|
3872
|
+
return U(this._bodyBlob);
|
|
2772
3873
|
if (this._bodyArrayBuffer)
|
|
2773
|
-
return Promise.resolve(
|
|
3874
|
+
return Promise.resolve(_(this._bodyArrayBuffer));
|
|
2774
3875
|
if (this._bodyFormData)
|
|
2775
3876
|
throw new Error("could not read FormData body as text");
|
|
2776
3877
|
return Promise.resolve(this._bodyText);
|
|
2777
|
-
},
|
|
2778
|
-
return this.text().then(
|
|
3878
|
+
}, a.formData && (this.formData = function() {
|
|
3879
|
+
return this.text().then(ie);
|
|
2779
3880
|
}), this.json = function() {
|
|
2780
3881
|
return this.text().then(JSON.parse);
|
|
2781
3882
|
}, this;
|
|
2782
3883
|
}
|
|
2783
|
-
var
|
|
2784
|
-
function
|
|
2785
|
-
var
|
|
2786
|
-
return
|
|
3884
|
+
var j = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];
|
|
3885
|
+
function Q(d) {
|
|
3886
|
+
var g = d.toUpperCase();
|
|
3887
|
+
return j.indexOf(g) > -1 ? g : d;
|
|
2787
3888
|
}
|
|
2788
|
-
function
|
|
2789
|
-
|
|
2790
|
-
var
|
|
2791
|
-
if (
|
|
2792
|
-
if (
|
|
3889
|
+
function H(d, g) {
|
|
3890
|
+
g = g || {};
|
|
3891
|
+
var v = g.body;
|
|
3892
|
+
if (d instanceof H) {
|
|
3893
|
+
if (d.bodyUsed)
|
|
2793
3894
|
throw new TypeError("Already read");
|
|
2794
|
-
this.url =
|
|
3895
|
+
this.url = d.url, this.credentials = d.credentials, g.headers || (this.headers = new N(d.headers)), this.method = d.method, this.mode = d.mode, this.signal = d.signal, !v && d._bodyInit != null && (v = d._bodyInit, d.bodyUsed = !0);
|
|
2795
3896
|
} else
|
|
2796
|
-
this.url = String(
|
|
2797
|
-
if (this.credentials =
|
|
3897
|
+
this.url = String(d);
|
|
3898
|
+
if (this.credentials = g.credentials || this.credentials || "same-origin", (g.headers || !this.headers) && (this.headers = new N(g.headers)), this.method = Q(g.method || this.method || "GET"), this.mode = g.mode || this.mode || null, this.signal = g.signal || this.signal, this.referrer = null, (this.method === "GET" || this.method === "HEAD") && v)
|
|
2798
3899
|
throw new TypeError("Body not allowed for GET or HEAD requests");
|
|
2799
|
-
this._initBody(
|
|
3900
|
+
this._initBody(v);
|
|
2800
3901
|
}
|
|
2801
|
-
|
|
2802
|
-
return new
|
|
3902
|
+
H.prototype.clone = function() {
|
|
3903
|
+
return new H(this, { body: this._bodyInit });
|
|
2803
3904
|
};
|
|
2804
|
-
function
|
|
2805
|
-
var
|
|
2806
|
-
return
|
|
2807
|
-
if (
|
|
2808
|
-
var
|
|
2809
|
-
|
|
3905
|
+
function ie(d) {
|
|
3906
|
+
var g = new FormData();
|
|
3907
|
+
return d.trim().split("&").forEach(function(v) {
|
|
3908
|
+
if (v) {
|
|
3909
|
+
var q = v.split("="), M = q.shift().replace(/\+/g, " "), C = q.join("=").replace(/\+/g, " ");
|
|
3910
|
+
g.append(decodeURIComponent(M), decodeURIComponent(C));
|
|
2810
3911
|
}
|
|
2811
|
-
}),
|
|
3912
|
+
}), g;
|
|
2812
3913
|
}
|
|
2813
|
-
function
|
|
2814
|
-
var
|
|
2815
|
-
return
|
|
2816
|
-
var
|
|
2817
|
-
if (
|
|
2818
|
-
var
|
|
2819
|
-
|
|
3914
|
+
function he(d) {
|
|
3915
|
+
var g = new N(), v = d.replace(/\r?\n[\t ]+/g, " ");
|
|
3916
|
+
return v.split(/\r?\n/).forEach(function(q) {
|
|
3917
|
+
var M = q.split(":"), C = M.shift().trim();
|
|
3918
|
+
if (C) {
|
|
3919
|
+
var Ne = M.join(":").trim();
|
|
3920
|
+
g.append(C, Ne);
|
|
2820
3921
|
}
|
|
2821
|
-
}),
|
|
3922
|
+
}), g;
|
|
2822
3923
|
}
|
|
2823
|
-
|
|
2824
|
-
function R(
|
|
2825
|
-
|
|
3924
|
+
G.call(H.prototype);
|
|
3925
|
+
function R(d, g) {
|
|
3926
|
+
g || (g = {}), this.type = "default", this.status = g.status === void 0 ? 200 : g.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = "statusText" in g ? g.statusText : "OK", this.headers = new N(g.headers), this.url = g.url || "", this._initBody(d);
|
|
2826
3927
|
}
|
|
2827
|
-
|
|
3928
|
+
G.call(R.prototype), R.prototype.clone = function() {
|
|
2828
3929
|
return new R(this._bodyInit, {
|
|
2829
3930
|
status: this.status,
|
|
2830
3931
|
statusText: this.statusText,
|
|
2831
|
-
headers: new
|
|
3932
|
+
headers: new N(this.headers),
|
|
2832
3933
|
url: this.url
|
|
2833
3934
|
});
|
|
2834
3935
|
}, R.error = function() {
|
|
2835
|
-
var
|
|
2836
|
-
return
|
|
3936
|
+
var d = new R(null, { status: 0, statusText: "" });
|
|
3937
|
+
return d.type = "error", d;
|
|
2837
3938
|
};
|
|
2838
|
-
var
|
|
2839
|
-
R.redirect = function(
|
|
2840
|
-
if (
|
|
3939
|
+
var se = [301, 302, 303, 307, 308];
|
|
3940
|
+
R.redirect = function(d, g) {
|
|
3941
|
+
if (se.indexOf(g) === -1)
|
|
2841
3942
|
throw new RangeError("Invalid status code");
|
|
2842
|
-
return new R(null, { status:
|
|
2843
|
-
},
|
|
3943
|
+
return new R(null, { status: g, headers: { location: d } });
|
|
3944
|
+
}, o.DOMException = s.DOMException;
|
|
2844
3945
|
try {
|
|
2845
|
-
new
|
|
3946
|
+
new o.DOMException();
|
|
2846
3947
|
} catch {
|
|
2847
|
-
|
|
2848
|
-
this.message =
|
|
2849
|
-
var
|
|
2850
|
-
this.stack =
|
|
2851
|
-
},
|
|
3948
|
+
o.DOMException = function(g, v) {
|
|
3949
|
+
this.message = g, this.name = v;
|
|
3950
|
+
var q = Error(g);
|
|
3951
|
+
this.stack = q.stack;
|
|
3952
|
+
}, o.DOMException.prototype = Object.create(Error.prototype), o.DOMException.prototype.constructor = o.DOMException;
|
|
2852
3953
|
}
|
|
2853
|
-
function
|
|
2854
|
-
return new Promise(function(
|
|
2855
|
-
var
|
|
2856
|
-
if (
|
|
2857
|
-
return
|
|
2858
|
-
var
|
|
2859
|
-
function
|
|
2860
|
-
|
|
3954
|
+
function W(d, g) {
|
|
3955
|
+
return new Promise(function(v, q) {
|
|
3956
|
+
var M = new H(d, g);
|
|
3957
|
+
if (M.signal && M.signal.aborted)
|
|
3958
|
+
return q(new o.DOMException("Aborted", "AbortError"));
|
|
3959
|
+
var C = new XMLHttpRequest();
|
|
3960
|
+
function Ne() {
|
|
3961
|
+
C.abort();
|
|
2861
3962
|
}
|
|
2862
|
-
|
|
2863
|
-
var
|
|
2864
|
-
status:
|
|
2865
|
-
statusText:
|
|
2866
|
-
headers:
|
|
3963
|
+
C.onload = function() {
|
|
3964
|
+
var de = {
|
|
3965
|
+
status: C.status,
|
|
3966
|
+
statusText: C.statusText,
|
|
3967
|
+
headers: he(C.getAllResponseHeaders() || "")
|
|
2867
3968
|
};
|
|
2868
|
-
|
|
2869
|
-
var
|
|
2870
|
-
|
|
2871
|
-
},
|
|
2872
|
-
|
|
2873
|
-
},
|
|
2874
|
-
|
|
2875
|
-
},
|
|
2876
|
-
|
|
2877
|
-
},
|
|
2878
|
-
|
|
2879
|
-
}),
|
|
2880
|
-
|
|
2881
|
-
}),
|
|
3969
|
+
de.url = "responseURL" in C ? C.responseURL : de.headers.get("X-Request-URL");
|
|
3970
|
+
var Re = "response" in C ? C.response : C.responseText;
|
|
3971
|
+
v(new R(Re, de));
|
|
3972
|
+
}, C.onerror = function() {
|
|
3973
|
+
q(new TypeError("Network request failed"));
|
|
3974
|
+
}, C.ontimeout = function() {
|
|
3975
|
+
q(new TypeError("Network request failed"));
|
|
3976
|
+
}, C.onabort = function() {
|
|
3977
|
+
q(new o.DOMException("Aborted", "AbortError"));
|
|
3978
|
+
}, C.open(M.method, M.url, !0), M.credentials === "include" ? C.withCredentials = !0 : M.credentials === "omit" && (C.withCredentials = !1), "responseType" in C && a.blob && (C.responseType = "blob"), M.headers.forEach(function(de, Re) {
|
|
3979
|
+
C.setRequestHeader(Re, de);
|
|
3980
|
+
}), M.signal && (M.signal.addEventListener("abort", Ne), C.onreadystatechange = function() {
|
|
3981
|
+
C.readyState === 4 && M.signal.removeEventListener("abort", Ne);
|
|
3982
|
+
}), C.send(typeof M._bodyInit > "u" ? null : M._bodyInit);
|
|
2882
3983
|
});
|
|
2883
3984
|
}
|
|
2884
|
-
return
|
|
3985
|
+
return W.polyfill = !0, s.fetch || (s.fetch = W, s.Headers = N, s.Request = H, s.Response = R), o.Headers = N, o.Request = H, o.Response = R, o.fetch = W, Object.defineProperty(o, "__esModule", { value: !0 }), o;
|
|
2885
3986
|
})({});
|
|
2886
|
-
})(
|
|
2887
|
-
var
|
|
2888
|
-
t =
|
|
2889
|
-
})(
|
|
2890
|
-
var
|
|
2891
|
-
const
|
|
3987
|
+
})(i), i.fetch.ponyfill = !0, delete i.fetch.polyfill;
|
|
3988
|
+
var r = i;
|
|
3989
|
+
t = r.fetch, t.default = r.fetch, t.fetch = r.fetch, t.Headers = r.Headers, t.Request = r.Request, t.Response = r.Response, e.exports = t;
|
|
3990
|
+
})(Ye, Ye.exports);
|
|
3991
|
+
var be = Ye.exports;
|
|
3992
|
+
const Ae = /* @__PURE__ */ Ei(be), Ni = /* @__PURE__ */ Dt({
|
|
2892
3993
|
__proto__: null,
|
|
2893
|
-
default:
|
|
2894
|
-
}, [
|
|
3994
|
+
default: Ae
|
|
3995
|
+
}, [be]), oe = (e) => {
|
|
2895
3996
|
let t = {};
|
|
2896
|
-
return e && (typeof Headers < "u" && e instanceof Headers ||
|
|
2897
|
-
n &&
|
|
3997
|
+
return e && (typeof Headers < "u" && e instanceof Headers || Ni && be.Headers && e instanceof be.Headers ? t = In(e) : Array.isArray(e) ? e.forEach(([n, i]) => {
|
|
3998
|
+
n && i !== void 0 && (t[n] = i);
|
|
2898
3999
|
}) : t = e), t;
|
|
2899
|
-
},
|
|
4000
|
+
}, ot = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), yi = (e) => {
|
|
2900
4001
|
if (!Array.isArray(e.query)) {
|
|
2901
|
-
const
|
|
2902
|
-
return e.variables &&
|
|
4002
|
+
const i = e, r = [`query=${encodeURIComponent(ot(i.query))}`];
|
|
4003
|
+
return e.variables && r.push(`variables=${encodeURIComponent(i.jsonSerializer.stringify(i.variables))}`), i.operationName && r.push(`operationName=${encodeURIComponent(i.operationName)}`), r.join("&");
|
|
2903
4004
|
}
|
|
2904
4005
|
if (typeof e.variables < "u" && !Array.isArray(e.variables))
|
|
2905
4006
|
throw new Error("Cannot create query with given variable type, array expected");
|
|
2906
|
-
const t = e, n = e.query.reduce((
|
|
2907
|
-
query:
|
|
4007
|
+
const t = e, n = e.query.reduce((i, r, s) => (i.push({
|
|
4008
|
+
query: ot(r),
|
|
2908
4009
|
variables: t.variables ? t.jsonSerializer.stringify(t.variables[s]) : void 0
|
|
2909
|
-
}),
|
|
4010
|
+
}), i), []);
|
|
2910
4011
|
return `query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`;
|
|
2911
|
-
},
|
|
2912
|
-
const { url: n, query:
|
|
2913
|
-
let
|
|
2914
|
-
e === "POST" ? (
|
|
2915
|
-
query:
|
|
2916
|
-
variables:
|
|
4012
|
+
}, vi = (e) => async (t) => {
|
|
4013
|
+
const { url: n, query: i, variables: r, operationName: s, fetch: o, fetchOptions: a, middleware: u } = t, c = { ...t.headers };
|
|
4014
|
+
let l = "", f;
|
|
4015
|
+
e === "POST" ? (f = Ti(i, r, s, a.jsonSerializer), typeof f == "string" && (c["Content-Type"] = "application/json")) : l = yi({
|
|
4016
|
+
query: i,
|
|
4017
|
+
variables: r,
|
|
2917
4018
|
operationName: s,
|
|
2918
|
-
jsonSerializer:
|
|
4019
|
+
jsonSerializer: a.jsonSerializer ?? ze
|
|
2919
4020
|
});
|
|
2920
|
-
const
|
|
4021
|
+
const h = {
|
|
2921
4022
|
method: e,
|
|
2922
|
-
headers:
|
|
2923
|
-
body:
|
|
2924
|
-
...
|
|
4023
|
+
headers: c,
|
|
4024
|
+
body: f,
|
|
4025
|
+
...a
|
|
2925
4026
|
};
|
|
2926
|
-
let
|
|
2927
|
-
if (
|
|
2928
|
-
const
|
|
2929
|
-
|
|
4027
|
+
let E = n, N = h;
|
|
4028
|
+
if (u) {
|
|
4029
|
+
const y = await Promise.resolve(u({ ...h, url: n, operationName: s, variables: r })), { url: x, ...b } = y;
|
|
4030
|
+
E = x, N = b;
|
|
2930
4031
|
}
|
|
2931
|
-
return
|
|
4032
|
+
return l && (E = `${E}?${l}`), await o(E, N);
|
|
2932
4033
|
};
|
|
2933
|
-
class
|
|
4034
|
+
class wi {
|
|
2934
4035
|
constructor(t, n = {}) {
|
|
2935
|
-
this.url = t, this.requestConfig = n, this.rawRequest = async (...
|
|
2936
|
-
const [
|
|
2937
|
-
|
|
2938
|
-
const { operationName:
|
|
2939
|
-
return
|
|
2940
|
-
url:
|
|
2941
|
-
query:
|
|
2942
|
-
variables:
|
|
4036
|
+
this.url = t, this.requestConfig = n, this.rawRequest = async (...i) => {
|
|
4037
|
+
const [r, s, o] = i, a = _n(r, s, o), { headers: u, fetch: c = Ae, method: l = "POST", requestMiddleware: f, responseMiddleware: h, ...E } = this.requestConfig, { url: N } = this;
|
|
4038
|
+
a.signal !== void 0 && (E.signal = a.signal);
|
|
4039
|
+
const { operationName: y } = Fe(a.query);
|
|
4040
|
+
return Pe({
|
|
4041
|
+
url: N,
|
|
4042
|
+
query: a.query,
|
|
4043
|
+
variables: a.variables,
|
|
2943
4044
|
headers: {
|
|
2944
|
-
...
|
|
2945
|
-
...
|
|
4045
|
+
...oe(Me(u)),
|
|
4046
|
+
...oe(a.requestHeaders)
|
|
2946
4047
|
},
|
|
2947
|
-
operationName:
|
|
2948
|
-
fetch:
|
|
2949
|
-
method:
|
|
2950
|
-
fetchOptions:
|
|
2951
|
-
middleware:
|
|
2952
|
-
}).then((
|
|
2953
|
-
throw
|
|
4048
|
+
operationName: y,
|
|
4049
|
+
fetch: c,
|
|
4050
|
+
method: l,
|
|
4051
|
+
fetchOptions: E,
|
|
4052
|
+
middleware: f
|
|
4053
|
+
}).then((x) => (h && h(x), x)).catch((x) => {
|
|
4054
|
+
throw h && h(x), x;
|
|
2954
4055
|
});
|
|
2955
4056
|
};
|
|
2956
4057
|
}
|
|
2957
4058
|
async request(t, ...n) {
|
|
2958
|
-
const [
|
|
2959
|
-
s.signal !== void 0 && (
|
|
2960
|
-
const { query:
|
|
2961
|
-
return
|
|
2962
|
-
url:
|
|
2963
|
-
query:
|
|
4059
|
+
const [i, r] = n, s = On(t, i, r), { headers: o, fetch: a = Ae, method: u = "POST", requestMiddleware: c, responseMiddleware: l, ...f } = this.requestConfig, { url: h } = this;
|
|
4060
|
+
s.signal !== void 0 && (f.signal = s.signal);
|
|
4061
|
+
const { query: E, operationName: N } = Fe(s.document);
|
|
4062
|
+
return Pe({
|
|
4063
|
+
url: h,
|
|
4064
|
+
query: E,
|
|
2964
4065
|
variables: s.variables,
|
|
2965
4066
|
headers: {
|
|
2966
|
-
...
|
|
2967
|
-
...
|
|
4067
|
+
...oe(Me(o)),
|
|
4068
|
+
...oe(s.requestHeaders)
|
|
2968
4069
|
},
|
|
2969
|
-
operationName:
|
|
2970
|
-
fetch:
|
|
2971
|
-
method:
|
|
2972
|
-
fetchOptions:
|
|
2973
|
-
middleware:
|
|
2974
|
-
}).then((
|
|
2975
|
-
throw
|
|
4070
|
+
operationName: N,
|
|
4071
|
+
fetch: a,
|
|
4072
|
+
method: u,
|
|
4073
|
+
fetchOptions: f,
|
|
4074
|
+
middleware: c
|
|
4075
|
+
}).then((y) => (l && l(y), y.data)).catch((y) => {
|
|
4076
|
+
throw l && l(y), y;
|
|
2976
4077
|
});
|
|
2977
4078
|
}
|
|
2978
4079
|
// prettier-ignore
|
|
2979
4080
|
batchRequests(t, n) {
|
|
2980
|
-
const
|
|
2981
|
-
|
|
2982
|
-
const
|
|
2983
|
-
return
|
|
4081
|
+
const i = bn(t, n), { headers: r, ...s } = this.requestConfig;
|
|
4082
|
+
i.signal !== void 0 && (s.signal = i.signal);
|
|
4083
|
+
const o = i.documents.map(({ document: u }) => Fe(u).query), a = i.documents.map(({ variables: u }) => u);
|
|
4084
|
+
return Pe({
|
|
2984
4085
|
url: this.url,
|
|
2985
|
-
query:
|
|
4086
|
+
query: o,
|
|
2986
4087
|
// @ts-expect-error TODO reconcile batch variables into system.
|
|
2987
|
-
variables:
|
|
4088
|
+
variables: a,
|
|
2988
4089
|
headers: {
|
|
2989
|
-
...
|
|
2990
|
-
...
|
|
4090
|
+
...oe(Me(r)),
|
|
4091
|
+
...oe(i.requestHeaders)
|
|
2991
4092
|
},
|
|
2992
4093
|
operationName: void 0,
|
|
2993
|
-
fetch: this.requestConfig.fetch ??
|
|
4094
|
+
fetch: this.requestConfig.fetch ?? Ae,
|
|
2994
4095
|
method: this.requestConfig.method || "POST",
|
|
2995
4096
|
fetchOptions: s,
|
|
2996
4097
|
middleware: this.requestConfig.requestMiddleware
|
|
2997
|
-
}).then((
|
|
2998
|
-
throw this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(
|
|
4098
|
+
}).then((u) => (this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(u), u.data)).catch((u) => {
|
|
4099
|
+
throw this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(u), u;
|
|
2999
4100
|
});
|
|
3000
4101
|
}
|
|
3001
4102
|
setHeaders(t) {
|
|
@@ -3005,8 +4106,8 @@ class Lt {
|
|
|
3005
4106
|
* Attach a header to the client. All subsequent requests will have this header.
|
|
3006
4107
|
*/
|
|
3007
4108
|
setHeader(t, n) {
|
|
3008
|
-
const { headers:
|
|
3009
|
-
return
|
|
4109
|
+
const { headers: i } = this.requestConfig;
|
|
4110
|
+
return i ? i[t] = n : this.requestConfig.headers = { [t]: n }, this;
|
|
3010
4111
|
}
|
|
3011
4112
|
/**
|
|
3012
4113
|
* Change the client endpoint. All subsequent requests will send to this endpoint.
|
|
@@ -3015,47 +4116,40 @@ class Lt {
|
|
|
3015
4116
|
return this.url = t, this;
|
|
3016
4117
|
}
|
|
3017
4118
|
}
|
|
3018
|
-
const
|
|
3019
|
-
const { query: t, variables: n, fetchOptions:
|
|
3020
|
-
if (
|
|
3021
|
-
const { errors:
|
|
4119
|
+
const Pe = async (e) => {
|
|
4120
|
+
const { query: t, variables: n, fetchOptions: i } = e, r = vi(An(e.method ?? "post")), s = Array.isArray(e.query), o = await r(e), a = await Ai(o, i.jsonSerializer ?? ze), u = Array.isArray(a) ? !a.some(({ data: l }) => !l) : !!a.data, c = Array.isArray(a) || !a.errors || Array.isArray(a.errors) && !a.errors.length || i.errorPolicy === "all" || i.errorPolicy === "ignore";
|
|
4121
|
+
if (o.ok && c && u) {
|
|
4122
|
+
const { errors: l, ...f } = (Array.isArray(a), a), h = i.errorPolicy === "ignore" ? f : a;
|
|
3022
4123
|
return {
|
|
3023
|
-
...s ? { data:
|
|
3024
|
-
headers:
|
|
3025
|
-
status:
|
|
4124
|
+
...s ? { data: h } : h,
|
|
4125
|
+
headers: o.headers,
|
|
4126
|
+
status: o.status
|
|
3026
4127
|
};
|
|
3027
4128
|
} else {
|
|
3028
|
-
const
|
|
3029
|
-
error:
|
|
3030
|
-
} :
|
|
3031
|
-
throw new
|
|
4129
|
+
const l = typeof a == "string" ? {
|
|
4130
|
+
error: a
|
|
4131
|
+
} : a;
|
|
4132
|
+
throw new me(
|
|
3032
4133
|
// @ts-expect-error TODO
|
|
3033
|
-
{ ...
|
|
4134
|
+
{ ...l, status: o.status, headers: o.headers },
|
|
3034
4135
|
{ query: t, variables: n }
|
|
3035
4136
|
);
|
|
3036
4137
|
}
|
|
3037
|
-
}
|
|
3038
|
-
|
|
3039
|
-
const r = Ve(e, t, ...n);
|
|
3040
|
-
return new Lt(r.url).request({
|
|
3041
|
-
...r
|
|
3042
|
-
});
|
|
3043
|
-
}
|
|
3044
|
-
const Pt = (e, t, n, r) => {
|
|
3045
|
-
const i = r ?? he;
|
|
4138
|
+
}, Ti = (e, t, n, i) => {
|
|
4139
|
+
const r = i ?? ze;
|
|
3046
4140
|
if (!Array.isArray(e))
|
|
3047
|
-
return
|
|
4141
|
+
return r.stringify({ query: e, variables: t, operationName: n });
|
|
3048
4142
|
if (typeof t < "u" && !Array.isArray(t))
|
|
3049
4143
|
throw new Error("Cannot create request body with given variable type, array expected");
|
|
3050
|
-
const s = e.reduce((
|
|
3051
|
-
return
|
|
3052
|
-
},
|
|
4144
|
+
const s = e.reduce((o, a, u) => (o.push({ query: a, variables: t ? t[u] : void 0 }), o), []);
|
|
4145
|
+
return r.stringify(s);
|
|
4146
|
+
}, Ai = async (e, t) => {
|
|
3053
4147
|
let n;
|
|
3054
|
-
return e.headers.forEach((
|
|
3055
|
-
|
|
4148
|
+
return e.headers.forEach((i, r) => {
|
|
4149
|
+
r.toLowerCase() === "content-type" && (n = i);
|
|
3056
4150
|
}), n && (n.toLowerCase().startsWith("application/json") || n.toLowerCase().startsWith("application/graphql+json") || n.toLowerCase().startsWith("application/graphql-response+json")) ? t.parse(await e.text()) : e.text();
|
|
3057
|
-
},
|
|
3058
|
-
getMeta:
|
|
4151
|
+
}, Me = (e) => typeof e == "function" ? e() : e, Ii = (e, ...t) => e.reduce((n, i, r) => `${n}${i}${r in t ? String(t[r]) : ""}`, ""), Oi = {
|
|
4152
|
+
getMeta: Ii`
|
|
3059
4153
|
query getDoctype($doctype: String!) {
|
|
3060
4154
|
getMeta(doctype: $doctype) {
|
|
3061
4155
|
id
|
|
@@ -3066,10 +4160,33 @@ const Pt = (e, t, n, r) => {
|
|
|
3066
4160
|
}
|
|
3067
4161
|
}
|
|
3068
4162
|
`
|
|
3069
|
-
},
|
|
3070
|
-
|
|
4163
|
+
}, _i = (e) => JSON.parse(e, (t, n) => {
|
|
4164
|
+
if (typeof n == "string")
|
|
4165
|
+
try {
|
|
4166
|
+
return JSON.parse(n, (i, r) => typeof r == "string" && !isNaN(Number(r)) ? new le(r) : r);
|
|
4167
|
+
} catch {
|
|
4168
|
+
return n;
|
|
4169
|
+
}
|
|
4170
|
+
else if (!isNaN(Number(n)))
|
|
4171
|
+
return new le(n);
|
|
4172
|
+
return n;
|
|
4173
|
+
}), bi = {
|
|
4174
|
+
getMeta: async (e, t) => {
|
|
4175
|
+
const n = new wi(t || "/graphql", {
|
|
4176
|
+
jsonSerializer: {
|
|
4177
|
+
stringify: (r) => JSON.stringify(r),
|
|
4178
|
+
// process the request object before sending; leave as default JSON
|
|
4179
|
+
parse: _i
|
|
4180
|
+
// process the response meta object
|
|
4181
|
+
}
|
|
4182
|
+
}), { getMeta: i } = await n.request({
|
|
4183
|
+
document: Oi.getMeta,
|
|
4184
|
+
variables: { doctype: e }
|
|
4185
|
+
});
|
|
4186
|
+
return i;
|
|
4187
|
+
}
|
|
3071
4188
|
};
|
|
3072
4189
|
export {
|
|
3073
|
-
|
|
4190
|
+
bi as methods
|
|
3074
4191
|
};
|
|
3075
4192
|
//# sourceMappingURL=graphql-client.js.map
|