@debugged-development/ticketapp-sdk 1.0.5 → 1.0.8
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
|
@@ -27,85 +27,85 @@ const ee = {
|
|
|
27
27
|
});
|
|
28
28
|
},
|
|
29
29
|
addProductToOrder: (e, t) => {
|
|
30
|
-
const { input:
|
|
30
|
+
const { input: n, amountReserved: i, expiredAt: r } = t.payload;
|
|
31
31
|
if (!e.order)
|
|
32
32
|
return;
|
|
33
|
-
const s = e.order.items.findIndex((o) =>
|
|
33
|
+
const s = e.order.items.findIndex((o) => n.seat ? o.id === n.id && o.seats?.some((c) => c.id === n.seat?.id) : o.id === n.id);
|
|
34
34
|
if (s >= 0)
|
|
35
35
|
e.order.items[s].amount += i;
|
|
36
36
|
else {
|
|
37
37
|
const o = {
|
|
38
|
-
id:
|
|
38
|
+
id: n.id,
|
|
39
39
|
type: "PRODUCT",
|
|
40
|
-
name:
|
|
40
|
+
name: n.name,
|
|
41
41
|
amount: i,
|
|
42
|
-
price:
|
|
43
|
-
depositPrice:
|
|
44
|
-
serviceFee:
|
|
45
|
-
originalPrice:
|
|
46
|
-
seats:
|
|
42
|
+
price: n.price,
|
|
43
|
+
depositPrice: n.depositPrice,
|
|
44
|
+
serviceFee: n.serviceFee,
|
|
45
|
+
originalPrice: n.price,
|
|
46
|
+
seats: n.seat ? [{ id: n.seat.id, label: n.seat.label }] : void 0
|
|
47
47
|
};
|
|
48
48
|
e.order.items.push(o);
|
|
49
49
|
}
|
|
50
|
-
e.order.expiredAt = _.fromISO(
|
|
50
|
+
e.order.expiredAt = _.fromISO(r);
|
|
51
51
|
},
|
|
52
52
|
removeProductFromOrder: (e, t) => {
|
|
53
53
|
if (!e.order) return;
|
|
54
|
-
const { id:
|
|
55
|
-
(o) => o.type === "PRODUCT" && o.id ===
|
|
54
|
+
const { id: n, amountReleased: i, seatId: r } = t.payload, s = e.order.items.findIndex(
|
|
55
|
+
(o) => o.type === "PRODUCT" && o.id === n
|
|
56
56
|
);
|
|
57
57
|
if (s !== -1) {
|
|
58
58
|
const o = e.order.items[s];
|
|
59
59
|
if (o.amount -= i, o.amount <= 0)
|
|
60
60
|
e.order.items.splice(s, 1);
|
|
61
|
-
else if (o.seats &&
|
|
62
|
-
const c = o.seats.findIndex((l) => l.id ===
|
|
61
|
+
else if (o.seats && r) {
|
|
62
|
+
const c = o.seats.findIndex((l) => l.id === r);
|
|
63
63
|
c !== -1 && o.seats.splice(c, 1);
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
e.order.items.length === 0 && (e.order = null);
|
|
67
67
|
},
|
|
68
68
|
setPackageInOrder: (e, t) => {
|
|
69
|
-
const { input:
|
|
69
|
+
const { input: n, amountReserved: i, expiredAt: r } = t.payload;
|
|
70
70
|
e.order || (e.order = {
|
|
71
71
|
id: "",
|
|
72
|
-
currency:
|
|
72
|
+
currency: n.currency,
|
|
73
73
|
items: [],
|
|
74
|
-
expiredAt: _.fromISO(
|
|
74
|
+
expiredAt: _.fromISO(r)
|
|
75
75
|
});
|
|
76
76
|
const s = e.order.items.find(
|
|
77
|
-
(o) => o.type === "PACKAGE" && o.id ===
|
|
77
|
+
(o) => o.type === "PACKAGE" && o.id === n.id
|
|
78
78
|
);
|
|
79
|
-
s ? (s.amount = i, s.packageItems =
|
|
80
|
-
id:
|
|
79
|
+
s ? (s.amount = i, s.packageItems = n.items) : e.order.items.push({
|
|
80
|
+
id: n.id,
|
|
81
81
|
type: "PACKAGE",
|
|
82
|
-
name:
|
|
82
|
+
name: n.name,
|
|
83
83
|
amount: i,
|
|
84
|
-
price:
|
|
85
|
-
depositPrice:
|
|
86
|
-
originalPrice:
|
|
87
|
-
serviceFee:
|
|
88
|
-
packageItems:
|
|
84
|
+
price: n.discountPrice ?? n.price,
|
|
85
|
+
depositPrice: n.depositPrice,
|
|
86
|
+
originalPrice: n.price,
|
|
87
|
+
serviceFee: n.serviceFee,
|
|
88
|
+
packageItems: n.items
|
|
89
89
|
});
|
|
90
90
|
},
|
|
91
91
|
setDeliveryOption: (e, t) => {
|
|
92
92
|
if (!e.order) return;
|
|
93
|
-
const
|
|
94
|
-
(
|
|
93
|
+
const n = t.payload, i = e.order.items.findIndex(
|
|
94
|
+
(r) => r.type === "DELIVERY"
|
|
95
95
|
);
|
|
96
|
-
if (
|
|
96
|
+
if (n)
|
|
97
97
|
if (i !== -1) {
|
|
98
|
-
const
|
|
99
|
-
|
|
98
|
+
const r = e.order.items[i];
|
|
99
|
+
r.id = n.id, r.name = n.name, r.price = n.price, r.serviceFee = n.serviceFee;
|
|
100
100
|
} else
|
|
101
101
|
e.order.items.push({
|
|
102
|
-
id:
|
|
102
|
+
id: n.id,
|
|
103
103
|
type: "PRODUCT",
|
|
104
|
-
name:
|
|
104
|
+
name: n.name,
|
|
105
105
|
amount: 1,
|
|
106
|
-
price:
|
|
107
|
-
originalPrice:
|
|
108
|
-
serviceFee:
|
|
106
|
+
price: n.price,
|
|
107
|
+
originalPrice: n.price,
|
|
108
|
+
serviceFee: n.serviceFee
|
|
109
109
|
});
|
|
110
110
|
else i !== -1 && e.order.items.splice(i, 1);
|
|
111
111
|
},
|
|
@@ -116,16 +116,16 @@ const ee = {
|
|
|
116
116
|
}
|
|
117
117
|
}), {
|
|
118
118
|
setProcessing: N,
|
|
119
|
-
setError:
|
|
120
|
-
setOrder:
|
|
119
|
+
setError: sr,
|
|
120
|
+
setOrder: ar,
|
|
121
121
|
initializeOrder: $,
|
|
122
122
|
addProductToOrder: te,
|
|
123
|
-
removeProductFromOrder:
|
|
124
|
-
setPackageInOrder:
|
|
125
|
-
setDeliveryOption:
|
|
126
|
-
setCustomer:
|
|
123
|
+
removeProductFromOrder: nn,
|
|
124
|
+
setPackageInOrder: ne,
|
|
125
|
+
setDeliveryOption: rn,
|
|
126
|
+
setCustomer: re,
|
|
127
127
|
clearBasket: ie
|
|
128
|
-
} = ue.actions,
|
|
128
|
+
} = ue.actions, sn = ue.reducer, an = {
|
|
129
129
|
events: [],
|
|
130
130
|
processing: !1,
|
|
131
131
|
error: null,
|
|
@@ -140,7 +140,7 @@ const ee = {
|
|
|
140
140
|
}
|
|
141
141
|
}, le = de({
|
|
142
142
|
name: "event",
|
|
143
|
-
initialState:
|
|
143
|
+
initialState: an,
|
|
144
144
|
reducers: {
|
|
145
145
|
setProcessing: (e, t) => {
|
|
146
146
|
e.processing = t.payload, t.payload && (e.error = null);
|
|
@@ -165,8 +165,8 @@ const ee = {
|
|
|
165
165
|
};
|
|
166
166
|
},
|
|
167
167
|
setEventProducts: (e, t) => {
|
|
168
|
-
const
|
|
169
|
-
|
|
168
|
+
const n = e.events.find((i) => i.id === t.payload.eventId);
|
|
169
|
+
n && (n.products = t.payload.products);
|
|
170
170
|
},
|
|
171
171
|
setLoadingProducts: (e, t) => {
|
|
172
172
|
e.loadingProducts[t.payload.eventId] = t.payload.loading;
|
|
@@ -180,7 +180,7 @@ const ee = {
|
|
|
180
180
|
clearEvents: Ee,
|
|
181
181
|
setEventProducts: Ie,
|
|
182
182
|
setLoadingProducts: q
|
|
183
|
-
} = le.actions, ge = le.reducer,
|
|
183
|
+
} = le.actions, ge = le.reducer, on = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
184
184
|
__proto__: null,
|
|
185
185
|
clearEvents: Ee,
|
|
186
186
|
default: ge,
|
|
@@ -193,9 +193,9 @@ const ee = {
|
|
|
193
193
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
194
194
|
var F = function() {
|
|
195
195
|
return F = Object.assign || function(t) {
|
|
196
|
-
for (var
|
|
197
|
-
|
|
198
|
-
for (var s in
|
|
196
|
+
for (var n, i = 1, r = arguments.length; i < r; i++) {
|
|
197
|
+
n = arguments[i];
|
|
198
|
+
for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
|
|
199
199
|
}
|
|
200
200
|
return t;
|
|
201
201
|
}, F.apply(this, arguments);
|
|
@@ -204,37 +204,37 @@ function B(e, t) {
|
|
|
204
204
|
if (!!!e)
|
|
205
205
|
throw new Error(t);
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function dn(e) {
|
|
208
208
|
return typeof e == "object" && e !== null;
|
|
209
209
|
}
|
|
210
|
-
function
|
|
210
|
+
function cn(e, t) {
|
|
211
211
|
if (!!!e)
|
|
212
212
|
throw new Error(
|
|
213
213
|
"Unexpected invariant triggered."
|
|
214
214
|
);
|
|
215
215
|
}
|
|
216
|
-
const
|
|
216
|
+
const un = /\r\n|[\n\r]/g;
|
|
217
217
|
function K(e, t) {
|
|
218
|
-
let
|
|
219
|
-
for (const
|
|
220
|
-
if (typeof
|
|
218
|
+
let n = 0, i = 1;
|
|
219
|
+
for (const r of e.body.matchAll(un)) {
|
|
220
|
+
if (typeof r.index == "number" || cn(!1), r.index >= t)
|
|
221
221
|
break;
|
|
222
|
-
|
|
222
|
+
n = r.index + r[0].length, i += 1;
|
|
223
223
|
}
|
|
224
224
|
return {
|
|
225
225
|
line: i,
|
|
226
|
-
column: t + 1 -
|
|
226
|
+
column: t + 1 - n
|
|
227
227
|
};
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function ln(e) {
|
|
230
230
|
return fe(
|
|
231
231
|
e.source,
|
|
232
232
|
K(e.source, e.start)
|
|
233
233
|
);
|
|
234
234
|
}
|
|
235
235
|
function fe(e, t) {
|
|
236
|
-
const
|
|
237
|
-
`, d = i.split(/\r\n|[\n\r]/g), A = d[
|
|
236
|
+
const n = e.locationOffset.column - 1, i = "".padStart(n) + e.body, r = t.line - 1, s = e.locationOffset.line - 1, o = t.line + s, c = t.line === 1 ? n : 0, l = t.column + c, E = `${e.name}:${o}:${l}
|
|
237
|
+
`, d = i.split(/\r\n|[\n\r]/g), A = d[r];
|
|
238
238
|
if (A.length > 120) {
|
|
239
239
|
const g = Math.floor(l / 80), O = l % 80, f = [];
|
|
240
240
|
for (let h = 0; h < A.length; h += 80)
|
|
@@ -248,18 +248,18 @@ function fe(e, t) {
|
|
|
248
248
|
}
|
|
249
249
|
return E + se([
|
|
250
250
|
// Lines specified like this: ["prefix", "string"],
|
|
251
|
-
[`${o - 1} |`, d[
|
|
251
|
+
[`${o - 1} |`, d[r - 1]],
|
|
252
252
|
[`${o} |`, A],
|
|
253
253
|
["|", "^".padStart(l)],
|
|
254
|
-
[`${o + 1} |`, d[
|
|
254
|
+
[`${o + 1} |`, d[r + 1]]
|
|
255
255
|
]);
|
|
256
256
|
}
|
|
257
257
|
function se(e) {
|
|
258
|
-
const t = e.filter(([i,
|
|
259
|
-
return t.map(([i,
|
|
258
|
+
const t = e.filter(([i, r]) => r !== void 0), n = Math.max(...t.map(([i]) => i.length));
|
|
259
|
+
return t.map(([i, r]) => i.padStart(n) + (r ? " " + r : "")).join(`
|
|
260
260
|
`);
|
|
261
261
|
}
|
|
262
|
-
function
|
|
262
|
+
function hn(e) {
|
|
263
263
|
const t = e[0];
|
|
264
264
|
return t == null || "kind" in t || "length" in t ? {
|
|
265
265
|
nodes: t,
|
|
@@ -309,17 +309,17 @@ class X extends Error {
|
|
|
309
309
|
/**
|
|
310
310
|
* @deprecated Please use the `GraphQLErrorOptions` constructor overload instead.
|
|
311
311
|
*/
|
|
312
|
-
constructor(t, ...
|
|
313
|
-
var i,
|
|
314
|
-
const { nodes: o, source: c, positions: l, path: E, originalError: d, extensions: A } =
|
|
312
|
+
constructor(t, ...n) {
|
|
313
|
+
var i, r, s;
|
|
314
|
+
const { nodes: o, source: c, positions: l, path: E, originalError: d, extensions: A } = hn(n);
|
|
315
315
|
super(t), this.name = "GraphQLError", this.path = E ?? void 0, this.originalError = d ?? void 0, this.nodes = ae(
|
|
316
316
|
Array.isArray(o) ? o : o ? [o] : void 0
|
|
317
317
|
);
|
|
318
318
|
const g = ae(
|
|
319
319
|
(i = this.nodes) === null || i === void 0 ? void 0 : i.map((f) => f.loc).filter((f) => f != null)
|
|
320
320
|
);
|
|
321
|
-
this.source = c ?? (g == null || (
|
|
322
|
-
const O =
|
|
321
|
+
this.source = c ?? (g == null || (r = g[0]) === null || r === void 0 ? void 0 : r.source), this.positions = l ?? g?.map((f) => f.start), this.locations = l && c ? l.map((f) => K(c, f)) : g?.map((f) => K(f.source, f.start));
|
|
322
|
+
const O = dn(
|
|
323
323
|
d?.extensions
|
|
324
324
|
) ? d?.extensions : void 0;
|
|
325
325
|
this.extensions = (s = A ?? O) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
|
|
@@ -358,15 +358,15 @@ class X extends Error {
|
|
|
358
358
|
toString() {
|
|
359
359
|
let t = this.message;
|
|
360
360
|
if (this.nodes)
|
|
361
|
-
for (const
|
|
362
|
-
|
|
361
|
+
for (const n of this.nodes)
|
|
362
|
+
n.loc && (t += `
|
|
363
363
|
|
|
364
|
-
` +
|
|
364
|
+
` + ln(n.loc));
|
|
365
365
|
else if (this.source && this.locations)
|
|
366
|
-
for (const
|
|
366
|
+
for (const n of this.locations)
|
|
367
367
|
t += `
|
|
368
368
|
|
|
369
|
-
` + fe(this.source,
|
|
369
|
+
` + fe(this.source, n);
|
|
370
370
|
return t;
|
|
371
371
|
}
|
|
372
372
|
toJSON() {
|
|
@@ -379,13 +379,13 @@ class X extends Error {
|
|
|
379
379
|
function ae(e) {
|
|
380
380
|
return e === void 0 || e.length === 0 ? void 0 : e;
|
|
381
381
|
}
|
|
382
|
-
function m(e, t,
|
|
383
|
-
return new X(`Syntax Error: ${
|
|
382
|
+
function m(e, t, n) {
|
|
383
|
+
return new X(`Syntax Error: ${n}`, {
|
|
384
384
|
source: e,
|
|
385
385
|
positions: [t]
|
|
386
386
|
});
|
|
387
387
|
}
|
|
388
|
-
class
|
|
388
|
+
class En {
|
|
389
389
|
/**
|
|
390
390
|
* The character offset at which this Node begins.
|
|
391
391
|
*/
|
|
@@ -401,8 +401,8 @@ class hr {
|
|
|
401
401
|
/**
|
|
402
402
|
* The Source document the AST represents.
|
|
403
403
|
*/
|
|
404
|
-
constructor(t,
|
|
405
|
-
this.start = t.start, this.end =
|
|
404
|
+
constructor(t, n, i) {
|
|
405
|
+
this.start = t.start, this.end = n.end, this.startToken = t, this.endToken = n, this.source = i;
|
|
406
406
|
}
|
|
407
407
|
get [Symbol.toStringTag]() {
|
|
408
408
|
return "Location";
|
|
@@ -441,8 +441,8 @@ class pe {
|
|
|
441
441
|
* including ignored tokens. <SOF> is always the first node and <EOF>
|
|
442
442
|
* the last.
|
|
443
443
|
*/
|
|
444
|
-
constructor(t,
|
|
445
|
-
this.kind = t, this.start =
|
|
444
|
+
constructor(t, n, i, r, s, o) {
|
|
445
|
+
this.kind = t, this.start = n, this.end = i, this.line = r, this.column = s, this.value = o, this.prev = null, this.next = null;
|
|
446
446
|
}
|
|
447
447
|
get [Symbol.toStringTag]() {
|
|
448
448
|
return "Token";
|
|
@@ -456,7 +456,7 @@ class pe {
|
|
|
456
456
|
};
|
|
457
457
|
}
|
|
458
458
|
}
|
|
459
|
-
const
|
|
459
|
+
const In = {
|
|
460
460
|
Name: [],
|
|
461
461
|
Document: ["definitions"],
|
|
462
462
|
OperationDefinition: [
|
|
@@ -531,7 +531,7 @@ const Er = {
|
|
|
531
531
|
EnumTypeExtension: ["name", "directives", "values"],
|
|
532
532
|
InputObjectTypeExtension: ["name", "directives", "fields"]
|
|
533
533
|
};
|
|
534
|
-
new Set(Object.keys(
|
|
534
|
+
new Set(Object.keys(In));
|
|
535
535
|
var P;
|
|
536
536
|
(function(e) {
|
|
537
537
|
e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
|
|
@@ -544,7 +544,7 @@ var u;
|
|
|
544
544
|
(function(e) {
|
|
545
545
|
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";
|
|
546
546
|
})(u || (u = {}));
|
|
547
|
-
function
|
|
547
|
+
function gn(e) {
|
|
548
548
|
return e === 9 || e === 32;
|
|
549
549
|
}
|
|
550
550
|
function S(e) {
|
|
@@ -557,25 +557,25 @@ function Ae(e) {
|
|
|
557
557
|
function me(e) {
|
|
558
558
|
return Ae(e) || e === 95;
|
|
559
559
|
}
|
|
560
|
-
function
|
|
560
|
+
function fn(e) {
|
|
561
561
|
return Ae(e) || S(e) || e === 95;
|
|
562
562
|
}
|
|
563
|
-
function
|
|
563
|
+
function pn(e) {
|
|
564
564
|
var t;
|
|
565
|
-
let
|
|
565
|
+
let n = Number.MAX_SAFE_INTEGER, i = null, r = -1;
|
|
566
566
|
for (let o = 0; o < e.length; ++o) {
|
|
567
567
|
var s;
|
|
568
|
-
const c = e[o], l =
|
|
569
|
-
l !== c.length && (i = (s = i) !== null && s !== void 0 ? s : o,
|
|
568
|
+
const c = e[o], l = An(c);
|
|
569
|
+
l !== c.length && (i = (s = i) !== null && s !== void 0 ? s : o, r = o, o !== 0 && l < n && (n = l));
|
|
570
570
|
}
|
|
571
|
-
return e.map((o, c) => c === 0 ? o : o.slice(
|
|
571
|
+
return e.map((o, c) => c === 0 ? o : o.slice(n)).slice(
|
|
572
572
|
(t = i) !== null && t !== void 0 ? t : 0,
|
|
573
|
-
|
|
573
|
+
r + 1
|
|
574
574
|
);
|
|
575
575
|
}
|
|
576
|
-
function
|
|
576
|
+
function An(e) {
|
|
577
577
|
let t = 0;
|
|
578
|
-
for (; t < e.length &&
|
|
578
|
+
for (; t < e.length && gn(e.charCodeAt(t)); )
|
|
579
579
|
++t;
|
|
580
580
|
return t;
|
|
581
581
|
}
|
|
@@ -583,7 +583,7 @@ var a;
|
|
|
583
583
|
(function(e) {
|
|
584
584
|
e.SOF = "<SOF>", e.EOF = "<EOF>", e.BANG = "!", e.DOLLAR = "$", e.AMP = "&", e.PAREN_L = "(", e.PAREN_R = ")", e.SPREAD = "...", e.COLON = ":", e.EQUALS = "=", e.AT = "@", e.BRACKET_L = "[", e.BRACKET_R = "]", e.BRACE_L = "{", e.PIPE = "|", e.BRACE_R = "}", e.NAME = "Name", e.INT = "Int", e.FLOAT = "Float", e.STRING = "String", e.BLOCK_STRING = "BlockString", e.COMMENT = "Comment";
|
|
585
585
|
})(a || (a = {}));
|
|
586
|
-
class
|
|
586
|
+
class mn {
|
|
587
587
|
/**
|
|
588
588
|
* The previously focused non-ignored token.
|
|
589
589
|
*/
|
|
@@ -597,8 +597,8 @@ class Ar {
|
|
|
597
597
|
* The character offset at which the current line begins.
|
|
598
598
|
*/
|
|
599
599
|
constructor(t) {
|
|
600
|
-
const
|
|
601
|
-
this.source = t, this.lastToken =
|
|
600
|
+
const n = new pe(a.SOF, 0, 0, 0, 0);
|
|
601
|
+
this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
|
|
602
602
|
}
|
|
603
603
|
get [Symbol.toStringTag]() {
|
|
604
604
|
return "Lexer";
|
|
@@ -620,14 +620,14 @@ class Ar {
|
|
|
620
620
|
if (t.next)
|
|
621
621
|
t = t.next;
|
|
622
622
|
else {
|
|
623
|
-
const
|
|
624
|
-
t.next =
|
|
623
|
+
const n = Tn(this, t.end);
|
|
624
|
+
t.next = n, n.prev = t, t = n;
|
|
625
625
|
}
|
|
626
626
|
while (t.kind === a.COMMENT);
|
|
627
627
|
return t;
|
|
628
628
|
}
|
|
629
629
|
}
|
|
630
|
-
function
|
|
630
|
+
function On(e) {
|
|
631
631
|
return e === a.BANG || e === a.DOLLAR || e === a.AMP || e === a.PAREN_L || e === a.PAREN_R || 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;
|
|
632
632
|
}
|
|
633
633
|
function R(e) {
|
|
@@ -643,24 +643,24 @@ function Te(e) {
|
|
|
643
643
|
return e >= 56320 && e <= 57343;
|
|
644
644
|
}
|
|
645
645
|
function v(e, t) {
|
|
646
|
-
const
|
|
647
|
-
if (
|
|
646
|
+
const n = e.source.body.codePointAt(t);
|
|
647
|
+
if (n === void 0)
|
|
648
648
|
return a.EOF;
|
|
649
|
-
if (
|
|
650
|
-
const i = String.fromCodePoint(
|
|
649
|
+
if (n >= 32 && n <= 126) {
|
|
650
|
+
const i = String.fromCodePoint(n);
|
|
651
651
|
return i === '"' ? `'"'` : `"${i}"`;
|
|
652
652
|
}
|
|
653
|
-
return "U+" +
|
|
653
|
+
return "U+" + n.toString(16).toUpperCase().padStart(4, "0");
|
|
654
654
|
}
|
|
655
|
-
function p(e, t,
|
|
656
|
-
const s = e.line, o = 1 +
|
|
657
|
-
return new pe(t,
|
|
655
|
+
function p(e, t, n, i, r) {
|
|
656
|
+
const s = e.line, o = 1 + n - e.lineStart;
|
|
657
|
+
return new pe(t, n, i, s, o, r);
|
|
658
658
|
}
|
|
659
|
-
function
|
|
660
|
-
const
|
|
661
|
-
let
|
|
662
|
-
for (;
|
|
663
|
-
const s =
|
|
659
|
+
function Tn(e, t) {
|
|
660
|
+
const n = e.source.body, i = n.length;
|
|
661
|
+
let r = t;
|
|
662
|
+
for (; r < i; ) {
|
|
663
|
+
const s = n.charCodeAt(r);
|
|
664
664
|
switch (s) {
|
|
665
665
|
// Ignored ::
|
|
666
666
|
// - UnicodeBOM
|
|
@@ -683,21 +683,21 @@ function Or(e, t) {
|
|
|
683
683
|
case 32:
|
|
684
684
|
// <space>
|
|
685
685
|
case 44:
|
|
686
|
-
++
|
|
686
|
+
++r;
|
|
687
687
|
continue;
|
|
688
688
|
// LineTerminator ::
|
|
689
689
|
// - "New Line (U+000A)"
|
|
690
690
|
// - "Carriage Return (U+000D)" [lookahead != "New Line (U+000A)"]
|
|
691
691
|
// - "Carriage Return (U+000D)" "New Line (U+000A)"
|
|
692
692
|
case 10:
|
|
693
|
-
++
|
|
693
|
+
++r, ++e.line, e.lineStart = r;
|
|
694
694
|
continue;
|
|
695
695
|
case 13:
|
|
696
|
-
|
|
696
|
+
n.charCodeAt(r + 1) === 10 ? r += 2 : ++r, ++e.line, e.lineStart = r;
|
|
697
697
|
continue;
|
|
698
698
|
// Comment
|
|
699
699
|
case 35:
|
|
700
|
-
return
|
|
700
|
+
return Nn(e, r);
|
|
701
701
|
// Token ::
|
|
702
702
|
// - Punctuator
|
|
703
703
|
// - Name
|
|
@@ -707,62 +707,62 @@ function Or(e, t) {
|
|
|
707
707
|
//
|
|
708
708
|
// Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
|
|
709
709
|
case 33:
|
|
710
|
-
return p(e, a.BANG,
|
|
710
|
+
return p(e, a.BANG, r, r + 1);
|
|
711
711
|
case 36:
|
|
712
|
-
return p(e, a.DOLLAR,
|
|
712
|
+
return p(e, a.DOLLAR, r, r + 1);
|
|
713
713
|
case 38:
|
|
714
|
-
return p(e, a.AMP,
|
|
714
|
+
return p(e, a.AMP, r, r + 1);
|
|
715
715
|
case 40:
|
|
716
|
-
return p(e, a.PAREN_L,
|
|
716
|
+
return p(e, a.PAREN_L, r, r + 1);
|
|
717
717
|
case 41:
|
|
718
|
-
return p(e, a.PAREN_R,
|
|
718
|
+
return p(e, a.PAREN_R, r, r + 1);
|
|
719
719
|
case 46:
|
|
720
|
-
if (
|
|
721
|
-
return p(e, a.SPREAD,
|
|
720
|
+
if (n.charCodeAt(r + 1) === 46 && n.charCodeAt(r + 2) === 46)
|
|
721
|
+
return p(e, a.SPREAD, r, r + 3);
|
|
722
722
|
break;
|
|
723
723
|
case 58:
|
|
724
|
-
return p(e, a.COLON,
|
|
724
|
+
return p(e, a.COLON, r, r + 1);
|
|
725
725
|
case 61:
|
|
726
|
-
return p(e, a.EQUALS,
|
|
726
|
+
return p(e, a.EQUALS, r, r + 1);
|
|
727
727
|
case 64:
|
|
728
|
-
return p(e, a.AT,
|
|
728
|
+
return p(e, a.AT, r, r + 1);
|
|
729
729
|
case 91:
|
|
730
|
-
return p(e, a.BRACKET_L,
|
|
730
|
+
return p(e, a.BRACKET_L, r, r + 1);
|
|
731
731
|
case 93:
|
|
732
|
-
return p(e, a.BRACKET_R,
|
|
732
|
+
return p(e, a.BRACKET_R, r, r + 1);
|
|
733
733
|
case 123:
|
|
734
|
-
return p(e, a.BRACE_L,
|
|
734
|
+
return p(e, a.BRACE_L, r, r + 1);
|
|
735
735
|
case 124:
|
|
736
|
-
return p(e, a.PIPE,
|
|
736
|
+
return p(e, a.PIPE, r, r + 1);
|
|
737
737
|
case 125:
|
|
738
|
-
return p(e, a.BRACE_R,
|
|
738
|
+
return p(e, a.BRACE_R, r, r + 1);
|
|
739
739
|
// StringValue
|
|
740
740
|
case 34:
|
|
741
|
-
return
|
|
741
|
+
return n.charCodeAt(r + 1) === 34 && n.charCodeAt(r + 2) === 34 ? Ln(e, r) : _n(e, r);
|
|
742
742
|
}
|
|
743
743
|
if (S(s) || s === 45)
|
|
744
|
-
return
|
|
744
|
+
return Dn(e, r, s);
|
|
745
745
|
if (me(s))
|
|
746
|
-
return
|
|
746
|
+
return kn(e, r);
|
|
747
747
|
throw m(
|
|
748
748
|
e.source,
|
|
749
|
-
|
|
750
|
-
s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : R(s) || V(
|
|
749
|
+
r,
|
|
750
|
+
s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : R(s) || V(n, r) ? `Unexpected character: ${v(e, r)}.` : `Invalid character: ${v(e, r)}.`
|
|
751
751
|
);
|
|
752
752
|
}
|
|
753
753
|
return p(e, a.EOF, i, i);
|
|
754
754
|
}
|
|
755
|
-
function
|
|
756
|
-
const
|
|
757
|
-
let
|
|
758
|
-
for (;
|
|
759
|
-
const s =
|
|
755
|
+
function Nn(e, t) {
|
|
756
|
+
const n = e.source.body, i = n.length;
|
|
757
|
+
let r = t + 1;
|
|
758
|
+
for (; r < i; ) {
|
|
759
|
+
const s = n.charCodeAt(r);
|
|
760
760
|
if (s === 10 || s === 13)
|
|
761
761
|
break;
|
|
762
762
|
if (R(s))
|
|
763
|
-
++
|
|
764
|
-
else if (V(
|
|
765
|
-
|
|
763
|
+
++r;
|
|
764
|
+
else if (V(n, r))
|
|
765
|
+
r += 2;
|
|
766
766
|
else
|
|
767
767
|
break;
|
|
768
768
|
}
|
|
@@ -770,44 +770,44 @@ function Tr(e, t) {
|
|
|
770
770
|
e,
|
|
771
771
|
a.COMMENT,
|
|
772
772
|
t,
|
|
773
|
-
|
|
774
|
-
|
|
773
|
+
r,
|
|
774
|
+
n.slice(t + 1, r)
|
|
775
775
|
);
|
|
776
776
|
}
|
|
777
|
-
function
|
|
777
|
+
function Dn(e, t, n) {
|
|
778
778
|
const i = e.source.body;
|
|
779
|
-
let
|
|
780
|
-
if (s === 45 && (s = i.charCodeAt(++
|
|
781
|
-
if (s = i.charCodeAt(++
|
|
779
|
+
let r = t, s = n, o = !1;
|
|
780
|
+
if (s === 45 && (s = i.charCodeAt(++r)), s === 48) {
|
|
781
|
+
if (s = i.charCodeAt(++r), S(s))
|
|
782
782
|
throw m(
|
|
783
783
|
e.source,
|
|
784
|
-
|
|
784
|
+
r,
|
|
785
785
|
`Invalid number, unexpected digit after 0: ${v(
|
|
786
786
|
e,
|
|
787
|
-
|
|
787
|
+
r
|
|
788
788
|
)}.`
|
|
789
789
|
);
|
|
790
790
|
} else
|
|
791
|
-
|
|
792
|
-
if (s === 46 && (o = !0, s = i.charCodeAt(++
|
|
791
|
+
r = G(e, r, s), s = i.charCodeAt(r);
|
|
792
|
+
if (s === 46 && (o = !0, s = i.charCodeAt(++r), r = G(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 = G(e, r, s), s = i.charCodeAt(r)), s === 46 || me(s))
|
|
793
793
|
throw m(
|
|
794
794
|
e.source,
|
|
795
|
-
|
|
795
|
+
r,
|
|
796
796
|
`Invalid number, expected digit but got: ${v(
|
|
797
797
|
e,
|
|
798
|
-
|
|
798
|
+
r
|
|
799
799
|
)}.`
|
|
800
800
|
);
|
|
801
801
|
return p(
|
|
802
802
|
e,
|
|
803
803
|
o ? a.FLOAT : a.INT,
|
|
804
804
|
t,
|
|
805
|
-
|
|
806
|
-
i.slice(t,
|
|
805
|
+
r,
|
|
806
|
+
i.slice(t, r)
|
|
807
807
|
);
|
|
808
808
|
}
|
|
809
|
-
function G(e, t,
|
|
810
|
-
if (!S(
|
|
809
|
+
function G(e, t, n) {
|
|
810
|
+
if (!S(n))
|
|
811
811
|
throw m(
|
|
812
812
|
e.source,
|
|
813
813
|
t,
|
|
@@ -817,53 +817,53 @@ function G(e, t, r) {
|
|
|
817
817
|
)}.`
|
|
818
818
|
);
|
|
819
819
|
const i = e.source.body;
|
|
820
|
-
let
|
|
821
|
-
for (; S(i.charCodeAt(
|
|
822
|
-
++
|
|
823
|
-
return
|
|
824
|
-
}
|
|
825
|
-
function
|
|
826
|
-
const
|
|
827
|
-
let
|
|
828
|
-
for (;
|
|
829
|
-
const c =
|
|
820
|
+
let r = t + 1;
|
|
821
|
+
for (; S(i.charCodeAt(r)); )
|
|
822
|
+
++r;
|
|
823
|
+
return r;
|
|
824
|
+
}
|
|
825
|
+
function _n(e, t) {
|
|
826
|
+
const n = e.source.body, i = n.length;
|
|
827
|
+
let r = t + 1, s = r, o = "";
|
|
828
|
+
for (; r < i; ) {
|
|
829
|
+
const c = n.charCodeAt(r);
|
|
830
830
|
if (c === 34)
|
|
831
|
-
return o +=
|
|
831
|
+
return o += n.slice(s, r), p(e, a.STRING, t, r + 1, o);
|
|
832
832
|
if (c === 92) {
|
|
833
|
-
o +=
|
|
834
|
-
const l =
|
|
835
|
-
o += l.value,
|
|
833
|
+
o += n.slice(s, r);
|
|
834
|
+
const l = n.charCodeAt(r + 1) === 117 ? n.charCodeAt(r + 2) === 123 ? vn(e, r) : Pn(e, r) : Rn(e, r);
|
|
835
|
+
o += l.value, r += l.size, s = r;
|
|
836
836
|
continue;
|
|
837
837
|
}
|
|
838
838
|
if (c === 10 || c === 13)
|
|
839
839
|
break;
|
|
840
840
|
if (R(c))
|
|
841
|
-
++
|
|
842
|
-
else if (V(
|
|
843
|
-
|
|
841
|
+
++r;
|
|
842
|
+
else if (V(n, r))
|
|
843
|
+
r += 2;
|
|
844
844
|
else
|
|
845
845
|
throw m(
|
|
846
846
|
e.source,
|
|
847
|
-
|
|
847
|
+
r,
|
|
848
848
|
`Invalid character within String: ${v(
|
|
849
849
|
e,
|
|
850
|
-
|
|
850
|
+
r
|
|
851
851
|
)}.`
|
|
852
852
|
);
|
|
853
853
|
}
|
|
854
|
-
throw m(e.source,
|
|
854
|
+
throw m(e.source, r, "Unterminated string.");
|
|
855
855
|
}
|
|
856
|
-
function
|
|
857
|
-
const
|
|
858
|
-
let i = 0,
|
|
859
|
-
for (;
|
|
860
|
-
const s =
|
|
856
|
+
function vn(e, t) {
|
|
857
|
+
const n = e.source.body;
|
|
858
|
+
let i = 0, r = 3;
|
|
859
|
+
for (; r < 12; ) {
|
|
860
|
+
const s = n.charCodeAt(t + r++);
|
|
861
861
|
if (s === 125) {
|
|
862
|
-
if (
|
|
862
|
+
if (r < 5 || !R(i))
|
|
863
863
|
break;
|
|
864
864
|
return {
|
|
865
865
|
value: String.fromCodePoint(i),
|
|
866
|
-
size:
|
|
866
|
+
size: r
|
|
867
867
|
};
|
|
868
868
|
}
|
|
869
869
|
if (i = i << 4 | k(s), i < 0)
|
|
@@ -872,31 +872,31 @@ function _r(e, t) {
|
|
|
872
872
|
throw m(
|
|
873
873
|
e.source,
|
|
874
874
|
t,
|
|
875
|
-
`Invalid Unicode escape sequence: "${
|
|
875
|
+
`Invalid Unicode escape sequence: "${n.slice(
|
|
876
876
|
t,
|
|
877
|
-
t +
|
|
877
|
+
t + r
|
|
878
878
|
)}".`
|
|
879
879
|
);
|
|
880
880
|
}
|
|
881
|
-
function
|
|
882
|
-
const
|
|
881
|
+
function Pn(e, t) {
|
|
882
|
+
const n = e.source.body, i = oe(n, t + 2);
|
|
883
883
|
if (R(i))
|
|
884
884
|
return {
|
|
885
885
|
value: String.fromCodePoint(i),
|
|
886
886
|
size: 6
|
|
887
887
|
};
|
|
888
|
-
if (Oe(i) &&
|
|
889
|
-
const
|
|
890
|
-
if (Te(
|
|
888
|
+
if (Oe(i) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
|
|
889
|
+
const r = oe(n, t + 8);
|
|
890
|
+
if (Te(r))
|
|
891
891
|
return {
|
|
892
|
-
value: String.fromCodePoint(i,
|
|
892
|
+
value: String.fromCodePoint(i, r),
|
|
893
893
|
size: 12
|
|
894
894
|
};
|
|
895
895
|
}
|
|
896
896
|
throw m(
|
|
897
897
|
e.source,
|
|
898
898
|
t,
|
|
899
|
-
`Invalid Unicode escape sequence: "${
|
|
899
|
+
`Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`
|
|
900
900
|
);
|
|
901
901
|
}
|
|
902
902
|
function oe(e, t) {
|
|
@@ -905,9 +905,9 @@ function oe(e, t) {
|
|
|
905
905
|
function k(e) {
|
|
906
906
|
return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
|
|
907
907
|
}
|
|
908
|
-
function
|
|
909
|
-
const
|
|
910
|
-
switch (
|
|
908
|
+
function Rn(e, t) {
|
|
909
|
+
const n = e.source.body;
|
|
910
|
+
switch (n.charCodeAt(t + 1)) {
|
|
911
911
|
case 34:
|
|
912
912
|
return {
|
|
913
913
|
value: '"',
|
|
@@ -953,42 +953,42 @@ function Pr(e, t) {
|
|
|
953
953
|
throw m(
|
|
954
954
|
e.source,
|
|
955
955
|
t,
|
|
956
|
-
`Invalid character escape sequence: "${
|
|
956
|
+
`Invalid character escape sequence: "${n.slice(
|
|
957
957
|
t,
|
|
958
958
|
t + 2
|
|
959
959
|
)}".`
|
|
960
960
|
);
|
|
961
961
|
}
|
|
962
|
-
function
|
|
963
|
-
const
|
|
964
|
-
let
|
|
962
|
+
function Ln(e, t) {
|
|
963
|
+
const n = e.source.body, i = n.length;
|
|
964
|
+
let r = e.lineStart, s = t + 3, o = s, c = "";
|
|
965
965
|
const l = [];
|
|
966
966
|
for (; s < i; ) {
|
|
967
|
-
const E =
|
|
968
|
-
if (E === 34 &&
|
|
969
|
-
c +=
|
|
967
|
+
const E = n.charCodeAt(s);
|
|
968
|
+
if (E === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
|
|
969
|
+
c += n.slice(o, s), l.push(c);
|
|
970
970
|
const d = p(
|
|
971
971
|
e,
|
|
972
972
|
a.BLOCK_STRING,
|
|
973
973
|
t,
|
|
974
974
|
s + 3,
|
|
975
975
|
// Return a string of the lines joined with U+000A.
|
|
976
|
-
|
|
976
|
+
pn(l).join(`
|
|
977
977
|
`)
|
|
978
978
|
);
|
|
979
|
-
return e.line += l.length - 1, e.lineStart =
|
|
979
|
+
return e.line += l.length - 1, e.lineStart = r, d;
|
|
980
980
|
}
|
|
981
|
-
if (E === 92 &&
|
|
982
|
-
c +=
|
|
981
|
+
if (E === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
|
|
982
|
+
c += n.slice(o, s), o = s + 1, s += 4;
|
|
983
983
|
continue;
|
|
984
984
|
}
|
|
985
985
|
if (E === 10 || E === 13) {
|
|
986
|
-
c +=
|
|
986
|
+
c += n.slice(o, s), l.push(c), E === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, c = "", o = s, r = s;
|
|
987
987
|
continue;
|
|
988
988
|
}
|
|
989
989
|
if (R(E))
|
|
990
990
|
++s;
|
|
991
|
-
else if (V(
|
|
991
|
+
else if (V(n, s))
|
|
992
992
|
s += 2;
|
|
993
993
|
else
|
|
994
994
|
throw m(
|
|
@@ -1002,13 +1002,13 @@ function Rr(e, t) {
|
|
|
1002
1002
|
}
|
|
1003
1003
|
throw m(e.source, s, "Unterminated string.");
|
|
1004
1004
|
}
|
|
1005
|
-
function
|
|
1006
|
-
const
|
|
1007
|
-
let
|
|
1008
|
-
for (;
|
|
1009
|
-
const s =
|
|
1010
|
-
if (
|
|
1011
|
-
++
|
|
1005
|
+
function kn(e, t) {
|
|
1006
|
+
const n = e.source.body, i = n.length;
|
|
1007
|
+
let r = t + 1;
|
|
1008
|
+
for (; r < i; ) {
|
|
1009
|
+
const s = n.charCodeAt(r);
|
|
1010
|
+
if (fn(s))
|
|
1011
|
+
++r;
|
|
1012
1012
|
else
|
|
1013
1013
|
break;
|
|
1014
1014
|
}
|
|
@@ -1016,11 +1016,11 @@ function Lr(e, t) {
|
|
|
1016
1016
|
e,
|
|
1017
1017
|
a.NAME,
|
|
1018
1018
|
t,
|
|
1019
|
-
|
|
1020
|
-
|
|
1019
|
+
r,
|
|
1020
|
+
n.slice(t, r)
|
|
1021
1021
|
);
|
|
1022
1022
|
}
|
|
1023
|
-
const
|
|
1023
|
+
const Sn = 10, Ne = 2;
|
|
1024
1024
|
function De(e) {
|
|
1025
1025
|
return w(e, []);
|
|
1026
1026
|
}
|
|
@@ -1031,71 +1031,71 @@ function w(e, t) {
|
|
|
1031
1031
|
case "function":
|
|
1032
1032
|
return e.name ? `[function ${e.name}]` : "[function]";
|
|
1033
1033
|
case "object":
|
|
1034
|
-
return
|
|
1034
|
+
return Cn(e, t);
|
|
1035
1035
|
default:
|
|
1036
1036
|
return String(e);
|
|
1037
1037
|
}
|
|
1038
1038
|
}
|
|
1039
|
-
function
|
|
1039
|
+
function Cn(e, t) {
|
|
1040
1040
|
if (e === null)
|
|
1041
1041
|
return "null";
|
|
1042
1042
|
if (t.includes(e))
|
|
1043
1043
|
return "[Circular]";
|
|
1044
|
-
const
|
|
1045
|
-
if (
|
|
1044
|
+
const n = [...t, e];
|
|
1045
|
+
if (xn(e)) {
|
|
1046
1046
|
const i = e.toJSON();
|
|
1047
1047
|
if (i !== e)
|
|
1048
|
-
return typeof i == "string" ? i : w(i,
|
|
1048
|
+
return typeof i == "string" ? i : w(i, n);
|
|
1049
1049
|
} else if (Array.isArray(e))
|
|
1050
|
-
return
|
|
1051
|
-
return
|
|
1050
|
+
return Fn(e, n);
|
|
1051
|
+
return bn(e, n);
|
|
1052
1052
|
}
|
|
1053
|
-
function
|
|
1053
|
+
function xn(e) {
|
|
1054
1054
|
return typeof e.toJSON == "function";
|
|
1055
1055
|
}
|
|
1056
|
-
function
|
|
1057
|
-
const
|
|
1058
|
-
return
|
|
1059
|
-
([
|
|
1056
|
+
function bn(e, t) {
|
|
1057
|
+
const n = Object.entries(e);
|
|
1058
|
+
return n.length === 0 ? "{}" : t.length > Ne ? "[" + yn(e) + "]" : "{ " + n.map(
|
|
1059
|
+
([r, s]) => r + ": " + w(s, t)
|
|
1060
1060
|
).join(", ") + " }";
|
|
1061
1061
|
}
|
|
1062
|
-
function
|
|
1062
|
+
function Fn(e, t) {
|
|
1063
1063
|
if (e.length === 0)
|
|
1064
1064
|
return "[]";
|
|
1065
1065
|
if (t.length > Ne)
|
|
1066
1066
|
return "[Array]";
|
|
1067
|
-
const
|
|
1068
|
-
for (let s = 0; s <
|
|
1069
|
-
|
|
1070
|
-
return i === 1 ?
|
|
1067
|
+
const n = Math.min(Sn, e.length), i = e.length - n, r = [];
|
|
1068
|
+
for (let s = 0; s < n; ++s)
|
|
1069
|
+
r.push(w(e[s], t));
|
|
1070
|
+
return i === 1 ? r.push("... 1 more item") : i > 1 && r.push(`... ${i} more items`), "[" + r.join(", ") + "]";
|
|
1071
1071
|
}
|
|
1072
|
-
function
|
|
1072
|
+
function yn(e) {
|
|
1073
1073
|
const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
|
|
1074
1074
|
if (t === "Object" && typeof e.constructor == "function") {
|
|
1075
|
-
const
|
|
1076
|
-
if (typeof
|
|
1077
|
-
return
|
|
1075
|
+
const n = e.constructor.name;
|
|
1076
|
+
if (typeof n == "string" && n !== "")
|
|
1077
|
+
return n;
|
|
1078
1078
|
}
|
|
1079
1079
|
return t;
|
|
1080
1080
|
}
|
|
1081
|
-
const
|
|
1082
|
-
process.env.NODE_ENV === "production",
|
|
1081
|
+
const Un = globalThis.process && // eslint-disable-next-line no-undef
|
|
1082
|
+
process.env.NODE_ENV === "production", Mn = (
|
|
1083
1083
|
/* c8 ignore next 6 */
|
|
1084
1084
|
// FIXME: https://github.com/graphql/graphql-js/issues/2317
|
|
1085
|
-
|
|
1086
|
-
return t instanceof
|
|
1087
|
-
} : function(t,
|
|
1088
|
-
if (t instanceof
|
|
1085
|
+
Un ? function(t, n) {
|
|
1086
|
+
return t instanceof n;
|
|
1087
|
+
} : function(t, n) {
|
|
1088
|
+
if (t instanceof n)
|
|
1089
1089
|
return !0;
|
|
1090
1090
|
if (typeof t == "object" && t !== null) {
|
|
1091
1091
|
var i;
|
|
1092
|
-
const
|
|
1092
|
+
const r = n.prototype[Symbol.toStringTag], s = (
|
|
1093
1093
|
// We still need to support constructor's name to detect conflicts with older versions of this library.
|
|
1094
1094
|
Symbol.toStringTag in t ? t[Symbol.toStringTag] : (i = t.constructor) === null || i === void 0 ? void 0 : i.name
|
|
1095
1095
|
);
|
|
1096
|
-
if (
|
|
1096
|
+
if (r === s) {
|
|
1097
1097
|
const o = De(t);
|
|
1098
|
-
throw new Error(`Cannot use ${
|
|
1098
|
+
throw new Error(`Cannot use ${r} "${o}" from another module or realm.
|
|
1099
1099
|
|
|
1100
1100
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
1101
1101
|
directory. If different versions of "graphql" are the dependencies of other
|
|
@@ -1113,11 +1113,11 @@ spurious results.`);
|
|
|
1113
1113
|
}
|
|
1114
1114
|
);
|
|
1115
1115
|
class _e {
|
|
1116
|
-
constructor(t,
|
|
1116
|
+
constructor(t, n = "GraphQL request", i = {
|
|
1117
1117
|
line: 1,
|
|
1118
1118
|
column: 1
|
|
1119
1119
|
}) {
|
|
1120
|
-
typeof t == "string" || B(!1, `Body must be a string. Received: ${De(t)}.`), this.body = t, this.name =
|
|
1120
|
+
typeof t == "string" || B(!1, `Body must be a string. Received: ${De(t)}.`), this.body = t, this.name = n, this.locationOffset = i, this.locationOffset.line > 0 || B(
|
|
1121
1121
|
!1,
|
|
1122
1122
|
"line in locationOffset is 1-indexed and must be positive."
|
|
1123
1123
|
), this.locationOffset.column > 0 || B(
|
|
@@ -1129,20 +1129,20 @@ class _e {
|
|
|
1129
1129
|
return "Source";
|
|
1130
1130
|
}
|
|
1131
1131
|
}
|
|
1132
|
-
function
|
|
1133
|
-
return
|
|
1132
|
+
function Vn(e) {
|
|
1133
|
+
return Mn(e, _e);
|
|
1134
1134
|
}
|
|
1135
|
-
function
|
|
1136
|
-
const
|
|
1135
|
+
function wn(e, t) {
|
|
1136
|
+
const n = new $n(e, t), i = n.parseDocument();
|
|
1137
1137
|
return Object.defineProperty(i, "tokenCount", {
|
|
1138
1138
|
enumerable: !1,
|
|
1139
|
-
value:
|
|
1139
|
+
value: n.tokenCount
|
|
1140
1140
|
}), i;
|
|
1141
1141
|
}
|
|
1142
|
-
class
|
|
1143
|
-
constructor(t,
|
|
1144
|
-
const i =
|
|
1145
|
-
this._lexer = new
|
|
1142
|
+
class $n {
|
|
1143
|
+
constructor(t, n = {}) {
|
|
1144
|
+
const i = Vn(t) ? t : new _e(t);
|
|
1145
|
+
this._lexer = new mn(i), this._options = n, this._tokenCounter = 0;
|
|
1146
1146
|
}
|
|
1147
1147
|
get tokenCount() {
|
|
1148
1148
|
return this._tokenCounter;
|
|
@@ -1197,9 +1197,9 @@ class wr {
|
|
|
1197
1197
|
parseDefinition() {
|
|
1198
1198
|
if (this.peek(a.BRACE_L))
|
|
1199
1199
|
return this.parseOperationDefinition();
|
|
1200
|
-
const t = this.peekDescription(),
|
|
1201
|
-
if (
|
|
1202
|
-
switch (
|
|
1200
|
+
const t = this.peekDescription(), n = t ? this._lexer.lookahead() : this._lexer.token;
|
|
1201
|
+
if (n.kind === a.NAME) {
|
|
1202
|
+
switch (n.value) {
|
|
1203
1203
|
case "schema":
|
|
1204
1204
|
return this.parseSchemaDefinition();
|
|
1205
1205
|
case "scalar":
|
|
@@ -1223,7 +1223,7 @@ class wr {
|
|
|
1223
1223
|
this._lexer.token.start,
|
|
1224
1224
|
"Unexpected description, descriptions are supported only on type definitions."
|
|
1225
1225
|
);
|
|
1226
|
-
switch (
|
|
1226
|
+
switch (n.value) {
|
|
1227
1227
|
case "query":
|
|
1228
1228
|
case "mutation":
|
|
1229
1229
|
case "subscription":
|
|
@@ -1234,7 +1234,7 @@ class wr {
|
|
|
1234
1234
|
return this.parseTypeSystemExtension();
|
|
1235
1235
|
}
|
|
1236
1236
|
}
|
|
1237
|
-
throw this.unexpected(
|
|
1237
|
+
throw this.unexpected(n);
|
|
1238
1238
|
}
|
|
1239
1239
|
// Implements the parsing rules in the Operations section.
|
|
1240
1240
|
/**
|
|
@@ -1253,11 +1253,11 @@ class wr {
|
|
|
1253
1253
|
directives: [],
|
|
1254
1254
|
selectionSet: this.parseSelectionSet()
|
|
1255
1255
|
});
|
|
1256
|
-
const
|
|
1256
|
+
const n = this.parseOperationType();
|
|
1257
1257
|
let i;
|
|
1258
1258
|
return this.peek(a.NAME) && (i = this.parseName()), this.node(t, {
|
|
1259
1259
|
kind: u.OPERATION_DEFINITION,
|
|
1260
|
-
operation:
|
|
1260
|
+
operation: n,
|
|
1261
1261
|
name: i,
|
|
1262
1262
|
variableDefinitions: this.parseVariableDefinitions(),
|
|
1263
1263
|
directives: this.parseDirectives(!1),
|
|
@@ -1341,12 +1341,12 @@ class wr {
|
|
|
1341
1341
|
* Alias : Name :
|
|
1342
1342
|
*/
|
|
1343
1343
|
parseField() {
|
|
1344
|
-
const t = this._lexer.token,
|
|
1345
|
-
let i,
|
|
1346
|
-
return this.expectOptionalToken(a.COLON) ? (i =
|
|
1344
|
+
const t = this._lexer.token, n = this.parseName();
|
|
1345
|
+
let i, r;
|
|
1346
|
+
return this.expectOptionalToken(a.COLON) ? (i = n, r = this.parseName()) : r = n, this.node(t, {
|
|
1347
1347
|
kind: u.FIELD,
|
|
1348
1348
|
alias: i,
|
|
1349
|
-
name:
|
|
1349
|
+
name: r,
|
|
1350
1350
|
arguments: this.parseArguments(!1),
|
|
1351
1351
|
directives: this.parseDirectives(!1),
|
|
1352
1352
|
selectionSet: this.peek(a.BRACE_L) ? this.parseSelectionSet() : void 0
|
|
@@ -1356,15 +1356,15 @@ class wr {
|
|
|
1356
1356
|
* Arguments[Const] : ( Argument[?Const]+ )
|
|
1357
1357
|
*/
|
|
1358
1358
|
parseArguments(t) {
|
|
1359
|
-
const
|
|
1360
|
-
return this.optionalMany(a.PAREN_L,
|
|
1359
|
+
const n = t ? this.parseConstArgument : this.parseArgument;
|
|
1360
|
+
return this.optionalMany(a.PAREN_L, n, a.PAREN_R);
|
|
1361
1361
|
}
|
|
1362
1362
|
/**
|
|
1363
1363
|
* Argument[Const] : Name : Value[?Const]
|
|
1364
1364
|
*/
|
|
1365
1365
|
parseArgument(t = !1) {
|
|
1366
|
-
const
|
|
1367
|
-
return this.expectToken(a.COLON), this.node(
|
|
1366
|
+
const n = this._lexer.token, i = this.parseName();
|
|
1367
|
+
return this.expectToken(a.COLON), this.node(n, {
|
|
1368
1368
|
kind: u.ARGUMENT,
|
|
1369
1369
|
name: i,
|
|
1370
1370
|
value: this.parseValueLiteral(t)
|
|
@@ -1384,14 +1384,14 @@ class wr {
|
|
|
1384
1384
|
parseFragment() {
|
|
1385
1385
|
const t = this._lexer.token;
|
|
1386
1386
|
this.expectToken(a.SPREAD);
|
|
1387
|
-
const
|
|
1388
|
-
return !
|
|
1387
|
+
const n = this.expectOptionalKeyword("on");
|
|
1388
|
+
return !n && this.peek(a.NAME) ? this.node(t, {
|
|
1389
1389
|
kind: u.FRAGMENT_SPREAD,
|
|
1390
1390
|
name: this.parseFragmentName(),
|
|
1391
1391
|
directives: this.parseDirectives(!1)
|
|
1392
1392
|
}) : this.node(t, {
|
|
1393
1393
|
kind: u.INLINE_FRAGMENT,
|
|
1394
|
-
typeCondition:
|
|
1394
|
+
typeCondition: n ? this.parseNamedType() : void 0,
|
|
1395
1395
|
directives: this.parseDirectives(!1),
|
|
1396
1396
|
selectionSet: this.parseSelectionSet()
|
|
1397
1397
|
});
|
|
@@ -1447,45 +1447,45 @@ class wr {
|
|
|
1447
1447
|
* EnumValue : Name but not `true`, `false` or `null`
|
|
1448
1448
|
*/
|
|
1449
1449
|
parseValueLiteral(t) {
|
|
1450
|
-
const
|
|
1451
|
-
switch (
|
|
1450
|
+
const n = this._lexer.token;
|
|
1451
|
+
switch (n.kind) {
|
|
1452
1452
|
case a.BRACKET_L:
|
|
1453
1453
|
return this.parseList(t);
|
|
1454
1454
|
case a.BRACE_L:
|
|
1455
1455
|
return this.parseObject(t);
|
|
1456
1456
|
case a.INT:
|
|
1457
|
-
return this.advanceLexer(), this.node(
|
|
1457
|
+
return this.advanceLexer(), this.node(n, {
|
|
1458
1458
|
kind: u.INT,
|
|
1459
|
-
value:
|
|
1459
|
+
value: n.value
|
|
1460
1460
|
});
|
|
1461
1461
|
case a.FLOAT:
|
|
1462
|
-
return this.advanceLexer(), this.node(
|
|
1462
|
+
return this.advanceLexer(), this.node(n, {
|
|
1463
1463
|
kind: u.FLOAT,
|
|
1464
|
-
value:
|
|
1464
|
+
value: n.value
|
|
1465
1465
|
});
|
|
1466
1466
|
case a.STRING:
|
|
1467
1467
|
case a.BLOCK_STRING:
|
|
1468
1468
|
return this.parseStringLiteral();
|
|
1469
1469
|
case a.NAME:
|
|
1470
|
-
switch (this.advanceLexer(),
|
|
1470
|
+
switch (this.advanceLexer(), n.value) {
|
|
1471
1471
|
case "true":
|
|
1472
|
-
return this.node(
|
|
1472
|
+
return this.node(n, {
|
|
1473
1473
|
kind: u.BOOLEAN,
|
|
1474
1474
|
value: !0
|
|
1475
1475
|
});
|
|
1476
1476
|
case "false":
|
|
1477
|
-
return this.node(
|
|
1477
|
+
return this.node(n, {
|
|
1478
1478
|
kind: u.BOOLEAN,
|
|
1479
1479
|
value: !1
|
|
1480
1480
|
});
|
|
1481
1481
|
case "null":
|
|
1482
|
-
return this.node(
|
|
1482
|
+
return this.node(n, {
|
|
1483
1483
|
kind: u.NULL
|
|
1484
1484
|
});
|
|
1485
1485
|
default:
|
|
1486
|
-
return this.node(
|
|
1486
|
+
return this.node(n, {
|
|
1487
1487
|
kind: u.ENUM,
|
|
1488
|
-
value:
|
|
1488
|
+
value: n.value
|
|
1489
1489
|
});
|
|
1490
1490
|
}
|
|
1491
1491
|
case a.DOLLAR:
|
|
@@ -1494,11 +1494,11 @@ class wr {
|
|
|
1494
1494
|
const i = this._lexer.token.value;
|
|
1495
1495
|
throw m(
|
|
1496
1496
|
this._lexer.source,
|
|
1497
|
-
|
|
1497
|
+
n.start,
|
|
1498
1498
|
`Unexpected variable "$${i}" in constant value.`
|
|
1499
1499
|
);
|
|
1500
1500
|
} else
|
|
1501
|
-
throw this.unexpected(
|
|
1501
|
+
throw this.unexpected(n);
|
|
1502
1502
|
return this.parseVariable();
|
|
1503
1503
|
default:
|
|
1504
1504
|
throw this.unexpected();
|
|
@@ -1521,10 +1521,10 @@ class wr {
|
|
|
1521
1521
|
* - [ Value[?Const]+ ]
|
|
1522
1522
|
*/
|
|
1523
1523
|
parseList(t) {
|
|
1524
|
-
const
|
|
1524
|
+
const n = () => this.parseValueLiteral(t);
|
|
1525
1525
|
return this.node(this._lexer.token, {
|
|
1526
1526
|
kind: u.LIST,
|
|
1527
|
-
values: this.any(a.BRACKET_L,
|
|
1527
|
+
values: this.any(a.BRACKET_L, n, a.BRACKET_R)
|
|
1528
1528
|
});
|
|
1529
1529
|
}
|
|
1530
1530
|
/**
|
|
@@ -1535,18 +1535,18 @@ class wr {
|
|
|
1535
1535
|
* ```
|
|
1536
1536
|
*/
|
|
1537
1537
|
parseObject(t) {
|
|
1538
|
-
const
|
|
1538
|
+
const n = () => this.parseObjectField(t);
|
|
1539
1539
|
return this.node(this._lexer.token, {
|
|
1540
1540
|
kind: u.OBJECT,
|
|
1541
|
-
fields: this.any(a.BRACE_L,
|
|
1541
|
+
fields: this.any(a.BRACE_L, n, a.BRACE_R)
|
|
1542
1542
|
});
|
|
1543
1543
|
}
|
|
1544
1544
|
/**
|
|
1545
1545
|
* ObjectField[Const] : Name : Value[?Const]
|
|
1546
1546
|
*/
|
|
1547
1547
|
parseObjectField(t) {
|
|
1548
|
-
const
|
|
1549
|
-
return this.expectToken(a.COLON), this.node(
|
|
1548
|
+
const n = this._lexer.token, i = this.parseName();
|
|
1549
|
+
return this.expectToken(a.COLON), this.node(n, {
|
|
1550
1550
|
kind: u.OBJECT_FIELD,
|
|
1551
1551
|
name: i,
|
|
1552
1552
|
value: this.parseValueLiteral(t)
|
|
@@ -1557,10 +1557,10 @@ class wr {
|
|
|
1557
1557
|
* Directives[Const] : Directive[?Const]+
|
|
1558
1558
|
*/
|
|
1559
1559
|
parseDirectives(t) {
|
|
1560
|
-
const
|
|
1560
|
+
const n = [];
|
|
1561
1561
|
for (; this.peek(a.AT); )
|
|
1562
|
-
|
|
1563
|
-
return
|
|
1562
|
+
n.push(this.parseDirective(t));
|
|
1563
|
+
return n;
|
|
1564
1564
|
}
|
|
1565
1565
|
parseConstDirectives() {
|
|
1566
1566
|
return this.parseDirectives(!0);
|
|
@@ -1571,8 +1571,8 @@ class wr {
|
|
|
1571
1571
|
* ```
|
|
1572
1572
|
*/
|
|
1573
1573
|
parseDirective(t) {
|
|
1574
|
-
const
|
|
1575
|
-
return this.expectToken(a.AT), this.node(
|
|
1574
|
+
const n = this._lexer.token;
|
|
1575
|
+
return this.expectToken(a.AT), this.node(n, {
|
|
1576
1576
|
kind: u.DIRECTIVE,
|
|
1577
1577
|
name: this.parseName(),
|
|
1578
1578
|
arguments: this.parseArguments(t)
|
|
@@ -1587,19 +1587,19 @@ class wr {
|
|
|
1587
1587
|
*/
|
|
1588
1588
|
parseTypeReference() {
|
|
1589
1589
|
const t = this._lexer.token;
|
|
1590
|
-
let
|
|
1590
|
+
let n;
|
|
1591
1591
|
if (this.expectOptionalToken(a.BRACKET_L)) {
|
|
1592
1592
|
const i = this.parseTypeReference();
|
|
1593
|
-
this.expectToken(a.BRACKET_R),
|
|
1593
|
+
this.expectToken(a.BRACKET_R), n = this.node(t, {
|
|
1594
1594
|
kind: u.LIST_TYPE,
|
|
1595
1595
|
type: i
|
|
1596
1596
|
});
|
|
1597
1597
|
} else
|
|
1598
|
-
|
|
1598
|
+
n = this.parseNamedType();
|
|
1599
1599
|
return this.expectOptionalToken(a.BANG) ? this.node(t, {
|
|
1600
1600
|
kind: u.NON_NULL_TYPE,
|
|
1601
|
-
type:
|
|
1602
|
-
}) :
|
|
1601
|
+
type: n
|
|
1602
|
+
}) : n;
|
|
1603
1603
|
}
|
|
1604
1604
|
/**
|
|
1605
1605
|
* NamedType : Name
|
|
@@ -1627,30 +1627,30 @@ class wr {
|
|
|
1627
1627
|
* ```
|
|
1628
1628
|
*/
|
|
1629
1629
|
parseSchemaDefinition() {
|
|
1630
|
-
const t = this._lexer.token,
|
|
1630
|
+
const t = this._lexer.token, n = this.parseDescription();
|
|
1631
1631
|
this.expectKeyword("schema");
|
|
1632
|
-
const i = this.parseConstDirectives(),
|
|
1632
|
+
const i = this.parseConstDirectives(), r = this.many(
|
|
1633
1633
|
a.BRACE_L,
|
|
1634
1634
|
this.parseOperationTypeDefinition,
|
|
1635
1635
|
a.BRACE_R
|
|
1636
1636
|
);
|
|
1637
1637
|
return this.node(t, {
|
|
1638
1638
|
kind: u.SCHEMA_DEFINITION,
|
|
1639
|
-
description:
|
|
1639
|
+
description: n,
|
|
1640
1640
|
directives: i,
|
|
1641
|
-
operationTypes:
|
|
1641
|
+
operationTypes: r
|
|
1642
1642
|
});
|
|
1643
1643
|
}
|
|
1644
1644
|
/**
|
|
1645
1645
|
* OperationTypeDefinition : OperationType : NamedType
|
|
1646
1646
|
*/
|
|
1647
1647
|
parseOperationTypeDefinition() {
|
|
1648
|
-
const t = this._lexer.token,
|
|
1648
|
+
const t = this._lexer.token, n = this.parseOperationType();
|
|
1649
1649
|
this.expectToken(a.COLON);
|
|
1650
1650
|
const i = this.parseNamedType();
|
|
1651
1651
|
return this.node(t, {
|
|
1652
1652
|
kind: u.OPERATION_TYPE_DEFINITION,
|
|
1653
|
-
operation:
|
|
1653
|
+
operation: n,
|
|
1654
1654
|
type: i
|
|
1655
1655
|
});
|
|
1656
1656
|
}
|
|
@@ -1658,14 +1658,14 @@ class wr {
|
|
|
1658
1658
|
* ScalarTypeDefinition : Description? scalar Name Directives[Const]?
|
|
1659
1659
|
*/
|
|
1660
1660
|
parseScalarTypeDefinition() {
|
|
1661
|
-
const t = this._lexer.token,
|
|
1661
|
+
const t = this._lexer.token, n = this.parseDescription();
|
|
1662
1662
|
this.expectKeyword("scalar");
|
|
1663
|
-
const i = this.parseName(),
|
|
1663
|
+
const i = this.parseName(), r = this.parseConstDirectives();
|
|
1664
1664
|
return this.node(t, {
|
|
1665
1665
|
kind: u.SCALAR_TYPE_DEFINITION,
|
|
1666
|
-
description:
|
|
1666
|
+
description: n,
|
|
1667
1667
|
name: i,
|
|
1668
|
-
directives:
|
|
1668
|
+
directives: r
|
|
1669
1669
|
});
|
|
1670
1670
|
}
|
|
1671
1671
|
/**
|
|
@@ -1674,14 +1674,14 @@ class wr {
|
|
|
1674
1674
|
* type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?
|
|
1675
1675
|
*/
|
|
1676
1676
|
parseObjectTypeDefinition() {
|
|
1677
|
-
const t = this._lexer.token,
|
|
1677
|
+
const t = this._lexer.token, n = this.parseDescription();
|
|
1678
1678
|
this.expectKeyword("type");
|
|
1679
|
-
const i = this.parseName(),
|
|
1679
|
+
const i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
|
|
1680
1680
|
return this.node(t, {
|
|
1681
1681
|
kind: u.OBJECT_TYPE_DEFINITION,
|
|
1682
|
-
description:
|
|
1682
|
+
description: n,
|
|
1683
1683
|
name: i,
|
|
1684
|
-
interfaces:
|
|
1684
|
+
interfaces: r,
|
|
1685
1685
|
directives: s,
|
|
1686
1686
|
fields: o
|
|
1687
1687
|
});
|
|
@@ -1711,14 +1711,14 @@ class wr {
|
|
|
1711
1711
|
* - Description? Name ArgumentsDefinition? : Type Directives[Const]?
|
|
1712
1712
|
*/
|
|
1713
1713
|
parseFieldDefinition() {
|
|
1714
|
-
const t = this._lexer.token,
|
|
1714
|
+
const t = this._lexer.token, n = this.parseDescription(), i = this.parseName(), r = this.parseArgumentDefs();
|
|
1715
1715
|
this.expectToken(a.COLON);
|
|
1716
1716
|
const s = this.parseTypeReference(), o = this.parseConstDirectives();
|
|
1717
1717
|
return this.node(t, {
|
|
1718
1718
|
kind: u.FIELD_DEFINITION,
|
|
1719
|
-
description:
|
|
1719
|
+
description: n,
|
|
1720
1720
|
name: i,
|
|
1721
|
-
arguments:
|
|
1721
|
+
arguments: r,
|
|
1722
1722
|
type: s,
|
|
1723
1723
|
directives: o
|
|
1724
1724
|
});
|
|
@@ -1738,17 +1738,17 @@ class wr {
|
|
|
1738
1738
|
* - Description? Name : Type DefaultValue? Directives[Const]?
|
|
1739
1739
|
*/
|
|
1740
1740
|
parseInputValueDef() {
|
|
1741
|
-
const t = this._lexer.token,
|
|
1741
|
+
const t = this._lexer.token, n = this.parseDescription(), i = this.parseName();
|
|
1742
1742
|
this.expectToken(a.COLON);
|
|
1743
|
-
const
|
|
1743
|
+
const r = this.parseTypeReference();
|
|
1744
1744
|
let s;
|
|
1745
1745
|
this.expectOptionalToken(a.EQUALS) && (s = this.parseConstValueLiteral());
|
|
1746
1746
|
const o = this.parseConstDirectives();
|
|
1747
1747
|
return this.node(t, {
|
|
1748
1748
|
kind: u.INPUT_VALUE_DEFINITION,
|
|
1749
|
-
description:
|
|
1749
|
+
description: n,
|
|
1750
1750
|
name: i,
|
|
1751
|
-
type:
|
|
1751
|
+
type: r,
|
|
1752
1752
|
defaultValue: s,
|
|
1753
1753
|
directives: o
|
|
1754
1754
|
});
|
|
@@ -1758,14 +1758,14 @@ class wr {
|
|
|
1758
1758
|
* - Description? interface Name Directives[Const]? FieldsDefinition?
|
|
1759
1759
|
*/
|
|
1760
1760
|
parseInterfaceTypeDefinition() {
|
|
1761
|
-
const t = this._lexer.token,
|
|
1761
|
+
const t = this._lexer.token, n = this.parseDescription();
|
|
1762
1762
|
this.expectKeyword("interface");
|
|
1763
|
-
const i = this.parseName(),
|
|
1763
|
+
const i = this.parseName(), r = this.parseImplementsInterfaces(), s = this.parseConstDirectives(), o = this.parseFieldsDefinition();
|
|
1764
1764
|
return this.node(t, {
|
|
1765
1765
|
kind: u.INTERFACE_TYPE_DEFINITION,
|
|
1766
|
-
description:
|
|
1766
|
+
description: n,
|
|
1767
1767
|
name: i,
|
|
1768
|
-
interfaces:
|
|
1768
|
+
interfaces: r,
|
|
1769
1769
|
directives: s,
|
|
1770
1770
|
fields: o
|
|
1771
1771
|
});
|
|
@@ -1775,14 +1775,14 @@ class wr {
|
|
|
1775
1775
|
* - Description? union Name Directives[Const]? UnionMemberTypes?
|
|
1776
1776
|
*/
|
|
1777
1777
|
parseUnionTypeDefinition() {
|
|
1778
|
-
const t = this._lexer.token,
|
|
1778
|
+
const t = this._lexer.token, n = this.parseDescription();
|
|
1779
1779
|
this.expectKeyword("union");
|
|
1780
|
-
const i = this.parseName(),
|
|
1780
|
+
const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseUnionMemberTypes();
|
|
1781
1781
|
return this.node(t, {
|
|
1782
1782
|
kind: u.UNION_TYPE_DEFINITION,
|
|
1783
|
-
description:
|
|
1783
|
+
description: n,
|
|
1784
1784
|
name: i,
|
|
1785
|
-
directives:
|
|
1785
|
+
directives: r,
|
|
1786
1786
|
types: s
|
|
1787
1787
|
});
|
|
1788
1788
|
}
|
|
@@ -1799,14 +1799,14 @@ class wr {
|
|
|
1799
1799
|
* - Description? enum Name Directives[Const]? EnumValuesDefinition?
|
|
1800
1800
|
*/
|
|
1801
1801
|
parseEnumTypeDefinition() {
|
|
1802
|
-
const t = this._lexer.token,
|
|
1802
|
+
const t = this._lexer.token, n = this.parseDescription();
|
|
1803
1803
|
this.expectKeyword("enum");
|
|
1804
|
-
const i = this.parseName(),
|
|
1804
|
+
const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseEnumValuesDefinition();
|
|
1805
1805
|
return this.node(t, {
|
|
1806
1806
|
kind: u.ENUM_TYPE_DEFINITION,
|
|
1807
|
-
description:
|
|
1807
|
+
description: n,
|
|
1808
1808
|
name: i,
|
|
1809
|
-
directives:
|
|
1809
|
+
directives: r,
|
|
1810
1810
|
values: s
|
|
1811
1811
|
});
|
|
1812
1812
|
}
|
|
@@ -1826,12 +1826,12 @@ class wr {
|
|
|
1826
1826
|
* EnumValueDefinition : Description? EnumValue Directives[Const]?
|
|
1827
1827
|
*/
|
|
1828
1828
|
parseEnumValueDefinition() {
|
|
1829
|
-
const t = this._lexer.token,
|
|
1829
|
+
const t = this._lexer.token, n = this.parseDescription(), i = this.parseEnumValueName(), r = this.parseConstDirectives();
|
|
1830
1830
|
return this.node(t, {
|
|
1831
1831
|
kind: u.ENUM_VALUE_DEFINITION,
|
|
1832
|
-
description:
|
|
1832
|
+
description: n,
|
|
1833
1833
|
name: i,
|
|
1834
|
-
directives:
|
|
1834
|
+
directives: r
|
|
1835
1835
|
});
|
|
1836
1836
|
}
|
|
1837
1837
|
/**
|
|
@@ -1853,14 +1853,14 @@ class wr {
|
|
|
1853
1853
|
* - Description? input Name Directives[Const]? InputFieldsDefinition?
|
|
1854
1854
|
*/
|
|
1855
1855
|
parseInputObjectTypeDefinition() {
|
|
1856
|
-
const t = this._lexer.token,
|
|
1856
|
+
const t = this._lexer.token, n = this.parseDescription();
|
|
1857
1857
|
this.expectKeyword("input");
|
|
1858
|
-
const i = this.parseName(),
|
|
1858
|
+
const i = this.parseName(), r = this.parseConstDirectives(), s = this.parseInputFieldsDefinition();
|
|
1859
1859
|
return this.node(t, {
|
|
1860
1860
|
kind: u.INPUT_OBJECT_TYPE_DEFINITION,
|
|
1861
|
-
description:
|
|
1861
|
+
description: n,
|
|
1862
1862
|
name: i,
|
|
1863
|
-
directives:
|
|
1863
|
+
directives: r,
|
|
1864
1864
|
fields: s
|
|
1865
1865
|
});
|
|
1866
1866
|
}
|
|
@@ -1920,16 +1920,16 @@ class wr {
|
|
|
1920
1920
|
parseSchemaExtension() {
|
|
1921
1921
|
const t = this._lexer.token;
|
|
1922
1922
|
this.expectKeyword("extend"), this.expectKeyword("schema");
|
|
1923
|
-
const
|
|
1923
|
+
const n = this.parseConstDirectives(), i = this.optionalMany(
|
|
1924
1924
|
a.BRACE_L,
|
|
1925
1925
|
this.parseOperationTypeDefinition,
|
|
1926
1926
|
a.BRACE_R
|
|
1927
1927
|
);
|
|
1928
|
-
if (
|
|
1928
|
+
if (n.length === 0 && i.length === 0)
|
|
1929
1929
|
throw this.unexpected();
|
|
1930
1930
|
return this.node(t, {
|
|
1931
1931
|
kind: u.SCHEMA_EXTENSION,
|
|
1932
|
-
directives:
|
|
1932
|
+
directives: n,
|
|
1933
1933
|
operationTypes: i
|
|
1934
1934
|
});
|
|
1935
1935
|
}
|
|
@@ -1940,12 +1940,12 @@ class wr {
|
|
|
1940
1940
|
parseScalarTypeExtension() {
|
|
1941
1941
|
const t = this._lexer.token;
|
|
1942
1942
|
this.expectKeyword("extend"), this.expectKeyword("scalar");
|
|
1943
|
-
const
|
|
1943
|
+
const n = this.parseName(), i = this.parseConstDirectives();
|
|
1944
1944
|
if (i.length === 0)
|
|
1945
1945
|
throw this.unexpected();
|
|
1946
1946
|
return this.node(t, {
|
|
1947
1947
|
kind: u.SCALAR_TYPE_EXTENSION,
|
|
1948
|
-
name:
|
|
1948
|
+
name: n,
|
|
1949
1949
|
directives: i
|
|
1950
1950
|
});
|
|
1951
1951
|
}
|
|
@@ -1958,14 +1958,14 @@ class wr {
|
|
|
1958
1958
|
parseObjectTypeExtension() {
|
|
1959
1959
|
const t = this._lexer.token;
|
|
1960
1960
|
this.expectKeyword("extend"), this.expectKeyword("type");
|
|
1961
|
-
const
|
|
1962
|
-
if (i.length === 0 &&
|
|
1961
|
+
const n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
|
|
1962
|
+
if (i.length === 0 && r.length === 0 && s.length === 0)
|
|
1963
1963
|
throw this.unexpected();
|
|
1964
1964
|
return this.node(t, {
|
|
1965
1965
|
kind: u.OBJECT_TYPE_EXTENSION,
|
|
1966
|
-
name:
|
|
1966
|
+
name: n,
|
|
1967
1967
|
interfaces: i,
|
|
1968
|
-
directives:
|
|
1968
|
+
directives: r,
|
|
1969
1969
|
fields: s
|
|
1970
1970
|
});
|
|
1971
1971
|
}
|
|
@@ -1978,14 +1978,14 @@ class wr {
|
|
|
1978
1978
|
parseInterfaceTypeExtension() {
|
|
1979
1979
|
const t = this._lexer.token;
|
|
1980
1980
|
this.expectKeyword("extend"), this.expectKeyword("interface");
|
|
1981
|
-
const
|
|
1982
|
-
if (i.length === 0 &&
|
|
1981
|
+
const n = this.parseName(), i = this.parseImplementsInterfaces(), r = this.parseConstDirectives(), s = this.parseFieldsDefinition();
|
|
1982
|
+
if (i.length === 0 && r.length === 0 && s.length === 0)
|
|
1983
1983
|
throw this.unexpected();
|
|
1984
1984
|
return this.node(t, {
|
|
1985
1985
|
kind: u.INTERFACE_TYPE_EXTENSION,
|
|
1986
|
-
name:
|
|
1986
|
+
name: n,
|
|
1987
1987
|
interfaces: i,
|
|
1988
|
-
directives:
|
|
1988
|
+
directives: r,
|
|
1989
1989
|
fields: s
|
|
1990
1990
|
});
|
|
1991
1991
|
}
|
|
@@ -1997,14 +1997,14 @@ class wr {
|
|
|
1997
1997
|
parseUnionTypeExtension() {
|
|
1998
1998
|
const t = this._lexer.token;
|
|
1999
1999
|
this.expectKeyword("extend"), this.expectKeyword("union");
|
|
2000
|
-
const
|
|
2001
|
-
if (i.length === 0 &&
|
|
2000
|
+
const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseUnionMemberTypes();
|
|
2001
|
+
if (i.length === 0 && r.length === 0)
|
|
2002
2002
|
throw this.unexpected();
|
|
2003
2003
|
return this.node(t, {
|
|
2004
2004
|
kind: u.UNION_TYPE_EXTENSION,
|
|
2005
|
-
name:
|
|
2005
|
+
name: n,
|
|
2006
2006
|
directives: i,
|
|
2007
|
-
types:
|
|
2007
|
+
types: r
|
|
2008
2008
|
});
|
|
2009
2009
|
}
|
|
2010
2010
|
/**
|
|
@@ -2015,14 +2015,14 @@ class wr {
|
|
|
2015
2015
|
parseEnumTypeExtension() {
|
|
2016
2016
|
const t = this._lexer.token;
|
|
2017
2017
|
this.expectKeyword("extend"), this.expectKeyword("enum");
|
|
2018
|
-
const
|
|
2019
|
-
if (i.length === 0 &&
|
|
2018
|
+
const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseEnumValuesDefinition();
|
|
2019
|
+
if (i.length === 0 && r.length === 0)
|
|
2020
2020
|
throw this.unexpected();
|
|
2021
2021
|
return this.node(t, {
|
|
2022
2022
|
kind: u.ENUM_TYPE_EXTENSION,
|
|
2023
|
-
name:
|
|
2023
|
+
name: n,
|
|
2024
2024
|
directives: i,
|
|
2025
|
-
values:
|
|
2025
|
+
values: r
|
|
2026
2026
|
});
|
|
2027
2027
|
}
|
|
2028
2028
|
/**
|
|
@@ -2033,14 +2033,14 @@ class wr {
|
|
|
2033
2033
|
parseInputObjectTypeExtension() {
|
|
2034
2034
|
const t = this._lexer.token;
|
|
2035
2035
|
this.expectKeyword("extend"), this.expectKeyword("input");
|
|
2036
|
-
const
|
|
2037
|
-
if (i.length === 0 &&
|
|
2036
|
+
const n = this.parseName(), i = this.parseConstDirectives(), r = this.parseInputFieldsDefinition();
|
|
2037
|
+
if (i.length === 0 && r.length === 0)
|
|
2038
2038
|
throw this.unexpected();
|
|
2039
2039
|
return this.node(t, {
|
|
2040
2040
|
kind: u.INPUT_OBJECT_TYPE_EXTENSION,
|
|
2041
|
-
name:
|
|
2041
|
+
name: n,
|
|
2042
2042
|
directives: i,
|
|
2043
|
-
fields:
|
|
2043
|
+
fields: r
|
|
2044
2044
|
});
|
|
2045
2045
|
}
|
|
2046
2046
|
/**
|
|
@@ -2050,16 +2050,16 @@ class wr {
|
|
|
2050
2050
|
* ```
|
|
2051
2051
|
*/
|
|
2052
2052
|
parseDirectiveDefinition() {
|
|
2053
|
-
const t = this._lexer.token,
|
|
2053
|
+
const t = this._lexer.token, n = this.parseDescription();
|
|
2054
2054
|
this.expectKeyword("directive"), this.expectToken(a.AT);
|
|
2055
|
-
const i = this.parseName(),
|
|
2055
|
+
const i = this.parseName(), r = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
|
|
2056
2056
|
this.expectKeyword("on");
|
|
2057
2057
|
const o = this.parseDirectiveLocations();
|
|
2058
2058
|
return this.node(t, {
|
|
2059
2059
|
kind: u.DIRECTIVE_DEFINITION,
|
|
2060
|
-
description:
|
|
2060
|
+
description: n,
|
|
2061
2061
|
name: i,
|
|
2062
|
-
arguments:
|
|
2062
|
+
arguments: r,
|
|
2063
2063
|
repeatable: s,
|
|
2064
2064
|
locations: o
|
|
2065
2065
|
});
|
|
@@ -2100,9 +2100,9 @@ class wr {
|
|
|
2100
2100
|
* `INPUT_FIELD_DEFINITION`
|
|
2101
2101
|
*/
|
|
2102
2102
|
parseDirectiveLocation() {
|
|
2103
|
-
const t = this._lexer.token,
|
|
2104
|
-
if (Object.prototype.hasOwnProperty.call(j,
|
|
2105
|
-
return
|
|
2103
|
+
const t = this._lexer.token, n = this.parseName();
|
|
2104
|
+
if (Object.prototype.hasOwnProperty.call(j, n.value))
|
|
2105
|
+
return n;
|
|
2106
2106
|
throw this.unexpected(t);
|
|
2107
2107
|
}
|
|
2108
2108
|
// Core parsing utility functions
|
|
@@ -2111,12 +2111,12 @@ class wr {
|
|
|
2111
2111
|
* location object, used to identify the place in the source that created a
|
|
2112
2112
|
* given parsed object.
|
|
2113
2113
|
*/
|
|
2114
|
-
node(t,
|
|
2115
|
-
return this._options.noLocation !== !0 && (
|
|
2114
|
+
node(t, n) {
|
|
2115
|
+
return this._options.noLocation !== !0 && (n.loc = new En(
|
|
2116
2116
|
t,
|
|
2117
2117
|
this._lexer.lastToken,
|
|
2118
2118
|
this._lexer.source
|
|
2119
|
-
)),
|
|
2119
|
+
)), n;
|
|
2120
2120
|
}
|
|
2121
2121
|
/**
|
|
2122
2122
|
* Determines if the next token is of a given kind
|
|
@@ -2129,13 +2129,13 @@ class wr {
|
|
|
2129
2129
|
* Otherwise, do not change the parser state and throw an error.
|
|
2130
2130
|
*/
|
|
2131
2131
|
expectToken(t) {
|
|
2132
|
-
const
|
|
2133
|
-
if (
|
|
2134
|
-
return this.advanceLexer(),
|
|
2132
|
+
const n = this._lexer.token;
|
|
2133
|
+
if (n.kind === t)
|
|
2134
|
+
return this.advanceLexer(), n;
|
|
2135
2135
|
throw m(
|
|
2136
2136
|
this._lexer.source,
|
|
2137
|
-
|
|
2138
|
-
`Expected ${ve(t)}, found ${x(
|
|
2137
|
+
n.start,
|
|
2138
|
+
`Expected ${ve(t)}, found ${x(n)}.`
|
|
2139
2139
|
);
|
|
2140
2140
|
}
|
|
2141
2141
|
/**
|
|
@@ -2150,14 +2150,14 @@ class wr {
|
|
|
2150
2150
|
* Otherwise, do not change the parser state and throw an error.
|
|
2151
2151
|
*/
|
|
2152
2152
|
expectKeyword(t) {
|
|
2153
|
-
const
|
|
2154
|
-
if (
|
|
2153
|
+
const n = this._lexer.token;
|
|
2154
|
+
if (n.kind === a.NAME && n.value === t)
|
|
2155
2155
|
this.advanceLexer();
|
|
2156
2156
|
else
|
|
2157
2157
|
throw m(
|
|
2158
2158
|
this._lexer.source,
|
|
2159
|
-
|
|
2160
|
-
`Expected "${t}", found ${x(
|
|
2159
|
+
n.start,
|
|
2160
|
+
`Expected "${t}", found ${x(n)}.`
|
|
2161
2161
|
);
|
|
2162
2162
|
}
|
|
2163
2163
|
/**
|
|
@@ -2165,18 +2165,18 @@ class wr {
|
|
|
2165
2165
|
* Otherwise, do not change the parser state and return "false".
|
|
2166
2166
|
*/
|
|
2167
2167
|
expectOptionalKeyword(t) {
|
|
2168
|
-
const
|
|
2169
|
-
return
|
|
2168
|
+
const n = this._lexer.token;
|
|
2169
|
+
return n.kind === a.NAME && n.value === t ? (this.advanceLexer(), !0) : !1;
|
|
2170
2170
|
}
|
|
2171
2171
|
/**
|
|
2172
2172
|
* Helper function for creating an error when an unexpected lexed token is encountered.
|
|
2173
2173
|
*/
|
|
2174
2174
|
unexpected(t) {
|
|
2175
|
-
const
|
|
2175
|
+
const n = t ?? this._lexer.token;
|
|
2176
2176
|
return m(
|
|
2177
2177
|
this._lexer.source,
|
|
2178
|
-
|
|
2179
|
-
`Unexpected ${x(
|
|
2178
|
+
n.start,
|
|
2179
|
+
`Unexpected ${x(n)}.`
|
|
2180
2180
|
);
|
|
2181
2181
|
}
|
|
2182
2182
|
/**
|
|
@@ -2184,12 +2184,12 @@ class wr {
|
|
|
2184
2184
|
* This list begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
2185
2185
|
* Advances the parser to the next lex token after the closing token.
|
|
2186
2186
|
*/
|
|
2187
|
-
any(t,
|
|
2187
|
+
any(t, n, i) {
|
|
2188
2188
|
this.expectToken(t);
|
|
2189
|
-
const
|
|
2189
|
+
const r = [];
|
|
2190
2190
|
for (; !this.expectOptionalToken(i); )
|
|
2191
|
-
|
|
2192
|
-
return
|
|
2191
|
+
r.push(n.call(this));
|
|
2192
|
+
return r;
|
|
2193
2193
|
}
|
|
2194
2194
|
/**
|
|
2195
2195
|
* Returns a list of parse nodes, determined by the parseFn.
|
|
@@ -2197,13 +2197,13 @@ class wr {
|
|
|
2197
2197
|
* that begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
2198
2198
|
* Advances the parser to the next lex token after the closing token.
|
|
2199
2199
|
*/
|
|
2200
|
-
optionalMany(t,
|
|
2200
|
+
optionalMany(t, n, i) {
|
|
2201
2201
|
if (this.expectOptionalToken(t)) {
|
|
2202
|
-
const
|
|
2202
|
+
const r = [];
|
|
2203
2203
|
do
|
|
2204
|
-
|
|
2204
|
+
r.push(n.call(this));
|
|
2205
2205
|
while (!this.expectOptionalToken(i));
|
|
2206
|
-
return
|
|
2206
|
+
return r;
|
|
2207
2207
|
}
|
|
2208
2208
|
return [];
|
|
2209
2209
|
}
|
|
@@ -2212,33 +2212,33 @@ class wr {
|
|
|
2212
2212
|
* This list begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
2213
2213
|
* Advances the parser to the next lex token after the closing token.
|
|
2214
2214
|
*/
|
|
2215
|
-
many(t,
|
|
2215
|
+
many(t, n, i) {
|
|
2216
2216
|
this.expectToken(t);
|
|
2217
|
-
const
|
|
2217
|
+
const r = [];
|
|
2218
2218
|
do
|
|
2219
|
-
|
|
2219
|
+
r.push(n.call(this));
|
|
2220
2220
|
while (!this.expectOptionalToken(i));
|
|
2221
|
-
return
|
|
2221
|
+
return r;
|
|
2222
2222
|
}
|
|
2223
2223
|
/**
|
|
2224
2224
|
* Returns a non-empty list of parse nodes, determined by the parseFn.
|
|
2225
2225
|
* This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.
|
|
2226
2226
|
* Advances the parser to the next lex token after last item in the list.
|
|
2227
2227
|
*/
|
|
2228
|
-
delimitedMany(t,
|
|
2228
|
+
delimitedMany(t, n) {
|
|
2229
2229
|
this.expectOptionalToken(t);
|
|
2230
2230
|
const i = [];
|
|
2231
2231
|
do
|
|
2232
|
-
i.push(
|
|
2232
|
+
i.push(n.call(this));
|
|
2233
2233
|
while (this.expectOptionalToken(t));
|
|
2234
2234
|
return i;
|
|
2235
2235
|
}
|
|
2236
2236
|
advanceLexer() {
|
|
2237
|
-
const { maxTokens: t } = this._options,
|
|
2238
|
-
if (
|
|
2237
|
+
const { maxTokens: t } = this._options, n = this._lexer.advance();
|
|
2238
|
+
if (n.kind !== a.EOF && (++this._tokenCounter, t !== void 0 && this._tokenCounter > t))
|
|
2239
2239
|
throw m(
|
|
2240
2240
|
this._lexer.source,
|
|
2241
|
-
|
|
2241
|
+
n.start,
|
|
2242
2242
|
`Document contains more that ${t} tokens. Parsing aborted.`
|
|
2243
2243
|
);
|
|
2244
2244
|
}
|
|
@@ -2248,84 +2248,84 @@ function x(e) {
|
|
|
2248
2248
|
return ve(e.kind) + (t != null ? ` "${t}"` : "");
|
|
2249
2249
|
}
|
|
2250
2250
|
function ve(e) {
|
|
2251
|
-
return
|
|
2251
|
+
return On(e) ? `"${e}"` : e;
|
|
2252
2252
|
}
|
|
2253
2253
|
var b = /* @__PURE__ */ new Map(), W = /* @__PURE__ */ new Map(), Pe = !0, y = !1;
|
|
2254
2254
|
function Re(e) {
|
|
2255
2255
|
return e.replace(/[\s,]+/g, " ").trim();
|
|
2256
2256
|
}
|
|
2257
|
-
function
|
|
2257
|
+
function Bn(e) {
|
|
2258
2258
|
return Re(e.source.body.substring(e.start, e.end));
|
|
2259
2259
|
}
|
|
2260
|
-
function
|
|
2261
|
-
var t = /* @__PURE__ */ new Set(),
|
|
2260
|
+
function Gn(e) {
|
|
2261
|
+
var t = /* @__PURE__ */ new Set(), n = [];
|
|
2262
2262
|
return e.definitions.forEach(function(i) {
|
|
2263
2263
|
if (i.kind === "FragmentDefinition") {
|
|
2264
|
-
var
|
|
2265
|
-
o && !o.has(s) ? Pe && console.warn("Warning: fragment with name " +
|
|
2264
|
+
var r = i.name.value, s = Bn(i.loc), o = W.get(r);
|
|
2265
|
+
o && !o.has(s) ? Pe && console.warn("Warning: fragment with name " + r + ` already exists.
|
|
2266
2266
|
graphql-tag enforces all fragment names across your application to be unique; read more about
|
|
2267
|
-
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : o || W.set(
|
|
2267
|
+
this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : o || W.set(r, o = /* @__PURE__ */ new Set()), o.add(s), t.has(s) || (t.add(s), n.push(i));
|
|
2268
2268
|
} else
|
|
2269
|
-
|
|
2270
|
-
}), F(F({}, e), { definitions:
|
|
2269
|
+
n.push(i);
|
|
2270
|
+
}), F(F({}, e), { definitions: n });
|
|
2271
2271
|
}
|
|
2272
|
-
function
|
|
2272
|
+
function Hn(e) {
|
|
2273
2273
|
var t = new Set(e.definitions);
|
|
2274
2274
|
t.forEach(function(i) {
|
|
2275
|
-
i.loc && delete i.loc, Object.keys(i).forEach(function(
|
|
2276
|
-
var s = i[
|
|
2275
|
+
i.loc && delete i.loc, Object.keys(i).forEach(function(r) {
|
|
2276
|
+
var s = i[r];
|
|
2277
2277
|
s && typeof s == "object" && t.add(s);
|
|
2278
2278
|
});
|
|
2279
2279
|
});
|
|
2280
|
-
var
|
|
2281
|
-
return
|
|
2280
|
+
var n = e.loc;
|
|
2281
|
+
return n && (delete n.startToken, delete n.endToken), e;
|
|
2282
2282
|
}
|
|
2283
|
-
function
|
|
2283
|
+
function zn(e) {
|
|
2284
2284
|
var t = Re(e);
|
|
2285
2285
|
if (!b.has(t)) {
|
|
2286
|
-
var
|
|
2286
|
+
var n = wn(e, {
|
|
2287
2287
|
experimentalFragmentVariables: y,
|
|
2288
2288
|
allowLegacyFragmentVariables: y
|
|
2289
2289
|
});
|
|
2290
|
-
if (!
|
|
2290
|
+
if (!n || n.kind !== "Document")
|
|
2291
2291
|
throw new Error("Not a valid GraphQL document.");
|
|
2292
|
-
b.set(t,
|
|
2292
|
+
b.set(t, Hn(Gn(n)));
|
|
2293
2293
|
}
|
|
2294
2294
|
return b.get(t);
|
|
2295
2295
|
}
|
|
2296
2296
|
function I(e) {
|
|
2297
|
-
for (var t = [],
|
|
2298
|
-
t[
|
|
2297
|
+
for (var t = [], n = 1; n < arguments.length; n++)
|
|
2298
|
+
t[n - 1] = arguments[n];
|
|
2299
2299
|
typeof e == "string" && (e = [e]);
|
|
2300
2300
|
var i = e[0];
|
|
2301
|
-
return t.forEach(function(
|
|
2302
|
-
|
|
2303
|
-
}),
|
|
2301
|
+
return t.forEach(function(r, s) {
|
|
2302
|
+
r && r.kind === "Document" ? i += r.loc.source.body : i += r, i += e[s + 1];
|
|
2303
|
+
}), zn(i);
|
|
2304
2304
|
}
|
|
2305
|
-
function
|
|
2305
|
+
function Yn() {
|
|
2306
2306
|
b.clear(), W.clear();
|
|
2307
2307
|
}
|
|
2308
|
-
function
|
|
2308
|
+
function qn() {
|
|
2309
2309
|
Pe = !1;
|
|
2310
2310
|
}
|
|
2311
|
-
function
|
|
2311
|
+
function Kn() {
|
|
2312
2312
|
y = !0;
|
|
2313
2313
|
}
|
|
2314
|
-
function
|
|
2314
|
+
function jn() {
|
|
2315
2315
|
y = !1;
|
|
2316
2316
|
}
|
|
2317
2317
|
var L = {
|
|
2318
2318
|
gql: I,
|
|
2319
|
-
resetCaches:
|
|
2320
|
-
disableFragmentWarnings:
|
|
2321
|
-
enableExperimentalFragmentVariables:
|
|
2322
|
-
disableExperimentalFragmentVariables:
|
|
2319
|
+
resetCaches: Yn,
|
|
2320
|
+
disableFragmentWarnings: qn,
|
|
2321
|
+
enableExperimentalFragmentVariables: Kn,
|
|
2322
|
+
disableExperimentalFragmentVariables: jn
|
|
2323
2323
|
};
|
|
2324
2324
|
(function(e) {
|
|
2325
2325
|
e.gql = L.gql, e.resetCaches = L.resetCaches, e.disableFragmentWarnings = L.disableFragmentWarnings, e.enableExperimentalFragmentVariables = L.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = L.disableExperimentalFragmentVariables;
|
|
2326
2326
|
})(I || (I = {}));
|
|
2327
2327
|
I.default = I;
|
|
2328
|
-
var Le = /* @__PURE__ */ ((e) => (e.Private = "PRIVATE", e.Public = "PUBLIC", e))(Le || {}), ke = /* @__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))(ke || {}), Se = /* @__PURE__ */ ((e) => (e.Fixed = "FIXED", e.Percentage = "PERCENTAGE", e))(Se || {}), Ce = /* @__PURE__ */ ((e) => (e.Progressive = "PROGRESSIVE", e.Retroactive = "RETROACTIVE", e))(Ce || {}), xe = /* @__PURE__ */ ((e) => (e.AllEvents = "ALL_EVENTS", e.PerEvent = "PER_EVENT", e))(xe || {}), be = /* @__PURE__ */ ((e) => (e.Collect = "COLLECT", e.Sale = "SALE", e.Scan = "SCAN", e))(be || {}), Fe = /* @__PURE__ */ ((e) => (e.Aed = "AED", e.Afn = "AFN", e.All = "ALL", e.Amd = "AMD", e.Ars = "ARS", e.Aud = "AUD", e.Azn = "AZN", e.Bam = "BAM", e.Bdt = "BDT", e.Bgn = "BGN", e.Bhd = "BHD", e.Bif = "BIF", e.Bnd = "BND", e.Bob = "BOB", e.Brl = "BRL", e.Bwp = "BWP", e.Byn = "BYN", e.Bzd = "BZD", e.Cad = "CAD", e.Cdf = "CDF", e.Chf = "CHF", e.Clp = "CLP", e.Cny = "CNY", e.Cop = "COP", e.Crc = "CRC", e.Cve = "CVE", e.Czk = "CZK", e.Djf = "DJF", e.Dkk = "DKK", e.Dop = "DOP", e.Dzd = "DZD", e.Eek = "EEK", e.Egp = "EGP", e.Ern = "ERN", e.Etb = "ETB", e.Eur = "EUR", e.Gbp = "GBP", e.Gel = "GEL", e.Ghs = "GHS", e.Gnf = "GNF", e.Gtq = "GTQ", e.Hkd = "HKD", e.Hnl = "HNL", e.Hrk = "HRK", e.Huf = "HUF", e.Idr = "IDR", e.Ils = "ILS", e.Inr = "INR", e.Iqd = "IQD", e.Irr = "IRR", e.Isk = "ISK", e.Jmd = "JMD", e.Jod = "JOD", e.Jpy = "JPY", e.Kes = "KES", e.Khr = "KHR", e.Kmf = "KMF", e.Krw = "KRW", e.Kwd = "KWD", e.Kzt = "KZT", e.Lbp = "LBP", e.Lkr = "LKR", e.Ltl = "LTL", e.Lvl = "LVL", e.Lyd = "LYD", e.Mad = "MAD", e.Mdl = "MDL", e.Mga = "MGA", e.Mkd = "MKD", e.Mmk = "MMK", e.Mop = "MOP", e.Mur = "MUR", e.Mxn = "MXN", e.Myr = "MYR", e.Mzn = "MZN", e.Nad = "NAD", e.Ngn = "NGN", e.Nio = "NIO", e.Nok = "NOK", e.Npr = "NPR", e.Nzd = "NZD", e.Omr = "OMR", e.Pab = "PAB", e.Pen = "PEN", e.Php = "PHP", e.Pkr = "PKR", e.Pln = "PLN", e.Pyg = "PYG", e.Qar = "QAR", e.Ron = "RON", e.Rsd = "RSD", e.Rub = "RUB", e.Rwf = "RWF", e.Sar = "SAR", e.Sdg = "SDG", e.Sek = "SEK", e.Sgd = "SGD", e.Sos = "SOS", e.Syp = "SYP", e.Thb = "THB", e.Tnd = "TND", e.Top = "TOP", e.Try = "TRY", e.Ttd = "TTD", e.Twd = "TWD", e.Tzs = "TZS", e.Uah = "UAH", e.Ugx = "UGX", e.Usd = "USD", e.Uyu = "UYU", e.Uzs = "UZS", e.Vef = "VEF", e.Vnd = "VND", e.Xaf = "XAF", e.Xof = "XOF", e.Yer = "YER", e.Zar = "ZAR", e.Zmk = "ZMK", e.Zwl = "ZWL", e))(Fe || {}), ye = /* @__PURE__ */ ((e) => (e.Age = "AGE", e.Email = "EMAIL", e.FirstName = "FIRST_NAME", e.Gender = "GENDER", e.GooglePlace = "GOOGLE_PLACE", e.LastName = "LAST_NAME", e.Residence = "RESIDENCE", e))(ye || {}), Ue = /* @__PURE__ */ ((e) => (e.Checkbox = "CHECKBOX", e.Date = "DATE", e.Dropdown = "DROPDOWN", e.Email = "EMAIL", e.Numeric = "NUMERIC", e.PhoneNumber = "PHONE_NUMBER", e.RadioButton = "RADIO_BUTTON", e.Text = "TEXT", e.TextArea = "TEXT_AREA", e.Time = "TIME", e))(Ue || {}), Me = /* @__PURE__ */ ((e) => (e.Banner = "Banner", e.Icon = "Icon", e))(Me || {}), Ve = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e.Paused = "PAUSED", e.SoldOut = "SOLD_OUT", e))(Ve || {}), we = /* @__PURE__ */ ((e) => (e.Txt = "TXT", e.Xlsx = "XLSX", e))(we || {}), $e = /* @__PURE__ */ ((e) => (e.Completed = "COMPLETED", e.Failed = "FAILED", e.Initial = "INITIAL", e.Processing = "PROCESSING", e))($e || {}), Be = /* @__PURE__ */ ((e) => (e.Collector = "COLLECTOR", e.Event = "EVENT", e.Organization = "ORGANIZATION", e.Payout = "PAYOUT", e.Profit = "PROFIT", e.Promoter = "PROMOTER", e.Seller = "SELLER", e))(Be || {}), Ge = /* @__PURE__ */ ((e) => (e.Admin = "ADMIN", e.CashCollector = "CASH_COLLECTOR", e.Collector = "COLLECTOR", e.EventManager = "EVENT_MANAGER", e.HostingManager = "HOSTING_MANAGER", e.LocationManager = "LOCATION_MANAGER", e.OfflineVendor = "OFFLINE_VENDOR", e.OnlineVendor = "ONLINE_VENDOR", e.OrganizationManager = "ORGANIZATION_MANAGER", e.Scanner = "SCANNER", e))(Ge || {}), He = /* @__PURE__ */ ((e) => (e.Day = "DAY", e.Hour = "HOUR", e.Minute = "MINUTE", e.Month = "MONTH", e.Quarter = "QUARTER", e.Week = "WEEK", e.Year = "YEAR", e))(He || {}), ze = /* @__PURE__ */ ((e) => (e.Expired = "EXPIRED", e.Valid = "VALID", e))(ze || {}), Ye = /* @__PURE__ */ ((e) => (e.Addons = "ADDONS", e.AppCustomerHistory = "APP_CUSTOMER_HISTORY", e.Arrivals = "ARRIVALS", e.CalculateCashPayout = "CALCULATE_CASH_PAYOUT", e.Cash = "CASH", e.CashHistory = "CASH_HISTORY", e.Collector = "COLLECTOR", e.Commission = "COMMISSION", e.CountryStatistics = "COUNTRY_STATISTICS", e.CustomField = "CUSTOM_FIELD", e.DepositPrice = "DEPOSIT_PRICE", e.DetailStatistics = "DETAIL_STATISTICS", e.DiscountPrice = "DISCOUNT_PRICE", e.DoorSale = "DOOR_SALE", e.DynamicEvents = "DYNAMIC_EVENTS", e.EmailMarketing = "EMAIL_MARKETING", e.EventCapacity = "EVENT_CAPACITY", e.EventDeliveryOptions = "EVENT_DELIVERY_OPTIONS", e.EventPercentage = "EVENT_PERCENTAGE", e.EventSeatsIntegration = "EVENT_SEATS_INTEGRATION", e.GroupTickets = "GROUP_TICKETS", e.Guest = "GUEST", e.Hosting = "HOSTING", e.Location = "LOCATION", e.Marketing = "MARKETING", e.MobileRefund = "MOBILE_REFUND", e.OrderDetail = "ORDER_DETAIL", e.OrderPending = "ORDER_PENDING", e.OrderRefund = "ORDER_REFUND", e.Override = "OVERRIDE", e.Package = "PACKAGE", e.PaidInAdvance = "PAID_IN_ADVANCE", e.ProductAdditionalInfo = "PRODUCT_ADDITIONAL_INFO", e.ProductPurchasePrice = "PRODUCT_PURCHASE_PRICE", e.Promoter = "PROMOTER", e.Reporting = "REPORTING", e.Role = "ROLE", e.Shop = "SHOP", e.SingleTickets = "SINGLE_TICKETS", e.TapToPay = "TAP_TO_PAY", e.Team = "TEAM", e.TicketLimit = "TICKET_LIMIT", e.TicketSeller = "TICKET_SELLER", e.Token = "TOKEN", e.ViewStatistics = "VIEW_STATISTICS", e))(Ye || {}), qe = /* @__PURE__ */ ((e) => (e.AddOn = "ADD_ON", e.DeliveryOption = "DELIVERY_OPTION", e.EntranceTicket = "ENTRANCE_TICKET", e))(qe || {}), Ke = /* @__PURE__ */ ((e) => (e.Dashboard = "DASHBOARD", e.Offline = "OFFLINE", e.Online = "ONLINE", e.Ticketswap = "TICKETSWAP", e))(Ke || {}), je = /* @__PURE__ */ ((e) => (e.Canceled = "CANCELED", e.Finalized = "FINALIZED", e.PendingFinalization = "PENDING_FINALIZATION", e))(je || {}), We = /* @__PURE__ */ ((e) => (e.Default = "DEFAULT", e.Door = "DOOR", e.Email = "EMAIL", e.Guest = "GUEST", e.Promoter = "PROMOTER", e.Swap = "SWAP", e.Tracker = "TRACKER", e))(We || {}), Xe = /* @__PURE__ */ ((e) => (e.CustomField = "CUSTOM_FIELD", e.Event = "EVENT", e.Guest = "GUEST", e.Hosting = "HOSTING", e.Location = "LOCATION", e.Marketing = "MARKETING", e.Module = "MODULE", e.Organization = "ORGANIZATION", e.Permission = "PERMISSION", e.Product = "PRODUCT", e.Role = "ROLE", e.Shop = "SHOP", e.Team = "TEAM", e.User = "USER", e))(Xe || {}), U = /* @__PURE__ */ ((e) => (e.AdditionalEvent = "ADDITIONAL_EVENT", e.Addon = "ADDON", e.Regular = "REGULAR", e))(U || {}), Qe = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Concept = "CONCEPT", e.Paused = "PAUSED", e.SoldOut = "SOLD_OUT", e))(Qe || {}), Je = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e))(Je || {}), Ze = /* @__PURE__ */ ((e) => (e.Fixed = "FIXED", e.Percentage = "PERCENTAGE", e))(Ze || {}), et = /* @__PURE__ */ ((e) => (e.Collect = "COLLECT", e.Initial = "INITIAL", e))(et || {}), tt = /* @__PURE__ */ ((e) => (e.Canceled = "CANCELED", e.ChargedBack = "CHARGED_BACK", e.Denied = "DENIED", e.Expired = "EXPIRED", e.Failure = "FAILURE", e.Paid = "PAID", e.Refunded = "REFUNDED", e.Rejected = "REJECTED", e))(tt || {}), rt = /* @__PURE__ */ ((e) => (e.Cash = "CASH", e.Digital = "DIGITAL", e.Other = "OTHER", e.TapToPay = "TAP_TO_PAY", e))(rt || {}), nt = /* @__PURE__ */ ((e) => (e.AccessDashboard = "ACCESS_DASHBOARD", e.AccessSale = "ACCESS_SALE", e.AccessScan = "ACCESS_SCAN", e.AdminModuleUpdate = "ADMIN_MODULE_UPDATE", e.AdminModuleView = "ADMIN_MODULE_VIEW", e.AdminOrganizationCreate = "ADMIN_ORGANIZATION_CREATE", e.AdminOrganizationDelete = "ADMIN_ORGANIZATION_DELETE", e.AdminOrganizationView = "ADMIN_ORGANIZATION_VIEW", e.AdminPermissionUpdate = "ADMIN_PERMISSION_UPDATE", e.AdminPermissionView = "ADMIN_PERMISSION_VIEW", e.AdminSuper = "ADMIN_SUPER", e.AdminUserCreate = "ADMIN_USER_CREATE", e.AdminUserDelete = "ADMIN_USER_DELETE", e.AdminUserView = "ADMIN_USER_VIEW", e.CashCollectorStatistics = "CASH_COLLECTOR_STATISTICS", e.CashCollectorView = "CASH_COLLECTOR_VIEW", e.CashDepositCreate = "CASH_DEPOSIT_CREATE", e.CashDepositView = "CASH_DEPOSIT_VIEW", e.CashOnHandView = "CASH_ON_HAND_VIEW", e.CollectorManage = "COLLECTOR_MANAGE", e.CollectorStatistics = "COLLECTOR_STATISTICS", e.CollectorView = "COLLECTOR_VIEW", e.CommissionManage = "COMMISSION_MANAGE", e.CommissionPayoutCreate = "COMMISSION_PAYOUT_CREATE", e.CommissionPayoutView = "COMMISSION_PAYOUT_VIEW", e.CommissionStatistics = "COMMISSION_STATISTICS", e.CommissionView = "COMMISSION_VIEW", e.CustomFieldManage = "CUSTOM_FIELD_MANAGE", e.CustomFieldView = "CUSTOM_FIELD_VIEW", e.EmailRuleManage = "EMAIL_RULE_MANAGE", e.EmailRuleStatistics = "EMAIL_RULE_STATISTICS", e.EmailRuleView = "EMAIL_RULE_VIEW", e.EmailRunStatistics = "EMAIL_RUN_STATISTICS", e.EmailRunView = "EMAIL_RUN_VIEW", e.EventManage = "EVENT_MANAGE", e.EventStatistics = "EVENT_STATISTICS", e.EventView = "EVENT_VIEW", e.GuestManage = "GUEST_MANAGE", e.GuestProductManage = "GUEST_PRODUCT_MANAGE", e.GuestProductStatistics = "GUEST_PRODUCT_STATISTICS", e.GuestProductView = "GUEST_PRODUCT_VIEW", e.GuestView = "GUEST_VIEW", e.HostingManage = "HOSTING_MANAGE", e.HostingStatistics = "HOSTING_STATISTICS", e.HostingView = "HOSTING_VIEW", e.LocationManage = "LOCATION_MANAGE", e.LocationStatistics = "LOCATION_STATISTICS", e.LocationView = "LOCATION_VIEW", e.NoteManage = "NOTE_MANAGE", e.NoteView = "NOTE_VIEW", e.OrderCreateDoor = "ORDER_CREATE_DOOR", e.OrderCreateSeller = "ORDER_CREATE_SELLER", e.OrderManage = "ORDER_MANAGE", e.OrderView = "ORDER_VIEW", e.OrganizationManage = "ORGANIZATION_MANAGE", e.OrganizationStatistics = "ORGANIZATION_STATISTICS", e.OrganizationSuper = "ORGANIZATION_SUPER", e.OverrideManage = "OVERRIDE_MANAGE", e.PackageManage = "PACKAGE_MANAGE", e.PackageStatistics = "PACKAGE_STATISTICS", e.PackageView = "PACKAGE_VIEW", e.ProductManage = "PRODUCT_MANAGE", e.ProductStatistics = "PRODUCT_STATISTICS", e.ProductView = "PRODUCT_VIEW", e.PromoterManage = "PROMOTER_MANAGE", e.PromoterStatistics = "PROMOTER_STATISTICS", e.PromoterView = "PROMOTER_VIEW", e.ReportingManage = "REPORTING_MANAGE", e.ReportingView = "REPORTING_VIEW", e.RoleAssign = "ROLE_ASSIGN", e.RoleManage = "ROLE_MANAGE", e.RoleView = "ROLE_VIEW", e.SellerManage = "SELLER_MANAGE", e.SellerStatistics = "SELLER_STATISTICS", e.SellerView = "SELLER_VIEW", e.ShopManage = "SHOP_MANAGE", e.ShopView = "SHOP_VIEW", e.TeamManage = "TEAM_MANAGE", e.TeamStatistics = "TEAM_STATISTICS", e.TeamUserInvite = "TEAM_USER_INVITE", e.TeamUserRemove = "TEAM_USER_REMOVE", e.TeamView = "TEAM_VIEW", e.TemplateManage = "TEMPLATE_MANAGE", e.TemplateView = "TEMPLATE_VIEW", e.TicketLimitManage = "TICKET_LIMIT_MANAGE", e.TicketLimitView = "TICKET_LIMIT_VIEW", e.TokenManage = "TOKEN_MANAGE", e.TokenView = "TOKEN_VIEW", e.TrackerManage = "TRACKER_MANAGE", e.TrackerStatistics = "TRACKER_STATISTICS", e.TrackerView = "TRACKER_VIEW", e.UserInviteManage = "USER_INVITE_MANAGE", e.UserInviteView = "USER_INVITE_VIEW", e.UserManage = "USER_MANAGE", e.UserView = "USER_VIEW", e))(nt || {}), it = /* @__PURE__ */ ((e) => (e.AllReserved = "ALL_RESERVED", e.Available = "AVAILABLE", e.SoldOut = "SOLD_OUT", e))(it || {}), st = /* @__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))(st || {}), at = /* @__PURE__ */ ((e) => (e.Other = "OTHER", e.Ticketapp = "TICKETAPP", e))(at || {}), ot = /* @__PURE__ */ ((e) => (e.Email = "EMAIL", e.Phone = "PHONE", e))(ot || {}), dt = /* @__PURE__ */ ((e) => (e.Cancelled = "CANCELLED", e.Completed = "COMPLETED", e.Failed = "FAILED", e.Pending = "PENDING", e.Processing = "PROCESSING", e))(dt || {}), ct = /* @__PURE__ */ ((e) => (e.Csv = "CSV", e.Txt = "TXT", e))(ct || {}), ut = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e))(ut || {}), lt = /* @__PURE__ */ ((e) => (e.NonPaid = "NON_PAID", e.Paid = "PAID", e))(lt || {}), ht = /* @__PURE__ */ ((e) => (e.CashCollector = "CASH_COLLECTOR", e.Collector = "COLLECTOR", e.CommissionPayouts = "COMMISSION_PAYOUTS", e.GuestManager = "GUEST_MANAGER", e.OfflineVendor = "OFFLINE_VENDOR", e.OnlineVendor = "ONLINE_VENDOR", e))(ht || {}), Et = /* @__PURE__ */ ((e) => (e.Offline = "OFFLINE", e.Online = "ONLINE", e))(Et || {}), It = /* @__PURE__ */ ((e) => (e.Door = "DOOR", e.Promoter = "PROMOTER", e.Seller = "SELLER", e.Web = "WEB", e))(It || {}), gt = /* @__PURE__ */ ((e) => (e.AlreadyScanned = "ALREADY_SCANNED", e.AlreadyScannedByGroup = "ALREADY_SCANNED_BY_GROUP", e.InvalidDate = "INVALID_DATE", e.MaxScanAmountReached = "MAX_SCAN_AMOUNT_REACHED", e.NotFinalized = "NOT_FINALIZED", e.NotFoundForEvent = "NOT_FOUND_FOR_EVENT", e.TicketSwapped = "TICKET_SWAPPED", e))(gt || {}), ft = /* @__PURE__ */ ((e) => (e.Default = "DEFAULT", e.Transparent = "TRANSPARENT", e))(ft || {}), pt = /* @__PURE__ */ ((e) => (e.Calendar = "CALENDAR", e.Large = "LARGE", e.Small = "SMALL", e))(pt || {}), At = /* @__PURE__ */ ((e) => (e.Asc = "ASC", e.Desc = "DESC", e))(At || {}), mt = /* @__PURE__ */ ((e) => (e.Canceled = "CANCELED", e.CashTransaction = "CASH_TRANSACTION", e.CashTransactionDeposit = "CASH_TRANSACTION_DEPOSIT", e.Collect = "COLLECT", e.Commission = "COMMISSION", e.CommissionPayout = "COMMISSION_PAYOUT", e.Refunded = "REFUNDED", e.Sale = "SALE", e.Scan = "SCAN", e))(mt || {}), Ot = /* @__PURE__ */ ((e) => (e.Past = "PAST", e.Upcoming = "UPCOMING", e))(Ot || {}), Tt = /* @__PURE__ */ ((e) => (e.Collector = "COLLECTOR", e.Offline = "OFFLINE", e.Online = "ONLINE", e))(Tt || {}), Nt = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Expired = "EXPIRED", e.Inactive = "INACTIVE", e))(Nt || {}), Dt = /* @__PURE__ */ ((e) => (e.Team = "TEAM", e.User = "USER", e))(Dt || {}), _t = /* @__PURE__ */ ((e) => (e.Event = "EVENT", e.Hosting = "HOSTING", e.Location = "LOCATION", e.Package = "PACKAGE", e))(_t || {}), vt = /* @__PURE__ */ ((e) => (e.FullyPickedUp = "FULLY_PICKED_UP", e.NotPicketUp = "NOT_PICKET_UP", e.PartialPicketUp = "PARTIAL_PICKET_UP", e))(vt || {}), Pt = /* @__PURE__ */ ((e) => (e.Email = "EMAIL", e.Facebook = "FACEBOOK", e.Instagram = "INSTAGRAM", e.Qr = "QR", e.Sms = "SMS", e.Snapchat = "SNAPCHAT", e.Tiktok = "TIKTOK", e.Twitter = "TWITTER", e.Website = "WEBSITE", e))(Pt || {}), Rt = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e))(Rt || {}), Lt = /* @__PURE__ */ ((e) => (e.Default = "DEFAULT", e.DiscountedPrices = "DISCOUNTED_PRICES", e.DiscountedProducts = "DISCOUNTED_PRODUCTS", e))(Lt || {}), kt = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e.Invited = "INVITED", e))(kt || {});
|
|
2328
|
+
var Le = /* @__PURE__ */ ((e) => (e.Private = "PRIVATE", e.Public = "PUBLIC", e))(Le || {}), ke = /* @__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))(ke || {}), Se = /* @__PURE__ */ ((e) => (e.Fixed = "FIXED", e.Percentage = "PERCENTAGE", e))(Se || {}), Ce = /* @__PURE__ */ ((e) => (e.Progressive = "PROGRESSIVE", e.Retroactive = "RETROACTIVE", e))(Ce || {}), xe = /* @__PURE__ */ ((e) => (e.AllEvents = "ALL_EVENTS", e.PerEvent = "PER_EVENT", e))(xe || {}), be = /* @__PURE__ */ ((e) => (e.Collect = "COLLECT", e.Sale = "SALE", e.Scan = "SCAN", e))(be || {}), Fe = /* @__PURE__ */ ((e) => (e.Aed = "AED", e.Afn = "AFN", e.All = "ALL", e.Amd = "AMD", e.Ars = "ARS", e.Aud = "AUD", e.Azn = "AZN", e.Bam = "BAM", e.Bdt = "BDT", e.Bgn = "BGN", e.Bhd = "BHD", e.Bif = "BIF", e.Bnd = "BND", e.Bob = "BOB", e.Brl = "BRL", e.Bwp = "BWP", e.Byn = "BYN", e.Bzd = "BZD", e.Cad = "CAD", e.Cdf = "CDF", e.Chf = "CHF", e.Clp = "CLP", e.Cny = "CNY", e.Cop = "COP", e.Crc = "CRC", e.Cve = "CVE", e.Czk = "CZK", e.Djf = "DJF", e.Dkk = "DKK", e.Dop = "DOP", e.Dzd = "DZD", e.Eek = "EEK", e.Egp = "EGP", e.Ern = "ERN", e.Etb = "ETB", e.Eur = "EUR", e.Gbp = "GBP", e.Gel = "GEL", e.Ghs = "GHS", e.Gnf = "GNF", e.Gtq = "GTQ", e.Hkd = "HKD", e.Hnl = "HNL", e.Hrk = "HRK", e.Huf = "HUF", e.Idr = "IDR", e.Ils = "ILS", e.Inr = "INR", e.Iqd = "IQD", e.Irr = "IRR", e.Isk = "ISK", e.Jmd = "JMD", e.Jod = "JOD", e.Jpy = "JPY", e.Kes = "KES", e.Khr = "KHR", e.Kmf = "KMF", e.Krw = "KRW", e.Kwd = "KWD", e.Kzt = "KZT", e.Lbp = "LBP", e.Lkr = "LKR", e.Ltl = "LTL", e.Lvl = "LVL", e.Lyd = "LYD", e.Mad = "MAD", e.Mdl = "MDL", e.Mga = "MGA", e.Mkd = "MKD", e.Mmk = "MMK", e.Mop = "MOP", e.Mur = "MUR", e.Mxn = "MXN", e.Myr = "MYR", e.Mzn = "MZN", e.Nad = "NAD", e.Ngn = "NGN", e.Nio = "NIO", e.Nok = "NOK", e.Npr = "NPR", e.Nzd = "NZD", e.Omr = "OMR", e.Pab = "PAB", e.Pen = "PEN", e.Php = "PHP", e.Pkr = "PKR", e.Pln = "PLN", e.Pyg = "PYG", e.Qar = "QAR", e.Ron = "RON", e.Rsd = "RSD", e.Rub = "RUB", e.Rwf = "RWF", e.Sar = "SAR", e.Sdg = "SDG", e.Sek = "SEK", e.Sgd = "SGD", e.Sos = "SOS", e.Syp = "SYP", e.Thb = "THB", e.Tnd = "TND", e.Top = "TOP", e.Try = "TRY", e.Ttd = "TTD", e.Twd = "TWD", e.Tzs = "TZS", e.Uah = "UAH", e.Ugx = "UGX", e.Usd = "USD", e.Uyu = "UYU", e.Uzs = "UZS", e.Vef = "VEF", e.Vnd = "VND", e.Xaf = "XAF", e.Xof = "XOF", e.Yer = "YER", e.Zar = "ZAR", e.Zmk = "ZMK", e.Zwl = "ZWL", e))(Fe || {}), ye = /* @__PURE__ */ ((e) => (e.Age = "AGE", e.Email = "EMAIL", e.FirstName = "FIRST_NAME", e.Gender = "GENDER", e.GooglePlace = "GOOGLE_PLACE", e.LastName = "LAST_NAME", e.Residence = "RESIDENCE", e))(ye || {}), Ue = /* @__PURE__ */ ((e) => (e.Checkbox = "CHECKBOX", e.Date = "DATE", e.Dropdown = "DROPDOWN", e.Email = "EMAIL", e.Numeric = "NUMERIC", e.PhoneNumber = "PHONE_NUMBER", e.RadioButton = "RADIO_BUTTON", e.Text = "TEXT", e.TextArea = "TEXT_AREA", e.Time = "TIME", e))(Ue || {}), Me = /* @__PURE__ */ ((e) => (e.Banner = "Banner", e.Icon = "Icon", e))(Me || {}), Ve = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e.Paused = "PAUSED", e.SoldOut = "SOLD_OUT", e))(Ve || {}), we = /* @__PURE__ */ ((e) => (e.Txt = "TXT", e.Xlsx = "XLSX", e))(we || {}), $e = /* @__PURE__ */ ((e) => (e.Completed = "COMPLETED", e.Failed = "FAILED", e.Initial = "INITIAL", e.Processing = "PROCESSING", e))($e || {}), Be = /* @__PURE__ */ ((e) => (e.Collector = "COLLECTOR", e.Event = "EVENT", e.Organization = "ORGANIZATION", e.Payout = "PAYOUT", e.Profit = "PROFIT", e.Promoter = "PROMOTER", e.Seller = "SELLER", e))(Be || {}), Ge = /* @__PURE__ */ ((e) => (e.Admin = "ADMIN", e.CashCollector = "CASH_COLLECTOR", e.Collector = "COLLECTOR", e.EventManager = "EVENT_MANAGER", e.HostingManager = "HOSTING_MANAGER", e.LocationManager = "LOCATION_MANAGER", e.OfflineVendor = "OFFLINE_VENDOR", e.OnlineVendor = "ONLINE_VENDOR", e.OrganizationManager = "ORGANIZATION_MANAGER", e.Scanner = "SCANNER", e))(Ge || {}), He = /* @__PURE__ */ ((e) => (e.Day = "DAY", e.Hour = "HOUR", e.Minute = "MINUTE", e.Month = "MONTH", e.Quarter = "QUARTER", e.Week = "WEEK", e.Year = "YEAR", e))(He || {}), ze = /* @__PURE__ */ ((e) => (e.Expired = "EXPIRED", e.Valid = "VALID", e))(ze || {}), Ye = /* @__PURE__ */ ((e) => (e.Addons = "ADDONS", e.AppCustomerHistory = "APP_CUSTOMER_HISTORY", e.Arrivals = "ARRIVALS", e.CalculateCashPayout = "CALCULATE_CASH_PAYOUT", e.Cash = "CASH", e.CashHistory = "CASH_HISTORY", e.Collector = "COLLECTOR", e.Commission = "COMMISSION", e.CountryStatistics = "COUNTRY_STATISTICS", e.CustomField = "CUSTOM_FIELD", e.DepositPrice = "DEPOSIT_PRICE", e.DetailStatistics = "DETAIL_STATISTICS", e.DiscountPrice = "DISCOUNT_PRICE", e.DoorSale = "DOOR_SALE", e.DynamicEvents = "DYNAMIC_EVENTS", e.EmailMarketing = "EMAIL_MARKETING", e.EventCapacity = "EVENT_CAPACITY", e.EventDeliveryOptions = "EVENT_DELIVERY_OPTIONS", e.EventPercentage = "EVENT_PERCENTAGE", e.EventSeatsIntegration = "EVENT_SEATS_INTEGRATION", e.GroupTickets = "GROUP_TICKETS", e.Guest = "GUEST", e.Hosting = "HOSTING", e.Location = "LOCATION", e.Marketing = "MARKETING", e.MobileRefund = "MOBILE_REFUND", e.OrderDetail = "ORDER_DETAIL", e.OrderPending = "ORDER_PENDING", e.OrderRefund = "ORDER_REFUND", e.Override = "OVERRIDE", e.Package = "PACKAGE", e.PaidInAdvance = "PAID_IN_ADVANCE", e.ProductAdditionalInfo = "PRODUCT_ADDITIONAL_INFO", e.ProductPurchasePrice = "PRODUCT_PURCHASE_PRICE", e.Promoter = "PROMOTER", e.Reporting = "REPORTING", e.Role = "ROLE", e.Shop = "SHOP", e.SingleTickets = "SINGLE_TICKETS", e.TapToPay = "TAP_TO_PAY", e.Team = "TEAM", e.TicketLimit = "TICKET_LIMIT", e.TicketSeller = "TICKET_SELLER", e.Token = "TOKEN", e.ViewStatistics = "VIEW_STATISTICS", e))(Ye || {}), qe = /* @__PURE__ */ ((e) => (e.AddOn = "ADD_ON", e.DeliveryOption = "DELIVERY_OPTION", e.EntranceTicket = "ENTRANCE_TICKET", e))(qe || {}), Ke = /* @__PURE__ */ ((e) => (e.Dashboard = "DASHBOARD", e.Offline = "OFFLINE", e.Online = "ONLINE", e.Ticketswap = "TICKETSWAP", e))(Ke || {}), je = /* @__PURE__ */ ((e) => (e.Canceled = "CANCELED", e.Finalized = "FINALIZED", e.PendingFinalization = "PENDING_FINALIZATION", e))(je || {}), We = /* @__PURE__ */ ((e) => (e.Default = "DEFAULT", e.Door = "DOOR", e.Email = "EMAIL", e.Guest = "GUEST", e.Promoter = "PROMOTER", e.Swap = "SWAP", e.Tracker = "TRACKER", e))(We || {}), Xe = /* @__PURE__ */ ((e) => (e.CustomField = "CUSTOM_FIELD", e.Event = "EVENT", e.Guest = "GUEST", e.Hosting = "HOSTING", e.Location = "LOCATION", e.Marketing = "MARKETING", e.Module = "MODULE", e.Organization = "ORGANIZATION", e.Permission = "PERMISSION", e.Product = "PRODUCT", e.Role = "ROLE", e.Shop = "SHOP", e.Team = "TEAM", e.User = "USER", e))(Xe || {}), U = /* @__PURE__ */ ((e) => (e.AdditionalEvent = "ADDITIONAL_EVENT", e.Addon = "ADDON", e.Regular = "REGULAR", e))(U || {}), Qe = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Concept = "CONCEPT", e.Paused = "PAUSED", e.SoldOut = "SOLD_OUT", e))(Qe || {}), Je = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e))(Je || {}), Ze = /* @__PURE__ */ ((e) => (e.Fixed = "FIXED", e.Percentage = "PERCENTAGE", e))(Ze || {}), et = /* @__PURE__ */ ((e) => (e.Collect = "COLLECT", e.Initial = "INITIAL", e))(et || {}), tt = /* @__PURE__ */ ((e) => (e.Canceled = "CANCELED", e.ChargedBack = "CHARGED_BACK", e.Denied = "DENIED", e.Expired = "EXPIRED", e.Failure = "FAILURE", e.Paid = "PAID", e.Refunded = "REFUNDED", e.Rejected = "REJECTED", e))(tt || {}), nt = /* @__PURE__ */ ((e) => (e.Cash = "CASH", e.Digital = "DIGITAL", e.Other = "OTHER", e.TapToPay = "TAP_TO_PAY", e))(nt || {}), rt = /* @__PURE__ */ ((e) => (e.AccessDashboard = "ACCESS_DASHBOARD", e.AccessSale = "ACCESS_SALE", e.AccessScan = "ACCESS_SCAN", e.AdminModuleUpdate = "ADMIN_MODULE_UPDATE", e.AdminModuleView = "ADMIN_MODULE_VIEW", e.AdminOrganizationCreate = "ADMIN_ORGANIZATION_CREATE", e.AdminOrganizationDelete = "ADMIN_ORGANIZATION_DELETE", e.AdminOrganizationView = "ADMIN_ORGANIZATION_VIEW", e.AdminPermissionUpdate = "ADMIN_PERMISSION_UPDATE", e.AdminPermissionView = "ADMIN_PERMISSION_VIEW", e.AdminSuper = "ADMIN_SUPER", e.AdminUserCreate = "ADMIN_USER_CREATE", e.AdminUserDelete = "ADMIN_USER_DELETE", e.AdminUserView = "ADMIN_USER_VIEW", e.CashCollectorStatistics = "CASH_COLLECTOR_STATISTICS", e.CashCollectorView = "CASH_COLLECTOR_VIEW", e.CashDepositCreate = "CASH_DEPOSIT_CREATE", e.CashDepositView = "CASH_DEPOSIT_VIEW", e.CashOnHandView = "CASH_ON_HAND_VIEW", e.CollectorManage = "COLLECTOR_MANAGE", e.CollectorStatistics = "COLLECTOR_STATISTICS", e.CollectorView = "COLLECTOR_VIEW", e.CommissionManage = "COMMISSION_MANAGE", e.CommissionPayoutCreate = "COMMISSION_PAYOUT_CREATE", e.CommissionPayoutView = "COMMISSION_PAYOUT_VIEW", e.CommissionStatistics = "COMMISSION_STATISTICS", e.CommissionView = "COMMISSION_VIEW", e.CustomFieldManage = "CUSTOM_FIELD_MANAGE", e.CustomFieldView = "CUSTOM_FIELD_VIEW", e.EmailRuleManage = "EMAIL_RULE_MANAGE", e.EmailRuleStatistics = "EMAIL_RULE_STATISTICS", e.EmailRuleView = "EMAIL_RULE_VIEW", e.EmailRunStatistics = "EMAIL_RUN_STATISTICS", e.EmailRunView = "EMAIL_RUN_VIEW", e.EventManage = "EVENT_MANAGE", e.EventStatistics = "EVENT_STATISTICS", e.EventView = "EVENT_VIEW", e.GuestManage = "GUEST_MANAGE", e.GuestProductManage = "GUEST_PRODUCT_MANAGE", e.GuestProductStatistics = "GUEST_PRODUCT_STATISTICS", e.GuestProductView = "GUEST_PRODUCT_VIEW", e.GuestView = "GUEST_VIEW", e.HostingManage = "HOSTING_MANAGE", e.HostingStatistics = "HOSTING_STATISTICS", e.HostingView = "HOSTING_VIEW", e.LocationManage = "LOCATION_MANAGE", e.LocationStatistics = "LOCATION_STATISTICS", e.LocationView = "LOCATION_VIEW", e.NoteManage = "NOTE_MANAGE", e.NoteView = "NOTE_VIEW", e.OrderCreateDoor = "ORDER_CREATE_DOOR", e.OrderCreateSeller = "ORDER_CREATE_SELLER", e.OrderManage = "ORDER_MANAGE", e.OrderView = "ORDER_VIEW", e.OrganizationManage = "ORGANIZATION_MANAGE", e.OrganizationStatistics = "ORGANIZATION_STATISTICS", e.OrganizationSuper = "ORGANIZATION_SUPER", e.OverrideManage = "OVERRIDE_MANAGE", e.PackageManage = "PACKAGE_MANAGE", e.PackageStatistics = "PACKAGE_STATISTICS", e.PackageView = "PACKAGE_VIEW", e.ProductManage = "PRODUCT_MANAGE", e.ProductStatistics = "PRODUCT_STATISTICS", e.ProductView = "PRODUCT_VIEW", e.PromoterManage = "PROMOTER_MANAGE", e.PromoterStatistics = "PROMOTER_STATISTICS", e.PromoterView = "PROMOTER_VIEW", e.ReportingManage = "REPORTING_MANAGE", e.ReportingView = "REPORTING_VIEW", e.RoleAssign = "ROLE_ASSIGN", e.RoleManage = "ROLE_MANAGE", e.RoleView = "ROLE_VIEW", e.SellerManage = "SELLER_MANAGE", e.SellerStatistics = "SELLER_STATISTICS", e.SellerView = "SELLER_VIEW", e.ShopManage = "SHOP_MANAGE", e.ShopView = "SHOP_VIEW", e.TeamManage = "TEAM_MANAGE", e.TeamStatistics = "TEAM_STATISTICS", e.TeamUserInvite = "TEAM_USER_INVITE", e.TeamUserRemove = "TEAM_USER_REMOVE", e.TeamView = "TEAM_VIEW", e.TemplateManage = "TEMPLATE_MANAGE", e.TemplateView = "TEMPLATE_VIEW", e.TicketLimitManage = "TICKET_LIMIT_MANAGE", e.TicketLimitView = "TICKET_LIMIT_VIEW", e.TokenManage = "TOKEN_MANAGE", e.TokenView = "TOKEN_VIEW", e.TrackerManage = "TRACKER_MANAGE", e.TrackerStatistics = "TRACKER_STATISTICS", e.TrackerView = "TRACKER_VIEW", e.UserInviteManage = "USER_INVITE_MANAGE", e.UserInviteView = "USER_INVITE_VIEW", e.UserManage = "USER_MANAGE", e.UserView = "USER_VIEW", e))(rt || {}), it = /* @__PURE__ */ ((e) => (e.AllReserved = "ALL_RESERVED", e.Available = "AVAILABLE", e.SoldOut = "SOLD_OUT", e))(it || {}), st = /* @__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))(st || {}), at = /* @__PURE__ */ ((e) => (e.Other = "OTHER", e.Ticketapp = "TICKETAPP", e))(at || {}), ot = /* @__PURE__ */ ((e) => (e.Email = "EMAIL", e.Phone = "PHONE", e))(ot || {}), dt = /* @__PURE__ */ ((e) => (e.Cancelled = "CANCELLED", e.Completed = "COMPLETED", e.Failed = "FAILED", e.Pending = "PENDING", e.Processing = "PROCESSING", e))(dt || {}), ct = /* @__PURE__ */ ((e) => (e.Csv = "CSV", e.Txt = "TXT", e))(ct || {}), ut = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e))(ut || {}), lt = /* @__PURE__ */ ((e) => (e.NonPaid = "NON_PAID", e.Paid = "PAID", e))(lt || {}), ht = /* @__PURE__ */ ((e) => (e.CashCollector = "CASH_COLLECTOR", e.Collector = "COLLECTOR", e.CommissionPayouts = "COMMISSION_PAYOUTS", e.GuestManager = "GUEST_MANAGER", e.OfflineVendor = "OFFLINE_VENDOR", e.OnlineVendor = "ONLINE_VENDOR", e))(ht || {}), Et = /* @__PURE__ */ ((e) => (e.Offline = "OFFLINE", e.Online = "ONLINE", e))(Et || {}), It = /* @__PURE__ */ ((e) => (e.Door = "DOOR", e.Promoter = "PROMOTER", e.Seller = "SELLER", e.Web = "WEB", e))(It || {}), gt = /* @__PURE__ */ ((e) => (e.AlreadyScanned = "ALREADY_SCANNED", e.AlreadyScannedByGroup = "ALREADY_SCANNED_BY_GROUP", e.InvalidDate = "INVALID_DATE", e.MaxScanAmountReached = "MAX_SCAN_AMOUNT_REACHED", e.NotFinalized = "NOT_FINALIZED", e.NotFoundForEvent = "NOT_FOUND_FOR_EVENT", e.TicketSwapped = "TICKET_SWAPPED", e))(gt || {}), ft = /* @__PURE__ */ ((e) => (e.Default = "DEFAULT", e.Transparent = "TRANSPARENT", e))(ft || {}), pt = /* @__PURE__ */ ((e) => (e.Calendar = "CALENDAR", e.Large = "LARGE", e.Small = "SMALL", e))(pt || {}), At = /* @__PURE__ */ ((e) => (e.Asc = "ASC", e.Desc = "DESC", e))(At || {}), mt = /* @__PURE__ */ ((e) => (e.Canceled = "CANCELED", e.CashTransaction = "CASH_TRANSACTION", e.CashTransactionDeposit = "CASH_TRANSACTION_DEPOSIT", e.Collect = "COLLECT", e.Commission = "COMMISSION", e.CommissionPayout = "COMMISSION_PAYOUT", e.Refunded = "REFUNDED", e.Sale = "SALE", e.Scan = "SCAN", e))(mt || {}), Ot = /* @__PURE__ */ ((e) => (e.Past = "PAST", e.Upcoming = "UPCOMING", e))(Ot || {}), Tt = /* @__PURE__ */ ((e) => (e.Collector = "COLLECTOR", e.Offline = "OFFLINE", e.Online = "ONLINE", e))(Tt || {}), Nt = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Expired = "EXPIRED", e.Inactive = "INACTIVE", e))(Nt || {}), Dt = /* @__PURE__ */ ((e) => (e.Team = "TEAM", e.User = "USER", e))(Dt || {}), _t = /* @__PURE__ */ ((e) => (e.Event = "EVENT", e.Hosting = "HOSTING", e.Location = "LOCATION", e.Package = "PACKAGE", e))(_t || {}), vt = /* @__PURE__ */ ((e) => (e.FullyPickedUp = "FULLY_PICKED_UP", e.NotPicketUp = "NOT_PICKET_UP", e.PartialPicketUp = "PARTIAL_PICKET_UP", e))(vt || {}), Pt = /* @__PURE__ */ ((e) => (e.Email = "EMAIL", e.Facebook = "FACEBOOK", e.Instagram = "INSTAGRAM", e.Qr = "QR", e.Sms = "SMS", e.Snapchat = "SNAPCHAT", e.Tiktok = "TIKTOK", e.Twitter = "TWITTER", e.Website = "WEBSITE", e))(Pt || {}), Rt = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e))(Rt || {}), Lt = /* @__PURE__ */ ((e) => (e.Default = "DEFAULT", e.DiscountedPrices = "DISCOUNTED_PRICES", e.DiscountedProducts = "DISCOUNTED_PRODUCTS", e))(Lt || {}), kt = /* @__PURE__ */ ((e) => (e.Active = "ACTIVE", e.Inactive = "INACTIVE", e.Invited = "INVITED", e))(kt || {});
|
|
2329
2329
|
const St = I`
|
|
2330
2330
|
query findActiveOrderById($id: String) {
|
|
2331
2331
|
findOrder(id: $id) {
|
|
@@ -2464,6 +2464,7 @@ const St = I`
|
|
|
2464
2464
|
banner
|
|
2465
2465
|
description
|
|
2466
2466
|
addonDescription
|
|
2467
|
+
startingPrice
|
|
2467
2468
|
startAt
|
|
2468
2469
|
endAt
|
|
2469
2470
|
timezone
|
|
@@ -2772,63 +2773,63 @@ const St = I`
|
|
|
2772
2773
|
mutation createDigitalPayment($input: CreateDigitalOrderPaymentInput!) {
|
|
2773
2774
|
createDigitalOrderPayment(input: $input)
|
|
2774
2775
|
}
|
|
2775
|
-
`,
|
|
2776
|
-
function C(e, t =
|
|
2776
|
+
`, Wn = (e, t, n, i) => e();
|
|
2777
|
+
function C(e, t = Wn) {
|
|
2777
2778
|
return {
|
|
2778
|
-
findActiveOrderById(
|
|
2779
|
-
return t((s) => e.request({ document: St, variables:
|
|
2779
|
+
findActiveOrderById(n, i, r) {
|
|
2780
|
+
return t((s) => e.request({ document: St, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findActiveOrderById", "query", n);
|
|
2780
2781
|
},
|
|
2781
|
-
addToOrder(
|
|
2782
|
-
return t((s) => e.request({ document: Ct, variables:
|
|
2782
|
+
addToOrder(n, i, r) {
|
|
2783
|
+
return t((s) => e.request({ document: Ct, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "addToOrder", "mutation", n);
|
|
2783
2784
|
},
|
|
2784
|
-
removeFromOrder(
|
|
2785
|
-
return t((s) => e.request({ document: xt, variables:
|
|
2785
|
+
removeFromOrder(n, i, r) {
|
|
2786
|
+
return t((s) => e.request({ document: xt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "removeFromOrder", "mutation", n);
|
|
2786
2787
|
},
|
|
2787
|
-
configurePackage(
|
|
2788
|
-
return t((s) => e.request({ document: bt, variables:
|
|
2788
|
+
configurePackage(n, i, r) {
|
|
2789
|
+
return t((s) => e.request({ document: bt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "configurePackage", "mutation", n);
|
|
2789
2790
|
},
|
|
2790
|
-
configureOrderDeliveryOption(
|
|
2791
|
-
return t((s) => e.request({ document: Ft, variables:
|
|
2791
|
+
configureOrderDeliveryOption(n, i, r) {
|
|
2792
|
+
return t((s) => e.request({ document: Ft, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "configureOrderDeliveryOption", "mutation", n);
|
|
2792
2793
|
},
|
|
2793
|
-
createOrderCustomer(
|
|
2794
|
-
return t((s) => e.request({ document: yt, variables:
|
|
2794
|
+
createOrderCustomer(n, i, r) {
|
|
2795
|
+
return t((s) => e.request({ document: yt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "createOrderCustomer", "mutation", n);
|
|
2795
2796
|
},
|
|
2796
|
-
deleteOrder(
|
|
2797
|
-
return t((s) => e.request({ document: Ut, variables:
|
|
2797
|
+
deleteOrder(n, i, r) {
|
|
2798
|
+
return t((s) => e.request({ document: Ut, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "deleteOrder", "mutation", n);
|
|
2798
2799
|
},
|
|
2799
|
-
EventOverviewPage(
|
|
2800
|
-
return t((s) => e.request({ document: Mt, variables:
|
|
2800
|
+
EventOverviewPage(n, i, r) {
|
|
2801
|
+
return t((s) => e.request({ document: Mt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "EventOverviewPage", "query", n);
|
|
2801
2802
|
},
|
|
2802
|
-
findProductsByEventId(
|
|
2803
|
-
return t((s) => e.request({ document: Vt, variables:
|
|
2803
|
+
findProductsByEventId(n, i, r) {
|
|
2804
|
+
return t((s) => e.request({ document: Vt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findProductsByEventId", "query", n);
|
|
2804
2805
|
},
|
|
2805
|
-
findAllPackages(
|
|
2806
|
-
return t((s) => e.request({ document: wt, variables:
|
|
2806
|
+
findAllPackages(n, i, r) {
|
|
2807
|
+
return t((s) => e.request({ document: wt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findAllPackages", "query", n);
|
|
2807
2808
|
},
|
|
2808
|
-
findAllPackageItems(
|
|
2809
|
-
return t((s) => e.request({ document: $t, variables:
|
|
2809
|
+
findAllPackageItems(n, i, r) {
|
|
2810
|
+
return t((s) => e.request({ document: $t, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findAllPackageItems", "query", n);
|
|
2810
2811
|
},
|
|
2811
|
-
setPackageItemToOrder(
|
|
2812
|
-
return t((s) => e.request({ document: Bt, variables:
|
|
2812
|
+
setPackageItemToOrder(n, i, r) {
|
|
2813
|
+
return t((s) => e.request({ document: Bt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "setPackageItemToOrder", "mutation", n);
|
|
2813
2814
|
},
|
|
2814
|
-
setAdditionalPackageItemToOrder(
|
|
2815
|
-
return t((s) => e.request({ document: Gt, variables:
|
|
2815
|
+
setAdditionalPackageItemToOrder(n, i, r) {
|
|
2816
|
+
return t((s) => e.request({ document: Gt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "setAdditionalPackageItemToOrder", "mutation", n);
|
|
2816
2817
|
},
|
|
2817
|
-
findAllPublicPackagesByOrganizationId(
|
|
2818
|
-
return t((s) => e.request({ document: Ht, variables:
|
|
2818
|
+
findAllPublicPackagesByOrganizationId(n, i, r) {
|
|
2819
|
+
return t((s) => e.request({ document: Ht, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findAllPublicPackagesByOrganizationId", "query", n);
|
|
2819
2820
|
},
|
|
2820
|
-
findPublicItemsByPackageId(
|
|
2821
|
-
return t((s) => e.request({ document: zt, variables:
|
|
2821
|
+
findPublicItemsByPackageId(n, i, r) {
|
|
2822
|
+
return t((s) => e.request({ document: zt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findPublicItemsByPackageId", "query", n);
|
|
2822
2823
|
},
|
|
2823
|
-
findPaymentMethods(
|
|
2824
|
-
return t((s) => e.request({ document: Yt, variables:
|
|
2824
|
+
findPaymentMethods(n, i, r) {
|
|
2825
|
+
return t((s) => e.request({ document: Yt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "findPaymentMethods", "query", n);
|
|
2825
2826
|
},
|
|
2826
|
-
createDigitalPayment(
|
|
2827
|
-
return t((s) => e.request({ document: qt, variables:
|
|
2827
|
+
createDigitalPayment(n, i, r) {
|
|
2828
|
+
return t((s) => e.request({ document: qt, variables: n, requestHeaders: { ...i, ...s }, signal: r }), "createDigitalPayment", "mutation", n);
|
|
2828
2829
|
}
|
|
2829
2830
|
};
|
|
2830
2831
|
}
|
|
2831
|
-
const
|
|
2832
|
+
const Xn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2832
2833
|
__proto__: null,
|
|
2833
2834
|
AddToOrderDocument: Ct,
|
|
2834
2835
|
CacheControlScope: Le,
|
|
@@ -2873,8 +2874,8 @@ const Wr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2873
2874
|
PaymentMethodFeeType: Ze,
|
|
2874
2875
|
PaymentSalesType: et,
|
|
2875
2876
|
PaymentStatus: tt,
|
|
2876
|
-
PaymentType:
|
|
2877
|
-
PermissionScope:
|
|
2877
|
+
PaymentType: nt,
|
|
2878
|
+
PermissionScope: rt,
|
|
2878
2879
|
ProductStatus: it,
|
|
2879
2880
|
ProductType: st,
|
|
2880
2881
|
RefundType: at,
|
|
@@ -2905,7 +2906,7 @@ const Wr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
2905
2906
|
TrackerType: Lt,
|
|
2906
2907
|
UserStatus: kt,
|
|
2907
2908
|
getSdk: C
|
|
2908
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
2909
|
+
}, Symbol.toStringTag, { value: "Module" })), Qn = "https://api.ticketapp.com/graphql";
|
|
2909
2910
|
class Kt {
|
|
2910
2911
|
config;
|
|
2911
2912
|
sdk;
|
|
@@ -2918,8 +2919,8 @@ class Kt {
|
|
|
2918
2919
|
event: ge
|
|
2919
2920
|
}
|
|
2920
2921
|
});
|
|
2921
|
-
const
|
|
2922
|
-
this.sdk = C(
|
|
2922
|
+
const n = new M(t.apiUrl ?? Qn);
|
|
2923
|
+
this.sdk = C(n);
|
|
2923
2924
|
}
|
|
2924
2925
|
getState() {
|
|
2925
2926
|
return this.store.getState().event;
|
|
@@ -2927,13 +2928,13 @@ class Kt {
|
|
|
2927
2928
|
subscribe(t) {
|
|
2928
2929
|
return this.store.subscribe(t);
|
|
2929
2930
|
}
|
|
2930
|
-
debugLog(t,
|
|
2931
|
-
this.config.debug && console.log(`[EventService:${this.config.organizationId}] ${t}`,
|
|
2931
|
+
debugLog(t, n) {
|
|
2932
|
+
this.config.debug && console.log(`[EventService:${this.config.organizationId}] ${t}`, n || "");
|
|
2932
2933
|
}
|
|
2933
2934
|
async fetchEvents(t = {}) {
|
|
2934
2935
|
this.store.dispatch(H(!0));
|
|
2935
2936
|
try {
|
|
2936
|
-
const
|
|
2937
|
+
const n = sessionStorage.getItem("TIC_TRACKER_ID") || void 0, i = t.locationIds ?? this.config.filteredLocationIds, r = t.hostingIds ?? this.config.filteredHostingIds;
|
|
2937
2938
|
let s;
|
|
2938
2939
|
if (t.startDate || t.endDate) {
|
|
2939
2940
|
const l = t.startDate ? typeof t.startDate == "string" ? t.startDate : t.startDate.toISOString() : (/* @__PURE__ */ new Date(0)).toISOString(), E = t.endDate ? typeof t.endDate == "string" ? t.endDate : t.endDate.toISOString() : (/* @__PURE__ */ new Date("2099-12-31")).toISOString();
|
|
@@ -2949,25 +2950,25 @@ class Kt {
|
|
|
2949
2950
|
}), this.debugLog("Fetching events with parameters", {
|
|
2950
2951
|
organizationId: this.config.organizationId,
|
|
2951
2952
|
locationIds: i,
|
|
2952
|
-
hostingIds:
|
|
2953
|
+
hostingIds: r,
|
|
2953
2954
|
eventIds: t.eventIds,
|
|
2954
2955
|
filterEventStatuses: t.filterEventStatuses,
|
|
2955
2956
|
dateRange: s,
|
|
2956
2957
|
page: o,
|
|
2957
2958
|
sorts: t.sorts,
|
|
2958
|
-
trackerId:
|
|
2959
|
+
trackerId: n,
|
|
2959
2960
|
showDoorTickets: this.config.enableDoorTickets
|
|
2960
2961
|
});
|
|
2961
2962
|
const c = await this.sdk.EventOverviewPage({
|
|
2962
2963
|
organizationId: this.config.organizationId,
|
|
2963
2964
|
locationIds: i,
|
|
2964
|
-
hostingIds:
|
|
2965
|
+
hostingIds: r,
|
|
2965
2966
|
eventIds: t.eventIds,
|
|
2966
2967
|
filterEventStatuses: t.filterEventStatuses,
|
|
2967
2968
|
dateRange: s,
|
|
2968
2969
|
page: o,
|
|
2969
2970
|
sorts: t.sorts,
|
|
2970
|
-
trackerId:
|
|
2971
|
+
trackerId: n,
|
|
2971
2972
|
showDoorTickets: this.config.enableDoorTickets
|
|
2972
2973
|
});
|
|
2973
2974
|
if (this.debugLog("Raw GraphQL response", c), c?.findAllPublicEventByOrganizationId?.data) {
|
|
@@ -2992,6 +2993,7 @@ class Kt {
|
|
|
2992
2993
|
name: h.location.name,
|
|
2993
2994
|
address: h.location.address
|
|
2994
2995
|
} : { id: "", name: "", address: null },
|
|
2996
|
+
startingPrice: h.startingPrice ?? 0,
|
|
2995
2997
|
products: []
|
|
2996
2998
|
})), E = c.findAllPublicEventByOrganizationId.count ?? 0, d = o?.index ?? 0, A = o?.size ?? l.length, g = l.length === A, O = d > 0, f = {
|
|
2997
2999
|
count: l.length,
|
|
@@ -3011,26 +3013,26 @@ class Kt {
|
|
|
3011
3013
|
hasNextPage: !1,
|
|
3012
3014
|
hasPreviousPage: !1
|
|
3013
3015
|
}));
|
|
3014
|
-
} catch (
|
|
3015
|
-
throw this.debugLog("Error fetching events",
|
|
3016
|
+
} catch (n) {
|
|
3017
|
+
throw this.debugLog("Error fetching events", n), this.store.dispatch(he(n.message || "Failed to fetch events")), n;
|
|
3016
3018
|
} finally {
|
|
3017
3019
|
this.store.dispatch(H(!1));
|
|
3018
3020
|
}
|
|
3019
3021
|
}
|
|
3020
|
-
async fetchProductsForEvent(t,
|
|
3022
|
+
async fetchProductsForEvent(t, n, i) {
|
|
3021
3023
|
this.store.dispatch(q({ eventId: t, loading: !0 }));
|
|
3022
3024
|
try {
|
|
3023
|
-
const
|
|
3025
|
+
const r = sessionStorage.getItem("TIC_TRACKER_ID") || void 0, s = this.config.enableDoorTickets && n ? n : void 0;
|
|
3024
3026
|
this.debugLog("Fetching products for event", {
|
|
3025
3027
|
eventId: t,
|
|
3026
3028
|
promoCode: i,
|
|
3027
|
-
trackerId:
|
|
3029
|
+
trackerId: r,
|
|
3028
3030
|
productTypes: s
|
|
3029
3031
|
});
|
|
3030
3032
|
const o = await this.sdk.findProductsByEventId({
|
|
3031
3033
|
eventId: t,
|
|
3032
3034
|
promoCode: i,
|
|
3033
|
-
trackerId:
|
|
3035
|
+
trackerId: r,
|
|
3034
3036
|
productTypes: s
|
|
3035
3037
|
});
|
|
3036
3038
|
if (o?.findPublicProductsByEventId) {
|
|
@@ -3044,8 +3046,8 @@ class Kt {
|
|
|
3044
3046
|
}), this.store.dispatch(Ie({ eventId: t, products: c })), c;
|
|
3045
3047
|
}
|
|
3046
3048
|
return;
|
|
3047
|
-
} catch (
|
|
3048
|
-
throw this.debugLog("Error fetching products", { eventId: t, error:
|
|
3049
|
+
} catch (r) {
|
|
3050
|
+
throw this.debugLog("Error fetching products", { eventId: t, error: r }), r;
|
|
3049
3051
|
} finally {
|
|
3050
3052
|
this.store.dispatch(q({ eventId: t, loading: !1 }));
|
|
3051
3053
|
}
|
|
@@ -3054,32 +3056,32 @@ class Kt {
|
|
|
3054
3056
|
this.debugLog("Clearing events"), this.store.dispatch(Ee());
|
|
3055
3057
|
}
|
|
3056
3058
|
}
|
|
3057
|
-
const
|
|
3059
|
+
const Jn = "https://api.ticketapp.com/graphql";
|
|
3058
3060
|
class jt {
|
|
3059
3061
|
config;
|
|
3060
3062
|
sdk;
|
|
3061
3063
|
constructor(t = {}) {
|
|
3062
3064
|
this.config = t;
|
|
3063
|
-
const
|
|
3065
|
+
const n = new M(t.apiUrl ?? Jn, {
|
|
3064
3066
|
headers: t.headers
|
|
3065
3067
|
});
|
|
3066
|
-
this.sdk = C(
|
|
3068
|
+
this.sdk = C(n);
|
|
3067
3069
|
}
|
|
3068
|
-
debugLog(t,
|
|
3069
|
-
this.config.debug && console.log(`[PaymentService] ${t}`,
|
|
3070
|
+
debugLog(t, n) {
|
|
3071
|
+
this.config.debug && console.log(`[PaymentService] ${t}`, n || "");
|
|
3070
3072
|
}
|
|
3071
3073
|
async getPaymentMethods(t) {
|
|
3072
3074
|
this.debugLog("Fetching payment methods", t);
|
|
3073
3075
|
try {
|
|
3074
|
-
const
|
|
3076
|
+
const n = await this.sdk.findPaymentMethods({
|
|
3075
3077
|
orderId: t.orderId,
|
|
3076
3078
|
orderItemId: t.orderItemId,
|
|
3077
3079
|
amountOfTickets: t.amountOfTickets,
|
|
3078
3080
|
paymentMethodId: t.paymentMethodId
|
|
3079
3081
|
});
|
|
3080
|
-
if (!
|
|
3082
|
+
if (!n?.findPaymentDetails)
|
|
3081
3083
|
throw this.debugLog("No payment details found"), new Error("No payment details found for this order");
|
|
3082
|
-
const i =
|
|
3084
|
+
const i = n.findPaymentDetails;
|
|
3083
3085
|
return this.debugLog("Payment methods fetched successfully", {
|
|
3084
3086
|
methodCount: i.methods?.length ?? 0,
|
|
3085
3087
|
transactionPrice: i.transactionPrice,
|
|
@@ -3089,29 +3091,29 @@ class jt {
|
|
|
3089
3091
|
transactionPrice: i.transactionPrice,
|
|
3090
3092
|
baseTransactionFee: i.baseTransactionFee ?? null,
|
|
3091
3093
|
additionalTransactionFee: i.additionalTransactionFee ?? null,
|
|
3092
|
-
methods: i.methods?.map((
|
|
3093
|
-
id:
|
|
3094
|
-
name:
|
|
3095
|
-
image:
|
|
3096
|
-
fee:
|
|
3097
|
-
type:
|
|
3098
|
-
value:
|
|
3094
|
+
methods: i.methods?.map((r) => ({
|
|
3095
|
+
id: r.id,
|
|
3096
|
+
name: r.name,
|
|
3097
|
+
image: r.image,
|
|
3098
|
+
fee: r.fee ? {
|
|
3099
|
+
type: r.fee.type,
|
|
3100
|
+
value: r.fee.value
|
|
3099
3101
|
} : null,
|
|
3100
|
-
issuers:
|
|
3102
|
+
issuers: r.issuers?.map((s) => ({
|
|
3101
3103
|
id: s.id,
|
|
3102
3104
|
name: s.name,
|
|
3103
3105
|
image: s.image
|
|
3104
3106
|
})) ?? null
|
|
3105
3107
|
})) ?? null
|
|
3106
3108
|
};
|
|
3107
|
-
} catch (
|
|
3108
|
-
throw this.debugLog("Error fetching payment methods",
|
|
3109
|
+
} catch (n) {
|
|
3110
|
+
throw this.debugLog("Error fetching payment methods", n), n;
|
|
3109
3111
|
}
|
|
3110
3112
|
}
|
|
3111
3113
|
async createPayment(t) {
|
|
3112
3114
|
this.debugLog("Creating payment", t);
|
|
3113
3115
|
try {
|
|
3114
|
-
const
|
|
3116
|
+
const n = {
|
|
3115
3117
|
orderId: t.orderId,
|
|
3116
3118
|
paymentMethodId: t.paymentMethodId,
|
|
3117
3119
|
issuerId: t.issuerId,
|
|
@@ -3121,33 +3123,33 @@ class jt {
|
|
|
3121
3123
|
orderItemId: t.orderItemId,
|
|
3122
3124
|
amountOfTickets: t.amountOfTickets
|
|
3123
3125
|
};
|
|
3124
|
-
t.customer && (
|
|
3126
|
+
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);
|
|
3125
3127
|
const i = await this.sdk.createDigitalPayment({
|
|
3126
|
-
input:
|
|
3128
|
+
input: n
|
|
3127
3129
|
});
|
|
3128
3130
|
if (!i?.createDigitalOrderPayment)
|
|
3129
3131
|
throw this.debugLog("Failed to create payment"), new Error("Failed to create payment for this order");
|
|
3130
|
-
const
|
|
3132
|
+
const r = i.createDigitalOrderPayment;
|
|
3131
3133
|
return this.debugLog("Payment created successfully", {
|
|
3132
|
-
paymentUrl:
|
|
3134
|
+
paymentUrl: r
|
|
3133
3135
|
}), {
|
|
3134
|
-
paymentUrl:
|
|
3136
|
+
paymentUrl: r
|
|
3135
3137
|
};
|
|
3136
|
-
} catch (
|
|
3137
|
-
throw this.debugLog("Error creating payment",
|
|
3138
|
+
} catch (n) {
|
|
3139
|
+
throw this.debugLog("Error creating payment", n), n;
|
|
3138
3140
|
}
|
|
3139
3141
|
}
|
|
3140
|
-
calculateTotalWithFee(t,
|
|
3141
|
-
return
|
|
3142
|
+
calculateTotalWithFee(t, n) {
|
|
3143
|
+
return n.fee ? n.fee.type === "FIXED" ? t + n.fee.value : n.fee.type === "PERCENTAGE" ? t + t * (n.fee.value / 100) : t : t;
|
|
3142
3144
|
}
|
|
3143
|
-
calculateFee(t,
|
|
3144
|
-
return
|
|
3145
|
+
calculateFee(t, n) {
|
|
3146
|
+
return n.fee ? n.fee.type === "FIXED" ? n.fee.value : n.fee.type === "PERCENTAGE" ? t * (n.fee.value / 100) : 0 : 0;
|
|
3145
3147
|
}
|
|
3146
|
-
formatFee(t,
|
|
3147
|
-
return t.fee ? t.fee.type === "FIXED" ? `${
|
|
3148
|
+
formatFee(t, n = "€") {
|
|
3149
|
+
return t.fee ? t.fee.type === "FIXED" ? `${n}${t.fee.value.toFixed(2)}` : t.fee.type === "PERCENTAGE" ? `${t.fee.value}%` : "Free" : "Free";
|
|
3148
3150
|
}
|
|
3149
3151
|
}
|
|
3150
|
-
const
|
|
3152
|
+
const Zn = "https://api.ticketapp.com/graphql";
|
|
3151
3153
|
class Wt {
|
|
3152
3154
|
config;
|
|
3153
3155
|
sdk;
|
|
@@ -3157,88 +3159,88 @@ class Wt {
|
|
|
3157
3159
|
this.config = {
|
|
3158
3160
|
...t
|
|
3159
3161
|
};
|
|
3160
|
-
const
|
|
3161
|
-
this.sdk = C(
|
|
3162
|
+
const n = new M(t.apiUrl ?? Zn);
|
|
3163
|
+
this.sdk = C(n);
|
|
3162
3164
|
}
|
|
3163
|
-
debugLog(t,
|
|
3164
|
-
this.config.debug && console.log(`[PackageService] ${t}`,
|
|
3165
|
+
debugLog(t, n) {
|
|
3166
|
+
this.config.debug && console.log(`[PackageService] ${t}`, n || "");
|
|
3165
3167
|
}
|
|
3166
3168
|
async getPackages(t = {}) {
|
|
3167
3169
|
try {
|
|
3168
|
-
let
|
|
3169
|
-
t.page && (
|
|
3170
|
+
let n;
|
|
3171
|
+
t.page && (n = {
|
|
3170
3172
|
index: t.page.index ?? 0,
|
|
3171
3173
|
size: t.page.size ?? 20
|
|
3172
3174
|
}), this.debugLog("Fetching public packages", {
|
|
3173
3175
|
organizationId: this.config.organizationId,
|
|
3174
|
-
page:
|
|
3176
|
+
page: n,
|
|
3175
3177
|
tab: t.tab,
|
|
3176
3178
|
statuses: t.statuses
|
|
3177
3179
|
});
|
|
3178
3180
|
const i = await this.sdk.findAllPublicPackagesByOrganizationId({
|
|
3179
3181
|
organizationId: this.config.organizationId,
|
|
3180
|
-
page:
|
|
3182
|
+
page: n,
|
|
3181
3183
|
tab: t.tab,
|
|
3182
3184
|
statuses: t.statuses
|
|
3183
3185
|
});
|
|
3184
3186
|
if (i?.findAllPublicPackagesByOrganizationId) {
|
|
3185
|
-
const
|
|
3187
|
+
const r = i.findAllPublicPackagesByOrganizationId;
|
|
3186
3188
|
return this.debugLog("Public packages fetched", {
|
|
3187
|
-
count:
|
|
3188
|
-
dataLength:
|
|
3189
|
-
}),
|
|
3189
|
+
count: r.count,
|
|
3190
|
+
dataLength: r.data.length
|
|
3191
|
+
}), r;
|
|
3190
3192
|
}
|
|
3191
3193
|
return null;
|
|
3192
|
-
} catch (
|
|
3193
|
-
throw this.debugLog("Error fetching public packages",
|
|
3194
|
+
} catch (n) {
|
|
3195
|
+
throw this.debugLog("Error fetching public packages", n), n;
|
|
3194
3196
|
}
|
|
3195
3197
|
}
|
|
3196
|
-
async getPackageItems(t,
|
|
3198
|
+
async getPackageItems(t, n = [U.Regular, U.AdditionalEvent]) {
|
|
3197
3199
|
try {
|
|
3198
|
-
this.debugLog("Fetching public package items", { packageId: t, types:
|
|
3200
|
+
this.debugLog("Fetching public package items", { packageId: t, types: n });
|
|
3199
3201
|
const i = await this.sdk.findPublicItemsByPackageId({
|
|
3200
3202
|
packageId: t,
|
|
3201
|
-
types:
|
|
3203
|
+
types: n,
|
|
3202
3204
|
page: { index: 0, size: 100 }
|
|
3203
3205
|
});
|
|
3204
3206
|
if (i?.findPublicItemsByPackageId) {
|
|
3205
|
-
const
|
|
3207
|
+
const r = i.findPublicItemsByPackageId;
|
|
3206
3208
|
return this.debugLog("Public package items fetched", {
|
|
3207
|
-
count:
|
|
3208
|
-
dataLength:
|
|
3209
|
-
}),
|
|
3209
|
+
count: r.count,
|
|
3210
|
+
dataLength: r.data.length
|
|
3211
|
+
}), r;
|
|
3210
3212
|
}
|
|
3211
3213
|
return null;
|
|
3212
3214
|
} catch (i) {
|
|
3213
3215
|
throw this.debugLog("Error fetching public package items", i), i;
|
|
3214
3216
|
}
|
|
3215
3217
|
}
|
|
3216
|
-
async setPackageToOrder(t,
|
|
3218
|
+
async setPackageToOrder(t, n, i) {
|
|
3217
3219
|
try {
|
|
3218
|
-
this.debugLog("Setting package to order", { sessionId: t, items:
|
|
3219
|
-
const
|
|
3220
|
+
this.debugLog("Setting package to order", { sessionId: t, items: n, amount: i });
|
|
3221
|
+
const r = await this.sdk.setPackageItemToOrder({
|
|
3220
3222
|
sessionId: t,
|
|
3221
3223
|
amount: i,
|
|
3222
|
-
items:
|
|
3224
|
+
items: n
|
|
3223
3225
|
});
|
|
3224
|
-
return
|
|
3225
|
-
} catch (
|
|
3226
|
-
throw this.debugLog("Error setting package to order",
|
|
3226
|
+
return r?.setPackageItemToOrder ? (this.debugLog("Package set successfully", r.setPackageItemToOrder), r.setPackageItemToOrder) : null;
|
|
3227
|
+
} catch (r) {
|
|
3228
|
+
throw this.debugLog("Error setting package to order", r), r;
|
|
3227
3229
|
}
|
|
3228
3230
|
}
|
|
3229
|
-
async setAdditionalPackageItem(t,
|
|
3231
|
+
async setAdditionalPackageItem(t, n, i, r) {
|
|
3230
3232
|
try {
|
|
3231
3233
|
this.debugLog("Setting additional package item", {
|
|
3232
3234
|
sessionId: t,
|
|
3233
|
-
packageItemId:
|
|
3235
|
+
packageItemId: n,
|
|
3234
3236
|
eventId: i,
|
|
3235
|
-
amount:
|
|
3237
|
+
amount: r
|
|
3236
3238
|
});
|
|
3237
3239
|
const s = await this.sdk.setAdditionalPackageItemToOrder({
|
|
3238
3240
|
sessionId: t,
|
|
3239
|
-
packageItemId:
|
|
3241
|
+
packageItemId: n,
|
|
3240
3242
|
eventId: i,
|
|
3241
|
-
amount:
|
|
3243
|
+
amount: r
|
|
3242
3244
|
});
|
|
3243
3245
|
return s?.setAdditionalPackageItemToOrder ? (this.debugLog("Additional package item set successfully", s.setAdditionalPackageItemToOrder), s.setAdditionalPackageItemToOrder) : null;
|
|
3244
3246
|
} catch (s) {
|
|
@@ -3247,7 +3249,7 @@ class Wt {
|
|
|
3247
3249
|
}
|
|
3248
3250
|
}
|
|
3249
3251
|
var D = /* @__PURE__ */ ((e) => (e.PACKAGE = "PACKAGE", e.PRODUCT = "PRODUCT", e.ADD_ONS = "ADD_ONS", e.DELIVERY = "DELIVERY", e.PICKUP = "PICKUP", e))(D || {}), Xt = /* @__PURE__ */ ((e) => (e.Ticket = "Ticket", e.Door = "Door", e.Addon = "Addon", e.Promoter = "Promoter", e.Pickup = "Pickup", e.Delivery = "Delivery", e))(Xt || {}), Qt = /* @__PURE__ */ ((e) => (e.FIXED = "FIXED", e.PERCENTAGE = "PERCENTAGE", e))(Qt || {}), Jt = /* @__PURE__ */ ((e) => (e.AdditionalEvent = "ADDITIONAL_EVENT", e.Addon = "ADDON", e.Regular = "REGULAR", e))(Jt || {});
|
|
3250
|
-
const
|
|
3252
|
+
const er = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3251
3253
|
__proto__: null,
|
|
3252
3254
|
BasketOrderType: D,
|
|
3253
3255
|
BasketService: Zt,
|
|
@@ -3257,7 +3259,7 @@ const Zr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3257
3259
|
PaymentMethodFeeType: Qt,
|
|
3258
3260
|
PaymentService: jt,
|
|
3259
3261
|
ProductType: Xt
|
|
3260
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
3262
|
+
}, Symbol.toStringTag, { value: "Module" })), tr = "https://api.ticketapp.com/graphql";
|
|
3261
3263
|
class Zt {
|
|
3262
3264
|
config;
|
|
3263
3265
|
orderIdKey;
|
|
@@ -3268,11 +3270,11 @@ class Zt {
|
|
|
3268
3270
|
...t
|
|
3269
3271
|
}, this.orderIdKey = `ORDER_ID_${t.shopSlug}`, this.store = ce({
|
|
3270
3272
|
reducer: {
|
|
3271
|
-
basket:
|
|
3273
|
+
basket: sn
|
|
3272
3274
|
}
|
|
3273
3275
|
});
|
|
3274
|
-
const
|
|
3275
|
-
this.sdk = C(
|
|
3276
|
+
const n = new M(t.apiUrl ?? tr);
|
|
3277
|
+
this.sdk = C(n), this.restoreOrderFromSession();
|
|
3276
3278
|
}
|
|
3277
3279
|
async restoreOrderFromSession() {
|
|
3278
3280
|
const t = this.getOrderId();
|
|
@@ -3280,8 +3282,8 @@ class Zt {
|
|
|
3280
3282
|
this.debugLog("Found existing order ID in session, restoring...", { orderId: t });
|
|
3281
3283
|
try {
|
|
3282
3284
|
await this.fetchOrder(t), this.debugLog("Order restored successfully");
|
|
3283
|
-
} catch (
|
|
3284
|
-
this.debugLog("Failed to restore order, clearing session",
|
|
3285
|
+
} catch (n) {
|
|
3286
|
+
this.debugLog("Failed to restore order, clearing session", n), this.clearOrderFromSession();
|
|
3285
3287
|
}
|
|
3286
3288
|
}
|
|
3287
3289
|
}
|
|
@@ -3295,10 +3297,10 @@ class Zt {
|
|
|
3295
3297
|
const t = this.getState();
|
|
3296
3298
|
if (!t.order)
|
|
3297
3299
|
return null;
|
|
3298
|
-
const
|
|
3300
|
+
const n = t.order.items.reduce((i, r) => i + (r.amount || 0), 0);
|
|
3299
3301
|
return {
|
|
3300
3302
|
...t.order,
|
|
3301
|
-
count:
|
|
3303
|
+
count: n
|
|
3302
3304
|
};
|
|
3303
3305
|
}
|
|
3304
3306
|
getOrderId() {
|
|
@@ -3312,17 +3314,17 @@ class Zt {
|
|
|
3312
3314
|
}
|
|
3313
3315
|
generateOrderId() {
|
|
3314
3316
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => {
|
|
3315
|
-
const
|
|
3316
|
-
return (t === "x" ?
|
|
3317
|
+
const n = Math.random() * 16 | 0;
|
|
3318
|
+
return (t === "x" ? n : n & 3 | 8).toString(16);
|
|
3317
3319
|
});
|
|
3318
3320
|
}
|
|
3319
|
-
debugLog(t,
|
|
3320
|
-
this.config.debug && console.log(`[BasketService:${this.config.shopSlug}] ${t}`,
|
|
3321
|
+
debugLog(t, n) {
|
|
3322
|
+
this.config.debug && console.log(`[BasketService:${this.config.shopSlug}] ${t}`, n || "");
|
|
3321
3323
|
}
|
|
3322
3324
|
async addProduct(t) {
|
|
3323
3325
|
this.store.dispatch(N(!0));
|
|
3324
3326
|
try {
|
|
3325
|
-
const i = this.store.getState().basket.order?.id ?? this.getOrderId() ?? this.generateOrderId(),
|
|
3327
|
+
const i = this.store.getState().basket.order?.id ?? this.getOrderId() ?? this.generateOrderId(), r = this.getTrackerId();
|
|
3326
3328
|
this.debugLog("Adding product", {
|
|
3327
3329
|
productId: t.id,
|
|
3328
3330
|
orderId: i,
|
|
@@ -3339,7 +3341,7 @@ class Zt {
|
|
|
3339
3341
|
holdToken: t.seat.holdToken
|
|
3340
3342
|
}
|
|
3341
3343
|
} : null,
|
|
3342
|
-
trackerId:
|
|
3344
|
+
trackerId: r || void 0,
|
|
3343
3345
|
shopId: this.config.shopId,
|
|
3344
3346
|
amount: t.amount
|
|
3345
3347
|
});
|
|
@@ -3359,8 +3361,8 @@ class Zt {
|
|
|
3359
3361
|
})
|
|
3360
3362
|
);
|
|
3361
3363
|
}
|
|
3362
|
-
} catch (
|
|
3363
|
-
throw this.debugLog("Error adding product",
|
|
3364
|
+
} catch (n) {
|
|
3365
|
+
throw this.debugLog("Error adding product", n), this.handleError(n), n;
|
|
3364
3366
|
} finally {
|
|
3365
3367
|
this.store.dispatch(N(!1));
|
|
3366
3368
|
}
|
|
@@ -3375,7 +3377,7 @@ class Zt {
|
|
|
3375
3377
|
orderId: i.id,
|
|
3376
3378
|
amount: t.amount
|
|
3377
3379
|
});
|
|
3378
|
-
const
|
|
3380
|
+
const r = await this.sdk.removeFromOrder({
|
|
3379
3381
|
productId: t.id,
|
|
3380
3382
|
orderId: i.id,
|
|
3381
3383
|
additionalData: t.seat ? {
|
|
@@ -3386,10 +3388,10 @@ class Zt {
|
|
|
3386
3388
|
} : null,
|
|
3387
3389
|
amount: t.amount
|
|
3388
3390
|
});
|
|
3389
|
-
if (
|
|
3390
|
-
const { amountReleased: s } =
|
|
3391
|
-
this.debugLog("Product removed successfully",
|
|
3392
|
-
|
|
3391
|
+
if (r?.releaseProduct) {
|
|
3392
|
+
const { amountReleased: s } = r.releaseProduct;
|
|
3393
|
+
this.debugLog("Product removed successfully", r.releaseProduct), this.store.dispatch(
|
|
3394
|
+
nn({
|
|
3393
3395
|
id: t.id,
|
|
3394
3396
|
amountReleased: s,
|
|
3395
3397
|
seatId: t.seat?.id
|
|
@@ -3398,8 +3400,8 @@ class Zt {
|
|
|
3398
3400
|
const o = this.getState();
|
|
3399
3401
|
(!o.order || o.order.items.length === 0) && (this.debugLog("Basket is now empty, cancelling order and clearing session"), await this.cancelOrder());
|
|
3400
3402
|
}
|
|
3401
|
-
} catch (
|
|
3402
|
-
throw this.debugLog("Error removing product",
|
|
3403
|
+
} catch (r) {
|
|
3404
|
+
throw this.debugLog("Error removing product", r), this.handleError(r), r;
|
|
3403
3405
|
} finally {
|
|
3404
3406
|
this.store.dispatch(N(!1));
|
|
3405
3407
|
}
|
|
@@ -3408,7 +3410,7 @@ class Zt {
|
|
|
3408
3410
|
async configurePackage(t) {
|
|
3409
3411
|
this.store.dispatch(N(!0));
|
|
3410
3412
|
try {
|
|
3411
|
-
const i = this.store.getState().basket.order?.id ?? this.getOrderId() ?? this.generateOrderId(),
|
|
3413
|
+
const i = this.store.getState().basket.order?.id ?? this.getOrderId() ?? this.generateOrderId(), r = this.getTrackerId(), s = t.items.map((c) => ({
|
|
3412
3414
|
packageItemId: c.packageItemId,
|
|
3413
3415
|
eventId: c.eventId
|
|
3414
3416
|
}));
|
|
@@ -3420,7 +3422,7 @@ class Zt {
|
|
|
3420
3422
|
shopId: this.config.shopId
|
|
3421
3423
|
});
|
|
3422
3424
|
const o = await this.sdk.configurePackage({
|
|
3423
|
-
trackerId:
|
|
3425
|
+
trackerId: r || void 0,
|
|
3424
3426
|
shopId: this.config.shopId,
|
|
3425
3427
|
packageId: t.id,
|
|
3426
3428
|
orderId: i,
|
|
@@ -3436,7 +3438,7 @@ class Zt {
|
|
|
3436
3438
|
expiredAt: l
|
|
3437
3439
|
})
|
|
3438
3440
|
), this.store.dispatch(
|
|
3439
|
-
|
|
3441
|
+
ne({
|
|
3440
3442
|
input: t,
|
|
3441
3443
|
amountReserved: E,
|
|
3442
3444
|
expiredAt: l
|
|
@@ -3444,8 +3446,8 @@ class Zt {
|
|
|
3444
3446
|
), null;
|
|
3445
3447
|
} else
|
|
3446
3448
|
return this.debugLog("Package configuration failed - no amount reserved"), { error: "Failed to configure package - no items reserved" };
|
|
3447
|
-
} catch (
|
|
3448
|
-
return this.debugLog("Error configuring package",
|
|
3449
|
+
} catch (n) {
|
|
3450
|
+
return this.debugLog("Error configuring package", n), this.handleError(n), { error: n };
|
|
3449
3451
|
} finally {
|
|
3450
3452
|
this.store.dispatch(N(!1));
|
|
3451
3453
|
}
|
|
@@ -3453,9 +3455,9 @@ class Zt {
|
|
|
3453
3455
|
async setDelivery(t) {
|
|
3454
3456
|
this.store.dispatch(N(!0));
|
|
3455
3457
|
try {
|
|
3456
|
-
this.store.dispatch(
|
|
3457
|
-
} catch (
|
|
3458
|
-
throw this.debugLog("Error setting delivery",
|
|
3458
|
+
this.store.dispatch(rn(t));
|
|
3459
|
+
} catch (n) {
|
|
3460
|
+
throw this.debugLog("Error setting delivery", n), this.handleError(n), n;
|
|
3459
3461
|
} finally {
|
|
3460
3462
|
this.store.dispatch(N(!1));
|
|
3461
3463
|
}
|
|
@@ -3463,14 +3465,14 @@ class Zt {
|
|
|
3463
3465
|
async fetchOrder(t) {
|
|
3464
3466
|
this.debugLog("Fetching order from server", { orderId: t });
|
|
3465
3467
|
try {
|
|
3466
|
-
const
|
|
3467
|
-
if (!
|
|
3468
|
+
const n = await this.sdk.findActiveOrderById({ id: t });
|
|
3469
|
+
if (!n?.findOrder) {
|
|
3468
3470
|
this.debugLog("Order not found"), this.clearOrderFromSession();
|
|
3469
3471
|
return;
|
|
3470
3472
|
}
|
|
3471
|
-
const i =
|
|
3473
|
+
const i = n.findOrder;
|
|
3472
3474
|
this.debugLog("Order fetched successfully", i);
|
|
3473
|
-
const
|
|
3475
|
+
const r = i.items, s = r.filter((d) => d.product != null && d.amount > 0).map((d) => {
|
|
3474
3476
|
let A = D.PRODUCT;
|
|
3475
3477
|
return d.product.type === "PROMOTER" ? A = D.ADD_ONS : d.product.type === "PICKUP" ? A = D.PICKUP : d.product.type === "DELIVERY" && (A = D.DELIVERY), {
|
|
3476
3478
|
id: d.product.id,
|
|
@@ -3488,7 +3490,7 @@ class Zt {
|
|
|
3488
3490
|
label: g.label
|
|
3489
3491
|
}))
|
|
3490
3492
|
};
|
|
3491
|
-
}), o =
|
|
3493
|
+
}), o = r.filter((d) => d.packageItem != null && d.amount > 0).reduce((d, A) => {
|
|
3492
3494
|
const {
|
|
3493
3495
|
packageItem: g,
|
|
3494
3496
|
event: O,
|
|
@@ -3509,17 +3511,17 @@ class Zt {
|
|
|
3509
3511
|
originalPrice: Z ?? 0,
|
|
3510
3512
|
packageItems: []
|
|
3511
3513
|
};
|
|
3512
|
-
const
|
|
3514
|
+
const en = _.fromISO(O.startAt, {
|
|
3513
3515
|
zone: O.timezone
|
|
3514
|
-
}),
|
|
3516
|
+
}), tn = _.fromISO(O.endAt, {
|
|
3515
3517
|
zone: O.timezone
|
|
3516
3518
|
});
|
|
3517
3519
|
return d[T].packageItems.push({
|
|
3518
3520
|
packageItemId: g.id,
|
|
3519
3521
|
eventId: O.id,
|
|
3520
3522
|
name: O.name,
|
|
3521
|
-
startAt:
|
|
3522
|
-
endAt:
|
|
3523
|
+
startAt: en,
|
|
3524
|
+
endAt: tn
|
|
3523
3525
|
}), d;
|
|
3524
3526
|
}, {}), c = [
|
|
3525
3527
|
...s,
|
|
@@ -3529,7 +3531,7 @@ class Zt {
|
|
|
3529
3531
|
this.debugLog("All order items have zero or negative amounts, clearing session"), this.clearOrderFromSession();
|
|
3530
3532
|
return;
|
|
3531
3533
|
}
|
|
3532
|
-
const l =
|
|
3534
|
+
const l = r.filter((d) => d.amount > 0).map((d) => new Date(d.expiredAt).getTime());
|
|
3533
3535
|
if (l.length === 0) {
|
|
3534
3536
|
this.debugLog("No valid items with expiration times, clearing session"), this.clearOrderFromSession();
|
|
3535
3537
|
return;
|
|
@@ -3543,7 +3545,7 @@ class Zt {
|
|
|
3543
3545
|
})
|
|
3544
3546
|
), c.forEach((d) => {
|
|
3545
3547
|
d.type === D.PACKAGE ? this.store.dispatch(
|
|
3546
|
-
|
|
3548
|
+
ne({
|
|
3547
3549
|
input: {
|
|
3548
3550
|
id: d.id,
|
|
3549
3551
|
name: d.name,
|
|
@@ -3573,42 +3575,30 @@ class Zt {
|
|
|
3573
3575
|
})
|
|
3574
3576
|
);
|
|
3575
3577
|
}), i.mainBooker && (this.debugLog("Order has customer (mainBooker)", i.mainBooker), this.store.dispatch(
|
|
3576
|
-
|
|
3578
|
+
re({
|
|
3577
3579
|
firstName: i.mainBooker.firstName ?? void 0,
|
|
3578
3580
|
lastName: i.mainBooker.lastName ?? void 0,
|
|
3579
3581
|
email: i.mainBooker.email ?? void 0,
|
|
3580
3582
|
age: i.mainBooker.age ?? void 0
|
|
3581
3583
|
})
|
|
3582
3584
|
)), this.debugLog("Order state fully synced", this.getState());
|
|
3583
|
-
} catch (
|
|
3584
|
-
throw this.debugLog("Error fetching order",
|
|
3585
|
+
} catch (n) {
|
|
3586
|
+
throw this.debugLog("Error fetching order", n), n;
|
|
3585
3587
|
}
|
|
3586
3588
|
}
|
|
3587
3589
|
async createCustomer(t) {
|
|
3588
|
-
const i = this.
|
|
3590
|
+
const i = this.getState().order;
|
|
3589
3591
|
if (!i)
|
|
3590
3592
|
throw new Error("No active order. Add items to basket first.");
|
|
3591
|
-
|
|
3592
|
-
const n = this.store.getState().basket;
|
|
3593
|
-
if (n.order?.customer)
|
|
3594
|
-
throw this.debugLog("Order already has a customer after fetching", n.order.customer), new Error("Order already has a customer associated with it.");
|
|
3595
|
-
this.debugLog("Creating customer", {
|
|
3596
|
-
orderId: i.id,
|
|
3597
|
-
email: t.email,
|
|
3598
|
-
orderHasItems: i.items.length > 0
|
|
3599
|
-
});
|
|
3593
|
+
this.debugLog("Creating/replacing customer", { orderId: i.id, email: t.email });
|
|
3600
3594
|
try {
|
|
3601
|
-
const
|
|
3595
|
+
const r = await this.sdk.createOrderCustomer({
|
|
3602
3596
|
orderId: i.id,
|
|
3603
3597
|
customer: t
|
|
3604
3598
|
});
|
|
3605
|
-
this.debugLog("Customer
|
|
3606
|
-
} catch (
|
|
3607
|
-
throw this.debugLog("Failed to
|
|
3608
|
-
error: s.message,
|
|
3609
|
-
response: s.response,
|
|
3610
|
-
graphQLErrors: s.response?.errors
|
|
3611
|
-
}), new Error(`Failed to create customer: ${s.message}`);
|
|
3599
|
+
this.debugLog("Customer set successfully", r), this.store.dispatch(re(t));
|
|
3600
|
+
} catch (r) {
|
|
3601
|
+
throw this.debugLog("Failed to set customer", r), new Error(`Failed to set customer: ${r.message}`);
|
|
3612
3602
|
}
|
|
3613
3603
|
}
|
|
3614
3604
|
async cancelOrder() {
|
|
@@ -3619,46 +3609,46 @@ class Zt {
|
|
|
3619
3609
|
this.debugLog("Clearing order from session"), sessionStorage.removeItem(this.orderIdKey), this.store.dispatch(ie());
|
|
3620
3610
|
}
|
|
3621
3611
|
handleError(t) {
|
|
3622
|
-
const
|
|
3623
|
-
if (
|
|
3624
|
-
const i =
|
|
3612
|
+
const n = t;
|
|
3613
|
+
if (n.graphQLErrors && n.graphQLErrors.length > 0) {
|
|
3614
|
+
const i = n.graphQLErrors[0];
|
|
3625
3615
|
i.extensions?.status === "RATE_LIMIT" && console.error("Rate Limit reached"), i.extensions?.status === "SOLD_OUT" && console.error("Product sold out");
|
|
3626
3616
|
}
|
|
3627
|
-
if (
|
|
3628
|
-
const i =
|
|
3617
|
+
if (n.response?.errors && n.response.errors.length > 0) {
|
|
3618
|
+
const i = n.response.errors[0];
|
|
3629
3619
|
console.error("GraphQL Error:", i.message), i.extensions?.code && console.error("Error Code:", i.extensions.code);
|
|
3630
3620
|
}
|
|
3631
3621
|
}
|
|
3632
3622
|
}
|
|
3633
|
-
class
|
|
3623
|
+
class or {
|
|
3634
3624
|
basket;
|
|
3635
3625
|
event;
|
|
3636
3626
|
payment;
|
|
3637
3627
|
package;
|
|
3638
3628
|
// Attach all types to the SDK class
|
|
3639
|
-
static Types =
|
|
3640
|
-
static GraphQL =
|
|
3641
|
-
static EventStore =
|
|
3629
|
+
static Types = er;
|
|
3630
|
+
static GraphQL = Xn;
|
|
3631
|
+
static EventStore = on;
|
|
3642
3632
|
constructor(t) {
|
|
3643
3633
|
const {
|
|
3644
|
-
organizationId:
|
|
3634
|
+
organizationId: n,
|
|
3645
3635
|
shopId: i,
|
|
3646
|
-
shopSlug:
|
|
3636
|
+
shopSlug: r,
|
|
3647
3637
|
debug: s = !1,
|
|
3648
3638
|
filteredLocationIds: o = [],
|
|
3649
3639
|
filteredHostingIds: c = [],
|
|
3650
3640
|
enableDoorTickets: l = !1,
|
|
3651
3641
|
apiUrl: E
|
|
3652
3642
|
} = t;
|
|
3653
|
-
this.basket = new Zt({ shopId: i, shopSlug:
|
|
3654
|
-
organizationId:
|
|
3643
|
+
this.basket = new Zt({ shopId: i, shopSlug: r, debug: s, apiUrl: E }), this.event = new Kt({
|
|
3644
|
+
organizationId: n,
|
|
3655
3645
|
shopId: i,
|
|
3656
3646
|
debug: s,
|
|
3657
3647
|
filteredLocationIds: o,
|
|
3658
3648
|
filteredHostingIds: c,
|
|
3659
3649
|
enableDoorTickets: l,
|
|
3660
3650
|
apiUrl: E
|
|
3661
|
-
}), this.payment = new jt({ debug: s, apiUrl: E }), this.package = new Wt({ organizationId:
|
|
3651
|
+
}), this.payment = new jt({ debug: s, apiUrl: E }), this.package = new Wt({ organizationId: n, debug: s, apiUrl: E });
|
|
3662
3652
|
}
|
|
3663
3653
|
}
|
|
3664
3654
|
export {
|
|
@@ -3670,5 +3660,5 @@ export {
|
|
|
3670
3660
|
Qt as PaymentMethodFeeType,
|
|
3671
3661
|
jt as PaymentService,
|
|
3672
3662
|
Xt as ProductType,
|
|
3673
|
-
|
|
3663
|
+
or as TicketappSDK
|
|
3674
3664
|
};
|