oapiex 0.3.8 → 0.3.10

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 (43) hide show
  1. package/bin/acorn-e8W_D2c_.mjs +16 -0
  2. package/bin/angular-hFYH82G-.mjs +4 -0
  3. package/bin/babel-fr_lL9to.mjs +15 -0
  4. package/bin/cli.mjs +111 -13
  5. package/bin/estree-B-Lhm4Hd.mjs +44 -0
  6. package/bin/flow-BRS1FfP1.mjs +20 -0
  7. package/bin/glimmer-BtFpvZhb.mjs +37 -0
  8. package/bin/graphql-kQVq9UYo.mjs +28 -0
  9. package/bin/html-CIcRoqWL.mjs +25 -0
  10. package/bin/markdown-uvG4mxr8.mjs +62 -0
  11. package/bin/meriyah-DyP35pNK.mjs +5 -0
  12. package/bin/postcss-CbFXTw98.mjs +61 -0
  13. package/bin/typescript-BDVDge_O.mjs +21 -0
  14. package/bin/yaml-BNfwk1xa.mjs +159 -0
  15. package/dist/acorn-21ABnSdB.cjs +4971 -0
  16. package/dist/acorn-C_1S2EAj.mjs +4969 -0
  17. package/dist/angular-BV6jfWdp.cjs +4084 -0
  18. package/dist/angular-C66eBqoS.mjs +4082 -0
  19. package/dist/babel-Bz8pZo4b.cjs +9879 -0
  20. package/dist/babel-CsQd21KZ.mjs +9877 -0
  21. package/dist/estree-CzMW7i2J.mjs +7266 -0
  22. package/dist/estree-JnZk-Onr.cjs +7270 -0
  23. package/dist/flow-BiaXaApn.mjs +52913 -0
  24. package/dist/flow-nfncfm-z.cjs +52915 -0
  25. package/dist/glimmer-B6CdKQ-2.mjs +7532 -0
  26. package/dist/glimmer-CiwR9Elq.cjs +7536 -0
  27. package/dist/graphql-BHWygr4C.cjs +1950 -0
  28. package/dist/graphql-C2x1gvQd.mjs +1945 -0
  29. package/dist/html-2W-fjNa6.cjs +7143 -0
  30. package/dist/html-kerd4hOT.mjs +7138 -0
  31. package/dist/index.cjs +15635 -22
  32. package/dist/index.mjs +15622 -8
  33. package/dist/markdown-CbyydoYw.mjs +6877 -0
  34. package/dist/markdown-Ccw9NnJ_.cjs +6882 -0
  35. package/dist/meriyah-C4Gx_ouZ.mjs +7591 -0
  36. package/dist/meriyah-CUKcThLv.cjs +7593 -0
  37. package/dist/postcss-DtZ8UtYr.cjs +6782 -0
  38. package/dist/postcss-DuVmYBUE.mjs +6777 -0
  39. package/dist/typescript-DoEQusFy.mjs +22902 -0
  40. package/dist/typescript-I6QkuLBo.cjs +22904 -0
  41. package/dist/yaml-TADhykGS.mjs +5279 -0
  42. package/dist/yaml-jVlKqQbk.cjs +5285 -0
  43. package/package.json +16 -13
