lingo.dev 0.63.1 → 0.70.1

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.
Files changed (61) hide show
  1. package/LICENSE.md +201 -0
  2. package/bin/cli.mjs +3 -1
  3. package/build/acorn-7GKKTQAZ.mjs +3047 -0
  4. package/build/acorn-C2XWIPGO.cjs +3047 -0
  5. package/build/angular-5ISIBFBY.mjs +2794 -0
  6. package/build/angular-XQHAJDB2.cjs +2794 -0
  7. package/build/api-7PZYRHW3.mjs +5 -0
  8. package/build/api-C35FHFLD.cjs +7 -0
  9. package/build/babel-DSN33ILH.cjs +6946 -0
  10. package/build/babel-ZNMMF5TX.mjs +6946 -0
  11. package/build/chunk-2AI774XU.cjs +130086 -0
  12. package/build/chunk-DAMIL4EZ.mjs +4533 -0
  13. package/build/chunk-HEBXNMVQ.mjs +48 -0
  14. package/build/chunk-IKCNLHD5.cjs +4533 -0
  15. package/build/chunk-L5BCMCQE.cjs +48 -0
  16. package/build/chunk-MUWDGJF2.mjs +962 -0
  17. package/build/chunk-XFD3AFWA.mjs +130086 -0
  18. package/build/chunk-ZXT7SLL5.cjs +962 -0
  19. package/build/cli.cjs +134752 -0
  20. package/build/cli.d.cts +3 -0
  21. package/build/cli.d.ts +3 -0
  22. package/build/cli.mjs +134745 -0
  23. package/build/estree-2CSK435T.mjs +4374 -0
  24. package/build/estree-N7T576SJ.cjs +4374 -0
  25. package/build/flow-IBTCTNRO.mjs +26897 -0
  26. package/build/flow-Y3OXWML5.cjs +26897 -0
  27. package/build/glimmer-FCD5RY7E.mjs +2847 -0
  28. package/build/glimmer-N5YT5DMK.cjs +2847 -0
  29. package/build/graphql-4DMZI42L.mjs +1247 -0
  30. package/build/graphql-GV4OMB3Z.cjs +1247 -0
  31. package/build/html-RNXFERLB.mjs +2716 -0
  32. package/build/html-XMA5LP2U.cjs +2716 -0
  33. package/build/markdown-6BIFNHAV.mjs +3484 -0
  34. package/build/markdown-LUUZAIEE.cjs +3484 -0
  35. package/build/meriyah-IV6VMAUC.mjs +2474 -0
  36. package/build/meriyah-XSJDPEN3.cjs +2474 -0
  37. package/build/postcss-PDIS5YQZ.cjs +5057 -0
  38. package/build/postcss-SDQEBDMO.mjs +5057 -0
  39. package/build/sdk.cjs +8 -0
  40. package/build/sdk.d.cts +1 -0
  41. package/build/sdk.d.ts +1 -0
  42. package/build/sdk.mjs +8 -0
  43. package/build/spec.cjs +47 -0
  44. package/build/spec.d.cts +1 -0
  45. package/build/spec.d.ts +1 -0
  46. package/build/spec.mjs +47 -0
  47. package/build/typescript-TT5RRHSS.cjs +13104 -0
  48. package/build/typescript-U5HXARXA.mjs +13104 -0
  49. package/build/yaml-6ITWGIVF.cjs +4223 -0
  50. package/build/yaml-DDDZYPIN.mjs +4223 -0
  51. package/package.json +26 -25
  52. package/readme.md +5 -16
  53. package/build/react-next.cjs +0 -2
  54. package/build/react-next.d.cts +0 -1
  55. package/build/react-next.d.ts +0 -1
  56. package/build/react-next.mjs +0 -2
  57. package/build/react.cjs +0 -2
  58. package/build/react.d.cts +0 -2
  59. package/build/react.d.ts +0 -2
  60. package/build/react.mjs +0 -2
  61. package/content/banner.png +0 -0
