@shopify/cli 3.88.0 → 3.89.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/dist/acorn-45LE5Z2A.js +3016 -0
  2. package/dist/angular-Z5FPQPLR.js +2791 -0
  3. package/dist/babel-TRRZ6QQY.js +7173 -0
  4. package/dist/{chunk-J7U35MPX.js → chunk-2CNWYFWQ.js} +5 -5
  5. package/dist/{chunk-HM34WS7W.js → chunk-2OJBOBH2.js} +3 -3
  6. package/dist/{chunk-4ISFA2N3.js → chunk-2QVJ6J2X.js} +7 -6
  7. package/dist/{chunk-K5F7HNJN.js → chunk-36WMFQ3S.js} +3 -3
  8. package/dist/{chunk-VH47P2IR.js → chunk-5PAHFSKT.js} +3 -3
  9. package/dist/{chunk-6GKJAGTG.js → chunk-6KFJWCTP.js} +2 -2
  10. package/dist/{chunk-GZ3PD27A.js → chunk-6YASM3HI.js} +5 -5
  11. package/dist/{chunk-UBFTWR2L.js → chunk-B5Q2Q4B3.js} +3 -3
  12. package/dist/{chunk-QRIP3SU2.js → chunk-CUCT627W.js} +8 -8
  13. package/dist/{chunk-7U3KXZYU.js → chunk-EAEHP4CZ.js} +4 -4
  14. package/dist/{chunk-JO4W7S44.js → chunk-EQO4QA4E.js} +37 -16
  15. package/dist/{chunk-DGWEIWJA.js → chunk-EYUOBXKH.js} +3 -3
  16. package/dist/{chunk-GZARFYAY.js → chunk-GFYDB5LD.js} +2 -2
  17. package/dist/{chunk-5BHU3PRC.js → chunk-GSUL4KBP.js} +2086 -2216
  18. package/dist/{chunk-YBRRA3G2.js → chunk-GT7PA6E6.js} +2 -2
  19. package/dist/{chunk-LBA6IB72.js → chunk-JYBBGVIM.js} +3 -3
  20. package/dist/{chunk-6XQFNXU3.js → chunk-LJHVLE3R.js} +2 -2
  21. package/dist/{chunk-TQWSBJX3.js → chunk-NJR5IH3H.js} +4 -4
  22. package/dist/{chunk-IVWPL6RQ.js → chunk-P3SM4EEQ.js} +3 -3
  23. package/dist/{chunk-SATLZT2F.js → chunk-PYPPUTUV.js} +2 -2
  24. package/dist/{chunk-4NQZXGUR.js → chunk-R7OKLQB6.js} +4 -4
  25. package/dist/{chunk-TF4AQQB4.js → chunk-TLGBKEEX.js} +6 -6
  26. package/dist/{chunk-ZKOCRU7F.js → chunk-TPPRDIBF.js} +4 -4
  27. package/dist/{chunk-6O34ZV3A.js → chunk-TRR5QJRW.js} +4 -4
  28. package/dist/{chunk-OUR7YOZK.js → chunk-TWYT4DFD.js} +2 -2
  29. package/dist/{chunk-HQJPNVYR.js → chunk-V2ZY6OP3.js} +6 -6
  30. package/dist/{chunk-VLBE545G.js → chunk-WC5EDB4Z.js} +4 -4
  31. package/dist/{chunk-TZSBI4FY.js → chunk-WF5BWNFE.js} +6 -6
  32. package/dist/{chunk-TPVWZRBE.js → chunk-WSX6K4TT.js} +3 -3
  33. package/dist/{chunk-SMXARNZJ.js → chunk-XLMH6DBR.js} +3 -3
  34. package/dist/{chunk-KVDUU7LU.js → chunk-Y2BHJWKT.js} +2 -2
  35. package/dist/{chunk-CCYDP5TC.js → chunk-Y3HY6QD7.js} +5 -5
  36. package/dist/{chunk-5OVH24W5.js → chunk-YETFHMCK.js} +7 -7
  37. package/dist/{chunk-KF76XPVO.js → chunk-ZM543XCR.js} +3 -3
  38. package/dist/cli/commands/auth/login.js +10 -10
  39. package/dist/cli/commands/auth/login.test.js +11 -11
  40. package/dist/cli/commands/auth/logout.js +10 -10
  41. package/dist/cli/commands/auth/logout.test.js +11 -11
  42. package/dist/cli/commands/cache/clear.js +10 -10
  43. package/dist/cli/commands/debug/command-flags.js +10 -10
  44. package/dist/cli/commands/docs/generate.js +10 -10
  45. package/dist/cli/commands/docs/generate.test.js +10 -10
  46. package/dist/cli/commands/help.js +10 -10
  47. package/dist/cli/commands/kitchen-sink/async.js +11 -11
  48. package/dist/cli/commands/kitchen-sink/async.test.js +11 -11
  49. package/dist/cli/commands/kitchen-sink/index.js +13 -13
  50. package/dist/cli/commands/kitchen-sink/index.test.js +13 -13
  51. package/dist/cli/commands/kitchen-sink/prompts.js +11 -11
  52. package/dist/cli/commands/kitchen-sink/prompts.test.js +11 -11
  53. package/dist/cli/commands/kitchen-sink/static.js +11 -11
  54. package/dist/cli/commands/kitchen-sink/static.test.js +11 -11
  55. package/dist/cli/commands/notifications/generate.js +11 -11
  56. package/dist/cli/commands/notifications/list.js +11 -11
  57. package/dist/cli/commands/search.js +11 -11
  58. package/dist/cli/commands/upgrade.js +11 -11
  59. package/dist/cli/commands/version.js +11 -11
  60. package/dist/cli/commands/version.test.js +11 -11
  61. package/dist/cli/services/commands/notifications.js +8 -8
  62. package/dist/cli/services/commands/search.js +4 -4
  63. package/dist/cli/services/commands/search.test.js +4 -4
  64. package/dist/cli/services/commands/version.js +5 -5
  65. package/dist/cli/services/commands/version.test.js +6 -6
  66. package/dist/cli/services/kitchen-sink/async.js +4 -4
  67. package/dist/cli/services/kitchen-sink/prompts.js +4 -4
  68. package/dist/cli/services/kitchen-sink/static.js +4 -4
  69. package/dist/cli/services/upgrade.js +5 -5
  70. package/dist/cli/services/upgrade.test.js +6 -6
  71. package/dist/{custom-oclif-loader-EAWHI4I3.js → custom-oclif-loader-TLTSWHLS.js} +4 -4
  72. package/dist/{devtools-EVCDECOU.js → devtools-2SG3BFWJ.js} +4 -4
  73. package/dist/{devtools-LDCSRUXB.js → devtools-D47L6HIC.js} +7 -7
  74. package/dist/{error-handler-WZR7CPYT.js → error-handler-JWFNITM6.js} +8 -8
  75. package/dist/estree-PY6WKTNG.js +4490 -0
  76. package/dist/flow-YN54TSCB.js +27513 -0
  77. package/dist/glimmer-RMPUUUDS.js +2781 -0
  78. package/dist/graphql-PPLVYWBL.js +1225 -0
  79. package/dist/hooks/postrun.js +7 -7
  80. package/dist/hooks/prerun.js +8 -8
  81. package/dist/html-3U6QZZZ4.js +2768 -0
  82. package/dist/index.js +9196 -4200
  83. package/dist/{lib-G7Q5M6VX.js → lib-XGN4IWQ3.js} +3 -3
  84. package/dist/{local-P2SS6AIS.js → local-4NMXX5NP.js} +4 -4
  85. package/dist/markdown-RHRQTUMC.js +3269 -0
  86. package/dist/meriyah-7MIMHTWQ.js +2645 -0
  87. package/dist/{node-package-manager-FZWNOAYQ.js → node-package-manager-SHRILTY3.js} +5 -5
  88. package/dist/postcss-MSOPGY7M.js +4796 -0
  89. package/dist/prettier-2ITB6I34.js +13861 -0
  90. package/dist/tsconfig.tsbuildinfo +1 -1
  91. package/dist/typescript-ZSZVUJZX.js +13034 -0
  92. package/dist/{ui-5RSPUMJS.js → ui-MKDRI4FX.js} +4 -4
  93. package/dist/{workerd-K73DK5CH.js → workerd-BHG6KDEK.js} +11 -11
  94. package/dist/yaml-6GALFXQY.js +4077 -0
  95. package/oclif.manifest.json +404 -19
  96. package/package.json +6 -6
