@builtbystack/sq-shopify-theme-sdk 0.0.9 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -177,6 +177,18 @@ getPurchasingCustomerCurrentRank は購入者の現在のランク情報を返
177
177
 
178
178
  ***
179
179
 
180
+ #### getPurchasingCustomerDiscountCodeCount()
181
+
182
+ > **getPurchasingCustomerDiscountCodeCount**(): `Promise`\<`number`\>
183
+
184
+ getPurchasingCustomerDiscountCodeCount は顧客に紐付くDiscountCodeの数を返します。
185
+
186
+ ##### Returns
187
+
188
+ `Promise`\<`number`\>
189
+
190
+ ***
191
+
180
192
  #### getPurchasingCustomerDiscounts()
181
193
 
182
194
  > **getPurchasingCustomerDiscounts**(`first`?, `after`?, `isReverse`?): `Promise`\<`null` \| [`PurchasingCustomerDiscounts`](#type-aliasespurchasingcustomerdiscountsmd)\>
@@ -828,6 +840,12 @@ PurchasingCustomerDiscount は購入者の割引情報を表す。
828
840
 
829
841
  > **createdAt**: `Date`
830
842
 
843
+ #### customerApplicable
844
+
845
+ > **customerApplicable**: `boolean`
846
+
847
+ Discountがこの顧客で有効かどうかを表す。
848
+
831
849
  #### description
832
850
 
833
851
  > **description**: `string`
@@ -252,6 +252,10 @@ export declare type PurchasingCustomerDiscount = {
252
252
  */
253
253
  status: string;
254
254
  code: string;
255
+ /**
256
+ * Discountがこの顧客で有効かどうかを表す。
257
+ */
258
+ customerApplicable: boolean;
255
259
  startsAt: Date;
256
260
  endsAt: Date;
257
261
  createdAt: Date;
@@ -337,6 +341,10 @@ export declare class SDK {
337
341
  * getPurchasingCustomerCurrentRank は購入者の現在のランク情報を返します。
338
342
  */
339
343
  getPurchasingCustomerCurrentRank(): Promise<CustomerRank | null>;
344
+ /**
345
+ * getPurchasingCustomerDiscountCodeCount は顧客に紐付くDiscountCodeの数を返します。
346
+ */
347
+ getPurchasingCustomerDiscountCodeCount(): Promise<number>;
340
348
  }
341
349
 
342
350
  export { }
@@ -1,6 +1,6 @@
1
1
  var He = Object.defineProperty;
2
2
  var Ye = (e, t, n) => t in e ? He(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var Ce = (e, t, n) => (Ye(e, typeof t != "symbol" ? t + "" : t, n), n);
3
+ var Te = (e, t, n) => (Ye(e, typeof t != "symbol" ? t + "" : t, n), n);
4
4
  function ze(e, t) {
5
5
  for (var n = 0; n < t.length; n++) {
6
6
  const i = t[n];
@@ -561,7 +561,7 @@ function ht(e, t) {
561
561
  if (Y(s) || s === 45)
562
562
  return ft(e, r, s);
563
563
  if (we(s))
564
- return Tt(e, r);
564
+ return Ct(e, r);
565
565
  throw b(
566
566
  e.source,
567
567
  r,
@@ -684,7 +684,7 @@ function yt(e, t) {
684
684
  size: r
685
685
  };
686
686
  }
687
- if (i = i << 4 | G(s), i < 0)
687
+ if (i = i << 4 | $(s), i < 0)
688
688
  break;
689
689
  }
690
690
  throw b(
@@ -718,9 +718,9 @@ function Et(e, t) {
718
718
  );
719
719
  }
720
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));
721
+ return $(e.charCodeAt(t)) << 12 | $(e.charCodeAt(t + 1)) << 8 | $(e.charCodeAt(t + 2)) << 4 | $(e.charCodeAt(t + 3));
722
722
  }
723
- function G(e) {
723
+ function $(e) {
724
724
  return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
725
725
  }
726
726
  function gt(e, t) {
@@ -820,7 +820,7 @@ function vt(e, t) {
820
820
  }
821
821
  throw b(e.source, s, "Unterminated string.");
822
822
  }
823
- function Tt(e, t) {
823
+ function Ct(e, t) {
824
824
  const n = e.source.body, i = n.length;
825
825
  let r = t + 1;
826
826
  for (; r < i; ) {
@@ -838,8 +838,8 @@ function Tt(e, t) {
838
838
  n.slice(t, r)
839
839
  );
840
840
  }
841
- const Ct = 10, Fe = 2;
842
- function Te(e) {
841
+ const Tt = 10, Fe = 2;
842
+ function Ce(e) {
843
843
  return oe(e, []);
844
844
  }
845
845
  function oe(e, t) {
@@ -882,7 +882,7 @@ function bt(e, t) {
882
882
  return "[]";
883
883
  if (t.length > Fe)
884
884
  return "[Array]";
885
- const n = Math.min(Ct, e.length), i = e.length - n, r = [];
885
+ const n = Math.min(Tt, e.length), i = e.length - n, r = [];
886
886
  for (let s = 0; s < n; ++s)
887
887
  r.push(oe(e[s], t));
888
888
  return i === 1 ? r.push("... 1 more item") : i > 1 && r.push(`... ${i} more items`), "[" + r.join(", ") + "]";
@@ -896,7 +896,7 @@ function It(e) {
896
896
  }
897
897
  return t;
898
898
  }
899
- const Ot = (
899
+ const Dt = (
900
900
  /* c8 ignore next 6 */
901
901
  // FIXME: https://github.com/graphql/graphql-js/issues/2317
902
902
  globalThis.process && globalThis.process.env.NODE_ENV === "production" ? function(t, n) {
@@ -911,7 +911,7 @@ const Ot = (
911
911
  Symbol.toStringTag in t ? t[Symbol.toStringTag] : (i = t.constructor) === null || i === void 0 ? void 0 : i.name
912
912
  );
913
913
  if (r === s) {
914
- const o = Te(t);
914
+ const o = Ce(t);
915
915
  throw new Error(`Cannot use ${r} "${o}" from another module or realm.
916
916
 
917
917
  Ensure that there is only one instance of "graphql" in the node_modules
@@ -934,7 +934,7 @@ class Be {
934
934
  line: 1,
935
935
  column: 1
936
936
  }) {
937
- typeof t == "string" || Z(!1, `Body must be a string. Received: ${Te(t)}.`), this.body = t, this.name = n, this.locationOffset = i, this.locationOffset.line > 0 || Z(
937
+ typeof t == "string" || Z(!1, `Body must be a string. Received: ${Ce(t)}.`), this.body = t, this.name = n, this.locationOffset = i, this.locationOffset.line > 0 || Z(
938
938
  !1,
939
939
  "line in locationOffset is 1-indexed and must be positive."
940
940
  ), this.locationOffset.column > 0 || Z(
@@ -946,15 +946,15 @@ class Be {
946
946
  return "Source";
947
947
  }
948
948
  }
949
- function Dt(e) {
950
- return Ot(e, Be);
949
+ function Ot(e) {
950
+ return Dt(e, Be);
951
951
  }
952
952
  function Me(e, t) {
953
953
  return new _t(e, t).parseDocument();
954
954
  }
955
955
  class _t {
956
956
  constructor(t, n = {}) {
957
- const i = Dt(t) ? t : new Be(t);
957
+ const i = Ot(t) ? t : new Be(t);
958
958
  this._lexer = new lt(i), this._options = n, this._tokenCounter = 0;
959
959
  }
960
960
  /**
@@ -2269,7 +2269,7 @@ function Lt(e, t, n = Re) {
2269
2269
  let S;
2270
2270
  if (!Array.isArray(p)) {
2271
2271
  var y, N;
2272
- xe(p) || Z(!1, `Invalid AST Node: ${Te(p)}.`);
2272
+ xe(p) || Z(!1, `Invalid AST Node: ${Ce(p)}.`);
2273
2273
  const k = _ ? (y = i.get(p.kind)) === null || y === void 0 ? void 0 : y.leave : (N = i.get(p.kind)) === null || N === void 0 ? void 0 : N.enter;
2274
2274
  if (S = k == null ? void 0 : k.call(t, p, m, E, g, A), S === Pt)
2275
2275
  break;
@@ -2289,14 +2289,14 @@ function Lt(e, t, n = Re) {
2289
2289
  if (S === void 0 && z && h.push([m, p]), _)
2290
2290
  g.pop();
2291
2291
  else {
2292
- var D;
2292
+ var O;
2293
2293
  r = {
2294
2294
  inArray: s,
2295
2295
  index: u,
2296
2296
  keys: o,
2297
2297
  edits: h,
2298
2298
  prev: r
2299
- }, s = Array.isArray(p), o = s ? p : (D = n[p.kind]) !== null && D !== void 0 ? D : [], u = -1, h = [], E && A.push(E), E = p;
2299
+ }, s = Array.isArray(p), o = s ? p : (O = n[p.kind]) !== null && O !== void 0 ? O : [], u = -1, h = [], E && A.push(E), E = p;
2300
2300
  }
2301
2301
  } while (r !== void 0);
2302
2302
  return h.length !== 0 ? h[h.length - 1][1] : e;
@@ -2329,7 +2329,7 @@ const Mt = 80, Ut = {
2329
2329
  },
2330
2330
  OperationDefinition: {
2331
2331
  leave(e) {
2332
- const t = T("(", d(e.variableDefinitions, ", "), ")"), n = d(
2332
+ const t = C("(", d(e.variableDefinitions, ", "), ")"), n = d(
2333
2333
  [
2334
2334
  e.operation,
2335
2335
  d([e.name, t]),
@@ -2341,16 +2341,16 @@ const Mt = 80, Ut = {
2341
2341
  }
2342
2342
  },
2343
2343
  VariableDefinition: {
2344
- leave: ({ variable: e, type: t, defaultValue: n, directives: i }) => e + ": " + t + T(" = ", n) + T(" ", d(i, " "))
2344
+ leave: ({ variable: e, type: t, defaultValue: n, directives: i }) => e + ": " + t + C(" = ", n) + C(" ", d(i, " "))
2345
2345
  },
2346
2346
  SelectionSet: {
2347
2347
  leave: ({ selections: e }) => R(e)
2348
2348
  },
2349
2349
  Field: {
2350
2350
  leave({ alias: e, name: t, arguments: n, directives: i, selectionSet: r }) {
2351
- const s = T("", e, ": ") + t;
2352
- let o = s + T("(", d(n, ", "), ")");
2353
- return o.length > Mt && (o = s + T(`(
2351
+ const s = C("", e, ": ") + t;
2352
+ let o = s + C("(", d(n, ", "), ")");
2353
+ return o.length > Mt && (o = s + C(`(
2354
2354
  `, K(d(n, `
2355
2355
  `)), `
2356
2356
  )`)), d([o, d(i, " "), r], " ");
@@ -2361,13 +2361,13 @@ const Mt = 80, Ut = {
2361
2361
  },
2362
2362
  // Fragments
2363
2363
  FragmentSpread: {
2364
- leave: ({ name: e, directives: t }) => "..." + e + T(" ", d(t, " "))
2364
+ leave: ({ name: e, directives: t }) => "..." + e + C(" ", d(t, " "))
2365
2365
  },
2366
2366
  InlineFragment: {
2367
2367
  leave: ({ typeCondition: e, directives: t, selectionSet: n }) => d(
2368
2368
  [
2369
2369
  "...",
2370
- T("on ", e),
2370
+ C("on ", e),
2371
2371
  d(t, " "),
2372
2372
  n
2373
2373
  ],
@@ -2377,7 +2377,7 @@ const Mt = 80, Ut = {
2377
2377
  FragmentDefinition: {
2378
2378
  leave: ({ name: e, typeCondition: t, variableDefinitions: n, directives: i, selectionSet: r }) => (
2379
2379
  // or removed in the future.
2380
- `fragment ${e}${T("(", d(n, ", "), ")")} on ${t} ${T("", d(i, " "), " ")}` + r
2380
+ `fragment ${e}${C("(", d(n, ", "), ")")} on ${t} ${C("", d(i, " "), " ")}` + r
2381
2381
  )
2382
2382
  },
2383
2383
  // Value
@@ -2410,7 +2410,7 @@ const Mt = 80, Ut = {
2410
2410
  },
2411
2411
  // Directive
2412
2412
  Directive: {
2413
- leave: ({ name: e, arguments: t }) => "@" + e + T("(", d(t, ", "), ")")
2413
+ leave: ({ name: e, arguments: t }) => "@" + e + C("(", d(t, ", "), ")")
2414
2414
  },
2415
2415
  // Type
2416
2416
  NamedType: {
@@ -2424,23 +2424,23 @@ const Mt = 80, Ut = {
2424
2424
  },
2425
2425
  // Type System Definitions
2426
2426
  SchemaDefinition: {
2427
- leave: ({ description: e, directives: t, operationTypes: n }) => T("", e, `
2427
+ leave: ({ description: e, directives: t, operationTypes: n }) => C("", e, `
2428
2428
  `) + d(["schema", d(t, " "), R(n)], " ")
2429
2429
  },
2430
2430
  OperationTypeDefinition: {
2431
2431
  leave: ({ operation: e, type: t }) => e + ": " + t
2432
2432
  },
2433
2433
  ScalarTypeDefinition: {
2434
- leave: ({ description: e, name: t, directives: n }) => T("", e, `
2434
+ leave: ({ description: e, name: t, directives: n }) => C("", e, `
2435
2435
  `) + d(["scalar", t, d(n, " ")], " ")
2436
2436
  },
2437
2437
  ObjectTypeDefinition: {
2438
- leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => T("", e, `
2438
+ leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => C("", e, `
2439
2439
  `) + d(
2440
2440
  [
2441
2441
  "type",
2442
2442
  t,
2443
- T("implements ", d(n, " & ")),
2443
+ C("implements ", d(n, " & ")),
2444
2444
  d(i, " "),
2445
2445
  R(r)
2446
2446
  ],
@@ -2448,26 +2448,26 @@ const Mt = 80, Ut = {
2448
2448
  )
2449
2449
  },
2450
2450
  FieldDefinition: {
2451
- leave: ({ description: e, name: t, arguments: n, type: i, directives: r }) => T("", e, `
2452
- `) + t + (Ie(n) ? T(`(
2451
+ leave: ({ description: e, name: t, arguments: n, type: i, directives: r }) => C("", e, `
2452
+ `) + t + (Ie(n) ? C(`(
2453
2453
  `, K(d(n, `
2454
2454
  `)), `
2455
- )`) : T("(", d(n, ", "), ")")) + ": " + i + T(" ", d(r, " "))
2455
+ )`) : C("(", d(n, ", "), ")")) + ": " + i + C(" ", d(r, " "))
2456
2456
  },
2457
2457
  InputValueDefinition: {
2458
- leave: ({ description: e, name: t, type: n, defaultValue: i, directives: r }) => T("", e, `
2458
+ leave: ({ description: e, name: t, type: n, defaultValue: i, directives: r }) => C("", e, `
2459
2459
  `) + d(
2460
- [t + ": " + n, T("= ", i), d(r, " ")],
2460
+ [t + ": " + n, C("= ", i), d(r, " ")],
2461
2461
  " "
2462
2462
  )
2463
2463
  },
2464
2464
  InterfaceTypeDefinition: {
2465
- leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => T("", e, `
2465
+ leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => C("", e, `
2466
2466
  `) + d(
2467
2467
  [
2468
2468
  "interface",
2469
2469
  t,
2470
- T("implements ", d(n, " & ")),
2470
+ C("implements ", d(n, " & ")),
2471
2471
  d(i, " "),
2472
2472
  R(r)
2473
2473
  ],
@@ -2475,30 +2475,30 @@ const Mt = 80, Ut = {
2475
2475
  )
2476
2476
  },
2477
2477
  UnionTypeDefinition: {
2478
- leave: ({ description: e, name: t, directives: n, types: i }) => T("", e, `
2478
+ leave: ({ description: e, name: t, directives: n, types: i }) => C("", e, `
2479
2479
  `) + d(
2480
- ["union", t, d(n, " "), T("= ", d(i, " | "))],
2480
+ ["union", t, d(n, " "), C("= ", d(i, " | "))],
2481
2481
  " "
2482
2482
  )
2483
2483
  },
2484
2484
  EnumTypeDefinition: {
2485
- leave: ({ description: e, name: t, directives: n, values: i }) => T("", e, `
2485
+ leave: ({ description: e, name: t, directives: n, values: i }) => C("", e, `
2486
2486
  `) + d(["enum", t, d(n, " "), R(i)], " ")
2487
2487
  },
2488
2488
  EnumValueDefinition: {
2489
- leave: ({ description: e, name: t, directives: n }) => T("", e, `
2489
+ leave: ({ description: e, name: t, directives: n }) => C("", e, `
2490
2490
  `) + d([t, d(n, " ")], " ")
2491
2491
  },
2492
2492
  InputObjectTypeDefinition: {
2493
- leave: ({ description: e, name: t, directives: n, fields: i }) => T("", e, `
2493
+ leave: ({ description: e, name: t, directives: n, fields: i }) => C("", e, `
2494
2494
  `) + d(["input", t, d(n, " "), R(i)], " ")
2495
2495
  },
2496
2496
  DirectiveDefinition: {
2497
- leave: ({ description: e, name: t, arguments: n, repeatable: i, locations: r }) => T("", e, `
2498
- `) + "directive @" + t + (Ie(n) ? T(`(
2497
+ leave: ({ description: e, name: t, arguments: n, repeatable: i, locations: r }) => C("", e, `
2498
+ `) + "directive @" + t + (Ie(n) ? C(`(
2499
2499
  `, K(d(n, `
2500
2500
  `)), `
2501
- )`) : T("(", d(n, ", "), ")")) + (i ? " repeatable" : "") + " on " + d(r, " | ")
2501
+ )`) : C("(", d(n, ", "), ")")) + (i ? " repeatable" : "") + " on " + d(r, " | ")
2502
2502
  },
2503
2503
  SchemaExtension: {
2504
2504
  leave: ({ directives: e, operationTypes: t }) => d(
@@ -2514,7 +2514,7 @@ const Mt = 80, Ut = {
2514
2514
  [
2515
2515
  "extend type",
2516
2516
  e,
2517
- T("implements ", d(t, " & ")),
2517
+ C("implements ", d(t, " & ")),
2518
2518
  d(n, " "),
2519
2519
  R(i)
2520
2520
  ],
@@ -2526,7 +2526,7 @@ const Mt = 80, Ut = {
2526
2526
  [
2527
2527
  "extend interface",
2528
2528
  e,
2529
- T("implements ", d(t, " & ")),
2529
+ C("implements ", d(t, " & ")),
2530
2530
  d(n, " "),
2531
2531
  R(i)
2532
2532
  ],
@@ -2539,7 +2539,7 @@ const Mt = 80, Ut = {
2539
2539
  "extend union",
2540
2540
  e,
2541
2541
  d(t, " "),
2542
- T("= ", d(n, " | "))
2542
+ C("= ", d(n, " | "))
2543
2543
  ],
2544
2544
  " "
2545
2545
  )
@@ -2556,16 +2556,16 @@ function d(e, t = "") {
2556
2556
  return (n = e == null ? void 0 : e.filter((i) => i).join(t)) !== null && n !== void 0 ? n : "";
2557
2557
  }
2558
2558
  function R(e) {
2559
- return T(`{
2559
+ return C(`{
2560
2560
  `, K(d(e, `
2561
2561
  `)), `
2562
2562
  }`);
2563
2563
  }
2564
- function T(e, t, n = "") {
2564
+ function C(e, t, n = "") {
2565
2565
  return t != null && t !== "" ? e + t + n : "";
2566
2566
  }
2567
2567
  function K(e) {
2568
- return T(" ", e.replace(/\n/g, `
2568
+ return C(" ", e.replace(/\n/g, `
2569
2569
  `));
2570
2570
  }
2571
2571
  function Ie(e) {
@@ -2573,7 +2573,7 @@ function Ie(e) {
2573
2573
  return (t = e == null ? void 0 : e.some((n) => n.includes(`
2574
2574
  `))) !== null && t !== void 0 ? t : !1;
2575
2575
  }
2576
- const Oe = (e) => {
2576
+ const De = (e) => {
2577
2577
  var i, r;
2578
2578
  let t;
2579
2579
  const n = e.definitions.filter((s) => s.kind === "OperationDefinition");
@@ -2583,12 +2583,12 @@ const Oe = (e) => {
2583
2583
  let n;
2584
2584
  try {
2585
2585
  const i = Me(e);
2586
- n = Oe(i);
2586
+ n = De(i);
2587
2587
  } catch {
2588
2588
  }
2589
2589
  return { query: e, operationName: n };
2590
2590
  }
2591
- const t = Oe(e);
2591
+ const t = De(e);
2592
2592
  return { query: Bt(e), operationName: t };
2593
2593
  };
2594
2594
  class H extends Error {
@@ -2712,7 +2712,7 @@ var ye = { exports: {} };
2712
2712
  return Promise.reject(new TypeError("Already read"));
2713
2713
  a.bodyUsed = !0;
2714
2714
  }
2715
- function D(a) {
2715
+ function O(a) {
2716
2716
  return new Promise(function(l, v) {
2717
2717
  a.onload = function() {
2718
2718
  l(a.result);
@@ -2722,16 +2722,16 @@ var ye = { exports: {} };
2722
2722
  });
2723
2723
  }
2724
2724
  function _(a) {
2725
- var l = new FileReader(), v = D(l);
2725
+ var l = new FileReader(), v = O(l);
2726
2726
  return l.readAsArrayBuffer(a), v;
2727
2727
  }
2728
2728
  function z(a) {
2729
- var l = new FileReader(), v = D(l);
2729
+ var l = new FileReader(), v = O(l);
2730
2730
  return l.readAsText(a), v;
2731
2731
  }
2732
2732
  function S(a) {
2733
- for (var l = new Uint8Array(a), v = new Array(l.length), O = 0; O < l.length; O++)
2734
- v[O] = String.fromCharCode(l[O]);
2733
+ for (var l = new Uint8Array(a), v = new Array(l.length), D = 0; D < l.length; D++)
2734
+ v[D] = String.fromCharCode(l[D]);
2735
2735
  return v.join("");
2736
2736
  }
2737
2737
  function k(a) {
@@ -2798,18 +2798,18 @@ var ye = { exports: {} };
2798
2798
  var l = new FormData();
2799
2799
  return a.trim().split("&").forEach(function(v) {
2800
2800
  if (v) {
2801
- var O = v.split("="), I = O.shift().replace(/\+/g, " "), C = O.join("=").replace(/\+/g, " ");
2802
- l.append(decodeURIComponent(I), decodeURIComponent(C));
2801
+ var D = v.split("="), I = D.shift().replace(/\+/g, " "), T = D.join("=").replace(/\+/g, " ");
2802
+ l.append(decodeURIComponent(I), decodeURIComponent(T));
2803
2803
  }
2804
2804
  }), l;
2805
2805
  }
2806
- function $e(a) {
2806
+ function Ge(a) {
2807
2807
  var l = new y(), v = a.replace(/\r?\n[\t ]+/g, " ");
2808
- return v.split(/\r?\n/).forEach(function(O) {
2809
- var I = O.split(":"), C = I.shift().trim();
2810
- if (C) {
2808
+ return v.split(/\r?\n/).forEach(function(D) {
2809
+ var I = D.split(":"), T = I.shift().trim();
2810
+ if (T) {
2811
2811
  var X = I.join(":").trim();
2812
- l.append(C, X);
2812
+ l.append(T, X);
2813
2813
  }
2814
2814
  }), l;
2815
2815
  }
@@ -2828,9 +2828,9 @@ var ye = { exports: {} };
2828
2828
  var a = new w(null, { status: 0, statusText: "" });
2829
2829
  return a.type = "error", a;
2830
2830
  };
2831
- var Ge = [301, 302, 303, 307, 308];
2831
+ var $e = [301, 302, 303, 307, 308];
2832
2832
  w.redirect = function(a, l) {
2833
- if (Ge.indexOf(l) === -1)
2833
+ if ($e.indexOf(l) === -1)
2834
2834
  throw new RangeError("Invalid status code");
2835
2835
  return new w(null, { status: l, headers: { location: a } });
2836
2836
  }, o.DOMException = s.DOMException;
@@ -2839,39 +2839,39 @@ var ye = { exports: {} };
2839
2839
  } catch {
2840
2840
  o.DOMException = function(l, v) {
2841
2841
  this.message = l, this.name = v;
2842
- var O = Error(l);
2843
- this.stack = O.stack;
2842
+ var D = Error(l);
2843
+ this.stack = D.stack;
2844
2844
  }, o.DOMException.prototype = Object.create(Error.prototype), o.DOMException.prototype.constructor = o.DOMException;
2845
2845
  }
2846
2846
  function ae(a, l) {
2847
- return new Promise(function(v, O) {
2847
+ return new Promise(function(v, D) {
2848
2848
  var I = new L(a, l);
2849
2849
  if (I.signal && I.signal.aborted)
2850
- return O(new o.DOMException("Aborted", "AbortError"));
2851
- var C = new XMLHttpRequest();
2850
+ return D(new o.DOMException("Aborted", "AbortError"));
2851
+ var T = new XMLHttpRequest();
2852
2852
  function X() {
2853
- C.abort();
2853
+ T.abort();
2854
2854
  }
2855
- C.onload = function() {
2855
+ T.onload = function() {
2856
2856
  var j = {
2857
- status: C.status,
2858
- statusText: C.statusText,
2859
- headers: $e(C.getAllResponseHeaders() || "")
2857
+ status: T.status,
2858
+ statusText: T.statusText,
2859
+ headers: Ge(T.getAllResponseHeaders() || "")
2860
2860
  };
2861
- j.url = "responseURL" in C ? C.responseURL : j.headers.get("X-Request-URL");
2862
- var ce = "response" in C ? C.response : C.responseText;
2861
+ j.url = "responseURL" in T ? T.responseURL : j.headers.get("X-Request-URL");
2862
+ var ce = "response" in T ? T.response : T.responseText;
2863
2863
  v(new w(ce, j));
2864
- }, C.onerror = function() {
2865
- O(new TypeError("Network request failed"));
2866
- }, C.ontimeout = function() {
2867
- O(new TypeError("Network request failed"));
2868
- }, C.onabort = function() {
2869
- O(new o.DOMException("Aborted", "AbortError"));
2870
- }, C.open(I.method, I.url, !0), I.credentials === "include" ? C.withCredentials = !0 : I.credentials === "omit" && (C.withCredentials = !1), "responseType" in C && u.blob && (C.responseType = "blob"), I.headers.forEach(function(j, ce) {
2871
- C.setRequestHeader(ce, j);
2872
- }), I.signal && (I.signal.addEventListener("abort", X), C.onreadystatechange = function() {
2873
- C.readyState === 4 && I.signal.removeEventListener("abort", X);
2874
- }), C.send(typeof I._bodyInit > "u" ? null : I._bodyInit);
2864
+ }, T.onerror = function() {
2865
+ D(new TypeError("Network request failed"));
2866
+ }, T.ontimeout = function() {
2867
+ D(new TypeError("Network request failed"));
2868
+ }, T.onabort = function() {
2869
+ D(new o.DOMException("Aborted", "AbortError"));
2870
+ }, T.open(I.method, I.url, !0), I.credentials === "include" ? T.withCredentials = !0 : I.credentials === "omit" && (T.withCredentials = !1), "responseType" in T && u.blob && (T.responseType = "blob"), I.headers.forEach(function(j, ce) {
2871
+ T.setRequestHeader(ce, j);
2872
+ }), I.signal && (I.signal.addEventListener("abort", X), T.onreadystatechange = function() {
2873
+ T.readyState === 4 && I.signal.removeEventListener("abort", X);
2874
+ }), T.send(typeof I._bodyInit > "u" ? null : I._bodyInit);
2875
2875
  });
2876
2876
  }
2877
2877
  return ae.polyfill = !0, s.fetch || (s.fetch = ae, s.Headers = y, s.Request = L, s.Response = w), o.Headers = y, o.Request = L, o.Response = w, o.fetch = ae, Object.defineProperty(o, "__esModule", { value: !0 }), o;
@@ -2889,22 +2889,22 @@ const ee = /* @__PURE__ */ Vt(ne), jt = /* @__PURE__ */ ze({
2889
2889
  return e && (typeof Headers < "u" && e instanceof Headers || jt && ne.Headers && e instanceof ne.Headers ? t = Je(e) : Array.isArray(e) ? e.forEach(([n, i]) => {
2890
2890
  n && i !== void 0 && (t[n] = i);
2891
2891
  }) : t = e), t;
2892
- }, De = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), $t = (e) => {
2892
+ }, Oe = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), Gt = (e) => {
2893
2893
  if (!Array.isArray(e.query)) {
2894
- const i = e, r = [`query=${encodeURIComponent(De(i.query))}`];
2894
+ const i = e, r = [`query=${encodeURIComponent(Oe(i.query))}`];
2895
2895
  return e.variables && r.push(`variables=${encodeURIComponent(i.jsonSerializer.stringify(i.variables))}`), i.operationName && r.push(`operationName=${encodeURIComponent(i.operationName)}`), r.join("&");
2896
2896
  }
2897
2897
  if (typeof e.variables < "u" && !Array.isArray(e.variables))
2898
2898
  throw new Error("Cannot create query with given variable type, array expected");
2899
2899
  const t = e, n = e.query.reduce((i, r, s) => (i.push({
2900
- query: De(r),
2900
+ query: Oe(r),
2901
2901
  variables: t.variables ? t.jsonSerializer.stringify(t.variables[s]) : void 0
2902
2902
  }), i), []);
2903
2903
  return `query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`;
2904
- }, Gt = (e) => async (t) => {
2904
+ }, $t = (e) => async (t) => {
2905
2905
  const { url: n, query: i, variables: r, operationName: s, fetch: o, fetchOptions: u, middleware: h } = t, p = { ...t.headers };
2906
2906
  let m = "", E;
2907
- e === "POST" ? (E = Yt(i, r, s, u.jsonSerializer), typeof E == "string" && (p["Content-Type"] = "application/json")) : m = $t({
2907
+ e === "POST" ? (E = Yt(i, r, s, u.jsonSerializer), typeof E == "string" && (p["Content-Type"] = "application/json")) : m = Gt({
2908
2908
  query: i,
2909
2909
  variables: r,
2910
2910
  operationName: s,
@@ -2918,8 +2918,8 @@ const ee = /* @__PURE__ */ Vt(ne), jt = /* @__PURE__ */ ze({
2918
2918
  };
2919
2919
  let A = n, y = g;
2920
2920
  if (h) {
2921
- const N = await Promise.resolve(h({ ...g, url: n, operationName: s, variables: r })), { url: D, ..._ } = N;
2922
- A = D, y = _;
2921
+ const N = await Promise.resolve(h({ ...g, url: n, operationName: s, variables: r })), { url: O, ..._ } = N;
2922
+ A = O, y = _;
2923
2923
  }
2924
2924
  return m && (A = `${A}?${m}`), await o(A, y);
2925
2925
  };
@@ -2942,8 +2942,8 @@ class Ht {
2942
2942
  method: m,
2943
2943
  fetchOptions: A,
2944
2944
  middleware: E
2945
- }).then((D) => (g && g(D), D)).catch((D) => {
2946
- throw g && g(D), D;
2945
+ }).then((O) => (g && g(O), O)).catch((O) => {
2946
+ throw g && g(O), O;
2947
2947
  });
2948
2948
  };
2949
2949
  }
@@ -3009,7 +3009,7 @@ class Ht {
3009
3009
  }
3010
3010
  }
3011
3011
  const de = async (e) => {
3012
- const { query: t, variables: n, fetchOptions: i } = e, r = Gt(Qe(e.method ?? "post")), s = Array.isArray(e.query), o = await r(e), u = await zt(o, i.jsonSerializer ?? ge), h = Array.isArray(u) ? !u.some(({ data: m }) => !m) : !!u.data, p = Array.isArray(u) || !u.errors || Array.isArray(u.errors) && !u.errors.length || i.errorPolicy === "all" || i.errorPolicy === "ignore";
3012
+ const { query: t, variables: n, fetchOptions: i } = e, r = $t(Qe(e.method ?? "post")), s = Array.isArray(e.query), o = await r(e), u = await zt(o, i.jsonSerializer ?? ge), h = Array.isArray(u) ? !u.some(({ data: m }) => !m) : !!u.data, p = Array.isArray(u) || !u.errors || Array.isArray(u.errors) && !u.errors.length || i.errorPolicy === "all" || i.errorPolicy === "ignore";
3013
3013
  if (o.ok && p && h) {
3014
3014
  const { errors: m, ...E } = (Array.isArray(u), u), g = i.errorPolicy === "ignore" ? E : u;
3015
3015
  return {
@@ -3115,7 +3115,7 @@ function en() {
3115
3115
  function tn() {
3116
3116
  ie = !1;
3117
3117
  }
3118
- var $ = {
3118
+ var G = {
3119
3119
  gql: q,
3120
3120
  resetCaches: Zt,
3121
3121
  disableFragmentWarnings: Kt,
@@ -3123,7 +3123,7 @@ var $ = {
3123
3123
  disableExperimentalFragmentVariables: tn
3124
3124
  };
3125
3125
  (function(e) {
3126
- e.gql = $.gql, e.resetCaches = $.resetCaches, e.disableFragmentWarnings = $.disableFragmentWarnings, e.enableExperimentalFragmentVariables = $.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = $.disableExperimentalFragmentVariables;
3126
+ e.gql = G.gql, e.resetCaches = G.resetCaches, e.disableFragmentWarnings = G.disableFragmentWarnings, e.enableExperimentalFragmentVariables = G.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = G.disableExperimentalFragmentVariables;
3127
3127
  })(q || (q = {}));
3128
3128
  q.default = q;
3129
3129
  const P = q, nn = P`
@@ -3243,6 +3243,7 @@ const P = q, nn = P`
3243
3243
  status
3244
3244
  description
3245
3245
  code
3246
+ customerApplicable
3246
3247
  startsAt
3247
3248
  endsAt
3248
3249
  createdAt
@@ -3258,6 +3259,13 @@ const P = q, nn = P`
3258
3259
  }
3259
3260
  }
3260
3261
  `, un = P`
3262
+ query GetPurchasingCustomerDiscountCodeCount {
3263
+ purchasingCustomer {
3264
+ id
3265
+ discountCodeCount
3266
+ }
3267
+ }
3268
+ `, ln = P`
3261
3269
  query GetPurchasingCustomerPointChangeActivities($first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: PointChangeActivitySortKey! = CREATED_AT) {
3262
3270
  purchasingCustomer {
3263
3271
  id
@@ -3289,7 +3297,7 @@ const P = q, nn = P`
3289
3297
  }
3290
3298
  }
3291
3299
  }
3292
- `, ln = P`
3300
+ `, dn = P`
3293
3301
  query GetPurchasingCustomerRank {
3294
3302
  purchasingCustomer {
3295
3303
  currentCustomerRank {
@@ -3328,8 +3336,8 @@ const P = q, nn = P`
3328
3336
  }
3329
3337
  }
3330
3338
  }
3331
- `, dn = (e, t, n, i) => e();
3332
- function hn(e, t = dn) {
3339
+ `, hn = (e, t, n, i) => e();
3340
+ function pn(e, t = hn) {
3333
3341
  return {
3334
3342
  GetLocationAvailabilities(n, i) {
3335
3343
  return t((r) => e.request(nn, n, { ...i, ...r }), "GetLocationAvailabilities", "query", n);
@@ -3349,18 +3357,21 @@ function hn(e, t = dn) {
3349
3357
  GetPurchasingCustomerDiscounts(n, i) {
3350
3358
  return t((r) => e.request(cn, n, { ...i, ...r }), "GetPurchasingCustomerDiscounts", "query", n);
3351
3359
  },
3360
+ GetPurchasingCustomerDiscountCodeCount(n, i) {
3361
+ return t((r) => e.request(un, n, { ...i, ...r }), "GetPurchasingCustomerDiscountCodeCount", "query", n);
3362
+ },
3352
3363
  GetPurchasingCustomerPointChangeActivities(n, i) {
3353
- return t((r) => e.request(un, n, { ...i, ...r }), "GetPurchasingCustomerPointChangeActivities", "query", n);
3364
+ return t((r) => e.request(ln, n, { ...i, ...r }), "GetPurchasingCustomerPointChangeActivities", "query", n);
3354
3365
  },
3355
3366
  GetPurchasingCustomerRank(n, i) {
3356
- return t((r) => e.request(ln, n, { ...i, ...r }), "GetPurchasingCustomerRank", "query", n);
3367
+ return t((r) => e.request(dn, n, { ...i, ...r }), "GetPurchasingCustomerRank", "query", n);
3357
3368
  }
3358
3369
  };
3359
3370
  }
3360
- class fn {
3371
+ class mn {
3361
3372
  constructor(t) {
3362
- Ce(this, "api");
3363
- this.api = hn(
3373
+ Te(this, "api");
3374
+ this.api = pn(
3364
3375
  new Ht(`${t}/apps/sq-api`, {
3365
3376
  headers: {
3366
3377
  "X-SQ-CLIENT": "ShopifyAppProxy"
@@ -3510,6 +3521,7 @@ class fn {
3510
3521
  status: s.status,
3511
3522
  description: s.description,
3512
3523
  code: s.code,
3524
+ customerApplicable: s.customerApplicable,
3513
3525
  startsAt: new Date(s.startsAt),
3514
3526
  endsAt: new Date(s.endsAt),
3515
3527
  createdAt: new Date(s.createdAt),
@@ -3600,7 +3612,14 @@ class fn {
3600
3612
  } : void 0
3601
3613
  } : null;
3602
3614
  }
3615
+ /**
3616
+ * getPurchasingCustomerDiscountCodeCount は顧客に紐付くDiscountCodeの数を返します。
3617
+ */
3618
+ async getPurchasingCustomerDiscountCodeCount() {
3619
+ var n;
3620
+ return ((n = (await this.api.GetPurchasingCustomerDiscountCodeCount()).purchasingCustomer) == null ? void 0 : n.discountCodeCount) ?? 0;
3621
+ }
3603
3622
  }
3604
3623
  export {
3605
- fn as SDK
3624
+ mn as SDK
3606
3625
  };
@@ -1,14 +1,14 @@
1
- (function(R,_){typeof exports=="object"&&typeof module<"u"?_(exports):typeof define=="function"&&define.amd?define(["exports"],_):(R=typeof globalThis<"u"?globalThis:R||self,_(R.SQ={}))})(this,function(R){"use strict";var pn=Object.defineProperty;var fn=(R,_,F)=>_ in R?pn(R,_,{enumerable:!0,configurable:!0,writable:!0,value:F}):R[_]=F;var $e=(R,_,F)=>(fn(R,typeof _!="symbol"?_+"":_,F),F);function _(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in e)){const s=Object.getOwnPropertyDescriptor(i,r);s&&Object.defineProperty(e,r,s.get?s:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const F=JSON,Ge=e=>e.toUpperCase(),He=e=>{const t={};return e.forEach((n,i)=>{t[i]=n}),t},Ye=(e,t,n)=>e.document?e:{document:e,variables:t,requestHeaders:n,signal:void 0},ze=(e,t,n)=>e.query?e:{query:e,variables:t,requestHeaders:n,signal:void 0},Qe=(e,t)=>e.documents?e:{documents:e,requestHeaders:t,signal:void 0};function X(e,t){if(!!!e)throw new Error(t)}function Je(e){return typeof e=="object"&&e!==null}function Xe(e,t){if(!!!e)throw new Error(t??"Unexpected invariant triggered.")}const We=/\r\n|[\n\r]/g;function le(e,t){let n=0,i=1;for(const r of e.body.matchAll(We)){if(typeof r.index=="number"||Xe(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}function Ze(e){return Ne(e.source,le(e.source,e.start))}function Ne(e,t){const n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=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}
1
+ (function(R,_){typeof exports=="object"&&typeof module<"u"?_(exports):typeof define=="function"&&define.amd?define(["exports"],_):(R=typeof globalThis<"u"?globalThis:R||self,_(R.SQ={}))})(this,function(R){"use strict";var fn=Object.defineProperty;var mn=(R,_,F)=>_ in R?fn(R,_,{enumerable:!0,configurable:!0,writable:!0,value:F}):R[_]=F;var Ge=(R,_,F)=>(mn(R,typeof _!="symbol"?_+"":_,F),F);function _(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in e)){const s=Object.getOwnPropertyDescriptor(i,r);s&&Object.defineProperty(e,r,s.get?s:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const F=JSON,$e=e=>e.toUpperCase(),He=e=>{const t={};return e.forEach((n,i)=>{t[i]=n}),t},Ye=(e,t,n)=>e.document?e:{document:e,variables:t,requestHeaders:n,signal:void 0},ze=(e,t,n)=>e.query?e:{query:e,variables:t,requestHeaders:n,signal:void 0},Qe=(e,t)=>e.documents?e:{documents:e,requestHeaders:t,signal:void 0};function X(e,t){if(!!!e)throw new Error(t)}function Je(e){return typeof e=="object"&&e!==null}function Xe(e,t){if(!!!e)throw new Error(t??"Unexpected invariant triggered.")}const We=/\r\n|[\n\r]/g;function le(e,t){let n=0,i=1;for(const r of e.body.matchAll(We)){if(typeof r.index=="number"||Xe(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}function Ze(e){return Ne(e.source,le(e.source,e.start))}function Ne(e,t){const n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=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}
2
2
  `,m=i.split(/\r\n|[\n\r]/g),E=m[r];if(E.length>120){const g=Math.floor(h/80),A=h%80,y=[];for(let N=0;N<E.length;N+=80)y.push(E.slice(N,N+80));return p+xe([[`${o} |`,y[0]],...y.slice(1,g+1).map(N=>["|",N]),["|","^".padStart(A)],["|",y[g+1]]])}return p+xe([[`${o-1} |`,m[r-1]],[`${o} |`,E],["|","^".padStart(h)],[`${o+1} |`,m[r+1]]])}function xe(e){const t=e.filter(([i,r])=>r!==void 0),n=Math.max(...t.map(([i])=>i.length));return t.map(([i,r])=>i.padStart(n)+(r?" "+r:"")).join(`
3
3
  `)}function Ke(e){const t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}class de extends Error{constructor(t,...n){var i,r,s;const{nodes:o,source:u,positions:h,path:p,originalError:m,extensions:E}=Ke(n);super(t),this.name="GraphQLError",this.path=p??void 0,this.originalError=m??void 0,this.nodes=be(Array.isArray(o)?o:o?[o]:void 0);const g=be((i=this.nodes)===null||i===void 0?void 0:i.map(y=>y.loc).filter(y=>y!=null));this.source=u??(g==null||(r=g[0])===null||r===void 0?void 0:r.source),this.positions=h??(g==null?void 0:g.map(y=>y.start)),this.locations=h&&u?h.map(y=>le(u,y)):g==null?void 0:g.map(y=>le(y.source,y.start));const A=Je(m==null?void 0:m.extensions)?m==null?void 0:m.extensions:void 0;this.extensions=(s=E??A)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),m!=null&&m.stack?Object.defineProperty(this,"stack",{value:m.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,de):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(t+=`
4
4
 
5
5
  `+Ze(n.loc));else if(this.source&&this.locations)for(const n of this.locations)t+=`
6
6
 
7
- `+Ne(this.source,n);return t}toJSON(){const t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}}function be(e){return e===void 0||e.length===0?void 0:e}function b(e,t,n){return new de(`Syntax Error: ${n}`,{source:e,positions:[t]})}class et{constructor(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Ie{constructor(t,n,i,r,s,o){this.kind=t,this.start=n,this.end=i,this.line=r,this.column=s,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const Oe={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},tt=new Set(Object.keys(Oe));function De(e){const t=e==null?void 0:e.kind;return typeof t=="string"&&tt.has(t)}var q;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(q||(q={}));var he;(function(e){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"})(he||(he={}));var f;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(f||(f={}));function pe(e){return e===9||e===32}function H(e){return e>=48&&e<=57}function _e(e){return e>=97&&e<=122||e>=65&&e<=90}function ke(e){return _e(e)||e===95}function nt(e){return _e(e)||H(e)||e===95}function rt(e){var t;let n=Number.MAX_SAFE_INTEGER,i=null,r=-1;for(let o=0;o<e.length;++o){var s;const u=e[o],h=it(u);h!==u.length&&(i=(s=i)!==null&&s!==void 0?s:o,r=o,o!==0&&h<n&&(n=h))}return e.map((o,u)=>u===0?o:o.slice(n)).slice((t=i)!==null&&t!==void 0?t:0,r+1)}function it(e){let t=0;for(;t<e.length&&pe(e.charCodeAt(t));)++t;return t}function st(e,t){const n=e.replace(/"""/g,'\\"""'),i=n.split(/\r\n|[\n\r]/g),r=i.length===1,s=i.length>1&&i.slice(1).every(A=>A.length===0||pe(A.charCodeAt(0))),o=n.endsWith('\\"""'),u=e.endsWith('"')&&!o,h=e.endsWith("\\"),p=u||h,m=!(t!=null&&t.minimize)&&(!r||e.length>70||p||s||o);let E="";const g=r&&pe(e.charCodeAt(0));return(m&&!g||s)&&(E+=`
7
+ `+Ne(this.source,n);return t}toJSON(){const t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}}function be(e){return e===void 0||e.length===0?void 0:e}function b(e,t,n){return new de(`Syntax Error: ${n}`,{source:e,positions:[t]})}class et{constructor(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Ie{constructor(t,n,i,r,s,o){this.kind=t,this.start=n,this.end=i,this.line=r,this.column=s,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const De={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},tt=new Set(Object.keys(De));function Oe(e){const t=e==null?void 0:e.kind;return typeof t=="string"&&tt.has(t)}var q;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(q||(q={}));var he;(function(e){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"})(he||(he={}));var f;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(f||(f={}));function pe(e){return e===9||e===32}function H(e){return e>=48&&e<=57}function _e(e){return e>=97&&e<=122||e>=65&&e<=90}function ke(e){return _e(e)||e===95}function nt(e){return _e(e)||H(e)||e===95}function rt(e){var t;let n=Number.MAX_SAFE_INTEGER,i=null,r=-1;for(let o=0;o<e.length;++o){var s;const u=e[o],h=it(u);h!==u.length&&(i=(s=i)!==null&&s!==void 0?s:o,r=o,o!==0&&h<n&&(n=h))}return e.map((o,u)=>u===0?o:o.slice(n)).slice((t=i)!==null&&t!==void 0?t:0,r+1)}function it(e){let t=0;for(;t<e.length&&pe(e.charCodeAt(t));)++t;return t}function st(e,t){const n=e.replace(/"""/g,'\\"""'),i=n.split(/\r\n|[\n\r]/g),r=i.length===1,s=i.length>1&&i.slice(1).every(A=>A.length===0||pe(A.charCodeAt(0))),o=n.endsWith('\\"""'),u=e.endsWith('"')&&!o,h=e.endsWith("\\"),p=u||h,m=!(t!=null&&t.minimize)&&(!r||e.length>70||p||s||o);let E="";const g=r&&pe(e.charCodeAt(0));return(m&&!g||s)&&(E+=`
8
8
  `),E+=n,(m||p)&&(E+=`
9
9
  `),'"""'+E+'"""'}var c;(function(e){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"})(c||(c={}));class ot{constructor(t){const n=new Ie(c.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==c.EOF)do if(t.next)t=t.next;else{const n=ct(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===c.COMMENT);return t}}function at(e){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}function V(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function W(e,t){return Re(e.charCodeAt(t))&&Se(e.charCodeAt(t+1))}function Re(e){return e>=55296&&e<=56319}function Se(e){return e>=56320&&e<=57343}function M(e,t){const n=e.source.body.codePointAt(t);if(n===void 0)return c.EOF;if(n>=32&&n<=126){const i=String.fromCodePoint(n);return i==='"'?`'"'`:`"${i}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function x(e,t,n,i,r){const s=e.line,o=1+n-e.lineStart;return new Ie(t,n,i,s,o,r)}function ct(e,t){const n=e.source.body,i=n.length;let r=t;for(;r<i;){const s=n.charCodeAt(r);switch(s){case 65279:case 9:case 32:case 44:++r;continue;case 10:++r,++e.line,e.lineStart=r;continue;case 13:n.charCodeAt(r+1)===10?r+=2:++r,++e.line,e.lineStart=r;continue;case 35:return ut(e,r);case 33:return x(e,c.BANG,r,r+1);case 36:return x(e,c.DOLLAR,r,r+1);case 38:return x(e,c.AMP,r,r+1);case 40:return x(e,c.PAREN_L,r,r+1);case 41:return x(e,c.PAREN_R,r,r+1);case 46:if(n.charCodeAt(r+1)===46&&n.charCodeAt(r+2)===46)return x(e,c.SPREAD,r,r+3);break;case 58:return x(e,c.COLON,r,r+1);case 61:return x(e,c.EQUALS,r,r+1);case 64:return x(e,c.AT,r,r+1);case 91:return x(e,c.BRACKET_L,r,r+1);case 93:return x(e,c.BRACKET_R,r,r+1);case 123:return x(e,c.BRACE_L,r,r+1);case 124:return x(e,c.PIPE,r,r+1);case 125:return x(e,c.BRACE_R,r,r+1);case 34:return n.charCodeAt(r+1)===34&&n.charCodeAt(r+2)===34?mt(e,r):dt(e,r)}if(H(s)||s===45)return lt(e,r,s);if(ke(s))return yt(e,r);throw b(e.source,r,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:V(s)||W(n,r)?`Unexpected character: ${M(e,r)}.`:`Invalid character: ${M(e,r)}.`)}return x(e,c.EOF,i,i)}function ut(e,t){const n=e.source.body,i=n.length;let r=t+1;for(;r<i;){const s=n.charCodeAt(r);if(s===10||s===13)break;if(V(s))++r;else if(W(n,r))r+=2;else break}return x(e,c.COMMENT,t,r,n.slice(t+1,r))}function lt(e,t,n){const i=e.source.body;let r=t,s=n,o=!1;if(s===45&&(s=i.charCodeAt(++r)),s===48){if(s=i.charCodeAt(++r),H(s))throw b(e.source,r,`Invalid number, unexpected digit after 0: ${M(e,r)}.`)}else r=fe(e,r,s),s=i.charCodeAt(r);if(s===46&&(o=!0,s=i.charCodeAt(++r),r=fe(e,r,s),s=i.charCodeAt(r)),(s===69||s===101)&&(o=!0,s=i.charCodeAt(++r),(s===43||s===45)&&(s=i.charCodeAt(++r)),r=fe(e,r,s),s=i.charCodeAt(r)),s===46||ke(s))throw b(e.source,r,`Invalid number, expected digit but got: ${M(e,r)}.`);return x(e,o?c.FLOAT:c.INT,t,r,i.slice(t,r))}function fe(e,t,n){if(!H(n))throw b(e.source,t,`Invalid number, expected digit but got: ${M(e,t)}.`);const i=e.source.body;let r=t+1;for(;H(i.charCodeAt(r));)++r;return r}function dt(e,t){const n=e.source.body,i=n.length;let r=t+1,s=r,o="";for(;r<i;){const u=n.charCodeAt(r);if(u===34)return o+=n.slice(s,r),x(e,c.STRING,t,r+1,o);if(u===92){o+=n.slice(s,r);const h=n.charCodeAt(r+1)===117?n.charCodeAt(r+2)===123?ht(e,r):pt(e,r):ft(e,r);o+=h.value,r+=h.size,s=r;continue}if(u===10||u===13)break;if(V(u))++r;else if(W(n,r))r+=2;else throw b(e.source,r,`Invalid character within String: ${M(e,r)}.`)}throw b(e.source,r,"Unterminated string.")}function ht(e,t){const n=e.source.body;let i=0,r=3;for(;r<12;){const s=n.charCodeAt(t+r++);if(s===125){if(r<5||!V(i))break;return{value:String.fromCodePoint(i),size:r}}if(i=i<<4|Y(s),i<0)break}throw b(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+r)}".`)}function pt(e,t){const n=e.source.body,i=we(n,t+2);if(V(i))return{value:String.fromCodePoint(i),size:6};if(Re(i)&&n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){const r=we(n,t+8);if(Se(r))return{value:String.fromCodePoint(i,r),size:12}}throw b(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function we(e,t){return Y(e.charCodeAt(t))<<12|Y(e.charCodeAt(t+1))<<8|Y(e.charCodeAt(t+2))<<4|Y(e.charCodeAt(t+3))}function Y(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function ft(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
10
10
  `,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw b(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function mt(e,t){const n=e.source.body,i=n.length;let r=e.lineStart,s=t+3,o=s,u="";const h=[];for(;s<i;){const p=n.charCodeAt(s);if(p===34&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34){u+=n.slice(o,s),h.push(u);const m=x(e,c.BLOCK_STRING,t,s+3,rt(h).join(`
11
- `));return e.line+=h.length-1,e.lineStart=r,m}if(p===92&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34&&n.charCodeAt(s+3)===34){u+=n.slice(o,s),o=s+1,s+=4;continue}if(p===10||p===13){u+=n.slice(o,s),h.push(u),p===13&&n.charCodeAt(s+1)===10?s+=2:++s,u="",o=s,r=s;continue}if(V(p))++s;else if(W(n,s))s+=2;else throw b(e.source,s,`Invalid character within String: ${M(e,s)}.`)}throw b(e.source,s,"Unterminated string.")}function yt(e,t){const n=e.source.body,i=n.length;let r=t+1;for(;r<i;){const s=n.charCodeAt(r);if(nt(s))++r;else break}return x(e,c.NAME,t,r,n.slice(t,r))}const Et=10,Pe=2;function me(e){return Z(e,[])}function Z(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return gt(e,t);default:return String(e)}}function gt(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(vt(e)){const i=e.toJSON();if(i!==e)return typeof i=="string"?i:Z(i,n)}else if(Array.isArray(e))return Ct(e,n);return Tt(e,n)}function vt(e){return typeof e.toJSON=="function"}function Tt(e,t){const n=Object.entries(e);return n.length===0?"{}":t.length>Pe?"["+At(e)+"]":"{ "+n.map(([r,s])=>r+": "+Z(s,t)).join(", ")+" }"}function Ct(e,t){if(e.length===0)return"[]";if(t.length>Pe)return"[Array]";const n=Math.min(Et,e.length),i=e.length-n,r=[];for(let s=0;s<n;++s)r.push(Z(e[s],t));return i===1?r.push("... 1 more item"):i>1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}function At(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){const n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}const Nt=globalThis.process&&globalThis.process.env.NODE_ENV==="production"?function(t,n){return t instanceof n}:function(t,n){if(t instanceof n)return!0;if(typeof t=="object"&&t!==null){var i;const r=n.prototype[Symbol.toStringTag],s=Symbol.toStringTag in t?t[Symbol.toStringTag]:(i=t.constructor)===null||i===void 0?void 0:i.name;if(r===s){const o=me(t);throw new Error(`Cannot use ${r} "${o}" from another module or realm.
11
+ `));return e.line+=h.length-1,e.lineStart=r,m}if(p===92&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34&&n.charCodeAt(s+3)===34){u+=n.slice(o,s),o=s+1,s+=4;continue}if(p===10||p===13){u+=n.slice(o,s),h.push(u),p===13&&n.charCodeAt(s+1)===10?s+=2:++s,u="",o=s,r=s;continue}if(V(p))++s;else if(W(n,s))s+=2;else throw b(e.source,s,`Invalid character within String: ${M(e,s)}.`)}throw b(e.source,s,"Unterminated string.")}function yt(e,t){const n=e.source.body,i=n.length;let r=t+1;for(;r<i;){const s=n.charCodeAt(r);if(nt(s))++r;else break}return x(e,c.NAME,t,r,n.slice(t,r))}const Et=10,Pe=2;function me(e){return Z(e,[])}function Z(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return gt(e,t);default:return String(e)}}function gt(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(vt(e)){const i=e.toJSON();if(i!==e)return typeof i=="string"?i:Z(i,n)}else if(Array.isArray(e))return Tt(e,n);return Ct(e,n)}function vt(e){return typeof e.toJSON=="function"}function Ct(e,t){const n=Object.entries(e);return n.length===0?"{}":t.length>Pe?"["+At(e)+"]":"{ "+n.map(([r,s])=>r+": "+Z(s,t)).join(", ")+" }"}function Tt(e,t){if(e.length===0)return"[]";if(t.length>Pe)return"[Array]";const n=Math.min(Et,e.length),i=e.length-n,r=[];for(let s=0;s<n;++s)r.push(Z(e[s],t));return i===1?r.push("... 1 more item"):i>1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}function At(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){const n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}const Nt=globalThis.process&&globalThis.process.env.NODE_ENV==="production"?function(t,n){return t instanceof n}:function(t,n){if(t instanceof n)return!0;if(typeof t=="object"&&t!==null){var i;const r=n.prototype[Symbol.toStringTag],s=Symbol.toStringTag in t?t[Symbol.toStringTag]:(i=t.constructor)===null||i===void 0?void 0:i.name;if(r===s){const o=me(t);throw new Error(`Cannot use ${r} "${o}" from another module or realm.
12
12
 
13
13
  Ensure that there is only one instance of "graphql" in the node_modules
14
14
  directory. If different versions of "graphql" are the dependencies of other
@@ -19,36 +19,36 @@ https://yarnpkg.com/en/docs/selective-version-resolutions
19
19
  Duplicate "graphql" modules cannot be used at the same time since different
20
20
  versions may have different capabilities and behavior. The data from one
21
21
  version used in the function from another could produce confusing and
22
- spurious results.`)}}return!1};class Le{constructor(t,n="GraphQL request",i={line:1,column:1}){typeof t=="string"||X(!1,`Body must be a string. Received: ${me(t)}.`),this.body=t,this.name=n,this.locationOffset=i,this.locationOffset.line>0||X(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||X(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function xt(e){return Nt(e,Le)}function Fe(e,t){return new bt(e,t).parseDocument()}class bt{constructor(t,n={}){const i=xt(t)?t:new Le(t);this._lexer=new ot(i),this._options=n,this._tokenCounter=0}parseName(){const t=this.expectToken(c.NAME);return this.node(t,{kind:f.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:f.DOCUMENT,definitions:this.many(c.SOF,this.parseDefinition,c.EOF)})}parseDefinition(){if(this.peek(c.BRACE_L))return this.parseOperationDefinition();const t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(n.kind===c.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(t)throw b(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){const t=this._lexer.token;if(this.peek(c.BRACE_L))return this.node(t,{kind:f.OPERATION_DEFINITION,operation:q.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseOperationType();let i;return this.peek(c.NAME)&&(i=this.parseName()),this.node(t,{kind:f.OPERATION_DEFINITION,operation:n,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const t=this.expectToken(c.NAME);switch(t.value){case"query":return q.QUERY;case"mutation":return q.MUTATION;case"subscription":return q.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(c.PAREN_L,this.parseVariableDefinition,c.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:f.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(c.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(c.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const t=this._lexer.token;return this.expectToken(c.DOLLAR),this.node(t,{kind:f.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:f.SELECTION_SET,selections:this.many(c.BRACE_L,this.parseSelection,c.BRACE_R)})}parseSelection(){return this.peek(c.SPREAD)?this.parseFragment():this.parseField()}parseField(){const t=this._lexer.token,n=this.parseName();let i,r;return this.expectOptionalToken(c.COLON)?(i=n,r=this.parseName()):r=n,this.node(t,{kind:f.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(c.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){const n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(c.PAREN_L,n,c.PAREN_R)}parseArgument(t=!1){const n=this._lexer.token,i=this.parseName();return this.expectToken(c.COLON),this.node(n,{kind:f.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const t=this._lexer.token;this.expectToken(c.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(c.NAME)?this.node(t,{kind:f.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:f.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:f.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:f.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){const n=this._lexer.token;switch(n.kind){case c.BRACKET_L:return this.parseList(t);case c.BRACE_L:return this.parseObject(t);case c.INT:return this.advanceLexer(),this.node(n,{kind:f.INT,value:n.value});case c.FLOAT:return this.advanceLexer(),this.node(n,{kind:f.FLOAT,value:n.value});case c.STRING:case c.BLOCK_STRING:return this.parseStringLiteral();case c.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:f.BOOLEAN,value:!0});case"false":return this.node(n,{kind:f.BOOLEAN,value:!1});case"null":return this.node(n,{kind:f.NULL});default:return this.node(n,{kind:f.ENUM,value:n.value})}case c.DOLLAR:if(t)if(this.expectToken(c.DOLLAR),this._lexer.token.kind===c.NAME){const i=this._lexer.token.value;throw b(this._lexer.source,n.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:f.STRING,value:t.value,block:t.kind===c.BLOCK_STRING})}parseList(t){const n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:f.LIST,values:this.any(c.BRACKET_L,n,c.BRACKET_R)})}parseObject(t){const n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:f.OBJECT,fields:this.any(c.BRACE_L,n,c.BRACE_R)})}parseObjectField(t){const n=this._lexer.token,i=this.parseName();return this.expectToken(c.COLON),this.node(n,{kind:f.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(t){const n=[];for(;this.peek(c.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){const n=this._lexer.token;return this.expectToken(c.AT),this.node(n,{kind:f.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){const t=this._lexer.token;let n;if(this.expectOptionalToken(c.BRACKET_L)){const i=this.parseTypeReference();this.expectToken(c.BRACKET_R),n=this.node(t,{kind:f.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(c.BANG)?this.node(t,{kind:f.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:f.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(c.STRING)||this.peek(c.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const i=this.parseConstDirectives(),r=this.many(c.BRACE_L,this.parseOperationTypeDefinition,c.BRACE_R);return this.node(t,{kind:f.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:r})}parseOperationTypeDefinition(){const t=this._lexer.token,n=this.parseOperationType();this.expectToken(c.COLON);const i=this.parseNamedType();return this.node(t,{kind:f.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const i=this.parseName(),r=this.parseConstDirectives();return this.node(t,{kind:f.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:r})}parseObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:f.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(c.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(c.BRACE_L,this.parseFieldDefinition,c.BRACE_R)}parseFieldDefinition(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(c.COLON);const s=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(t,{kind:f.FIELD_DEFINITION,description:n,name:i,arguments:r,type:s,directives:o})}parseArgumentDefs(){return this.optionalMany(c.PAREN_L,this.parseInputValueDef,c.PAREN_R)}parseInputValueDef(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(c.COLON);const r=this.parseTypeReference();let s;this.expectOptionalToken(c.EQUALS)&&(s=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(t,{kind:f.INPUT_VALUE_DEFINITION,description:n,name:i,type:r,defaultValue:s,directives:o})}parseInterfaceTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:f.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:o})}parseUnionTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(t,{kind:f.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(c.EQUALS)?this.delimitedMany(c.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(t,{kind:f.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:s})}parseEnumValuesDefinition(){return this.optionalMany(c.BRACE_L,this.parseEnumValueDefinition,c.BRACE_R)}parseEnumValueDefinition(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(t,{kind:f.ENUM_VALUE_DEFINITION,description:n,name:i,directives:r})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw b(this._lexer.source,this._lexer.token.start,`${K(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(t,{kind:f.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(c.BRACE_L,this.parseInputValueDef,c.BRACE_R)}parseTypeSystemExtension(){const t=this._lexer.lookahead();if(t.kind===c.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.optionalMany(c.BRACE_L,this.parseOperationTypeDefinition,c.BRACE_R);if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:f.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();if(i.length===0)throw this.unexpected();return this.node(t,{kind:f.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:f.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseInterfaceTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:f.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseUnionTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:f.UNION_TYPE_EXTENSION,name:n,directives:i,types:r})}parseEnumTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:f.ENUM_TYPE_EXTENSION,name:n,directives:i,values:r})}parseInputObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:f.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:r})}parseDirectiveDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(c.AT);const i=this.parseName(),r=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(t,{kind:f.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,repeatable:s,locations:o})}parseDirectiveLocations(){return this.delimitedMany(c.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(he,n.value))return n;throw this.unexpected(t)}node(t,n){return this._options.noLocation!==!0&&(n.loc=new et(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){const n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw b(this._lexer.source,n.start,`Expected ${Be(t)}, found ${K(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){const n=this._lexer.token;if(n.kind===c.NAME&&n.value===t)this.advanceLexer();else throw b(this._lexer.source,n.start,`Expected "${t}", found ${K(n)}.`)}expectOptionalKeyword(t){const n=this._lexer.token;return n.kind===c.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){const n=t??this._lexer.token;return b(this._lexer.source,n.start,`Unexpected ${K(n)}.`)}any(t,n,i){this.expectToken(t);const r=[];for(;!this.expectOptionalToken(i);)r.push(n.call(this));return r}optionalMany(t,n,i){if(this.expectOptionalToken(t)){const r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}return[]}many(t,n,i){this.expectToken(t);const r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}delimitedMany(t,n){this.expectOptionalToken(t);const i=[];do i.push(n.call(this));while(this.expectOptionalToken(t));return i}advanceLexer(){const{maxTokens:t}=this._options,n=this._lexer.advance();if(t!==void 0&&n.kind!==c.EOF&&(++this._tokenCounter,this._tokenCounter>t))throw b(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}}function K(e){const t=e.value;return Be(e.kind)+(t!=null?` "${t}"`:"")}function Be(e){return at(e)?`"${e}"`:e}function It(e){return`"${e.replace(Ot,Dt)}"`}const Ot=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Dt(e){return _t[e.charCodeAt(0)]}const _t=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],kt=Object.freeze({});function Rt(e,t,n=Oe){const i=new Map;for(const k of Object.values(f))i.set(k,St(t,k));let r,s=Array.isArray(e),o=[e],u=-1,h=[],p=e,m,E;const g=[],A=[];do{u++;const k=u===o.length,oe=k&&h.length!==0;if(k){if(m=A.length===0?void 0:g[g.length-1],p=E,E=A.pop(),oe)if(s){p=p.slice();let w=0;for(const[G,ae]of h){const ce=G-w;ae===null?(p.splice(ce,1),w++):p[ce]=ae}}else{p=Object.defineProperties({},Object.getOwnPropertyDescriptors(p));for(const[w,G]of h)p[w]=G}u=r.index,o=r.keys,h=r.edits,s=r.inArray,r=r.prev}else if(E){if(m=s?u:o[u],p=E[m],p==null)continue;g.push(m)}let P;if(!Array.isArray(p)){var y,N;De(p)||X(!1,`Invalid AST Node: ${me(p)}.`);const w=k?(y=i.get(p.kind))===null||y===void 0?void 0:y.leave:(N=i.get(p.kind))===null||N===void 0?void 0:N.enter;if(P=w==null?void 0:w.call(t,p,m,E,g,A),P===kt)break;if(P===!1){if(!k){g.pop();continue}}else if(P!==void 0&&(h.push([m,P]),!k))if(De(P))p=P;else{g.pop();continue}}if(P===void 0&&oe&&h.push([m,p]),k)g.pop();else{var D;r={inArray:s,index:u,keys:o,edits:h,prev:r},s=Array.isArray(p),o=s?p:(D=n[p.kind])!==null&&D!==void 0?D:[],u=-1,h=[],E&&A.push(E),E=p}}while(r!==void 0);return h.length!==0?h[h.length-1][1]:e}function St(e,t){const n=e[t];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function wt(e){return Rt(e,Lt)}const Pt=80,Lt={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>d(e.definitions,`
22
+ spurious results.`)}}return!1};class Le{constructor(t,n="GraphQL request",i={line:1,column:1}){typeof t=="string"||X(!1,`Body must be a string. Received: ${me(t)}.`),this.body=t,this.name=n,this.locationOffset=i,this.locationOffset.line>0||X(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||X(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function xt(e){return Nt(e,Le)}function Fe(e,t){return new bt(e,t).parseDocument()}class bt{constructor(t,n={}){const i=xt(t)?t:new Le(t);this._lexer=new ot(i),this._options=n,this._tokenCounter=0}parseName(){const t=this.expectToken(c.NAME);return this.node(t,{kind:f.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:f.DOCUMENT,definitions:this.many(c.SOF,this.parseDefinition,c.EOF)})}parseDefinition(){if(this.peek(c.BRACE_L))return this.parseOperationDefinition();const t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(n.kind===c.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(t)throw b(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){const t=this._lexer.token;if(this.peek(c.BRACE_L))return this.node(t,{kind:f.OPERATION_DEFINITION,operation:q.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseOperationType();let i;return this.peek(c.NAME)&&(i=this.parseName()),this.node(t,{kind:f.OPERATION_DEFINITION,operation:n,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const t=this.expectToken(c.NAME);switch(t.value){case"query":return q.QUERY;case"mutation":return q.MUTATION;case"subscription":return q.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(c.PAREN_L,this.parseVariableDefinition,c.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:f.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(c.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(c.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const t=this._lexer.token;return this.expectToken(c.DOLLAR),this.node(t,{kind:f.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:f.SELECTION_SET,selections:this.many(c.BRACE_L,this.parseSelection,c.BRACE_R)})}parseSelection(){return this.peek(c.SPREAD)?this.parseFragment():this.parseField()}parseField(){const t=this._lexer.token,n=this.parseName();let i,r;return this.expectOptionalToken(c.COLON)?(i=n,r=this.parseName()):r=n,this.node(t,{kind:f.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(c.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){const n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(c.PAREN_L,n,c.PAREN_R)}parseArgument(t=!1){const n=this._lexer.token,i=this.parseName();return this.expectToken(c.COLON),this.node(n,{kind:f.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const t=this._lexer.token;this.expectToken(c.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(c.NAME)?this.node(t,{kind:f.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:f.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:f.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:f.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){const n=this._lexer.token;switch(n.kind){case c.BRACKET_L:return this.parseList(t);case c.BRACE_L:return this.parseObject(t);case c.INT:return this.advanceLexer(),this.node(n,{kind:f.INT,value:n.value});case c.FLOAT:return this.advanceLexer(),this.node(n,{kind:f.FLOAT,value:n.value});case c.STRING:case c.BLOCK_STRING:return this.parseStringLiteral();case c.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:f.BOOLEAN,value:!0});case"false":return this.node(n,{kind:f.BOOLEAN,value:!1});case"null":return this.node(n,{kind:f.NULL});default:return this.node(n,{kind:f.ENUM,value:n.value})}case c.DOLLAR:if(t)if(this.expectToken(c.DOLLAR),this._lexer.token.kind===c.NAME){const i=this._lexer.token.value;throw b(this._lexer.source,n.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:f.STRING,value:t.value,block:t.kind===c.BLOCK_STRING})}parseList(t){const n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:f.LIST,values:this.any(c.BRACKET_L,n,c.BRACKET_R)})}parseObject(t){const n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:f.OBJECT,fields:this.any(c.BRACE_L,n,c.BRACE_R)})}parseObjectField(t){const n=this._lexer.token,i=this.parseName();return this.expectToken(c.COLON),this.node(n,{kind:f.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(t){const n=[];for(;this.peek(c.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){const n=this._lexer.token;return this.expectToken(c.AT),this.node(n,{kind:f.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){const t=this._lexer.token;let n;if(this.expectOptionalToken(c.BRACKET_L)){const i=this.parseTypeReference();this.expectToken(c.BRACKET_R),n=this.node(t,{kind:f.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(c.BANG)?this.node(t,{kind:f.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:f.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(c.STRING)||this.peek(c.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const i=this.parseConstDirectives(),r=this.many(c.BRACE_L,this.parseOperationTypeDefinition,c.BRACE_R);return this.node(t,{kind:f.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:r})}parseOperationTypeDefinition(){const t=this._lexer.token,n=this.parseOperationType();this.expectToken(c.COLON);const i=this.parseNamedType();return this.node(t,{kind:f.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const i=this.parseName(),r=this.parseConstDirectives();return this.node(t,{kind:f.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:r})}parseObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:f.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(c.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(c.BRACE_L,this.parseFieldDefinition,c.BRACE_R)}parseFieldDefinition(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(c.COLON);const s=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(t,{kind:f.FIELD_DEFINITION,description:n,name:i,arguments:r,type:s,directives:o})}parseArgumentDefs(){return this.optionalMany(c.PAREN_L,this.parseInputValueDef,c.PAREN_R)}parseInputValueDef(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(c.COLON);const r=this.parseTypeReference();let s;this.expectOptionalToken(c.EQUALS)&&(s=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(t,{kind:f.INPUT_VALUE_DEFINITION,description:n,name:i,type:r,defaultValue:s,directives:o})}parseInterfaceTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:f.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:o})}parseUnionTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(t,{kind:f.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(c.EQUALS)?this.delimitedMany(c.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(t,{kind:f.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:s})}parseEnumValuesDefinition(){return this.optionalMany(c.BRACE_L,this.parseEnumValueDefinition,c.BRACE_R)}parseEnumValueDefinition(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(t,{kind:f.ENUM_VALUE_DEFINITION,description:n,name:i,directives:r})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw b(this._lexer.source,this._lexer.token.start,`${K(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(t,{kind:f.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(c.BRACE_L,this.parseInputValueDef,c.BRACE_R)}parseTypeSystemExtension(){const t=this._lexer.lookahead();if(t.kind===c.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.optionalMany(c.BRACE_L,this.parseOperationTypeDefinition,c.BRACE_R);if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:f.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();if(i.length===0)throw this.unexpected();return this.node(t,{kind:f.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:f.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseInterfaceTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:f.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseUnionTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:f.UNION_TYPE_EXTENSION,name:n,directives:i,types:r})}parseEnumTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:f.ENUM_TYPE_EXTENSION,name:n,directives:i,values:r})}parseInputObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:f.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:r})}parseDirectiveDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(c.AT);const i=this.parseName(),r=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(t,{kind:f.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,repeatable:s,locations:o})}parseDirectiveLocations(){return this.delimitedMany(c.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(he,n.value))return n;throw this.unexpected(t)}node(t,n){return this._options.noLocation!==!0&&(n.loc=new et(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){const n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw b(this._lexer.source,n.start,`Expected ${Be(t)}, found ${K(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){const n=this._lexer.token;if(n.kind===c.NAME&&n.value===t)this.advanceLexer();else throw b(this._lexer.source,n.start,`Expected "${t}", found ${K(n)}.`)}expectOptionalKeyword(t){const n=this._lexer.token;return n.kind===c.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){const n=t??this._lexer.token;return b(this._lexer.source,n.start,`Unexpected ${K(n)}.`)}any(t,n,i){this.expectToken(t);const r=[];for(;!this.expectOptionalToken(i);)r.push(n.call(this));return r}optionalMany(t,n,i){if(this.expectOptionalToken(t)){const r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}return[]}many(t,n,i){this.expectToken(t);const r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}delimitedMany(t,n){this.expectOptionalToken(t);const i=[];do i.push(n.call(this));while(this.expectOptionalToken(t));return i}advanceLexer(){const{maxTokens:t}=this._options,n=this._lexer.advance();if(t!==void 0&&n.kind!==c.EOF&&(++this._tokenCounter,this._tokenCounter>t))throw b(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}}function K(e){const t=e.value;return Be(e.kind)+(t!=null?` "${t}"`:"")}function Be(e){return at(e)?`"${e}"`:e}function It(e){return`"${e.replace(Dt,Ot)}"`}const Dt=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function Ot(e){return _t[e.charCodeAt(0)]}const _t=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],kt=Object.freeze({});function Rt(e,t,n=De){const i=new Map;for(const k of Object.values(f))i.set(k,St(t,k));let r,s=Array.isArray(e),o=[e],u=-1,h=[],p=e,m,E;const g=[],A=[];do{u++;const k=u===o.length,oe=k&&h.length!==0;if(k){if(m=A.length===0?void 0:g[g.length-1],p=E,E=A.pop(),oe)if(s){p=p.slice();let w=0;for(const[$,ae]of h){const ce=$-w;ae===null?(p.splice(ce,1),w++):p[ce]=ae}}else{p=Object.defineProperties({},Object.getOwnPropertyDescriptors(p));for(const[w,$]of h)p[w]=$}u=r.index,o=r.keys,h=r.edits,s=r.inArray,r=r.prev}else if(E){if(m=s?u:o[u],p=E[m],p==null)continue;g.push(m)}let P;if(!Array.isArray(p)){var y,N;Oe(p)||X(!1,`Invalid AST Node: ${me(p)}.`);const w=k?(y=i.get(p.kind))===null||y===void 0?void 0:y.leave:(N=i.get(p.kind))===null||N===void 0?void 0:N.enter;if(P=w==null?void 0:w.call(t,p,m,E,g,A),P===kt)break;if(P===!1){if(!k){g.pop();continue}}else if(P!==void 0&&(h.push([m,P]),!k))if(Oe(P))p=P;else{g.pop();continue}}if(P===void 0&&oe&&h.push([m,p]),k)g.pop();else{var O;r={inArray:s,index:u,keys:o,edits:h,prev:r},s=Array.isArray(p),o=s?p:(O=n[p.kind])!==null&&O!==void 0?O:[],u=-1,h=[],E&&A.push(E),E=p}}while(r!==void 0);return h.length!==0?h[h.length-1][1]:e}function St(e,t){const n=e[t];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function wt(e){return Rt(e,Lt)}const Pt=80,Lt={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>d(e.definitions,`
23
23
 
24
- `)},OperationDefinition:{leave(e){const t=T("(",d(e.variableDefinitions,", "),")"),n=d([e.operation,d([e.name,t]),d(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:i})=>e+": "+t+T(" = ",n)+T(" ",d(i," "))},SelectionSet:{leave:({selections:e})=>S(e)},Field:{leave({alias:e,name:t,arguments:n,directives:i,selectionSet:r}){const s=T("",e,": ")+t;let o=s+T("(",d(n,", "),")");return o.length>Pt&&(o=s+T(`(
24
+ `)},OperationDefinition:{leave(e){const t=C("(",d(e.variableDefinitions,", "),")"),n=d([e.operation,d([e.name,t]),d(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:i})=>e+": "+t+C(" = ",n)+C(" ",d(i," "))},SelectionSet:{leave:({selections:e})=>S(e)},Field:{leave({alias:e,name:t,arguments:n,directives:i,selectionSet:r}){const s=C("",e,": ")+t;let o=s+C("(",d(n,", "),")");return o.length>Pt&&(o=s+C(`(
25
25
  `,ee(d(n,`
26
26
  `)),`
27
- )`)),d([o,d(i," "),r]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+T(" ",d(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>d(["...",T("on ",e),d(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:i,selectionSet:r})=>`fragment ${e}${T("(",d(n,", "),")")} on ${t} ${T("",d(i," ")," ")}`+r},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?st(e):It(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+d(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+d(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+T("(",d(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>T("",e,`
28
- `)+d(["schema",d(t," "),S(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>T("",e,`
29
- `)+d(["scalar",t,d(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:i,fields:r})=>T("",e,`
30
- `)+d(["type",t,T("implements ",d(n," & ")),d(i," "),S(r)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:i,directives:r})=>T("",e,`
31
- `)+t+(Me(n)?T(`(
27
+ )`)),d([o,d(i," "),r]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+C(" ",d(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>d(["...",C("on ",e),d(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:i,selectionSet:r})=>`fragment ${e}${C("(",d(n,", "),")")} on ${t} ${C("",d(i," ")," ")}`+r},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?st(e):It(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+d(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+d(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+C("(",d(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>C("",e,`
28
+ `)+d(["schema",d(t," "),S(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>C("",e,`
29
+ `)+d(["scalar",t,d(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:i,fields:r})=>C("",e,`
30
+ `)+d(["type",t,C("implements ",d(n," & ")),d(i," "),S(r)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:i,directives:r})=>C("",e,`
31
+ `)+t+(Me(n)?C(`(
32
32
  `,ee(d(n,`
33
33
  `)),`
34
- )`):T("(",d(n,", "),")"))+": "+i+T(" ",d(r," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:i,directives:r})=>T("",e,`
35
- `)+d([t+": "+n,T("= ",i),d(r," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:i,fields:r})=>T("",e,`
36
- `)+d(["interface",t,T("implements ",d(n," & ")),d(i," "),S(r)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:i})=>T("",e,`
37
- `)+d(["union",t,d(n," "),T("= ",d(i," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:i})=>T("",e,`
38
- `)+d(["enum",t,d(n," "),S(i)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>T("",e,`
39
- `)+d([t,d(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:i})=>T("",e,`
40
- `)+d(["input",t,d(n," "),S(i)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:i,locations:r})=>T("",e,`
41
- `)+"directive @"+t+(Me(n)?T(`(
34
+ )`):C("(",d(n,", "),")"))+": "+i+C(" ",d(r," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:i,directives:r})=>C("",e,`
35
+ `)+d([t+": "+n,C("= ",i),d(r," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:i,fields:r})=>C("",e,`
36
+ `)+d(["interface",t,C("implements ",d(n," & ")),d(i," "),S(r)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:i})=>C("",e,`
37
+ `)+d(["union",t,d(n," "),C("= ",d(i," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:i})=>C("",e,`
38
+ `)+d(["enum",t,d(n," "),S(i)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>C("",e,`
39
+ `)+d([t,d(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:i})=>C("",e,`
40
+ `)+d(["input",t,d(n," "),S(i)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:i,locations:r})=>C("",e,`
41
+ `)+"directive @"+t+(Me(n)?C(`(
42
42
  `,ee(d(n,`
43
43
  `)),`
44
- )`):T("(",d(n,", "),")"))+(i?" repeatable":"")+" on "+d(r," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>d(["extend schema",d(e," "),S(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>d(["extend scalar",e,d(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:i})=>d(["extend type",e,T("implements ",d(t," & ")),d(n," "),S(i)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:i})=>d(["extend interface",e,T("implements ",d(t," & ")),d(n," "),S(i)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>d(["extend union",e,d(t," "),T("= ",d(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>d(["extend enum",e,d(t," "),S(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>d(["extend input",e,d(t," "),S(n)]," ")}};function d(e,t=""){var n;return(n=e==null?void 0:e.filter(i=>i).join(t))!==null&&n!==void 0?n:""}function S(e){return T(`{
44
+ )`):C("(",d(n,", "),")"))+(i?" repeatable":"")+" on "+d(r," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>d(["extend schema",d(e," "),S(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>d(["extend scalar",e,d(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:i})=>d(["extend type",e,C("implements ",d(t," & ")),d(n," "),S(i)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:i})=>d(["extend interface",e,C("implements ",d(t," & ")),d(n," "),S(i)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>d(["extend union",e,d(t," "),C("= ",d(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>d(["extend enum",e,d(t," "),S(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>d(["extend input",e,d(t," "),S(n)]," ")}};function d(e,t=""){var n;return(n=e==null?void 0:e.filter(i=>i).join(t))!==null&&n!==void 0?n:""}function S(e){return C(`{
45
45
  `,ee(d(e,`
46
46
  `)),`
47
- }`)}function T(e,t,n=""){return t!=null&&t!==""?e+t+n:""}function ee(e){return T(" ",e.replace(/\n/g,`
47
+ }`)}function C(e,t,n=""){return t!=null&&t!==""?e+t+n:""}function ee(e){return C(" ",e.replace(/\n/g,`
48
48
  `))}function Me(e){var t;return(t=e==null?void 0:e.some(n=>n.includes(`
49
- `)))!==null&&t!==void 0?t:!1}const Ue=e=>{var i,r;let t;const n=e.definitions.filter(s=>s.kind==="OperationDefinition");return n.length===1&&(t=(r=(i=n[0])==null?void 0:i.name)==null?void 0:r.value),t},ye=e=>{if(typeof e=="string"){let n;try{const i=Fe(e);n=Ue(i)}catch{}return{query:e,operationName:n}}const t=Ue(e);return{query:wt(e),operationName:t}};class z extends Error{constructor(t,n){const i=`${z.extractMessage(t)}: ${JSON.stringify({response:t,request:n})}`;super(i),Object.setPrototypeOf(this,z.prototype),this.response=t,this.request=n,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,z)}static extractMessage(t){var n,i;return((i=(n=t.errors)==null?void 0:n[0])==null?void 0:i.message)??`GraphQL Error (Code: ${t.status})`}}var Ft=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Bt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ee={exports:{}};(function(e,t){var n=typeof self<"u"?self:Ft,i=function(){function s(){this.fetch=!1,this.DOMException=n.DOMException}return s.prototype=n,new s}();(function(s){(function(o){var u={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function h(a){return a&&DataView.prototype.isPrototypeOf(a)}if(u.arrayBuffer)var p=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],m=ArrayBuffer.isView||function(a){return a&&p.indexOf(Object.prototype.toString.call(a))>-1};function E(a){if(typeof a!="string"&&(a=String(a)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(a))throw new TypeError("Invalid character in header field name");return a.toLowerCase()}function g(a){return typeof a!="string"&&(a=String(a)),a}function A(a){var l={next:function(){var v=a.shift();return{done:v===void 0,value:v}}};return u.iterable&&(l[Symbol.iterator]=function(){return l}),l}function y(a){this.map={},a instanceof y?a.forEach(function(l,v){this.append(v,l)},this):Array.isArray(a)?a.forEach(function(l){this.append(l[0],l[1])},this):a&&Object.getOwnPropertyNames(a).forEach(function(l){this.append(l,a[l])},this)}y.prototype.append=function(a,l){a=E(a),l=g(l);var v=this.map[a];this.map[a]=v?v+", "+l:l},y.prototype.delete=function(a){delete this.map[E(a)]},y.prototype.get=function(a){return a=E(a),this.has(a)?this.map[a]:null},y.prototype.has=function(a){return this.map.hasOwnProperty(E(a))},y.prototype.set=function(a,l){this.map[E(a)]=g(l)},y.prototype.forEach=function(a,l){for(var v in this.map)this.map.hasOwnProperty(v)&&a.call(l,this.map[v],v,this)},y.prototype.keys=function(){var a=[];return this.forEach(function(l,v){a.push(v)}),A(a)},y.prototype.values=function(){var a=[];return this.forEach(function(l){a.push(l)}),A(a)},y.prototype.entries=function(){var a=[];return this.forEach(function(l,v){a.push([v,l])}),A(a)},u.iterable&&(y.prototype[Symbol.iterator]=y.prototype.entries);function N(a){if(a.bodyUsed)return Promise.reject(new TypeError("Already read"));a.bodyUsed=!0}function D(a){return new Promise(function(l,v){a.onload=function(){l(a.result)},a.onerror=function(){v(a.error)}})}function k(a){var l=new FileReader,v=D(l);return l.readAsArrayBuffer(a),v}function oe(a){var l=new FileReader,v=D(l);return l.readAsText(a),v}function P(a){for(var l=new Uint8Array(a),v=new Array(l.length),O=0;O<l.length;O++)v[O]=String.fromCharCode(l[O]);return v.join("")}function w(a){if(a.slice)return a.slice(0);var l=new Uint8Array(a.byteLength);return l.set(new Uint8Array(a)),l.buffer}function G(){return this.bodyUsed=!1,this._initBody=function(a){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=w(a.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(a)||m(a))?this._bodyArrayBuffer=w(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"))},u.blob&&(this.blob=function(){var a=N(this);if(a)return a;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?N(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(k)}),this.text=function(){var a=N(this);if(a)return a;if(this._bodyBlob)return oe(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(P(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},u.formData&&(this.formData=function(){return this.text().then(ln)}),this.json=function(){return this.text().then(JSON.parse)},this}var ae=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function ce(a){var l=a.toUpperCase();return ae.indexOf(l)>-1?l:a}function U(a,l){l=l||{};var v=l.body;if(a instanceof U){if(a.bodyUsed)throw new TypeError("Already read");this.url=a.url,this.credentials=a.credentials,l.headers||(this.headers=new y(a.headers)),this.method=a.method,this.mode=a.mode,this.signal=a.signal,!v&&a._bodyInit!=null&&(v=a._bodyInit,a.bodyUsed=!0)}else this.url=String(a);if(this.credentials=l.credentials||this.credentials||"same-origin",(l.headers||!this.headers)&&(this.headers=new y(l.headers)),this.method=ce(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")&&v)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(v)}U.prototype.clone=function(){return new U(this,{body:this._bodyInit})};function ln(a){var l=new FormData;return a.trim().split("&").forEach(function(v){if(v){var O=v.split("="),I=O.shift().replace(/\+/g," "),C=O.join("=").replace(/\+/g," ");l.append(decodeURIComponent(I),decodeURIComponent(C))}}),l}function dn(a){var l=new y,v=a.replace(/\r?\n[\t ]+/g," ");return v.split(/\r?\n/).forEach(function(O){var I=O.split(":"),C=I.shift().trim();if(C){var ue=I.join(":").trim();l.append(C,ue)}}),l}G.call(U.prototype);function L(a,l){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 y(l.headers),this.url=l.url||"",this._initBody(a)}G.call(L.prototype),L.prototype.clone=function(){return new L(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new y(this.headers),url:this.url})},L.error=function(){var a=new L(null,{status:0,statusText:""});return a.type="error",a};var hn=[301,302,303,307,308];L.redirect=function(a,l){if(hn.indexOf(l)===-1)throw new RangeError("Invalid status code");return new L(null,{status:l,headers:{location:a}})},o.DOMException=s.DOMException;try{new o.DOMException}catch{o.DOMException=function(l,v){this.message=l,this.name=v;var O=Error(l);this.stack=O.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function Ce(a,l){return new Promise(function(v,O){var I=new U(a,l);if(I.signal&&I.signal.aborted)return O(new o.DOMException("Aborted","AbortError"));var C=new XMLHttpRequest;function ue(){C.abort()}C.onload=function(){var J={status:C.status,statusText:C.statusText,headers:dn(C.getAllResponseHeaders()||"")};J.url="responseURL"in C?C.responseURL:J.headers.get("X-Request-URL");var Ae="response"in C?C.response:C.responseText;v(new L(Ae,J))},C.onerror=function(){O(new TypeError("Network request failed"))},C.ontimeout=function(){O(new TypeError("Network request failed"))},C.onabort=function(){O(new o.DOMException("Aborted","AbortError"))},C.open(I.method,I.url,!0),I.credentials==="include"?C.withCredentials=!0:I.credentials==="omit"&&(C.withCredentials=!1),"responseType"in C&&u.blob&&(C.responseType="blob"),I.headers.forEach(function(J,Ae){C.setRequestHeader(Ae,J)}),I.signal&&(I.signal.addEventListener("abort",ue),C.onreadystatechange=function(){C.readyState===4&&I.signal.removeEventListener("abort",ue)}),C.send(typeof I._bodyInit>"u"?null:I._bodyInit)})}return Ce.polyfill=!0,s.fetch||(s.fetch=Ce,s.Headers=y,s.Request=U,s.Response=L),o.Headers=y,o.Request=U,o.Response=L,o.fetch=Ce,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var r=i;t=r.fetch,t.default=r.fetch,t.fetch=r.fetch,t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response,e.exports=t})(Ee,Ee.exports);var te=Ee.exports;const ne=Bt(te),Mt=_({__proto__:null,default:ne},[te]),j=e=>{let t={};return e&&(typeof Headers<"u"&&e instanceof Headers||Mt&&te.Headers&&e instanceof te.Headers?t=He(e):Array.isArray(e)?e.forEach(([n,i])=>{n&&i!==void 0&&(t[n]=i)}):t=e),t},qe=e=>e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),Ut=e=>{if(!Array.isArray(e.query)){const i=e,r=[`query=${encodeURIComponent(qe(i.query))}`];return e.variables&&r.push(`variables=${encodeURIComponent(i.jsonSerializer.stringify(i.variables))}`),i.operationName&&r.push(`operationName=${encodeURIComponent(i.operationName)}`),r.join("&")}if(typeof e.variables<"u"&&!Array.isArray(e.variables))throw new Error("Cannot create query with given variable type, array expected");const t=e,n=e.query.reduce((i,r,s)=>(i.push({query:qe(r),variables:t.variables?t.jsonSerializer.stringify(t.variables[s]):void 0}),i),[]);return`query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`},qt=e=>async t=>{const{url:n,query:i,variables:r,operationName:s,fetch:o,fetchOptions:u,middleware:h}=t,p={...t.headers};let m="",E;e==="POST"?(E=jt(i,r,s,u.jsonSerializer),typeof E=="string"&&(p["Content-Type"]="application/json")):m=Ut({query:i,variables:r,operationName:s,jsonSerializer:u.jsonSerializer??F});const g={method:e,headers:p,body:E,...u};let A=n,y=g;if(h){const N=await Promise.resolve(h({...g,url:n,operationName:s,variables:r})),{url:D,...k}=N;A=D,y=k}return m&&(A=`${A}?${m}`),await o(A,y)};class Vt{constructor(t,n={}){this.url=t,this.requestConfig=n,this.rawRequest=async(...i)=>{const[r,s,o]=i,u=ze(r,s,o),{headers:h,fetch:p=ne,method:m="POST",requestMiddleware:E,responseMiddleware:g,...A}=this.requestConfig,{url:y}=this;u.signal!==void 0&&(A.signal=u.signal);const{operationName:N}=ye(u.query);return ge({url:y,query:u.query,variables:u.variables,headers:{...j(ve(h)),...j(u.requestHeaders)},operationName:N,fetch:p,method:m,fetchOptions:A,middleware:E}).then(D=>(g&&g(D),D)).catch(D=>{throw g&&g(D),D})}}async request(t,...n){const[i,r]=n,s=Ye(t,i,r),{headers:o,fetch:u=ne,method:h="POST",requestMiddleware:p,responseMiddleware:m,...E}=this.requestConfig,{url:g}=this;s.signal!==void 0&&(E.signal=s.signal);const{query:A,operationName:y}=ye(s.document);return ge({url:g,query:A,variables:s.variables,headers:{...j(ve(o)),...j(s.requestHeaders)},operationName:y,fetch:u,method:h,fetchOptions:E,middleware:p}).then(N=>(m&&m(N),N.data)).catch(N=>{throw m&&m(N),N})}batchRequests(t,n){const i=Qe(t,n),{headers:r,...s}=this.requestConfig;i.signal!==void 0&&(s.signal=i.signal);const o=i.documents.map(({document:h})=>ye(h).query),u=i.documents.map(({variables:h})=>h);return ge({url:this.url,query:o,variables:u,headers:{...j(ve(r)),...j(i.requestHeaders)},operationName:void 0,fetch:this.requestConfig.fetch??ne,method:this.requestConfig.method||"POST",fetchOptions:s,middleware:this.requestConfig.requestMiddleware}).then(h=>(this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(h),h.data)).catch(h=>{throw this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(h),h})}setHeaders(t){return this.requestConfig.headers=t,this}setHeader(t,n){const{headers:i}=this.requestConfig;return i?i[t]=n:this.requestConfig.headers={[t]:n},this}setEndpoint(t){return this.url=t,this}}const ge=async e=>{const{query:t,variables:n,fetchOptions:i}=e,r=qt(Ge(e.method??"post")),s=Array.isArray(e.query),o=await r(e),u=await $t(o,i.jsonSerializer??F),h=Array.isArray(u)?!u.some(({data:m})=>!m):!!u.data,p=Array.isArray(u)||!u.errors||Array.isArray(u.errors)&&!u.errors.length||i.errorPolicy==="all"||i.errorPolicy==="ignore";if(o.ok&&p&&h){const{errors:m,...E}=(Array.isArray(u),u),g=i.errorPolicy==="ignore"?E:u;return{...s?{data:g}:g,headers:o.headers,status:o.status}}else{const m=typeof u=="string"?{error:u}:u;throw new z({...m,status:o.status,headers:o.headers},{query:t,variables:n})}},jt=(e,t,n,i)=>{const r=i??F;if(!Array.isArray(e))return r.stringify({query:e,variables:t,operationName:n});if(typeof t<"u"&&!Array.isArray(t))throw new Error("Cannot create request body with given variable type, array expected");const s=e.reduce((o,u,h)=>(o.push({query:u,variables:t?t[h]:void 0}),o),[]);return r.stringify(s)},$t=async(e,t)=>{let n;return e.headers.forEach((i,r)=>{r.toLowerCase()==="content-type"&&(n=i)}),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()},ve=e=>typeof e=="function"?e():e;var re=function(){return re=Object.assign||function(t){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},re.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;var ie=new Map,Te=new Map,Ve=!0,se=!1;function je(e){return e.replace(/[\s,]+/g," ").trim()}function Gt(e){return je(e.source.body.substring(e.start,e.end))}function Ht(e){var t=new Set,n=[];return e.definitions.forEach(function(i){if(i.kind==="FragmentDefinition"){var r=i.name.value,s=Gt(i.loc),o=Te.get(r);o&&!o.has(s)?Ve&&console.warn("Warning: fragment with name "+r+` already exists.
49
+ `)))!==null&&t!==void 0?t:!1}const Ue=e=>{var i,r;let t;const n=e.definitions.filter(s=>s.kind==="OperationDefinition");return n.length===1&&(t=(r=(i=n[0])==null?void 0:i.name)==null?void 0:r.value),t},ye=e=>{if(typeof e=="string"){let n;try{const i=Fe(e);n=Ue(i)}catch{}return{query:e,operationName:n}}const t=Ue(e);return{query:wt(e),operationName:t}};class z extends Error{constructor(t,n){const i=`${z.extractMessage(t)}: ${JSON.stringify({response:t,request:n})}`;super(i),Object.setPrototypeOf(this,z.prototype),this.response=t,this.request=n,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,z)}static extractMessage(t){var n,i;return((i=(n=t.errors)==null?void 0:n[0])==null?void 0:i.message)??`GraphQL Error (Code: ${t.status})`}}var Ft=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Bt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ee={exports:{}};(function(e,t){var n=typeof self<"u"?self:Ft,i=function(){function s(){this.fetch=!1,this.DOMException=n.DOMException}return s.prototype=n,new s}();(function(s){(function(o){var u={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function h(a){return a&&DataView.prototype.isPrototypeOf(a)}if(u.arrayBuffer)var p=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],m=ArrayBuffer.isView||function(a){return a&&p.indexOf(Object.prototype.toString.call(a))>-1};function E(a){if(typeof a!="string"&&(a=String(a)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(a))throw new TypeError("Invalid character in header field name");return a.toLowerCase()}function g(a){return typeof a!="string"&&(a=String(a)),a}function A(a){var l={next:function(){var v=a.shift();return{done:v===void 0,value:v}}};return u.iterable&&(l[Symbol.iterator]=function(){return l}),l}function y(a){this.map={},a instanceof y?a.forEach(function(l,v){this.append(v,l)},this):Array.isArray(a)?a.forEach(function(l){this.append(l[0],l[1])},this):a&&Object.getOwnPropertyNames(a).forEach(function(l){this.append(l,a[l])},this)}y.prototype.append=function(a,l){a=E(a),l=g(l);var v=this.map[a];this.map[a]=v?v+", "+l:l},y.prototype.delete=function(a){delete this.map[E(a)]},y.prototype.get=function(a){return a=E(a),this.has(a)?this.map[a]:null},y.prototype.has=function(a){return this.map.hasOwnProperty(E(a))},y.prototype.set=function(a,l){this.map[E(a)]=g(l)},y.prototype.forEach=function(a,l){for(var v in this.map)this.map.hasOwnProperty(v)&&a.call(l,this.map[v],v,this)},y.prototype.keys=function(){var a=[];return this.forEach(function(l,v){a.push(v)}),A(a)},y.prototype.values=function(){var a=[];return this.forEach(function(l){a.push(l)}),A(a)},y.prototype.entries=function(){var a=[];return this.forEach(function(l,v){a.push([v,l])}),A(a)},u.iterable&&(y.prototype[Symbol.iterator]=y.prototype.entries);function N(a){if(a.bodyUsed)return Promise.reject(new TypeError("Already read"));a.bodyUsed=!0}function O(a){return new Promise(function(l,v){a.onload=function(){l(a.result)},a.onerror=function(){v(a.error)}})}function k(a){var l=new FileReader,v=O(l);return l.readAsArrayBuffer(a),v}function oe(a){var l=new FileReader,v=O(l);return l.readAsText(a),v}function P(a){for(var l=new Uint8Array(a),v=new Array(l.length),D=0;D<l.length;D++)v[D]=String.fromCharCode(l[D]);return v.join("")}function w(a){if(a.slice)return a.slice(0);var l=new Uint8Array(a.byteLength);return l.set(new Uint8Array(a)),l.buffer}function $(){return this.bodyUsed=!1,this._initBody=function(a){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=w(a.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(a)||m(a))?this._bodyArrayBuffer=w(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"))},u.blob&&(this.blob=function(){var a=N(this);if(a)return a;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?N(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(k)}),this.text=function(){var a=N(this);if(a)return a;if(this._bodyBlob)return oe(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(P(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},u.formData&&(this.formData=function(){return this.text().then(dn)}),this.json=function(){return this.text().then(JSON.parse)},this}var ae=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function ce(a){var l=a.toUpperCase();return ae.indexOf(l)>-1?l:a}function U(a,l){l=l||{};var v=l.body;if(a instanceof U){if(a.bodyUsed)throw new TypeError("Already read");this.url=a.url,this.credentials=a.credentials,l.headers||(this.headers=new y(a.headers)),this.method=a.method,this.mode=a.mode,this.signal=a.signal,!v&&a._bodyInit!=null&&(v=a._bodyInit,a.bodyUsed=!0)}else this.url=String(a);if(this.credentials=l.credentials||this.credentials||"same-origin",(l.headers||!this.headers)&&(this.headers=new y(l.headers)),this.method=ce(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")&&v)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(v)}U.prototype.clone=function(){return new U(this,{body:this._bodyInit})};function dn(a){var l=new FormData;return a.trim().split("&").forEach(function(v){if(v){var D=v.split("="),I=D.shift().replace(/\+/g," "),T=D.join("=").replace(/\+/g," ");l.append(decodeURIComponent(I),decodeURIComponent(T))}}),l}function hn(a){var l=new y,v=a.replace(/\r?\n[\t ]+/g," ");return v.split(/\r?\n/).forEach(function(D){var I=D.split(":"),T=I.shift().trim();if(T){var ue=I.join(":").trim();l.append(T,ue)}}),l}$.call(U.prototype);function L(a,l){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 y(l.headers),this.url=l.url||"",this._initBody(a)}$.call(L.prototype),L.prototype.clone=function(){return new L(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new y(this.headers),url:this.url})},L.error=function(){var a=new L(null,{status:0,statusText:""});return a.type="error",a};var pn=[301,302,303,307,308];L.redirect=function(a,l){if(pn.indexOf(l)===-1)throw new RangeError("Invalid status code");return new L(null,{status:l,headers:{location:a}})},o.DOMException=s.DOMException;try{new o.DOMException}catch{o.DOMException=function(l,v){this.message=l,this.name=v;var D=Error(l);this.stack=D.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function Te(a,l){return new Promise(function(v,D){var I=new U(a,l);if(I.signal&&I.signal.aborted)return D(new o.DOMException("Aborted","AbortError"));var T=new XMLHttpRequest;function ue(){T.abort()}T.onload=function(){var J={status:T.status,statusText:T.statusText,headers:hn(T.getAllResponseHeaders()||"")};J.url="responseURL"in T?T.responseURL:J.headers.get("X-Request-URL");var Ae="response"in T?T.response:T.responseText;v(new L(Ae,J))},T.onerror=function(){D(new TypeError("Network request failed"))},T.ontimeout=function(){D(new TypeError("Network request failed"))},T.onabort=function(){D(new o.DOMException("Aborted","AbortError"))},T.open(I.method,I.url,!0),I.credentials==="include"?T.withCredentials=!0:I.credentials==="omit"&&(T.withCredentials=!1),"responseType"in T&&u.blob&&(T.responseType="blob"),I.headers.forEach(function(J,Ae){T.setRequestHeader(Ae,J)}),I.signal&&(I.signal.addEventListener("abort",ue),T.onreadystatechange=function(){T.readyState===4&&I.signal.removeEventListener("abort",ue)}),T.send(typeof I._bodyInit>"u"?null:I._bodyInit)})}return Te.polyfill=!0,s.fetch||(s.fetch=Te,s.Headers=y,s.Request=U,s.Response=L),o.Headers=y,o.Request=U,o.Response=L,o.fetch=Te,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var r=i;t=r.fetch,t.default=r.fetch,t.fetch=r.fetch,t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response,e.exports=t})(Ee,Ee.exports);var te=Ee.exports;const ne=Bt(te),Mt=_({__proto__:null,default:ne},[te]),j=e=>{let t={};return e&&(typeof Headers<"u"&&e instanceof Headers||Mt&&te.Headers&&e instanceof te.Headers?t=He(e):Array.isArray(e)?e.forEach(([n,i])=>{n&&i!==void 0&&(t[n]=i)}):t=e),t},qe=e=>e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),Ut=e=>{if(!Array.isArray(e.query)){const i=e,r=[`query=${encodeURIComponent(qe(i.query))}`];return e.variables&&r.push(`variables=${encodeURIComponent(i.jsonSerializer.stringify(i.variables))}`),i.operationName&&r.push(`operationName=${encodeURIComponent(i.operationName)}`),r.join("&")}if(typeof e.variables<"u"&&!Array.isArray(e.variables))throw new Error("Cannot create query with given variable type, array expected");const t=e,n=e.query.reduce((i,r,s)=>(i.push({query:qe(r),variables:t.variables?t.jsonSerializer.stringify(t.variables[s]):void 0}),i),[]);return`query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`},qt=e=>async t=>{const{url:n,query:i,variables:r,operationName:s,fetch:o,fetchOptions:u,middleware:h}=t,p={...t.headers};let m="",E;e==="POST"?(E=jt(i,r,s,u.jsonSerializer),typeof E=="string"&&(p["Content-Type"]="application/json")):m=Ut({query:i,variables:r,operationName:s,jsonSerializer:u.jsonSerializer??F});const g={method:e,headers:p,body:E,...u};let A=n,y=g;if(h){const N=await Promise.resolve(h({...g,url:n,operationName:s,variables:r})),{url:O,...k}=N;A=O,y=k}return m&&(A=`${A}?${m}`),await o(A,y)};class Vt{constructor(t,n={}){this.url=t,this.requestConfig=n,this.rawRequest=async(...i)=>{const[r,s,o]=i,u=ze(r,s,o),{headers:h,fetch:p=ne,method:m="POST",requestMiddleware:E,responseMiddleware:g,...A}=this.requestConfig,{url:y}=this;u.signal!==void 0&&(A.signal=u.signal);const{operationName:N}=ye(u.query);return ge({url:y,query:u.query,variables:u.variables,headers:{...j(ve(h)),...j(u.requestHeaders)},operationName:N,fetch:p,method:m,fetchOptions:A,middleware:E}).then(O=>(g&&g(O),O)).catch(O=>{throw g&&g(O),O})}}async request(t,...n){const[i,r]=n,s=Ye(t,i,r),{headers:o,fetch:u=ne,method:h="POST",requestMiddleware:p,responseMiddleware:m,...E}=this.requestConfig,{url:g}=this;s.signal!==void 0&&(E.signal=s.signal);const{query:A,operationName:y}=ye(s.document);return ge({url:g,query:A,variables:s.variables,headers:{...j(ve(o)),...j(s.requestHeaders)},operationName:y,fetch:u,method:h,fetchOptions:E,middleware:p}).then(N=>(m&&m(N),N.data)).catch(N=>{throw m&&m(N),N})}batchRequests(t,n){const i=Qe(t,n),{headers:r,...s}=this.requestConfig;i.signal!==void 0&&(s.signal=i.signal);const o=i.documents.map(({document:h})=>ye(h).query),u=i.documents.map(({variables:h})=>h);return ge({url:this.url,query:o,variables:u,headers:{...j(ve(r)),...j(i.requestHeaders)},operationName:void 0,fetch:this.requestConfig.fetch??ne,method:this.requestConfig.method||"POST",fetchOptions:s,middleware:this.requestConfig.requestMiddleware}).then(h=>(this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(h),h.data)).catch(h=>{throw this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(h),h})}setHeaders(t){return this.requestConfig.headers=t,this}setHeader(t,n){const{headers:i}=this.requestConfig;return i?i[t]=n:this.requestConfig.headers={[t]:n},this}setEndpoint(t){return this.url=t,this}}const ge=async e=>{const{query:t,variables:n,fetchOptions:i}=e,r=qt($e(e.method??"post")),s=Array.isArray(e.query),o=await r(e),u=await Gt(o,i.jsonSerializer??F),h=Array.isArray(u)?!u.some(({data:m})=>!m):!!u.data,p=Array.isArray(u)||!u.errors||Array.isArray(u.errors)&&!u.errors.length||i.errorPolicy==="all"||i.errorPolicy==="ignore";if(o.ok&&p&&h){const{errors:m,...E}=(Array.isArray(u),u),g=i.errorPolicy==="ignore"?E:u;return{...s?{data:g}:g,headers:o.headers,status:o.status}}else{const m=typeof u=="string"?{error:u}:u;throw new z({...m,status:o.status,headers:o.headers},{query:t,variables:n})}},jt=(e,t,n,i)=>{const r=i??F;if(!Array.isArray(e))return r.stringify({query:e,variables:t,operationName:n});if(typeof t<"u"&&!Array.isArray(t))throw new Error("Cannot create request body with given variable type, array expected");const s=e.reduce((o,u,h)=>(o.push({query:u,variables:t?t[h]:void 0}),o),[]);return r.stringify(s)},Gt=async(e,t)=>{let n;return e.headers.forEach((i,r)=>{r.toLowerCase()==="content-type"&&(n=i)}),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()},ve=e=>typeof e=="function"?e():e;var re=function(){return re=Object.assign||function(t){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},re.apply(this,arguments)};typeof SuppressedError=="function"&&SuppressedError;var ie=new Map,Ce=new Map,Ve=!0,se=!1;function je(e){return e.replace(/[\s,]+/g," ").trim()}function $t(e){return je(e.source.body.substring(e.start,e.end))}function Ht(e){var t=new Set,n=[];return e.definitions.forEach(function(i){if(i.kind==="FragmentDefinition"){var r=i.name.value,s=$t(i.loc),o=Ce.get(r);o&&!o.has(s)?Ve&&console.warn("Warning: fragment with name "+r+` already exists.
50
50
  graphql-tag enforces all fragment names across your application to be unique; read more about
51
- this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||Te.set(r,o=new Set),o.add(s),t.has(s)||(t.add(s),n.push(i))}else n.push(i)}),re(re({},e),{definitions:n})}function Yt(e){var t=new Set(e.definitions);t.forEach(function(i){i.loc&&delete i.loc,Object.keys(i).forEach(function(r){var s=i[r];s&&typeof s=="object"&&t.add(s)})});var n=e.loc;return n&&(delete n.startToken,delete n.endToken),e}function zt(e){var t=je(e);if(!ie.has(t)){var n=Fe(e,{experimentalFragmentVariables:se,allowLegacyFragmentVariables:se});if(!n||n.kind!=="Document")throw new Error("Not a valid GraphQL document.");ie.set(t,Yt(Ht(n)))}return ie.get(t)}function $(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];typeof e=="string"&&(e=[e]);var i=e[0];return t.forEach(function(r,s){r&&r.kind==="Document"?i+=r.loc.source.body:i+=r,i+=e[s+1]}),zt(i)}function Qt(){ie.clear(),Te.clear()}function Jt(){Ve=!1}function Xt(){se=!0}function Wt(){se=!1}var Q={gql:$,resetCaches:Qt,disableFragmentWarnings:Jt,enableExperimentalFragmentVariables:Xt,disableExperimentalFragmentVariables:Wt};(function(e){e.gql=Q.gql,e.resetCaches=Q.resetCaches,e.disableFragmentWarnings=Q.disableFragmentWarnings,e.enableExperimentalFragmentVariables=Q.enableExperimentalFragmentVariables,e.disableExperimentalFragmentVariables=Q.disableExperimentalFragmentVariables})($||($={})),$.default=$;const B=$,Zt=B`
51
+ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||Ce.set(r,o=new Set),o.add(s),t.has(s)||(t.add(s),n.push(i))}else n.push(i)}),re(re({},e),{definitions:n})}function Yt(e){var t=new Set(e.definitions);t.forEach(function(i){i.loc&&delete i.loc,Object.keys(i).forEach(function(r){var s=i[r];s&&typeof s=="object"&&t.add(s)})});var n=e.loc;return n&&(delete n.startToken,delete n.endToken),e}function zt(e){var t=je(e);if(!ie.has(t)){var n=Fe(e,{experimentalFragmentVariables:se,allowLegacyFragmentVariables:se});if(!n||n.kind!=="Document")throw new Error("Not a valid GraphQL document.");ie.set(t,Yt(Ht(n)))}return ie.get(t)}function G(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];typeof e=="string"&&(e=[e]);var i=e[0];return t.forEach(function(r,s){r&&r.kind==="Document"?i+=r.loc.source.body:i+=r,i+=e[s+1]}),zt(i)}function Qt(){ie.clear(),Ce.clear()}function Jt(){Ve=!1}function Xt(){se=!0}function Wt(){se=!1}var Q={gql:G,resetCaches:Qt,disableFragmentWarnings:Jt,enableExperimentalFragmentVariables:Xt,disableExperimentalFragmentVariables:Wt};(function(e){e.gql=Q.gql,e.resetCaches=Q.resetCaches,e.disableFragmentWarnings=Q.disableFragmentWarnings,e.enableExperimentalFragmentVariables=Q.enableExperimentalFragmentVariables,e.disableExperimentalFragmentVariables=Q.disableExperimentalFragmentVariables})(G||(G={})),G.default=G;const B=G,Zt=B`
52
52
  query GetLocationAvailabilities($sku: String!, $first: Int, $after: String, $isReverse: Boolean! = false) {
53
53
  locationAvailabilities(
54
54
  sku: $sku
@@ -165,6 +165,7 @@ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o
165
165
  status
166
166
  description
167
167
  code
168
+ customerApplicable
168
169
  startsAt
169
170
  endsAt
170
171
  createdAt
@@ -180,6 +181,13 @@ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o
180
181
  }
181
182
  }
182
183
  `,sn=B`
184
+ query GetPurchasingCustomerDiscountCodeCount {
185
+ purchasingCustomer {
186
+ id
187
+ discountCodeCount
188
+ }
189
+ }
190
+ `,on=B`
183
191
  query GetPurchasingCustomerPointChangeActivities($first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: PointChangeActivitySortKey! = CREATED_AT) {
184
192
  purchasingCustomer {
185
193
  id
@@ -211,7 +219,7 @@ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o
211
219
  }
212
220
  }
213
221
  }
214
- `,on=B`
222
+ `,an=B`
215
223
  query GetPurchasingCustomerRank {
216
224
  purchasingCustomer {
217
225
  currentCustomerRank {
@@ -250,4 +258,4 @@ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o
250
258
  }
251
259
  }
252
260
  }
253
- `,an=(e,t,n,i)=>e();function cn(e,t=an){return{GetLocationAvailabilities(n,i){return t(r=>e.request(Zt,n,{...i,...r}),"GetLocationAvailabilities","query",n)},GetLocationAvailability(n,i){return t(r=>e.request(Kt,n,{...i,...r}),"GetLocationAvailability","query",n)},GetPurchasingCustomerMetafield(n,i){return t(r=>e.request(en,n,{...i,...r}),"GetPurchasingCustomerMetafield","query",n)},GetPoints(n,i){return t(r=>e.request(tn,n,{...i,...r}),"GetPoints","query",n)},GetLocations(n,i){return t(r=>e.request(nn,n,{...i,...r}),"GetLocations","query",n)},GetPurchasingCustomerDiscounts(n,i){return t(r=>e.request(rn,n,{...i,...r}),"GetPurchasingCustomerDiscounts","query",n)},GetPurchasingCustomerPointChangeActivities(n,i){return t(r=>e.request(sn,n,{...i,...r}),"GetPurchasingCustomerPointChangeActivities","query",n)},GetPurchasingCustomerRank(n,i){return t(r=>e.request(on,n,{...i,...r}),"GetPurchasingCustomerRank","query",n)}}}class un{constructor(t){$e(this,"api");this.api=cn(new Vt(`${t}/apps/sq-api`,{headers:{"X-SQ-CLIENT":"ShopifyAppProxy"}}))}async getLocationAvailabilities(t,n,i,r){const s=await this.api.GetLocationAvailabilities({sku:t,first:n,after:i,isReverse:r});return{nodes:s.locationAvailabilities.nodes.map(o=>({location:{id:o.location.id,name:o.location.name,phone:o.location.phone,address:o.location.address?{id:o.location.address.id,countryCode:o.location.address.countryCode,country:o.location.address.country,postalCode:o.location.address.postalCode,provinceCode:o.location.address.provinceCode,province:o.location.address.province,city:o.location.address.city,address1:o.location.address.address1,address2:o.location.address.address2}:void 0},inventoryQuantity:o.inventoryQuantity}))??[],pageInfo:s.locationAvailabilities.pageInfo??null}}async getLocationAvailability(t,n){const i=await this.api.GetLocationAvailability({sku:t,locationID:n});return{location:{id:i.locationAvailability.location.id,name:i.locationAvailability.location.name,phone:i.locationAvailability.location.phone,address:i.locationAvailability.location.address?{id:i.locationAvailability.location.address.id,countryCode:i.locationAvailability.location.address.countryCode,country:i.locationAvailability.location.address.country,postalCode:i.locationAvailability.location.address.postalCode,provinceCode:i.locationAvailability.location.address.provinceCode,province:i.locationAvailability.location.address.province,city:i.locationAvailability.location.address.city,address1:i.locationAvailability.location.address.address1,address2:i.locationAvailability.location.address.address2}:void 0},inventoryQuantity:i.locationAvailability.inventoryQuantity}}async getPurchasingCustomerMetafield(t,n){return(await this.api.GetPurchasingCustomerMetafield({namespace:t,key:n})).purchasingCustomerMetafield??null}async getPoints(){const t=await this.api.GetPoints();return t.purchasingCustomer?{pointsApproved:t.purchasingCustomer.pointsApproved,pointsPending:t.purchasingCustomer.pointsPending}:null}async getLocations(t,n,i){const r=await this.api.GetLocations({first:t,after:n,isReverse:i});return{nodes:r.locations.nodes.map(s=>({id:s.id,name:s.name,phone:s.phone,address:s.address?{id:s.address.id,countryCode:s.address.countryCode,country:s.address.country,postalCode:s.address.postalCode,provinceCode:s.address.provinceCode,province:s.address.province,city:s.address.city,address1:s.address.address1,address2:s.address.address2}:void 0}))??[],pageInfo:r.locations.pageInfo??null}}async getPurchasingCustomerDiscounts(t,n,i){const r=await this.api.GetPurchasingCustomerDiscounts({first:t,after:n,isReverse:i});return r.purchasingCustomer?{id:r.purchasingCustomer.id,nodes:r.purchasingCustomer.discounts.nodes.map(s=>({id:s.id,title:s.title,status:s.status,description:s.description,code:s.code,startsAt:new Date(s.startsAt),endsAt:new Date(s.endsAt),createdAt:new Date(s.createdAt),updatedAt:new Date(s.updatedAt)}))??[],pageInfo:r.purchasingCustomer.discounts.pageInfo??null}:null}async getPointChangeActivities(t,n,i,r){const s=await this.api.GetPurchasingCustomerPointChangeActivities({first:t,after:n,isReverse:i,sortKeys:r});return s.purchasingCustomer?{nodes:s.purchasingCustomer.pointChangeActivities.nodes.map(o=>({id:o.id,title:o.title,pointChange:{id:o.pointChange.id,delta:o.pointChange.delta,availableAt:o.pointChange.availableAt?new Date(o.pointChange.availableAt):void 0,availableUntil:o.pointChange.availableUntil?new Date(o.pointChange.availableUntil):void 0,expiresDate:o.pointChange.expiresDate?new Date(o.pointChange.expiresDate):void 0,pointChangeCreatedAt:new Date(o.pointChange.pointChangeCreatedAt),createdAt:new Date(o.pointChange.createdAt)}})),pageInfo:s.purchasingCustomer.pointChangeActivities.pageInfo}:null}async getPurchasingCustomerCurrentRank(){var n;const t=await this.api.GetPurchasingCustomerRank();return(n=t.purchasingCustomer)!=null&&n.currentCustomerRank?{id:t.purchasingCustomer.currentCustomerRank.id,name:t.purchasingCustomer.currentCustomerRank.name,calculationCondition:{customerRankCalculationPeriod:t.purchasingCustomer.currentCustomerRank.calculationCondition.customerRankCalculationPeriod?{start:new Date(t.purchasingCustomer.currentCustomerRank.calculationCondition.customerRankCalculationPeriod.start),end:new Date(t.purchasingCustomer.currentCustomerRank.calculationCondition.customerRankCalculationPeriod.end)}:void 0,earnedPoint:t.purchasingCustomer.currentCustomerRank.calculationCondition.earnedPoint,purchasePrice:t.purchasingCustomer.currentCustomerRank.calculationCondition.purchasePrice},earnedPointToRankUp:t.purchasingCustomer.currentCustomerRank.earnedPointToRankUp,higherRank:t.purchasingCustomer.currentCustomerRank.higherRank?{id:t.purchasingCustomer.currentCustomerRank.higherRank.id,name:t.purchasingCustomer.currentCustomerRank.higherRank.name,threshold:t.purchasingCustomer.currentCustomerRank.higherRank.threshold}:void 0,lowerRank:t.purchasingCustomer.currentCustomerRank.lowerRank?{id:t.purchasingCustomer.currentCustomerRank.lowerRank.id,name:t.purchasingCustomer.currentCustomerRank.lowerRank.name,threshold:t.purchasingCustomer.currentCustomerRank.lowerRank.threshold}:void 0,purchasePriceToRankUp:t.purchasingCustomer.currentCustomerRank.purchasePriceToRankUp,threshold:t.purchasingCustomer.currentCustomerRank.threshold,pointMultiplier:t.purchasingCustomer.currentCustomerRank.pointMultiplier?{id:t.purchasingCustomer.currentCustomerRank.pointMultiplier.id,customerRankRule:{id:t.purchasingCustomer.currentCustomerRank.pointMultiplier.customerRankRule.id,name:t.purchasingCustomer.currentCustomerRank.pointMultiplier.customerRankRule.name,threshold:t.purchasingCustomer.currentCustomerRank.pointMultiplier.customerRankRule.threshold},multiplier:t.purchasingCustomer.currentCustomerRank.pointMultiplier.multiplier}:void 0}:null}}R.SDK=un,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
261
+ `,cn=(e,t,n,i)=>e();function un(e,t=cn){return{GetLocationAvailabilities(n,i){return t(r=>e.request(Zt,n,{...i,...r}),"GetLocationAvailabilities","query",n)},GetLocationAvailability(n,i){return t(r=>e.request(Kt,n,{...i,...r}),"GetLocationAvailability","query",n)},GetPurchasingCustomerMetafield(n,i){return t(r=>e.request(en,n,{...i,...r}),"GetPurchasingCustomerMetafield","query",n)},GetPoints(n,i){return t(r=>e.request(tn,n,{...i,...r}),"GetPoints","query",n)},GetLocations(n,i){return t(r=>e.request(nn,n,{...i,...r}),"GetLocations","query",n)},GetPurchasingCustomerDiscounts(n,i){return t(r=>e.request(rn,n,{...i,...r}),"GetPurchasingCustomerDiscounts","query",n)},GetPurchasingCustomerDiscountCodeCount(n,i){return t(r=>e.request(sn,n,{...i,...r}),"GetPurchasingCustomerDiscountCodeCount","query",n)},GetPurchasingCustomerPointChangeActivities(n,i){return t(r=>e.request(on,n,{...i,...r}),"GetPurchasingCustomerPointChangeActivities","query",n)},GetPurchasingCustomerRank(n,i){return t(r=>e.request(an,n,{...i,...r}),"GetPurchasingCustomerRank","query",n)}}}class ln{constructor(t){Ge(this,"api");this.api=un(new Vt(`${t}/apps/sq-api`,{headers:{"X-SQ-CLIENT":"ShopifyAppProxy"}}))}async getLocationAvailabilities(t,n,i,r){const s=await this.api.GetLocationAvailabilities({sku:t,first:n,after:i,isReverse:r});return{nodes:s.locationAvailabilities.nodes.map(o=>({location:{id:o.location.id,name:o.location.name,phone:o.location.phone,address:o.location.address?{id:o.location.address.id,countryCode:o.location.address.countryCode,country:o.location.address.country,postalCode:o.location.address.postalCode,provinceCode:o.location.address.provinceCode,province:o.location.address.province,city:o.location.address.city,address1:o.location.address.address1,address2:o.location.address.address2}:void 0},inventoryQuantity:o.inventoryQuantity}))??[],pageInfo:s.locationAvailabilities.pageInfo??null}}async getLocationAvailability(t,n){const i=await this.api.GetLocationAvailability({sku:t,locationID:n});return{location:{id:i.locationAvailability.location.id,name:i.locationAvailability.location.name,phone:i.locationAvailability.location.phone,address:i.locationAvailability.location.address?{id:i.locationAvailability.location.address.id,countryCode:i.locationAvailability.location.address.countryCode,country:i.locationAvailability.location.address.country,postalCode:i.locationAvailability.location.address.postalCode,provinceCode:i.locationAvailability.location.address.provinceCode,province:i.locationAvailability.location.address.province,city:i.locationAvailability.location.address.city,address1:i.locationAvailability.location.address.address1,address2:i.locationAvailability.location.address.address2}:void 0},inventoryQuantity:i.locationAvailability.inventoryQuantity}}async getPurchasingCustomerMetafield(t,n){return(await this.api.GetPurchasingCustomerMetafield({namespace:t,key:n})).purchasingCustomerMetafield??null}async getPoints(){const t=await this.api.GetPoints();return t.purchasingCustomer?{pointsApproved:t.purchasingCustomer.pointsApproved,pointsPending:t.purchasingCustomer.pointsPending}:null}async getLocations(t,n,i){const r=await this.api.GetLocations({first:t,after:n,isReverse:i});return{nodes:r.locations.nodes.map(s=>({id:s.id,name:s.name,phone:s.phone,address:s.address?{id:s.address.id,countryCode:s.address.countryCode,country:s.address.country,postalCode:s.address.postalCode,provinceCode:s.address.provinceCode,province:s.address.province,city:s.address.city,address1:s.address.address1,address2:s.address.address2}:void 0}))??[],pageInfo:r.locations.pageInfo??null}}async getPurchasingCustomerDiscounts(t,n,i){const r=await this.api.GetPurchasingCustomerDiscounts({first:t,after:n,isReverse:i});return r.purchasingCustomer?{id:r.purchasingCustomer.id,nodes:r.purchasingCustomer.discounts.nodes.map(s=>({id:s.id,title:s.title,status:s.status,description:s.description,code:s.code,customerApplicable:s.customerApplicable,startsAt:new Date(s.startsAt),endsAt:new Date(s.endsAt),createdAt:new Date(s.createdAt),updatedAt:new Date(s.updatedAt)}))??[],pageInfo:r.purchasingCustomer.discounts.pageInfo??null}:null}async getPointChangeActivities(t,n,i,r){const s=await this.api.GetPurchasingCustomerPointChangeActivities({first:t,after:n,isReverse:i,sortKeys:r});return s.purchasingCustomer?{nodes:s.purchasingCustomer.pointChangeActivities.nodes.map(o=>({id:o.id,title:o.title,pointChange:{id:o.pointChange.id,delta:o.pointChange.delta,availableAt:o.pointChange.availableAt?new Date(o.pointChange.availableAt):void 0,availableUntil:o.pointChange.availableUntil?new Date(o.pointChange.availableUntil):void 0,expiresDate:o.pointChange.expiresDate?new Date(o.pointChange.expiresDate):void 0,pointChangeCreatedAt:new Date(o.pointChange.pointChangeCreatedAt),createdAt:new Date(o.pointChange.createdAt)}})),pageInfo:s.purchasingCustomer.pointChangeActivities.pageInfo}:null}async getPurchasingCustomerCurrentRank(){var n;const t=await this.api.GetPurchasingCustomerRank();return(n=t.purchasingCustomer)!=null&&n.currentCustomerRank?{id:t.purchasingCustomer.currentCustomerRank.id,name:t.purchasingCustomer.currentCustomerRank.name,calculationCondition:{customerRankCalculationPeriod:t.purchasingCustomer.currentCustomerRank.calculationCondition.customerRankCalculationPeriod?{start:new Date(t.purchasingCustomer.currentCustomerRank.calculationCondition.customerRankCalculationPeriod.start),end:new Date(t.purchasingCustomer.currentCustomerRank.calculationCondition.customerRankCalculationPeriod.end)}:void 0,earnedPoint:t.purchasingCustomer.currentCustomerRank.calculationCondition.earnedPoint,purchasePrice:t.purchasingCustomer.currentCustomerRank.calculationCondition.purchasePrice},earnedPointToRankUp:t.purchasingCustomer.currentCustomerRank.earnedPointToRankUp,higherRank:t.purchasingCustomer.currentCustomerRank.higherRank?{id:t.purchasingCustomer.currentCustomerRank.higherRank.id,name:t.purchasingCustomer.currentCustomerRank.higherRank.name,threshold:t.purchasingCustomer.currentCustomerRank.higherRank.threshold}:void 0,lowerRank:t.purchasingCustomer.currentCustomerRank.lowerRank?{id:t.purchasingCustomer.currentCustomerRank.lowerRank.id,name:t.purchasingCustomer.currentCustomerRank.lowerRank.name,threshold:t.purchasingCustomer.currentCustomerRank.lowerRank.threshold}:void 0,purchasePriceToRankUp:t.purchasingCustomer.currentCustomerRank.purchasePriceToRankUp,threshold:t.purchasingCustomer.currentCustomerRank.threshold,pointMultiplier:t.purchasingCustomer.currentCustomerRank.pointMultiplier?{id:t.purchasingCustomer.currentCustomerRank.pointMultiplier.id,customerRankRule:{id:t.purchasingCustomer.currentCustomerRank.pointMultiplier.customerRankRule.id,name:t.purchasingCustomer.currentCustomerRank.pointMultiplier.customerRankRule.name,threshold:t.purchasingCustomer.currentCustomerRank.pointMultiplier.customerRankRule.threshold},multiplier:t.purchasingCustomer.currentCustomerRank.pointMultiplier.multiplier}:void 0}:null}async getPurchasingCustomerDiscountCodeCount(){var n;return((n=(await this.api.GetPurchasingCustomerDiscountCodeCount()).purchasingCustomer)==null?void 0:n.discountCodeCount)??0}}R.SDK=ln,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@builtbystack/sq-shopify-theme-sdk",
3
3
  "private": false,
4
- "version": "0.0.9",
4
+ "version": "0.0.10",
5
5
  "files": [
6
6
  "dist"
7
7
  ],