mainstack-payments 2.0.2 → 2.0.4
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/build/{CashAppPayment-ByktxjXA.js → CashAppPayment-BghcQZPY.js} +44 -45
- package/build/{CryptoPayments-BkqcfMtz.js → CryptoPayments-eVW9ZpTq.js} +43 -44
- package/build/api/config.d.ts +10 -0
- package/build/api/index.d.ts +121 -0
- package/build/{src/components → components}/CheckoutForm.d.ts +7 -2
- package/build/{src/components → components}/PaymentOptions/CashAppPayment.d.ts +3 -2
- package/build/components/PaymentOptions/CryptoPayments.d.ts +12 -0
- package/build/{src/components → components}/WalletPay.d.ts +2 -2
- package/build/hooks/usePaystackPayment.d.ts +21 -0
- package/build/{index-BWm87vgg.js → index-OyliAwvi.js} +2088 -1988
- package/build/index.css +1 -1
- package/build/mainstack-payments.js +12 -10
- package/build/{payments-CjiNVkeO.js → payments-B3Hm80pK.js} +145 -143
- package/build/types/index.d.ts +233 -0
- package/package.json +3 -3
- package/build/src/api/config.d.ts +0 -7
- package/build/src/api/index.d.ts +0 -89
- package/build/src/components/PaymentOptions/CryptoPayments.d.ts +0 -11
- package/build/src/hooks/usePaystackPayment.d.ts +0 -31
- package/build/src/types/index.d.ts +0 -101
- /package/build/{src/app.d.ts → app.d.ts} +0 -0
- /package/build/{src/components → components}/ConfirmEmailModal.d.ts +0 -0
- /package/build/{src/components → components}/ContactAction.d.ts +0 -0
- /package/build/{src/components → components}/ContactForm.d.ts +0 -0
- /package/build/{src/components → components}/Payment.d.ts +0 -0
- /package/build/{src/components → components}/PaymentActionModal.d.ts +0 -0
- /package/build/{src/components → components}/PaymentOptions/PaystackPayments.d.ts +0 -0
- /package/build/{src/components → components}/PaystackPaymentErrorModal.d.ts +0 -0
- /package/build/{src/components → components}/PrivacyPolicy.d.ts +0 -0
- /package/build/{src/components → components}/SummaryCard.d.ts +0 -0
- /package/build/{src/components → components}/UI/CardButton.d.ts +0 -0
- /package/build/{src/components → components}/UI/Collapse.d.ts +0 -0
- /package/build/{src/components → components}/UI/PaymentsDivider.d.ts +0 -0
- /package/build/{src/components → components}/UI/icons/AfricanPayIcon.d.ts +0 -0
- /package/build/{src/components → components}/UI/icons/ApplePayIcon.d.ts +0 -0
- /package/build/{src/components → components}/UI/icons/CashAppIcon.d.ts +0 -0
- /package/build/{src/components → components}/UI/icons/CheckoutCardIcon.d.ts +0 -0
- /package/build/{src/components → components}/UI/icons/CryptoIcon.d.ts +0 -0
- /package/build/{src/components → components}/UI/icons/GooglePayIcon.d.ts +0 -0
- /package/build/{src/components → components}/UI/icons/MainstackLogo.d.ts +0 -0
- /package/build/{src/constants → constants}/index.d.ts +0 -0
- /package/build/{src/enums → enums}/currenciesEnums.d.ts +0 -0
- /package/build/{src/hooks → hooks}/useApi.d.ts +0 -0
- /package/build/{src/hooks → hooks}/useDebounce.d.ts +0 -0
- /package/build/{src/hooks → hooks}/usePayment.d.ts +0 -0
- /package/build/{src/hooks → hooks}/useSmoothScroll.d.ts +0 -0
- /package/build/{src/index.d.ts → index.d.ts} +0 -0
- /package/build/{src/pages → pages}/DiscountCode.d.ts +0 -0
- /package/build/{src/pages → pages}/Home.d.ts +0 -0
- /package/build/{src/pages → pages}/Login.d.ts +0 -0
- /package/build/{src/pages → pages}/Page404.d.ts +0 -0
- /package/build/{src/pages → pages}/PaymentRedirect.d.ts +0 -0
- /package/build/{src/pages → pages}/index.d.ts +0 -0
- /package/build/{src/provider → provider}/index.d.ts +0 -0
- /package/build/{src/routes → routes}/index.d.ts +0 -0
- /package/build/{src/utils → utils}/ValidatePostcode.d.ts +0 -0
- /package/build/{src/utils → utils}/countries_flag.json.d.ts +0 -0
- /package/build/{src/utils → utils}/countries_with_flags_and_currencies.json.d.ts +0 -0
- /package/build/{src/utils → utils}/formatUnderscoreText.d.ts +0 -0
- /package/build/{src/utils → utils}/index.d.ts +0 -0
- /package/build/{src/utils → utils}/stringifyPrice.d.ts +0 -0
- /package/build/{src/utils → utils}/validations.d.ts +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _ from "react";
|
|
2
|
-
function
|
|
2
|
+
function Ge(r) {
|
|
3
3
|
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
4
4
|
}
|
|
5
|
-
var
|
|
5
|
+
var Ee = { exports: {} }, ue = { exports: {} }, R = {};
|
|
6
6
|
/** @license React v16.13.1
|
|
7
7
|
* react-is.production.min.js
|
|
8
8
|
*
|
|
@@ -12,7 +12,7 @@ var he = { exports: {} }, Ee = { exports: {} }, R = {};
|
|
|
12
12
|
* LICENSE file in the root directory of this source tree.
|
|
13
13
|
*/
|
|
14
14
|
var Te;
|
|
15
|
-
function
|
|
15
|
+
function He() {
|
|
16
16
|
if (Te) return R;
|
|
17
17
|
Te = 1;
|
|
18
18
|
var r = typeof Symbol == "function" && Symbol.for, e = r ? Symbol.for("react.element") : 60103, t = r ? Symbol.for("react.portal") : 60106, n = r ? Symbol.for("react.fragment") : 60107, c = r ? Symbol.for("react.strict_mode") : 60108, a = r ? Symbol.for("react.profiler") : 60114, p = r ? Symbol.for("react.provider") : 60109, l = r ? Symbol.for("react.context") : 60110, f = r ? Symbol.for("react.async_mode") : 60111, h = r ? Symbol.for("react.concurrent_mode") : 60111, d = r ? Symbol.for("react.forward_ref") : 60112, y = r ? Symbol.for("react.suspense") : 60113, g = r ? Symbol.for("react.suspense_list") : 60120, A = r ? Symbol.for("react.memo") : 60115, I = r ? Symbol.for("react.lazy") : 60116, O = r ? Symbol.for("react.block") : 60121, k = r ? Symbol.for("react.fundamental") : 60117, Y = r ? Symbol.for("react.responder") : 60118, X = r ? Symbol.for("react.scope") : 60119;
|
|
@@ -87,7 +87,7 @@ var x = {};
|
|
|
87
87
|
* LICENSE file in the root directory of this source tree.
|
|
88
88
|
*/
|
|
89
89
|
var Pe;
|
|
90
|
-
function
|
|
90
|
+
function Xe() {
|
|
91
91
|
return Pe || (Pe = 1, process.env.NODE_ENV !== "production" && function() {
|
|
92
92
|
var r = typeof Symbol == "function" && Symbol.for, e = r ? Symbol.for("react.element") : 60103, t = r ? Symbol.for("react.portal") : 60106, n = r ? Symbol.for("react.fragment") : 60107, c = r ? Symbol.for("react.strict_mode") : 60108, a = r ? Symbol.for("react.profiler") : 60114, p = r ? Symbol.for("react.provider") : 60109, l = r ? Symbol.for("react.context") : 60110, f = r ? Symbol.for("react.async_mode") : 60111, h = r ? Symbol.for("react.concurrent_mode") : 60111, d = r ? Symbol.for("react.forward_ref") : 60112, y = r ? Symbol.for("react.suspense") : 60113, g = r ? Symbol.for("react.suspense_list") : 60120, A = r ? Symbol.for("react.memo") : 60115, I = r ? Symbol.for("react.lazy") : 60116, O = r ? Symbol.for("react.block") : 60121, k = r ? Symbol.for("react.fundamental") : 60117, Y = r ? Symbol.for("react.responder") : 60118, X = r ? Symbol.for("react.scope") : 60119;
|
|
93
93
|
function $(u) {
|
|
@@ -169,17 +169,19 @@ function He() {
|
|
|
169
169
|
x.AsyncMode = s, x.ConcurrentMode = z, x.ContextConsumer = ee, x.ContextProvider = re, x.Element = te, x.ForwardRef = K, x.Fragment = V, x.Lazy = G, x.Memo = ne, x.Portal = J, x.Profiler = W, x.StrictMode = F, x.Suspense = D, x.isAsyncMode = Z, x.isConcurrentMode = o, x.isContextConsumer = i, x.isContextProvider = C, x.isElement = E, x.isForwardRef = v, x.isFragment = S, x.isLazy = m, x.isMemo = b, x.isPortal = T, x.isProfiler = w, x.isStrictMode = P, x.isSuspense = U, x.isValidElementType = $, x.typeOf = M;
|
|
170
170
|
}()), x;
|
|
171
171
|
}
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
var Oe;
|
|
173
|
+
function We() {
|
|
174
|
+
return Oe || (Oe = 1, process.env.NODE_ENV === "production" ? ue.exports = He() : ue.exports = Xe()), ue.exports;
|
|
175
|
+
}
|
|
174
176
|
/*
|
|
175
177
|
object-assign
|
|
176
178
|
(c) Sindre Sorhus
|
|
177
179
|
@license MIT
|
|
178
180
|
*/
|
|
179
|
-
var
|
|
180
|
-
function
|
|
181
|
-
if (
|
|
182
|
-
|
|
181
|
+
var pe, Re;
|
|
182
|
+
function Ze() {
|
|
183
|
+
if (Re) return pe;
|
|
184
|
+
Re = 1;
|
|
183
185
|
var r = Object.getOwnPropertySymbols, e = Object.prototype.hasOwnProperty, t = Object.prototype.propertyIsEnumerable;
|
|
184
186
|
function n(a) {
|
|
185
187
|
if (a == null)
|
|
@@ -208,7 +210,7 @@ function Xe() {
|
|
|
208
210
|
return !1;
|
|
209
211
|
}
|
|
210
212
|
}
|
|
211
|
-
return
|
|
213
|
+
return pe = c() ? Object.assign : function(a, p) {
|
|
212
214
|
for (var l, f = n(a), h, d = 1; d < arguments.length; d++) {
|
|
213
215
|
l = Object(arguments[d]);
|
|
214
216
|
for (var y in l)
|
|
@@ -220,27 +222,27 @@ function Xe() {
|
|
|
220
222
|
}
|
|
221
223
|
}
|
|
222
224
|
return f;
|
|
223
|
-
},
|
|
225
|
+
}, pe;
|
|
224
226
|
}
|
|
225
|
-
var
|
|
227
|
+
var de, xe;
|
|
226
228
|
function Ce() {
|
|
227
|
-
if (
|
|
228
|
-
|
|
229
|
+
if (xe) return de;
|
|
230
|
+
xe = 1;
|
|
229
231
|
var r = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
230
|
-
return
|
|
231
|
-
}
|
|
232
|
-
var de, xe;
|
|
233
|
-
function We() {
|
|
234
|
-
return xe || (xe = 1, de = Function.call.bind(Object.prototype.hasOwnProperty)), de;
|
|
232
|
+
return de = r, de;
|
|
235
233
|
}
|
|
236
234
|
var ve, we;
|
|
237
|
-
function
|
|
238
|
-
|
|
239
|
-
|
|
235
|
+
function Ye() {
|
|
236
|
+
return we || (we = 1, ve = Function.call.bind(Object.prototype.hasOwnProperty)), ve;
|
|
237
|
+
}
|
|
238
|
+
var ye, _e;
|
|
239
|
+
function Qe() {
|
|
240
|
+
if (_e) return ye;
|
|
241
|
+
_e = 1;
|
|
240
242
|
var r = function() {
|
|
241
243
|
};
|
|
242
244
|
if (process.env.NODE_ENV !== "production") {
|
|
243
|
-
var e = Ce(), t = {}, n =
|
|
245
|
+
var e = Ce(), t = {}, n = Ye();
|
|
244
246
|
r = function(a) {
|
|
245
247
|
var p = "Warning: " + a;
|
|
246
248
|
typeof console < "u" && console.error(p);
|
|
@@ -280,13 +282,13 @@ function Ze() {
|
|
|
280
282
|
}
|
|
281
283
|
return c.resetWarningCache = function() {
|
|
282
284
|
process.env.NODE_ENV !== "production" && (t = {});
|
|
283
|
-
},
|
|
285
|
+
}, ye = c, ye;
|
|
284
286
|
}
|
|
285
|
-
var
|
|
286
|
-
function
|
|
287
|
-
if (
|
|
288
|
-
|
|
289
|
-
var r =
|
|
287
|
+
var me, Ae;
|
|
288
|
+
function er() {
|
|
289
|
+
if (Ae) return me;
|
|
290
|
+
Ae = 1;
|
|
291
|
+
var r = We(), e = Ze(), t = Ce(), n = Ye(), c = Qe(), a = function() {
|
|
290
292
|
};
|
|
291
293
|
process.env.NODE_ENV !== "production" && (a = function(l) {
|
|
292
294
|
var f = "Warning: " + l;
|
|
@@ -299,7 +301,7 @@ function Qe() {
|
|
|
299
301
|
function p() {
|
|
300
302
|
return null;
|
|
301
303
|
}
|
|
302
|
-
return
|
|
304
|
+
return me = function(l, f) {
|
|
303
305
|
var h = typeof Symbol == "function" && Symbol.iterator, d = "@@iterator";
|
|
304
306
|
function y(o) {
|
|
305
307
|
var i = o && (h && o[h] || o[d]);
|
|
@@ -601,18 +603,18 @@ Valid keys: ` + JSON.stringify(Object.keys(o), null, " ")
|
|
|
601
603
|
return !o.constructor || !o.constructor.name ? g : o.constructor.name;
|
|
602
604
|
}
|
|
603
605
|
return A.checkPropTypes = c, A.resetWarningCache = c.resetWarningCache, A.PropTypes = A, A;
|
|
604
|
-
},
|
|
606
|
+
}, me;
|
|
605
607
|
}
|
|
606
|
-
var
|
|
607
|
-
function
|
|
608
|
-
if (
|
|
609
|
-
|
|
608
|
+
var he, je;
|
|
609
|
+
function rr() {
|
|
610
|
+
if (je) return he;
|
|
611
|
+
je = 1;
|
|
610
612
|
var r = Ce();
|
|
611
613
|
function e() {
|
|
612
614
|
}
|
|
613
615
|
function t() {
|
|
614
616
|
}
|
|
615
|
-
return t.resetWarningCache = e,
|
|
617
|
+
return t.resetWarningCache = e, he = function() {
|
|
616
618
|
function n(p, l, f, h, d, y) {
|
|
617
619
|
if (y !== r) {
|
|
618
620
|
var g = new Error(
|
|
@@ -649,16 +651,16 @@ function er() {
|
|
|
649
651
|
resetWarningCache: e
|
|
650
652
|
};
|
|
651
653
|
return a.PropTypes = a, a;
|
|
652
|
-
},
|
|
654
|
+
}, he;
|
|
653
655
|
}
|
|
654
656
|
if (process.env.NODE_ENV !== "production") {
|
|
655
|
-
var
|
|
656
|
-
|
|
657
|
+
var tr = We(), nr = !0;
|
|
658
|
+
Ee.exports = er()(tr.isElement, nr);
|
|
657
659
|
} else
|
|
658
|
-
|
|
659
|
-
var
|
|
660
|
-
const j = /* @__PURE__ */
|
|
661
|
-
function
|
|
660
|
+
Ee.exports = rr()();
|
|
661
|
+
var or = Ee.exports;
|
|
662
|
+
const j = /* @__PURE__ */ Ge(or);
|
|
663
|
+
function ke(r, e) {
|
|
662
664
|
var t = Object.keys(r);
|
|
663
665
|
if (Object.getOwnPropertySymbols) {
|
|
664
666
|
var n = Object.getOwnPropertySymbols(r);
|
|
@@ -668,26 +670,26 @@ function je(r, e) {
|
|
|
668
670
|
}
|
|
669
671
|
return t;
|
|
670
672
|
}
|
|
671
|
-
function
|
|
673
|
+
function Ie(r) {
|
|
672
674
|
for (var e = 1; e < arguments.length; e++) {
|
|
673
675
|
var t = arguments[e] != null ? arguments[e] : {};
|
|
674
|
-
e % 2 ?
|
|
675
|
-
|
|
676
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(t)) :
|
|
676
|
+
e % 2 ? ke(Object(t), !0).forEach(function(n) {
|
|
677
|
+
De(r, n, t[n]);
|
|
678
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(t)) : ke(Object(t)).forEach(function(n) {
|
|
677
679
|
Object.defineProperty(r, n, Object.getOwnPropertyDescriptor(t, n));
|
|
678
680
|
});
|
|
679
681
|
}
|
|
680
682
|
return r;
|
|
681
683
|
}
|
|
682
|
-
function
|
|
684
|
+
function fe(r) {
|
|
683
685
|
"@babel/helpers - typeof";
|
|
684
|
-
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ?
|
|
686
|
+
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? fe = function(e) {
|
|
685
687
|
return typeof e;
|
|
686
|
-
} :
|
|
688
|
+
} : fe = function(e) {
|
|
687
689
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
688
|
-
},
|
|
690
|
+
}, fe(r);
|
|
689
691
|
}
|
|
690
|
-
function
|
|
692
|
+
function De(r, e, t) {
|
|
691
693
|
return e in r ? Object.defineProperty(r, e, {
|
|
692
694
|
value: t,
|
|
693
695
|
enumerable: !0,
|
|
@@ -695,13 +697,13 @@ function Ye(r, e, t) {
|
|
|
695
697
|
writable: !0
|
|
696
698
|
}) : r[e] = t, r;
|
|
697
699
|
}
|
|
698
|
-
function
|
|
699
|
-
return
|
|
700
|
+
function Ue(r, e) {
|
|
701
|
+
return ar(r) || ir(r, e) || ur(r, e) || sr();
|
|
700
702
|
}
|
|
701
|
-
function
|
|
703
|
+
function ar(r) {
|
|
702
704
|
if (Array.isArray(r)) return r;
|
|
703
705
|
}
|
|
704
|
-
function
|
|
706
|
+
function ir(r, e) {
|
|
705
707
|
var t = r && (typeof Symbol < "u" && r[Symbol.iterator] || r["@@iterator"]);
|
|
706
708
|
if (t != null) {
|
|
707
709
|
var n = [], c = !0, a = !1, p, l;
|
|
@@ -720,20 +722,20 @@ function ar(r, e) {
|
|
|
720
722
|
return n;
|
|
721
723
|
}
|
|
722
724
|
}
|
|
723
|
-
function
|
|
725
|
+
function ur(r, e) {
|
|
724
726
|
if (r) {
|
|
725
|
-
if (typeof r == "string") return
|
|
727
|
+
if (typeof r == "string") return Me(r, e);
|
|
726
728
|
var t = Object.prototype.toString.call(r).slice(8, -1);
|
|
727
729
|
if (t === "Object" && r.constructor && (t = r.constructor.name), t === "Map" || t === "Set") return Array.from(r);
|
|
728
|
-
if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return
|
|
730
|
+
if (t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)) return Me(r, e);
|
|
729
731
|
}
|
|
730
732
|
}
|
|
731
|
-
function
|
|
733
|
+
function Me(r, e) {
|
|
732
734
|
(e == null || e > r.length) && (e = r.length);
|
|
733
735
|
for (var t = 0, n = new Array(e); t < e; t++) n[t] = r[t];
|
|
734
736
|
return n;
|
|
735
737
|
}
|
|
736
|
-
function
|
|
738
|
+
function sr() {
|
|
737
739
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
738
740
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
739
741
|
}
|
|
@@ -758,17 +760,17 @@ var N = function(e, t, n) {
|
|
|
758
760
|
t.current = e;
|
|
759
761
|
}, [e]), t.current;
|
|
760
762
|
}, Q = function(e) {
|
|
761
|
-
return e !== null &&
|
|
762
|
-
}, sr = function(e) {
|
|
763
|
-
return Q(e) && typeof e.then == "function";
|
|
763
|
+
return e !== null && fe(e) === "object";
|
|
764
764
|
}, cr = function(e) {
|
|
765
|
+
return Q(e) && typeof e.then == "function";
|
|
766
|
+
}, fr = function(e) {
|
|
765
767
|
return Q(e) && typeof e.elements == "function" && typeof e.createToken == "function" && typeof e.createPaymentMethod == "function" && typeof e.confirmCardPayment == "function";
|
|
766
|
-
},
|
|
768
|
+
}, $e = "[object Object]", lr = function r(e, t) {
|
|
767
769
|
if (!Q(e) || !Q(t))
|
|
768
770
|
return e === t;
|
|
769
771
|
var n = Array.isArray(e), c = Array.isArray(t);
|
|
770
772
|
if (n !== c) return !1;
|
|
771
|
-
var a = Object.prototype.toString.call(e) ===
|
|
773
|
+
var a = Object.prototype.toString.call(e) === $e, p = Object.prototype.toString.call(t) === $e;
|
|
772
774
|
if (a !== p) return !1;
|
|
773
775
|
if (!a && !n) return e === t;
|
|
774
776
|
var l = Object.keys(e), f = Object.keys(t);
|
|
@@ -784,33 +786,33 @@ var N = function(e, t, n) {
|
|
|
784
786
|
return r(A[Y], I[Y]);
|
|
785
787
|
};
|
|
786
788
|
return g.every(O);
|
|
787
|
-
},
|
|
789
|
+
}, Ne = function(e, t, n) {
|
|
788
790
|
return Q(e) ? Object.keys(e).reduce(function(c, a) {
|
|
789
|
-
var p = !Q(t) || !
|
|
790
|
-
return n.includes(a) ? (p && console.warn("Unsupported prop change: options.".concat(a, " is not a mutable property.")), c) : p ?
|
|
791
|
+
var p = !Q(t) || !lr(e[a], t[a]);
|
|
792
|
+
return n.includes(a) ? (p && console.warn("Unsupported prop change: options.".concat(a, " is not a mutable property.")), c) : p ? Ie(Ie({}, c || {}), {}, De({}, a, e[a])) : c;
|
|
791
793
|
}, null) : null;
|
|
792
|
-
},
|
|
793
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] :
|
|
794
|
-
if (e === null ||
|
|
794
|
+
}, Fe = "Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.", Le = function(e) {
|
|
795
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Fe;
|
|
796
|
+
if (e === null || fr(e))
|
|
795
797
|
return e;
|
|
796
798
|
throw new Error(t);
|
|
797
|
-
},
|
|
798
|
-
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] :
|
|
799
|
-
if (
|
|
799
|
+
}, pr = function(e) {
|
|
800
|
+
var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : Fe;
|
|
801
|
+
if (cr(e))
|
|
800
802
|
return {
|
|
801
803
|
tag: "async",
|
|
802
804
|
stripePromise: Promise.resolve(e).then(function(c) {
|
|
803
|
-
return
|
|
805
|
+
return Le(c, t);
|
|
804
806
|
})
|
|
805
807
|
};
|
|
806
|
-
var n =
|
|
808
|
+
var n = Le(e, t);
|
|
807
809
|
return n === null ? {
|
|
808
810
|
tag: "empty"
|
|
809
811
|
} : {
|
|
810
812
|
tag: "sync",
|
|
811
813
|
stripe: n
|
|
812
814
|
};
|
|
813
|
-
},
|
|
815
|
+
}, dr = function(e) {
|
|
814
816
|
!e || !e._registerWrapper || !e.registerAppInfo || (e._registerWrapper({
|
|
815
817
|
name: "react-stripe-js",
|
|
816
818
|
version: "2.7.0"
|
|
@@ -819,21 +821,21 @@ var N = function(e, t, n) {
|
|
|
819
821
|
version: "2.7.0",
|
|
820
822
|
url: "https://stripe.com/docs/stripe-js/react"
|
|
821
823
|
}));
|
|
822
|
-
},
|
|
823
|
-
|
|
824
|
-
var
|
|
824
|
+
}, le = /* @__PURE__ */ _.createContext(null);
|
|
825
|
+
le.displayName = "ElementsContext";
|
|
826
|
+
var Be = function(e, t) {
|
|
825
827
|
if (!e)
|
|
826
828
|
throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t, " in an <Elements> provider."));
|
|
827
829
|
return e;
|
|
828
|
-
},
|
|
830
|
+
}, vr = function(e) {
|
|
829
831
|
var t = e.stripe, n = e.options, c = e.children, a = _.useMemo(function() {
|
|
830
|
-
return
|
|
832
|
+
return pr(t);
|
|
831
833
|
}, [t]), p = _.useState(function() {
|
|
832
834
|
return {
|
|
833
835
|
stripe: a.tag === "sync" ? a.stripe : null,
|
|
834
836
|
elements: a.tag === "sync" ? a.stripe.elements(n) : null
|
|
835
837
|
};
|
|
836
|
-
}), l =
|
|
838
|
+
}), l = Ue(p, 2), f = l[0], h = l[1];
|
|
837
839
|
_.useEffect(function() {
|
|
838
840
|
var g = !0, A = function(O) {
|
|
839
841
|
h(function(k) {
|
|
@@ -856,49 +858,49 @@ var Fe = function(e, t) {
|
|
|
856
858
|
var y = be(n);
|
|
857
859
|
return _.useEffect(function() {
|
|
858
860
|
if (f.elements) {
|
|
859
|
-
var g =
|
|
861
|
+
var g = Ne(n, y, ["clientSecret", "fonts"]);
|
|
860
862
|
g && f.elements.update(g);
|
|
861
863
|
}
|
|
862
864
|
}, [n, y, f.elements]), _.useEffect(function() {
|
|
863
|
-
|
|
864
|
-
}, [f.stripe]), /* @__PURE__ */ _.createElement(
|
|
865
|
+
dr(f.stripe);
|
|
866
|
+
}, [f.stripe]), /* @__PURE__ */ _.createElement(le.Provider, {
|
|
865
867
|
value: f
|
|
866
868
|
}, c);
|
|
867
869
|
};
|
|
868
|
-
|
|
870
|
+
vr.propTypes = {
|
|
869
871
|
stripe: j.any,
|
|
870
872
|
options: j.object
|
|
871
873
|
};
|
|
872
|
-
var
|
|
873
|
-
var t = _.useContext(
|
|
874
|
-
return
|
|
875
|
-
},
|
|
876
|
-
var e =
|
|
874
|
+
var yr = function(e) {
|
|
875
|
+
var t = _.useContext(le);
|
|
876
|
+
return Be(t, e);
|
|
877
|
+
}, wr = function() {
|
|
878
|
+
var e = yr("calls useElements()"), t = e.elements;
|
|
877
879
|
return t;
|
|
878
880
|
};
|
|
879
881
|
j.func.isRequired;
|
|
880
|
-
var
|
|
881
|
-
|
|
882
|
-
var
|
|
882
|
+
var ze = /* @__PURE__ */ _.createContext(null);
|
|
883
|
+
ze.displayName = "CustomCheckoutSdkContext";
|
|
884
|
+
var mr = function(e, t) {
|
|
883
885
|
if (!e)
|
|
884
886
|
throw new Error("Could not find CustomCheckoutProvider context; You need to wrap the part of your app that ".concat(t, " in an <CustomCheckoutProvider> provider."));
|
|
885
887
|
return e;
|
|
886
|
-
},
|
|
887
|
-
|
|
888
|
+
}, hr = /* @__PURE__ */ _.createContext(null);
|
|
889
|
+
hr.displayName = "CustomCheckoutContext";
|
|
888
890
|
j.any, j.shape({
|
|
889
891
|
clientSecret: j.string.isRequired,
|
|
890
892
|
elementsOptions: j.object
|
|
891
893
|
}).isRequired;
|
|
892
894
|
var ge = function(e) {
|
|
893
|
-
var t = _.useContext(
|
|
895
|
+
var t = _.useContext(ze), n = _.useContext(le);
|
|
894
896
|
if (t && n)
|
|
895
897
|
throw new Error("You cannot wrap the part of your app that ".concat(e, " in both <CustomCheckoutProvider> and <Elements> providers."));
|
|
896
|
-
return t ?
|
|
897
|
-
},
|
|
898
|
+
return t ? mr(t, e) : Be(n, e);
|
|
899
|
+
}, Er = function(e) {
|
|
898
900
|
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
899
901
|
}, L = function(e, t) {
|
|
900
|
-
var n = "".concat(
|
|
901
|
-
var h = f.id, d = f.className, y = f.options, g = y === void 0 ? {} : y, A = f.onBlur, I = f.onFocus, O = f.onReady, k = f.onChange, Y = f.onEscape, X = f.onClick, $ = f.onLoadError, M = f.onLoaderStart, s = f.onNetworksChange, z = f.onConfirm, ee = f.onCancel, re = f.onShippingAddressChange, te = f.onShippingRateChange, K = ge("mounts <".concat(n, ">")), V = "elements" in K ? K.elements : null, G = "customCheckoutSdk" in K ? K.customCheckoutSdk : null, ne = _.useState(null), J =
|
|
902
|
+
var n = "".concat(Er(e), "Element"), c = function(f) {
|
|
903
|
+
var h = f.id, d = f.className, y = f.options, g = y === void 0 ? {} : y, A = f.onBlur, I = f.onFocus, O = f.onReady, k = f.onChange, Y = f.onEscape, X = f.onClick, $ = f.onLoadError, M = f.onLoaderStart, s = f.onNetworksChange, z = f.onConfirm, ee = f.onCancel, re = f.onShippingAddressChange, te = f.onShippingRateChange, K = ge("mounts <".concat(n, ">")), V = "elements" in K ? K.elements : null, G = "customCheckoutSdk" in K ? K.customCheckoutSdk : null, ne = _.useState(null), J = Ue(ne, 2), W = J[0], F = J[1], D = _.useRef(null), H = _.useRef(null);
|
|
902
904
|
N(W, "blur", A), N(W, "focus", I), N(W, "escape", Y), N(W, "click", X), N(W, "loaderror", $), N(W, "loaderstart", M), N(W, "networkschange", s), N(W, "confirm", z), N(W, "cancel", ee), N(W, "shippingaddresschange", re), N(W, "shippingratechange", te), N(W, "change", k);
|
|
903
905
|
var Z;
|
|
904
906
|
O && (e === "expressCheckout" ? Z = O : Z = function() {
|
|
@@ -912,7 +914,7 @@ var ge = function(e) {
|
|
|
912
914
|
var o = be(g);
|
|
913
915
|
return _.useEffect(function() {
|
|
914
916
|
if (D.current) {
|
|
915
|
-
var i =
|
|
917
|
+
var i = Ne(g, o, ["paymentRequest"]);
|
|
916
918
|
i && D.current.update(i);
|
|
917
919
|
}
|
|
918
920
|
}, [g, o]), _.useLayoutEffect(function() {
|
|
@@ -954,15 +956,15 @@ var ge = function(e) {
|
|
|
954
956
|
onShippingRateChange: j.func,
|
|
955
957
|
options: j.object
|
|
956
958
|
}, p.displayName = n, p.__elementType = e, p;
|
|
957
|
-
}, q = typeof window > "u",
|
|
958
|
-
|
|
959
|
-
var
|
|
959
|
+
}, q = typeof window > "u", br = /* @__PURE__ */ _.createContext(null);
|
|
960
|
+
br.displayName = "EmbeddedCheckoutProviderContext";
|
|
961
|
+
var _r = function() {
|
|
960
962
|
var e = ge("calls useStripe()"), t = e.stripe;
|
|
961
963
|
return t;
|
|
962
964
|
};
|
|
963
965
|
L("auBankAccount", q);
|
|
964
966
|
L("card", q);
|
|
965
|
-
var
|
|
967
|
+
var Ar = L("cardNumber", q), jr = L("cardExpiry", q), kr = L("cardCvc", q);
|
|
966
968
|
L("fpxBank", q);
|
|
967
969
|
L("iban", q);
|
|
968
970
|
L("idealBank", q);
|
|
@@ -977,36 +979,36 @@ L("shippingAddress", q);
|
|
|
977
979
|
L("paymentMethodMessaging", q);
|
|
978
980
|
L("affirmMessage", q);
|
|
979
981
|
L("afterpayClearpayMessage", q);
|
|
980
|
-
var
|
|
981
|
-
var
|
|
982
|
-
for (var e = document.querySelectorAll('script[src^="'.concat(
|
|
982
|
+
var Ve = "https://js.stripe.com/v3", gr = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;
|
|
983
|
+
var Cr = function() {
|
|
984
|
+
for (var e = document.querySelectorAll('script[src^="'.concat(Ve, '"]')), t = 0; t < e.length; t++) {
|
|
983
985
|
var n = e[t];
|
|
984
|
-
if (
|
|
986
|
+
if (gr.test(n.src))
|
|
985
987
|
return n;
|
|
986
988
|
}
|
|
987
989
|
return null;
|
|
988
|
-
},
|
|
990
|
+
}, qe = function(e) {
|
|
989
991
|
var t = "", n = document.createElement("script");
|
|
990
|
-
n.src = "".concat(
|
|
992
|
+
n.src = "".concat(Ve).concat(t);
|
|
991
993
|
var c = document.head || document.body;
|
|
992
994
|
if (!c)
|
|
993
995
|
throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
|
|
994
996
|
return c.appendChild(n), n;
|
|
995
|
-
},
|
|
997
|
+
}, Sr = function(e, t) {
|
|
996
998
|
!e || !e._registerWrapper || e._registerWrapper({
|
|
997
999
|
name: "stripe-js",
|
|
998
1000
|
version: "3.5.0",
|
|
999
1001
|
startTime: t
|
|
1000
1002
|
});
|
|
1001
|
-
}, oe = null,
|
|
1003
|
+
}, oe = null, se = null, ce = null, Tr = function(e) {
|
|
1002
1004
|
return function() {
|
|
1003
1005
|
e(new Error("Failed to load Stripe.js"));
|
|
1004
1006
|
};
|
|
1005
|
-
},
|
|
1007
|
+
}, Pr = function(e, t) {
|
|
1006
1008
|
return function() {
|
|
1007
1009
|
window.Stripe ? e(window.Stripe) : t(new Error("Stripe.js not available"));
|
|
1008
1010
|
};
|
|
1009
|
-
},
|
|
1011
|
+
}, Or = function(e) {
|
|
1010
1012
|
return oe !== null ? oe : (oe = new Promise(function(t, n) {
|
|
1011
1013
|
if (typeof window > "u" || typeof document > "u") {
|
|
1012
1014
|
t(null);
|
|
@@ -1017,16 +1019,16 @@ var gr = function() {
|
|
|
1017
1019
|
return;
|
|
1018
1020
|
}
|
|
1019
1021
|
try {
|
|
1020
|
-
var c =
|
|
1022
|
+
var c = Cr();
|
|
1021
1023
|
if (!(c && e)) {
|
|
1022
1024
|
if (!c)
|
|
1023
|
-
c =
|
|
1024
|
-
else if (c &&
|
|
1025
|
+
c = qe(e);
|
|
1026
|
+
else if (c && ce !== null && se !== null) {
|
|
1025
1027
|
var a;
|
|
1026
|
-
c.removeEventListener("load",
|
|
1028
|
+
c.removeEventListener("load", ce), c.removeEventListener("error", se), (a = c.parentNode) === null || a === void 0 || a.removeChild(c), c = qe(e);
|
|
1027
1029
|
}
|
|
1028
1030
|
}
|
|
1029
|
-
|
|
1031
|
+
ce = Pr(t, n), se = Tr(n), c.addEventListener("load", ce), c.addEventListener("error", se);
|
|
1030
1032
|
} catch (p) {
|
|
1031
1033
|
n(p);
|
|
1032
1034
|
return;
|
|
@@ -1034,38 +1036,38 @@ var gr = function() {
|
|
|
1034
1036
|
}), oe.catch(function(t) {
|
|
1035
1037
|
return oe = null, Promise.reject(t);
|
|
1036
1038
|
}));
|
|
1037
|
-
},
|
|
1039
|
+
}, Rr = function(e, t, n) {
|
|
1038
1040
|
if (e === null)
|
|
1039
1041
|
return null;
|
|
1040
1042
|
var c = e.apply(void 0, t);
|
|
1041
|
-
return
|
|
1042
|
-
}, ae,
|
|
1043
|
-
return ae || (ae =
|
|
1043
|
+
return Sr(c, n), c;
|
|
1044
|
+
}, ae, Je = !1, Ke = function() {
|
|
1045
|
+
return ae || (ae = Or(null).catch(function(e) {
|
|
1044
1046
|
return ae = null, Promise.reject(e);
|
|
1045
1047
|
}), ae);
|
|
1046
1048
|
};
|
|
1047
1049
|
Promise.resolve().then(function() {
|
|
1048
|
-
return
|
|
1050
|
+
return Ke();
|
|
1049
1051
|
}).catch(function(r) {
|
|
1050
|
-
|
|
1052
|
+
Je || console.warn(r);
|
|
1051
1053
|
});
|
|
1052
|
-
var
|
|
1054
|
+
var Ir = function() {
|
|
1053
1055
|
for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
|
|
1054
1056
|
t[n] = arguments[n];
|
|
1055
|
-
|
|
1057
|
+
Je = !0;
|
|
1056
1058
|
var c = Date.now();
|
|
1057
|
-
return
|
|
1058
|
-
return
|
|
1059
|
+
return Ke().then(function(a) {
|
|
1060
|
+
return Rr(a, t, c);
|
|
1059
1061
|
});
|
|
1060
1062
|
};
|
|
1061
1063
|
export {
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1064
|
+
Ar as C,
|
|
1065
|
+
vr as E,
|
|
1066
|
+
wr as a,
|
|
1067
|
+
jr as b,
|
|
1068
|
+
kr as c,
|
|
1069
|
+
Ge as g,
|
|
1070
|
+
Ir as l,
|
|
1071
|
+
We as r,
|
|
1072
|
+
_r as u
|
|
1071
1073
|
};
|