@builtbystack/sq-shopify-theme-sdk 0.0.22 → 0.0.24

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.
@@ -17,44 +17,34 @@ function ze(e, t) {
17
17
  }
18
18
  return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }));
19
19
  }
20
- const Ce = JSON, Qe = (e) => e.toUpperCase(), Je = (e) => {
21
- const t = {};
22
- return e.forEach((n, r) => {
23
- t[r] = n;
24
- }), t;
25
- }, Xe = (e, t, n) => e.document ? e : {
26
- document: e,
27
- variables: t,
28
- requestHeaders: n,
29
- signal: void 0
30
- }, We = (e, t, n) => e.query ? e : {
31
- query: e,
32
- variables: t,
33
- requestHeaders: n,
34
- signal: void 0
35
- }, Ke = (e, t) => e.documents ? e : {
36
- documents: e,
37
- requestHeaders: t,
38
- signal: void 0
20
+ var ne = function() {
21
+ return ne = Object.assign || function(t) {
22
+ for (var n, r = 1, i = arguments.length; r < i; r++) {
23
+ n = arguments[r];
24
+ for (var s in n)
25
+ Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
26
+ }
27
+ return t;
28
+ }, ne.apply(this, arguments);
39
29
  };
40
30
  function K(e, t) {
41
31
  if (!!!e)
42
32
  throw new Error(t);
43
33
  }
44
- function Ze(e) {
34
+ function Je(e) {
45
35
  return typeof e == "object" && e !== null;
46
36
  }
47
- function et(e, t) {
37
+ function Qe(e, t) {
48
38
  if (!!!e)
49
39
  throw new Error(
50
40
  t ?? "Unexpected invariant triggered."
51
41
  );
52
42
  }
53
- const tt = /\r\n|[\n\r]/g;
43
+ const Xe = /\r\n|[\n\r]/g;
54
44
  function pe(e, t) {
55
45
  let n = 0, r = 1;
56
- for (const i of e.body.matchAll(tt)) {
57
- if (typeof i.index == "number" || et(!1), i.index >= t)
46
+ for (const i of e.body.matchAll(Xe)) {
47
+ if (typeof i.index == "number" || Qe(!1), i.index >= t)
58
48
  break;
59
49
  n = i.index + i[0].length, r += 1;
60
50
  }
@@ -63,14 +53,14 @@ function pe(e, t) {
63
53
  column: t + 1 - n
64
54
  };
65
55
  }
66
- function nt(e) {
56
+ function We(e) {
67
57
  return Oe(
68
58
  e.source,
69
59
  pe(e.source, e.start)
70
60
  );
71
61
  }
72
62
  function Oe(e, t) {
73
- const n = e.locationOffset.column - 1, r = "".padStart(n) + e.body, i = t.line - 1, s = e.locationOffset.line - 1, o = t.line + s, u = t.line === 1 ? n : 0, h = t.column + u, p = `${e.name}:${o}:${h}
63
+ const n = e.locationOffset.column - 1, r = "".padStart(n) + e.body, i = t.line - 1, s = e.locationOffset.line - 1, o = t.line + s, c = t.line === 1 ? n : 0, h = t.column + c, p = `${e.name}:${o}:${h}
74
64
  `, m = r.split(/\r\n|[\n\r]/g), y = m[i];
75
65
  if (y.length > 120) {
76
66
  const C = Math.floor(h / 80), T = h % 80, g = [];
@@ -96,7 +86,7 @@ function Te(e) {
96
86
  return t.map(([r, i]) => r.padStart(n) + (i ? " " + i : "")).join(`
97
87
  `);
98
88
  }
99
- function rt(e) {
89
+ function Ke(e) {
100
90
  const t = e[0];
101
91
  return t == null || "kind" in t || "length" in t ? {
102
92
  nodes: t,
@@ -107,7 +97,7 @@ function rt(e) {
107
97
  extensions: e[5]
108
98
  } : t;
109
99
  }
110
- class Ee extends Error {
100
+ class Ce extends Error {
111
101
  /**
112
102
  * An array of `{ line, column }` locations within the source GraphQL document
113
103
  * which correspond to this error.
@@ -148,15 +138,15 @@ class Ee extends Error {
148
138
  */
149
139
  constructor(t, ...n) {
150
140
  var r, i, s;
151
- const { nodes: o, source: u, positions: h, path: p, originalError: m, extensions: y } = rt(n);
141
+ const { nodes: o, source: c, positions: h, path: p, originalError: m, extensions: y } = Ke(n);
152
142
  super(t), this.name = "GraphQLError", this.path = p ?? void 0, this.originalError = m ?? void 0, this.nodes = Ne(
153
143
  Array.isArray(o) ? o : o ? [o] : void 0
154
144
  );
155
145
  const C = Ne(
156
146
  (r = this.nodes) === null || r === void 0 ? void 0 : r.map((g) => g.loc).filter((g) => g != null)
157
147
  );
158
- this.source = u ?? (C == null || (i = C[0]) === null || i === void 0 ? void 0 : i.source), this.positions = h ?? (C == null ? void 0 : C.map((g) => g.start)), this.locations = h && u ? h.map((g) => pe(u, g)) : C == null ? void 0 : C.map((g) => pe(g.source, g.start));
159
- const T = Ze(
148
+ this.source = c ?? (C == null || (i = C[0]) === null || i === void 0 ? void 0 : i.source), this.positions = h ?? (C == null ? void 0 : C.map((g) => g.start)), this.locations = h && c ? h.map((g) => pe(c, g)) : C == null ? void 0 : C.map((g) => pe(g.source, g.start));
149
+ const T = Je(
160
150
  m == null ? void 0 : m.extensions
161
151
  ) ? m == null ? void 0 : m.extensions : void 0;
162
152
  this.extensions = (s = y ?? T) !== null && s !== void 0 ? s : /* @__PURE__ */ Object.create(null), Object.defineProperties(this, {
@@ -183,7 +173,7 @@ class Ee extends Error {
183
173
  value: m.stack,
184
174
  writable: !0,
185
175
  configurable: !0
186
- }) : Error.captureStackTrace ? Error.captureStackTrace(this, Ee) : Object.defineProperty(this, "stack", {
176
+ }) : Error.captureStackTrace ? Error.captureStackTrace(this, Ce) : Object.defineProperty(this, "stack", {
187
177
  value: Error().stack,
188
178
  writable: !0,
189
179
  configurable: !0
@@ -198,7 +188,7 @@ class Ee extends Error {
198
188
  for (const n of this.nodes)
199
189
  n.loc && (t += `
200
190
 
201
- ` + nt(n.loc));
191
+ ` + We(n.loc));
202
192
  else if (this.source && this.locations)
203
193
  for (const n of this.locations)
204
194
  t += `
@@ -216,13 +206,13 @@ class Ee extends Error {
216
206
  function Ne(e) {
217
207
  return e === void 0 || e.length === 0 ? void 0 : e;
218
208
  }
219
- function b(e, t, n) {
220
- return new Ee(`Syntax Error: ${n}`, {
209
+ function S(e, t, n) {
210
+ return new Ce(`Syntax Error: ${n}`, {
221
211
  source: e,
222
212
  positions: [t]
223
213
  });
224
214
  }
225
- class it {
215
+ class Ze {
226
216
  /**
227
217
  * The character offset at which this Node begins.
228
218
  */
@@ -251,7 +241,7 @@ class it {
251
241
  };
252
242
  }
253
243
  }
254
- class Re {
244
+ class De {
255
245
  /**
256
246
  * The kind of Token.
257
247
  */
@@ -367,15 +357,15 @@ const ke = {
367
357
  UnionTypeExtension: ["name", "directives", "types"],
368
358
  EnumTypeExtension: ["name", "directives", "values"],
369
359
  InputObjectTypeExtension: ["name", "directives", "fields"]
370
- }, st = new Set(Object.keys(ke));
360
+ }, et = new Set(Object.keys(ke));
371
361
  function Ie(e) {
372
362
  const t = e == null ? void 0 : e.kind;
373
- return typeof t == "string" && st.has(t);
363
+ return typeof t == "string" && et.has(t);
374
364
  }
375
- var M;
365
+ var q;
376
366
  (function(e) {
377
367
  e.QUERY = "query", e.MUTATION = "mutation", e.SUBSCRIPTION = "subscription";
378
- })(M || (M = {}));
368
+ })(q || (q = {}));
379
369
  var fe;
380
370
  (function(e) {
381
371
  e.QUERY = "QUERY", e.MUTATION = "MUTATION", e.SUBSCRIPTION = "SUBSCRIPTION", e.FIELD = "FIELD", e.FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION", e.FRAGMENT_SPREAD = "FRAGMENT_SPREAD", e.INLINE_FRAGMENT = "INLINE_FRAGMENT", e.VARIABLE_DEFINITION = "VARIABLE_DEFINITION", e.SCHEMA = "SCHEMA", e.SCALAR = "SCALAR", e.OBJECT = "OBJECT", e.FIELD_DEFINITION = "FIELD_DEFINITION", e.ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION", e.INTERFACE = "INTERFACE", e.UNION = "UNION", e.ENUM = "ENUM", e.ENUM_VALUE = "ENUM_VALUE", e.INPUT_OBJECT = "INPUT_OBJECT", e.INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION";
@@ -390,37 +380,37 @@ function me(e) {
390
380
  function Y(e) {
391
381
  return e >= 48 && e <= 57;
392
382
  }
393
- function _e(e) {
383
+ function Pe(e) {
394
384
  return e >= 97 && e <= 122 || // A-Z
395
385
  e >= 65 && e <= 90;
396
386
  }
397
- function Pe(e) {
398
- return _e(e) || e === 95;
387
+ function _e(e) {
388
+ return Pe(e) || e === 95;
399
389
  }
400
- function ot(e) {
401
- return _e(e) || Y(e) || e === 95;
390
+ function tt(e) {
391
+ return Pe(e) || Y(e) || e === 95;
402
392
  }
403
- function at(e) {
393
+ function nt(e) {
404
394
  var t;
405
395
  let n = Number.MAX_SAFE_INTEGER, r = null, i = -1;
406
396
  for (let o = 0; o < e.length; ++o) {
407
397
  var s;
408
- const u = e[o], h = ct(u);
409
- h !== u.length && (r = (s = r) !== null && s !== void 0 ? s : o, i = o, o !== 0 && h < n && (n = h));
398
+ const c = e[o], h = rt(c);
399
+ h !== c.length && (r = (s = r) !== null && s !== void 0 ? s : o, i = o, o !== 0 && h < n && (n = h));
410
400
  }
411
- return e.map((o, u) => u === 0 ? o : o.slice(n)).slice(
401
+ return e.map((o, c) => c === 0 ? o : o.slice(n)).slice(
412
402
  (t = r) !== null && t !== void 0 ? t : 0,
413
403
  i + 1
414
404
  );
415
405
  }
416
- function ct(e) {
406
+ function rt(e) {
417
407
  let t = 0;
418
408
  for (; t < e.length && me(e.charCodeAt(t)); )
419
409
  ++t;
420
410
  return t;
421
411
  }
422
- function ut(e, t) {
423
- const n = e.replace(/"""/g, '\\"""'), r = n.split(/\r\n|[\n\r]/g), i = r.length === 1, s = r.length > 1 && r.slice(1).every((T) => T.length === 0 || me(T.charCodeAt(0))), o = n.endsWith('\\"""'), u = e.endsWith('"') && !o, h = e.endsWith("\\"), p = u || h, m = !(t != null && t.minimize) && // add leading and trailing new lines only if it improves readability
412
+ function it(e, t) {
413
+ const n = e.replace(/"""/g, '\\"""'), r = n.split(/\r\n|[\n\r]/g), i = r.length === 1, s = r.length > 1 && r.slice(1).every((T) => T.length === 0 || me(T.charCodeAt(0))), o = n.endsWith('\\"""'), c = e.endsWith('"') && !o, h = e.endsWith("\\"), p = c || h, m = !(t != null && t.minimize) && // add leading and trailing new lines only if it improves readability
424
414
  (!i || e.length > 70 || p || s || o);
425
415
  let y = "";
426
416
  const C = i && me(e.charCodeAt(0));
@@ -428,11 +418,11 @@ function ut(e, t) {
428
418
  `), y += n, (m || p) && (y += `
429
419
  `), '"""' + y + '"""';
430
420
  }
431
- var c;
421
+ var u;
432
422
  (function(e) {
433
423
  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";
434
- })(c || (c = {}));
435
- class lt {
424
+ })(u || (u = {}));
425
+ class st {
436
426
  /**
437
427
  * The previously focused non-ignored token.
438
428
  */
@@ -446,7 +436,7 @@ class lt {
446
436
  * The character offset at which the current line begins.
447
437
  */
448
438
  constructor(t) {
449
- const n = new Re(c.SOF, 0, 0, 0, 0);
439
+ const n = new De(u.SOF, 0, 0, 0, 0);
450
440
  this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
451
441
  }
452
442
  get [Symbol.toStringTag]() {
@@ -464,22 +454,22 @@ class lt {
464
454
  */
465
455
  lookahead() {
466
456
  let t = this.token;
467
- if (t.kind !== c.EOF)
457
+ if (t.kind !== u.EOF)
468
458
  do
469
459
  if (t.next)
470
460
  t = t.next;
471
461
  else {
472
- const n = ht(this, t.end);
462
+ const n = at(this, t.end);
473
463
  t.next = n, n.prev = t, t = n;
474
464
  }
475
- while (t.kind === c.COMMENT);
465
+ while (t.kind === u.COMMENT);
476
466
  return t;
477
467
  }
478
468
  }
479
- function dt(e) {
480
- return e === c.BANG || e === c.DOLLAR || e === c.AMP || e === c.PAREN_L || e === c.PAREN_R || e === c.SPREAD || e === c.COLON || e === c.EQUALS || e === c.AT || e === c.BRACKET_L || e === c.BRACKET_R || e === c.BRACE_L || e === c.PIPE || e === c.BRACE_R;
469
+ function ot(e) {
470
+ return e === u.BANG || e === u.DOLLAR || e === u.AMP || e === u.PAREN_L || e === u.PAREN_R || e === u.SPREAD || e === u.COLON || e === u.EQUALS || e === u.AT || e === u.BRACKET_L || e === u.BRACKET_R || e === u.BRACE_L || e === u.PIPE || e === u.BRACE_R;
481
471
  }
482
- function V(e) {
472
+ function G(e) {
483
473
  return e >= 0 && e <= 55295 || e >= 57344 && e <= 1114111;
484
474
  }
485
475
  function se(e, t) {
@@ -494,7 +484,7 @@ function we(e) {
494
484
  function F(e, t) {
495
485
  const n = e.source.body.codePointAt(t);
496
486
  if (n === void 0)
497
- return c.EOF;
487
+ return u.EOF;
498
488
  if (n >= 32 && n <= 126) {
499
489
  const r = String.fromCodePoint(n);
500
490
  return r === '"' ? `'"'` : `"${r}"`;
@@ -503,9 +493,9 @@ function F(e, t) {
503
493
  }
504
494
  function I(e, t, n, r, i) {
505
495
  const s = e.line, o = 1 + n - e.lineStart;
506
- return new Re(t, n, r, s, o, i);
496
+ return new De(t, n, r, s, o, i);
507
497
  }
508
- function ht(e, t) {
498
+ function at(e, t) {
509
499
  const n = e.source.body, r = n.length;
510
500
  let i = t;
511
501
  for (; i < r; ) {
@@ -524,60 +514,60 @@ function ht(e, t) {
524
514
  n.charCodeAt(i + 1) === 10 ? i += 2 : ++i, ++e.line, e.lineStart = i;
525
515
  continue;
526
516
  case 35:
527
- return pt(e, i);
517
+ return ut(e, i);
528
518
  case 33:
529
- return I(e, c.BANG, i, i + 1);
519
+ return I(e, u.BANG, i, i + 1);
530
520
  case 36:
531
- return I(e, c.DOLLAR, i, i + 1);
521
+ return I(e, u.DOLLAR, i, i + 1);
532
522
  case 38:
533
- return I(e, c.AMP, i, i + 1);
523
+ return I(e, u.AMP, i, i + 1);
534
524
  case 40:
535
- return I(e, c.PAREN_L, i, i + 1);
525
+ return I(e, u.PAREN_L, i, i + 1);
536
526
  case 41:
537
- return I(e, c.PAREN_R, i, i + 1);
527
+ return I(e, u.PAREN_R, i, i + 1);
538
528
  case 46:
539
529
  if (n.charCodeAt(i + 1) === 46 && n.charCodeAt(i + 2) === 46)
540
- return I(e, c.SPREAD, i, i + 3);
530
+ return I(e, u.SPREAD, i, i + 3);
541
531
  break;
542
532
  case 58:
543
- return I(e, c.COLON, i, i + 1);
533
+ return I(e, u.COLON, i, i + 1);
544
534
  case 61:
545
- return I(e, c.EQUALS, i, i + 1);
535
+ return I(e, u.EQUALS, i, i + 1);
546
536
  case 64:
547
- return I(e, c.AT, i, i + 1);
537
+ return I(e, u.AT, i, i + 1);
548
538
  case 91:
549
- return I(e, c.BRACKET_L, i, i + 1);
539
+ return I(e, u.BRACKET_L, i, i + 1);
550
540
  case 93:
551
- return I(e, c.BRACKET_R, i, i + 1);
541
+ return I(e, u.BRACKET_R, i, i + 1);
552
542
  case 123:
553
- return I(e, c.BRACE_L, i, i + 1);
543
+ return I(e, u.BRACE_L, i, i + 1);
554
544
  case 124:
555
- return I(e, c.PIPE, i, i + 1);
545
+ return I(e, u.PIPE, i, i + 1);
556
546
  case 125:
557
- return I(e, c.BRACE_R, i, i + 1);
547
+ return I(e, u.BRACE_R, i, i + 1);
558
548
  case 34:
559
- return n.charCodeAt(i + 1) === 34 && n.charCodeAt(i + 2) === 34 ? Et(e, i) : mt(e, i);
549
+ return n.charCodeAt(i + 1) === 34 && n.charCodeAt(i + 2) === 34 ? ft(e, i) : lt(e, i);
560
550
  }
561
551
  if (Y(s) || s === 45)
562
- return ft(e, i, s);
563
- if (Pe(s))
564
- return vt(e, i);
565
- throw b(
552
+ return ct(e, i, s);
553
+ if (_e(s))
554
+ return mt(e, i);
555
+ throw S(
566
556
  e.source,
567
557
  i,
568
- s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : V(s) || se(n, i) ? `Unexpected character: ${F(e, i)}.` : `Invalid character: ${F(e, i)}.`
558
+ s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : G(s) || se(n, i) ? `Unexpected character: ${F(e, i)}.` : `Invalid character: ${F(e, i)}.`
569
559
  );
570
560
  }
571
- return I(e, c.EOF, r, r);
561
+ return I(e, u.EOF, r, r);
572
562
  }
573
- function pt(e, t) {
563
+ function ut(e, t) {
574
564
  const n = e.source.body, r = n.length;
575
565
  let i = t + 1;
576
566
  for (; i < r; ) {
577
567
  const s = n.charCodeAt(i);
578
568
  if (s === 10 || s === 13)
579
569
  break;
580
- if (V(s))
570
+ if (G(s))
581
571
  ++i;
582
572
  else if (se(n, i))
583
573
  i += 2;
@@ -586,18 +576,18 @@ function pt(e, t) {
586
576
  }
587
577
  return I(
588
578
  e,
589
- c.COMMENT,
579
+ u.COMMENT,
590
580
  t,
591
581
  i,
592
582
  n.slice(t + 1, i)
593
583
  );
594
584
  }
595
- function ft(e, t, n) {
585
+ function ct(e, t, n) {
596
586
  const r = e.source.body;
597
587
  let i = t, s = n, o = !1;
598
588
  if (s === 45 && (s = r.charCodeAt(++i)), s === 48) {
599
589
  if (s = r.charCodeAt(++i), Y(s))
600
- throw b(
590
+ throw S(
601
591
  e.source,
602
592
  i,
603
593
  `Invalid number, unexpected digit after 0: ${F(
@@ -606,9 +596,9 @@ function ft(e, t, n) {
606
596
  )}.`
607
597
  );
608
598
  } else
609
- i = ue(e, i, s), s = r.charCodeAt(i);
610
- if (s === 46 && (o = !0, s = r.charCodeAt(++i), i = ue(e, i, s), s = r.charCodeAt(i)), (s === 69 || s === 101) && (o = !0, s = r.charCodeAt(++i), (s === 43 || s === 45) && (s = r.charCodeAt(++i)), i = ue(e, i, s), s = r.charCodeAt(i)), s === 46 || Pe(s))
611
- throw b(
599
+ i = ce(e, i, s), s = r.charCodeAt(i);
600
+ if (s === 46 && (o = !0, s = r.charCodeAt(++i), i = ce(e, i, s), s = r.charCodeAt(i)), (s === 69 || s === 101) && (o = !0, s = r.charCodeAt(++i), (s === 43 || s === 45) && (s = r.charCodeAt(++i)), i = ce(e, i, s), s = r.charCodeAt(i)), s === 46 || _e(s))
601
+ throw S(
612
602
  e.source,
613
603
  i,
614
604
  `Invalid number, expected digit but got: ${F(
@@ -618,15 +608,15 @@ function ft(e, t, n) {
618
608
  );
619
609
  return I(
620
610
  e,
621
- o ? c.FLOAT : c.INT,
611
+ o ? u.FLOAT : u.INT,
622
612
  t,
623
613
  i,
624
614
  r.slice(t, i)
625
615
  );
626
616
  }
627
- function ue(e, t, n) {
617
+ function ce(e, t, n) {
628
618
  if (!Y(n))
629
- throw b(
619
+ throw S(
630
620
  e.source,
631
621
  t,
632
622
  `Invalid number, expected digit but got: ${F(
@@ -640,27 +630,27 @@ function ue(e, t, n) {
640
630
  ++i;
641
631
  return i;
642
632
  }
643
- function mt(e, t) {
633
+ function lt(e, t) {
644
634
  const n = e.source.body, r = n.length;
645
635
  let i = t + 1, s = i, o = "";
646
636
  for (; i < r; ) {
647
- const u = n.charCodeAt(i);
648
- if (u === 34)
649
- return o += n.slice(s, i), I(e, c.STRING, t, i + 1, o);
650
- if (u === 92) {
637
+ const c = n.charCodeAt(i);
638
+ if (c === 34)
639
+ return o += n.slice(s, i), I(e, u.STRING, t, i + 1, o);
640
+ if (c === 92) {
651
641
  o += n.slice(s, i);
652
- const h = n.charCodeAt(i + 1) === 117 ? n.charCodeAt(i + 2) === 123 ? gt(e, i) : yt(e, i) : Ct(e, i);
642
+ const h = n.charCodeAt(i + 1) === 117 ? n.charCodeAt(i + 2) === 123 ? dt(e, i) : ht(e, i) : pt(e, i);
653
643
  o += h.value, i += h.size, s = i;
654
644
  continue;
655
645
  }
656
- if (u === 10 || u === 13)
646
+ if (c === 10 || c === 13)
657
647
  break;
658
- if (V(u))
648
+ if (G(c))
659
649
  ++i;
660
650
  else if (se(n, i))
661
651
  i += 2;
662
652
  else
663
- throw b(
653
+ throw S(
664
654
  e.source,
665
655
  i,
666
656
  `Invalid character within String: ${F(
@@ -669,25 +659,25 @@ function mt(e, t) {
669
659
  )}.`
670
660
  );
671
661
  }
672
- throw b(e.source, i, "Unterminated string.");
662
+ throw S(e.source, i, "Unterminated string.");
673
663
  }
674
- function gt(e, t) {
664
+ function dt(e, t) {
675
665
  const n = e.source.body;
676
666
  let r = 0, i = 3;
677
667
  for (; i < 12; ) {
678
668
  const s = n.charCodeAt(t + i++);
679
669
  if (s === 125) {
680
- if (i < 5 || !V(r))
670
+ if (i < 5 || !G(r))
681
671
  break;
682
672
  return {
683
673
  value: String.fromCodePoint(r),
684
674
  size: i
685
675
  };
686
676
  }
687
- if (r = r << 4 | G(s), r < 0)
677
+ if (r = r << 4 | j(s), r < 0)
688
678
  break;
689
679
  }
690
- throw b(
680
+ throw S(
691
681
  e.source,
692
682
  t,
693
683
  `Invalid Unicode escape sequence: "${n.slice(
@@ -696,34 +686,34 @@ function gt(e, t) {
696
686
  )}".`
697
687
  );
698
688
  }
699
- function yt(e, t) {
700
- const n = e.source.body, r = be(n, t + 2);
701
- if (V(r))
689
+ function ht(e, t) {
690
+ const n = e.source.body, r = Se(n, t + 2);
691
+ if (G(r))
702
692
  return {
703
693
  value: String.fromCodePoint(r),
704
694
  size: 6
705
695
  };
706
696
  if (Le(r) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
707
- const i = be(n, t + 8);
697
+ const i = Se(n, t + 8);
708
698
  if (we(i))
709
699
  return {
710
700
  value: String.fromCodePoint(r, i),
711
701
  size: 12
712
702
  };
713
703
  }
714
- throw b(
704
+ throw S(
715
705
  e.source,
716
706
  t,
717
707
  `Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`
718
708
  );
719
709
  }
720
- function be(e, t) {
721
- return G(e.charCodeAt(t)) << 12 | G(e.charCodeAt(t + 1)) << 8 | G(e.charCodeAt(t + 2)) << 4 | G(e.charCodeAt(t + 3));
710
+ function Se(e, t) {
711
+ return j(e.charCodeAt(t)) << 12 | j(e.charCodeAt(t + 1)) << 8 | j(e.charCodeAt(t + 2)) << 4 | j(e.charCodeAt(t + 3));
722
712
  }
723
- function G(e) {
713
+ function j(e) {
724
714
  return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
725
715
  }
726
- function Ct(e, t) {
716
+ function pt(e, t) {
727
717
  const n = e.source.body;
728
718
  switch (n.charCodeAt(t + 1)) {
729
719
  case 34:
@@ -768,7 +758,7 @@ function Ct(e, t) {
768
758
  size: 2
769
759
  };
770
760
  }
771
- throw b(
761
+ throw S(
772
762
  e.source,
773
763
  t,
774
764
  `Invalid character escape sequence: "${n.slice(
@@ -777,39 +767,39 @@ function Ct(e, t) {
777
767
  )}".`
778
768
  );
779
769
  }
780
- function Et(e, t) {
770
+ function ft(e, t) {
781
771
  const n = e.source.body, r = n.length;
782
- let i = e.lineStart, s = t + 3, o = s, u = "";
772
+ let i = e.lineStart, s = t + 3, o = s, c = "";
783
773
  const h = [];
784
774
  for (; s < r; ) {
785
775
  const p = n.charCodeAt(s);
786
776
  if (p === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
787
- u += n.slice(o, s), h.push(u);
777
+ c += n.slice(o, s), h.push(c);
788
778
  const m = I(
789
779
  e,
790
- c.BLOCK_STRING,
780
+ u.BLOCK_STRING,
791
781
  t,
792
782
  s + 3,
793
783
  // Return a string of the lines joined with U+000A.
794
- at(h).join(`
784
+ nt(h).join(`
795
785
  `)
796
786
  );
797
787
  return e.line += h.length - 1, e.lineStart = i, m;
798
788
  }
799
789
  if (p === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
800
- u += n.slice(o, s), o = s + 1, s += 4;
790
+ c += n.slice(o, s), o = s + 1, s += 4;
801
791
  continue;
802
792
  }
803
793
  if (p === 10 || p === 13) {
804
- u += n.slice(o, s), h.push(u), p === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, u = "", o = s, i = s;
794
+ c += n.slice(o, s), h.push(c), p === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, c = "", o = s, i = s;
805
795
  continue;
806
796
  }
807
- if (V(p))
797
+ if (G(p))
808
798
  ++s;
809
799
  else if (se(n, s))
810
800
  s += 2;
811
801
  else
812
- throw b(
802
+ throw S(
813
803
  e.source,
814
804
  s,
815
805
  `Invalid character within String: ${F(
@@ -818,28 +808,28 @@ function Et(e, t) {
818
808
  )}.`
819
809
  );
820
810
  }
821
- throw b(e.source, s, "Unterminated string.");
811
+ throw S(e.source, s, "Unterminated string.");
822
812
  }
823
- function vt(e, t) {
813
+ function mt(e, t) {
824
814
  const n = e.source.body, r = n.length;
825
815
  let i = t + 1;
826
816
  for (; i < r; ) {
827
817
  const s = n.charCodeAt(i);
828
- if (ot(s))
818
+ if (tt(s))
829
819
  ++i;
830
820
  else
831
821
  break;
832
822
  }
833
823
  return I(
834
824
  e,
835
- c.NAME,
825
+ u.NAME,
836
826
  t,
837
827
  i,
838
828
  n.slice(t, i)
839
829
  );
840
830
  }
841
- const At = 10, Fe = 2;
842
- function ve(e) {
831
+ const gt = 10, Fe = 2;
832
+ function Ee(e) {
843
833
  return oe(e, []);
844
834
  }
845
835
  function oe(e, t) {
@@ -849,45 +839,45 @@ function oe(e, t) {
849
839
  case "function":
850
840
  return e.name ? `[function ${e.name}]` : "[function]";
851
841
  case "object":
852
- return Tt(e, t);
842
+ return yt(e, t);
853
843
  default:
854
844
  return String(e);
855
845
  }
856
846
  }
857
- function Tt(e, t) {
847
+ function yt(e, t) {
858
848
  if (e === null)
859
849
  return "null";
860
850
  if (t.includes(e))
861
851
  return "[Circular]";
862
852
  const n = [...t, e];
863
- if (Nt(e)) {
853
+ if (Ct(e)) {
864
854
  const r = e.toJSON();
865
855
  if (r !== e)
866
856
  return typeof r == "string" ? r : oe(r, n);
867
857
  } else if (Array.isArray(e))
868
- return bt(e, n);
869
- return It(e, n);
858
+ return vt(e, n);
859
+ return Et(e, n);
870
860
  }
871
- function Nt(e) {
861
+ function Ct(e) {
872
862
  return typeof e.toJSON == "function";
873
863
  }
874
- function It(e, t) {
864
+ function Et(e, t) {
875
865
  const n = Object.entries(e);
876
- return n.length === 0 ? "{}" : t.length > Fe ? "[" + xt(e) + "]" : "{ " + n.map(
866
+ return n.length === 0 ? "{}" : t.length > Fe ? "[" + At(e) + "]" : "{ " + n.map(
877
867
  ([i, s]) => i + ": " + oe(s, t)
878
868
  ).join(", ") + " }";
879
869
  }
880
- function bt(e, t) {
870
+ function vt(e, t) {
881
871
  if (e.length === 0)
882
872
  return "[]";
883
873
  if (t.length > Fe)
884
874
  return "[Array]";
885
- const n = Math.min(At, e.length), r = e.length - n, i = [];
875
+ const n = Math.min(gt, e.length), r = e.length - n, i = [];
886
876
  for (let s = 0; s < n; ++s)
887
877
  i.push(oe(e[s], t));
888
878
  return r === 1 ? i.push("... 1 more item") : r > 1 && i.push(`... ${r} more items`), "[" + i.join(", ") + "]";
889
879
  }
890
- function xt(e) {
880
+ function At(e) {
891
881
  const t = Object.prototype.toString.call(e).replace(/^\[object /, "").replace(/]$/, "");
892
882
  if (t === "Object" && typeof e.constructor == "function") {
893
883
  const n = e.constructor.name;
@@ -896,7 +886,7 @@ function xt(e) {
896
886
  }
897
887
  return t;
898
888
  }
899
- const St = (
889
+ const Tt = (
900
890
  /* c8 ignore next 6 */
901
891
  // FIXME: https://github.com/graphql/graphql-js/issues/2317
902
892
  globalThis.process && globalThis.process.env.NODE_ENV === "production" ? function(t, n) {
@@ -911,7 +901,7 @@ const St = (
911
901
  Symbol.toStringTag in t ? t[Symbol.toStringTag] : (r = t.constructor) === null || r === void 0 ? void 0 : r.name
912
902
  );
913
903
  if (i === s) {
914
- const o = ve(t);
904
+ const o = Ee(t);
915
905
  throw new Error(`Cannot use ${i} "${o}" from another module or realm.
916
906
 
917
907
  Ensure that there is only one instance of "graphql" in the node_modules
@@ -934,7 +924,7 @@ class Be {
934
924
  line: 1,
935
925
  column: 1
936
926
  }) {
937
- typeof t == "string" || K(!1, `Body must be a string. Received: ${ve(t)}.`), this.body = t, this.name = n, this.locationOffset = r, this.locationOffset.line > 0 || K(
927
+ typeof t == "string" || K(!1, `Body must be a string. Received: ${Ee(t)}.`), this.body = t, this.name = n, this.locationOffset = r, this.locationOffset.line > 0 || K(
938
928
  !1,
939
929
  "line in locationOffset is 1-indexed and must be positive."
940
930
  ), this.locationOffset.column > 0 || K(
@@ -946,22 +936,22 @@ class Be {
946
936
  return "Source";
947
937
  }
948
938
  }
949
- function Dt(e) {
950
- return St(e, Be);
939
+ function Nt(e) {
940
+ return Tt(e, Be);
951
941
  }
952
942
  function Ue(e, t) {
953
- return new Ot(e, t).parseDocument();
943
+ return new It(e, t).parseDocument();
954
944
  }
955
- class Ot {
945
+ class It {
956
946
  constructor(t, n = {}) {
957
- const r = Dt(t) ? t : new Be(t);
958
- this._lexer = new lt(r), this._options = n, this._tokenCounter = 0;
947
+ const r = Nt(t) ? t : new Be(t);
948
+ this._lexer = new st(r), this._options = n, this._tokenCounter = 0;
959
949
  }
960
950
  /**
961
951
  * Converts a name lex token into a name parse node.
962
952
  */
963
953
  parseName() {
964
- const t = this.expectToken(c.NAME);
954
+ const t = this.expectToken(u.NAME);
965
955
  return this.node(t, {
966
956
  kind: f.NAME,
967
957
  value: t.value
@@ -975,9 +965,9 @@ class Ot {
975
965
  return this.node(this._lexer.token, {
976
966
  kind: f.DOCUMENT,
977
967
  definitions: this.many(
978
- c.SOF,
968
+ u.SOF,
979
969
  this.parseDefinition,
980
- c.EOF
970
+ u.EOF
981
971
  )
982
972
  });
983
973
  }
@@ -1005,10 +995,10 @@ class Ot {
1005
995
  * - InputObjectTypeDefinition
1006
996
  */
1007
997
  parseDefinition() {
1008
- if (this.peek(c.BRACE_L))
998
+ if (this.peek(u.BRACE_L))
1009
999
  return this.parseOperationDefinition();
1010
1000
  const t = this.peekDescription(), n = t ? this._lexer.lookahead() : this._lexer.token;
1011
- if (n.kind === c.NAME) {
1001
+ if (n.kind === u.NAME) {
1012
1002
  switch (n.value) {
1013
1003
  case "schema":
1014
1004
  return this.parseSchemaDefinition();
@@ -1028,7 +1018,7 @@ class Ot {
1028
1018
  return this.parseDirectiveDefinition();
1029
1019
  }
1030
1020
  if (t)
1031
- throw b(
1021
+ throw S(
1032
1022
  this._lexer.source,
1033
1023
  this._lexer.token.start,
1034
1024
  "Unexpected description, descriptions are supported only on type definitions."
@@ -1054,10 +1044,10 @@ class Ot {
1054
1044
  */
1055
1045
  parseOperationDefinition() {
1056
1046
  const t = this._lexer.token;
1057
- if (this.peek(c.BRACE_L))
1047
+ if (this.peek(u.BRACE_L))
1058
1048
  return this.node(t, {
1059
1049
  kind: f.OPERATION_DEFINITION,
1060
- operation: M.QUERY,
1050
+ operation: q.QUERY,
1061
1051
  name: void 0,
1062
1052
  variableDefinitions: [],
1063
1053
  directives: [],
@@ -1065,7 +1055,7 @@ class Ot {
1065
1055
  });
1066
1056
  const n = this.parseOperationType();
1067
1057
  let r;
1068
- return this.peek(c.NAME) && (r = this.parseName()), this.node(t, {
1058
+ return this.peek(u.NAME) && (r = this.parseName()), this.node(t, {
1069
1059
  kind: f.OPERATION_DEFINITION,
1070
1060
  operation: n,
1071
1061
  name: r,
@@ -1078,14 +1068,14 @@ class Ot {
1078
1068
  * OperationType : one of query mutation subscription
1079
1069
  */
1080
1070
  parseOperationType() {
1081
- const t = this.expectToken(c.NAME);
1071
+ const t = this.expectToken(u.NAME);
1082
1072
  switch (t.value) {
1083
1073
  case "query":
1084
- return M.QUERY;
1074
+ return q.QUERY;
1085
1075
  case "mutation":
1086
- return M.MUTATION;
1076
+ return q.MUTATION;
1087
1077
  case "subscription":
1088
- return M.SUBSCRIPTION;
1078
+ return q.SUBSCRIPTION;
1089
1079
  }
1090
1080
  throw this.unexpected(t);
1091
1081
  }
@@ -1094,9 +1084,9 @@ class Ot {
1094
1084
  */
1095
1085
  parseVariableDefinitions() {
1096
1086
  return this.optionalMany(
1097
- c.PAREN_L,
1087
+ u.PAREN_L,
1098
1088
  this.parseVariableDefinition,
1099
- c.PAREN_R
1089
+ u.PAREN_R
1100
1090
  );
1101
1091
  }
1102
1092
  /**
@@ -1106,8 +1096,8 @@ class Ot {
1106
1096
  return this.node(this._lexer.token, {
1107
1097
  kind: f.VARIABLE_DEFINITION,
1108
1098
  variable: this.parseVariable(),
1109
- type: (this.expectToken(c.COLON), this.parseTypeReference()),
1110
- defaultValue: this.expectOptionalToken(c.EQUALS) ? this.parseConstValueLiteral() : void 0,
1099
+ type: (this.expectToken(u.COLON), this.parseTypeReference()),
1100
+ defaultValue: this.expectOptionalToken(u.EQUALS) ? this.parseConstValueLiteral() : void 0,
1111
1101
  directives: this.parseConstDirectives()
1112
1102
  });
1113
1103
  }
@@ -1116,7 +1106,7 @@ class Ot {
1116
1106
  */
1117
1107
  parseVariable() {
1118
1108
  const t = this._lexer.token;
1119
- return this.expectToken(c.DOLLAR), this.node(t, {
1109
+ return this.expectToken(u.DOLLAR), this.node(t, {
1120
1110
  kind: f.VARIABLE,
1121
1111
  name: this.parseName()
1122
1112
  });
@@ -1130,9 +1120,9 @@ class Ot {
1130
1120
  return this.node(this._lexer.token, {
1131
1121
  kind: f.SELECTION_SET,
1132
1122
  selections: this.many(
1133
- c.BRACE_L,
1123
+ u.BRACE_L,
1134
1124
  this.parseSelection,
1135
- c.BRACE_R
1125
+ u.BRACE_R
1136
1126
  )
1137
1127
  });
1138
1128
  }
@@ -1143,7 +1133,7 @@ class Ot {
1143
1133
  * - InlineFragment
1144
1134
  */
1145
1135
  parseSelection() {
1146
- return this.peek(c.SPREAD) ? this.parseFragment() : this.parseField();
1136
+ return this.peek(u.SPREAD) ? this.parseFragment() : this.parseField();
1147
1137
  }
1148
1138
  /**
1149
1139
  * Field : Alias? Name Arguments? Directives? SelectionSet?
@@ -1153,13 +1143,13 @@ class Ot {
1153
1143
  parseField() {
1154
1144
  const t = this._lexer.token, n = this.parseName();
1155
1145
  let r, i;
1156
- return this.expectOptionalToken(c.COLON) ? (r = n, i = this.parseName()) : i = n, this.node(t, {
1146
+ return this.expectOptionalToken(u.COLON) ? (r = n, i = this.parseName()) : i = n, this.node(t, {
1157
1147
  kind: f.FIELD,
1158
1148
  alias: r,
1159
1149
  name: i,
1160
1150
  arguments: this.parseArguments(!1),
1161
1151
  directives: this.parseDirectives(!1),
1162
- selectionSet: this.peek(c.BRACE_L) ? this.parseSelectionSet() : void 0
1152
+ selectionSet: this.peek(u.BRACE_L) ? this.parseSelectionSet() : void 0
1163
1153
  });
1164
1154
  }
1165
1155
  /**
@@ -1167,14 +1157,14 @@ class Ot {
1167
1157
  */
1168
1158
  parseArguments(t) {
1169
1159
  const n = t ? this.parseConstArgument : this.parseArgument;
1170
- return this.optionalMany(c.PAREN_L, n, c.PAREN_R);
1160
+ return this.optionalMany(u.PAREN_L, n, u.PAREN_R);
1171
1161
  }
1172
1162
  /**
1173
1163
  * Argument[Const] : Name : Value[?Const]
1174
1164
  */
1175
1165
  parseArgument(t = !1) {
1176
1166
  const n = this._lexer.token, r = this.parseName();
1177
- return this.expectToken(c.COLON), this.node(n, {
1167
+ return this.expectToken(u.COLON), this.node(n, {
1178
1168
  kind: f.ARGUMENT,
1179
1169
  name: r,
1180
1170
  value: this.parseValueLiteral(t)
@@ -1193,9 +1183,9 @@ class Ot {
1193
1183
  */
1194
1184
  parseFragment() {
1195
1185
  const t = this._lexer.token;
1196
- this.expectToken(c.SPREAD);
1186
+ this.expectToken(u.SPREAD);
1197
1187
  const n = this.expectOptionalKeyword("on");
1198
- return !n && this.peek(c.NAME) ? this.node(t, {
1188
+ return !n && this.peek(u.NAME) ? this.node(t, {
1199
1189
  kind: f.FRAGMENT_SPREAD,
1200
1190
  name: this.parseFragmentName(),
1201
1191
  directives: this.parseDirectives(!1)
@@ -1259,24 +1249,24 @@ class Ot {
1259
1249
  parseValueLiteral(t) {
1260
1250
  const n = this._lexer.token;
1261
1251
  switch (n.kind) {
1262
- case c.BRACKET_L:
1252
+ case u.BRACKET_L:
1263
1253
  return this.parseList(t);
1264
- case c.BRACE_L:
1254
+ case u.BRACE_L:
1265
1255
  return this.parseObject(t);
1266
- case c.INT:
1256
+ case u.INT:
1267
1257
  return this.advanceLexer(), this.node(n, {
1268
1258
  kind: f.INT,
1269
1259
  value: n.value
1270
1260
  });
1271
- case c.FLOAT:
1261
+ case u.FLOAT:
1272
1262
  return this.advanceLexer(), this.node(n, {
1273
1263
  kind: f.FLOAT,
1274
1264
  value: n.value
1275
1265
  });
1276
- case c.STRING:
1277
- case c.BLOCK_STRING:
1266
+ case u.STRING:
1267
+ case u.BLOCK_STRING:
1278
1268
  return this.parseStringLiteral();
1279
- case c.NAME:
1269
+ case u.NAME:
1280
1270
  switch (this.advanceLexer(), n.value) {
1281
1271
  case "true":
1282
1272
  return this.node(n, {
@@ -1298,11 +1288,11 @@ class Ot {
1298
1288
  value: n.value
1299
1289
  });
1300
1290
  }
1301
- case c.DOLLAR:
1291
+ case u.DOLLAR:
1302
1292
  if (t)
1303
- if (this.expectToken(c.DOLLAR), this._lexer.token.kind === c.NAME) {
1293
+ if (this.expectToken(u.DOLLAR), this._lexer.token.kind === u.NAME) {
1304
1294
  const r = this._lexer.token.value;
1305
- throw b(
1295
+ throw S(
1306
1296
  this._lexer.source,
1307
1297
  n.start,
1308
1298
  `Unexpected variable "$${r}" in constant value.`
@@ -1322,7 +1312,7 @@ class Ot {
1322
1312
  return this.advanceLexer(), this.node(t, {
1323
1313
  kind: f.STRING,
1324
1314
  value: t.value,
1325
- block: t.kind === c.BLOCK_STRING
1315
+ block: t.kind === u.BLOCK_STRING
1326
1316
  });
1327
1317
  }
1328
1318
  /**
@@ -1334,7 +1324,7 @@ class Ot {
1334
1324
  const n = () => this.parseValueLiteral(t);
1335
1325
  return this.node(this._lexer.token, {
1336
1326
  kind: f.LIST,
1337
- values: this.any(c.BRACKET_L, n, c.BRACKET_R)
1327
+ values: this.any(u.BRACKET_L, n, u.BRACKET_R)
1338
1328
  });
1339
1329
  }
1340
1330
  /**
@@ -1348,7 +1338,7 @@ class Ot {
1348
1338
  const n = () => this.parseObjectField(t);
1349
1339
  return this.node(this._lexer.token, {
1350
1340
  kind: f.OBJECT,
1351
- fields: this.any(c.BRACE_L, n, c.BRACE_R)
1341
+ fields: this.any(u.BRACE_L, n, u.BRACE_R)
1352
1342
  });
1353
1343
  }
1354
1344
  /**
@@ -1356,7 +1346,7 @@ class Ot {
1356
1346
  */
1357
1347
  parseObjectField(t) {
1358
1348
  const n = this._lexer.token, r = this.parseName();
1359
- return this.expectToken(c.COLON), this.node(n, {
1349
+ return this.expectToken(u.COLON), this.node(n, {
1360
1350
  kind: f.OBJECT_FIELD,
1361
1351
  name: r,
1362
1352
  value: this.parseValueLiteral(t)
@@ -1368,7 +1358,7 @@ class Ot {
1368
1358
  */
1369
1359
  parseDirectives(t) {
1370
1360
  const n = [];
1371
- for (; this.peek(c.AT); )
1361
+ for (; this.peek(u.AT); )
1372
1362
  n.push(this.parseDirective(t));
1373
1363
  return n;
1374
1364
  }
@@ -1382,7 +1372,7 @@ class Ot {
1382
1372
  */
1383
1373
  parseDirective(t) {
1384
1374
  const n = this._lexer.token;
1385
- return this.expectToken(c.AT), this.node(n, {
1375
+ return this.expectToken(u.AT), this.node(n, {
1386
1376
  kind: f.DIRECTIVE,
1387
1377
  name: this.parseName(),
1388
1378
  arguments: this.parseArguments(t)
@@ -1398,15 +1388,15 @@ class Ot {
1398
1388
  parseTypeReference() {
1399
1389
  const t = this._lexer.token;
1400
1390
  let n;
1401
- if (this.expectOptionalToken(c.BRACKET_L)) {
1391
+ if (this.expectOptionalToken(u.BRACKET_L)) {
1402
1392
  const r = this.parseTypeReference();
1403
- this.expectToken(c.BRACKET_R), n = this.node(t, {
1393
+ this.expectToken(u.BRACKET_R), n = this.node(t, {
1404
1394
  kind: f.LIST_TYPE,
1405
1395
  type: r
1406
1396
  });
1407
1397
  } else
1408
1398
  n = this.parseNamedType();
1409
- return this.expectOptionalToken(c.BANG) ? this.node(t, {
1399
+ return this.expectOptionalToken(u.BANG) ? this.node(t, {
1410
1400
  kind: f.NON_NULL_TYPE,
1411
1401
  type: n
1412
1402
  }) : n;
@@ -1422,7 +1412,7 @@ class Ot {
1422
1412
  }
1423
1413
  // Implements the parsing rules in the Type Definition section.
1424
1414
  peekDescription() {
1425
- return this.peek(c.STRING) || this.peek(c.BLOCK_STRING);
1415
+ return this.peek(u.STRING) || this.peek(u.BLOCK_STRING);
1426
1416
  }
1427
1417
  /**
1428
1418
  * Description : StringValue
@@ -1440,9 +1430,9 @@ class Ot {
1440
1430
  const t = this._lexer.token, n = this.parseDescription();
1441
1431
  this.expectKeyword("schema");
1442
1432
  const r = this.parseConstDirectives(), i = this.many(
1443
- c.BRACE_L,
1433
+ u.BRACE_L,
1444
1434
  this.parseOperationTypeDefinition,
1445
- c.BRACE_R
1435
+ u.BRACE_R
1446
1436
  );
1447
1437
  return this.node(t, {
1448
1438
  kind: f.SCHEMA_DEFINITION,
@@ -1456,7 +1446,7 @@ class Ot {
1456
1446
  */
1457
1447
  parseOperationTypeDefinition() {
1458
1448
  const t = this._lexer.token, n = this.parseOperationType();
1459
- this.expectToken(c.COLON);
1449
+ this.expectToken(u.COLON);
1460
1450
  const r = this.parseNamedType();
1461
1451
  return this.node(t, {
1462
1452
  kind: f.OPERATION_TYPE_DEFINITION,
@@ -1502,7 +1492,7 @@ class Ot {
1502
1492
  * - ImplementsInterfaces & NamedType
1503
1493
  */
1504
1494
  parseImplementsInterfaces() {
1505
- return this.expectOptionalKeyword("implements") ? this.delimitedMany(c.AMP, this.parseNamedType) : [];
1495
+ return this.expectOptionalKeyword("implements") ? this.delimitedMany(u.AMP, this.parseNamedType) : [];
1506
1496
  }
1507
1497
  /**
1508
1498
  * ```
@@ -1511,9 +1501,9 @@ class Ot {
1511
1501
  */
1512
1502
  parseFieldsDefinition() {
1513
1503
  return this.optionalMany(
1514
- c.BRACE_L,
1504
+ u.BRACE_L,
1515
1505
  this.parseFieldDefinition,
1516
- c.BRACE_R
1506
+ u.BRACE_R
1517
1507
  );
1518
1508
  }
1519
1509
  /**
@@ -1522,7 +1512,7 @@ class Ot {
1522
1512
  */
1523
1513
  parseFieldDefinition() {
1524
1514
  const t = this._lexer.token, n = this.parseDescription(), r = this.parseName(), i = this.parseArgumentDefs();
1525
- this.expectToken(c.COLON);
1515
+ this.expectToken(u.COLON);
1526
1516
  const s = this.parseTypeReference(), o = this.parseConstDirectives();
1527
1517
  return this.node(t, {
1528
1518
  kind: f.FIELD_DEFINITION,
@@ -1538,9 +1528,9 @@ class Ot {
1538
1528
  */
1539
1529
  parseArgumentDefs() {
1540
1530
  return this.optionalMany(
1541
- c.PAREN_L,
1531
+ u.PAREN_L,
1542
1532
  this.parseInputValueDef,
1543
- c.PAREN_R
1533
+ u.PAREN_R
1544
1534
  );
1545
1535
  }
1546
1536
  /**
@@ -1549,10 +1539,10 @@ class Ot {
1549
1539
  */
1550
1540
  parseInputValueDef() {
1551
1541
  const t = this._lexer.token, n = this.parseDescription(), r = this.parseName();
1552
- this.expectToken(c.COLON);
1542
+ this.expectToken(u.COLON);
1553
1543
  const i = this.parseTypeReference();
1554
1544
  let s;
1555
- this.expectOptionalToken(c.EQUALS) && (s = this.parseConstValueLiteral());
1545
+ this.expectOptionalToken(u.EQUALS) && (s = this.parseConstValueLiteral());
1556
1546
  const o = this.parseConstDirectives();
1557
1547
  return this.node(t, {
1558
1548
  kind: f.INPUT_VALUE_DEFINITION,
@@ -1602,7 +1592,7 @@ class Ot {
1602
1592
  * - UnionMemberTypes | NamedType
1603
1593
  */
1604
1594
  parseUnionMemberTypes() {
1605
- return this.expectOptionalToken(c.EQUALS) ? this.delimitedMany(c.PIPE, this.parseNamedType) : [];
1595
+ return this.expectOptionalToken(u.EQUALS) ? this.delimitedMany(u.PIPE, this.parseNamedType) : [];
1606
1596
  }
1607
1597
  /**
1608
1598
  * EnumTypeDefinition :
@@ -1627,9 +1617,9 @@ class Ot {
1627
1617
  */
1628
1618
  parseEnumValuesDefinition() {
1629
1619
  return this.optionalMany(
1630
- c.BRACE_L,
1620
+ u.BRACE_L,
1631
1621
  this.parseEnumValueDefinition,
1632
- c.BRACE_R
1622
+ u.BRACE_R
1633
1623
  );
1634
1624
  }
1635
1625
  /**
@@ -1649,7 +1639,7 @@ class Ot {
1649
1639
  */
1650
1640
  parseEnumValueName() {
1651
1641
  if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null")
1652
- throw b(
1642
+ throw S(
1653
1643
  this._lexer.source,
1654
1644
  this._lexer.token.start,
1655
1645
  `${W(
@@ -1681,9 +1671,9 @@ class Ot {
1681
1671
  */
1682
1672
  parseInputFieldsDefinition() {
1683
1673
  return this.optionalMany(
1684
- c.BRACE_L,
1674
+ u.BRACE_L,
1685
1675
  this.parseInputValueDef,
1686
- c.BRACE_R
1676
+ u.BRACE_R
1687
1677
  );
1688
1678
  }
1689
1679
  /**
@@ -1701,7 +1691,7 @@ class Ot {
1701
1691
  */
1702
1692
  parseTypeSystemExtension() {
1703
1693
  const t = this._lexer.lookahead();
1704
- if (t.kind === c.NAME)
1694
+ if (t.kind === u.NAME)
1705
1695
  switch (t.value) {
1706
1696
  case "schema":
1707
1697
  return this.parseSchemaExtension();
@@ -1731,9 +1721,9 @@ class Ot {
1731
1721
  const t = this._lexer.token;
1732
1722
  this.expectKeyword("extend"), this.expectKeyword("schema");
1733
1723
  const n = this.parseConstDirectives(), r = this.optionalMany(
1734
- c.BRACE_L,
1724
+ u.BRACE_L,
1735
1725
  this.parseOperationTypeDefinition,
1736
- c.BRACE_R
1726
+ u.BRACE_R
1737
1727
  );
1738
1728
  if (n.length === 0 && r.length === 0)
1739
1729
  throw this.unexpected();
@@ -1861,7 +1851,7 @@ class Ot {
1861
1851
  */
1862
1852
  parseDirectiveDefinition() {
1863
1853
  const t = this._lexer.token, n = this.parseDescription();
1864
- this.expectKeyword("directive"), this.expectToken(c.AT);
1854
+ this.expectKeyword("directive"), this.expectToken(u.AT);
1865
1855
  const r = this.parseName(), i = this.parseArgumentDefs(), s = this.expectOptionalKeyword("repeatable");
1866
1856
  this.expectKeyword("on");
1867
1857
  const o = this.parseDirectiveLocations();
@@ -1880,7 +1870,7 @@ class Ot {
1880
1870
  * - DirectiveLocations | DirectiveLocation
1881
1871
  */
1882
1872
  parseDirectiveLocations() {
1883
- return this.delimitedMany(c.PIPE, this.parseDirectiveLocation);
1873
+ return this.delimitedMany(u.PIPE, this.parseDirectiveLocation);
1884
1874
  }
1885
1875
  /*
1886
1876
  * DirectiveLocation :
@@ -1922,7 +1912,7 @@ class Ot {
1922
1912
  * given parsed object.
1923
1913
  */
1924
1914
  node(t, n) {
1925
- return this._options.noLocation !== !0 && (n.loc = new it(
1915
+ return this._options.noLocation !== !0 && (n.loc = new Ze(
1926
1916
  t,
1927
1917
  this._lexer.lastToken,
1928
1918
  this._lexer.source
@@ -1942,10 +1932,10 @@ class Ot {
1942
1932
  const n = this._lexer.token;
1943
1933
  if (n.kind === t)
1944
1934
  return this.advanceLexer(), n;
1945
- throw b(
1935
+ throw S(
1946
1936
  this._lexer.source,
1947
1937
  n.start,
1948
- `Expected ${Me(t)}, found ${W(n)}.`
1938
+ `Expected ${qe(t)}, found ${W(n)}.`
1949
1939
  );
1950
1940
  }
1951
1941
  /**
@@ -1961,10 +1951,10 @@ class Ot {
1961
1951
  */
1962
1952
  expectKeyword(t) {
1963
1953
  const n = this._lexer.token;
1964
- if (n.kind === c.NAME && n.value === t)
1954
+ if (n.kind === u.NAME && n.value === t)
1965
1955
  this.advanceLexer();
1966
1956
  else
1967
- throw b(
1957
+ throw S(
1968
1958
  this._lexer.source,
1969
1959
  n.start,
1970
1960
  `Expected "${t}", found ${W(n)}.`
@@ -1976,14 +1966,14 @@ class Ot {
1976
1966
  */
1977
1967
  expectOptionalKeyword(t) {
1978
1968
  const n = this._lexer.token;
1979
- return n.kind === c.NAME && n.value === t ? (this.advanceLexer(), !0) : !1;
1969
+ return n.kind === u.NAME && n.value === t ? (this.advanceLexer(), !0) : !1;
1980
1970
  }
1981
1971
  /**
1982
1972
  * Helper function for creating an error when an unexpected lexed token is encountered.
1983
1973
  */
1984
1974
  unexpected(t) {
1985
1975
  const n = t ?? this._lexer.token;
1986
- return b(
1976
+ return S(
1987
1977
  this._lexer.source,
1988
1978
  n.start,
1989
1979
  `Unexpected ${W(n)}.`
@@ -2045,8 +2035,8 @@ class Ot {
2045
2035
  }
2046
2036
  advanceLexer() {
2047
2037
  const { maxTokens: t } = this._options, n = this._lexer.advance();
2048
- if (t !== void 0 && n.kind !== c.EOF && (++this._tokenCounter, this._tokenCounter > t))
2049
- throw b(
2038
+ if (t !== void 0 && n.kind !== u.EOF && (++this._tokenCounter, this._tokenCounter > t))
2039
+ throw S(
2050
2040
  this._lexer.source,
2051
2041
  n.start,
2052
2042
  `Document contains more that ${t} tokens. Parsing aborted.`
@@ -2055,19 +2045,19 @@ class Ot {
2055
2045
  }
2056
2046
  function W(e) {
2057
2047
  const t = e.value;
2058
- return Me(e.kind) + (t != null ? ` "${t}"` : "");
2048
+ return qe(e.kind) + (t != null ? ` "${t}"` : "");
2059
2049
  }
2060
- function Me(e) {
2061
- return dt(e) ? `"${e}"` : e;
2050
+ function qe(e) {
2051
+ return ot(e) ? `"${e}"` : e;
2062
2052
  }
2063
- function Rt(e) {
2064
- return `"${e.replace(kt, _t)}"`;
2053
+ function St(e) {
2054
+ return `"${e.replace(bt, xt)}"`;
2065
2055
  }
2066
- const kt = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
2067
- function _t(e) {
2068
- return Pt[e.charCodeAt(0)];
2056
+ const bt = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
2057
+ function xt(e) {
2058
+ return Rt[e.charCodeAt(0)];
2069
2059
  }
2070
- const Pt = [
2060
+ const Rt = [
2071
2061
  "\\u0000",
2072
2062
  "\\u0001",
2073
2063
  "\\u0002",
@@ -2233,24 +2223,24 @@ const Pt = [
2233
2223
  "\\u009D",
2234
2224
  "\\u009E",
2235
2225
  "\\u009F"
2236
- ], Lt = Object.freeze({});
2237
- function wt(e, t, n = ke) {
2226
+ ], Ot = Object.freeze({});
2227
+ function Dt(e, t, n = ke) {
2238
2228
  const r = /* @__PURE__ */ new Map();
2239
- for (const R of Object.values(f))
2240
- r.set(R, Ft(t, R));
2241
- let i, s = Array.isArray(e), o = [e], u = -1, h = [], p = e, m, y;
2229
+ for (const D of Object.values(f))
2230
+ r.set(D, kt(t, D));
2231
+ let i, s = Array.isArray(e), o = [e], c = -1, h = [], p = e, m, y;
2242
2232
  const C = [], T = [];
2243
2233
  do {
2244
- u++;
2245
- const R = u === o.length, z = R && h.length !== 0;
2246
- if (R) {
2234
+ c++;
2235
+ const D = c === o.length, z = D && h.length !== 0;
2236
+ if (D) {
2247
2237
  if (m = T.length === 0 ? void 0 : C[C.length - 1], p = y, y = T.pop(), z)
2248
2238
  if (s) {
2249
2239
  p = p.slice();
2250
2240
  let k = 0;
2251
- for (const [B, Q] of h) {
2252
- const J = B - k;
2253
- Q === null ? (p.splice(J, 1), k++) : p[J] = Q;
2241
+ for (const [B, J] of h) {
2242
+ const Q = B - k;
2243
+ J === null ? (p.splice(Q, 1), k++) : p[Q] = J;
2254
2244
  }
2255
2245
  } else {
2256
2246
  p = Object.defineProperties(
@@ -2260,48 +2250,48 @@ function wt(e, t, n = ke) {
2260
2250
  for (const [k, B] of h)
2261
2251
  p[k] = B;
2262
2252
  }
2263
- u = i.index, o = i.keys, h = i.edits, s = i.inArray, i = i.prev;
2253
+ c = i.index, o = i.keys, h = i.edits, s = i.inArray, i = i.prev;
2264
2254
  } else if (y) {
2265
- if (m = s ? u : o[u], p = y[m], p == null)
2255
+ if (m = s ? c : o[c], p = y[m], p == null)
2266
2256
  continue;
2267
2257
  C.push(m);
2268
2258
  }
2269
- let P;
2259
+ let _;
2270
2260
  if (!Array.isArray(p)) {
2271
2261
  var g, N;
2272
- Ie(p) || K(!1, `Invalid AST Node: ${ve(p)}.`);
2273
- const k = R ? (g = r.get(p.kind)) === null || g === void 0 ? void 0 : g.leave : (N = r.get(p.kind)) === null || N === void 0 ? void 0 : N.enter;
2274
- if (P = k == null ? void 0 : k.call(t, p, m, y, C, T), P === Lt)
2262
+ Ie(p) || K(!1, `Invalid AST Node: ${Ee(p)}.`);
2263
+ const k = D ? (g = r.get(p.kind)) === null || g === void 0 ? void 0 : g.leave : (N = r.get(p.kind)) === null || N === void 0 ? void 0 : N.enter;
2264
+ if (_ = k == null ? void 0 : k.call(t, p, m, y, C, T), _ === Ot)
2275
2265
  break;
2276
- if (P === !1) {
2277
- if (!R) {
2266
+ if (_ === !1) {
2267
+ if (!D) {
2278
2268
  C.pop();
2279
2269
  continue;
2280
2270
  }
2281
- } else if (P !== void 0 && (h.push([m, P]), !R))
2282
- if (Ie(P))
2283
- p = P;
2271
+ } else if (_ !== void 0 && (h.push([m, _]), !D))
2272
+ if (Ie(_))
2273
+ p = _;
2284
2274
  else {
2285
2275
  C.pop();
2286
2276
  continue;
2287
2277
  }
2288
2278
  }
2289
- if (P === void 0 && z && h.push([m, p]), R)
2279
+ if (_ === void 0 && z && h.push([m, p]), D)
2290
2280
  C.pop();
2291
2281
  else {
2292
- var D;
2282
+ var O;
2293
2283
  i = {
2294
2284
  inArray: s,
2295
- index: u,
2285
+ index: c,
2296
2286
  keys: o,
2297
2287
  edits: h,
2298
2288
  prev: i
2299
- }, s = Array.isArray(p), o = s ? p : (D = n[p.kind]) !== null && D !== void 0 ? D : [], u = -1, h = [], y && T.push(y), y = p;
2289
+ }, s = Array.isArray(p), o = s ? p : (O = n[p.kind]) !== null && O !== void 0 ? O : [], c = -1, h = [], y && T.push(y), y = p;
2300
2290
  }
2301
2291
  } while (i !== void 0);
2302
2292
  return h.length !== 0 ? h[h.length - 1][1] : e;
2303
2293
  }
2304
- function Ft(e, t) {
2294
+ function kt(e, t) {
2305
2295
  const n = e[t];
2306
2296
  return typeof n == "object" ? n : typeof n == "function" ? {
2307
2297
  enter: n,
@@ -2311,10 +2301,10 @@ function Ft(e, t) {
2311
2301
  leave: e.leave
2312
2302
  };
2313
2303
  }
2314
- function Bt(e) {
2315
- return wt(e, Mt);
2304
+ function Pt(e) {
2305
+ return Dt(e, Lt);
2316
2306
  }
2317
- const Ut = 80, Mt = {
2307
+ const _t = 80, Lt = {
2318
2308
  Name: {
2319
2309
  leave: (e) => e.value
2320
2310
  },
@@ -2344,13 +2334,13 @@ const Ut = 80, Mt = {
2344
2334
  leave: ({ variable: e, type: t, defaultValue: n, directives: r }) => e + ": " + t + v(" = ", n) + v(" ", d(r, " "))
2345
2335
  },
2346
2336
  SelectionSet: {
2347
- leave: ({ selections: e }) => _(e)
2337
+ leave: ({ selections: e }) => P(e)
2348
2338
  },
2349
2339
  Field: {
2350
2340
  leave({ alias: e, name: t, arguments: n, directives: r, selectionSet: i }) {
2351
2341
  const s = v("", e, ": ") + t;
2352
2342
  let o = s + v("(", d(n, ", "), ")");
2353
- return o.length > Ut && (o = s + v(`(
2343
+ return o.length > _t && (o = s + v(`(
2354
2344
  `, Z(d(n, `
2355
2345
  `)), `
2356
2346
  )`)), d([o, d(r, " "), i], " ");
@@ -2388,7 +2378,7 @@ const Ut = 80, Mt = {
2388
2378
  leave: ({ value: e }) => e
2389
2379
  },
2390
2380
  StringValue: {
2391
- leave: ({ value: e, block: t }) => t ? ut(e) : Rt(e)
2381
+ leave: ({ value: e, block: t }) => t ? it(e) : St(e)
2392
2382
  },
2393
2383
  BooleanValue: {
2394
2384
  leave: ({ value: e }) => e ? "true" : "false"
@@ -2425,7 +2415,7 @@ const Ut = 80, Mt = {
2425
2415
  // Type System Definitions
2426
2416
  SchemaDefinition: {
2427
2417
  leave: ({ description: e, directives: t, operationTypes: n }) => v("", e, `
2428
- `) + d(["schema", d(t, " "), _(n)], " ")
2418
+ `) + d(["schema", d(t, " "), P(n)], " ")
2429
2419
  },
2430
2420
  OperationTypeDefinition: {
2431
2421
  leave: ({ operation: e, type: t }) => e + ": " + t
@@ -2442,14 +2432,14 @@ const Ut = 80, Mt = {
2442
2432
  t,
2443
2433
  v("implements ", d(n, " & ")),
2444
2434
  d(r, " "),
2445
- _(i)
2435
+ P(i)
2446
2436
  ],
2447
2437
  " "
2448
2438
  )
2449
2439
  },
2450
2440
  FieldDefinition: {
2451
2441
  leave: ({ description: e, name: t, arguments: n, type: r, directives: i }) => v("", e, `
2452
- `) + t + (xe(n) ? v(`(
2442
+ `) + t + (be(n) ? v(`(
2453
2443
  `, Z(d(n, `
2454
2444
  `)), `
2455
2445
  )`) : v("(", d(n, ", "), ")")) + ": " + r + v(" ", d(i, " "))
@@ -2469,7 +2459,7 @@ const Ut = 80, Mt = {
2469
2459
  t,
2470
2460
  v("implements ", d(n, " & ")),
2471
2461
  d(r, " "),
2472
- _(i)
2462
+ P(i)
2473
2463
  ],
2474
2464
  " "
2475
2465
  )
@@ -2483,7 +2473,7 @@ const Ut = 80, Mt = {
2483
2473
  },
2484
2474
  EnumTypeDefinition: {
2485
2475
  leave: ({ description: e, name: t, directives: n, values: r }) => v("", e, `
2486
- `) + d(["enum", t, d(n, " "), _(r)], " ")
2476
+ `) + d(["enum", t, d(n, " "), P(r)], " ")
2487
2477
  },
2488
2478
  EnumValueDefinition: {
2489
2479
  leave: ({ description: e, name: t, directives: n }) => v("", e, `
@@ -2491,18 +2481,18 @@ const Ut = 80, Mt = {
2491
2481
  },
2492
2482
  InputObjectTypeDefinition: {
2493
2483
  leave: ({ description: e, name: t, directives: n, fields: r }) => v("", e, `
2494
- `) + d(["input", t, d(n, " "), _(r)], " ")
2484
+ `) + d(["input", t, d(n, " "), P(r)], " ")
2495
2485
  },
2496
2486
  DirectiveDefinition: {
2497
2487
  leave: ({ description: e, name: t, arguments: n, repeatable: r, locations: i }) => v("", e, `
2498
- `) + "directive @" + t + (xe(n) ? v(`(
2488
+ `) + "directive @" + t + (be(n) ? v(`(
2499
2489
  `, Z(d(n, `
2500
2490
  `)), `
2501
2491
  )`) : v("(", d(n, ", "), ")")) + (r ? " repeatable" : "") + " on " + d(i, " | ")
2502
2492
  },
2503
2493
  SchemaExtension: {
2504
2494
  leave: ({ directives: e, operationTypes: t }) => d(
2505
- ["extend schema", d(e, " "), _(t)],
2495
+ ["extend schema", d(e, " "), P(t)],
2506
2496
  " "
2507
2497
  )
2508
2498
  },
@@ -2516,7 +2506,7 @@ const Ut = 80, Mt = {
2516
2506
  e,
2517
2507
  v("implements ", d(t, " & ")),
2518
2508
  d(n, " "),
2519
- _(r)
2509
+ P(r)
2520
2510
  ],
2521
2511
  " "
2522
2512
  )
@@ -2528,7 +2518,7 @@ const Ut = 80, Mt = {
2528
2518
  e,
2529
2519
  v("implements ", d(t, " & ")),
2530
2520
  d(n, " "),
2531
- _(r)
2521
+ P(r)
2532
2522
  ],
2533
2523
  " "
2534
2524
  )
@@ -2545,17 +2535,17 @@ const Ut = 80, Mt = {
2545
2535
  )
2546
2536
  },
2547
2537
  EnumTypeExtension: {
2548
- leave: ({ name: e, directives: t, values: n }) => d(["extend enum", e, d(t, " "), _(n)], " ")
2538
+ leave: ({ name: e, directives: t, values: n }) => d(["extend enum", e, d(t, " "), P(n)], " ")
2549
2539
  },
2550
2540
  InputObjectTypeExtension: {
2551
- leave: ({ name: e, directives: t, fields: n }) => d(["extend input", e, d(t, " "), _(n)], " ")
2541
+ leave: ({ name: e, directives: t, fields: n }) => d(["extend input", e, d(t, " "), P(n)], " ")
2552
2542
  }
2553
2543
  };
2554
2544
  function d(e, t = "") {
2555
2545
  var n;
2556
2546
  return (n = e == null ? void 0 : e.filter((r) => r).join(t)) !== null && n !== void 0 ? n : "";
2557
2547
  }
2558
- function _(e) {
2548
+ function P(e) {
2559
2549
  return v(`{
2560
2550
  `, Z(d(e, `
2561
2551
  `)), `
@@ -2568,955 +2558,997 @@ function Z(e) {
2568
2558
  return v(" ", e.replace(/\n/g, `
2569
2559
  `));
2570
2560
  }
2571
- function xe(e) {
2561
+ function be(e) {
2572
2562
  var t;
2573
2563
  return (t = e == null ? void 0 : e.some((n) => n.includes(`
2574
2564
  `))) !== null && t !== void 0 ? t : !1;
2575
2565
  }
2576
- const Se = (e) => {
2577
- var r, i;
2578
- let t;
2579
- const n = e.definitions.filter((s) => s.kind === "OperationDefinition");
2580
- return n.length === 1 && (t = (i = (r = n[0]) == null ? void 0 : r.name) == null ? void 0 : i.value), t;
2581
- }, le = (e) => {
2582
- if (typeof e == "string") {
2583
- let n;
2584
- try {
2585
- const r = Ue(e);
2586
- n = Se(r);
2587
- } catch {
2588
- }
2589
- return { query: e, operationName: n };
2566
+ var ee = /* @__PURE__ */ new Map(), ge = /* @__PURE__ */ new Map(), Me = !0, re = !1;
2567
+ function Ge(e) {
2568
+ return e.replace(/[\s,]+/g, " ").trim();
2569
+ }
2570
+ function wt(e) {
2571
+ return Ge(e.source.body.substring(e.start, e.end));
2572
+ }
2573
+ function Ft(e) {
2574
+ var t = /* @__PURE__ */ new Set(), n = [];
2575
+ return e.definitions.forEach(function(r) {
2576
+ if (r.kind === "FragmentDefinition") {
2577
+ var i = r.name.value, s = wt(r.loc), o = ge.get(i);
2578
+ o && !o.has(s) ? Me && console.warn("Warning: fragment with name " + i + ` already exists.
2579
+ graphql-tag enforces all fragment names across your application to be unique; read more about
2580
+ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : o || ge.set(i, o = /* @__PURE__ */ new Set()), o.add(s), t.has(s) || (t.add(s), n.push(r));
2581
+ } else
2582
+ n.push(r);
2583
+ }), ne(ne({}, e), { definitions: n });
2584
+ }
2585
+ function Bt(e) {
2586
+ var t = new Set(e.definitions);
2587
+ t.forEach(function(r) {
2588
+ r.loc && delete r.loc, Object.keys(r).forEach(function(i) {
2589
+ var s = r[i];
2590
+ s && typeof s == "object" && t.add(s);
2591
+ });
2592
+ });
2593
+ var n = e.loc;
2594
+ return n && (delete n.startToken, delete n.endToken), e;
2595
+ }
2596
+ function Ut(e) {
2597
+ var t = Ge(e);
2598
+ if (!ee.has(t)) {
2599
+ var n = Ue(e, {
2600
+ experimentalFragmentVariables: re,
2601
+ allowLegacyFragmentVariables: re
2602
+ });
2603
+ if (!n || n.kind !== "Document")
2604
+ throw new Error("Not a valid GraphQL document.");
2605
+ ee.set(t, Bt(Ft(n)));
2590
2606
  }
2591
- const t = Se(e);
2592
- return { query: Bt(e), operationName: t };
2607
+ return ee.get(t);
2608
+ }
2609
+ function M(e) {
2610
+ for (var t = [], n = 1; n < arguments.length; n++)
2611
+ t[n - 1] = arguments[n];
2612
+ typeof e == "string" && (e = [e]);
2613
+ var r = e[0];
2614
+ return t.forEach(function(i, s) {
2615
+ i && i.kind === "Document" ? r += i.loc.source.body : r += i, r += e[s + 1];
2616
+ }), Ut(r);
2617
+ }
2618
+ function qt() {
2619
+ ee.clear(), ge.clear();
2620
+ }
2621
+ function Mt() {
2622
+ Me = !1;
2623
+ }
2624
+ function Gt() {
2625
+ re = !0;
2626
+ }
2627
+ function Vt() {
2628
+ re = !1;
2629
+ }
2630
+ var $ = {
2631
+ gql: M,
2632
+ resetCaches: qt,
2633
+ disableFragmentWarnings: Mt,
2634
+ enableExperimentalFragmentVariables: Gt,
2635
+ disableExperimentalFragmentVariables: Vt
2593
2636
  };
2594
- class H extends Error {
2595
- constructor(t, n) {
2596
- const r = `${H.extractMessage(t)}: ${JSON.stringify({
2597
- response: t,
2598
- request: n
2599
- })}`;
2600
- super(r), Object.setPrototypeOf(this, H.prototype), this.response = t, this.request = n, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(this, H);
2637
+ (function(e) {
2638
+ e.gql = $.gql, e.resetCaches = $.resetCaches, e.disableFragmentWarnings = $.disableFragmentWarnings, e.enableExperimentalFragmentVariables = $.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = $.disableExperimentalFragmentVariables;
2639
+ })(M || (M = {}));
2640
+ M.default = M;
2641
+ const x = M, $t = x`
2642
+ query GetLocationAvailabilities($sku: String!, $first: Int, $after: String, $isReverse: Boolean! = false) {
2643
+ locationAvailabilities(
2644
+ sku: $sku
2645
+ first: $first
2646
+ after: $after
2647
+ isReverse: $isReverse
2648
+ ) {
2649
+ nodes {
2650
+ location {
2651
+ id
2652
+ name
2653
+ phone
2654
+ mapURL
2655
+ tags
2656
+ address {
2657
+ id
2658
+ countryCode
2659
+ country
2660
+ postalCode
2661
+ provinceCode
2662
+ province
2663
+ city
2664
+ address1
2665
+ address2
2666
+ updatedAt
2667
+ createdAt
2668
+ }
2669
+ }
2670
+ inventoryQuantity
2671
+ }
2672
+ pageInfo {
2673
+ startCursor
2674
+ endCursor
2675
+ hasNextPage
2676
+ hasPreviousPage
2677
+ }
2601
2678
  }
2602
- static extractMessage(t) {
2603
- var n, r;
2604
- return ((r = (n = t.errors) == null ? void 0 : n[0]) == null ? void 0 : r.message) ?? `GraphQL Error (Code: ${t.status})`;
2679
+ }
2680
+ `, jt = x`
2681
+ query GetLocationAvailability($sku: String!, $locationID: ID!) {
2682
+ locationAvailability(sku: $sku, locationID: $locationID) {
2683
+ location {
2684
+ id
2685
+ name
2686
+ phone
2687
+ mapURL
2688
+ tags
2689
+ address {
2690
+ id
2691
+ countryCode
2692
+ country
2693
+ postalCode
2694
+ provinceCode
2695
+ province
2696
+ city
2697
+ address1
2698
+ address2
2699
+ updatedAt
2700
+ createdAt
2701
+ }
2702
+ }
2703
+ inventoryQuantity
2605
2704
  }
2606
2705
  }
2607
- var qt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2608
- function Vt(e) {
2609
- return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
2706
+ `, Ht = x`
2707
+ query GetPurchasingCustomerMetafield($namespace: String!, $key: String!) {
2708
+ purchasingCustomerMetafield(namespace: $namespace, key: $key) {
2709
+ id
2710
+ namespace
2711
+ key
2712
+ value
2713
+ }
2610
2714
  }
2611
- var ge = { exports: {} };
2612
- (function(e, t) {
2613
- var n = typeof self < "u" ? self : qt, r = function() {
2614
- function s() {
2615
- this.fetch = !1, this.DOMException = n.DOMException;
2616
- }
2617
- return s.prototype = n, new s();
2618
- }();
2619
- (function(s) {
2620
- (function(o) {
2621
- var u = {
2622
- searchParams: "URLSearchParams" in s,
2623
- iterable: "Symbol" in s && "iterator" in Symbol,
2624
- blob: "FileReader" in s && "Blob" in s && function() {
2625
- try {
2626
- return new Blob(), !0;
2627
- } catch {
2628
- return !1;
2629
- }
2630
- }(),
2631
- formData: "FormData" in s,
2632
- arrayBuffer: "ArrayBuffer" in s
2633
- };
2634
- function h(a) {
2635
- return a && DataView.prototype.isPrototypeOf(a);
2636
- }
2637
- if (u.arrayBuffer)
2638
- var p = [
2639
- "[object Int8Array]",
2640
- "[object Uint8Array]",
2641
- "[object Uint8ClampedArray]",
2642
- "[object Int16Array]",
2643
- "[object Uint16Array]",
2644
- "[object Int32Array]",
2645
- "[object Uint32Array]",
2646
- "[object Float32Array]",
2647
- "[object Float64Array]"
2648
- ], m = ArrayBuffer.isView || function(a) {
2649
- return a && p.indexOf(Object.prototype.toString.call(a)) > -1;
2650
- };
2651
- function y(a) {
2652
- if (typeof a != "string" && (a = String(a)), /[^a-z0-9\-#$%&'*+.^_`|~]/i.test(a))
2653
- throw new TypeError("Invalid character in header field name");
2654
- return a.toLowerCase();
2715
+ `, Yt = x`
2716
+ query GetPoints {
2717
+ purchasingCustomer {
2718
+ pointsApproved
2719
+ pointsPending
2720
+ }
2721
+ }
2722
+ `, zt = x`
2723
+ query GetLocations($tag: String, $provinceCodes: [String!], $first: Int, $after: String, $isReverse: Boolean! = false) {
2724
+ locations(
2725
+ first: $first
2726
+ after: $after
2727
+ isReverse: $isReverse
2728
+ filter: {tag: $tag, provinceCodes: $provinceCodes}
2729
+ ) {
2730
+ nodes {
2731
+ id
2732
+ name
2733
+ phone
2734
+ mapURL
2735
+ tags
2736
+ address {
2737
+ id
2738
+ countryCode
2739
+ country
2740
+ postalCode
2741
+ provinceCode
2742
+ province
2743
+ city
2744
+ address1
2745
+ address2
2746
+ updatedAt
2747
+ createdAt
2655
2748
  }
2656
- function C(a) {
2657
- return typeof a != "string" && (a = String(a)), a;
2749
+ }
2750
+ pageInfo {
2751
+ startCursor
2752
+ endCursor
2753
+ hasNextPage
2754
+ hasPreviousPage
2755
+ }
2756
+ }
2757
+ }
2758
+ `, Jt = x`
2759
+ query GetPurchasingCustomerDiscounts($first: Int, $after: String, $isReverse: Boolean! = false) {
2760
+ purchasingCustomer {
2761
+ id
2762
+ orderPriceAdjustmentRules(first: $first, after: $after, isReverse: $isReverse) {
2763
+ nodes {
2764
+ id
2765
+ title
2766
+ status
2767
+ description
2768
+ code
2769
+ customerApplicable
2770
+ shopifyStoreApplicable
2771
+ applicableLocationCount
2772
+ hasApplicableLocations
2773
+ startsAt
2774
+ endsAt
2775
+ createdAt
2776
+ updatedAt
2658
2777
  }
2659
- function T(a) {
2660
- var l = {
2661
- next: function() {
2662
- var E = a.shift();
2663
- return { done: E === void 0, value: E };
2778
+ pageInfo {
2779
+ startCursor
2780
+ endCursor
2781
+ hasNextPage
2782
+ hasPreviousPage
2783
+ }
2784
+ }
2785
+ }
2786
+ }
2787
+ `, Qt = x`
2788
+ query GetPurchasingCustomerDiscountCodeCount {
2789
+ purchasingCustomer {
2790
+ id
2791
+ orderPriceAdjustmentRuleCount
2792
+ }
2793
+ }
2794
+ `, Xt = x`
2795
+ query GetPurchasingCustomerPointChangeActivities($first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: PointChangeActivitySortKey! = CREATED_AT) {
2796
+ purchasingCustomer {
2797
+ id
2798
+ pointChangeActivities(
2799
+ first: $first
2800
+ after: $after
2801
+ isReverse: $isReverse
2802
+ sortKeys: $sortKeys
2803
+ ) {
2804
+ nodes {
2805
+ id
2806
+ title
2807
+ tenant {
2808
+ id
2809
+ name
2810
+ }
2811
+ pointChange {
2812
+ id
2813
+ delta
2814
+ availableAt
2815
+ expiresDate
2816
+ availableUntil
2817
+ pointChangeCreatedAt
2818
+ tenant {
2819
+ id
2820
+ name
2664
2821
  }
2665
- };
2666
- return u.iterable && (l[Symbol.iterator] = function() {
2667
- return l;
2668
- }), l;
2822
+ createdAt
2823
+ }
2824
+ retailLocation {
2825
+ id
2826
+ name
2827
+ phone
2828
+ mapURL
2829
+ tags
2830
+ address {
2831
+ id
2832
+ countryCode
2833
+ country
2834
+ postalCode
2835
+ provinceCode
2836
+ province
2837
+ city
2838
+ address1
2839
+ address2
2840
+ updatedAt
2841
+ createdAt
2842
+ }
2843
+ }
2669
2844
  }
2670
- function g(a) {
2671
- this.map = {}, a instanceof g ? a.forEach(function(l, E) {
2672
- this.append(E, l);
2673
- }, this) : Array.isArray(a) ? a.forEach(function(l) {
2674
- this.append(l[0], l[1]);
2675
- }, this) : a && Object.getOwnPropertyNames(a).forEach(function(l) {
2676
- this.append(l, a[l]);
2677
- }, this);
2845
+ pageInfo {
2846
+ startCursor
2847
+ endCursor
2848
+ hasNextPage
2849
+ hasPreviousPage
2678
2850
  }
2679
- g.prototype.append = function(a, l) {
2680
- a = y(a), l = C(l);
2681
- var E = this.map[a];
2682
- this.map[a] = E ? E + ", " + l : l;
2683
- }, g.prototype.delete = function(a) {
2684
- delete this.map[y(a)];
2685
- }, g.prototype.get = function(a) {
2686
- return a = y(a), this.has(a) ? this.map[a] : null;
2687
- }, g.prototype.has = function(a) {
2688
- return this.map.hasOwnProperty(y(a));
2689
- }, g.prototype.set = function(a, l) {
2690
- this.map[y(a)] = C(l);
2691
- }, g.prototype.forEach = function(a, l) {
2692
- for (var E in this.map)
2693
- this.map.hasOwnProperty(E) && a.call(l, this.map[E], E, this);
2694
- }, g.prototype.keys = function() {
2695
- var a = [];
2696
- return this.forEach(function(l, E) {
2697
- a.push(E);
2698
- }), T(a);
2699
- }, g.prototype.values = function() {
2700
- var a = [];
2701
- return this.forEach(function(l) {
2702
- a.push(l);
2703
- }), T(a);
2704
- }, g.prototype.entries = function() {
2705
- var a = [];
2706
- return this.forEach(function(l, E) {
2707
- a.push([E, l]);
2708
- }), T(a);
2709
- }, u.iterable && (g.prototype[Symbol.iterator] = g.prototype.entries);
2710
- function N(a) {
2711
- if (a.bodyUsed)
2712
- return Promise.reject(new TypeError("Already read"));
2713
- a.bodyUsed = !0;
2851
+ }
2852
+ }
2853
+ }
2854
+ `, Wt = x`
2855
+ query GetPurchasingCustomerRank {
2856
+ purchasingCustomer {
2857
+ currentCustomerRank {
2858
+ id
2859
+ name
2860
+ threshold
2861
+ higherRank {
2862
+ id
2863
+ name
2864
+ threshold
2714
2865
  }
2715
- function D(a) {
2716
- return new Promise(function(l, E) {
2717
- a.onload = function() {
2718
- l(a.result);
2719
- }, a.onerror = function() {
2720
- E(a.error);
2721
- };
2722
- });
2866
+ lowerRank {
2867
+ id
2868
+ name
2869
+ threshold
2723
2870
  }
2724
- function R(a) {
2725
- var l = new FileReader(), E = D(l);
2726
- return l.readAsArrayBuffer(a), E;
2871
+ earnedPointToRankUp
2872
+ purchasePriceToRankUp
2873
+ calculationCondition {
2874
+ customerRankCalculationPeriod {
2875
+ start
2876
+ end
2877
+ }
2878
+ earnedPoint
2879
+ purchasePrice
2727
2880
  }
2728
- function z(a) {
2729
- var l = new FileReader(), E = D(l);
2730
- return l.readAsText(a), E;
2881
+ pointMultiplier {
2882
+ id
2883
+ customerRankRule {
2884
+ id
2885
+ name
2886
+ threshold
2887
+ }
2888
+ multiplier
2731
2889
  }
2732
- function P(a) {
2733
- for (var l = new Uint8Array(a), E = new Array(l.length), S = 0; S < l.length; S++)
2734
- E[S] = String.fromCharCode(l[S]);
2735
- return E.join("");
2890
+ }
2891
+ }
2892
+ }
2893
+ `, Kt = x`
2894
+ query GetSharingPurchasingCustomerCount {
2895
+ purchasingCustomer {
2896
+ id
2897
+ sharingPurchasingCustomerCount
2898
+ }
2899
+ }
2900
+ `, Zt = x`
2901
+ query GetPurchasingCustomerSharing {
2902
+ purchasingCustomer {
2903
+ id
2904
+ customerSharing {
2905
+ id
2906
+ purchasingCustomers {
2907
+ id
2908
+ sharingPurchasingCustomerCount
2909
+ tenant {
2910
+ id
2911
+ name
2912
+ }
2736
2913
  }
2737
- function k(a) {
2738
- if (a.slice)
2739
- return a.slice(0);
2740
- var l = new Uint8Array(a.byteLength);
2741
- return l.set(new Uint8Array(a)), l.buffer;
2914
+ }
2915
+ }
2916
+ }
2917
+ `, en = x`
2918
+ query GetProduct($id: String!, $first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: ProductVariantSortKeys! = CREATED_AT) {
2919
+ productByProductShopifyLegacyResourceID(productShopifyLegacyResourceID: $id) {
2920
+ id
2921
+ title
2922
+ hasBackOrderProductVariants
2923
+ isLocalPickupAvailable
2924
+ productVariants(
2925
+ first: $first
2926
+ after: $after
2927
+ isReverse: $isReverse
2928
+ sortKeys: $sortKeys
2929
+ ) {
2930
+ nodes {
2931
+ id
2932
+ title
2933
+ inventoryItem {
2934
+ id
2935
+ sku
2936
+ }
2937
+ isBackOrderEnable
2938
+ isLocalPickupAvailable
2742
2939
  }
2743
- function B() {
2744
- return this.bodyUsed = !1, this._initBody = function(a) {
2745
- this._bodyInit = a, a ? typeof a == "string" ? this._bodyText = a : u.blob && Blob.prototype.isPrototypeOf(a) ? this._bodyBlob = a : u.formData && FormData.prototype.isPrototypeOf(a) ? this._bodyFormData = a : u.searchParams && URLSearchParams.prototype.isPrototypeOf(a) ? this._bodyText = a.toString() : u.arrayBuffer && u.blob && h(a) ? (this._bodyArrayBuffer = k(a.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : u.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(a) || m(a)) ? this._bodyArrayBuffer = k(a) : this._bodyText = a = Object.prototype.toString.call(a) : this._bodyText = "", this.headers.get("content-type") || (typeof a == "string" ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : u.searchParams && URLSearchParams.prototype.isPrototypeOf(a) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
2746
- }, u.blob && (this.blob = function() {
2747
- var a = N(this);
2748
- if (a)
2749
- return a;
2750
- if (this._bodyBlob)
2751
- return Promise.resolve(this._bodyBlob);
2752
- if (this._bodyArrayBuffer)
2753
- return Promise.resolve(new Blob([this._bodyArrayBuffer]));
2754
- if (this._bodyFormData)
2755
- throw new Error("could not read FormData body as blob");
2756
- return Promise.resolve(new Blob([this._bodyText]));
2757
- }, this.arrayBuffer = function() {
2758
- return this._bodyArrayBuffer ? N(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(R);
2759
- }), this.text = function() {
2760
- var a = N(this);
2761
- if (a)
2762
- return a;
2763
- if (this._bodyBlob)
2764
- return z(this._bodyBlob);
2765
- if (this._bodyArrayBuffer)
2766
- return Promise.resolve(P(this._bodyArrayBuffer));
2767
- if (this._bodyFormData)
2768
- throw new Error("could not read FormData body as text");
2769
- return Promise.resolve(this._bodyText);
2770
- }, u.formData && (this.formData = function() {
2771
- return this.text().then($e);
2772
- }), this.json = function() {
2773
- return this.text().then(JSON.parse);
2774
- }, this;
2775
- }
2776
- var Q = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];
2777
- function J(a) {
2778
- var l = a.toUpperCase();
2779
- return Q.indexOf(l) > -1 ? l : a;
2780
- }
2781
- function w(a, l) {
2782
- l = l || {};
2783
- var E = l.body;
2784
- if (a instanceof w) {
2785
- if (a.bodyUsed)
2786
- throw new TypeError("Already read");
2787
- this.url = a.url, this.credentials = a.credentials, l.headers || (this.headers = new g(a.headers)), this.method = a.method, this.mode = a.mode, this.signal = a.signal, !E && a._bodyInit != null && (E = a._bodyInit, a.bodyUsed = !0);
2788
- } else
2789
- this.url = String(a);
2790
- if (this.credentials = l.credentials || this.credentials || "same-origin", (l.headers || !this.headers) && (this.headers = new g(l.headers)), this.method = J(l.method || this.method || "GET"), this.mode = l.mode || this.mode || null, this.signal = l.signal || this.signal, this.referrer = null, (this.method === "GET" || this.method === "HEAD") && E)
2791
- throw new TypeError("Body not allowed for GET or HEAD requests");
2792
- this._initBody(E);
2793
- }
2794
- w.prototype.clone = function() {
2795
- return new w(this, { body: this._bodyInit });
2796
- };
2797
- function $e(a) {
2798
- var l = new FormData();
2799
- return a.trim().split("&").forEach(function(E) {
2800
- if (E) {
2801
- var S = E.split("="), x = S.shift().replace(/\+/g, " "), A = S.join("=").replace(/\+/g, " ");
2802
- l.append(decodeURIComponent(x), decodeURIComponent(A));
2803
- }
2804
- }), l;
2805
- }
2806
- function je(a) {
2807
- var l = new g(), E = a.replace(/\r?\n[\t ]+/g, " ");
2808
- return E.split(/\r?\n/).forEach(function(S) {
2809
- var x = S.split(":"), A = x.shift().trim();
2810
- if (A) {
2811
- var X = x.join(":").trim();
2812
- l.append(A, X);
2813
- }
2814
- }), l;
2815
- }
2816
- B.call(w.prototype);
2817
- function L(a, l) {
2818
- l || (l = {}), this.type = "default", this.status = l.status === void 0 ? 200 : l.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = "statusText" in l ? l.statusText : "OK", this.headers = new g(l.headers), this.url = l.url || "", this._initBody(a);
2819
- }
2820
- B.call(L.prototype), L.prototype.clone = function() {
2821
- return new L(this._bodyInit, {
2822
- status: this.status,
2823
- statusText: this.statusText,
2824
- headers: new g(this.headers),
2825
- url: this.url
2826
- });
2827
- }, L.error = function() {
2828
- var a = new L(null, { status: 0, statusText: "" });
2829
- return a.type = "error", a;
2830
- };
2831
- var Ge = [301, 302, 303, 307, 308];
2832
- L.redirect = function(a, l) {
2833
- if (Ge.indexOf(l) === -1)
2834
- throw new RangeError("Invalid status code");
2835
- return new L(null, { status: l, headers: { location: a } });
2836
- }, o.DOMException = s.DOMException;
2837
- try {
2838
- new o.DOMException();
2839
- } catch {
2840
- o.DOMException = function(l, E) {
2841
- this.message = l, this.name = E;
2842
- var S = Error(l);
2843
- this.stack = S.stack;
2844
- }, o.DOMException.prototype = Object.create(Error.prototype), o.DOMException.prototype.constructor = o.DOMException;
2845
- }
2846
- function ae(a, l) {
2847
- return new Promise(function(E, S) {
2848
- var x = new w(a, l);
2849
- if (x.signal && x.signal.aborted)
2850
- return S(new o.DOMException("Aborted", "AbortError"));
2851
- var A = new XMLHttpRequest();
2852
- function X() {
2853
- A.abort();
2854
- }
2855
- A.onload = function() {
2856
- var $ = {
2857
- status: A.status,
2858
- statusText: A.statusText,
2859
- headers: je(A.getAllResponseHeaders() || "")
2860
- };
2861
- $.url = "responseURL" in A ? A.responseURL : $.headers.get("X-Request-URL");
2862
- var ce = "response" in A ? A.response : A.responseText;
2863
- E(new L(ce, $));
2864
- }, A.onerror = function() {
2865
- S(new TypeError("Network request failed"));
2866
- }, A.ontimeout = function() {
2867
- S(new TypeError("Network request failed"));
2868
- }, A.onabort = function() {
2869
- S(new o.DOMException("Aborted", "AbortError"));
2870
- }, A.open(x.method, x.url, !0), x.credentials === "include" ? A.withCredentials = !0 : x.credentials === "omit" && (A.withCredentials = !1), "responseType" in A && u.blob && (A.responseType = "blob"), x.headers.forEach(function($, ce) {
2871
- A.setRequestHeader(ce, $);
2872
- }), x.signal && (x.signal.addEventListener("abort", X), A.onreadystatechange = function() {
2873
- A.readyState === 4 && x.signal.removeEventListener("abort", X);
2874
- }), A.send(typeof x._bodyInit > "u" ? null : x._bodyInit);
2875
- });
2940
+ pageInfo {
2941
+ startCursor
2942
+ endCursor
2943
+ hasNextPage
2944
+ hasPreviousPage
2876
2945
  }
2877
- return ae.polyfill = !0, s.fetch || (s.fetch = ae, s.Headers = g, s.Request = w, s.Response = L), o.Headers = g, o.Request = w, o.Response = L, o.fetch = ae, Object.defineProperty(o, "__esModule", { value: !0 }), o;
2878
- })({});
2879
- })(r), r.fetch.ponyfill = !0, delete r.fetch.polyfill;
2880
- var i = r;
2881
- t = i.fetch, t.default = i.fetch, t.fetch = i.fetch, t.Headers = i.Headers, t.Request = i.Request, t.Response = i.Response, e.exports = t;
2882
- })(ge, ge.exports);
2883
- var ne = ge.exports;
2884
- const ee = /* @__PURE__ */ Vt(ne), $t = /* @__PURE__ */ ze({
2885
- __proto__: null,
2886
- default: ee
2887
- }, [ne]), U = (e) => {
2888
- let t = {};
2889
- return e && (typeof Headers < "u" && e instanceof Headers || $t && ne.Headers && e instanceof ne.Headers ? t = Je(e) : Array.isArray(e) ? e.forEach(([n, r]) => {
2890
- n && r !== void 0 && (t[n] = r);
2891
- }) : t = e), t;
2892
- }, De = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), jt = (e) => {
2893
- if (!Array.isArray(e.query)) {
2894
- const r = e, i = [`query=${encodeURIComponent(De(r.query))}`];
2895
- return e.variables && i.push(`variables=${encodeURIComponent(r.jsonSerializer.stringify(r.variables))}`), r.operationName && i.push(`operationName=${encodeURIComponent(r.operationName)}`), i.join("&");
2896
- }
2897
- if (typeof e.variables < "u" && !Array.isArray(e.variables))
2898
- throw new Error("Cannot create query with given variable type, array expected");
2899
- const t = e, n = e.query.reduce((r, i, s) => (r.push({
2900
- query: De(i),
2901
- variables: t.variables ? t.jsonSerializer.stringify(t.variables[s]) : void 0
2902
- }), r), []);
2903
- return `query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`;
2904
- }, Gt = (e) => async (t) => {
2905
- const { url: n, query: r, variables: i, operationName: s, fetch: o, fetchOptions: u, middleware: h } = t, p = { ...t.headers };
2906
- let m = "", y;
2907
- e === "POST" ? (y = Yt(r, i, s, u.jsonSerializer), typeof y == "string" && (p["Content-Type"] = "application/json")) : m = jt({
2908
- query: r,
2909
- variables: i,
2910
- operationName: s,
2911
- jsonSerializer: u.jsonSerializer ?? Ce
2912
- });
2913
- const C = {
2914
- method: e,
2915
- headers: p,
2916
- body: y,
2917
- ...u
2918
- };
2919
- let T = n, g = C;
2920
- if (h) {
2921
- const N = await Promise.resolve(h({ ...C, url: n, operationName: s, variables: i })), { url: D, ...R } = N;
2922
- T = D, g = R;
2923
- }
2924
- return m && (T = `${T}?${m}`), await o(T, g);
2925
- };
2926
- class Ht {
2927
- constructor(t, n = {}) {
2928
- this.url = t, this.requestConfig = n, this.rawRequest = async (...r) => {
2929
- const [i, s, o] = r, u = We(i, s, o), { headers: h, fetch: p = ee, method: m = "POST", requestMiddleware: y, responseMiddleware: C, ...T } = this.requestConfig, { url: g } = this;
2930
- u.signal !== void 0 && (T.signal = u.signal);
2931
- const { operationName: N } = le(u.query);
2932
- return de({
2933
- url: g,
2934
- query: u.query,
2935
- variables: u.variables,
2936
- headers: {
2937
- ...U(he(h)),
2938
- ...U(u.requestHeaders)
2939
- },
2940
- operationName: N,
2941
- fetch: p,
2942
- method: m,
2943
- fetchOptions: T,
2944
- middleware: y
2945
- }).then((D) => (C && C(D), D)).catch((D) => {
2946
- throw C && C(D), D;
2947
- });
2948
- };
2949
- }
2950
- async request(t, ...n) {
2951
- const [r, i] = n, s = Xe(t, r, i), { headers: o, fetch: u = ee, method: h = "POST", requestMiddleware: p, responseMiddleware: m, ...y } = this.requestConfig, { url: C } = this;
2952
- s.signal !== void 0 && (y.signal = s.signal);
2953
- const { query: T, operationName: g } = le(s.document);
2954
- return de({
2955
- url: C,
2956
- query: T,
2957
- variables: s.variables,
2958
- headers: {
2959
- ...U(he(o)),
2960
- ...U(s.requestHeaders)
2961
- },
2962
- operationName: g,
2963
- fetch: u,
2964
- method: h,
2965
- fetchOptions: y,
2966
- middleware: p
2967
- }).then((N) => (m && m(N), N.data)).catch((N) => {
2968
- throw m && m(N), N;
2969
- });
2970
- }
2971
- // prettier-ignore
2972
- batchRequests(t, n) {
2973
- const r = Ke(t, n), { headers: i, ...s } = this.requestConfig;
2974
- r.signal !== void 0 && (s.signal = r.signal);
2975
- const o = r.documents.map(({ document: h }) => le(h).query), u = r.documents.map(({ variables: h }) => h);
2976
- return de({
2977
- url: this.url,
2978
- query: o,
2979
- // @ts-expect-error TODO reconcile batch variables into system.
2980
- variables: u,
2981
- headers: {
2982
- ...U(he(i)),
2983
- ...U(r.requestHeaders)
2984
- },
2985
- operationName: void 0,
2986
- fetch: this.requestConfig.fetch ?? ee,
2987
- method: this.requestConfig.method || "POST",
2988
- fetchOptions: s,
2989
- middleware: this.requestConfig.requestMiddleware
2990
- }).then((h) => (this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(h), h.data)).catch((h) => {
2991
- throw this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(h), h;
2992
- });
2993
- }
2994
- setHeaders(t) {
2995
- return this.requestConfig.headers = t, this;
2996
- }
2997
- /**
2998
- * Attach a header to the client. All subsequent requests will have this header.
2999
- */
3000
- setHeader(t, n) {
3001
- const { headers: r } = this.requestConfig;
3002
- return r ? r[t] = n : this.requestConfig.headers = { [t]: n }, this;
3003
- }
3004
- /**
3005
- * Change the client endpoint. All subsequent requests will send to this endpoint.
3006
- */
3007
- setEndpoint(t) {
3008
- return this.url = t, this;
2946
+ }
3009
2947
  }
3010
2948
  }
3011
- const de = async (e) => {
3012
- const { query: t, variables: n, fetchOptions: r } = e, i = Gt(Qe(e.method ?? "post")), s = Array.isArray(e.query), o = await i(e), u = await zt(o, r.jsonSerializer ?? Ce), h = Array.isArray(u) ? !u.some(({ data: m }) => !m) : !!u.data, p = Array.isArray(u) || !u.errors || Array.isArray(u.errors) && !u.errors.length || r.errorPolicy === "all" || r.errorPolicy === "ignore";
3013
- if (o.ok && p && h) {
3014
- const { errors: m, ...y } = (Array.isArray(u), u), C = r.errorPolicy === "ignore" ? y : u;
3015
- return {
3016
- ...s ? { data: C } : C,
3017
- headers: o.headers,
3018
- status: o.status
3019
- };
3020
- } else {
3021
- const m = typeof u == "string" ? {
3022
- error: u
3023
- } : u;
3024
- throw new H(
3025
- // @ts-expect-error TODO
3026
- { ...m, status: o.status, headers: o.headers },
3027
- { query: t, variables: n }
3028
- );
3029
- }
3030
- }, Yt = (e, t, n, r) => {
3031
- const i = r ?? Ce;
3032
- if (!Array.isArray(e))
3033
- return i.stringify({ query: e, variables: t, operationName: n });
3034
- if (typeof t < "u" && !Array.isArray(t))
3035
- throw new Error("Cannot create request body with given variable type, array expected");
3036
- const s = e.reduce((o, u, h) => (o.push({ query: u, variables: t ? t[h] : void 0 }), o), []);
3037
- return i.stringify(s);
3038
- }, zt = async (e, t) => {
3039
- let n;
3040
- return e.headers.forEach((r, i) => {
3041
- i.toLowerCase() === "content-type" && (n = r);
3042
- }), n && (n.toLowerCase().startsWith("application/json") || n.toLowerCase().startsWith("application/graphql+json") || n.toLowerCase().startsWith("application/graphql-response+json")) ? t.parse(await e.text()) : e.text();
3043
- }, he = (e) => typeof e == "function" ? e() : e;
3044
- var re = function() {
3045
- return re = Object.assign || function(t) {
3046
- for (var n, r = 1, i = arguments.length; r < i; r++) {
3047
- n = arguments[r];
3048
- for (var s in n)
3049
- Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
2949
+ `, tn = x`
2950
+ query GetPointCampaignOrderRuleTargetCustomerRank {
2951
+ pointCampaignOrderRuleTargetCustomerRank {
2952
+ pointCampaignOrderRule {
2953
+ id
2954
+ title
3050
2955
  }
3051
- return t;
3052
- }, re.apply(this, arguments);
3053
- };
3054
- var te = /* @__PURE__ */ new Map(), ye = /* @__PURE__ */ new Map(), qe = !0, ie = !1;
3055
- function Ve(e) {
3056
- return e.replace(/[\s,]+/g, " ").trim();
3057
- }
3058
- function Qt(e) {
3059
- return Ve(e.source.body.substring(e.start, e.end));
3060
- }
3061
- function Jt(e) {
3062
- var t = /* @__PURE__ */ new Set(), n = [];
3063
- return e.definitions.forEach(function(r) {
3064
- if (r.kind === "FragmentDefinition") {
3065
- var i = r.name.value, s = Qt(r.loc), o = ye.get(i);
3066
- o && !o.has(s) ? qe && console.warn("Warning: fragment with name " + i + ` already exists.
3067
- graphql-tag enforces all fragment names across your application to be unique; read more about
3068
- this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`) : o || ye.set(i, o = /* @__PURE__ */ new Set()), o.add(s), t.has(s) || (t.add(s), n.push(r));
3069
- } else
3070
- n.push(r);
3071
- }), re(re({}, e), { definitions: n });
3072
- }
3073
- function Xt(e) {
3074
- var t = new Set(e.definitions);
3075
- t.forEach(function(r) {
3076
- r.loc && delete r.loc, Object.keys(r).forEach(function(i) {
3077
- var s = r[i];
3078
- s && typeof s == "object" && t.add(s);
3079
- });
3080
- });
3081
- var n = e.loc;
3082
- return n && (delete n.startToken, delete n.endToken), e;
3083
- }
3084
- function Wt(e) {
3085
- var t = Ve(e);
3086
- if (!te.has(t)) {
3087
- var n = Ue(e, {
3088
- experimentalFragmentVariables: ie,
3089
- allowLegacyFragmentVariables: ie
3090
- });
3091
- if (!n || n.kind !== "Document")
3092
- throw new Error("Not a valid GraphQL document.");
3093
- te.set(t, Xt(Jt(n)));
2956
+ multiplier
2957
+ fixedPoint
3094
2958
  }
3095
- return te.get(t);
3096
- }
3097
- function q(e) {
3098
- for (var t = [], n = 1; n < arguments.length; n++)
3099
- t[n - 1] = arguments[n];
3100
- typeof e == "string" && (e = [e]);
3101
- var r = e[0];
3102
- return t.forEach(function(i, s) {
3103
- i && i.kind === "Document" ? r += i.loc.source.body : r += i, r += e[s + 1];
3104
- }), Wt(r);
3105
- }
3106
- function Kt() {
3107
- te.clear(), ye.clear();
3108
- }
3109
- function Zt() {
3110
- qe = !1;
3111
2959
  }
3112
- function en() {
3113
- ie = !0;
2960
+ `, nn = x`
2961
+ query GetEstimatedShopifyCartPoint($input: EstimatedShopifyCartPointInput!) {
2962
+ estimatedShopifyCartPoint(input: $input) {
2963
+ pointsEarned
2964
+ }
3114
2965
  }
3115
- function tn() {
3116
- ie = !1;
2966
+ `, rn = x`
2967
+ query GetEstimatedShopifyCartLineItemPoint($input: EstimatedShopifyCartLineItemPointInput!) {
2968
+ estimatedShopifyCartLineItemPoint(input: $input) {
2969
+ pointsEarned
2970
+ }
3117
2971
  }
3118
- var j = {
3119
- gql: q,
3120
- resetCaches: Kt,
3121
- disableFragmentWarnings: Zt,
3122
- enableExperimentalFragmentVariables: en,
3123
- disableExperimentalFragmentVariables: tn
3124
- };
3125
- (function(e) {
3126
- e.gql = j.gql, e.resetCaches = j.resetCaches, e.disableFragmentWarnings = j.disableFragmentWarnings, e.enableExperimentalFragmentVariables = j.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = j.disableExperimentalFragmentVariables;
3127
- })(q || (q = {}));
3128
- q.default = q;
3129
- const O = q, nn = O`
3130
- query GetLocationAvailabilities($sku: String!, $first: Int, $after: String, $isReverse: Boolean! = false) {
3131
- locationAvailabilities(
3132
- sku: $sku
3133
- first: $first
3134
- after: $after
3135
- isReverse: $isReverse
3136
- ) {
3137
- nodes {
3138
- location {
2972
+ `, sn = x`
2973
+ mutation PurchasingCustomerSendCustomerSharingActivationCode {
2974
+ purchasingCustomerSendCustomerSharingActivationCode {
2975
+ purchasingCustomer {
2976
+ id
2977
+ sharingPurchasingCustomerCount
2978
+ tenant {
3139
2979
  id
3140
2980
  name
3141
- phone
3142
- mapURL
3143
- tags
3144
- address {
3145
- id
3146
- countryCode
3147
- country
3148
- postalCode
3149
- provinceCode
3150
- province
3151
- city
3152
- address1
3153
- address2
3154
- updatedAt
3155
- createdAt
3156
- }
3157
2981
  }
3158
- inventoryQuantity
3159
2982
  }
3160
- pageInfo {
3161
- startCursor
3162
- endCursor
3163
- hasNextPage
3164
- hasPreviousPage
2983
+ customerSharingActivationCode {
2984
+ id
3165
2985
  }
3166
2986
  }
3167
2987
  }
3168
- `, rn = O`
3169
- query GetLocationAvailability($sku: String!, $locationID: ID!) {
3170
- locationAvailability(sku: $sku, locationID: $locationID) {
3171
- location {
2988
+ `, on = x`
2989
+ mutation PurchasingCustomerActivateCustomerSharing($email: String!, $activationCode: String!) {
2990
+ purchasingCustomerActivateCustomerSharing(
2991
+ input: {email: $email, activationCode: $activationCode}
2992
+ ) {
2993
+ purchasingCustomer {
3172
2994
  id
3173
- name
3174
- phone
3175
- mapURL
3176
- tags
3177
- address {
2995
+ sharingPurchasingCustomerCount
2996
+ tenant {
3178
2997
  id
3179
- countryCode
3180
- country
3181
- postalCode
3182
- provinceCode
3183
- province
3184
- city
3185
- address1
3186
- address2
3187
- updatedAt
3188
- createdAt
2998
+ name
2999
+ }
3000
+ }
3001
+ }
3002
+ }
3003
+ `, an = (e, t, n, r) => e();
3004
+ function un(e, t = an) {
3005
+ return {
3006
+ GetLocationAvailabilities(n, r) {
3007
+ return t((i) => e.request($t, n, { ...r, ...i }), "GetLocationAvailabilities", "query", n);
3008
+ },
3009
+ GetLocationAvailability(n, r) {
3010
+ return t((i) => e.request(jt, n, { ...r, ...i }), "GetLocationAvailability", "query", n);
3011
+ },
3012
+ GetPurchasingCustomerMetafield(n, r) {
3013
+ return t((i) => e.request(Ht, n, { ...r, ...i }), "GetPurchasingCustomerMetafield", "query", n);
3014
+ },
3015
+ GetPoints(n, r) {
3016
+ return t((i) => e.request(Yt, n, { ...r, ...i }), "GetPoints", "query", n);
3017
+ },
3018
+ GetLocations(n, r) {
3019
+ return t((i) => e.request(zt, n, { ...r, ...i }), "GetLocations", "query", n);
3020
+ },
3021
+ GetPurchasingCustomerDiscounts(n, r) {
3022
+ return t((i) => e.request(Jt, n, { ...r, ...i }), "GetPurchasingCustomerDiscounts", "query", n);
3023
+ },
3024
+ GetPurchasingCustomerDiscountCodeCount(n, r) {
3025
+ return t((i) => e.request(Qt, n, { ...r, ...i }), "GetPurchasingCustomerDiscountCodeCount", "query", n);
3026
+ },
3027
+ GetPurchasingCustomerPointChangeActivities(n, r) {
3028
+ return t((i) => e.request(Xt, n, { ...r, ...i }), "GetPurchasingCustomerPointChangeActivities", "query", n);
3029
+ },
3030
+ GetPurchasingCustomerRank(n, r) {
3031
+ return t((i) => e.request(Wt, n, { ...r, ...i }), "GetPurchasingCustomerRank", "query", n);
3032
+ },
3033
+ GetSharingPurchasingCustomerCount(n, r) {
3034
+ return t((i) => e.request(Kt, n, { ...r, ...i }), "GetSharingPurchasingCustomerCount", "query", n);
3035
+ },
3036
+ GetPurchasingCustomerSharing(n, r) {
3037
+ return t((i) => e.request(Zt, n, { ...r, ...i }), "GetPurchasingCustomerSharing", "query", n);
3038
+ },
3039
+ GetProduct(n, r) {
3040
+ return t((i) => e.request(en, n, { ...r, ...i }), "GetProduct", "query", n);
3041
+ },
3042
+ GetPointCampaignOrderRuleTargetCustomerRank(n, r) {
3043
+ return t((i) => e.request(tn, n, { ...r, ...i }), "GetPointCampaignOrderRuleTargetCustomerRank", "query", n);
3044
+ },
3045
+ GetEstimatedShopifyCartPoint(n, r) {
3046
+ return t((i) => e.request(nn, n, { ...r, ...i }), "GetEstimatedShopifyCartPoint", "query", n);
3047
+ },
3048
+ GetEstimatedShopifyCartLineItemPoint(n, r) {
3049
+ return t((i) => e.request(rn, n, { ...r, ...i }), "GetEstimatedShopifyCartLineItemPoint", "query", n);
3050
+ },
3051
+ PurchasingCustomerSendCustomerSharingActivationCode(n, r) {
3052
+ return t((i) => e.request(sn, n, { ...r, ...i }), "PurchasingCustomerSendCustomerSharingActivationCode", "mutation", n);
3053
+ },
3054
+ PurchasingCustomerActivateCustomerSharing(n, r) {
3055
+ return t((i) => e.request(on, n, { ...r, ...i }), "PurchasingCustomerActivateCustomerSharing", "mutation", n);
3056
+ }
3057
+ };
3058
+ }
3059
+ const ve = JSON, cn = (e) => e.toUpperCase(), ln = (e) => {
3060
+ const t = {};
3061
+ return e.forEach((n, r) => {
3062
+ t[r] = n;
3063
+ }), t;
3064
+ }, dn = (e, t, n) => e.document ? e : {
3065
+ document: e,
3066
+ variables: t,
3067
+ requestHeaders: n,
3068
+ signal: void 0
3069
+ }, hn = (e, t, n) => e.query ? e : {
3070
+ query: e,
3071
+ variables: t,
3072
+ requestHeaders: n,
3073
+ signal: void 0
3074
+ }, pn = (e, t) => e.documents ? e : {
3075
+ documents: e,
3076
+ requestHeaders: t,
3077
+ signal: void 0
3078
+ }, xe = (e) => {
3079
+ var r, i;
3080
+ let t;
3081
+ const n = e.definitions.filter((s) => s.kind === "OperationDefinition");
3082
+ return n.length === 1 && (t = (i = (r = n[0]) == null ? void 0 : r.name) == null ? void 0 : i.value), t;
3083
+ }, le = (e) => {
3084
+ if (typeof e == "string") {
3085
+ let n;
3086
+ try {
3087
+ const r = Ue(e);
3088
+ n = xe(r);
3089
+ } catch {
3090
+ }
3091
+ return { query: e, operationName: n };
3092
+ }
3093
+ const t = xe(e);
3094
+ return { query: Pt(e), operationName: t };
3095
+ };
3096
+ class H extends Error {
3097
+ constructor(t, n) {
3098
+ const r = `${H.extractMessage(t)}: ${JSON.stringify({
3099
+ response: t,
3100
+ request: n
3101
+ })}`;
3102
+ super(r), Object.setPrototypeOf(this, H.prototype), this.response = t, this.request = n, typeof Error.captureStackTrace == "function" && Error.captureStackTrace(this, H);
3103
+ }
3104
+ static extractMessage(t) {
3105
+ var n, r;
3106
+ return ((r = (n = t.errors) == null ? void 0 : n[0]) == null ? void 0 : r.message) ?? `GraphQL Error (Code: ${t.status})`;
3107
+ }
3108
+ }
3109
+ var fn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
3110
+ function mn(e) {
3111
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
3112
+ }
3113
+ var ye = { exports: {} };
3114
+ (function(e, t) {
3115
+ var n = typeof self < "u" ? self : fn, r = function() {
3116
+ function s() {
3117
+ this.fetch = !1, this.DOMException = n.DOMException;
3118
+ }
3119
+ return s.prototype = n, new s();
3120
+ }();
3121
+ (function(s) {
3122
+ (function(o) {
3123
+ var c = {
3124
+ searchParams: "URLSearchParams" in s,
3125
+ iterable: "Symbol" in s && "iterator" in Symbol,
3126
+ blob: "FileReader" in s && "Blob" in s && function() {
3127
+ try {
3128
+ return new Blob(), !0;
3129
+ } catch {
3130
+ return !1;
3131
+ }
3132
+ }(),
3133
+ formData: "FormData" in s,
3134
+ arrayBuffer: "ArrayBuffer" in s
3135
+ };
3136
+ function h(a) {
3137
+ return a && DataView.prototype.isPrototypeOf(a);
3138
+ }
3139
+ if (c.arrayBuffer)
3140
+ var p = [
3141
+ "[object Int8Array]",
3142
+ "[object Uint8Array]",
3143
+ "[object Uint8ClampedArray]",
3144
+ "[object Int16Array]",
3145
+ "[object Uint16Array]",
3146
+ "[object Int32Array]",
3147
+ "[object Uint32Array]",
3148
+ "[object Float32Array]",
3149
+ "[object Float64Array]"
3150
+ ], m = ArrayBuffer.isView || function(a) {
3151
+ return a && p.indexOf(Object.prototype.toString.call(a)) > -1;
3152
+ };
3153
+ function y(a) {
3154
+ if (typeof a != "string" && (a = String(a)), /[^a-z0-9\-#$%&'*+.^_`|~]/i.test(a))
3155
+ throw new TypeError("Invalid character in header field name");
3156
+ return a.toLowerCase();
3157
+ }
3158
+ function C(a) {
3159
+ return typeof a != "string" && (a = String(a)), a;
3160
+ }
3161
+ function T(a) {
3162
+ var l = {
3163
+ next: function() {
3164
+ var E = a.shift();
3165
+ return { done: E === void 0, value: E };
3166
+ }
3167
+ };
3168
+ return c.iterable && (l[Symbol.iterator] = function() {
3169
+ return l;
3170
+ }), l;
3171
+ }
3172
+ function g(a) {
3173
+ this.map = {}, a instanceof g ? a.forEach(function(l, E) {
3174
+ this.append(E, l);
3175
+ }, this) : Array.isArray(a) ? a.forEach(function(l) {
3176
+ this.append(l[0], l[1]);
3177
+ }, this) : a && Object.getOwnPropertyNames(a).forEach(function(l) {
3178
+ this.append(l, a[l]);
3179
+ }, this);
3180
+ }
3181
+ g.prototype.append = function(a, l) {
3182
+ a = y(a), l = C(l);
3183
+ var E = this.map[a];
3184
+ this.map[a] = E ? E + ", " + l : l;
3185
+ }, g.prototype.delete = function(a) {
3186
+ delete this.map[y(a)];
3187
+ }, g.prototype.get = function(a) {
3188
+ return a = y(a), this.has(a) ? this.map[a] : null;
3189
+ }, g.prototype.has = function(a) {
3190
+ return this.map.hasOwnProperty(y(a));
3191
+ }, g.prototype.set = function(a, l) {
3192
+ this.map[y(a)] = C(l);
3193
+ }, g.prototype.forEach = function(a, l) {
3194
+ for (var E in this.map)
3195
+ this.map.hasOwnProperty(E) && a.call(l, this.map[E], E, this);
3196
+ }, g.prototype.keys = function() {
3197
+ var a = [];
3198
+ return this.forEach(function(l, E) {
3199
+ a.push(E);
3200
+ }), T(a);
3201
+ }, g.prototype.values = function() {
3202
+ var a = [];
3203
+ return this.forEach(function(l) {
3204
+ a.push(l);
3205
+ }), T(a);
3206
+ }, g.prototype.entries = function() {
3207
+ var a = [];
3208
+ return this.forEach(function(l, E) {
3209
+ a.push([E, l]);
3210
+ }), T(a);
3211
+ }, c.iterable && (g.prototype[Symbol.iterator] = g.prototype.entries);
3212
+ function N(a) {
3213
+ if (a.bodyUsed)
3214
+ return Promise.reject(new TypeError("Already read"));
3215
+ a.bodyUsed = !0;
3216
+ }
3217
+ function O(a) {
3218
+ return new Promise(function(l, E) {
3219
+ a.onload = function() {
3220
+ l(a.result);
3221
+ }, a.onerror = function() {
3222
+ E(a.error);
3223
+ };
3224
+ });
3225
+ }
3226
+ function D(a) {
3227
+ var l = new FileReader(), E = O(l);
3228
+ return l.readAsArrayBuffer(a), E;
3189
3229
  }
3190
- }
3191
- inventoryQuantity
3192
- }
3193
- }
3194
- `, sn = O`
3195
- query GetPurchasingCustomerMetafield($namespace: String!, $key: String!) {
3196
- purchasingCustomerMetafield(namespace: $namespace, key: $key) {
3197
- id
3198
- namespace
3199
- key
3200
- value
3201
- }
3202
- }
3203
- `, on = O`
3204
- query GetPoints {
3205
- purchasingCustomer {
3206
- pointsApproved
3207
- pointsPending
3208
- }
3209
- }
3210
- `, an = O`
3211
- query GetLocations($tag: String, $provinceCodes: [String!], $first: Int, $after: String, $isReverse: Boolean! = false) {
3212
- locations(
3213
- first: $first
3214
- after: $after
3215
- isReverse: $isReverse
3216
- filter: {tag: $tag, provinceCodes: $provinceCodes}
3217
- ) {
3218
- nodes {
3219
- id
3220
- name
3221
- phone
3222
- mapURL
3223
- tags
3224
- address {
3225
- id
3226
- countryCode
3227
- country
3228
- postalCode
3229
- provinceCode
3230
- province
3231
- city
3232
- address1
3233
- address2
3234
- updatedAt
3235
- createdAt
3230
+ function z(a) {
3231
+ var l = new FileReader(), E = O(l);
3232
+ return l.readAsText(a), E;
3236
3233
  }
3237
- }
3238
- pageInfo {
3239
- startCursor
3240
- endCursor
3241
- hasNextPage
3242
- hasPreviousPage
3243
- }
3244
- }
3245
- }
3246
- `, cn = O`
3247
- query GetPurchasingCustomerDiscounts($first: Int, $after: String, $isReverse: Boolean! = false) {
3248
- purchasingCustomer {
3249
- id
3250
- orderPriceAdjustmentRules(first: $first, after: $after, isReverse: $isReverse) {
3251
- nodes {
3252
- id
3253
- title
3254
- status
3255
- description
3256
- code
3257
- customerApplicable
3258
- shopifyStoreApplicable
3259
- applicableLocationCount
3260
- hasApplicableLocations
3261
- startsAt
3262
- endsAt
3263
- createdAt
3264
- updatedAt
3234
+ function _(a) {
3235
+ for (var l = new Uint8Array(a), E = new Array(l.length), R = 0; R < l.length; R++)
3236
+ E[R] = String.fromCharCode(l[R]);
3237
+ return E.join("");
3265
3238
  }
3266
- pageInfo {
3267
- startCursor
3268
- endCursor
3269
- hasNextPage
3270
- hasPreviousPage
3239
+ function k(a) {
3240
+ if (a.slice)
3241
+ return a.slice(0);
3242
+ var l = new Uint8Array(a.byteLength);
3243
+ return l.set(new Uint8Array(a)), l.buffer;
3271
3244
  }
3272
- }
3273
- }
3274
- }
3275
- `, un = O`
3276
- query GetPurchasingCustomerDiscountCodeCount {
3277
- purchasingCustomer {
3278
- id
3279
- orderPriceAdjustmentRuleCount
3280
- }
3281
- }
3282
- `, ln = O`
3283
- query GetPurchasingCustomerPointChangeActivities($first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: PointChangeActivitySortKey! = CREATED_AT) {
3284
- purchasingCustomer {
3285
- id
3286
- pointChangeActivities(
3287
- first: $first
3288
- after: $after
3289
- isReverse: $isReverse
3290
- sortKeys: $sortKeys
3291
- ) {
3292
- nodes {
3293
- id
3294
- title
3295
- tenant {
3296
- id
3297
- name
3298
- }
3299
- pointChange {
3300
- id
3301
- delta
3302
- availableAt
3303
- expiresDate
3304
- availableUntil
3305
- pointChangeCreatedAt
3306
- tenant {
3307
- id
3308
- name
3309
- }
3310
- createdAt
3311
- }
3312
- retailLocation {
3313
- id
3314
- name
3315
- phone
3316
- mapURL
3317
- tags
3318
- address {
3319
- id
3320
- countryCode
3321
- country
3322
- postalCode
3323
- provinceCode
3324
- province
3325
- city
3326
- address1
3327
- address2
3328
- updatedAt
3329
- createdAt
3330
- }
3331
- }
3245
+ function B() {
3246
+ return this.bodyUsed = !1, this._initBody = function(a) {
3247
+ this._bodyInit = a, a ? typeof a == "string" ? this._bodyText = a : c.blob && Blob.prototype.isPrototypeOf(a) ? this._bodyBlob = a : c.formData && FormData.prototype.isPrototypeOf(a) ? this._bodyFormData = a : c.searchParams && URLSearchParams.prototype.isPrototypeOf(a) ? this._bodyText = a.toString() : c.arrayBuffer && c.blob && h(a) ? (this._bodyArrayBuffer = k(a.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : c.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(a) || m(a)) ? this._bodyArrayBuffer = k(a) : this._bodyText = a = Object.prototype.toString.call(a) : this._bodyText = "", this.headers.get("content-type") || (typeof a == "string" ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : c.searchParams && URLSearchParams.prototype.isPrototypeOf(a) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
3248
+ }, c.blob && (this.blob = function() {
3249
+ var a = N(this);
3250
+ if (a)
3251
+ return a;
3252
+ if (this._bodyBlob)
3253
+ return Promise.resolve(this._bodyBlob);
3254
+ if (this._bodyArrayBuffer)
3255
+ return Promise.resolve(new Blob([this._bodyArrayBuffer]));
3256
+ if (this._bodyFormData)
3257
+ throw new Error("could not read FormData body as blob");
3258
+ return Promise.resolve(new Blob([this._bodyText]));
3259
+ }, this.arrayBuffer = function() {
3260
+ return this._bodyArrayBuffer ? N(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(D);
3261
+ }), this.text = function() {
3262
+ var a = N(this);
3263
+ if (a)
3264
+ return a;
3265
+ if (this._bodyBlob)
3266
+ return z(this._bodyBlob);
3267
+ if (this._bodyArrayBuffer)
3268
+ return Promise.resolve(_(this._bodyArrayBuffer));
3269
+ if (this._bodyFormData)
3270
+ throw new Error("could not read FormData body as text");
3271
+ return Promise.resolve(this._bodyText);
3272
+ }, c.formData && (this.formData = function() {
3273
+ return this.text().then(Ve);
3274
+ }), this.json = function() {
3275
+ return this.text().then(JSON.parse);
3276
+ }, this;
3332
3277
  }
3333
- pageInfo {
3334
- startCursor
3335
- endCursor
3336
- hasNextPage
3337
- hasPreviousPage
3278
+ var J = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];
3279
+ function Q(a) {
3280
+ var l = a.toUpperCase();
3281
+ return J.indexOf(l) > -1 ? l : a;
3338
3282
  }
3339
- }
3340
- }
3341
- }
3342
- `, dn = O`
3343
- query GetPurchasingCustomerRank {
3344
- purchasingCustomer {
3345
- currentCustomerRank {
3346
- id
3347
- name
3348
- threshold
3349
- higherRank {
3350
- id
3351
- name
3352
- threshold
3283
+ function w(a, l) {
3284
+ l = l || {};
3285
+ var E = l.body;
3286
+ if (a instanceof w) {
3287
+ if (a.bodyUsed)
3288
+ throw new TypeError("Already read");
3289
+ this.url = a.url, this.credentials = a.credentials, l.headers || (this.headers = new g(a.headers)), this.method = a.method, this.mode = a.mode, this.signal = a.signal, !E && a._bodyInit != null && (E = a._bodyInit, a.bodyUsed = !0);
3290
+ } else
3291
+ this.url = String(a);
3292
+ if (this.credentials = l.credentials || this.credentials || "same-origin", (l.headers || !this.headers) && (this.headers = new g(l.headers)), this.method = Q(l.method || this.method || "GET"), this.mode = l.mode || this.mode || null, this.signal = l.signal || this.signal, this.referrer = null, (this.method === "GET" || this.method === "HEAD") && E)
3293
+ throw new TypeError("Body not allowed for GET or HEAD requests");
3294
+ this._initBody(E);
3353
3295
  }
3354
- lowerRank {
3355
- id
3356
- name
3357
- threshold
3296
+ w.prototype.clone = function() {
3297
+ return new w(this, { body: this._bodyInit });
3298
+ };
3299
+ function Ve(a) {
3300
+ var l = new FormData();
3301
+ return a.trim().split("&").forEach(function(E) {
3302
+ if (E) {
3303
+ var R = E.split("="), b = R.shift().replace(/\+/g, " "), A = R.join("=").replace(/\+/g, " ");
3304
+ l.append(decodeURIComponent(b), decodeURIComponent(A));
3305
+ }
3306
+ }), l;
3358
3307
  }
3359
- earnedPointToRankUp
3360
- purchasePriceToRankUp
3361
- calculationCondition {
3362
- customerRankCalculationPeriod {
3363
- start
3364
- end
3365
- }
3366
- earnedPoint
3367
- purchasePrice
3308
+ function $e(a) {
3309
+ var l = new g(), E = a.replace(/\r?\n[\t ]+/g, " ");
3310
+ return E.split(/\r?\n/).forEach(function(R) {
3311
+ var b = R.split(":"), A = b.shift().trim();
3312
+ if (A) {
3313
+ var X = b.join(":").trim();
3314
+ l.append(A, X);
3315
+ }
3316
+ }), l;
3368
3317
  }
3369
- pointMultiplier {
3370
- id
3371
- customerRankRule {
3372
- id
3373
- name
3374
- threshold
3375
- }
3376
- multiplier
3318
+ B.call(w.prototype);
3319
+ function L(a, l) {
3320
+ l || (l = {}), this.type = "default", this.status = l.status === void 0 ? 200 : l.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = "statusText" in l ? l.statusText : "OK", this.headers = new g(l.headers), this.url = l.url || "", this._initBody(a);
3321
+ }
3322
+ B.call(L.prototype), L.prototype.clone = function() {
3323
+ return new L(this._bodyInit, {
3324
+ status: this.status,
3325
+ statusText: this.statusText,
3326
+ headers: new g(this.headers),
3327
+ url: this.url
3328
+ });
3329
+ }, L.error = function() {
3330
+ var a = new L(null, { status: 0, statusText: "" });
3331
+ return a.type = "error", a;
3332
+ };
3333
+ var je = [301, 302, 303, 307, 308];
3334
+ L.redirect = function(a, l) {
3335
+ if (je.indexOf(l) === -1)
3336
+ throw new RangeError("Invalid status code");
3337
+ return new L(null, { status: l, headers: { location: a } });
3338
+ }, o.DOMException = s.DOMException;
3339
+ try {
3340
+ new o.DOMException();
3341
+ } catch {
3342
+ o.DOMException = function(l, E) {
3343
+ this.message = l, this.name = E;
3344
+ var R = Error(l);
3345
+ this.stack = R.stack;
3346
+ }, o.DOMException.prototype = Object.create(Error.prototype), o.DOMException.prototype.constructor = o.DOMException;
3377
3347
  }
3378
- }
3348
+ function ae(a, l) {
3349
+ return new Promise(function(E, R) {
3350
+ var b = new w(a, l);
3351
+ if (b.signal && b.signal.aborted)
3352
+ return R(new o.DOMException("Aborted", "AbortError"));
3353
+ var A = new XMLHttpRequest();
3354
+ function X() {
3355
+ A.abort();
3356
+ }
3357
+ A.onload = function() {
3358
+ var V = {
3359
+ status: A.status,
3360
+ statusText: A.statusText,
3361
+ headers: $e(A.getAllResponseHeaders() || "")
3362
+ };
3363
+ V.url = "responseURL" in A ? A.responseURL : V.headers.get("X-Request-URL");
3364
+ var ue = "response" in A ? A.response : A.responseText;
3365
+ E(new L(ue, V));
3366
+ }, A.onerror = function() {
3367
+ R(new TypeError("Network request failed"));
3368
+ }, A.ontimeout = function() {
3369
+ R(new TypeError("Network request failed"));
3370
+ }, A.onabort = function() {
3371
+ R(new o.DOMException("Aborted", "AbortError"));
3372
+ }, A.open(b.method, b.url, !0), b.credentials === "include" ? A.withCredentials = !0 : b.credentials === "omit" && (A.withCredentials = !1), "responseType" in A && c.blob && (A.responseType = "blob"), b.headers.forEach(function(V, ue) {
3373
+ A.setRequestHeader(ue, V);
3374
+ }), b.signal && (b.signal.addEventListener("abort", X), A.onreadystatechange = function() {
3375
+ A.readyState === 4 && b.signal.removeEventListener("abort", X);
3376
+ }), A.send(typeof b._bodyInit > "u" ? null : b._bodyInit);
3377
+ });
3378
+ }
3379
+ return ae.polyfill = !0, s.fetch || (s.fetch = ae, s.Headers = g, s.Request = w, s.Response = L), o.Headers = g, o.Request = w, o.Response = L, o.fetch = ae, Object.defineProperty(o, "__esModule", { value: !0 }), o;
3380
+ })({});
3381
+ })(r), r.fetch.ponyfill = !0, delete r.fetch.polyfill;
3382
+ var i = r;
3383
+ t = i.fetch, t.default = i.fetch, t.fetch = i.fetch, t.Headers = i.Headers, t.Request = i.Request, t.Response = i.Response, e.exports = t;
3384
+ })(ye, ye.exports);
3385
+ var ie = ye.exports;
3386
+ const te = /* @__PURE__ */ mn(ie), gn = /* @__PURE__ */ ze({
3387
+ __proto__: null,
3388
+ default: te
3389
+ }, [ie]), U = (e) => {
3390
+ let t = {};
3391
+ return e && (typeof Headers < "u" && e instanceof Headers || gn && ie.Headers && e instanceof ie.Headers ? t = ln(e) : Array.isArray(e) ? e.forEach(([n, r]) => {
3392
+ n && r !== void 0 && (t[n] = r);
3393
+ }) : t = e), t;
3394
+ }, Re = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), yn = (e) => {
3395
+ if (!Array.isArray(e.query)) {
3396
+ const r = e, i = [`query=${encodeURIComponent(Re(r.query))}`];
3397
+ return e.variables && i.push(`variables=${encodeURIComponent(r.jsonSerializer.stringify(r.variables))}`), r.operationName && i.push(`operationName=${encodeURIComponent(r.operationName)}`), i.join("&");
3379
3398
  }
3380
- }
3381
- `, hn = O`
3382
- query GetSharingPurchasingCustomerCount {
3383
- purchasingCustomer {
3384
- id
3385
- sharingPurchasingCustomerCount
3399
+ if (typeof e.variables < "u" && !Array.isArray(e.variables))
3400
+ throw new Error("Cannot create query with given variable type, array expected");
3401
+ const t = e, n = e.query.reduce((r, i, s) => (r.push({
3402
+ query: Re(i),
3403
+ variables: t.variables ? t.jsonSerializer.stringify(t.variables[s]) : void 0
3404
+ }), r), []);
3405
+ return `query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`;
3406
+ }, Cn = (e) => async (t) => {
3407
+ const { url: n, query: r, variables: i, operationName: s, fetch: o, fetchOptions: c, middleware: h } = t, p = { ...t.headers };
3408
+ let m = "", y;
3409
+ e === "POST" ? (y = vn(r, i, s, c.jsonSerializer), typeof y == "string" && (p["Content-Type"] = "application/json")) : m = yn({
3410
+ query: r,
3411
+ variables: i,
3412
+ operationName: s,
3413
+ jsonSerializer: c.jsonSerializer ?? ve
3414
+ });
3415
+ const C = {
3416
+ method: e,
3417
+ headers: p,
3418
+ body: y,
3419
+ ...c
3420
+ };
3421
+ let T = n, g = C;
3422
+ if (h) {
3423
+ const N = await Promise.resolve(h({ ...C, url: n, operationName: s, variables: i })), { url: O, ...D } = N;
3424
+ T = O, g = D;
3386
3425
  }
3387
- }
3388
- `, pn = O`
3389
- query GetPurchasingCustomerSharing {
3390
- purchasingCustomer {
3391
- id
3392
- customerSharing {
3393
- id
3394
- purchasingCustomers {
3395
- id
3396
- sharingPurchasingCustomerCount
3397
- tenant {
3398
- id
3399
- name
3400
- }
3401
- }
3402
- }
3426
+ return m && (T = `${T}?${m}`), await o(T, g);
3427
+ };
3428
+ class En {
3429
+ constructor(t, n = {}) {
3430
+ this.url = t, this.requestConfig = n, this.rawRequest = async (...r) => {
3431
+ const [i, s, o] = r, c = hn(i, s, o), { headers: h, fetch: p = te, method: m = "POST", requestMiddleware: y, responseMiddleware: C, ...T } = this.requestConfig, { url: g } = this;
3432
+ c.signal !== void 0 && (T.signal = c.signal);
3433
+ const { operationName: N } = le(c.query);
3434
+ return de({
3435
+ url: g,
3436
+ query: c.query,
3437
+ variables: c.variables,
3438
+ headers: {
3439
+ ...U(he(h)),
3440
+ ...U(c.requestHeaders)
3441
+ },
3442
+ operationName: N,
3443
+ fetch: p,
3444
+ method: m,
3445
+ fetchOptions: T,
3446
+ middleware: y
3447
+ }).then((O) => (C && C(O), O)).catch((O) => {
3448
+ throw C && C(O), O;
3449
+ });
3450
+ };
3403
3451
  }
3404
- }
3405
- `, fn = O`
3406
- query GetProduct($id: String!, $first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: ProductVariantSortKeys! = CREATED_AT) {
3407
- productByProductShopifyLegacyResourceID(productShopifyLegacyResourceID: $id) {
3408
- id
3409
- title
3410
- hasBackOrderProductVariants
3411
- isLocalPickupAvailable
3412
- productVariants(
3413
- first: $first
3414
- after: $after
3415
- isReverse: $isReverse
3416
- sortKeys: $sortKeys
3417
- ) {
3418
- nodes {
3419
- id
3420
- title
3421
- inventoryItem {
3422
- id
3423
- sku
3424
- }
3425
- isBackOrderEnable
3426
- isLocalPickupAvailable
3427
- }
3428
- pageInfo {
3429
- startCursor
3430
- endCursor
3431
- hasNextPage
3432
- hasPreviousPage
3433
- }
3434
- }
3452
+ async request(t, ...n) {
3453
+ const [r, i] = n, s = dn(t, r, i), { headers: o, fetch: c = te, method: h = "POST", requestMiddleware: p, responseMiddleware: m, ...y } = this.requestConfig, { url: C } = this;
3454
+ s.signal !== void 0 && (y.signal = s.signal);
3455
+ const { query: T, operationName: g } = le(s.document);
3456
+ return de({
3457
+ url: C,
3458
+ query: T,
3459
+ variables: s.variables,
3460
+ headers: {
3461
+ ...U(he(o)),
3462
+ ...U(s.requestHeaders)
3463
+ },
3464
+ operationName: g,
3465
+ fetch: c,
3466
+ method: h,
3467
+ fetchOptions: y,
3468
+ middleware: p
3469
+ }).then((N) => (m && m(N), N.data)).catch((N) => {
3470
+ throw m && m(N), N;
3471
+ });
3435
3472
  }
3436
- }
3437
- `, mn = O`
3438
- mutation PurchasingCustomerSendCustomerSharingActivationCode {
3439
- purchasingCustomerSendCustomerSharingActivationCode {
3440
- purchasingCustomer {
3441
- id
3442
- sharingPurchasingCustomerCount
3443
- tenant {
3444
- id
3445
- name
3446
- }
3447
- }
3448
- customerSharingActivationCode {
3449
- id
3450
- }
3473
+ // prettier-ignore
3474
+ batchRequests(t, n) {
3475
+ const r = pn(t, n), { headers: i, ...s } = this.requestConfig;
3476
+ r.signal !== void 0 && (s.signal = r.signal);
3477
+ const o = r.documents.map(({ document: h }) => le(h).query), c = r.documents.map(({ variables: h }) => h);
3478
+ return de({
3479
+ url: this.url,
3480
+ query: o,
3481
+ // @ts-expect-error TODO reconcile batch variables into system.
3482
+ variables: c,
3483
+ headers: {
3484
+ ...U(he(i)),
3485
+ ...U(r.requestHeaders)
3486
+ },
3487
+ operationName: void 0,
3488
+ fetch: this.requestConfig.fetch ?? te,
3489
+ method: this.requestConfig.method || "POST",
3490
+ fetchOptions: s,
3491
+ middleware: this.requestConfig.requestMiddleware
3492
+ }).then((h) => (this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(h), h.data)).catch((h) => {
3493
+ throw this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(h), h;
3494
+ });
3451
3495
  }
3452
- }
3453
- `, gn = O`
3454
- mutation PurchasingCustomerActivateCustomerSharing($email: String!, $activationCode: String!) {
3455
- purchasingCustomerActivateCustomerSharing(
3456
- input: {email: $email, activationCode: $activationCode}
3457
- ) {
3458
- purchasingCustomer {
3459
- id
3460
- sharingPurchasingCustomerCount
3461
- tenant {
3462
- id
3463
- name
3464
- }
3465
- }
3496
+ setHeaders(t) {
3497
+ return this.requestConfig.headers = t, this;
3498
+ }
3499
+ /**
3500
+ * Attach a header to the client. All subsequent requests will have this header.
3501
+ */
3502
+ setHeader(t, n) {
3503
+ const { headers: r } = this.requestConfig;
3504
+ return r ? r[t] = n : this.requestConfig.headers = { [t]: n }, this;
3505
+ }
3506
+ /**
3507
+ * Change the client endpoint. All subsequent requests will send to this endpoint.
3508
+ */
3509
+ setEndpoint(t) {
3510
+ return this.url = t, this;
3466
3511
  }
3467
3512
  }
3468
- `, yn = (e, t, n, r) => e();
3469
- function Cn(e, t = yn) {
3470
- return {
3471
- GetLocationAvailabilities(n, r) {
3472
- return t((i) => e.request(nn, n, { ...r, ...i }), "GetLocationAvailabilities", "query", n);
3473
- },
3474
- GetLocationAvailability(n, r) {
3475
- return t((i) => e.request(rn, n, { ...r, ...i }), "GetLocationAvailability", "query", n);
3476
- },
3477
- GetPurchasingCustomerMetafield(n, r) {
3478
- return t((i) => e.request(sn, n, { ...r, ...i }), "GetPurchasingCustomerMetafield", "query", n);
3479
- },
3480
- GetPoints(n, r) {
3481
- return t((i) => e.request(on, n, { ...r, ...i }), "GetPoints", "query", n);
3482
- },
3483
- GetLocations(n, r) {
3484
- return t((i) => e.request(an, n, { ...r, ...i }), "GetLocations", "query", n);
3485
- },
3486
- GetPurchasingCustomerDiscounts(n, r) {
3487
- return t((i) => e.request(cn, n, { ...r, ...i }), "GetPurchasingCustomerDiscounts", "query", n);
3488
- },
3489
- GetPurchasingCustomerDiscountCodeCount(n, r) {
3490
- return t((i) => e.request(un, n, { ...r, ...i }), "GetPurchasingCustomerDiscountCodeCount", "query", n);
3491
- },
3492
- GetPurchasingCustomerPointChangeActivities(n, r) {
3493
- return t((i) => e.request(ln, n, { ...r, ...i }), "GetPurchasingCustomerPointChangeActivities", "query", n);
3494
- },
3495
- GetPurchasingCustomerRank(n, r) {
3496
- return t((i) => e.request(dn, n, { ...r, ...i }), "GetPurchasingCustomerRank", "query", n);
3497
- },
3498
- GetSharingPurchasingCustomerCount(n, r) {
3499
- return t((i) => e.request(hn, n, { ...r, ...i }), "GetSharingPurchasingCustomerCount", "query", n);
3500
- },
3501
- GetPurchasingCustomerSharing(n, r) {
3502
- return t((i) => e.request(pn, n, { ...r, ...i }), "GetPurchasingCustomerSharing", "query", n);
3503
- },
3504
- GetProduct(n, r) {
3505
- return t((i) => e.request(fn, n, { ...r, ...i }), "GetProduct", "query", n);
3506
- },
3507
- PurchasingCustomerSendCustomerSharingActivationCode(n, r) {
3508
- return t((i) => e.request(mn, n, { ...r, ...i }), "PurchasingCustomerSendCustomerSharingActivationCode", "mutation", n);
3509
- },
3510
- PurchasingCustomerActivateCustomerSharing(n, r) {
3511
- return t((i) => e.request(gn, n, { ...r, ...i }), "PurchasingCustomerActivateCustomerSharing", "mutation", n);
3512
- }
3513
- };
3514
- }
3515
- class vn {
3513
+ const de = async (e) => {
3514
+ const { query: t, variables: n, fetchOptions: r } = e, i = Cn(cn(e.method ?? "post")), s = Array.isArray(e.query), o = await i(e), c = await An(o, r.jsonSerializer ?? ve), h = Array.isArray(c) ? !c.some(({ data: m }) => !m) : !!c.data, p = Array.isArray(c) || !c.errors || Array.isArray(c.errors) && !c.errors.length || r.errorPolicy === "all" || r.errorPolicy === "ignore";
3515
+ if (o.ok && p && h) {
3516
+ const { errors: m, ...y } = (Array.isArray(c), c), C = r.errorPolicy === "ignore" ? y : c;
3517
+ return {
3518
+ ...s ? { data: C } : C,
3519
+ headers: o.headers,
3520
+ status: o.status
3521
+ };
3522
+ } else {
3523
+ const m = typeof c == "string" ? {
3524
+ error: c
3525
+ } : c;
3526
+ throw new H(
3527
+ // @ts-expect-error TODO
3528
+ { ...m, status: o.status, headers: o.headers },
3529
+ { query: t, variables: n }
3530
+ );
3531
+ }
3532
+ }, vn = (e, t, n, r) => {
3533
+ const i = r ?? ve;
3534
+ if (!Array.isArray(e))
3535
+ return i.stringify({ query: e, variables: t, operationName: n });
3536
+ if (typeof t < "u" && !Array.isArray(t))
3537
+ throw new Error("Cannot create request body with given variable type, array expected");
3538
+ const s = e.reduce((o, c, h) => (o.push({ query: c, variables: t ? t[h] : void 0 }), o), []);
3539
+ return i.stringify(s);
3540
+ }, An = async (e, t) => {
3541
+ let n;
3542
+ return e.headers.forEach((r, i) => {
3543
+ i.toLowerCase() === "content-type" && (n = r);
3544
+ }), n && (n.toLowerCase().startsWith("application/json") || n.toLowerCase().startsWith("application/graphql+json") || n.toLowerCase().startsWith("application/graphql-response+json")) ? t.parse(await e.text()) : e.text();
3545
+ }, he = (e) => typeof e == "function" ? e() : e;
3546
+ var Tn = /* @__PURE__ */ ((e) => (e.Eur = "EUR", e.Jpy = "JPY", e.Usd = "USD", e))(Tn || {});
3547
+ class In {
3516
3548
  constructor(t) {
3517
3549
  Ae(this, "api");
3518
- this.api = Cn(
3519
- new Ht(`${t}/apps/sq-api`, {
3550
+ this.api = un(
3551
+ new En(`${t}/apps/sq-api`, {
3520
3552
  headers: {
3521
3553
  "X-SQ-CLIENT": "ShopifyAppProxy"
3522
3554
  }
@@ -3630,22 +3662,22 @@ class vn {
3630
3662
  async getLocations(t, n, r, i, s) {
3631
3663
  const o = await this.api.GetLocations({ tag: t, provinceCodes: n, first: r, after: i, isReverse: s });
3632
3664
  return {
3633
- nodes: o.locations.nodes.map((u) => ({
3634
- id: u.id,
3635
- name: u.name,
3636
- phone: u.phone,
3637
- mapURL: u.mapURL,
3638
- tags: u.tags,
3639
- address: u.address ? {
3640
- id: u.address.id,
3641
- countryCode: u.address.countryCode,
3642
- country: u.address.country,
3643
- postalCode: u.address.postalCode,
3644
- provinceCode: u.address.provinceCode,
3645
- province: u.address.province,
3646
- city: u.address.city,
3647
- address1: u.address.address1,
3648
- address2: u.address.address2
3665
+ nodes: o.locations.nodes.map((c) => ({
3666
+ id: c.id,
3667
+ name: c.name,
3668
+ phone: c.phone,
3669
+ mapURL: c.mapURL,
3670
+ tags: c.tags,
3671
+ address: c.address ? {
3672
+ id: c.address.id,
3673
+ countryCode: c.address.countryCode,
3674
+ country: c.address.country,
3675
+ postalCode: c.address.postalCode,
3676
+ provinceCode: c.address.provinceCode,
3677
+ province: c.address.province,
3678
+ city: c.address.city,
3679
+ address1: c.address.address1,
3680
+ address2: c.address.address2
3649
3681
  } : void 0
3650
3682
  })) ?? [],
3651
3683
  pageInfo: o.locations.pageInfo ?? null
@@ -3843,14 +3875,14 @@ class vn {
3843
3875
  isLocalPickupAvailable: o.productByProductShopifyLegacyResourceID.isLocalPickupAvailable,
3844
3876
  variants: {
3845
3877
  nodes: o.productByProductShopifyLegacyResourceID.productVariants.nodes.map(
3846
- (u) => ({
3847
- id: u.id,
3848
- title: u.title,
3849
- isBackOrderEnable: u.isBackOrderEnable,
3850
- isLocalPickupAvailable: u.isLocalPickupAvailable,
3878
+ (c) => ({
3879
+ id: c.id,
3880
+ title: c.title,
3881
+ isBackOrderEnable: c.isBackOrderEnable,
3882
+ isLocalPickupAvailable: c.isLocalPickupAvailable,
3851
3883
  inventoryItem: {
3852
- id: u.inventoryItem.id,
3853
- sku: u.inventoryItem.sku
3884
+ id: c.inventoryItem.id,
3885
+ sku: c.inventoryItem.sku
3854
3886
  }
3855
3887
  })
3856
3888
  ),
@@ -3858,6 +3890,43 @@ class vn {
3858
3890
  }
3859
3891
  } : null;
3860
3892
  }
3893
+ async getPointCampaignOrderRuleTargetCustomerRank() {
3894
+ const t = await this.api.GetPointCampaignOrderRuleTargetCustomerRank();
3895
+ return t.pointCampaignOrderRuleTargetCustomerRank ? {
3896
+ pointCampaignOrderRule: {
3897
+ id: t.pointCampaignOrderRuleTargetCustomerRank.pointCampaignOrderRule.id,
3898
+ title: t.pointCampaignOrderRuleTargetCustomerRank.pointCampaignOrderRule.title
3899
+ },
3900
+ multiplier: t.pointCampaignOrderRuleTargetCustomerRank.multiplier ? t.pointCampaignOrderRuleTargetCustomerRank.multiplier : void 0,
3901
+ fixedPoint: t.pointCampaignOrderRuleTargetCustomerRank.fixedPoint ? t.pointCampaignOrderRuleTargetCustomerRank.fixedPoint : void 0
3902
+ } : null;
3903
+ }
3904
+ async getEstimatedShopifyCartPoint(t, n, r) {
3905
+ const i = await this.api.GetEstimatedShopifyCartPoint({
3906
+ input: {
3907
+ currencyCode: t,
3908
+ taxesIncluded: n,
3909
+ lineItems: r
3910
+ }
3911
+ });
3912
+ return i.estimatedShopifyCartPoint ? {
3913
+ pointsEarned: i.estimatedShopifyCartPoint.pointsEarned
3914
+ } : null;
3915
+ }
3916
+ async getEstimatedShopifyCartLineItemPoint(t, n, r, i, s) {
3917
+ const o = await this.api.GetEstimatedShopifyCartLineItemPoint({
3918
+ input: {
3919
+ currencyCode: t,
3920
+ taxesIncluded: n,
3921
+ sku: r,
3922
+ quantity: i,
3923
+ unitPrice: s
3924
+ }
3925
+ });
3926
+ return o.estimatedShopifyCartLineItemPoint ? {
3927
+ pointsEarned: o.estimatedShopifyCartLineItemPoint.pointsEarned
3928
+ } : null;
3929
+ }
3861
3930
  /**
3862
3931
  * purchasingCustomerSendCustomerSharingActivationCode はログインしているアカウントのメールアドレスに顧客情報共有のためのアクティベーションコードを送信します。
3863
3932
  */
@@ -3898,5 +3967,6 @@ class vn {
3898
3967
  }
3899
3968
  }
3900
3969
  export {
3901
- vn as SDK
3970
+ Tn as CurrencyCode,
3971
+ In as SDK
3902
3972
  };