@kubb/core 3.0.0-alpha.16 → 3.0.0-alpha.18

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