@@ -0,0 +1,1225 @@
1
+ import {
2
+ __esm,
3
+ init_cjs_shims
4
+ } from "./chunk-PKR7KJ6P.js";
5
+
6
+ // ../../node_modules/.pnpm/prettier@3.7.4/node_modules/prettier/plugins/graphql.mjs
7
+ function x(e2) {
8
+ return S(e2), { type: Ee, contents: e2 };
9
+ }
10
+ function y(e2, t = {}) {
11
+ return S(e2), Y(t.expandedStates, !0), { type: Te, id: t.id, contents: e2, break: !!t.shouldBreak, expandedStates: t.expandedStates };
12
+ }
13
+ function I(e2, t = "", n = {}) {
14
+ return S(e2), t !== "" && S(t), { type: Ne, breakContents: e2, flatContents: t, groupId: n.groupId };
15
+ }
16
+ function E(e2, t) {
17
+ S(e2), Y(t);
18
+ let n = [];
19
+ for (let i = 0; i < t.length; i++) i !== 0 && n.push(e2), n.push(t[i]);
20
+ return n;
21
+ }
22
+ function j(e2) {
23
+ return (t, n, i) => {
24
+ let r = !!i?.backwards;
25
+ if (n === !1) return !1;
26
+ let { length: s } = t, a = n;
27
+ for (; a >= 0 && a < s; ) {
28
+ let u = t.charAt(a);
29
+ if (e2 instanceof RegExp) {
30
+ if (!e2.test(u)) return a;
31
+ } else if (!e2.includes(u)) return a;
32
+ r ? a-- : a++;
33
+ }
34
+ return a === -1 || a === s ? a : !1;
35
+ };
36
+ }
37
+ function mt(e2, t, n) {
38
+ let i = !!n?.backwards;
39
+ if (t === !1) return !1;
40
+ let r = e2.charAt(t);
41
+ if (i) {
42
+ if (e2.charAt(t - 1) === "\r" && r === `
43
+ `) return t - 2;
44
+ if (Oe(r)) return t - 1;
45
+ } else {
46
+ if (r === "\r" && e2.charAt(t + 1) === `
47
+ `) return t + 2;
48
+ if (Oe(r)) return t + 1;
49
+ }
50
+ return t;
51
+ }
52
+ function Et(e2, t, n = {}) {
53
+ let i = $(e2, n.backwards ? t - 1 : t, n), r = X(e2, i, n);
54
+ return i !== r;
55
+ }
56
+ function Tt(e2, t) {
57
+ if (t === !1) return !1;
58
+ if (e2.charAt(t) === "/" && e2.charAt(t + 1) === "*") {
59
+ for (let n = t + 2; n < e2.length; ++n) if (e2.charAt(n) === "*" && e2.charAt(n + 1) === "/") return n + 2;
60
+ }
61
+ return t;
62
+ }
63
+ function Nt(e2, t) {
64
+ return t === !1 ? !1 : e2.charAt(t) === "/" && e2.charAt(t + 1) === "/" ? Ae(e2, t) : t;
65
+ }
66
+ function xt(e2, t) {
67
+ let n = null, i = t;
68
+ for (; i !== n; ) n = i, i = ye(e2, i), i = De(e2, i), i = $(e2, i);
69
+ return i = ge(e2, i), i = X(e2, i), i !== !1 && Ie(e2, i);
70
+ }
71
+ function _t(e2) {
72
+ return Array.isArray(e2) && e2.length > 0;
73
+ }
74
+ function w(e2) {
75
+ if (P !== null && typeof P.property) {
76
+ let t = P;
77
+ return P = w.prototype = null, t;
78
+ }
79
+ return P = w.prototype = e2 ?? /* @__PURE__ */ Object.create(null), new w();
80
+ }
81
+ function ae(e2) {
82
+ return w(e2);
83
+ }
84
+ function At(e2, t = "type") {
85
+ ae(e2);
86
+ function n(i) {
87
+ let r = i[t], s = e2[r];
88
+ if (!Array.isArray(s)) throw Object.assign(new Error(`Missing visitor keys for '${r}'.`), { node: i });
89
+ return s;
90
+ }
91
+ return n;
92
+ }
93
+ function It(e2, t, n) {
94
+ let { node: i } = e2;
95
+ if (!i.description) return "";
96
+ let r = [n("description")];
97
+ return i.kind === "InputValueDefinition" && !i.description.block ? r.push(k) : r.push(f), r;
98
+ }
99
+ function Dt(e2, t, n) {
100
+ let { node: i } = e2;
101
+ switch (i.kind) {
102
+ case "Document":
103
+ return [...E(f, g(e2, t, n, "definitions")), f];
104
+ case "OperationDefinition": {
105
+ let r = t.originalText[J(i)] !== "{", s = !!i.name;
106
+ return [A(e2, t, n), r ? i.operation : "", r && s ? [" ", n("name")] : "", r && !s && se(i.variableDefinitions) ? " " : "", Be(e2, n), _(e2, n, i), !r && !s ? "" : " ", n("selectionSet")];
107
+ }
108
+ case "FragmentDefinition":
109
+ return [A(e2, t, n), "fragment ", n("name"), Be(e2, n), " on ", n("typeCondition"), _(e2, n, i), " ", n("selectionSet")];
110
+ case "SelectionSet":
111
+ return ["{", x([f, E(f, g(e2, t, n, "selections"))]), f, "}"];
112
+ case "Field":
113
+ return y([i.alias ? [n("alias"), ": "] : "", n("name"), i.arguments.length > 0 ? y(["(", x([l, E([I("", ", "), l], g(e2, t, n, "arguments"))]), l, ")"]) : "", _(e2, n, i), i.selectionSet ? " " : "", n("selectionSet")]);
114
+ case "Name":
115
+ return i.value;
116
+ case "StringValue":
117
+ if (i.block) {
118
+ let r = U(0, i.value, '"""', '\\"""').split(`
119
+ `);
120
+ return r.length === 1 && (r[0] = r[0].trim()), r.every((s) => s === "") && (r.length = 0), E(f, ['"""', ...r, '"""']);
121
+ }
122
+ return ['"', U(0, U(0, i.value, /["\\]/gu, "\\$&"), `
123
+ `, "\\n"), '"'];
124
+ case "IntValue":
125
+ case "FloatValue":
126
+ case "EnumValue":
127
+ return i.value;
128
+ case "BooleanValue":
129
+ return i.value ? "true" : "false";
130
+ case "NullValue":
131
+ return "null";
132
+ case "Variable":
133
+ return ["$", n("name")];
134
+ case "ListValue":
135
+ return y(["[", x([l, E([I("", ", "), l], e2.map(n, "values"))]), l, "]"]);
136
+ case "ObjectValue": {
137
+ let r = t.bracketSpacing && i.fields.length > 0 ? " " : "";
138
+ return y(["{", r, x([l, E([I("", ", "), l], e2.map(n, "fields"))]), l, I("", r), "}"]);
139
+ }
140
+ case "ObjectField":
141
+ case "Argument":
142
+ return [n("name"), ": ", n("value")];
143
+ case "Directive":
144
+ return ["@", n("name"), i.arguments.length > 0 ? y(["(", x([l, E([I("", ", "), l], g(e2, t, n, "arguments"))]), l, ")"]) : ""];
145
+ case "NamedType":
146
+ return n("name");
147
+ case "VariableDefinition":
148
+ return [A(e2, t, n), n("variable"), ": ", n("type"), i.defaultValue ? [" = ", n("defaultValue")] : "", _(e2, n, i)];
149
+ case "ObjectTypeExtension":
150
+ case "ObjectTypeDefinition":
151
+ case "InputObjectTypeExtension":
152
+ case "InputObjectTypeDefinition":
153
+ case "InterfaceTypeExtension":
154
+ case "InterfaceTypeDefinition": {
155
+ let { kind: r } = i, s = [];
156
+ return r.endsWith("TypeDefinition") ? s.push(A(e2, t, n)) : s.push("extend "), r.startsWith("ObjectType") ? s.push("type") : r.startsWith("InputObjectType") ? s.push("input") : s.push("interface"), s.push(" ", n("name")), !r.startsWith("InputObjectType") && i.interfaces.length > 0 && s.push(" implements ", ...kt(e2, t, n)), s.push(_(e2, n, i)), i.fields.length > 0 && s.push([" {", x([f, E(f, g(e2, t, n, "fields"))]), f, "}"]), s;
157
+ }
158
+ case "FieldDefinition":
159
+ return [A(e2, t, n), n("name"), i.arguments.length > 0 ? y(["(", x([l, E([I("", ", "), l], g(e2, t, n, "arguments"))]), l, ")"]) : "", ": ", n("type"), _(e2, n, i)];
160
+ case "DirectiveDefinition":
161
+ return [A(e2, t, n), "directive ", "@", n("name"), i.arguments.length > 0 ? y(["(", x([l, E([I("", ", "), l], g(e2, t, n, "arguments"))]), l, ")"]) : "", i.repeatable ? " repeatable" : "", " on ", ...E(" | ", e2.map(n, "locations"))];
162
+ case "EnumTypeExtension":
163
+ case "EnumTypeDefinition":
164
+ return [A(e2, t, n), i.kind === "EnumTypeExtension" ? "extend " : "", "enum ", n("name"), _(e2, n, i), i.values.length > 0 ? [" {", x([f, E(f, g(e2, t, n, "values"))]), f, "}"] : ""];
165
+ case "EnumValueDefinition":
166
+ return [A(e2, t, n), n("name"), _(e2, n, i)];
167
+ case "InputValueDefinition":
168
+ return [A(e2, t, n), n("name"), ": ", n("type"), i.defaultValue ? [" = ", n("defaultValue")] : "", _(e2, n, i)];
169
+ case "SchemaExtension":
170
+ return ["extend schema", _(e2, n, i), ...i.operationTypes.length > 0 ? [" {", x([f, E(f, g(e2, t, n, "operationTypes"))]), f, "}"] : []];
171
+ case "SchemaDefinition":
172
+ return [A(e2, t, n), "schema", _(e2, n, i), " {", i.operationTypes.length > 0 ? x([f, E(f, g(e2, t, n, "operationTypes"))]) : "", f, "}"];
173
+ case "OperationTypeDefinition":
174
+ return [i.operation, ": ", n("type")];
175
+ case "FragmentSpread":
176
+ return ["...", n("name"), _(e2, n, i)];
177
+ case "InlineFragment":
178
+ return ["...", i.typeCondition ? [" on ", n("typeCondition")] : "", _(e2, n, i), " ", n("selectionSet")];
179
+ case "UnionTypeExtension":
180
+ case "UnionTypeDefinition":
181
+ return y([A(e2, t, n), y([i.kind === "UnionTypeExtension" ? "extend " : "", "union ", n("name"), _(e2, n, i), i.types.length > 0 ? [" =", I("", " "), x([I([k, "| "]), E([k, "| "], e2.map(n, "types"))])] : ""])]);
182
+ case "ScalarTypeExtension":
183
+ case "ScalarTypeDefinition":
184
+ return [A(e2, t, n), i.kind === "ScalarTypeExtension" ? "extend " : "", "scalar ", n("name"), _(e2, n, i)];
185
+ case "NonNullType":
186
+ return [n("type"), "!"];
187
+ case "ListType":
188
+ return ["[", n("type"), "]"];
189
+ default:
190
+ throw new ke(i, "Graphql", "kind");
191
+ }
192
+ }
193
+ function _(e2, t, n) {
194
+ if (n.directives.length === 0) return "";
195
+ let i = E(k, e2.map(t, "directives"));
196
+ return n.kind === "FragmentDefinition" || n.kind === "OperationDefinition" ? y([k, i]) : [" ", y(x([l, i]))];
197
+ }
198
+ function g(e2, t, n, i) {
199
+ return e2.map(({ isLast: r, node: s }) => {
200
+ let a = n();
201
+ return !r && Se(t.originalText, q(s)) ? [a, f] : a;
202
+ }, i);
203
+ }
204
+ function gt(e2) {
205
+ return e2.kind !== "Comment";
206
+ }
207
+ function St({ node: e2 }) {
208
+ if (e2.kind === "Comment") return "#" + e2.value.trimEnd();
209
+ throw new Error("Not a comment: " + JSON.stringify(e2));
210
+ }
211
+ function kt(e2, t, n) {
212
+ let { node: i } = e2, r = [], { interfaces: s } = i, a = e2.map(n, "interfaces");
213
+ for (let u = 0; u < s.length; u++) {
214
+ let p = s[u];
215
+ r.push(a[u]);
216
+ let T = s[u + 1];
217
+ if (T) {
218
+ let D = t.originalText.slice(p.loc.end, T.loc.start).includes("#");
219
+ r.push(" &", D ? k : " ");
220
+ }
221
+ }
222
+ return r;
223
+ }
224
+ function Be(e2, t) {
225
+ let { node: n } = e2;
226
+ return se(n.variableDefinitions) ? y(["(", x([l, E([I("", ", "), l], e2.map(t, "variableDefinitions"))]), l, ")"]) : "";
227
+ }
228
+ function Ue(e2, t) {
229
+ e2.kind === "StringValue" && e2.block && !e2.value.includes(`
230
+ `) && (t.value = e2.value.trim());
231
+ }
232
+ function Ct(e2) {
233
+ let { node: t } = e2;
234
+ return t?.comments?.some((n) => n.value.trim() === "prettier-ignore");
235
+ }
236
+ function Xe(e2) {
237
+ return typeof e2 == "object" && e2 !== null;
238
+ }
239
+ function He(e2, t) {
240
+ if (!e2) throw new Error(t ?? "Unexpected invariant triggered.");
241
+ }
242
+ function M(e2, t) {
243
+ let n = 0, i = 1;
244
+ for (let r of e2.body.matchAll(bt)) {
245
+ if (typeof r.index == "number" || He(!1), r.index >= t) break;
246
+ n = r.index + r[0].length, i += 1;
247
+ }
248
+ return { line: i, column: t + 1 - n };
249
+ }
250
+ function qe(e2) {
251
+ return ue(e2.source, M(e2.source, e2.start));
252
+ }
253
+ function ue(e2, t) {
254
+ let n = e2.locationOffset.column - 1, i = "".padStart(n) + e2.body, r = t.line - 1, s = e2.locationOffset.line - 1, a = t.line + s, u = t.line === 1 ? n : 0, p = t.column + u, T = `${e2.name}:${a}:${p}
255
+ `, d = i.split(/\r\n|[\n\r]/g), D = d[r];
256
+ if (D.length > 120) {
257
+ let O = Math.floor(p / 80), re = p % 80, N = [];
258
+ for (let v = 0; v < D.length; v += 80) N.push(D.slice(v, v + 80));
259
+ return T + Je([[`${a} |`, N[0]], ...N.slice(1, O + 1).map((v) => ["|", v]), ["|", "^".padStart(re)], ["|", N[O + 1]]]);
260
+ }
261
+ return T + Je([[`${a - 1} |`, d[r - 1]], [`${a} |`, D], ["|", "^".padStart(p)], [`${a + 1} |`, d[r + 1]]]);
262
+ }
263
+ function Je(e2) {
264
+ let t = e2.filter(([i, r]) => r !== void 0), n = Math.max(...t.map(([i]) => i.length));
265
+ return t.map(([i, r]) => i.padStart(n) + (r ? " " + r : "")).join(`
266
+ `);
267
+ }
268
+ function Lt(e2) {
269
+ let t = e2[0];
270
+ 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;
271
+ }
272
+ function Qe(e2) {
273
+ return e2 === void 0 || e2.length === 0 ? void 0 : e2;
274
+ }
275
+ function h(e2, t, n) {
276
+ return new Q(`Syntax Error: ${n}`, { source: e2, positions: [t] });
277
+ }
278
+ function We(e2) {
279
+ return e2 === 9 || e2 === 32;
280
+ }
281
+ function b(e2) {
282
+ return e2 >= 48 && e2 <= 57;
283
+ }
284
+ function ze(e2) {
285
+ return e2 >= 97 && e2 <= 122 || e2 >= 65 && e2 <= 90;
286
+ }
287
+ function pe(e2) {
288
+ return ze(e2) || e2 === 95;
289
+ }
290
+ function Ke(e2) {
291
+ return ze(e2) || b(e2) || e2 === 95;
292
+ }
293
+ function Ze(e2) {
294
+ var t;
295
+ let n = Number.MAX_SAFE_INTEGER, i = null, r = -1;
296
+ for (let a = 0; a < e2.length; ++a) {
297
+ var s;
298
+ let u = e2[a], p = Pt(u);
299
+ p !== u.length && (i = (s = i) !== null && s !== void 0 ? s : a, r = a, a !== 0 && p < n && (n = p));
300
+ }
301
+ return e2.map((a, u) => u === 0 ? a : a.slice(n)).slice((t = i) !== null && t !== void 0 ? t : 0, r + 1);
302
+ }
303
+ function Pt(e2) {
304
+ let t = 0;
305
+ for (; t < e2.length && We(e2.charCodeAt(t)); ) ++t;
306
+ return t;
307
+ }
308
+ function tt(e2) {
309
+ return e2 === o.BANG || e2 === o.DOLLAR || e2 === o.AMP || e2 === o.PAREN_L || e2 === o.PAREN_R || e2 === o.DOT || 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;
310
+ }
311
+ function L(e2) {
312
+ return e2 >= 0 && e2 <= 55295 || e2 >= 57344 && e2 <= 1114111;
313
+ }
314
+ function K(e2, t) {
315
+ return nt(e2.charCodeAt(t)) && rt(e2.charCodeAt(t + 1));
316
+ }
317
+ function nt(e2) {
318
+ return e2 >= 55296 && e2 <= 56319;
319
+ }
320
+ function rt(e2) {
321
+ return e2 >= 56320 && e2 <= 57343;
322
+ }
323
+ function R(e2, t) {
324
+ let n = e2.source.body.codePointAt(t);
325
+ if (n === void 0) return o.EOF;
326
+ if (n >= 32 && n <= 126) {
327
+ let i = String.fromCodePoint(n);
328
+ return i === '"' ? `'"'` : `"${i}"`;
329
+ }
330
+ return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
331
+ }
332
+ function m(e2, t, n, i, r) {
333
+ let s = e2.line, a = 1 + n - e2.lineStart;
334
+ return new F(t, n, i, s, a, r);
335
+ }
336
+ function wt(e2, t) {
337
+ let n = e2.source.body, i = n.length, r = t;
338
+ for (; r < i; ) {
339
+ let s = n.charCodeAt(r);
340
+ switch (s) {
341
+ case 65279:
342
+ case 9:
343
+ case 32:
344
+ case 44:
345
+ ++r;
346
+ continue;
347
+ case 10:
348
+ ++r, ++e2.line, e2.lineStart = r;
349
+ continue;
350
+ case 13:
351
+ n.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++e2.line, e2.lineStart = r;
352
+ continue;
353
+ case 35:
354
+ return Ft(e2, r);
355
+ case 33:
356
+ return m(e2, o.BANG, r, r + 1);
357
+ case 36:
358
+ return m(e2, o.DOLLAR, r, r + 1);
359
+ case 38:
360
+ return m(e2, o.AMP, r, r + 1);
361
+ case 40:
362
+ return m(e2, o.PAREN_L, r, r + 1);
363
+ case 41:
364
+ return m(e2, o.PAREN_R, r, r + 1);
365
+ case 46:
366
+ if (n.charCodeAt(r + 1) === 46 && n.charCodeAt(r + 2) === 46) return m(e2, o.SPREAD, r, r + 3);
367
+ break;
368
+ case 58:
369
+ return m(e2, o.COLON, r, r + 1);
370
+ case 61:
371
+ return m(e2, o.EQUALS, r, r + 1);
372
+ case 64:
373
+ return m(e2, o.AT, r, r + 1);
374
+ case 91:
375
+ return m(e2, o.BRACKET_L, r, r + 1);
376
+ case 93:
377
+ return m(e2, o.BRACKET_R, r, r + 1);
378
+ case 123:
379
+ return m(e2, o.BRACE_L, r, r + 1);
380
+ case 124:
381
+ return m(e2, o.PIPE, r, r + 1);
382
+ case 125:
383
+ return m(e2, o.BRACE_R, r, r + 1);
384
+ case 34:
385
+ return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? Yt(e2, r) : Vt(e2, r);
386
+ }
387
+ if (b(s) || s === 45) return Mt(e2, r, s);
388
+ if (pe(s)) return jt(e2, r);
389
+ throw h(e2.source, r, s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : L(s) || K(n, r) ? `Unexpected character: ${R(e2, r)}.` : `Invalid character: ${R(e2, r)}.`);
390
+ }
391
+ return m(e2, o.EOF, i, i);
392
+ }
393
+ function Ft(e2, t) {
394
+ let n = e2.source.body, i = n.length, r = t + 1;
395
+ for (; r < i; ) {
396
+ let s = n.charCodeAt(r);
397
+ if (s === 10 || s === 13) break;
398
+ if (L(s)) ++r;
399
+ else if (K(n, r)) r += 2;
400
+ else break;
401
+ }
402
+ return m(e2, o.COMMENT, t, r, n.slice(t + 1, r));
403
+ }
404
+ function Mt(e2, t, n) {
405
+ let i = e2.source.body, r = t, s = n, a = !1;
406
+ if (s === 45 && (s = i.charCodeAt(++r)), s === 48) {
407
+ if (s = i.charCodeAt(++r), b(s)) throw h(e2.source, r, `Invalid number, unexpected digit after 0: ${R(e2, r)}.`);
408
+ } else r = le(e2, r, s), s = i.charCodeAt(r);
409
+ if (s === 46 && (a = !0, s = i.charCodeAt(++r), r = le(e2, r, s), s = i.charCodeAt(r)), (s === 69 || s === 101) && (a = !0, s = i.charCodeAt(++r), (s === 43 || s === 45) && (s = i.charCodeAt(++r)), r = le(e2, r, s), s = i.charCodeAt(r)), s === 46 || pe(s)) throw h(e2.source, r, `Invalid number, expected digit but got: ${R(e2, r)}.`);
410
+ return m(e2, a ? o.FLOAT : o.INT, t, r, i.slice(t, r));
411
+ }
412
+ function le(e2, t, n) {
413
+ if (!b(n)) throw h(e2.source, t, `Invalid number, expected digit but got: ${R(e2, t)}.`);
414
+ let i = e2.source.body, r = t + 1;
415
+ for (; b(i.charCodeAt(r)); ) ++r;
416
+ return r;
417
+ }
418
+ function Vt(e2, t) {
419
+ let n = e2.source.body, i = n.length, r = t + 1, s = r, a = "";
420
+ for (; r < i; ) {
421
+ let u = n.charCodeAt(r);
422
+ if (u === 34) return a += n.slice(s, r), m(e2, o.STRING, t, r + 1, a);
423
+ if (u === 92) {
424
+ a += n.slice(s, r);
425
+ let p = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ? Bt(e2, r) : Ut(e2, r) : Gt(e2, r);
426
+ a += p.value, r += p.size, s = r;
427
+ continue;
428
+ }
429
+ if (u === 10 || u === 13) break;
430
+ if (L(u)) ++r;
431
+ else if (K(n, r)) r += 2;
432
+ else throw h(e2.source, r, `Invalid character within String: ${R(e2, r)}.`);
433
+ }
434
+ throw h(e2.source, r, "Unterminated string.");
435
+ }
436
+ function Bt(e2, t) {
437
+ let n = e2.source.body, i = 0, r = 3;
438
+ for (; r < 12; ) {
439
+ let s = n.charCodeAt(t + r++);
440
+ if (s === 125) {
441
+ if (r < 5 || !L(i)) break;
442
+ return { value: String.fromCodePoint(i), size: r };
443
+ }
444
+ if (i = i << 4 | V(s), i < 0) break;
445
+ }
446
+ throw h(e2.source, t, `Invalid Unicode escape sequence: "${n.slice(t, t + r)}".`);
447
+ }
448
+ function Ut(e2, t) {
449
+ let n = e2.source.body, i = et(n, t + 2);
450
+ if (L(i)) return { value: String.fromCodePoint(i), size: 6 };
451
+ if (nt(i) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
452
+ let r = et(n, t + 8);
453
+ if (rt(r)) return { value: String.fromCodePoint(i, r), size: 12 };
454
+ }
455
+ throw h(e2.source, t, `Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`);
456
+ }
457
+ function et(e2, t) {
458
+ return V(e2.charCodeAt(t)) << 12 | V(e2.charCodeAt(t + 1)) << 8 | V(e2.charCodeAt(t + 2)) << 4 | V(e2.charCodeAt(t + 3));
459
+ }
460
+ function V(e2) {
461
+ return e2 >= 48 && e2 <= 57 ? e2 - 48 : e2 >= 65 && e2 <= 70 ? e2 - 55 : e2 >= 97 && e2 <= 102 ? e2 - 87 : -1;
462
+ }
463
+ function Gt(e2, t) {
464
+ let n = e2.source.body;
465
+ switch (n.charCodeAt(t + 1)) {
466
+ case 34:
467
+ return { value: '"', size: 2 };
468
+ case 92:
469
+ return { value: "\\", size: 2 };
470
+ case 47:
471
+ return { value: "/", size: 2 };
472
+ case 98:
473
+ return { value: "\b", size: 2 };
474
+ case 102:
475
+ return { value: "\f", size: 2 };
476
+ case 110:
477
+ return { value: `
478
+ `, size: 2 };
479
+ case 114:
480
+ return { value: "\r", size: 2 };
481
+ case 116:
482
+ return { value: " ", size: 2 };
483
+ }
484
+ throw h(e2.source, t, `Invalid character escape sequence: "${n.slice(t, t + 2)}".`);
485
+ }
486
+ function Yt(e2, t) {
487
+ let n = e2.source.body, i = n.length, r = e2.lineStart, s = t + 3, a = s, u = "", p = [];
488
+ for (; s < i; ) {
489
+ let T = n.charCodeAt(s);
490
+ if (T === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
491
+ u += n.slice(a, s), p.push(u);
492
+ let d = m(e2, o.BLOCK_STRING, t, s + 3, Ze(p).join(`
493
+ `));
494
+ return e2.line += p.length - 1, e2.lineStart = r, d;
495
+ }
496
+ if (T === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
497
+ u += n.slice(a, s), a = s + 1, s += 4;
498
+ continue;
499
+ }
500
+ if (T === 10 || T === 13) {
501
+ u += n.slice(a, s), p.push(u), T === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, u = "", a = s, r = s;
502
+ continue;
503
+ }
504
+ if (L(T)) ++s;
505
+ else if (K(n, s)) s += 2;
506
+ else throw h(e2.source, s, `Invalid character within String: ${R(e2, s)}.`);
507
+ }
508
+ throw h(e2.source, s, "Unterminated string.");
509
+ }
510
+ function jt(e2, t) {
511
+ let n = e2.source.body, i = n.length, r = t + 1;
512
+ for (; r < i; ) {
513
+ let s = n.charCodeAt(r);
514
+ if (Ke(s)) ++r;
515
+ else break;
516
+ }
517
+ return m(e2, o.NAME, t, r, n.slice(t, r));
518
+ }
519
+ function Z(e2, t) {
520
+ if (!e2) throw new Error(t);
521
+ }
522
+ function ee(e2) {
523
+ return te(e2, []);
524
+ }
525
+ function te(e2, t) {
526
+ switch (typeof e2) {
527
+ case "string":
528
+ return JSON.stringify(e2);
529
+ case "function":
530
+ return e2.name ? `[function ${e2.name}]` : "[function]";
531
+ case "object":
532
+ return $t(e2, t);
533
+ default:
534
+ return String(e2);
535
+ }
536
+ }
537
+ function $t(e2, t) {
538
+ if (e2 === null) return "null";
539
+ if (t.includes(e2)) return "[Circular]";
540
+ let n = [...t, e2];
541
+ if (Xt(e2)) {
542
+ let i = e2.toJSON();
543
+ if (i !== e2) return typeof i == "string" ? i : te(i, n);
544
+ } else if (Array.isArray(e2)) return Jt(e2, n);
545
+ return Ht(e2, n);
546
+ }
547
+ function Xt(e2) {
548
+ return typeof e2.toJSON == "function";
549
+ }
550
+ function Ht(e2, t) {
551
+ let n = Object.entries(e2);
552
+ return n.length === 0 ? "{}" : t.length > 2 ? "[" + qt(e2) + "]" : "{ " + n.map(([r, s]) => r + ": " + te(s, t)).join(", ") + " }";
553
+ }
554
+ function Jt(e2, t) {
555
+ if (e2.length === 0) return "[]";
556
+ if (t.length > 2) return "[Array]";
557
+ let n = Math.min(10, e2.length), i = e2.length - n, r = [];
558
+ for (let s = 0; s < n; ++s) r.push(te(e2[s], t));
559
+ return i === 1 ? r.push("... 1 more item") : i > 1 && r.push(`... ${i} more items`), "[" + r.join(", ") + "]";
560
+ }
561
+ function qt(e2) {
562
+ let t = Object.prototype.toString.call(e2).replace(/^\[object /, "").replace(/]$/, "");
563
+ if (t === "Object" && typeof e2.constructor == "function") {
564
+ let n = e2.constructor.name;
565
+ if (typeof n == "string" && n !== "") return n;
566
+ }
567
+ return t;
568
+ }
569
+ function st(e2) {
570
+ return it(e2, B);
571
+ }
572
+ function ot(e2, t) {
573
+ let n = new fe(e2, t), i = n.parseDocument();
574
+ return Object.defineProperty(i, "tokenCount", { enumerable: !1, value: n.tokenCount }), i;
575
+ }
576
+ function ne(e2) {
577
+ let t = e2.value;
578
+ return at(e2.kind) + (t != null ? ` "${t}"` : "");
579
+ }
580
+ function at(e2) {
581
+ return tt(e2) ? `"${e2}"` : e2;
582
+ }
583
+ function Wt(e2, t) {
584
+ let n = new SyntaxError(e2 + " (" + t.loc.start.line + ":" + t.loc.start.column + ")");
585
+ return Object.assign(n, t);
586
+ }
587
+ function zt(e2) {
588
+ let t = [], { startToken: n, endToken: i } = e2.loc;
589
+ for (let r = n; r !== i; r = r.next) r.kind === "Comment" && t.push({ ...r, loc: { start: r.start, end: r.end } });
590
+ return t;
591
+ }
592
+ function Zt(e2) {
593
+ if (e2?.name === "GraphQLError") {
594
+ let { message: t, locations: [n] } = e2;
595
+ return ct(t, { loc: { start: n }, cause: e2 });
596
+ }
597
+ return e2;
598
+ }
599
+ function en(e2) {
600
+ let t;
601
+ try {
602
+ t = ot(e2, Kt);
603
+ } catch (n) {
604
+ throw Zt(n);
605
+ }
606
+ return t.comments = zt(t), t;
607
+ }
608
+ var pt, de, ut, me, lt, ft, U, ht, ie, Ee, Te, Ne, G, xe, S, Y, _e, k, l, dt, f, kn, $, ye, Ae, Oe, X, Ie, De, ge, Se, se, oe, ke, P, yt, Ce, H, F, ce, qn, C, Re, ve, Ot, be, J, q, Le, Pe, we, Fe, Me, Ve, A, Rt, Ge, Ye, je, vt, $e, he, bt, Q, W, c, o, z, Qt, it, B, fe, ct, Kt, tn, nn, init_graphql = __esm({
609
+ "../../node_modules/.pnpm/prettier@3.7.4/node_modules/prettier/plugins/graphql.mjs"() {
610
+ init_cjs_shims();
611
+ pt = Object.defineProperty, de = (e2, t) => {
612
+ for (var n in t) pt(e2, n, { get: t[n], enumerable: !0 });
613
+ }, ut = {};
614
+ de(ut, { languages: () => Ye, options: () => $e, parsers: () => he, printers: () => nn });
615
+ me = (e2, t) => (n, i, ...r) => n | 1 && i == null ? void 0 : (t.call(i) ?? i[e2]).apply(i, r), lt = String.prototype.replaceAll ?? function(e2, t) {
616
+ return e2.global ? this.replace(e2, t) : this.split(e2).join(t);
617
+ }, ft = me("replaceAll", function() {
618
+ if (typeof this == "string") return lt;
619
+ }), U = ft, ht = () => {
620
+ }, ie = ht, Ee = "indent", Te = "group", Ne = "if-break", G = "line", xe = "break-parent", S = ie, Y = ie;
621
+ _e = { type: xe };
622
+ k = { type: G }, l = { type: G, soft: !0 }, dt = { type: G, hard: !0 }, f = [dt, _e];
623
+ kn = j(/\s/u), $ = j(" "), ye = j(",; "), Ae = j(/[^\n\r]/u), Oe = (e2) => e2 === `
624
+ ` || e2 === "\r" || e2 === "\u2028" || e2 === "\u2029";
625
+ X = mt;
626
+ Ie = Et;
627
+ De = Tt;
628
+ ge = Nt;
629
+ Se = xt;
630
+ se = _t, oe = class extends Error {
631
+ name = "UnexpectedNodeError";
632
+ constructor(t, n, i = "type") {
633
+ super(`Unexpected ${n} node ${i}: ${JSON.stringify(t[i])}.`), this.node = t;
634
+ }
635
+ }, ke = oe, P = null;
636
+ yt = 10;
637
+ for (let e2 = 0; e2 <= yt; e2++) w();
638
+ Ce = At, H = class {
639
+ constructor(t, n, i) {
640
+ this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source = i;
641
+ }
642
+ get [Symbol.toStringTag]() {
643
+ return "Location";
644
+ }
645
+ toJSON() {
646
+ return { start: this.start, end: this.end };
647
+ }
648
+ }, F = class {
649
+ constructor(t, n, i, r, s, a) {
650
+ this.kind = t, this.start = n, this.end = i, this.line = r, this.column = s, this.value = a, this.prev = null, this.next = null;
651
+ }
652
+ get [Symbol.toStringTag]() {
653
+ return "Token";
654
+ }
655
+ toJSON() {
656
+ return { kind: this.kind, value: this.value, line: this.line, column: this.column };
657
+ }
658
+ }, ce = { Name: [], Document: ["definitions"], OperationDefinition: ["description", "name", "variableDefinitions", "directives", "selectionSet"], VariableDefinition: ["description", "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: ["description", "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"], TypeCoordinate: ["name"], MemberCoordinate: ["name", "memberName"], ArgumentCoordinate: ["name", "fieldName", "argumentName"], DirectiveCoordinate: ["name"], DirectiveArgumentCoordinate: ["name", "argumentName"] }, qn = new Set(Object.keys(ce));
659
+ (function(e2) {
660
+ e2.QUERY = "query", e2.MUTATION = "mutation", e2.SUBSCRIPTION = "subscription";
661
+ })(C || (C = {}));
662
+ Re = { ...ce };
663
+ for (let e2 of ["ArgumentCoordinate", "DirectiveArgumentCoordinate", "DirectiveCoordinate", "MemberCoordinate", "TypeCoordinate"]) delete Re[e2];
664
+ ve = Re, Ot = Ce(ve, "kind"), be = Ot, J = (e2) => e2.loc.start, q = (e2) => e2.loc.end, Le = "format", Pe = /^\s*#[^\S\n]*@(?:noformat|noprettier)\s*(?:\n|$)/u, we = /^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/u, Fe = (e2) => we.test(e2), Me = (e2) => Pe.test(e2), Ve = (e2) => `# @${Le}
665
+
666
+ ${e2}`;
667
+ A = It;
668
+ Ue.ignoredProperties = /* @__PURE__ */ new Set(["loc", "comments"]);
669
+ Rt = { print: Dt, massageAstNode: Ue, hasPrettierIgnore: Ct, insertPragma: Ve, printComment: St, canAttachComment: gt, getVisitorKeys: be }, Ge = Rt, Ye = [{ name: "GraphQL", type: "data", aceMode: "graphqlschema", extensions: [".graphql", ".gql", ".graphqls"], tmScope: "source.graphql", parsers: ["graphql"], vscodeLanguageIds: ["graphql"], linguistLanguageId: 139 }], je = { bracketSpacing: { category: "Common", type: "boolean", default: !0, description: "Print spaces between brackets.", oppositeDescription: "Do not print spaces between brackets." }, objectWrap: { category: "Common", type: "choice", default: "preserve", description: "How to wrap object literals.", choices: [{ value: "preserve", description: "Keep as multi-line, if there is a newline between the opening brace and first property." }, { value: "collapse", description: "Fit to a single line when possible." }] }, singleQuote: { category: "Common", type: "boolean", default: !1, 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: !1, description: "Put > of opening tags on the last line instead of on a new line." }, singleAttributePerLine: { category: "Common", type: "boolean", default: !1, description: "Enforce single attribute per line in HTML, Vue and JSX." } }, vt = { bracketSpacing: je.bracketSpacing }, $e = vt, he = {};
670
+ de(he, { graphql: () => tn });
671
+ bt = /\r\n|[\n\r]/g;
672
+ Q = class e extends Error {
673
+ constructor(t, ...n) {
674
+ var i, r, s;
675
+ let { nodes: a, source: u, positions: p, path: T, originalError: d, extensions: D } = Lt(n);
676
+ super(t), this.name = "GraphQLError", this.path = T ?? void 0, this.originalError = d ?? void 0, this.nodes = Qe(Array.isArray(a) ? a : a ? [a] : void 0);
677
+ let O = Qe((i = this.nodes) === null || i === void 0 ? void 0 : i.map((N) => N.loc).filter((N) => N != null));
678
+ this.source = u ?? (O == null || (r = O[0]) === null || r === void 0 ? void 0 : r.source), this.positions = p ?? O?.map((N) => N.start), this.locations = p && u ? p.map((N) => M(u, N)) : O?.map((N) => M(N.source, N.start));
679
+ let re = Xe(d?.extensions) ? d?.extensions : void 0;
680
+ this.extensions = (s = D ?? re) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, { message: { writable: !0, enumerable: !0 }, name: { enumerable: !1 }, nodes: { enumerable: !1 }, source: { enumerable: !1 }, positions: { enumerable: !1 }, originalError: { enumerable: !1 } }), d != null && d.stack ? Object.defineProperty(this, "stack", { value: d.stack, writable: !0, configurable: !0 }) : Error.captureStackTrace ? Error.captureStackTrace(this, e) : Object.defineProperty(this, "stack", { value: Error().stack, writable: !0, configurable: !0 });
681
+ }
682
+ get [Symbol.toStringTag]() {
683
+ return "GraphQLError";
684
+ }
685
+ toString() {
686
+ let t = this.message;
687
+ if (this.nodes) for (let n of this.nodes) n.loc && (t += `
688
+
689
+ ` + qe(n.loc));
690
+ else if (this.source && this.locations) for (let n of this.locations) t += `
691
+
692
+ ` + ue(this.source, n);
693
+ return t;
694
+ }
695
+ toJSON() {
696
+ let t = { message: this.message };
697
+ 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;
698
+ }
699
+ };
700
+ (function(e2) {
701
+ 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";
702
+ })(W || (W = {}));
703
+ (function(e2) {
704
+ 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", e2.TYPE_COORDINATE = "TypeCoordinate", e2.MEMBER_COORDINATE = "MemberCoordinate", e2.ARGUMENT_COORDINATE = "ArgumentCoordinate", e2.DIRECTIVE_COORDINATE = "DirectiveCoordinate", e2.DIRECTIVE_ARGUMENT_COORDINATE = "DirectiveArgumentCoordinate";
705
+ })(c || (c = {}));
706
+ (function(e2) {
707
+ e2.SOF = "<SOF>", e2.EOF = "<EOF>", e2.BANG = "!", e2.DOLLAR = "$", e2.AMP = "&", e2.PAREN_L = "(", e2.PAREN_R = ")", e2.DOT = ".", 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";
708
+ })(o || (o = {}));
709
+ z = class {
710
+ constructor(t) {
711
+ let n = new F(o.SOF, 0, 0, 0, 0);
712
+ this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
713
+ }
714
+ get [Symbol.toStringTag]() {
715
+ return "Lexer";
716
+ }
717
+ advance() {
718
+ return this.lastToken = this.token, this.token = this.lookahead();
719
+ }
720
+ lookahead() {
721
+ let t = this.token;
722
+ if (t.kind !== o.EOF) do
723
+ if (t.next) t = t.next;
724
+ else {
725
+ let n = wt(this, t.end);
726
+ t.next = n, n.prev = t, t = n;
727
+ }
728
+ while (t.kind === o.COMMENT);
729
+ return t;
730
+ }
731
+ };
732
+ Qt = globalThis.process && !0, it = Qt ? function(t, n) {
733
+ return t instanceof n;
734
+ } : function(t, n) {
735
+ if (t instanceof n) return !0;
736
+ if (typeof t == "object" && t !== null) {
737
+ var i;
738
+ let r = n.prototype[Symbol.toStringTag], s = Symbol.toStringTag in t ? t[Symbol.toStringTag] : (i = t.constructor) === null || i === void 0 ? void 0 : i.name;
739
+ if (r === s) {
740
+ let a = ee(t);
741
+ throw new Error(`Cannot use ${r} "${a}" from another module or realm.
742
+
743
+ Ensure that there is only one instance of "graphql" in the node_modules
744
+ directory. If different versions of "graphql" are the dependencies of other
745
+ relied on modules, use "resolutions" to ensure only one version is installed.
746
+
747
+ https://yarnpkg.com/en/docs/selective-version-resolutions
748
+
749
+ Duplicate "graphql" modules cannot be used at the same time since different
750
+ versions may have different capabilities and behavior. The data from one
751
+ version used in the function from another could produce confusing and
752
+ spurious results.`);
753
+ }
754
+ }
755
+ return !1;
756
+ }, B = class {
757
+ constructor(t, n = "GraphQL request", i = { line: 1, column: 1 }) {
758
+ typeof t == "string" || Z(!1, `Body must be a string. Received: ${ee(t)}.`), this.body = t, this.name = n, this.locationOffset = i, this.locationOffset.line > 0 || Z(!1, "line in locationOffset is 1-indexed and must be positive."), this.locationOffset.column > 0 || Z(!1, "column in locationOffset is 1-indexed and must be positive.");
759
+ }
760
+ get [Symbol.toStringTag]() {
761
+ return "Source";
762
+ }
763
+ };
764
+ fe = class {
765
+ constructor(t, n = {}) {
766
+ let { lexer: i, ...r } = n;
767
+ if (i) this._lexer = i;
768
+ else {
769
+ let s = st(t) ? t : new B(t);
770
+ this._lexer = new z(s);
771
+ }
772
+ this._options = r, this._tokenCounter = 0;
773
+ }
774
+ get tokenCount() {
775
+ return this._tokenCounter;
776
+ }
777
+ parseName() {
778
+ let t = this.expectToken(o.NAME);
779
+ return this.node(t, { kind: c.NAME, value: t.value });
780
+ }
781
+ parseDocument() {
782
+ return this.node(this._lexer.token, { kind: c.DOCUMENT, definitions: this.many(o.SOF, this.parseDefinition, o.EOF) });
783
+ }
784
+ parseDefinition() {
785
+ if (this.peek(o.BRACE_L)) return this.parseOperationDefinition();
786
+ let t = this.peekDescription(), n = t ? this._lexer.lookahead() : this._lexer.token;
787
+ if (t && n.kind === o.BRACE_L) throw h(this._lexer.source, this._lexer.token.start, "Unexpected description, descriptions are not supported on shorthand queries.");
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
+ switch (n.value) {
808
+ case "query":
809
+ case "mutation":
810
+ case "subscription":
811
+ return this.parseOperationDefinition();
812
+ case "fragment":
813
+ return this.parseFragmentDefinition();
814
+ }
815
+ if (t) throw h(this._lexer.source, this._lexer.token.start, "Unexpected description, only GraphQL definitions support descriptions.");
816
+ switch (n.value) {
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: C.QUERY, description: void 0, name: void 0, variableDefinitions: [], directives: [], selectionSet: this.parseSelectionSet() });
826
+ let n = this.parseDescription(), i = this.parseOperationType(), r;
827
+ return this.peek(o.NAME) && (r = this.parseName()), this.node(t, { kind: c.OPERATION_DEFINITION, operation: i, description: n, name: r, variableDefinitions: this.parseVariableDefinitions(), directives: this.parseDirectives(!1), selectionSet: this.parseSelectionSet() });
828
+ }
829
+ parseOperationType() {
830
+ let t = this.expectToken(o.NAME);
831
+ switch (t.value) {
832
+ case "query":
833
+ return C.QUERY;
834
+ case "mutation":
835
+ return C.MUTATION;
836
+ case "subscription":
837
+ return C.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, description: this.parseDescription(), 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(), i, r;
859
+ return this.expectOptionalToken(o.COLON) ? (i = n, r = this.parseName()) : r = n, this.node(t, { kind: c.FIELD, alias: i, name: r, arguments: this.parseArguments(!1), directives: this.parseDirectives(!1), 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 = !1) {
866
+ let n = this._lexer.token, i = this.parseName();
867
+ return this.expectToken(o.COLON), this.node(n, { kind: c.ARGUMENT, name: i, value: this.parseValueLiteral(t) });
868
+ }
869
+ parseConstArgument() {
870
+ return this.parseArgument(!0);
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(!1) }) : this.node(t, { kind: c.INLINE_FRAGMENT, typeCondition: n ? this.parseNamedType() : void 0, directives: this.parseDirectives(!1), selectionSet: this.parseSelectionSet() });
877
+ }
878
+ parseFragmentDefinition() {
879
+ let t = this._lexer.token, n = this.parseDescription();
880
+ return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(t, { kind: c.FRAGMENT_DEFINITION, description: n, name: this.parseFragmentName(), variableDefinitions: this.parseVariableDefinitions(), typeCondition: (this.expectKeyword("on"), this.parseNamedType()), directives: this.parseDirectives(!1), selectionSet: this.parseSelectionSet() }) : this.node(t, { kind: c.FRAGMENT_DEFINITION, description: n, name: this.parseFragmentName(), typeCondition: (this.expectKeyword("on"), this.parseNamedType()), directives: this.parseDirectives(!1), 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: !0 });
904
+ case "false":
905
+ return this.node(n, { kind: c.BOOLEAN, value: !1 });
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 i = this._lexer.token.value;
914
+ throw h(this._lexer.source, n.start, `Unexpected variable "$${i}" 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(!0);
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, i = this.parseName();
938
+ return this.expectToken(o.COLON), this.node(n, { kind: c.OBJECT_FIELD, name: i, 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(!0);
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 i = this.parseTypeReference();
956
+ this.expectToken(o.BRACKET_R), n = this.node(t, { kind: c.LIST_TYPE, type: i });
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 i = this.parseConstDirectives(), r = this.many(o.BRACE_L, this.parseOperationTypeDefinition, o.BRACE_R);
973
+ return this.node(t, { kind: c.SCHEMA_DEFINITION, description: n, directives: i, operationTypes: r });
974
+ }
975
+ parseOperationTypeDefinition() {
976
+ let t = this._lexer.token, n = this.parseOperationType();
977
+ this.expectToken(o.COLON);
978
+ let i = this.parseNamedType();
979
+ return this.node(t, { kind: c.OPERATION_TYPE_DEFINITION, operation: n, type: i });
980
+ }
981
+ parseScalarTypeDefinition() {
982
+ let t = this._lexer.token, n = this.parseDescription();
983
+ this.expectKeyword("scalar");
984
+ let i = this.parseName(), r = this.parseConstDirectives();
985
+ return this.node(t, { kind: c.SCALAR_TYPE_DEFINITION, description: n, name: i, directives: r });
986
+ }
987
+ parseObjectTypeDefinition() {
988
+ let t = this._lexer.token, n = this.parseDescription();
989
+ this.expectKeyword("type");
990
+ let i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
991
+ return this.node(t, { kind: c.OBJECT_TYPE_DEFINITION, description: n, name: i, interfaces: r, 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(), i = this.parseName(), r = 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: i, arguments: r, 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(), i = this.parseName();
1010
+ this.expectToken(o.COLON);
1011
+ let r = 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: i, type: r, defaultValue: s, directives: a });
1015
+ }
1016
+ parseInterfaceTypeDefinition() {
1017
+ let t = this._lexer.token, n = this.parseDescription();
1018
+ this.expectKeyword("interface");
1019
+ let i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
1020
+ return this.node(t, { kind: c.INTERFACE_TYPE_DEFINITION, description: n, name: i, interfaces: r, directives: s, fields: a });
1021
+ }
1022
+ parseUnionTypeDefinition() {
1023
+ let t = this._lexer.token, n = this.parseDescription();
1024
+ this.expectKeyword("union");
1025
+ let i = this.parseName(), r = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
1026
+ return this.node(t, { kind: c.UNION_TYPE_DEFINITION, description: n, name: i, directives: r, 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 i = this.parseName(), r = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
1035
+ return this.node(t, { kind: c.ENUM_TYPE_DEFINITION, description: n, name: i, directives: r, 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(), i = this.parseEnumValueName(), r = this.parseConstDirectives();
1042
+ return this.node(t, { kind: c.ENUM_VALUE_DEFINITION, description: n, name: i, directives: r });
1043
+ }
1044
+ parseEnumValueName() {
1045
+ if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null") throw h(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 i = this.parseName(), r = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
1052
+ return this.node(t, { kind: c.INPUT_OBJECT_TYPE_DEFINITION, description: n, name: i, directives: r, 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(), i = this.optionalMany(o.BRACE_L, this.parseOperationTypeDefinition, o.BRACE_R);
1081
+ if (n.length === 0 && i.length === 0) throw this.unexpected();
1082
+ return this.node(t, { kind: c.SCHEMA_EXTENSION, directives: n, operationTypes: i });
1083
+ }
1084
+ parseScalarTypeExtension() {
1085
+ let t = this._lexer.token;
1086
+ this.expectKeyword("extend"), this.expectKeyword("scalar");
1087
+ let n = this.parseName(), i = this.parseConstDirectives();
1088
+ if (i.length === 0) throw this.unexpected();
1089
+ return this.node(t, { kind: c.SCALAR_TYPE_EXTENSION, name: n, directives: i });
1090
+ }
1091
+ parseObjectTypeExtension() {
1092
+ let t = this._lexer.token;
1093
+ this.expectKeyword("extend"), this.expectKeyword("type");
1094
+ let n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1095
+ if (i.length === 0 && r.length === 0 && s.length === 0) throw this.unexpected();
1096
+ return this.node(t, { kind: c.OBJECT_TYPE_EXTENSION, name: n, interfaces: i, directives: r, fields: s });
1097
+ }
1098
+ parseInterfaceTypeExtension() {
1099
+ let t = this._lexer.token;
1100
+ this.expectKeyword("extend"), this.expectKeyword("interface");
1101
+ let n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1102
+ if (i.length === 0 && r.length === 0 && s.length === 0) throw this.unexpected();
1103
+ return this.node(t, { kind: c.INTERFACE_TYPE_EXTENSION, name: n, interfaces: i, directives: r, fields: s });
1104
+ }
1105
+ parseUnionTypeExtension() {
1106
+ let t = this._lexer.token;
1107
+ this.expectKeyword("extend"), this.expectKeyword("union");
1108
+ let n = this.parseName(), i = this.parseConstDirectives(), r = this.parseUnionMemberTypes();
1109
+ if (i.length === 0 && r.length === 0) throw this.unexpected();
1110
+ return this.node(t, { kind: c.UNION_TYPE_EXTENSION, name: n, directives: i, types: r });
1111
+ }
1112
+ parseEnumTypeExtension() {
1113
+ let t = this._lexer.token;
1114
+ this.expectKeyword("extend"), this.expectKeyword("enum");
1115
+ let n = this.parseName(), i = this.parseConstDirectives(), r = this.parseEnumValuesDefinition();
1116
+ if (i.length === 0 && r.length === 0) throw this.unexpected();
1117
+ return this.node(t, { kind: c.ENUM_TYPE_EXTENSION, name: n, directives: i, values: r });
1118
+ }
1119
+ parseInputObjectTypeExtension() {
1120
+ let t = this._lexer.token;
1121
+ this.expectKeyword("extend"), this.expectKeyword("input");
1122
+ let n = this.parseName(), i = this.parseConstDirectives(), r = this.parseInputFieldsDefinition();
1123
+ if (i.length === 0 && r.length === 0) throw this.unexpected();
1124
+ return this.node(t, { kind: c.INPUT_OBJECT_TYPE_EXTENSION, name: n, directives: i, fields: r });
1125
+ }
1126
+ parseDirectiveDefinition() {
1127
+ let t = this._lexer.token, n = this.parseDescription();
1128
+ this.expectKeyword("directive"), this.expectToken(o.AT);
1129
+ let i = this.parseName(), r = 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: i, arguments: r, 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(W, n.value)) return n;
1140
+ throw this.unexpected(t);
1141
+ }
1142
+ parseSchemaCoordinate() {
1143
+ let t = this._lexer.token, n = this.expectOptionalToken(o.AT), i = this.parseName(), r;
1144
+ !n && this.expectOptionalToken(o.DOT) && (r = this.parseName());
1145
+ let s;
1146
+ return (n || r) && this.expectOptionalToken(o.PAREN_L) && (s = this.parseName(), this.expectToken(o.COLON), this.expectToken(o.PAREN_R)), n ? s ? this.node(t, { kind: c.DIRECTIVE_ARGUMENT_COORDINATE, name: i, argumentName: s }) : this.node(t, { kind: c.DIRECTIVE_COORDINATE, name: i }) : r ? s ? this.node(t, { kind: c.ARGUMENT_COORDINATE, name: i, fieldName: r, argumentName: s }) : this.node(t, { kind: c.MEMBER_COORDINATE, name: i, memberName: r }) : this.node(t, { kind: c.TYPE_COORDINATE, name: i });
1147
+ }
1148
+ node(t, n) {
1149
+ return this._options.noLocation !== !0 && (n.loc = new H(t, this._lexer.lastToken, this._lexer.source)), n;
1150
+ }
1151
+ peek(t) {
1152
+ return this._lexer.token.kind === t;
1153
+ }
1154
+ expectToken(t) {
1155
+ let n = this._lexer.token;
1156
+ if (n.kind === t) return this.advanceLexer(), n;
1157
+ throw h(this._lexer.source, n.start, `Expected ${at(t)}, found ${ne(n)}.`);
1158
+ }
1159
+ expectOptionalToken(t) {
1160
+ return this._lexer.token.kind === t ? (this.advanceLexer(), !0) : !1;
1161
+ }
1162
+ expectKeyword(t) {
1163
+ let n = this._lexer.token;
1164
+ if (n.kind === o.NAME && n.value === t) this.advanceLexer();
1165
+ else throw h(this._lexer.source, n.start, `Expected "${t}", found ${ne(n)}.`);
1166
+ }
1167
+ expectOptionalKeyword(t) {
1168
+ let n = this._lexer.token;
1169
+ return n.kind === o.NAME && n.value === t ? (this.advanceLexer(), !0) : !1;
1170
+ }
1171
+ unexpected(t) {
1172
+ let n = t ?? this._lexer.token;
1173
+ return h(this._lexer.source, n.start, `Unexpected ${ne(n)}.`);
1174
+ }
1175
+ any(t, n, i) {
1176
+ this.expectToken(t);
1177
+ let r = [];
1178
+ for (; !this.expectOptionalToken(i); ) r.push(n.call(this));
1179
+ return r;
1180
+ }
1181
+ optionalMany(t, n, i) {
1182
+ if (this.expectOptionalToken(t)) {
1183
+ let r = [];
1184
+ do
1185
+ r.push(n.call(this));
1186
+ while (!this.expectOptionalToken(i));
1187
+ return r;
1188
+ }
1189
+ return [];
1190
+ }
1191
+ many(t, n, i) {
1192
+ this.expectToken(t);
1193
+ let r = [];
1194
+ do
1195
+ r.push(n.call(this));
1196
+ while (!this.expectOptionalToken(i));
1197
+ return r;
1198
+ }
1199
+ delimitedMany(t, n) {
1200
+ this.expectOptionalToken(t);
1201
+ let i = [];
1202
+ do
1203
+ i.push(n.call(this));
1204
+ while (this.expectOptionalToken(t));
1205
+ return i;
1206
+ }
1207
+ advanceLexer() {
1208
+ let { maxTokens: t } = this._options, n = this._lexer.advance();
1209
+ if (n.kind !== o.EOF && (++this._tokenCounter, t !== void 0 && this._tokenCounter > t)) throw h(this._lexer.source, n.start, `Document contains more that ${t} tokens. Parsing aborted.`);
1210
+ }
1211
+ };
1212
+ ct = Wt;
1213
+ Kt = { allowLegacyFragmentVariables: !0 };
1214
+ tn = { parse: en, astFormat: "graphql", hasPragma: Fe, hasIgnorePragma: Me, locStart: J, locEnd: q }, nn = { graphql: Ge };
1215
+ }
1216
+ });
1217
+ init_graphql();
1218
+ export {
1219
+ ut as default,
1220
+ Ye as languages,
1221
+ $e as options,
1222
+ he as parsers,
1223
+ nn as printers
1224
+ };
1225
+ //# sourceMappingURL=graphql-PPLVYWBL.js.map