tf-checkout-react 1.0.43 → 1.0.44
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/components/billing-info-container/index.d.ts +20 -1
- package/dist/components/billing-info-container/utils.d.ts +1 -1
- package/dist/components/confirmationContainer/index.d.ts +4 -1
- package/dist/components/loginModal/index.d.ts +5 -0
- package/dist/components/paymentContainer/index.d.ts +5 -1
- package/dist/components/registerModal/index.d.ts +3 -0
- package/dist/components/ticketsContainer/index.d.ts +5 -1
- package/dist/tf-checkout-react.cjs.development.css +1 -1
- package/dist/tf-checkout-react.cjs.development.js +385 -137
- package/dist/tf-checkout-react.cjs.development.js.map +1 -1
- package/dist/tf-checkout-react.cjs.production.min.js +1 -1
- package/dist/tf-checkout-react.cjs.production.min.js.map +1 -1
- package/dist/tf-checkout-react.esm.js +390 -142
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/package.json +3 -1
- package/src/.DS_Store +0 -0
- package/src/api/index.ts +2 -2
- package/src/components/.DS_Store +0 -0
- package/src/components/billing-info-container/index.tsx +210 -49
- package/src/components/billing-info-container/style.css +15 -0
- package/src/components/billing-info-container/utils.ts +38 -11
- package/src/components/common/CustomField.tsx +15 -0
- package/src/components/confirmationContainer/index.tsx +8 -3
- package/src/components/loginModal/index.tsx +38 -6
- package/src/components/paymentContainer/index.tsx +10 -0
- package/src/components/registerModal/index.tsx +20 -3
- package/src/components/ticketsContainer/index.tsx +10 -2
|
@@ -7,7 +7,7 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'defau
|
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var React__default = _interopDefault(React);
|
|
9
9
|
var formik = require('formik');
|
|
10
|
-
var
|
|
10
|
+
var LoadingButton = _interopDefault(require('@mui/lab/LoadingButton'));
|
|
11
11
|
var _identity = _interopDefault(require('lodash/identity'));
|
|
12
12
|
var _map = _interopDefault(require('lodash/map'));
|
|
13
13
|
var _get = _interopDefault(require('lodash/get'));
|
|
@@ -19,6 +19,7 @@ var Box = _interopDefault(require('@mui/material/Box'));
|
|
|
19
19
|
var _forEach = _interopDefault(require('lodash/forEach'));
|
|
20
20
|
var _flatMapDeep = _interopDefault(require('lodash/flatMapDeep'));
|
|
21
21
|
var TextField = _interopDefault(require('@mui/material/TextField'));
|
|
22
|
+
var styles = require('@mui/styles');
|
|
22
23
|
var FormGroup = _interopDefault(require('@mui/material/FormGroup'));
|
|
23
24
|
var FormControlLabel = _interopDefault(require('@mui/material/FormControlLabel'));
|
|
24
25
|
var Checkbox = _interopDefault(require('@mui/material/Checkbox'));
|
|
@@ -38,7 +39,7 @@ var _isObject = _interopDefault(require('lodash/isObject'));
|
|
|
38
39
|
var FormControl = _interopDefault(require('@mui/material/FormControl'));
|
|
39
40
|
var MenuItem = _interopDefault(require('@mui/material/MenuItem'));
|
|
40
41
|
var Select = _interopDefault(require('@mui/material/Select'));
|
|
41
|
-
var Button
|
|
42
|
+
var Button = _interopDefault(require('react-bootstrap/Button'));
|
|
42
43
|
var jwt_decode = _interopDefault(require('jwt-decode'));
|
|
43
44
|
|
|
44
45
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -912,6 +913,10 @@ if (isWindowDefined && localStorage.getItem('auth_guest_token')) {
|
|
|
912
913
|
ttfHeaders['Authorization-Guest'] = /*#__PURE__*/localStorage.getItem('auth_guest_token');
|
|
913
914
|
}
|
|
914
915
|
|
|
916
|
+
if (isWindowDefined && window.location.origin !== 'https://www.houseofx.nyc' && window.location.origin !== 'https://tickets-staging.houseofx.nyc') {
|
|
917
|
+
ttfHeaders['X-Source-Origin'] = 'houseofx.com';
|
|
918
|
+
}
|
|
919
|
+
|
|
915
920
|
var publicRequest = /*#__PURE__*/axios.create({
|
|
916
921
|
baseURL: ENV.BASE_URL ,
|
|
917
922
|
headers: ttfHeaders
|
|
@@ -955,7 +960,9 @@ publicRequest.interceptors.request.use(function (config) {
|
|
|
955
960
|
}
|
|
956
961
|
|
|
957
962
|
if (isWindowDefined && window.location.origin !== 'https://www.houseofx.nyc' && window.location.origin !== 'https://tickets-staging.houseofx.nyc') {
|
|
958
|
-
var _updatedHeaders2 = _extends({}, config.headers
|
|
963
|
+
var _updatedHeaders2 = _extends({}, config.headers, {
|
|
964
|
+
'X-Source-Origin': 'houseofx.com'
|
|
965
|
+
});
|
|
959
966
|
|
|
960
967
|
config.headers = _updatedHeaders2;
|
|
961
968
|
}
|
|
@@ -1077,7 +1084,15 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1077
1084
|
onLogin = _ref.onLogin,
|
|
1078
1085
|
alreadyHasUser = _ref.alreadyHasUser,
|
|
1079
1086
|
userExpired = _ref.userExpired,
|
|
1080
|
-
setUserExpired = _ref.setUserExpired
|
|
1087
|
+
setUserExpired = _ref.setUserExpired,
|
|
1088
|
+
_ref$onAuthorizeSucce = _ref.onAuthorizeSuccess,
|
|
1089
|
+
onAuthorizeSuccess = _ref$onAuthorizeSucce === void 0 ? function () {} : _ref$onAuthorizeSucce,
|
|
1090
|
+
_ref$onAuthorizeError = _ref.onAuthorizeError,
|
|
1091
|
+
onAuthorizeError = _ref$onAuthorizeError === void 0 ? function () {} : _ref$onAuthorizeError,
|
|
1092
|
+
_ref$onGetProfileData = _ref.onGetProfileDataSuccess,
|
|
1093
|
+
onGetProfileDataSuccess = _ref$onGetProfileData === void 0 ? function () {} : _ref$onGetProfileData,
|
|
1094
|
+
_ref$onGetProfileData2 = _ref.onGetProfileDataError,
|
|
1095
|
+
onGetProfileDataError = _ref$onGetProfileData2 === void 0 ? function () {} : _ref$onGetProfileData2;
|
|
1081
1096
|
|
|
1082
1097
|
var _useState = React.useState(''),
|
|
1083
1098
|
error = _useState[0],
|
|
@@ -1097,7 +1112,7 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1097
1112
|
},
|
|
1098
1113
|
onSubmit: function () {
|
|
1099
1114
|
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref2) {
|
|
1100
|
-
var email, password, bodyFormData, resAutorize, bodyFormDataToken, resAccessToken, accessToken,
|
|
1115
|
+
var email, password, bodyFormData, resAutorize, bodyFormDataToken, resAccessToken, accessToken, profileResponse, profileSpecifiedData, profileDataObj, _e$response, _e$response$data, _error;
|
|
1101
1116
|
|
|
1102
1117
|
return runtime_1.wrap(function _callee$(_context) {
|
|
1103
1118
|
while (1) {
|
|
@@ -1119,19 +1134,45 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1119
1134
|
bodyFormDataToken.append('grant_type', 'authorization_code');
|
|
1120
1135
|
bodyFormDataToken.append('client_id', ENV.CLIENT_ID );
|
|
1121
1136
|
bodyFormDataToken.append('client_secret', ENV.CLIENT_SECRET );
|
|
1122
|
-
|
|
1137
|
+
resAccessToken = null;
|
|
1138
|
+
_context.prev = 15;
|
|
1139
|
+
_context.next = 18;
|
|
1123
1140
|
return getAccessToken(bodyFormDataToken);
|
|
1124
1141
|
|
|
1125
|
-
case
|
|
1142
|
+
case 18:
|
|
1126
1143
|
resAccessToken = _context.sent;
|
|
1144
|
+
onAuthorizeSuccess(resAccessToken.data);
|
|
1145
|
+
_context.next = 26;
|
|
1146
|
+
break;
|
|
1147
|
+
|
|
1148
|
+
case 22:
|
|
1149
|
+
_context.prev = 22;
|
|
1150
|
+
_context.t0 = _context["catch"](15);
|
|
1151
|
+
onAuthorizeError(_context.t0.response);
|
|
1152
|
+
return _context.abrupt("return");
|
|
1153
|
+
|
|
1154
|
+
case 26:
|
|
1127
1155
|
accessToken = _get(resAccessToken, 'data.access_token');
|
|
1128
1156
|
handleSetAccessToken(accessToken);
|
|
1129
|
-
|
|
1157
|
+
profileResponse = null;
|
|
1158
|
+
_context.prev = 29;
|
|
1159
|
+
_context.next = 32;
|
|
1130
1160
|
return getProfileData(accessToken);
|
|
1131
1161
|
|
|
1132
|
-
case
|
|
1133
|
-
|
|
1134
|
-
|
|
1162
|
+
case 32:
|
|
1163
|
+
profileResponse = _context.sent;
|
|
1164
|
+
onGetProfileDataSuccess(profileResponse.data);
|
|
1165
|
+
_context.next = 40;
|
|
1166
|
+
break;
|
|
1167
|
+
|
|
1168
|
+
case 36:
|
|
1169
|
+
_context.prev = 36;
|
|
1170
|
+
_context.t1 = _context["catch"](29);
|
|
1171
|
+
onGetProfileDataError(_context.t1.response);
|
|
1172
|
+
return _context.abrupt("return");
|
|
1173
|
+
|
|
1174
|
+
case 40:
|
|
1175
|
+
profileSpecifiedData = _get(profileResponse, 'data.data');
|
|
1135
1176
|
profileDataObj = {
|
|
1136
1177
|
id: profileSpecifiedData.id,
|
|
1137
1178
|
first_name: profileSpecifiedData.firstName,
|
|
@@ -1146,26 +1187,26 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1146
1187
|
|
|
1147
1188
|
setUserExpired(false);
|
|
1148
1189
|
onLogin();
|
|
1149
|
-
_context.next =
|
|
1190
|
+
_context.next = 50;
|
|
1150
1191
|
break;
|
|
1151
1192
|
|
|
1152
|
-
case
|
|
1153
|
-
_context.prev =
|
|
1154
|
-
_context.
|
|
1193
|
+
case 47:
|
|
1194
|
+
_context.prev = 47;
|
|
1195
|
+
_context.t2 = _context["catch"](1);
|
|
1155
1196
|
|
|
1156
|
-
if (axios.isAxiosError(_context.
|
|
1157
|
-
_error = (_context.
|
|
1197
|
+
if (axios.isAxiosError(_context.t2)) {
|
|
1198
|
+
_error = (_context.t2 == null ? void 0 : (_e$response = _context.t2.response) == null ? void 0 : (_e$response$data = _e$response.data) == null ? void 0 : _e$response$data.message) || 'Error';
|
|
1158
1199
|
setError(_error);
|
|
1159
|
-
} else if (_context.
|
|
1160
|
-
setError((_context.
|
|
1200
|
+
} else if (_context.t2 instanceof Error) {
|
|
1201
|
+
setError((_context.t2 == null ? void 0 : _context.t2.message) || 'Error');
|
|
1161
1202
|
}
|
|
1162
1203
|
|
|
1163
|
-
case
|
|
1204
|
+
case 50:
|
|
1164
1205
|
case "end":
|
|
1165
1206
|
return _context.stop();
|
|
1166
1207
|
}
|
|
1167
1208
|
}
|
|
1168
|
-
}, _callee, null, [[1, 29]]);
|
|
1209
|
+
}, _callee, null, [[1, 47], [15, 22], [29, 36]]);
|
|
1169
1210
|
}));
|
|
1170
1211
|
|
|
1171
1212
|
function onSubmit(_x) {
|
|
@@ -1226,7 +1267,11 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1226
1267
|
};
|
|
1227
1268
|
|
|
1228
1269
|
var RegisterModal = function RegisterModal(_ref) {
|
|
1229
|
-
var onClose = _ref.onClose
|
|
1270
|
+
var onClose = _ref.onClose,
|
|
1271
|
+
_ref$onGetProfileData = _ref.onGetProfileDataSuccess,
|
|
1272
|
+
onGetProfileDataSuccess = _ref$onGetProfileData === void 0 ? function () {} : _ref$onGetProfileData,
|
|
1273
|
+
_ref$onGetProfileData2 = _ref.onGetProfileDataError,
|
|
1274
|
+
onGetProfileDataError = _ref$onGetProfileData2 === void 0 ? function () {} : _ref$onGetProfileData2;
|
|
1230
1275
|
return React__default.createElement("div", {
|
|
1231
1276
|
style: {
|
|
1232
1277
|
display: 'flex',
|
|
@@ -1250,7 +1295,7 @@ var RegisterModal = function RegisterModal(_ref) {
|
|
|
1250
1295
|
},
|
|
1251
1296
|
onSubmit: function () {
|
|
1252
1297
|
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref2) {
|
|
1253
|
-
var firstName, lastName, email, password, confirmPassword, bodyFormData, resRegister, access_token,
|
|
1298
|
+
var firstName, lastName, email, password, confirmPassword, bodyFormData, resRegister, access_token, profileResponse, profileSpecifiedData, profileDataObj;
|
|
1254
1299
|
return runtime_1.wrap(function _callee$(_context) {
|
|
1255
1300
|
while (1) {
|
|
1256
1301
|
switch (_context.prev = _context.next) {
|
|
@@ -1271,12 +1316,25 @@ var RegisterModal = function RegisterModal(_ref) {
|
|
|
1271
1316
|
resRegister = _context.sent;
|
|
1272
1317
|
access_token = _get(resRegister, 'data.data.attributes.access_token');
|
|
1273
1318
|
handleSetAccessToken(access_token);
|
|
1274
|
-
|
|
1319
|
+
profileResponse = null;
|
|
1320
|
+
_context.prev = 15;
|
|
1321
|
+
_context.next = 18;
|
|
1275
1322
|
return getProfileData(access_token);
|
|
1276
1323
|
|
|
1277
|
-
case
|
|
1278
|
-
|
|
1279
|
-
|
|
1324
|
+
case 18:
|
|
1325
|
+
profileResponse = _context.sent;
|
|
1326
|
+
onGetProfileDataSuccess(profileResponse.data);
|
|
1327
|
+
_context.next = 26;
|
|
1328
|
+
break;
|
|
1329
|
+
|
|
1330
|
+
case 22:
|
|
1331
|
+
_context.prev = 22;
|
|
1332
|
+
_context.t0 = _context["catch"](15);
|
|
1333
|
+
onGetProfileDataError(_context.t0.response);
|
|
1334
|
+
return _context.abrupt("return");
|
|
1335
|
+
|
|
1336
|
+
case 26:
|
|
1337
|
+
profileSpecifiedData = _get(profileResponse, 'data.data');
|
|
1280
1338
|
profileDataObj = {
|
|
1281
1339
|
id: profileSpecifiedData.id,
|
|
1282
1340
|
first_name: profileSpecifiedData.firstName,
|
|
@@ -1291,12 +1349,12 @@ var RegisterModal = function RegisterModal(_ref) {
|
|
|
1291
1349
|
|
|
1292
1350
|
onClose();
|
|
1293
1351
|
|
|
1294
|
-
case
|
|
1352
|
+
case 30:
|
|
1295
1353
|
case "end":
|
|
1296
1354
|
return _context.stop();
|
|
1297
1355
|
}
|
|
1298
1356
|
}
|
|
1299
|
-
}, _callee);
|
|
1357
|
+
}, _callee, null, [[15, 22]]);
|
|
1300
1358
|
}));
|
|
1301
1359
|
|
|
1302
1360
|
function onSubmit(_x) {
|
|
@@ -1400,7 +1458,7 @@ var RegisterModal = function RegisterModal(_ref) {
|
|
|
1400
1458
|
}));
|
|
1401
1459
|
};
|
|
1402
1460
|
|
|
1403
|
-
var _excluded = ["
|
|
1461
|
+
var _excluded = ["firstName", "lastName", "holderAge", "confirmEmail", "confirmPassword"];
|
|
1404
1462
|
var getInitialValues = function getInitialValues(data, propsInitialValues) {
|
|
1405
1463
|
if (data === void 0) {
|
|
1406
1464
|
data = [];
|
|
@@ -1458,7 +1516,7 @@ var setLoggedUserData = function setLoggedUserData(data) {
|
|
|
1458
1516
|
zip: (data == null ? void 0 : data.zip) || (data == null ? void 0 : data.zipCode) || ''
|
|
1459
1517
|
};
|
|
1460
1518
|
};
|
|
1461
|
-
var createCheckoutDataBody = function createCheckoutDataBody(values, logedInValues, includeDob) {
|
|
1519
|
+
var createCheckoutDataBody = function createCheckoutDataBody(ticketsQuantity, values, logedInValues, includeDob) {
|
|
1462
1520
|
if (values === void 0) {
|
|
1463
1521
|
values = {};
|
|
1464
1522
|
}
|
|
@@ -1472,23 +1530,52 @@ var createCheckoutDataBody = function createCheckoutDataBody(values, logedInValu
|
|
|
1472
1530
|
}
|
|
1473
1531
|
|
|
1474
1532
|
var _values = values,
|
|
1475
|
-
holderAge = _values.holderAge,
|
|
1476
1533
|
firstName = _values.firstName,
|
|
1477
1534
|
lastName = _values.lastName,
|
|
1478
|
-
|
|
1479
|
-
holderLastName = _values.holderLastName,
|
|
1535
|
+
holderAge = _values.holderAge,
|
|
1480
1536
|
restValues = _objectWithoutPropertiesLoose(_values, _excluded);
|
|
1481
1537
|
|
|
1538
|
+
var holders = [];
|
|
1539
|
+
var ticket_holders = [];
|
|
1540
|
+
|
|
1541
|
+
var _loop = function _loop(i) {
|
|
1542
|
+
var individualHolder = Object.fromEntries(Object.entries(values).filter(function (_ref4) {
|
|
1543
|
+
var key = _ref4[0];
|
|
1544
|
+
return key.includes(String(i));
|
|
1545
|
+
}));
|
|
1546
|
+
holders.push(individualHolder);
|
|
1547
|
+
};
|
|
1548
|
+
|
|
1549
|
+
for (var i = 0; i <= ticketsQuantity; i++) {
|
|
1550
|
+
_loop(i);
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
var filteredHolders = holders.filter(function (holder) {
|
|
1554
|
+
return Object.entries(holder).length > 0;
|
|
1555
|
+
});
|
|
1556
|
+
ticket_holders = filteredHolders.map(function (item, index) {
|
|
1557
|
+
return {
|
|
1558
|
+
first_name: item["holderFirstName-" + index] || '',
|
|
1559
|
+
last_name: item["holderLastName-" + index] || '',
|
|
1560
|
+
phone: item["holderPhone-" + index] || '',
|
|
1561
|
+
email: item["holderEmail-" + index] || ''
|
|
1562
|
+
};
|
|
1563
|
+
});
|
|
1564
|
+
var filteredRestValue = {};
|
|
1565
|
+
|
|
1566
|
+
_forEach(restValues, function (value, key) {
|
|
1567
|
+
if (!key.includes('holder')) {
|
|
1568
|
+
filteredRestValue[key] = value;
|
|
1569
|
+
}
|
|
1570
|
+
});
|
|
1571
|
+
|
|
1482
1572
|
var body = {
|
|
1483
|
-
attributes: _extends({},
|
|
1573
|
+
attributes: _extends({}, filteredRestValue, {
|
|
1484
1574
|
email: restValues.email || logedInValues.emailLogged,
|
|
1485
1575
|
confirm_email: restValues.email || logedInValues.emailLogged,
|
|
1486
1576
|
first_name: firstName || logedInValues.firstNameLogged,
|
|
1487
1577
|
last_name: lastName || logedInValues.lastNameLogged,
|
|
1488
|
-
ticket_holders:
|
|
1489
|
-
first_name: holderFirstName,
|
|
1490
|
-
last_name: holderLastName
|
|
1491
|
-
}]
|
|
1578
|
+
ticket_holders: ticket_holders
|
|
1492
1579
|
})
|
|
1493
1580
|
};
|
|
1494
1581
|
|
|
@@ -1502,6 +1589,13 @@ var createCheckoutDataBody = function createCheckoutDataBody(values, logedInValu
|
|
|
1502
1589
|
return body;
|
|
1503
1590
|
};
|
|
1504
1591
|
|
|
1592
|
+
var useStyles = /*#__PURE__*/styles.makeStyles({
|
|
1593
|
+
input: {
|
|
1594
|
+
"&::placeholder": {
|
|
1595
|
+
color: "gray"
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
});
|
|
1505
1599
|
var CustomField = function CustomField(_ref) {
|
|
1506
1600
|
var label = _ref.label,
|
|
1507
1601
|
_ref$type = _ref.type,
|
|
@@ -1518,6 +1612,7 @@ var CustomField = function CustomField(_ref) {
|
|
|
1518
1612
|
|
|
1519
1613
|
var error = _get(errors, field.name);
|
|
1520
1614
|
|
|
1615
|
+
var classes = useStyles();
|
|
1521
1616
|
return React__default.createElement(TextField, Object.assign({
|
|
1522
1617
|
id: field.name,
|
|
1523
1618
|
label: label,
|
|
@@ -1529,6 +1624,11 @@ var CustomField = function CustomField(_ref) {
|
|
|
1529
1624
|
InputLabelProps: {
|
|
1530
1625
|
shrink: isShrink
|
|
1531
1626
|
},
|
|
1627
|
+
InputProps: {
|
|
1628
|
+
classes: {
|
|
1629
|
+
input: classes.input
|
|
1630
|
+
}
|
|
1631
|
+
},
|
|
1532
1632
|
SelectProps: {
|
|
1533
1633
|
"native": true
|
|
1534
1634
|
}
|
|
@@ -1571,7 +1671,9 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
1571
1671
|
setStates = _ref.setStates,
|
|
1572
1672
|
setFieldValue = _ref.setFieldValue,
|
|
1573
1673
|
setValues = _ref.setValues,
|
|
1574
|
-
setUserValues = _ref.setUserValues
|
|
1674
|
+
setUserValues = _ref.setUserValues,
|
|
1675
|
+
onGetStatesSuccess = _ref.onGetStatesSuccess,
|
|
1676
|
+
onGetStatesError = _ref.onGetStatesError;
|
|
1575
1677
|
React.useEffect(function () {
|
|
1576
1678
|
var fetchStates = /*#__PURE__*/function () {
|
|
1577
1679
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
@@ -1595,19 +1697,21 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
1595
1697
|
});
|
|
1596
1698
|
setStates(mappedStates);
|
|
1597
1699
|
setFieldValue('state', (_mappedStates$0$label = (_mappedStates$ = mappedStates[0]) == null ? void 0 : _mappedStates$.label) != null ? _mappedStates$0$label : '');
|
|
1598
|
-
|
|
1700
|
+
onGetStatesSuccess(res.data);
|
|
1701
|
+
_context.next = 13;
|
|
1599
1702
|
break;
|
|
1600
1703
|
|
|
1601
|
-
case
|
|
1602
|
-
_context.prev =
|
|
1704
|
+
case 10:
|
|
1705
|
+
_context.prev = 10;
|
|
1603
1706
|
_context.t0 = _context["catch"](0);
|
|
1707
|
+
onGetStatesError(_context.t0.response);
|
|
1604
1708
|
|
|
1605
|
-
case
|
|
1709
|
+
case 13:
|
|
1606
1710
|
case "end":
|
|
1607
1711
|
return _context.stop();
|
|
1608
1712
|
}
|
|
1609
1713
|
}
|
|
1610
|
-
}, _callee, null, [[0,
|
|
1714
|
+
}, _callee, null, [[0, 10]]);
|
|
1611
1715
|
}));
|
|
1612
1716
|
|
|
1613
1717
|
return function fetchStates() {
|
|
@@ -1631,9 +1735,6 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
1631
1735
|
email: (parsedData == null ? void 0 : parsedData.email) || '',
|
|
1632
1736
|
phone: (parsedData == null ? void 0 : parsedData.phone) || '',
|
|
1633
1737
|
confirmEmail: '',
|
|
1634
|
-
holderFirstName: '',
|
|
1635
|
-
holderLastName: '',
|
|
1636
|
-
holderAge: '',
|
|
1637
1738
|
state: (parsedData == null ? void 0 : parsedData.state) || '',
|
|
1638
1739
|
street_address: (parsedData == null ? void 0 : parsedData.street_address) || '',
|
|
1639
1740
|
country: (parsedData == null ? void 0 : parsedData.country) || 1,
|
|
@@ -1645,9 +1746,7 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
1645
1746
|
};
|
|
1646
1747
|
setValues(mappedValues);
|
|
1647
1748
|
setUserValues(mappedValues);
|
|
1648
|
-
} catch (e) {
|
|
1649
|
-
console.log(e);
|
|
1650
|
-
}
|
|
1749
|
+
} catch (e) {}
|
|
1651
1750
|
}
|
|
1652
1751
|
}
|
|
1653
1752
|
};
|
|
@@ -1665,6 +1764,11 @@ var SectionContainer = function SectionContainer(_ref3) {
|
|
|
1665
1764
|
var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
1666
1765
|
var _ref4$data = _ref4.data,
|
|
1667
1766
|
data = _ref4$data === void 0 ? [] : _ref4$data,
|
|
1767
|
+
_ref4$ticketHoldersFi = _ref4.ticketHoldersFields,
|
|
1768
|
+
ticketHoldersFields = _ref4$ticketHoldersFi === void 0 ? {
|
|
1769
|
+
id: 1,
|
|
1770
|
+
fields: []
|
|
1771
|
+
} : _ref4$ticketHoldersFi,
|
|
1668
1772
|
_ref4$initialValues = _ref4.initialValues,
|
|
1669
1773
|
initialValues = _ref4$initialValues === void 0 ? {} : _ref4$initialValues,
|
|
1670
1774
|
_ref4$buttonName = _ref4.buttonName,
|
|
@@ -1672,7 +1776,35 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1672
1776
|
_ref4$handleSubmit = _ref4.handleSubmit,
|
|
1673
1777
|
handleSubmit = _ref4$handleSubmit === void 0 ? _identity : _ref4$handleSubmit,
|
|
1674
1778
|
_ref4$theme = _ref4.theme,
|
|
1675
|
-
theme = _ref4$theme === void 0 ? 'light' : _ref4$theme
|
|
1779
|
+
theme = _ref4$theme === void 0 ? 'light' : _ref4$theme,
|
|
1780
|
+
_ref4$onRegisterSucce = _ref4.onRegisterSuccess,
|
|
1781
|
+
onRegisterSuccess = _ref4$onRegisterSucce === void 0 ? function () {} : _ref4$onRegisterSucce,
|
|
1782
|
+
_ref4$onRegisterError = _ref4.onRegisterError,
|
|
1783
|
+
onRegisterError = _ref4$onRegisterError === void 0 ? function () {} : _ref4$onRegisterError,
|
|
1784
|
+
_ref4$onSubmitError = _ref4.onSubmitError,
|
|
1785
|
+
onSubmitError = _ref4$onSubmitError === void 0 ? function () {} : _ref4$onSubmitError,
|
|
1786
|
+
_ref4$onGetCartSucces = _ref4.onGetCartSuccess,
|
|
1787
|
+
onGetCartSuccess = _ref4$onGetCartSucces === void 0 ? function () {} : _ref4$onGetCartSucces,
|
|
1788
|
+
_ref4$onGetCartError = _ref4.onGetCartError,
|
|
1789
|
+
onGetCartError = _ref4$onGetCartError === void 0 ? function () {} : _ref4$onGetCartError,
|
|
1790
|
+
_ref4$onGetCountriesS = _ref4.onGetCountriesSuccess,
|
|
1791
|
+
onGetCountriesSuccess = _ref4$onGetCountriesS === void 0 ? function () {} : _ref4$onGetCountriesS,
|
|
1792
|
+
_ref4$onGetCountriesE = _ref4.onGetCountriesError,
|
|
1793
|
+
onGetCountriesError = _ref4$onGetCountriesE === void 0 ? function () {} : _ref4$onGetCountriesE,
|
|
1794
|
+
_ref4$onGetStatesSucc = _ref4.onGetStatesSuccess,
|
|
1795
|
+
onGetStatesSuccess = _ref4$onGetStatesSucc === void 0 ? function () {} : _ref4$onGetStatesSucc,
|
|
1796
|
+
_ref4$onGetStatesErro = _ref4.onGetStatesError,
|
|
1797
|
+
onGetStatesError = _ref4$onGetStatesErro === void 0 ? function () {} : _ref4$onGetStatesErro,
|
|
1798
|
+
_ref4$onGetProfileDat = _ref4.onGetProfileDataSuccess,
|
|
1799
|
+
onGetProfileDataSuccess = _ref4$onGetProfileDat === void 0 ? function () {} : _ref4$onGetProfileDat,
|
|
1800
|
+
_ref4$onGetProfileDat2 = _ref4.onGetProfileDataError,
|
|
1801
|
+
onGetProfileDataError = _ref4$onGetProfileDat2 === void 0 ? function () {} : _ref4$onGetProfileDat2,
|
|
1802
|
+
_ref4$onAuthorizeSucc = _ref4.onAuthorizeSuccess,
|
|
1803
|
+
onAuthorizeSuccess = _ref4$onAuthorizeSucc === void 0 ? function () {} : _ref4$onAuthorizeSucc,
|
|
1804
|
+
_ref4$onAuthorizeErro = _ref4.onAuthorizeError,
|
|
1805
|
+
onAuthorizeError = _ref4$onAuthorizeErro === void 0 ? function () {} : _ref4$onAuthorizeErro,
|
|
1806
|
+
_ref4$onLogin = _ref4.onLogin,
|
|
1807
|
+
onLogin = _ref4$onLogin === void 0 ? function () {} : _ref4$onLogin;
|
|
1676
1808
|
var userData = typeof window !== 'undefined' && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
1677
1809
|
var access_token = typeof window !== 'undefined' && window.localStorage.getItem('access_token') ? window.localStorage.getItem('access_token') || '' : '';
|
|
1678
1810
|
|
|
@@ -1704,7 +1836,11 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1704
1836
|
showModalRegister = _useState7[0],
|
|
1705
1837
|
setShowModalRegister = _useState7[1];
|
|
1706
1838
|
|
|
1707
|
-
var _useState8 = React.useState(
|
|
1839
|
+
var _useState8 = React.useState(1),
|
|
1840
|
+
ticketsQuantity = _useState8[0],
|
|
1841
|
+
setTicketsQuantity = _useState8[1];
|
|
1842
|
+
|
|
1843
|
+
var _useState9 = React.useState({
|
|
1708
1844
|
firstName: '',
|
|
1709
1845
|
lastName: '',
|
|
1710
1846
|
email: '',
|
|
@@ -1719,8 +1855,8 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1719
1855
|
state: '',
|
|
1720
1856
|
zip: ''
|
|
1721
1857
|
}),
|
|
1722
|
-
userValues =
|
|
1723
|
-
setUserValues =
|
|
1858
|
+
userValues = _useState9[0],
|
|
1859
|
+
setUserValues = _useState9[1];
|
|
1724
1860
|
|
|
1725
1861
|
var isLoggedIn = !!access_token;
|
|
1726
1862
|
|
|
@@ -1733,12 +1869,25 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1733
1869
|
var showDOB = getQueryVariable('age_required') === 'true';
|
|
1734
1870
|
var showTicketHolderName = getQueryVariable('names_required') === 'true';
|
|
1735
1871
|
|
|
1736
|
-
var optedInFieldValue = _get(cartInfoData, 'optedIn', false);
|
|
1872
|
+
var optedInFieldValue = _get(cartInfoData, 'optedIn', false);
|
|
1873
|
+
|
|
1874
|
+
var getQuantity = function getQuantity(cart) {
|
|
1875
|
+
if (cart === void 0) {
|
|
1876
|
+
cart = [];
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
var qty = 0;
|
|
1880
|
+
cart.forEach(function (item) {
|
|
1881
|
+
qty += +item.quantity;
|
|
1882
|
+
});
|
|
1883
|
+
return qty;
|
|
1884
|
+
}; // fetch cart data
|
|
1737
1885
|
|
|
1738
1886
|
|
|
1739
1887
|
var fetchCart = /*#__PURE__*/function () {
|
|
1740
1888
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
|
|
1741
|
-
var res;
|
|
1889
|
+
var res, cartInfo, _cartInfo$cart, cart;
|
|
1890
|
+
|
|
1742
1891
|
return runtime_1.wrap(function _callee2$(_context2) {
|
|
1743
1892
|
while (1) {
|
|
1744
1893
|
switch (_context2.prev = _context2.next) {
|
|
@@ -1750,20 +1899,25 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1750
1899
|
case 3:
|
|
1751
1900
|
res = _context2.sent;
|
|
1752
1901
|
setCustomHeader(res);
|
|
1753
|
-
|
|
1754
|
-
|
|
1902
|
+
cartInfo = _get(res, 'data.data.attributes');
|
|
1903
|
+
setCartInfo(cartInfo);
|
|
1904
|
+
_cartInfo$cart = cartInfo.cart, cart = _cartInfo$cart === void 0 ? [] : _cartInfo$cart;
|
|
1905
|
+
setTicketsQuantity(getQuantity(cart));
|
|
1906
|
+
onGetCartSuccess(res.data);
|
|
1907
|
+
_context2.next = 15;
|
|
1755
1908
|
break;
|
|
1756
1909
|
|
|
1757
|
-
case
|
|
1758
|
-
_context2.prev =
|
|
1910
|
+
case 12:
|
|
1911
|
+
_context2.prev = 12;
|
|
1759
1912
|
_context2.t0 = _context2["catch"](0);
|
|
1913
|
+
onGetCartError(_context2.t0.response);
|
|
1760
1914
|
|
|
1761
|
-
case
|
|
1915
|
+
case 15:
|
|
1762
1916
|
case "end":
|
|
1763
1917
|
return _context2.stop();
|
|
1764
1918
|
}
|
|
1765
1919
|
}
|
|
1766
|
-
}, _callee2, null, [[0,
|
|
1920
|
+
}, _callee2, null, [[0, 12]]);
|
|
1767
1921
|
}));
|
|
1768
1922
|
|
|
1769
1923
|
return function fetchCart() {
|
|
@@ -1782,7 +1936,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1782
1936
|
_context3.prev = 0;
|
|
1783
1937
|
|
|
1784
1938
|
if (!(typeof window !== 'undefined' && token)) {
|
|
1785
|
-
_context3.next =
|
|
1939
|
+
_context3.next = 10;
|
|
1786
1940
|
break;
|
|
1787
1941
|
}
|
|
1788
1942
|
|
|
@@ -1795,21 +1949,23 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1795
1949
|
profileDataObj = setLoggedUserData(profileSpecifiedData);
|
|
1796
1950
|
setUserValues(profileDataObj);
|
|
1797
1951
|
window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
|
|
1952
|
+
onGetProfileDataSuccess(userDataResponse.data);
|
|
1798
1953
|
|
|
1799
|
-
case
|
|
1800
|
-
_context3.next =
|
|
1954
|
+
case 10:
|
|
1955
|
+
_context3.next = 15;
|
|
1801
1956
|
break;
|
|
1802
1957
|
|
|
1803
|
-
case
|
|
1804
|
-
_context3.prev =
|
|
1958
|
+
case 12:
|
|
1959
|
+
_context3.prev = 12;
|
|
1805
1960
|
_context3.t0 = _context3["catch"](0);
|
|
1961
|
+
onGetProfileDataError(_context3.t0.response);
|
|
1806
1962
|
|
|
1807
|
-
case
|
|
1963
|
+
case 15:
|
|
1808
1964
|
case "end":
|
|
1809
1965
|
return _context3.stop();
|
|
1810
1966
|
}
|
|
1811
1967
|
}
|
|
1812
|
-
}, _callee3, null, [[0,
|
|
1968
|
+
}, _callee3, null, [[0, 12]]);
|
|
1813
1969
|
}));
|
|
1814
1970
|
|
|
1815
1971
|
return function fetchUserData(_x) {
|
|
@@ -1828,10 +1984,11 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1828
1984
|
while (1) {
|
|
1829
1985
|
switch (_context4.prev = _context4.next) {
|
|
1830
1986
|
case 0:
|
|
1831
|
-
_context4.
|
|
1987
|
+
_context4.prev = 0;
|
|
1988
|
+
_context4.next = 3;
|
|
1832
1989
|
return getCountries();
|
|
1833
1990
|
|
|
1834
|
-
case
|
|
1991
|
+
case 3:
|
|
1835
1992
|
res = _context4.sent;
|
|
1836
1993
|
setCustomHeader(res);
|
|
1837
1994
|
setCountries(_map(_get(res, 'data.data'), function (item, key) {
|
|
@@ -1840,13 +1997,21 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1840
1997
|
value: Number(key)
|
|
1841
1998
|
};
|
|
1842
1999
|
}));
|
|
2000
|
+
onGetCountriesSuccess(res.data);
|
|
2001
|
+
_context4.next = 12;
|
|
2002
|
+
break;
|
|
1843
2003
|
|
|
1844
|
-
case
|
|
2004
|
+
case 9:
|
|
2005
|
+
_context4.prev = 9;
|
|
2006
|
+
_context4.t0 = _context4["catch"](0);
|
|
2007
|
+
onGetCountriesError(_context4.t0.response);
|
|
2008
|
+
|
|
2009
|
+
case 12:
|
|
1845
2010
|
case "end":
|
|
1846
2011
|
return _context4.stop();
|
|
1847
2012
|
}
|
|
1848
2013
|
}
|
|
1849
|
-
}, _callee4);
|
|
2014
|
+
}, _callee4, null, [[0, 9]]);
|
|
1850
2015
|
}));
|
|
1851
2016
|
|
|
1852
2017
|
return function fetchCountries() {
|
|
@@ -1869,7 +2034,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1869
2034
|
enableReinitialize: true,
|
|
1870
2035
|
onSubmit: function () {
|
|
1871
2036
|
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(values, formikHelpers) {
|
|
1872
|
-
var updatedUserData, _profileSpecifiedData, _profileDataObj, _checkoutBody, _res, bodyFormData,
|
|
2037
|
+
var updatedUserData, _profileSpecifiedData, _profileDataObj, _checkoutBody, _res, bodyFormData, access_token_register, resRegister, refreshToken, tokens, _e$response, _e$response$data, error, profileData, profileSpecifiedData, profileDataObj, checkoutBody, res, _e$response2;
|
|
1873
2038
|
|
|
1874
2039
|
return runtime_1.wrap(function _callee5$(_context5) {
|
|
1875
2040
|
while (1) {
|
|
@@ -1900,7 +2065,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1900
2065
|
}
|
|
1901
2066
|
|
|
1902
2067
|
case 9:
|
|
1903
|
-
_checkoutBody = createCheckoutDataBody(values, {
|
|
2068
|
+
_checkoutBody = createCheckoutDataBody(ticketsQuantity, values, {
|
|
1904
2069
|
emailLogged: emailLogged,
|
|
1905
2070
|
firstNameLogged: firstNameLogged,
|
|
1906
2071
|
lastNameLogged: lastNameLogged
|
|
@@ -1915,17 +2080,54 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1915
2080
|
|
|
1916
2081
|
case 15:
|
|
1917
2082
|
bodyFormData = createRegisterFormData(values);
|
|
1918
|
-
|
|
2083
|
+
access_token_register = null;
|
|
2084
|
+
_context5.prev = 17;
|
|
2085
|
+
_context5.next = 20;
|
|
1919
2086
|
return register(bodyFormData);
|
|
1920
2087
|
|
|
1921
|
-
case
|
|
2088
|
+
case 20:
|
|
1922
2089
|
resRegister = _context5.sent;
|
|
1923
2090
|
access_token_register = _get(resRegister, 'data.data.attributes.access_token');
|
|
2091
|
+
refreshToken = _get(resRegister, 'data.data.attributes.refresh_token');
|
|
1924
2092
|
handleSetAccessToken(access_token_register);
|
|
1925
|
-
|
|
2093
|
+
tokens = {
|
|
2094
|
+
accessToken: access_token_register,
|
|
2095
|
+
refreshToken: refreshToken
|
|
2096
|
+
};
|
|
2097
|
+
onRegisterSuccess(tokens);
|
|
2098
|
+
_context5.next = 33;
|
|
2099
|
+
break;
|
|
2100
|
+
|
|
2101
|
+
case 28:
|
|
2102
|
+
_context5.prev = 28;
|
|
2103
|
+
_context5.t0 = _context5["catch"](17);
|
|
2104
|
+
|
|
2105
|
+
if (axios.isAxiosError(_context5.t0)) {
|
|
2106
|
+
error = _context5.t0 == null ? void 0 : (_e$response = _context5.t0.response) == null ? void 0 : (_e$response$data = _e$response.data) == null ? void 0 : _e$response$data.message;
|
|
2107
|
+
|
|
2108
|
+
if (_includes(error, 'You must be aged')) {
|
|
2109
|
+
formikHelpers.setFieldError('holderAge', error);
|
|
2110
|
+
}
|
|
2111
|
+
|
|
2112
|
+
if (error != null && error.password) {
|
|
2113
|
+
formikHelpers.setFieldError('password', error.password);
|
|
2114
|
+
formikHelpers.setFieldError('confirmPassword', error.password);
|
|
2115
|
+
}
|
|
2116
|
+
|
|
2117
|
+
if (error != null && error.email) {
|
|
2118
|
+
setAlreadyHasUser(true);
|
|
2119
|
+
setShowModalLogin(true);
|
|
2120
|
+
}
|
|
2121
|
+
}
|
|
2122
|
+
|
|
2123
|
+
onRegisterError(_context5.t0.response);
|
|
2124
|
+
return _context5.abrupt("return");
|
|
2125
|
+
|
|
2126
|
+
case 33:
|
|
2127
|
+
_context5.next = 35;
|
|
1926
2128
|
return getProfileData(access_token_register);
|
|
1927
2129
|
|
|
1928
|
-
case
|
|
2130
|
+
case 35:
|
|
1929
2131
|
profileData = _context5.sent;
|
|
1930
2132
|
profileSpecifiedData = _get(profileData, 'data.data');
|
|
1931
2133
|
profileDataObj = setLoggedUserData(profileSpecifiedData);
|
|
@@ -1934,42 +2136,26 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1934
2136
|
window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
|
|
1935
2137
|
}
|
|
1936
2138
|
|
|
1937
|
-
checkoutBody = createCheckoutDataBody(values, {
|
|
2139
|
+
checkoutBody = createCheckoutDataBody(ticketsQuantity, values, {
|
|
1938
2140
|
emailLogged: emailLogged,
|
|
1939
2141
|
firstNameLogged: firstNameLogged,
|
|
1940
2142
|
lastNameLogged: lastNameLogged
|
|
1941
2143
|
}, showDOB);
|
|
1942
|
-
_context5.next =
|
|
2144
|
+
_context5.next = 42;
|
|
1943
2145
|
return postOnCheckout(checkoutBody, access_token_register);
|
|
1944
2146
|
|
|
1945
|
-
case
|
|
2147
|
+
case 42:
|
|
1946
2148
|
res = _context5.sent;
|
|
1947
2149
|
handleSubmit(values, formikHelpers, res);
|
|
1948
|
-
_context5.next =
|
|
2150
|
+
_context5.next = 50;
|
|
1949
2151
|
break;
|
|
1950
2152
|
|
|
1951
|
-
case
|
|
1952
|
-
_context5.prev =
|
|
1953
|
-
_context5.
|
|
2153
|
+
case 46:
|
|
2154
|
+
_context5.prev = 46;
|
|
2155
|
+
_context5.t1 = _context5["catch"](0);
|
|
1954
2156
|
|
|
1955
|
-
if (axios.isAxiosError(_context5.
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
if (_includes(error, 'You must be aged')) {
|
|
1959
|
-
formikHelpers.setFieldError('holderAge', error);
|
|
1960
|
-
}
|
|
1961
|
-
|
|
1962
|
-
if (error != null && error.password) {
|
|
1963
|
-
formikHelpers.setFieldError('password', error.password);
|
|
1964
|
-
formikHelpers.setFieldError('confirmPassword', error.password);
|
|
1965
|
-
}
|
|
1966
|
-
|
|
1967
|
-
if (error != null && error.email) {
|
|
1968
|
-
setAlreadyHasUser(true);
|
|
1969
|
-
setShowModalLogin(true);
|
|
1970
|
-
}
|
|
1971
|
-
|
|
1972
|
-
if (((_e$response2 = _context5.t0.response) == null ? void 0 : _e$response2.data.error) === 'invalid_token') {
|
|
2157
|
+
if (axios.isAxiosError(_context5.t1)) {
|
|
2158
|
+
if (((_e$response2 = _context5.t1.response) == null ? void 0 : _e$response2.data.error) === 'invalid_token') {
|
|
1973
2159
|
if (typeof window !== 'undefined') {
|
|
1974
2160
|
window.localStorage.removeItem('user_data');
|
|
1975
2161
|
window.localStorage.removeItem('access_token');
|
|
@@ -1979,12 +2165,14 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1979
2165
|
}
|
|
1980
2166
|
}
|
|
1981
2167
|
|
|
1982
|
-
|
|
2168
|
+
onSubmitError(_context5.t1.response);
|
|
2169
|
+
|
|
2170
|
+
case 50:
|
|
1983
2171
|
case "end":
|
|
1984
2172
|
return _context5.stop();
|
|
1985
2173
|
}
|
|
1986
2174
|
}
|
|
1987
|
-
}, _callee5, null, [[0,
|
|
2175
|
+
}, _callee5, null, [[0, 46], [17, 28]]);
|
|
1988
2176
|
}));
|
|
1989
2177
|
|
|
1990
2178
|
function onSubmit(_x2, _x3) {
|
|
@@ -2001,7 +2189,9 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
2001
2189
|
setStates: setStates,
|
|
2002
2190
|
setFieldValue: props.setFieldValue,
|
|
2003
2191
|
setValues: props.setValues,
|
|
2004
|
-
setUserValues: setUserValues
|
|
2192
|
+
setUserValues: setUserValues,
|
|
2193
|
+
onGetStatesSuccess: onGetStatesSuccess,
|
|
2194
|
+
onGetStatesError: onGetStatesError
|
|
2005
2195
|
}), React__default.createElement("div", {
|
|
2006
2196
|
className: "billing-info-container " + theme
|
|
2007
2197
|
}, !isLoggedIn && React__default.createElement("div", {
|
|
@@ -2012,6 +2202,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
2012
2202
|
className: "login-register-button",
|
|
2013
2203
|
type: "button",
|
|
2014
2204
|
onClick: function onClick() {
|
|
2205
|
+
onLogin();
|
|
2015
2206
|
setShowModalLogin(true);
|
|
2016
2207
|
}
|
|
2017
2208
|
}, "Login"))), _map(data, function (item) {
|
|
@@ -2067,16 +2258,45 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
2067
2258
|
}));
|
|
2068
2259
|
})));
|
|
2069
2260
|
}));
|
|
2070
|
-
}), React__default.createElement(
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
}
|
|
2076
|
-
|
|
2261
|
+
}), showTicketHolderName && React__default.createElement(SectionContainer, {
|
|
2262
|
+
key: ticketHoldersFields.id
|
|
2263
|
+
}, React__default.createElement("p", null, ticketHoldersFields.label), _map(new Array(ticketsQuantity), function (_item, index) {
|
|
2264
|
+
return React__default.createElement("div", {
|
|
2265
|
+
key: index
|
|
2266
|
+
}, React__default.createElement("h5", null, "Ticket ", index + 1), _map(ticketHoldersFields.fields, function (group, i) {
|
|
2267
|
+
var groupClassname = group.groupClassname,
|
|
2268
|
+
groupItems = group.groupItems;
|
|
2269
|
+
return React__default.createElement("div", {
|
|
2270
|
+
key: i
|
|
2271
|
+
}, React__default.createElement("div", {
|
|
2272
|
+
className: groupClassname
|
|
2273
|
+
}, _map(groupItems, function (element) {
|
|
2274
|
+
return React__default.createElement("div", {
|
|
2275
|
+
className: element.className,
|
|
2276
|
+
key: element.name + "-" + index
|
|
2277
|
+
}, React__default.createElement(formik.Field, {
|
|
2278
|
+
name: element.name + "-" + index,
|
|
2279
|
+
key: element.name + "-" + index,
|
|
2280
|
+
label: element.label,
|
|
2281
|
+
type: element.type,
|
|
2282
|
+
required: true,
|
|
2283
|
+
component: element.type === 'checkbox' ? CheckboxField : CustomField,
|
|
2284
|
+
validate: combineValidators(element.required ? requiredValidator : function () {}, element.onValidate ? element.onValidate : function () {})
|
|
2285
|
+
}));
|
|
2286
|
+
})));
|
|
2287
|
+
}));
|
|
2288
|
+
})), React__default.createElement("div", {
|
|
2289
|
+
className: "button-container"
|
|
2290
|
+
}, React__default.createElement(LoadingButton, {
|
|
2077
2291
|
type: "submit",
|
|
2078
2292
|
variant: "contained",
|
|
2079
|
-
className: "login-register-button"
|
|
2293
|
+
className: "login-register-button",
|
|
2294
|
+
loadingIndicator: React__default.createElement(material.CircularProgress, {
|
|
2295
|
+
color: "inherit",
|
|
2296
|
+
size: 26
|
|
2297
|
+
}),
|
|
2298
|
+
loading: props.isSubmitting,
|
|
2299
|
+
disabled: props.isSubmitting
|
|
2080
2300
|
}, buttonName))));
|
|
2081
2301
|
}), showModalLogin && React__default.createElement(LoginModal, {
|
|
2082
2302
|
onClose: function onClose() {
|
|
@@ -2087,14 +2307,20 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
2087
2307
|
},
|
|
2088
2308
|
alreadyHasUser: alreadyHasUser,
|
|
2089
2309
|
userExpired: userExpired,
|
|
2090
|
-
setUserExpired: setUserExpired
|
|
2310
|
+
setUserExpired: setUserExpired,
|
|
2311
|
+
onAuthorizeSuccess: onAuthorizeSuccess,
|
|
2312
|
+
onAuthorizeError: onAuthorizeError,
|
|
2313
|
+
onGetProfileDataSuccess: onGetProfileDataSuccess,
|
|
2314
|
+
onGetProfileDataError: onGetProfileDataError
|
|
2091
2315
|
}), showModalRegister && React__default.createElement(RegisterModal, {
|
|
2092
2316
|
onClose: function onClose() {
|
|
2093
2317
|
setShowModalRegister(false);
|
|
2094
2318
|
},
|
|
2095
2319
|
onRegister: function onRegister() {
|
|
2096
2320
|
setShowModalRegister(false);
|
|
2097
|
-
}
|
|
2321
|
+
},
|
|
2322
|
+
onGetProfileDataSuccess: onGetProfileDataSuccess,
|
|
2323
|
+
onGetProfileDataError: onGetProfileDataError
|
|
2098
2324
|
}));
|
|
2099
2325
|
};
|
|
2100
2326
|
|
|
@@ -2401,7 +2627,13 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
2401
2627
|
errorText = _ref.errorText,
|
|
2402
2628
|
checkoutData = _ref.checkoutData,
|
|
2403
2629
|
_ref$onErrorClose = _ref.onErrorClose,
|
|
2404
|
-
onErrorClose = _ref$onErrorClose === void 0 ? _identity : _ref$onErrorClose
|
|
2630
|
+
onErrorClose = _ref$onErrorClose === void 0 ? _identity : _ref$onErrorClose,
|
|
2631
|
+
_ref$onGetPaymentData = _ref.onGetPaymentDataSuccess,
|
|
2632
|
+
onGetPaymentDataSuccess = _ref$onGetPaymentData === void 0 ? function () {} : _ref$onGetPaymentData,
|
|
2633
|
+
_ref$onGetPaymentData2 = _ref.onGetPaymentDataError,
|
|
2634
|
+
onGetPaymentDataError = _ref$onGetPaymentData2 === void 0 ? function () {} : _ref$onGetPaymentData2,
|
|
2635
|
+
_ref$onPaymentError = _ref.onPaymentError,
|
|
2636
|
+
onPaymentError = _ref$onPaymentError === void 0 ? function () {} : _ref$onPaymentError;
|
|
2405
2637
|
|
|
2406
2638
|
var _useState = React.useState(initialReviewValues),
|
|
2407
2639
|
reviewData = _useState[0],
|
|
@@ -2452,17 +2684,19 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
2452
2684
|
currency: order_details == null ? void 0 : order_details.currency
|
|
2453
2685
|
};
|
|
2454
2686
|
setOrderData(_orderData);
|
|
2687
|
+
onGetPaymentDataSuccess(response.data);
|
|
2455
2688
|
}
|
|
2456
2689
|
|
|
2457
|
-
_context.next =
|
|
2690
|
+
_context.next = 11;
|
|
2458
2691
|
break;
|
|
2459
2692
|
|
|
2460
2693
|
case 7:
|
|
2461
2694
|
_context.prev = 7;
|
|
2462
2695
|
_context.t0 = _context["catch"](0);
|
|
2463
2696
|
setError(_get(_context.t0, 'response.data.message'));
|
|
2697
|
+
onGetPaymentDataError(_context.t0.response);
|
|
2464
2698
|
|
|
2465
|
-
case
|
|
2699
|
+
case 11:
|
|
2466
2700
|
case "end":
|
|
2467
2701
|
return _context.stop();
|
|
2468
2702
|
}
|
|
@@ -2503,15 +2737,16 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
2503
2737
|
setPaymentIsLoading(false);
|
|
2504
2738
|
}
|
|
2505
2739
|
|
|
2506
|
-
_context2.next =
|
|
2740
|
+
_context2.next = 15;
|
|
2507
2741
|
break;
|
|
2508
2742
|
|
|
2509
2743
|
case 11:
|
|
2510
2744
|
_context2.prev = 11;
|
|
2511
2745
|
_context2.t0 = _context2["catch"](0);
|
|
2512
2746
|
setError(_get(_context2.t0, 'response.data.message'));
|
|
2747
|
+
onPaymentError(_context2.t0.response);
|
|
2513
2748
|
|
|
2514
|
-
case
|
|
2749
|
+
case 15:
|
|
2515
2750
|
case "end":
|
|
2516
2751
|
return _context2.stop();
|
|
2517
2752
|
}
|
|
@@ -2580,7 +2815,11 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
2580
2815
|
_ref$shareButtons = _ref.shareButtons,
|
|
2581
2816
|
shareButtons = _ref$shareButtons === void 0 ? [] : _ref$shareButtons,
|
|
2582
2817
|
_ref$shareLink = _ref.shareLink,
|
|
2583
|
-
shareLink = _ref$shareLink === void 0 ? '' : _ref$shareLink
|
|
2818
|
+
shareLink = _ref$shareLink === void 0 ? '' : _ref$shareLink,
|
|
2819
|
+
_ref$onGetConfirmatio = _ref.onGetConfirmationDataSuccess,
|
|
2820
|
+
onGetConfirmationDataSuccess = _ref$onGetConfirmatio === void 0 ? function () {} : _ref$onGetConfirmatio,
|
|
2821
|
+
_ref$onGetConfirmatio2 = _ref.onGetConfirmationDataError,
|
|
2822
|
+
onGetConfirmationDataError = _ref$onGetConfirmatio2 === void 0 ? function () {} : _ref$onGetConfirmatio2;
|
|
2584
2823
|
var inputRef = React.useRef(null);
|
|
2585
2824
|
|
|
2586
2825
|
var _useState = React.useState({}),
|
|
@@ -2601,7 +2840,7 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
2601
2840
|
dataEncoded = typeof window !== 'undefined' && window.localStorage.getItem('checkoutData');
|
|
2602
2841
|
|
|
2603
2842
|
if (!dataEncoded) {
|
|
2604
|
-
_context.next =
|
|
2843
|
+
_context.next = 16;
|
|
2605
2844
|
break;
|
|
2606
2845
|
}
|
|
2607
2846
|
|
|
@@ -2615,21 +2854,23 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
2615
2854
|
response = _context.sent;
|
|
2616
2855
|
_data = _get(response, 'data.data.attributes');
|
|
2617
2856
|
setData(_data);
|
|
2618
|
-
|
|
2857
|
+
onGetConfirmationDataSuccess(response.data);
|
|
2858
|
+
_context.next = 16;
|
|
2619
2859
|
break;
|
|
2620
2860
|
|
|
2621
|
-
case
|
|
2622
|
-
_context.prev =
|
|
2861
|
+
case 13:
|
|
2862
|
+
_context.prev = 13;
|
|
2623
2863
|
_context.t0 = _context["catch"](4);
|
|
2864
|
+
onGetConfirmationDataError(_context.t0.response);
|
|
2624
2865
|
|
|
2625
|
-
case
|
|
2866
|
+
case 16:
|
|
2626
2867
|
case "end":
|
|
2627
2868
|
return _context.stop();
|
|
2628
2869
|
}
|
|
2629
2870
|
}
|
|
2630
|
-
}, _callee, null, [[4,
|
|
2871
|
+
}, _callee, null, [[4, 13]]);
|
|
2631
2872
|
}))();
|
|
2632
|
-
}, []);
|
|
2873
|
+
}, [onGetConfirmationDataSuccess, onGetConfirmationDataError]);
|
|
2633
2874
|
return React__default.createElement("div", {
|
|
2634
2875
|
className: "confirmation-page"
|
|
2635
2876
|
}, React__default.createElement("p", {
|
|
@@ -2848,7 +3089,13 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
2848
3089
|
eventId = _ref.eventId,
|
|
2849
3090
|
onAddToCartSuccess = _ref.onAddToCartSuccess,
|
|
2850
3091
|
_ref$contentStyle = _ref.contentStyle,
|
|
2851
|
-
contentStyle = _ref$contentStyle === void 0 ? {} : _ref$contentStyle
|
|
3092
|
+
contentStyle = _ref$contentStyle === void 0 ? {} : _ref$contentStyle,
|
|
3093
|
+
_ref$onAddToCartError = _ref.onAddToCartError,
|
|
3094
|
+
onAddToCartError = _ref$onAddToCartError === void 0 ? function () {} : _ref$onAddToCartError,
|
|
3095
|
+
_ref$onGetTicketsSucc = _ref.onGetTicketsSuccess,
|
|
3096
|
+
onGetTicketsSuccess = _ref$onGetTicketsSucc === void 0 ? function () {} : _ref$onGetTicketsSucc,
|
|
3097
|
+
_ref$onGetTicketsErro = _ref.onGetTicketsError,
|
|
3098
|
+
onGetTicketsError = _ref$onGetTicketsErro === void 0 ? function () {} : _ref$onGetTicketsErro;
|
|
2852
3099
|
|
|
2853
3100
|
var _useState = React.useState({}),
|
|
2854
3101
|
selectedTickets = _useState[0],
|
|
@@ -2925,6 +3172,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
2925
3172
|
return _isObject(item);
|
|
2926
3173
|
});
|
|
2927
3174
|
setTickets(_tickets);
|
|
3175
|
+
onGetTicketsSuccess(response.data);
|
|
2928
3176
|
}
|
|
2929
3177
|
|
|
2930
3178
|
_context.next = 11;
|
|
@@ -2933,7 +3181,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
2933
3181
|
case 8:
|
|
2934
3182
|
_context.prev = 8;
|
|
2935
3183
|
_context.t0 = _context["catch"](0);
|
|
2936
|
-
|
|
3184
|
+
onGetTicketsError(_context.t0.response);
|
|
2937
3185
|
|
|
2938
3186
|
case 11:
|
|
2939
3187
|
_context.prev = 11;
|
|
@@ -3016,7 +3264,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
3016
3264
|
case 13:
|
|
3017
3265
|
_context2.prev = 13;
|
|
3018
3266
|
_context2.t0 = _context2["catch"](6);
|
|
3019
|
-
|
|
3267
|
+
onAddToCartError(_context2.t0.response);
|
|
3020
3268
|
|
|
3021
3269
|
case 16:
|
|
3022
3270
|
_context2.prev = 16;
|
|
@@ -3056,13 +3304,13 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
3056
3304
|
setPromoCodeUpdated(promoCode);
|
|
3057
3305
|
}
|
|
3058
3306
|
}
|
|
3059
|
-
}), React__default.createElement(Button
|
|
3307
|
+
}), React__default.createElement(Button, {
|
|
3060
3308
|
className: "promo-apply-button",
|
|
3061
3309
|
placeholder: "Promo Code",
|
|
3062
3310
|
onClick: function onClick() {
|
|
3063
3311
|
setPromoCodeUpdated(promoCode);
|
|
3064
3312
|
}
|
|
3065
|
-
}, "Apply")), !showPromoInput && !isAllTicketsSoldOut ? React__default.createElement(Button
|
|
3313
|
+
}, "Apply")), !showPromoInput && !isAllTicketsSoldOut ? React__default.createElement(Button, {
|
|
3066
3314
|
className: "promo-code-button",
|
|
3067
3315
|
placeholder: "Promo Codes",
|
|
3068
3316
|
onClick: function onClick() {
|
|
@@ -3073,7 +3321,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
3073
3321
|
style: {
|
|
3074
3322
|
display: 'none'
|
|
3075
3323
|
}
|
|
3076
|
-
}), !isAllTicketsSoldOut && React__default.createElement(Button
|
|
3324
|
+
}), !isAllTicketsSoldOut && React__default.createElement(Button, {
|
|
3077
3325
|
"aria-hidden": true,
|
|
3078
3326
|
className: "book-button " + (handleBookIsLoading || _isEmpty(selectedTickets) || Object.values(selectedTickets)[0] === 0 ? 'disabled' : ''),
|
|
3079
3327
|
onClick: !handleBookIsLoading && !_isEmpty(selectedTickets) && Object.values(selectedTickets)[0] > 0 ? handleBook : function () {}
|