@ticketapp-dev/shop-sdk 1.0.41 → 1.0.43

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.
package/dist/index.js CHANGED
@@ -1,101 +1,101 @@
1
- import { GraphQLClient as oe } from "graphql-request";
2
- import { DateTime as L } from "luxon";
3
- var _ = /* @__PURE__ */ ((e) => (e.PACKAGE = "PACKAGE", e.PRODUCT = "PRODUCT", e.ADD_ONS = "ADD_ONS", e.DELIVERY = "DELIVERY", e.PICKUP = "PICKUP", e))(_ || {}), Y = /* @__PURE__ */ ((e) => (e.AdditionalEvent = "ADDITIONAL_EVENT", e.Addon = "ADDON", e.Regular = "REGULAR", e))(Y || {}), Ee = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Concept = "CONCEPT", e.Paused = "PAUSED", e.SoldOut = "SOLD_OUT", e))(Ee || {}), ye = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e))(ye || {}), Te = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e.Paused = "PAUSED", e.SoldOut = "SOLD_OUT", e))(Te || {}), ve = /* @__PURE__ */ ((e) => (e.Asc = "ASC", e.Desc = "DESC", e))(ve || {}), ke = /* @__PURE__ */ ((e) => (e.AllReserved = "ALL_RESERVED", e.Available = "AVAILABLE", e.SoldOut = "SOLD_OUT", e))(ke || {}), Oe = /* @__PURE__ */ ((e) => (e.Addon = "ADDON", e.Delivery = "DELIVERY", e.Door = "DOOR", e.Friend = "FRIEND", e.Guest = "GUEST", e.Pickup = "PICKUP", e.Promoter = "PROMOTER", e.Ticket = "TICKET", e))(Oe || {}), Ae = /* @__PURE__ */ ((e) => (e.FIXED = "FIXED", e.PERCENTAGE = "PERCENTAGE", e))(Ae || {}), De = /* @__PURE__ */ ((e) => (e.AddOn = "ADD_ON", e.DeliveryOption = "DELIVERY_OPTION", e.EntranceTicket = "ENTRANCE_TICKET", e))(De || {}), Ne = /* @__PURE__ */ ((e) => (e.Fixed = "FIXED", e.Percentage = "PERCENTAGE", e))(Ne || {}), H = /* @__PURE__ */ ((e) => (e.Event = "EVENT", e.Package = "PACKAGE", e))(H || {});
4
- const Ue = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1
+ import { GraphQLClient as v } from "graphql-request";
2
+ import { DateTime as A } from "luxon";
3
+ var T = /* @__PURE__ */ ((n) => (n.PACKAGE = "PACKAGE", n.PRODUCT = "PRODUCT", n.ADD_ONS = "ADD_ONS", n.DELIVERY = "DELIVERY", n.PICKUP = "PICKUP", n))(T || {}), R = /* @__PURE__ */ ((n) => (n.AdditionalEvent = "ADDITIONAL_EVENT", n.Addon = "ADDON", n.Regular = "REGULAR", n))(R || {}), K = /* @__PURE__ */ ((n) => (n.Active = "ACTIVE", n.Concept = "CONCEPT", n.Paused = "PAUSED", n.SoldOut = "SOLD_OUT", n))(K || {}), ee = /* @__PURE__ */ ((n) => (n.Active = "ACTIVE", n.Inactive = "INACTIVE", n))(ee || {}), te = /* @__PURE__ */ ((n) => (n.Active = "ACTIVE", n.Inactive = "INACTIVE", n.Paused = "PAUSED", n.SoldOut = "SOLD_OUT", n))(te || {}), ne = /* @__PURE__ */ ((n) => (n.Asc = "ASC", n.Desc = "DESC", n))(ne || {}), ie = /* @__PURE__ */ ((n) => (n.AllReserved = "ALL_RESERVED", n.Available = "AVAILABLE", n.SoldOut = "SOLD_OUT", n))(ie || {}), re = /* @__PURE__ */ ((n) => (n.Addon = "ADDON", n.Delivery = "DELIVERY", n.Door = "DOOR", n.Friend = "FRIEND", n.Guest = "GUEST", n.Pickup = "PICKUP", n.Promoter = "PROMOTER", n.Ticket = "TICKET", n))(re || {}), se = /* @__PURE__ */ ((n) => (n.FIXED = "FIXED", n.PERCENTAGE = "PERCENTAGE", n))(se || {}), ae = /* @__PURE__ */ ((n) => (n.AddOn = "ADD_ON", n.DeliveryOption = "DELIVERY_OPTION", n.EntranceTicket = "ENTRANCE_TICKET", n))(ae || {}), oe = /* @__PURE__ */ ((n) => (n.Fixed = "FIXED", n.Percentage = "PERCENTAGE", n))(oe || {}), w = /* @__PURE__ */ ((n) => (n.Event = "EVENT", n.Package = "PACKAGE", n))(w || {});
4
+ const Te = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5
5
  __proto__: null,
6
- BasketOrderType: _,
7
- DiscountType: Ne,
8
- EventStatus: Te,
9
- MetricsType: H,
10
- OrderItemType: De,
11
- PackageItemType: Y,
12
- PackageStatus: Ee,
13
- PackageTabType: ye,
14
- PaymentMethodFeeType: Ae,
15
- ProductStatus: ke,
16
- ProductType: Oe,
17
- SortOrder: ve
6
+ BasketOrderType: T,
7
+ DiscountType: oe,
8
+ EventStatus: te,
9
+ MetricsType: w,
10
+ OrderItemType: ae,
11
+ PackageItemType: R,
12
+ PackageStatus: K,
13
+ PackageTabType: ee,
14
+ PaymentMethodFeeType: se,
15
+ ProductStatus: ie,
16
+ ProductType: re,
17
+ SortOrder: ne
18
18
  }, Symbol.toStringTag, { value: "Module" }));
