crain-react-pelcro-js 1.0.0-beta.5 → 1.0.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1076 -69
- package/dist/index.esm.js +1069 -62
- package/package.json +3 -9
package/dist/index.cjs.js
CHANGED
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var stripeJs = require('@stripe/stripe-js');
|
|
7
|
-
var reactStripeJs = require('@stripe/react-stripe-js');
|
|
8
6
|
|
|
9
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
8
|
|
|
@@ -6955,7 +6953,7 @@ const persistImpl = (config, baseOptions) => (set, get, api) => {
|
|
|
6955
6953
|
};
|
|
6956
6954
|
const persist = persistImpl;
|
|
6957
6955
|
|
|
6958
|
-
function _defineProperty$
|
|
6956
|
+
function _defineProperty$4(obj, key, value) {
|
|
6959
6957
|
if (key in obj) {
|
|
6960
6958
|
Object.defineProperty(obj, key, {
|
|
6961
6959
|
value: value,
|
|
@@ -8193,15 +8191,15 @@ function warn(s) {
|
|
|
8193
8191
|
console.warn('[react-ga]', s);
|
|
8194
8192
|
}
|
|
8195
8193
|
|
|
8196
|
-
function _typeof$
|
|
8194
|
+
function _typeof$3(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$3 = function _typeof(obj) { return typeof obj; }; } else { _typeof$3 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$3(obj); }
|
|
8197
8195
|
|
|
8198
|
-
function ownKeys$
|
|
8196
|
+
function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
8199
8197
|
|
|
8200
|
-
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$
|
|
8198
|
+
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$3(source, true).forEach(function (key) { _defineProperty$3(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$3(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
8201
8199
|
|
|
8202
|
-
function _objectWithoutProperties$
|
|
8200
|
+
function _objectWithoutProperties$2(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose$2(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
8203
8201
|
|
|
8204
|
-
function _objectWithoutPropertiesLoose$
|
|
8202
|
+
function _objectWithoutPropertiesLoose$2(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8205
8203
|
|
|
8206
8204
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8207
8205
|
|
|
@@ -8209,7 +8207,7 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
8209
8207
|
|
|
8210
8208
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
8211
8209
|
|
|
8212
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof$
|
|
8210
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof$3(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
8213
8211
|
|
|
8214
8212
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
8215
8213
|
|
|
@@ -8219,7 +8217,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
|
8219
8217
|
|
|
8220
8218
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
8221
8219
|
|
|
8222
|
-
function _defineProperty$
|
|
8220
|
+
function _defineProperty$3(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8223
8221
|
var NEWTAB = '_blank';
|
|
8224
8222
|
var MIDDLECLICK = 1;
|
|
8225
8223
|
|
|
@@ -8241,7 +8239,7 @@ function (_Component) {
|
|
|
8241
8239
|
|
|
8242
8240
|
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(OutboundLink)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
|
8243
8241
|
|
|
8244
|
-
_defineProperty$
|
|
8242
|
+
_defineProperty$3(_assertThisInitialized(_this), "handleClick", function (event) {
|
|
8245
8243
|
var _this$props = _this.props,
|
|
8246
8244
|
target = _this$props.target,
|
|
8247
8245
|
eventLabel = _this$props.eventLabel,
|
|
@@ -8276,7 +8274,7 @@ function (_Component) {
|
|
|
8276
8274
|
value: function render() {
|
|
8277
8275
|
var _this$props2 = this.props,
|
|
8278
8276
|
href = _this$props2.to,
|
|
8279
|
-
oldProps = _objectWithoutProperties$
|
|
8277
|
+
oldProps = _objectWithoutProperties$2(_this$props2, ["to"]);
|
|
8280
8278
|
|
|
8281
8279
|
var props = _objectSpread$2({}, oldProps, {
|
|
8282
8280
|
href: href,
|
|
@@ -8296,11 +8294,11 @@ function (_Component) {
|
|
|
8296
8294
|
return OutboundLink;
|
|
8297
8295
|
}(React.Component);
|
|
8298
8296
|
|
|
8299
|
-
_defineProperty$
|
|
8297
|
+
_defineProperty$3(OutboundLink$1, "trackLink", function () {
|
|
8300
8298
|
warn('ga tracking not enabled');
|
|
8301
8299
|
});
|
|
8302
8300
|
|
|
8303
|
-
_defineProperty$
|
|
8301
|
+
_defineProperty$3(OutboundLink$1, "propTypes", {
|
|
8304
8302
|
eventLabel: PropTypes.string.isRequired,
|
|
8305
8303
|
target: PropTypes.string,
|
|
8306
8304
|
to: PropTypes.string,
|
|
@@ -8308,7 +8306,7 @@ _defineProperty$2(OutboundLink$1, "propTypes", {
|
|
|
8308
8306
|
trackerNames: PropTypes.arrayOf(PropTypes.string)
|
|
8309
8307
|
});
|
|
8310
8308
|
|
|
8311
|
-
_defineProperty$
|
|
8309
|
+
_defineProperty$3(OutboundLink$1, "defaultProps", {
|
|
8312
8310
|
target: null,
|
|
8313
8311
|
to: null,
|
|
8314
8312
|
onClick: null,
|
|
@@ -8415,17 +8413,17 @@ var TestModeAPI = {
|
|
|
8415
8413
|
}
|
|
8416
8414
|
};
|
|
8417
8415
|
|
|
8418
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
8416
|
+
function _objectWithoutProperties$1(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose$1(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
8419
8417
|
|
|
8420
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8418
|
+
function _objectWithoutPropertiesLoose$1(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8421
8419
|
|
|
8422
|
-
function ownKeys$
|
|
8420
|
+
function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
8423
8421
|
|
|
8424
|
-
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$
|
|
8422
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$2(source, true).forEach(function (key) { _defineProperty$2(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$2(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
8425
8423
|
|
|
8426
|
-
function _defineProperty$
|
|
8424
|
+
function _defineProperty$2(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8427
8425
|
|
|
8428
|
-
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
8426
|
+
function _typeof$2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$2 = function _typeof(obj) { return typeof obj; }; } else { _typeof$2 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$2(obj); }
|
|
8429
8427
|
|
|
8430
8428
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
|
8431
8429
|
|
|
@@ -8520,7 +8518,7 @@ function initialize(configsOrTrackingId, options) {
|
|
|
8520
8518
|
|
|
8521
8519
|
if (Array.isArray(configsOrTrackingId)) {
|
|
8522
8520
|
configsOrTrackingId.forEach(function (config) {
|
|
8523
|
-
if (_typeof(config) !== 'object') {
|
|
8521
|
+
if (_typeof$2(config) !== 'object') {
|
|
8524
8522
|
warn('All configs must be an object');
|
|
8525
8523
|
return;
|
|
8526
8524
|
}
|
|
@@ -8567,7 +8565,7 @@ function set(fieldsObject, trackerNames) {
|
|
|
8567
8565
|
return;
|
|
8568
8566
|
}
|
|
8569
8567
|
|
|
8570
|
-
if (_typeof(fieldsObject) !== 'object') {
|
|
8568
|
+
if (_typeof$2(fieldsObject) !== 'object') {
|
|
8571
8569
|
warn('Expected `fieldsObject` arg to be an Object');
|
|
8572
8570
|
return;
|
|
8573
8571
|
}
|
|
@@ -8738,7 +8736,7 @@ function event() {
|
|
|
8738
8736
|
value = _ref2.value,
|
|
8739
8737
|
nonInteraction = _ref2.nonInteraction,
|
|
8740
8738
|
transport = _ref2.transport,
|
|
8741
|
-
args = _objectWithoutProperties(_ref2, ["category", "action", "label", "value", "nonInteraction", "transport"]);
|
|
8739
|
+
args = _objectWithoutProperties$1(_ref2, ["category", "action", "label", "value", "nonInteraction", "transport"]);
|
|
8742
8740
|
|
|
8743
8741
|
var trackerNames = arguments.length > 1 ? arguments[1] : undefined;
|
|
8744
8742
|
|
|
@@ -8862,7 +8860,7 @@ var plugin = {
|
|
|
8862
8860
|
var requireString = trackerName ? "".concat(trackerName, ".require") : 'require'; // Optional Fields
|
|
8863
8861
|
|
|
8864
8862
|
if (options) {
|
|
8865
|
-
if (_typeof(options) !== 'object') {
|
|
8863
|
+
if (_typeof$2(options) !== 'object') {
|
|
8866
8864
|
warn('Expected `options` arg to be an Object');
|
|
8867
8865
|
return;
|
|
8868
8866
|
}
|
|
@@ -9032,11 +9030,11 @@ var Defaults = /*#__PURE__*/Object.freeze({
|
|
|
9032
9030
|
'default': core
|
|
9033
9031
|
});
|
|
9034
9032
|
|
|
9035
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
9033
|
+
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
9036
9034
|
|
|
9037
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
9035
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(source, true).forEach(function (key) { _defineProperty$1(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
9038
9036
|
|
|
9039
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9037
|
+
function _defineProperty$1(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9040
9038
|
OutboundLink$1.origTrackLink = OutboundLink$1.trackLink;
|
|
9041
9039
|
OutboundLink$1.trackLink = outboundLink;
|
|
9042
9040
|
var OutboundLink = OutboundLink$1;
|
|
@@ -9350,7 +9348,7 @@ var src_default = ga4_default;
|
|
|
9350
9348
|
class PelcroActions {
|
|
9351
9349
|
constructor(storeSetter, storeGetter) {
|
|
9352
9350
|
var _this = this;
|
|
9353
|
-
_defineProperty$
|
|
9351
|
+
_defineProperty$4(this, "resetState", () => {
|
|
9354
9352
|
const {
|
|
9355
9353
|
view,
|
|
9356
9354
|
cartItems,
|
|
@@ -9358,7 +9356,7 @@ class PelcroActions {
|
|
|
9358
9356
|
} = initialState$1;
|
|
9359
9357
|
this.set(otherStateFields);
|
|
9360
9358
|
});
|
|
9361
|
-
_defineProperty$
|
|
9359
|
+
_defineProperty$4(this, "switchView", view => {
|
|
9362
9360
|
var _window$Pelcro$site$r;
|
|
9363
9361
|
// view switching guards
|
|
9364
9362
|
if (userMustVerifyEmail() && !["dashboard", "meter", "login", null].includes(view)) {
|
|
@@ -9385,7 +9383,7 @@ class PelcroActions {
|
|
|
9385
9383
|
view
|
|
9386
9384
|
});
|
|
9387
9385
|
});
|
|
9388
|
-
_defineProperty$
|
|
9386
|
+
_defineProperty$4(this, "resetView", () => {
|
|
9389
9387
|
const {
|
|
9390
9388
|
switchView,
|
|
9391
9389
|
resetState
|
|
@@ -9393,7 +9391,7 @@ class PelcroActions {
|
|
|
9393
9391
|
switchView(null);
|
|
9394
9392
|
resetState();
|
|
9395
9393
|
});
|
|
9396
|
-
_defineProperty$
|
|
9394
|
+
_defineProperty$4(this, "switchToPaymentView", () => {
|
|
9397
9395
|
const {
|
|
9398
9396
|
switchView,
|
|
9399
9397
|
resetView,
|
|
@@ -9411,7 +9409,7 @@ class PelcroActions {
|
|
|
9411
9409
|
}
|
|
9412
9410
|
return resetView();
|
|
9413
9411
|
});
|
|
9414
|
-
_defineProperty$
|
|
9412
|
+
_defineProperty$4(this, "switchToCheckoutForm", () => {
|
|
9415
9413
|
const {
|
|
9416
9414
|
switchView,
|
|
9417
9415
|
product,
|
|
@@ -9432,7 +9430,7 @@ class PelcroActions {
|
|
|
9432
9430
|
return switchView("invoice-payment");
|
|
9433
9431
|
}
|
|
9434
9432
|
});
|
|
9435
|
-
_defineProperty$
|
|
9433
|
+
_defineProperty$4(this, "switchToAddressView", () => {
|
|
9436
9434
|
const {
|
|
9437
9435
|
switchView
|
|
9438
9436
|
} = this.get();
|
|
@@ -9442,21 +9440,21 @@ class PelcroActions {
|
|
|
9442
9440
|
switchView("address-create");
|
|
9443
9441
|
}
|
|
9444
9442
|
});
|
|
9445
|
-
_defineProperty$
|
|
9443
|
+
_defineProperty$4(this, "setProduct", id => {
|
|
9446
9444
|
const product = window.Pelcro.product.getById(id);
|
|
9447
9445
|
if (!product) return console.error("invalid product id");
|
|
9448
9446
|
this.set({
|
|
9449
9447
|
product
|
|
9450
9448
|
});
|
|
9451
9449
|
});
|
|
9452
|
-
_defineProperty$
|
|
9450
|
+
_defineProperty$4(this, "setPlan", id => {
|
|
9453
9451
|
const plan = window.Pelcro.plan.getById(id);
|
|
9454
9452
|
if (!plan) return console.error("invalid plan id");
|
|
9455
9453
|
this.set({
|
|
9456
9454
|
plan
|
|
9457
9455
|
});
|
|
9458
9456
|
});
|
|
9459
|
-
_defineProperty$
|
|
9457
|
+
_defineProperty$4(this, "setSubscriptionToCancel", id => {
|
|
9460
9458
|
var _window$Pelcro$subscr;
|
|
9461
9459
|
const subscriptions = (_window$Pelcro$subscr = window.Pelcro.subscription.list()) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
|
|
9462
9460
|
const subscriptionToCancel = subscriptions.filter(sub => String(sub.id) === String(id))[0];
|
|
@@ -9467,7 +9465,7 @@ class PelcroActions {
|
|
|
9467
9465
|
subscriptionToCancel
|
|
9468
9466
|
});
|
|
9469
9467
|
});
|
|
9470
|
-
_defineProperty$
|
|
9468
|
+
_defineProperty$4(this, "setSubscriptionToSuspend", id => {
|
|
9471
9469
|
var _window$Pelcro$subscr2;
|
|
9472
9470
|
const subscriptions = (_window$Pelcro$subscr2 = window.Pelcro.subscription.list()) !== null && _window$Pelcro$subscr2 !== void 0 ? _window$Pelcro$subscr2 : [];
|
|
9473
9471
|
const subscriptionToSuspend = subscriptions.filter(sub => String(sub.id) === String(id))[0];
|
|
@@ -9478,7 +9476,7 @@ class PelcroActions {
|
|
|
9478
9476
|
subscriptionToSuspend
|
|
9479
9477
|
});
|
|
9480
9478
|
});
|
|
9481
|
-
_defineProperty$
|
|
9479
|
+
_defineProperty$4(this, "setSubscriptionToManageMembers", id => {
|
|
9482
9480
|
var _window$Pelcro$subscr3, _subscriptionToManage;
|
|
9483
9481
|
const subscriptions = (_window$Pelcro$subscr3 = window.Pelcro.subscription.list()) !== null && _window$Pelcro$subscr3 !== void 0 ? _window$Pelcro$subscr3 : [];
|
|
9484
9482
|
const subscriptionToManageMembers = subscriptions.filter(sub => String(sub.id) === String(id))[0];
|
|
@@ -9493,7 +9491,7 @@ class PelcroActions {
|
|
|
9493
9491
|
});
|
|
9494
9492
|
return true;
|
|
9495
9493
|
});
|
|
9496
|
-
_defineProperty$
|
|
9494
|
+
_defineProperty$4(this, "setInvoice", id => {
|
|
9497
9495
|
var _window$Pelcro$invoic;
|
|
9498
9496
|
const invoices = (_window$Pelcro$invoic = window.Pelcro.invoice.list()) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
|
|
9499
9497
|
const invoice = invoices.find(inv => String(inv.id) === String(id));
|
|
@@ -9506,7 +9504,7 @@ class PelcroActions {
|
|
|
9506
9504
|
});
|
|
9507
9505
|
return true;
|
|
9508
9506
|
});
|
|
9509
|
-
_defineProperty$
|
|
9507
|
+
_defineProperty$4(this, "setSelectedMembership", id => {
|
|
9510
9508
|
var _window$Pelcro$user$r, _window$Pelcro$user$r2;
|
|
9511
9509
|
const memberships = (_window$Pelcro$user$r = (_window$Pelcro$user$r2 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.memberships) !== null && _window$Pelcro$user$r !== void 0 ? _window$Pelcro$user$r : [];
|
|
9512
9510
|
const membership = memberships.find(membership => String(membership.id) === String(id));
|
|
@@ -9519,13 +9517,13 @@ class PelcroActions {
|
|
|
9519
9517
|
});
|
|
9520
9518
|
return true;
|
|
9521
9519
|
});
|
|
9522
|
-
_defineProperty$
|
|
9520
|
+
_defineProperty$4(this, "setCouponCode", couponCode => {
|
|
9523
9521
|
if (!couponCode) return console.error("invalid coupon code");
|
|
9524
9522
|
this.set({
|
|
9525
9523
|
couponCode
|
|
9526
9524
|
});
|
|
9527
9525
|
});
|
|
9528
|
-
_defineProperty$
|
|
9526
|
+
_defineProperty$4(this, "logout", function () {
|
|
9529
9527
|
var _window, _window$Pelcro, _window$Pelcro$uiSett;
|
|
9530
9528
|
let displayLogin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
9531
9529
|
const {
|
|
@@ -9556,7 +9554,7 @@ class PelcroActions {
|
|
|
9556
9554
|
switchView("login");
|
|
9557
9555
|
}
|
|
9558
9556
|
});
|
|
9559
|
-
_defineProperty$
|
|
9557
|
+
_defineProperty$4(this, "addToCart", itemSkuId => {
|
|
9560
9558
|
const itemToAdd = window.Pelcro.ecommerce.products.getBySkuId(Number(itemSkuId));
|
|
9561
9559
|
if (!itemToAdd) {
|
|
9562
9560
|
console.error("invalid item SKU id");
|
|
@@ -9596,7 +9594,7 @@ class PelcroActions {
|
|
|
9596
9594
|
}));
|
|
9597
9595
|
return true;
|
|
9598
9596
|
});
|
|
9599
|
-
_defineProperty$
|
|
9597
|
+
_defineProperty$4(this, "removeFromCart", itemSkuId => {
|
|
9600
9598
|
const {
|
|
9601
9599
|
cartItems
|
|
9602
9600
|
} = this.get();
|
|
@@ -9630,7 +9628,7 @@ class PelcroActions {
|
|
|
9630
9628
|
});
|
|
9631
9629
|
return true;
|
|
9632
9630
|
});
|
|
9633
|
-
_defineProperty$
|
|
9631
|
+
_defineProperty$4(this, "purchaseItem", itemSkuId => {
|
|
9634
9632
|
const quickPurchaseItem = window.Pelcro.ecommerce.products.getBySkuId(Number(itemSkuId));
|
|
9635
9633
|
if (!quickPurchaseItem) {
|
|
9636
9634
|
console.error("invalid item SKU id");
|
|
@@ -9667,7 +9665,7 @@ class PelcroActions {
|
|
|
9667
9665
|
}
|
|
9668
9666
|
switchToAddressView();
|
|
9669
9667
|
});
|
|
9670
|
-
_defineProperty$
|
|
9668
|
+
_defineProperty$4(this, "setPaymentMethodToEdit", id => {
|
|
9671
9669
|
window.Pelcro.paymentMethods.getPaymentMethod({
|
|
9672
9670
|
auth_token: window.Pelcro.user.read().auth_token,
|
|
9673
9671
|
payment_method_id: id
|
|
@@ -9683,7 +9681,7 @@ class PelcroActions {
|
|
|
9683
9681
|
}
|
|
9684
9682
|
});
|
|
9685
9683
|
});
|
|
9686
|
-
_defineProperty$
|
|
9684
|
+
_defineProperty$4(this, "setPaymentMethodToDelete", id => {
|
|
9687
9685
|
window.Pelcro.paymentMethods.getPaymentMethod({
|
|
9688
9686
|
auth_token: window.Pelcro.user.read().auth_token,
|
|
9689
9687
|
payment_method_id: id
|
|
@@ -9699,7 +9697,7 @@ class PelcroActions {
|
|
|
9699
9697
|
}
|
|
9700
9698
|
});
|
|
9701
9699
|
});
|
|
9702
|
-
_defineProperty$
|
|
9700
|
+
_defineProperty$4(this, "setPaymentMethodToVerify", paymentMethod => {
|
|
9703
9701
|
this.set({
|
|
9704
9702
|
paymentMethodToVerify: paymentMethod
|
|
9705
9703
|
});
|
|
@@ -9715,7 +9713,7 @@ class PelcroActions {
|
|
|
9715
9713
|
|
|
9716
9714
|
class PelcroCallbacks {
|
|
9717
9715
|
constructor() {
|
|
9718
|
-
_defineProperty$
|
|
9716
|
+
_defineProperty$4(this, "whenSiteReady", callback => {
|
|
9719
9717
|
var _window$Pelcro$site$r;
|
|
9720
9718
|
if ((_window$Pelcro$site$r = window.Pelcro.site.read()) !== null && _window$Pelcro$site$r !== void 0 && _window$Pelcro$site$r.settings) {
|
|
9721
9719
|
callback(window.Pelcro.site.read());
|
|
@@ -9725,7 +9723,7 @@ class PelcroCallbacks {
|
|
|
9725
9723
|
});
|
|
9726
9724
|
}
|
|
9727
9725
|
});
|
|
9728
|
-
_defineProperty$
|
|
9726
|
+
_defineProperty$4(this, "whenUserReady", (callback, listenerOptions) => {
|
|
9729
9727
|
var _window$Pelcro$user$r;
|
|
9730
9728
|
if ((_window$Pelcro$user$r = window.Pelcro.user.read()) !== null && _window$Pelcro$user$r !== void 0 && _window$Pelcro$user$r.id) {
|
|
9731
9729
|
callback(window.Pelcro.user.read());
|
|
@@ -9735,7 +9733,7 @@ class PelcroCallbacks {
|
|
|
9735
9733
|
}, listenerOptions);
|
|
9736
9734
|
}
|
|
9737
9735
|
});
|
|
9738
|
-
_defineProperty$
|
|
9736
|
+
_defineProperty$4(this, "whenEcommerceLoaded", callback => {
|
|
9739
9737
|
var _window$Pelcro$ecomme;
|
|
9740
9738
|
if ((_window$Pelcro$ecomme = window.Pelcro.ecommerce.products.read()) !== null && _window$Pelcro$ecomme !== void 0 && _window$Pelcro$ecomme.length) {
|
|
9741
9739
|
callback(window.Pelcro.ecommerce.products.read());
|
|
@@ -10105,6 +10103,1015 @@ pageLanguageObserver.observe(document.documentElement, {
|
|
|
10105
10103
|
attributes: true
|
|
10106
10104
|
});
|
|
10107
10105
|
|
|
10106
|
+
function _typeof$1(obj) {
|
|
10107
|
+
"@babel/helpers - typeof";
|
|
10108
|
+
|
|
10109
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
10110
|
+
_typeof$1 = function (obj) {
|
|
10111
|
+
return typeof obj;
|
|
10112
|
+
};
|
|
10113
|
+
} else {
|
|
10114
|
+
_typeof$1 = function (obj) {
|
|
10115
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
10116
|
+
};
|
|
10117
|
+
}
|
|
10118
|
+
|
|
10119
|
+
return _typeof$1(obj);
|
|
10120
|
+
}
|
|
10121
|
+
|
|
10122
|
+
var RELEASE_TRAIN = 'dahlia';
|
|
10123
|
+
|
|
10124
|
+
var runtimeVersionToUrlVersion = function runtimeVersionToUrlVersion(version) {
|
|
10125
|
+
return version === 3 ? 'v3' : version;
|
|
10126
|
+
};
|
|
10127
|
+
|
|
10128
|
+
var ORIGIN = 'https://js.stripe.com';
|
|
10129
|
+
var STRIPE_JS_URL = "".concat(ORIGIN, "/").concat(RELEASE_TRAIN, "/stripe.js");
|
|
10130
|
+
var V3_URL_REGEX = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;
|
|
10131
|
+
var STRIPE_JS_URL_REGEX = /^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/;
|
|
10132
|
+
var EXISTING_SCRIPT_MESSAGE = 'loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used';
|
|
10133
|
+
|
|
10134
|
+
var isStripeJSURL = function isStripeJSURL(url) {
|
|
10135
|
+
return V3_URL_REGEX.test(url) || STRIPE_JS_URL_REGEX.test(url);
|
|
10136
|
+
};
|
|
10137
|
+
|
|
10138
|
+
var findScript = function findScript() {
|
|
10139
|
+
var scripts = document.querySelectorAll("script[src^=\"".concat(ORIGIN, "\"]"));
|
|
10140
|
+
|
|
10141
|
+
for (var i = 0; i < scripts.length; i++) {
|
|
10142
|
+
var script = scripts[i];
|
|
10143
|
+
|
|
10144
|
+
if (!isStripeJSURL(script.src)) {
|
|
10145
|
+
continue;
|
|
10146
|
+
}
|
|
10147
|
+
|
|
10148
|
+
return script;
|
|
10149
|
+
}
|
|
10150
|
+
|
|
10151
|
+
return null;
|
|
10152
|
+
};
|
|
10153
|
+
|
|
10154
|
+
var injectScript = function injectScript(params) {
|
|
10155
|
+
var queryString = params && !params.advancedFraudSignals ? '?advancedFraudSignals=false' : '';
|
|
10156
|
+
var script = document.createElement('script');
|
|
10157
|
+
script.src = "".concat(STRIPE_JS_URL).concat(queryString);
|
|
10158
|
+
var headOrBody = document.head || document.body;
|
|
10159
|
+
|
|
10160
|
+
if (!headOrBody) {
|
|
10161
|
+
throw new Error('Expected document.body not to be null. Stripe.js requires a <body> element.');
|
|
10162
|
+
}
|
|
10163
|
+
|
|
10164
|
+
headOrBody.appendChild(script);
|
|
10165
|
+
return script;
|
|
10166
|
+
};
|
|
10167
|
+
|
|
10168
|
+
var registerWrapper = function registerWrapper(stripe, startTime) {
|
|
10169
|
+
if (!stripe || !stripe._registerWrapper) {
|
|
10170
|
+
return;
|
|
10171
|
+
}
|
|
10172
|
+
|
|
10173
|
+
stripe._registerWrapper({
|
|
10174
|
+
name: 'stripe-js',
|
|
10175
|
+
version: "9.1.0",
|
|
10176
|
+
startTime: startTime
|
|
10177
|
+
});
|
|
10178
|
+
};
|
|
10179
|
+
|
|
10180
|
+
var stripePromise$1 = null;
|
|
10181
|
+
var onErrorListener = null;
|
|
10182
|
+
var onLoadListener = null;
|
|
10183
|
+
|
|
10184
|
+
var onError = function onError(reject) {
|
|
10185
|
+
return function (cause) {
|
|
10186
|
+
reject(new Error('Failed to load Stripe.js', {
|
|
10187
|
+
cause: cause
|
|
10188
|
+
}));
|
|
10189
|
+
};
|
|
10190
|
+
};
|
|
10191
|
+
|
|
10192
|
+
var onLoad = function onLoad(resolve, reject) {
|
|
10193
|
+
return function () {
|
|
10194
|
+
if (window.Stripe) {
|
|
10195
|
+
resolve(window.Stripe);
|
|
10196
|
+
} else {
|
|
10197
|
+
reject(new Error('Stripe.js not available'));
|
|
10198
|
+
}
|
|
10199
|
+
};
|
|
10200
|
+
};
|
|
10201
|
+
|
|
10202
|
+
var loadScript = function loadScript(params) {
|
|
10203
|
+
// Ensure that we only attempt to load Stripe.js at most once
|
|
10204
|
+
if (stripePromise$1 !== null) {
|
|
10205
|
+
return stripePromise$1;
|
|
10206
|
+
}
|
|
10207
|
+
|
|
10208
|
+
stripePromise$1 = new Promise(function (resolve, reject) {
|
|
10209
|
+
if (typeof window === 'undefined' || typeof document === 'undefined') {
|
|
10210
|
+
// Resolve to null when imported server side. This makes the module
|
|
10211
|
+
// safe to import in an isomorphic code base.
|
|
10212
|
+
resolve(null);
|
|
10213
|
+
return;
|
|
10214
|
+
}
|
|
10215
|
+
|
|
10216
|
+
if (window.Stripe && params) {
|
|
10217
|
+
console.warn(EXISTING_SCRIPT_MESSAGE);
|
|
10218
|
+
}
|
|
10219
|
+
|
|
10220
|
+
if (window.Stripe) {
|
|
10221
|
+
resolve(window.Stripe);
|
|
10222
|
+
return;
|
|
10223
|
+
}
|
|
10224
|
+
|
|
10225
|
+
try {
|
|
10226
|
+
var script = findScript();
|
|
10227
|
+
|
|
10228
|
+
if (script && params) {
|
|
10229
|
+
console.warn(EXISTING_SCRIPT_MESSAGE);
|
|
10230
|
+
} else if (!script) {
|
|
10231
|
+
script = injectScript(params);
|
|
10232
|
+
} else if (script && onLoadListener !== null && onErrorListener !== null) {
|
|
10233
|
+
var _script$parentNode;
|
|
10234
|
+
|
|
10235
|
+
// remove event listeners
|
|
10236
|
+
script.removeEventListener('load', onLoadListener);
|
|
10237
|
+
script.removeEventListener('error', onErrorListener); // if script exists, but we are reloading due to an error,
|
|
10238
|
+
// reload script to trigger 'load' event
|
|
10239
|
+
|
|
10240
|
+
(_script$parentNode = script.parentNode) === null || _script$parentNode === void 0 ? void 0 : _script$parentNode.removeChild(script);
|
|
10241
|
+
script = injectScript(params);
|
|
10242
|
+
}
|
|
10243
|
+
|
|
10244
|
+
onLoadListener = onLoad(resolve, reject);
|
|
10245
|
+
onErrorListener = onError(reject);
|
|
10246
|
+
script.addEventListener('load', onLoadListener);
|
|
10247
|
+
script.addEventListener('error', onErrorListener);
|
|
10248
|
+
} catch (error) {
|
|
10249
|
+
reject(error);
|
|
10250
|
+
return;
|
|
10251
|
+
}
|
|
10252
|
+
}); // Resets stripePromise on error
|
|
10253
|
+
|
|
10254
|
+
return stripePromise$1["catch"](function (error) {
|
|
10255
|
+
stripePromise$1 = null;
|
|
10256
|
+
return Promise.reject(error);
|
|
10257
|
+
});
|
|
10258
|
+
};
|
|
10259
|
+
var initStripe = function initStripe(maybeStripe, args, startTime) {
|
|
10260
|
+
if (maybeStripe === null) {
|
|
10261
|
+
return null;
|
|
10262
|
+
}
|
|
10263
|
+
|
|
10264
|
+
var pk = args[0];
|
|
10265
|
+
|
|
10266
|
+
if (typeof pk !== 'string') {
|
|
10267
|
+
throw new Error("Expected publishable key to be of type string, got type ".concat(_typeof$1(pk), " instead."));
|
|
10268
|
+
}
|
|
10269
|
+
|
|
10270
|
+
var isTestKey = pk.match(/^pk_test/); // @ts-expect-error this is not publicly typed
|
|
10271
|
+
|
|
10272
|
+
var version = runtimeVersionToUrlVersion(maybeStripe.version);
|
|
10273
|
+
var expectedVersion = RELEASE_TRAIN;
|
|
10274
|
+
|
|
10275
|
+
if (isTestKey && version !== expectedVersion) {
|
|
10276
|
+
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("9.1.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
|
|
10277
|
+
}
|
|
10278
|
+
|
|
10279
|
+
var stripe = maybeStripe.apply(undefined, args);
|
|
10280
|
+
registerWrapper(stripe, startTime);
|
|
10281
|
+
return stripe;
|
|
10282
|
+
}; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
|
10283
|
+
|
|
10284
|
+
var stripePromise;
|
|
10285
|
+
var loadCalled = false;
|
|
10286
|
+
|
|
10287
|
+
var getStripePromise = function getStripePromise() {
|
|
10288
|
+
if (stripePromise) {
|
|
10289
|
+
return stripePromise;
|
|
10290
|
+
}
|
|
10291
|
+
|
|
10292
|
+
stripePromise = loadScript(null)["catch"](function (error) {
|
|
10293
|
+
// clear cache on error
|
|
10294
|
+
stripePromise = null;
|
|
10295
|
+
return Promise.reject(error);
|
|
10296
|
+
});
|
|
10297
|
+
return stripePromise;
|
|
10298
|
+
}; // Execute our own script injection after a tick to give users time to do their
|
|
10299
|
+
// own script injection.
|
|
10300
|
+
|
|
10301
|
+
|
|
10302
|
+
Promise.resolve().then(function () {
|
|
10303
|
+
return getStripePromise();
|
|
10304
|
+
})["catch"](function (error) {
|
|
10305
|
+
if (!loadCalled) {
|
|
10306
|
+
console.warn(error);
|
|
10307
|
+
}
|
|
10308
|
+
});
|
|
10309
|
+
var loadStripe = function loadStripe() {
|
|
10310
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
10311
|
+
args[_key] = arguments[_key];
|
|
10312
|
+
}
|
|
10313
|
+
|
|
10314
|
+
loadCalled = true;
|
|
10315
|
+
var startTime = Date.now(); // if previous attempts are unsuccessful, will re-load script
|
|
10316
|
+
|
|
10317
|
+
return getStripePromise().then(function (maybeStripe) {
|
|
10318
|
+
return initStripe(maybeStripe, args, startTime);
|
|
10319
|
+
});
|
|
10320
|
+
};
|
|
10321
|
+
|
|
10322
|
+
function ownKeys(object, enumerableOnly) {
|
|
10323
|
+
var keys = Object.keys(object);
|
|
10324
|
+
|
|
10325
|
+
if (Object.getOwnPropertySymbols) {
|
|
10326
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
10327
|
+
|
|
10328
|
+
if (enumerableOnly) {
|
|
10329
|
+
symbols = symbols.filter(function (sym) {
|
|
10330
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
10331
|
+
});
|
|
10332
|
+
}
|
|
10333
|
+
|
|
10334
|
+
keys.push.apply(keys, symbols);
|
|
10335
|
+
}
|
|
10336
|
+
|
|
10337
|
+
return keys;
|
|
10338
|
+
}
|
|
10339
|
+
|
|
10340
|
+
function _objectSpread2(target) {
|
|
10341
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
10342
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
10343
|
+
|
|
10344
|
+
if (i % 2) {
|
|
10345
|
+
ownKeys(Object(source), true).forEach(function (key) {
|
|
10346
|
+
_defineProperty(target, key, source[key]);
|
|
10347
|
+
});
|
|
10348
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
10349
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
10350
|
+
} else {
|
|
10351
|
+
ownKeys(Object(source)).forEach(function (key) {
|
|
10352
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
10353
|
+
});
|
|
10354
|
+
}
|
|
10355
|
+
}
|
|
10356
|
+
|
|
10357
|
+
return target;
|
|
10358
|
+
}
|
|
10359
|
+
|
|
10360
|
+
function _typeof(obj) {
|
|
10361
|
+
"@babel/helpers - typeof";
|
|
10362
|
+
|
|
10363
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
10364
|
+
_typeof = function (obj) {
|
|
10365
|
+
return typeof obj;
|
|
10366
|
+
};
|
|
10367
|
+
} else {
|
|
10368
|
+
_typeof = function (obj) {
|
|
10369
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
10370
|
+
};
|
|
10371
|
+
}
|
|
10372
|
+
|
|
10373
|
+
return _typeof(obj);
|
|
10374
|
+
}
|
|
10375
|
+
|
|
10376
|
+
function _defineProperty(obj, key, value) {
|
|
10377
|
+
if (key in obj) {
|
|
10378
|
+
Object.defineProperty(obj, key, {
|
|
10379
|
+
value: value,
|
|
10380
|
+
enumerable: true,
|
|
10381
|
+
configurable: true,
|
|
10382
|
+
writable: true
|
|
10383
|
+
});
|
|
10384
|
+
} else {
|
|
10385
|
+
obj[key] = value;
|
|
10386
|
+
}
|
|
10387
|
+
|
|
10388
|
+
return obj;
|
|
10389
|
+
}
|
|
10390
|
+
|
|
10391
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
10392
|
+
if (source == null) return {};
|
|
10393
|
+
var target = {};
|
|
10394
|
+
var sourceKeys = Object.keys(source);
|
|
10395
|
+
var key, i;
|
|
10396
|
+
|
|
10397
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
10398
|
+
key = sourceKeys[i];
|
|
10399
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
10400
|
+
target[key] = source[key];
|
|
10401
|
+
}
|
|
10402
|
+
|
|
10403
|
+
return target;
|
|
10404
|
+
}
|
|
10405
|
+
|
|
10406
|
+
function _objectWithoutProperties(source, excluded) {
|
|
10407
|
+
if (source == null) return {};
|
|
10408
|
+
|
|
10409
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
10410
|
+
|
|
10411
|
+
var key, i;
|
|
10412
|
+
|
|
10413
|
+
if (Object.getOwnPropertySymbols) {
|
|
10414
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
10415
|
+
|
|
10416
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
10417
|
+
key = sourceSymbolKeys[i];
|
|
10418
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
10419
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
10420
|
+
target[key] = source[key];
|
|
10421
|
+
}
|
|
10422
|
+
}
|
|
10423
|
+
|
|
10424
|
+
return target;
|
|
10425
|
+
}
|
|
10426
|
+
|
|
10427
|
+
function _slicedToArray(arr, i) {
|
|
10428
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
10429
|
+
}
|
|
10430
|
+
|
|
10431
|
+
function _arrayWithHoles(arr) {
|
|
10432
|
+
if (Array.isArray(arr)) return arr;
|
|
10433
|
+
}
|
|
10434
|
+
|
|
10435
|
+
function _iterableToArrayLimit(arr, i) {
|
|
10436
|
+
var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]);
|
|
10437
|
+
|
|
10438
|
+
if (_i == null) return;
|
|
10439
|
+
var _arr = [];
|
|
10440
|
+
var _n = true;
|
|
10441
|
+
var _d = false;
|
|
10442
|
+
|
|
10443
|
+
var _s, _e;
|
|
10444
|
+
|
|
10445
|
+
try {
|
|
10446
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
10447
|
+
_arr.push(_s.value);
|
|
10448
|
+
|
|
10449
|
+
if (i && _arr.length === i) break;
|
|
10450
|
+
}
|
|
10451
|
+
} catch (err) {
|
|
10452
|
+
_d = true;
|
|
10453
|
+
_e = err;
|
|
10454
|
+
} finally {
|
|
10455
|
+
try {
|
|
10456
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
10457
|
+
} finally {
|
|
10458
|
+
if (_d) throw _e;
|
|
10459
|
+
}
|
|
10460
|
+
}
|
|
10461
|
+
|
|
10462
|
+
return _arr;
|
|
10463
|
+
}
|
|
10464
|
+
|
|
10465
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
10466
|
+
if (!o) return;
|
|
10467
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
10468
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
10469
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
10470
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
10471
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
10472
|
+
}
|
|
10473
|
+
|
|
10474
|
+
function _arrayLikeToArray(arr, len) {
|
|
10475
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
10476
|
+
|
|
10477
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
10478
|
+
|
|
10479
|
+
return arr2;
|
|
10480
|
+
}
|
|
10481
|
+
|
|
10482
|
+
function _nonIterableRest() {
|
|
10483
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
10484
|
+
}
|
|
10485
|
+
|
|
10486
|
+
var useAttachEvent = function useAttachEvent(element, event, cb) {
|
|
10487
|
+
var cbDefined = !!cb;
|
|
10488
|
+
var cbRef = React__default["default"].useRef(cb); // In many integrations the callback prop changes on each render.
|
|
10489
|
+
// Using a ref saves us from calling element.on/.off every render.
|
|
10490
|
+
|
|
10491
|
+
React__default["default"].useEffect(function () {
|
|
10492
|
+
cbRef.current = cb;
|
|
10493
|
+
}, [cb]);
|
|
10494
|
+
React__default["default"].useEffect(function () {
|
|
10495
|
+
if (!cbDefined || !element) {
|
|
10496
|
+
return function () {};
|
|
10497
|
+
}
|
|
10498
|
+
|
|
10499
|
+
var decoratedCb = function decoratedCb() {
|
|
10500
|
+
if (cbRef.current) {
|
|
10501
|
+
cbRef.current.apply(cbRef, arguments);
|
|
10502
|
+
}
|
|
10503
|
+
};
|
|
10504
|
+
|
|
10505
|
+
element.on(event, decoratedCb);
|
|
10506
|
+
return function () {
|
|
10507
|
+
element.off(event, decoratedCb);
|
|
10508
|
+
};
|
|
10509
|
+
}, [cbDefined, event, element, cbRef]);
|
|
10510
|
+
};
|
|
10511
|
+
|
|
10512
|
+
var usePrevious = function usePrevious(value) {
|
|
10513
|
+
var ref = React__default["default"].useRef(value);
|
|
10514
|
+
React__default["default"].useEffect(function () {
|
|
10515
|
+
ref.current = value;
|
|
10516
|
+
}, [value]);
|
|
10517
|
+
return ref.current;
|
|
10518
|
+
};
|
|
10519
|
+
|
|
10520
|
+
var isUnknownObject = function isUnknownObject(raw) {
|
|
10521
|
+
return raw !== null && _typeof(raw) === 'object';
|
|
10522
|
+
};
|
|
10523
|
+
var isPromise = function isPromise(raw) {
|
|
10524
|
+
return isUnknownObject(raw) && typeof raw.then === 'function';
|
|
10525
|
+
}; // We are using types to enforce the `stripe` prop in this lib,
|
|
10526
|
+
// but in an untyped integration `stripe` could be anything, so we need
|
|
10527
|
+
// to do some sanity validation to prevent type errors.
|
|
10528
|
+
|
|
10529
|
+
var isStripe = function isStripe(raw) {
|
|
10530
|
+
return isUnknownObject(raw) && typeof raw.elements === 'function' && typeof raw.createToken === 'function' && typeof raw.createPaymentMethod === 'function' && typeof raw.confirmCardPayment === 'function';
|
|
10531
|
+
};
|
|
10532
|
+
|
|
10533
|
+
var PLAIN_OBJECT_STR = '[object Object]';
|
|
10534
|
+
var isEqual = function isEqual(left, right) {
|
|
10535
|
+
if (!isUnknownObject(left) || !isUnknownObject(right)) {
|
|
10536
|
+
return left === right;
|
|
10537
|
+
}
|
|
10538
|
+
|
|
10539
|
+
var leftArray = Array.isArray(left);
|
|
10540
|
+
var rightArray = Array.isArray(right);
|
|
10541
|
+
if (leftArray !== rightArray) return false;
|
|
10542
|
+
var leftPlainObject = Object.prototype.toString.call(left) === PLAIN_OBJECT_STR;
|
|
10543
|
+
var rightPlainObject = Object.prototype.toString.call(right) === PLAIN_OBJECT_STR;
|
|
10544
|
+
if (leftPlainObject !== rightPlainObject) return false; // not sure what sort of special object this is (regexp is one option), so
|
|
10545
|
+
// fallback to reference check.
|
|
10546
|
+
|
|
10547
|
+
if (!leftPlainObject && !leftArray) return left === right;
|
|
10548
|
+
var leftKeys = Object.keys(left);
|
|
10549
|
+
var rightKeys = Object.keys(right);
|
|
10550
|
+
if (leftKeys.length !== rightKeys.length) return false;
|
|
10551
|
+
var keySet = {};
|
|
10552
|
+
|
|
10553
|
+
for (var i = 0; i < leftKeys.length; i += 1) {
|
|
10554
|
+
keySet[leftKeys[i]] = true;
|
|
10555
|
+
}
|
|
10556
|
+
|
|
10557
|
+
for (var _i = 0; _i < rightKeys.length; _i += 1) {
|
|
10558
|
+
keySet[rightKeys[_i]] = true;
|
|
10559
|
+
}
|
|
10560
|
+
|
|
10561
|
+
var allKeys = Object.keys(keySet);
|
|
10562
|
+
|
|
10563
|
+
if (allKeys.length !== leftKeys.length) {
|
|
10564
|
+
return false;
|
|
10565
|
+
}
|
|
10566
|
+
|
|
10567
|
+
var l = left;
|
|
10568
|
+
var r = right;
|
|
10569
|
+
|
|
10570
|
+
var pred = function pred(key) {
|
|
10571
|
+
return isEqual(l[key], r[key]);
|
|
10572
|
+
};
|
|
10573
|
+
|
|
10574
|
+
return allKeys.every(pred);
|
|
10575
|
+
};
|
|
10576
|
+
|
|
10577
|
+
var extractAllowedOptionsUpdates = function extractAllowedOptionsUpdates(options, prevOptions, immutableKeys) {
|
|
10578
|
+
if (!isUnknownObject(options)) {
|
|
10579
|
+
return null;
|
|
10580
|
+
}
|
|
10581
|
+
|
|
10582
|
+
return Object.keys(options).reduce(function (newOptions, key) {
|
|
10583
|
+
var isUpdated = !isUnknownObject(prevOptions) || !isEqual(options[key], prevOptions[key]);
|
|
10584
|
+
|
|
10585
|
+
if (immutableKeys.includes(key)) {
|
|
10586
|
+
if (isUpdated) {
|
|
10587
|
+
console.warn("Unsupported prop change: options.".concat(key, " is not a mutable property."));
|
|
10588
|
+
}
|
|
10589
|
+
|
|
10590
|
+
return newOptions;
|
|
10591
|
+
}
|
|
10592
|
+
|
|
10593
|
+
if (!isUpdated) {
|
|
10594
|
+
return newOptions;
|
|
10595
|
+
}
|
|
10596
|
+
|
|
10597
|
+
return _objectSpread2(_objectSpread2({}, newOptions || {}), {}, _defineProperty({}, key, options[key]));
|
|
10598
|
+
}, null);
|
|
10599
|
+
};
|
|
10600
|
+
|
|
10601
|
+
var INVALID_STRIPE_ERROR$1 = '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.'; // We are using types to enforce the `stripe` prop in this lib, but in a real
|
|
10602
|
+
// integration `stripe` could be anything, so we need to do some sanity
|
|
10603
|
+
// validation to prevent type errors.
|
|
10604
|
+
|
|
10605
|
+
var validateStripe = function validateStripe(maybeStripe) {
|
|
10606
|
+
var errorMsg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : INVALID_STRIPE_ERROR$1;
|
|
10607
|
+
|
|
10608
|
+
if (maybeStripe === null || isStripe(maybeStripe)) {
|
|
10609
|
+
return maybeStripe;
|
|
10610
|
+
}
|
|
10611
|
+
|
|
10612
|
+
throw new Error(errorMsg);
|
|
10613
|
+
};
|
|
10614
|
+
|
|
10615
|
+
var parseStripeProp = function parseStripeProp(raw) {
|
|
10616
|
+
var errorMsg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : INVALID_STRIPE_ERROR$1;
|
|
10617
|
+
|
|
10618
|
+
if (isPromise(raw)) {
|
|
10619
|
+
return {
|
|
10620
|
+
tag: 'async',
|
|
10621
|
+
stripePromise: Promise.resolve(raw).then(function (result) {
|
|
10622
|
+
return validateStripe(result, errorMsg);
|
|
10623
|
+
})
|
|
10624
|
+
};
|
|
10625
|
+
}
|
|
10626
|
+
|
|
10627
|
+
var stripe = validateStripe(raw, errorMsg);
|
|
10628
|
+
|
|
10629
|
+
if (stripe === null) {
|
|
10630
|
+
return {
|
|
10631
|
+
tag: 'empty'
|
|
10632
|
+
};
|
|
10633
|
+
}
|
|
10634
|
+
|
|
10635
|
+
return {
|
|
10636
|
+
tag: 'sync',
|
|
10637
|
+
stripe: stripe
|
|
10638
|
+
};
|
|
10639
|
+
};
|
|
10640
|
+
|
|
10641
|
+
var registerWithStripeJs = function registerWithStripeJs(stripe) {
|
|
10642
|
+
if (!stripe || !stripe._registerWrapper || !stripe.registerAppInfo) {
|
|
10643
|
+
return;
|
|
10644
|
+
}
|
|
10645
|
+
|
|
10646
|
+
stripe._registerWrapper({
|
|
10647
|
+
name: 'react-stripe-js',
|
|
10648
|
+
version: "6.1.0"
|
|
10649
|
+
});
|
|
10650
|
+
|
|
10651
|
+
stripe.registerAppInfo({
|
|
10652
|
+
name: 'react-stripe-js',
|
|
10653
|
+
version: "6.1.0",
|
|
10654
|
+
url: 'https://stripe.com/docs/stripe-js/react'
|
|
10655
|
+
});
|
|
10656
|
+
};
|
|
10657
|
+
|
|
10658
|
+
var ElementsContext = /*#__PURE__*/React__default["default"].createContext(null);
|
|
10659
|
+
ElementsContext.displayName = 'ElementsContext';
|
|
10660
|
+
var parseElementsContext = function parseElementsContext(ctx, useCase) {
|
|
10661
|
+
if (!ctx) {
|
|
10662
|
+
throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(useCase, " in an <Elements> provider."));
|
|
10663
|
+
}
|
|
10664
|
+
|
|
10665
|
+
return ctx;
|
|
10666
|
+
};
|
|
10667
|
+
/**
|
|
10668
|
+
* The `Elements` provider allows you to use [Element components](https://stripe.com/docs/stripe-js/react#element-components) and access the [Stripe object](https://stripe.com/docs/js/initializing) in any nested component.
|
|
10669
|
+
* Render an `Elements` provider at the root of your React app so that it is available everywhere you need it.
|
|
10670
|
+
*
|
|
10671
|
+
* To use the `Elements` provider, call `loadStripe` from `@stripe/stripe-js` with your publishable key.
|
|
10672
|
+
* The `loadStripe` function will asynchronously load the Stripe.js script and initialize a `Stripe` object.
|
|
10673
|
+
* Pass the returned `Promise` to `Elements`.
|
|
10674
|
+
*
|
|
10675
|
+
* @docs https://docs.stripe.com/sdks/stripejs-react?ui=elements#elements-provider
|
|
10676
|
+
*/
|
|
10677
|
+
|
|
10678
|
+
var Elements = function Elements(_ref) {
|
|
10679
|
+
var rawStripeProp = _ref.stripe,
|
|
10680
|
+
options = _ref.options,
|
|
10681
|
+
children = _ref.children;
|
|
10682
|
+
var parsed = React__default["default"].useMemo(function () {
|
|
10683
|
+
return parseStripeProp(rawStripeProp);
|
|
10684
|
+
}, [rawStripeProp]); // For a sync stripe instance, initialize into context
|
|
10685
|
+
|
|
10686
|
+
var _React$useState = React__default["default"].useState(function () {
|
|
10687
|
+
return {
|
|
10688
|
+
stripe: parsed.tag === 'sync' ? parsed.stripe : null,
|
|
10689
|
+
elements: parsed.tag === 'sync' ? parsed.stripe.elements(options) : null
|
|
10690
|
+
};
|
|
10691
|
+
}),
|
|
10692
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
10693
|
+
ctx = _React$useState2[0],
|
|
10694
|
+
setContext = _React$useState2[1];
|
|
10695
|
+
|
|
10696
|
+
React__default["default"].useEffect(function () {
|
|
10697
|
+
var isMounted = true;
|
|
10698
|
+
|
|
10699
|
+
var safeSetContext = function safeSetContext(stripe) {
|
|
10700
|
+
setContext(function (ctx) {
|
|
10701
|
+
// no-op if we already have a stripe instance (https://github.com/stripe/react-stripe-js/issues/296)
|
|
10702
|
+
if (ctx.stripe) return ctx;
|
|
10703
|
+
return {
|
|
10704
|
+
stripe: stripe,
|
|
10705
|
+
elements: stripe.elements(options)
|
|
10706
|
+
};
|
|
10707
|
+
});
|
|
10708
|
+
}; // For an async stripePromise, store it in context once resolved
|
|
10709
|
+
|
|
10710
|
+
|
|
10711
|
+
if (parsed.tag === 'async' && !ctx.stripe) {
|
|
10712
|
+
parsed.stripePromise.then(function (stripe) {
|
|
10713
|
+
if (stripe && isMounted) {
|
|
10714
|
+
// Only update Elements context if the component is still mounted
|
|
10715
|
+
// and stripe is not null. We allow stripe to be null to make
|
|
10716
|
+
// handling SSR easier.
|
|
10717
|
+
safeSetContext(stripe);
|
|
10718
|
+
}
|
|
10719
|
+
});
|
|
10720
|
+
} else if (parsed.tag === 'sync' && !ctx.stripe) {
|
|
10721
|
+
// Or, handle a sync stripe instance going from null -> populated
|
|
10722
|
+
safeSetContext(parsed.stripe);
|
|
10723
|
+
}
|
|
10724
|
+
|
|
10725
|
+
return function () {
|
|
10726
|
+
isMounted = false;
|
|
10727
|
+
};
|
|
10728
|
+
}, [parsed, ctx, options]); // Warn on changes to stripe prop
|
|
10729
|
+
|
|
10730
|
+
var prevStripe = usePrevious(rawStripeProp);
|
|
10731
|
+
React__default["default"].useEffect(function () {
|
|
10732
|
+
if (prevStripe !== null && prevStripe !== rawStripeProp) {
|
|
10733
|
+
console.warn('Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.');
|
|
10734
|
+
}
|
|
10735
|
+
}, [prevStripe, rawStripeProp]); // Apply updates to elements when options prop has relevant changes
|
|
10736
|
+
|
|
10737
|
+
var prevOptions = usePrevious(options);
|
|
10738
|
+
React__default["default"].useEffect(function () {
|
|
10739
|
+
if (!ctx.elements) {
|
|
10740
|
+
return;
|
|
10741
|
+
}
|
|
10742
|
+
|
|
10743
|
+
var updates = extractAllowedOptionsUpdates(options, prevOptions, ['clientSecret', 'fonts']);
|
|
10744
|
+
|
|
10745
|
+
if (updates) {
|
|
10746
|
+
ctx.elements.update(updates);
|
|
10747
|
+
}
|
|
10748
|
+
}, [options, prevOptions, ctx.elements]); // Attach react-stripe-js version to stripe.js instance
|
|
10749
|
+
|
|
10750
|
+
React__default["default"].useEffect(function () {
|
|
10751
|
+
registerWithStripeJs(ctx.stripe);
|
|
10752
|
+
}, [ctx.stripe]);
|
|
10753
|
+
return /*#__PURE__*/React__default["default"].createElement(ElementsContext.Provider, {
|
|
10754
|
+
value: ctx
|
|
10755
|
+
}, children);
|
|
10756
|
+
};
|
|
10757
|
+
Elements.propTypes = {
|
|
10758
|
+
stripe: PropTypes.any,
|
|
10759
|
+
options: PropTypes.object
|
|
10760
|
+
};
|
|
10761
|
+
var useElementsContextWithUseCase = function useElementsContextWithUseCase(useCaseMessage) {
|
|
10762
|
+
var ctx = React__default["default"].useContext(ElementsContext);
|
|
10763
|
+
return parseElementsContext(ctx, useCaseMessage);
|
|
10764
|
+
};
|
|
10765
|
+
/**
|
|
10766
|
+
* @docs https://stripe.com/docs/stripe-js/react#useelements-hook
|
|
10767
|
+
*/
|
|
10768
|
+
|
|
10769
|
+
var useElements = function useElements() {
|
|
10770
|
+
var _useElementsContextWi = useElementsContextWithUseCase('calls useElements()'),
|
|
10771
|
+
elements = _useElementsContextWi.elements;
|
|
10772
|
+
|
|
10773
|
+
return elements;
|
|
10774
|
+
};
|
|
10775
|
+
({
|
|
10776
|
+
children: PropTypes.func.isRequired
|
|
10777
|
+
});
|
|
10778
|
+
|
|
10779
|
+
var CheckoutContext = /*#__PURE__*/React__default["default"].createContext(null);
|
|
10780
|
+
CheckoutContext.displayName = 'CheckoutContext';
|
|
10781
|
+
var useElementsOrCheckoutContextWithUseCase = function useElementsOrCheckoutContextWithUseCase(useCaseString) {
|
|
10782
|
+
var checkout = React__default["default"].useContext(CheckoutContext);
|
|
10783
|
+
var elements = React__default["default"].useContext(ElementsContext);
|
|
10784
|
+
|
|
10785
|
+
if (checkout) {
|
|
10786
|
+
if (elements) {
|
|
10787
|
+
throw new Error("You cannot wrap the part of your app that ".concat(useCaseString, " in both a checkout provider and <Elements> provider."));
|
|
10788
|
+
} else {
|
|
10789
|
+
return checkout;
|
|
10790
|
+
}
|
|
10791
|
+
} else {
|
|
10792
|
+
return parseElementsContext(elements, useCaseString);
|
|
10793
|
+
}
|
|
10794
|
+
};
|
|
10795
|
+
|
|
10796
|
+
var _excluded = ["mode"];
|
|
10797
|
+
|
|
10798
|
+
var capitalized = function capitalized(str) {
|
|
10799
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
10800
|
+
};
|
|
10801
|
+
|
|
10802
|
+
var createElementComponent = function createElementComponent(type, isServer, customDisplayName) {
|
|
10803
|
+
var displayName = "".concat(capitalized(type), "Element");
|
|
10804
|
+
|
|
10805
|
+
var ClientElement = function ClientElement(_ref) {
|
|
10806
|
+
var id = _ref.id,
|
|
10807
|
+
className = _ref.className,
|
|
10808
|
+
_ref$options = _ref.options,
|
|
10809
|
+
options = _ref$options === void 0 ? {} : _ref$options,
|
|
10810
|
+
onBlur = _ref.onBlur,
|
|
10811
|
+
onFocus = _ref.onFocus,
|
|
10812
|
+
onReady = _ref.onReady,
|
|
10813
|
+
onChange = _ref.onChange,
|
|
10814
|
+
onEscape = _ref.onEscape,
|
|
10815
|
+
onClick = _ref.onClick,
|
|
10816
|
+
onLoadError = _ref.onLoadError,
|
|
10817
|
+
onLoaderStart = _ref.onLoaderStart,
|
|
10818
|
+
onNetworksChange = _ref.onNetworksChange,
|
|
10819
|
+
onConfirm = _ref.onConfirm,
|
|
10820
|
+
onCancel = _ref.onCancel,
|
|
10821
|
+
onShippingAddressChange = _ref.onShippingAddressChange,
|
|
10822
|
+
onShippingRateChange = _ref.onShippingRateChange,
|
|
10823
|
+
onSavedPaymentMethodRemove = _ref.onSavedPaymentMethodRemove,
|
|
10824
|
+
onSavedPaymentMethodUpdate = _ref.onSavedPaymentMethodUpdate;
|
|
10825
|
+
var ctx = useElementsOrCheckoutContextWithUseCase("mounts <".concat(displayName, ">"));
|
|
10826
|
+
var elements = 'elements' in ctx ? ctx.elements : null;
|
|
10827
|
+
var checkoutState = 'checkoutState' in ctx ? ctx.checkoutState : null;
|
|
10828
|
+
var checkoutSdk = (checkoutState === null || checkoutState === void 0 ? void 0 : checkoutState.type) === 'success' || (checkoutState === null || checkoutState === void 0 ? void 0 : checkoutState.type) === 'loading' ? checkoutState.sdk : null;
|
|
10829
|
+
|
|
10830
|
+
var _React$useState = React__default["default"].useState(null),
|
|
10831
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
10832
|
+
element = _React$useState2[0],
|
|
10833
|
+
setElement = _React$useState2[1];
|
|
10834
|
+
|
|
10835
|
+
var elementRef = React__default["default"].useRef(null);
|
|
10836
|
+
var domNode = React__default["default"].useRef(null); // For every event where the merchant provides a callback, call element.on
|
|
10837
|
+
// with that callback. If the merchant ever changes the callback, removes
|
|
10838
|
+
// the old callback with element.off and then call element.on with the new one.
|
|
10839
|
+
|
|
10840
|
+
useAttachEvent(element, 'blur', onBlur);
|
|
10841
|
+
useAttachEvent(element, 'focus', onFocus);
|
|
10842
|
+
useAttachEvent(element, 'escape', onEscape);
|
|
10843
|
+
useAttachEvent(element, 'click', onClick);
|
|
10844
|
+
useAttachEvent(element, 'loaderror', onLoadError);
|
|
10845
|
+
useAttachEvent(element, 'loaderstart', onLoaderStart);
|
|
10846
|
+
useAttachEvent(element, 'networkschange', onNetworksChange);
|
|
10847
|
+
useAttachEvent(element, 'confirm', onConfirm);
|
|
10848
|
+
useAttachEvent(element, 'cancel', onCancel);
|
|
10849
|
+
useAttachEvent(element, 'shippingaddresschange', onShippingAddressChange);
|
|
10850
|
+
useAttachEvent(element, 'shippingratechange', onShippingRateChange);
|
|
10851
|
+
useAttachEvent(element, 'savedpaymentmethodremove', onSavedPaymentMethodRemove);
|
|
10852
|
+
useAttachEvent(element, 'savedpaymentmethodupdate', onSavedPaymentMethodUpdate);
|
|
10853
|
+
useAttachEvent(element, 'change', onChange);
|
|
10854
|
+
var readyCallback;
|
|
10855
|
+
|
|
10856
|
+
if (onReady) {
|
|
10857
|
+
if (type === 'expressCheckout') {
|
|
10858
|
+
// Passes through the event, which includes visible PM types
|
|
10859
|
+
readyCallback = onReady;
|
|
10860
|
+
} else {
|
|
10861
|
+
// For other Elements, pass through the Element itself.
|
|
10862
|
+
readyCallback = function readyCallback() {
|
|
10863
|
+
onReady(element);
|
|
10864
|
+
};
|
|
10865
|
+
}
|
|
10866
|
+
}
|
|
10867
|
+
|
|
10868
|
+
useAttachEvent(element, 'ready', readyCallback);
|
|
10869
|
+
React__default["default"].useLayoutEffect(function () {
|
|
10870
|
+
if (elementRef.current === null && domNode.current !== null && (elements || checkoutSdk)) {
|
|
10871
|
+
var newElement = null;
|
|
10872
|
+
|
|
10873
|
+
if (checkoutSdk) {
|
|
10874
|
+
var elementsSdk = checkoutSdk;
|
|
10875
|
+
var formSdk = checkoutSdk;
|
|
10876
|
+
|
|
10877
|
+
switch (type) {
|
|
10878
|
+
case 'paymentForm':
|
|
10879
|
+
newElement = formSdk.createForm(options);
|
|
10880
|
+
break;
|
|
10881
|
+
|
|
10882
|
+
case 'payment':
|
|
10883
|
+
newElement = elementsSdk.createPaymentElement(options);
|
|
10884
|
+
break;
|
|
10885
|
+
|
|
10886
|
+
case 'address':
|
|
10887
|
+
if ('mode' in options) {
|
|
10888
|
+
var mode = options.mode,
|
|
10889
|
+
restOptions = _objectWithoutProperties(options, _excluded);
|
|
10890
|
+
|
|
10891
|
+
if (mode === 'shipping') {
|
|
10892
|
+
newElement = elementsSdk.createShippingAddressElement(restOptions);
|
|
10893
|
+
} else if (mode === 'billing') {
|
|
10894
|
+
newElement = elementsSdk.createBillingAddressElement(restOptions);
|
|
10895
|
+
} else {
|
|
10896
|
+
throw new Error("Invalid options.mode. mode must be 'billing' or 'shipping'.");
|
|
10897
|
+
}
|
|
10898
|
+
} else {
|
|
10899
|
+
throw new Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");
|
|
10900
|
+
}
|
|
10901
|
+
|
|
10902
|
+
break;
|
|
10903
|
+
|
|
10904
|
+
case 'expressCheckout':
|
|
10905
|
+
newElement = elementsSdk.createExpressCheckoutElement(options);
|
|
10906
|
+
break;
|
|
10907
|
+
|
|
10908
|
+
case 'currencySelector':
|
|
10909
|
+
newElement = checkoutSdk.createCurrencySelectorElement();
|
|
10910
|
+
break;
|
|
10911
|
+
|
|
10912
|
+
case 'taxId':
|
|
10913
|
+
newElement = elementsSdk.createTaxIdElement(options);
|
|
10914
|
+
break;
|
|
10915
|
+
|
|
10916
|
+
default:
|
|
10917
|
+
throw new Error("<".concat(displayName, "> is not supported inside a checkout provider. Use an <Elements> provider instead."));
|
|
10918
|
+
}
|
|
10919
|
+
} else if (elements) {
|
|
10920
|
+
newElement = elements.create(type, options);
|
|
10921
|
+
} // Store element in a ref to ensure it's _immediately_ available in cleanup hooks in StrictMode
|
|
10922
|
+
|
|
10923
|
+
|
|
10924
|
+
elementRef.current = newElement; // Store element in state to facilitate event listener attachment
|
|
10925
|
+
|
|
10926
|
+
setElement(newElement);
|
|
10927
|
+
|
|
10928
|
+
if (newElement) {
|
|
10929
|
+
newElement.mount(domNode.current);
|
|
10930
|
+
}
|
|
10931
|
+
}
|
|
10932
|
+
}, [elements, checkoutSdk, options]);
|
|
10933
|
+
var prevOptions = usePrevious(options);
|
|
10934
|
+
React__default["default"].useEffect(function () {
|
|
10935
|
+
if (!elementRef.current) {
|
|
10936
|
+
return;
|
|
10937
|
+
}
|
|
10938
|
+
|
|
10939
|
+
var updates = extractAllowedOptionsUpdates(options, prevOptions, ['paymentRequest']);
|
|
10940
|
+
|
|
10941
|
+
if (updates && 'update' in elementRef.current) {
|
|
10942
|
+
elementRef.current.update(updates);
|
|
10943
|
+
}
|
|
10944
|
+
}, [options, prevOptions]);
|
|
10945
|
+
React__default["default"].useLayoutEffect(function () {
|
|
10946
|
+
return function () {
|
|
10947
|
+
if (elementRef.current && typeof elementRef.current.destroy === 'function') {
|
|
10948
|
+
try {
|
|
10949
|
+
elementRef.current.destroy();
|
|
10950
|
+
elementRef.current = null;
|
|
10951
|
+
} catch (error) {// Do nothing
|
|
10952
|
+
}
|
|
10953
|
+
}
|
|
10954
|
+
};
|
|
10955
|
+
}, []);
|
|
10956
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
10957
|
+
id: id,
|
|
10958
|
+
className: className,
|
|
10959
|
+
ref: domNode
|
|
10960
|
+
});
|
|
10961
|
+
}; // Only render the Element wrapper in a server environment.
|
|
10962
|
+
|
|
10963
|
+
|
|
10964
|
+
var ServerElement = function ServerElement(props) {
|
|
10965
|
+
useElementsOrCheckoutContextWithUseCase("mounts <".concat(displayName, ">"));
|
|
10966
|
+
var id = props.id,
|
|
10967
|
+
className = props.className;
|
|
10968
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
10969
|
+
id: id,
|
|
10970
|
+
className: className
|
|
10971
|
+
});
|
|
10972
|
+
};
|
|
10973
|
+
|
|
10974
|
+
var Element = isServer ? ServerElement : ClientElement;
|
|
10975
|
+
Element.propTypes = {
|
|
10976
|
+
id: PropTypes.string,
|
|
10977
|
+
className: PropTypes.string,
|
|
10978
|
+
onChange: PropTypes.func,
|
|
10979
|
+
onBlur: PropTypes.func,
|
|
10980
|
+
onFocus: PropTypes.func,
|
|
10981
|
+
onReady: PropTypes.func,
|
|
10982
|
+
onEscape: PropTypes.func,
|
|
10983
|
+
onClick: PropTypes.func,
|
|
10984
|
+
onLoadError: PropTypes.func,
|
|
10985
|
+
onLoaderStart: PropTypes.func,
|
|
10986
|
+
onNetworksChange: PropTypes.func,
|
|
10987
|
+
onConfirm: PropTypes.func,
|
|
10988
|
+
onCancel: PropTypes.func,
|
|
10989
|
+
onShippingAddressChange: PropTypes.func,
|
|
10990
|
+
onShippingRateChange: PropTypes.func,
|
|
10991
|
+
onSavedPaymentMethodRemove: PropTypes.func,
|
|
10992
|
+
onSavedPaymentMethodUpdate: PropTypes.func,
|
|
10993
|
+
options: PropTypes.object
|
|
10994
|
+
};
|
|
10995
|
+
Element.displayName = displayName;
|
|
10996
|
+
Element.__elementType = type;
|
|
10997
|
+
return Element;
|
|
10998
|
+
};
|
|
10999
|
+
|
|
11000
|
+
var isServer = typeof window === 'undefined';
|
|
11001
|
+
|
|
11002
|
+
var EmbeddedCheckoutContext = /*#__PURE__*/React__default["default"].createContext(null);
|
|
11003
|
+
EmbeddedCheckoutContext.displayName = 'EmbeddedCheckoutProviderContext';
|
|
11004
|
+
|
|
11005
|
+
/**
|
|
11006
|
+
* @docs https://stripe.com/docs/stripe-js/react#usestripe-hook
|
|
11007
|
+
*/
|
|
11008
|
+
|
|
11009
|
+
var useStripe = function useStripe() {
|
|
11010
|
+
var _useElementsOrCheckou = useElementsOrCheckoutContextWithUseCase('calls useStripe()'),
|
|
11011
|
+
stripe = _useElementsOrCheckou.stripe;
|
|
11012
|
+
|
|
11013
|
+
return stripe;
|
|
11014
|
+
};
|
|
11015
|
+
|
|
11016
|
+
/**
|
|
11017
|
+
* Requires beta access:
|
|
11018
|
+
* Contact [Stripe support](https://support.stripe.com/) for more information.
|
|
11019
|
+
*
|
|
11020
|
+
* @docs https://stripe.com/docs/stripe-js/react#element-components
|
|
11021
|
+
*/
|
|
11022
|
+
|
|
11023
|
+
createElementComponent('auBankAccount', isServer);
|
|
11024
|
+
/**
|
|
11025
|
+
* @docs https://stripe.com/docs/stripe-js/react#element-components
|
|
11026
|
+
*/
|
|
11027
|
+
|
|
11028
|
+
createElementComponent('card', isServer);
|
|
11029
|
+
/**
|
|
11030
|
+
* @docs https://stripe.com/docs/stripe-js/react#element-components
|
|
11031
|
+
*/
|
|
11032
|
+
|
|
11033
|
+
createElementComponent('cardNumber', isServer);
|
|
11034
|
+
/**
|
|
11035
|
+
* @docs https://stripe.com/docs/stripe-js/react#element-components
|
|
11036
|
+
*/
|
|
11037
|
+
|
|
11038
|
+
createElementComponent('cardExpiry', isServer);
|
|
11039
|
+
/**
|
|
11040
|
+
* @docs https://stripe.com/docs/stripe-js/react#element-components
|
|
11041
|
+
*/
|
|
11042
|
+
|
|
11043
|
+
createElementComponent('cardCvc', isServer);
|
|
11044
|
+
/**
|
|
11045
|
+
* @docs https://stripe.com/docs/stripe-js/react#element-components
|
|
11046
|
+
*/
|
|
11047
|
+
|
|
11048
|
+
createElementComponent('iban', isServer);
|
|
11049
|
+
var PaymentElement = createElementComponent('payment', isServer);
|
|
11050
|
+
/**
|
|
11051
|
+
* @docs https://stripe.com/docs/stripe-js/react#element-components
|
|
11052
|
+
*/
|
|
11053
|
+
|
|
11054
|
+
createElementComponent('expressCheckout', isServer);
|
|
11055
|
+
/**
|
|
11056
|
+
* @docs https://stripe.com/docs/stripe-js/react#element-components
|
|
11057
|
+
*/
|
|
11058
|
+
|
|
11059
|
+
var PaymentRequestButtonElement = createElementComponent('paymentRequestButton', isServer);
|
|
11060
|
+
/**
|
|
11061
|
+
* @docs https://stripe.com/docs/stripe-js/react#element-components
|
|
11062
|
+
*/
|
|
11063
|
+
|
|
11064
|
+
createElementComponent('linkAuthentication', isServer);
|
|
11065
|
+
/**
|
|
11066
|
+
* @docs https://stripe.com/docs/stripe-js/react#element-components
|
|
11067
|
+
*/
|
|
11068
|
+
|
|
11069
|
+
createElementComponent('address', isServer);
|
|
11070
|
+
/**
|
|
11071
|
+
* @deprecated
|
|
11072
|
+
* Use `AddressElement` instead.
|
|
11073
|
+
*
|
|
11074
|
+
* @docs https://stripe.com/docs/stripe-js/react#element-components
|
|
11075
|
+
*/
|
|
11076
|
+
|
|
11077
|
+
createElementComponent('shippingAddress', isServer);
|
|
11078
|
+
/**
|
|
11079
|
+
* @docs https://stripe.com/docs/stripe-js/react#element-components
|
|
11080
|
+
*/
|
|
11081
|
+
|
|
11082
|
+
createElementComponent('paymentMethodMessaging', isServer);
|
|
11083
|
+
/**
|
|
11084
|
+
* Requires beta access:
|
|
11085
|
+
* Contact [Stripe support](https://support.stripe.com/) for more information.
|
|
11086
|
+
*/
|
|
11087
|
+
|
|
11088
|
+
createElementComponent('taxId', isServer);
|
|
11089
|
+
/**
|
|
11090
|
+
* @docs https://stripe.com/docs/issuing/elements
|
|
11091
|
+
*/
|
|
11092
|
+
|
|
11093
|
+
createElementComponent('issuingCardNumberDisplay', isServer);
|
|
11094
|
+
/**
|
|
11095
|
+
* @docs https://stripe.com/docs/issuing/elements
|
|
11096
|
+
*/
|
|
11097
|
+
|
|
11098
|
+
createElementComponent('issuingCardCvcDisplay', isServer);
|
|
11099
|
+
/**
|
|
11100
|
+
* @docs https://stripe.com/docs/issuing/elements
|
|
11101
|
+
*/
|
|
11102
|
+
|
|
11103
|
+
createElementComponent('issuingCardExpiryDisplay', isServer);
|
|
11104
|
+
/**
|
|
11105
|
+
* @docs https://stripe.com/docs/issuing/elements
|
|
11106
|
+
*/
|
|
11107
|
+
|
|
11108
|
+
createElementComponent('issuingCardPinDisplay', isServer);
|
|
11109
|
+
/**
|
|
11110
|
+
* @docs https://stripe.com/docs/issuing/elements
|
|
11111
|
+
*/
|
|
11112
|
+
|
|
11113
|
+
createElementComponent('issuingCardCopyButton', isServer);
|
|
11114
|
+
|
|
10108
11115
|
var lib = {};
|
|
10109
11116
|
|
|
10110
11117
|
Object.defineProperty(lib, "__esModule", {
|
|
@@ -10557,7 +11564,7 @@ class Payment {
|
|
|
10557
11564
|
* @param {(StripeGateway|PaypalGateway|VantivGateway|TapGateway|CybersourceGateway|BraintreeGateway)} paymentGateway
|
|
10558
11565
|
*/
|
|
10559
11566
|
constructor(paymentGateway) {
|
|
10560
|
-
_defineProperty$
|
|
11567
|
+
_defineProperty$4(this, "execute", (options, callback) => {
|
|
10561
11568
|
if (!this.paymentGateway) {
|
|
10562
11569
|
callback(_classPrivateFieldGet(this, _generateUserError).call(this), null);
|
|
10563
11570
|
return console.error("No payment gateway provided");
|
|
@@ -10652,7 +11659,7 @@ class StripeGateway {
|
|
|
10652
11659
|
writable: true,
|
|
10653
11660
|
value: PAYMENT_GATEWAYS_ENUM["stripe"]
|
|
10654
11661
|
});
|
|
10655
|
-
_defineProperty$
|
|
11662
|
+
_defineProperty$4(this, "execute", (options, callback) => {
|
|
10656
11663
|
const types = PAYMENT_TYPES;
|
|
10657
11664
|
switch (options.type) {
|
|
10658
11665
|
case types.CREATE_SUBSCRIPTION:
|
|
@@ -10839,7 +11846,7 @@ class PaypalGateway {
|
|
|
10839
11846
|
writable: true,
|
|
10840
11847
|
value: PAYMENT_GATEWAYS_ENUM["paypal"]
|
|
10841
11848
|
});
|
|
10842
|
-
_defineProperty$
|
|
11849
|
+
_defineProperty$4(this, "execute", (options, callback) => {
|
|
10843
11850
|
const types = PAYMENT_TYPES;
|
|
10844
11851
|
switch (options.type) {
|
|
10845
11852
|
case types.CREATE_SUBSCRIPTION:
|
|
@@ -10939,7 +11946,7 @@ class VantivGateway {
|
|
|
10939
11946
|
writable: true,
|
|
10940
11947
|
value: PAYMENT_GATEWAYS_ENUM["vantiv"]
|
|
10941
11948
|
});
|
|
10942
|
-
_defineProperty$
|
|
11949
|
+
_defineProperty$4(this, "execute", (options, callback) => {
|
|
10943
11950
|
const types = PAYMENT_TYPES;
|
|
10944
11951
|
switch (options.type) {
|
|
10945
11952
|
case types.CREATE_SUBSCRIPTION:
|
|
@@ -11151,7 +12158,7 @@ class TapGateway {
|
|
|
11151
12158
|
writable: true,
|
|
11152
12159
|
value: PAYMENT_GATEWAYS_ENUM["tap"]
|
|
11153
12160
|
});
|
|
11154
|
-
_defineProperty$
|
|
12161
|
+
_defineProperty$4(this, "execute", (options, callback) => {
|
|
11155
12162
|
const types = PAYMENT_TYPES;
|
|
11156
12163
|
switch (options.type) {
|
|
11157
12164
|
case types.CREATE_SUBSCRIPTION:
|
|
@@ -11367,7 +12374,7 @@ class CybersourceGateway {
|
|
|
11367
12374
|
writable: true,
|
|
11368
12375
|
value: PAYMENT_GATEWAYS_ENUM["cybersource"]
|
|
11369
12376
|
});
|
|
11370
|
-
_defineProperty$
|
|
12377
|
+
_defineProperty$4(this, "execute", (options, callback) => {
|
|
11371
12378
|
const types = PAYMENT_TYPES;
|
|
11372
12379
|
switch (options.type) {
|
|
11373
12380
|
case types.CREATE_SUBSCRIPTION:
|
|
@@ -11601,7 +12608,7 @@ class BraintreeGateway {
|
|
|
11601
12608
|
writable: true,
|
|
11602
12609
|
value: PAYMENT_GATEWAYS_ENUM["braintree"]
|
|
11603
12610
|
});
|
|
11604
|
-
_defineProperty$
|
|
12611
|
+
_defineProperty$4(this, "execute", (options, callback) => {
|
|
11605
12612
|
const types = PAYMENT_TYPES;
|
|
11606
12613
|
switch (options.type) {
|
|
11607
12614
|
case types.CREATE_SUBSCRIPTION:
|
|
@@ -11620,14 +12627,14 @@ class BraintreeGateway {
|
|
|
11620
12627
|
console.error("Unsupported payment method: braintree Gateway");
|
|
11621
12628
|
}
|
|
11622
12629
|
});
|
|
11623
|
-
_defineProperty$
|
|
12630
|
+
_defineProperty$4(this, "createDropin", function (authorization, selector) {
|
|
11624
12631
|
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
11625
12632
|
return createBraintreeDropin(authorization, selector, options);
|
|
11626
12633
|
});
|
|
11627
|
-
_defineProperty$
|
|
12634
|
+
_defineProperty$4(this, "requestPaymentMethod", instance => {
|
|
11628
12635
|
return requestBraintreePaymentMethod(instance);
|
|
11629
12636
|
});
|
|
11630
|
-
_defineProperty$
|
|
12637
|
+
_defineProperty$4(this, "loadScript", () => {
|
|
11631
12638
|
return loadBraintreeScript();
|
|
11632
12639
|
});
|
|
11633
12640
|
_classPrivateFieldInitSpec(this, _createSubscription6, {
|
|
@@ -11970,8 +12977,8 @@ const PaymentMethodContainerWithoutStripe = _ref => {
|
|
|
11970
12977
|
onFailure = () => {},
|
|
11971
12978
|
...props
|
|
11972
12979
|
} = _ref;
|
|
11973
|
-
const stripe =
|
|
11974
|
-
const elements =
|
|
12980
|
+
const stripe = useStripe();
|
|
12981
|
+
const elements = useElements();
|
|
11975
12982
|
const [vantivPaymentRequest, setVantivPaymentRequest] = React.useState(null);
|
|
11976
12983
|
const [updatedCouponCode, setUpdatedCouponCode] = React.useState("");
|
|
11977
12984
|
const {
|
|
@@ -15398,7 +16405,7 @@ const PaymentMethodContainer = props => {
|
|
|
15398
16405
|
const cardProcessor = getSiteCardProcessor();
|
|
15399
16406
|
|
|
15400
16407
|
// Create the Stripe object
|
|
15401
|
-
const stripePromise = cardProcessor === "stripe" ?
|
|
16408
|
+
const stripePromise = cardProcessor === "stripe" ? loadStripe(window.Pelcro.environment.stripe, {
|
|
15402
16409
|
stripeAccount: window.Pelcro.site.read().account_id,
|
|
15403
16410
|
locale: getPageOrDefaultLanguage()
|
|
15404
16411
|
}) : null;
|
|
@@ -15443,7 +16450,7 @@ const PaymentMethodContainer = props => {
|
|
|
15443
16450
|
}, []); // eslint-disable-line react-hooks/exhaustive-deps
|
|
15444
16451
|
|
|
15445
16452
|
if (isStripeLoaded) {
|
|
15446
|
-
return /*#__PURE__*/React__default["default"].createElement("div", null, clientSecret || selectedPaymentMethodId ? /*#__PURE__*/React__default["default"].createElement(
|
|
16453
|
+
return /*#__PURE__*/React__default["default"].createElement("div", null, clientSecret || selectedPaymentMethodId ? /*#__PURE__*/React__default["default"].createElement(Elements, {
|
|
15447
16454
|
options: options,
|
|
15448
16455
|
stripe: stripePromise
|
|
15449
16456
|
}, /*#__PURE__*/React__default["default"].createElement(PaymentMethodContainerWithoutStripe, Object.assign({
|
|
@@ -15747,7 +16754,7 @@ const PelcroPaymentRequestButton = _ref => {
|
|
|
15747
16754
|
onFailure,
|
|
15748
16755
|
...props
|
|
15749
16756
|
} = _ref;
|
|
15750
|
-
const stripe =
|
|
16757
|
+
const stripe = useStripe();
|
|
15751
16758
|
const [isInitializing, setIsInitializing] = React.useState(true);
|
|
15752
16759
|
const [localPaymentRequest, setLocalPaymentRequest] = React.useState(null);
|
|
15753
16760
|
const {
|
|
@@ -15998,7 +17005,7 @@ const PelcroPaymentRequestButton = _ref => {
|
|
|
15998
17005
|
if (isInitializing || !canMakePayment || !localPaymentRequest) {
|
|
15999
17006
|
return null;
|
|
16000
17007
|
}
|
|
16001
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
17008
|
+
return /*#__PURE__*/React__default["default"].createElement(PaymentRequestButtonElement, Object.assign({
|
|
16002
17009
|
className: "StripeElement stripe-payment-request-btn",
|
|
16003
17010
|
options: {
|
|
16004
17011
|
paymentRequest: localPaymentRequest,
|
|
@@ -16139,7 +17146,7 @@ const CheckoutForm = _ref3 => {
|
|
|
16139
17146
|
placeholder: "Exp Year *"
|
|
16140
17147
|
}))));
|
|
16141
17148
|
}
|
|
16142
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
17149
|
+
return /*#__PURE__*/React__default["default"].createElement(PaymentElement, {
|
|
16143
17150
|
id: "payment-element",
|
|
16144
17151
|
options: paymentElementOptions
|
|
16145
17152
|
});
|