@launchdarkly/o11y 0.0.0-stage → 1.2.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.
@@ -0,0 +1,4587 @@
1
+ var tn = Object.defineProperty, nn = Object.defineProperties;
2
+ var rn = Object.getOwnPropertyDescriptors;
3
+ var ce = Object.getOwnPropertySymbols;
4
+ var rt = Object.prototype.hasOwnProperty, it = Object.prototype.propertyIsEnumerable;
5
+ var Oe = (e, t) => (t = Symbol[e]) ? t : Symbol.for("Symbol." + e), sn = (e) => {
6
+ throw TypeError(e);
7
+ };
8
+ var De = (e, t, n) => t in e ? tn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, _ = (e, t) => {
9
+ for (var n in t || (t = {}))
10
+ rt.call(t, n) && De(e, n, t[n]);
11
+ if (ce)
12
+ for (var n of ce(t))
13
+ it.call(t, n) && De(e, n, t[n]);
14
+ return e;
15
+ }, q = (e, t) => nn(e, rn(t));
16
+ var H = (e, t) => {
17
+ var n = {};
18
+ for (var r in e)
19
+ rt.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
20
+ if (e != null && ce)
21
+ for (var r of ce(e))
22
+ t.indexOf(r) < 0 && it.call(e, r) && (n[r] = e[r]);
23
+ return n;
24
+ };
25
+ var G = (e, t, n) => De(e, typeof t != "symbol" ? t + "" : t, n);
26
+ var U = (e, t, n) => new Promise((r, i) => {
27
+ var s = (c) => {
28
+ try {
29
+ a(n.next(c));
30
+ } catch (f) {
31
+ i(f);
32
+ }
33
+ }, o = (c) => {
34
+ try {
35
+ a(n.throw(c));
36
+ } catch (f) {
37
+ i(f);
38
+ }
39
+ }, a = (c) => c.done ? r(c.value) : Promise.resolve(c.value).then(s, o);
40
+ a((n = n.apply(e, t)).next());
41
+ }), on = function(e, t) {
42
+ this[0] = e, this[1] = t;
43
+ };
44
+ var we = (e) => {
45
+ var t = e[Oe("asyncIterator")], n = !1, r, i = {};
46
+ return t == null ? (t = e[Oe("iterator")](), r = (s) => i[s] = (o) => t[s](o)) : (t = t.call(e), r = (s) => i[s] = (o) => {
47
+ if (n) {
48
+ if (n = !1, s === "throw") throw o;
49
+ return o;
50
+ }
51
+ return n = !0, {
52
+ done: !1,
53
+ value: new on(new Promise((a) => {
54
+ var c = t[s](o);
55
+ c instanceof Object || sn("Object expected"), a(c);
56
+ }), 1)
57
+ };
58
+ }), i[Oe("iterator")] = () => i, r("next"), "throw" in t ? r("throw") : i.throw = (s) => {
59
+ throw s;
60
+ }, "return" in t && r("return"), i;
61
+ };
62
+ import { a as K, B as an, i as st } from "./buffer-DIFxvF2Q.js";
63
+ function de(e, t) {
64
+ if (!!!e)
65
+ throw new Error(t);
66
+ }
67
+ function cn(e) {
68
+ return typeof e == "object" && e !== null;
69
+ }
70
+ function un(e, t) {
71
+ if (!!!e)
72
+ throw new Error(
73
+ "Unexpected invariant triggered."
74
+ );
75
+ }
76
+ const ln = /\r\n|[\n\r]/g;
77
+ function Ue(e, t) {
78
+ let n = 0, r = 1;
79
+ for (const i of e.body.matchAll(ln)) {
80
+ if (typeof i.index == "number" || un(!1), i.index >= t)
81
+ break;
82
+ n = i.index + i[0].length, r += 1;
83
+ }
84
+ return {
85
+ line: r,
86
+ column: t + 1 - n
87
+ };
88
+ }
89
+ function fn(e) {
90
+ return At(
91
+ e.source,
92
+ Ue(e.source, e.start)
93
+ );
94
+ }
95
+ function At(e, t) {
96
+ const n = e.locationOffset.column - 1, r = "".padStart(n) + e.body, i = t.line - 1, s = e.locationOffset.line - 1, o = t.line + s, a = t.line === 1 ? n : 0, c = t.column + a, f = `${e.name}:${o}:${c}
97
+ `, h = r.split(/\r\n|[\n\r]/g), m = h[i];
98
+ if (m.length > 120) {
99
+ const E = Math.floor(c / 80), S = c % 80, y = [];
100
+ for (let N = 0; N < m.length; N += 80)
101
+ y.push(m.slice(N, N + 80));
102
+ return f + ot([
103
+ [`${o} |`, y[0]],
104
+ ...y.slice(1, E + 1).map((N) => ["|", N]),
105
+ ["|", "^".padStart(S)],
106
+ ["|", y[E + 1]]
107
+ ]);
108
+ }
109
+ return f + ot([
110
+ // Lines specified like this: ["prefix", "string"],
111
+ [`${o - 1} |`, h[i - 1]],
112
+ [`${o} |`, m],
113
+ ["|", "^".padStart(c)],
114
+ [`${o + 1} |`, h[i + 1]]
115
+ ]);
116
+ }
117
+ function ot(e) {
118
+ const t = e.filter(([r, i]) => i !== void 0), n = Math.max(...t.map(([r]) => r.length));
119
+ return t.map(([r, i]) => r.padStart(n) + (i ? " " + i : "")).join(`
120
+ `);
121
+ }
122
+ function hn(e) {
123
+ const t = e[0];
124
+ return t == null || "kind" in t || "length" in t ? {
125
+ nodes: t,
126
+ source: e[1],
127
+ positions: e[2],
128
+ path: e[3],
129
+ originalError: e[4],
130
+ extensions: e[5]
131
+ } : t;
132
+ }
133
+ class Qe extends Error {
134
+ /**
135
+ * An array of `{ line, column }` locations within the source GraphQL document
136
+ * which correspond to this error.
137
+ *
138
+ * Errors during validation often contain multiple locations, for example to
139
+ * point out two things with the same name. Errors during execution include a
140
+ * single location, the field which produced the error.
141
+ *
142
+ * Enumerable, and appears in the result of JSON.stringify().
143
+ */
144
+ /**
145
+ * An array describing the JSON-path into the execution response which
146
+ * corresponds to this error. Only included for errors during execution.
147
+ *
148
+ * Enumerable, and appears in the result of JSON.stringify().
149
+ */
150
+ /**
151
+ * An array of GraphQL AST Nodes corresponding to this error.
152
+ */
153
+ /**
154
+ * The source GraphQL document for the first location of this error.
155
+ *
156
+ * Note that if this Error represents more than one node, the source may not
157
+ * represent nodes after the first node.
158
+ */
159
+ /**
160
+ * An array of character offsets within the source GraphQL document
161
+ * which correspond to this error.
162
+ */
163
+ /**
164
+ * The original error thrown from a field resolver during execution.
165
+ */
166
+ /**
167
+ * Extension fields to add to the formatted error.
168
+ */
169
+ /**
170
+ * @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
171
+ */
172
+ constructor(t, ...n) {
173
+ var r, i, s;
174
+ const { nodes: o, source: a, positions: c, path: f, originalError: h, extensions: m } = hn(n);
175
+ super(t), this.name = "GraphQLError", this.path = f != null ? f : void 0, this.originalError = h != null ? h : void 0, this.nodes = at(
176
+ Array.isArray(o) ? o : o ? [o] : void 0
177
+ );
178
+ const E = at(
179
+ (r = this.nodes) === null || r === void 0 ? void 0 : r.map((y) => y.loc).filter((y) => y != null)
180
+ );
181
+ this.source = a != null ? a : E == null || (i = E[0]) === null || i === void 0 ? void 0 : i.source, this.positions = c != null ? c : E == null ? void 0 : E.map((y) => y.start), this.locations = c && a ? c.map((y) => Ue(a, y)) : E == null ? void 0 : E.map((y) => Ue(y.source, y.start));
182
+ const S = cn(
183
+ h == null ? void 0 : h.extensions
184
+ ) ? h == null ? void 0 : h.extensions : void 0;
185
+ this.extensions = (s = m != null ? m : S) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
186
+ message: {
187
+ writable: !0,
188
+ enumerable: !0
189
+ },
190
+ name: {
191
+ enumerable: !1
192
+ },
193
+ nodes: {
194
+ enumerable: !1
195
+ },
196
+ source: {
197
+ enumerable: !1
198
+ },
199
+ positions: {
200
+ enumerable: !1
201
+ },
202
+ originalError: {
203
+ enumerable: !1
204
+ }
205
+ }), h != null && h.stack ? Object.defineProperty(this, "stack", {
206
+ value: h.stack,
207
+ writable: !0,
208
+ configurable: !0
209
+ }) : Error.captureStackTrace ? Error.captureStackTrace(this, Qe) : Object.defineProperty(this, "stack", {
210
+ value: Error().stack,
211
+ writable: !0,
212
+ configurable: !0
213
+ });
214
+ }
215
+ get [Symbol.toStringTag]() {
216
+ return "GraphQLError";
217
+ }
218
+ toString() {
219
+ let t = this.message;
220
+ if (this.nodes)
221
+ for (const n of this.nodes)
222
+ n.loc && (t += `
223
+
224
+ ` + fn(n.loc));
225
+ else if (this.source && this.locations)
226
+ for (const n of this.locations)
227
+ t += `
228
+
229
+ ` + At(this.source, n);
230
+ return t;
231
+ }
232
+ toJSON() {
233
+ const t = {
234
+ message: this.message
235
+ };
236
+ 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;
237
+ }
238
+ }
239
+ function at(e) {
240
+ return e === void 0 || e.length === 0 ? void 0 : e;
241
+ }
242
+ function O(e, t, n) {
243
+ return new Qe(`Syntax Error: ${n}`, {
244
+ source: e,
245
+ positions: [t]
246
+ });
247
+ }
248
+ class dn {
249
+ /**
250
+ * The character offset at which this Node begins.
251
+ */
252
+ /**
253
+ * The character offset at which this Node ends.
254
+ */
255
+ /**
256
+ * The Token at which this Node begins.
257
+ */
258
+ /**
259
+ * The Token at which this Node ends.
260
+ */
261
+ /**
262
+ * The Source document the AST represents.
263
+ */
264
+ constructor(t, n, r) {
265
+ this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source = r;
266
+ }
267
+ get [Symbol.toStringTag]() {
268
+ return "Location";
269
+ }
270
+ toJSON() {
271
+ return {
272
+ start: this.start,
273
+ end: this.end
274
+ };
275
+ }
276
+ }
277
+ class Nt {
278
+ /**
279
+ * The kind of Token.
280
+ */
281
+ /**
282
+ * The character offset at which this Node begins.
283
+ */
284
+ /**
285
+ * The character offset at which this Node ends.
286
+ */
287
+ /**
288
+ * The 1-indexed line number on which this Token appears.
289
+ */
290
+ /**
291
+ * The 1-indexed column number at which this Token begins.
292
+ */
293
+ /**
294
+ * For non-punctuation tokens, represents the interpreted value of the token.
295
+ *
296
+ * Note: is undefined for punctuation tokens, but typed as string for
297
+ * convenience in the parser.
298
+ */
299
+ /**
300
+ * Tokens exist as nodes in a double-linked-list amongst all tokens
301
+ * including ignored tokens. <SOF> is always the first node and <EOF>
302
+ * the last.
303
+ */
304
+ constructor(t, n, r, i, s, o) {
305
+ this.kind = t, this.start = n, this.end = r, this.line = i, this.column = s, this.value = o, this.prev = null, this.next = null;
306
+ }
307
+ get [Symbol.toStringTag]() {
308
+ return "Token";
309
+ }
310
+ toJSON() {
311
+ return {
312
+ kind: this.kind,
313
+ value: this.value,
314
+ line: this.line,
315
+ column: this.column
316
+ };
317
+ }
318
+ }
319
+ const It = {
320
+ Name: [],
321
+ Document: ["definitions"],
322
+ OperationDefinition: [
323
+ "name",
324
+ "variableDefinitions",
325
+ "directives",
326
+ "selectionSet"
327
+ ],
328
+ VariableDefinition: ["variable", "type", "defaultValue", "directives"],
329
+ Variable: ["name"],
330
+ SelectionSet: ["selections"],
331
+ Field: ["alias", "name", "arguments", "directives", "selectionSet"],
332
+ Argument: ["name", "value"],
333
+ FragmentSpread: ["name", "directives"],
334
+ InlineFragment: ["typeCondition", "directives", "selectionSet"],
335
+ FragmentDefinition: [
336
+ "name",
337
+ // Note: fragment variable definitions are deprecated and will removed in v17.0.0
338
+ "variableDefinitions",
339
+ "typeCondition",
340
+ "directives",
341
+ "selectionSet"
342
+ ],
343
+ IntValue: [],
344
+ FloatValue: [],
345
+ StringValue: [],
346
+ BooleanValue: [],
347
+ NullValue: [],
348
+ EnumValue: [],
349
+ ListValue: ["values"],
350
+ ObjectValue: ["fields"],
351
+ ObjectField: ["name", "value"],
352
+ Directive: ["name", "arguments"],
353
+ NamedType: ["name"],
354
+ ListType: ["type"],
355
+ NonNullType: ["type"],
356
+ SchemaDefinition: ["description", "directives", "operationTypes"],
357
+ OperationTypeDefinition: ["type"],
358
+ ScalarTypeDefinition: ["description", "name", "directives"],
359
+ ObjectTypeDefinition: [
360
+ "description",
361
+ "name",
362
+ "interfaces",
363
+ "directives",
364
+ "fields"
365
+ ],
366
+ FieldDefinition: ["description", "name", "arguments", "type", "directives"],
367
+ InputValueDefinition: [
368
+ "description",
369
+ "name",
370
+ "type",
371
+ "defaultValue",
372
+ "directives"
373
+ ],
374
+ InterfaceTypeDefinition: [
375
+ "description",
376
+ "name",
377
+ "interfaces",
378
+ "directives",
379
+ "fields"
380
+ ],
381
+ UnionTypeDefinition: ["description", "name", "directives", "types"],
382
+ EnumTypeDefinition: ["description", "name", "directives", "values"],
383
+ EnumValueDefinition: ["description", "name", "directives"],
384
+ InputObjectTypeDefinition: ["description", "name", "directives", "fields"],
385
+ DirectiveDefinition: ["description", "name", "arguments", "locations"],
386
+ SchemaExtension: ["directives", "operationTypes"],
387
+ ScalarTypeExtension: ["name", "directives"],
388
+ ObjectTypeExtension: ["name", "interfaces", "directives", "fields"],
389
+ InterfaceTypeExtension: ["name", "interfaces", "directives", "fields"],
390
+ UnionTypeExtension: ["name", "directives", "types"],
391
+ EnumTypeExtension: ["name", "directives", "values"],
392
+ InputObjectTypeExtension: ["name", "directives", "fields"]
393
+ }, pn = new Set(Object.keys(It));
394
+ function ct(e) {
395
+ const t = e == null ? void 0 : e.kind;
396
+ return typeof t == "string" && pn.has(t);
397
+ }
398
+ var J;
399
+ (function(e) {
400
+ e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
401
+ })(J || (J = {}));
402
+ var Be;
403
+ (function(e) {
404
+ 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";
405
+ })(Be || (Be = {}));
406
+ var g;
407
+ (function(e) {
408
+ 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";
409
+ })(g || (g = {}));
410
+ function Ve(e) {
411
+ return e === 9 || e === 32;
412
+ }
413
+ function ie(e) {
414
+ return e >= 48 && e <= 57;
415
+ }
416
+ function bt(e) {
417
+ return e >= 97 && e <= 122 || // A-Z
418
+ e >= 65 && e <= 90;
419
+ }
420
+ function xt(e) {
421
+ return bt(e) || e === 95;
422
+ }
423
+ function mn(e) {
424
+ return bt(e) || ie(e) || e === 95;
425
+ }
426
+ function gn(e) {
427
+ var t;
428
+ let n = Number.MAX_SAFE_INTEGER, r = null, i = -1;
429
+ for (let o = 0; o < e.length; ++o) {
430
+ var s;
431
+ const a = e[o], c = yn(a);
432
+ c !== a.length && (r = (s = r) !== null && s !== void 0 ? s : o, i = o, o !== 0 && c < n && (n = c));
433
+ }
434
+ return e.map((o, a) => a === 0 ? o : o.slice(n)).slice(
435
+ (t = r) !== null && t !== void 0 ? t : 0,
436
+ i + 1
437
+ );
438
+ }
439
+ function yn(e) {
440
+ let t = 0;
441
+ for (; t < e.length && Ve(e.charCodeAt(t)); )
442
+ ++t;
443
+ return t;
444
+ }
445
+ function En(e, t) {
446
+ const n = e.replace(/"""/g, '\\"""'), r = n.split(/\r\n|[\n\r]/g), i = r.length === 1, s = r.length > 1 && r.slice(1).every((S) => S.length === 0 || Ve(S.charCodeAt(0))), o = n.endsWith('\\"""'), a = e.endsWith('"') && !o, c = e.endsWith("\\"), f = a || c, h = (
447
+ // add leading and trailing new lines only if it improves readability
448
+ !i || e.length > 70 || f || s || o
449
+ );
450
+ let m = "";
451
+ const E = i && Ve(e.charCodeAt(0));
452
+ return (h && !E || s) && (m += `
453
+ `), m += n, (h || f) && (m += `
454
+ `), '"""' + m + '"""';
455
+ }
456
+ var l;
457
+ (function(e) {
458
+ 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";
459
+ })(l || (l = {}));
460
+ class _n {
461
+ /**
462
+ * The previously focused non-ignored token.
463
+ */
464
+ /**
465
+ * The currently focused non-ignored token.
466
+ */
467
+ /**
468
+ * The (1-indexed) line containing the current token.
469
+ */
470
+ /**
471
+ * The character offset at which the current line begins.
472
+ */
473
+ constructor(t) {
474
+ const n = new Nt(l.SOF, 0, 0, 0, 0);
475
+ this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
476
+ }
477
+ get [Symbol.toStringTag]() {
478
+ return "Lexer";
479
+ }
480
+ /**
481
+ * Advances the token stream to the next non-ignored token.
482
+ */
483
+ advance() {
484
+ return this.lastToken = this.token, this.token = this.lookahead();
485
+ }
486
+ /**
487
+ * Looks ahead and returns the next non-ignored token, but does not change
488
+ * the state of Lexer.
489
+ */
490
+ lookahead() {
491
+ let t = this.token;
492
+ if (t.kind !== l.EOF)
493
+ do
494
+ if (t.next)
495
+ t = t.next;
496
+ else {
497
+ const n = vn(this, t.end);
498
+ t.next = n, n.prev = t, t = n;
499
+ }
500
+ while (t.kind === l.COMMENT);
501
+ return t;
502
+ }
503
+ }
504
+ function Tn(e) {
505
+ return e === l.BANG || e === l.DOLLAR || e === l.AMP || e === l.PAREN_L || e === l.PAREN_R || e === l.SPREAD || e === l.COLON || e === l.EQUALS || e === l.AT || e === l.BRACKET_L || e === l.BRACKET_R || e === l.BRACE_L || e === l.PIPE || e === l.BRACE_R;
506
+ }
507
+ function Z(e) {
508
+ return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
509
+ }
510
+ function ve(e, t) {
511
+ return Ot(e.charCodeAt(t)) && Dt(e.charCodeAt(t + 1));
512
+ }
513
+ function Ot(e) {
514
+ return e >= 55296 && e <= 56319;
515
+ }
516
+ function Dt(e) {
517
+ return e >= 56320 && e <= 57343;
518
+ }
519
+ function B(e, t) {
520
+ const n = e.source.body.codePointAt(t);
521
+ if (n === void 0)
522
+ return l.EOF;
523
+ if (n >= 32 && n <= 126) {
524
+ const r = String.fromCodePoint(n);
525
+ return r === '"' ? `'"'` : `"${r}"`;
526
+ }
527
+ return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
528
+ }
529
+ function I(e, t, n, r, i) {
530
+ const s = e.line, o = 1 + n - e.lineStart;
531
+ return new Nt(t, n, r, s, o, i);
532
+ }
533
+ function vn(e, t) {
534
+ const n = e.source.body, r = n.length;
535
+ let i = t;
536
+ for (; i < r; ) {
537
+ const s = n.charCodeAt(i);
538
+ switch (s) {
539
+ // Ignored ::
540
+ // - UnicodeBOM
541
+ // - WhiteSpace
542
+ // - LineTerminator
543
+ // - Comment
544
+ // - Comma
545
+ //
546
+ // UnicodeBOM :: "Byte Order Mark (U+FEFF)"
547
+ //
548
+ // WhiteSpace ::
549
+ // - "Horizontal Tab (U+0009)"
550
+ // - "Space (U+0020)"
551
+ //
552
+ // Comma :: ,
553
+ case 65279:
554
+ // <BOM>
555
+ case 9:
556
+ // \t
557
+ case 32:
558
+ // <space>
559
+ case 44:
560
+ ++i;
561
+ continue;
562
+ // LineTerminator ::
563
+ // - "New Line (U+000A)"
564
+ // - "Carriage Return (U+000D)" [lookahead != "New Line (U+000A)"]
565
+ // - "Carriage Return (U+000D)" "New Line (U+000A)"
566
+ case 10:
567
+ ++i, ++e.line, e.lineStart = i;
568
+ continue;
569
+ case 13:
570
+ n.charCodeAt(i + 1) === 10 ? i += 2 : ++i, ++e.line, e.lineStart = i;
571
+ continue;
572
+ // Comment
573
+ case 35:
574
+ return Sn(e, i);
575
+ // Token ::
576
+ // - Punctuator
577
+ // - Name
578
+ // - IntValue
579
+ // - FloatValue
580
+ // - StringValue
581
+ //
582
+ // Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
583
+ case 33:
584
+ return I(e, l.BANG, i, i + 1);
585
+ case 36:
586
+ return I(e, l.DOLLAR, i, i + 1);
587
+ case 38:
588
+ return I(e, l.AMP, i, i + 1);
589
+ case 40:
590
+ return I(e, l.PAREN_L, i, i + 1);
591
+ case 41:
592
+ return I(e, l.PAREN_R, i, i + 1);
593
+ case 46:
594
+ if (n.charCodeAt(i + 1) === 46 && n.charCodeAt(i + 2) === 46)
595
+ return I(e, l.SPREAD, i, i + 3);
596
+ break;
597
+ case 58:
598
+ return I(e, l.COLON, i, i + 1);
599
+ case 61:
600
+ return I(e, l.EQUALS, i, i + 1);
601
+ case 64:
602
+ return I(e, l.AT, i, i + 1);
603
+ case 91:
604
+ return I(e, l.BRACKET_L, i, i + 1);
605
+ case 93:
606
+ return I(e, l.BRACKET_R, i, i + 1);
607
+ case 123:
608
+ return I(e, l.BRACE_L, i, i + 1);
609
+ case 124:
610
+ return I(e, l.PIPE, i, i + 1);
611
+ case 125:
612
+ return I(e, l.BRACE_R, i, i + 1);
613
+ // StringValue
614
+ case 34:
615
+ return n.charCodeAt(i + 1) === 34 && n.charCodeAt(i + 2) === 34 ? On(e, i) : Nn(e, i);
616
+ }
617
+ if (ie(s) || s === 45)
618
+ return An(e, i, s);
619
+ if (xt(s))
620
+ return Dn(e, i);
621
+ throw O(
622
+ e.source,
623
+ i,
624
+ s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : Z(s) || ve(n, i) ? `Unexpected character: ${B(e, i)}.` : `Invalid character: ${B(e, i)}.`
625
+ );
626
+ }
627
+ return I(e, l.EOF, r, r);
628
+ }
629
+ function Sn(e, t) {
630
+ const n = e.source.body, r = n.length;
631
+ let i = t + 1;
632
+ for (; i < r; ) {
633
+ const s = n.charCodeAt(i);
634
+ if (s === 10 || s === 13)
635
+ break;
636
+ if (Z(s))
637
+ ++i;
638
+ else if (ve(n, i))
639
+ i += 2;
640
+ else
641
+ break;
642
+ }
643
+ return I(
644
+ e,
645
+ l.COMMENT,
646
+ t,
647
+ i,
648
+ n.slice(t + 1, i)
649
+ );
650
+ }
651
+ function An(e, t, n) {
652
+ const r = e.source.body;
653
+ let i = t, s = n, o = !1;
654
+ if (s === 45 && (s = r.charCodeAt(++i)), s === 48) {
655
+ if (s = r.charCodeAt(++i), ie(s))
656
+ throw O(
657
+ e.source,
658
+ i,
659
+ `Invalid number, unexpected digit after 0: ${B(
660
+ e,
661
+ i
662
+ )}.`
663
+ );
664
+ } else
665
+ i = Ce(e, i, s), s = r.charCodeAt(i);
666
+ if (s === 46 && (o = !0, s = r.charCodeAt(++i), i = Ce(e, i, s), s = r.charCodeAt(i)), (s === 69 || s === 101) && (o = !0, s = r.charCodeAt(++i), (s === 43 || s === 45) && (s = r.charCodeAt(++i)), i = Ce(e, i, s), s = r.charCodeAt(i)), s === 46 || xt(s))
667
+ throw O(
668
+ e.source,
669
+ i,
670
+ `Invalid number, expected digit but got: ${B(
671
+ e,
672
+ i
673
+ )}.`
674
+ );
675
+ return I(
676
+ e,
677
+ o ? l.FLOAT : l.INT,
678
+ t,
679
+ i,
680
+ r.slice(t, i)
681
+ );
682
+ }
683
+ function Ce(e, t, n) {
684
+ if (!ie(n))
685
+ throw O(
686
+ e.source,
687
+ t,
688
+ `Invalid number, expected digit but got: ${B(
689
+ e,
690
+ t
691
+ )}.`
692
+ );
693
+ const r = e.source.body;
694
+ let i = t + 1;
695
+ for (; ie(r.charCodeAt(i)); )
696
+ ++i;
697
+ return i;
698
+ }
699
+ function Nn(e, t) {
700
+ const n = e.source.body, r = n.length;
701
+ let i = t + 1, s = i, o = "";
702
+ for (; i < r; ) {
703
+ const a = n.charCodeAt(i);
704
+ if (a === 34)
705
+ return o += n.slice(s, i), I(e, l.STRING, t, i + 1, o);
706
+ if (a === 92) {
707
+ o += n.slice(s, i);
708
+ const c = n.charCodeAt(i + 1) === 117 ? n.charCodeAt(i + 2) === 123 ? In(e, i) : bn(e, i) : xn(e, i);
709
+ o += c.value, i += c.size, s = i;
710
+ continue;
711
+ }
712
+ if (a === 10 || a === 13)
713
+ break;
714
+ if (Z(a))
715
+ ++i;
716
+ else if (ve(n, i))
717
+ i += 2;
718
+ else
719
+ throw O(
720
+ e.source,
721
+ i,
722
+ `Invalid character within String: ${B(
723
+ e,
724
+ i
725
+ )}.`
726
+ );
727
+ }
728
+ throw O(e.source, i, "Unterminated string.");
729
+ }
730
+ function In(e, t) {
731
+ const n = e.source.body;
732
+ let r = 0, i = 3;
733
+ for (; i < 12; ) {
734
+ const s = n.charCodeAt(t + i++);
735
+ if (s === 125) {
736
+ if (i < 5 || !Z(r))
737
+ break;
738
+ return {
739
+ value: String.fromCodePoint(r),
740
+ size: i
741
+ };
742
+ }
743
+ if (r = r << 4 | re(s), r < 0)
744
+ break;
745
+ }
746
+ throw O(
747
+ e.source,
748
+ t,
749
+ `Invalid Unicode escape sequence: "${n.slice(
750
+ t,
751
+ t + i
752
+ )}".`
753
+ );
754
+ }
755
+ function bn(e, t) {
756
+ const n = e.source.body, r = ut(n, t + 2);
757
+ if (Z(r))
758
+ return {
759
+ value: String.fromCodePoint(r),
760
+ size: 6
761
+ };
762
+ if (Ot(r) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
763
+ const i = ut(n, t + 8);
764
+ if (Dt(i))
765
+ return {
766
+ value: String.fromCodePoint(r, i),
767
+ size: 12
768
+ };
769
+ }
770
+ throw O(
771
+ e.source,
772
+ t,
773
+ `Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`
774
+ );
775
+ }
776
+ function ut(e, t) {
777
+ return re(e.charCodeAt(t)) << 12 | re(e.charCodeAt(t + 1)) << 8 | re(e.charCodeAt(t + 2)) << 4 | re(e.charCodeAt(t + 3));
778
+ }
779
+ function re(e) {
780
+ return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
781
+ }
782
+ function xn(e, t) {
783
+ const n = e.source.body;
784
+ switch (n.charCodeAt(t + 1)) {
785
+ case 34:
786
+ return {
787
+ value: '"',
788
+ size: 2
789
+ };
790
+ case 92:
791
+ return {
792
+ value: "\\",
793
+ size: 2
794
+ };
795
+ case 47:
796
+ return {
797
+ value: "/",
798
+ size: 2
799
+ };
800
+ case 98:
801
+ return {
802
+ value: "\b",
803
+ size: 2
804
+ };
805
+ case 102:
806
+ return {
807
+ value: "\f",
808
+ size: 2
809
+ };
810
+ case 110:
811
+ return {
812
+ value: `
813
+ `,
814
+ size: 2
815
+ };
816
+ case 114:
817
+ return {
818
+ value: "\r",
819
+ size: 2
820
+ };
821
+ case 116:
822
+ return {
823
+ value: " ",
824
+ size: 2
825
+ };
826
+ }
827
+ throw O(
828
+ e.source,
829
+ t,
830
+ `Invalid character escape sequence: "${n.slice(
831
+ t,
832
+ t + 2
833
+ )}".`
834
+ );
835
+ }
836
+ function On(e, t) {
837
+ const n = e.source.body, r = n.length;
838
+ let i = e.lineStart, s = t + 3, o = s, a = "";
839
+ const c = [];
840
+ for (; s < r; ) {
841
+ const f = n.charCodeAt(s);
842
+ if (f === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
843
+ a += n.slice(o, s), c.push(a);
844
+ const h = I(
845
+ e,
846
+ l.BLOCK_STRING,
847
+ t,
848
+ s + 3,
849
+ // Return a string of the lines joined with U+000A.
850
+ gn(c).join(`
851
+ `)
852
+ );
853
+ return e.line += c.length - 1, e.lineStart = i, h;
854
+ }
855
+ if (f === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
856
+ a += n.slice(o, s), o = s + 1, s += 4;
857
+ continue;
858
+ }
859
+ if (f === 10 || f === 13) {
860
+ a += n.slice(o, s), c.push(a), f === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, a = "", o = s, i = s;
861
+ continue;
862
+ }
863
+ if (Z(f))
864
+ ++s;
865
+ else if (ve(n, s))
866
+ s += 2;
867
+ else
868
+ throw O(
869
+ e.source,
870
+ s,
871
+ `Invalid character within String: ${B(
872
+ e,
873
+ s
874
+ )}.`
875
+ );
876
+ }
877
+ throw O(e.source, s, "Unterminated string.");
878
+ }
879
+ function Dn(e, t) {
880
+ const n = e.source.body, r = n.length;
881
+ let i = t + 1;
882
+ for (; i < r; ) {
883
+ const s = n.charCodeAt(i);
884
+ if (mn(s))
885
+ ++i;
886
+ else
887
+ break;
888
+ }
889
+ return I(
890
+ e,
891
+ l.NAME,
892
+ t,
893
+ i,
894
+ n.slice(t, i)
895
+ );
896
+ }
897
+ const wn = 10, wt = 2;
898
+ function Ke(e) {
899
+ return Se(e, []);
900
+ }
901
+ function Se(e, t) {
902
+ switch (typeof e) {
903
+ case "string":
904
+ return JSON.stringify(e);
905
+ case "function":
906
+ return e.name ? `[function ${e.name}]` : "[function]";
907
+ case "object":
908
+ return Cn(e, t);
909
+ default:
910
+ return String(e);
911
+ }
912
+ }
913
+ function Cn(e, t) {
914
+ if (e === null)
915
+ return "null";
916
+ if (t.includes(e))
917
+ return "[Circular]";
918
+ const n = [...t, e];
919
+ if (Rn(e)) {
920
+ const r = e.toJSON();
921
+ if (r !== e)
922
+ return typeof r == "string" ? r : Se(r, n);
923
+ } else if (Array.isArray(e))
924
+ return Ln(e, n);
925
+ return kn(e, n);
926
+ }
927
+ function Rn(e) {
928
+ return typeof e.toJSON == "function";
929
+ }
930
+ function kn(e, t) {
931
+ const n = Object.entries(e);
932
+ return n.length === 0 ? "{}" : t.length > wt ? "[" + Pn(e) + "]" : "{ " + n.map(
933
+ ([i, s]) => i + ": " + Se(s, t)
934
+ ).join(", ") + " }";
935
+ }
936
+ function Ln(e, t) {
937
+ if (e.length === 0)
938
+ return "[]";
939
+ if (t.length > wt)
940
+ return "[Array]";
941
+ const n = Math.min(wn, e.length), r = e.length - n, i = [];
942
+ for (let s = 0; s < n; ++s)
943
+ i.push(Se(e[s], t));
944
+ return r === 1 ? i.push("... 1 more item") : r > 1 && i.push(`... ${r} more items`), "[" + i.join(", ") + "]";
945
+ }
946
+ function Pn(e) {
947
+ const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
948
+ if (t === "Object" && typeof e.constructor == "function") {
949
+ const n = e.constructor.name;
950
+ if (typeof n == "string" && n !== "")
951
+ return n;
952
+ }
953
+ return t;
954
+ }
955
+ const Fn = globalThis.process && // eslint-disable-next-line no-undef
956
+ process.env.NODE_ENV === "production", Mn = (
957
+ /* c8 ignore next 6 */
958
+ // FIXME: https://github.com/graphql/graphql-js/issues/2317
959
+ Fn ? function(t, n) {
960
+ return t instanceof n;
961
+ } : function(t, n) {
962
+ if (t instanceof n)
963
+ return !0;
964
+ if (typeof t == "object" && t !== null) {
965
+ var r;
966
+ const i = n.prototype[Symbol.toStringTag], s = (
967
+ // We still need to support constructor's name to detect conflicts with older versions of this library.
968
+ Symbol.toStringTag in t ? t[Symbol.toStringTag] : (r = t.constructor) === null || r === void 0 ? void 0 : r.name
969
+ );
970
+ if (i === s) {
971
+ const o = Ke(t);
972
+ throw new Error(`Cannot use ${i} "${o}" from another module or realm.
973
+
974
+ Ensure that there is only one instance of "graphql" in the node_modules
975
+ directory. If different versions of "graphql" are the dependencies of other
976
+ relied on modules, use "resolutions" to ensure only one version is installed.
977
+
978
+ https://yarnpkg.com/en/docs/selective-version-resolutions
979
+
980
+ Duplicate "graphql" modules cannot be used at the same time since different
981
+ versions may have different capabilities and behavior. The data from one
982
+ version used in the function from another could produce confusing and
983
+ spurious results.`);
984
+ }
985
+ }
986
+ return !1;
987
+ }
988
+ );
989
+ class Ct {
990
+ constructor(t, n = "GraphQL request", r = {
991
+ line: 1,
992
+ column: 1
993
+ }) {
994
+ typeof t == "string" || de(!1, `Body must be a string. Received: ${Ke(t)}.`), this.body = t, this.name = n, this.locationOffset = r, this.locationOffset.line > 0 || de(
995
+ !1,
996
+ "line in locationOffset is 1-indexed and must be positive."
997
+ ), this.locationOffset.column > 0 || de(
998
+ !1,
999
+ "column in locationOffset is 1-indexed and must be positive."
1000
+ );
1001
+ }
1002
+ get [Symbol.toStringTag]() {
1003
+ return "Source";
1004
+ }
1005
+ }
1006
+ function $n(e) {
1007
+ return Mn(e, Ct);
1008
+ }
1009
+ function Rt(e, t) {
1010
+ const n = new Un(e, t), r = n.parseDocument();
1011
+ return Object.defineProperty(r, "tokenCount", {
1012
+ enumerable: !1,
1013
+ value: n.tokenCount
1014
+ }), r;
1015
+ }
1016
+ class Un {
1017
+ constructor(t, n = {}) {
1018
+ const r = $n(t) ? t : new Ct(t);
1019
+ this._lexer = new _n(r), this._options = n, this._tokenCounter = 0;
1020
+ }
1021
+ get tokenCount() {
1022
+ return this._tokenCounter;
1023
+ }
1024
+ /**
1025
+ * Converts a name lex token into a name parse node.
1026
+ */
1027
+ parseName() {
1028
+ const t = this.expectToken(l.NAME);
1029
+ return this.node(t, {
1030
+ kind: g.NAME,
1031
+ value: t.value
1032
+ });
1033
+ }
1034
+ // Implements the parsing rules in the Document section.
1035
+ /**
1036
+ * Document : Definition+
1037
+ */
1038
+ parseDocument() {
1039
+ return this.node(this._lexer.token, {
1040
+ kind: g.DOCUMENT,
1041
+ definitions: this.many(
1042
+ l.SOF,
1043
+ this.parseDefinition,
1044
+ l.EOF
1045
+ )
1046
+ });
1047
+ }
1048
+ /**
1049
+ * Definition :
1050
+ * - ExecutableDefinition
1051
+ * - TypeSystemDefinition
1052
+ * - TypeSystemExtension
1053
+ *
1054
+ * ExecutableDefinition :
1055
+ * - OperationDefinition
1056
+ * - FragmentDefinition
1057
+ *
1058
+ * TypeSystemDefinition :
1059
+ * - SchemaDefinition
1060
+ * - TypeDefinition
1061
+ * - DirectiveDefinition
1062
+ *
1063
+ * TypeDefinition :
1064
+ * - ScalarTypeDefinition
1065
+ * - ObjectTypeDefinition
1066
+ * - InterfaceTypeDefinition
1067
+ * - UnionTypeDefinition
1068
+ * - EnumTypeDefinition
1069
+ * - InputObjectTypeDefinition
1070
+ */
1071
+ parseDefinition() {
1072
+ if (this.peek(l.BRACE_L))
1073
+ return this.parseOperationDefinition();
1074
+ const t = this.peekDescription(), n = t ? this._lexer.lookahead() : this._lexer.token;
1075
+ if (n.kind === l.NAME) {
1076
+ switch (n.value) {
1077
+ case "schema":
1078
+ return this.parseSchemaDefinition();
1079
+ case "scalar":
1080
+ return this.parseScalarTypeDefinition();
1081
+ case "type":
1082
+ return this.parseObjectTypeDefinition();
1083
+ case "interface":
1084
+ return this.parseInterfaceTypeDefinition();
1085
+ case "union":
1086
+ return this.parseUnionTypeDefinition();
1087
+ case "enum":
1088
+ return this.parseEnumTypeDefinition();
1089
+ case "input":
1090
+ return this.parseInputObjectTypeDefinition();
1091
+ case "directive":
1092
+ return this.parseDirectiveDefinition();
1093
+ }
1094
+ if (t)
1095
+ throw O(
1096
+ this._lexer.source,
1097
+ this._lexer.token.start,
1098
+ "Unexpected description, descriptions are supported only on type definitions."
1099
+ );
1100
+ switch (n.value) {
1101
+ case "query":
1102
+ case "mutation":
1103
+ case "subscription":
1104
+ return this.parseOperationDefinition();
1105
+ case "fragment":
1106
+ return this.parseFragmentDefinition();
1107
+ case "extend":
1108
+ return this.parseTypeSystemExtension();
1109
+ }
1110
+ }
1111
+ throw this.unexpected(n);
1112
+ }
1113
+ // Implements the parsing rules in the Operations section.
1114
+ /**
1115
+ * OperationDefinition :
1116
+ * - SelectionSet
1117
+ * - OperationType Name? VariableDefinitions? Directives? SelectionSet
1118
+ */
1119
+ parseOperationDefinition() {
1120
+ const t = this._lexer.token;
1121
+ if (this.peek(l.BRACE_L))
1122
+ return this.node(t, {
1123
+ kind: g.OPERATION_DEFINITION,
1124
+ operation: J.QUERY,
1125
+ name: void 0,
1126
+ variableDefinitions: [],
1127
+ directives: [],
1128
+ selectionSet: this.parseSelectionSet()
1129
+ });
1130
+ const n = this.parseOperationType();
1131
+ let r;
1132
+ return this.peek(l.NAME) && (r = this.parseName()), this.node(t, {
1133
+ kind: g.OPERATION_DEFINITION,
1134
+ operation: n,
1135
+ name: r,
1136
+ variableDefinitions: this.parseVariableDefinitions(),
1137
+ directives: this.parseDirectives(!1),
1138
+ selectionSet: this.parseSelectionSet()
1139
+ });
1140
+ }
1141
+ /**
1142
+ * OperationType : one of query mutation subscription
1143
+ */
1144
+ parseOperationType() {
1145
+ const t = this.expectToken(l.NAME);
1146
+ switch (t.value) {
1147
+ case "query":
1148
+ return J.QUERY;
1149
+ case "mutation":
1150
+ return J.MUTATION;
1151
+ case "subscription":
1152
+ return J.SUBSCRIPTION;
1153
+ }
1154
+ throw this.unexpected(t);
1155
+ }
1156
+ /**
1157
+ * VariableDefinitions : ( VariableDefinition+ )
1158
+ */
1159
+ parseVariableDefinitions() {
1160
+ return this.optionalMany(
1161
+ l.PAREN_L,
1162
+ this.parseVariableDefinition,
1163
+ l.PAREN_R
1164
+ );
1165
+ }
1166
+ /**
1167
+ * VariableDefinition : Variable : Type DefaultValue? Directives[Const]?
1168
+ */
1169
+ parseVariableDefinition() {
1170
+ return this.node(this._lexer.token, {
1171
+ kind: g.VARIABLE_DEFINITION,
1172
+ variable: this.parseVariable(),
1173
+ type: (this.expectToken(l.COLON), this.parseTypeReference()),
1174
+ defaultValue: this.expectOptionalToken(l.EQUALS) ? this.parseConstValueLiteral() : void 0,
1175
+ directives: this.parseConstDirectives()
1176
+ });
1177
+ }
1178
+ /**
1179
+ * Variable : $ Name
1180
+ */
1181
+ parseVariable() {
1182
+ const t = this._lexer.token;
1183
+ return this.expectToken(l.DOLLAR), this.node(t, {
1184
+ kind: g.VARIABLE,
1185
+ name: this.parseName()
1186
+ });
1187
+ }
1188
+ /**
1189
+ * ```
1190
+ * SelectionSet : { Selection+ }
1191
+ * ```
1192
+ */
1193
+ parseSelectionSet() {
1194
+ return this.node(this._lexer.token, {
1195
+ kind: g.SELECTION_SET,
1196
+ selections: this.many(
1197
+ l.BRACE_L,
1198
+ this.parseSelection,
1199
+ l.BRACE_R
1200
+ )
1201
+ });
1202
+ }
1203
+ /**
1204
+ * Selection :
1205
+ * - Field
1206
+ * - FragmentSpread
1207
+ * - InlineFragment
1208
+ */
1209
+ parseSelection() {
1210
+ return this.peek(l.SPREAD) ? this.parseFragment() : this.parseField();
1211
+ }
1212
+ /**
1213
+ * Field : Alias? Name Arguments? Directives? SelectionSet?
1214
+ *
1215
+ * Alias : Name :
1216
+ */
1217
+ parseField() {
1218
+ const t = this._lexer.token, n = this.parseName();
1219
+ let r, i;
1220
+ return this.expectOptionalToken(l.COLON) ? (r = n, i = this.parseName()) : i = n, this.node(t, {
1221
+ kind: g.FIELD,
1222
+ alias: r,
1223
+ name: i,
1224
+ arguments: this.parseArguments(!1),
1225
+ directives: this.parseDirectives(!1),
1226
+ selectionSet: this.peek(l.BRACE_L) ? this.parseSelectionSet() : void 0
1227
+ });
1228
+ }
1229
+ /**
1230
+ * Arguments[Const] : ( Argument[?Const]+ )
1231
+ */
1232
+ parseArguments(t) {
1233
+ const n = t ? this.parseConstArgument : this.parseArgument;
1234
+ return this.optionalMany(l.PAREN_L, n, l.PAREN_R);
1235
+ }
1236
+ /**
1237
+ * Argument[Const] : Name : Value[?Const]
1238
+ */
1239
+ parseArgument(t = !1) {
1240
+ const n = this._lexer.token, r = this.parseName();
1241
+ return this.expectToken(l.COLON), this.node(n, {
1242
+ kind: g.ARGUMENT,
1243
+ name: r,
1244
+ value: this.parseValueLiteral(t)
1245
+ });
1246
+ }
1247
+ parseConstArgument() {
1248
+ return this.parseArgument(!0);
1249
+ }
1250
+ // Implements the parsing rules in the Fragments section.
1251
+ /**
1252
+ * Corresponds to both FragmentSpread and InlineFragment in the spec.
1253
+ *
1254
+ * FragmentSpread : ... FragmentName Directives?
1255
+ *
1256
+ * InlineFragment : ... TypeCondition? Directives? SelectionSet
1257
+ */
1258
+ parseFragment() {
1259
+ const t = this._lexer.token;
1260
+ this.expectToken(l.SPREAD);
1261
+ const n = this.expectOptionalKeyword("on");
1262
+ return !n && this.peek(l.NAME) ? this.node(t, {
1263
+ kind: g.FRAGMENT_SPREAD,
1264
+ name: this.parseFragmentName(),
1265
+ directives: this.parseDirectives(!1)
1266
+ }) : this.node(t, {
1267
+ kind: g.INLINE_FRAGMENT,
1268
+ typeCondition: n ? this.parseNamedType() : void 0,
1269
+ directives: this.parseDirectives(!1),
1270
+ selectionSet: this.parseSelectionSet()
1271
+ });
1272
+ }
1273
+ /**
1274
+ * FragmentDefinition :
1275
+ * - fragment FragmentName on TypeCondition Directives? SelectionSet
1276
+ *
1277
+ * TypeCondition : NamedType
1278
+ */
1279
+ parseFragmentDefinition() {
1280
+ const t = this._lexer.token;
1281
+ return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(t, {
1282
+ kind: g.FRAGMENT_DEFINITION,
1283
+ name: this.parseFragmentName(),
1284
+ variableDefinitions: this.parseVariableDefinitions(),
1285
+ typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
1286
+ directives: this.parseDirectives(!1),
1287
+ selectionSet: this.parseSelectionSet()
1288
+ }) : this.node(t, {
1289
+ kind: g.FRAGMENT_DEFINITION,
1290
+ name: this.parseFragmentName(),
1291
+ typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
1292
+ directives: this.parseDirectives(!1),
1293
+ selectionSet: this.parseSelectionSet()
1294
+ });
1295
+ }
1296
+ /**
1297
+ * FragmentName : Name but not `on`
1298
+ */
1299
+ parseFragmentName() {
1300
+ if (this._lexer.token.value === "on")
1301
+ throw this.unexpected();
1302
+ return this.parseName();
1303
+ }
1304
+ // Implements the parsing rules in the Values section.
1305
+ /**
1306
+ * Value[Const] :
1307
+ * - [~Const] Variable
1308
+ * - IntValue
1309
+ * - FloatValue
1310
+ * - StringValue
1311
+ * - BooleanValue
1312
+ * - NullValue
1313
+ * - EnumValue
1314
+ * - ListValue[?Const]
1315
+ * - ObjectValue[?Const]
1316
+ *
1317
+ * BooleanValue : one of `true` `false`
1318
+ *
1319
+ * NullValue : `null`
1320
+ *
1321
+ * EnumValue : Name but not `true`, `false` or `null`
1322
+ */
1323
+ parseValueLiteral(t) {
1324
+ const n = this._lexer.token;
1325
+ switch (n.kind) {
1326
+ case l.BRACKET_L:
1327
+ return this.parseList(t);
1328
+ case l.BRACE_L:
1329
+ return this.parseObject(t);
1330
+ case l.INT:
1331
+ return this.advanceLexer(), this.node(n, {
1332
+ kind: g.INT,
1333
+ value: n.value
1334
+ });
1335
+ case l.FLOAT:
1336
+ return this.advanceLexer(), this.node(n, {
1337
+ kind: g.FLOAT,
1338
+ value: n.value
1339
+ });
1340
+ case l.STRING:
1341
+ case l.BLOCK_STRING:
1342
+ return this.parseStringLiteral();
1343
+ case l.NAME:
1344
+ switch (this.advanceLexer(), n.value) {
1345
+ case "true":
1346
+ return this.node(n, {
1347
+ kind: g.BOOLEAN,
1348
+ value: !0
1349
+ });
1350
+ case "false":
1351
+ return this.node(n, {
1352
+ kind: g.BOOLEAN,
1353
+ value: !1
1354
+ });
1355
+ case "null":
1356
+ return this.node(n, {
1357
+ kind: g.NULL
1358
+ });
1359
+ default:
1360
+ return this.node(n, {
1361
+ kind: g.ENUM,
1362
+ value: n.value
1363
+ });
1364
+ }
1365
+ case l.DOLLAR:
1366
+ if (t)
1367
+ if (this.expectToken(l.DOLLAR), this._lexer.token.kind === l.NAME) {
1368
+ const r = this._lexer.token.value;
1369
+ throw O(
1370
+ this._lexer.source,
1371
+ n.start,
1372
+ `Unexpected variable "$${r}" in constant value.`
1373
+ );
1374
+ } else
1375
+ throw this.unexpected(n);
1376
+ return this.parseVariable();
1377
+ default:
1378
+ throw this.unexpected();
1379
+ }
1380
+ }
1381
+ parseConstValueLiteral() {
1382
+ return this.parseValueLiteral(!0);
1383
+ }
1384
+ parseStringLiteral() {
1385
+ const t = this._lexer.token;
1386
+ return this.advanceLexer(), this.node(t, {
1387
+ kind: g.STRING,
1388
+ value: t.value,
1389
+ block: t.kind === l.BLOCK_STRING
1390
+ });
1391
+ }
1392
+ /**
1393
+ * ListValue[Const] :
1394
+ * - [ ]
1395
+ * - [ Value[?Const]+ ]
1396
+ */
1397
+ parseList(t) {
1398
+ const n = () => this.parseValueLiteral(t);
1399
+ return this.node(this._lexer.token, {
1400
+ kind: g.LIST,
1401
+ values: this.any(l.BRACKET_L, n, l.BRACKET_R)
1402
+ });
1403
+ }
1404
+ /**
1405
+ * ```
1406
+ * ObjectValue[Const] :
1407
+ * - { }
1408
+ * - { ObjectField[?Const]+ }
1409
+ * ```
1410
+ */
1411
+ parseObject(t) {
1412
+ const n = () => this.parseObjectField(t);
1413
+ return this.node(this._lexer.token, {
1414
+ kind: g.OBJECT,
1415
+ fields: this.any(l.BRACE_L, n, l.BRACE_R)
1416
+ });
1417
+ }
1418
+ /**
1419
+ * ObjectField[Const] : Name : Value[?Const]
1420
+ */
1421
+ parseObjectField(t) {
1422
+ const n = this._lexer.token, r = this.parseName();
1423
+ return this.expectToken(l.COLON), this.node(n, {
1424
+ kind: g.OBJECT_FIELD,
1425
+ name: r,
1426
+ value: this.parseValueLiteral(t)
1427
+ });
1428
+ }
1429
+ // Implements the parsing rules in the Directives section.
1430
+ /**
1431
+ * Directives[Const] : Directive[?Const]+
1432
+ */
1433
+ parseDirectives(t) {
1434
+ const n = [];
1435
+ for (; this.peek(l.AT); )
1436
+ n.push(this.parseDirective(t));
1437
+ return n;
1438
+ }
1439
+ parseConstDirectives() {
1440
+ return this.parseDirectives(!0);
1441
+ }
1442
+ /**
1443
+ * ```
1444
+ * Directive[Const] : @ Name Arguments[?Const]?
1445
+ * ```
1446
+ */
1447
+ parseDirective(t) {
1448
+ const n = this._lexer.token;
1449
+ return this.expectToken(l.AT), this.node(n, {
1450
+ kind: g.DIRECTIVE,
1451
+ name: this.parseName(),
1452
+ arguments: this.parseArguments(t)
1453
+ });
1454
+ }
1455
+ // Implements the parsing rules in the Types section.
1456
+ /**
1457
+ * Type :
1458
+ * - NamedType
1459
+ * - ListType
1460
+ * - NonNullType
1461
+ */
1462
+ parseTypeReference() {
1463
+ const t = this._lexer.token;
1464
+ let n;
1465
+ if (this.expectOptionalToken(l.BRACKET_L)) {
1466
+ const r = this.parseTypeReference();
1467
+ this.expectToken(l.BRACKET_R), n = this.node(t, {
1468
+ kind: g.LIST_TYPE,
1469
+ type: r
1470
+ });
1471
+ } else
1472
+ n = this.parseNamedType();
1473
+ return this.expectOptionalToken(l.BANG) ? this.node(t, {
1474
+ kind: g.NON_NULL_TYPE,
1475
+ type: n
1476
+ }) : n;
1477
+ }
1478
+ /**
1479
+ * NamedType : Name
1480
+ */
1481
+ parseNamedType() {
1482
+ return this.node(this._lexer.token, {
1483
+ kind: g.NAMED_TYPE,
1484
+ name: this.parseName()
1485
+ });
1486
+ }
1487
+ // Implements the parsing rules in the Type Definition section.
1488
+ peekDescription() {
1489
+ return this.peek(l.STRING) || this.peek(l.BLOCK_STRING);
1490
+ }
1491
+ /**
1492
+ * Description : StringValue
1493
+ */
1494
+ parseDescription() {
1495
+ if (this.peekDescription())
1496
+ return this.parseStringLiteral();
1497
+ }
1498
+ /**
1499
+ * ```
1500
+ * SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ }
1501
+ * ```
1502
+ */
1503
+ parseSchemaDefinition() {
1504
+ const t = this._lexer.token, n = this.parseDescription();
1505
+ this.expectKeyword("schema");
1506
+ const r = this.parseConstDirectives(), i = this.many(
1507
+ l.BRACE_L,
1508
+ this.parseOperationTypeDefinition,
1509
+ l.BRACE_R
1510
+ );
1511
+ return this.node(t, {
1512
+ kind: g.SCHEMA_DEFINITION,
1513
+ description: n,
1514
+ directives: r,
1515
+ operationTypes: i
1516
+ });
1517
+ }
1518
+ /**
1519
+ * OperationTypeDefinition : OperationType : NamedType
1520
+ */
1521
+ parseOperationTypeDefinition() {
1522
+ const t = this._lexer.token, n = this.parseOperationType();
1523
+ this.expectToken(l.COLON);
1524
+ const r = this.parseNamedType();
1525
+ return this.node(t, {
1526
+ kind: g.OPERATION_TYPE_DEFINITION,
1527
+ operation: n,
1528
+ type: r
1529
+ });
1530
+ }
1531
+ /**
1532
+ * ScalarTypeDefinition : Description? scalar Name Directives[Const]?
1533
+ */
1534
+ parseScalarTypeDefinition() {
1535
+ const t = this._lexer.token, n = this.parseDescription();
1536
+ this.expectKeyword("scalar");
1537
+ const r = this.parseName(), i = this.parseConstDirectives();
1538
+ return this.node(t, {
1539
+ kind: g.SCALAR_TYPE_DEFINITION,
1540
+ description: n,
1541
+ name: r,
1542
+ directives: i
1543
+ });
1544
+ }
1545
+ /**
1546
+ * ObjectTypeDefinition :
1547
+ * Description?
1548
+ * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?
1549
+ */
1550
+ parseObjectTypeDefinition() {
1551
+ const t = this._lexer.token, n = this.parseDescription();
1552
+ this.expectKeyword("type");
1553
+ const r = this.parseName(), i = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
1554
+ return this.node(t, {
1555
+ kind: g.OBJECT_TYPE_DEFINITION,
1556
+ description: n,
1557
+ name: r,
1558
+ interfaces: i,
1559
+ directives: s,
1560
+ fields: o
1561
+ });
1562
+ }
1563
+ /**
1564
+ * ImplementsInterfaces :
1565
+ * - implements `&`? NamedType
1566
+ * - ImplementsInterfaces & NamedType
1567
+ */
1568
+ parseImplementsInterfaces() {
1569
+ return this.expectOptionalKeyword("implements") ? this.delimitedMany(l.AMP, this.parseNamedType) : [];
1570
+ }
1571
+ /**
1572
+ * ```
1573
+ * FieldsDefinition : { FieldDefinition+ }
1574
+ * ```
1575
+ */
1576
+ parseFieldsDefinition() {
1577
+ return this.optionalMany(
1578
+ l.BRACE_L,
1579
+ this.parseFieldDefinition,
1580
+ l.BRACE_R
1581
+ );
1582
+ }
1583
+ /**
1584
+ * FieldDefinition :
1585
+ * - Description? Name ArgumentsDefinition? : Type Directives[Const]?
1586
+ */
1587
+ parseFieldDefinition() {
1588
+ const t = this._lexer.token, n = this.parseDescription(), r = this.parseName(), i = this.parseArgumentDefs();
1589
+ this.expectToken(l.COLON);
1590
+ const s = this.parseTypeReference(), o = this.parseConstDirectives();
1591
+ return this.node(t, {
1592
+ kind: g.FIELD_DEFINITION,
1593
+ description: n,
1594
+ name: r,
1595
+ arguments: i,
1596
+ type: s,
1597
+ directives: o
1598
+ });
1599
+ }
1600
+ /**
1601
+ * ArgumentsDefinition : ( InputValueDefinition+ )
1602
+ */
1603
+ parseArgumentDefs() {
1604
+ return this.optionalMany(
1605
+ l.PAREN_L,
1606
+ this.parseInputValueDef,
1607
+ l.PAREN_R
1608
+ );
1609
+ }
1610
+ /**
1611
+ * InputValueDefinition :
1612
+ * - Description? Name : Type DefaultValue? Directives[Const]?
1613
+ */
1614
+ parseInputValueDef() {
1615
+ const t = this._lexer.token, n = this.parseDescription(), r = this.parseName();
1616
+ this.expectToken(l.COLON);
1617
+ const i = this.parseTypeReference();
1618
+ let s;
1619
+ this.expectOptionalToken(l.EQUALS) && (s = this.parseConstValueLiteral());
1620
+ const o = this.parseConstDirectives();
1621
+ return this.node(t, {
1622
+ kind: g.INPUT_VALUE_DEFINITION,
1623
+ description: n,
1624
+ name: r,
1625
+ type: i,
1626
+ defaultValue: s,
1627
+ directives: o
1628
+ });
1629
+ }
1630
+ /**
1631
+ * InterfaceTypeDefinition :
1632
+ * - Description? interface Name Directives[Const]? FieldsDefinition?
1633
+ */
1634
+ parseInterfaceTypeDefinition() {
1635
+ const t = this._lexer.token, n = this.parseDescription();
1636
+ this.expectKeyword("interface");
1637
+ const r = this.parseName(), i = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
1638
+ return this.node(t, {
1639
+ kind: g.INTERFACE_TYPE_DEFINITION,
1640
+ description: n,
1641
+ name: r,
1642
+ interfaces: i,
1643
+ directives: s,
1644
+ fields: o
1645
+ });
1646
+ }
1647
+ /**
1648
+ * UnionTypeDefinition :
1649
+ * - Description? union Name Directives[Const]? UnionMemberTypes?
1650
+ */
1651
+ parseUnionTypeDefinition() {
1652
+ const t = this._lexer.token, n = this.parseDescription();
1653
+ this.expectKeyword("union");
1654
+ const r = this.parseName(), i = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
1655
+ return this.node(t, {
1656
+ kind: g.UNION_TYPE_DEFINITION,
1657
+ description: n,
1658
+ name: r,
1659
+ directives: i,
1660
+ types: s
1661
+ });
1662
+ }
1663
+ /**
1664
+ * UnionMemberTypes :
1665
+ * - = `|`? NamedType
1666
+ * - UnionMemberTypes | NamedType
1667
+ */
1668
+ parseUnionMemberTypes() {
1669
+ return this.expectOptionalToken(l.EQUALS) ? this.delimitedMany(l.PIPE, this.parseNamedType) : [];
1670
+ }
1671
+ /**
1672
+ * EnumTypeDefinition :
1673
+ * - Description? enum Name Directives[Const]? EnumValuesDefinition?
1674
+ */
1675
+ parseEnumTypeDefinition() {
1676
+ const t = this._lexer.token, n = this.parseDescription();
1677
+ this.expectKeyword("enum");
1678
+ const r = this.parseName(), i = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
1679
+ return this.node(t, {
1680
+ kind: g.ENUM_TYPE_DEFINITION,
1681
+ description: n,
1682
+ name: r,
1683
+ directives: i,
1684
+ values: s
1685
+ });
1686
+ }
1687
+ /**
1688
+ * ```
1689
+ * EnumValuesDefinition : { EnumValueDefinition+ }
1690
+ * ```
1691
+ */
1692
+ parseEnumValuesDefinition() {
1693
+ return this.optionalMany(
1694
+ l.BRACE_L,
1695
+ this.parseEnumValueDefinition,
1696
+ l.BRACE_R
1697
+ );
1698
+ }
1699
+ /**
1700
+ * EnumValueDefinition : Description? EnumValue Directives[Const]?
1701
+ */
1702
+ parseEnumValueDefinition() {
1703
+ const t = this._lexer.token, n = this.parseDescription(), r = this.parseEnumValueName(), i = this.parseConstDirectives();
1704
+ return this.node(t, {
1705
+ kind: g.ENUM_VALUE_DEFINITION,
1706
+ description: n,
1707
+ name: r,
1708
+ directives: i
1709
+ });
1710
+ }
1711
+ /**
1712
+ * EnumValue : Name but not `true`, `false` or `null`
1713
+ */
1714
+ parseEnumValueName() {
1715
+ if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null")
1716
+ throw O(
1717
+ this._lexer.source,
1718
+ this._lexer.token.start,
1719
+ `${ue(
1720
+ this._lexer.token
1721
+ )} is reserved and cannot be used for an enum value.`
1722
+ );
1723
+ return this.parseName();
1724
+ }
1725
+ /**
1726
+ * InputObjectTypeDefinition :
1727
+ * - Description? input Name Directives[Const]? InputFieldsDefinition?
1728
+ */
1729
+ parseInputObjectTypeDefinition() {
1730
+ const t = this._lexer.token, n = this.parseDescription();
1731
+ this.expectKeyword("input");
1732
+ const r = this.parseName(), i = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
1733
+ return this.node(t, {
1734
+ kind: g.INPUT_OBJECT_TYPE_DEFINITION,
1735
+ description: n,
1736
+ name: r,
1737
+ directives: i,
1738
+ fields: s
1739
+ });
1740
+ }
1741
+ /**
1742
+ * ```
1743
+ * InputFieldsDefinition : { InputValueDefinition+ }
1744
+ * ```
1745
+ */
1746
+ parseInputFieldsDefinition() {
1747
+ return this.optionalMany(
1748
+ l.BRACE_L,
1749
+ this.parseInputValueDef,
1750
+ l.BRACE_R
1751
+ );
1752
+ }
1753
+ /**
1754
+ * TypeSystemExtension :
1755
+ * - SchemaExtension
1756
+ * - TypeExtension
1757
+ *
1758
+ * TypeExtension :
1759
+ * - ScalarTypeExtension
1760
+ * - ObjectTypeExtension
1761
+ * - InterfaceTypeExtension
1762
+ * - UnionTypeExtension
1763
+ * - EnumTypeExtension
1764
+ * - InputObjectTypeDefinition
1765
+ */
1766
+ parseTypeSystemExtension() {
1767
+ const t = this._lexer.lookahead();
1768
+ if (t.kind === l.NAME)
1769
+ switch (t.value) {
1770
+ case "schema":
1771
+ return this.parseSchemaExtension();
1772
+ case "scalar":
1773
+ return this.parseScalarTypeExtension();
1774
+ case "type":
1775
+ return this.parseObjectTypeExtension();
1776
+ case "interface":
1777
+ return this.parseInterfaceTypeExtension();
1778
+ case "union":
1779
+ return this.parseUnionTypeExtension();
1780
+ case "enum":
1781
+ return this.parseEnumTypeExtension();
1782
+ case "input":
1783
+ return this.parseInputObjectTypeExtension();
1784
+ }
1785
+ throw this.unexpected(t);
1786
+ }
1787
+ /**
1788
+ * ```
1789
+ * SchemaExtension :
1790
+ * - extend schema Directives[Const]? { OperationTypeDefinition+ }
1791
+ * - extend schema Directives[Const]
1792
+ * ```
1793
+ */
1794
+ parseSchemaExtension() {
1795
+ const t = this._lexer.token;
1796
+ this.expectKeyword("extend"), this.expectKeyword("schema");
1797
+ const n = this.parseConstDirectives(), r = this.optionalMany(
1798
+ l.BRACE_L,
1799
+ this.parseOperationTypeDefinition,
1800
+ l.BRACE_R
1801
+ );
1802
+ if (n.length === 0 && r.length === 0)
1803
+ throw this.unexpected();
1804
+ return this.node(t, {
1805
+ kind: g.SCHEMA_EXTENSION,
1806
+ directives: n,
1807
+ operationTypes: r
1808
+ });
1809
+ }
1810
+ /**
1811
+ * ScalarTypeExtension :
1812
+ * - extend scalar Name Directives[Const]
1813
+ */
1814
+ parseScalarTypeExtension() {
1815
+ const t = this._lexer.token;
1816
+ this.expectKeyword("extend"), this.expectKeyword("scalar");
1817
+ const n = this.parseName(), r = this.parseConstDirectives();
1818
+ if (r.length === 0)
1819
+ throw this.unexpected();
1820
+ return this.node(t, {
1821
+ kind: g.SCALAR_TYPE_EXTENSION,
1822
+ name: n,
1823
+ directives: r
1824
+ });
1825
+ }
1826
+ /**
1827
+ * ObjectTypeExtension :
1828
+ * - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition
1829
+ * - extend type Name ImplementsInterfaces? Directives[Const]
1830
+ * - extend type Name ImplementsInterfaces
1831
+ */
1832
+ parseObjectTypeExtension() {
1833
+ const t = this._lexer.token;
1834
+ this.expectKeyword("extend"), this.expectKeyword("type");
1835
+ const n = this.parseName(), r = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1836
+ if (r.length === 0 && i.length === 0 && s.length === 0)
1837
+ throw this.unexpected();
1838
+ return this.node(t, {
1839
+ kind: g.OBJECT_TYPE_EXTENSION,
1840
+ name: n,
1841
+ interfaces: r,
1842
+ directives: i,
1843
+ fields: s
1844
+ });
1845
+ }
1846
+ /**
1847
+ * InterfaceTypeExtension :
1848
+ * - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition
1849
+ * - extend interface Name ImplementsInterfaces? Directives[Const]
1850
+ * - extend interface Name ImplementsInterfaces
1851
+ */
1852
+ parseInterfaceTypeExtension() {
1853
+ const t = this._lexer.token;
1854
+ this.expectKeyword("extend"), this.expectKeyword("interface");
1855
+ const n = this.parseName(), r = this.parseImplementsInterfaces(), i = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1856
+ if (r.length === 0 && i.length === 0 && s.length === 0)
1857
+ throw this.unexpected();
1858
+ return this.node(t, {
1859
+ kind: g.INTERFACE_TYPE_EXTENSION,
1860
+ name: n,
1861
+ interfaces: r,
1862
+ directives: i,
1863
+ fields: s
1864
+ });
1865
+ }
1866
+ /**
1867
+ * UnionTypeExtension :
1868
+ * - extend union Name Directives[Const]? UnionMemberTypes
1869
+ * - extend union Name Directives[Const]
1870
+ */
1871
+ parseUnionTypeExtension() {
1872
+ const t = this._lexer.token;
1873
+ this.expectKeyword("extend"), this.expectKeyword("union");
1874
+ const n = this.parseName(), r = this.parseConstDirectives(), i = this.parseUnionMemberTypes();
1875
+ if (r.length === 0 && i.length === 0)
1876
+ throw this.unexpected();
1877
+ return this.node(t, {
1878
+ kind: g.UNION_TYPE_EXTENSION,
1879
+ name: n,
1880
+ directives: r,
1881
+ types: i
1882
+ });
1883
+ }
1884
+ /**
1885
+ * EnumTypeExtension :
1886
+ * - extend enum Name Directives[Const]? EnumValuesDefinition
1887
+ * - extend enum Name Directives[Const]
1888
+ */
1889
+ parseEnumTypeExtension() {
1890
+ const t = this._lexer.token;
1891
+ this.expectKeyword("extend"), this.expectKeyword("enum");
1892
+ const n = this.parseName(), r = this.parseConstDirectives(), i = this.parseEnumValuesDefinition();
1893
+ if (r.length === 0 && i.length === 0)
1894
+ throw this.unexpected();
1895
+ return this.node(t, {
1896
+ kind: g.ENUM_TYPE_EXTENSION,
1897
+ name: n,
1898
+ directives: r,
1899
+ values: i
1900
+ });
1901
+ }
1902
+ /**
1903
+ * InputObjectTypeExtension :
1904
+ * - extend input Name Directives[Const]? InputFieldsDefinition
1905
+ * - extend input Name Directives[Const]
1906
+ */
1907
+ parseInputObjectTypeExtension() {
1908
+ const t = this._lexer.token;
1909
+ this.expectKeyword("extend"), this.expectKeyword("input");
1910
+ const n = this.parseName(), r = this.parseConstDirectives(), i = this.parseInputFieldsDefinition();
1911
+ if (r.length === 0 && i.length === 0)
1912
+ throw this.unexpected();
1913
+ return this.node(t, {
1914
+ kind: g.INPUT_OBJECT_TYPE_EXTENSION,
1915
+ name: n,
1916
+ directives: r,
1917
+ fields: i
1918
+ });
1919
+ }
1920
+ /**
1921
+ * ```
1922
+ * DirectiveDefinition :
1923
+ * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations
1924
+ * ```
1925
+ */
1926
+ parseDirectiveDefinition() {
1927
+ const t = this._lexer.token, n = this.parseDescription();
1928
+ this.expectKeyword("directive"), this.expectToken(l.AT);
1929
+ const r = this.parseName(), i = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
1930
+ this.expectKeyword("on");
1931
+ const o = this.parseDirectiveLocations();
1932
+ return this.node(t, {
1933
+ kind: g.DIRECTIVE_DEFINITION,
1934
+ description: n,
1935
+ name: r,
1936
+ arguments: i,
1937
+ repeatable: s,
1938
+ locations: o
1939
+ });
1940
+ }
1941
+ /**
1942
+ * DirectiveLocations :
1943
+ * - `|`? DirectiveLocation
1944
+ * - DirectiveLocations | DirectiveLocation
1945
+ */
1946
+ parseDirectiveLocations() {
1947
+ return this.delimitedMany(l.PIPE, this.parseDirectiveLocation);
1948
+ }
1949
+ /*
1950
+ * DirectiveLocation :
1951
+ * - ExecutableDirectiveLocation
1952
+ * - TypeSystemDirectiveLocation
1953
+ *
1954
+ * ExecutableDirectiveLocation : one of
1955
+ * `QUERY`
1956
+ * `MUTATION`
1957
+ * `SUBSCRIPTION`
1958
+ * `FIELD`
1959
+ * `FRAGMENT_DEFINITION`
1960
+ * `FRAGMENT_SPREAD`
1961
+ * `INLINE_FRAGMENT`
1962
+ *
1963
+ * TypeSystemDirectiveLocation : one of
1964
+ * `SCHEMA`
1965
+ * `SCALAR`
1966
+ * `OBJECT`
1967
+ * `FIELD_DEFINITION`
1968
+ * `ARGUMENT_DEFINITION`
1969
+ * `INTERFACE`
1970
+ * `UNION`
1971
+ * `ENUM`
1972
+ * `ENUM_VALUE`
1973
+ * `INPUT_OBJECT`
1974
+ * `INPUT_FIELD_DEFINITION`
1975
+ */
1976
+ parseDirectiveLocation() {
1977
+ const t = this._lexer.token, n = this.parseName();
1978
+ if (Object.prototype.hasOwnProperty.call(Be, n.value))
1979
+ return n;
1980
+ throw this.unexpected(t);
1981
+ }
1982
+ // Core parsing utility functions
1983
+ /**
1984
+ * Returns a node that, if configured to do so, sets a "loc" field as a
1985
+ * location object, used to identify the place in the source that created a
1986
+ * given parsed object.
1987
+ */
1988
+ node(t, n) {
1989
+ return this._options.noLocation !== !0 && (n.loc = new dn(
1990
+ t,
1991
+ this._lexer.lastToken,
1992
+ this._lexer.source
1993
+ )), n;
1994
+ }
1995
+ /**
1996
+ * Determines if the next token is of a given kind
1997
+ */
1998
+ peek(t) {
1999
+ return this._lexer.token.kind === t;
2000
+ }
2001
+ /**
2002
+ * If the next token is of the given kind, return that token after advancing the lexer.
2003
+ * Otherwise, do not change the parser state and throw an error.
2004
+ */
2005
+ expectToken(t) {
2006
+ const n = this._lexer.token;
2007
+ if (n.kind === t)
2008
+ return this.advanceLexer(), n;
2009
+ throw O(
2010
+ this._lexer.source,
2011
+ n.start,
2012
+ `Expected ${kt(t)}, found ${ue(n)}.`
2013
+ );
2014
+ }
2015
+ /**
2016
+ * If the next token is of the given kind, return "true" after advancing the lexer.
2017
+ * Otherwise, do not change the parser state and return "false".
2018
+ */
2019
+ expectOptionalToken(t) {
2020
+ return this._lexer.token.kind === t ? (this.advanceLexer(), !0) : !1;
2021
+ }
2022
+ /**
2023
+ * If the next token is a given keyword, advance the lexer.
2024
+ * Otherwise, do not change the parser state and throw an error.
2025
+ */
2026
+ expectKeyword(t) {
2027
+ const n = this._lexer.token;
2028
+ if (n.kind === l.NAME && n.value === t)
2029
+ this.advanceLexer();
2030
+ else
2031
+ throw O(
2032
+ this._lexer.source,
2033
+ n.start,
2034
+ `Expected "${t}", found ${ue(n)}.`
2035
+ );
2036
+ }
2037
+ /**
2038
+ * If the next token is a given keyword, return "true" after advancing the lexer.
2039
+ * Otherwise, do not change the parser state and return "false".
2040
+ */
2041
+ expectOptionalKeyword(t) {
2042
+ const n = this._lexer.token;
2043
+ return n.kind === l.NAME && n.value === t ? (this.advanceLexer(), !0) : !1;
2044
+ }
2045
+ /**
2046
+ * Helper function for creating an error when an unexpected lexed token is encountered.
2047
+ */
2048
+ unexpected(t) {
2049
+ const n = t != null ? t : this._lexer.token;
2050
+ return O(
2051
+ this._lexer.source,
2052
+ n.start,
2053
+ `Unexpected ${ue(n)}.`
2054
+ );
2055
+ }
2056
+ /**
2057
+ * Returns a possibly empty list of parse nodes, determined by the parseFn.
2058
+ * This list begins with a lex token of openKind and ends with a lex token of closeKind.
2059
+ * Advances the parser to the next lex token after the closing token.
2060
+ */
2061
+ any(t, n, r) {
2062
+ this.expectToken(t);
2063
+ const i = [];
2064
+ for (; !this.expectOptionalToken(r); )
2065
+ i.push(n.call(this));
2066
+ return i;
2067
+ }
2068
+ /**
2069
+ * Returns a list of parse nodes, determined by the parseFn.
2070
+ * It can be empty only if open token is missing otherwise it will always return non-empty list
2071
+ * that begins with a lex token of openKind and ends with a lex token of closeKind.
2072
+ * Advances the parser to the next lex token after the closing token.
2073
+ */
2074
+ optionalMany(t, n, r) {
2075
+ if (this.expectOptionalToken(t)) {
2076
+ const i = [];
2077
+ do
2078
+ i.push(n.call(this));
2079
+ while (!this.expectOptionalToken(r));
2080
+ return i;
2081
+ }
2082
+ return [];
2083
+ }
2084
+ /**
2085
+ * Returns a non-empty list of parse nodes, determined by the parseFn.
2086
+ * This list begins with a lex token of openKind and ends with a lex token of closeKind.
2087
+ * Advances the parser to the next lex token after the closing token.
2088
+ */
2089
+ many(t, n, r) {
2090
+ this.expectToken(t);
2091
+ const i = [];
2092
+ do
2093
+ i.push(n.call(this));
2094
+ while (!this.expectOptionalToken(r));
2095
+ return i;
2096
+ }
2097
+ /**
2098
+ * Returns a non-empty list of parse nodes, determined by the parseFn.
2099
+ * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.
2100
+ * Advances the parser to the next lex token after last item in the list.
2101
+ */
2102
+ delimitedMany(t, n) {
2103
+ this.expectOptionalToken(t);
2104
+ const r = [];
2105
+ do
2106
+ r.push(n.call(this));
2107
+ while (this.expectOptionalToken(t));
2108
+ return r;
2109
+ }
2110
+ advanceLexer() {
2111
+ const { maxTokens: t } = this._options, n = this._lexer.advance();
2112
+ if (n.kind !== l.EOF && (++this._tokenCounter, t !== void 0 && this._tokenCounter > t))
2113
+ throw O(
2114
+ this._lexer.source,
2115
+ n.start,
2116
+ `Document contains more that ${t} tokens. Parsing aborted.`
2117
+ );
2118
+ }
2119
+ }
2120
+ function ue(e) {
2121
+ const t = e.value;
2122
+ return kt(e.kind) + (t != null ? ` "${t}"` : "");
2123
+ }
2124
+ function kt(e) {
2125
+ return Tn(e) ? `"${e}"` : e;
2126
+ }
2127
+ function Bn(e) {
2128
+ return `"${e.replace(Vn, jn)}"`;
2129
+ }
2130
+ const Vn = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
2131
+ function jn(e) {
2132
+ return qn[e.charCodeAt(0)];
2133
+ }
2134
+ const qn = [
2135
+ "\\u0000",
2136
+ "\\u0001",
2137
+ "\\u0002",
2138
+ "\\u0003",
2139
+ "\\u0004",
2140
+ "\\u0005",
2141
+ "\\u0006",
2142
+ "\\u0007",
2143
+ "\\b",
2144
+ "\\t",
2145
+ "\\n",
2146
+ "\\u000B",
2147
+ "\\f",
2148
+ "\\r",
2149
+ "\\u000E",
2150
+ "\\u000F",
2151
+ "\\u0010",
2152
+ "\\u0011",
2153
+ "\\u0012",
2154
+ "\\u0013",
2155
+ "\\u0014",
2156
+ "\\u0015",
2157
+ "\\u0016",
2158
+ "\\u0017",
2159
+ "\\u0018",
2160
+ "\\u0019",
2161
+ "\\u001A",
2162
+ "\\u001B",
2163
+ "\\u001C",
2164
+ "\\u001D",
2165
+ "\\u001E",
2166
+ "\\u001F",
2167
+ "",
2168
+ "",
2169
+ '\\"',
2170
+ "",
2171
+ "",
2172
+ "",
2173
+ "",
2174
+ "",
2175
+ "",
2176
+ "",
2177
+ "",
2178
+ "",
2179
+ "",
2180
+ "",
2181
+ "",
2182
+ "",
2183
+ // 2F
2184
+ "",
2185
+ "",
2186
+ "",
2187
+ "",
2188
+ "",
2189
+ "",
2190
+ "",
2191
+ "",
2192
+ "",
2193
+ "",
2194
+ "",
2195
+ "",
2196
+ "",
2197
+ "",
2198
+ "",
2199
+ "",
2200
+ // 3F
2201
+ "",
2202
+ "",
2203
+ "",
2204
+ "",
2205
+ "",
2206
+ "",
2207
+ "",
2208
+ "",
2209
+ "",
2210
+ "",
2211
+ "",
2212
+ "",
2213
+ "",
2214
+ "",
2215
+ "",
2216
+ "",
2217
+ // 4F
2218
+ "",
2219
+ "",
2220
+ "",
2221
+ "",
2222
+ "",
2223
+ "",
2224
+ "",
2225
+ "",
2226
+ "",
2227
+ "",
2228
+ "",
2229
+ "",
2230
+ "\\\\",
2231
+ "",
2232
+ "",
2233
+ "",
2234
+ // 5F
2235
+ "",
2236
+ "",
2237
+ "",
2238
+ "",
2239
+ "",
2240
+ "",
2241
+ "",
2242
+ "",
2243
+ "",
2244
+ "",
2245
+ "",
2246
+ "",
2247
+ "",
2248
+ "",
2249
+ "",
2250
+ "",
2251
+ // 6F
2252
+ "",
2253
+ "",
2254
+ "",
2255
+ "",
2256
+ "",
2257
+ "",
2258
+ "",
2259
+ "",
2260
+ "",
2261
+ "",
2262
+ "",
2263
+ "",
2264
+ "",
2265
+ "",
2266
+ "",
2267
+ "\\u007F",
2268
+ "\\u0080",
2269
+ "\\u0081",
2270
+ "\\u0082",
2271
+ "\\u0083",
2272
+ "\\u0084",
2273
+ "\\u0085",
2274
+ "\\u0086",
2275
+ "\\u0087",
2276
+ "\\u0088",
2277
+ "\\u0089",
2278
+ "\\u008A",
2279
+ "\\u008B",
2280
+ "\\u008C",
2281
+ "\\u008D",
2282
+ "\\u008E",
2283
+ "\\u008F",
2284
+ "\\u0090",
2285
+ "\\u0091",
2286
+ "\\u0092",
2287
+ "\\u0093",
2288
+ "\\u0094",
2289
+ "\\u0095",
2290
+ "\\u0096",
2291
+ "\\u0097",
2292
+ "\\u0098",
2293
+ "\\u0099",
2294
+ "\\u009A",
2295
+ "\\u009B",
2296
+ "\\u009C",
2297
+ "\\u009D",
2298
+ "\\u009E",
2299
+ "\\u009F"
2300
+ ], Hn = Object.freeze({});
2301
+ function Gn(e, t, n = It) {
2302
+ const r = /* @__PURE__ */ new Map();
2303
+ for (const x of Object.values(g))
2304
+ r.set(x, Yn(t, x));
2305
+ let i, s = Array.isArray(e), o = [e], a = -1, c = [], f = e, h, m;
2306
+ const E = [], S = [];
2307
+ do {
2308
+ a++;
2309
+ const x = a === o.length, V = x && c.length !== 0;
2310
+ if (x) {
2311
+ if (h = S.length === 0 ? void 0 : E[E.length - 1], f = m, m = S.pop(), V)
2312
+ if (s) {
2313
+ f = f.slice();
2314
+ let P = 0;
2315
+ for (const [j, se] of c) {
2316
+ const oe = j - P;
2317
+ se === null ? (f.splice(oe, 1), P++) : f[oe] = se;
2318
+ }
2319
+ } else {
2320
+ f = _({}, f);
2321
+ for (const [P, j] of c)
2322
+ f[P] = j;
2323
+ }
2324
+ a = i.index, o = i.keys, c = i.edits, s = i.inArray, i = i.prev;
2325
+ } else if (m) {
2326
+ if (h = s ? a : o[a], f = m[h], f == null)
2327
+ continue;
2328
+ E.push(h);
2329
+ }
2330
+ let k;
2331
+ if (!Array.isArray(f)) {
2332
+ var y, N;
2333
+ ct(f) || de(!1, `Invalid AST Node: ${Ke(f)}.`);
2334
+ const P = x ? (y = r.get(f.kind)) === null || y === void 0 ? void 0 : y.leave : (N = r.get(f.kind)) === null || N === void 0 ? void 0 : N.enter;
2335
+ if (k = P == null ? void 0 : P.call(t, f, h, m, E, S), k === Hn)
2336
+ break;
2337
+ if (k === !1) {
2338
+ if (!x) {
2339
+ E.pop();
2340
+ continue;
2341
+ }
2342
+ } else if (k !== void 0 && (c.push([h, k]), !x))
2343
+ if (ct(k))
2344
+ f = k;
2345
+ else {
2346
+ E.pop();
2347
+ continue;
2348
+ }
2349
+ }
2350
+ if (k === void 0 && V && c.push([h, f]), x)
2351
+ E.pop();
2352
+ else {
2353
+ var b;
2354
+ i = {
2355
+ inArray: s,
2356
+ index: a,
2357
+ keys: o,
2358
+ edits: c,
2359
+ prev: i
2360
+ }, s = Array.isArray(f), o = s ? f : (b = n[f.kind]) !== null && b !== void 0 ? b : [], a = -1, c = [], m && S.push(m), m = f;
2361
+ }
2362
+ } while (i !== void 0);
2363
+ return c.length !== 0 ? c[c.length - 1][1] : e;
2364
+ }
2365
+ function Yn(e, t) {
2366
+ const n = e[t];
2367
+ return typeof n == "object" ? n : typeof n == "function" ? {
2368
+ enter: n,
2369
+ leave: void 0
2370
+ } : {
2371
+ enter: e.enter,
2372
+ leave: e.leave
2373
+ };
2374
+ }
2375
+ function zn(e) {
2376
+ return Gn(e, Xn);
2377
+ }
2378
+ const Jn = 80, Xn = {
2379
+ Name: {
2380
+ leave: (e) => e.value
2381
+ },
2382
+ Variable: {
2383
+ leave: (e) => "$" + e.name
2384
+ },
2385
+ // Document
2386
+ Document: {
2387
+ leave: (e) => p(e.definitions, `
2388
+
2389
+ `)
2390
+ },
2391
+ OperationDefinition: {
2392
+ leave(e) {
2393
+ const t = v("(", p(e.variableDefinitions, ", "), ")"), n = p(
2394
+ [
2395
+ e.operation,
2396
+ p([e.name, t]),
2397
+ p(e.directives, " ")
2398
+ ],
2399
+ " "
2400
+ );
2401
+ return (n === "query" ? "" : n + " ") + e.selectionSet;
2402
+ }
2403
+ },
2404
+ VariableDefinition: {
2405
+ leave: ({ variable: e, type: t, defaultValue: n, directives: r }) => e + ": " + t + v(" = ", n) + v(" ", p(r, " "))
2406
+ },
2407
+ SelectionSet: {
2408
+ leave: ({ selections: e }) => F(e)
2409
+ },
2410
+ Field: {
2411
+ leave({ alias: e, name: t, arguments: n, directives: r, selectionSet: i }) {
2412
+ const s = v("", e, ": ") + t;
2413
+ let o = s + v("(", p(n, ", "), ")");
2414
+ return o.length > Jn && (o = s + v(`(
2415
+ `, pe(p(n, `
2416
+ `)), `
2417
+ )`)), p([o, p(r, " "), i], " ");
2418
+ }
2419
+ },
2420
+ Argument: {
2421
+ leave: ({ name: e, value: t }) => e + ": " + t
2422
+ },
2423
+ // Fragments
2424
+ FragmentSpread: {
2425
+ leave: ({ name: e, directives: t }) => "..." + e + v(" ", p(t, " "))
2426
+ },
2427
+ InlineFragment: {
2428
+ leave: ({ typeCondition: e, directives: t, selectionSet: n }) => p(
2429
+ [
2430
+ "...",
2431
+ v("on ", e),
2432
+ p(t, " "),
2433
+ n
2434
+ ],
2435
+ " "
2436
+ )
2437
+ },
2438
+ FragmentDefinition: {
2439
+ leave: ({ name: e, typeCondition: t, variableDefinitions: n, directives: r, selectionSet: i }) => (
2440
+ // or removed in the future.
2441
+ `fragment ${e}${v("(", p(n, ", "), ")")} on ${t} ${v("", p(r, " "), " ")}` + i
2442
+ )
2443
+ },
2444
+ // Value
2445
+ IntValue: {
2446
+ leave: ({ value: e }) => e
2447
+ },
2448
+ FloatValue: {
2449
+ leave: ({ value: e }) => e
2450
+ },
2451
+ StringValue: {
2452
+ leave: ({ value: e, block: t }) => t ? En(e) : Bn(e)
2453
+ },
2454
+ BooleanValue: {
2455
+ leave: ({ value: e }) => e ? "true" : "false"
2456
+ },
2457
+ NullValue: {
2458
+ leave: () => "null"
2459
+ },
2460
+ EnumValue: {
2461
+ leave: ({ value: e }) => e
2462
+ },
2463
+ ListValue: {
2464
+ leave: ({ values: e }) => "[" + p(e, ", ") + "]"
2465
+ },
2466
+ ObjectValue: {
2467
+ leave: ({ fields: e }) => "{" + p(e, ", ") + "}"
2468
+ },
2469
+ ObjectField: {
2470
+ leave: ({ name: e, value: t }) => e + ": " + t
2471
+ },
2472
+ // Directive
2473
+ Directive: {
2474
+ leave: ({ name: e, arguments: t }) => "@" + e + v("(", p(t, ", "), ")")
2475
+ },
2476
+ // Type
2477
+ NamedType: {
2478
+ leave: ({ name: e }) => e
2479
+ },
2480
+ ListType: {
2481
+ leave: ({ type: e }) => "[" + e + "]"
2482
+ },
2483
+ NonNullType: {
2484
+ leave: ({ type: e }) => e + "!"
2485
+ },
2486
+ // Type System Definitions
2487
+ SchemaDefinition: {
2488
+ leave: ({ description: e, directives: t, operationTypes: n }) => v("", e, `
2489
+ `) + p(["schema", p(t, " "), F(n)], " ")
2490
+ },
2491
+ OperationTypeDefinition: {
2492
+ leave: ({ operation: e, type: t }) => e + ": " + t
2493
+ },
2494
+ ScalarTypeDefinition: {
2495
+ leave: ({ description: e, name: t, directives: n }) => v("", e, `
2496
+ `) + p(["scalar", t, p(n, " ")], " ")
2497
+ },
2498
+ ObjectTypeDefinition: {
2499
+ leave: ({ description: e, name: t, interfaces: n, directives: r, fields: i }) => v("", e, `
2500
+ `) + p(
2501
+ [
2502
+ "type",
2503
+ t,
2504
+ v("implements ", p(n, " & ")),
2505
+ p(r, " "),
2506
+ F(i)
2507
+ ],
2508
+ " "
2509
+ )
2510
+ },
2511
+ FieldDefinition: {
2512
+ leave: ({ description: e, name: t, arguments: n, type: r, directives: i }) => v("", e, `
2513
+ `) + t + (lt(n) ? v(`(
2514
+ `, pe(p(n, `
2515
+ `)), `
2516
+ )`) : v("(", p(n, ", "), ")")) + ": " + r + v(" ", p(i, " "))
2517
+ },
2518
+ InputValueDefinition: {
2519
+ leave: ({ description: e, name: t, type: n, defaultValue: r, directives: i }) => v("", e, `
2520
+ `) + p(
2521
+ [t + ": " + n, v("= ", r), p(i, " ")],
2522
+ " "
2523
+ )
2524
+ },
2525
+ InterfaceTypeDefinition: {
2526
+ leave: ({ description: e, name: t, interfaces: n, directives: r, fields: i }) => v("", e, `
2527
+ `) + p(
2528
+ [
2529
+ "interface",
2530
+ t,
2531
+ v("implements ", p(n, " & ")),
2532
+ p(r, " "),
2533
+ F(i)
2534
+ ],
2535
+ " "
2536
+ )
2537
+ },
2538
+ UnionTypeDefinition: {
2539
+ leave: ({ description: e, name: t, directives: n, types: r }) => v("", e, `
2540
+ `) + p(
2541
+ ["union", t, p(n, " "), v("= ", p(r, " | "))],
2542
+ " "
2543
+ )
2544
+ },
2545
+ EnumTypeDefinition: {
2546
+ leave: ({ description: e, name: t, directives: n, values: r }) => v("", e, `
2547
+ `) + p(["enum", t, p(n, " "), F(r)], " ")
2548
+ },
2549
+ EnumValueDefinition: {
2550
+ leave: ({ description: e, name: t, directives: n }) => v("", e, `
2551
+ `) + p([t, p(n, " ")], " ")
2552
+ },
2553
+ InputObjectTypeDefinition: {
2554
+ leave: ({ description: e, name: t, directives: n, fields: r }) => v("", e, `
2555
+ `) + p(["input", t, p(n, " "), F(r)], " ")
2556
+ },
2557
+ DirectiveDefinition: {
2558
+ leave: ({ description: e, name: t, arguments: n, repeatable: r, locations: i }) => v("", e, `
2559
+ `) + "directive @" + t + (lt(n) ? v(`(
2560
+ `, pe(p(n, `
2561
+ `)), `
2562
+ )`) : v("(", p(n, ", "), ")")) + (r ? " repeatable" : "") + " on " + p(i, " | ")
2563
+ },
2564
+ SchemaExtension: {
2565
+ leave: ({ directives: e, operationTypes: t }) => p(
2566
+ ["extend schema", p(e, " "), F(t)],
2567
+ " "
2568
+ )
2569
+ },
2570
+ ScalarTypeExtension: {
2571
+ leave: ({ name: e, directives: t }) => p(["extend scalar", e, p(t, " ")], " ")
2572
+ },
2573
+ ObjectTypeExtension: {
2574
+ leave: ({ name: e, interfaces: t, directives: n, fields: r }) => p(
2575
+ [
2576
+ "extend type",
2577
+ e,
2578
+ v("implements ", p(t, " & ")),
2579
+ p(n, " "),
2580
+ F(r)
2581
+ ],
2582
+ " "
2583
+ )
2584
+ },
2585
+ InterfaceTypeExtension: {
2586
+ leave: ({ name: e, interfaces: t, directives: n, fields: r }) => p(
2587
+ [
2588
+ "extend interface",
2589
+ e,
2590
+ v("implements ", p(t, " & ")),
2591
+ p(n, " "),
2592
+ F(r)
2593
+ ],
2594
+ " "
2595
+ )
2596
+ },
2597
+ UnionTypeExtension: {
2598
+ leave: ({ name: e, directives: t, types: n }) => p(
2599
+ [
2600
+ "extend union",
2601
+ e,
2602
+ p(t, " "),
2603
+ v("= ", p(n, " | "))
2604
+ ],
2605
+ " "
2606
+ )
2607
+ },
2608
+ EnumTypeExtension: {
2609
+ leave: ({ name: e, directives: t, values: n }) => p(["extend enum", e, p(t, " "), F(n)], " ")
2610
+ },
2611
+ InputObjectTypeExtension: {
2612
+ leave: ({ name: e, directives: t, fields: n }) => p(["extend input", e, p(t, " "), F(n)], " ")
2613
+ }
2614
+ };
2615
+ function p(e, t = "") {
2616
+ var n;
2617
+ return (n = e == null ? void 0 : e.filter((r) => r).join(t)) !== null && n !== void 0 ? n : "";
2618
+ }
2619
+ function F(e) {
2620
+ return v(`{
2621
+ `, pe(p(e, `
2622
+ `)), `
2623
+ }`);
2624
+ }
2625
+ function v(e, t, n = "") {
2626
+ return t != null && t !== "" ? e + t + n : "";
2627
+ }
2628
+ function pe(e) {
2629
+ return v(" ", e.replace(/\n/g, `
2630
+ `));
2631
+ }
2632
+ function lt(e) {
2633
+ var t;
2634
+ return (t = e == null ? void 0 : e.some((n) => n.includes(`
2635
+ `))) !== null && t !== void 0 ? t : !1;
2636
+ }
2637
+ const We = JSON, Qn = (e) => e.toUpperCase(), Kn = (e) => {
2638
+ const t = {};
2639
+ return e.forEach((n, r) => {
2640
+ t[r] = n;
2641
+ }), t;
2642
+ }, Wn = (e, t, n) => e.document ? e : {
2643
+ document: e,
2644
+ variables: t,
2645
+ requestHeaders: n,
2646
+ signal: void 0
2647
+ }, Zn = (e, t, n) => e.query ? e : {
2648
+ query: e,
2649
+ variables: t,
2650
+ requestHeaders: n,
2651
+ signal: void 0
2652
+ }, er = (e, t) => e.documents ? e : {
2653
+ documents: e,
2654
+ requestHeaders: t,
2655
+ signal: void 0
2656
+ }, ft = (e) => {
2657
+ var r, i;
2658
+ let t;
2659
+ const n = e.definitions.filter((s) => s.kind === "OperationDefinition");
2660
+ return n.length === 1 && (t = (i = (r = n[0]) == null ? void 0 : r.name) == null ? void 0 : i.value), t;
2661
+ }, Re = (e) => {
2662
+ if (typeof e == "string") {
2663
+ let n;
2664
+ try {
2665
+ const r = Rt(e);
2666
+ n = ft(r);
2667
+ } catch (r) {
2668
+ }
2669
+ return { query: e, operationName: n };
2670
+ }
2671
+ const t = ft(e);
2672
+ return { query: zn(e), operationName: t };
2673
+ };
2674
+ class X extends Error {
2675
+ constructor(t, n) {
2676
+ const r = `${X.extractMessage(t)}: ${JSON.stringify({
2677
+ response: t,
2678
+ request: n
2679
+ })}`;
2680
+ super(r), Object.setPrototypeOf(this, X.prototype), this.response = t, this.request = n, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(this, X);
2681
+ }
2682
+ static extractMessage(t) {
2683
+ var n, r, i;
2684
+ return (i = (r = (n = t.errors) == null ? void 0 : n[0]) == null ? void 0 : r.message) != null ? i : `GraphQL Error (Code: ${t.status})`;
2685
+ }
2686
+ }
2687
+ var tr = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {};
2688
+ function Ze(e) {
2689
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
2690
+ }
2691
+ var je = { exports: {} };
2692
+ (function(e, t) {
2693
+ var n = typeof self != "undefined" ? self : tr, r = function() {
2694
+ function s() {
2695
+ this.fetch = !1, this.DOMException = n.DOMException;
2696
+ }
2697
+ return s.prototype = n, new s();
2698
+ }();
2699
+ (function(s) {
2700
+ (function(o) {
2701
+ var a = {
2702
+ searchParams: "URLSearchParams" in s,
2703
+ iterable: "Symbol" in s && "iterator" in Symbol,
2704
+ blob: "FileReader" in s && "Blob" in s && function() {
2705
+ try {
2706
+ return new Blob(), !0;
2707
+ } catch (u) {
2708
+ return !1;
2709
+ }
2710
+ }(),
2711
+ formData: "FormData" in s,
2712
+ arrayBuffer: "ArrayBuffer" in s
2713
+ };
2714
+ function c(u) {
2715
+ return u && DataView.prototype.isPrototypeOf(u);
2716
+ }
2717
+ if (a.arrayBuffer)
2718
+ var f = [
2719
+ "[object Int8Array]",
2720
+ "[object Uint8Array]",
2721
+ "[object Uint8ClampedArray]",
2722
+ "[object Int16Array]",
2723
+ "[object Uint16Array]",
2724
+ "[object Int32Array]",
2725
+ "[object Uint32Array]",
2726
+ "[object Float32Array]",
2727
+ "[object Float64Array]"
2728
+ ], h = ArrayBuffer.isView || function(u) {
2729
+ return u && f.indexOf(Object.prototype.toString.call(u)) > -1;
2730
+ };
2731
+ function m(u) {
2732
+ if (typeof u != "string" && (u = String(u)), /[^a-z0-9\-#$%&'*+.^_`|~]/i.test(u))
2733
+ throw new TypeError("Invalid character in header field name");
2734
+ return u.toLowerCase();
2735
+ }
2736
+ function E(u) {
2737
+ return typeof u != "string" && (u = String(u)), u;
2738
+ }
2739
+ function S(u) {
2740
+ var d = {
2741
+ next: function() {
2742
+ var T = u.shift();
2743
+ return { done: T === void 0, value: T };
2744
+ }
2745
+ };
2746
+ return a.iterable && (d[Symbol.iterator] = function() {
2747
+ return d;
2748
+ }), d;
2749
+ }
2750
+ function y(u) {
2751
+ this.map = {}, u instanceof y ? u.forEach(function(d, T) {
2752
+ this.append(T, d);
2753
+ }, this) : Array.isArray(u) ? u.forEach(function(d) {
2754
+ this.append(d[0], d[1]);
2755
+ }, this) : u && Object.getOwnPropertyNames(u).forEach(function(d) {
2756
+ this.append(d, u[d]);
2757
+ }, this);
2758
+ }
2759
+ y.prototype.append = function(u, d) {
2760
+ u = m(u), d = E(d);
2761
+ var T = this.map[u];
2762
+ this.map[u] = T ? T + ", " + d : d;
2763
+ }, y.prototype.delete = function(u) {
2764
+ delete this.map[m(u)];
2765
+ }, y.prototype.get = function(u) {
2766
+ return u = m(u), this.has(u) ? this.map[u] : null;
2767
+ }, y.prototype.has = function(u) {
2768
+ return this.map.hasOwnProperty(m(u));
2769
+ }, y.prototype.set = function(u, d) {
2770
+ this.map[m(u)] = E(d);
2771
+ }, y.prototype.forEach = function(u, d) {
2772
+ for (var T in this.map)
2773
+ this.map.hasOwnProperty(T) && u.call(d, this.map[T], T, this);
2774
+ }, y.prototype.keys = function() {
2775
+ var u = [];
2776
+ return this.forEach(function(d, T) {
2777
+ u.push(T);
2778
+ }), S(u);
2779
+ }, y.prototype.values = function() {
2780
+ var u = [];
2781
+ return this.forEach(function(d) {
2782
+ u.push(d);
2783
+ }), S(u);
2784
+ }, y.prototype.entries = function() {
2785
+ var u = [];
2786
+ return this.forEach(function(d, T) {
2787
+ u.push([T, d]);
2788
+ }), S(u);
2789
+ }, a.iterable && (y.prototype[Symbol.iterator] = y.prototype.entries);
2790
+ function N(u) {
2791
+ if (u.bodyUsed)
2792
+ return Promise.reject(new TypeError("Already read"));
2793
+ u.bodyUsed = !0;
2794
+ }
2795
+ function b(u) {
2796
+ return new Promise(function(d, T) {
2797
+ u.onload = function() {
2798
+ d(u.result);
2799
+ }, u.onerror = function() {
2800
+ T(u.error);
2801
+ };
2802
+ });
2803
+ }
2804
+ function x(u) {
2805
+ var d = new FileReader(), T = b(d);
2806
+ return d.readAsArrayBuffer(u), T;
2807
+ }
2808
+ function V(u) {
2809
+ var d = new FileReader(), T = b(d);
2810
+ return d.readAsText(u), T;
2811
+ }
2812
+ function k(u) {
2813
+ for (var d = new Uint8Array(u), T = new Array(d.length), w = 0; w < d.length; w++)
2814
+ T[w] = String.fromCharCode(d[w]);
2815
+ return T.join("");
2816
+ }
2817
+ function P(u) {
2818
+ if (u.slice)
2819
+ return u.slice(0);
2820
+ var d = new Uint8Array(u.byteLength);
2821
+ return d.set(new Uint8Array(u)), d.buffer;
2822
+ }
2823
+ function j() {
2824
+ return this.bodyUsed = !1, this._initBody = function(u) {
2825
+ this._bodyInit = u, u ? typeof u == "string" ? this._bodyText = u : a.blob && Blob.prototype.isPrototypeOf(u) ? this._bodyBlob = u : a.formData && FormData.prototype.isPrototypeOf(u) ? this._bodyFormData = u : a.searchParams && URLSearchParams.prototype.isPrototypeOf(u) ? this._bodyText = u.toString() : a.arrayBuffer && a.blob && c(u) ? (this._bodyArrayBuffer = P(u.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : a.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(u) || h(u)) ? this._bodyArrayBuffer = P(u) : this._bodyText = u = Object.prototype.toString.call(u) : this._bodyText = "", this.headers.get("content-type") || (typeof u == "string" ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : a.searchParams && URLSearchParams.prototype.isPrototypeOf(u) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
2826
+ }, a.blob && (this.blob = function() {
2827
+ var u = N(this);
2828
+ if (u)
2829
+ return u;
2830
+ if (this._bodyBlob)
2831
+ return Promise.resolve(this._bodyBlob);
2832
+ if (this._bodyArrayBuffer)
2833
+ return Promise.resolve(new Blob([this._bodyArrayBuffer]));
2834
+ if (this._bodyFormData)
2835
+ throw new Error("could not read FormData body as blob");
2836
+ return Promise.resolve(new Blob([this._bodyText]));
2837
+ }, this.arrayBuffer = function() {
2838
+ return this._bodyArrayBuffer ? N(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(x);
2839
+ }), this.text = function() {
2840
+ var u = N(this);
2841
+ if (u)
2842
+ return u;
2843
+ if (this._bodyBlob)
2844
+ return V(this._bodyBlob);
2845
+ if (this._bodyArrayBuffer)
2846
+ return Promise.resolve(k(this._bodyArrayBuffer));
2847
+ if (this._bodyFormData)
2848
+ throw new Error("could not read FormData body as text");
2849
+ return Promise.resolve(this._bodyText);
2850
+ }, a.formData && (this.formData = function() {
2851
+ return this.text().then(Wt);
2852
+ }), this.json = function() {
2853
+ return this.text().then(JSON.parse);
2854
+ }, this;
2855
+ }
2856
+ var se = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];
2857
+ function oe(u) {
2858
+ var d = u.toUpperCase();
2859
+ return se.indexOf(d) > -1 ? d : u;
2860
+ }
2861
+ function $(u, d) {
2862
+ d = d || {};
2863
+ var T = d.body;
2864
+ if (u instanceof $) {
2865
+ if (u.bodyUsed)
2866
+ throw new TypeError("Already read");
2867
+ this.url = u.url, this.credentials = u.credentials, d.headers || (this.headers = new y(u.headers)), this.method = u.method, this.mode = u.mode, this.signal = u.signal, !T && u._bodyInit != null && (T = u._bodyInit, u.bodyUsed = !0);
2868
+ } else
2869
+ this.url = String(u);
2870
+ if (this.credentials = d.credentials || this.credentials || "same-origin", (d.headers || !this.headers) && (this.headers = new y(d.headers)), this.method = oe(d.method || this.method || "GET"), this.mode = d.mode || this.mode || null, this.signal = d.signal || this.signal, this.referrer = null, (this.method === "GET" || this.method === "HEAD") && T)
2871
+ throw new TypeError("Body not allowed for GET or HEAD requests");
2872
+ this._initBody(T);
2873
+ }
2874
+ $.prototype.clone = function() {
2875
+ return new $(this, { body: this._bodyInit });
2876
+ };
2877
+ function Wt(u) {
2878
+ var d = new FormData();
2879
+ return u.trim().split("&").forEach(function(T) {
2880
+ if (T) {
2881
+ var w = T.split("="), D = w.shift().replace(/\+/g, " "), A = w.join("=").replace(/\+/g, " ");
2882
+ d.append(decodeURIComponent(D), decodeURIComponent(A));
2883
+ }
2884
+ }), d;
2885
+ }
2886
+ function Zt(u) {
2887
+ var d = new y(), T = u.replace(/\r?\n[\t ]+/g, " ");
2888
+ return T.split(/\r?\n/).forEach(function(w) {
2889
+ var D = w.split(":"), A = D.shift().trim();
2890
+ if (A) {
2891
+ var ae = D.join(":").trim();
2892
+ d.append(A, ae);
2893
+ }
2894
+ }), d;
2895
+ }
2896
+ j.call($.prototype);
2897
+ function M(u, d) {
2898
+ d || (d = {}), this.type = "default", this.status = d.status === void 0 ? 200 : d.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = "statusText" in d ? d.statusText : "OK", this.headers = new y(d.headers), this.url = d.url || "", this._initBody(u);
2899
+ }
2900
+ j.call(M.prototype), M.prototype.clone = function() {
2901
+ return new M(this._bodyInit, {
2902
+ status: this.status,
2903
+ statusText: this.statusText,
2904
+ headers: new y(this.headers),
2905
+ url: this.url
2906
+ });
2907
+ }, M.error = function() {
2908
+ var u = new M(null, { status: 0, statusText: "" });
2909
+ return u.type = "error", u;
2910
+ };
2911
+ var en = [301, 302, 303, 307, 308];
2912
+ M.redirect = function(u, d) {
2913
+ if (en.indexOf(d) === -1)
2914
+ throw new RangeError("Invalid status code");
2915
+ return new M(null, { status: d, headers: { location: u } });
2916
+ }, o.DOMException = s.DOMException;
2917
+ try {
2918
+ new o.DOMException();
2919
+ } catch (u) {
2920
+ o.DOMException = function(d, T) {
2921
+ this.message = d, this.name = T;
2922
+ var w = Error(d);
2923
+ this.stack = w.stack;
2924
+ }, o.DOMException.prototype = Object.create(Error.prototype), o.DOMException.prototype.constructor = o.DOMException;
2925
+ }
2926
+ function be(u, d) {
2927
+ return new Promise(function(T, w) {
2928
+ var D = new $(u, d);
2929
+ if (D.signal && D.signal.aborted)
2930
+ return w(new o.DOMException("Aborted", "AbortError"));
2931
+ var A = new XMLHttpRequest();
2932
+ function ae() {
2933
+ A.abort();
2934
+ }
2935
+ A.onload = function() {
2936
+ var te = {
2937
+ status: A.status,
2938
+ statusText: A.statusText,
2939
+ headers: Zt(A.getAllResponseHeaders() || "")
2940
+ };
2941
+ te.url = "responseURL" in A ? A.responseURL : te.headers.get("X-Request-URL");
2942
+ var xe = "response" in A ? A.response : A.responseText;
2943
+ T(new M(xe, te));
2944
+ }, A.onerror = function() {
2945
+ w(new TypeError("Network request failed"));
2946
+ }, A.ontimeout = function() {
2947
+ w(new TypeError("Network request failed"));
2948
+ }, A.onabort = function() {
2949
+ w(new o.DOMException("Aborted", "AbortError"));
2950
+ }, A.open(D.method, D.url, !0), D.credentials === "include" ? A.withCredentials = !0 : D.credentials === "omit" && (A.withCredentials = !1), "responseType" in A && a.blob && (A.responseType = "blob"), D.headers.forEach(function(te, xe) {
2951
+ A.setRequestHeader(xe, te);
2952
+ }), D.signal && (D.signal.addEventListener("abort", ae), A.onreadystatechange = function() {
2953
+ A.readyState === 4 && D.signal.removeEventListener("abort", ae);
2954
+ }), A.send(typeof D._bodyInit == "undefined" ? null : D._bodyInit);
2955
+ });
2956
+ }
2957
+ return be.polyfill = !0, s.fetch || (s.fetch = be, s.Headers = y, s.Request = $, s.Response = M), o.Headers = y, o.Request = $, o.Response = M, o.fetch = be, Object.defineProperty(o, "__esModule", { value: !0 }), o;
2958
+ })({});
2959
+ })(r), r.fetch.ponyfill = !0, delete r.fetch.polyfill;
2960
+ var i = r;
2961
+ t = i.fetch, t.default = i.fetch, t.fetch = i.fetch, t.Headers = i.Headers, t.Request = i.Request, t.Response = i.Response, e.exports = t;
2962
+ })(je, je.exports);
2963
+ var qe = je.exports;
2964
+ const me = /* @__PURE__ */ Ze(qe), nr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2965
+ __proto__: null,
2966
+ default: me
2967
+ }, Symbol.toStringTag, { value: "Module" })), Y = (e) => {
2968
+ let t = {};
2969
+ return e && (typeof Headers != "undefined" && e instanceof Headers || nr && qe.Headers && e instanceof qe.Headers ? t = Kn(e) : Array.isArray(e) ? e.forEach(([n, r]) => {
2970
+ n && r !== void 0 && (t[n] = r);
2971
+ }) : t = e), t;
2972
+ }, ht = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), rr = (e) => {
2973
+ if (!Array.isArray(e.query)) {
2974
+ const r = e, i = [`query=${encodeURIComponent(ht(r.query))}`];
2975
+ return e.variables && i.push(`variables=${encodeURIComponent(r.jsonSerializer.stringify(r.variables))}`), r.operationName && i.push(`operationName=${encodeURIComponent(r.operationName)}`), i.join("&");
2976
+ }
2977
+ if (typeof e.variables != "undefined" && !Array.isArray(e.variables))
2978
+ throw new Error("Cannot create query with given variable type, array expected");
2979
+ const t = e, n = e.query.reduce((r, i, s) => (r.push({
2980
+ query: ht(i),
2981
+ variables: t.variables ? t.jsonSerializer.stringify(t.variables[s]) : void 0
2982
+ }), r), []);
2983
+ return `query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`;
2984
+ }, ir = (e) => (t) => U(void 0, null, function* () {
2985
+ var N;
2986
+ const { url: n, query: r, variables: i, operationName: s, fetch: o, fetchOptions: a, middleware: c } = t, f = _({}, t.headers);
2987
+ let h = "", m;
2988
+ e === "POST" ? (m = sr(r, i, s, a.jsonSerializer), typeof m == "string" && (f["Content-Type"] = "application/json")) : h = rr({
2989
+ query: r,
2990
+ variables: i,
2991
+ operationName: s,
2992
+ jsonSerializer: (N = a.jsonSerializer) != null ? N : We
2993
+ });
2994
+ const E = _({
2995
+ method: e,
2996
+ headers: f,
2997
+ body: m
2998
+ }, a);
2999
+ let S = n, y = E;
3000
+ if (c) {
3001
+ const b = yield Promise.resolve(c(q(_({}, E), { url: n, operationName: s, variables: i }))), { url: V } = b, k = H(b, ["url"]);
3002
+ S = V, y = k;
3003
+ }
3004
+ return h && (S = `${S}?${h}`), yield o(S, y);
3005
+ });
3006
+ class vi {
3007
+ constructor(t, n = {}) {
3008
+ this.url = t, this.requestConfig = n, this.rawRequest = (...r) => U(this, null, function* () {
3009
+ const [i, s, o] = r, a = Zn(i, s, o), b = this.requestConfig, { headers: c, fetch: f = me, method: h = "POST", requestMiddleware: m, responseMiddleware: E } = b, S = H(b, ["headers", "fetch", "method", "requestMiddleware", "responseMiddleware"]), { url: y } = this;
3010
+ a.signal !== void 0 && (S.signal = a.signal);
3011
+ const { operationName: N } = Re(a.query);
3012
+ return ke({
3013
+ url: y,
3014
+ query: a.query,
3015
+ variables: a.variables,
3016
+ headers: _(_({}, Y(Le(c))), Y(a.requestHeaders)),
3017
+ operationName: N,
3018
+ fetch: f,
3019
+ method: h,
3020
+ fetchOptions: S,
3021
+ middleware: m
3022
+ }).then((x) => (E && E(x), x)).catch((x) => {
3023
+ throw E && E(x), x;
3024
+ });
3025
+ });
3026
+ }
3027
+ request(t, ...n) {
3028
+ return U(this, null, function* () {
3029
+ const [r, i] = n, s = Wn(t, r, i), N = this.requestConfig, { headers: o, fetch: a = me, method: c = "POST", requestMiddleware: f, responseMiddleware: h } = N, m = H(N, ["headers", "fetch", "method", "requestMiddleware", "responseMiddleware"]), { url: E } = this;
3030
+ s.signal !== void 0 && (m.signal = s.signal);
3031
+ const { query: S, operationName: y } = Re(s.document);
3032
+ return ke({
3033
+ url: E,
3034
+ query: S,
3035
+ variables: s.variables,
3036
+ headers: _(_({}, Y(Le(o))), Y(s.requestHeaders)),
3037
+ operationName: y,
3038
+ fetch: a,
3039
+ method: c,
3040
+ fetchOptions: m,
3041
+ middleware: f
3042
+ }).then((b) => (h && h(b), b.data)).catch((b) => {
3043
+ throw h && h(b), b;
3044
+ });
3045
+ });
3046
+ }
3047
+ // prettier-ignore
3048
+ batchRequests(t, n) {
3049
+ var f;
3050
+ const r = er(t, n), c = this.requestConfig, { headers: i } = c, s = H(c, ["headers"]);
3051
+ r.signal !== void 0 && (s.signal = r.signal);
3052
+ const o = r.documents.map(({ document: h }) => Re(h).query), a = r.documents.map(({ variables: h }) => h);
3053
+ return ke({
3054
+ url: this.url,
3055
+ query: o,
3056
+ // @ts-expect-error TODO reconcile batch variables into system.
3057
+ variables: a,
3058
+ headers: _(_({}, Y(Le(i))), Y(r.requestHeaders)),
3059
+ operationName: void 0,
3060
+ fetch: (f = this.requestConfig.fetch) != null ? f : me,
3061
+ method: this.requestConfig.method || "POST",
3062
+ fetchOptions: s,
3063
+ middleware: this.requestConfig.requestMiddleware
3064
+ }).then((h) => (this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(h), h.data)).catch((h) => {
3065
+ throw this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(h), h;
3066
+ });
3067
+ }
3068
+ setHeaders(t) {
3069
+ return this.requestConfig.headers = t, this;
3070
+ }
3071
+ /**
3072
+ * Attach a header to the client. All subsequent requests will have this header.
3073
+ */
3074
+ setHeader(t, n) {
3075
+ const { headers: r } = this.requestConfig;
3076
+ return r ? r[t] = n : this.requestConfig.headers = { [t]: n }, this;
3077
+ }
3078
+ /**
3079
+ * Change the client endpoint. All subsequent requests will send to this endpoint.
3080
+ */
3081
+ setEndpoint(t) {
3082
+ return this.url = t, this;
3083
+ }
3084
+ }
3085
+ const ke = (e) => U(void 0, null, function* () {
3086
+ var h, m;
3087
+ const { query: t, variables: n, fetchOptions: r } = e, i = ir(Qn((h = e.method) != null ? h : "post")), s = Array.isArray(e.query), o = yield i(e), a = yield or(o, (m = r.jsonSerializer) != null ? m : We), c = Array.isArray(a) ? !a.some(({ data: S }) => !S) : !!a.data, f = Array.isArray(a) || !a.errors || Array.isArray(a.errors) && !a.errors.length || r.errorPolicy === "all" || r.errorPolicy === "ignore";
3088
+ if (o.ok && f && c) {
3089
+ const E = (Array.isArray(a), a), { errors: S } = E, y = H(E, ["errors"]), N = r.errorPolicy === "ignore" ? y : a;
3090
+ return q(_({}, s ? { data: N } : N), {
3091
+ headers: o.headers,
3092
+ status: o.status
3093
+ });
3094
+ } else {
3095
+ const S = typeof a == "string" ? {
3096
+ error: a
3097
+ } : a;
3098
+ throw new X(
3099
+ // @ts-expect-error TODO
3100
+ q(_({}, S), { status: o.status, headers: o.headers }),
3101
+ { query: t, variables: n }
3102
+ );
3103
+ }
3104
+ }), sr = (e, t, n, r) => {
3105
+ const i = r != null ? r : We;
3106
+ if (!Array.isArray(e))
3107
+ return i.stringify({ query: e, variables: t, operationName: n });
3108
+ if (typeof t != "undefined" && !Array.isArray(t))
3109
+ throw new Error("Cannot create request body with given variable type, array expected");
3110
+ const s = e.reduce((o, a, c) => (o.push({ query: a, variables: t ? t[c] : void 0 }), o), []);
3111
+ return i.stringify(s);
3112
+ }, or = (e, t) => U(void 0, null, function* () {
3113
+ let n;
3114
+ return e.headers.forEach((r, i) => {
3115
+ i.toLowerCase() === "content-type" && (n = r);
3116
+ }), n && (n.toLowerCase().startsWith("application/json") || n.toLowerCase().startsWith("application/graphql+json") || n.toLowerCase().startsWith("application/graphql-response+json")) ? t.parse(yield e.text()) : e.text();
3117
+ }), Le = (e) => typeof e == "function" ? e() : e;
3118
+ var He = { exports: {} };
3119
+ (function(e, t) {
3120
+ t = e.exports = n, t.getSerialize = r;
3121
+ function n(i, s, o, a) {
3122
+ return JSON.stringify(i, r(s, a), o);
3123
+ }
3124
+ function r(i, s) {
3125
+ var o = [], a = [];
3126
+ return s == null && (s = function(c, f) {
3127
+ return o[0] === f ? "[Circular ~]" : "[Circular ~." + a.slice(0, o.indexOf(f)).join(".") + "]";
3128
+ }), function(c, f) {
3129
+ if (o.length > 0) {
3130
+ var h = o.indexOf(this);
3131
+ ~h ? o.splice(h + 1) : o.push(this), ~h ? a.splice(h, 1 / 0, c) : a.push(c), ~o.indexOf(f) && (f = s.call(this, c, f));
3132
+ } else o.push(f);
3133
+ return i == null ? f : i.call(this, c, f);
3134
+ };
3135
+ }
3136
+ })(He, He.exports);
3137
+ var ar = He.exports;
3138
+ const Si = /* @__PURE__ */ Ze(ar);
3139
+ var ye = function() {
3140
+ return ye = Object.assign || function(t) {
3141
+ for (var n, r = 1, i = arguments.length; r < i; r++) {
3142
+ n = arguments[r];
3143
+ for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
3144
+ }
3145
+ return t;
3146
+ }, ye.apply(this, arguments);
3147
+ }, ge = /* @__PURE__ */ new Map(), Ge = /* @__PURE__ */ new Map(), Lt = !0, Ee = !1;
3148
+ function Pt(e) {
3149
+ return e.replace(/[\s,]+/g, " ").trim();
3150
+ }
3151
+ function cr(e) {
3152
+ return Pt(e.source.body.substring(e.start, e.end));
3153
+ }
3154
+ function ur(e) {
3155
+ var t = /* @__PURE__ */ new Set(), n = [];
3156
+ return e.definitions.forEach(function(r) {
3157
+ if (r.kind === "FragmentDefinition") {
3158
+ var i = r.name.value, s = cr(r.loc), o = Ge.get(i);
3159
+ o && !o.has(s) ? Lt && console.warn("Warning: fragment with name " + i + ` already exists.
3160
+ graphql-tag enforces all fragment names across your application to be unique; read more about
3161
+ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : o || Ge.set(i, o = /* @__PURE__ */ new Set()), o.add(s), t.has(s) || (t.add(s), n.push(r));
3162
+ } else
3163
+ n.push(r);
3164
+ }), ye(ye({}, e), { definitions: n });
3165
+ }
3166
+ function lr(e) {
3167
+ var t = new Set(e.definitions);
3168
+ t.forEach(function(r) {
3169
+ r.loc && delete r.loc, Object.keys(r).forEach(function(i) {
3170
+ var s = r[i];
3171
+ s && typeof s == "object" && t.add(s);
3172
+ });
3173
+ });
3174
+ var n = e.loc;
3175
+ return n && (delete n.startToken, delete n.endToken), e;
3176
+ }
3177
+ function fr(e) {
3178
+ var t = Pt(e);
3179
+ if (!ge.has(t)) {
3180
+ var n = Rt(e, {
3181
+ experimentalFragmentVariables: Ee,
3182
+ allowLegacyFragmentVariables: Ee
3183
+ });
3184
+ if (!n || n.kind !== "Document")
3185
+ throw new Error("Not a valid GraphQL document.");
3186
+ ge.set(t, lr(ur(n)));
3187
+ }
3188
+ return ge.get(t);
3189
+ }
3190
+ function R(e) {
3191
+ for (var t = [], n = 1; n < arguments.length; n++)
3192
+ t[n - 1] = arguments[n];
3193
+ typeof e == "string" && (e = [e]);
3194
+ var r = e[0];
3195
+ return t.forEach(function(i, s) {
3196
+ i && i.kind === "Document" ? r += i.loc.source.body : r += i, r += e[s + 1];
3197
+ }), fr(r);
3198
+ }
3199
+ function hr() {
3200
+ ge.clear(), Ge.clear();
3201
+ }
3202
+ function dr() {
3203
+ Lt = !1;
3204
+ }
3205
+ function pr() {
3206
+ Ee = !0;
3207
+ }
3208
+ function mr() {
3209
+ Ee = !1;
3210
+ }
3211
+ var ne = {
3212
+ gql: R,
3213
+ resetCaches: hr,
3214
+ disableFragmentWarnings: dr,
3215
+ enableExperimentalFragmentVariables: pr,
3216
+ disableExperimentalFragmentVariables: mr
3217
+ };
3218
+ (function(e) {
3219
+ e.gql = ne.gql, e.resetCaches = ne.resetCaches, e.disableFragmentWarnings = ne.disableFragmentWarnings, e.enableExperimentalFragmentVariables = ne.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = ne.disableExperimentalFragmentVariables;
3220
+ })(R || (R = {}));
3221
+ R.default = R;
3222
+ const Ft = R`
3223
+ fragment MatchParts on MatchConfig {
3224
+ regexValue
3225
+ matchValue
3226
+ }
3227
+ `, gr = R`
3228
+ mutation PushPayload(
3229
+ $session_secure_id: String!
3230
+ $payload_id: ID!
3231
+ $events: ReplayEventsInput!
3232
+ $messages: String!
3233
+ $resources: String!
3234
+ $web_socket_events: String!
3235
+ $errors: [ErrorObjectInput]!
3236
+ $is_beacon: Boolean
3237
+ $has_session_unloaded: Boolean
3238
+ $highlight_logs: String
3239
+ ) {
3240
+ pushPayload(
3241
+ session_secure_id: $session_secure_id
3242
+ payload_id: $payload_id
3243
+ events: $events
3244
+ messages: $messages
3245
+ resources: $resources
3246
+ web_socket_events: $web_socket_events
3247
+ errors: $errors
3248
+ is_beacon: $is_beacon
3249
+ has_session_unloaded: $has_session_unloaded
3250
+ highlight_logs: $highlight_logs
3251
+ )
3252
+ }
3253
+ `, yr = R`
3254
+ mutation PushSessionEvents(
3255
+ $session_secure_id: String!
3256
+ $payload_id: Int64ID!
3257
+ $data: String!
3258
+ ) {
3259
+ pushSessionEvents(
3260
+ session_secure_id: $session_secure_id
3261
+ payload_id: $payload_id
3262
+ data: $data
3263
+ )
3264
+ }
3265
+ `, Er = R`
3266
+ mutation identifySession(
3267
+ $session_secure_id: String!
3268
+ $user_identifier: String!
3269
+ $user_object: Any
3270
+ ) {
3271
+ identifySession(
3272
+ session_secure_id: $session_secure_id
3273
+ user_identifier: $user_identifier
3274
+ user_object: $user_object
3275
+ )
3276
+ }
3277
+ `, _r = R`
3278
+ mutation addSessionProperties(
3279
+ $session_secure_id: String!
3280
+ $properties_object: Any
3281
+ ) {
3282
+ addSessionProperties(
3283
+ session_secure_id: $session_secure_id
3284
+ properties_object: $properties_object
3285
+ )
3286
+ }
3287
+ `, Tr = R`
3288
+ mutation pushMetrics($metrics: [MetricInput]!) {
3289
+ pushMetrics(metrics: $metrics)
3290
+ }
3291
+ `, vr = R`
3292
+ mutation addSessionFeedback(
3293
+ $session_secure_id: String!
3294
+ $user_name: String
3295
+ $user_email: String
3296
+ $verbatim: String!
3297
+ $timestamp: Timestamp!
3298
+ ) {
3299
+ addSessionFeedback(
3300
+ session_secure_id: $session_secure_id
3301
+ user_name: $user_name
3302
+ user_email: $user_email
3303
+ verbatim: $verbatim
3304
+ timestamp: $timestamp
3305
+ )
3306
+ }
3307
+ `, Sr = R`
3308
+ mutation initializeSession(
3309
+ $session_secure_id: String!
3310
+ $session_key: String
3311
+ $organization_verbose_id: String!
3312
+ $enable_strict_privacy: Boolean!
3313
+ $privacy_setting: String!
3314
+ $enable_recording_network_contents: Boolean!
3315
+ $clientVersion: String!
3316
+ $firstloadVersion: String!
3317
+ $clientConfig: String!
3318
+ $environment: String!
3319
+ $id: String!
3320
+ $appVersion: String
3321
+ $serviceName: String!
3322
+ $client_id: String!
3323
+ $network_recording_domains: [String!]
3324
+ $disable_session_recording: Boolean
3325
+ ) {
3326
+ initializeSession(
3327
+ session_secure_id: $session_secure_id
3328
+ session_key: $session_key
3329
+ organization_verbose_id: $organization_verbose_id
3330
+ enable_strict_privacy: $enable_strict_privacy
3331
+ enable_recording_network_contents: $enable_recording_network_contents
3332
+ clientVersion: $clientVersion
3333
+ firstloadVersion: $firstloadVersion
3334
+ clientConfig: $clientConfig
3335
+ environment: $environment
3336
+ appVersion: $appVersion
3337
+ serviceName: $serviceName
3338
+ fingerprint: $id
3339
+ client_id: $client_id
3340
+ network_recording_domains: $network_recording_domains
3341
+ disable_session_recording: $disable_session_recording
3342
+ privacy_setting: $privacy_setting
3343
+ ) {
3344
+ secure_id
3345
+ project_id
3346
+ sampling {
3347
+ spans {
3348
+ name {
3349
+ ...MatchParts
3350
+ }
3351
+ attributes {
3352
+ key {
3353
+ ...MatchParts
3354
+ }
3355
+ attribute {
3356
+ ...MatchParts
3357
+ }
3358
+ }
3359
+ events {
3360
+ name {
3361
+ ...MatchParts
3362
+ }
3363
+ attributes {
3364
+ key {
3365
+ ...MatchParts
3366
+ }
3367
+ attribute {
3368
+ ...MatchParts
3369
+ }
3370
+ }
3371
+ }
3372
+ samplingRatio
3373
+ }
3374
+ logs {
3375
+ message {
3376
+ ...MatchParts
3377
+ }
3378
+ severityText {
3379
+ ...MatchParts
3380
+ }
3381
+ attributes {
3382
+ key {
3383
+ ...MatchParts
3384
+ }
3385
+ attribute {
3386
+ ...MatchParts
3387
+ }
3388
+ }
3389
+ samplingRatio
3390
+ }
3391
+ }
3392
+ }
3393
+ }
3394
+ ${Ft}
3395
+ `, Ar = R`
3396
+ query Ignore($id: ID!) {
3397
+ ignore(id: $id)
3398
+ }
3399
+ `, Nr = R`
3400
+ query GetSamplingConfig($organization_verbose_id: String!) {
3401
+ sampling(organization_verbose_id: $organization_verbose_id) {
3402
+ spans {
3403
+ name {
3404
+ ...MatchParts
3405
+ }
3406
+ attributes {
3407
+ key {
3408
+ ...MatchParts
3409
+ }
3410
+ attribute {
3411
+ ...MatchParts
3412
+ }
3413
+ }
3414
+ events {
3415
+ name {
3416
+ ...MatchParts
3417
+ }
3418
+ attributes {
3419
+ key {
3420
+ ...MatchParts
3421
+ }
3422
+ attribute {
3423
+ ...MatchParts
3424
+ }
3425
+ }
3426
+ }
3427
+ samplingRatio
3428
+ }
3429
+ logs {
3430
+ message {
3431
+ ...MatchParts
3432
+ }
3433
+ severityText {
3434
+ ...MatchParts
3435
+ }
3436
+ attributes {
3437
+ key {
3438
+ ...MatchParts
3439
+ }
3440
+ attribute {
3441
+ ...MatchParts
3442
+ }
3443
+ }
3444
+ samplingRatio
3445
+ }
3446
+ }
3447
+ }
3448
+ ${Ft}
3449
+ `, Ir = (e, t, n, r) => e();
3450
+ function Ai(e, t = Ir) {
3451
+ return {
3452
+ PushPayload(n, r) {
3453
+ return t(
3454
+ (i) => e.request(
3455
+ gr,
3456
+ n,
3457
+ _(_({}, r), i)
3458
+ ),
3459
+ "PushPayload",
3460
+ "mutation",
3461
+ n
3462
+ );
3463
+ },
3464
+ PushSessionEvents(n, r) {
3465
+ return t(
3466
+ (i) => e.request(
3467
+ yr,
3468
+ n,
3469
+ _(_({}, r), i)
3470
+ ),
3471
+ "PushSessionEvents",
3472
+ "mutation",
3473
+ n
3474
+ );
3475
+ },
3476
+ identifySession(n, r) {
3477
+ return t(
3478
+ (i) => e.request(
3479
+ Er,
3480
+ n,
3481
+ _(_({}, r), i)
3482
+ ),
3483
+ "identifySession",
3484
+ "mutation",
3485
+ n
3486
+ );
3487
+ },
3488
+ addSessionProperties(n, r) {
3489
+ return t(
3490
+ (i) => e.request(
3491
+ _r,
3492
+ n,
3493
+ _(_({}, r), i)
3494
+ ),
3495
+ "addSessionProperties",
3496
+ "mutation",
3497
+ n
3498
+ );
3499
+ },
3500
+ pushMetrics(n, r) {
3501
+ return t(
3502
+ (i) => e.request(
3503
+ Tr,
3504
+ n,
3505
+ _(_({}, r), i)
3506
+ ),
3507
+ "pushMetrics",
3508
+ "mutation",
3509
+ n
3510
+ );
3511
+ },
3512
+ addSessionFeedback(n, r) {
3513
+ return t(
3514
+ (i) => e.request(
3515
+ vr,
3516
+ n,
3517
+ _(_({}, r), i)
3518
+ ),
3519
+ "addSessionFeedback",
3520
+ "mutation",
3521
+ n
3522
+ );
3523
+ },
3524
+ initializeSession(n, r) {
3525
+ return t(
3526
+ (i) => e.request(
3527
+ Sr,
3528
+ n,
3529
+ _(_({}, r), i)
3530
+ ),
3531
+ "initializeSession",
3532
+ "mutation",
3533
+ n
3534
+ );
3535
+ },
3536
+ Ignore(n, r) {
3537
+ return t(
3538
+ (i) => e.request(Ar, n, _(_({}, r), i)),
3539
+ "Ignore",
3540
+ "query",
3541
+ n
3542
+ );
3543
+ },
3544
+ GetSamplingConfig(n, r) {
3545
+ return t(
3546
+ (i) => e.request(
3547
+ Nr,
3548
+ n,
3549
+ _(_({}, r), i)
3550
+ ),
3551
+ "GetSamplingConfig",
3552
+ "query",
3553
+ n
3554
+ );
3555
+ }
3556
+ };
3557
+ }
3558
+ function Ni(e, t, n) {
3559
+ try {
3560
+ if (!(t in e))
3561
+ return () => {
3562
+ };
3563
+ const r = e[t], i = n(r);
3564
+ return typeof i == "function" && (i.prototype = i.prototype || {}, Object.defineProperties(i, {
3565
+ __rrweb_original__: {
3566
+ enumerable: !1,
3567
+ value: r
3568
+ }
3569
+ })), e[t] = i, () => {
3570
+ e[t] = r;
3571
+ };
3572
+ } catch (r) {
3573
+ return () => {
3574
+ };
3575
+ }
3576
+ }
3577
+ function br(e) {
3578
+ if (!e || !e.outerHTML)
3579
+ return "";
3580
+ let t = "";
3581
+ for (; e.parentElement; ) {
3582
+ let n = e.localName;
3583
+ if (!n)
3584
+ break;
3585
+ n = n.toLowerCase();
3586
+ let r = e.parentElement, i = [];
3587
+ if (r.children && r.children.length > 0)
3588
+ for (let s = 0; s < r.children.length; s++) {
3589
+ let o = r.children[s];
3590
+ o.localName && o.localName.toLowerCase && o.localName.toLowerCase() === n && i.push(o);
3591
+ }
3592
+ i.length > 1 && (n += ":eq(" + i.indexOf(e) + ")"), t = n + (t ? ">" + t : ""), e = r;
3593
+ }
3594
+ return t;
3595
+ }
3596
+ function Ye(e) {
3597
+ return Object.prototype.toString.call(e) === "[object Object]";
3598
+ }
3599
+ function Mt(e, t) {
3600
+ if (t === 0)
3601
+ return !0;
3602
+ const n = Object.keys(e);
3603
+ for (const r of n)
3604
+ if (Ye(e[r]) && Mt(e[r], t - 1))
3605
+ return !0;
3606
+ return !1;
3607
+ }
3608
+ function Ii(e, t) {
3609
+ const n = {
3610
+ numOfKeysLimit: 50,
3611
+ depthOfLimit: 4
3612
+ };
3613
+ Object.assign(n, t);
3614
+ const r = [], i = [];
3615
+ return JSON.stringify(e, function(a, c) {
3616
+ if (r.length > 0) {
3617
+ const f = r.indexOf(this);
3618
+ ~f ? r.splice(f + 1) : r.push(this), ~f ? i.splice(f, 1 / 0, a) : i.push(a), ~r.indexOf(c) && (r[0] === c ? c = "[Circular ~]" : c = "[Circular ~." + i.slice(0, r.indexOf(c)).join(".") + "]");
3619
+ } else
3620
+ r.push(c);
3621
+ if (c == null)
3622
+ return c;
3623
+ if (s(c))
3624
+ return o(c);
3625
+ if (c instanceof Event) {
3626
+ const f = {};
3627
+ for (const h in c) {
3628
+ const m = c[h];
3629
+ Array.isArray(m) ? f[h] = br(
3630
+ m.length ? m[0] : null
3631
+ ) : f[h] = m;
3632
+ }
3633
+ return f;
3634
+ } else {
3635
+ if (c instanceof Node)
3636
+ return c instanceof HTMLElement ? c ? c.outerHTML : "" : c.nodeName;
3637
+ if (c instanceof Error)
3638
+ return c.name + ": " + c.message;
3639
+ }
3640
+ return c;
3641
+ });
3642
+ function s(a) {
3643
+ return Ye(a) && Object.keys(a).length > n.numOfKeysLimit || typeof a == "function" ? !0 : a instanceof Event && a.isTrusted === !1 ? Object.keys(a).length === 1 : !!(Ye(a) && Mt(a, n.depthOfLimit));
3644
+ }
3645
+ function o(a) {
3646
+ let c = a.toString();
3647
+ return n.stringLengthLimit && c.length > n.stringLengthLimit && (c = `${c.slice(0, n.stringLengthLimit)}...`), c;
3648
+ }
3649
+ }
3650
+ function xr() {
3651
+ var e = document.createElement("canvas");
3652
+ return e.getContext && e.getContext("2d") ? e.toDataURL("image/webp").indexOf("data:image/webp") == 0 : !1;
3653
+ }
3654
+ function bi() {
3655
+ return xr() ? {
3656
+ type: "image/webp",
3657
+ quality: 0.9
3658
+ } : {
3659
+ type: "image/jpeg",
3660
+ quality: 0.6
3661
+ };
3662
+ }
3663
+ function xi(e) {
3664
+ return typeof e == "number" && !isNaN(e) && isFinite(e);
3665
+ }
3666
+ const Oi = "exception.message", Di = "exception.stacktrace", wi = "exception.type", Ci = "http.response.status_code", Ri = "server.address", ki = "service.name", Li = "service.version", Pi = "telemetry.sdk.name", Fi = "telemetry.sdk.version", Mi = "url.full", $i = "url.path", Ui = "url.query", Bi = "user_agent.original", Vi = 1e3, ji = 1e3 * 2, qi = 4 * 60 * 60 * 1e3, et = 15 * 60 * 1e3, Hi = {
3667
+ normal: {
3668
+ bytes: 1e7,
3669
+ time: 4 * 60 * 1e3
3670
+ },
3671
+ canvas: {
3672
+ bytes: 16e6,
3673
+ time: 5e3
3674
+ }
3675
+ }, Gi = 100, Yi = "app.highlight.io", zi = "https://app.launchdarkly.com", Ji = {
3676
+ "observability.ld-stg.launchdarkly.com": "ld-stg.launchdarkly.com",
3677
+ "observability.app.launchdarkly.com": "app.launchdarkly.com",
3678
+ "observability.app.ld.catamorphic.com": "app.ld.catamorphic.com"
3679
+ }, Xi = "/projects/default", Qi = new RegExp("pub\\.(?<domain>.+)");
3680
+ /*! js-cookie v3.0.8 | MIT */
3681
+ function le(e) {
3682
+ for (var t = 1; t < arguments.length; t++) {
3683
+ var n = arguments[t];
3684
+ for (var r in n)
3685
+ r !== "__proto__" && (e[r] = n[r]);
3686
+ }
3687
+ return e;
3688
+ }
3689
+ var Or = {
3690
+ read: function(e) {
3691
+ return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
3692
+ },
3693
+ write: function(e) {
3694
+ return encodeURIComponent(e).replace(
3695
+ /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
3696
+ decodeURIComponent
3697
+ );
3698
+ }
3699
+ };
3700
+ function ze(e, t) {
3701
+ function n(i, s, o) {
3702
+ if (typeof document != "undefined") {
3703
+ o = le({}, t, o), typeof o.expires == "number" && (o.expires = new Date(Date.now() + o.expires * 864e5)), o.expires && (o.expires = o.expires.toUTCString()), i = encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
3704
+ var a = "";
3705
+ for (var c in o)
3706
+ o[c] && (a += "; " + c, o[c] !== !0 && (a += "=" + o[c].split(";")[0]));
3707
+ return document.cookie = i + "=" + e.write(s, i) + a;
3708
+ }
3709
+ }
3710
+ function r(i) {
3711
+ if (!(typeof document == "undefined" || arguments.length && !i)) {
3712
+ for (var s = document.cookie ? document.cookie.split("; ") : [], o = {}, a = 0; a < s.length; a++) {
3713
+ var c = s[a].split("="), f = c.slice(1).join("=");
3714
+ try {
3715
+ var h = decodeURIComponent(c[0]);
3716
+ if (h in o || (o[h] = e.read(f, h)), i === h)
3717
+ break;
3718
+ } catch (m) {
3719
+ }
3720
+ }
3721
+ return i ? o[i] : o;
3722
+ }
3723
+ }
3724
+ return Object.create(
3725
+ {
3726
+ set: n,
3727
+ get: r,
3728
+ remove: function(i, s) {
3729
+ n(
3730
+ i,
3731
+ "",
3732
+ le({}, s, {
3733
+ expires: -1
3734
+ })
3735
+ );
3736
+ },
3737
+ withAttributes: function(i) {
3738
+ return ze(this.converter, le({}, this.attributes, i));
3739
+ },
3740
+ withConverter: function(i) {
3741
+ return ze(le({}, this.converter, i), this.attributes);
3742
+ }
3743
+ },
3744
+ {
3745
+ attributes: { value: Object.freeze(t) },
3746
+ converter: { value: Object.freeze(e) }
3747
+ }
3748
+ );
3749
+ }
3750
+ var fe = ze(Or, { path: "/" }), Dr = /* @__PURE__ */ ((e) => (e.CLIENT_ID = "highlightClientID", e))(Dr || {});
3751
+ let _e = "localStorage", Je = !0;
3752
+ class wr {
3753
+ constructor() {
3754
+ G(this, "storage", {});
3755
+ }
3756
+ get length() {
3757
+ return Object.keys(this.storage).length;
3758
+ }
3759
+ key(t) {
3760
+ var r;
3761
+ return (r = Object.keys(this.storage)[t]) != null ? r : null;
3762
+ }
3763
+ getItem(t) {
3764
+ var n;
3765
+ return (n = this.storage[t]) != null ? n : "";
3766
+ }
3767
+ setItem(t, n) {
3768
+ this.storage[t] = n;
3769
+ }
3770
+ removeItem(t) {
3771
+ delete this.storage[t];
3772
+ }
3773
+ }
3774
+ class Cr {
3775
+ getItem(t) {
3776
+ var n;
3777
+ return (n = fe.get(t)) != null ? n : "";
3778
+ }
3779
+ setItem(t, n) {
3780
+ if (!Je)
3781
+ return;
3782
+ const r = /* @__PURE__ */ new Date();
3783
+ r.setTime(r.getTime() + et), fe.set(t, n, { expires: r });
3784
+ }
3785
+ removeItem(t) {
3786
+ Je && fe.remove(t);
3787
+ }
3788
+ keys() {
3789
+ var t;
3790
+ return Object.keys((t = fe.get()) != null ? t : {});
3791
+ }
3792
+ }
3793
+ const Q = new wr(), W = new Cr(), Ae = () => {
3794
+ let e = null;
3795
+ if (typeof window == "undefined")
3796
+ return Q;
3797
+ try {
3798
+ switch (_e) {
3799
+ case "localStorage":
3800
+ e = window.localStorage;
3801
+ break;
3802
+ case "sessionStorage":
3803
+ e = window.sessionStorage;
3804
+ break;
3805
+ }
3806
+ e || (K(
3807
+ "storage",
3808
+ "getPersistentStorage",
3809
+ "debug",
3810
+ `persistent storage was not found for mode ${_e}; using global storage`
3811
+ ), e = Q);
3812
+ } catch (t) {
3813
+ K(
3814
+ "storage",
3815
+ "getPersistentStorage",
3816
+ "debug",
3817
+ "failed to get persistent storage; using global storage",
3818
+ t
3819
+ ), e = Q;
3820
+ }
3821
+ return e;
3822
+ }, Rr = (e) => {
3823
+ _e = e;
3824
+ }, dt = (e) => {
3825
+ Je = e;
3826
+ }, tt = (e) => {
3827
+ try {
3828
+ return Ae().getItem(e);
3829
+ } catch (t) {
3830
+ return K(
3831
+ "storage",
3832
+ "getItem",
3833
+ "debug",
3834
+ `failed to get item ${e}; using global storage`,
3835
+ t
3836
+ ), Q.getItem(e);
3837
+ }
3838
+ }, $t = (e, t) => {
3839
+ W.setItem(e, t);
3840
+ try {
3841
+ return Ae().setItem(e, t);
3842
+ } catch (n) {
3843
+ return K(
3844
+ "storage",
3845
+ "setItem",
3846
+ "debug",
3847
+ `failed to set item ${e}; using global storage`,
3848
+ n
3849
+ ), Q.setItem(e, t);
3850
+ }
3851
+ }, Ut = (e) => {
3852
+ W.removeItem(e);
3853
+ try {
3854
+ return Ae().removeItem(e);
3855
+ } catch (t) {
3856
+ return K(
3857
+ "storage",
3858
+ "removeItem",
3859
+ "debug",
3860
+ `failed to remove item ${e}; using global storage`,
3861
+ t
3862
+ ), Q.removeItem(e);
3863
+ }
3864
+ }, Ki = (e) => {
3865
+ if (_e === "sessionStorage") {
3866
+ console.warn(
3867
+ "highlight.io cannot use local storage; segment integration will not work"
3868
+ );
3869
+ return;
3870
+ }
3871
+ if (typeof window == "undefined") {
3872
+ console.warn(
3873
+ "highlight.io cannot use local storage (not a window); segment integration will not work"
3874
+ );
3875
+ return;
3876
+ }
3877
+ const t = window.localStorage.setItem;
3878
+ window.localStorage.setItem = function() {
3879
+ const [n, r] = arguments;
3880
+ e({ keyName: n, keyValue: r }), t.apply(this, [n, r]);
3881
+ };
3882
+ };
3883
+ var ee = /* @__PURE__ */ ((e) => (e.SEGMENT_LAST_SENT_HASH_KEY = "HIGHLIGHT_SEGMENT_LAST_SENT_HASH_KEY", e.SESSION_ID = "sessionID", e.SESSION_DATA = "sessionData", e.USER_IDENTIFIER = "highlightIdentifier", e.USER_OBJECT = "highlightUserObject", e))(ee || {});
3884
+ const Ne = (e) => `${ee.SESSION_DATA}_${e}`, kr = () => {
3885
+ var e;
3886
+ return typeof globalThis != "undefined" && ((e = globalThis.persistentSessionSecureID) != null && e.length) ? globalThis.persistentSessionSecureID : Bt();
3887
+ }, Lr = (e) => {
3888
+ typeof globalThis != "undefined" && (e != null && e.length) && (globalThis.persistentSessionSecureID = e);
3889
+ }, Bt = () => {
3890
+ var e;
3891
+ return (e = tt(ee.SESSION_ID)) != null ? e : "";
3892
+ }, Vt = (e) => {
3893
+ $t(ee.SESSION_ID, e);
3894
+ }, Pr = (e) => {
3895
+ const t = Ne(e);
3896
+ return JSON.parse(tt(t) || "{}");
3897
+ }, Fr = (e) => {
3898
+ e || (e = Bt());
3899
+ let t = Pr(e);
3900
+ if (t && t.lastPushTime && Date.now() - t.lastPushTime < et)
3901
+ return t;
3902
+ Ut(Ne(e));
3903
+ }, jt = function(e) {
3904
+ if (!(e != null && e.sessionSecureID)) return;
3905
+ const t = e.sessionSecureID;
3906
+ Lr(t);
3907
+ const n = Ne(t);
3908
+ $t(n, JSON.stringify(e)), $r(n);
3909
+ }, Mr = function() {
3910
+ const e = W.getItem(
3911
+ ee.SESSION_ID
3912
+ );
3913
+ Vt(e);
3914
+ const t = Ne(e), n = W.getItem(t);
3915
+ try {
3916
+ jt(JSON.parse(n));
3917
+ } catch (r) {
3918
+ }
3919
+ };
3920
+ function $r(e) {
3921
+ var i;
3922
+ const t = `${ee.SESSION_DATA}_`, n = /* @__PURE__ */ new Set(), r = Ae();
3923
+ for (let s = r.length - 1; s >= 0; s--) {
3924
+ const o = r.key(s);
3925
+ o && o.startsWith(t) && o !== e && n.add(o);
3926
+ }
3927
+ for (const s of W.keys())
3928
+ s.startsWith(t) && s !== e && n.add(s);
3929
+ for (const s of n) {
3930
+ let o = !0;
3931
+ try {
3932
+ const a = tt(s) || W.getItem(s) || "{}", c = JSON.parse(a), f = (i = c.lastPushTime) != null ? i : c.sessionStartTime;
3933
+ o = f === void 0 || Date.now() - f >= et;
3934
+ } catch (a) {
3935
+ }
3936
+ o && (K(
3937
+ "highlightSession",
3938
+ "pruneSessionData",
3939
+ "debug",
3940
+ `removing session data for stale key ${s}`
3941
+ ), Ut(s));
3942
+ }
3943
+ }
3944
+ var qt = /* @__PURE__ */ ((e) => (e.BillingQuotaExceeded = "BillingQuotaExceeded", e))(qt || {});
3945
+ const Ur = 3, Br = 1e3, Vr = 500, jr = [qt.BillingQuotaExceeded.toString()], qr = (e) => {
3946
+ var n;
3947
+ return ((n = e.response.errors) == null ? void 0 : n.find(
3948
+ (r) => jr.includes(r.message)
3949
+ )) === void 0;
3950
+ }, Wi = () => {
3951
+ const e = (t, n, r, i, s = 0) => U(void 0, null, function* () {
3952
+ try {
3953
+ return yield t();
3954
+ } catch (o) {
3955
+ if (o instanceof X && !qr(o))
3956
+ throw o;
3957
+ if (s < Ur)
3958
+ return yield new Promise(
3959
+ (a) => setTimeout(
3960
+ a,
3961
+ Br + Vr * Math.pow(2, s)
3962
+ )
3963
+ ), yield e(
3964
+ t,
3965
+ n,
3966
+ r,
3967
+ i,
3968
+ s + 1
3969
+ );
3970
+ throw console.error(
3971
+ `highlight.io: data request failed after ${s} retries`
3972
+ ), o;
3973
+ }
3974
+ });
3975
+ return e;
3976
+ }, C = "feature_flag", Ht = "launchdarkly", Gt = "evaluation", Hr = `${C}.${Gt}`, Zi = `${C}.set.id`, Gr = `${C}.key`, Yr = `${C}.contextKeys`, zr = `${C}.context.id`, Jr = `${C}.result.value`, Xr = `${C}.provider.name`, pt = {
3977
+ kind: `${C}.result.reason.kind`,
3978
+ errorKind: `${C}.result.reason.errorKind`,
3979
+ ruleIndex: `${C}.result.reason.ruleIndex`,
3980
+ ruleId: `${C}.result.reason.ruleId`,
3981
+ prerequisiteKey: `${C}.result.reason.prerequisiteKey`,
3982
+ inExperiment: `${C}.result.reason.inExperiment`,
3983
+ bigSegmentsStatus: `${C}.result.reason.bigSegmentsStatus`
3984
+ }, Qr = `${C}.result.variationIndex`, es = `${Ht}.application.id`, ts = `${Ht}.application.version`, Kr = "context", ns = `${Kr}.contextKeys`, Wr = "$ld:telemetry:session:init", mt = "$ld:telemetry:track", rs = "launchdarkly.track", is = "page_view", ss = "document_load", os = "result.status";
3985
+ function gt(e) {
3986
+ return e.includes("%") || e.includes(":") ? e.replace(/%/g, "%25").replace(/:/g, "%3A") : e;
3987
+ }
3988
+ function Yt(e) {
3989
+ return e.kind === "multi";
3990
+ }
3991
+ function yt(e) {
3992
+ return Yt(e) ? Object.keys(e).sort().filter((t) => t !== "kind").map((t) => `${t}:${gt(e[t].key)}`).join(":") : "kind" in e && e.kind === "user" ? e.key : "kind" in e ? `${e.kind}:${gt(e.key)}` : e.key;
3993
+ }
3994
+ function Et(e) {
3995
+ return Yt(e) ? Object.keys(e).sort().filter((t) => t !== "kind").map((t) => ({
3996
+ [t]: e[t].key
3997
+ })).reduce((t, n) => _(_({}, t), n), {}) : "kind" in e ? {
3998
+ [e.kind]: e.key
3999
+ } : {
4000
+ user: e.key
4001
+ };
4002
+ }
4003
+ function as(e, t, n) {
4004
+ t.addHook({
4005
+ getMetadata: () => ({
4006
+ name: "highlight.run"
4007
+ }),
4008
+ afterIdentify: (r, i, s) => {
4009
+ var a, c;
4010
+ const o = q(_({}, Et(r.context)), {
4011
+ key: (c = (a = n == null ? void 0 : n.contextFriendlyName) == null ? void 0 : a.call(n, r.context)) != null ? c : yt(r.context)
4012
+ });
4013
+ return e.log("LD.identify", "INFO", o), s.status === "completed" && e.identify(o.key, o, "LaunchDarkly"), i;
4014
+ },
4015
+ afterEvaluation: (r, i, s) => {
4016
+ const o = _({
4017
+ [Xr]: "LaunchDarkly",
4018
+ [Gr]: r.flagKey,
4019
+ [Jr]: JSON.stringify(s.value)
4020
+ }, s.variationIndex !== void 0 && s.variationIndex !== null ? {
4021
+ [Qr]: s.variationIndex
4022
+ } : {});
4023
+ if (s.reason)
4024
+ for (const a in pt) {
4025
+ const c = a, f = s.reason[c];
4026
+ f != null && (o[pt[c]] = f);
4027
+ }
4028
+ return r.context && (o[Yr] = JSON.stringify(
4029
+ Et(r.context)
4030
+ ), o[zr] = yt(
4031
+ r.context
4032
+ )), e.startSpan(Gt, (a) => {
4033
+ a && a.addEvent(Hr, o);
4034
+ }), i;
4035
+ }
4036
+ });
4037
+ }
4038
+ class Zr {
4039
+ constructor(t, n) {
4040
+ G(this, "client");
4041
+ G(this, "metadata");
4042
+ this.client = t, this.metadata = n;
4043
+ }
4044
+ getHooks(t) {
4045
+ return [];
4046
+ }
4047
+ init(t) {
4048
+ this.client.track(Wr, {
4049
+ sessionID: t
4050
+ });
4051
+ }
4052
+ recordGauge(t, n) {
4053
+ }
4054
+ identify(t, n, r = {}, i) {
4055
+ }
4056
+ error(t, n) {
4057
+ }
4058
+ track(t, n) {
4059
+ const r = n.event;
4060
+ this.client.track(
4061
+ r ? `${mt}:${r}` : mt,
4062
+ q(_({}, n), {
4063
+ sessionID: t
4064
+ })
4065
+ );
4066
+ }
4067
+ }
4068
+ class cs extends an {
4069
+ constructor(n, r) {
4070
+ super();
4071
+ G(this, "client");
4072
+ this.client = new Zr(n, r);
4073
+ }
4074
+ getHooks(n) {
4075
+ return [
4076
+ {
4077
+ getMetadata: () => ({
4078
+ name: "highlight.run/ld"
4079
+ }),
4080
+ afterIdentify: (r, i, s) => (this.load(this.client), i)
4081
+ }
4082
+ ];
4083
+ }
4084
+ init(n) {
4085
+ return this._bufferCall("init", [n]);
4086
+ }
4087
+ recordGauge(n, r) {
4088
+ return this._bufferCall("recordGauge", [n, r]);
4089
+ }
4090
+ identify(n, r, i = {}, s) {
4091
+ return this._bufferCall("identify", [
4092
+ n,
4093
+ r,
4094
+ i,
4095
+ s
4096
+ ]);
4097
+ }
4098
+ error(n, r) {
4099
+ return this._bufferCall("error", [n, r]);
4100
+ }
4101
+ track(n, r) {
4102
+ return this._bufferCall("track", [n, r]);
4103
+ }
4104
+ }
4105
+ const us = (e) => {
4106
+ e(window.location.href);
4107
+ const t = history.pushState;
4108
+ history.pushState = /* @__PURE__ */ ((s) => function() {
4109
+ var a = s.apply(this, arguments);
4110
+ return window.dispatchEvent(new Event("pushstate")), window.dispatchEvent(new Event("locationchange")), a;
4111
+ })(history.pushState);
4112
+ const n = history.replaceState;
4113
+ history.replaceState = /* @__PURE__ */ ((s) => function() {
4114
+ var a = s.apply(this, arguments);
4115
+ return window.dispatchEvent(new Event("replacestate")), window.dispatchEvent(new Event("locationchange")), a;
4116
+ })(history.replaceState);
4117
+ const r = () => {
4118
+ window.dispatchEvent(new Event("locationchange"));
4119
+ };
4120
+ window.addEventListener("popstate", r);
4121
+ const i = function() {
4122
+ e(window.location.href);
4123
+ };
4124
+ return window.addEventListener("locationchange", i), () => {
4125
+ window.removeEventListener("popstate", r), window.removeEventListener("locationchange", i), history.pushState = t, history.replaceState = n;
4126
+ };
4127
+ }, ei = "1.2.0", ti = {
4128
+ version: ei
4129
+ }, ls = ti.version;
4130
+ let L, nt;
4131
+ function fs(e, t) {
4132
+ return e.nodeType, Node.ELEMENT_NODE, Xe(e);
4133
+ return ni(e, t);
4134
+ }
4135
+ function hs(e) {
4136
+ if (e.id.length)
4137
+ return `#${e.id}`;
4138
+ if (e.classList.length) {
4139
+ let t = [];
4140
+ for (const n of e.classList)
4141
+ t.push(`.${n}`);
4142
+ return `${e.nodeName.toLowerCase()}${t.join(",")}`;
4143
+ }
4144
+ return e.nodeName.toLowerCase();
4145
+ }
4146
+ function ni(e, t) {
4147
+ if (e.tagName.toLowerCase() === "html")
4148
+ return "html";
4149
+ try {
4150
+ const n = {
4151
+ root: document.body,
4152
+ idName: (i) => !0,
4153
+ className: (i) => !0,
4154
+ tagName: (i) => !0,
4155
+ attr: (i, s) => !1,
4156
+ seedMinLength: 1,
4157
+ optimizedMinLength: 2,
4158
+ threshold: 50,
4159
+ maxNumberOfTries: 1e3,
4160
+ optimized: !0
4161
+ };
4162
+ L = _(_({}, n), t), nt = ri(L.root, n);
4163
+ let r = Pe(
4164
+ e,
4165
+ 0,
4166
+ () => Pe(
4167
+ e,
4168
+ 1,
4169
+ () => Pe(
4170
+ e,
4171
+ 2
4172
+ /* One */
4173
+ )
4174
+ )
4175
+ );
4176
+ if (r) {
4177
+ if (L.optimized) {
4178
+ const i = Xt(Qt(r, e));
4179
+ i.length > 0 && (r = i[0]);
4180
+ }
4181
+ return Ie(r);
4182
+ } else
4183
+ return Xe(e);
4184
+ } catch (n) {
4185
+ return Xe(e);
4186
+ }
4187
+ }
4188
+ function ri(e, t) {
4189
+ return e.nodeType === Node.DOCUMENT_NODE ? e : e === t.root ? e.ownerDocument : e;
4190
+ }
4191
+ function Pe(e, t, n) {
4192
+ let r = null, i = [], s = e, o = 0;
4193
+ for (; s && s !== L.root.parentElement; ) {
4194
+ let a = he(ii(s)) || he(...si(s)) || he(...oi(s)) || he(ai(s)) || [ci()];
4195
+ const c = ui(s);
4196
+ if (t === 0)
4197
+ c && (a = a.concat(
4198
+ a.filter(Me).map((f) => Fe(f, c))
4199
+ ));
4200
+ else if (t === 1)
4201
+ a = a.slice(0, 1), c && (a = a.concat(
4202
+ a.filter(Me).map((f) => Fe(f, c))
4203
+ ));
4204
+ else if (t === 2) {
4205
+ const [f] = a = a.slice(0, 1);
4206
+ c && Me(f) && (a = [Fe(f, c)]);
4207
+ }
4208
+ for (let f of a)
4209
+ f.level = o;
4210
+ if (i.push(a), i.length >= L.seedMinLength && (r = _t(i, n), r))
4211
+ break;
4212
+ s = s.parentElement, o++;
4213
+ }
4214
+ return r || (r = _t(i, n)), r;
4215
+ }
4216
+ function _t(e, t) {
4217
+ const n = Xt(Jt(e));
4218
+ if (n.length > L.threshold)
4219
+ return t ? t() : null;
4220
+ for (let r of n)
4221
+ if (zt(r))
4222
+ return r;
4223
+ return null;
4224
+ }
4225
+ function Ie(e) {
4226
+ let t = e[0], n = t.name;
4227
+ for (let r = 1; r < e.length; r++) {
4228
+ const i = e[r].level || 0;
4229
+ t.level === i - 1 ? n = `${e[r].name} > ${n}` : n = `${e[r].name} ${n}`, t = e[r];
4230
+ }
4231
+ return n;
4232
+ }
4233
+ function Tt(e) {
4234
+ return e.map((t) => t.penalty).reduce((t, n) => t + n, 0);
4235
+ }
4236
+ function zt(e) {
4237
+ switch (nt.querySelectorAll(Ie(e)).length) {
4238
+ case 0:
4239
+ return !0;
4240
+ case 1:
4241
+ return !0;
4242
+ default:
4243
+ return !1;
4244
+ }
4245
+ }
4246
+ function ii(e) {
4247
+ const t = e.getAttribute("id");
4248
+ return t && L.idName(t) ? {
4249
+ name: "#" + Te(t, { isIdentifier: !0 }),
4250
+ penalty: 0
4251
+ } : null;
4252
+ }
4253
+ function si(e) {
4254
+ return Array.from(e.attributes).filter(
4255
+ (n) => L.attr(n.name, n.value)
4256
+ ).map(
4257
+ (n) => ({
4258
+ name: "[" + Te(n.name, { isIdentifier: !0 }) + '="' + Te(n.value) + '"]',
4259
+ penalty: 0.5
4260
+ })
4261
+ );
4262
+ }
4263
+ function oi(e) {
4264
+ return Array.from(e.classList).filter(L.className).map(
4265
+ (n) => ({
4266
+ name: "." + Te(n, { isIdentifier: !0 }),
4267
+ penalty: 1
4268
+ })
4269
+ );
4270
+ }
4271
+ function ai(e) {
4272
+ const t = e.tagName.toLowerCase();
4273
+ return L.tagName(t) ? {
4274
+ name: t,
4275
+ penalty: 2
4276
+ } : null;
4277
+ }
4278
+ function ci() {
4279
+ return {
4280
+ name: "*",
4281
+ penalty: 3
4282
+ };
4283
+ }
4284
+ function ui(e) {
4285
+ const t = e.parentNode;
4286
+ if (!t)
4287
+ return null;
4288
+ let n = t.firstChild;
4289
+ if (!n)
4290
+ return null;
4291
+ let r = 0;
4292
+ for (; n && (n.nodeType === Node.ELEMENT_NODE && r++, n !== e); )
4293
+ n = n.nextSibling;
4294
+ return r;
4295
+ }
4296
+ function Fe(e, t) {
4297
+ return {
4298
+ name: e.name + `:nth-child(${t})`,
4299
+ penalty: e.penalty + 1
4300
+ };
4301
+ }
4302
+ function Me(e) {
4303
+ return e.name !== "html" && !e.name.startsWith("#");
4304
+ }
4305
+ function he(...e) {
4306
+ const t = e.filter(li);
4307
+ return t.length > 0 ? t : null;
4308
+ }
4309
+ function li(e) {
4310
+ return e != null;
4311
+ }
4312
+ function* Jt(e, t = []) {
4313
+ if (e.length > 0)
4314
+ for (let n of e[0])
4315
+ yield* we(Jt(e.slice(1, e.length), t.concat(n)));
4316
+ else
4317
+ yield t;
4318
+ }
4319
+ function Xt(e) {
4320
+ return Array.from(e).sort((t, n) => Tt(t) - Tt(n));
4321
+ }
4322
+ function* Qt(e, t, n = {
4323
+ counter: 0,
4324
+ visited: /* @__PURE__ */ new Map()
4325
+ }) {
4326
+ if (e.length > 2 && e.length > L.optimizedMinLength)
4327
+ for (let r = 1; r < e.length - 1; r++) {
4328
+ if (n.counter > L.maxNumberOfTries)
4329
+ return;
4330
+ n.counter += 1;
4331
+ const i = [...e];
4332
+ i.splice(r, 1);
4333
+ const s = Ie(i);
4334
+ if (n.visited.has(s))
4335
+ return;
4336
+ zt(i) && fi(i, t) && (yield i, n.visited.set(s, !0), yield* we(Qt(i, t, n)));
4337
+ }
4338
+ }
4339
+ function fi(e, t) {
4340
+ return nt.querySelector(Ie(e)) === t;
4341
+ }
4342
+ const hi = /[ -,\.\/:-@\[-\^`\{-~]/, di = /[ -,\.\/:-@\[\]\^`\{-~]/, pi = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g, mi = {
4343
+ escapeEverything: !1,
4344
+ isIdentifier: !1,
4345
+ quotes: "single",
4346
+ wrap: !1
4347
+ };
4348
+ function Te(e, t = {}) {
4349
+ const n = _(_({}, mi), t);
4350
+ n.quotes != "single" && n.quotes != "double" && (n.quotes = "single");
4351
+ const r = n.quotes == "double" ? '"' : "'", i = n.isIdentifier, s = e.charAt(0);
4352
+ let o = "", a = 0;
4353
+ const c = e.length;
4354
+ for (; a < c; ) {
4355
+ const f = e.charAt(a++);
4356
+ let h = f.charCodeAt(0), m;
4357
+ if (h < 32 || h > 126) {
4358
+ if (h >= 55296 && h <= 56319 && a < c) {
4359
+ const E = e.charCodeAt(a++);
4360
+ (E & 64512) == 56320 ? h = ((h & 1023) << 10) + (E & 1023) + 65536 : a--;
4361
+ }
4362
+ m = "\\" + h.toString(16).toUpperCase() + " ";
4363
+ } else
4364
+ n.escapeEverything ? hi.test(f) ? m = "\\" + f : m = "\\" + h.toString(16).toUpperCase() + " " : /[\t\n\f\r\x0B]/.test(f) ? m = "\\" + h.toString(16).toUpperCase() + " " : f == "\\" || !i && (f == '"' && r == f || f == "'" && r == f) || i && di.test(f) ? m = "\\" + f : m = f;
4365
+ o += m;
4366
+ }
4367
+ return i && (/^-[-\d]/.test(o) ? o = "\\-" + o.slice(1) : /\d/.test(s) && (o = "\\3" + s + " " + o.slice(1))), o = o.replace(pi, function(f, h, m) {
4368
+ return h && h.length % 2 ? f : (h || "") + m;
4369
+ }), !i && n.wrap ? r + o + r : o;
4370
+ }
4371
+ const Xe = (e) => {
4372
+ let t = "";
4373
+ const n = e.getAttribute("class"), r = e.getAttribute("id");
4374
+ return r && (t = t.concat(vt(r, "#"))), n && (t = t.concat(vt(n, "."))), t === "" && (t = t.concat(e.tagName.toLowerCase())), t;
4375
+ }, vt = (e, t) => `${t}${e.trim().split(" ").join(t)}`, ds = (e) => {
4376
+ let t;
4377
+ const r = () => {
4378
+ clearTimeout(t), t = setTimeout(() => {
4379
+ var i, s;
4380
+ e({
4381
+ height: window.innerHeight,
4382
+ width: window.innerWidth,
4383
+ availHeight: window.screen.availHeight,
4384
+ availWidth: window.screen.availWidth,
4385
+ colorDepth: window.screen.colorDepth,
4386
+ pixelDepth: window.screen.pixelDepth,
4387
+ orientation: (s = (i = window.screen.orientation) == null ? void 0 : i.angle) != null ? s : 0
4388
+ });
4389
+ }, 500);
4390
+ };
4391
+ return window.addEventListener("resize", r), r(), () => window.removeEventListener("resize", r);
4392
+ };
4393
+ var Kt = { exports: {} };
4394
+ /**
4395
+ * @preserve
4396
+ * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)
4397
+ *
4398
+ * @author <a href="mailto:jensyt@gmail.com">Jens Taylor</a>
4399
+ * @see http://github.com/homebrewing/brauhaus-diff
4400
+ * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
4401
+ * @see http://github.com/garycourt/murmurhash-js
4402
+ * @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
4403
+ * @see http://sites.google.com/site/murmurhash/
4404
+ */
4405
+ (function(e) {
4406
+ (function() {
4407
+ var t;
4408
+ function n(r, i) {
4409
+ var s = this instanceof n ? this : t;
4410
+ if (s.reset(i), typeof r == "string" && r.length > 0 && s.hash(r), s !== this)
4411
+ return s;
4412
+ }
4413
+ n.prototype.hash = function(r) {
4414
+ var i, s, o, a, c;
4415
+ switch (c = r.length, this.len += c, s = this.k1, o = 0, this.rem) {
4416
+ case 0:
4417
+ s ^= c > o ? r.charCodeAt(o++) & 65535 : 0;
4418
+ case 1:
4419
+ s ^= c > o ? (r.charCodeAt(o++) & 65535) << 8 : 0;
4420
+ case 2:
4421
+ s ^= c > o ? (r.charCodeAt(o++) & 65535) << 16 : 0;
4422
+ case 3:
4423
+ s ^= c > o ? (r.charCodeAt(o) & 255) << 24 : 0, s ^= c > o ? (r.charCodeAt(o++) & 65280) >> 8 : 0;
4424
+ }
4425
+ if (this.rem = c + this.rem & 3, c -= this.rem, c > 0) {
4426
+ for (i = this.h1; s = s * 11601 + (s & 65535) * 3432906752 & 4294967295, s = s << 15 | s >>> 17, s = s * 13715 + (s & 65535) * 461832192 & 4294967295, i ^= s, i = i << 13 | i >>> 19, i = i * 5 + 3864292196 & 4294967295, !(o >= c); )
4427
+ s = r.charCodeAt(o++) & 65535 ^ (r.charCodeAt(o++) & 65535) << 8 ^ (r.charCodeAt(o++) & 65535) << 16, a = r.charCodeAt(o++), s ^= (a & 255) << 24 ^ (a & 65280) >> 8;
4428
+ switch (s = 0, this.rem) {
4429
+ case 3:
4430
+ s ^= (r.charCodeAt(o + 2) & 65535) << 16;
4431
+ case 2:
4432
+ s ^= (r.charCodeAt(o + 1) & 65535) << 8;
4433
+ case 1:
4434
+ s ^= r.charCodeAt(o) & 65535;
4435
+ }
4436
+ this.h1 = i;
4437
+ }
4438
+ return this.k1 = s, this;
4439
+ }, n.prototype.result = function() {
4440
+ var r, i;
4441
+ return r = this.k1, i = this.h1, r > 0 && (r = r * 11601 + (r & 65535) * 3432906752 & 4294967295, r = r << 15 | r >>> 17, r = r * 13715 + (r & 65535) * 461832192 & 4294967295, i ^= r), i ^= this.len, i ^= i >>> 16, i = i * 51819 + (i & 65535) * 2246770688 & 4294967295, i ^= i >>> 13, i = i * 44597 + (i & 65535) * 3266445312 & 4294967295, i ^= i >>> 16, i >>> 0;
4442
+ }, n.prototype.reset = function(r) {
4443
+ return this.h1 = typeof r == "number" ? r : 0, this.rem = this.k1 = this.len = 0, this;
4444
+ }, t = new n(), e.exports = n;
4445
+ })();
4446
+ })(Kt);
4447
+ var gi = Kt.exports;
4448
+ const yi = /* @__PURE__ */ Ze(gi), $e = 28, z = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", Ei = 2246822507, St = (e) => {
4449
+ var n;
4450
+ var t = "";
4451
+ if (e) {
4452
+ const r = yi(e).result();
4453
+ for (let i = 0; i < $e; i++) {
4454
+ const o = ((r ^ i * Ei) >>> 0) % z.length;
4455
+ t += z.charAt(o);
4456
+ }
4457
+ } else {
4458
+ const r = typeof window != "undefined" && ((n = window.crypto) == null ? void 0 : n.getRandomValues), i = new Uint32Array($e);
4459
+ r && window.crypto.getRandomValues(i);
4460
+ for (let s = 0; s < $e; s++)
4461
+ r ? t += z.charAt(
4462
+ i[s] % z.length
4463
+ ) : t += z.charAt(
4464
+ Math.floor(Math.random() * z.length)
4465
+ );
4466
+ }
4467
+ return t;
4468
+ };
4469
+ class ps {
4470
+ constructor(t) {
4471
+ G(this, "sessionSecureID");
4472
+ try {
4473
+ t != null && t.storageMode && Rr(t == null ? void 0 : t.storageMode), dt(!!(t != null && t.sessionCookie)), t != null && t.sessionCookie ? Mr() : dt(!1);
4474
+ } catch (n) {
4475
+ st(
4476
+ "Error initializing @launchdarkly observability plugin",
4477
+ "error",
4478
+ n
4479
+ );
4480
+ }
4481
+ }
4482
+ configureSession(t, n) {
4483
+ try {
4484
+ const r = kr();
4485
+ let i = Fr(
4486
+ r
4487
+ );
4488
+ i != null && i.sessionSecureID ? this.sessionSecureID = i.sessionSecureID : (n != null && n.sessionKey ? this.sessionSecureID = St(
4489
+ `${t}-${n.sessionKey}`
4490
+ ) : this.sessionSecureID = St(), Vt(this.sessionSecureID), jt({
4491
+ sessionSecureID: this.sessionSecureID,
4492
+ sessionKey: n == null ? void 0 : n.sessionKey,
4493
+ projectID: 0,
4494
+ sessionStartTime: Date.now(),
4495
+ lastPushTime: Date.now()
4496
+ }));
4497
+ } catch (r) {
4498
+ st(
4499
+ "Error configuring session in @launchdarkly observability plugin",
4500
+ "error",
4501
+ r
4502
+ );
4503
+ }
4504
+ }
4505
+ }
4506
+ export {
4507
+ Br as $,
4508
+ Qi as A,
4509
+ zi as B,
4510
+ Ji as C,
4511
+ Xi as D,
4512
+ ps as E,
4513
+ Vi as F,
4514
+ St as G,
4515
+ Yi as H,
4516
+ yt as I,
4517
+ Et as J,
4518
+ ts as K,
4519
+ cs as L,
4520
+ qi as M,
4521
+ es as N,
4522
+ Xr as O,
4523
+ us as P,
4524
+ Zi as Q,
4525
+ Fi as R,
4526
+ ee as S,
4527
+ Pi as T,
4528
+ tr as U,
4529
+ Gi as V,
4530
+ Ze as W,
4531
+ Ni as X,
4532
+ Ii as Y,
4533
+ kr as Z,
4534
+ Ur as _,
4535
+ tt as a,
4536
+ Vr as a0,
4537
+ Mi as a1,
4538
+ is as a2,
4539
+ Ci as a3,
4540
+ Bi as a4,
4541
+ Li as a5,
4542
+ ki as a6,
4543
+ ss as a7,
4544
+ Ui as a8,
4545
+ $i as a9,
4546
+ wi as aa,
4547
+ Oi as ab,
4548
+ Di as ac,
4549
+ ns as ad,
4550
+ Ri as ae,
4551
+ rs as af,
4552
+ Jr as ag,
4553
+ Gt as ah,
4554
+ C as ai,
4555
+ Qr as aj,
4556
+ Gr as ak,
4557
+ pt as al,
4558
+ Yr as am,
4559
+ zr as an,
4560
+ os as ao,
4561
+ bi as b,
4562
+ Ai as c,
4563
+ $t as d,
4564
+ Vt as e,
4565
+ jt as f,
4566
+ Fr as g,
4567
+ ds as h,
4568
+ ji as i,
4569
+ dt as j,
4570
+ Hi as k,
4571
+ Dr as l,
4572
+ Rr as m,
4573
+ Wi as n,
4574
+ vi as o,
4575
+ zn as p,
4576
+ hs as q,
4577
+ Ut as r,
4578
+ Si as s,
4579
+ xi as t,
4580
+ yr as u,
4581
+ as as v,
4582
+ Mr as w,
4583
+ ls as x,
4584
+ fs as y,
4585
+ Ki as z
4586
+ };
4587
+ //# sourceMappingURL=common-DQ61tUu9.js.map