@rexeus/typeweaver 0.0.3 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,37 +1,37 @@
1
- var ft = Object.defineProperty;
2
- var ye = (e2, t) => {
3
- for (var n in t) ft(e2, n, { get: t[n], enumerable: true });
1
+ var Et = Object.defineProperty;
2
+ var xe = (e2, t) => {
3
+ for (var n in t) Et(e2, n, { get: t[n], enumerable: true });
4
4
  };
5
- var _e = {};
6
- ye(_e, { languages: () => Je, options: () => qe, parsers: () => Ne, printers: () => an });
7
- var ht = (e2, t, n, i) => {
5
+ var Ne = {};
6
+ xe(Ne, { languages: () => Qe, options: () => Ke, parsers: () => _e, printers: () => pn });
7
+ var Tt = (e2, t, n, i) => {
8
8
  if (!(e2 && t == null)) return t.replaceAll ? t.replaceAll(n, i) : n.global ? t.replace(n, i) : t.split(n).join(i);
9
- }, j = ht;
10
- var G = "indent";
9
+ }, G = Tt;
10
+ var j = "indent";
11
11
  var $ = "group";
12
- var F = "if-break";
13
- var C = "line";
14
- var J = "break-parent";
15
- var ve = () => {
16
- }, le = ve;
17
- function _(e2) {
18
- return { type: G, contents: e2 };
19
- }
20
- function x(e2, t = {}) {
12
+ var w = "if-break";
13
+ var S = "line";
14
+ var X = "break-parent";
15
+ var Re = () => {
16
+ }, le = Re;
17
+ function N(e2) {
18
+ return { type: j, contents: e2 };
19
+ }
20
+ function y(e2, t = {}) {
21
21
  return le(t.expandedStates), { type: $, id: t.id, contents: e2, break: !!t.shouldBreak, expandedStates: t.expandedStates };
22
22
  }
23
23
  function I(e2, t = "", n = {}) {
24
- return { type: F, breakContents: e2, flatContents: t, groupId: n.groupId };
24
+ return { type: w, breakContents: e2, flatContents: t, groupId: n.groupId };
25
25
  }
26
- var Tt = { type: J };
27
- var Nt = { type: C, hard: true };
28
- var k = { type: C }, p = { type: C, soft: true }, f = [Nt, Tt];
26
+ var yt = { type: X };
27
+ var Ot = { type: S, hard: true };
28
+ var k = { type: S }, p = { type: S, soft: true }, f = [Ot, yt];
29
29
  function E(e2, t) {
30
30
  let n = [];
31
31
  for (let i = 0; i < t.length; i++) i !== 0 && n.push(e2), n.push(t[i]);
32
32
  return n;
33
33
  }
34
- function X(e2) {
34
+ function H(e2) {
35
35
  return (t, n, i) => {
36
36
  let r = !!(i != null && i.backwards);
37
37
  if (n === false) return false;
@@ -46,8 +46,8 @@ function X(e2) {
46
46
  return a === -1 || a === s ? a : false;
47
47
  };
48
48
  }
49
- var q = X(" "), be = X(",; "), Le = X(/[^\n\r]/u);
50
- function _t(e2, t, n) {
49
+ var J = H(" "), ve = H(",; "), Le = H(/[^\n\r]/u);
50
+ function It(e2, t, n) {
51
51
  let i = !!(n != null && n.backwards);
52
52
  if (t === false) return false;
53
53
  let r = e2.charAt(t);
@@ -64,54 +64,54 @@ function _t(e2, t, n) {
64
64
  }
65
65
  return t;
66
66
  }
67
- var Q = _t;
68
- function yt(e2, t, n = {}) {
69
- let i = q(e2, n.backwards ? t - 1 : t, n), r = Q(e2, i, n);
67
+ var q = It;
68
+ function At(e2, t, n = {}) {
69
+ let i = J(e2, n.backwards ? t - 1 : t, n), r = q(e2, i, n);
70
70
  return i !== r;
71
71
  }
72
- var Re = yt;
73
- function xt(e2, t) {
72
+ var be = At;
73
+ function Dt(e2, t) {
74
74
  if (t === false) return false;
75
75
  if (e2.charAt(t) === "/" && e2.charAt(t + 1) === "*") {
76
76
  for (let n = t + 2; n < e2.length; ++n) if (e2.charAt(n) === "*" && e2.charAt(n + 1) === "/") return n + 2;
77
77
  }
78
78
  return t;
79
79
  }
80
- var Pe = xt;
81
- function Ot(e2, t) {
80
+ var Pe = Dt;
81
+ function gt(e2, t) {
82
82
  return t === false ? false : e2.charAt(t) === "/" && e2.charAt(t + 1) === "/" ? Le(e2, t) : t;
83
83
  }
84
- var Fe = Ot;
85
- function It(e2, t) {
84
+ var we = gt;
85
+ function kt(e2, t) {
86
86
  let n = null, i = t;
87
- for (; i !== n; ) n = i, i = be(e2, i), i = Pe(e2, i), i = q(e2, i);
88
- return i = Fe(e2, i), i = Q(e2, i), i !== false && Re(e2, i);
87
+ for (; i !== n; ) n = i, i = ve(e2, i), i = Pe(e2, i), i = J(e2, i);
88
+ return i = we(e2, i), i = q(e2, i), i !== false && be(e2, i);
89
89
  }
90
- var we = It;
91
- function Dt(e2) {
90
+ var Fe = kt;
91
+ function St(e2) {
92
92
  return Array.isArray(e2) && e2.length > 0;
93
93
  }
94
- var pe = Dt;
94
+ var pe = St;
95
95
  var fe = class extends Error {
96
96
  name = "UnexpectedNodeError";
97
97
  constructor(t, n, i = "type") {
98
98
  super(`Unexpected ${n} node ${i}: ${JSON.stringify(t[i])}.`), this.node = t;
99
99
  }
100
100
  }, Be = fe;
101
- var w = null;
101
+ var F = null;
102
102
  function B(e2) {
103
- if (w !== null && typeof w.property) {
104
- let t = w;
105
- return w = B.prototype = null, t;
103
+ if (F !== null && typeof F.property) {
104
+ let t = F;
105
+ return F = B.prototype = null, t;
106
106
  }
107
- return w = B.prototype = e2 ?? /* @__PURE__ */ Object.create(null), new B();
107
+ return F = B.prototype = e2 ?? /* @__PURE__ */ Object.create(null), new B();
108
108
  }
109
- var gt = 10;
110
- for (let e2 = 0; e2 <= gt; e2++) B();
109
+ var Ct = 10;
110
+ for (let e2 = 0; e2 <= Ct; e2++) B();
111
111
  function he(e2) {
112
112
  return B(e2);
113
113
  }
114
- function At(e2, t = "type") {
114
+ function Rt(e2, t = "type") {
115
115
  he(e2);
116
116
  function n(i) {
117
117
  let r = i[t], s = e2[r];
@@ -120,8 +120,8 @@ function At(e2, t = "type") {
120
120
  }
121
121
  return n;
122
122
  }
123
- var Ue = At;
124
- var H = class {
123
+ var Ue = Rt;
124
+ var Q = class {
125
125
  constructor(t, n, i) {
126
126
  this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source = i;
127
127
  }
@@ -142,56 +142,60 @@ var H = class {
142
142
  return { kind: this.kind, value: this.value, line: this.line, column: this.column };
143
143
  }
144
144
  }, W = { Name: [], Document: ["definitions"], OperationDefinition: ["name", "variableDefinitions", "directives", "selectionSet"], VariableDefinition: ["variable", "type", "defaultValue", "directives"], Variable: ["name"], SelectionSet: ["selections"], Field: ["alias", "name", "arguments", "directives", "selectionSet"], Argument: ["name", "value"], FragmentSpread: ["name", "directives"], InlineFragment: ["typeCondition", "directives", "selectionSet"], FragmentDefinition: ["name", "variableDefinitions", "typeCondition", "directives", "selectionSet"], IntValue: [], FloatValue: [], StringValue: [], BooleanValue: [], NullValue: [], EnumValue: [], ListValue: ["values"], ObjectValue: ["fields"], ObjectField: ["name", "value"], Directive: ["name", "arguments"], NamedType: ["name"], ListType: ["type"], NonNullType: ["type"], SchemaDefinition: ["description", "directives", "operationTypes"], OperationTypeDefinition: ["type"], ScalarTypeDefinition: ["description", "name", "directives"], ObjectTypeDefinition: ["description", "name", "interfaces", "directives", "fields"], FieldDefinition: ["description", "name", "arguments", "type", "directives"], InputValueDefinition: ["description", "name", "type", "defaultValue", "directives"], InterfaceTypeDefinition: ["description", "name", "interfaces", "directives", "fields"], UnionTypeDefinition: ["description", "name", "directives", "types"], EnumTypeDefinition: ["description", "name", "directives", "values"], EnumValueDefinition: ["description", "name", "directives"], InputObjectTypeDefinition: ["description", "name", "directives", "fields"], DirectiveDefinition: ["description", "name", "arguments", "locations"], SchemaExtension: ["directives", "operationTypes"], ScalarTypeExtension: ["name", "directives"], ObjectTypeExtension: ["name", "interfaces", "directives", "fields"], InterfaceTypeExtension: ["name", "interfaces", "directives", "fields"], UnionTypeExtension: ["name", "directives", "types"], EnumTypeExtension: ["name", "directives", "values"], InputObjectTypeExtension: ["name", "directives", "fields"] }; new Set(Object.keys(W));
145
- var S;
145
+ var C;
146
146
  (function(e2) {
147
147
  e2.QUERY = "query", e2.MUTATION = "mutation", e2.SUBSCRIPTION = "subscription";
148
- })(S || (S = {}));
149
- var kt = Ue(W, "kind"), Ve = kt;
148
+ })(C || (C = {}));
149
+ var vt = Ue(W, "kind"), Me = vt;
150
150
  function K(e2) {
151
151
  return e2.loc.start;
152
152
  }
153
153
  function z(e2) {
154
154
  return e2.loc.end;
155
155
  }
156
- function Ye(e2) {
157
- return /^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/u.test(e2);
156
+ var Ve = "format", Ye = /^\s*#[^\S\n]*@(?:noformat|noprettier)\s*(?:\n|$)/u, Ge = /^\s*#[^\S\n]*@(?:format|prettier)\s*(?:\n|$)/u;
157
+ function je(e2) {
158
+ return Ge.test(e2);
159
+ }
160
+ function $e(e2) {
161
+ return Ye.test(e2);
158
162
  }
159
- function Me(e2) {
160
- return `# @format
163
+ function Xe(e2) {
164
+ return `# @${Ve}
161
165
 
162
- ` + e2;
166
+ ${e2}`;
163
167
  }
164
- function Ct(e2, t, n) {
168
+ function Lt(e2, t, n) {
165
169
  let { node: i } = e2;
166
170
  if (!i.description) return "";
167
171
  let r = [n("description")];
168
172
  return i.kind === "InputValueDefinition" && !i.description.block ? r.push(k) : r.push(f), r;
169
173
  }
170
- var g = Ct;
171
- function St(e2, t, n) {
174
+ var D = Lt;
175
+ function bt(e2, t, n) {
172
176
  let { node: i } = e2;
173
177
  switch (i.kind) {
174
178
  case "Document":
175
- return [...E(f, A(e2, t, n, "definitions")), f];
179
+ return [...E(f, g(e2, t, n, "definitions")), f];
176
180
  case "OperationDefinition": {
177
181
  let r = t.originalText[K(i)] !== "{", s = !!i.name;
178
- return [r ? i.operation : "", r && s ? [" ", n("name")] : "", r && !s && pe(i.variableDefinitions) ? " " : "", je(e2, n), y(e2, n, i), !r && !s ? "" : " ", n("selectionSet")];
182
+ return [r ? i.operation : "", r && s ? [" ", n("name")] : "", r && !s && pe(i.variableDefinitions) ? " " : "", He(e2, n), x(e2, n, i), !r && !s ? "" : " ", n("selectionSet")];
179
183
  }
180
184
  case "FragmentDefinition":
181
- return ["fragment ", n("name"), je(e2, n), " on ", n("typeCondition"), y(e2, n, i), " ", n("selectionSet")];
185
+ return ["fragment ", n("name"), He(e2, n), " on ", n("typeCondition"), x(e2, n, i), " ", n("selectionSet")];
182
186
  case "SelectionSet":
183
- return ["{", _([f, E(f, A(e2, t, n, "selections"))]), f, "}"];
187
+ return ["{", N([f, E(f, g(e2, t, n, "selections"))]), f, "}"];
184
188
  case "Field":
185
- return x([i.alias ? [n("alias"), ": "] : "", n("name"), i.arguments.length > 0 ? x(["(", _([p, E([I("", ", "), p], A(e2, t, n, "arguments"))]), p, ")"]) : "", y(e2, n, i), i.selectionSet ? " " : "", n("selectionSet")]);
189
+ return y([i.alias ? [n("alias"), ": "] : "", n("name"), i.arguments.length > 0 ? y(["(", N([p, E([I("", ", "), p], g(e2, t, n, "arguments"))]), p, ")"]) : "", x(e2, n, i), i.selectionSet ? " " : "", n("selectionSet")]);
186
190
  case "Name":
187
191
  return i.value;
188
192
  case "StringValue":
189
193
  if (i.block) {
190
- let r = j(false, i.value, '"""', String.raw`\"""`).split(`
194
+ let r = G(false, i.value, '"""', String.raw`\"""`).split(`
191
195
  `);
192
196
  return r.length === 1 && (r[0] = r[0].trim()), r.every((s) => s === "") && (r.length = 0), E(f, ['"""', ...r, '"""']);
193
197
  }
194
- return ['"', j(false, j(false, i.value, /["\\]/gu, String.raw`\$&`), `
198
+ return ['"', G(false, G(false, i.value, /["\\]/gu, String.raw`\$&`), `
195
199
  `, String.raw`\n`), '"'];
196
200
  case "IntValue":
197
201
  case "FloatValue":
@@ -204,20 +208,20 @@ function St(e2, t, n) {
204
208
  case "Variable":
205
209
  return ["$", n("name")];
206
210
  case "ListValue":
207
- return x(["[", _([p, E([I("", ", "), p], e2.map(n, "values"))]), p, "]"]);
211
+ return y(["[", N([p, E([I("", ", "), p], e2.map(n, "values"))]), p, "]"]);
208
212
  case "ObjectValue": {
209
213
  let r = t.bracketSpacing && i.fields.length > 0 ? " " : "";
210
- return x(["{", r, _([p, E([I("", ", "), p], e2.map(n, "fields"))]), p, I("", r), "}"]);
214
+ return y(["{", r, N([p, E([I("", ", "), p], e2.map(n, "fields"))]), p, I("", r), "}"]);
211
215
  }
212
216
  case "ObjectField":
213
217
  case "Argument":
214
218
  return [n("name"), ": ", n("value")];
215
219
  case "Directive":
216
- return ["@", n("name"), i.arguments.length > 0 ? x(["(", _([p, E([I("", ", "), p], A(e2, t, n, "arguments"))]), p, ")"]) : ""];
220
+ return ["@", n("name"), i.arguments.length > 0 ? y(["(", N([p, E([I("", ", "), p], g(e2, t, n, "arguments"))]), p, ")"]) : ""];
217
221
  case "NamedType":
218
222
  return n("name");
219
223
  case "VariableDefinition":
220
- return [n("variable"), ": ", n("type"), i.defaultValue ? [" = ", n("defaultValue")] : "", y(e2, n, i)];
224
+ return [n("variable"), ": ", n("type"), i.defaultValue ? [" = ", n("defaultValue")] : "", x(e2, n, i)];
221
225
  case "ObjectTypeExtension":
222
226
  case "ObjectTypeDefinition":
223
227
  case "InputObjectTypeExtension":
@@ -225,35 +229,35 @@ function St(e2, t, n) {
225
229
  case "InterfaceTypeExtension":
226
230
  case "InterfaceTypeDefinition": {
227
231
  let { kind: r } = i, s = [];
228
- return r.endsWith("TypeDefinition") ? s.push(g(e2, t, n)) : s.push("extend "), r.startsWith("ObjectType") ? s.push("type") : r.startsWith("InputObjectType") ? s.push("input") : s.push("interface"), s.push(" ", n("name")), !r.startsWith("InputObjectType") && i.interfaces.length > 0 && s.push(" implements ", ...Lt(e2, t, n)), s.push(y(e2, n, i)), i.fields.length > 0 && s.push([" {", _([f, E(f, A(e2, t, n, "fields"))]), f, "}"]), s;
232
+ return r.endsWith("TypeDefinition") ? s.push(D(e2, t, n)) : s.push("extend "), r.startsWith("ObjectType") ? s.push("type") : r.startsWith("InputObjectType") ? s.push("input") : s.push("interface"), s.push(" ", n("name")), !r.startsWith("InputObjectType") && i.interfaces.length > 0 && s.push(" implements ", ...Ft(e2, t, n)), s.push(x(e2, n, i)), i.fields.length > 0 && s.push([" {", N([f, E(f, g(e2, t, n, "fields"))]), f, "}"]), s;
229
233
  }
230
234
  case "FieldDefinition":
231
- return [g(e2, t, n), n("name"), i.arguments.length > 0 ? x(["(", _([p, E([I("", ", "), p], A(e2, t, n, "arguments"))]), p, ")"]) : "", ": ", n("type"), y(e2, n, i)];
235
+ return [D(e2, t, n), n("name"), i.arguments.length > 0 ? y(["(", N([p, E([I("", ", "), p], g(e2, t, n, "arguments"))]), p, ")"]) : "", ": ", n("type"), x(e2, n, i)];
232
236
  case "DirectiveDefinition":
233
- return [g(e2, t, n), "directive ", "@", n("name"), i.arguments.length > 0 ? x(["(", _([p, E([I("", ", "), p], A(e2, t, n, "arguments"))]), p, ")"]) : "", i.repeatable ? " repeatable" : "", " on ", ...E(" | ", e2.map(n, "locations"))];
237
+ return [D(e2, t, n), "directive ", "@", n("name"), i.arguments.length > 0 ? y(["(", N([p, E([I("", ", "), p], g(e2, t, n, "arguments"))]), p, ")"]) : "", i.repeatable ? " repeatable" : "", " on ", ...E(" | ", e2.map(n, "locations"))];
234
238
  case "EnumTypeExtension":
235
239
  case "EnumTypeDefinition":
236
- return [g(e2, t, n), i.kind === "EnumTypeExtension" ? "extend " : "", "enum ", n("name"), y(e2, n, i), i.values.length > 0 ? [" {", _([f, E(f, A(e2, t, n, "values"))]), f, "}"] : ""];
240
+ return [D(e2, t, n), i.kind === "EnumTypeExtension" ? "extend " : "", "enum ", n("name"), x(e2, n, i), i.values.length > 0 ? [" {", N([f, E(f, g(e2, t, n, "values"))]), f, "}"] : ""];
237
241
  case "EnumValueDefinition":
238
- return [g(e2, t, n), n("name"), y(e2, n, i)];
242
+ return [D(e2, t, n), n("name"), x(e2, n, i)];
239
243
  case "InputValueDefinition":
240
- return [g(e2, t, n), n("name"), ": ", n("type"), i.defaultValue ? [" = ", n("defaultValue")] : "", y(e2, n, i)];
244
+ return [D(e2, t, n), n("name"), ": ", n("type"), i.defaultValue ? [" = ", n("defaultValue")] : "", x(e2, n, i)];
241
245
  case "SchemaExtension":
242
- return ["extend schema", y(e2, n, i), ...i.operationTypes.length > 0 ? [" {", _([f, E(f, A(e2, t, n, "operationTypes"))]), f, "}"] : []];
246
+ return ["extend schema", x(e2, n, i), ...i.operationTypes.length > 0 ? [" {", N([f, E(f, g(e2, t, n, "operationTypes"))]), f, "}"] : []];
243
247
  case "SchemaDefinition":
244
- return [g(e2, t, n), "schema", y(e2, n, i), " {", i.operationTypes.length > 0 ? _([f, E(f, A(e2, t, n, "operationTypes"))]) : "", f, "}"];
248
+ return [D(e2, t, n), "schema", x(e2, n, i), " {", i.operationTypes.length > 0 ? N([f, E(f, g(e2, t, n, "operationTypes"))]) : "", f, "}"];
245
249
  case "OperationTypeDefinition":
246
250
  return [i.operation, ": ", n("type")];
247
251
  case "FragmentSpread":
248
- return ["...", n("name"), y(e2, n, i)];
252
+ return ["...", n("name"), x(e2, n, i)];
249
253
  case "InlineFragment":
250
- return ["...", i.typeCondition ? [" on ", n("typeCondition")] : "", y(e2, n, i), " ", n("selectionSet")];
254
+ return ["...", i.typeCondition ? [" on ", n("typeCondition")] : "", x(e2, n, i), " ", n("selectionSet")];
251
255
  case "UnionTypeExtension":
252
256
  case "UnionTypeDefinition":
253
- return x([g(e2, t, n), x([i.kind === "UnionTypeExtension" ? "extend " : "", "union ", n("name"), y(e2, n, i), i.types.length > 0 ? [" =", I("", " "), _([I([k, "| "]), E([k, "| "], e2.map(n, "types"))])] : ""])]);
257
+ return y([D(e2, t, n), y([i.kind === "UnionTypeExtension" ? "extend " : "", "union ", n("name"), x(e2, n, i), i.types.length > 0 ? [" =", I("", " "), N([I([k, "| "]), E([k, "| "], e2.map(n, "types"))])] : ""])]);
254
258
  case "ScalarTypeExtension":
255
259
  case "ScalarTypeDefinition":
256
- return [g(e2, t, n), i.kind === "ScalarTypeExtension" ? "extend " : "", "scalar ", n("name"), y(e2, n, i)];
260
+ return [D(e2, t, n), i.kind === "ScalarTypeExtension" ? "extend " : "", "scalar ", n("name"), x(e2, n, i)];
257
261
  case "NonNullType":
258
262
  return [n("type"), "!"];
259
263
  case "ListType":
@@ -262,104 +266,104 @@ function St(e2, t, n) {
262
266
  throw new Be(i, "Graphql", "kind");
263
267
  }
264
268
  }
265
- function y(e2, t, n) {
269
+ function x(e2, t, n) {
266
270
  if (n.directives.length === 0) return "";
267
271
  let i = E(k, e2.map(t, "directives"));
268
- return n.kind === "FragmentDefinition" || n.kind === "OperationDefinition" ? x([k, i]) : [" ", x(_([p, i]))];
272
+ return n.kind === "FragmentDefinition" || n.kind === "OperationDefinition" ? y([k, i]) : [" ", y(N([p, i]))];
269
273
  }
270
- function A(e2, t, n, i) {
274
+ function g(e2, t, n, i) {
271
275
  return e2.map(({ isLast: r, node: s }) => {
272
276
  let a = n();
273
- return !r && we(t.originalText, z(s)) ? [a, f] : a;
277
+ return !r && Fe(t.originalText, z(s)) ? [a, f] : a;
274
278
  }, i);
275
279
  }
276
- function vt(e2) {
280
+ function Pt(e2) {
277
281
  return e2.kind !== "Comment";
278
282
  }
279
- function bt(e2) {
283
+ function wt(e2) {
280
284
  let t = e2.node;
281
285
  if (t.kind === "Comment") return "#" + t.value.trimEnd();
282
286
  throw new Error("Not a comment: " + JSON.stringify(t));
283
287
  }
284
- function Lt(e2, t, n) {
288
+ function Ft(e2, t, n) {
285
289
  let { node: i } = e2, r = [], { interfaces: s } = i, a = e2.map(n, "interfaces");
286
290
  for (let u = 0; u < s.length; u++) {
287
291
  let l = s[u];
288
292
  r.push(a[u]);
289
293
  let T = s[u + 1];
290
294
  if (T) {
291
- let D = t.originalText.slice(l.loc.end, T.loc.start).includes("#");
292
- r.push(" &", D ? k : " ");
295
+ let A = t.originalText.slice(l.loc.end, T.loc.start).includes("#");
296
+ r.push(" &", A ? k : " ");
293
297
  }
294
298
  }
295
299
  return r;
296
300
  }
297
- function je(e2, t) {
301
+ function He(e2, t) {
298
302
  let { node: n } = e2;
299
- return pe(n.variableDefinitions) ? x(["(", _([p, E([I("", ", "), p], e2.map(t, "variableDefinitions"))]), p, ")"]) : "";
303
+ return pe(n.variableDefinitions) ? y(["(", N([p, E([I("", ", "), p], e2.map(t, "variableDefinitions"))]), p, ")"]) : "";
300
304
  }
301
- function Ge(e2, t) {
305
+ function Je(e2, t) {
302
306
  e2.kind === "StringValue" && e2.block && !e2.value.includes(`
303
307
  `) && (t.value = e2.value.trim());
304
308
  }
305
- Ge.ignoredProperties = /* @__PURE__ */ new Set(["loc", "comments"]);
306
- function Rt(e2) {
309
+ Je.ignoredProperties = /* @__PURE__ */ new Set(["loc", "comments"]);
310
+ function Bt(e2) {
307
311
  var n;
308
312
  let { node: t } = e2;
309
313
  return (n = t == null ? void 0 : t.comments) == null ? void 0 : n.some((i) => i.value.trim() === "prettier-ignore");
310
314
  }
311
- var Pt = { print: St, massageAstNode: Ge, hasPrettierIgnore: Rt, insertPragma: Me, printComment: bt, canAttachComment: vt, getVisitorKeys: Ve }, $e = Pt;
312
- var Je = [{ linguistLanguageId: 139, name: "GraphQL", type: "data", color: "#e10098", extensions: [".graphql", ".gql", ".graphqls"], tmScope: "source.graphql", aceMode: "text", parsers: ["graphql"], vscodeLanguageIds: ["graphql"] }];
313
- var Xe = { bracketSpacing: { category: "Common", type: "boolean", default: true, description: "Print spaces between brackets.", oppositeDescription: "Do not print spaces between brackets." }};
314
- var Ft = { bracketSpacing: Xe.bracketSpacing }, qe = Ft;
315
- var Ne = {};
316
- ye(Ne, { graphql: () => on });
317
- function Qe(e2) {
315
+ var Ut = { print: bt, massageAstNode: Je, hasPrettierIgnore: Bt, insertPragma: Xe, printComment: wt, canAttachComment: Pt, getVisitorKeys: Me }, qe = Ut;
316
+ var Qe = [{ name: "GraphQL", type: "data", extensions: [".graphql", ".gql", ".graphqls"], tmScope: "source.graphql", aceMode: "text", parsers: ["graphql"], vscodeLanguageIds: ["graphql"], linguistLanguageId: 139 }];
317
+ var We = { bracketSpacing: { category: "Common", type: "boolean", default: true, description: "Print spaces between brackets.", oppositeDescription: "Do not print spaces between brackets." }};
318
+ var Mt = { bracketSpacing: We.bracketSpacing }, Ke = Mt;
319
+ var _e = {};
320
+ xe(_e, { graphql: () => ln });
321
+ function ze(e2) {
318
322
  return typeof e2 == "object" && e2 !== null;
319
323
  }
320
- function He(e2, t) {
324
+ function Ze(e2, t) {
321
325
  throw new Error("Unexpected invariant triggered.");
322
326
  }
323
- var wt = /\r\n|[\n\r]/g;
324
- function V(e2, t) {
327
+ var Vt = /\r\n|[\n\r]/g;
328
+ function M(e2, t) {
325
329
  let n = 0, i = 1;
326
- for (let r of e2.body.matchAll(wt)) {
327
- if (typeof r.index == "number" || He(), r.index >= t) break;
330
+ for (let r of e2.body.matchAll(Vt)) {
331
+ if (typeof r.index == "number" || Ze(), r.index >= t) break;
328
332
  n = r.index + r[0].length, i += 1;
329
333
  }
330
334
  return { line: i, column: t + 1 - n };
331
335
  }
332
- function Ke(e2) {
333
- return de(e2.source, V(e2.source, e2.start));
336
+ function tt(e2) {
337
+ return de(e2.source, M(e2.source, e2.start));
334
338
  }
335
339
  function de(e2, t) {
336
340
  let n = e2.locationOffset.column - 1, i = "".padStart(n) + e2.body, r = t.line - 1, s = e2.locationOffset.line - 1, a = t.line + s, u = t.line === 1 ? n : 0, l = t.column + u, T = `${e2.name}:${a}:${l}
337
- `, h = i.split(/\r\n|[\n\r]/g), D = h[r];
338
- if (D.length > 120) {
339
- let O = Math.floor(l / 80), ae = l % 80, N = [];
340
- for (let b = 0; b < D.length; b += 80) N.push(D.slice(b, b + 80));
341
- return T + We([[`${a} |`, N[0]], ...N.slice(1, O + 1).map((b) => ["|", b]), ["|", "^".padStart(ae)], ["|", N[O + 1]]]);
341
+ `, h = i.split(/\r\n|[\n\r]/g), A = h[r];
342
+ if (A.length > 120) {
343
+ let O = Math.floor(l / 80), ae = l % 80, _ = [];
344
+ for (let v = 0; v < A.length; v += 80) _.push(A.slice(v, v + 80));
345
+ return T + et([[`${a} |`, _[0]], ..._.slice(1, O + 1).map((v) => ["|", v]), ["|", "^".padStart(ae)], ["|", _[O + 1]]]);
342
346
  }
343
- return T + We([[`${a - 1} |`, h[r - 1]], [`${a} |`, D], ["|", "^".padStart(l)], [`${a + 1} |`, h[r + 1]]]);
347
+ return T + et([[`${a - 1} |`, h[r - 1]], [`${a} |`, A], ["|", "^".padStart(l)], [`${a + 1} |`, h[r + 1]]]);
344
348
  }
345
- function We(e2) {
349
+ function et(e2) {
346
350
  let t = e2.filter(([i, r]) => r !== void 0), n = Math.max(...t.map(([i]) => i.length));
347
351
  return t.map(([i, r]) => i.padStart(n) + (r ? " " + r : "")).join(`
348
352
  `);
349
353
  }
350
- function Bt(e2) {
354
+ function Yt(e2) {
351
355
  let t = e2[0];
352
356
  return t == null || "kind" in t || "length" in t ? { nodes: t, source: e2[1], positions: e2[2], path: e2[3], originalError: e2[4], extensions: e2[5] } : t;
353
357
  }
354
358
  var Z = class e extends Error {
355
359
  constructor(t, ...n) {
356
360
  var i, r, s;
357
- let { nodes: a, source: u, positions: l, path: T, originalError: h, extensions: D } = Bt(n);
358
- super(t), this.name = "GraphQLError", this.path = T ?? void 0, this.originalError = h ?? void 0, this.nodes = ze(Array.isArray(a) ? a : a ? [a] : void 0);
359
- let O = ze((i = this.nodes) === null || i === void 0 ? void 0 : i.map((N) => N.loc).filter((N) => N != null));
360
- 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((N) => N.start)), this.locations = l && u ? l.map((N) => V(u, N)) : O == null ? void 0 : O.map((N) => V(N.source, N.start));
361
- let ae = Qe(h == null ? void 0 : h.extensions) ? h == null ? void 0 : h.extensions : void 0;
362
- this.extensions = (s = D ?? ae) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, { message: { writable: true, enumerable: true }, name: { enumerable: false }, nodes: { enumerable: false }, source: { enumerable: false }, positions: { enumerable: false }, originalError: { enumerable: false } }), h != null && h.stack ? Object.defineProperty(this, "stack", { value: h.stack, writable: true, configurable: true }) : Error.captureStackTrace ? Error.captureStackTrace(this, e) : Object.defineProperty(this, "stack", { value: Error().stack, writable: true, configurable: true });
361
+ let { nodes: a, source: u, positions: l, path: T, originalError: h, extensions: A } = Yt(n);
362
+ 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);
363
+ let O = nt((i = this.nodes) === null || i === void 0 ? void 0 : i.map((_) => _.loc).filter((_) => _ != null));
364
+ 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));
365
+ let ae = ze(h == null ? void 0 : h.extensions) ? h == null ? void 0 : h.extensions : void 0;
366
+ this.extensions = (s = A ?? ae) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, { message: { writable: true, enumerable: true }, name: { enumerable: false }, nodes: { enumerable: false }, source: { enumerable: false }, positions: { enumerable: false }, originalError: { enumerable: false } }), h != null && h.stack ? Object.defineProperty(this, "stack", { value: h.stack, writable: true, configurable: true }) : Error.captureStackTrace ? Error.captureStackTrace(this, e) : Object.defineProperty(this, "stack", { value: Error().stack, writable: true, configurable: true });
363
367
  }
364
368
  get [Symbol.toStringTag]() {
365
369
  return "GraphQLError";
@@ -368,7 +372,7 @@ var Z = class e extends Error {
368
372
  let t = this.message;
369
373
  if (this.nodes) for (let n of this.nodes) n.loc && (t += `
370
374
 
371
- ` + Ke(n.loc));
375
+ ` + tt(n.loc));
372
376
  else if (this.source && this.locations) for (let n of this.locations) t += `
373
377
 
374
378
  ` + de(this.source, n);
@@ -379,7 +383,7 @@ var Z = class e extends Error {
379
383
  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;
380
384
  }
381
385
  };
382
- function ze(e2) {
386
+ function nt(e2) {
383
387
  return e2 === void 0 || e2.length === 0 ? void 0 : e2;
384
388
  }
385
389
  function d(e2, t, n) {
@@ -393,34 +397,34 @@ var c;
393
397
  (function(e2) {
394
398
  e2.NAME = "Name", e2.DOCUMENT = "Document", e2.OPERATION_DEFINITION = "OperationDefinition", e2.VARIABLE_DEFINITION = "VariableDefinition", e2.SELECTION_SET = "SelectionSet", e2.FIELD = "Field", e2.ARGUMENT = "Argument", e2.FRAGMENT_SPREAD = "FragmentSpread", e2.INLINE_FRAGMENT = "InlineFragment", e2.FRAGMENT_DEFINITION = "FragmentDefinition", e2.VARIABLE = "Variable", e2.INT = "IntValue", e2.FLOAT = "FloatValue", e2.STRING = "StringValue", e2.BOOLEAN = "BooleanValue", e2.NULL = "NullValue", e2.ENUM = "EnumValue", e2.LIST = "ListValue", e2.OBJECT = "ObjectValue", e2.OBJECT_FIELD = "ObjectField", e2.DIRECTIVE = "Directive", e2.NAMED_TYPE = "NamedType", e2.LIST_TYPE = "ListType", e2.NON_NULL_TYPE = "NonNullType", e2.SCHEMA_DEFINITION = "SchemaDefinition", e2.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", e2.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", e2.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", e2.FIELD_DEFINITION = "FieldDefinition", e2.INPUT_VALUE_DEFINITION = "InputValueDefinition", e2.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", e2.UNION_TYPE_DEFINITION = "UnionTypeDefinition", e2.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", e2.ENUM_VALUE_DEFINITION = "EnumValueDefinition", e2.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", e2.DIRECTIVE_DEFINITION = "DirectiveDefinition", e2.SCHEMA_EXTENSION = "SchemaExtension", e2.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", e2.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", e2.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", e2.UNION_TYPE_EXTENSION = "UnionTypeExtension", e2.ENUM_TYPE_EXTENSION = "EnumTypeExtension", e2.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension";
395
399
  })(c || (c = {}));
396
- function Ze(e2) {
400
+ function rt(e2) {
397
401
  return e2 === 9 || e2 === 32;
398
402
  }
399
- function R(e2) {
403
+ function b(e2) {
400
404
  return e2 >= 48 && e2 <= 57;
401
405
  }
402
- function et(e2) {
406
+ function it(e2) {
403
407
  return e2 >= 97 && e2 <= 122 || e2 >= 65 && e2 <= 90;
404
408
  }
405
409
  function me(e2) {
406
- return et(e2) || e2 === 95;
410
+ return it(e2) || e2 === 95;
407
411
  }
408
- function tt(e2) {
409
- return et(e2) || R(e2) || e2 === 95;
412
+ function st(e2) {
413
+ return it(e2) || b(e2) || e2 === 95;
410
414
  }
411
- function nt(e2) {
415
+ function ot(e2) {
412
416
  var t;
413
417
  let n = Number.MAX_SAFE_INTEGER, i = null, r = -1;
414
418
  for (let a = 0; a < e2.length; ++a) {
415
419
  var s;
416
- let u = e2[a], l = Ut(u);
420
+ let u = e2[a], l = Gt(u);
417
421
  l !== u.length && (i = (s = i) !== null && s !== void 0 ? s : a, r = a, a !== 0 && l < n && (n = l));
418
422
  }
419
423
  return e2.map((a, u) => u === 0 ? a : a.slice(n)).slice((t = i) !== null && t !== void 0 ? t : 0, r + 1);
420
424
  }
421
- function Ut(e2) {
425
+ function Gt(e2) {
422
426
  let t = 0;
423
- for (; t < e2.length && Ze(e2.charCodeAt(t)); ) ++t;
427
+ for (; t < e2.length && rt(e2.charCodeAt(t)); ) ++t;
424
428
  return t;
425
429
  }
426
430
  var o;
@@ -443,29 +447,29 @@ var te = class {
443
447
  if (t.kind !== o.EOF) do
444
448
  if (t.next) t = t.next;
445
449
  else {
446
- let n = Vt(this, t.end);
450
+ let n = jt(this, t.end);
447
451
  t.next = n, n.prev = t, t = n;
448
452
  }
449
453
  while (t.kind === o.COMMENT);
450
454
  return t;
451
455
  }
452
456
  };
453
- function it(e2) {
457
+ function ct(e2) {
454
458
  return e2 === o.BANG || e2 === o.DOLLAR || e2 === o.AMP || e2 === o.PAREN_L || e2 === o.PAREN_R || e2 === o.SPREAD || e2 === o.COLON || e2 === o.EQUALS || e2 === o.AT || e2 === o.BRACKET_L || e2 === o.BRACKET_R || e2 === o.BRACE_L || e2 === o.PIPE || e2 === o.BRACE_R;
455
459
  }
456
460
  function P(e2) {
457
461
  return e2 >= 0 && e2 <= 55295 || e2 >= 57344 && e2 <= 1114111;
458
462
  }
459
463
  function ne(e2, t) {
460
- return st(e2.charCodeAt(t)) && ot(e2.charCodeAt(t + 1));
464
+ return ut(e2.charCodeAt(t)) && lt(e2.charCodeAt(t + 1));
461
465
  }
462
- function st(e2) {
466
+ function ut(e2) {
463
467
  return e2 >= 55296 && e2 <= 56319;
464
468
  }
465
- function ot(e2) {
469
+ function lt(e2) {
466
470
  return e2 >= 56320 && e2 <= 57343;
467
471
  }
468
- function v(e2, t) {
472
+ function R(e2, t) {
469
473
  let n = e2.source.body.codePointAt(t);
470
474
  if (n === void 0) return o.EOF;
471
475
  if (n >= 32 && n <= 126) {
@@ -478,7 +482,7 @@ function m(e2, t, n, i, r) {
478
482
  let s = e2.line, a = 1 + n - e2.lineStart;
479
483
  return new U(t, n, i, s, a, r);
480
484
  }
481
- function Vt(e2, t) {
485
+ function jt(e2, t) {
482
486
  let n = e2.source.body, i = n.length, r = t;
483
487
  for (; r < i; ) {
484
488
  let s = n.charCodeAt(r);
@@ -496,7 +500,7 @@ function Vt(e2, t) {
496
500
  n.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++e2.line, e2.lineStart = r;
497
501
  continue;
498
502
  case 35:
499
- return Yt(e2, r);
503
+ return $t(e2, r);
500
504
  case 33:
501
505
  return m(e2, o.BANG, r, r + 1);
502
506
  case 36:
@@ -527,15 +531,15 @@ function Vt(e2, t) {
527
531
  case 125:
528
532
  return m(e2, o.BRACE_R, r, r + 1);
529
533
  case 34:
530
- return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? Xt(e2, r) : jt(e2, r);
534
+ return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? Wt(e2, r) : Ht(e2, r);
531
535
  }
532
- if (R(s) || s === 45) return Mt(e2, r, s);
533
- if (me(s)) return qt(e2, r);
534
- throw d(e2.source, r, s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : P(s) || ne(n, r) ? `Unexpected character: ${v(e2, r)}.` : `Invalid character: ${v(e2, r)}.`);
536
+ if (b(s) || s === 45) return Xt(e2, r, s);
537
+ if (me(s)) return Kt(e2, r);
538
+ throw d(e2.source, r, s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : P(s) || ne(n, r) ? `Unexpected character: ${R(e2, r)}.` : `Invalid character: ${R(e2, r)}.`);
535
539
  }
536
540
  return m(e2, o.EOF, i, i);
537
541
  }
538
- function Yt(e2, t) {
542
+ function $t(e2, t) {
539
543
  let n = e2.source.body, i = n.length, r = t + 1;
540
544
  for (; r < i; ) {
541
545
  let s = n.charCodeAt(r);
@@ -546,39 +550,39 @@ function Yt(e2, t) {
546
550
  }
547
551
  return m(e2, o.COMMENT, t, r, n.slice(t + 1, r));
548
552
  }
549
- function Mt(e2, t, n) {
553
+ function Xt(e2, t, n) {
550
554
  let i = e2.source.body, r = t, s = n, a = false;
551
555
  if (s === 45 && (s = i.charCodeAt(++r)), s === 48) {
552
- if (s = i.charCodeAt(++r), R(s)) throw d(e2.source, r, `Invalid number, unexpected digit after 0: ${v(e2, r)}.`);
556
+ if (s = i.charCodeAt(++r), b(s)) throw d(e2.source, r, `Invalid number, unexpected digit after 0: ${R(e2, r)}.`);
553
557
  } else r = Ee(e2, r, s), s = i.charCodeAt(r);
554
- if (s === 46 && (a = true, s = i.charCodeAt(++r), r = Ee(e2, r, s), s = i.charCodeAt(r)), (s === 69 || s === 101) && (a = true, s = i.charCodeAt(++r), (s === 43 || s === 45) && (s = i.charCodeAt(++r)), r = Ee(e2, r, s), s = i.charCodeAt(r)), s === 46 || me(s)) throw d(e2.source, r, `Invalid number, expected digit but got: ${v(e2, r)}.`);
558
+ if (s === 46 && (a = true, s = i.charCodeAt(++r), r = Ee(e2, r, s), s = i.charCodeAt(r)), (s === 69 || s === 101) && (a = true, s = i.charCodeAt(++r), (s === 43 || s === 45) && (s = i.charCodeAt(++r)), r = Ee(e2, r, s), s = i.charCodeAt(r)), s === 46 || me(s)) throw d(e2.source, r, `Invalid number, expected digit but got: ${R(e2, r)}.`);
555
559
  return m(e2, a ? o.FLOAT : o.INT, t, r, i.slice(t, r));
556
560
  }
557
561
  function Ee(e2, t, n) {
558
- if (!R(n)) throw d(e2.source, t, `Invalid number, expected digit but got: ${v(e2, t)}.`);
562
+ if (!b(n)) throw d(e2.source, t, `Invalid number, expected digit but got: ${R(e2, t)}.`);
559
563
  let i = e2.source.body, r = t + 1;
560
- for (; R(i.charCodeAt(r)); ) ++r;
564
+ for (; b(i.charCodeAt(r)); ) ++r;
561
565
  return r;
562
566
  }
563
- function jt(e2, t) {
567
+ function Ht(e2, t) {
564
568
  let n = e2.source.body, i = n.length, r = t + 1, s = r, a = "";
565
569
  for (; r < i; ) {
566
570
  let u = n.charCodeAt(r);
567
571
  if (u === 34) return a += n.slice(s, r), m(e2, o.STRING, t, r + 1, a);
568
572
  if (u === 92) {
569
573
  a += n.slice(s, r);
570
- let l = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ? Gt(e2, r) : $t(e2, r) : Jt(e2, r);
574
+ let l = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ? Jt(e2, r) : qt(e2, r) : Qt(e2, r);
571
575
  a += l.value, r += l.size, s = r;
572
576
  continue;
573
577
  }
574
578
  if (u === 10 || u === 13) break;
575
579
  if (P(u)) ++r;
576
580
  else if (ne(n, r)) r += 2;
577
- else throw d(e2.source, r, `Invalid character within String: ${v(e2, r)}.`);
581
+ else throw d(e2.source, r, `Invalid character within String: ${R(e2, r)}.`);
578
582
  }
579
583
  throw d(e2.source, r, "Unterminated string.");
580
584
  }
581
- function Gt(e2, t) {
585
+ function Jt(e2, t) {
582
586
  let n = e2.source.body, i = 0, r = 3;
583
587
  for (; r < 12; ) {
584
588
  let s = n.charCodeAt(t + r++);
@@ -586,26 +590,26 @@ function Gt(e2, t) {
586
590
  if (r < 5 || !P(i)) break;
587
591
  return { value: String.fromCodePoint(i), size: r };
588
592
  }
589
- if (i = i << 4 | Y(s), i < 0) break;
593
+ if (i = i << 4 | V(s), i < 0) break;
590
594
  }
591
595
  throw d(e2.source, t, `Invalid Unicode escape sequence: "${n.slice(t, t + r)}".`);
592
596
  }
593
- function $t(e2, t) {
594
- let n = e2.source.body, i = rt(n, t + 2);
597
+ function qt(e2, t) {
598
+ let n = e2.source.body, i = at(n, t + 2);
595
599
  if (P(i)) return { value: String.fromCodePoint(i), size: 6 };
596
- if (st(i) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
597
- let r = rt(n, t + 8);
598
- if (ot(r)) return { value: String.fromCodePoint(i, r), size: 12 };
600
+ if (ut(i) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
601
+ let r = at(n, t + 8);
602
+ if (lt(r)) return { value: String.fromCodePoint(i, r), size: 12 };
599
603
  }
600
604
  throw d(e2.source, t, `Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`);
601
605
  }
602
- function rt(e2, t) {
603
- return Y(e2.charCodeAt(t)) << 12 | Y(e2.charCodeAt(t + 1)) << 8 | Y(e2.charCodeAt(t + 2)) << 4 | Y(e2.charCodeAt(t + 3));
606
+ function at(e2, t) {
607
+ return V(e2.charCodeAt(t)) << 12 | V(e2.charCodeAt(t + 1)) << 8 | V(e2.charCodeAt(t + 2)) << 4 | V(e2.charCodeAt(t + 3));
604
608
  }
605
- function Y(e2) {
609
+ function V(e2) {
606
610
  return e2 >= 48 && e2 <= 57 ? e2 - 48 : e2 >= 65 && e2 <= 70 ? e2 - 55 : e2 >= 97 && e2 <= 102 ? e2 - 87 : -1;
607
611
  }
608
- function Jt(e2, t) {
612
+ function Qt(e2, t) {
609
613
  let n = e2.source.body;
610
614
  switch (n.charCodeAt(t + 1)) {
611
615
  case 34:
@@ -628,13 +632,13 @@ function Jt(e2, t) {
628
632
  }
629
633
  throw d(e2.source, t, `Invalid character escape sequence: "${n.slice(t, t + 2)}".`);
630
634
  }
631
- function Xt(e2, t) {
635
+ function Wt(e2, t) {
632
636
  let n = e2.source.body, i = n.length, r = e2.lineStart, s = t + 3, a = s, u = "", l = [];
633
637
  for (; s < i; ) {
634
638
  let T = n.charCodeAt(s);
635
639
  if (T === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
636
640
  u += n.slice(a, s), l.push(u);
637
- let h = m(e2, o.BLOCK_STRING, t, s + 3, nt(l).join(`
641
+ let h = m(e2, o.BLOCK_STRING, t, s + 3, ot(l).join(`
638
642
  `));
639
643
  return e2.line += l.length - 1, e2.lineStart = r, h;
640
644
  }
@@ -648,15 +652,15 @@ function Xt(e2, t) {
648
652
  }
649
653
  if (P(T)) ++s;
650
654
  else if (ne(n, s)) s += 2;
651
- else throw d(e2.source, s, `Invalid character within String: ${v(e2, s)}.`);
655
+ else throw d(e2.source, s, `Invalid character within String: ${R(e2, s)}.`);
652
656
  }
653
657
  throw d(e2.source, s, "Unterminated string.");
654
658
  }
655
- function qt(e2, t) {
659
+ function Kt(e2, t) {
656
660
  let n = e2.source.body, i = n.length, r = t + 1;
657
661
  for (; r < i; ) {
658
662
  let s = n.charCodeAt(r);
659
- if (tt(s)) ++r;
663
+ if (st(s)) ++r;
660
664
  else break;
661
665
  }
662
666
  return m(e2, o.NAME, t, r, n.slice(t, r));
@@ -674,36 +678,36 @@ function se(e2, t) {
674
678
  case "function":
675
679
  return e2.name ? `[function ${e2.name}]` : "[function]";
676
680
  case "object":
677
- return Qt(e2, t);
681
+ return zt(e2, t);
678
682
  default:
679
683
  return String(e2);
680
684
  }
681
685
  }
682
- function Qt(e2, t) {
686
+ function zt(e2, t) {
683
687
  if (e2 === null) return "null";
684
688
  if (t.includes(e2)) return "[Circular]";
685
689
  let n = [...t, e2];
686
- if (Ht(e2)) {
690
+ if (Zt(e2)) {
687
691
  let i = e2.toJSON();
688
692
  if (i !== e2) return typeof i == "string" ? i : se(i, n);
689
- } else if (Array.isArray(e2)) return Kt(e2, n);
690
- return Wt(e2, n);
693
+ } else if (Array.isArray(e2)) return tn(e2, n);
694
+ return en(e2, n);
691
695
  }
692
- function Ht(e2) {
696
+ function Zt(e2) {
693
697
  return typeof e2.toJSON == "function";
694
698
  }
695
- function Wt(e2, t) {
699
+ function en(e2, t) {
696
700
  let n = Object.entries(e2);
697
- return n.length === 0 ? "{}" : t.length > 2 ? "[" + zt(e2) + "]" : "{ " + n.map(([r, s]) => r + ": " + se(s, t)).join(", ") + " }";
701
+ return n.length === 0 ? "{}" : t.length > 2 ? "[" + nn(e2) + "]" : "{ " + n.map(([r, s]) => r + ": " + se(s, t)).join(", ") + " }";
698
702
  }
699
- function Kt(e2, t) {
703
+ function tn(e2, t) {
700
704
  if (e2.length === 0) return "[]";
701
705
  if (t.length > 2) return "[Array]";
702
706
  let n = Math.min(10, e2.length), i = e2.length - n, r = [];
703
707
  for (let s = 0; s < n; ++s) r.push(se(e2[s], t));
704
708
  return i === 1 ? r.push("... 1 more item") : i > 1 && r.push(`... ${i} more items`), "[" + r.join(", ") + "]";
705
709
  }
706
- function zt(e2) {
710
+ function nn(e2) {
707
711
  let t = Object.prototype.toString.call(e2).replace(/^\[object /, "").replace(/]$/, "");
708
712
  if (t === "Object" && typeof e2.constructor == "function") {
709
713
  let n = e2.constructor.name;
@@ -711,7 +715,7 @@ function zt(e2) {
711
715
  }
712
716
  return t;
713
717
  }
714
- var Zt = globalThis.process && true, at = Zt ? function(t, n) {
718
+ var rn = globalThis.process && true, pt = rn ? function(t, n) {
715
719
  return t instanceof n;
716
720
  } : function(t, n) {
717
721
  if (t instanceof n) return true;
@@ -736,7 +740,7 @@ spurious results.`);
736
740
  }
737
741
  return false;
738
742
  };
739
- var M = class {
743
+ var Y = class {
740
744
  constructor(t, n = "GraphQL request", i = { line: 1, column: 1 }) {
741
745
  typeof t == "string" || re(false, `Body must be a string. Received: ${ie(t)}.`), this.body = t, this.name = n, this.locationOffset = i, this.locationOffset.line > 0 || re(false, "line in locationOffset is 1-indexed and must be positive."), this.locationOffset.column > 0 || re(false, "column in locationOffset is 1-indexed and must be positive.");
742
746
  }
@@ -744,16 +748,16 @@ var M = class {
744
748
  return "Source";
745
749
  }
746
750
  };
747
- function ct(e2) {
748
- return at(e2, M);
751
+ function ft(e2) {
752
+ return pt(e2, Y);
749
753
  }
750
- function ut(e2, t) {
754
+ function ht(e2, t) {
751
755
  let n = new Te(e2, t), i = n.parseDocument();
752
756
  return Object.defineProperty(i, "tokenCount", { enumerable: false, value: n.tokenCount }), i;
753
757
  }
754
758
  var Te = class {
755
759
  constructor(t, n = {}) {
756
- let i = ct(t) ? t : new M(t);
760
+ let i = ft(t) ? t : new Y(t);
757
761
  this._lexer = new te(i), this._options = n, this._tokenCounter = 0;
758
762
  }
759
763
  get tokenCount() {
@@ -804,7 +808,7 @@ var Te = class {
804
808
  }
805
809
  parseOperationDefinition() {
806
810
  let t = this._lexer.token;
807
- if (this.peek(o.BRACE_L)) return this.node(t, { kind: c.OPERATION_DEFINITION, operation: S.QUERY, name: void 0, variableDefinitions: [], directives: [], selectionSet: this.parseSelectionSet() });
811
+ if (this.peek(o.BRACE_L)) return this.node(t, { kind: c.OPERATION_DEFINITION, operation: C.QUERY, name: void 0, variableDefinitions: [], directives: [], selectionSet: this.parseSelectionSet() });
808
812
  let n = this.parseOperationType(), i;
809
813
  return this.peek(o.NAME) && (i = this.parseName()), this.node(t, { kind: c.OPERATION_DEFINITION, operation: n, name: i, variableDefinitions: this.parseVariableDefinitions(), directives: this.parseDirectives(false), selectionSet: this.parseSelectionSet() });
810
814
  }
@@ -812,11 +816,11 @@ var Te = class {
812
816
  let t = this.expectToken(o.NAME);
813
817
  switch (t.value) {
814
818
  case "query":
815
- return S.QUERY;
819
+ return C.QUERY;
816
820
  case "mutation":
817
- return S.MUTATION;
821
+ return C.MUTATION;
818
822
  case "subscription":
819
- return S.SUBSCRIPTION;
823
+ return C.SUBSCRIPTION;
820
824
  }
821
825
  throw this.unexpected(t);
822
826
  }
@@ -1122,7 +1126,7 @@ var Te = class {
1122
1126
  throw this.unexpected(t);
1123
1127
  }
1124
1128
  node(t, n) {
1125
- return this._options.noLocation !== true && (n.loc = new H(t, this._lexer.lastToken, this._lexer.source)), n;
1129
+ return this._options.noLocation !== true && (n.loc = new Q(t, this._lexer.lastToken, this._lexer.source)), n;
1126
1130
  }
1127
1131
  peek(t) {
1128
1132
  return this._lexer.token.kind === t;
@@ -1130,7 +1134,7 @@ var Te = class {
1130
1134
  expectToken(t) {
1131
1135
  let n = this._lexer.token;
1132
1136
  if (n.kind === t) return this.advanceLexer(), n;
1133
- throw d(this._lexer.source, n.start, `Expected ${lt(t)}, found ${oe(n)}.`);
1137
+ throw d(this._lexer.source, n.start, `Expected ${dt(t)}, found ${oe(n)}.`);
1134
1138
  }
1135
1139
  expectOptionalToken(t) {
1136
1140
  return this._lexer.token.kind === t ? (this.advanceLexer(), true) : false;
@@ -1187,40 +1191,40 @@ var Te = class {
1187
1191
  };
1188
1192
  function oe(e2) {
1189
1193
  let t = e2.value;
1190
- return lt(e2.kind) + (t != null ? ` "${t}"` : "");
1194
+ return dt(e2.kind) + (t != null ? ` "${t}"` : "");
1191
1195
  }
1192
- function lt(e2) {
1193
- return it(e2) ? `"${e2}"` : e2;
1196
+ function dt(e2) {
1197
+ return ct(e2) ? `"${e2}"` : e2;
1194
1198
  }
1195
- function en(e2, t) {
1199
+ function sn(e2, t) {
1196
1200
  let n = new SyntaxError(e2 + " (" + t.loc.start.line + ":" + t.loc.start.column + ")");
1197
1201
  return Object.assign(n, t);
1198
1202
  }
1199
- var pt = en;
1200
- function tn(e2) {
1203
+ var mt = sn;
1204
+ function on(e2) {
1201
1205
  let t = [], { startToken: n, endToken: i } = e2.loc;
1202
1206
  for (let r = n; r !== i; r = r.next) r.kind === "Comment" && t.push({ ...r, loc: { start: r.start, end: r.end } });
1203
1207
  return t;
1204
1208
  }
1205
- var nn = { allowLegacyFragmentVariables: true };
1206
- function rn(e2) {
1209
+ var an = { allowLegacyFragmentVariables: true };
1210
+ function cn(e2) {
1207
1211
  if ((e2 == null ? void 0 : e2.name) === "GraphQLError") {
1208
1212
  let { message: t, locations: [n] } = e2;
1209
- return pt(t, { loc: { start: n }, cause: e2 });
1213
+ return mt(t, { loc: { start: n }, cause: e2 });
1210
1214
  }
1211
1215
  return e2;
1212
1216
  }
1213
- function sn(e2) {
1217
+ function un(e2) {
1214
1218
  let t;
1215
1219
  try {
1216
- t = ut(e2, nn);
1220
+ t = ht(e2, an);
1217
1221
  } catch (n) {
1218
- throw rn(n);
1222
+ throw cn(n);
1219
1223
  }
1220
- return t.comments = tn(t), t;
1224
+ return t.comments = on(t), t;
1221
1225
  }
1222
- var on = { parse: sn, astFormat: "graphql", hasPragma: Ye, locStart: K, locEnd: z };
1223
- var an = { graphql: $e };
1224
- var Si = _e;
1226
+ var ln = { parse: un, astFormat: "graphql", hasPragma: je, hasIgnorePragma: $e, locStart: K, locEnd: z };
1227
+ var pn = { graphql: qe };
1228
+ var Ui = Ne;
1225
1229
 
1226
- export { Si as default, Je as languages, qe as options, Ne as parsers, an as printers };
1230
+ export { Ui as default, Qe as languages, Ke as options, _e as parsers, pn as printers };