@@ -0,0 +1,1247 @@
1
+ import "./chunk-HEBXNMVQ.mjs";
2
+
3
+ // ../node_modules/.pnpm/prettier@3.4.2/node_modules/prettier/plugins/graphql.mjs
4
+ var tt = Object.defineProperty;
5
+ var Ne = (e2, t) => {
6
+ for (var n in t) tt(e2, n, { get: t[n], enumerable: true });
7
+ };
8
+ var Te = {};
9
+ Ne(Te, { languages: () => Pe, options: () => we, parsers: () => Ee, printers: () => sn });
10
+ var nt = (e2, t, n, r) => {
11
+ if (!(e2 && t == null)) return t.replaceAll ? t.replaceAll(n, r) : n.global ? t.replace(n, r) : t.split(n).join(r);
12
+ };
13
+ var Y = nt;
14
+ var re = "indent";
15
+ var se = "group";
16
+ var oe = "if-break";
17
+ var P = "line";
18
+ var ae = "break-parent";
19
+ var xe = () => {
20
+ };
21
+ var b = xe;
22
+ var ce = xe;
23
+ function x(e2) {
24
+ return b(e2), { type: re, contents: e2 };
25
+ }
26
+ function y(e2, t = {}) {
27
+ return b(e2), ce(t.expandedStates, true), { type: se, id: t.id, contents: e2, break: !!t.shouldBreak, expandedStates: t.expandedStates };
28
+ }
29
+ function O(e2, t = "", n = {}) {
30
+ return b(e2), t !== "" && b(t), { type: oe, breakContents: e2, flatContents: t, groupId: n.groupId };
31
+ }
32
+ var mt = { type: ae };
33
+ var Et = { type: P, hard: true };
34
+ var k = { type: P };
35
+ var p = { type: P, soft: true };
36
+ var f = [Et, mt];
37
+ function E(e2, t) {
38
+ b(e2), ce(t);
39
+ let n = [];
40
+ for (let r = 0; r < t.length; r++) r !== 0 && n.push(e2), n.push(t[r]);
41
+ return n;
42
+ }
43
+ function j(e2) {
44
+ return (t, n, r) => {
45
+ let i = !!(r != null && r.backwards);
46
+ if (n === false) return false;
47
+ let { length: s } = t, a = n;
48
+ for (; a >= 0 && a < s; ) {
49
+ let u = t.charAt(a);
50
+ if (e2 instanceof RegExp) {
51
+ if (!e2.test(u)) return a;
52
+ } else if (!e2.includes(u)) return a;
53
+ i ? a-- : a++;
54
+ }
55
+ return a === -1 || a === s ? a : false;
56
+ };
57
+ }
58
+ var An = j(/\s/u);
59
+ var G = j(" ");
60
+ var _e = j(",; ");
61
+ var ye = j(/[^\n\r]/u);
62
+ function Tt(e2, t, n) {
63
+ let r = !!(n != null && n.backwards);
64
+ if (t === false) return false;
65
+ let i = e2.charAt(t);
66
+ if (r) {
67
+ if (e2.charAt(t - 1) === "\r" && i === `
68
+ `) return t - 2;
69
+ if (i === `
70
+ ` || i === "\r" || i === "\u2028" || i === "\u2029") return t - 1;
71
+ } else {
72
+ if (i === "\r" && e2.charAt(t + 1) === `
73
+ `) return t + 2;
74
+ if (i === `
75
+ ` || i === "\r" || i === "\u2028" || i === "\u2029") return t + 1;
76
+ }
77
+ return t;
78
+ }
79
+ var $ = Tt;
80
+ function Nt(e2, t, n = {}) {
81
+ let r = G(e2, n.backwards ? t - 1 : t, n), i = $(e2, r, n);
82
+ return r !== i;
83
+ }
84
+ var Ie = Nt;
85
+ function xt(e2, t) {
86
+ if (t === false) return false;
87
+ if (e2.charAt(t) === "/" && e2.charAt(t + 1) === "*") {
88
+ for (let n = t + 2; n < e2.length; ++n) if (e2.charAt(n) === "*" && e2.charAt(n + 1) === "/") return n + 2;
89
+ }
90
+ return t;
91
+ }
92
+ var Oe = xt;
93
+ function _t(e2, t) {
94
+ return t === false ? false : e2.charAt(t) === "/" && e2.charAt(t + 1) === "/" ? ye(e2, t) : t;
95
+ }
96
+ var De = _t;
97
+ function yt(e2, t) {
98
+ let n = null, r = t;
99
+ for (; r !== n; ) n = r, r = _e(e2, r), r = Oe(e2, r), r = G(e2, r);
100
+ return r = De(e2, r), r = $(e2, r), r !== false && Ie(e2, r);
101
+ }
102
+ var Ae = yt;
103
+ function It(e2) {
104
+ return Array.isArray(e2) && e2.length > 0;
105
+ }
106
+ var ue = It;
107
+ var le = class extends Error {
108
+ name = "UnexpectedNodeError";
109
+ constructor(t, n, r = "type") {
110
+ super(`Unexpected ${n} node ${r}: ${JSON.stringify(t[r])}.`), this.node = t;
111
+ }
112
+ };
113
+ var ge = le;
114
+ var F = null;
115
+ function w(e2) {
116
+ if (F !== null && typeof F.property) {
117
+ let t = F;
118
+ return F = w.prototype = null, t;
119
+ }
120
+ return F = w.prototype = e2 ?? /* @__PURE__ */ Object.create(null), new w();
121
+ }
122
+ var Ot = 10;
123
+ for (let e2 = 0; e2 <= Ot; e2++) w();
124
+ function pe(e2) {
125
+ return w(e2);
126
+ }
127
+ function Dt(e2, t = "type") {
128
+ pe(e2);
129
+ function n(r) {
130
+ let i = r[t], s = e2[i];
131
+ if (!Array.isArray(s)) throw Object.assign(new Error(`Missing visitor keys for '${i}'.`), { node: r });
132
+ return s;
133
+ }
134
+ return n;
135
+ }
136
+ var ke = Dt;
137
+ var J = class {
138
+ constructor(t, n, r) {
139
+ this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source = r;
140
+ }
141
+ get [Symbol.toStringTag]() {
142
+ return "Location";
143
+ }
144
+ toJSON() {
145
+ return { start: this.start, end: this.end };
146
+ }
147
+ };
148
+ var V = class {
149
+ constructor(t, n, r, i, s, a) {
150
+ this.kind = t, this.start = n, this.end = r, this.line = i, this.column = s, this.value = a, this.prev = null, this.next = null;
151
+ }
152
+ get [Symbol.toStringTag]() {
153
+ return "Token";
154
+ }
155
+ toJSON() {
156
+ return { kind: this.kind, value: this.value, line: this.line, column: this.column };
157
+ }
158
+ };
159
+ var X = { Name: [], Document: ["definitions"], OperationDefinition: ["name", "variableDefinitions", "directives", "selectionSet"], VariableDefinition: ["variable", "type", "defaultValue", "directives"], Variable: ["name"], SelectionSet: ["selections"], Field: ["alias", "name", "arguments", "directives", "selectionSet"], Argument: ["name", "value"], FragmentSpread: ["name", "directives"], InlineFragment: ["typeCondition", "directives", "selectionSet"], FragmentDefinition: ["name", "variableDefinitions", "typeCondition", "directives", "selectionSet"], IntValue: [], FloatValue: [], StringValue: [], BooleanValue: [], NullValue: [], EnumValue: [], ListValue: ["values"], ObjectValue: ["fields"], ObjectField: ["name", "value"], Directive: ["name", "arguments"], NamedType: ["name"], ListType: ["type"], NonNullType: ["type"], SchemaDefinition: ["description", "directives", "operationTypes"], OperationTypeDefinition: ["type"], ScalarTypeDefinition: ["description", "name", "directives"], ObjectTypeDefinition: ["description", "name", "interfaces", "directives", "fields"], FieldDefinition: ["description", "name", "arguments", "type", "directives"], InputValueDefinition: ["description", "name", "type", "defaultValue", "directives"], InterfaceTypeDefinition: ["description", "name", "interfaces", "directives", "fields"], UnionTypeDefinition: ["description", "name", "directives", "types"], EnumTypeDefinition: ["description", "name", "directives", "values"], EnumValueDefinition: ["description", "name", "directives"], InputObjectTypeDefinition: ["description", "name", "directives", "fields"], DirectiveDefinition: ["description", "name", "arguments", "locations"], SchemaExtension: ["directives", "operationTypes"], ScalarTypeExtension: ["name", "directives"], ObjectTypeExtension: ["name", "interfaces", "directives", "fields"], InterfaceTypeExtension: ["name", "interfaces", "directives", "fields"], UnionTypeExtension: ["name", "directives", "types"], EnumTypeExtension: ["name", "directives", "values"], InputObjectTypeExtension: ["name", "directives", "fields"] };
160
+ var Jn = new Set(Object.keys(X));
161
+ var S;
162
+ (function(e2) {
163
+ e2.QUERY = "query", e2.MUTATION = "mutation", e2.SUBSCRIPTION = "subscription";
164
+ })(S || (S = {}));
165
+ var At = ke(X, "kind");
166
+ var Se = At;
167
+ function q(e2) {
168
+ return e2.loc.start;
169
+ }
170
+ function Q(e2) {
171
+ return e2.loc.end;
172
+ }
173
+ function Ce(e2) {
174
+ return /^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/u.test(e2);
175
+ }
176
+ function ve(e2) {
177
+ return `# @format
178
+
179
+ ` + e2;
180
+ }
181
+ function gt(e2, t, n) {
182
+ let { node: r } = e2;
183
+ if (!r.description) return "";
184
+ let i = [n("description")];
185
+ return r.kind === "InputValueDefinition" && !r.description.block ? i.push(k) : i.push(f), i;
186
+ }
187
+ var A = gt;
188
+ function kt(e2, t, n) {
189
+ let { node: r } = e2;
190
+ switch (r.kind) {
191
+ case "Document":
192
+ return [...E(f, g(e2, t, n, "definitions")), f];
193
+ case "OperationDefinition": {
194
+ let i = t.originalText[q(r)] !== "{", s = !!r.name;
195
+ return [i ? r.operation : "", i && s ? [" ", n("name")] : "", i && !s && ue(r.variableDefinitions) ? " " : "", be(e2, n), _(e2, n, r), !i && !s ? "" : " ", n("selectionSet")];
196
+ }
197
+ case "FragmentDefinition":
198
+ return ["fragment ", n("name"), be(e2, n), " on ", n("typeCondition"), _(e2, n, r), " ", n("selectionSet")];
199
+ case "SelectionSet":
200
+ return ["{", x([f, E(f, g(e2, t, n, "selections"))]), f, "}"];
201
+ case "Field":
202
+ return y([r.alias ? [n("alias"), ": "] : "", n("name"), r.arguments.length > 0 ? y(["(", x([p, E([O("", ", "), p], g(e2, t, n, "arguments"))]), p, ")"]) : "", _(e2, n, r), r.selectionSet ? " " : "", n("selectionSet")]);
203
+ case "Name":
204
+ return r.value;
205
+ case "StringValue":
206
+ if (r.block) {
207
+ let i = Y(false, r.value, '"""', String.raw`\"""`).split(`
208
+ `);
209
+ return i.length === 1 && (i[0] = i[0].trim()), i.every((s) => s === "") && (i.length = 0), E(f, ['"""', ...i, '"""']);
210
+ }
211
+ return ['"', Y(false, Y(false, r.value, /["\\]/gu, String.raw`\$&`), `
212
+ `, String.raw`\n`), '"'];
213
+ case "IntValue":
214
+ case "FloatValue":
215
+ case "EnumValue":
216
+ return r.value;
217
+ case "BooleanValue":
218
+ return r.value ? "true" : "false";
219
+ case "NullValue":
220
+ return "null";
221
+ case "Variable":
222
+ return ["$", n("name")];
223
+ case "ListValue":
224
+ return y(["[", x([p, E([O("", ", "), p], e2.map(n, "values"))]), p, "]"]);
225
+ case "ObjectValue": {
226
+ let i = t.bracketSpacing && r.fields.length > 0 ? " " : "";
227
+ return y(["{", i, x([p, E([O("", ", "), p], e2.map(n, "fields"))]), p, O("", i), "}"]);
228
+ }
229
+ case "ObjectField":
230
+ case "Argument":
231
+ return [n("name"), ": ", n("value")];
232
+ case "Directive":
233
+ return ["@", n("name"), r.arguments.length > 0 ? y(["(", x([p, E([O("", ", "), p], g(e2, t, n, "arguments"))]), p, ")"]) : ""];
234
+ case "NamedType":
235
+ return n("name");
236
+ case "VariableDefinition":
237
+ return [n("variable"), ": ", n("type"), r.defaultValue ? [" = ", n("defaultValue")] : "", _(e2, n, r)];
238
+ case "ObjectTypeExtension":
239
+ case "ObjectTypeDefinition":
240
+ case "InputObjectTypeExtension":
241
+ case "InputObjectTypeDefinition":
242
+ case "InterfaceTypeExtension":
243
+ case "InterfaceTypeDefinition": {
244
+ let { kind: i } = r, s = [];
245
+ return i.endsWith("TypeDefinition") ? s.push(A(e2, t, n)) : s.push("extend "), i.startsWith("ObjectType") ? s.push("type") : i.startsWith("InputObjectType") ? s.push("input") : s.push("interface"), s.push(" ", n("name")), !i.startsWith("InputObjectType") && r.interfaces.length > 0 && s.push(" implements ", ...vt(e2, t, n)), s.push(_(e2, n, r)), r.fields.length > 0 && s.push([" {", x([f, E(f, g(e2, t, n, "fields"))]), f, "}"]), s;
246
+ }
247
+ case "FieldDefinition":
248
+ return [A(e2, t, n), n("name"), r.arguments.length > 0 ? y(["(", x([p, E([O("", ", "), p], g(e2, t, n, "arguments"))]), p, ")"]) : "", ": ", n("type"), _(e2, n, r)];
249
+ case "DirectiveDefinition":
250
+ return [A(e2, t, n), "directive ", "@", n("name"), r.arguments.length > 0 ? y(["(", x([p, E([O("", ", "), p], g(e2, t, n, "arguments"))]), p, ")"]) : "", r.repeatable ? " repeatable" : "", " on ", ...E(" | ", e2.map(n, "locations"))];
251
+ case "EnumTypeExtension":
252
+ case "EnumTypeDefinition":
253
+ return [A(e2, t, n), r.kind === "EnumTypeExtension" ? "extend " : "", "enum ", n("name"), _(e2, n, r), r.values.length > 0 ? [" {", x([f, E(f, g(e2, t, n, "values"))]), f, "}"] : ""];
254
+ case "EnumValueDefinition":
255
+ return [A(e2, t, n), n("name"), _(e2, n, r)];
256
+ case "InputValueDefinition":
257
+ return [A(e2, t, n), n("name"), ": ", n("type"), r.defaultValue ? [" = ", n("defaultValue")] : "", _(e2, n, r)];
258
+ case "SchemaExtension":
259
+ return ["extend schema", _(e2, n, r), ...r.operationTypes.length > 0 ? [" {", x([f, E(f, g(e2, t, n, "operationTypes"))]), f, "}"] : []];
260
+ case "SchemaDefinition":
261
+ return [A(e2, t, n), "schema", _(e2, n, r), " {", r.operationTypes.length > 0 ? x([f, E(f, g(e2, t, n, "operationTypes"))]) : "", f, "}"];
262
+ case "OperationTypeDefinition":
263
+ return [r.operation, ": ", n("type")];
264
+ case "FragmentSpread":
265
+ return ["...", n("name"), _(e2, n, r)];
266
+ case "InlineFragment":
267
+ return ["...", r.typeCondition ? [" on ", n("typeCondition")] : "", _(e2, n, r), " ", n("selectionSet")];
268
+ case "UnionTypeExtension":
269
+ case "UnionTypeDefinition":
270
+ return y([A(e2, t, n), y([r.kind === "UnionTypeExtension" ? "extend " : "", "union ", n("name"), _(e2, n, r), r.types.length > 0 ? [" =", O("", " "), x([O([k, "| "]), E([k, "| "], e2.map(n, "types"))])] : ""])]);
271
+ case "ScalarTypeExtension":
272
+ case "ScalarTypeDefinition":
273
+ return [A(e2, t, n), r.kind === "ScalarTypeExtension" ? "extend " : "", "scalar ", n("name"), _(e2, n, r)];
274
+ case "NonNullType":
275
+ return [n("type"), "!"];
276
+ case "ListType":
277
+ return ["[", n("type"), "]"];
278
+ default:
279
+ throw new ge(r, "Graphql", "kind");
280
+ }
281
+ }
282
+ function _(e2, t, n) {
283
+ if (n.directives.length === 0) return "";
284
+ let r = E(k, e2.map(t, "directives"));
285
+ return n.kind === "FragmentDefinition" || n.kind === "OperationDefinition" ? y([k, r]) : [" ", y(x([p, r]))];
286
+ }
287
+ function g(e2, t, n, r) {
288
+ return e2.map(({ isLast: i, node: s }) => {
289
+ let a = n();
290
+ return !i && Ae(t.originalText, Q(s)) ? [a, f] : a;
291
+ }, r);
292
+ }
293
+ function St(e2) {
294
+ return e2.kind !== "Comment";
295
+ }
296
+ function Ct(e2) {
297
+ let t = e2.node;
298
+ if (t.kind === "Comment") return "#" + t.value.trimEnd();
299
+ throw new Error("Not a comment: " + JSON.stringify(t));
300
+ }
301
+ function vt(e2, t, n) {
302
+ let { node: r } = e2, i = [], { interfaces: s } = r, a = e2.map(n, "interfaces");
303
+ for (let u = 0; u < s.length; u++) {
304
+ let l = s[u];
305
+ i.push(a[u]);
306
+ let T = s[u + 1];
307
+ if (T) {
308
+ let D = t.originalText.slice(l.loc.end, T.loc.start).includes("#");
309
+ i.push(" &", D ? k : " ");
310
+ }
311
+ }
312
+ return i;
313
+ }
314
+ function be(e2, t) {
315
+ let { node: n } = e2;
316
+ return ue(n.variableDefinitions) ? y(["(", x([p, E([O("", ", "), p], e2.map(t, "variableDefinitions"))]), p, ")"]) : "";
317
+ }
318
+ function Le(e2, t) {
319
+ e2.kind === "StringValue" && e2.block && !e2.value.includes(`
320
+ `) && (t.value = e2.value.trim());
321
+ }
322
+ Le.ignoredProperties = /* @__PURE__ */ new Set(["loc", "comments"]);
323
+ function bt(e2) {
324
+ var n;
325
+ let { node: t } = e2;
326
+ return (n = t == null ? void 0 : t.comments) == null ? void 0 : n.some((r) => r.value.trim() === "prettier-ignore");
327
+ }
328
+ var Lt = { print: kt, massageAstNode: Le, hasPrettierIgnore: bt, insertPragma: ve, printComment: Ct, canAttachComment: St, getVisitorKeys: Se };
329
+ var Re = Lt;
330
+ var Pe = [{ linguistLanguageId: 139, name: "GraphQL", type: "data", color: "#e10098", extensions: [".graphql", ".gql", ".graphqls"], tmScope: "source.graphql", aceMode: "text", parsers: ["graphql"], vscodeLanguageIds: ["graphql"] }];
331
+ var Fe = { bracketSpacing: { category: "Common", type: "boolean", default: true, description: "Print spaces between brackets.", oppositeDescription: "Do not print spaces between brackets." }, singleQuote: { category: "Common", type: "boolean", default: false, description: "Use single quotes instead of double quotes." }, proseWrap: { category: "Common", type: "choice", default: "preserve", description: "How to wrap prose.", choices: [{ value: "always", description: "Wrap prose if it exceeds the print width." }, { value: "never", description: "Do not wrap prose." }, { value: "preserve", description: "Wrap prose as-is." }] }, bracketSameLine: { category: "Common", type: "boolean", default: false, description: "Put > of opening tags on the last line instead of on a new line." }, singleAttributePerLine: { category: "Common", type: "boolean", default: false, description: "Enforce single attribute per line in HTML, Vue and JSX." } };
332
+ var Rt = { bracketSpacing: Fe.bracketSpacing };
333
+ var we = Rt;
334
+ var Ee = {};
335
+ Ne(Ee, { graphql: () => rn });
336
+ function Ve(e2) {
337
+ return typeof e2 == "object" && e2 !== null;
338
+ }
339
+ function Be(e2, t) {
340
+ if (!!!e2) throw new Error(t ?? "Unexpected invariant triggered.");
341
+ }
342
+ var Pt = /\r\n|[\n\r]/g;
343
+ function B(e2, t) {
344
+ let n = 0, r = 1;
345
+ for (let i of e2.body.matchAll(Pt)) {
346
+ if (typeof i.index == "number" || Be(false), i.index >= t) break;
347
+ n = i.index + i[0].length, r += 1;
348
+ }
349
+ return { line: r, column: t + 1 - n };
350
+ }
351
+ function Me(e2) {
352
+ return fe(e2.source, B(e2.source, e2.start));
353
+ }
354
+ function fe(e2, t) {
355
+ let n = e2.locationOffset.column - 1, r = "".padStart(n) + e2.body, i = t.line - 1, s = e2.locationOffset.line - 1, a = t.line + s, u = t.line === 1 ? n : 0, l = t.column + u, T = `${e2.name}:${a}:${l}
356
+ `, h = r.split(/\r\n|[\n\r]/g), D = h[i];
357
+ if (D.length > 120) {
358
+ let I = Math.floor(l / 80), ie = l % 80, N = [];
359
+ for (let v = 0; v < D.length; v += 80) N.push(D.slice(v, v + 80));
360
+ return T + Ue([[`${a} |`, N[0]], ...N.slice(1, I + 1).map((v) => ["|", v]), ["|", "^".padStart(ie)], ["|", N[I + 1]]]);
361
+ }
362
+ return T + Ue([[`${a - 1} |`, h[i - 1]], [`${a} |`, D], ["|", "^".padStart(l)], [`${a + 1} |`, h[i + 1]]]);
363
+ }
364
+ function Ue(e2) {
365
+ let t = e2.filter(([r, i]) => i !== void 0), n = Math.max(...t.map(([r]) => r.length));
366
+ return t.map(([r, i]) => r.padStart(n) + (i ? " " + i : "")).join(`
367
+ `);
368
+ }
369
+ function Ft(e2) {
370
+ let t = e2[0];
371
+ return t == null || "kind" in t || "length" in t ? { nodes: t, source: e2[1], positions: e2[2], path: e2[3], originalError: e2[4], extensions: e2[5] } : t;
372
+ }
373
+ var W = class e extends Error {
374
+ constructor(t, ...n) {
375
+ var r, i, s;
376
+ let { nodes: a, source: u, positions: l, path: T, originalError: h, extensions: D } = Ft(n);
377
+ super(t), this.name = "GraphQLError", this.path = T ?? void 0, this.originalError = h ?? void 0, this.nodes = Ye(Array.isArray(a) ? a : a ? [a] : void 0);
378
+ let I = Ye((r = this.nodes) === null || r === void 0 ? void 0 : r.map((N) => N.loc).filter((N) => N != null));
379
+ this.source = u ?? (I == null || (i = I[0]) === null || i === void 0 ? void 0 : i.source), this.positions = l ?? (I == null ? void 0 : I.map((N) => N.start)), this.locations = l && u ? l.map((N) => B(u, N)) : I == null ? void 0 : I.map((N) => B(N.source, N.start));
380
+ let ie = Ve(h == null ? void 0 : h.extensions) ? h == null ? void 0 : h.extensions : void 0;
381
+ this.extensions = (s = D ?? ie) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, { message: { writable: true, enumerable: true }, name: { enumerable: false }, nodes: { enumerable: false }, source: { enumerable: false }, positions: { enumerable: false }, originalError: { enumerable: false } }), h != null && h.stack ? Object.defineProperty(this, "stack", { value: h.stack, writable: true, configurable: true }) : Error.captureStackTrace ? Error.captureStackTrace(this, e) : Object.defineProperty(this, "stack", { value: Error().stack, writable: true, configurable: true });
382
+ }
383
+ get [Symbol.toStringTag]() {
384
+ return "GraphQLError";
385
+ }
386
+ toString() {
387
+ let t = this.message;
388
+ if (this.nodes) for (let n of this.nodes) n.loc && (t += `
389
+
390
+ ` + Me(n.loc));
391
+ else if (this.source && this.locations) for (let n of this.locations) t += `
392
+
393
+ ` + fe(this.source, n);
394
+ return t;
395
+ }
396
+ toJSON() {
397
+ let t = { message: this.message };
398
+ 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;
399
+ }
400
+ };
401
+ function Ye(e2) {
402
+ return e2 === void 0 || e2.length === 0 ? void 0 : e2;
403
+ }
404
+ function d(e2, t, n) {
405
+ return new W(`Syntax Error: ${n}`, { source: e2, positions: [t] });
406
+ }
407
+ var H;
408
+ (function(e2) {
409
+ e2.QUERY = "QUERY", e2.MUTATION = "MUTATION", e2.SUBSCRIPTION = "SUBSCRIPTION", e2.FIELD = "FIELD", e2.FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", e2.FRAGMENT_SPREAD = "FRAGMENT_SPREAD", e2.INLINE_FRAGMENT = "INLINE_FRAGMENT", e2.VARIABLE_DEFINITION = "VARIABLE_DEFINITION", e2.SCHEMA = "SCHEMA", e2.SCALAR = "SCALAR", e2.OBJECT = "OBJECT", e2.FIELD_DEFINITION = "FIELD_DEFINITION", e2.ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", e2.INTERFACE = "INTERFACE", e2.UNION = "UNION", e2.ENUM = "ENUM", e2.ENUM_VALUE = "ENUM_VALUE", e2.INPUT_OBJECT = "INPUT_OBJECT", e2.INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION";
410
+ })(H || (H = {}));
411
+ var c;
412
+ (function(e2) {
413
+ e2.NAME = "Name", e2.DOCUMENT = "Document", e2.OPERATION_DEFINITION = "OperationDefinition", e2.VARIABLE_DEFINITION = "VariableDefinition", e2.SELECTION_SET = "SelectionSet", e2.FIELD = "Field", e2.ARGUMENT = "Argument", e2.FRAGMENT_SPREAD = "FragmentSpread", e2.INLINE_FRAGMENT = "InlineFragment", e2.FRAGMENT_DEFINITION = "FragmentDefinition", e2.VARIABLE = "Variable", e2.INT = "IntValue", e2.FLOAT = "FloatValue", e2.STRING = "StringValue", e2.BOOLEAN = "BooleanValue", e2.NULL = "NullValue", e2.ENUM = "EnumValue", e2.LIST = "ListValue", e2.OBJECT = "ObjectValue", e2.OBJECT_FIELD = "ObjectField", e2.DIRECTIVE = "Directive", e2.NAMED_TYPE = "NamedType", e2.LIST_TYPE = "ListType", e2.NON_NULL_TYPE = "NonNullType", e2.SCHEMA_DEFINITION = "SchemaDefinition", e2.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", e2.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", e2.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", e2.FIELD_DEFINITION = "FieldDefinition", e2.INPUT_VALUE_DEFINITION = "InputValueDefinition", e2.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", e2.UNION_TYPE_DEFINITION = "UnionTypeDefinition", e2.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", e2.ENUM_VALUE_DEFINITION = "EnumValueDefinition", e2.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", e2.DIRECTIVE_DEFINITION = "DirectiveDefinition", e2.SCHEMA_EXTENSION = "SchemaExtension", e2.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", e2.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", e2.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", e2.UNION_TYPE_EXTENSION = "UnionTypeExtension", e2.ENUM_TYPE_EXTENSION = "EnumTypeExtension", e2.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension";
414
+ })(c || (c = {}));
415
+ function je(e2) {
416
+ return e2 === 9 || e2 === 32;
417
+ }
418
+ function L(e2) {
419
+ return e2 >= 48 && e2 <= 57;
420
+ }
421
+ function Ge(e2) {
422
+ return e2 >= 97 && e2 <= 122 || e2 >= 65 && e2 <= 90;
423
+ }
424
+ function he(e2) {
425
+ return Ge(e2) || e2 === 95;
426
+ }
427
+ function $e(e2) {
428
+ return Ge(e2) || L(e2) || e2 === 95;
429
+ }
430
+ function Je(e2) {
431
+ var t;
432
+ let n = Number.MAX_SAFE_INTEGER, r = null, i = -1;
433
+ for (let a = 0; a < e2.length; ++a) {
434
+ var s;
435
+ let u = e2[a], l = wt(u);
436
+ l !== u.length && (r = (s = r) !== null && s !== void 0 ? s : a, i = a, a !== 0 && l < n && (n = l));
437
+ }
438
+ return e2.map((a, u) => u === 0 ? a : a.slice(n)).slice((t = r) !== null && t !== void 0 ? t : 0, i + 1);
439
+ }
440
+ function wt(e2) {
441
+ let t = 0;
442
+ for (; t < e2.length && je(e2.charCodeAt(t)); ) ++t;
443
+ return t;
444
+ }
445
+ var o;
446
+ (function(e2) {
447
+ e2.SOF = "<SOF>", e2.EOF = "<EOF>", e2.BANG = "!", e2.DOLLAR = "$", e2.AMP = "&", e2.PAREN_L = "(", e2.PAREN_R = ")", e2.SPREAD = "...", e2.COLON = ":", e2.EQUALS = "=", e2.AT = "@", e2.BRACKET_L = "[", e2.BRACKET_R = "]", e2.BRACE_L = "{", e2.PIPE = "|", e2.BRACE_R = "}", e2.NAME = "Name", e2.INT = "Int", e2.FLOAT = "Float", e2.STRING = "String", e2.BLOCK_STRING = "BlockString", e2.COMMENT = "Comment";
448
+ })(o || (o = {}));
449
+ var z = class {
450
+ constructor(t) {
451
+ let n = new V(o.SOF, 0, 0, 0, 0);
452
+ this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
453
+ }
454
+ get [Symbol.toStringTag]() {
455
+ return "Lexer";
456
+ }
457
+ advance() {
458
+ return this.lastToken = this.token, this.token = this.lookahead();
459
+ }
460
+ lookahead() {
461
+ let t = this.token;
462
+ if (t.kind !== o.EOF) do
463
+ if (t.next) t = t.next;
464
+ else {
465
+ let n = Vt(this, t.end);
466
+ t.next = n, n.prev = t, t = n;
467
+ }
468
+ while (t.kind === o.COMMENT);
469
+ return t;
470
+ }
471
+ };
472
+ function qe(e2) {
473
+ return e2 === o.BANG || e2 === o.DOLLAR || e2 === o.AMP || e2 === o.PAREN_L || e2 === o.PAREN_R || e2 === o.SPREAD || e2 === o.COLON || e2 === o.EQUALS || e2 === o.AT || e2 === o.BRACKET_L || e2 === o.BRACKET_R || e2 === o.BRACE_L || e2 === o.PIPE || e2 === o.BRACE_R;
474
+ }
475
+ function R(e2) {
476
+ return e2 >= 0 && e2 <= 55295 || e2 >= 57344 && e2 <= 1114111;
477
+ }
478
+ function K(e2, t) {
479
+ return Qe(e2.charCodeAt(t)) && We(e2.charCodeAt(t + 1));
480
+ }
481
+ function Qe(e2) {
482
+ return e2 >= 55296 && e2 <= 56319;
483
+ }
484
+ function We(e2) {
485
+ return e2 >= 56320 && e2 <= 57343;
486
+ }
487
+ function C(e2, t) {
488
+ let n = e2.source.body.codePointAt(t);
489
+ if (n === void 0) return o.EOF;
490
+ if (n >= 32 && n <= 126) {
491
+ let r = String.fromCodePoint(n);
492
+ return r === '"' ? `'"'` : `"${r}"`;
493
+ }
494
+ return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
495
+ }
496
+ function m(e2, t, n, r, i) {
497
+ let s = e2.line, a = 1 + n - e2.lineStart;
498
+ return new V(t, n, r, s, a, i);
499
+ }
500
+ function Vt(e2, t) {
501
+ let n = e2.source.body, r = n.length, i = t;
502
+ for (; i < r; ) {
503
+ let s = n.charCodeAt(i);
504
+ switch (s) {
505
+ case 65279:
506
+ case 9:
507
+ case 32:
508
+ case 44:
509
+ ++i;
510
+ continue;
511
+ case 10:
512
+ ++i, ++e2.line, e2.lineStart = i;
513
+ continue;
514
+ case 13:
515
+ n.charCodeAt(i + 1) === 10 ? i += 2 : ++i, ++e2.line, e2.lineStart = i;
516
+ continue;
517
+ case 35:
518
+ return Bt(e2, i);
519
+ case 33:
520
+ return m(e2, o.BANG, i, i + 1);
521
+ case 36:
522
+ return m(e2, o.DOLLAR, i, i + 1);
523
+ case 38:
524
+ return m(e2, o.AMP, i, i + 1);
525
+ case 40:
526
+ return m(e2, o.PAREN_L, i, i + 1);
527
+ case 41:
528
+ return m(e2, o.PAREN_R, i, i + 1);
529
+ case 46:
530
+ if (n.charCodeAt(i + 1) === 46 && n.charCodeAt(i + 2) === 46) return m(e2, o.SPREAD, i, i + 3);
531
+ break;
532
+ case 58:
533
+ return m(e2, o.COLON, i, i + 1);
534
+ case 61:
535
+ return m(e2, o.EQUALS, i, i + 1);
536
+ case 64:
537
+ return m(e2, o.AT, i, i + 1);
538
+ case 91:
539
+ return m(e2, o.BRACKET_L, i, i + 1);
540
+ case 93:
541
+ return m(e2, o.BRACKET_R, i, i + 1);
542
+ case 123:
543
+ return m(e2, o.BRACE_L, i, i + 1);
544
+ case 124:
545
+ return m(e2, o.PIPE, i, i + 1);
546
+ case 125:
547
+ return m(e2, o.BRACE_R, i, i + 1);
548
+ case 34:
549
+ return n.charCodeAt(i + 1) === 34 && n.charCodeAt(i + 2) === 34 ? $t(e2, i) : Mt(e2, i);
550
+ }
551
+ if (L(s) || s === 45) return Ut(e2, i, s);
552
+ if (he(s)) return Jt(e2, i);
553
+ throw d(e2.source, i, s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : R(s) || K(n, i) ? `Unexpected character: ${C(e2, i)}.` : `Invalid character: ${C(e2, i)}.`);
554
+ }
555
+ return m(e2, o.EOF, r, r);
556
+ }
557
+ function Bt(e2, t) {
558
+ let n = e2.source.body, r = n.length, i = t + 1;
559
+ for (; i < r; ) {
560
+ let s = n.charCodeAt(i);
561
+ if (s === 10 || s === 13) break;
562
+ if (R(s)) ++i;
563
+ else if (K(n, i)) i += 2;
564
+ else break;
565
+ }
566
+ return m(e2, o.COMMENT, t, i, n.slice(t + 1, i));
567
+ }
568
+ function Ut(e2, t, n) {
569
+ let r = e2.source.body, i = t, s = n, a = false;
570
+ if (s === 45 && (s = r.charCodeAt(++i)), s === 48) {
571
+ if (s = r.charCodeAt(++i), L(s)) throw d(e2.source, i, `Invalid number, unexpected digit after 0: ${C(e2, i)}.`);
572
+ } else i = de(e2, i, s), s = r.charCodeAt(i);
573
+ if (s === 46 && (a = true, s = r.charCodeAt(++i), i = de(e2, i, s), s = r.charCodeAt(i)), (s === 69 || s === 101) && (a = true, s = r.charCodeAt(++i), (s === 43 || s === 45) && (s = r.charCodeAt(++i)), i = de(e2, i, s), s = r.charCodeAt(i)), s === 46 || he(s)) throw d(e2.source, i, `Invalid number, expected digit but got: ${C(e2, i)}.`);
574
+ return m(e2, a ? o.FLOAT : o.INT, t, i, r.slice(t, i));
575
+ }
576
+ function de(e2, t, n) {
577
+ if (!L(n)) throw d(e2.source, t, `Invalid number, expected digit but got: ${C(e2, t)}.`);
578
+ let r = e2.source.body, i = t + 1;
579
+ for (; L(r.charCodeAt(i)); ) ++i;
580
+ return i;
581
+ }
582
+ function Mt(e2, t) {
583
+ let n = e2.source.body, r = n.length, i = t + 1, s = i, a = "";
584
+ for (; i < r; ) {
585
+ let u = n.charCodeAt(i);
586
+ if (u === 34) return a += n.slice(s, i), m(e2, o.STRING, t, i + 1, a);
587
+ if (u === 92) {
588
+ a += n.slice(s, i);
589
+ let l = n.charCodeAt(i + 1) === 117 ? n.charCodeAt(i + 2) === 123 ? Yt(e2, i) : jt(e2, i) : Gt(e2, i);
590
+ a += l.value, i += l.size, s = i;
591
+ continue;
592
+ }
593
+ if (u === 10 || u === 13) break;
594
+ if (R(u)) ++i;
595
+ else if (K(n, i)) i += 2;
596
+ else throw d(e2.source, i, `Invalid character within String: ${C(e2, i)}.`);
597
+ }
598
+ throw d(e2.source, i, "Unterminated string.");
599
+ }
600
+ function Yt(e2, t) {
601
+ let n = e2.source.body, r = 0, i = 3;
602
+ for (; i < 12; ) {
603
+ let s = n.charCodeAt(t + i++);
604
+ if (s === 125) {
605
+ if (i < 5 || !R(r)) break;
606
+ return { value: String.fromCodePoint(r), size: i };
607
+ }
608
+ if (r = r << 4 | U(s), r < 0) break;
609
+ }
610
+ throw d(e2.source, t, `Invalid Unicode escape sequence: "${n.slice(t, t + i)}".`);
611
+ }
612
+ function jt(e2, t) {
613
+ let n = e2.source.body, r = Xe(n, t + 2);
614
+ if (R(r)) return { value: String.fromCodePoint(r), size: 6 };
615
+ if (Qe(r) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
616
+ let i = Xe(n, t + 8);
617
+ if (We(i)) return { value: String.fromCodePoint(r, i), size: 12 };
618
+ }
619
+ throw d(e2.source, t, `Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`);
620
+ }
621
+ function Xe(e2, t) {
622
+ return U(e2.charCodeAt(t)) << 12 | U(e2.charCodeAt(t + 1)) << 8 | U(e2.charCodeAt(t + 2)) << 4 | U(e2.charCodeAt(t + 3));
623
+ }
624
+ function U(e2) {
625
+ return e2 >= 48 && e2 <= 57 ? e2 - 48 : e2 >= 65 && e2 <= 70 ? e2 - 55 : e2 >= 97 && e2 <= 102 ? e2 - 87 : -1;
626
+ }
627
+ function Gt(e2, t) {
628
+ let n = e2.source.body;
629
+ switch (n.charCodeAt(t + 1)) {
630
+ case 34:
631
+ return { value: '"', size: 2 };
632
+ case 92:
633
+ return { value: "\\", size: 2 };
634
+ case 47:
635
+ return { value: "/", size: 2 };
636
+ case 98:
637
+ return { value: "\b", size: 2 };
638
+ case 102:
639
+ return { value: "\f", size: 2 };
640
+ case 110:
641
+ return { value: `
642
+ `, size: 2 };
643
+ case 114:
644
+ return { value: "\r", size: 2 };
645
+ case 116:
646
+ return { value: " ", size: 2 };
647
+ }
648
+ throw d(e2.source, t, `Invalid character escape sequence: "${n.slice(t, t + 2)}".`);
649
+ }
650
+ function $t(e2, t) {
651
+ let n = e2.source.body, r = n.length, i = e2.lineStart, s = t + 3, a = s, u = "", l = [];
652
+ for (; s < r; ) {
653
+ let T = n.charCodeAt(s);
654
+ if (T === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
655
+ u += n.slice(a, s), l.push(u);
656
+ let h = m(e2, o.BLOCK_STRING, t, s + 3, Je(l).join(`
657
+ `));
658
+ return e2.line += l.length - 1, e2.lineStart = i, h;
659
+ }
660
+ if (T === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
661
+ u += n.slice(a, s), a = s + 1, s += 4;
662
+ continue;
663
+ }
664
+ if (T === 10 || T === 13) {
665
+ u += n.slice(a, s), l.push(u), T === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, u = "", a = s, i = s;
666
+ continue;
667
+ }
668
+ if (R(T)) ++s;
669
+ else if (K(n, s)) s += 2;
670
+ else throw d(e2.source, s, `Invalid character within String: ${C(e2, s)}.`);
671
+ }
672
+ throw d(e2.source, s, "Unterminated string.");
673
+ }
674
+ function Jt(e2, t) {
675
+ let n = e2.source.body, r = n.length, i = t + 1;
676
+ for (; i < r; ) {
677
+ let s = n.charCodeAt(i);
678
+ if ($e(s)) ++i;
679
+ else break;
680
+ }
681
+ return m(e2, o.NAME, t, i, n.slice(t, i));
682
+ }
683
+ function Z(e2, t) {
684
+ if (!!!e2) throw new Error(t);
685
+ }
686
+ function ee(e2) {
687
+ return te(e2, []);
688
+ }
689
+ function te(e2, t) {
690
+ switch (typeof e2) {
691
+ case "string":
692
+ return JSON.stringify(e2);
693
+ case "function":
694
+ return e2.name ? `[function ${e2.name}]` : "[function]";
695
+ case "object":
696
+ return Xt(e2, t);
697
+ default:
698
+ return String(e2);
699
+ }
700
+ }
701
+ function Xt(e2, t) {
702
+ if (e2 === null) return "null";
703
+ if (t.includes(e2)) return "[Circular]";
704
+ let n = [...t, e2];
705
+ if (qt(e2)) {
706
+ let r = e2.toJSON();
707
+ if (r !== e2) return typeof r == "string" ? r : te(r, n);
708
+ } else if (Array.isArray(e2)) return Wt(e2, n);
709
+ return Qt(e2, n);
710
+ }
711
+ function qt(e2) {
712
+ return typeof e2.toJSON == "function";
713
+ }
714
+ function Qt(e2, t) {
715
+ let n = Object.entries(e2);
716
+ return n.length === 0 ? "{}" : t.length > 2 ? "[" + Ht(e2) + "]" : "{ " + n.map(([i, s]) => i + ": " + te(s, t)).join(", ") + " }";
717
+ }
718
+ function Wt(e2, t) {
719
+ if (e2.length === 0) return "[]";
720
+ if (t.length > 2) return "[Array]";
721
+ let n = Math.min(10, e2.length), r = e2.length - n, i = [];
722
+ for (let s = 0; s < n; ++s) i.push(te(e2[s], t));
723
+ return r === 1 ? i.push("... 1 more item") : r > 1 && i.push(`... ${r} more items`), "[" + i.join(", ") + "]";
724
+ }
725
+ function Ht(e2) {
726
+ let t = Object.prototype.toString.call(e2).replace(/^\[object /, "").replace(/]$/, "");
727
+ if (t === "Object" && typeof e2.constructor == "function") {
728
+ let n = e2.constructor.name;
729
+ if (typeof n == "string" && n !== "") return n;
730
+ }
731
+ return t;
732
+ }
733
+ var zt = globalThis.process && true;
734
+ var He = zt ? function(t, n) {
735
+ return t instanceof n;
736
+ } : function(t, n) {
737
+ if (t instanceof n) return true;
738
+ if (typeof t == "object" && t !== null) {
739
+ var r;
740
+ let i = n.prototype[Symbol.toStringTag], s = Symbol.toStringTag in t ? t[Symbol.toStringTag] : (r = t.constructor) === null || r === void 0 ? void 0 : r.name;
741
+ if (i === s) {
742
+ let a = ee(t);
743
+ throw new Error(`Cannot use ${i} "${a}" from another module or realm.
744
+
745
+ Ensure that there is only one instance of "graphql" in the node_modules
746
+ directory. If different versions of "graphql" are the dependencies of other
747
+ relied on modules, use "resolutions" to ensure only one version is installed.
748
+
749
+ https://yarnpkg.com/en/docs/selective-version-resolutions
750
+
751
+ Duplicate "graphql" modules cannot be used at the same time since different
752
+ versions may have different capabilities and behavior. The data from one
753
+ version used in the function from another could produce confusing and
754
+ spurious results.`);
755
+ }
756
+ }
757
+ return false;
758
+ };
759
+ var M = class {
760
+ constructor(t, n = "GraphQL request", r = { line: 1, column: 1 }) {
761
+ typeof t == "string" || Z(false, `Body must be a string. Received: ${ee(t)}.`), this.body = t, this.name = n, this.locationOffset = r, this.locationOffset.line > 0 || Z(false, "line in locationOffset is 1-indexed and must be positive."), this.locationOffset.column > 0 || Z(false, "column in locationOffset is 1-indexed and must be positive.");
762
+ }
763
+ get [Symbol.toStringTag]() {
764
+ return "Source";
765
+ }
766
+ };
767
+ function ze(e2) {
768
+ return He(e2, M);
769
+ }
770
+ function Ke(e2, t) {
771
+ return new me(e2, t).parseDocument();
772
+ }
773
+ var me = class {
774
+ constructor(t, n = {}) {
775
+ let r = ze(t) ? t : new M(t);
776
+ this._lexer = new z(r), this._options = n, this._tokenCounter = 0;
777
+ }
778
+ parseName() {
779
+ let t = this.expectToken(o.NAME);
780
+ return this.node(t, { kind: c.NAME, value: t.value });
781
+ }
782
+ parseDocument() {
783
+ return this.node(this._lexer.token, { kind: c.DOCUMENT, definitions: this.many(o.SOF, this.parseDefinition, o.EOF) });
784
+ }
785
+ parseDefinition() {
786
+ if (this.peek(o.BRACE_L)) return this.parseOperationDefinition();
787
+ let t = this.peekDescription(), n = t ? this._lexer.lookahead() : this._lexer.token;
788
+ if (n.kind === o.NAME) {
789
+ switch (n.value) {
790
+ case "schema":
791
+ return this.parseSchemaDefinition();
792
+ case "scalar":
793
+ return this.parseScalarTypeDefinition();
794
+ case "type":
795
+ return this.parseObjectTypeDefinition();
796
+ case "interface":
797
+ return this.parseInterfaceTypeDefinition();
798
+ case "union":
799
+ return this.parseUnionTypeDefinition();
800
+ case "enum":
801
+ return this.parseEnumTypeDefinition();
802
+ case "input":
803
+ return this.parseInputObjectTypeDefinition();
804
+ case "directive":
805
+ return this.parseDirectiveDefinition();
806
+ }
807
+ if (t) throw d(this._lexer.source, this._lexer.token.start, "Unexpected description, descriptions are supported only on type definitions.");
808
+ switch (n.value) {
809
+ case "query":
810
+ case "mutation":
811
+ case "subscription":
812
+ return this.parseOperationDefinition();
813
+ case "fragment":
814
+ return this.parseFragmentDefinition();
815
+ case "extend":
816
+ return this.parseTypeSystemExtension();
817
+ }
818
+ }
819
+ throw this.unexpected(n);
820
+ }
821
+ parseOperationDefinition() {
822
+ let t = this._lexer.token;
823
+ if (this.peek(o.BRACE_L)) return this.node(t, { kind: c.OPERATION_DEFINITION, operation: S.QUERY, name: void 0, variableDefinitions: [], directives: [], selectionSet: this.parseSelectionSet() });
824
+ let n = this.parseOperationType(), r;
825
+ return this.peek(o.NAME) && (r = this.parseName()), this.node(t, { kind: c.OPERATION_DEFINITION, operation: n, name: r, variableDefinitions: this.parseVariableDefinitions(), directives: this.parseDirectives(false), selectionSet: this.parseSelectionSet() });
826
+ }
827
+ parseOperationType() {
828
+ let t = this.expectToken(o.NAME);
829
+ switch (t.value) {
830
+ case "query":
831
+ return S.QUERY;
832
+ case "mutation":
833
+ return S.MUTATION;
834
+ case "subscription":
835
+ return S.SUBSCRIPTION;
836
+ }
837
+ throw this.unexpected(t);
838
+ }
839
+ parseVariableDefinitions() {
840
+ return this.optionalMany(o.PAREN_L, this.parseVariableDefinition, o.PAREN_R);
841
+ }
842
+ parseVariableDefinition() {
843
+ return this.node(this._lexer.token, { kind: c.VARIABLE_DEFINITION, variable: this.parseVariable(), type: (this.expectToken(o.COLON), this.parseTypeReference()), defaultValue: this.expectOptionalToken(o.EQUALS) ? this.parseConstValueLiteral() : void 0, directives: this.parseConstDirectives() });
844
+ }
845
+ parseVariable() {
846
+ let t = this._lexer.token;
847
+ return this.expectToken(o.DOLLAR), this.node(t, { kind: c.VARIABLE, name: this.parseName() });
848
+ }
849
+ parseSelectionSet() {
850
+ return this.node(this._lexer.token, { kind: c.SELECTION_SET, selections: this.many(o.BRACE_L, this.parseSelection, o.BRACE_R) });
851
+ }
852
+ parseSelection() {
853
+ return this.peek(o.SPREAD) ? this.parseFragment() : this.parseField();
854
+ }
855
+ parseField() {
856
+ let t = this._lexer.token, n = this.parseName(), r, i;
857
+ return this.expectOptionalToken(o.COLON) ? (r = n, i = this.parseName()) : i = n, this.node(t, { kind: c.FIELD, alias: r, name: i, arguments: this.parseArguments(false), directives: this.parseDirectives(false), selectionSet: this.peek(o.BRACE_L) ? this.parseSelectionSet() : void 0 });
858
+ }
859
+ parseArguments(t) {
860
+ let n = t ? this.parseConstArgument : this.parseArgument;
861
+ return this.optionalMany(o.PAREN_L, n, o.PAREN_R);
862
+ }
863
+ parseArgument(t = false) {
864
+ let n = this._lexer.token, r = this.parseName();
865
+ return this.expectToken(o.COLON), this.node(n, { kind: c.ARGUMENT, name: r, value: this.parseValueLiteral(t) });
866
+ }
867
+ parseConstArgument() {
868
+ return this.parseArgument(true);
869
+ }
870
+ parseFragment() {
871
+ let t = this._lexer.token;
872
+ this.expectToken(o.SPREAD);
873
+ let n = this.expectOptionalKeyword("on");
874
+ return !n && this.peek(o.NAME) ? this.node(t, { kind: c.FRAGMENT_SPREAD, name: this.parseFragmentName(), directives: this.parseDirectives(false) }) : this.node(t, { kind: c.INLINE_FRAGMENT, typeCondition: n ? this.parseNamedType() : void 0, directives: this.parseDirectives(false), selectionSet: this.parseSelectionSet() });
875
+ }
876
+ parseFragmentDefinition() {
877
+ let t = this._lexer.token;
878
+ return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === true ? this.node(t, { kind: c.FRAGMENT_DEFINITION, name: this.parseFragmentName(), variableDefinitions: this.parseVariableDefinitions(), typeCondition: (this.expectKeyword("on"), this.parseNamedType()), directives: this.parseDirectives(false), selectionSet: this.parseSelectionSet() }) : this.node(t, { kind: c.FRAGMENT_DEFINITION, name: this.parseFragmentName(), typeCondition: (this.expectKeyword("on"), this.parseNamedType()), directives: this.parseDirectives(false), selectionSet: this.parseSelectionSet() });
879
+ }
880
+ parseFragmentName() {
881
+ if (this._lexer.token.value === "on") throw this.unexpected();
882
+ return this.parseName();
883
+ }
884
+ parseValueLiteral(t) {
885
+ let n = this._lexer.token;
886
+ switch (n.kind) {
887
+ case o.BRACKET_L:
888
+ return this.parseList(t);
889
+ case o.BRACE_L:
890
+ return this.parseObject(t);
891
+ case o.INT:
892
+ return this.advanceLexer(), this.node(n, { kind: c.INT, value: n.value });
893
+ case o.FLOAT:
894
+ return this.advanceLexer(), this.node(n, { kind: c.FLOAT, value: n.value });
895
+ case o.STRING:
896
+ case o.BLOCK_STRING:
897
+ return this.parseStringLiteral();
898
+ case o.NAME:
899
+ switch (this.advanceLexer(), n.value) {
900
+ case "true":
901
+ return this.node(n, { kind: c.BOOLEAN, value: true });
902
+ case "false":
903
+ return this.node(n, { kind: c.BOOLEAN, value: false });
904
+ case "null":
905
+ return this.node(n, { kind: c.NULL });
906
+ default:
907
+ return this.node(n, { kind: c.ENUM, value: n.value });
908
+ }
909
+ case o.DOLLAR:
910
+ if (t) if (this.expectToken(o.DOLLAR), this._lexer.token.kind === o.NAME) {
911
+ let r = this._lexer.token.value;
912
+ throw d(this._lexer.source, n.start, `Unexpected variable "$${r}" in constant value.`);
913
+ } else throw this.unexpected(n);
914
+ return this.parseVariable();
915
+ default:
916
+ throw this.unexpected();
917
+ }
918
+ }
919
+ parseConstValueLiteral() {
920
+ return this.parseValueLiteral(true);
921
+ }
922
+ parseStringLiteral() {
923
+ let t = this._lexer.token;
924
+ return this.advanceLexer(), this.node(t, { kind: c.STRING, value: t.value, block: t.kind === o.BLOCK_STRING });
925
+ }
926
+ parseList(t) {
927
+ let n = () => this.parseValueLiteral(t);
928
+ return this.node(this._lexer.token, { kind: c.LIST, values: this.any(o.BRACKET_L, n, o.BRACKET_R) });
929
+ }
930
+ parseObject(t) {
931
+ let n = () => this.parseObjectField(t);
932
+ return this.node(this._lexer.token, { kind: c.OBJECT, fields: this.any(o.BRACE_L, n, o.BRACE_R) });
933
+ }
934
+ parseObjectField(t) {
935
+ let n = this._lexer.token, r = this.parseName();
936
+ return this.expectToken(o.COLON), this.node(n, { kind: c.OBJECT_FIELD, name: r, value: this.parseValueLiteral(t) });
937
+ }
938
+ parseDirectives(t) {
939
+ let n = [];
940
+ for (; this.peek(o.AT); ) n.push(this.parseDirective(t));
941
+ return n;
942
+ }
943
+ parseConstDirectives() {
944
+ return this.parseDirectives(true);
945
+ }
946
+ parseDirective(t) {
947
+ let n = this._lexer.token;
948
+ return this.expectToken(o.AT), this.node(n, { kind: c.DIRECTIVE, name: this.parseName(), arguments: this.parseArguments(t) });
949
+ }
950
+ parseTypeReference() {
951
+ let t = this._lexer.token, n;
952
+ if (this.expectOptionalToken(o.BRACKET_L)) {
953
+ let r = this.parseTypeReference();
954
+ this.expectToken(o.BRACKET_R), n = this.node(t, { kind: c.LIST_TYPE, type: r });
955
+ } else n = this.parseNamedType();
956
+ return this.expectOptionalToken(o.BANG) ? this.node(t, { kind: c.NON_NULL_TYPE, type: n }) : n;
957
+ }
958
+ parseNamedType() {
959
+ return this.node(this._lexer.token, { kind: c.NAMED_TYPE, name: this.parseName() });
960
+ }
961
+ peekDescription() {
962
+ return this.peek(o.STRING) || this.peek(o.BLOCK_STRING);
963
+ }
964
+ parseDescription() {
965
+ if (this.peekDescription()) return this.parseStringLiteral();
966
+ }
967
+ parseSchemaDefinition() {
968
+ let t = this._lexer.token, n = this.parseDescription();
969
+ this.expectKeyword("schema");
970
+ let r = this.parseConstDirectives(), i = this.many(o.BRACE_L, this.parseOperationTypeDefinition, o.BRACE_R);
971
+ return this.node(t, { kind: c.SCHEMA_DEFINITION, description: n, directives: r, operationTypes: i });
972
+ }
973
+ parseOperationTypeDefinition() {
974
+ let t = this._lexer.token, n = this.parseOperationType();
975
+ this.expectToken(o.COLON);
976
+ let r = this.parseNamedType();
977
+ return this.node(t, { kind: c.OPERATION_TYPE_DEFINITION, operation: n, type: r });
978
+ }
979
+ parseScalarTypeDefinition() {
980
+ let t = this._lexer.token, n = this.parseDescription();
981
+ this.expectKeyword("scalar");
982
+ let r = this.parseName(), i = this.parseConstDirectives();
983
+ return this.node(t, { kind: c.SCALAR_TYPE_DEFINITION, description: n, name: r, directives: i });
984
+ }
985
+ parseObjectTypeDefinition() {
986
+ let t = this._lexer.token, n = this.parseDescription();
987
+ this.expectKeyword("type");
988
+ let r = this.parseName(), i = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
989
+ return this.node(t, { kind: c.OBJECT_TYPE_DEFINITION, description: n, name: r, interfaces: i, directives: s, fields: a });
990
+ }
991
+ parseImplementsInterfaces() {
992
+ return this.expectOptionalKeyword("implements") ? this.delimitedMany(o.AMP, this.parseNamedType) : [];
993
+ }
994
+ parseFieldsDefinition() {
995
+ return this.optionalMany(o.BRACE_L, this.parseFieldDefinition, o.BRACE_R);
996
+ }
997
+ parseFieldDefinition() {
998
+ let t = this._lexer.token, n = this.parseDescription(), r = this.parseName(), i = this.parseArgumentDefs();
999
+ this.expectToken(o.COLON);
1000
+ let s = this.parseTypeReference(), a = this.parseConstDirectives();
1001
+ return this.node(t, { kind: c.FIELD_DEFINITION, description: n, name: r, arguments: i, type: s, directives: a });
1002
+ }
1003
+ parseArgumentDefs() {
1004
+ return this.optionalMany(o.PAREN_L, this.parseInputValueDef, o.PAREN_R);
1005
+ }
1006
+ parseInputValueDef() {
1007
+ let t = this._lexer.token, n = this.parseDescription(), r = this.parseName();
1008
+ this.expectToken(o.COLON);
1009
+ let i = this.parseTypeReference(), s;
1010
+ this.expectOptionalToken(o.EQUALS) && (s = this.parseConstValueLiteral());
1011
+ let a = this.parseConstDirectives();
1012
+ return this.node(t, { kind: c.INPUT_VALUE_DEFINITION, description: n, name: r, type: i, defaultValue: s, directives: a });
1013
+ }
1014
+ parseInterfaceTypeDefinition() {
1015
+ let t = this._lexer.token, n = this.parseDescription();
1016
+ this.expectKeyword("interface");
1017
+ let r = this.parseName(), i = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
1018
+ return this.node(t, { kind: c.INTERFACE_TYPE_DEFINITION, description: n, name: r, interfaces: i, directives: s, fields: a });
1019
+ }
1020
+ parseUnionTypeDefinition() {
1021
+ let t = this._lexer.token, n = this.parseDescription();
1022
+ this.expectKeyword("union");
1023
+ let r = this.parseName(), i = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
1024
+ return this.node(t, { kind: c.UNION_TYPE_DEFINITION, description: n, name: r, directives: i, types: s });
1025
+ }
1026
+ parseUnionMemberTypes() {
1027
+ return this.expectOptionalToken(o.EQUALS) ? this.delimitedMany(o.PIPE, this.parseNamedType) : [];
1028
+ }
1029
+ parseEnumTypeDefinition() {
1030
+ let t = this._lexer.token, n = this.parseDescription();
1031
+ this.expectKeyword("enum");
1032
+ let r = this.parseName(), i = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
1033
+ return this.node(t, { kind: c.ENUM_TYPE_DEFINITION, description: n, name: r, directives: i, values: s });
1034
+ }
1035
+ parseEnumValuesDefinition() {
1036
+ return this.optionalMany(o.BRACE_L, this.parseEnumValueDefinition, o.BRACE_R);
1037
+ }
1038
+ parseEnumValueDefinition() {
1039
+ let t = this._lexer.token, n = this.parseDescription(), r = this.parseEnumValueName(), i = this.parseConstDirectives();
1040
+ return this.node(t, { kind: c.ENUM_VALUE_DEFINITION, description: n, name: r, directives: i });
1041
+ }
1042
+ parseEnumValueName() {
1043
+ if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null") throw d(this._lexer.source, this._lexer.token.start, `${ne(this._lexer.token)} is reserved and cannot be used for an enum value.`);
1044
+ return this.parseName();
1045
+ }
1046
+ parseInputObjectTypeDefinition() {
1047
+ let t = this._lexer.token, n = this.parseDescription();
1048
+ this.expectKeyword("input");
1049
+ let r = this.parseName(), i = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
1050
+ return this.node(t, { kind: c.INPUT_OBJECT_TYPE_DEFINITION, description: n, name: r, directives: i, fields: s });
1051
+ }
1052
+ parseInputFieldsDefinition() {
1053
+ return this.optionalMany(o.BRACE_L, this.parseInputValueDef, o.BRACE_R);
1054
+ }
1055
+ parseTypeSystemExtension() {
1056
+ let t = this._lexer.lookahead();
1057
+ if (t.kind === o.NAME) switch (t.value) {
1058
+ case "schema":
1059
+ return this.parseSchemaExtension();
1060
+ case "scalar":
1061
+ return this.parseScalarTypeExtension();
1062
+ case "type":
1063
+ return this.parseObjectTypeExtension();
1064
+ case "interface":
1065
+ return this.parseInterfaceTypeExtension();
1066
+ case "union":
1067
+ return this.parseUnionTypeExtension();
1068
+ case "enum":
1069
+ return this.parseEnumTypeExtension();
1070
+ case "input":
1071
+ return this.parseInputObjectTypeExtension();
1072
+ }
1073
+ throw this.unexpected(t);
1074
+ }
1075
+ parseSchemaExtension() {
1076
+ let t = this._lexer.token;
1077
+ this.expectKeyword("extend"), this.expectKeyword("schema");
1078
+ let n = this.parseConstDirectives(), r = this.optionalMany(o.BRACE_L, this.parseOperationTypeDefinition, o.BRACE_R);
1079
+ if (n.length === 0 && r.length === 0) throw this.unexpected();
1080
+ return this.node(t, { kind: c.SCHEMA_EXTENSION, directives: n, operationTypes: r });
1081
+ }
1082
+ parseScalarTypeExtension() {
1083
+ let t = this._lexer.token;
1084
+ this.expectKeyword("extend"), this.expectKeyword("scalar");
1085
+ let n = this.parseName(), r = this.parseConstDirectives();
1086
+ if (r.length === 0) throw this.unexpected();
1087
+ return this.node(t, { kind: c.SCALAR_TYPE_EXTENSION, name: n, directives: r });
1088
+ }
1089
+ parseObjectTypeExtension() {
1090
+ let t = this._lexer.token;
1091
+ this.expectKeyword("extend"), this.expectKeyword("type");
1092
+ let n = this.parseName(), r = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1093
+ if (r.length === 0 && i.length === 0 && s.length === 0) throw this.unexpected();
1094
+ return this.node(t, { kind: c.OBJECT_TYPE_EXTENSION, name: n, interfaces: r, directives: i, fields: s });
1095
+ }
1096
+ parseInterfaceTypeExtension() {
1097
+ let t = this._lexer.token;
1098
+ this.expectKeyword("extend"), this.expectKeyword("interface");
1099
+ let n = this.parseName(), r = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1100
+ if (r.length === 0 && i.length === 0 && s.length === 0) throw this.unexpected();
1101
+ return this.node(t, { kind: c.INTERFACE_TYPE_EXTENSION, name: n, interfaces: r, directives: i, fields: s });
1102
+ }
1103
+ parseUnionTypeExtension() {
1104
+ let t = this._lexer.token;
1105
+ this.expectKeyword("extend"), this.expectKeyword("union");
1106
+ let n = this.parseName(), r = this.parseConstDirectives(), i = this.parseUnionMemberTypes();
1107
+ if (r.length === 0 && i.length === 0) throw this.unexpected();
1108
+ return this.node(t, { kind: c.UNION_TYPE_EXTENSION, name: n, directives: r, types: i });
1109
+ }
1110
+ parseEnumTypeExtension() {
1111
+ let t = this._lexer.token;
1112
+ this.expectKeyword("extend"), this.expectKeyword("enum");
1113
+ let n = this.parseName(), r = this.parseConstDirectives(), i = this.parseEnumValuesDefinition();
1114
+ if (r.length === 0 && i.length === 0) throw this.unexpected();
1115
+ return this.node(t, { kind: c.ENUM_TYPE_EXTENSION, name: n, directives: r, values: i });
1116
+ }
1117
+ parseInputObjectTypeExtension() {
1118
+ let t = this._lexer.token;
1119
+ this.expectKeyword("extend"), this.expectKeyword("input");
1120
+ let n = this.parseName(), r = this.parseConstDirectives(), i = this.parseInputFieldsDefinition();
1121
+ if (r.length === 0 && i.length === 0) throw this.unexpected();
1122
+ return this.node(t, { kind: c.INPUT_OBJECT_TYPE_EXTENSION, name: n, directives: r, fields: i });
1123
+ }
1124
+ parseDirectiveDefinition() {
1125
+ let t = this._lexer.token, n = this.parseDescription();
1126
+ this.expectKeyword("directive"), this.expectToken(o.AT);
1127
+ let r = this.parseName(), i = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
1128
+ this.expectKeyword("on");
1129
+ let a = this.parseDirectiveLocations();
1130
+ return this.node(t, { kind: c.DIRECTIVE_DEFINITION, description: n, name: r, arguments: i, repeatable: s, locations: a });
1131
+ }
1132
+ parseDirectiveLocations() {
1133
+ return this.delimitedMany(o.PIPE, this.parseDirectiveLocation);
1134
+ }
1135
+ parseDirectiveLocation() {
1136
+ let t = this._lexer.token, n = this.parseName();
1137
+ if (Object.prototype.hasOwnProperty.call(H, n.value)) return n;
1138
+ throw this.unexpected(t);
1139
+ }
1140
+ node(t, n) {
1141
+ return this._options.noLocation !== true && (n.loc = new J(t, this._lexer.lastToken, this._lexer.source)), n;
1142
+ }
1143
+ peek(t) {
1144
+ return this._lexer.token.kind === t;
1145
+ }
1146
+ expectToken(t) {
1147
+ let n = this._lexer.token;
1148
+ if (n.kind === t) return this.advanceLexer(), n;
1149
+ throw d(this._lexer.source, n.start, `Expected ${Ze(t)}, found ${ne(n)}.`);
1150
+ }
1151
+ expectOptionalToken(t) {
1152
+ return this._lexer.token.kind === t ? (this.advanceLexer(), true) : false;
1153
+ }
1154
+ expectKeyword(t) {
1155
+ let n = this._lexer.token;
1156
+ if (n.kind === o.NAME && n.value === t) this.advanceLexer();
1157
+ else throw d(this._lexer.source, n.start, `Expected "${t}", found ${ne(n)}.`);
1158
+ }
1159
+ expectOptionalKeyword(t) {
1160
+ let n = this._lexer.token;
1161
+ return n.kind === o.NAME && n.value === t ? (this.advanceLexer(), true) : false;
1162
+ }
1163
+ unexpected(t) {
1164
+ let n = t ?? this._lexer.token;
1165
+ return d(this._lexer.source, n.start, `Unexpected ${ne(n)}.`);
1166
+ }
1167
+ any(t, n, r) {
1168
+ this.expectToken(t);
1169
+ let i = [];
1170
+ for (; !this.expectOptionalToken(r); ) i.push(n.call(this));
1171
+ return i;
1172
+ }
1173
+ optionalMany(t, n, r) {
1174
+ if (this.expectOptionalToken(t)) {
1175
+ let i = [];
1176
+ do
1177
+ i.push(n.call(this));
1178
+ while (!this.expectOptionalToken(r));
1179
+ return i;
1180
+ }
1181
+ return [];
1182
+ }
1183
+ many(t, n, r) {
1184
+ this.expectToken(t);
1185
+ let i = [];
1186
+ do
1187
+ i.push(n.call(this));
1188
+ while (!this.expectOptionalToken(r));
1189
+ return i;
1190
+ }
1191
+ delimitedMany(t, n) {
1192
+ this.expectOptionalToken(t);
1193
+ let r = [];
1194
+ do
1195
+ r.push(n.call(this));
1196
+ while (this.expectOptionalToken(t));
1197
+ return r;
1198
+ }
1199
+ advanceLexer() {
1200
+ let { maxTokens: t } = this._options, n = this._lexer.advance();
1201
+ if (t !== void 0 && n.kind !== o.EOF && (++this._tokenCounter, this._tokenCounter > t)) throw d(this._lexer.source, n.start, `Document contains more that ${t} tokens. Parsing aborted.`);
1202
+ }
1203
+ };
1204
+ function ne(e2) {
1205
+ let t = e2.value;
1206
+ return Ze(e2.kind) + (t != null ? ` "${t}"` : "");
1207
+ }
1208
+ function Ze(e2) {
1209
+ return qe(e2) ? `"${e2}"` : e2;
1210
+ }
1211
+ function Kt(e2, t) {
1212
+ let n = new SyntaxError(e2 + " (" + t.loc.start.line + ":" + t.loc.start.column + ")");
1213
+ return Object.assign(n, t);
1214
+ }
1215
+ var et = Kt;
1216
+ function Zt(e2) {
1217
+ let t = [], { startToken: n, endToken: r } = e2.loc;
1218
+ for (let i = n; i !== r; i = i.next) i.kind === "Comment" && t.push({ ...i, loc: { start: i.start, end: i.end } });
1219
+ return t;
1220
+ }
1221
+ var en = { allowLegacyFragmentVariables: true };
1222
+ function tn(e2) {
1223
+ if ((e2 == null ? void 0 : e2.name) === "GraphQLError") {
1224
+ let { message: t, locations: [n] } = e2;
1225
+ return et(t, { loc: { start: n }, cause: e2 });
1226
+ }
1227
+ return e2;
1228
+ }
1229
+ function nn(e2) {
1230
+ let t;
1231
+ try {
1232
+ t = Ke(e2, en);
1233
+ } catch (n) {
1234
+ throw tn(n);
1235
+ }
1236
+ return t.comments = Zt(t), t;
1237
+ }
1238
+ var rn = { parse: nn, astFormat: "graphql", hasPragma: Ce, locStart: q, locEnd: Q };
1239
+ var sn = { graphql: Re };
1240
+ var fr = Te;
1241
+ export {
1242
+ fr as default,
1243
+ Pe as languages,
1244
+ we as options,
1245
+ Ee as parsers,
1246
+ sn as printers
1247
+ };