19
- var Q = function() {
20
- return Q = Object.assign || function(t) {
21
- for (var n, i = 1, r = arguments.length; i < r; i++) {
22
- n = arguments[i];
23
- for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
19
+ var F = function() {
20
+ return F = Object.assign || function(e) {
21
+ for (var t, i = 1, r = arguments.length; i < r; i++) {
22
+ t = arguments[i];
23
+ for (var s in t) Object.prototype.hasOwnProperty.call(t, s) && (e[s] = t[s]);
24
24
  }
25
- return t;
26
- }, Q.apply(this, arguments);
25
+ return e;
26
+ }, F.apply(this, arguments);
27
27
  };
28
- function z(e, t) {
29
- if (!!!e)
30
- throw new Error(t);
28
+ function U(n, e) {
29
+ if (!!!n)
30
+ throw new Error(e);
31
31
  }
32
- function Me(e) {
33
- return typeof e == "object" && e !== null;
32
+ function Ae(n) {
33
+ return typeof n == "object" && n !== null;
34
34
  }
35
- function qe(e, t) {
36
- if (!!!e)
35
+ function Ne(n, e) {
36
+ if (!!!n)
37
37
  throw new Error(
38
38
  "Unexpected invariant triggered."
39
39
  );
40
40
  }
41
- const ze = /\r\n|[\n\r]/g;
42
- function ie(e, t) {
43
- let n = 0, i = 1;
44
- for (const r of e.body.matchAll(ze)) {
45
- if (typeof r.index == "number" || qe(!1), r.index >= t)
41
+ const De = /\r\n|[\n\r]/g;
42
+ function z(n, e) {
43
+ let t = 0, i = 1;
44
+ for (const r of n.body.matchAll(De)) {
45
+ if (typeof r.index == "number" || Ne(!1), r.index >= e)
46
46
  break;
47
- n = r.index + r[0].length, i += 1;
47
+ t = r.index + r[0].length, i += 1;
48
48
  }
49
49
  return {
50
50
  line: i,
51
- column: t + 1 - n
51
+ column: e + 1 - t
52
52
  };
53
53
  }
54
- function je(e) {
55
- return xe(
56
- e.source,
57
- ie(e.source, e.start)
54
+ function ve(n) {
55
+ return ce(
56
+ n.source,
57
+ z(n.source, n.start)
58
58
  );
59
59
  }
60
- function xe(e, t) {
61
- const n = e.locationOffset.column - 1, i = "".padStart(n) + e.body, r = t.line - 1, s = e.locationOffset.line - 1, o = t.line + s, p = t.line === 1 ? n : 0, f = t.column + p, l = `${e.name}:${o}:${f}
62
- `, g = i.split(/\r\n|[\n\r]/g), d = g[r];
60
+ function ce(n, e) {
61
+ const t = n.locationOffset.column - 1, i = "".padStart(t) + n.body, r = e.line - 1, s = n.locationOffset.line - 1, o = e.line + s, u = e.line === 1 ? t : 0, h = e.column + u, E = `${n.name}:${o}:${h}
62
+ `, m = i.split(/\r\n|[\n\r]/g), d = m[r];
63
63
  if (d.length > 120) {
64
- const m = Math.floor(f / 80), y = f % 80, I = [];
65
- for (let D = 0; D < d.length; D += 80)
66
- I.push(d.slice(D, D + 80));
67
- return l + le([
68
- [`${o} |`, I[0]],
69
- ...I.slice(1, m + 1).map((D) => ["|", D]),
64
+ const f = Math.floor(h / 80), y = h % 80, p = [];
65
+ for (let O = 0; O < d.length; O += 80)
66
+ p.push(d.slice(O, O + 80));
67
+ return E + Q([
68
+ [`${o} |`, p[0]],
69
+ ...p.slice(1, f + 1).map((O) => ["|", O]),
70
70
  ["|", "^".padStart(y)],
71
- ["|", I[m + 1]]
71
+ ["|", p[f + 1]]
72
72
  ]);
73
73
  }
74
- return l + le([
74
+ return E + Q([
75
75
  // Lines specified like this: ["prefix", "string"],
76
- [`${o - 1} |`, g[r - 1]],
76
+ [`${o - 1} |`, m[r - 1]],
77
77
  [`${o} |`, d],
78
- ["|", "^".padStart(f)],
79
- [`${o + 1} |`, g[r + 1]]
78
+ ["|", "^".padStart(h)],
79
+ [`${o + 1} |`, m[r + 1]]
80
80
  ]);
81
81
  }
82
- function le(e) {
83
- const t = e.filter(([i, r]) => r !== void 0), n = Math.max(...t.map(([i]) => i.length));
84
- return t.map(([i, r]) => i.padStart(n) + (r ? " " + r : "")).join(`
82
+ function Q(n) {
83
+ const e = n.filter(([i, r]) => r !== void 0), t = Math.max(...e.map(([i]) => i.length));
84
+ return e.map(([i, r]) => i.padStart(t) + (r ? " " + r : "")).join(`
85
85
  `);
86
86
  }
87
- function Ge(e) {
88
- const t = e[0];
89
- return t == null || "kind" in t || "length" in t ? {
90
- nodes: t,
91
- source: e[1],
92
- positions: e[2],
93
- path: e[3],
94
- originalError: e[4],
95
- extensions: e[5]
96
- } : t;
87
+ function xe(n) {
88
+ const e = n[0];
89
+ return e == null || "kind" in e || "length" in e ? {
90
+ nodes: e,
91
+ source: n[1],
92
+ positions: n[2],
93
+ path: n[3],
94
+ originalError: n[4],
95
+ extensions: n[5]
96
+ } : e;
97
97
  }
98
- class ce extends Error {
98
+ class j extends Error {
99
99
  /**
100
100
  * An array of `{ line, column }` locations within the source GraphQL document
101
101
  * which correspond to this error.
@@ -134,19 +134,19 @@ class ce extends Error {
134
134
  /**
135
135
  * @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
136
136
  */
137
- constructor(t, ...n) {
137
+ constructor(e, ...t) {
138
138
  var i, r, s;
139
- const { nodes: o, source: p, positions: f, path: l, originalError: g, extensions: d } = Ge(n);
140
- super(t), this.name = "GraphQLError", this.path = l ?? void 0, this.originalError = g ?? void 0, this.nodes = pe(
139
+ const { nodes: o, source: u, positions: h, path: E, originalError: m, extensions: d } = xe(t);
140
+ super(e), this.name = "GraphQLError", this.path = E ?? void 0, this.originalError = m ?? void 0, this.nodes = X(
141
141
  Array.isArray(o) ? o : o ? [o] : void 0
142
142
  );
143
- const m = pe(
144
- (i = this.nodes) === null || i === void 0 ? void 0 : i.map((I) => I.loc).filter((I) => I != null)
143
+ const f = X(
144
+ (i = this.nodes) === null || i === void 0 ? void 0 : i.map((p) => p.loc).filter((p) => p != null)
145
145
  );
146
- this.source = p ?? (m == null || (r = m[0]) === null || r === void 0 ? void 0 : r.source), this.positions = f ?? m?.map((I) => I.start), this.locations = f && p ? f.map((I) => ie(p, I)) : m?.map((I) => ie(I.source, I.start));
147
- const y = Me(
148
- g?.extensions
149
- ) ? g?.extensions : void 0;
146
+ this.source = u ?? (f == null || (r = f[0]) === null || r === void 0 ? void 0 : r.source), this.positions = h ?? f?.map((p) => p.start), this.locations = h && u ? h.map((p) => z(u, p)) : f?.map((p) => z(p.source, p.start));
147
+ const y = Ae(
148
+ m?.extensions
149
+ ) ? m?.extensions : void 0;
150
150
  this.extensions = (s = d ?? y) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
151
151
  message: {
152
152
  writable: !0,
@@ -167,11 +167,11 @@ class ce extends Error {
167
167
  originalError: {
168
168
  enumerable: !1
169
169
  }
170
- }), g != null && g.stack ? Object.defineProperty(this, "stack", {
171
- value: g.stack,
170
+ }), m != null && m.stack ? Object.defineProperty(this, "stack", {
171
+ value: m.stack,
172
172
  writable: !0,
173
173
  configurable: !0
174
- }) : Error.captureStackTrace ? Error.captureStackTrace(this, ce) : Object.defineProperty(this, "stack", {
174
+ }) : Error.captureStackTrace ? Error.captureStackTrace(this, j) : Object.defineProperty(this, "stack", {
175
175
  value: Error().stack,
176
176
  writable: !0,
177
177
  configurable: !0
@@ -181,36 +181,36 @@ class ce extends Error {
181
181
  return "GraphQLError";
182
182
  }
183
183
  toString() {
184
- let t = this.message;
184
+ let e = this.message;
185
185
  if (this.nodes)
186
- for (const n of this.nodes)
187
- n.loc && (t += `
186
+ for (const t of this.nodes)
187
+ t.loc && (e += `
188
188
 
189
- ` + je(n.loc));
189
+ ` + ve(t.loc));
190
190
  else if (this.source && this.locations)
191
- for (const n of this.locations)
192
- t += `
191
+ for (const t of this.locations)
192
+ e += `
193
193
 
194
- ` + xe(this.source, n);
195
- return t;
194
+ ` + ce(this.source, t);
195
+ return e;
196
196
  }
197
197
  toJSON() {
198
- const t = {
198
+ const e = {
199
199
  message: this.message
200
200
  };
201
- 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;
201
+ return this.locations != null && (e.locations = this.locations), this.path != null && (e.path = this.path), this.extensions != null && Object.keys(this.extensions).length > 0 && (e.extensions = this.extensions), e;
202
202
  }
203
203
  }
204
- function pe(e) {
205
- return e === void 0 || e.length === 0 ? void 0 : e;
204
+ function X(n) {
205
+ return n === void 0 || n.length === 0 ? void 0 : n;
206
206
  }
207
- function v(e, t, n) {
208
- return new ce(`Syntax Error: ${n}`, {
209
- source: e,
210
- positions: [t]
207
+ function I(n, e, t) {
208
+ return new j(`Syntax Error: ${t}`, {
209
+ source: n,
210
+ positions: [e]
211
211
  });
212
212
  }
213
- class Ye {
213
+ class Pe {
214
214
  /**
215
215
  * The character offset at which this Node begins.
216
216
  */
@@ -226,8 +226,8 @@ class Ye {
226
226
  /**
227
227
  * The Source document the AST represents.
228
228
  */
229
- constructor(t, n, i) {
230
- this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source = i;
229
+ constructor(e, t, i) {
230
+ this.start = e.start, this.end = t.end, this.startToken = e, this.endToken = t, this.source = i;
231
231
  }
232
232
  get [Symbol.toStringTag]() {
233
233
  return "Location";
@@ -239,7 +239,7 @@ class Ye {
239
239
  };
240
240
  }
241
241
  }
242
- class be {
242
+ class de {
243
243
  /**
244
244
  * The kind of Token.
245
245
  */
@@ -266,8 +266,8 @@ class be {
266
266
  * including ignored tokens. <SOF> is always the first node and <EOF>
267
267
  * the last.
268
268
  */
269
- constructor(t, n, i, r, s, o) {
270
- this.kind = t, this.start = n, this.end = i, this.line = r, this.column = s, this.value = o, this.prev = null, this.next = null;
269
+ constructor(e, t, i, r, s, o) {
270
+ this.kind = e, this.start = t, this.end = i, this.line = r, this.column = s, this.value = o, this.prev = null, this.next = null;
271
271
  }
272
272
  get [Symbol.toStringTag]() {
273
273
  return "Token";
@@ -281,7 +281,7 @@ class be {
281
281
  };
282
282
  }
283
283
  }
284
- const Pe = {
284
+ const be = {
285
285
  Name: [],
286
286
  Document: ["definitions"],
287
287
  OperationDefinition: [
@@ -368,74 +368,60 @@ const Pe = {
368
368
  ArgumentCoordinate: ["name", "fieldName", "argumentName"],
369
369
  DirectiveCoordinate: ["name"],
370
370
  DirectiveArgumentCoordinate: ["name", "argumentName"]
371
- }, He = new Set(Object.keys(Pe));
372
- function he(e) {
373
- const t = e?.kind;
374
- return typeof t == "string" && He.has(t);
375
- }
376
- var w;
377
- (function(e) {
378
- e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
379
- })(w || (w = {}));
380
- var re;
381
- (function(e) {
382
- 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";
383
- })(re || (re = {}));
384
- var u;
385
- (function(e) {
386
- e.NAME = "Name", e.DOCUMENT = "Document", e.OPERATION_DEFINITION = "OperationDefinition", e.VARIABLE_DEFINITION = "VariableDefinition", e.SELECTION_SET = "SelectionSet", e.FIELD = "Field", e.ARGUMENT = "Argument", e.FRAGMENT_SPREAD = "FragmentSpread", e.INLINE_FRAGMENT = "InlineFragment", e.FRAGMENT_DEFINITION = "FragmentDefinition", e.VARIABLE = "Variable", e.INT = "IntValue", e.FLOAT = "FloatValue", e.STRING = "StringValue", e.BOOLEAN = "BooleanValue", e.NULL = "NullValue", e.ENUM = "EnumValue", e.LIST = "ListValue", e.OBJECT = "ObjectValue", e.OBJECT_FIELD = "ObjectField", e.DIRECTIVE = "Directive", e.NAMED_TYPE = "NamedType", e.LIST_TYPE = "ListType", e.NON_NULL_TYPE = "NonNullType", e.SCHEMA_DEFINITION = "SchemaDefinition", e.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", e.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", e.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", e.FIELD_DEFINITION = "FieldDefinition", e.INPUT_VALUE_DEFINITION = "InputValueDefinition", e.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", e.UNION_TYPE_DEFINITION = "UnionTypeDefinition", e.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", e.ENUM_VALUE_DEFINITION = "EnumValueDefinition", e.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", e.DIRECTIVE_DEFINITION = "DirectiveDefinition", e.SCHEMA_EXTENSION = "SchemaExtension", e.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", e.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", e.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", e.UNION_TYPE_EXTENSION = "UnionTypeExtension", e.ENUM_TYPE_EXTENSION = "EnumTypeExtension", e.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension", e.TYPE_COORDINATE = "TypeCoordinate", e.MEMBER_COORDINATE = "MemberCoordinate", e.ARGUMENT_COORDINATE = "ArgumentCoordinate", e.DIRECTIVE_COORDINATE = "DirectiveCoordinate", e.DIRECTIVE_ARGUMENT_COORDINATE = "DirectiveArgumentCoordinate";
387
- })(u || (u = {}));
388
- function se(e) {
389
- return e === 9 || e === 32;
390
- }
391
- function U(e) {
392
- return e >= 48 && e <= 57;
393
- }
394
- function Se(e) {
395
- return e >= 97 && e <= 122 || // A-Z
396
- e >= 65 && e <= 90;
397
- }
398
- function Ce(e) {
399
- return Se(e) || e === 95;
400
- }
401
- function Qe(e) {
402
- return Se(e) || U(e) || e === 95;
403
- }
404
- function Je(e) {
405
- var t;
406
- let n = Number.MAX_SAFE_INTEGER, i = null, r = -1;
407
- for (let o = 0; o < e.length; ++o) {
371
+ };
372
+ new Set(Object.keys(be));
373
+ var D;
374
+ (function(n) {
375
+ n.QUERY = "query", n.MUTATION = "mutation", n.SUBSCRIPTION = "subscription";
376
+ })(D || (D = {}));
377
+ var q;
378
+ (function(n) {
379
+ n.QUERY = "QUERY", n.MUTATION = "MUTATION", n.SUBSCRIPTION = "SUBSCRIPTION", n.FIELD = "FIELD", n.FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", n.FRAGMENT_SPREAD = "FRAGMENT_SPREAD", n.INLINE_FRAGMENT = "INLINE_FRAGMENT", n.VARIABLE_DEFINITION = "VARIABLE_DEFINITION", n.SCHEMA = "SCHEMA", n.SCALAR = "SCALAR", n.OBJECT = "OBJECT", n.FIELD_DEFINITION = "FIELD_DEFINITION", n.ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", n.INTERFACE = "INTERFACE", n.UNION = "UNION", n.ENUM = "ENUM", n.ENUM_VALUE = "ENUM_VALUE", n.INPUT_OBJECT = "INPUT_OBJECT", n.INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION";
380
+ })(q || (q = {}));
381
+ var c;
382
+ (function(n) {
383
+ n.NAME = "Name", n.DOCUMENT = "Document", n.OPERATION_DEFINITION = "OperationDefinition", n.VARIABLE_DEFINITION = "VariableDefinition", n.SELECTION_SET = "SelectionSet", n.FIELD = "Field", n.ARGUMENT = "Argument", n.FRAGMENT_SPREAD = "FragmentSpread", n.INLINE_FRAGMENT = "InlineFragment", n.FRAGMENT_DEFINITION = "FragmentDefinition", n.VARIABLE = "Variable", n.INT = "IntValue", n.FLOAT = "FloatValue", n.STRING = "StringValue", n.BOOLEAN = "BooleanValue", n.NULL = "NullValue", n.ENUM = "EnumValue", n.LIST = "ListValue", n.OBJECT = "ObjectValue", n.OBJECT_FIELD = "ObjectField", n.DIRECTIVE = "Directive", n.NAMED_TYPE = "NamedType", n.LIST_TYPE = "ListType", n.NON_NULL_TYPE = "NonNullType", n.SCHEMA_DEFINITION = "SchemaDefinition", n.OPERATION_TYPE_DEFINITION = "OperationTypeDefinition", n.SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition", n.OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition", n.FIELD_DEFINITION = "FieldDefinition", n.INPUT_VALUE_DEFINITION = "InputValueDefinition", n.INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition", n.UNION_TYPE_DEFINITION = "UnionTypeDefinition", n.ENUM_TYPE_DEFINITION = "EnumTypeDefinition", n.ENUM_VALUE_DEFINITION = "EnumValueDefinition", n.INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition", n.DIRECTIVE_DEFINITION = "DirectiveDefinition", n.SCHEMA_EXTENSION = "SchemaExtension", n.SCALAR_TYPE_EXTENSION = "ScalarTypeExtension", n.OBJECT_TYPE_EXTENSION = "ObjectTypeExtension", n.INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension", n.UNION_TYPE_EXTENSION = "UnionTypeExtension", n.ENUM_TYPE_EXTENSION = "EnumTypeExtension", n.INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension", n.TYPE_COORDINATE = "TypeCoordinate", n.MEMBER_COORDINATE = "MemberCoordinate", n.ARGUMENT_COORDINATE = "ArgumentCoordinate", n.DIRECTIVE_COORDINATE = "DirectiveCoordinate", n.DIRECTIVE_ARGUMENT_COORDINATE = "DirectiveArgumentCoordinate";
384
+ })(c || (c = {}));
385
+ function Se(n) {
386
+ return n === 9 || n === 32;
387
+ }
388
+ function S(n) {
389
+ return n >= 48 && n <= 57;
390
+ }
391
+ function ue(n) {
392
+ return n >= 97 && n <= 122 || // A-Z
393
+ n >= 65 && n <= 90;
394
+ }
395
+ function le(n) {
396
+ return ue(n) || n === 95;
397
+ }
398
+ function Ce(n) {
399
+ return ue(n) || S(n) || n === 95;
400
+ }
401
+ function _e(n) {
402
+ var e;
403
+ let t = Number.MAX_SAFE_INTEGER, i = null, r = -1;
404
+ for (let o = 0; o < n.length; ++o) {
408
405
  var s;
409
- const p = e[o], f = Xe(p);
410
- f !== p.length && (i = (s = i) !== null && s !== void 0 ? s : o, r = o, o !== 0 && f < n && (n = f));
406
+ const u = n[o], h = Le(u);
407
+ h !== u.length && (i = (s = i) !== null && s !== void 0 ? s : o, r = o, o !== 0 && h < t && (t = h));
411
408
  }
412
- return e.map((o, p) => p === 0 ? o : o.slice(n)).slice(
413
- (t = i) !== null && t !== void 0 ? t : 0,
409
+ return n.map((o, u) => u === 0 ? o : o.slice(t)).slice(
410
+ (e = i) !== null && e !== void 0 ? e : 0,
414
411
  r + 1
415
412
  );
416
413
  }
417
- function Xe(e) {
418
- let t = 0;
419
- for (; t < e.length && se(e.charCodeAt(t)); )
420
- ++t;
421
- return t;
422
- }
423
- function We(e, t) {
424
- const n = e.replace(/"""/g, '\\"""'), i = n.split(/\r\n|[\n\r]/g), r = i.length === 1, s = i.length > 1 && i.slice(1).every((y) => y.length === 0 || se(y.charCodeAt(0))), o = n.endsWith('\\"""'), p = e.endsWith('"') && !o, f = e.endsWith("\\"), l = p || f, g = (
425
- // add leading and trailing new lines only if it improves readability
426
- !r || e.length > 70 || l || s || o
427
- );
428
- let d = "";
429
- const m = r && se(e.charCodeAt(0));
430
- return (g && !m || s) && (d += `
431
- `), d += n, (g || l) && (d += `
432
- `), '"""' + d + '"""';
414
+ function Le(n) {
415
+ let e = 0;
416
+ for (; e < n.length && Se(n.charCodeAt(e)); )
417
+ ++e;
418
+ return e;
433
419
  }
434
420
  var a;
435
- (function(e) {
436
- e.SOF = "<SOF>", e.EOF = "<EOF>", e.BANG = "!", e.DOLLAR = "$", e.AMP = "&", e.PAREN_L = "(", e.PAREN_R = ")", e.DOT = ".", e.SPREAD = "...", e.COLON = ":", e.EQUALS = "=", e.AT = "@", e.BRACKET_L = "[", e.BRACKET_R = "]", e.BRACE_L = "{", e.PIPE = "|", e.BRACE_R = "}", e.NAME = "Name", e.INT = "Int", e.FLOAT = "Float", e.STRING = "String", e.BLOCK_STRING = "BlockString", e.COMMENT = "Comment";
421
+ (function(n) {
422
+ n.SOF = "<SOF>", n.EOF = "<EOF>", n.BANG = "!", n.DOLLAR = "$", n.AMP = "&", n.PAREN_L = "(", n.PAREN_R = ")", n.DOT = ".", n.SPREAD = "...", n.COLON = ":", n.EQUALS = "=", n.AT = "@", n.BRACKET_L = "[", n.BRACKET_R = "]", n.BRACE_L = "{", n.PIPE = "|", n.BRACE_R = "}", n.NAME = "Name", n.INT = "Int", n.FLOAT = "Float", n.STRING = "String", n.BLOCK_STRING = "BlockString", n.COMMENT = "Comment";
437
423
  })(a || (a = {}));
438
- class Ze {
424
+ class Re {
439
425
  /**
440
426
  * The previously focused non-ignored token.
441
427
  */
@@ -448,9 +434,9 @@ class Ze {
448
434
  /**
449
435
  * The character offset at which the current line begins.
450
436
  */
451
- constructor(t) {
452
- const n = new be(a.SOF, 0, 0, 0, 0);
453
- this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
437
+ constructor(e) {
438
+ const t = new de(a.SOF, 0, 0, 0, 0);
439
+ this.source = e, this.lastToken = t, this.token = t, this.line = 1, this.lineStart = 0;
454
440
  }
455
441
  get [Symbol.toStringTag]() {
456
442
  return "Lexer";
@@ -466,53 +452,53 @@ class Ze {
466
452
  * the state of Lexer.
467
453
  */
468
454
  lookahead() {
469
- let t = this.token;
470
- if (t.kind !== a.EOF)
455
+ let e = this.token;
456
+ if (e.kind !== a.EOF)
471
457
  do
472
- if (t.next)
473
- t = t.next;
458
+ if (e.next)
459
+ e = e.next;
474
460
  else {
475
- const n = et(this, t.end);
476
- t.next = n, n.prev = t, t = n;
461
+ const t = Fe(this, e.end);
462
+ e.next = t, t.prev = e, e = t;
477
463
  }
478
- while (t.kind === a.COMMENT);
479
- return t;
464
+ while (e.kind === a.COMMENT);
465
+ return e;
480
466
  }
481
467
  }
482
- function Ke(e) {
483
- return e === a.BANG || e === a.DOLLAR || e === a.AMP || e === a.PAREN_L || e === a.PAREN_R || e === a.DOT || e === a.SPREAD || e === a.COLON || e === a.EQUALS || e === a.AT || e === a.BRACKET_L || e === a.BRACKET_R || e === a.BRACE_L || e === a.PIPE || e === a.BRACE_R;
468
+ function we(n) {
469
+ return n === a.BANG || n === a.DOLLAR || n === a.AMP || n === a.PAREN_L || n === a.PAREN_R || n === a.DOT || n === a.SPREAD || n === a.COLON || n === a.EQUALS || n === a.AT || n === a.BRACKET_L || n === a.BRACKET_R || n === a.BRACE_L || n === a.PIPE || n === a.BRACE_R;
484
470
  }
485
- function F(e) {
486
- return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
471
+ function x(n) {
472
+ return n >= 0 && n <= 55295 || n >= 57344 && n <= 1114111;
487
473
  }
488
- function X(e, t) {
489
- return _e(e.charCodeAt(t)) && Le(e.charCodeAt(t + 1));
474
+ function B(n, e) {
475
+ return he(n.charCodeAt(e)) && pe(n.charCodeAt(e + 1));
490
476
  }
491
- function _e(e) {
492
- return e >= 55296 && e <= 56319;
477
+ function he(n) {
478
+ return n >= 55296 && n <= 56319;
493
479
  }
494
- function Le(e) {
495
- return e >= 56320 && e <= 57343;
480
+ function pe(n) {
481
+ return n >= 56320 && n <= 57343;
496
482
  }
497
- function R(e, t) {
498
- const n = e.source.body.codePointAt(t);
499
- if (n === void 0)
483
+ function N(n, e) {
484
+ const t = n.source.body.codePointAt(e);
485
+ if (t === void 0)
500
486
  return a.EOF;
501
- if (n >= 32 && n <= 126) {
502
- const i = String.fromCodePoint(n);
487
+ if (t >= 32 && t <= 126) {
488
+ const i = String.fromCodePoint(t);
503
489
  return i === '"' ? `'"'` : `"${i}"`;
504
490
  }
505
- return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
491
+ return "U+" + t.toString(16).toUpperCase().padStart(4, "0");
506
492
  }
507
- function T(e, t, n, i, r) {
508
- const s = e.line, o = 1 + n - e.lineStart;
509
- return new be(t, n, i, s, o, r);
493
+ function g(n, e, t, i, r) {
494
+ const s = n.line, o = 1 + t - n.lineStart;
495
+ return new de(e, t, i, s, o, r);
510
496
  }
511
- function et(e, t) {
512
- const n = e.source.body, i = n.length;
513
- let r = t;
497
+ function Fe(n, e) {
498
+ const t = n.source.body, i = t.length;
499
+ let r = e;
514
500
  for (; r < i; ) {
515
- const s = n.charCodeAt(r);
501
+ const s = t.charCodeAt(r);
516
502
  switch (s) {
517
503
  // Ignored ::
518
504
  // - UnicodeBOM
@@ -542,14 +528,14 @@ function et(e, t) {
542
528
  // - "Carriage Return (U+000D)" [lookahead != "New Line (U+000A)"]
543
529
  // - "Carriage Return (U+000D)" "New Line (U+000A)"
544
530
  case 10:
545
- ++r, ++e.line, e.lineStart = r;
531
+ ++r, ++n.line, n.lineStart = r;
546
532
  continue;
547
533
  case 13:
548
- n.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++e.line, e.lineStart = r;
534
+ t.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++n.line, n.lineStart = r;
549
535
  continue;
550
536
  // Comment
551
537
  case 35:
552
- return tt(e, r);
538
+ return $e(n, r);
553
539
  // Token ::
554
540
  // - Punctuator
555
541
  // - Name
@@ -559,207 +545,207 @@ function et(e, t) {
559
545
  //
560
546
  // Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
561
547
  case 33:
562
- return T(e, a.BANG, r, r + 1);
548
+ return g(n, a.BANG, r, r + 1);
563
549
  case 36:
564
- return T(e, a.DOLLAR, r, r + 1);
550
+ return g(n, a.DOLLAR, r, r + 1);
565
551
  case 38:
566
- return T(e, a.AMP, r, r + 1);
552
+ return g(n, a.AMP, r, r + 1);
567
553
  case 40:
568
- return T(e, a.PAREN_L, r, r + 1);
554
+ return g(n, a.PAREN_L, r, r + 1);
569
555
  case 41:
570
- return T(e, a.PAREN_R, r, r + 1);
556
+ return g(n, a.PAREN_R, r, r + 1);
571
557
  case 46:
572
- if (n.charCodeAt(r + 1) === 46 && n.charCodeAt(r + 2) === 46)
573
- return T(e, a.SPREAD, r, r + 3);
558
+ if (t.charCodeAt(r + 1) === 46 && t.charCodeAt(r + 2) === 46)
559
+ return g(n, a.SPREAD, r, r + 3);
574
560
  break;
575
561
  case 58:
576
- return T(e, a.COLON, r, r + 1);
562
+ return g(n, a.COLON, r, r + 1);
577
563
  case 61:
578
- return T(e, a.EQUALS, r, r + 1);
564
+ return g(n, a.EQUALS, r, r + 1);
579
565
  case 64:
580
- return T(e, a.AT, r, r + 1);
566
+ return g(n, a.AT, r, r + 1);
581
567
  case 91:
582
- return T(e, a.BRACKET_L, r, r + 1);
568
+ return g(n, a.BRACKET_L, r, r + 1);
583
569
  case 93:
584
- return T(e, a.BRACKET_R, r, r + 1);
570
+ return g(n, a.BRACKET_R, r, r + 1);
585
571
  case 123:
586
- return T(e, a.BRACE_L, r, r + 1);
572
+ return g(n, a.BRACE_L, r, r + 1);
587
573
  case 124:
588
- return T(e, a.PIPE, r, r + 1);
574
+ return g(n, a.PIPE, r, r + 1);
589
575
  case 125:
590
- return T(e, a.BRACE_R, r, r + 1);
576
+ return g(n, a.BRACE_R, r, r + 1);
591
577
  // StringValue
592
578
  case 34:
593
- return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? ot(e, r) : it(e, r);
579
+ return t.charCodeAt(r + 1) === 34 && t.charCodeAt(r + 2) === 34 ? qe(n, r) : Ve(n, r);
594
580
  }
595
- if (U(s) || s === 45)
596
- return nt(e, r, s);
597
- if (Ce(s))
598
- return ct(e, r);
599
- throw v(
600
- e.source,
581
+ if (S(s) || s === 45)
582
+ return Be(n, r, s);
583
+ if (le(s))
584
+ return Ge(n, r);
585
+ throw I(
586
+ n.source,
601
587
  r,
602
- s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : F(s) || X(n, r) ? `Unexpected character: ${R(e, r)}.` : `Invalid character: ${R(e, r)}.`
588
+ s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : x(s) || B(t, r) ? `Unexpected character: ${N(n, r)}.` : `Invalid character: ${N(n, r)}.`
603
589
  );
604
590
  }
605
- return T(e, a.EOF, i, i);
591
+ return g(n, a.EOF, i, i);
606
592
  }
607
- function tt(e, t) {
608
- const n = e.source.body, i = n.length;
609
- let r = t + 1;
593
+ function $e(n, e) {
594
+ const t = n.source.body, i = t.length;
595
+ let r = e + 1;
610
596
  for (; r < i; ) {
611
- const s = n.charCodeAt(r);
597
+ const s = t.charCodeAt(r);
612
598
  if (s === 10 || s === 13)
613
599
  break;
614
- if (F(s))
600
+ if (x(s))
615
601
  ++r;
616
- else if (X(n, r))
602
+ else if (B(t, r))
617
603
  r += 2;
618
604
  else
619
605
  break;
620
606
  }
621
- return T(
622
- e,
607
+ return g(
608
+ n,
623
609
  a.COMMENT,
624
- t,
610
+ e,
625
611
  r,
626
- n.slice(t + 1, r)
612
+ t.slice(e + 1, r)
627
613
  );
628
614
  }
629
- function nt(e, t, n) {
630
- const i = e.source.body;
631
- let r = t, s = n, o = !1;
615
+ function Be(n, e, t) {
616
+ const i = n.source.body;
617
+ let r = e, s = t, o = !1;
632
618
  if (s === 45 && (s = i.charCodeAt(++r)), s === 48) {
633
- if (s = i.charCodeAt(++r), U(s))
634
- throw v(
635
- e.source,
619
+ if (s = i.charCodeAt(++r), S(s))
620
+ throw I(
621
+ n.source,
636
622
  r,
637
- `Invalid number, unexpected digit after 0: ${R(
638
- e,
623
+ `Invalid number, unexpected digit after 0: ${N(
624
+ n,
639
625
  r
640
626
  )}.`
641
627
  );
642
628
  } else
643
- r = ee(e, r, s), s = i.charCodeAt(r);
644
- if (s === 46 && (o = !0, s = i.charCodeAt(++r), r = ee(e, r, s), s = i.charCodeAt(r)), (s === 69 || s === 101) && (o = !0, s = i.charCodeAt(++r), (s === 43 || s === 45) && (s = i.charCodeAt(++r)), r = ee(e, r, s), s = i.charCodeAt(r)), s === 46 || Ce(s))
645
- throw v(
646
- e.source,
629
+ r = M(n, r, s), s = i.charCodeAt(r);
630
+ if (s === 46 && (o = !0, s = i.charCodeAt(++r), r = M(n, r, s), s = i.charCodeAt(r)), (s === 69 || s === 101) && (o = !0, s = i.charCodeAt(++r), (s === 43 || s === 45) && (s = i.charCodeAt(++r)), r = M(n, r, s), s = i.charCodeAt(r)), s === 46 || le(s))
631
+ throw I(
632
+ n.source,
647
633
  r,
648
- `Invalid number, expected digit but got: ${R(
649
- e,
634
+ `Invalid number, expected digit but got: ${N(
635
+ n,
650
636
  r
651
637
  )}.`
652
638
  );
653
- return T(
654
- e,
639
+ return g(
640
+ n,
655
641
  o ? a.FLOAT : a.INT,
656
- t,
642
+ e,
657
643
  r,
658
- i.slice(t, r)
644
+ i.slice(e, r)
659
645
  );
660
646
  }
661
- function ee(e, t, n) {
662
- if (!U(n))
663
- throw v(
664
- e.source,
665
- t,
666
- `Invalid number, expected digit but got: ${R(
667
- e,
668
- t
647
+ function M(n, e, t) {
648
+ if (!S(t))
649
+ throw I(
650
+ n.source,
651
+ e,
652
+ `Invalid number, expected digit but got: ${N(
653
+ n,
654
+ e
669
655
  )}.`
670
656
  );
671
- const i = e.source.body;
672
- let r = t + 1;
673
- for (; U(i.charCodeAt(r)); )
657
+ const i = n.source.body;
658
+ let r = e + 1;
659
+ for (; S(i.charCodeAt(r)); )
674
660
  ++r;
675
661
  return r;
676
662
  }
677
- function it(e, t) {
678
- const n = e.source.body, i = n.length;
679
- let r = t + 1, s = r, o = "";
663
+ function Ve(n, e) {
664
+ const t = n.source.body, i = t.length;
665
+ let r = e + 1, s = r, o = "";
680
666
  for (; r < i; ) {
681
- const p = n.charCodeAt(r);
682
- if (p === 34)
683
- return o += n.slice(s, r), T(e, a.STRING, t, r + 1, o);
684
- if (p === 92) {
685
- o += n.slice(s, r);
686
- const f = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ? rt(e, r) : st(e, r) : at(e, r);
687
- o += f.value, r += f.size, s = r;
667
+ const u = t.charCodeAt(r);
668
+ if (u === 34)
669
+ return o += t.slice(s, r), g(n, a.STRING, e, r + 1, o);
670
+ if (u === 92) {
671
+ o += t.slice(s, r);
672
+ const h = t.charCodeAt(r + 1) === 117 ? t.charCodeAt(r + 2) === 123 ? Ue(n, r) : Me(n, r) : ze(n, r);
673
+ o += h.value, r += h.size, s = r;
688
674
  continue;
689
675
  }
690
- if (p === 10 || p === 13)
676
+ if (u === 10 || u === 13)
691
677
  break;
692
- if (F(p))
678
+ if (x(u))
693
679
  ++r;
694
- else if (X(n, r))
680
+ else if (B(t, r))
695
681
  r += 2;
696
682
  else
697
- throw v(
698
- e.source,
683
+ throw I(
684
+ n.source,
699
685
  r,
700
- `Invalid character within String: ${R(
701
- e,
686
+ `Invalid character within String: ${N(
687
+ n,
702
688
  r
703
689
  )}.`
704
690
  );
705
691
  }
706
- throw v(e.source, r, "Unterminated string.");
692
+ throw I(n.source, r, "Unterminated string.");
707
693
  }
708
- function rt(e, t) {
709
- const n = e.source.body;
694
+ function Ue(n, e) {
695
+ const t = n.source.body;
710
696
  let i = 0, r = 3;
711
697
  for (; r < 12; ) {
712
- const s = n.charCodeAt(t + r++);
698
+ const s = t.charCodeAt(e + r++);
713
699
  if (s === 125) {
714
- if (r < 5 || !F(i))
700
+ if (r < 5 || !x(i))
715
701
  break;
716
702
  return {
717
703
  value: String.fromCodePoint(i),
718
704
  size: r
719
705
  };
720
706
  }
721
- if (i = i << 4 | V(s), i < 0)
707
+ if (i = i << 4 | b(s), i < 0)
722
708
  break;
723
709
  }
724
- throw v(
725
- e.source,
726
- t,
727
- `Invalid Unicode escape sequence: "${n.slice(
728
- t,
729
- t + r
710
+ throw I(
711
+ n.source,
712
+ e,
713
+ `Invalid Unicode escape sequence: "${t.slice(
714
+ e,
715
+ e + r
730
716
  )}".`
731
717
  );
732
718
  }
733
- function st(e, t) {
734
- const n = e.source.body, i = fe(n, t + 2);
735
- if (F(i))
719
+ function Me(n, e) {
720
+ const t = n.source.body, i = W(t, e + 2);
721
+ if (x(i))
736
722
  return {
737
723
  value: String.fromCodePoint(i),
738
724
  size: 6
739
725
  };
740
- if (_e(i) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
741
- const r = fe(n, t + 8);
742
- if (Le(r))
726
+ if (he(i) && t.charCodeAt(e + 6) === 92 && t.charCodeAt(e + 7) === 117) {
727
+ const r = W(t, e + 8);
728
+ if (pe(r))
743
729
  return {
744
730
  value: String.fromCodePoint(i, r),
745
731
  size: 12
746
732
  };
747
733
  }
748
- throw v(
749
- e.source,
750
- t,
751
- `Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`
734
+ throw I(
735
+ n.source,
736
+ e,
737
+ `Invalid Unicode escape sequence: "${t.slice(e, e + 6)}".`
752
738
  );
753
739
  }
754
- function fe(e, t) {
755
- return V(e.charCodeAt(t)) << 12 | V(e.charCodeAt(t + 1)) << 8 | V(e.charCodeAt(t + 2)) << 4 | V(e.charCodeAt(t + 3));
740
+ function W(n, e) {
741
+ return b(n.charCodeAt(e)) << 12 | b(n.charCodeAt(e + 1)) << 8 | b(n.charCodeAt(e + 2)) << 4 | b(n.charCodeAt(e + 3));
756
742
  }
757
- function V(e) {
758
- return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
743
+ function b(n) {
744
+ return n >= 48 && n <= 57 ? n - 48 : n >= 65 && n <= 70 ? n - 55 : n >= 97 && n <= 102 ? n - 87 : -1;
759
745
  }
760
- function at(e, t) {
761
- const n = e.source.body;
762
- switch (n.charCodeAt(t + 1)) {
746
+ function ze(n, e) {
747
+ const t = n.source.body;
748
+ switch (t.charCodeAt(e + 1)) {
763
749
  case 34:
764
750
  return {
765
751
  value: '"',
@@ -802,151 +788,151 @@ function at(e, t) {
802
788
  size: 2
803
789
  };
804
790
  }
805
- throw v(
806
- e.source,
807
- t,
808
- `Invalid character escape sequence: "${n.slice(
809
- t,
810
- t + 2
791
+ throw I(
792
+ n.source,
793
+ e,
794
+ `Invalid character escape sequence: "${t.slice(
795
+ e,
796
+ e + 2
811
797
  )}".`
812
798
  );
813
799
  }
814
- function ot(e, t) {
815
- const n = e.source.body, i = n.length;
816
- let r = e.lineStart, s = t + 3, o = s, p = "";
817
- const f = [];
800
+ function qe(n, e) {
801
+ const t = n.source.body, i = t.length;
802
+ let r = n.lineStart, s = e + 3, o = s, u = "";
803
+ const h = [];
818
804
  for (; s < i; ) {
819
- const l = n.charCodeAt(s);
820
- if (l === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
821
- p += n.slice(o, s), f.push(p);
822
- const g = T(
823
- e,
805
+ const E = t.charCodeAt(s);
806
+ if (E === 34 && t.charCodeAt(s + 1) === 34 && t.charCodeAt(s + 2) === 34) {
807
+ u += t.slice(o, s), h.push(u);
808
+ const m = g(
809
+ n,
824
810
  a.BLOCK_STRING,
825
- t,
811
+ e,
826
812
  s + 3,
827
813
  // Return a string of the lines joined with U+000A.
828
- Je(f).join(`
814
+ _e(h).join(`
829
815
  `)
830
816
  );
831
- return e.line += f.length - 1, e.lineStart = r, g;
817
+ return n.line += h.length - 1, n.lineStart = r, m;
832
818
  }
833
- if (l === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
834
- p += n.slice(o, s), o = s + 1, s += 4;
819
+ if (E === 92 && t.charCodeAt(s + 1) === 34 && t.charCodeAt(s + 2) === 34 && t.charCodeAt(s + 3) === 34) {
820
+ u += t.slice(o, s), o = s + 1, s += 4;
835
821
  continue;
836
822
  }
837
- if (l === 10 || l === 13) {
838
- p += n.slice(o, s), f.push(p), l === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, p = "", o = s, r = s;
823
+ if (E === 10 || E === 13) {
824
+ u += t.slice(o, s), h.push(u), E === 13 && t.charCodeAt(s + 1) === 10 ? s += 2 : ++s, u = "", o = s, r = s;
839
825
  continue;
840
826
  }
841
- if (F(l))
827
+ if (x(E))
842
828
  ++s;
843
- else if (X(n, s))
829
+ else if (B(t, s))
844
830
  s += 2;
845
831
  else
846
- throw v(
847
- e.source,
832
+ throw I(
833
+ n.source,
848
834
  s,
849
- `Invalid character within String: ${R(
850
- e,
835
+ `Invalid character within String: ${N(
836
+ n,
851
837
  s
852
838
  )}.`
853
839
  );
854
840
  }
855
- throw v(e.source, s, "Unterminated string.");
841
+ throw I(n.source, s, "Unterminated string.");
856
842
  }
857
- function ct(e, t) {
858
- const n = e.source.body, i = n.length;
859
- let r = t + 1;
843
+ function Ge(n, e) {
844
+ const t = n.source.body, i = t.length;
845
+ let r = e + 1;
860
846
  for (; r < i; ) {
861
- const s = n.charCodeAt(r);
862
- if (Qe(s))
847
+ const s = t.charCodeAt(r);
848
+ if (Ce(s))
863
849
  ++r;
864
850
  else
865
851
  break;
866
852
  }
867
- return T(
868
- e,
853
+ return g(
854
+ n,
869
855
  a.NAME,
870
- t,
856
+ e,
871
857
  r,
872
- n.slice(t, r)
858
+ t.slice(e, r)
873
859
  );
874
860
  }
875
- const dt = 10, Re = 2;
876
- function de(e) {
877
- return W(e, []);
861
+ const je = 10, me = 2;
862
+ function fe(n) {
863
+ return V(n, []);
878
864
  }
879
- function W(e, t) {
880
- switch (typeof e) {
865
+ function V(n, e) {
866
+ switch (typeof n) {
881
867
  case "string":
882
- return JSON.stringify(e);
868
+ return JSON.stringify(n);
883
869
  case "function":
884
- return e.name ? `[function ${e.name}]` : "[function]";
870
+ return n.name ? `[function ${n.name}]` : "[function]";
885
871
  case "object":
886
- return ut(e, t);
872
+ return Ye(n, e);
887
873
  default:
888
- return String(e);
874
+ return String(n);
889
875
  }
890
876
  }
891
- function ut(e, t) {
892
- if (e === null)
877
+ function Ye(n, e) {
878
+ if (n === null)
893
879
  return "null";
894
- if (t.includes(e))
880
+ if (e.includes(n))
895
881
  return "[Circular]";
896
- const n = [...t, e];
897
- if (lt(e)) {
898
- const i = e.toJSON();
899
- if (i !== e)
900
- return typeof i == "string" ? i : W(i, n);
901
- } else if (Array.isArray(e))
902
- return ht(e, n);
903
- return pt(e, n);
904
- }
905
- function lt(e) {
906
- return typeof e.toJSON == "function";
907
- }
908
- function pt(e, t) {
909
- const n = Object.entries(e);
910
- return n.length === 0 ? "{}" : t.length > Re ? "[" + ft(e) + "]" : "{ " + n.map(
911
- ([r, s]) => r + ": " + W(s, t)
882
+ const t = [...e, n];
883
+ if (He(n)) {
884
+ const i = n.toJSON();
885
+ if (i !== n)
886
+ return typeof i == "string" ? i : V(i, t);
887
+ } else if (Array.isArray(n))
888
+ return Qe(n, t);
889
+ return Je(n, t);
890
+ }
891
+ function He(n) {
892
+ return typeof n.toJSON == "function";
893
+ }
894
+ function Je(n, e) {
895
+ const t = Object.entries(n);
896
+ return t.length === 0 ? "{}" : e.length > me ? "[" + Xe(n) + "]" : "{ " + t.map(
897
+ ([r, s]) => r + ": " + V(s, e)
912
898
  ).join(", ") + " }";
913
899
  }
914
- function ht(e, t) {
915
- if (e.length === 0)
900
+ function Qe(n, e) {
901
+ if (n.length === 0)
916
902
  return "[]";
917
- if (t.length > Re)
903
+ if (e.length > me)
918
904
  return "[Array]";
919
- const n = Math.min(dt, e.length), i = e.length - n, r = [];
920
- for (let s = 0; s < n; ++s)
921
- r.push(W(e[s], t));
905
+ const t = Math.min(je, n.length), i = n.length - t, r = [];
906
+ for (let s = 0; s < t; ++s)
907
+ r.push(V(n[s], e));
922
908
  return i === 1 ? r.push("... 1 more item") : i > 1 && r.push(`... ${i} more items`), "[" + r.join(", ") + "]";
923
909
  }
924
- function ft(e) {
925
- const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
926
- if (t === "Object" && typeof e.constructor == "function") {
927
- const n = e.constructor.name;
928
- if (typeof n == "string" && n !== "")
929
- return n;
910
+ function Xe(n) {
911
+ const e = Object.prototype.toString.call(n).replace(/^\[object /, "").replace(/]$/, "");
912
+ if (e === "Object" && typeof n.constructor == "function") {
913
+ const t = n.constructor.name;
914
+ if (typeof t == "string" && t !== "")
915
+ return t;
930
916
  }
931
- return t;
917
+ return e;
932
918
  }
933
- const mt = globalThis.process && // eslint-disable-next-line no-undef
934
- process.env.NODE_ENV === "production", gt = (
919
+ const We = globalThis.process && // eslint-disable-next-line no-undef
920
+ process.env.NODE_ENV === "production", Ze = (
935
921
  /* c8 ignore next 6 */
936
922
  // FIXME: https://github.com/graphql/graphql-js/issues/2317
937
- mt ? function(t, n) {
938
- return t instanceof n;
939
- } : function(t, n) {
940
- if (t instanceof n)
923
+ We ? function(e, t) {
924
+ return e instanceof t;
925
+ } : function(e, t) {
926
+ if (e instanceof t)
941
927
  return !0;
942
- if (typeof t == "object" && t !== null) {
928
+ if (typeof e == "object" && e !== null) {
943
929
  var i;
944
- const r = n.prototype[Symbol.toStringTag], s = (
930
+ const r = t.prototype[Symbol.toStringTag], s = (
945
931
  // We still need to support constructor's name to detect conflicts with older versions of this library.
946
- Symbol.toStringTag in t ? t[Symbol.toStringTag] : (i = t.constructor) === null || i === void 0 ? void 0 : i.name
932
+ Symbol.toStringTag in e ? e[Symbol.toStringTag] : (i = e.constructor) === null || i === void 0 ? void 0 : i.name
947
933
  );
948
934
  if (r === s) {
949
- const o = de(t);
935
+ const o = fe(e);
950
936
  throw new Error(`Cannot use ${r} "${o}" from another module or realm.
951
937
 
952
938
  Ensure that there is only one instance of "graphql" in the node_modules
@@ -964,15 +950,15 @@ spurious results.`);
964
950
  return !1;
965
951
  }
966
952
  );
967
- class we {
968
- constructor(t, n = "GraphQL request", i = {
953
+ class ge {
954
+ constructor(e, t = "GraphQL request", i = {
969
955
  line: 1,
970
956
  column: 1
971
957
  }) {
972
- typeof t == "string" || z(!1, `Body must be a string. Received: ${de(t)}.`), this.body = t, this.name = n, this.locationOffset = i, this.locationOffset.line > 0 || z(
958
+ typeof e == "string" || U(!1, `Body must be a string. Received: ${fe(e)}.`), this.body = e, this.name = t, this.locationOffset = i, this.locationOffset.line > 0 || U(
973
959
  !1,
974
960
  "line in locationOffset is 1-indexed and must be positive."
975
- ), this.locationOffset.column > 0 || z(
961
+ ), this.locationOffset.column > 0 || U(
976
962
  !1,
977
963
  "column in locationOffset is 1-indexed and must be positive."
978
964
  );
@@ -981,24 +967,24 @@ class we {
981
967
  return "Source";
982
968
  }
983
969
  }
984
- function It(e) {
985
- return gt(e, we);
970
+ function Ke(n) {
971
+ return Ze(n, ge);
986
972
  }
987
- function Et(e, t) {
988
- const n = new yt(e, t), i = n.parseDocument();
973
+ function et(n, e) {
974
+ const t = new tt(n, e), i = t.parseDocument();
989
975
  return Object.defineProperty(i, "tokenCount", {
990
976
  enumerable: !1,
991
- value: n.tokenCount
977
+ value: t.tokenCount
992
978
  }), i;
993
979
  }
994
- class yt {
995
- constructor(t, n = {}) {
996
- const { lexer: i, ...r } = n;
980
+ class tt {
981
+ constructor(e, t = {}) {
982
+ const { lexer: i, ...r } = t;
997
983
  if (i)
998
984
  this._lexer = i;
999
985
  else {
1000
- const s = It(t) ? t : new we(t);
1001
- this._lexer = new Ze(s);
986
+ const s = Ke(e) ? e : new ge(e);
987
+ this._lexer = new Re(s);
1002
988
  }
1003
989
  this._options = r, this._tokenCounter = 0;
1004
990
  }
@@ -1009,10 +995,10 @@ class yt {
1009
995
  * Converts a name lex token into a name parse node.
1010
996
  */
1011
997
  parseName() {
1012
- const t = this.expectToken(a.NAME);
1013
- return this.node(t, {
1014
- kind: u.NAME,
1015
- value: t.value
998
+ const e = this.expectToken(a.NAME);
999
+ return this.node(e, {
1000
+ kind: c.NAME,
1001
+ value: e.value
1016
1002
  });
1017
1003
  }
1018
1004
  // Implements the parsing rules in the Document section.
@@ -1021,7 +1007,7 @@ class yt {
1021
1007
  */
1022
1008
  parseDocument() {
1023
1009
  return this.node(this._lexer.token, {
1024
- kind: u.DOCUMENT,
1010
+ kind: c.DOCUMENT,
1025
1011
  definitions: this.many(
1026
1012
  a.SOF,
1027
1013
  this.parseDefinition,
@@ -1055,15 +1041,15 @@ class yt {
1055
1041
  parseDefinition() {
1056
1042
  if (this.peek(a.BRACE_L))
1057
1043
  return this.parseOperationDefinition();
1058
- const t = this.peekDescription(), n = t ? this._lexer.lookahead() : this._lexer.token;
1059
- if (t && n.kind === a.BRACE_L)
1060
- throw v(
1044
+ const e = this.peekDescription(), t = e ? this._lexer.lookahead() : this._lexer.token;
1045
+ if (e && t.kind === a.BRACE_L)
1046
+ throw I(
1061
1047
  this._lexer.source,
1062
1048
  this._lexer.token.start,
1063
1049
  "Unexpected description, descriptions are not supported on shorthand queries."
1064
1050
  );
1065
- if (n.kind === a.NAME) {
1066
- switch (n.value) {
1051
+ if (t.kind === a.NAME) {
1052
+ switch (t.value) {
1067
1053
  case "schema":
1068
1054
  return this.parseSchemaDefinition();
1069
1055
  case "scalar":
@@ -1081,7 +1067,7 @@ class yt {
1081
1067
  case "directive":
1082
1068
  return this.parseDirectiveDefinition();
1083
1069
  }
1084
- switch (n.value) {
1070
+ switch (t.value) {
1085
1071
  case "query":
1086
1072
  case "mutation":
1087
1073
  case "subscription":
@@ -1089,16 +1075,16 @@ class yt {
1089
1075
  case "fragment":
1090
1076
  return this.parseFragmentDefinition();
1091
1077
  }
1092
- if (t)
1093
- throw v(
1078
+ if (e)
1079
+ throw I(
1094
1080
  this._lexer.source,
1095
1081
  this._lexer.token.start,
1096
1082
  "Unexpected description, only GraphQL definitions support descriptions."
1097
1083
  );
1098
- if (n.value === "extend")
1084
+ if (t.value === "extend")
1099
1085
  return this.parseTypeSystemExtension();
1100
1086
  }
1101
- throw this.unexpected(n);
1087
+ throw this.unexpected(t);
1102
1088
  }
1103
1089
  // Implements the parsing rules in the Operations section.
1104
1090
  /**
@@ -1107,23 +1093,23 @@ class yt {
1107
1093
  * - OperationType Name? VariableDefinitions? Directives? SelectionSet
1108
1094
  */
1109
1095
  parseOperationDefinition() {
1110
- const t = this._lexer.token;
1096
+ const e = this._lexer.token;
1111
1097
  if (this.peek(a.BRACE_L))
1112
- return this.node(t, {
1113
- kind: u.OPERATION_DEFINITION,
1114
- operation: w.QUERY,
1098
+ return this.node(e, {
1099
+ kind: c.OPERATION_DEFINITION,
1100
+ operation: D.QUERY,
1115
1101
  description: void 0,
1116
1102
  name: void 0,
1117
1103
  variableDefinitions: [],
1118
1104
  directives: [],
1119
1105
  selectionSet: this.parseSelectionSet()
1120
1106
  });
1121
- const n = this.parseDescription(), i = this.parseOperationType();
1107
+ const t = this.parseDescription(), i = this.parseOperationType();
1122
1108
  let r;
1123
- return this.peek(a.NAME) && (r = this.parseName()), this.node(t, {
1124
- kind: u.OPERATION_DEFINITION,
1109
+ return this.peek(a.NAME) && (r = this.parseName()), this.node(e, {
1110
+ kind: c.OPERATION_DEFINITION,
1125
1111
  operation: i,
1126
- description: n,
1112
+ description: t,
1127
1113
  name: r,
1128
1114
  variableDefinitions: this.parseVariableDefinitions(),
1129
1115
  directives: this.parseDirectives(!1),
@@ -1134,16 +1120,16 @@ class yt {
1134
1120
  * OperationType : one of query mutation subscription
1135
1121
  */
1136
1122
  parseOperationType() {
1137
- const t = this.expectToken(a.NAME);
1138
- switch (t.value) {
1123
+ const e = this.expectToken(a.NAME);
1124
+ switch (e.value) {
1139
1125
  case "query":
1140
- return w.QUERY;
1126
+ return D.QUERY;
1141
1127
  case "mutation":
1142
- return w.MUTATION;
1128
+ return D.MUTATION;
1143
1129
  case "subscription":
1144
- return w.SUBSCRIPTION;
1130
+ return D.SUBSCRIPTION;
1145
1131
  }
1146
- throw this.unexpected(t);
1132
+ throw this.unexpected(e);
1147
1133
  }
1148
1134
  /**
1149
1135
  * VariableDefinitions : ( VariableDefinition+ )
@@ -1160,7 +1146,7 @@ class yt {
1160
1146
  */
1161
1147
  parseVariableDefinition() {
1162
1148
  return this.node(this._lexer.token, {
1163
- kind: u.VARIABLE_DEFINITION,
1149
+ kind: c.VARIABLE_DEFINITION,
1164
1150
  description: this.parseDescription(),
1165
1151
  variable: this.parseVariable(),
1166
1152
  type: (this.expectToken(a.COLON), this.parseTypeReference()),
@@ -1172,9 +1158,9 @@ class yt {
1172
1158
  * Variable : $ Name
1173
1159
  */
1174
1160
  parseVariable() {
1175
- const t = this._lexer.token;
1176
- return this.expectToken(a.DOLLAR), this.node(t, {
1177
- kind: u.VARIABLE,
1161
+ const e = this._lexer.token;
1162
+ return this.expectToken(a.DOLLAR), this.node(e, {
1163
+ kind: c.VARIABLE,
1178
1164
  name: this.parseName()
1179
1165
  });
1180
1166
  }
@@ -1185,7 +1171,7 @@ class yt {
1185
1171
  */
1186
1172
  parseSelectionSet() {
1187
1173
  return this.node(this._lexer.token, {
1188
- kind: u.SELECTION_SET,
1174
+ kind: c.SELECTION_SET,
1189
1175
  selections: this.many(
1190
1176
  a.BRACE_L,
1191
1177
  this.parseSelection,
@@ -1208,10 +1194,10 @@ class yt {
1208
1194
  * Alias : Name :
1209
1195
  */
1210
1196
  parseField() {
1211
- const t = this._lexer.token, n = this.parseName();
1197
+ const e = this._lexer.token, t = this.parseName();
1212
1198
  let i, r;
1213
- return this.expectOptionalToken(a.COLON) ? (i = n, r = this.parseName()) : r = n, this.node(t, {
1214
- kind: u.FIELD,
1199
+ return this.expectOptionalToken(a.COLON) ? (i = t, r = this.parseName()) : r = t, this.node(e, {
1200
+ kind: c.FIELD,
1215
1201
  alias: i,
1216
1202
  name: r,
1217
1203
  arguments: this.parseArguments(!1),
@@ -1222,19 +1208,19 @@ class yt {
1222
1208
  /**
1223
1209
  * Arguments[Const] : ( Argument[?Const]+ )
1224
1210
  */
1225
- parseArguments(t) {
1226
- const n = t ? this.parseConstArgument : this.parseArgument;
1227
- return this.optionalMany(a.PAREN_L, n, a.PAREN_R);
1211
+ parseArguments(e) {
1212
+ const t = e ? this.parseConstArgument : this.parseArgument;
1213
+ return this.optionalMany(a.PAREN_L, t, a.PAREN_R);
1228
1214
  }
1229
1215
  /**
1230
1216
  * Argument[Const] : Name : Value[?Const]
1231
1217
  */
1232
- parseArgument(t = !1) {
1233
- const n = this._lexer.token, i = this.parseName();
1234
- return this.expectToken(a.COLON), this.node(n, {
1235
- kind: u.ARGUMENT,
1218
+ parseArgument(e = !1) {
1219
+ const t = this._lexer.token, i = this.parseName();
1220
+ return this.expectToken(a.COLON), this.node(t, {
1221
+ kind: c.ARGUMENT,
1236
1222
  name: i,
1237
- value: this.parseValueLiteral(t)
1223
+ value: this.parseValueLiteral(e)
1238
1224
  });
1239
1225
  }
1240
1226
  parseConstArgument() {
@@ -1249,16 +1235,16 @@ class yt {
1249
1235
  * InlineFragment : ... TypeCondition? Directives? SelectionSet
1250
1236
  */
1251
1237
  parseFragment() {
1252
- const t = this._lexer.token;
1238
+ const e = this._lexer.token;
1253
1239
  this.expectToken(a.SPREAD);
1254
- const n = this.expectOptionalKeyword("on");
1255
- return !n && this.peek(a.NAME) ? this.node(t, {
1256
- kind: u.FRAGMENT_SPREAD,
1240
+ const t = this.expectOptionalKeyword("on");
1241
+ return !t && this.peek(a.NAME) ? this.node(e, {
1242
+ kind: c.FRAGMENT_SPREAD,
1257
1243
  name: this.parseFragmentName(),
1258
1244
  directives: this.parseDirectives(!1)
1259
- }) : this.node(t, {
1260
- kind: u.INLINE_FRAGMENT,
1261
- typeCondition: n ? this.parseNamedType() : void 0,
1245
+ }) : this.node(e, {
1246
+ kind: c.INLINE_FRAGMENT,
1247
+ typeCondition: t ? this.parseNamedType() : void 0,
1262
1248
  directives: this.parseDirectives(!1),
1263
1249
  selectionSet: this.parseSelectionSet()
1264
1250
  });
@@ -1270,18 +1256,18 @@ class yt {
1270
1256
  * TypeCondition : NamedType
1271
1257
  */
1272
1258
  parseFragmentDefinition() {
1273
- const t = this._lexer.token, n = this.parseDescription();
1274
- return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(t, {
1275
- kind: u.FRAGMENT_DEFINITION,
1276
- description: n,
1259
+ const e = this._lexer.token, t = this.parseDescription();
1260
+ return this.expectKeyword("fragment"), this._options.allowLegacyFragmentVariables === !0 ? this.node(e, {
1261
+ kind: c.FRAGMENT_DEFINITION,
1262
+ description: t,
1277
1263
  name: this.parseFragmentName(),
1278
1264
  variableDefinitions: this.parseVariableDefinitions(),
1279
1265
  typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
1280
1266
  directives: this.parseDirectives(!1),
1281
1267
  selectionSet: this.parseSelectionSet()
1282
- }) : this.node(t, {
1283
- kind: u.FRAGMENT_DEFINITION,
1284
- description: n,
1268
+ }) : this.node(e, {
1269
+ kind: c.FRAGMENT_DEFINITION,
1270
+ description: t,
1285
1271
  name: this.parseFragmentName(),
1286
1272
  typeCondition: (this.expectKeyword("on"), this.parseNamedType()),
1287
1273
  directives: this.parseDirectives(!1),
@@ -1315,59 +1301,59 @@ class yt {
1315
1301
  *
1316
1302
  * EnumValue : Name but not `true`, `false` or `null`
1317
1303
  */
1318
- parseValueLiteral(t) {
1319
- const n = this._lexer.token;
1320
- switch (n.kind) {
1304
+ parseValueLiteral(e) {
1305
+ const t = this._lexer.token;
1306
+ switch (t.kind) {
1321
1307
  case a.BRACKET_L:
1322
- return this.parseList(t);
1308
+ return this.parseList(e);
1323
1309
  case a.BRACE_L:
1324
- return this.parseObject(t);
1310
+ return this.parseObject(e);
1325
1311
  case a.INT:
1326
- return this.advanceLexer(), this.node(n, {
1327
- kind: u.INT,
1328
- value: n.value
1312
+ return this.advanceLexer(), this.node(t, {
1313
+ kind: c.INT,
1314
+ value: t.value
1329
1315
  });
1330
1316
  case a.FLOAT:
1331
- return this.advanceLexer(), this.node(n, {
1332
- kind: u.FLOAT,
1333
- value: n.value
1317
+ return this.advanceLexer(), this.node(t, {
1318
+ kind: c.FLOAT,
1319
+ value: t.value
1334
1320
  });
1335
1321
  case a.STRING:
1336
1322
  case a.BLOCK_STRING:
1337
1323
  return this.parseStringLiteral();
1338
1324
  case a.NAME:
1339
- switch (this.advanceLexer(), n.value) {
1325
+ switch (this.advanceLexer(), t.value) {
1340
1326
  case "true":
1341
- return this.node(n, {
1342
- kind: u.BOOLEAN,
1327
+ return this.node(t, {
1328
+ kind: c.BOOLEAN,
1343
1329
  value: !0
1344
1330
  });
1345
1331
  case "false":
1346
- return this.node(n, {
1347
- kind: u.BOOLEAN,
1332
+ return this.node(t, {
1333
+ kind: c.BOOLEAN,
1348
1334
  value: !1
1349
1335
  });
1350
1336
  case "null":
1351
- return this.node(n, {
1352
- kind: u.NULL
1337
+ return this.node(t, {
1338
+ kind: c.NULL
1353
1339
  });
1354
1340
  default:
1355
- return this.node(n, {
1356
- kind: u.ENUM,
1357
- value: n.value
1341
+ return this.node(t, {
1342
+ kind: c.ENUM,
1343
+ value: t.value
1358
1344
  });
1359
1345
  }
1360
1346
  case a.DOLLAR:
1361
- if (t)
1347
+ if (e)
1362
1348
  if (this.expectToken(a.DOLLAR), this._lexer.token.kind === a.NAME) {
1363
1349
  const i = this._lexer.token.value;
1364
- throw v(
1350
+ throw I(
1365
1351
  this._lexer.source,
1366
- n.start,
1352
+ t.start,
1367
1353
  `Unexpected variable "$${i}" in constant value.`
1368
1354
  );
1369
1355
  } else
1370
- throw this.unexpected(n);
1356
+ throw this.unexpected(t);
1371
1357
  return this.parseVariable();
1372
1358
  default:
1373
1359
  throw this.unexpected();
@@ -1377,11 +1363,11 @@ class yt {
1377
1363
  return this.parseValueLiteral(!0);
1378
1364
  }
1379
1365
  parseStringLiteral() {
1380
- const t = this._lexer.token;
1381
- return this.advanceLexer(), this.node(t, {
1382
- kind: u.STRING,
1383
- value: t.value,
1384
- block: t.kind === a.BLOCK_STRING
1366
+ const e = this._lexer.token;
1367
+ return this.advanceLexer(), this.node(e, {
1368
+ kind: c.STRING,
1369
+ value: e.value,
1370
+ block: e.kind === a.BLOCK_STRING
1385
1371
  });
1386
1372
  }
1387
1373
  /**
@@ -1389,11 +1375,11 @@ class yt {
1389
1375
  * - [ ]
1390
1376
  * - [ Value[?Const]+ ]
1391
1377
  */
1392
- parseList(t) {
1393
- const n = () => this.parseValueLiteral(t);
1378
+ parseList(e) {
1379
+ const t = () => this.parseValueLiteral(e);
1394
1380
  return this.node(this._lexer.token, {
1395
- kind: u.LIST,
1396
- values: this.any(a.BRACKET_L, n, a.BRACKET_R)
1381
+ kind: c.LIST,
1382
+ values: this.any(a.BRACKET_L, t, a.BRACKET_R)
1397
1383
  });
1398
1384
  }
1399
1385
  /**
@@ -1403,33 +1389,33 @@ class yt {
1403
1389
  * - { ObjectField[?Const]+ }
1404
1390
  * ```
1405
1391
  */
1406
- parseObject(t) {
1407
- const n = () => this.parseObjectField(t);
1392
+ parseObject(e) {
1393
+ const t = () => this.parseObjectField(e);
1408
1394
  return this.node(this._lexer.token, {
1409
- kind: u.OBJECT,
1410
- fields: this.any(a.BRACE_L, n, a.BRACE_R)
1395
+ kind: c.OBJECT,
1396
+ fields: this.any(a.BRACE_L, t, a.BRACE_R)
1411
1397
  });
1412
1398
  }
1413
1399
  /**
1414
1400
  * ObjectField[Const] : Name : Value[?Const]
1415
1401
  */
1416
- parseObjectField(t) {
1417
- const n = this._lexer.token, i = this.parseName();
1418
- return this.expectToken(a.COLON), this.node(n, {
1419
- kind: u.OBJECT_FIELD,
1402
+ parseObjectField(e) {
1403
+ const t = this._lexer.token, i = this.parseName();
1404
+ return this.expectToken(a.COLON), this.node(t, {
1405
+ kind: c.OBJECT_FIELD,
1420
1406
  name: i,
1421
- value: this.parseValueLiteral(t)
1407
+ value: this.parseValueLiteral(e)
1422
1408
  });
1423
1409
  }
1424
1410
  // Implements the parsing rules in the Directives section.
1425
1411
  /**
1426
1412
  * Directives[Const] : Directive[?Const]+
1427
1413
  */
1428
- parseDirectives(t) {
1429
- const n = [];
1414
+ parseDirectives(e) {
1415
+ const t = [];
1430
1416
  for (; this.peek(a.AT); )
1431
- n.push(this.parseDirective(t));
1432
- return n;
1417
+ t.push(this.parseDirective(e));
1418
+ return t;
1433
1419
  }
1434
1420
  parseConstDirectives() {
1435
1421
  return this.parseDirectives(!0);
@@ -1439,12 +1425,12 @@ class yt {
1439
1425
  * Directive[Const] : @ Name Arguments[?Const]?
1440
1426
  * ```
1441
1427
  */
1442
- parseDirective(t) {
1443
- const n = this._lexer.token;
1444
- return this.expectToken(a.AT), this.node(n, {
1445
- kind: u.DIRECTIVE,
1428
+ parseDirective(e) {
1429
+ const t = this._lexer.token;
1430
+ return this.expectToken(a.AT), this.node(t, {
1431
+ kind: c.DIRECTIVE,
1446
1432
  name: this.parseName(),
1447
- arguments: this.parseArguments(t)
1433
+ arguments: this.parseArguments(e)
1448
1434
  });
1449
1435
  }
1450
1436
  // Implements the parsing rules in the Types section.
@@ -1455,27 +1441,27 @@ class yt {
1455
1441
  * - NonNullType
1456
1442
  */
1457
1443
  parseTypeReference() {
1458
- const t = this._lexer.token;
1459
- let n;
1444
+ const e = this._lexer.token;
1445
+ let t;
1460
1446
  if (this.expectOptionalToken(a.BRACKET_L)) {
1461
1447
  const i = this.parseTypeReference();
1462
- this.expectToken(a.BRACKET_R), n = this.node(t, {
1463
- kind: u.LIST_TYPE,
1448
+ this.expectToken(a.BRACKET_R), t = this.node(e, {
1449
+ kind: c.LIST_TYPE,
1464
1450
  type: i
1465
1451
  });
1466
1452
  } else
1467
- n = this.parseNamedType();
1468
- return this.expectOptionalToken(a.BANG) ? this.node(t, {
1469
- kind: u.NON_NULL_TYPE,
1470
- type: n
1471
- }) : n;
1453
+ t = this.parseNamedType();
1454
+ return this.expectOptionalToken(a.BANG) ? this.node(e, {
1455
+ kind: c.NON_NULL_TYPE,
1456
+ type: t
1457
+ }) : t;
1472
1458
  }
1473
1459
  /**
1474
1460
  * NamedType : Name
1475
1461
  */
1476
1462
  parseNamedType() {
1477
1463
  return this.node(this._lexer.token, {
1478
- kind: u.NAMED_TYPE,
1464
+ kind: c.NAMED_TYPE,
1479
1465
  name: this.parseName()
1480
1466
  });
1481
1467
  }
@@ -1496,16 +1482,16 @@ class yt {
1496
1482
  * ```
1497
1483
  */
1498
1484
  parseSchemaDefinition() {
1499
- const t = this._lexer.token, n = this.parseDescription();
1485
+ const e = this._lexer.token, t = this.parseDescription();
1500
1486
  this.expectKeyword("schema");
1501
1487
  const i = this.parseConstDirectives(), r = this.many(
1502
1488
  a.BRACE_L,
1503
1489
  this.parseOperationTypeDefinition,
1504
1490
  a.BRACE_R
1505
1491
  );
1506
- return this.node(t, {
1507
- kind: u.SCHEMA_DEFINITION,
1508
- description: n,
1492
+ return this.node(e, {
1493
+ kind: c.SCHEMA_DEFINITION,
1494
+ description: t,
1509
1495
  directives: i,
1510
1496
  operationTypes: r
1511
1497
  });
@@ -1514,12 +1500,12 @@ class yt {
1514
1500
  * OperationTypeDefinition : OperationType : NamedType
1515
1501
  */
1516
1502
  parseOperationTypeDefinition() {
1517
- const t = this._lexer.token, n = this.parseOperationType();
1503
+ const e = this._lexer.token, t = this.parseOperationType();
1518
1504
  this.expectToken(a.COLON);
1519
1505
  const i = this.parseNamedType();
1520
- return this.node(t, {
1521
- kind: u.OPERATION_TYPE_DEFINITION,
1522
- operation: n,
1506
+ return this.node(e, {
1507
+ kind: c.OPERATION_TYPE_DEFINITION,
1508
+ operation: t,
1523
1509
  type: i
1524
1510
  });
1525
1511
  }
@@ -1527,12 +1513,12 @@ class yt {
1527
1513
  * ScalarTypeDefinition : Description? scalar Name Directives[Const]?
1528
1514
  */
1529
1515
  parseScalarTypeDefinition() {
1530
- const t = this._lexer.token, n = this.parseDescription();
1516
+ const e = this._lexer.token, t = this.parseDescription();
1531
1517
  this.expectKeyword("scalar");
1532
1518
  const i = this.parseName(), r = this.parseConstDirectives();
1533
- return this.node(t, {
1534
- kind: u.SCALAR_TYPE_DEFINITION,
1535
- description: n,
1519
+ return this.node(e, {
1520
+ kind: c.SCALAR_TYPE_DEFINITION,
1521
+ description: t,
1536
1522
  name: i,
1537
1523
  directives: r
1538
1524
  });
@@ -1543,12 +1529,12 @@ class yt {
1543
1529
  * type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?
1544
1530
  */
1545
1531
  parseObjectTypeDefinition() {
1546
- const t = this._lexer.token, n = this.parseDescription();
1532
+ const e = this._lexer.token, t = this.parseDescription();
1547
1533
  this.expectKeyword("type");
1548
1534
  const i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
1549
- return this.node(t, {
1550
- kind: u.OBJECT_TYPE_DEFINITION,
1551
- description: n,
1535
+ return this.node(e, {
1536
+ kind: c.OBJECT_TYPE_DEFINITION,
1537
+ description: t,
1552
1538
  name: i,
1553
1539
  interfaces: r,
1554
1540
  directives: s,
@@ -1580,12 +1566,12 @@ class yt {
1580
1566
  * - Description? Name ArgumentsDefinition? : Type Directives[Const]?
1581
1567
  */
1582
1568
  parseFieldDefinition() {
1583
- const t = this._lexer.token, n = this.parseDescription(), i = this.parseName(), r = this.parseArgumentDefs();
1569
+ const e = this._lexer.token, t = this.parseDescription(), i = this.parseName(), r = this.parseArgumentDefs();
1584
1570
  this.expectToken(a.COLON);
1585
1571
  const s = this.parseTypeReference(), o = this.parseConstDirectives();
1586
- return this.node(t, {
1587
- kind: u.FIELD_DEFINITION,
1588
- description: n,
1572
+ return this.node(e, {
1573
+ kind: c.FIELD_DEFINITION,
1574
+ description: t,
1589
1575
  name: i,
1590
1576
  arguments: r,
1591
1577
  type: s,
@@ -1607,15 +1593,15 @@ class yt {
1607
1593
  * - Description? Name : Type DefaultValue? Directives[Const]?
1608
1594
  */
1609
1595
  parseInputValueDef() {
1610
- const t = this._lexer.token, n = this.parseDescription(), i = this.parseName();
1596
+ const e = this._lexer.token, t = this.parseDescription(), i = this.parseName();
1611
1597
  this.expectToken(a.COLON);
1612
1598
  const r = this.parseTypeReference();
1613
1599
  let s;
1614
1600
  this.expectOptionalToken(a.EQUALS) && (s = this.parseConstValueLiteral());
1615
1601
  const o = this.parseConstDirectives();
1616
- return this.node(t, {
1617
- kind: u.INPUT_VALUE_DEFINITION,
1618
- description: n,
1602
+ return this.node(e, {
1603
+ kind: c.INPUT_VALUE_DEFINITION,
1604
+ description: t,
1619
1605
  name: i,
1620
1606
  type: r,
1621
1607
  defaultValue: s,
@@ -1627,12 +1613,12 @@ class yt {
1627
1613
  * - Description? interface Name Directives[Const]? FieldsDefinition?
1628
1614
  */
1629
1615
  parseInterfaceTypeDefinition() {
1630
- const t = this._lexer.token, n = this.parseDescription();
1616
+ const e = this._lexer.token, t = this.parseDescription();
1631
1617
  this.expectKeyword("interface");
1632
1618
  const i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
1633
- return this.node(t, {
1634
- kind: u.INTERFACE_TYPE_DEFINITION,
1635
- description: n,
1619
+ return this.node(e, {
1620
+ kind: c.INTERFACE_TYPE_DEFINITION,
1621
+ description: t,
1636
1622
  name: i,
1637
1623
  interfaces: r,
1638
1624
  directives: s,
@@ -1644,12 +1630,12 @@ class yt {
1644
1630
  * - Description? union Name Directives[Const]? UnionMemberTypes?
1645
1631
  */
1646
1632
  parseUnionTypeDefinition() {
1647
- const t = this._lexer.token, n = this.parseDescription();
1633
+ const e = this._lexer.token, t = this.parseDescription();
1648
1634
  this.expectKeyword("union");
1649
1635
  const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
1650
- return this.node(t, {
1651
- kind: u.UNION_TYPE_DEFINITION,
1652
- description: n,
1636
+ return this.node(e, {
1637
+ kind: c.UNION_TYPE_DEFINITION,
1638
+ description: t,
1653
1639
  name: i,
1654
1640
  directives: r,
1655
1641
  types: s
@@ -1668,12 +1654,12 @@ class yt {
1668
1654
  * - Description? enum Name Directives[Const]? EnumValuesDefinition?
1669
1655
  */
1670
1656
  parseEnumTypeDefinition() {
1671
- const t = this._lexer.token, n = this.parseDescription();
1657
+ const e = this._lexer.token, t = this.parseDescription();
1672
1658
  this.expectKeyword("enum");
1673
1659
  const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
1674
- return this.node(t, {
1675
- kind: u.ENUM_TYPE_DEFINITION,
1676
- description: n,
1660
+ return this.node(e, {
1661
+ kind: c.ENUM_TYPE_DEFINITION,
1662
+ description: t,
1677
1663
  name: i,
1678
1664
  directives: r,
1679
1665
  values: s
@@ -1695,10 +1681,10 @@ class yt {
1695
1681
  * EnumValueDefinition : Description? EnumValue Directives[Const]?
1696
1682
  */
1697
1683
  parseEnumValueDefinition() {
1698
- const t = this._lexer.token, n = this.parseDescription(), i = this.parseEnumValueName(), r = this.parseConstDirectives();
1699
- return this.node(t, {
1700
- kind: u.ENUM_VALUE_DEFINITION,
1701
- description: n,
1684
+ const e = this._lexer.token, t = this.parseDescription(), i = this.parseEnumValueName(), r = this.parseConstDirectives();
1685
+ return this.node(e, {
1686
+ kind: c.ENUM_VALUE_DEFINITION,
1687
+ description: t,
1702
1688
  name: i,
1703
1689
  directives: r
1704
1690
  });
@@ -1708,10 +1694,10 @@ class yt {
1708
1694
  */
1709
1695
  parseEnumValueName() {
1710
1696
  if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null")
1711
- throw v(
1697
+ throw I(
1712
1698
  this._lexer.source,
1713
1699
  this._lexer.token.start,
1714
- `${q(
1700
+ `${_(
1715
1701
  this._lexer.token
1716
1702
  )} is reserved and cannot be used for an enum value.`
1717
1703
  );
@@ -1722,12 +1708,12 @@ class yt {
1722
1708
  * - Description? input Name Directives[Const]? InputFieldsDefinition?
1723
1709
  */
1724
1710
  parseInputObjectTypeDefinition() {
1725
- const t = this._lexer.token, n = this.parseDescription();
1711
+ const e = this._lexer.token, t = this.parseDescription();
1726
1712
  this.expectKeyword("input");
1727
1713
  const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
1728
- return this.node(t, {
1729
- kind: u.INPUT_OBJECT_TYPE_DEFINITION,
1730
- description: n,
1714
+ return this.node(e, {
1715
+ kind: c.INPUT_OBJECT_TYPE_DEFINITION,
1716
+ description: t,
1731
1717
  name: i,
1732
1718
  directives: r,
1733
1719
  fields: s
@@ -1759,9 +1745,9 @@ class yt {
1759
1745
  * - InputObjectTypeDefinition
1760
1746
  */
1761
1747
  parseTypeSystemExtension() {
1762
- const t = this._lexer.lookahead();
1763
- if (t.kind === a.NAME)
1764
- switch (t.value) {
1748
+ const e = this._lexer.lookahead();
1749
+ if (e.kind === a.NAME)
1750
+ switch (e.value) {
1765
1751
  case "schema":
1766
1752
  return this.parseSchemaExtension();
1767
1753
  case "scalar":
@@ -1777,7 +1763,7 @@ class yt {
1777
1763
  case "input":
1778
1764
  return this.parseInputObjectTypeExtension();
1779
1765
  }
1780
- throw this.unexpected(t);
1766
+ throw this.unexpected(e);
1781
1767
  }
1782
1768
  /**
1783
1769
  * ```
@@ -1787,18 +1773,18 @@ class yt {
1787
1773
  * ```
1788
1774
  */
1789
1775
  parseSchemaExtension() {
1790
- const t = this._lexer.token;
1776
+ const e = this._lexer.token;
1791
1777
  this.expectKeyword("extend"), this.expectKeyword("schema");
1792
- const n = this.parseConstDirectives(), i = this.optionalMany(
1778
+ const t = this.parseConstDirectives(), i = this.optionalMany(
1793
1779
  a.BRACE_L,
1794
1780
  this.parseOperationTypeDefinition,
1795
1781
  a.BRACE_R
1796
1782
  );
1797
- if (n.length === 0 && i.length === 0)
1783
+ if (t.length === 0 && i.length === 0)
1798
1784
  throw this.unexpected();
1799
- return this.node(t, {
1800
- kind: u.SCHEMA_EXTENSION,
1801
- directives: n,
1785
+ return this.node(e, {
1786
+ kind: c.SCHEMA_EXTENSION,
1787
+ directives: t,
1802
1788
  operationTypes: i
1803
1789
  });
1804
1790
  }
@@ -1807,14 +1793,14 @@ class yt {
1807
1793
  * - extend scalar Name Directives[Const]
1808
1794
  */
1809
1795
  parseScalarTypeExtension() {
1810
- const t = this._lexer.token;
1796
+ const e = this._lexer.token;
1811
1797
  this.expectKeyword("extend"), this.expectKeyword("scalar");
1812
- const n = this.parseName(), i = this.parseConstDirectives();
1798
+ const t = this.parseName(), i = this.parseConstDirectives();
1813
1799
  if (i.length === 0)
1814
1800
  throw this.unexpected();
1815
- return this.node(t, {
1816
- kind: u.SCALAR_TYPE_EXTENSION,
1817
- name: n,
1801
+ return this.node(e, {
1802
+ kind: c.SCALAR_TYPE_EXTENSION,
1803
+ name: t,
1818
1804
  directives: i
1819
1805
  });
1820
1806
  }
@@ -1825,14 +1811,14 @@ class yt {
1825
1811
  * - extend type Name ImplementsInterfaces
1826
1812
  */
1827
1813
  parseObjectTypeExtension() {
1828
- const t = this._lexer.token;
1814
+ const e = this._lexer.token;
1829
1815
  this.expectKeyword("extend"), this.expectKeyword("type");
1830
- const n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1816
+ const t = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1831
1817
  if (i.length === 0 && r.length === 0 && s.length === 0)
1832
1818
  throw this.unexpected();
1833
- return this.node(t, {
1834
- kind: u.OBJECT_TYPE_EXTENSION,
1835
- name: n,
1819
+ return this.node(e, {
1820
+ kind: c.OBJECT_TYPE_EXTENSION,
1821
+ name: t,
1836
1822
  interfaces: i,
1837
1823
  directives: r,
1838
1824
  fields: s
@@ -1845,14 +1831,14 @@ class yt {
1845
1831
  * - extend interface Name ImplementsInterfaces
1846
1832
  */
1847
1833
  parseInterfaceTypeExtension() {
1848
- const t = this._lexer.token;
1834
+ const e = this._lexer.token;
1849
1835
  this.expectKeyword("extend"), this.expectKeyword("interface");
1850
- const n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1836
+ const t = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
1851
1837
  if (i.length === 0 && r.length === 0 && s.length === 0)
1852
1838
  throw this.unexpected();
1853
- return this.node(t, {
1854
- kind: u.INTERFACE_TYPE_EXTENSION,
1855
- name: n,
1839
+ return this.node(e, {
1840
+ kind: c.INTERFACE_TYPE_EXTENSION,
1841
+ name: t,
1856
1842
  interfaces: i,
1857
1843
  directives: r,
1858
1844
  fields: s
@@ -1864,14 +1850,14 @@ class yt {
1864
1850
  * - extend union Name Directives[Const]
1865
1851
  */
1866
1852
  parseUnionTypeExtension() {
1867
- const t = this._lexer.token;
1853
+ const e = this._lexer.token;
1868
1854
  this.expectKeyword("extend"), this.expectKeyword("union");
1869
- const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseUnionMemberTypes();
1855
+ const t = this.parseName(), i = this.parseConstDirectives(), r = this.parseUnionMemberTypes();
1870
1856
  if (i.length === 0 && r.length === 0)
1871
1857
  throw this.unexpected();
1872
- return this.node(t, {
1873
- kind: u.UNION_TYPE_EXTENSION,
1874
- name: n,
1858
+ return this.node(e, {
1859
+ kind: c.UNION_TYPE_EXTENSION,
1860
+ name: t,
1875
1861
  directives: i,
1876
1862
  types: r
1877
1863
  });
@@ -1882,14 +1868,14 @@ class yt {
1882
1868
  * - extend enum Name Directives[Const]
1883
1869
  */
1884
1870
  parseEnumTypeExtension() {
1885
- const t = this._lexer.token;
1871
+ const e = this._lexer.token;
1886
1872
  this.expectKeyword("extend"), this.expectKeyword("enum");
1887
- const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseEnumValuesDefinition();
1873
+ const t = this.parseName(), i = this.parseConstDirectives(), r = this.parseEnumValuesDefinition();
1888
1874
  if (i.length === 0 && r.length === 0)
1889
1875
  throw this.unexpected();
1890
- return this.node(t, {
1891
- kind: u.ENUM_TYPE_EXTENSION,
1892
- name: n,
1876
+ return this.node(e, {
1877
+ kind: c.ENUM_TYPE_EXTENSION,
1878
+ name: t,
1893
1879
  directives: i,
1894
1880
  values: r
1895
1881
  });
@@ -1900,14 +1886,14 @@ class yt {
1900
1886
  * - extend input Name Directives[Const]
1901
1887
  */
1902
1888
  parseInputObjectTypeExtension() {
1903
- const t = this._lexer.token;
1889
+ const e = this._lexer.token;
1904
1890
  this.expectKeyword("extend"), this.expectKeyword("input");
1905
- const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseInputFieldsDefinition();
1891
+ const t = this.parseName(), i = this.parseConstDirectives(), r = this.parseInputFieldsDefinition();
1906
1892
  if (i.length === 0 && r.length === 0)
1907
1893
  throw this.unexpected();
1908
- return this.node(t, {
1909
- kind: u.INPUT_OBJECT_TYPE_EXTENSION,
1910
- name: n,
1894
+ return this.node(e, {
1895
+ kind: c.INPUT_OBJECT_TYPE_EXTENSION,
1896
+ name: t,
1911
1897
  directives: i,
1912
1898
  fields: r
1913
1899
  });
@@ -1919,14 +1905,14 @@ class yt {
1919
1905
  * ```
1920
1906
  */
1921
1907
  parseDirectiveDefinition() {
1922
- const t = this._lexer.token, n = this.parseDescription();
1908
+ const e = this._lexer.token, t = this.parseDescription();
1923
1909
  this.expectKeyword("directive"), this.expectToken(a.AT);
1924
1910
  const i = this.parseName(), r = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
1925
1911
  this.expectKeyword("on");
1926
1912
  const o = this.parseDirectiveLocations();
1927
- return this.node(t, {
1928
- kind: u.DIRECTIVE_DEFINITION,
1929
- description: n,
1913
+ return this.node(e, {
1914
+ kind: c.DIRECTIVE_DEFINITION,
1915
+ description: t,
1930
1916
  name: i,
1931
1917
  arguments: r,
1932
1918
  repeatable: s,
@@ -1969,10 +1955,10 @@ class yt {
1969
1955
  * `INPUT_FIELD_DEFINITION`
1970
1956
  */
1971
1957
  parseDirectiveLocation() {
1972
- const t = this._lexer.token, n = this.parseName();
1973
- if (Object.prototype.hasOwnProperty.call(re, n.value))
1974
- return n;
1975
- throw this.unexpected(t);
1958
+ const e = this._lexer.token, t = this.parseName();
1959
+ if (Object.prototype.hasOwnProperty.call(q, t.value))
1960
+ return t;
1961
+ throw this.unexpected(e);
1976
1962
  }
1977
1963
  // Schema Coordinates
1978
1964
  /**
@@ -1984,28 +1970,28 @@ class yt {
1984
1970
  * - \@ Name ( Name : )
1985
1971
  */
1986
1972
  parseSchemaCoordinate() {
1987
- const t = this._lexer.token, n = this.expectOptionalToken(a.AT), i = this.parseName();
1973
+ const e = this._lexer.token, t = this.expectOptionalToken(a.AT), i = this.parseName();
1988
1974
  let r;
1989
- !n && this.expectOptionalToken(a.DOT) && (r = this.parseName());
1975
+ !t && this.expectOptionalToken(a.DOT) && (r = this.parseName());
1990
1976
  let s;
1991
- return (n || r) && this.expectOptionalToken(a.PAREN_L) && (s = this.parseName(), this.expectToken(a.COLON), this.expectToken(a.PAREN_R)), n ? s ? this.node(t, {
1992
- kind: u.DIRECTIVE_ARGUMENT_COORDINATE,
1977
+ return (t || r) && this.expectOptionalToken(a.PAREN_L) && (s = this.parseName(), this.expectToken(a.COLON), this.expectToken(a.PAREN_R)), t ? s ? this.node(e, {
1978
+ kind: c.DIRECTIVE_ARGUMENT_COORDINATE,
1993
1979
  name: i,
1994
1980
  argumentName: s
1995
- }) : this.node(t, {
1996
- kind: u.DIRECTIVE_COORDINATE,
1981
+ }) : this.node(e, {
1982
+ kind: c.DIRECTIVE_COORDINATE,
1997
1983
  name: i
1998
- }) : r ? s ? this.node(t, {
1999
- kind: u.ARGUMENT_COORDINATE,
1984
+ }) : r ? s ? this.node(e, {
1985
+ kind: c.ARGUMENT_COORDINATE,
2000
1986
  name: i,
2001
1987
  fieldName: r,
2002
1988
  argumentName: s
2003
- }) : this.node(t, {
2004
- kind: u.MEMBER_COORDINATE,
1989
+ }) : this.node(e, {
1990
+ kind: c.MEMBER_COORDINATE,
2005
1991
  name: i,
2006
1992
  memberName: r
2007
- }) : this.node(t, {
2008
- kind: u.TYPE_COORDINATE,
1993
+ }) : this.node(e, {
1994
+ kind: c.TYPE_COORDINATE,
2009
1995
  name: i
2010
1996
  });
2011
1997
  }
@@ -2015,72 +2001,72 @@ class yt {
2015
2001
  * location object, used to identify the place in the source that created a
2016
2002
  * given parsed object.
2017
2003
  */
2018
- node(t, n) {
2019
- return this._options.noLocation !== !0 && (n.loc = new Ye(
2020
- t,
2004
+ node(e, t) {
2005
+ return this._options.noLocation !== !0 && (t.loc = new Pe(
2006
+ e,
2021
2007
  this._lexer.lastToken,
2022
2008
  this._lexer.source
2023
- )), n;
2009
+ )), t;
2024
2010
  }
2025
2011
  /**
2026
2012
  * Determines if the next token is of a given kind
2027
2013
  */
2028
- peek(t) {
2029
- return this._lexer.token.kind === t;
2014
+ peek(e) {
2015
+ return this._lexer.token.kind === e;
2030
2016
  }
2031
2017
  /**
2032
2018
  * If the next token is of the given kind, return that token after advancing the lexer.
2033
2019
  * Otherwise, do not change the parser state and throw an error.
2034
2020
  */
2035
- expectToken(t) {
2036
- const n = this._lexer.token;
2037
- if (n.kind === t)
2038
- return this.advanceLexer(), n;
2039
- throw v(
2021
+ expectToken(e) {
2022
+ const t = this._lexer.token;
2023
+ if (t.kind === e)
2024
+ return this.advanceLexer(), t;
2025
+ throw I(
2040
2026
  this._lexer.source,
2041
- n.start,
2042
- `Expected ${Fe(t)}, found ${q(n)}.`
2027
+ t.start,
2028
+ `Expected ${Ie(e)}, found ${_(t)}.`
2043
2029
  );
2044
2030
  }
2045
2031
  /**
2046
2032
  * If the next token is of the given kind, return "true" after advancing the lexer.
2047
2033
  * Otherwise, do not change the parser state and return "false".
2048
2034
  */
2049
- expectOptionalToken(t) {
2050
- return this._lexer.token.kind === t ? (this.advanceLexer(), !0) : !1;
2035
+ expectOptionalToken(e) {
2036
+ return this._lexer.token.kind === e ? (this.advanceLexer(), !0) : !1;
2051
2037
  }
2052
2038
  /**
2053
2039
  * If the next token is a given keyword, advance the lexer.
2054
2040
  * Otherwise, do not change the parser state and throw an error.
2055
2041
  */
2056
- expectKeyword(t) {
2057
- const n = this._lexer.token;
2058
- if (n.kind === a.NAME && n.value === t)
2042
+ expectKeyword(e) {
2043
+ const t = this._lexer.token;
2044
+ if (t.kind === a.NAME && t.value === e)
2059
2045
  this.advanceLexer();
2060
2046
  else
2061
- throw v(
2047
+ throw I(
2062
2048
  this._lexer.source,
2063
- n.start,
2064
- `Expected "${t}", found ${q(n)}.`
2049
+ t.start,
2050
+ `Expected "${e}", found ${_(t)}.`
2065
2051
  );
2066
2052
  }
2067
2053
  /**
2068
2054
  * If the next token is a given keyword, return "true" after advancing the lexer.
2069
2055
  * Otherwise, do not change the parser state and return "false".
2070
2056
  */
2071
- expectOptionalKeyword(t) {
2072
- const n = this._lexer.token;
2073
- return n.kind === a.NAME && n.value === t ? (this.advanceLexer(), !0) : !1;
2057
+ expectOptionalKeyword(e) {
2058
+ const t = this._lexer.token;
2059
+ return t.kind === a.NAME && t.value === e ? (this.advanceLexer(), !0) : !1;
2074
2060
  }
2075
2061
  /**
2076
2062
  * Helper function for creating an error when an unexpected lexed token is encountered.
2077
2063
  */
2078
- unexpected(t) {
2079
- const n = t ?? this._lexer.token;
2080
- return v(
2064
+ unexpected(e) {
2065
+ const t = e ?? this._lexer.token;
2066
+ return I(
2081
2067
  this._lexer.source,
2082
- n.start,
2083
- `Unexpected ${q(n)}.`
2068
+ t.start,
2069
+ `Unexpected ${_(t)}.`
2084
2070
  );
2085
2071
  }
2086
2072
  /**
@@ -2088,11 +2074,11 @@ class yt {
2088
2074
  * This list begins with a lex token of openKind and ends with a lex token of closeKind.
2089
2075
  * Advances the parser to the next lex token after the closing token.
2090
2076
  */
2091
- any(t, n, i) {
2092
- this.expectToken(t);
2077
+ any(e, t, i) {
2078
+ this.expectToken(e);
2093
2079
  const r = [];
2094
2080
  for (; !this.expectOptionalToken(i); )
2095
- r.push(n.call(this));
2081
+ r.push(t.call(this));
2096
2082
  return r;
2097
2083
  }
2098
2084
  /**
@@ -2101,11 +2087,11 @@ class yt {
2101
2087
  * that begins with a lex token of openKind and ends with a lex token of closeKind.
2102
2088
  * Advances the parser to the next lex token after the closing token.
2103
2089
  */
2104
- optionalMany(t, n, i) {
2105
- if (this.expectOptionalToken(t)) {
2090
+ optionalMany(e, t, i) {
2091
+ if (this.expectOptionalToken(e)) {
2106
2092
  const r = [];
2107
2093
  do
2108
- r.push(n.call(this));
2094
+ r.push(t.call(this));
2109
2095
  while (!this.expectOptionalToken(i));
2110
2096
  return r;
2111
2097
  }
@@ -2116,11 +2102,11 @@ class yt {
2116
2102
  * This list begins with a lex token of openKind and ends with a lex token of closeKind.
2117
2103
  * Advances the parser to the next lex token after the closing token.
2118
2104
  */
2119
- many(t, n, i) {
2120
- this.expectToken(t);
2105
+ many(e, t, i) {
2106
+ this.expectToken(e);
2121
2107
  const r = [];
2122
2108
  do
2123
- r.push(n.call(this));
2109
+ r.push(t.call(this));
2124
2110
  while (!this.expectOptionalToken(i));
2125
2111
  return r;
2126
2112
  }
@@ -2129,645 +2115,107 @@ class yt {
2129
2115
  * This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.
2130
2116
  * Advances the parser to the next lex token after last item in the list.
2131
2117
  */
2132
- delimitedMany(t, n) {
2133
- this.expectOptionalToken(t);
2118
+ delimitedMany(e, t) {
2119
+ this.expectOptionalToken(e);
2134
2120
  const i = [];
2135
2121
  do
2136
- i.push(n.call(this));
2137
- while (this.expectOptionalToken(t));
2122
+ i.push(t.call(this));
2123
+ while (this.expectOptionalToken(e));
2138
2124
  return i;
2139
2125
  }
2140
2126
  advanceLexer() {
2141
- const { maxTokens: t } = this._options, n = this._lexer.advance();
2142
- if (n.kind !== a.EOF && (++this._tokenCounter, t !== void 0 && this._tokenCounter > t))
2143
- throw v(
2127
+ const { maxTokens: e } = this._options, t = this._lexer.advance();
2128
+ if (t.kind !== a.EOF && (++this._tokenCounter, e !== void 0 && this._tokenCounter > e))
2129
+ throw I(
2144
2130
  this._lexer.source,
2145
- n.start,
2146
- `Document contains more that ${t} tokens. Parsing aborted.`
2131
+ t.start,
2132
+ `Document contains more that ${e} tokens. Parsing aborted.`
2147
2133
  );
2148
2134
  }
2149
2135
  }
2150
- function q(e) {
2151
- const t = e.value;
2152
- return Fe(e.kind) + (t != null ? ` "${t}"` : "");
2153
- }
2154
- function Fe(e) {
2155
- return Ke(e) ? `"${e}"` : e;
2156
- }
2157
- function Tt(e) {
2158
- return `"${e.replace(vt, kt)}"`;
2159
- }
2160
- const vt = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
2161
- function kt(e) {
2162
- return Ot[e.charCodeAt(0)];
2163
- }
2164
- const Ot = [
2165
- "\\u0000",
2166
- "\\u0001",
2167
- "\\u0002",
2168
- "\\u0003",
2169
- "\\u0004",
2170
- "\\u0005",
2171
- "\\u0006",
2172
- "\\u0007",
2173
- "\\b",
2174
- "\\t",
2175
- "\\n",
2176
- "\\u000B",
2177
- "\\f",
2178
- "\\r",
2179
- "\\u000E",
2180
- "\\u000F",
2181
- "\\u0010",
2182
- "\\u0011",
2183
- "\\u0012",
2184
- "\\u0013",
2185
- "\\u0014",
2186
- "\\u0015",
2187
- "\\u0016",
2188
- "\\u0017",
2189
- "\\u0018",
2190
- "\\u0019",
2191
- "\\u001A",
2192
- "\\u001B",
2193
- "\\u001C",
2194
- "\\u001D",
2195
- "\\u001E",
2196
- "\\u001F",
2197
- "",
2198
- "",
2199
- '\\"',
2200
- "",
2201
- "",
2202
- "",
2203
- "",
2204
- "",
2205
- "",
2206
- "",
2207
- "",
2208
- "",
2209
- "",
2210
- "",
2211
- "",
2212
- "",
2213
- // 2F
2214
- "",
2215
- "",
2216
- "",
2217
- "",
2218
- "",
2219
- "",
2220
- "",
2221
- "",
2222
- "",
2223
- "",
2224
- "",
2225
- "",
2226
- "",
2227
- "",
2228
- "",
2229
- "",
2230
- // 3F
2231
- "",
2232
- "",
2233
- "",
2234
- "",
2235
- "",
2236
- "",
2237
- "",
2238
- "",
2239
- "",
2240
- "",
2241
- "",
2242
- "",
2243
- "",
2244
- "",
2245
- "",
2246
- "",
2247
- // 4F
2248
- "",
2249
- "",
2250
- "",
2251
- "",
2252
- "",
2253
- "",
2254
- "",
2255
- "",
2256
- "",
2257
- "",
2258
- "",
2259
- "",
2260
- "\\\\",
2261
- "",
2262
- "",
2263
- "",
2264
- // 5F
2265
- "",
2266
- "",
2267
- "",
2268
- "",
2269
- "",
2270
- "",
2271
- "",
2272
- "",
2273
- "",
2274
- "",
2275
- "",
2276
- "",
2277
- "",
2278
- "",
2279
- "",
2280
- "",
2281
- // 6F
2282
- "",
2283
- "",
2284
- "",
2285
- "",
2286
- "",
2287
- "",
2288
- "",
2289
- "",
2290
- "",
2291
- "",
2292
- "",
2293
- "",
2294
- "",
2295
- "",
2296
- "",
2297
- "\\u007F",
2298
- "\\u0080",
2299
- "\\u0081",
2300
- "\\u0082",
2301
- "\\u0083",
2302
- "\\u0084",
2303
- "\\u0085",
2304
- "\\u0086",
2305
- "\\u0087",
2306
- "\\u0088",
2307
- "\\u0089",
2308
- "\\u008A",
2309
- "\\u008B",
2310
- "\\u008C",
2311
- "\\u008D",
2312
- "\\u008E",
2313
- "\\u008F",
2314
- "\\u0090",
2315
- "\\u0091",
2316
- "\\u0092",
2317
- "\\u0093",
2318
- "\\u0094",
2319
- "\\u0095",
2320
- "\\u0096",
2321
- "\\u0097",
2322
- "\\u0098",
2323
- "\\u0099",
2324
- "\\u009A",
2325
- "\\u009B",
2326
- "\\u009C",
2327
- "\\u009D",
2328
- "\\u009E",
2329
- "\\u009F"
2330
- ], At = Object.freeze({});
2331
- function Dt(e, t, n = Pe) {
2332
- const i = /* @__PURE__ */ new Map();
2333
- for (const O of Object.values(u))
2334
- i.set(O, Nt(t, O));
2335
- let r, s = Array.isArray(e), o = [e], p = -1, f = [], l = e, g, d;
2336
- const m = [], y = [];
2337
- do {
2338
- p++;
2339
- const O = p === o.length, C = O && f.length !== 0;
2340
- if (O) {
2341
- if (g = y.length === 0 ? void 0 : m[m.length - 1], l = d, d = y.pop(), C)
2342
- if (s) {
2343
- l = l.slice();
2344
- let k = 0;
2345
- for (const [A, x] of f) {
2346
- const P = A - k;
2347
- x === null ? (l.splice(P, 1), k++) : l[P] = x;
2348
- }
2349
- } else {
2350
- l = { ...l };
2351
- for (const [k, A] of f)
2352
- l[k] = A;
2353
- }
2354
- p = r.index, o = r.keys, f = r.edits, s = r.inArray, r = r.prev;
2355
- } else if (d) {
2356
- if (g = s ? p : o[p], l = d[g], l == null)
2357
- continue;
2358
- m.push(g);
2359
- }
2360
- let b;
2361
- if (!Array.isArray(l)) {
2362
- var I, D;
2363
- he(l) || z(!1, `Invalid AST Node: ${de(l)}.`);
2364
- const k = O ? (I = i.get(l.kind)) === null || I === void 0 ? void 0 : I.leave : (D = i.get(l.kind)) === null || D === void 0 ? void 0 : D.enter;
2365
- if (b = k?.call(t, l, g, d, m, y), b === At)
2366
- break;
2367
- if (b === !1) {
2368
- if (!O) {
2369
- m.pop();
2370
- continue;
2371
- }
2372
- } else if (b !== void 0 && (f.push([g, b]), !O))
2373
- if (he(b))
2374
- l = b;
2375
- else {
2376
- m.pop();
2377
- continue;
2378
- }
2379
- }
2380
- if (b === void 0 && C && f.push([g, l]), O)
2381
- m.pop();
2382
- else {
2383
- var N;
2384
- r = {
2385
- inArray: s,
2386
- index: p,
2387
- keys: o,
2388
- edits: f,
2389
- prev: r
2390
- }, s = Array.isArray(l), o = s ? l : (N = n[l.kind]) !== null && N !== void 0 ? N : [], p = -1, f = [], d && y.push(d), d = l;
2391
- }
2392
- } while (r !== void 0);
2393
- return f.length !== 0 ? f[f.length - 1][1] : e;
2394
- }
2395
- function Nt(e, t) {
2396
- const n = e[t];
2397
- return typeof n == "object" ? n : typeof n == "function" ? {
2398
- enter: n,
2399
- leave: void 0
2400
- } : {
2401
- enter: e.enter,
2402
- leave: e.leave
2403
- };
2136
+ function _(n) {
2137
+ const e = n.value;
2138
+ return Ie(n.kind) + (e != null ? ` "${e}"` : "");
2404
2139
  }
2405
- function xt(e) {
2406
- return Dt(e, Pt);
2407
- }
2408
- const bt = 80, Pt = {
2409
- Name: {
2410
- leave: (e) => e.value
2411
- },
2412
- Variable: {
2413
- leave: (e) => "$" + e.name
2414
- },
2415
- // Document
2416
- Document: {
2417
- leave: (e) => c(e.definitions, `
2418
-
2419
- `)
2420
- },
2421
- OperationDefinition: {
2422
- leave(e) {
2423
- const t = te(e.variableDefinitions) ? h(`(
2424
- `, c(e.variableDefinitions, `
2425
- `), `
2426
- )`) : h("(", c(e.variableDefinitions, ", "), ")"), n = h("", e.description, `
2427
- `) + c(
2428
- [
2429
- e.operation,
2430
- c([e.name, t]),
2431
- c(e.directives, " ")
2432
- ],
2433
- " "
2434
- );
2435
- return (n === "query" ? "" : n + " ") + e.selectionSet;
2436
- }
2437
- },
2438
- VariableDefinition: {
2439
- leave: ({ variable: e, type: t, defaultValue: n, directives: i, description: r }) => h("", r, `
2440
- `) + e + ": " + t + h(" = ", n) + h(" ", c(i, " "))
2441
- },
2442
- SelectionSet: {
2443
- leave: ({ selections: e }) => S(e)
2444
- },
2445
- Field: {
2446
- leave({ alias: e, name: t, arguments: n, directives: i, selectionSet: r }) {
2447
- const s = h("", e, ": ") + t;
2448
- let o = s + h("(", c(n, ", "), ")");
2449
- return o.length > bt && (o = s + h(`(
2450
- `, j(c(n, `
2451
- `)), `
2452
- )`)), c([o, c(i, " "), r], " ");
2453
- }
2454
- },
2455
- Argument: {
2456
- leave: ({ name: e, value: t }) => e + ": " + t
2457
- },
2458
- // Fragments
2459
- FragmentSpread: {
2460
- leave: ({ name: e, directives: t }) => "..." + e + h(" ", c(t, " "))
2461
- },
2462
- InlineFragment: {
2463
- leave: ({ typeCondition: e, directives: t, selectionSet: n }) => c(
2464
- [
2465
- "...",
2466
- h("on ", e),
2467
- c(t, " "),
2468
- n
2469
- ],
2470
- " "
2471
- )
2472
- },
2473
- FragmentDefinition: {
2474
- leave: ({
2475
- name: e,
2476
- typeCondition: t,
2477
- variableDefinitions: n,
2478
- directives: i,
2479
- selectionSet: r,
2480
- description: s
2481
- }) => h("", s, `
2482
- `) + // Note: fragment variable definitions are experimental and may be changed
2483
- // or removed in the future.
2484
- `fragment ${e}${h("(", c(n, ", "), ")")} on ${t} ${h("", c(i, " "), " ")}` + r
2485
- },
2486
- // Value
2487
- IntValue: {
2488
- leave: ({ value: e }) => e
2489
- },
2490
- FloatValue: {
2491
- leave: ({ value: e }) => e
2492
- },
2493
- StringValue: {
2494
- leave: ({ value: e, block: t }) => t ? We(e) : Tt(e)
2495
- },
2496
- BooleanValue: {
2497
- leave: ({ value: e }) => e ? "true" : "false"
2498
- },
2499
- NullValue: {
2500
- leave: () => "null"
2501
- },
2502
- EnumValue: {
2503
- leave: ({ value: e }) => e
2504
- },
2505
- ListValue: {
2506
- leave: ({ values: e }) => "[" + c(e, ", ") + "]"
2507
- },
2508
- ObjectValue: {
2509
- leave: ({ fields: e }) => "{" + c(e, ", ") + "}"
2510
- },
2511
- ObjectField: {
2512
- leave: ({ name: e, value: t }) => e + ": " + t
2513
- },
2514
- // Directive
2515
- Directive: {
2516
- leave: ({ name: e, arguments: t }) => "@" + e + h("(", c(t, ", "), ")")
2517
- },
2518
- // Type
2519
- NamedType: {
2520
- leave: ({ name: e }) => e
2521
- },
2522
- ListType: {
2523
- leave: ({ type: e }) => "[" + e + "]"
2524
- },
2525
- NonNullType: {
2526
- leave: ({ type: e }) => e + "!"
2527
- },
2528
- // Type System Definitions
2529
- SchemaDefinition: {
2530
- leave: ({ description: e, directives: t, operationTypes: n }) => h("", e, `
2531
- `) + c(["schema", c(t, " "), S(n)], " ")
2532
- },
2533
- OperationTypeDefinition: {
2534
- leave: ({ operation: e, type: t }) => e + ": " + t
2535
- },
2536
- ScalarTypeDefinition: {
2537
- leave: ({ description: e, name: t, directives: n }) => h("", e, `
2538
- `) + c(["scalar", t, c(n, " ")], " ")
2539
- },
2540
- ObjectTypeDefinition: {
2541
- leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => h("", e, `
2542
- `) + c(
2543
- [
2544
- "type",
2545
- t,
2546
- h("implements ", c(n, " & ")),
2547
- c(i, " "),
2548
- S(r)
2549
- ],
2550
- " "
2551
- )
2552
- },
2553
- FieldDefinition: {
2554
- leave: ({ description: e, name: t, arguments: n, type: i, directives: r }) => h("", e, `
2555
- `) + t + (te(n) ? h(`(
2556
- `, j(c(n, `
2557
- `)), `
2558
- )`) : h("(", c(n, ", "), ")")) + ": " + i + h(" ", c(r, " "))
2559
- },
2560
- InputValueDefinition: {
2561
- leave: ({ description: e, name: t, type: n, defaultValue: i, directives: r }) => h("", e, `
2562
- `) + c(
2563
- [t + ": " + n, h("= ", i), c(r, " ")],
2564
- " "
2565
- )
2566
- },
2567
- InterfaceTypeDefinition: {
2568
- leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => h("", e, `
2569
- `) + c(
2570
- [
2571
- "interface",
2572
- t,
2573
- h("implements ", c(n, " & ")),
2574
- c(i, " "),
2575
- S(r)
2576
- ],
2577
- " "
2578
- )
2579
- },
2580
- UnionTypeDefinition: {
2581
- leave: ({ description: e, name: t, directives: n, types: i }) => h("", e, `
2582
- `) + c(
2583
- ["union", t, c(n, " "), h("= ", c(i, " | "))],
2584
- " "
2585
- )
2586
- },
2587
- EnumTypeDefinition: {
2588
- leave: ({ description: e, name: t, directives: n, values: i }) => h("", e, `
2589
- `) + c(["enum", t, c(n, " "), S(i)], " ")
2590
- },
2591
- EnumValueDefinition: {
2592
- leave: ({ description: e, name: t, directives: n }) => h("", e, `
2593
- `) + c([t, c(n, " ")], " ")
2594
- },
2595
- InputObjectTypeDefinition: {
2596
- leave: ({ description: e, name: t, directives: n, fields: i }) => h("", e, `
2597
- `) + c(["input", t, c(n, " "), S(i)], " ")
2598
- },
2599
- DirectiveDefinition: {
2600
- leave: ({ description: e, name: t, arguments: n, repeatable: i, locations: r }) => h("", e, `
2601
- `) + "directive @" + t + (te(n) ? h(`(
2602
- `, j(c(n, `
2603
- `)), `
2604
- )`) : h("(", c(n, ", "), ")")) + (i ? " repeatable" : "") + " on " + c(r, " | ")
2605
- },
2606
- SchemaExtension: {
2607
- leave: ({ directives: e, operationTypes: t }) => c(
2608
- ["extend schema", c(e, " "), S(t)],
2609
- " "
2610
- )
2611
- },
2612
- ScalarTypeExtension: {
2613
- leave: ({ name: e, directives: t }) => c(["extend scalar", e, c(t, " ")], " ")
2614
- },
2615
- ObjectTypeExtension: {
2616
- leave: ({ name: e, interfaces: t, directives: n, fields: i }) => c(
2617
- [
2618
- "extend type",
2619
- e,
2620
- h("implements ", c(t, " & ")),
2621
- c(n, " "),
2622
- S(i)
2623
- ],
2624
- " "
2625
- )
2626
- },
2627
- InterfaceTypeExtension: {
2628
- leave: ({ name: e, interfaces: t, directives: n, fields: i }) => c(
2629
- [
2630
- "extend interface",
2631
- e,
2632
- h("implements ", c(t, " & ")),
2633
- c(n, " "),
2634
- S(i)
2635
- ],
2636
- " "
2637
- )
2638
- },
2639
- UnionTypeExtension: {
2640
- leave: ({ name: e, directives: t, types: n }) => c(
2641
- [
2642
- "extend union",
2643
- e,
2644
- c(t, " "),
2645
- h("= ", c(n, " | "))
2646
- ],
2647
- " "
2648
- )
2649
- },
2650
- EnumTypeExtension: {
2651
- leave: ({ name: e, directives: t, values: n }) => c(["extend enum", e, c(t, " "), S(n)], " ")
2652
- },
2653
- InputObjectTypeExtension: {
2654
- leave: ({ name: e, directives: t, fields: n }) => c(["extend input", e, c(t, " "), S(n)], " ")
2655
- },
2656
- // Schema Coordinates
2657
- TypeCoordinate: {
2658
- leave: ({ name: e }) => e
2659
- },
2660
- MemberCoordinate: {
2661
- leave: ({ name: e, memberName: t }) => c([e, h(".", t)])
2662
- },
2663
- ArgumentCoordinate: {
2664
- leave: ({ name: e, fieldName: t, argumentName: n }) => c([e, h(".", t), h("(", n, ":)")])
2665
- },
2666
- DirectiveCoordinate: {
2667
- leave: ({ name: e }) => c(["@", e])
2668
- },
2669
- DirectiveArgumentCoordinate: {
2670
- leave: ({ name: e, argumentName: t }) => c(["@", e, h("(", t, ":)")])
2671
- }
2672
- };
2673
- function c(e, t = "") {
2674
- var n;
2675
- return (n = e?.filter((i) => i).join(t)) !== null && n !== void 0 ? n : "";
2676
- }
2677
- function S(e) {
2678
- return h(`{
2679
- `, j(c(e, `
2680
- `)), `
2681
- }`);
2682
- }
2683
- function h(e, t, n = "") {
2684
- return t != null && t !== "" ? e + t + n : "";
2685
- }
2686
- function j(e) {
2687
- return h(" ", e.replace(/\n/g, `
2688
- `));
2689
- }
2690
- function te(e) {
2691
- var t;
2692
- return (t = e?.some((n) => n.includes(`
2693
- `))) !== null && t !== void 0 ? t : !1;
2694
- }
2695
- var G = /* @__PURE__ */ new Map(), ae = /* @__PURE__ */ new Map(), $e = !0, J = !1;
2696
- function Be(e) {
2697
- return e.replace(/[\s,]+/g, " ").trim();
2698
- }
2699
- function St(e) {
2700
- return Be(e.source.body.substring(e.start, e.end));
2701
- }
2702
- function Ct(e) {
2703
- var t = /* @__PURE__ */ new Set(), n = [];
2704
- return e.definitions.forEach(function(i) {
2140
+ function Ie(n) {
2141
+ return we(n) ? `"${n}"` : n;
2142
+ }
2143
+ var L = /* @__PURE__ */ new Map(), G = /* @__PURE__ */ new Map(), Ee = !0, $ = !1;
2144
+ function ye(n) {
2145
+ return n.replace(/[\s,]+/g, " ").trim();
2146
+ }
2147
+ function nt(n) {
2148
+ return ye(n.source.body.substring(n.start, n.end));
2149
+ }
2150
+ function it(n) {
2151
+ var e = /* @__PURE__ */ new Set(), t = [];
2152
+ return n.definitions.forEach(function(i) {
2705
2153
  if (i.kind === "FragmentDefinition") {
2706
- var r = i.name.value, s = St(i.loc), o = ae.get(r);
2707
- o && !o.has(s) ? $e && console.warn("Warning: fragment with name " + r + ` already exists.
2154
+ var r = i.name.value, s = nt(i.loc), o = G.get(r);
2155
+ o && !o.has(s) ? Ee && console.warn("Warning: fragment with name " + r + ` already exists.
2708
2156
  graphql-tag enforces all fragment names across your application to be unique; read more about
2709
- this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : o || ae.set(r, o = /* @__PURE__ */ new Set()), o.add(s), t.has(s) || (t.add(s), n.push(i));
2157
+ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : o || G.set(r, o = /* @__PURE__ */ new Set()), o.add(s), e.has(s) || (e.add(s), t.push(i));
2710
2158
  } else
2711
- n.push(i);
2712
- }), Q(Q({}, e), { definitions: n });
2159
+ t.push(i);
2160
+ }), F(F({}, n), { definitions: t });
2713
2161
  }
2714
- function _t(e) {
2715
- var t = new Set(e.definitions);
2716
- t.forEach(function(i) {
2162
+ function rt(n) {
2163
+ var e = new Set(n.definitions);
2164
+ e.forEach(function(i) {
2717
2165
  i.loc && delete i.loc, Object.keys(i).forEach(function(r) {
2718
2166
  var s = i[r];
2719
- s && typeof s == "object" && t.add(s);
2167
+ s && typeof s == "object" && e.add(s);
2720
2168
  });
2721
2169
  });
2722
- var n = e.loc;
2723
- return n && (delete n.startToken, delete n.endToken), e;
2724
- }
2725
- function Lt(e) {
2726
- var t = Be(e);
2727
- if (!G.has(t)) {
2728
- var n = Et(e, {
2729
- experimentalFragmentVariables: J,
2730
- allowLegacyFragmentVariables: J
2170
+ var t = n.loc;
2171
+ return t && (delete t.startToken, delete t.endToken), n;
2172
+ }
2173
+ function st(n) {
2174
+ var e = ye(n);
2175
+ if (!L.has(e)) {
2176
+ var t = et(n, {
2177
+ experimentalFragmentVariables: $,
2178
+ allowLegacyFragmentVariables: $
2731
2179
  });
2732
- if (!n || n.kind !== "Document")
2180
+ if (!t || t.kind !== "Document")
2733
2181
  throw new Error("Not a valid GraphQL document.");
2734
- G.set(t, _t(Ct(n)));
2182
+ L.set(e, rt(it(t)));
2735
2183
  }
2736
- return G.get(t);
2184
+ return L.get(e);
2737
2185
  }
2738
- function E(e) {
2739
- for (var t = [], n = 1; n < arguments.length; n++)
2740
- t[n - 1] = arguments[n];
2741
- typeof e == "string" && (e = [e]);
2742
- var i = e[0];
2743
- return t.forEach(function(r, s) {
2744
- r && r.kind === "Document" ? i += r.loc.source.body : i += r, i += e[s + 1];
2745
- }), Lt(i);
2186
+ function l(n) {
2187
+ for (var e = [], t = 1; t < arguments.length; t++)
2188
+ e[t - 1] = arguments[t];
2189
+ typeof n == "string" && (n = [n]);
2190
+ var i = n[0];
2191
+ return e.forEach(function(r, s) {
2192
+ r && r.kind === "Document" ? i += r.loc.source.body : i += r, i += n[s + 1];
2193
+ }), st(i);
2746
2194
  }
2747
- function Rt() {
2748
- G.clear(), ae.clear();
2195
+ function at() {
2196
+ L.clear(), G.clear();
2749
2197
  }
2750
- function wt() {
2751
- $e = !1;
2198
+ function ot() {
2199
+ Ee = !1;
2752
2200
  }
2753
- function Ft() {
2754
- J = !0;
2201
+ function ct() {
2202
+ $ = !0;
2755
2203
  }
2756
- function $t() {
2757
- J = !1;
2204
+ function dt() {
2205
+ $ = !1;
2758
2206
  }
2759
- var B = {
2760
- gql: E,
2761
- resetCaches: Rt,
2762
- disableFragmentWarnings: wt,
2763
- enableExperimentalFragmentVariables: Ft,
2764
- disableExperimentalFragmentVariables: $t
2207
+ var P = {
2208
+ gql: l,
2209
+ resetCaches: at,
2210
+ disableFragmentWarnings: ot,
2211
+ enableExperimentalFragmentVariables: ct,
2212
+ disableExperimentalFragmentVariables: dt
2765
2213
  };
2766
- (function(e) {
2767
- e.gql = B.gql, e.resetCaches = B.resetCaches, e.disableFragmentWarnings = B.disableFragmentWarnings, e.enableExperimentalFragmentVariables = B.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = B.disableExperimentalFragmentVariables;
2768
- })(E || (E = {}));
2769
- E.default = E;
2770
- const Bt = E`
2214
+ (function(n) {
2215
+ n.gql = P.gql, n.resetCaches = P.resetCaches, n.disableFragmentWarnings = P.disableFragmentWarnings, n.enableExperimentalFragmentVariables = P.enableExperimentalFragmentVariables, n.disableExperimentalFragmentVariables = P.disableExperimentalFragmentVariables;
2216
+ })(l || (l = {}));
2217
+ l.default = l;
2218
+ const ut = l`
2771
2219
  query findActiveOrderById($id: String) {
2772
2220
  findOrder(id: $id) {
2773
2221
  id
@@ -2854,7 +2302,7 @@ const Bt = E`
2854
2302
  }
2855
2303
  }
2856
2304
  }
2857
- `, Vt = E`
2305
+ `, lt = l`
2858
2306
  query findOrderById($id: String, $reference: String) {
2859
2307
  findOrder(id: $id, reference: $reference) {
2860
2308
  id
@@ -2898,7 +2346,7 @@ const Bt = E`
2898
2346
  downloadCode
2899
2347
  }
2900
2348
  }
2901
- `, Ut = E`
2349
+ `, ht = l`
2902
2350
  mutation addToOrder($orderId: ID!, $productId: ID!, $shopId: ID, $additionalData: AdditionalDataInput, $trackerId: ID, $amount: Int) {
2903
2351
  reserveProduct(
2904
2352
  input: {orderId: $orderId, productId: $productId, additionalData: $additionalData, trackerId: $trackerId, shopId: $shopId, amountToIncrease: $amount}
@@ -2908,7 +2356,7 @@ const Bt = E`
2908
2356
  amountReserved
2909
2357
  }
2910
2358
  }
2911
- `, Mt = E`
2359
+ `, pt = l`
2912
2360
  mutation removeFromOrder($orderId: ID!, $productId: ID!, $additionalData: AdditionalDataInput, $amount: Int) {
2913
2361
  releaseProduct(
2914
2362
  input: {orderId: $orderId, productId: $productId, additionalData: $additionalData, amountToRelease: $amount}
@@ -2917,7 +2365,7 @@ const Bt = E`
2917
2365
  amountReleased
2918
2366
  }
2919
2367
  }
2920
- `, qt = E`
2368
+ `, mt = l`
2921
2369
  mutation configurePackage($orderId: ID!, $packageId: ID!, $amount: Int!, $items: [ReservedItem!]!, $shopId: ID, $trackerId: ID) {
2922
2370
  configurePackage(
2923
2371
  input: {orderId: $orderId, shopId: $shopId, trackerId: $trackerId, packageId: $packageId, amount: $amount, items: $items}
@@ -2927,7 +2375,7 @@ const Bt = E`
2927
2375
  amountReserved
2928
2376
  }
2929
2377
  }
2930
- `, zt = E`
2378
+ `, ft = l`
2931
2379
  mutation reserveAdditionalPackageItem($amount: Int!, $orderId: ID!, $packageId: ID!, $eventId: ID!, $packageItemId: ID!) {
2932
2380
  reserveAdditionalPackageItem(
2933
2381
  input: {amount: $amount, eventId: $eventId, orderId: $orderId, packageId: $packageId, packageItemId: $packageItemId}
@@ -2937,124 +2385,124 @@ const Bt = E`
2937
2385
  amountReserved
2938
2386
  }
2939
2387
  }
2940
- `, jt = E`
2388
+ `, gt = l`
2941
2389
  mutation configureOrderDeliveryOption($orderId: ID!, $productId: ID) {
2942
2390
  configureDeliveryOption(input: {orderId: $orderId, productId: $productId})
2943
2391
  }
2944
- `, Gt = E`
2392
+ `, It = l`
2945
2393
  mutation createOrderCustomer($orderId: ID!, $countryCode: String, $customer: CreateCustomerInput!) {
2946
2394
  createOrderCustomer(
2947
2395
  input: {id: $orderId, countryCode: $countryCode, customer: $customer}
2948
2396
  )
2949
2397
  }
2950
- `, Yt = E`
2398
+ `, Et = l`
2951
2399
  mutation deleteOrder($orderId: ID!) {
2952
2400
  cancelOrder(id: $orderId)
2953
2401
  }
2954
- `, Ht = (e, t, n, i) => e();
2955
- function Qt(e, t = Ht) {
2402
+ `, yt = (n, e, t, i) => n();
2403
+ function Ot(n, e = yt) {
2956
2404
  return {
2957
- findActiveOrderById(n, i, r) {
2958
- return t((s) => e.request({ document: Bt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findActiveOrderById", "query", n);
2405
+ findActiveOrderById(t, i, r) {
2406
+ return e((s) => n.request({ document: ut, variables: t, requestHeaders: { ...i, ...s }, signal: r }), "findActiveOrderById", "query", t);
2959
2407
  },
2960
- findOrderById(n, i, r) {
2961
- return t((s) => e.request({ document: Vt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findOrderById", "query", n);
2408
+ findOrderById(t, i, r) {
2409
+ return e((s) => n.request({ document: lt, variables: t, requestHeaders: { ...i, ...s }, signal: r }), "findOrderById", "query", t);
2962
2410
  },
2963
- addToOrder(n, i, r) {
2964
- return t((s) => e.request({ document: Ut, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "addToOrder", "mutation", n);
2411
+ addToOrder(t, i, r) {
2412
+ return e((s) => n.request({ document: ht, variables: t, requestHeaders: { ...i, ...s }, signal: r }), "addToOrder", "mutation", t);
2965
2413
  },
2966
- removeFromOrder(n, i, r) {
2967
- return t((s) => e.request({ document: Mt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "removeFromOrder", "mutation", n);
2414
+ removeFromOrder(t, i, r) {
2415
+ return e((s) => n.request({ document: pt, variables: t, requestHeaders: { ...i, ...s }, signal: r }), "removeFromOrder", "mutation", t);
2968
2416
  },
2969
- configurePackage(n, i, r) {
2970
- return t((s) => e.request({ document: qt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "configurePackage", "mutation", n);
2417
+ configurePackage(t, i, r) {
2418
+ return e((s) => n.request({ document: mt, variables: t, requestHeaders: { ...i, ...s }, signal: r }), "configurePackage", "mutation", t);
2971
2419
  },
2972
- reserveAdditionalPackageItem(n, i, r) {
2973
- return t((s) => e.request({ document: zt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "reserveAdditionalPackageItem", "mutation", n);
2420
+ reserveAdditionalPackageItem(t, i, r) {
2421
+ return e((s) => n.request({ document: ft, variables: t, requestHeaders: { ...i, ...s }, signal: r }), "reserveAdditionalPackageItem", "mutation", t);
2974
2422
  },
2975
- configureOrderDeliveryOption(n, i, r) {
2976
- return t((s) => e.request({ document: jt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "configureOrderDeliveryOption", "mutation", n);
2423
+ configureOrderDeliveryOption(t, i, r) {
2424
+ return e((s) => n.request({ document: gt, variables: t, requestHeaders: { ...i, ...s }, signal: r }), "configureOrderDeliveryOption", "mutation", t);
2977
2425
  },
2978
- createOrderCustomer(n, i, r) {
2979
- return t((s) => e.request({ document: Gt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "createOrderCustomer", "mutation", n);
2426
+ createOrderCustomer(t, i, r) {
2427
+ return e((s) => n.request({ document: It, variables: t, requestHeaders: { ...i, ...s }, signal: r }), "createOrderCustomer", "mutation", t);
2980
2428
  },
2981
- deleteOrder(n, i, r) {
2982
- return t((s) => e.request({ document: Yt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "deleteOrder", "mutation", n);
2429
+ deleteOrder(t, i, r) {
2430
+ return e((s) => n.request({ document: Et, variables: t, requestHeaders: { ...i, ...s }, signal: r }), "deleteOrder", "mutation", t);
2983
2431
  }
2984
2432
  };
2985
2433
  }
2986
- class Jt {
2434
+ class kt {
2987
2435
  config;
2988
2436
  sdk;
2989
- constructor(t) {
2990
- this.config = t, this.sdk = Qt(new oe(t.apiUrl));
2437
+ constructor(e) {
2438
+ this.config = e, this.sdk = Ot(new v(e.apiUrl));
2991
2439
  }
2992
2440
  // Basket update functions
2993
- async addProduct(t, n) {
2441
+ async addProduct(e, t) {
2994
2442
  try {
2995
2443
  return this.debugLog("Adding product", {
2996
- productId: n.id,
2997
- orderId: t,
2998
- amount: n.amount,
2999
- seat: n.seat
2444
+ productId: t.id,
2445
+ orderId: e,
2446
+ amount: t.amount,
2447
+ seat: t.seat
3000
2448
  }), (await this.sdk.addToOrder({
3001
- productId: n.id,
3002
- orderId: t,
3003
- additionalData: n.seat ? {
2449
+ productId: t.id,
2450
+ orderId: e,
2451
+ additionalData: t.seat ? {
3004
2452
  seat: {
3005
- seatId: n.seat.id,
3006
- seatLabel: n.seat.label,
3007
- holdToken: n.seat.holdToken
2453
+ seatId: t.seat.id,
2454
+ seatLabel: t.seat.label,
2455
+ holdToken: t.seat.holdToken
3008
2456
  }
3009
2457
  } : null,
3010
2458
  trackerId: this.config.trackerId,
3011
2459
  shopId: this.config.shopId,
3012
- amount: n.amount
2460
+ amount: t.amount
3013
2461
  })).reserveProduct;
3014
2462
  } catch (i) {
3015
2463
  throw this.debugLog("Error adding product", i), this.handleError(i), i;
3016
2464
  }
3017
2465
  }
3018
- async removeProduct(t, n) {
2466
+ async removeProduct(e, t) {
3019
2467
  try {
3020
2468
  return this.debugLog("Removing product", {
3021
- productId: n.id,
3022
- orderId: t,
3023
- amount: n.amount
2469
+ productId: t.id,
2470
+ orderId: e,
2471
+ amount: t.amount
3024
2472
  }), (await this.sdk.removeFromOrder({
3025
- productId: n.id,
3026
- orderId: t,
3027
- additionalData: n.seat ? {
2473
+ productId: t.id,
2474
+ orderId: e,
2475
+ additionalData: t.seat ? {
3028
2476
  seat: {
3029
- seatId: n.seat.id,
3030
- seatLabel: n.seat.label
2477
+ seatId: t.seat.id,
2478
+ seatLabel: t.seat.label
3031
2479
  }
3032
2480
  } : null,
3033
- amount: n.amount
2481
+ amount: t.amount
3034
2482
  })).releaseProduct ?? null;
3035
2483
  } catch (i) {
3036
2484
  throw this.debugLog("Error removing product", i), this.handleError(i), i;
3037
2485
  }
3038
2486
  }
3039
- async configurePackage(t, n) {
2487
+ async configurePackage(e, t) {
3040
2488
  try {
3041
- const i = n.items.map((s) => ({
2489
+ const i = t.items.map((s) => ({
3042
2490
  packageItemId: s.packageItemId,
3043
2491
  eventId: s.eventId
3044
2492
  }));
3045
2493
  this.debugLog("Configuring package", {
3046
- packageId: n.id,
3047
- orderId: t,
3048
- amount: n.amount,
2494
+ packageId: t.id,
2495
+ orderId: e,
2496
+ amount: t.amount,
3049
2497
  items: i,
3050
2498
  shopId: this.config.shopId
3051
2499
  });
3052
2500
  const r = await this.sdk.configurePackage({
3053
2501
  trackerId: this.config.trackerId,
3054
2502
  shopId: this.config.shopId,
3055
- packageId: n.id,
3056
- orderId: t,
3057
- amount: n.amount,
2503
+ packageId: t.id,
2504
+ orderId: e,
2505
+ amount: t.amount,
3058
2506
  items: i
3059
2507
  });
3060
2508
  return this.debugLog("Configure package response"), r.configurePackage ?? null;
@@ -3062,33 +2510,33 @@ class Jt {
3062
2510
  throw this.debugLog("Error configuring package", i), this.handleError(i), i;
3063
2511
  }
3064
2512
  }
3065
- async configureCustomer(t, n) {
3066
- this.debugLog("Creating/replacing customer", { orderId: t, email: n.email });
2513
+ async configureCustomer(e, t) {
2514
+ this.debugLog("Creating/replacing customer", { orderId: e, email: t.email });
3067
2515
  try {
3068
2516
  const i = await this.sdk.createOrderCustomer({
3069
- orderId: t,
3070
- customer: n
2517
+ orderId: e,
2518
+ customer: t
3071
2519
  });
3072
2520
  this.debugLog("Customer set successfully", i);
3073
2521
  } catch (i) {
3074
2522
  throw this.debugLog("Failed to set customer", i), new Error(`Failed to set customer: ${i.message}`);
3075
2523
  }
3076
2524
  }
3077
- async reserveAdditionalPackageItem(t, n) {
2525
+ async reserveAdditionalPackageItem(e, t) {
3078
2526
  try {
3079
2527
  this.debugLog("reserve additional packageItem", {
3080
- orderId: t,
3081
- eventId: n.eventId,
3082
- amount: n.amount,
3083
- packageId: n.packageId,
3084
- packageItemId: n.packageItemId
2528
+ orderId: e,
2529
+ eventId: t.eventId,
2530
+ amount: t.amount,
2531
+ packageId: t.packageId,
2532
+ packageItemId: t.packageItemId
3085
2533
  });
3086
2534
  const i = await this.sdk.reserveAdditionalPackageItem({
3087
- orderId: t,
3088
- eventId: n.eventId,
3089
- amount: n.amount,
3090
- packageId: n.packageId,
3091
- packageItemId: n.packageItemId
2535
+ orderId: e,
2536
+ eventId: t.eventId,
2537
+ amount: t.amount,
2538
+ packageId: t.packageId,
2539
+ packageItemId: t.packageItemId
3092
2540
  });
3093
2541
  return this.debugLog("reserve additional packageItem"), i.reserveAdditionalPackageItem ?? null;
3094
2542
  } catch (i) {
@@ -3096,12 +2544,12 @@ class Jt {
3096
2544
  }
3097
2545
  }
3098
2546
  // Cancel and clear order functions
3099
- async cancelOrder(t) {
3100
- t && (this.debugLog("Cancelling order", { orderId: t }), await this.sdk.deleteOrder({ orderId: t }), this.debugLog("Order cancelled successfully"));
2547
+ async cancelOrder(e) {
2548
+ e && (this.debugLog("Cancelling order", { orderId: e }), await this.sdk.deleteOrder({ orderId: e }), this.debugLog("Order cancelled successfully"));
3101
2549
  }
3102
- async findOrder(t, n) {
2550
+ async findOrder(e, t) {
3103
2551
  try {
3104
- const i = await this.sdk.findOrderById({ id: t, reference: n });
2552
+ const i = await this.sdk.findOrderById({ id: e, reference: t });
3105
2553
  return i.findOrder ? {
3106
2554
  id: i.findOrder.id,
3107
2555
  reference: i.findOrder.reference,
@@ -3126,19 +2574,19 @@ class Jt {
3126
2574
  return this.debugLog("Error finding order", i), this.handleError(i), null;
3127
2575
  }
3128
2576
  }
3129
- async findActiveOrder(t) {
3130
- this.debugLog("Fetching order from server", { orderId: t });
2577
+ async findActiveOrder(e) {
2578
+ this.debugLog("Fetching order from server", { orderId: e });
3131
2579
  try {
3132
- const n = await this.sdk.findActiveOrderById({ id: t });
3133
- if (!n?.findOrder)
2580
+ const t = await this.sdk.findActiveOrderById({ id: e });
2581
+ if (!t?.findOrder)
3134
2582
  return null;
3135
- const i = n.findOrder;
2583
+ const i = t.findOrder;
3136
2584
  this.debugLog("Order fetched successfully", i);
3137
2585
  const r = i.items, s = r.filter((d) => d.product != null && d.amount > 0).map((d) => {
3138
- let m = _.PRODUCT;
3139
- return d.product.type === "PROMOTER" ? m = _.ADD_ONS : d.product.type === "PICKUP" ? m = _.PICKUP : d.product.type === "DELIVERY" && (m = _.DELIVERY), {
2586
+ let f = T.PRODUCT;
2587
+ return d.product.type === "PROMOTER" ? f = T.ADD_ONS : d.product.type === "PICKUP" ? f = T.PICKUP : d.product.type === "DELIVERY" && (f = T.DELIVERY), {
3140
2588
  id: d.product.id,
3141
- type: m,
2589
+ type: f,
3142
2590
  name: d.product.name,
3143
2591
  icon: d.product.icon,
3144
2592
  description: d.product.description,
@@ -3152,51 +2600,51 @@ class Jt {
3152
2600
  label: y.label
3153
2601
  }))
3154
2602
  };
3155
- }), o = r.filter((d) => d.packageItem != null && d.amount > 0).reduce((d, m) => {
2603
+ }), o = r.filter((d) => d.packageItem != null && d.amount > 0).reduce((d, f) => {
3156
2604
  const {
3157
2605
  packageItem: y,
3158
- event: I,
3159
- amount: D,
3160
- price: N,
3161
- serviceFee: O,
3162
- depositPrice: C,
3163
- originalPrice: b
3164
- } = m, k = y.package.id;
3165
- d[k] ? (d[k].price += N ?? 0, d[k].serviceFee += O ?? 0, d[k].originalPrice += b ?? 0, d[k].depositPrice += C ?? N ?? 0) : d[k] = {
2606
+ event: p,
2607
+ amount: O,
2608
+ price: C,
2609
+ serviceFee: Y,
2610
+ depositPrice: H,
2611
+ originalPrice: J
2612
+ } = f, k = y.package.id;
2613
+ d[k] ? (d[k].price += C ?? 0, d[k].serviceFee += Y ?? 0, d[k].originalPrice += J ?? 0, d[k].depositPrice += H ?? C ?? 0) : d[k] = {
3166
2614
  id: k,
3167
- type: _.PACKAGE,
2615
+ type: T.PACKAGE,
3168
2616
  name: y.package.name,
3169
- amount: D,
3170
- price: N ?? 0,
3171
- serviceFee: O ?? 0,
3172
- depositPrice: C ?? N ?? 0,
3173
- originalPrice: b ?? 0,
2617
+ amount: O,
2618
+ price: C ?? 0,
2619
+ serviceFee: Y ?? 0,
2620
+ depositPrice: H ?? C ?? 0,
2621
+ originalPrice: J ?? 0,
3174
2622
  packageItems: []
3175
2623
  };
3176
- const A = L.fromISO(I.startAt, {
3177
- zone: I.timezone
3178
- }), x = L.fromISO(I.endAt, {
3179
- zone: I.timezone
2624
+ const Oe = A.fromISO(p.startAt, {
2625
+ zone: p.timezone
2626
+ }), ke = A.fromISO(p.endAt, {
2627
+ zone: p.timezone
3180
2628
  });
3181
2629
  return d[k].packageItems.push({
3182
2630
  packageItemId: y.id,
3183
- eventId: I.id,
3184
- name: I.name,
3185
- startAt: A.toJSDate().toISOString(),
3186
- endAt: x.toJSDate().toISOString()
2631
+ eventId: p.id,
2632
+ name: p.name,
2633
+ startAt: Oe.toJSDate().toISOString(),
2634
+ endAt: ke.toJSDate().toISOString()
3187
2635
  }), d;
3188
- }, {}), p = [
2636
+ }, {}), u = [
3189
2637
  ...s,
3190
2638
  ...Object.values(o)
3191
- ], f = p.reduce((d, m) => d + (m.amount || 0), 0);
3192
- if (f === 0)
2639
+ ], h = u.reduce((d, f) => d + (f.amount || 0), 0);
2640
+ if (h === 0)
3193
2641
  return null;
3194
- const l = r.filter((d) => d.amount > 0).map((d) => new Date(d.expiredAt).getTime()), g = L.fromMillis(Math.min(...l));
2642
+ const E = r.filter((d) => d.amount > 0).map((d) => new Date(d.expiredAt).getTime()), m = A.fromMillis(Math.min(...E));
3195
2643
  return {
3196
2644
  id: i.id,
3197
2645
  currency: i.currency,
3198
- expiredAt: g?.toJSDate().toISOString(),
3199
- items: p,
2646
+ expiredAt: m?.toJSDate().toISOString(),
2647
+ items: u,
3200
2648
  customer: i.mainBooker ? {
3201
2649
  firstName: i.mainBooker.firstName,
3202
2650
  lastName: i.mainBooker.lastName,
@@ -3206,29 +2654,29 @@ class Jt {
3206
2654
  residence: i.mainBooker.residence,
3207
2655
  extraInfo: i.mainBooker.extraInfo
3208
2656
  } : null,
3209
- count: f,
2657
+ count: h,
3210
2658
  orderProtection: !1
3211
2659
  };
3212
- } catch (n) {
3213
- throw this.debugLog("Error fetching order", n), n;
2660
+ } catch (t) {
2661
+ throw this.debugLog("Error fetching order", t), t;
3214
2662
  }
3215
2663
  }
3216
- debugLog(t, n) {
3217
- this.config.debug && console.log(`[BasketService] ${t}`, n || "");
2664
+ debugLog(e, t) {
2665
+ this.config.debug && console.log(`[BasketService] ${e}`, t || "");
3218
2666
  }
3219
- handleError(t) {
3220
- const n = t;
3221
- if (n.graphQLErrors && n.graphQLErrors.length > 0) {
3222
- const i = n.graphQLErrors[0];
2667
+ handleError(e) {
2668
+ const t = e;
2669
+ if (t.graphQLErrors && t.graphQLErrors.length > 0) {
2670
+ const i = t.graphQLErrors[0];
3223
2671
  i.extensions?.status === "RATE_LIMIT" && console.error("Rate Limit reached"), i.extensions?.status === "SOLD_OUT" && console.error("Product sold out");
3224
2672
  }
3225
- if (n.response?.errors && n.response.errors.length > 0) {
3226
- const i = n.response.errors[0];
2673
+ if (t.response?.errors && t.response.errors.length > 0) {
2674
+ const i = t.response.errors[0];
3227
2675
  console.error("GraphQL Error:", i.message), i.extensions?.code && console.error("Error Code:", i.extensions.code);
3228
2676
  }
3229
2677
  }
3230
2678
  }
3231
- const Xt = E`
2679
+ const Tt = l`
3232
2680
  query EventOverviewPage($organizationId: ID!, $hostingIds: [String!], $locationIds: [String!], $excludedEventIds: [String!], $trackerId: String, $filterEventStatuses: [EventStatus!], $dateRange: DateRangeInput, $page: PageInput, $sorts: [SortInput!], $searchTerm: String, $priceRange: PriceRangeInput) {
3233
2681
  findAllPublicEventByOrganizationId(
3234
2682
  id: $organizationId
@@ -3273,7 +2721,7 @@ const Xt = E`
3273
2721
  count
3274
2722
  }
3275
2723
  }
3276
- `, Wt = E`
2724
+ `, At = l`
3277
2725
  query EventDetailPage($eventId: ID!) {
3278
2726
  findPublicEventById(id: $eventId) {
3279
2727
  id
@@ -3305,7 +2753,7 @@ const Xt = E`
3305
2753
  totalViews
3306
2754
  }
3307
2755
  }
3308
- `, Zt = E`
2756
+ `, Nt = l`
3309
2757
  query findProductsByEventId($eventId: ID!, $promoCode: String, $trackerId: String, $productTypes: [ProductType!]) {
3310
2758
  findPublicProductsByEventId(
3311
2759
  eventId: $eventId
@@ -3339,153 +2787,81 @@ const Xt = E`
3339
2787
  showEndSalesAtTag
3340
2788
  }
3341
2789
  }
3342
- `, Kt = (e, t, n, i) => e();
3343
- function en(e, t = Kt) {
2790
+ `, Dt = (n, e, t, i) => n();
2791
+ function vt(n, e = Dt) {
3344
2792
  return {
3345
- EventOverviewPage(n, i, r) {
3346
- return t((s) => e.request({ document: Xt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "EventOverviewPage", "query", n);
2793
+ EventOverviewPage(t, i, r) {
2794
+ return e((s) => n.request({ document: Tt, variables: t, requestHeaders: { ...i, ...s }, signal: r }), "EventOverviewPage", "query", t);
3347
2795
  },
3348
- EventDetailPage(n, i, r) {
3349
- return t((s) => e.request({ document: Wt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "EventDetailPage", "query", n);
2796
+ EventDetailPage(t, i, r) {
2797
+ return e((s) => n.request({ document: At, variables: t, requestHeaders: { ...i, ...s }, signal: r }), "EventDetailPage", "query", t);
3350
2798
  },
3351
- findProductsByEventId(n, i, r) {
3352
- return t((s) => e.request({ document: Zt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findProductsByEventId", "query", n);
2799
+ findProductsByEventId(t, i, r) {
2800
+ return e((s) => n.request({ document: Nt, variables: t, requestHeaders: { ...i, ...s }, signal: r }), "findProductsByEventId", "query", t);
3353
2801
  }
3354
2802
  };
3355
2803
  }
3356
- function tn(e) {
3357
- const t = /(query|mutation|subscription)\s+(\w+)/.exec(e);
3358
- if (!t) return { type: "unknown" };
3359
- const n = t[1], i = t[2];
3360
- return { type: n, name: i };
3361
- }
3362
- async function nn(e) {
3363
- if (typeof globalThis < "u" && globalThis.crypto?.subtle) {
3364
- const n = new TextEncoder().encode(e), i = await globalThis.crypto.subtle.digest("SHA-256", n);
3365
- return Array.from(new Uint8Array(i)).map((r) => r.toString(16).padStart(2, "0")).join("");
3366
- }
3367
- try {
3368
- const { createHash: t } = await import("./__vite-browser-external-l0sNRNKZ.js");
3369
- return t("sha256").update(e).digest("hex");
3370
- } catch {
3371
- throw new Error("SHA-256 is not available in this environment");
3372
- }
3373
- }
3374
- function rn(e) {
3375
- const t = { "content-type": "application/json" };
3376
- if (e)
3377
- for (const [n, i] of Object.entries(e))
3378
- typeof i < "u" && (t[n] = String(i));
3379
- return t;
3380
- }
3381
- function me(e, t) {
3382
- return e?.length ? e.some((n) => t.includes(n?.extensions?.code) || t.includes(n?.message)) : !1;
3383
- }
3384
- function ge(e, t, n, i, r) {
3385
- const s = new Error(e);
3386
- return s.response = { data: r.json?.data, errors: r.json?.errors, status: r.status }, s.request = { query: t, variables: n, operationName: i }, s.graphQLErrors = r.json?.errors, s;
3387
- }
3388
- function ne(e, t, n, i, r) {
3389
- if (r.json?.errors?.length)
3390
- throw ge(`GraphQL request failed${e ? ` (${e})` : ""}`, t, n, i, r);
3391
- if (typeof r.json?.data > "u")
3392
- throw ge("GraphQL request failed: no data received", t, n, i, r);
3393
- return r.json.data;
3394
- }
3395
- class Z extends oe {
3396
- async request(t, ...n) {
3397
- let i = t, r, s, o;
3398
- t && typeof t == "object" && "document" in t ? (i = t.document, r = t.variables, s = t.requestHeaders, o = t.signal) : (r = n[0], s = n[1]);
3399
- const p = typeof i == "string" ? i : xt(i), { type: f, name: l } = tn(p), g = await nn(p), d = r ?? {}, m = this.url ?? this.endpoint ?? "", y = rn(s), I = async (A) => {
3400
- const x = await fetch(m, { method: "POST", headers: y, body: JSON.stringify(A), signal: o });
3401
- let P = null;
3402
- try {
3403
- P = await x.json();
3404
- } catch {
3405
- P = null;
3406
- }
3407
- return { status: x.status, json: P };
3408
- }, D = async (A) => {
3409
- const x = new URLSearchParams();
3410
- for (const [Ve, M] of Object.entries(A))
3411
- typeof M > "u" || x.set(Ve, typeof M == "string" ? M : JSON.stringify(M));
3412
- const P = m.includes("?") ? "&" : "?", $ = `${m}${P}${x.toString()}`, ue = await fetch($, { method: "GET", headers: y, signal: o });
3413
- let K = null;
3414
- try {
3415
- K = await ue.json();
3416
- } catch {
3417
- K = null;
3418
- }
3419
- return { status: ue.status, json: K };
3420
- }, N = {
3421
- operationName: l,
3422
- variables: d,
3423
- extensions: { persistedQuery: { version: 1, sha256Hash: g } }
3424
- }, O = async (A, x, P) => {
3425
- if (me(A.json?.errors, ["PERSISTED_QUERY_NOT_FOUND", "PersistedQueryNotFound"])) {
3426
- const $ = await x();
3427
- return ne("APQ register", p, d, l, $);
3428
- }
3429
- if (me(A.json?.errors, ["PERSISTED_QUERY_NOT_SUPPORTED"])) {
3430
- const $ = await P();
3431
- return ne("no APQ support", p, d, l, $);
3432
- }
3433
- return ne("", p, d, l, A);
3434
- };
3435
- if (f === "query") {
3436
- const A = await D(N);
3437
- return O(A, () => I({ ...N, query: p }), () => I({ operationName: l, variables: d, query: p }));
3438
- }
3439
- const C = await I(N);
3440
- return O(C, () => I({ ...N, query: p }), () => I({ operationName: l, variables: d, query: p }));
3441
- }
3442
- }
3443
- class sn {
2804
+ class xt {
3444
2805
  config;
3445
2806
  sdk;
3446
- constructor(t) {
3447
- this.config = t, this.sdk = en(new Z(t.apiUrl));
2807
+ constructor(e) {
2808
+ this.config = e, this.sdk = vt(new v(e.apiUrl));
3448
2809
  }
3449
- async getEvents(t = {}) {
2810
+ async getEvents(e = {}) {
3450
2811
  try {
3451
- t.page && (t.page = {
3452
- index: t.page.index ?? 0,
3453
- size: t.page.size ?? 20
2812
+ e.page && (e.page = {
2813
+ index: e.page.index ?? 0,
2814
+ size: e.page.size ?? 20
3454
2815
  }), this.debugLog("Fetching events with parameters", {
3455
2816
  organizationId: this.config.organizationId,
3456
- hostingIds: t.hostingIds,
3457
- filterEventStatuses: t.statuses,
3458
- dateRange: t.dateRange,
3459
- page: t.page,
3460
- sorts: t.sorts,
2817
+ hostingIds: e.hostingIds,
2818
+ filterEventStatuses: e.statuses,
2819
+ dateRange: e.dateRange,
2820
+ page: e.page,
2821
+ sorts: e.sorts,
3461
2822
  trackerId: this.config.trackerId
2823
+ }), console.log({
2824
+ organizationId: this.config.organizationId,
2825
+ hostingIds: e.hostingIds,
2826
+ locationIds: e.locationIds,
2827
+ excludedEventIds: e.excludedEventIds,
2828
+ filterEventStatuses: e.statuses,
2829
+ dateRange: e.dateRange && e.dateRange.from && e.dateRange.till ? {
2830
+ from: e.dateRange.from.toISO(),
2831
+ till: e.dateRange.till.toISO()
2832
+ } : void 0,
2833
+ page: e.page,
2834
+ sorts: e.sorts,
2835
+ trackerId: this.config.trackerId,
2836
+ searchTerm: e.searchTerm,
2837
+ priceRange: e.priceRange
3462
2838
  });
3463
- const n = await this.sdk.EventOverviewPage({
2839
+ const t = await this.sdk.EventOverviewPage({
3464
2840
  organizationId: this.config.organizationId,
3465
- hostingIds: t.hostingIds,
3466
- locationIds: t.locationIds,
3467
- excludedEventIds: t.excludedEventIds,
3468
- filterEventStatuses: t.statuses,
3469
- dateRange: t.dateRange && t.dateRange.from && t.dateRange.till ? {
3470
- from: t.dateRange.from.toISO(),
3471
- till: t.dateRange.till.toISO()
2841
+ hostingIds: e.hostingIds,
2842
+ locationIds: e.locationIds,
2843
+ excludedEventIds: e.excludedEventIds,
2844
+ filterEventStatuses: e.statuses,
2845
+ dateRange: e.dateRange && e.dateRange.from && e.dateRange.till ? {
2846
+ from: e.dateRange.from.toISO(),
2847
+ till: e.dateRange.till.toISO()
3472
2848
  } : void 0,
3473
- page: t.page,
3474
- sorts: t.sorts,
2849
+ page: e.page,
2850
+ sorts: e.sorts,
3475
2851
  trackerId: this.config.trackerId,
3476
- searchTerm: t.searchTerm,
3477
- priceRange: t.priceRange
2852
+ searchTerm: e.searchTerm,
2853
+ priceRange: e.priceRange
3478
2854
  });
3479
- if (this.debugLog("Raw GraphQL response", n), n?.findAllPublicEventByOrganizationId?.data) {
3480
- const i = n.findAllPublicEventByOrganizationId.data.map((r) => ({
2855
+ if (this.debugLog("Raw GraphQL response", t), t?.findAllPublicEventByOrganizationId?.data) {
2856
+ const i = t.findAllPublicEventByOrganizationId.data.map((r) => ({
3481
2857
  id: r.id,
3482
2858
  name: r.name,
3483
2859
  icon: r.icon,
3484
2860
  banner: r.banner,
3485
2861
  description: r.description,
3486
2862
  addonDescription: r.addonDescription,
3487
- startAt: L.fromISO(r.startAt, { zone: r.timezone }).toJSDate().toISOString(),
3488
- endAt: L.fromISO(r.endAt, { zone: r.timezone }).toJSDate().toISOString(),
2863
+ startAt: A.fromISO(r.startAt, { zone: r.timezone }).toJSDate().toISOString(),
2864
+ endAt: A.fromISO(r.endAt, { zone: r.timezone }).toJSDate().toISOString(),
3489
2865
  timezone: r.timezone,
3490
2866
  startSalesAt: null,
3491
2867
  endSalesAt: null,
@@ -3505,27 +2881,27 @@ class sn {
3505
2881
  startingPrice: r.startingPrice,
3506
2882
  totalViews: r.totalViews
3507
2883
  }));
3508
- return this.debugLog("Processed events", { events: i, count: i.length }), [i, n.findAllPublicEventByOrganizationId.count ?? 0];
2884
+ return this.debugLog("Processed events", { events: i, count: i.length }), [i, t.findAllPublicEventByOrganizationId.count ?? 0];
3509
2885
  } else
3510
2886
  return this.debugLog("No events found in response"), [[], 0];
3511
- } catch (n) {
3512
- throw this.debugLog("Error fetching events", n), n;
2887
+ } catch (t) {
2888
+ throw this.debugLog("Error fetching events", t), t;
3513
2889
  }
3514
2890
  }
3515
- async getEvent(t) {
2891
+ async getEvent(e) {
3516
2892
  try {
3517
- this.debugLog("Fetching single event", { eventId: t });
3518
- const n = await this.sdk.EventDetailPage({ eventId: t });
3519
- if (this.debugLog("Raw GraphQL response", n), n?.findPublicEventById) {
3520
- const i = n.findPublicEventById, r = {
2893
+ this.debugLog("Fetching single event", { eventId: e });
2894
+ const t = await this.sdk.EventDetailPage({ eventId: e });
2895
+ if (this.debugLog("Raw GraphQL response", t), t?.findPublicEventById) {
2896
+ const i = t.findPublicEventById, r = {
3521
2897
  id: i.id,
3522
2898
  name: i.name,
3523
2899
  icon: i.icon,
3524
2900
  banner: i.banner,
3525
2901
  description: i.description,
3526
2902
  addonDescription: i.addonDescription,
3527
- startAt: L.fromISO(i.startAt, { zone: i.timezone }).toJSDate().toISOString(),
3528
- endAt: L.fromISO(i.endAt, { zone: i.timezone }).toJSDate().toISOString(),
2903
+ startAt: A.fromISO(i.startAt, { zone: i.timezone }).toJSDate().toISOString(),
2904
+ endAt: A.fromISO(i.endAt, { zone: i.timezone }).toJSDate().toISOString(),
3529
2905
  timezone: i.timezone,
3530
2906
  startSalesAt: i.startSalesAt,
3531
2907
  endSalesAt: i.endSalesAt,
@@ -3547,26 +2923,26 @@ class sn {
3547
2923
  };
3548
2924
  return this.debugLog("Processed single event", r), r;
3549
2925
  } else {
3550
- this.debugLog("No event found for id", t);
2926
+ this.debugLog("No event found for id", e);
3551
2927
  return;
3552
2928
  }
3553
- } catch (n) {
3554
- throw this.debugLog("Error fetching single event", n), n;
2929
+ } catch (t) {
2930
+ throw this.debugLog("Error fetching single event", t), t;
3555
2931
  }
3556
2932
  }
3557
- async getProducts(t, n, i) {
2933
+ async getProducts(e, t, i) {
3558
2934
  try {
3559
2935
  this.debugLog("Fetching products for event", {
3560
- eventId: t,
2936
+ eventId: e,
3561
2937
  promoCode: i,
3562
2938
  trackerId: this.config.trackerId,
3563
- productTypes: n
2939
+ productTypes: t
3564
2940
  });
3565
2941
  const r = await this.sdk.findProductsByEventId({
3566
- eventId: t,
2942
+ eventId: e,
3567
2943
  promoCode: i,
3568
2944
  trackerId: this.config.trackerId,
3569
- productTypes: n
2945
+ productTypes: t
3570
2946
  });
3571
2947
  if (r?.findPublicProductsByEventId) {
3572
2948
  const s = r.findPublicProductsByEventId.map((o) => ({
@@ -3594,21 +2970,21 @@ class sn {
3594
2970
  type: o.type
3595
2971
  }));
3596
2972
  return this.debugLog("Products fetched", {
3597
- eventId: t,
2973
+ eventId: e,
3598
2974
  count: s.length,
3599
2975
  types: s.map((o) => o.type)
3600
2976
  }), s;
3601
2977
  }
3602
2978
  return;
3603
2979
  } catch (r) {
3604
- throw this.debugLog("Error fetching products", { eventId: t, error: r }), r;
2980
+ throw this.debugLog("Error fetching products", { eventId: e, error: r }), r;
3605
2981
  }
3606
2982
  }
3607
- debugLog(t, n) {
3608
- this.config.debug && console.log(`[EventService:${this.config.organizationId}] ${t}`, n || "");
2983
+ debugLog(e, t) {
2984
+ this.config.debug && console.log(`[EventService:${this.config.organizationId}] ${e}`, t || "");
3609
2985
  }
3610
2986
  }
3611
- const an = E`
2987
+ const Pt = l`
3612
2988
  query findPaymentMethods($orderId: ID!, $orderItemId: String, $amountOfTickets: Int, $paymentMethodId: String, $withTicketProtection: Boolean) {
3613
2989
  findPaymentDetails(
3614
2990
  orderId: $orderId
@@ -3638,40 +3014,40 @@ const an = E`
3638
3014
  protectionFee
3639
3015
  }
3640
3016
  }
3641
- `, on = E`
3017
+ `, bt = l`
3642
3018
  mutation createDigitalPayment($input: CreateDigitalOrderPaymentInput!) {
3643
3019
  createDigitalOrderPayment(input: $input)
3644
3020
  }
3645
- `, cn = (e, t, n, i) => e();
3646
- function dn(e, t = cn) {
3021
+ `, St = (n, e, t, i) => n();
3022
+ function Ct(n, e = St) {
3647
3023
  return {
3648
- findPaymentMethods(n, i, r) {
3649
- return t((s) => e.request({ document: an, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findPaymentMethods", "query", n);
3024
+ findPaymentMethods(t, i, r) {
3025
+ return e((s) => n.request({ document: Pt, variables: t, requestHeaders: { ...i, ...s }, signal: r }), "findPaymentMethods", "query", t);
3650
3026
  },
3651
- createDigitalPayment(n, i, r) {
3652
- return t((s) => e.request({ document: on, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "createDigitalPayment", "mutation", n);
3027
+ createDigitalPayment(t, i, r) {
3028
+ return e((s) => n.request({ document: bt, variables: t, requestHeaders: { ...i, ...s }, signal: r }), "createDigitalPayment", "mutation", t);
3653
3029
  }
3654
3030
  };
3655
3031
  }
3656
- class un {
3032
+ class _t {
3657
3033
  config;
3658
3034
  sdk;
3659
- constructor(t) {
3660
- this.config = t, this.sdk = dn(new oe(t.apiUrl));
3035
+ constructor(e) {
3036
+ this.config = e, this.sdk = Ct(new v(e.apiUrl));
3661
3037
  }
3662
- async getPaymentDetails(t) {
3663
- this.debugLog("Fetching payment methods", t);
3038
+ async getPaymentDetails(e) {
3039
+ this.debugLog("Fetching payment methods", e);
3664
3040
  try {
3665
- const n = await this.sdk.findPaymentMethods({
3666
- orderId: t.orderId,
3667
- orderItemId: t.orderItemId,
3668
- amountOfTickets: t.amountOfTickets,
3669
- paymentMethodId: t.paymentMethodId,
3670
- withTicketProtection: t.withTicketProtection
3041
+ const t = await this.sdk.findPaymentMethods({
3042
+ orderId: e.orderId,
3043
+ orderItemId: e.orderItemId,
3044
+ amountOfTickets: e.amountOfTickets,
3045
+ paymentMethodId: e.paymentMethodId,
3046
+ withTicketProtection: e.withTicketProtection
3671
3047
  });
3672
- if (!n?.findPaymentDetails)
3048
+ if (!t?.findPaymentDetails)
3673
3049
  throw this.debugLog("No payment details found"), new Error("No payment details found for this order");
3674
- const i = n.findPaymentDetails;
3050
+ const i = t.findPaymentDetails;
3675
3051
  return this.debugLog("Payment methods fetched successfully", {
3676
3052
  methodCount: i.methods?.length ?? 0,
3677
3053
  transactionPrice: i.transactionPrice,
@@ -3700,42 +3076,42 @@ class un {
3700
3076
  })) ?? null
3701
3077
  })) ?? null
3702
3078
  };
3703
- } catch (n) {
3704
- throw this.debugLog("Error fetching payment methods", n), n;
3079
+ } catch (t) {
3080
+ throw this.debugLog("Error fetching payment methods", t), t;
3705
3081
  }
3706
3082
  }
3707
- async createPayment(t) {
3708
- this.debugLog("Creating payment", t);
3083
+ async createPayment(e) {
3084
+ this.debugLog("Creating payment", e);
3709
3085
  try {
3710
- const n = {
3711
- orderId: t.orderId,
3712
- paymentMethodId: t.paymentMethodId,
3713
- issuerId: t.issuerId,
3714
- redirectUrl: t.redirectUrl,
3086
+ const t = {
3087
+ orderId: e.orderId,
3088
+ paymentMethodId: e.paymentMethodId,
3089
+ issuerId: e.issuerId,
3090
+ redirectUrl: e.redirectUrl,
3715
3091
  // For payment links this input in used
3716
- initiatedByUserId: t.initiatedByUserId,
3717
- initiatedByTeamId: t.initiatedByTeamId,
3718
- amountOfTickets: t.amountOfTickets,
3719
- orderItemId: t.orderItemId,
3720
- withTicketProtection: t.withTicketProtection
3092
+ initiatedByUserId: e.initiatedByUserId,
3093
+ initiatedByTeamId: e.initiatedByTeamId,
3094
+ amountOfTickets: e.amountOfTickets,
3095
+ orderItemId: e.orderItemId,
3096
+ withTicketProtection: e.withTicketProtection
3721
3097
  };
3722
- t.customer && (n.customer = t.customer), t.products && (n.products = t.products), t.description && (n.description = t.description), t.reference && (n.reference = t.reference), t.ipAddress && (n.ipAddress = t.ipAddress);
3098
+ e.customer && (t.customer = e.customer), e.products && (t.products = e.products), e.description && (t.description = e.description), e.reference && (t.reference = e.reference), e.ipAddress && (t.ipAddress = e.ipAddress);
3723
3099
  const i = await this.sdk.createDigitalPayment({
3724
- input: n
3100
+ input: t
3725
3101
  });
3726
3102
  if (!i?.createDigitalOrderPayment)
3727
3103
  throw this.debugLog("Failed to create payment"), new Error("Failed to create payment for this order");
3728
3104
  const r = i.createDigitalOrderPayment;
3729
3105
  return this.debugLog("Payment created successfully", { paymentUrl: r }), { paymentUrl: r };
3730
- } catch (n) {
3731
- throw this.debugLog("Error creating payment", n), n;
3106
+ } catch (t) {
3107
+ throw this.debugLog("Error creating payment", t), t;
3732
3108
  }
3733
3109
  }
3734
- debugLog(t, n) {
3735
- this.config.debug && console.log(`[PaymentService] ${t}`, n || "");
3110
+ debugLog(e, t) {
3111
+ this.config.debug && console.log(`[PaymentService] ${e}`, t || "");
3736
3112
  }
3737
3113
  }
3738
- const ln = E`
3114
+ const Lt = l`
3739
3115
  query findAllPublicPackagesByOrganizationId($organizationId: ID!) {
3740
3116
  findAllPublicPackagesByOrganizationId(organizationId: $organizationId) {
3741
3117
  data {
@@ -3760,7 +3136,7 @@ const ln = E`
3760
3136
  count
3761
3137
  }
3762
3138
  }
3763
- `, pn = E`
3139
+ `, Rt = l`
3764
3140
  query findPublicPackageById($packageId: ID!) {
3765
3141
  findPublicPackageById(id: $packageId) {
3766
3142
  id
@@ -3786,7 +3162,7 @@ const ln = E`
3786
3162
  }
3787
3163
  }
3788
3164
  }
3789
- `, hn = E`
3165
+ `, wt = l`
3790
3166
  query findPublicItemsByPackageId($packageId: ID!, $types: [PackageItemType!], $page: PageInput) {
3791
3167
  findPublicItemsByPackageId(packageId: $packageId, types: $types, page: $page) {
3792
3168
  data {
@@ -3821,40 +3197,40 @@ const ln = E`
3821
3197
  count
3822
3198
  }
3823
3199
  }
3824
- `, fn = (e, t, n, i) => e();
3825
- function mn(e, t = fn) {
3200
+ `, Ft = (n, e, t, i) => n();
3201
+ function $t(n, e = Ft) {
3826
3202
  return {
3827
- findAllPublicPackagesByOrganizationId(n, i, r) {
3828
- return t((s) => e.request({ document: ln, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findAllPublicPackagesByOrganizationId", "query", n);
3203
+ findAllPublicPackagesByOrganizationId(t, i, r) {
3204
+ return e((s) => n.request({ document: Lt, variables: t, requestHeaders: { ...i, ...s }, signal: r }), "findAllPublicPackagesByOrganizationId", "query", t);
3829
3205
  },
3830
- findPublicPackageById(n, i, r) {
3831
- return t((s) => e.request({ document: pn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findPublicPackageById", "query", n);
3206
+ findPublicPackageById(t, i, r) {
3207
+ return e((s) => n.request({ document: Rt, variables: t, requestHeaders: { ...i, ...s }, signal: r }), "findPublicPackageById", "query", t);
3832
3208
  },
3833
- findPublicItemsByPackageId(n, i, r) {
3834
- return t((s) => e.request({ document: hn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findPublicItemsByPackageId", "query", n);
3209
+ findPublicItemsByPackageId(t, i, r) {
3210
+ return e((s) => n.request({ document: wt, variables: t, requestHeaders: { ...i, ...s }, signal: r }), "findPublicItemsByPackageId", "query", t);
3835
3211
  }
3836
3212
  };
3837
3213
  }
3838
- class gn {
3214
+ class Bt {
3839
3215
  config;
3840
3216
  sdk;
3841
- constructor(t) {
3842
- this.config = t, this.sdk = mn(new Z(t.apiUrl));
3217
+ constructor(e) {
3218
+ this.config = e, this.sdk = $t(new v(e.apiUrl));
3843
3219
  }
3844
- debugLog(t, n) {
3845
- this.config.debug && console.log(`[PackageService] ${t}`, n || "");
3220
+ debugLog(e, t) {
3221
+ this.config.debug && console.log(`[PackageService] ${e}`, t || "");
3846
3222
  }
3847
- async getPackages(t = {}) {
3223
+ async getPackages(e = {}) {
3848
3224
  try {
3849
- let n;
3850
- t.page && (n = {
3851
- index: t.page.index ?? 0,
3852
- size: t.page.size ?? 20
3225
+ let t;
3226
+ e.page && (t = {
3227
+ index: e.page.index ?? 0,
3228
+ size: e.page.size ?? 20
3853
3229
  }), this.debugLog("Fetching public packages", {
3854
3230
  organizationId: this.config.organizationId,
3855
- page: n,
3856
- tab: t.tab,
3857
- statuses: t.statuses
3231
+ page: t,
3232
+ tab: e.tab,
3233
+ statuses: e.statuses
3858
3234
  });
3859
3235
  const i = await this.sdk.findAllPublicPackagesByOrganizationId({
3860
3236
  organizationId: this.config.organizationId
@@ -3867,31 +3243,31 @@ class gn {
3867
3243
  }), r.data;
3868
3244
  }
3869
3245
  return null;
3870
- } catch (n) {
3871
- throw this.debugLog("Error fetching public packages", n), n;
3246
+ } catch (t) {
3247
+ throw this.debugLog("Error fetching public packages", t), t;
3872
3248
  }
3873
3249
  }
3874
- async getPackage(t) {
3250
+ async getPackage(e) {
3875
3251
  try {
3876
3252
  this.debugLog("Fetching public packages", {
3877
- packageId: t
3253
+ packageId: e
3878
3254
  });
3879
- const n = await this.sdk.findPublicPackageById({ packageId: t });
3880
- if (n?.findPublicPackageById) {
3881
- const i = n.findPublicPackageById;
3255
+ const t = await this.sdk.findPublicPackageById({ packageId: e });
3256
+ if (t?.findPublicPackageById) {
3257
+ const i = t.findPublicPackageById;
3882
3258
  return this.debugLog("Public package fetched"), i;
3883
3259
  }
3884
3260
  return null;
3885
- } catch (n) {
3886
- throw this.debugLog("Error fetching public packages", n), n;
3261
+ } catch (t) {
3262
+ throw this.debugLog("Error fetching public packages", t), t;
3887
3263
  }
3888
3264
  }
3889
- async getPackageItems(t, n = [Y.Regular, Y.AdditionalEvent]) {
3265
+ async getPackageItems(e, t = [R.Regular, R.AdditionalEvent]) {
3890
3266
  try {
3891
- this.debugLog("Fetching public package items", { packageId: t, types: n });
3267
+ this.debugLog("Fetching public package items", { packageId: e, types: t });
3892
3268
  const i = await this.sdk.findPublicItemsByPackageId({
3893
- packageId: t,
3894
- types: n,
3269
+ packageId: e,
3270
+ types: t,
3895
3271
  page: { index: 0, size: 100 }
3896
3272
  });
3897
3273
  if (i?.findPublicItemsByPackageId) {
@@ -3907,7 +3283,7 @@ class gn {
3907
3283
  }
3908
3284
  }
3909
3285
  }
3910
- const In = E`
3286
+ const Vt = l`
3911
3287
  query findAllPublicCategoriesByOrganizationId($organizationId: ID!, $dateRange: DateRangeInput) {
3912
3288
  findAllPublicLocationsByOrganizationId(id: $organizationId) {
3913
3289
  data {
@@ -3927,89 +3303,89 @@ const In = E`
3927
3303
  count
3928
3304
  }
3929
3305
  }
3930
- `, En = (e, t, n, i) => e();
3931
- function yn(e, t = En) {
3306
+ `, Ut = (n, e, t, i) => n();
3307
+ function Mt(n, e = Ut) {
3932
3308
  return {
3933
- findAllPublicCategoriesByOrganizationId(n, i, r) {
3934
- return t((s) => e.request({ document: In, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findAllPublicCategoriesByOrganizationId", "query", n);
3309
+ findAllPublicCategoriesByOrganizationId(t, i, r) {
3310
+ return e((s) => n.request({ document: Vt, variables: t, requestHeaders: { ...i, ...s }, signal: r }), "findAllPublicCategoriesByOrganizationId", "query", t);
3935
3311
  }
3936
3312
  };
3937
3313
  }
3938
- class Tn {
3314
+ class zt {
3939
3315
  config;
3940
3316
  sdk;
3941
- constructor(t) {
3942
- this.config = t, this.sdk = yn(new Z(t.apiUrl));
3317
+ constructor(e) {
3318
+ this.config = e, this.sdk = Mt(new v(e.apiUrl));
3943
3319
  }
3944
- debugLog(t, n) {
3945
- this.config.debug && console.log(`[CategoryService] ${t}`, n || "");
3320
+ debugLog(e, t) {
3321
+ this.config.debug && console.log(`[CategoryService] ${e}`, t || "");
3946
3322
  }
3947
- async getCategories(t) {
3323
+ async getCategories(e) {
3948
3324
  try {
3949
3325
  this.debugLog("Fetching all categories", { organizationId: this.config.organizationId });
3950
- const n = await this.sdk.findAllPublicCategoriesByOrganizationId({ organizationId: this.config.organizationId, dateRange: t });
3951
- if (n?.findAllPublicHostingsByOrganizationId) {
3952
- const i = n.findAllPublicHostingsByOrganizationId, r = n.findAllPublicLocationsByOrganizationId;
3326
+ const t = await this.sdk.findAllPublicCategoriesByOrganizationId({ organizationId: this.config.organizationId, dateRange: e ?? null });
3327
+ if (t?.findAllPublicHostingsByOrganizationId) {
3328
+ const i = t.findAllPublicHostingsByOrganizationId, r = t.findAllPublicLocationsByOrganizationId;
3953
3329
  return this.debugLog("Categories fetched", { count: i.count + r.count, dataLength: i.data.length + r.data.length }), [
3954
3330
  ...i.data.map((s) => ({ id: s.id, name: s.name, icon: s.icon, activeEvents: s.amountOfActiveEvents, type: "HOSTING" })),
3955
3331
  ...r.data.map((s) => ({ id: s.id, name: s.name, activeEvents: s.amountOfActiveEvents, type: "LOCATION" }))
3956
3332
  ];
3957
3333
  }
3958
3334
  return [];
3959
- } catch (n) {
3960
- throw this.debugLog("Error fetching categories", n), n;
3335
+ } catch (t) {
3336
+ throw this.debugLog("Error fetching categories", t), t;
3961
3337
  }
3962
3338
  }
3963
3339
  }
3964
- const vn = E`
3340
+ const qt = l`
3965
3341
  mutation CreateShopView($id: ID!, $trackerLinkId: ID) {
3966
3342
  createShopView(id: $id, trackerId: $trackerLinkId)
3967
3343
  }
3968
- `, kn = E`
3344
+ `, Gt = l`
3969
3345
  mutation CreateEventView($id: ID!, $shopId: ID, $trackerLinkId: ID) {
3970
3346
  createEventView(id: $id, shopId: $shopId, trackerId: $trackerLinkId)
3971
3347
  }
3972
- `, On = E`
3348
+ `, jt = l`
3973
3349
  mutation CreatePackageView($id: ID!, $shopId: ID, $trackerLinkId: ID) {
3974
3350
  createPackageView(id: $id, shopId: $shopId, trackerId: $trackerLinkId)
3975
3351
  }
3976
- `, An = (e, t, n, i) => e();
3977
- function Dn(e, t = An) {
3352
+ `, Yt = (n, e, t, i) => n();
3353
+ function Ht(n, e = Yt) {
3978
3354
  return {
3979
- CreateShopView(n, i, r) {
3980
- return t((s) => e.request({ document: vn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "CreateShopView", "mutation", n);
3355
+ CreateShopView(t, i, r) {
3356
+ return e((s) => n.request({ document: qt, variables: t, requestHeaders: { ...i, ...s }, signal: r }), "CreateShopView", "mutation", t);
3981
3357
  },
3982
- CreateEventView(n, i, r) {
3983
- return t((s) => e.request({ document: kn, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "CreateEventView", "mutation", n);
3358
+ CreateEventView(t, i, r) {
3359
+ return e((s) => n.request({ document: Gt, variables: t, requestHeaders: { ...i, ...s }, signal: r }), "CreateEventView", "mutation", t);
3984
3360
  },
3985
- CreatePackageView(n, i, r) {
3986
- return t((s) => e.request({ document: On, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "CreatePackageView", "mutation", n);
3361
+ CreatePackageView(t, i, r) {
3362
+ return e((s) => n.request({ document: jt, variables: t, requestHeaders: { ...i, ...s }, signal: r }), "CreatePackageView", "mutation", t);
3987
3363
  }
3988
3364
  };
3989
3365
  }
3990
- class Nn {
3366
+ class Jt {
3991
3367
  config;
3992
3368
  sdk;
3993
- constructor(t) {
3994
- this.config = t, this.sdk = Dn(new Z(t.apiUrl));
3369
+ constructor(e) {
3370
+ this.config = e, this.sdk = Ht(new v(e.apiUrl));
3995
3371
  }
3996
- createMetric = async (t, n, i) => {
3997
- switch (!n && !i && await this.sdk.CreateShopView({
3998
- id: t,
3372
+ createMetric = async (e, t, i) => {
3373
+ switch (!t && !i && await this.sdk.CreateShopView({
3374
+ id: e,
3999
3375
  trackerLinkId: this.config.trackerId
4000
3376
  }), i) {
4001
- case H.Event:
3377
+ case w.Event:
4002
3378
  await this.sdk.CreateEventView({
4003
- id: t,
4004
- shopId: n,
3379
+ id: e,
3380
+ shopId: t,
4005
3381
  trackerLinkId: this.config.trackerId
4006
3382
  });
4007
3383
  break;
4008
- case H.Package:
3384
+ case w.Package:
4009
3385
  await this.sdk.CreatePackageView(
4010
3386
  {
4011
- id: t,
4012
- shopId: n,
3387
+ id: e,
3388
+ shopId: t,
4013
3389
  trackerLinkId: this.config.trackerId
4014
3390
  }
4015
3391
  );
@@ -4017,8 +3393,8 @@ class Nn {
4017
3393
  }
4018
3394
  };
4019
3395
  }
4020
- const xn = "https://api.ticketapp.com/graphql", Ie = "TIC_TRACKER_ID";
4021
- class Sn {
3396
+ const Qt = "https://api.ticketapp.com/graphql", Z = "TIC_TRACKER_ID";
3397
+ class Zt {
4022
3398
  basket;
4023
3399
  event;
4024
3400
  payment;
@@ -4026,42 +3402,42 @@ class Sn {
4026
3402
  category;
4027
3403
  metric;
4028
3404
  // Attach selected public types to the SDK class
4029
- static Types = Ue;
4030
- constructor(t) {
4031
- const { organizationId: n, debug: i = !1, apiUrl: r = xn } = t, s = this.getOrInitTrackerId();
4032
- this.basket = new Jt({ debug: i, apiUrl: r, shopId: t.shopId, trackerId: s }), this.event = new sn({ organizationId: n, debug: i, apiUrl: r, trackerId: s }), this.payment = new un({ debug: i, apiUrl: r }), this.package = new gn({ organizationId: n, debug: i, apiUrl: r }), this.category = new Tn({ organizationId: n, debug: i, apiUrl: r }), this.metric = new Nn({ apiUrl: r, trackerId: s });
3405
+ static Types = Te;
3406
+ constructor(e) {
3407
+ const { organizationId: t, debug: i = !1, apiUrl: r = Qt } = e, s = this.getOrInitTrackerId();
3408
+ this.basket = new kt({ debug: i, apiUrl: r, shopId: e.shopId, trackerId: s }), this.event = new xt({ organizationId: t, debug: i, apiUrl: r, trackerId: s }), this.payment = new _t({ debug: i, apiUrl: r }), this.package = new Bt({ organizationId: t, debug: i, apiUrl: r }), this.category = new zt({ organizationId: t, debug: i, apiUrl: r }), this.metric = new Jt({ apiUrl: r, trackerId: s });
4033
3409
  }
4034
3410
  // Resolve tracker id from (in order): explicit config, URL query, or session storage
4035
3411
  // Persist to session when found via config or URL for subsequent page loads
4036
3412
  getOrInitTrackerId() {
4037
3413
  try {
4038
- let t = null, n = null;
3414
+ let e = null, t = null;
4039
3415
  if (typeof window < "u") {
4040
3416
  try {
4041
- n = new URL(window.location.href).searchParams.get("trackerId");
3417
+ t = new URL(window.location.href).searchParams.get("trackerId");
4042
3418
  } catch {
4043
3419
  }
4044
3420
  try {
4045
- t = window.sessionStorage?.getItem(Ie) ?? null;
3421
+ e = window.sessionStorage?.getItem(Z) ?? null;
4046
3422
  } catch {
4047
3423
  }
4048
3424
  }
4049
- if (n && n.trim().length > 0) {
3425
+ if (t && t.trim().length > 0) {
4050
3426
  try {
4051
- typeof window < "u" && window.sessionStorage && sessionStorage.setItem(Ie, n);
3427
+ typeof window < "u" && window.sessionStorage && sessionStorage.setItem(Z, t);
4052
3428
  } catch {
4053
3429
  }
4054
- return n;
3430
+ return t;
4055
3431
  }
4056
- if (t && t.trim().length > 0) {
3432
+ if (e && e.trim().length > 0) {
4057
3433
  try {
4058
3434
  if (typeof window < "u") {
4059
3435
  const i = new URL(window.location.href);
4060
- i.searchParams.get("trackerId") || (i.searchParams.set("trackerId", t), window.history.replaceState({}, "", i.toString()));
3436
+ i.searchParams.get("trackerId") || (i.searchParams.set("trackerId", e), window.history.replaceState({}, "", i.toString()));
4061
3437
  }
4062
3438
  } catch {
4063
3439
  }
4064
- return t;
3440
+ return e;
4065
3441
  }
4066
3442
  return;
4067
3443
  } catch {
@@ -4070,17 +3446,17 @@ class Sn {
4070
3446
  }
4071
3447
  }
4072
3448
  export {
4073
- _ as BasketOrderType,
4074
- Ne as DiscountType,
4075
- Te as EventStatus,
4076
- H as MetricsType,
4077
- De as OrderItemType,
4078
- Y as PackageItemType,
4079
- Ee as PackageStatus,
4080
- ye as PackageTabType,
4081
- Ae as PaymentMethodFeeType,
4082
- ke as ProductStatus,
4083
- Oe as ProductType,
4084
- ve as SortOrder,
4085
- Sn as TicketappSDK
3449
+ T as BasketOrderType,
3450
+ oe as DiscountType,
3451
+ te as EventStatus,
3452
+ w as MetricsType,
3453
+ ae as OrderItemType,
3454
+ R as PackageItemType,
3455
+ K as PackageStatus,
3456
+ ee as PackageTabType,
3457
+ se as PaymentMethodFeeType,
3458
+ ie as ProductStatus,
3459
+ re as ProductType,
3460
+ ne as SortOrder,
3461
+ Zt as TicketappSDK
4086
3462
  };