@comet/admin-generator 9.0.0-beta.0 → 9.0.0-beta.1

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