@@ -0,0 +1,1945 @@
1
+ //#region node_modules/.pnpm/prettier@3.8.3/node_modules/prettier/plugins/graphql.mjs
2
+ var pt = Object.defineProperty;
3
+ var de = (e, t) => {
4
+ for (var n in t) pt(e, n, {
5
+ get: t[n],
6
+ enumerable: !0
7
+ });
8
+ };
9
+ var ut = {};
10
+ de(ut, {
11
+ languages: () => Ye,
12
+ options: () => $e,
13
+ parsers: () => he,
14
+ printers: () => nn
15
+ });
16
+ var me = (e, t) => (n, i, ...r) => n | 1 && i == null ? void 0 : (t.call(i) ?? i[e]).apply(i, r);
17
+ var lt = String.prototype.replaceAll ?? function(e, t) {
18
+ return e.global ? this.replace(e, t) : this.split(e).join(t);
19
+ }, U = me("replaceAll", function() {
20
+ if (typeof this == "string") return lt;
21
+ });
22
+ var ht = () => {}, ie = ht;
23
+ var Ee = "indent";
24
+ var Te = "group";
25
+ var Ne = "if-break";
26
+ var G = "line";
27
+ var xe = "break-parent";
28
+ var S = ie, Y = ie;
29
+ function x(e) {
30
+ return S(e), {
31
+ type: Ee,
32
+ contents: e
33
+ };
34
+ }
35
+ var _e = { type: xe };
36
+ function y(e, t = {}) {
37
+ return S(e), Y(t.expandedStates, !0), {
38
+ type: Te,
39
+ id: t.id,
40
+ contents: e,
41
+ break: !!t.shouldBreak,
42
+ expandedStates: t.expandedStates
43
+ };
44
+ }
45
+ function I(e, t = "", n = {}) {
46
+ return S(e), t !== "" && S(t), {
47
+ type: Ne,
48
+ breakContents: e,
49
+ flatContents: t,
50
+ groupId: n.groupId
51
+ };
52
+ }
53
+ function E(e, t) {
54
+ S(e), Y(t);
55
+ let n = [];
56
+ for (let i = 0; i < t.length; i++) i !== 0 && n.push(e), n.push(t[i]);
57
+ return n;
58
+ }
59
+ var k = { type: G }, l = {
60
+ type: G,
61
+ soft: !0
62
+ }, f = [{
63
+ type: G,
64
+ hard: !0
65
+ }, _e];
66
+ function j(e) {
67
+ return (t, n, i) => {
68
+ let r = !!i?.backwards;
69
+ if (n === !1) return !1;
70
+ let { length: s } = t, a = n;
71
+ for (; a >= 0 && a < s;) {
72
+ let u = t.charAt(a);
73
+ if (e instanceof RegExp) {
74
+ if (!e.test(u)) return a;
75
+ } else if (!e.includes(u)) return a;
76
+ r ? a-- : a++;
77
+ }
78
+ return a === -1 || a === s ? a : !1;
79
+ };
80
+ }
81
+ var $ = j(" "), ye = j(",; "), Ae = j(/[^\n\r]/u);
82
+ var Oe = (e) => e === `
83
+ ` || e === "\r" || e === "\u2028" || e === "\u2029";
84
+ function mt(e, t, n) {
85
+ let i = !!n?.backwards;
86
+ if (t === !1) return !1;
87
+ let r = e.charAt(t);
88
+ if (i) {
89
+ if (e.charAt(t - 1) === "\r" && r === `
90
+ `) return t - 2;
91
+ if (Oe(r)) return t - 1;
92
+ } else {
93
+ if (r === "\r" && e.charAt(t + 1) === `
94
+ `) return t + 2;
95
+ if (Oe(r)) return t + 1;
96
+ }
97
+ return t;
98
+ }
99
+ var X = mt;
100
+ function Et(e, t, n = {}) {
101
+ let i = $(e, n.backwards ? t - 1 : t, n);
102
+ return i !== X(e, i, n);
103
+ }
104
+ var Ie = Et;
105
+ function Tt(e, t) {
106
+ if (t === !1) return !1;
107
+ if (e.charAt(t) === "/" && e.charAt(t + 1) === "*") {
108
+ for (let n = t + 2; n < e.length; ++n) if (e.charAt(n) === "*" && e.charAt(n + 1) === "/") return n + 2;
109
+ }
110
+ return t;
111
+ }
112
+ var De = Tt;
113
+ function Nt(e, t) {
114
+ return t === !1 ? !1 : e.charAt(t) === "/" && e.charAt(t + 1) === "/" ? Ae(e, t) : t;
115
+ }
116
+ var ge = Nt;
117
+ function xt(e, t) {
118
+ let n = null, i = t;
119
+ for (; i !== n;) n = i, i = ye(e, i), i = De(e, i), i = $(e, i);
120
+ return i = ge(e, i), i = X(e, i), i !== !1 && Ie(e, i);
121
+ }
122
+ var Se = xt;
123
+ function _t(e) {
124
+ return Array.isArray(e) && e.length > 0;
125
+ }
126
+ var se = _t;
127
+ var oe = class extends Error {
128
+ name = "UnexpectedNodeError";
129
+ constructor(t, n, i = "type") {
130
+ super(`Unexpected ${n} node ${i}: ${JSON.stringify(t[i])}.`), this.node = t;
131
+ }
132
+ }, ke = oe;
133
+ var P = null;
134
+ function w(e) {
135
+ if (P !== null && typeof P.property) {
136
+ let t = P;
137
+ return P = w.prototype = null, t;
138
+ }
139
+ return P = w.prototype = e ?? Object.create(null), new w();
140
+ }
141
+ var yt = 10;
142
+ for (let e = 0; e <= yt; e++) w();
143
+ function ae(e) {
144
+ return w(e);
145
+ }
146
+ function At(e, t = "type") {
147
+ ae(e);
148
+ function n(i) {
149
+ let r = i[t], s = e[r];
150
+ if (!Array.isArray(s)) throw Object.assign(/* @__PURE__ */ new Error(`Missing visitor keys for '${r}'.`), { node: i });
151
+ return s;
152
+ }
153
+ return n;
154
+ }
155
+ var Ce = At, H = class {
156
+ constructor(t, n, i) {
157
+ this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source = i;
158
+ }
159
+ get [Symbol.toStringTag]() {
160
+ return "Location";
161
+ }
162
+ toJSON() {
163
+ return {
164
+ start: this.start,
165
+ end: this.end
166
+ };
167
+ }
168
+ }, F = class {
169
+ constructor(t, n, i, r, s, a) {
170
+ this.kind = t, this.start = n, this.end = i, this.line = r, this.column = s, this.value = a, this.prev = null, this.next = null;
171
+ }
172
+ get [Symbol.toStringTag]() {
173
+ return "Token";
174
+ }
175
+ toJSON() {
176
+ return {
177
+ kind: this.kind,
178
+ value: this.value,
179
+ line: this.line,
180
+ column: this.column
181
+ };
182
+ }
183
+ }, ce = {
184
+ Name: [],
185
+ Document: ["definitions"],
186
+ OperationDefinition: [
187
+ "description",
188
+ "name",
189
+ "variableDefinitions",
190
+ "directives",
191
+ "selectionSet"
192
+ ],
193
+ VariableDefinition: [
194
+ "description",
195
+ "variable",
196
+ "type",
197
+ "defaultValue",
198
+ "directives"
199
+ ],
200
+ Variable: ["name"],
201
+ SelectionSet: ["selections"],
202
+ Field: [
203
+ "alias",
204
+ "name",
205
+ "arguments",
206
+ "directives",
207
+ "selectionSet"
208
+ ],
209
+ Argument: ["name", "value"],
210
+ FragmentSpread: ["name", "directives"],
211
+ InlineFragment: [
212
+ "typeCondition",
213
+ "directives",
214
+ "selectionSet"
215
+ ],
216
+ FragmentDefinition: [
217
+ "description",
218
+ "name",
219
+ "variableDefinitions",
220
+ "typeCondition",
221
+ "directives",
222
+ "selectionSet"
223
+ ],
224
+ IntValue: [],
225
+ FloatValue: [],
226
+ StringValue: [],
227
+ BooleanValue: [],
228
+ NullValue: [],
229
+ EnumValue: [],
230
+ ListValue: ["values"],
231
+ ObjectValue: ["fields"],
232
+ ObjectField: ["name", "value"],
233
+ Directive: ["name", "arguments"],
234
+ NamedType: ["name"],
235
+ ListType: ["type"],
236
+ NonNullType: ["type"],
237
+ SchemaDefinition: [
238
+ "description",
239
+ "directives",
240
+ "operationTypes"
241
+ ],
242
+ OperationTypeDefinition: ["type"],
243
+ ScalarTypeDefinition: [
244
+ "description",
245
+ "name",
246
+ "directives"
247
+ ],
248
+ ObjectTypeDefinition: [
249
+ "description",
250
+ "name",
251
+ "interfaces",
252
+ "directives",
253
+ "fields"
254
+ ],
255
+ FieldDefinition: [
256
+ "description",
257
+ "name",
258
+ "arguments",
259
+ "type",
260
+ "directives"
261
+ ],
262
+ InputValueDefinition: [
263
+ "description",
264
+ "name",
265
+ "type",
266
+ "defaultValue",
267
+ "directives"
268
+ ],
269
+ InterfaceTypeDefinition: [
270
+ "description",
271
+ "name",
272
+ "interfaces",
273
+ "directives",
274
+ "fields"
275
+ ],
276
+ UnionTypeDefinition: [
277
+ "description",
278
+ "name",
279
+ "directives",
280
+ "types"
281
+ ],
282
+ EnumTypeDefinition: [
283
+ "description",
284
+ "name",
285
+ "directives",
286
+ "values"
287
+ ],
288
+ EnumValueDefinition: [
289
+ "description",
290
+ "name",
291
+ "directives"
292
+ ],
293
+ InputObjectTypeDefinition: [
294
+ "description",
295
+ "name",
296
+ "directives",
297
+ "fields"
298
+ ],
299
+ DirectiveDefinition: [
300
+ "description",
301
+ "name",
302
+ "arguments",
303
+ "locations"
304
+ ],
305
+ SchemaExtension: ["directives", "operationTypes"],
306
+ ScalarTypeExtension: ["name", "directives"],
307
+ ObjectTypeExtension: [
308
+ "name",
309
+ "interfaces",
310
+ "directives",
311
+ "fields"
312
+ ],
313
+ InterfaceTypeExtension: [
314
+ "name",
315
+ "interfaces",
316
+ "directives",
317
+ "fields"
318
+ ],
319
+ UnionTypeExtension: [
320
+ "name",
321
+ "directives",
322
+ "types"
323
+ ],
324
+ EnumTypeExtension: [
325
+ "name",
326
+ "directives",
327
+ "values"
328
+ ],
329
+ InputObjectTypeExtension: [
330
+ "name",
331
+ "directives",
332
+ "fields"
333
+ ],
334
+ TypeCoordinate: ["name"],
335
+ MemberCoordinate: ["name", "memberName"],
336
+ ArgumentCoordinate: [
337
+ "name",
338
+ "fieldName",
339
+ "argumentName"
340
+ ],
341
+ DirectiveCoordinate: ["name"],
342
+ DirectiveArgumentCoordinate: ["name", "argumentName"]
343
+ };
344
+ new Set(Object.keys(ce));
345
+ var C;
346
+ (function(e) {
347
+ e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
348
+ })(C || (C = {}));
349
+ var Re = { ...ce };
350
+ for (let e of [
351
+ "ArgumentCoordinate",
352
+ "DirectiveArgumentCoordinate",
353
+ "DirectiveCoordinate",
354
+ "MemberCoordinate",
355
+ "TypeCoordinate"
356
+ ]) delete Re[e];
357
+ var be = Ce(Re, "kind");
358
+ var J = (e) => e.loc.start, q = (e) => e.loc.end;
359
+ var Le = "format", Pe = /^\s*#[^\S\n]*@(?:noformat|noprettier)\s*(?:\n|$)/u, we = /^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/u;
360
+ var Fe = (e) => we.test(e), Me = (e) => Pe.test(e), Ve = (e) => `# @${Le}
361
+
362
+ ${e}`;
363
+ function It(e, t, n) {
364
+ let { node: i } = e;
365
+ if (!i.description) return "";
366
+ let r = [n("description")];
367
+ return i.kind === "InputValueDefinition" && !i.description.block ? r.push(k) : r.push(f), r;
368
+ }
369
+ var A = It;
370
+ function Dt(e, t, n) {
371
+ let { node: i } = e;
372
+ switch (i.kind) {
373
+ case "Document": return [...E(f, g(e, t, n, "definitions")), f];
374
+ case "OperationDefinition": {
375
+ let r = t.originalText[J(i)] !== "{", s = !!i.name;
376
+ return [
377
+ A(e, t, n),
378
+ r ? i.operation : "",
379
+ r && s ? [" ", n("name")] : "",
380
+ r && !s && se(i.variableDefinitions) ? " " : "",
381
+ Be(e, n),
382
+ _(e, n, i),
383
+ !r && !s ? "" : " ",
384
+ n("selectionSet")
385
+ ];
386
+ }
387
+ case "FragmentDefinition": return [
388
+ A(e, t, n),
389
+ "fragment ",
390
+ n("name"),
391
+ Be(e, n),
392
+ " on ",
393
+ n("typeCondition"),
394
+ _(e, n, i),
395
+ " ",
396
+ n("selectionSet")
397
+ ];
398
+ case "SelectionSet": return [
399
+ "{",
400
+ x([f, E(f, g(e, t, n, "selections"))]),
401
+ f,
402
+ "}"
403
+ ];
404
+ case "Field": return y([
405
+ i.alias ? [n("alias"), ": "] : "",
406
+ n("name"),
407
+ i.arguments.length > 0 ? y([
408
+ "(",
409
+ x([l, E([I("", ", "), l], g(e, t, n, "arguments"))]),
410
+ l,
411
+ ")"
412
+ ]) : "",
413
+ _(e, n, i),
414
+ i.selectionSet ? " " : "",
415
+ n("selectionSet")
416
+ ]);
417
+ case "Name": return i.value;
418
+ case "StringValue":
419
+ if (i.block) {
420
+ let r = U(0, i.value, "\"\"\"", "\\\"\"\"").split(`
421
+ `);
422
+ return r.length === 1 && (r[0] = r[0].trim()), r.every((s) => s === "") && (r.length = 0), E(f, [
423
+ "\"\"\"",
424
+ ...r,
425
+ "\"\"\""
426
+ ]);
427
+ }
428
+ return [
429
+ "\"",
430
+ U(0, U(0, i.value, /["\\]/gu, "\\$&"), `
431
+ `, "\\n"),
432
+ "\""
433
+ ];
434
+ case "IntValue":
435
+ case "FloatValue":
436
+ case "EnumValue": return i.value;
437
+ case "BooleanValue": return i.value ? "true" : "false";
438
+ case "NullValue": return "null";
439
+ case "Variable": return ["$", n("name")];
440
+ case "ListValue": return y([
441
+ "[",
442
+ x([l, E([I("", ", "), l], e.map(n, "values"))]),
443
+ l,
444
+ "]"
445
+ ]);
446
+ case "ObjectValue": {
447
+ let r = t.bracketSpacing && i.fields.length > 0 ? " " : "";
448
+ return y([
449
+ "{",
450
+ r,
451
+ x([l, E([I("", ", "), l], e.map(n, "fields"))]),
452
+ l,
453
+ I("", r),
454
+ "}"
455
+ ]);
456
+ }
457
+ case "ObjectField":
458
+ case "Argument": return [
459
+ n("name"),
460
+ ": ",
461
+ n("value")
462
+ ];
463
+ case "Directive": return [
464
+ "@",
465
+ n("name"),
466
+ i.arguments.length > 0 ? y([
467
+ "(",
468
+ x([l, E([I("", ", "), l], g(e, t, n, "arguments"))]),
469
+ l,
470
+ ")"
471
+ ]) : ""
472
+ ];
473
+ case "NamedType": return n("name");
474
+ case "VariableDefinition": return [
475
+ A(e, t, n),
476
+ n("variable"),
477
+ ": ",
478
+ n("type"),
479
+ i.defaultValue ? [" = ", n("defaultValue")] : "",
480
+ _(e, n, i)
481
+ ];
482
+ case "ObjectTypeExtension":
483
+ case "ObjectTypeDefinition":
484
+ case "InputObjectTypeExtension":
485
+ case "InputObjectTypeDefinition":
486
+ case "InterfaceTypeExtension":
487
+ case "InterfaceTypeDefinition": {
488
+ let { kind: r } = i, s = [];
489
+ return r.endsWith("TypeDefinition") ? s.push(A(e, 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(e, t, n)), s.push(_(e, n, i)), i.fields.length > 0 && s.push([
490
+ " {",
491
+ x([f, E(f, g(e, t, n, "fields"))]),
492
+ f,
493
+ "}"
494
+ ]), s;
495
+ }
496
+ case "FieldDefinition": return [
497
+ A(e, t, n),
498
+ n("name"),
499
+ i.arguments.length > 0 ? y([
500
+ "(",
501
+ x([l, E([I("", ", "), l], g(e, t, n, "arguments"))]),
502
+ l,
503
+ ")"
504
+ ]) : "",
505
+ ": ",
506
+ n("type"),
507
+ _(e, n, i)
508
+ ];
509
+ case "DirectiveDefinition": return [
510
+ A(e, t, n),
511
+ "directive ",
512
+ "@",
513
+ n("name"),
514
+ i.arguments.length > 0 ? y([
515
+ "(",
516
+ x([l, E([I("", ", "), l], g(e, t, n, "arguments"))]),
517
+ l,
518
+ ")"
519
+ ]) : "",
520
+ i.repeatable ? " repeatable" : "",
521
+ " on ",
522
+ ...E(" | ", e.map(n, "locations"))
523
+ ];
524
+ case "EnumTypeExtension":
525
+ case "EnumTypeDefinition": return [
526
+ A(e, t, n),
527
+ i.kind === "EnumTypeExtension" ? "extend " : "",
528
+ "enum ",
529
+ n("name"),
530
+ _(e, n, i),
531
+ i.values.length > 0 ? [
532
+ " {",
533
+ x([f, E(f, g(e, t, n, "values"))]),
534
+ f,
535
+ "}"
536
+ ] : ""
537
+ ];
538
+ case "EnumValueDefinition": return [
539
+ A(e, t, n),
540
+ n("name"),
541
+ _(e, n, i)
542
+ ];
543
+ case "InputValueDefinition": return [
544
+ A(e, t, n),
545
+ n("name"),
546
+ ": ",
547
+ n("type"),
548
+ i.defaultValue ? [" = ", n("defaultValue")] : "",
549
+ _(e, n, i)
550
+ ];
551
+ case "SchemaExtension": return [
552
+ "extend schema",
553
+ _(e, n, i),
554
+ ...i.operationTypes.length > 0 ? [
555
+ " {",
556
+ x([f, E(f, g(e, t, n, "operationTypes"))]),
557
+ f,
558
+ "}"
559
+ ] : []
560
+ ];
561
+ case "SchemaDefinition": return [
562
+ A(e, t, n),
563
+ "schema",
564
+ _(e, n, i),
565
+ " {",
566
+ i.operationTypes.length > 0 ? x([f, E(f, g(e, t, n, "operationTypes"))]) : "",
567
+ f,
568
+ "}"
569
+ ];
570
+ case "OperationTypeDefinition": return [
571
+ i.operation,
572
+ ": ",
573
+ n("type")
574
+ ];
575
+ case "FragmentSpread": return [
576
+ "...",
577
+ n("name"),
578
+ _(e, n, i)
579
+ ];
580
+ case "InlineFragment": return [
581
+ "...",
582
+ i.typeCondition ? [" on ", n("typeCondition")] : "",
583
+ _(e, n, i),
584
+ " ",
585
+ n("selectionSet")
586
+ ];
587
+ case "UnionTypeExtension":
588
+ case "UnionTypeDefinition": return y([A(e, t, n), y([
589
+ i.kind === "UnionTypeExtension" ? "extend " : "",
590
+ "union ",
591
+ n("name"),
592
+ _(e, n, i),
593
+ i.types.length > 0 ? [
594
+ " =",
595
+ I("", " "),
596
+ x([I([k, "| "]), E([k, "| "], e.map(n, "types"))])
597
+ ] : ""
598
+ ])]);
599
+ case "ScalarTypeExtension":
600
+ case "ScalarTypeDefinition": return [
601
+ A(e, t, n),
602
+ i.kind === "ScalarTypeExtension" ? "extend " : "",
603
+ "scalar ",
604
+ n("name"),
605
+ _(e, n, i)
606
+ ];
607
+ case "NonNullType": return [n("type"), "!"];
608
+ case "ListType": return [
609
+ "[",
610
+ n("type"),
611
+ "]"
612
+ ];
613
+ default: throw new ke(i, "Graphql", "kind");
614
+ }
615
+ }
616
+ function _(e, t, n) {
617
+ if (n.directives.length === 0) return "";
618
+ let i = E(k, e.map(t, "directives"));
619
+ return n.kind === "FragmentDefinition" || n.kind === "OperationDefinition" ? y([k, i]) : [" ", y(x([l, i]))];
620
+ }
621
+ function g(e, t, n, i) {
622
+ return e.map(({ isLast: r, node: s }) => {
623
+ let a = n();
624
+ return !r && Se(t.originalText, q(s)) ? [a, f] : a;
625
+ }, i);
626
+ }
627
+ function gt(e) {
628
+ return e.kind !== "Comment";
629
+ }
630
+ function St({ node: e }) {
631
+ if (e.kind === "Comment") return "#" + e.value.trimEnd();
632
+ throw new Error("Not a comment: " + JSON.stringify(e));
633
+ }
634
+ function kt(e, t, n) {
635
+ let { node: i } = e, r = [], { interfaces: s } = i, a = e.map(n, "interfaces");
636
+ for (let u = 0; u < s.length; u++) {
637
+ let p = s[u];
638
+ r.push(a[u]);
639
+ let T = s[u + 1];
640
+ if (T) {
641
+ let D = t.originalText.slice(p.loc.end, T.loc.start).includes("#");
642
+ r.push(" &", D ? k : " ");
643
+ }
644
+ }
645
+ return r;
646
+ }
647
+ function Be(e, t) {
648
+ let { node: n } = e;
649
+ return se(n.variableDefinitions) ? y([
650
+ "(",
651
+ x([l, E([I("", ", "), l], e.map(t, "variableDefinitions"))]),
652
+ l,
653
+ ")"
654
+ ]) : "";
655
+ }
656
+ function Ue(e, t) {
657
+ e.kind === "StringValue" && e.block && !e.value.includes(`
658
+ `) && (t.value = e.value.trim());
659
+ }
660
+ Ue.ignoredProperties = new Set(["loc", "comments"]);
661
+ function Ct(e) {
662
+ let { node: t } = e;
663
+ return t?.comments?.some((n) => n.value.trim() === "prettier-ignore");
664
+ }
665
+ var Ge = {
666
+ print: Dt,
667
+ massageAstNode: Ue,
668
+ hasPrettierIgnore: Ct,
669
+ insertPragma: Ve,
670
+ printComment: St,
671
+ canAttachComment: gt,
672
+ getVisitorKeys: be
673
+ };
674
+ var Ye = [{
675
+ name: "GraphQL",
676
+ type: "data",
677
+ aceMode: "graphqlschema",
678
+ extensions: [
679
+ ".graphql",
680
+ ".gql",
681
+ ".graphqls"
682
+ ],
683
+ tmScope: "source.graphql",
684
+ parsers: ["graphql"],
685
+ vscodeLanguageIds: ["graphql"],
686
+ linguistLanguageId: 139
687
+ }];
688
+ var $e = { bracketSpacing: {
689
+ bracketSpacing: {
690
+ category: "Common",
691
+ type: "boolean",
692
+ default: !0,
693
+ description: "Print spaces between brackets.",
694
+ oppositeDescription: "Do not print spaces between brackets."
695
+ },
696
+ objectWrap: {
697
+ category: "Common",
698
+ type: "choice",
699
+ default: "preserve",
700
+ description: "How to wrap object literals.",
701
+ choices: [{
702
+ value: "preserve",
703
+ description: "Keep as multi-line, if there is a newline between the opening brace and first property."
704
+ }, {
705
+ value: "collapse",
706
+ description: "Fit to a single line when possible."
707
+ }]
708
+ },
709
+ singleQuote: {
710
+ category: "Common",
711
+ type: "boolean",
712
+ default: !1,
713
+ description: "Use single quotes instead of double quotes."
714
+ },
715
+ proseWrap: {
716
+ category: "Common",
717
+ type: "choice",
718
+ default: "preserve",
719
+ description: "How to wrap prose.",
720
+ choices: [
721
+ {
722
+ value: "always",
723
+ description: "Wrap prose if it exceeds the print width."
724
+ },
725
+ {
726
+ value: "never",
727
+ description: "Do not wrap prose."
728
+ },
729
+ {
730
+ value: "preserve",
731
+ description: "Wrap prose as-is."
732
+ }
733
+ ]
734
+ },
735
+ bracketSameLine: {
736
+ category: "Common",
737
+ type: "boolean",
738
+ default: !1,
739
+ description: "Put > of opening tags on the last line instead of on a new line."
740
+ },
741
+ singleAttributePerLine: {
742
+ category: "Common",
743
+ type: "boolean",
744
+ default: !1,
745
+ description: "Enforce single attribute per line in HTML, Vue and JSX."
746
+ }
747
+ }.bracketSpacing };
748
+ var he = {};
749
+ de(he, { graphql: () => tn });
750
+ function Xe(e) {
751
+ return typeof e == "object" && e !== null;
752
+ }
753
+ function He(e, t) {
754
+ if (!!!e) throw new Error(t ?? "Unexpected invariant triggered.");
755
+ }
756
+ var bt = /\r\n|[\n\r]/g;
757
+ function M(e, t) {
758
+ let n = 0, i = 1;
759
+ for (let r of e.body.matchAll(bt)) {
760
+ if (typeof r.index == "number" || He(!1), r.index >= t) break;
761
+ n = r.index + r[0].length, i += 1;
762
+ }
763
+ return {
764
+ line: i,
765
+ column: t + 1 - n
766
+ };
767
+ }
768
+ function qe(e) {
769
+ return ue(e.source, M(e.source, e.start));
770
+ }
771
+ function ue(e, t) {
772
+ let n = e.locationOffset.column - 1, i = "".padStart(n) + e.body, r = t.line - 1, s = e.locationOffset.line - 1, a = t.line + s, u = t.line === 1 ? n : 0, p = t.column + u, T = `${e.name}:${a}:${p}
773
+ `, d = i.split(/\r\n|[\n\r]/g), D = d[r];
774
+ if (D.length > 120) {
775
+ let O = Math.floor(p / 80), re = p % 80, N = [];
776
+ for (let v = 0; v < D.length; v += 80) N.push(D.slice(v, v + 80));
777
+ return T + Je([
778
+ [`${a} |`, N[0]],
779
+ ...N.slice(1, O + 1).map((v) => ["|", v]),
780
+ ["|", "^".padStart(re)],
781
+ ["|", N[O + 1]]
782
+ ]);
783
+ }
784
+ return T + Je([
785
+ [`${a - 1} |`, d[r - 1]],
786
+ [`${a} |`, D],
787
+ ["|", "^".padStart(p)],
788
+ [`${a + 1} |`, d[r + 1]]
789
+ ]);
790
+ }
791
+ function Je(e) {
792
+ let t = e.filter(([i, r]) => r !== void 0), n = Math.max(...t.map(([i]) => i.length));
793
+ return t.map(([i, r]) => i.padStart(n) + (r ? " " + r : "")).join(`
794
+ `);
795
+ }
796
+ function Lt(e) {
797
+ let t = e[0];
798
+ return t == null || "kind" in t || "length" in t ? {
799
+ nodes: t,
800
+ source: e[1],
801
+ positions: e[2],
802
+ path: e[3],
803
+ originalError: e[4],
804
+ extensions: e[5]
805
+ } : t;
806
+ }
807
+ var Q = class e extends Error {
808
+ constructor(t, ...n) {
809
+ var i, r, s;
810
+ let { nodes: a, source: u, positions: p, path: T, originalError: d, extensions: D } = Lt(n);
811
+ 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);
812
+ let O = Qe((i = this.nodes) === null || i === void 0 ? void 0 : i.map((N) => N.loc).filter((N) => N != null));
813
+ 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));
814
+ let re = Xe(d?.extensions) ? d?.extensions : void 0;
815
+ this.extensions = (s = D ?? re) !== null && s !== void 0 ? s : Object.create(null), Object.defineProperties(this, {
816
+ message: {
817
+ writable: !0,
818
+ enumerable: !0
819
+ },
820
+ name: { enumerable: !1 },
821
+ nodes: { enumerable: !1 },
822
+ source: { enumerable: !1 },
823
+ positions: { enumerable: !1 },
824
+ originalError: { enumerable: !1 }
825
+ }), d != null && d.stack ? Object.defineProperty(this, "stack", {
826
+ value: d.stack,
827
+ writable: !0,
828
+ configurable: !0
829
+ }) : Error.captureStackTrace ? Error.captureStackTrace(this, e) : Object.defineProperty(this, "stack", {
830
+ value: Error().stack,
831
+ writable: !0,
832
+ configurable: !0
833
+ });
834
+ }
835
+ get [Symbol.toStringTag]() {
836
+ return "GraphQLError";
837
+ }
838
+ toString() {
839
+ let t = this.message;
840
+ if (this.nodes) for (let n of this.nodes) n.loc && (t += `
841
+
842
+ ` + qe(n.loc));
843
+ else if (this.source && this.locations) for (let n of this.locations) t += `
844
+
845
+ ` + ue(this.source, n);
846
+ return t;
847
+ }
848
+ toJSON() {
849
+ let t = { message: this.message };
850
+ 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;
851
+ }
852
+ };
853
+ function Qe(e) {
854
+ return e === void 0 || e.length === 0 ? void 0 : e;
855
+ }
856
+ function h(e, t, n) {
857
+ return new Q(`Syntax Error: ${n}`, {
858
+ source: e,
859
+ positions: [t]
860
+ });
861
+ }
862
+ var W;
863
+ (function(e) {
864
+ e.QUERY = "QUERY", e.MUTATION = "MUTATION", e.SUBSCRIPTION = "SUBSCRIPTION", e.FIELD = "FIELD", e.FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", e.FRAGMENT_SPREAD = "FRAGMENT_SPREAD", e.INLINE_FRAGMENT = "INLINE_FRAGMENT", e.VARIABLE_DEFINITION = "VARIABLE_DEFINITION", e.SCHEMA = "SCHEMA", e.SCALAR = "SCALAR", e.OBJECT = "OBJECT", e.FIELD_DEFINITION = "FIELD_DEFINITION", e.ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", e.INTERFACE = "INTERFACE", e.UNION = "UNION", e.ENUM = "ENUM", e.ENUM_VALUE = "ENUM_VALUE", e.INPUT_OBJECT = "INPUT_OBJECT", e.INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION";
865
+ })(W || (W = {}));
866
+ var c;
867
+ (function(e) {
868
+ e.NAME = "Name", e.DOCUMENT = "Document", e.OPERATION_DEFINITION = "OperationDefinition", e.VARIABLE_DEFINITION = "VariableDefinition", e.SELECTION_SET = "SelectionSet", e.FIELD = "Field", e.ARGUMENT = "Argument", e.FRAGMENT_SPREAD = "FragmentSpread", e.INLINE_FRAGMENT = "InlineFragment", e.FRAGMENT_DEFINITION = "FragmentDefinition", e.VARIABLE = "Variable", e.INT = "IntValue", e.FLOAT = "FloatValue", e.STRING = "StringValue", e.BOOLEAN = "BooleanValue", e.NULL = "NullValue", e.ENUM = "EnumValue", e.LIST = "ListValue", e.OBJECT = "ObjectValue", e.OBJECT_FIELD = "ObjectField", e.DIRECTIVE = "Directive", e.NAMED_TYPE = "NamedType", e.LIST_TYPE = "ListType", e.NON_NULL_TYPE = "NonNullType", e.SCHEMA_DEFINITION = "SchemaDefinition", e.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", e.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", e.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", e.FIELD_DEFINITION = "FieldDefinition", e.INPUT_VALUE_DEFINITION = "InputValueDefinition", e.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", e.UNION_TYPE_DEFINITION = "UnionTypeDefinition", e.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", e.ENUM_VALUE_DEFINITION = "EnumValueDefinition", e.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", e.DIRECTIVE_DEFINITION = "DirectiveDefinition", e.SCHEMA_EXTENSION = "SchemaExtension", e.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", e.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", e.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", e.UNION_TYPE_EXTENSION = "UnionTypeExtension", e.ENUM_TYPE_EXTENSION = "EnumTypeExtension", e.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension", e.TYPE_COORDINATE = "TypeCoordinate", e.MEMBER_COORDINATE = "MemberCoordinate", e.ARGUMENT_COORDINATE = "ArgumentCoordinate", e.DIRECTIVE_COORDINATE = "DirectiveCoordinate", e.DIRECTIVE_ARGUMENT_COORDINATE = "DirectiveArgumentCoordinate";
869
+ })(c || (c = {}));
870
+ function We(e) {
871
+ return e === 9 || e === 32;
872
+ }
873
+ function b(e) {
874
+ return e >= 48 && e <= 57;
875
+ }
876
+ function ze(e) {
877
+ return e >= 97 && e <= 122 || e >= 65 && e <= 90;
878
+ }
879
+ function pe(e) {
880
+ return ze(e) || e === 95;
881
+ }
882
+ function Ke(e) {
883
+ return ze(e) || b(e) || e === 95;
884
+ }
885
+ function Ze(e) {
886
+ var t;
887
+ let n = Number.MAX_SAFE_INTEGER, i = null, r = -1;
888
+ for (let a = 0; a < e.length; ++a) {
889
+ var s;
890
+ let u = e[a], p = Pt(u);
891
+ p !== u.length && (i = (s = i) !== null && s !== void 0 ? s : a, r = a, a !== 0 && p < n && (n = p));
892
+ }
893
+ return e.map((a, u) => u === 0 ? a : a.slice(n)).slice((t = i) !== null && t !== void 0 ? t : 0, r + 1);
894
+ }
895
+ function Pt(e) {
896
+ let t = 0;
897
+ for (; t < e.length && We(e.charCodeAt(t));) ++t;
898
+ return t;
899
+ }
900
+ var o;
901
+ (function(e) {
902
+ e.SOF = "<SOF>", e.EOF = "<EOF>", e.BANG = "!", e.DOLLAR = "$", e.AMP = "&", e.PAREN_L = "(", e.PAREN_R = ")", e.DOT = ".", e.SPREAD = "...", e.COLON = ":", e.EQUALS = "=", e.AT = "@", e.BRACKET_L = "[", e.BRACKET_R = "]", e.BRACE_L = "{", e.PIPE = "|", e.BRACE_R = "}", e.NAME = "Name", e.INT = "Int", e.FLOAT = "Float", e.STRING = "String", e.BLOCK_STRING = "BlockString", e.COMMENT = "Comment";
903
+ })(o || (o = {}));
904
+ var z = class {
905
+ constructor(t) {
906
+ let n = new F(o.SOF, 0, 0, 0, 0);
907
+ this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
908
+ }
909
+ get [Symbol.toStringTag]() {
910
+ return "Lexer";
911
+ }
912
+ advance() {
913
+ return this.lastToken = this.token, this.token = this.lookahead();
914
+ }
915
+ lookahead() {
916
+ let t = this.token;
917
+ if (t.kind !== o.EOF) do
918
+ if (t.next) t = t.next;
919
+ else {
920
+ let n = wt(this, t.end);
921
+ t.next = n, n.prev = t, t = n;
922
+ }
923
+ while (t.kind === o.COMMENT);
924
+ return t;
925
+ }
926
+ };
927
+ function tt(e) {
928
+ return e === o.BANG || e === o.DOLLAR || e === o.AMP || e === o.PAREN_L || e === o.PAREN_R || e === o.DOT || e === o.SPREAD || e === o.COLON || e === o.EQUALS || e === o.AT || e === o.BRACKET_L || e === o.BRACKET_R || e === o.BRACE_L || e === o.PIPE || e === o.BRACE_R;
929
+ }
930
+ function L(e) {
931
+ return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
932
+ }
933
+ function K(e, t) {
934
+ return nt(e.charCodeAt(t)) && rt(e.charCodeAt(t + 1));
935
+ }
936
+ function nt(e) {
937
+ return e >= 55296 && e <= 56319;
938
+ }
939
+ function rt(e) {
940
+ return e >= 56320 && e <= 57343;
941
+ }
942
+ function R(e, t) {
943
+ let n = e.source.body.codePointAt(t);
944
+ if (n === void 0) return o.EOF;
945
+ if (n >= 32 && n <= 126) {
946
+ let i = String.fromCodePoint(n);
947
+ return i === "\"" ? `'"'` : `"${i}"`;
948
+ }
949
+ return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
950
+ }
951
+ function m(e, t, n, i, r) {
952
+ let s = e.line;
953
+ return new F(t, n, i, s, 1 + n - e.lineStart, r);
954
+ }
955
+ function wt(e, t) {
956
+ let n = e.source.body, i = n.length, r = t;
957
+ for (; r < i;) {
958
+ let s = n.charCodeAt(r);
959
+ switch (s) {
960
+ case 65279:
961
+ case 9:
962
+ case 32:
963
+ case 44:
964
+ ++r;
965
+ continue;
966
+ case 10:
967
+ ++r, ++e.line, e.lineStart = r;
968
+ continue;
969
+ case 13:
970
+ n.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++e.line, e.lineStart = r;
971
+ continue;
972
+ case 35: return Ft(e, r);
973
+ case 33: return m(e, o.BANG, r, r + 1);
974
+ case 36: return m(e, o.DOLLAR, r, r + 1);
975
+ case 38: return m(e, o.AMP, r, r + 1);
976
+ case 40: return m(e, o.PAREN_L, r, r + 1);
977
+ case 41: return m(e, o.PAREN_R, r, r + 1);
978
+ case 46:
979
+ if (n.charCodeAt(r + 1) === 46 && n.charCodeAt(r + 2) === 46) return m(e, o.SPREAD, r, r + 3);
980
+ break;
981
+ case 58: return m(e, o.COLON, r, r + 1);
982
+ case 61: return m(e, o.EQUALS, r, r + 1);
983
+ case 64: return m(e, o.AT, r, r + 1);
984
+ case 91: return m(e, o.BRACKET_L, r, r + 1);
985
+ case 93: return m(e, o.BRACKET_R, r, r + 1);
986
+ case 123: return m(e, o.BRACE_L, r, r + 1);
987
+ case 124: return m(e, o.PIPE, r, r + 1);
988
+ case 125: return m(e, o.BRACE_R, r, r + 1);
989
+ case 34: return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? Yt(e, r) : Vt(e, r);
990
+ }
991
+ if (b(s) || s === 45) return Mt(e, r, s);
992
+ if (pe(s)) return jt(e, r);
993
+ throw h(e.source, r, s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : L(s) || K(n, r) ? `Unexpected character: ${R(e, r)}.` : `Invalid character: ${R(e, r)}.`);
994
+ }
995
+ return m(e, o.EOF, i, i);
996
+ }
997
+ function Ft(e, t) {
998
+ let n = e.source.body, i = n.length, r = t + 1;
999
+ for (; r < i;) {
1000
+ let s = n.charCodeAt(r);
1001
+ if (s === 10 || s === 13) break;
1002
+ if (L(s)) ++r;
1003
+ else if (K(n, r)) r += 2;
1004
+ else break;
1005
+ }
1006
+ return m(e, o.COMMENT, t, r, n.slice(t + 1, r));
1007
+ }
1008
+ function Mt(e, t, n) {
1009
+ let i = e.source.body, r = t, s = n, a = !1;
1010
+ if (s === 45 && (s = i.charCodeAt(++r)), s === 48) {
1011
+ if (s = i.charCodeAt(++r), b(s)) throw h(e.source, r, `Invalid number, unexpected digit after 0: ${R(e, r)}.`);
1012
+ } else r = le(e, r, s), s = i.charCodeAt(r);
1013
+ if (s === 46 && (a = !0, s = i.charCodeAt(++r), r = le(e, 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(e, r, s), s = i.charCodeAt(r)), s === 46 || pe(s)) throw h(e.source, r, `Invalid number, expected digit but got: ${R(e, r)}.`);
1014
+ return m(e, a ? o.FLOAT : o.INT, t, r, i.slice(t, r));
1015
+ }
1016
+ function le(e, t, n) {
1017
+ if (!b(n)) throw h(e.source, t, `Invalid number, expected digit but got: ${R(e, t)}.`);
1018
+ let i = e.source.body, r = t + 1;
1019
+ for (; b(i.charCodeAt(r));) ++r;
1020
+ return r;
1021
+ }
1022
+ function Vt(e, t) {
1023
+ let n = e.source.body, i = n.length, r = t + 1, s = r, a = "";
1024
+ for (; r < i;) {
1025
+ let u = n.charCodeAt(r);
1026
+ if (u === 34) return a += n.slice(s, r), m(e, o.STRING, t, r + 1, a);
1027
+ if (u === 92) {
1028
+ a += n.slice(s, r);
1029
+ let p = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ? Bt(e, r) : Ut(e, r) : Gt(e, r);
1030
+ a += p.value, r += p.size, s = r;
1031
+ continue;
1032
+ }
1033
+ if (u === 10 || u === 13) break;
1034
+ if (L(u)) ++r;
1035
+ else if (K(n, r)) r += 2;
1036
+ else throw h(e.source, r, `Invalid character within String: ${R(e, r)}.`);
1037
+ }
1038
+ throw h(e.source, r, "Unterminated string.");
1039
+ }
1040
+ function Bt(e, t) {
1041
+ let n = e.source.body, i = 0, r = 3;
1042
+ for (; r < 12;) {
1043
+ let s = n.charCodeAt(t + r++);
1044
+ if (s === 125) {
1045
+ if (r < 5 || !L(i)) break;
1046
+ return {
1047
+ value: String.fromCodePoint(i),
1048
+ size: r
1049
+ };
1050
+ }
1051
+ if (i = i << 4 | V(s), i < 0) break;
1052
+ }
1053
+ throw h(e.source, t, `Invalid Unicode escape sequence: "${n.slice(t, t + r)}".`);
1054
+ }
1055
+ function Ut(e, t) {
1056
+ let n = e.source.body, i = et(n, t + 2);
1057
+ if (L(i)) return {
1058
+ value: String.fromCodePoint(i),
1059
+ size: 6
1060
+ };
1061
+ if (nt(i) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
1062
+ let r = et(n, t + 8);
1063
+ if (rt(r)) return {
1064
+ value: String.fromCodePoint(i, r),
1065
+ size: 12
1066
+ };
1067
+ }
1068
+ throw h(e.source, t, `Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`);
1069
+ }
1070
+ function et(e, t) {
1071
+ return V(e.charCodeAt(t)) << 12 | V(e.charCodeAt(t + 1)) << 8 | V(e.charCodeAt(t + 2)) << 4 | V(e.charCodeAt(t + 3));
1072
+ }
1073
+ function V(e) {
1074
+ return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
1075
+ }
1076
+ function Gt(e, t) {
1077
+ let n = e.source.body;
1078
+ switch (n.charCodeAt(t + 1)) {
1079
+ case 34: return {
1080
+ value: "\"",
1081
+ size: 2
1082
+ };
1083
+ case 92: return {
1084
+ value: "\\",
1085
+ size: 2
1086
+ };
1087
+ case 47: return {
1088
+ value: "/",
1089
+ size: 2
1090
+ };
1091
+ case 98: return {
1092
+ value: "\b",
1093
+ size: 2
1094
+ };
1095
+ case 102: return {
1096
+ value: "\f",
1097
+ size: 2
1098
+ };
1099
+ case 110: return {
1100
+ value: `
1101
+ `,
1102
+ size: 2
1103
+ };
1104
+ case 114: return {
1105
+ value: "\r",
1106
+ size: 2
1107
+ };
1108
+ case 116: return {
1109
+ value: " ",
1110
+ size: 2
1111
+ };
1112
+ }
1113
+ throw h(e.source, t, `Invalid character escape sequence: "${n.slice(t, t + 2)}".`);
1114
+ }
1115
+ function Yt(e, t) {
1116
+ let n = e.source.body, i = n.length, r = e.lineStart, s = t + 3, a = s, u = "", p = [];
1117
+ for (; s < i;) {
1118
+ let T = n.charCodeAt(s);
1119
+ if (T === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
1120
+ u += n.slice(a, s), p.push(u);
1121
+ let d = m(e, o.BLOCK_STRING, t, s + 3, Ze(p).join(`
1122
+ `));
1123
+ return e.line += p.length - 1, e.lineStart = r, d;
1124
+ }
1125
+ if (T === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
1126
+ u += n.slice(a, s), a = s + 1, s += 4;
1127
+ continue;
1128
+ }
1129
+ if (T === 10 || T === 13) {
1130
+ u += n.slice(a, s), p.push(u), T === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, u = "", a = s, r = s;
1131
+ continue;
1132
+ }
1133
+ if (L(T)) ++s;
1134
+ else if (K(n, s)) s += 2;
1135
+ else throw h(e.source, s, `Invalid character within String: ${R(e, s)}.`);
1136
+ }
1137
+ throw h(e.source, s, "Unterminated string.");
1138
+ }
1139
+ function jt(e, t) {
1140
+ let n = e.source.body, i = n.length, r = t + 1;
1141
+ for (; r < i;) if (Ke(n.charCodeAt(r))) ++r;
1142
+ else break;
1143
+ return m(e, o.NAME, t, r, n.slice(t, r));
1144
+ }
1145
+ function Z(e, t) {
1146
+ if (!!!e) throw new Error(t);
1147
+ }
1148
+ function ee(e) {
1149
+ return te(e, []);
1150
+ }
1151
+ function te(e, t) {
1152
+ switch (typeof e) {
1153
+ case "string": return JSON.stringify(e);
1154
+ case "function": return e.name ? `[function ${e.name}]` : "[function]";
1155
+ case "object": return $t(e, t);
1156
+ default: return String(e);
1157
+ }
1158
+ }
1159
+ function $t(e, t) {
1160
+ if (e === null) return "null";
1161
+ if (t.includes(e)) return "[Circular]";
1162
+ let n = [...t, e];
1163
+ if (Xt(e)) {
1164
+ let i = e.toJSON();
1165
+ if (i !== e) return typeof i == "string" ? i : te(i, n);
1166
+ } else if (Array.isArray(e)) return Jt(e, n);
1167
+ return Ht(e, n);
1168
+ }
1169
+ function Xt(e) {
1170
+ return typeof e.toJSON == "function";
1171
+ }
1172
+ function Ht(e, t) {
1173
+ let n = Object.entries(e);
1174
+ return n.length === 0 ? "{}" : t.length > 2 ? "[" + qt(e) + "]" : "{ " + n.map(([r, s]) => r + ": " + te(s, t)).join(", ") + " }";
1175
+ }
1176
+ function Jt(e, t) {
1177
+ if (e.length === 0) return "[]";
1178
+ if (t.length > 2) return "[Array]";
1179
+ let n = Math.min(10, e.length), i = e.length - n, r = [];
1180
+ for (let s = 0; s < n; ++s) r.push(te(e[s], t));
1181
+ return i === 1 ? r.push("... 1 more item") : i > 1 && r.push(`... ${i} more items`), "[" + r.join(", ") + "]";
1182
+ }
1183
+ function qt(e) {
1184
+ let t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
1185
+ if (t === "Object" && typeof e.constructor == "function") {
1186
+ let n = e.constructor.name;
1187
+ if (typeof n == "string" && n !== "") return n;
1188
+ }
1189
+ return t;
1190
+ }
1191
+ var it = globalThis.process && !0 ? function(t, n) {
1192
+ return t instanceof n;
1193
+ } : function(t, n) {
1194
+ if (t instanceof n) return !0;
1195
+ if (typeof t == "object" && t !== null) {
1196
+ var i;
1197
+ let r = n.prototype[Symbol.toStringTag];
1198
+ if (r === (Symbol.toStringTag in t ? t[Symbol.toStringTag] : (i = t.constructor) === null || i === void 0 ? void 0 : i.name)) {
1199
+ let a = ee(t);
1200
+ throw new Error(`Cannot use ${r} "${a}" from another module or realm.
1201
+
1202
+ Ensure that there is only one instance of "graphql" in the node_modules
1203
+ directory. If different versions of "graphql" are the dependencies of other
1204
+ relied on modules, use "resolutions" to ensure only one version is installed.
1205
+
1206
+ https://yarnpkg.com/en/docs/selective-version-resolutions
1207
+
1208
+ Duplicate "graphql" modules cannot be used at the same time since different
1209
+ versions may have different capabilities and behavior. The data from one
1210
+ version used in the function from another could produce confusing and
1211
+ spurious results.`);
1212
+ }
1213
+ }
1214
+ return !1;
1215
+ };
1216
+ var B = class {
1217
+ constructor(t, n = "GraphQL request", i = {
1218
+ line: 1,
1219
+ column: 1
1220
+ }) {
1221
+ 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.");
1222
+ }
1223
+ get [Symbol.toStringTag]() {
1224
+ return "Source";
1225
+ }
1226
+ };
1227
+ function st(e) {
1228
+ return it(e, B);
1229
+ }
1230
+ function ot(e, t) {
1231
+ let n = new fe(e, t), i = n.parseDocument();
1232
+ return Object.defineProperty(i, "tokenCount", {
1233
+ enumerable: !1,
1234
+ value: n.tokenCount
1235
+ }), i;
1236
+ }
1237
+ var fe = class {
1238
+ constructor(t, n = {}) {
1239
+ let { lexer: i, ...r } = n;
1240
+ if (i) this._lexer = i;
1241
+ else {
1242
+ let s = st(t) ? t : new B(t);
1243
+ this._lexer = new z(s);
1244
+ }
1245
+ this._options = r, this._tokenCounter = 0;
1246
+ }
1247
+ get tokenCount() {
1248
+ return this._tokenCounter;
1249
+ }
1250
+ parseName() {
1251
+ let t = this.expectToken(o.NAME);
1252
+ return this.node(t, {
1253
+ kind: c.NAME,
1254
+ value: t.value
1255
+ });
1256
+ }
1257
+ parseDocument() {
1258
+ return this.node(this._lexer.token, {
1259
+ kind: c.DOCUMENT,
1260
+ definitions: this.many(o.SOF, this.parseDefinition, o.EOF)
1261
+ });
1262
+ }
1263
+ parseDefinition() {
1264
+ if (this.peek(o.BRACE_L)) return this.parseOperationDefinition();
1265
+ let t = this.peekDescription(), n = t ? this._lexer.lookahead() : this._lexer.token;
1266
+ 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.");
1267
+ if (n.kind === o.NAME) {
1268
+ switch (n.value) {
1269
+ case "schema": return this.parseSchemaDefinition();
1270
+ case "scalar": return this.parseScalarTypeDefinition();
1271
+ case "type": return this.parseObjectTypeDefinition();
1272
+ case "interface": return this.parseInterfaceTypeDefinition();
1273
+ case "union": return this.parseUnionTypeDefinition();
1274
+ case "enum": return this.parseEnumTypeDefinition();
1275
+ case "input": return this.parseInputObjectTypeDefinition();
1276
+ case "directive": return this.parseDirectiveDefinition();
1277
+ }
1278
+ switch (n.value) {
1279
+ case "query":
1280
+ case "mutation":
1281
+ case "subscription": return this.parseOperationDefinition();
1282
+ case "fragment": return this.parseFragmentDefinition();
1283
+ }
1284
+ if (t) throw h(this._lexer.source, this._lexer.token.start, "Unexpected description, only GraphQL definitions support descriptions.");
1285
+ switch (n.value) {
1286
+ case "extend": return this.parseTypeSystemExtension();
1287
+ }
1288
+ }
1289
+ throw this.unexpected(n);
1290
+ }
1291
+ parseOperationDefinition() {
1292
+ let t = this._lexer.token;
1293
+ if (this.peek(o.BRACE_L)) return this.node(t, {
1294
+ kind: c.OPERATION_DEFINITION,
1295
+ operation: C.QUERY,
1296
+ description: void 0,
1297
+ name: void 0,
1298
+ variableDefinitions: [],
1299
+ directives: [],
1300
+ selectionSet: this.parseSelectionSet()
1301
+ });
1302
+ let n = this.parseDescription(), i = this.parseOperationType(), r;
1303
+ return this.peek(o.NAME) && (r = this.parseName()), this.node(t, {
1304
+ kind: c.OPERATION_DEFINITION,
1305
+ operation: i,
1306
+ description: n,
1307
+ name: r,
1308
+ variableDefinitions: this.parseVariableDefinitions(),
1309
+ directives: this.parseDirectives(!1),
1310
+ selectionSet: this.parseSelectionSet()
1311
+ });
1312
+ }
1313
+ parseOperationType() {
1314
+ let t = this.expectToken(o.NAME);
1315
+ switch (t.value) {
1316
+ case "query": return C.QUERY;
1317
+ case "mutation": return C.MUTATION;
1318
+ case "subscription": return C.SUBSCRIPTION;
1319
+ }
1320
+ throw this.unexpected(t);
1321
+ }
1322
+ parseVariableDefinitions() {
1323
+ return this.optionalMany(o.PAREN_L, this.parseVariableDefinition, o.PAREN_R);
1324
+ }
1325
+ parseVariableDefinition() {
1326
+ return this.node(this._lexer.token, {
1327
+ kind: c.VARIABLE_DEFINITION,
1328
+ description: this.parseDescription(),
1329
+ variable: this.parseVariable(),
1330
+ type: (this.expectToken(o.COLON), this.parseTypeReference()),
1331
+ defaultValue: this.expectOptionalToken(o.EQUALS) ? this.parseConstValueLiteral() : void 0,
1332
+ directives: this.parseConstDirectives()
1333
+ });
1334
+ }
1335
+ parseVariable() {
1336
+ let t = this._lexer.token;
1337
+ return this.expectToken(o.DOLLAR), this.node(t, {
1338
+ kind: c.VARIABLE,
1339
+ name: this.parseName()
1340
+ });
1341
+ }
1342
+ parseSelectionSet() {
1343
+ return this.node(this._lexer.token, {
1344
+ kind: c.SELECTION_SET,
1345
+ selections: this.many(o.BRACE_L, this.parseSelection, o.BRACE_R)
1346
+ });
1347
+ }
1348
+ parseSelection() {
1349
+ return this.peek(o.SPREAD) ? this.parseFragment() : this.parseField();
1350
+ }
1351
+ parseField() {
1352
+ let t = this._lexer.token, n = this.parseName(), i, r;
1353
+ return this.expectOptionalToken(o.COLON) ? (i = n, r = this.parseName()) : r = n, this.node(t, {
1354
+ kind: c.FIELD,
1355
+ alias: i,
1356
+ name: r,
1357
+ arguments: this.parseArguments(!1),
1358
+ directives: this.parseDirectives(!1),
1359
+ selectionSet: this.peek(o.BRACE_L) ? this.parseSelectionSet() : void 0
1360
+ });
1361
+ }
1362
+ parseArguments(t) {
1363
+ let n = t ? this.parseConstArgument : this.parseArgument;
1364
+ return this.optionalMany(o.PAREN_L, n, o.PAREN_R);
1365
+ }
1366
+ parseArgument(t = !1) {
1367
+ let n = this._lexer.token, i = this.parseName();
1368
+ return this.expectToken(o.COLON), this.node(n, {
1369
+ kind: c.ARGUMENT,
1370
+ name: i,
1371
+ value: this.parseValueLiteral(t)
1372
+ });
1373
+ }
1374
+ parseConstArgument() {
1375
+ return this.parseArgument(!0);
1376
+ }
1377
+ parseFragment() {
1378
+ let t = this._lexer.token;
1379
+ this.expectToken(o.SPREAD);
1380
+ let n = this.expectOptionalKeyword("on");
1381
+ return !n && this.peek(o.NAME) ? this.node(t, {
1382
+ kind: c.FRAGMENT_SPREAD,
1383
+ name: this.parseFragmentName(),
1384
+ directives: this.parseDirectives(!1)
1385
+ }) : this.node(t, {
1386
+ kind: c.INLINE_FRAGMENT,
1387
+ typeCondition: n ? this.parseNamedType() : void 0,
1388
+ directives: this.parseDirectives(!1),
1389
+ selectionSet: this.parseSelectionSet()
1390
+ });
1391
+ }
1392
+ parseFragmentDefinition() {
1393
+ let t = this._lexer.token, n = this.parseDescription();
1394
+ return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(t, {
1395
+ kind: c.FRAGMENT_DEFINITION,
1396
+ description: n,
1397
+ name: this.parseFragmentName(),
1398
+ variableDefinitions: this.parseVariableDefinitions(),
1399
+ typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
1400
+ directives: this.parseDirectives(!1),
1401
+ selectionSet: this.parseSelectionSet()
1402
+ }) : this.node(t, {
1403
+ kind: c.FRAGMENT_DEFINITION,
1404
+ description: n,
1405
+ name: this.parseFragmentName(),
1406
+ typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
1407
+ directives: this.parseDirectives(!1),
1408
+ selectionSet: this.parseSelectionSet()
1409
+ });
1410
+ }
1411
+ parseFragmentName() {
1412
+ if (this._lexer.token.value === "on") throw this.unexpected();
1413
+ return this.parseName();
1414
+ }
1415
+ parseValueLiteral(t) {
1416
+ let n = this._lexer.token;
1417
+ switch (n.kind) {
1418
+ case o.BRACKET_L: return this.parseList(t);
1419
+ case o.BRACE_L: return this.parseObject(t);
1420
+ case o.INT: return this.advanceLexer(), this.node(n, {
1421
+ kind: c.INT,
1422
+ value: n.value
1423
+ });
1424
+ case o.FLOAT: return this.advanceLexer(), this.node(n, {
1425
+ kind: c.FLOAT,
1426
+ value: n.value
1427
+ });
1428
+ case o.STRING:
1429
+ case o.BLOCK_STRING: return this.parseStringLiteral();
1430
+ case o.NAME: switch (this.advanceLexer(), n.value) {
1431
+ case "true": return this.node(n, {
1432
+ kind: c.BOOLEAN,
1433
+ value: !0
1434
+ });
1435
+ case "false": return this.node(n, {
1436
+ kind: c.BOOLEAN,
1437
+ value: !1
1438
+ });
1439
+ case "null": return this.node(n, { kind: c.NULL });
1440
+ default: return this.node(n, {
1441
+ kind: c.ENUM,
1442
+ value: n.value
1443
+ });
1444
+ }
1445
+ case o.DOLLAR:
1446
+ if (t) if (this.expectToken(o.DOLLAR), this._lexer.token.kind === o.NAME) {
1447
+ let i = this._lexer.token.value;
1448
+ throw h(this._lexer.source, n.start, `Unexpected variable "$${i}" in constant value.`);
1449
+ } else throw this.unexpected(n);
1450
+ return this.parseVariable();
1451
+ default: throw this.unexpected();
1452
+ }
1453
+ }
1454
+ parseConstValueLiteral() {
1455
+ return this.parseValueLiteral(!0);
1456
+ }
1457
+ parseStringLiteral() {
1458
+ let t = this._lexer.token;
1459
+ return this.advanceLexer(), this.node(t, {
1460
+ kind: c.STRING,
1461
+ value: t.value,
1462
+ block: t.kind === o.BLOCK_STRING
1463
+ });
1464
+ }
1465
+ parseList(t) {
1466
+ let n = () => this.parseValueLiteral(t);
1467
+ return this.node(this._lexer.token, {
1468
+ kind: c.LIST,
1469
+ values: this.any(o.BRACKET_L, n, o.BRACKET_R)
1470
+ });
1471
+ }
1472
+ parseObject(t) {
1473
+ let n = () => this.parseObjectField(t);
1474
+ return this.node(this._lexer.token, {
1475
+ kind: c.OBJECT,
1476
+ fields: this.any(o.BRACE_L, n, o.BRACE_R)
1477
+ });
1478
+ }
1479
+ parseObjectField(t) {
1480
+ let n = this._lexer.token, i = this.parseName();
1481
+ return this.expectToken(o.COLON), this.node(n, {
1482
+ kind: c.OBJECT_FIELD,
1483
+ name: i,
1484
+ value: this.parseValueLiteral(t)
1485
+ });
1486
+ }
1487
+ parseDirectives(t) {
1488
+ let n = [];
1489
+ for (; this.peek(o.AT);) n.push(this.parseDirective(t));
1490
+ return n;
1491
+ }
1492
+ parseConstDirectives() {
1493
+ return this.parseDirectives(!0);
1494
+ }
1495
+ parseDirective(t) {
1496
+ let n = this._lexer.token;
1497
+ return this.expectToken(o.AT), this.node(n, {
1498
+ kind: c.DIRECTIVE,
1499
+ name: this.parseName(),
1500
+ arguments: this.parseArguments(t)
1501
+ });
1502
+ }
1503
+ parseTypeReference() {
1504
+ let t = this._lexer.token, n;
1505
+ if (this.expectOptionalToken(o.BRACKET_L)) {
1506
+ let i = this.parseTypeReference();
1507
+ this.expectToken(o.BRACKET_R), n = this.node(t, {
1508
+ kind: c.LIST_TYPE,
1509
+ type: i
1510
+ });
1511
+ } else n = this.parseNamedType();
1512
+ return this.expectOptionalToken(o.BANG) ? this.node(t, {
1513
+ kind: c.NON_NULL_TYPE,
1514
+ type: n
1515
+ }) : n;
1516
+ }
1517
+ parseNamedType() {
1518
+ return this.node(this._lexer.token, {
1519
+ kind: c.NAMED_TYPE,
1520
+ name: this.parseName()
1521
+ });
1522
+ }
1523
+ peekDescription() {
1524
+ return this.peek(o.STRING) || this.peek(o.BLOCK_STRING);
1525
+ }
1526
+ parseDescription() {
1527
+ if (this.peekDescription()) return this.parseStringLiteral();
1528
+ }
1529
+ parseSchemaDefinition() {
1530
+ let t = this._lexer.token, n = this.parseDescription();
1531
+ this.expectKeyword("schema");
1532
+ let i = this.parseConstDirectives(), r = this.many(o.BRACE_L, this.parseOperationTypeDefinition, o.BRACE_R);
1533
+ return this.node(t, {
1534
+ kind: c.SCHEMA_DEFINITION,
1535
+ description: n,
1536
+ directives: i,
1537
+ operationTypes: r
1538
+ });
1539
+ }
1540
+ parseOperationTypeDefinition() {
1541
+ let t = this._lexer.token, n = this.parseOperationType();
1542
+ this.expectToken(o.COLON);
1543
+ let i = this.parseNamedType();
1544
+ return this.node(t, {
1545
+ kind: c.OPERATION_TYPE_DEFINITION,
1546
+ operation: n,
1547
+ type: i
1548
+ });
1549
+ }
1550
+ parseScalarTypeDefinition() {
1551
+ let t = this._lexer.token, n = this.parseDescription();
1552
+ this.expectKeyword("scalar");
1553
+ let i = this.parseName(), r = this.parseConstDirectives();
1554
+ return this.node(t, {
1555
+ kind: c.SCALAR_TYPE_DEFINITION,
1556
+ description: n,
1557
+ name: i,
1558
+ directives: r
1559
+ });
1560
+ }
1561
+ parseObjectTypeDefinition() {
1562
+ let t = this._lexer.token, n = this.parseDescription();
1563
+ this.expectKeyword("type");
1564
+ let i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
1565
+ return this.node(t, {
1566
+ kind: c.OBJECT_TYPE_DEFINITION,
1567
+ description: n,
1568
+ name: i,
1569
+ interfaces: r,
1570
+ directives: s,
1571
+ fields: a
1572
+ });
1573
+ }
1574
+ parseImplementsInterfaces() {
1575
+ return this.expectOptionalKeyword("implements") ? this.delimitedMany(o.AMP, this.parseNamedType) : [];
1576
+ }
1577
+ parseFieldsDefinition() {
1578
+ return this.optionalMany(o.BRACE_L, this.parseFieldDefinition, o.BRACE_R);
1579
+ }
1580
+ parseFieldDefinition() {
1581
+ let t = this._lexer.token, n = this.parseDescription(), i = this.parseName(), r = this.parseArgumentDefs();
1582
+ this.expectToken(o.COLON);
1583
+ let s = this.parseTypeReference(), a = this.parseConstDirectives();
1584
+ return this.node(t, {
1585
+ kind: c.FIELD_DEFINITION,
1586
+ description: n,
1587
+ name: i,
1588
+ arguments: r,
1589
+ type: s,
1590
+ directives: a
1591
+ });
1592
+ }
1593
+ parseArgumentDefs() {
1594
+ return this.optionalMany(o.PAREN_L, this.parseInputValueDef, o.PAREN_R);
1595
+ }
1596
+ parseInputValueDef() {
1597
+ let t = this._lexer.token, n = this.parseDescription(), i = this.parseName();
1598
+ this.expectToken(o.COLON);
1599
+ let r = this.parseTypeReference(), s;
1600
+ this.expectOptionalToken(o.EQUALS) && (s = this.parseConstValueLiteral());
1601
+ let a = this.parseConstDirectives();
1602
+ return this.node(t, {
1603
+ kind: c.INPUT_VALUE_DEFINITION,
1604
+ description: n,
1605
+ name: i,
1606
+ type: r,
1607
+ defaultValue: s,
1608
+ directives: a
1609
+ });
1610
+ }
1611
+ parseInterfaceTypeDefinition() {
1612
+ let t = this._lexer.token, n = this.parseDescription();
1613
+ this.expectKeyword("interface");
1614
+ let i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), a = this.parseFieldsDefinition();
1615
+ return this.node(t, {
1616
+ kind: c.INTERFACE_TYPE_DEFINITION,
1617
+ description: n,
1618
+ name: i,
1619
+ interfaces: r,
1620
+ directives: s,
1621
+ fields: a
1622
+ });
1623
+ }
1624
+ parseUnionTypeDefinition() {
1625
+ let t = this._lexer.token, n = this.parseDescription();
1626
+ this.expectKeyword("union");
1627
+ let i = this.parseName(), r = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
1628
+ return this.node(t, {
1629
+ kind: c.UNION_TYPE_DEFINITION,
1630
+ description: n,
1631
+ name: i,
1632
+ directives: r,
1633
+ types: s
1634
+ });
1635
+ }
1636
+ parseUnionMemberTypes() {
1637
+ return this.expectOptionalToken(o.EQUALS) ? this.delimitedMany(o.PIPE, this.parseNamedType) : [];
1638
+ }
1639
+ parseEnumTypeDefinition() {
1640
+ let t = this._lexer.token, n = this.parseDescription();
1641
+ this.expectKeyword("enum");
1642
+ let i = this.parseName(), r = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
1643
+ return this.node(t, {
1644
+ kind: c.ENUM_TYPE_DEFINITION,
1645
+ description: n,
1646
+ name: i,
1647
+ directives: r,
1648
+ values: s
1649
+ });
1650
+ }
1651
+ parseEnumValuesDefinition() {
1652
+ return this.optionalMany(o.BRACE_L, this.parseEnumValueDefinition, o.BRACE_R);
1653
+ }
1654
+ parseEnumValueDefinition() {
1655
+ let t = this._lexer.token, n = this.parseDescription(), i = this.parseEnumValueName(), r = this.parseConstDirectives();
1656
+ return this.node(t, {
1657
+ kind: c.ENUM_VALUE_DEFINITION,
1658
+ description: n,
1659
+ name: i,
1660
+ directives: r
1661
+ });
1662
+ }
1663
+ parseEnumValueName() {
1664
+ 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.`);
1665
+ return this.parseName();
1666
+ }
1667
+ parseInputObjectTypeDefinition() {
1668
+ let t = this._lexer.token, n = this.parseDescription();
1669
+ this.expectKeyword("input");
1670
+ let i = this.parseName(), r = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
1671
+ return this.node(t, {
1672
+ kind: c.INPUT_OBJECT_TYPE_DEFINITION,
1673
+ description: n,
1674
+ name: i,
1675
+ directives: r,
1676
+ fields: s
1677
+ });
1678
+ }
1679
+ parseInputFieldsDefinition() {
1680
+ return this.optionalMany(o.BRACE_L, this.parseInputValueDef, o.BRACE_R);
1681
+ }
1682
+ parseTypeSystemExtension() {
1683
+ let t = this._lexer.lookahead();
1684
+ if (t.kind === o.NAME) switch (t.value) {
1685
+ case "schema": return this.parseSchemaExtension();
1686
+ case "scalar": return this.parseScalarTypeExtension();
1687
+ case "type": return this.parseObjectTypeExtension();
1688
+ case "interface": return this.parseInterfaceTypeExtension();
1689
+ case "union": return this.parseUnionTypeExtension();
1690
+ case "enum": return this.parseEnumTypeExtension();
1691
+ case "input": return this.parseInputObjectTypeExtension();
1692
+ }
1693
+ throw this.unexpected(t);
1694
+ }
1695
+ parseSchemaExtension() {
1696
+ let t = this._lexer.token;
1697
+ this.expectKeyword("extend"), this.expectKeyword("schema");
1698
+ let n = this.parseConstDirectives(), i = this.optionalMany(o.BRACE_L, this.parseOperationTypeDefinition, o.BRACE_R);
1699
+ if (n.length === 0 && i.length === 0) throw this.unexpected();
1700
+ return this.node(t, {
1701
+ kind: c.SCHEMA_EXTENSION,
1702
+ directives: n,
1703
+ operationTypes: i
1704
+ });
1705
+ }
1706
+ parseScalarTypeExtension() {
1707
+ let t = this._lexer.token;
1708
+ this.expectKeyword("extend"), this.expectKeyword("scalar");
1709
+ let n = this.parseName(), i = this.parseConstDirectives();
1710
+ if (i.length === 0) throw this.unexpected();
1711
+ return this.node(t, {
1712
+ kind: c.SCALAR_TYPE_EXTENSION,
1713
+ name: n,
1714
+ directives: i
1715
+ });
1716
+ }
1717
+ parseObjectTypeExtension() {
1718
+ let t = this._lexer.token;
1719
+ this.expectKeyword("extend"), this.expectKeyword("type");
1720
+ let n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1721
+ if (i.length === 0 && r.length === 0 && s.length === 0) throw this.unexpected();
1722
+ return this.node(t, {
1723
+ kind: c.OBJECT_TYPE_EXTENSION,
1724
+ name: n,
1725
+ interfaces: i,
1726
+ directives: r,
1727
+ fields: s
1728
+ });
1729
+ }
1730
+ parseInterfaceTypeExtension() {
1731
+ let t = this._lexer.token;
1732
+ this.expectKeyword("extend"), this.expectKeyword("interface");
1733
+ let n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1734
+ if (i.length === 0 && r.length === 0 && s.length === 0) throw this.unexpected();
1735
+ return this.node(t, {
1736
+ kind: c.INTERFACE_TYPE_EXTENSION,
1737
+ name: n,
1738
+ interfaces: i,
1739
+ directives: r,
1740
+ fields: s
1741
+ });
1742
+ }
1743
+ parseUnionTypeExtension() {
1744
+ let t = this._lexer.token;
1745
+ this.expectKeyword("extend"), this.expectKeyword("union");
1746
+ let n = this.parseName(), i = this.parseConstDirectives(), r = this.parseUnionMemberTypes();
1747
+ if (i.length === 0 && r.length === 0) throw this.unexpected();
1748
+ return this.node(t, {
1749
+ kind: c.UNION_TYPE_EXTENSION,
1750
+ name: n,
1751
+ directives: i,
1752
+ types: r
1753
+ });
1754
+ }
1755
+ parseEnumTypeExtension() {
1756
+ let t = this._lexer.token;
1757
+ this.expectKeyword("extend"), this.expectKeyword("enum");
1758
+ let n = this.parseName(), i = this.parseConstDirectives(), r = this.parseEnumValuesDefinition();
1759
+ if (i.length === 0 && r.length === 0) throw this.unexpected();
1760
+ return this.node(t, {
1761
+ kind: c.ENUM_TYPE_EXTENSION,
1762
+ name: n,
1763
+ directives: i,
1764
+ values: r
1765
+ });
1766
+ }
1767
+ parseInputObjectTypeExtension() {
1768
+ let t = this._lexer.token;
1769
+ this.expectKeyword("extend"), this.expectKeyword("input");
1770
+ let n = this.parseName(), i = this.parseConstDirectives(), r = this.parseInputFieldsDefinition();
1771
+ if (i.length === 0 && r.length === 0) throw this.unexpected();
1772
+ return this.node(t, {
1773
+ kind: c.INPUT_OBJECT_TYPE_EXTENSION,
1774
+ name: n,
1775
+ directives: i,
1776
+ fields: r
1777
+ });
1778
+ }
1779
+ parseDirectiveDefinition() {
1780
+ let t = this._lexer.token, n = this.parseDescription();
1781
+ this.expectKeyword("directive"), this.expectToken(o.AT);
1782
+ let i = this.parseName(), r = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
1783
+ this.expectKeyword("on");
1784
+ let a = this.parseDirectiveLocations();
1785
+ return this.node(t, {
1786
+ kind: c.DIRECTIVE_DEFINITION,
1787
+ description: n,
1788
+ name: i,
1789
+ arguments: r,
1790
+ repeatable: s,
1791
+ locations: a
1792
+ });
1793
+ }
1794
+ parseDirectiveLocations() {
1795
+ return this.delimitedMany(o.PIPE, this.parseDirectiveLocation);
1796
+ }
1797
+ parseDirectiveLocation() {
1798
+ let t = this._lexer.token, n = this.parseName();
1799
+ if (Object.prototype.hasOwnProperty.call(W, n.value)) return n;
1800
+ throw this.unexpected(t);
1801
+ }
1802
+ parseSchemaCoordinate() {
1803
+ let t = this._lexer.token, n = this.expectOptionalToken(o.AT), i = this.parseName(), r;
1804
+ !n && this.expectOptionalToken(o.DOT) && (r = this.parseName());
1805
+ let s;
1806
+ 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, {
1807
+ kind: c.DIRECTIVE_ARGUMENT_COORDINATE,
1808
+ name: i,
1809
+ argumentName: s
1810
+ }) : this.node(t, {
1811
+ kind: c.DIRECTIVE_COORDINATE,
1812
+ name: i
1813
+ }) : r ? s ? this.node(t, {
1814
+ kind: c.ARGUMENT_COORDINATE,
1815
+ name: i,
1816
+ fieldName: r,
1817
+ argumentName: s
1818
+ }) : this.node(t, {
1819
+ kind: c.MEMBER_COORDINATE,
1820
+ name: i,
1821
+ memberName: r
1822
+ }) : this.node(t, {
1823
+ kind: c.TYPE_COORDINATE,
1824
+ name: i
1825
+ });
1826
+ }
1827
+ node(t, n) {
1828
+ return this._options.noLocation !== !0 && (n.loc = new H(t, this._lexer.lastToken, this._lexer.source)), n;
1829
+ }
1830
+ peek(t) {
1831
+ return this._lexer.token.kind === t;
1832
+ }
1833
+ expectToken(t) {
1834
+ let n = this._lexer.token;
1835
+ if (n.kind === t) return this.advanceLexer(), n;
1836
+ throw h(this._lexer.source, n.start, `Expected ${at(t)}, found ${ne(n)}.`);
1837
+ }
1838
+ expectOptionalToken(t) {
1839
+ return this._lexer.token.kind === t ? (this.advanceLexer(), !0) : !1;
1840
+ }
1841
+ expectKeyword(t) {
1842
+ let n = this._lexer.token;
1843
+ if (n.kind === o.NAME && n.value === t) this.advanceLexer();
1844
+ else throw h(this._lexer.source, n.start, `Expected "${t}", found ${ne(n)}.`);
1845
+ }
1846
+ expectOptionalKeyword(t) {
1847
+ let n = this._lexer.token;
1848
+ return n.kind === o.NAME && n.value === t ? (this.advanceLexer(), !0) : !1;
1849
+ }
1850
+ unexpected(t) {
1851
+ let n = t ?? this._lexer.token;
1852
+ return h(this._lexer.source, n.start, `Unexpected ${ne(n)}.`);
1853
+ }
1854
+ any(t, n, i) {
1855
+ this.expectToken(t);
1856
+ let r = [];
1857
+ for (; !this.expectOptionalToken(i);) r.push(n.call(this));
1858
+ return r;
1859
+ }
1860
+ optionalMany(t, n, i) {
1861
+ if (this.expectOptionalToken(t)) {
1862
+ let r = [];
1863
+ do
1864
+ r.push(n.call(this));
1865
+ while (!this.expectOptionalToken(i));
1866
+ return r;
1867
+ }
1868
+ return [];
1869
+ }
1870
+ many(t, n, i) {
1871
+ this.expectToken(t);
1872
+ let r = [];
1873
+ do
1874
+ r.push(n.call(this));
1875
+ while (!this.expectOptionalToken(i));
1876
+ return r;
1877
+ }
1878
+ delimitedMany(t, n) {
1879
+ this.expectOptionalToken(t);
1880
+ let i = [];
1881
+ do
1882
+ i.push(n.call(this));
1883
+ while (this.expectOptionalToken(t));
1884
+ return i;
1885
+ }
1886
+ advanceLexer() {
1887
+ let { maxTokens: t } = this._options, n = this._lexer.advance();
1888
+ 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.`);
1889
+ }
1890
+ };
1891
+ function ne(e) {
1892
+ let t = e.value;
1893
+ return at(e.kind) + (t != null ? ` "${t}"` : "");
1894
+ }
1895
+ function at(e) {
1896
+ return tt(e) ? `"${e}"` : e;
1897
+ }
1898
+ function Wt(e, t) {
1899
+ let n = /* @__PURE__ */ new SyntaxError(e + " (" + t.loc.start.line + ":" + t.loc.start.column + ")");
1900
+ return Object.assign(n, t);
1901
+ }
1902
+ var ct = Wt;
1903
+ function zt(e) {
1904
+ let t = [], { startToken: n, endToken: i } = e.loc;
1905
+ for (let r = n; r !== i; r = r.next) r.kind === "Comment" && t.push({
1906
+ ...r,
1907
+ loc: {
1908
+ start: r.start,
1909
+ end: r.end
1910
+ }
1911
+ });
1912
+ return t;
1913
+ }
1914
+ var Kt = { allowLegacyFragmentVariables: !0 };
1915
+ function Zt(e) {
1916
+ if (e?.name === "GraphQLError") {
1917
+ let { message: t, locations: [n] } = e;
1918
+ return ct(t, {
1919
+ loc: { start: n },
1920
+ cause: e
1921
+ });
1922
+ }
1923
+ return e;
1924
+ }
1925
+ function en(e) {
1926
+ let t;
1927
+ try {
1928
+ t = ot(e, Kt);
1929
+ } catch (n) {
1930
+ throw Zt(n);
1931
+ }
1932
+ return t.comments = zt(t), t;
1933
+ }
1934
+ var tn = {
1935
+ parse: en,
1936
+ astFormat: "graphql",
1937
+ hasPragma: Fe,
1938
+ hasIgnorePragma: Me,
1939
+ locStart: J,
1940
+ locEnd: q
1941
+ };
1942
+ var nn = { graphql: Ge };
1943
+
1944
+ //#endregion
1945
+ export { ut as default, Ye as languages, $e as options, he as parsers, nn as printers };