@builtbystack/sq-shopify-theme-sdk 0.0.24 → 0.0.25
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 +26 -2
- package/dist/sq-shopify-theme-sdk.d.ts +19 -2
- package/dist/sq-shopify-theme-sdk.js +172 -163
- package/dist/sq-shopify-theme-sdk.umd.js +33 -28
- package/package.json +1 -1
|
@@ -41,7 +41,7 @@ function Qe(e, t) {
|
|
|
41
41
|
);
|
|
42
42
|
}
|
|
43
43
|
const Xe = /\r\n|[\n\r]/g;
|
|
44
|
-
function
|
|
44
|
+
function he(e, t) {
|
|
45
45
|
let n = 0, r = 1;
|
|
46
46
|
for (const i of e.body.matchAll(Xe)) {
|
|
47
47
|
if (typeof i.index == "number" || Qe(!1), i.index >= t)
|
|
@@ -54,30 +54,30 @@ function pe(e, t) {
|
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
function We(e) {
|
|
57
|
-
return
|
|
57
|
+
return De(
|
|
58
58
|
e.source,
|
|
59
|
-
|
|
59
|
+
he(e.source, e.start)
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
const n = e.locationOffset.column - 1, r = "".padStart(n) + e.body, i = t.line - 1, s = e.locationOffset.line - 1, o = t.line + s, c = t.line === 1 ? n : 0,
|
|
62
|
+
function De(e, t) {
|
|
63
|
+
const n = e.locationOffset.column - 1, r = "".padStart(n) + e.body, i = t.line - 1, s = e.locationOffset.line - 1, o = t.line + s, c = t.line === 1 ? n : 0, p = t.column + c, h = `${e.name}:${o}:${p}
|
|
64
64
|
`, m = r.split(/\r\n|[\n\r]/g), y = m[i];
|
|
65
65
|
if (y.length > 120) {
|
|
66
|
-
const C = Math.floor(
|
|
66
|
+
const C = Math.floor(p / 80), T = p % 80, g = [];
|
|
67
67
|
for (let N = 0; N < y.length; N += 80)
|
|
68
68
|
g.push(y.slice(N, N + 80));
|
|
69
|
-
return
|
|
69
|
+
return h + Te([
|
|
70
70
|
[`${o} |`, g[0]],
|
|
71
71
|
...g.slice(1, C + 1).map((N) => ["|", N]),
|
|
72
72
|
["|", "^".padStart(T)],
|
|
73
73
|
["|", g[C + 1]]
|
|
74
74
|
]);
|
|
75
75
|
}
|
|
76
|
-
return
|
|
76
|
+
return h + Te([
|
|
77
77
|
// Lines specified like this: ["prefix", "string"],
|
|
78
78
|
[`${o - 1} |`, m[i - 1]],
|
|
79
79
|
[`${o} |`, y],
|
|
80
|
-
["|", "^".padStart(
|
|
80
|
+
["|", "^".padStart(p)],
|
|
81
81
|
[`${o + 1} |`, m[i + 1]]
|
|
82
82
|
]);
|
|
83
83
|
}
|
|
@@ -138,14 +138,14 @@ class Ce extends Error {
|
|
|
138
138
|
*/
|
|
139
139
|
constructor(t, ...n) {
|
|
140
140
|
var r, i, s;
|
|
141
|
-
const { nodes: o, source: c, positions:
|
|
142
|
-
super(t), this.name = "GraphQLError", this.path =
|
|
141
|
+
const { nodes: o, source: c, positions: p, path: h, originalError: m, extensions: y } = Ke(n);
|
|
142
|
+
super(t), this.name = "GraphQLError", this.path = h ?? void 0, this.originalError = m ?? void 0, this.nodes = Ne(
|
|
143
143
|
Array.isArray(o) ? o : o ? [o] : void 0
|
|
144
144
|
);
|
|
145
145
|
const C = Ne(
|
|
146
146
|
(r = this.nodes) === null || r === void 0 ? void 0 : r.map((g) => g.loc).filter((g) => g != null)
|
|
147
147
|
);
|
|
148
|
-
this.source = c ?? (C == null || (i = C[0]) === null || i === void 0 ? void 0 : i.source), this.positions =
|
|
148
|
+
this.source = c ?? (C == null || (i = C[0]) === null || i === void 0 ? void 0 : i.source), this.positions = p ?? (C == null ? void 0 : C.map((g) => g.start)), this.locations = p && c ? p.map((g) => he(c, g)) : C == null ? void 0 : C.map((g) => he(g.source, g.start));
|
|
149
149
|
const T = Je(
|
|
150
150
|
m == null ? void 0 : m.extensions
|
|
151
151
|
) ? m == null ? void 0 : m.extensions : void 0;
|
|
@@ -193,7 +193,7 @@ class Ce extends Error {
|
|
|
193
193
|
for (const n of this.locations)
|
|
194
194
|
t += `
|
|
195
195
|
|
|
196
|
-
` +
|
|
196
|
+
` + De(this.source, n);
|
|
197
197
|
return t;
|
|
198
198
|
}
|
|
199
199
|
toJSON() {
|
|
@@ -206,7 +206,7 @@ class Ce extends Error {
|
|
|
206
206
|
function Ne(e) {
|
|
207
207
|
return e === void 0 || e.length === 0 ? void 0 : e;
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function x(e, t, n) {
|
|
210
210
|
return new Ce(`Syntax Error: ${n}`, {
|
|
211
211
|
source: e,
|
|
212
212
|
positions: [t]
|
|
@@ -241,7 +241,7 @@ class Ze {
|
|
|
241
241
|
};
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
|
-
class
|
|
244
|
+
class Oe {
|
|
245
245
|
/**
|
|
246
246
|
* The kind of Token.
|
|
247
247
|
*/
|
|
@@ -395,8 +395,8 @@ function nt(e) {
|
|
|
395
395
|
let n = Number.MAX_SAFE_INTEGER, r = null, i = -1;
|
|
396
396
|
for (let o = 0; o < e.length; ++o) {
|
|
397
397
|
var s;
|
|
398
|
-
const c = e[o],
|
|
399
|
-
|
|
398
|
+
const c = e[o], p = rt(c);
|
|
399
|
+
p !== c.length && (r = (s = r) !== null && s !== void 0 ? s : o, i = o, o !== 0 && p < n && (n = p));
|
|
400
400
|
}
|
|
401
401
|
return e.map((o, c) => c === 0 ? o : o.slice(n)).slice(
|
|
402
402
|
(t = r) !== null && t !== void 0 ? t : 0,
|
|
@@ -410,12 +410,12 @@ function rt(e) {
|
|
|
410
410
|
return t;
|
|
411
411
|
}
|
|
412
412
|
function it(e, t) {
|
|
413
|
-
const n = e.replace(/"""/g, '\\"""'), r = n.split(/\r\n|[\n\r]/g), i = r.length === 1, s = r.length > 1 && r.slice(1).every((T) => T.length === 0 || me(T.charCodeAt(0))), o = n.endsWith('\\"""'), c = e.endsWith('"') && !o,
|
|
414
|
-
(!i || e.length > 70 ||
|
|
413
|
+
const n = e.replace(/"""/g, '\\"""'), r = n.split(/\r\n|[\n\r]/g), i = r.length === 1, s = r.length > 1 && r.slice(1).every((T) => T.length === 0 || me(T.charCodeAt(0))), o = n.endsWith('\\"""'), c = e.endsWith('"') && !o, p = e.endsWith("\\"), h = c || p, m = !(t != null && t.minimize) && // add leading and trailing new lines only if it improves readability
|
|
414
|
+
(!i || e.length > 70 || h || s || o);
|
|
415
415
|
let y = "";
|
|
416
416
|
const C = i && me(e.charCodeAt(0));
|
|
417
417
|
return (m && !C || s) && (y += `
|
|
418
|
-
`), y += n, (m ||
|
|
418
|
+
`), y += n, (m || h) && (y += `
|
|
419
419
|
`), '"""' + y + '"""';
|
|
420
420
|
}
|
|
421
421
|
var u;
|
|
@@ -436,7 +436,7 @@ class st {
|
|
|
436
436
|
* The character offset at which the current line begins.
|
|
437
437
|
*/
|
|
438
438
|
constructor(t) {
|
|
439
|
-
const n = new
|
|
439
|
+
const n = new Oe(u.SOF, 0, 0, 0, 0);
|
|
440
440
|
this.source = t, this.lastToken = n, this.token = n, this.line = 1, this.lineStart = 0;
|
|
441
441
|
}
|
|
442
442
|
get [Symbol.toStringTag]() {
|
|
@@ -493,7 +493,7 @@ function F(e, t) {
|
|
|
493
493
|
}
|
|
494
494
|
function I(e, t, n, r, i) {
|
|
495
495
|
const s = e.line, o = 1 + n - e.lineStart;
|
|
496
|
-
return new
|
|
496
|
+
return new Oe(t, n, r, s, o, i);
|
|
497
497
|
}
|
|
498
498
|
function at(e, t) {
|
|
499
499
|
const n = e.source.body, r = n.length;
|
|
@@ -552,7 +552,7 @@ function at(e, t) {
|
|
|
552
552
|
return ct(e, i, s);
|
|
553
553
|
if (_e(s))
|
|
554
554
|
return mt(e, i);
|
|
555
|
-
throw
|
|
555
|
+
throw x(
|
|
556
556
|
e.source,
|
|
557
557
|
i,
|
|
558
558
|
s === 39 ? `Unexpected single quote character ('), did you mean to use a double quote (")?` : G(s) || se(n, i) ? `Unexpected character: ${F(e, i)}.` : `Invalid character: ${F(e, i)}.`
|
|
@@ -587,7 +587,7 @@ function ct(e, t, n) {
|
|
|
587
587
|
let i = t, s = n, o = !1;
|
|
588
588
|
if (s === 45 && (s = r.charCodeAt(++i)), s === 48) {
|
|
589
589
|
if (s = r.charCodeAt(++i), Y(s))
|
|
590
|
-
throw
|
|
590
|
+
throw x(
|
|
591
591
|
e.source,
|
|
592
592
|
i,
|
|
593
593
|
`Invalid number, unexpected digit after 0: ${F(
|
|
@@ -598,7 +598,7 @@ function ct(e, t, n) {
|
|
|
598
598
|
} else
|
|
599
599
|
i = ce(e, i, s), s = r.charCodeAt(i);
|
|
600
600
|
if (s === 46 && (o = !0, s = r.charCodeAt(++i), i = ce(e, i, s), s = r.charCodeAt(i)), (s === 69 || s === 101) && (o = !0, s = r.charCodeAt(++i), (s === 43 || s === 45) && (s = r.charCodeAt(++i)), i = ce(e, i, s), s = r.charCodeAt(i)), s === 46 || _e(s))
|
|
601
|
-
throw
|
|
601
|
+
throw x(
|
|
602
602
|
e.source,
|
|
603
603
|
i,
|
|
604
604
|
`Invalid number, expected digit but got: ${F(
|
|
@@ -616,7 +616,7 @@ function ct(e, t, n) {
|
|
|
616
616
|
}
|
|
617
617
|
function ce(e, t, n) {
|
|
618
618
|
if (!Y(n))
|
|
619
|
-
throw
|
|
619
|
+
throw x(
|
|
620
620
|
e.source,
|
|
621
621
|
t,
|
|
622
622
|
`Invalid number, expected digit but got: ${F(
|
|
@@ -639,8 +639,8 @@ function lt(e, t) {
|
|
|
639
639
|
return o += n.slice(s, i), I(e, u.STRING, t, i + 1, o);
|
|
640
640
|
if (c === 92) {
|
|
641
641
|
o += n.slice(s, i);
|
|
642
|
-
const
|
|
643
|
-
o +=
|
|
642
|
+
const p = n.charCodeAt(i + 1) === 117 ? n.charCodeAt(i + 2) === 123 ? dt(e, i) : pt(e, i) : ht(e, i);
|
|
643
|
+
o += p.value, i += p.size, s = i;
|
|
644
644
|
continue;
|
|
645
645
|
}
|
|
646
646
|
if (c === 10 || c === 13)
|
|
@@ -650,7 +650,7 @@ function lt(e, t) {
|
|
|
650
650
|
else if (se(n, i))
|
|
651
651
|
i += 2;
|
|
652
652
|
else
|
|
653
|
-
throw
|
|
653
|
+
throw x(
|
|
654
654
|
e.source,
|
|
655
655
|
i,
|
|
656
656
|
`Invalid character within String: ${F(
|
|
@@ -659,7 +659,7 @@ function lt(e, t) {
|
|
|
659
659
|
)}.`
|
|
660
660
|
);
|
|
661
661
|
}
|
|
662
|
-
throw
|
|
662
|
+
throw x(e.source, i, "Unterminated string.");
|
|
663
663
|
}
|
|
664
664
|
function dt(e, t) {
|
|
665
665
|
const n = e.source.body;
|
|
@@ -677,7 +677,7 @@ function dt(e, t) {
|
|
|
677
677
|
if (r = r << 4 | j(s), r < 0)
|
|
678
678
|
break;
|
|
679
679
|
}
|
|
680
|
-
throw
|
|
680
|
+
throw x(
|
|
681
681
|
e.source,
|
|
682
682
|
t,
|
|
683
683
|
`Invalid Unicode escape sequence: "${n.slice(
|
|
@@ -686,34 +686,34 @@ function dt(e, t) {
|
|
|
686
686
|
)}".`
|
|
687
687
|
);
|
|
688
688
|
}
|
|
689
|
-
function
|
|
690
|
-
const n = e.source.body, r =
|
|
689
|
+
function pt(e, t) {
|
|
690
|
+
const n = e.source.body, r = xe(n, t + 2);
|
|
691
691
|
if (G(r))
|
|
692
692
|
return {
|
|
693
693
|
value: String.fromCodePoint(r),
|
|
694
694
|
size: 6
|
|
695
695
|
};
|
|
696
696
|
if (Le(r) && n.charCodeAt(t + 6) === 92 && n.charCodeAt(t + 7) === 117) {
|
|
697
|
-
const i =
|
|
697
|
+
const i = xe(n, t + 8);
|
|
698
698
|
if (we(i))
|
|
699
699
|
return {
|
|
700
700
|
value: String.fromCodePoint(r, i),
|
|
701
701
|
size: 12
|
|
702
702
|
};
|
|
703
703
|
}
|
|
704
|
-
throw
|
|
704
|
+
throw x(
|
|
705
705
|
e.source,
|
|
706
706
|
t,
|
|
707
707
|
`Invalid Unicode escape sequence: "${n.slice(t, t + 6)}".`
|
|
708
708
|
);
|
|
709
709
|
}
|
|
710
|
-
function
|
|
710
|
+
function xe(e, t) {
|
|
711
711
|
return j(e.charCodeAt(t)) << 12 | j(e.charCodeAt(t + 1)) << 8 | j(e.charCodeAt(t + 2)) << 4 | j(e.charCodeAt(t + 3));
|
|
712
712
|
}
|
|
713
713
|
function j(e) {
|
|
714
714
|
return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
|
|
715
715
|
}
|
|
716
|
-
function
|
|
716
|
+
function ht(e, t) {
|
|
717
717
|
const n = e.source.body;
|
|
718
718
|
switch (n.charCodeAt(t + 1)) {
|
|
719
719
|
case 34:
|
|
@@ -758,7 +758,7 @@ function pt(e, t) {
|
|
|
758
758
|
size: 2
|
|
759
759
|
};
|
|
760
760
|
}
|
|
761
|
-
throw
|
|
761
|
+
throw x(
|
|
762
762
|
e.source,
|
|
763
763
|
t,
|
|
764
764
|
`Invalid character escape sequence: "${n.slice(
|
|
@@ -770,36 +770,36 @@ function pt(e, t) {
|
|
|
770
770
|
function ft(e, t) {
|
|
771
771
|
const n = e.source.body, r = n.length;
|
|
772
772
|
let i = e.lineStart, s = t + 3, o = s, c = "";
|
|
773
|
-
const
|
|
773
|
+
const p = [];
|
|
774
774
|
for (; s < r; ) {
|
|
775
|
-
const
|
|
776
|
-
if (
|
|
777
|
-
c += n.slice(o, s),
|
|
775
|
+
const h = n.charCodeAt(s);
|
|
776
|
+
if (h === 34 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34) {
|
|
777
|
+
c += n.slice(o, s), p.push(c);
|
|
778
778
|
const m = I(
|
|
779
779
|
e,
|
|
780
780
|
u.BLOCK_STRING,
|
|
781
781
|
t,
|
|
782
782
|
s + 3,
|
|
783
783
|
// Return a string of the lines joined with U+000A.
|
|
784
|
-
nt(
|
|
784
|
+
nt(p).join(`
|
|
785
785
|
`)
|
|
786
786
|
);
|
|
787
|
-
return e.line +=
|
|
787
|
+
return e.line += p.length - 1, e.lineStart = i, m;
|
|
788
788
|
}
|
|
789
|
-
if (
|
|
789
|
+
if (h === 92 && n.charCodeAt(s + 1) === 34 && n.charCodeAt(s + 2) === 34 && n.charCodeAt(s + 3) === 34) {
|
|
790
790
|
c += n.slice(o, s), o = s + 1, s += 4;
|
|
791
791
|
continue;
|
|
792
792
|
}
|
|
793
|
-
if (
|
|
794
|
-
c += n.slice(o, s),
|
|
793
|
+
if (h === 10 || h === 13) {
|
|
794
|
+
c += n.slice(o, s), p.push(c), h === 13 && n.charCodeAt(s + 1) === 10 ? s += 2 : ++s, c = "", o = s, i = s;
|
|
795
795
|
continue;
|
|
796
796
|
}
|
|
797
|
-
if (G(
|
|
797
|
+
if (G(h))
|
|
798
798
|
++s;
|
|
799
799
|
else if (se(n, s))
|
|
800
800
|
s += 2;
|
|
801
801
|
else
|
|
802
|
-
throw
|
|
802
|
+
throw x(
|
|
803
803
|
e.source,
|
|
804
804
|
s,
|
|
805
805
|
`Invalid character within String: ${F(
|
|
@@ -808,7 +808,7 @@ function ft(e, t) {
|
|
|
808
808
|
)}.`
|
|
809
809
|
);
|
|
810
810
|
}
|
|
811
|
-
throw
|
|
811
|
+
throw x(e.source, s, "Unterminated string.");
|
|
812
812
|
}
|
|
813
813
|
function mt(e, t) {
|
|
814
814
|
const n = e.source.body, r = n.length;
|
|
@@ -1018,7 +1018,7 @@ class It {
|
|
|
1018
1018
|
return this.parseDirectiveDefinition();
|
|
1019
1019
|
}
|
|
1020
1020
|
if (t)
|
|
1021
|
-
throw
|
|
1021
|
+
throw x(
|
|
1022
1022
|
this._lexer.source,
|
|
1023
1023
|
this._lexer.token.start,
|
|
1024
1024
|
"Unexpected description, descriptions are supported only on type definitions."
|
|
@@ -1292,7 +1292,7 @@ class It {
|
|
|
1292
1292
|
if (t)
|
|
1293
1293
|
if (this.expectToken(u.DOLLAR), this._lexer.token.kind === u.NAME) {
|
|
1294
1294
|
const r = this._lexer.token.value;
|
|
1295
|
-
throw
|
|
1295
|
+
throw x(
|
|
1296
1296
|
this._lexer.source,
|
|
1297
1297
|
n.start,
|
|
1298
1298
|
`Unexpected variable "$${r}" in constant value.`
|
|
@@ -1639,7 +1639,7 @@ class It {
|
|
|
1639
1639
|
*/
|
|
1640
1640
|
parseEnumValueName() {
|
|
1641
1641
|
if (this._lexer.token.value === "true" || this._lexer.token.value === "false" || this._lexer.token.value === "null")
|
|
1642
|
-
throw
|
|
1642
|
+
throw x(
|
|
1643
1643
|
this._lexer.source,
|
|
1644
1644
|
this._lexer.token.start,
|
|
1645
1645
|
`${W(
|
|
@@ -1932,7 +1932,7 @@ class It {
|
|
|
1932
1932
|
const n = this._lexer.token;
|
|
1933
1933
|
if (n.kind === t)
|
|
1934
1934
|
return this.advanceLexer(), n;
|
|
1935
|
-
throw
|
|
1935
|
+
throw x(
|
|
1936
1936
|
this._lexer.source,
|
|
1937
1937
|
n.start,
|
|
1938
1938
|
`Expected ${qe(t)}, found ${W(n)}.`
|
|
@@ -1954,7 +1954,7 @@ class It {
|
|
|
1954
1954
|
if (n.kind === u.NAME && n.value === t)
|
|
1955
1955
|
this.advanceLexer();
|
|
1956
1956
|
else
|
|
1957
|
-
throw
|
|
1957
|
+
throw x(
|
|
1958
1958
|
this._lexer.source,
|
|
1959
1959
|
n.start,
|
|
1960
1960
|
`Expected "${t}", found ${W(n)}.`
|
|
@@ -1973,7 +1973,7 @@ class It {
|
|
|
1973
1973
|
*/
|
|
1974
1974
|
unexpected(t) {
|
|
1975
1975
|
const n = t ?? this._lexer.token;
|
|
1976
|
-
return
|
|
1976
|
+
return x(
|
|
1977
1977
|
this._lexer.source,
|
|
1978
1978
|
n.start,
|
|
1979
1979
|
`Unexpected ${W(n)}.`
|
|
@@ -2036,7 +2036,7 @@ class It {
|
|
|
2036
2036
|
advanceLexer() {
|
|
2037
2037
|
const { maxTokens: t } = this._options, n = this._lexer.advance();
|
|
2038
2038
|
if (t !== void 0 && n.kind !== u.EOF && (++this._tokenCounter, this._tokenCounter > t))
|
|
2039
|
-
throw
|
|
2039
|
+
throw x(
|
|
2040
2040
|
this._lexer.source,
|
|
2041
2041
|
n.start,
|
|
2042
2042
|
`Document contains more that ${t} tokens. Parsing aborted.`
|
|
@@ -2050,11 +2050,11 @@ function W(e) {
|
|
|
2050
2050
|
function qe(e) {
|
|
2051
2051
|
return ot(e) ? `"${e}"` : e;
|
|
2052
2052
|
}
|
|
2053
|
-
function St(e) {
|
|
2054
|
-
return `"${e.replace(bt, xt)}"`;
|
|
2055
|
-
}
|
|
2056
|
-
const bt = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
|
|
2057
2053
|
function xt(e) {
|
|
2054
|
+
return `"${e.replace(St, bt)}"`;
|
|
2055
|
+
}
|
|
2056
|
+
const St = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
|
|
2057
|
+
function bt(e) {
|
|
2058
2058
|
return Rt[e.charCodeAt(0)];
|
|
2059
2059
|
}
|
|
2060
2060
|
const Rt = [
|
|
@@ -2223,73 +2223,73 @@ const Rt = [
|
|
|
2223
2223
|
"\\u009D",
|
|
2224
2224
|
"\\u009E",
|
|
2225
2225
|
"\\u009F"
|
|
2226
|
-
],
|
|
2227
|
-
function
|
|
2226
|
+
], Dt = Object.freeze({});
|
|
2227
|
+
function Ot(e, t, n = ke) {
|
|
2228
2228
|
const r = /* @__PURE__ */ new Map();
|
|
2229
|
-
for (const
|
|
2230
|
-
r.set(
|
|
2231
|
-
let i, s = Array.isArray(e), o = [e], c = -1,
|
|
2229
|
+
for (const O of Object.values(f))
|
|
2230
|
+
r.set(O, kt(t, O));
|
|
2231
|
+
let i, s = Array.isArray(e), o = [e], c = -1, p = [], h = e, m, y;
|
|
2232
2232
|
const C = [], T = [];
|
|
2233
2233
|
do {
|
|
2234
2234
|
c++;
|
|
2235
|
-
const
|
|
2236
|
-
if (
|
|
2237
|
-
if (m = T.length === 0 ? void 0 : C[C.length - 1],
|
|
2235
|
+
const O = c === o.length, z = O && p.length !== 0;
|
|
2236
|
+
if (O) {
|
|
2237
|
+
if (m = T.length === 0 ? void 0 : C[C.length - 1], h = y, y = T.pop(), z)
|
|
2238
2238
|
if (s) {
|
|
2239
|
-
|
|
2239
|
+
h = h.slice();
|
|
2240
2240
|
let k = 0;
|
|
2241
|
-
for (const [B, J] of
|
|
2241
|
+
for (const [B, J] of p) {
|
|
2242
2242
|
const Q = B - k;
|
|
2243
|
-
J === null ? (
|
|
2243
|
+
J === null ? (h.splice(Q, 1), k++) : h[Q] = J;
|
|
2244
2244
|
}
|
|
2245
2245
|
} else {
|
|
2246
|
-
|
|
2246
|
+
h = Object.defineProperties(
|
|
2247
2247
|
{},
|
|
2248
|
-
Object.getOwnPropertyDescriptors(
|
|
2248
|
+
Object.getOwnPropertyDescriptors(h)
|
|
2249
2249
|
);
|
|
2250
|
-
for (const [k, B] of
|
|
2251
|
-
|
|
2250
|
+
for (const [k, B] of p)
|
|
2251
|
+
h[k] = B;
|
|
2252
2252
|
}
|
|
2253
|
-
c = i.index, o = i.keys,
|
|
2253
|
+
c = i.index, o = i.keys, p = i.edits, s = i.inArray, i = i.prev;
|
|
2254
2254
|
} else if (y) {
|
|
2255
|
-
if (m = s ? c : o[c],
|
|
2255
|
+
if (m = s ? c : o[c], h = y[m], h == null)
|
|
2256
2256
|
continue;
|
|
2257
2257
|
C.push(m);
|
|
2258
2258
|
}
|
|
2259
2259
|
let _;
|
|
2260
|
-
if (!Array.isArray(
|
|
2260
|
+
if (!Array.isArray(h)) {
|
|
2261
2261
|
var g, N;
|
|
2262
|
-
Ie(
|
|
2263
|
-
const k =
|
|
2264
|
-
if (_ = k == null ? void 0 : k.call(t,
|
|
2262
|
+
Ie(h) || K(!1, `Invalid AST Node: ${Ee(h)}.`);
|
|
2263
|
+
const k = O ? (g = r.get(h.kind)) === null || g === void 0 ? void 0 : g.leave : (N = r.get(h.kind)) === null || N === void 0 ? void 0 : N.enter;
|
|
2264
|
+
if (_ = k == null ? void 0 : k.call(t, h, m, y, C, T), _ === Dt)
|
|
2265
2265
|
break;
|
|
2266
2266
|
if (_ === !1) {
|
|
2267
|
-
if (!
|
|
2267
|
+
if (!O) {
|
|
2268
2268
|
C.pop();
|
|
2269
2269
|
continue;
|
|
2270
2270
|
}
|
|
2271
|
-
} else if (_ !== void 0 && (
|
|
2271
|
+
} else if (_ !== void 0 && (p.push([m, _]), !O))
|
|
2272
2272
|
if (Ie(_))
|
|
2273
|
-
|
|
2273
|
+
h = _;
|
|
2274
2274
|
else {
|
|
2275
2275
|
C.pop();
|
|
2276
2276
|
continue;
|
|
2277
2277
|
}
|
|
2278
2278
|
}
|
|
2279
|
-
if (_ === void 0 && z &&
|
|
2279
|
+
if (_ === void 0 && z && p.push([m, h]), O)
|
|
2280
2280
|
C.pop();
|
|
2281
2281
|
else {
|
|
2282
|
-
var
|
|
2282
|
+
var D;
|
|
2283
2283
|
i = {
|
|
2284
2284
|
inArray: s,
|
|
2285
2285
|
index: c,
|
|
2286
2286
|
keys: o,
|
|
2287
|
-
edits:
|
|
2287
|
+
edits: p,
|
|
2288
2288
|
prev: i
|
|
2289
|
-
}, s = Array.isArray(
|
|
2289
|
+
}, s = Array.isArray(h), o = s ? h : (D = n[h.kind]) !== null && D !== void 0 ? D : [], c = -1, p = [], y && T.push(y), y = h;
|
|
2290
2290
|
}
|
|
2291
2291
|
} while (i !== void 0);
|
|
2292
|
-
return
|
|
2292
|
+
return p.length !== 0 ? p[p.length - 1][1] : e;
|
|
2293
2293
|
}
|
|
2294
2294
|
function kt(e, t) {
|
|
2295
2295
|
const n = e[t];
|
|
@@ -2302,7 +2302,7 @@ function kt(e, t) {
|
|
|
2302
2302
|
};
|
|
2303
2303
|
}
|
|
2304
2304
|
function Pt(e) {
|
|
2305
|
-
return
|
|
2305
|
+
return Ot(e, Lt);
|
|
2306
2306
|
}
|
|
2307
2307
|
const _t = 80, Lt = {
|
|
2308
2308
|
Name: {
|
|
@@ -2378,7 +2378,7 @@ const _t = 80, Lt = {
|
|
|
2378
2378
|
leave: ({ value: e }) => e
|
|
2379
2379
|
},
|
|
2380
2380
|
StringValue: {
|
|
2381
|
-
leave: ({ value: e, block: t }) => t ? it(e) :
|
|
2381
|
+
leave: ({ value: e, block: t }) => t ? it(e) : xt(e)
|
|
2382
2382
|
},
|
|
2383
2383
|
BooleanValue: {
|
|
2384
2384
|
leave: ({ value: e }) => e ? "true" : "false"
|
|
@@ -2439,7 +2439,7 @@ const _t = 80, Lt = {
|
|
|
2439
2439
|
},
|
|
2440
2440
|
FieldDefinition: {
|
|
2441
2441
|
leave: ({ description: e, name: t, arguments: n, type: r, directives: i }) => v("", e, `
|
|
2442
|
-
`) + t + (
|
|
2442
|
+
`) + t + (Se(n) ? v(`(
|
|
2443
2443
|
`, Z(d(n, `
|
|
2444
2444
|
`)), `
|
|
2445
2445
|
)`) : v("(", d(n, ", "), ")")) + ": " + r + v(" ", d(i, " "))
|
|
@@ -2485,7 +2485,7 @@ const _t = 80, Lt = {
|
|
|
2485
2485
|
},
|
|
2486
2486
|
DirectiveDefinition: {
|
|
2487
2487
|
leave: ({ description: e, name: t, arguments: n, repeatable: r, locations: i }) => v("", e, `
|
|
2488
|
-
`) + "directive @" + t + (
|
|
2488
|
+
`) + "directive @" + t + (Se(n) ? v(`(
|
|
2489
2489
|
`, Z(d(n, `
|
|
2490
2490
|
`)), `
|
|
2491
2491
|
)`) : v("(", d(n, ", "), ")")) + (r ? " repeatable" : "") + " on " + d(i, " | ")
|
|
@@ -2558,7 +2558,7 @@ function Z(e) {
|
|
|
2558
2558
|
return v(" ", e.replace(/\n/g, `
|
|
2559
2559
|
`));
|
|
2560
2560
|
}
|
|
2561
|
-
function
|
|
2561
|
+
function Se(e) {
|
|
2562
2562
|
var t;
|
|
2563
2563
|
return (t = e == null ? void 0 : e.some((n) => n.includes(`
|
|
2564
2564
|
`))) !== null && t !== void 0 ? t : !1;
|
|
@@ -2638,7 +2638,7 @@ var $ = {
|
|
|
2638
2638
|
e.gql = $.gql, e.resetCaches = $.resetCaches, e.disableFragmentWarnings = $.disableFragmentWarnings, e.enableExperimentalFragmentVariables = $.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = $.disableExperimentalFragmentVariables;
|
|
2639
2639
|
})(M || (M = {}));
|
|
2640
2640
|
M.default = M;
|
|
2641
|
-
const
|
|
2641
|
+
const b = M, $t = b`
|
|
2642
2642
|
query GetLocationAvailabilities($sku: String!, $first: Int, $after: String, $isReverse: Boolean! = false) {
|
|
2643
2643
|
locationAvailabilities(
|
|
2644
2644
|
sku: $sku
|
|
@@ -2677,7 +2677,7 @@ const x = M, $t = x`
|
|
|
2677
2677
|
}
|
|
2678
2678
|
}
|
|
2679
2679
|
}
|
|
2680
|
-
`, jt =
|
|
2680
|
+
`, jt = b`
|
|
2681
2681
|
query GetLocationAvailability($sku: String!, $locationID: ID!) {
|
|
2682
2682
|
locationAvailability(sku: $sku, locationID: $locationID) {
|
|
2683
2683
|
location {
|
|
@@ -2703,7 +2703,7 @@ const x = M, $t = x`
|
|
|
2703
2703
|
inventoryQuantity
|
|
2704
2704
|
}
|
|
2705
2705
|
}
|
|
2706
|
-
`, Ht =
|
|
2706
|
+
`, Ht = b`
|
|
2707
2707
|
query GetPurchasingCustomerMetafield($namespace: String!, $key: String!) {
|
|
2708
2708
|
purchasingCustomerMetafield(namespace: $namespace, key: $key) {
|
|
2709
2709
|
id
|
|
@@ -2712,14 +2712,19 @@ const x = M, $t = x`
|
|
|
2712
2712
|
value
|
|
2713
2713
|
}
|
|
2714
2714
|
}
|
|
2715
|
-
`, Yt =
|
|
2715
|
+
`, Yt = b`
|
|
2716
2716
|
query GetPoints {
|
|
2717
2717
|
purchasingCustomer {
|
|
2718
2718
|
pointsApproved
|
|
2719
2719
|
pointsPending
|
|
2720
|
+
pointsExpiringSoon {
|
|
2721
|
+
points
|
|
2722
|
+
expiresDate
|
|
2723
|
+
availableUntil
|
|
2724
|
+
}
|
|
2720
2725
|
}
|
|
2721
2726
|
}
|
|
2722
|
-
`, zt =
|
|
2727
|
+
`, zt = b`
|
|
2723
2728
|
query GetLocations($tag: String, $provinceCodes: [String!], $first: Int, $after: String, $isReverse: Boolean! = false) {
|
|
2724
2729
|
locations(
|
|
2725
2730
|
first: $first
|
|
@@ -2755,7 +2760,7 @@ const x = M, $t = x`
|
|
|
2755
2760
|
}
|
|
2756
2761
|
}
|
|
2757
2762
|
}
|
|
2758
|
-
`, Jt =
|
|
2763
|
+
`, Jt = b`
|
|
2759
2764
|
query GetPurchasingCustomerDiscounts($first: Int, $after: String, $isReverse: Boolean! = false) {
|
|
2760
2765
|
purchasingCustomer {
|
|
2761
2766
|
id
|
|
@@ -2784,14 +2789,14 @@ const x = M, $t = x`
|
|
|
2784
2789
|
}
|
|
2785
2790
|
}
|
|
2786
2791
|
}
|
|
2787
|
-
`, Qt =
|
|
2792
|
+
`, Qt = b`
|
|
2788
2793
|
query GetPurchasingCustomerDiscountCodeCount {
|
|
2789
2794
|
purchasingCustomer {
|
|
2790
2795
|
id
|
|
2791
2796
|
orderPriceAdjustmentRuleCount
|
|
2792
2797
|
}
|
|
2793
2798
|
}
|
|
2794
|
-
`, Xt =
|
|
2799
|
+
`, Xt = b`
|
|
2795
2800
|
query GetPurchasingCustomerPointChangeActivities($first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: PointChangeActivitySortKey! = CREATED_AT) {
|
|
2796
2801
|
purchasingCustomer {
|
|
2797
2802
|
id
|
|
@@ -2851,7 +2856,7 @@ const x = M, $t = x`
|
|
|
2851
2856
|
}
|
|
2852
2857
|
}
|
|
2853
2858
|
}
|
|
2854
|
-
`, Wt =
|
|
2859
|
+
`, Wt = b`
|
|
2855
2860
|
query GetPurchasingCustomerRank {
|
|
2856
2861
|
purchasingCustomer {
|
|
2857
2862
|
currentCustomerRank {
|
|
@@ -2890,14 +2895,14 @@ const x = M, $t = x`
|
|
|
2890
2895
|
}
|
|
2891
2896
|
}
|
|
2892
2897
|
}
|
|
2893
|
-
`, Kt =
|
|
2898
|
+
`, Kt = b`
|
|
2894
2899
|
query GetSharingPurchasingCustomerCount {
|
|
2895
2900
|
purchasingCustomer {
|
|
2896
2901
|
id
|
|
2897
2902
|
sharingPurchasingCustomerCount
|
|
2898
2903
|
}
|
|
2899
2904
|
}
|
|
2900
|
-
`, Zt =
|
|
2905
|
+
`, Zt = b`
|
|
2901
2906
|
query GetPurchasingCustomerSharing {
|
|
2902
2907
|
purchasingCustomer {
|
|
2903
2908
|
id
|
|
@@ -2914,7 +2919,7 @@ const x = M, $t = x`
|
|
|
2914
2919
|
}
|
|
2915
2920
|
}
|
|
2916
2921
|
}
|
|
2917
|
-
`, en =
|
|
2922
|
+
`, en = b`
|
|
2918
2923
|
query GetProduct($id: String!, $first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: ProductVariantSortKeys! = CREATED_AT) {
|
|
2919
2924
|
productByProductShopifyLegacyResourceID(productShopifyLegacyResourceID: $id) {
|
|
2920
2925
|
id
|
|
@@ -2946,7 +2951,7 @@ const x = M, $t = x`
|
|
|
2946
2951
|
}
|
|
2947
2952
|
}
|
|
2948
2953
|
}
|
|
2949
|
-
`, tn =
|
|
2954
|
+
`, tn = b`
|
|
2950
2955
|
query GetPointCampaignOrderRuleTargetCustomerRank {
|
|
2951
2956
|
pointCampaignOrderRuleTargetCustomerRank {
|
|
2952
2957
|
pointCampaignOrderRule {
|
|
@@ -2957,19 +2962,19 @@ const x = M, $t = x`
|
|
|
2957
2962
|
fixedPoint
|
|
2958
2963
|
}
|
|
2959
2964
|
}
|
|
2960
|
-
`, nn =
|
|
2965
|
+
`, nn = b`
|
|
2961
2966
|
query GetEstimatedShopifyCartPoint($input: EstimatedShopifyCartPointInput!) {
|
|
2962
2967
|
estimatedShopifyCartPoint(input: $input) {
|
|
2963
2968
|
pointsEarned
|
|
2964
2969
|
}
|
|
2965
2970
|
}
|
|
2966
|
-
`, rn =
|
|
2971
|
+
`, rn = b`
|
|
2967
2972
|
query GetEstimatedShopifyCartLineItemPoint($input: EstimatedShopifyCartLineItemPointInput!) {
|
|
2968
2973
|
estimatedShopifyCartLineItemPoint(input: $input) {
|
|
2969
2974
|
pointsEarned
|
|
2970
2975
|
}
|
|
2971
2976
|
}
|
|
2972
|
-
`, sn =
|
|
2977
|
+
`, sn = b`
|
|
2973
2978
|
mutation PurchasingCustomerSendCustomerSharingActivationCode {
|
|
2974
2979
|
purchasingCustomerSendCustomerSharingActivationCode {
|
|
2975
2980
|
purchasingCustomer {
|
|
@@ -2985,7 +2990,7 @@ const x = M, $t = x`
|
|
|
2985
2990
|
}
|
|
2986
2991
|
}
|
|
2987
2992
|
}
|
|
2988
|
-
`, on =
|
|
2993
|
+
`, on = b`
|
|
2989
2994
|
mutation PurchasingCustomerActivateCustomerSharing($email: String!, $activationCode: String!) {
|
|
2990
2995
|
purchasingCustomerActivateCustomerSharing(
|
|
2991
2996
|
input: {email: $email, activationCode: $activationCode}
|
|
@@ -3066,16 +3071,16 @@ const ve = JSON, cn = (e) => e.toUpperCase(), ln = (e) => {
|
|
|
3066
3071
|
variables: t,
|
|
3067
3072
|
requestHeaders: n,
|
|
3068
3073
|
signal: void 0
|
|
3069
|
-
},
|
|
3074
|
+
}, pn = (e, t, n) => e.query ? e : {
|
|
3070
3075
|
query: e,
|
|
3071
3076
|
variables: t,
|
|
3072
3077
|
requestHeaders: n,
|
|
3073
3078
|
signal: void 0
|
|
3074
|
-
},
|
|
3079
|
+
}, hn = (e, t) => e.documents ? e : {
|
|
3075
3080
|
documents: e,
|
|
3076
3081
|
requestHeaders: t,
|
|
3077
3082
|
signal: void 0
|
|
3078
|
-
},
|
|
3083
|
+
}, be = (e) => {
|
|
3079
3084
|
var r, i;
|
|
3080
3085
|
let t;
|
|
3081
3086
|
const n = e.definitions.filter((s) => s.kind === "OperationDefinition");
|
|
@@ -3085,12 +3090,12 @@ const ve = JSON, cn = (e) => e.toUpperCase(), ln = (e) => {
|
|
|
3085
3090
|
let n;
|
|
3086
3091
|
try {
|
|
3087
3092
|
const r = Ue(e);
|
|
3088
|
-
n =
|
|
3093
|
+
n = be(r);
|
|
3089
3094
|
} catch {
|
|
3090
3095
|
}
|
|
3091
3096
|
return { query: e, operationName: n };
|
|
3092
3097
|
}
|
|
3093
|
-
const t =
|
|
3098
|
+
const t = be(e);
|
|
3094
3099
|
return { query: Pt(e), operationName: t };
|
|
3095
3100
|
};
|
|
3096
3101
|
class H extends Error {
|
|
@@ -3133,11 +3138,11 @@ var ye = { exports: {} };
|
|
|
3133
3138
|
formData: "FormData" in s,
|
|
3134
3139
|
arrayBuffer: "ArrayBuffer" in s
|
|
3135
3140
|
};
|
|
3136
|
-
function
|
|
3141
|
+
function p(a) {
|
|
3137
3142
|
return a && DataView.prototype.isPrototypeOf(a);
|
|
3138
3143
|
}
|
|
3139
3144
|
if (c.arrayBuffer)
|
|
3140
|
-
var
|
|
3145
|
+
var h = [
|
|
3141
3146
|
"[object Int8Array]",
|
|
3142
3147
|
"[object Uint8Array]",
|
|
3143
3148
|
"[object Uint8ClampedArray]",
|
|
@@ -3148,7 +3153,7 @@ var ye = { exports: {} };
|
|
|
3148
3153
|
"[object Float32Array]",
|
|
3149
3154
|
"[object Float64Array]"
|
|
3150
3155
|
], m = ArrayBuffer.isView || function(a) {
|
|
3151
|
-
return a &&
|
|
3156
|
+
return a && h.indexOf(Object.prototype.toString.call(a)) > -1;
|
|
3152
3157
|
};
|
|
3153
3158
|
function y(a) {
|
|
3154
3159
|
if (typeof a != "string" && (a = String(a)), /[^a-z0-9\-#$%&'*+.^_`|~]/i.test(a))
|
|
@@ -3214,7 +3219,7 @@ var ye = { exports: {} };
|
|
|
3214
3219
|
return Promise.reject(new TypeError("Already read"));
|
|
3215
3220
|
a.bodyUsed = !0;
|
|
3216
3221
|
}
|
|
3217
|
-
function
|
|
3222
|
+
function D(a) {
|
|
3218
3223
|
return new Promise(function(l, E) {
|
|
3219
3224
|
a.onload = function() {
|
|
3220
3225
|
l(a.result);
|
|
@@ -3223,12 +3228,12 @@ var ye = { exports: {} };
|
|
|
3223
3228
|
};
|
|
3224
3229
|
});
|
|
3225
3230
|
}
|
|
3226
|
-
function
|
|
3227
|
-
var l = new FileReader(), E =
|
|
3231
|
+
function O(a) {
|
|
3232
|
+
var l = new FileReader(), E = D(l);
|
|
3228
3233
|
return l.readAsArrayBuffer(a), E;
|
|
3229
3234
|
}
|
|
3230
3235
|
function z(a) {
|
|
3231
|
-
var l = new FileReader(), E =
|
|
3236
|
+
var l = new FileReader(), E = D(l);
|
|
3232
3237
|
return l.readAsText(a), E;
|
|
3233
3238
|
}
|
|
3234
3239
|
function _(a) {
|
|
@@ -3244,7 +3249,7 @@ var ye = { exports: {} };
|
|
|
3244
3249
|
}
|
|
3245
3250
|
function B() {
|
|
3246
3251
|
return this.bodyUsed = !1, this._initBody = function(a) {
|
|
3247
|
-
this._bodyInit = a, a ? typeof a == "string" ? this._bodyText = a : c.blob && Blob.prototype.isPrototypeOf(a) ? this._bodyBlob = a : c.formData && FormData.prototype.isPrototypeOf(a) ? this._bodyFormData = a : c.searchParams && URLSearchParams.prototype.isPrototypeOf(a) ? this._bodyText = a.toString() : c.arrayBuffer && c.blob &&
|
|
3252
|
+
this._bodyInit = a, a ? typeof a == "string" ? this._bodyText = a : c.blob && Blob.prototype.isPrototypeOf(a) ? this._bodyBlob = a : c.formData && FormData.prototype.isPrototypeOf(a) ? this._bodyFormData = a : c.searchParams && URLSearchParams.prototype.isPrototypeOf(a) ? this._bodyText = a.toString() : c.arrayBuffer && c.blob && p(a) ? (this._bodyArrayBuffer = k(a.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : c.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(a) || m(a)) ? this._bodyArrayBuffer = k(a) : this._bodyText = a = Object.prototype.toString.call(a) : this._bodyText = "", this.headers.get("content-type") || (typeof a == "string" ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : c.searchParams && URLSearchParams.prototype.isPrototypeOf(a) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"));
|
|
3248
3253
|
}, c.blob && (this.blob = function() {
|
|
3249
3254
|
var a = N(this);
|
|
3250
3255
|
if (a)
|
|
@@ -3257,7 +3262,7 @@ var ye = { exports: {} };
|
|
|
3257
3262
|
throw new Error("could not read FormData body as blob");
|
|
3258
3263
|
return Promise.resolve(new Blob([this._bodyText]));
|
|
3259
3264
|
}, this.arrayBuffer = function() {
|
|
3260
|
-
return this._bodyArrayBuffer ? N(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(
|
|
3265
|
+
return this._bodyArrayBuffer ? N(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then(O);
|
|
3261
3266
|
}), this.text = function() {
|
|
3262
3267
|
var a = N(this);
|
|
3263
3268
|
if (a)
|
|
@@ -3300,17 +3305,17 @@ var ye = { exports: {} };
|
|
|
3300
3305
|
var l = new FormData();
|
|
3301
3306
|
return a.trim().split("&").forEach(function(E) {
|
|
3302
3307
|
if (E) {
|
|
3303
|
-
var R = E.split("="),
|
|
3304
|
-
l.append(decodeURIComponent(
|
|
3308
|
+
var R = E.split("="), S = R.shift().replace(/\+/g, " "), A = R.join("=").replace(/\+/g, " ");
|
|
3309
|
+
l.append(decodeURIComponent(S), decodeURIComponent(A));
|
|
3305
3310
|
}
|
|
3306
3311
|
}), l;
|
|
3307
3312
|
}
|
|
3308
3313
|
function $e(a) {
|
|
3309
3314
|
var l = new g(), E = a.replace(/\r?\n[\t ]+/g, " ");
|
|
3310
3315
|
return E.split(/\r?\n/).forEach(function(R) {
|
|
3311
|
-
var
|
|
3316
|
+
var S = R.split(":"), A = S.shift().trim();
|
|
3312
3317
|
if (A) {
|
|
3313
|
-
var X =
|
|
3318
|
+
var X = S.join(":").trim();
|
|
3314
3319
|
l.append(A, X);
|
|
3315
3320
|
}
|
|
3316
3321
|
}), l;
|
|
@@ -3347,8 +3352,8 @@ var ye = { exports: {} };
|
|
|
3347
3352
|
}
|
|
3348
3353
|
function ae(a, l) {
|
|
3349
3354
|
return new Promise(function(E, R) {
|
|
3350
|
-
var
|
|
3351
|
-
if (
|
|
3355
|
+
var S = new w(a, l);
|
|
3356
|
+
if (S.signal && S.signal.aborted)
|
|
3352
3357
|
return R(new o.DOMException("Aborted", "AbortError"));
|
|
3353
3358
|
var A = new XMLHttpRequest();
|
|
3354
3359
|
function X() {
|
|
@@ -3369,11 +3374,11 @@ var ye = { exports: {} };
|
|
|
3369
3374
|
R(new TypeError("Network request failed"));
|
|
3370
3375
|
}, A.onabort = function() {
|
|
3371
3376
|
R(new o.DOMException("Aborted", "AbortError"));
|
|
3372
|
-
}, A.open(
|
|
3377
|
+
}, A.open(S.method, S.url, !0), S.credentials === "include" ? A.withCredentials = !0 : S.credentials === "omit" && (A.withCredentials = !1), "responseType" in A && c.blob && (A.responseType = "blob"), S.headers.forEach(function(V, ue) {
|
|
3373
3378
|
A.setRequestHeader(ue, V);
|
|
3374
|
-
}),
|
|
3375
|
-
A.readyState === 4 &&
|
|
3376
|
-
}), A.send(typeof
|
|
3379
|
+
}), S.signal && (S.signal.addEventListener("abort", X), A.onreadystatechange = function() {
|
|
3380
|
+
A.readyState === 4 && S.signal.removeEventListener("abort", X);
|
|
3381
|
+
}), A.send(typeof S._bodyInit > "u" ? null : S._bodyInit);
|
|
3377
3382
|
});
|
|
3378
3383
|
}
|
|
3379
3384
|
return ae.polyfill = !0, s.fetch || (s.fetch = ae, s.Headers = g, s.Request = w, s.Response = L), o.Headers = g, o.Request = w, o.Response = L, o.fetch = ae, Object.defineProperty(o, "__esModule", { value: !0 }), o;
|
|
@@ -3404,9 +3409,9 @@ const te = /* @__PURE__ */ mn(ie), gn = /* @__PURE__ */ ze({
|
|
|
3404
3409
|
}), r), []);
|
|
3405
3410
|
return `query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`;
|
|
3406
3411
|
}, Cn = (e) => async (t) => {
|
|
3407
|
-
const { url: n, query: r, variables: i, operationName: s, fetch: o, fetchOptions: c, middleware:
|
|
3412
|
+
const { url: n, query: r, variables: i, operationName: s, fetch: o, fetchOptions: c, middleware: p } = t, h = { ...t.headers };
|
|
3408
3413
|
let m = "", y;
|
|
3409
|
-
e === "POST" ? (y = vn(r, i, s, c.jsonSerializer), typeof y == "string" && (
|
|
3414
|
+
e === "POST" ? (y = vn(r, i, s, c.jsonSerializer), typeof y == "string" && (h["Content-Type"] = "application/json")) : m = yn({
|
|
3410
3415
|
query: r,
|
|
3411
3416
|
variables: i,
|
|
3412
3417
|
operationName: s,
|
|
@@ -3414,21 +3419,21 @@ const te = /* @__PURE__ */ mn(ie), gn = /* @__PURE__ */ ze({
|
|
|
3414
3419
|
});
|
|
3415
3420
|
const C = {
|
|
3416
3421
|
method: e,
|
|
3417
|
-
headers:
|
|
3422
|
+
headers: h,
|
|
3418
3423
|
body: y,
|
|
3419
3424
|
...c
|
|
3420
3425
|
};
|
|
3421
3426
|
let T = n, g = C;
|
|
3422
|
-
if (
|
|
3423
|
-
const N = await Promise.resolve(
|
|
3424
|
-
T =
|
|
3427
|
+
if (p) {
|
|
3428
|
+
const N = await Promise.resolve(p({ ...C, url: n, operationName: s, variables: i })), { url: D, ...O } = N;
|
|
3429
|
+
T = D, g = O;
|
|
3425
3430
|
}
|
|
3426
3431
|
return m && (T = `${T}?${m}`), await o(T, g);
|
|
3427
3432
|
};
|
|
3428
3433
|
class En {
|
|
3429
3434
|
constructor(t, n = {}) {
|
|
3430
3435
|
this.url = t, this.requestConfig = n, this.rawRequest = async (...r) => {
|
|
3431
|
-
const [i, s, o] = r, c =
|
|
3436
|
+
const [i, s, o] = r, c = pn(i, s, o), { headers: p, fetch: h = te, method: m = "POST", requestMiddleware: y, responseMiddleware: C, ...T } = this.requestConfig, { url: g } = this;
|
|
3432
3437
|
c.signal !== void 0 && (T.signal = c.signal);
|
|
3433
3438
|
const { operationName: N } = le(c.query);
|
|
3434
3439
|
return de({
|
|
@@ -3436,21 +3441,21 @@ class En {
|
|
|
3436
3441
|
query: c.query,
|
|
3437
3442
|
variables: c.variables,
|
|
3438
3443
|
headers: {
|
|
3439
|
-
...U(
|
|
3444
|
+
...U(pe(p)),
|
|
3440
3445
|
...U(c.requestHeaders)
|
|
3441
3446
|
},
|
|
3442
3447
|
operationName: N,
|
|
3443
|
-
fetch:
|
|
3448
|
+
fetch: h,
|
|
3444
3449
|
method: m,
|
|
3445
3450
|
fetchOptions: T,
|
|
3446
3451
|
middleware: y
|
|
3447
|
-
}).then((
|
|
3448
|
-
throw C && C(
|
|
3452
|
+
}).then((D) => (C && C(D), D)).catch((D) => {
|
|
3453
|
+
throw C && C(D), D;
|
|
3449
3454
|
});
|
|
3450
3455
|
};
|
|
3451
3456
|
}
|
|
3452
3457
|
async request(t, ...n) {
|
|
3453
|
-
const [r, i] = n, s = dn(t, r, i), { headers: o, fetch: c = te, method:
|
|
3458
|
+
const [r, i] = n, s = dn(t, r, i), { headers: o, fetch: c = te, method: p = "POST", requestMiddleware: h, responseMiddleware: m, ...y } = this.requestConfig, { url: C } = this;
|
|
3454
3459
|
s.signal !== void 0 && (y.signal = s.signal);
|
|
3455
3460
|
const { query: T, operationName: g } = le(s.document);
|
|
3456
3461
|
return de({
|
|
@@ -3458,30 +3463,30 @@ class En {
|
|
|
3458
3463
|
query: T,
|
|
3459
3464
|
variables: s.variables,
|
|
3460
3465
|
headers: {
|
|
3461
|
-
...U(
|
|
3466
|
+
...U(pe(o)),
|
|
3462
3467
|
...U(s.requestHeaders)
|
|
3463
3468
|
},
|
|
3464
3469
|
operationName: g,
|
|
3465
3470
|
fetch: c,
|
|
3466
|
-
method:
|
|
3471
|
+
method: p,
|
|
3467
3472
|
fetchOptions: y,
|
|
3468
|
-
middleware:
|
|
3473
|
+
middleware: h
|
|
3469
3474
|
}).then((N) => (m && m(N), N.data)).catch((N) => {
|
|
3470
3475
|
throw m && m(N), N;
|
|
3471
3476
|
});
|
|
3472
3477
|
}
|
|
3473
3478
|
// prettier-ignore
|
|
3474
3479
|
batchRequests(t, n) {
|
|
3475
|
-
const r =
|
|
3480
|
+
const r = hn(t, n), { headers: i, ...s } = this.requestConfig;
|
|
3476
3481
|
r.signal !== void 0 && (s.signal = r.signal);
|
|
3477
|
-
const o = r.documents.map(({ document:
|
|
3482
|
+
const o = r.documents.map(({ document: p }) => le(p).query), c = r.documents.map(({ variables: p }) => p);
|
|
3478
3483
|
return de({
|
|
3479
3484
|
url: this.url,
|
|
3480
3485
|
query: o,
|
|
3481
3486
|
// @ts-expect-error TODO reconcile batch variables into system.
|
|
3482
3487
|
variables: c,
|
|
3483
3488
|
headers: {
|
|
3484
|
-
...U(
|
|
3489
|
+
...U(pe(i)),
|
|
3485
3490
|
...U(r.requestHeaders)
|
|
3486
3491
|
},
|
|
3487
3492
|
operationName: void 0,
|
|
@@ -3489,8 +3494,8 @@ class En {
|
|
|
3489
3494
|
method: this.requestConfig.method || "POST",
|
|
3490
3495
|
fetchOptions: s,
|
|
3491
3496
|
middleware: this.requestConfig.requestMiddleware
|
|
3492
|
-
}).then((
|
|
3493
|
-
throw this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(
|
|
3497
|
+
}).then((p) => (this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(p), p.data)).catch((p) => {
|
|
3498
|
+
throw this.requestConfig.responseMiddleware && this.requestConfig.responseMiddleware(p), p;
|
|
3494
3499
|
});
|
|
3495
3500
|
}
|
|
3496
3501
|
setHeaders(t) {
|
|
@@ -3511,8 +3516,8 @@ class En {
|
|
|
3511
3516
|
}
|
|
3512
3517
|
}
|
|
3513
3518
|
const de = async (e) => {
|
|
3514
|
-
const { query: t, variables: n, fetchOptions: r } = e, i = Cn(cn(e.method ?? "post")), s = Array.isArray(e.query), o = await i(e), c = await An(o, r.jsonSerializer ?? ve),
|
|
3515
|
-
if (o.ok &&
|
|
3519
|
+
const { query: t, variables: n, fetchOptions: r } = e, i = Cn(cn(e.method ?? "post")), s = Array.isArray(e.query), o = await i(e), c = await An(o, r.jsonSerializer ?? ve), p = Array.isArray(c) ? !c.some(({ data: m }) => !m) : !!c.data, h = Array.isArray(c) || !c.errors || Array.isArray(c.errors) && !c.errors.length || r.errorPolicy === "all" || r.errorPolicy === "ignore";
|
|
3520
|
+
if (o.ok && h && p) {
|
|
3516
3521
|
const { errors: m, ...y } = (Array.isArray(c), c), C = r.errorPolicy === "ignore" ? y : c;
|
|
3517
3522
|
return {
|
|
3518
3523
|
...s ? { data: C } : C,
|
|
@@ -3535,14 +3540,14 @@ const de = async (e) => {
|
|
|
3535
3540
|
return i.stringify({ query: e, variables: t, operationName: n });
|
|
3536
3541
|
if (typeof t < "u" && !Array.isArray(t))
|
|
3537
3542
|
throw new Error("Cannot create request body with given variable type, array expected");
|
|
3538
|
-
const s = e.reduce((o, c,
|
|
3543
|
+
const s = e.reduce((o, c, p) => (o.push({ query: c, variables: t ? t[p] : void 0 }), o), []);
|
|
3539
3544
|
return i.stringify(s);
|
|
3540
3545
|
}, An = async (e, t) => {
|
|
3541
3546
|
let n;
|
|
3542
3547
|
return e.headers.forEach((r, i) => {
|
|
3543
3548
|
i.toLowerCase() === "content-type" && (n = r);
|
|
3544
3549
|
}), n && (n.toLowerCase().startsWith("application/json") || n.toLowerCase().startsWith("application/graphql+json") || n.toLowerCase().startsWith("application/graphql-response+json")) ? t.parse(await e.text()) : e.text();
|
|
3545
|
-
},
|
|
3550
|
+
}, pe = (e) => typeof e == "function" ? e() : e;
|
|
3546
3551
|
var Tn = /* @__PURE__ */ ((e) => (e.Eur = "EUR", e.Jpy = "JPY", e.Usd = "USD", e))(Tn || {});
|
|
3547
3552
|
class In {
|
|
3548
3553
|
constructor(t) {
|
|
@@ -3640,14 +3645,18 @@ class In {
|
|
|
3640
3645
|
})).purchasingCustomerMetafield ?? null;
|
|
3641
3646
|
}
|
|
3642
3647
|
/**
|
|
3643
|
-
* getPoints
|
|
3644
|
-
* 存在しない場合は0を返します。
|
|
3648
|
+
* getPoints は、Points は SDK から取得できるポイントの情報を返します。
|
|
3645
3649
|
*/
|
|
3646
3650
|
async getPoints() {
|
|
3647
3651
|
const t = await this.api.GetPoints();
|
|
3648
3652
|
return t.purchasingCustomer ? {
|
|
3649
3653
|
pointsApproved: t.purchasingCustomer.pointsApproved,
|
|
3650
|
-
pointsPending: t.purchasingCustomer.pointsPending
|
|
3654
|
+
pointsPending: t.purchasingCustomer.pointsPending,
|
|
3655
|
+
pointsExpiringSoon: t.purchasingCustomer.pointsExpiringSoon ? {
|
|
3656
|
+
points: t.purchasingCustomer.pointsExpiringSoon.points,
|
|
3657
|
+
expiresDate: new Date(t.purchasingCustomer.pointsExpiringSoon.expiresDate),
|
|
3658
|
+
availableUntil: new Date(t.purchasingCustomer.pointsExpiringSoon.availableUntil)
|
|
3659
|
+
} : void 0
|
|
3651
3660
|
} : null;
|
|
3652
3661
|
}
|
|
3653
3662
|
/**
|