tf-checkout-react 1.0.41 → 1.0.45
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 +22 -3
- 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 +8 -4
- 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/index.d.ts +1 -0
- package/dist/tf-checkout-react.cjs.development.css +1 -1
- package/dist/tf-checkout-react.cjs.development.js +412 -144
- 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 +417 -150
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/types/billing-info-data.d.ts +2 -1
- package/package.json +3 -1
- package/src/api/index.ts +2 -2
- package/src/components/billing-info-container/index.tsx +224 -55
- 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 +46 -13
- package/src/components/paymentContainer/index.tsx +10 -0
- package/src/components/registerModal/index.tsx +20 -3
- package/src/components/ticketsContainer/index.tsx +14 -2
- package/src/index.ts +2 -1
- package/src/types/billing-info-data.ts +2 -1
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
|
@@ -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) {
|
|
@@ -913,7 +914,7 @@ if (isWindowDefined && localStorage.getItem('auth_guest_token')) {
|
|
|
913
914
|
}
|
|
914
915
|
|
|
915
916
|
if (isWindowDefined && window.location.origin !== 'https://www.houseofx.nyc' && window.location.origin !== 'https://tickets-staging.houseofx.nyc') {
|
|
916
|
-
ttfHeaders['X-Source-Origin'] = 'houseofx.
|
|
917
|
+
ttfHeaders['X-Source-Origin'] = 'houseofx.nyc';
|
|
917
918
|
}
|
|
918
919
|
|
|
919
920
|
var publicRequest = /*#__PURE__*/axios.create({
|
|
@@ -960,7 +961,7 @@ publicRequest.interceptors.request.use(function (config) {
|
|
|
960
961
|
|
|
961
962
|
if (isWindowDefined && window.location.origin !== 'https://www.houseofx.nyc' && window.location.origin !== 'https://tickets-staging.houseofx.nyc') {
|
|
962
963
|
var _updatedHeaders2 = _extends({}, config.headers, {
|
|
963
|
-
'X-Source-Origin': 'houseofx.
|
|
964
|
+
'X-Source-Origin': 'houseofx.nyc'
|
|
964
965
|
});
|
|
965
966
|
|
|
966
967
|
config.headers = _updatedHeaders2;
|
|
@@ -1081,9 +1082,18 @@ var style = {
|
|
|
1081
1082
|
var LoginModal = function LoginModal(_ref) {
|
|
1082
1083
|
var onClose = _ref.onClose,
|
|
1083
1084
|
onLogin = _ref.onLogin,
|
|
1084
|
-
alreadyHasUser = _ref.alreadyHasUser,
|
|
1085
|
-
|
|
1086
|
-
|
|
1085
|
+
_ref$alreadyHasUser = _ref.alreadyHasUser,
|
|
1086
|
+
alreadyHasUser = _ref$alreadyHasUser === void 0 ? false : _ref$alreadyHasUser,
|
|
1087
|
+
_ref$userExpired = _ref.userExpired,
|
|
1088
|
+
userExpired = _ref$userExpired === void 0 ? false : _ref$userExpired,
|
|
1089
|
+
_ref$onAuthorizeSucce = _ref.onAuthorizeSuccess,
|
|
1090
|
+
onAuthorizeSuccess = _ref$onAuthorizeSucce === void 0 ? function () {} : _ref$onAuthorizeSucce,
|
|
1091
|
+
_ref$onAuthorizeError = _ref.onAuthorizeError,
|
|
1092
|
+
onAuthorizeError = _ref$onAuthorizeError === void 0 ? function () {} : _ref$onAuthorizeError,
|
|
1093
|
+
_ref$onGetProfileData = _ref.onGetProfileDataSuccess,
|
|
1094
|
+
onGetProfileDataSuccess = _ref$onGetProfileData === void 0 ? function () {} : _ref$onGetProfileData,
|
|
1095
|
+
_ref$onGetProfileData2 = _ref.onGetProfileDataError,
|
|
1096
|
+
onGetProfileDataError = _ref$onGetProfileData2 === void 0 ? function () {} : _ref$onGetProfileData2;
|
|
1087
1097
|
|
|
1088
1098
|
var _useState = React.useState(''),
|
|
1089
1099
|
error = _useState[0],
|
|
@@ -1103,7 +1113,7 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1103
1113
|
},
|
|
1104
1114
|
onSubmit: function () {
|
|
1105
1115
|
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref2) {
|
|
1106
|
-
var email, password, bodyFormData, resAutorize, bodyFormDataToken, resAccessToken, accessToken,
|
|
1116
|
+
var email, password, bodyFormData, resAutorize, bodyFormDataToken, resAccessToken, accessToken, profileResponse, profileSpecifiedData, profileDataObj, _e$response, _e$response$data, _error;
|
|
1107
1117
|
|
|
1108
1118
|
return runtime_1.wrap(function _callee$(_context) {
|
|
1109
1119
|
while (1) {
|
|
@@ -1125,19 +1135,53 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1125
1135
|
bodyFormDataToken.append('grant_type', 'authorization_code');
|
|
1126
1136
|
bodyFormDataToken.append('client_id', ENV.CLIENT_ID );
|
|
1127
1137
|
bodyFormDataToken.append('client_secret', ENV.CLIENT_SECRET );
|
|
1128
|
-
|
|
1138
|
+
resAccessToken = null;
|
|
1139
|
+
_context.prev = 15;
|
|
1140
|
+
_context.next = 18;
|
|
1129
1141
|
return getAccessToken(bodyFormDataToken);
|
|
1130
1142
|
|
|
1131
|
-
case
|
|
1143
|
+
case 18:
|
|
1132
1144
|
resAccessToken = _context.sent;
|
|
1145
|
+
onAuthorizeSuccess(resAccessToken.data);
|
|
1146
|
+
_context.next = 26;
|
|
1147
|
+
break;
|
|
1148
|
+
|
|
1149
|
+
case 22:
|
|
1150
|
+
_context.prev = 22;
|
|
1151
|
+
_context.t0 = _context["catch"](15);
|
|
1152
|
+
|
|
1153
|
+
if (axios.isAxiosError(_context.t0)) {
|
|
1154
|
+
onAuthorizeError(_context.t0);
|
|
1155
|
+
}
|
|
1156
|
+
|
|
1157
|
+
return _context.abrupt("return");
|
|
1158
|
+
|
|
1159
|
+
case 26:
|
|
1133
1160
|
accessToken = _get(resAccessToken, 'data.access_token');
|
|
1134
1161
|
handleSetAccessToken(accessToken);
|
|
1135
|
-
|
|
1162
|
+
profileResponse = null;
|
|
1163
|
+
_context.prev = 29;
|
|
1164
|
+
_context.next = 32;
|
|
1136
1165
|
return getProfileData(accessToken);
|
|
1137
1166
|
|
|
1138
|
-
case
|
|
1139
|
-
|
|
1140
|
-
|
|
1167
|
+
case 32:
|
|
1168
|
+
profileResponse = _context.sent;
|
|
1169
|
+
onGetProfileDataSuccess(profileResponse.data);
|
|
1170
|
+
_context.next = 40;
|
|
1171
|
+
break;
|
|
1172
|
+
|
|
1173
|
+
case 36:
|
|
1174
|
+
_context.prev = 36;
|
|
1175
|
+
_context.t1 = _context["catch"](29);
|
|
1176
|
+
|
|
1177
|
+
if (axios.isAxiosError(_context.t1)) {
|
|
1178
|
+
onGetProfileDataError(_context.t1);
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
return _context.abrupt("return");
|
|
1182
|
+
|
|
1183
|
+
case 40:
|
|
1184
|
+
profileSpecifiedData = _get(profileResponse, 'data.data');
|
|
1141
1185
|
profileDataObj = {
|
|
1142
1186
|
id: profileSpecifiedData.id,
|
|
1143
1187
|
first_name: profileSpecifiedData.firstName,
|
|
@@ -1150,28 +1194,27 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1150
1194
|
window.localStorage.setItem('access_token', accessToken);
|
|
1151
1195
|
}
|
|
1152
1196
|
|
|
1153
|
-
setUserExpired(false);
|
|
1154
1197
|
onLogin();
|
|
1155
|
-
_context.next =
|
|
1198
|
+
_context.next = 49;
|
|
1156
1199
|
break;
|
|
1157
1200
|
|
|
1158
|
-
case
|
|
1159
|
-
_context.prev =
|
|
1160
|
-
_context.
|
|
1201
|
+
case 46:
|
|
1202
|
+
_context.prev = 46;
|
|
1203
|
+
_context.t2 = _context["catch"](1);
|
|
1161
1204
|
|
|
1162
|
-
if (axios.isAxiosError(_context.
|
|
1163
|
-
_error = (_context.
|
|
1205
|
+
if (axios.isAxiosError(_context.t2)) {
|
|
1206
|
+
_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';
|
|
1164
1207
|
setError(_error);
|
|
1165
|
-
} else if (_context.
|
|
1166
|
-
setError((_context.
|
|
1208
|
+
} else if (_context.t2 instanceof Error) {
|
|
1209
|
+
setError((_context.t2 == null ? void 0 : _context.t2.message) || 'Error');
|
|
1167
1210
|
}
|
|
1168
1211
|
|
|
1169
|
-
case
|
|
1212
|
+
case 49:
|
|
1170
1213
|
case "end":
|
|
1171
1214
|
return _context.stop();
|
|
1172
1215
|
}
|
|
1173
1216
|
}
|
|
1174
|
-
}, _callee, null, [[1, 29]]);
|
|
1217
|
+
}, _callee, null, [[1, 46], [15, 22], [29, 36]]);
|
|
1175
1218
|
}));
|
|
1176
1219
|
|
|
1177
1220
|
function onSubmit(_x) {
|
|
@@ -1232,7 +1275,11 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1232
1275
|
};
|
|
1233
1276
|
|
|
1234
1277
|
var RegisterModal = function RegisterModal(_ref) {
|
|
1235
|
-
var onClose = _ref.onClose
|
|
1278
|
+
var onClose = _ref.onClose,
|
|
1279
|
+
_ref$onGetProfileData = _ref.onGetProfileDataSuccess,
|
|
1280
|
+
onGetProfileDataSuccess = _ref$onGetProfileData === void 0 ? function () {} : _ref$onGetProfileData,
|
|
1281
|
+
_ref$onGetProfileData2 = _ref.onGetProfileDataError,
|
|
1282
|
+
onGetProfileDataError = _ref$onGetProfileData2 === void 0 ? function () {} : _ref$onGetProfileData2;
|
|
1236
1283
|
return React__default.createElement("div", {
|
|
1237
1284
|
style: {
|
|
1238
1285
|
display: 'flex',
|
|
@@ -1256,7 +1303,7 @@ var RegisterModal = function RegisterModal(_ref) {
|
|
|
1256
1303
|
},
|
|
1257
1304
|
onSubmit: function () {
|
|
1258
1305
|
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref2) {
|
|
1259
|
-
var firstName, lastName, email, password, confirmPassword, bodyFormData, resRegister, access_token,
|
|
1306
|
+
var firstName, lastName, email, password, confirmPassword, bodyFormData, resRegister, access_token, profileResponse, profileSpecifiedData, profileDataObj;
|
|
1260
1307
|
return runtime_1.wrap(function _callee$(_context) {
|
|
1261
1308
|
while (1) {
|
|
1262
1309
|
switch (_context.prev = _context.next) {
|
|
@@ -1277,12 +1324,25 @@ var RegisterModal = function RegisterModal(_ref) {
|
|
|
1277
1324
|
resRegister = _context.sent;
|
|
1278
1325
|
access_token = _get(resRegister, 'data.data.attributes.access_token');
|
|
1279
1326
|
handleSetAccessToken(access_token);
|
|
1280
|
-
|
|
1327
|
+
profileResponse = null;
|
|
1328
|
+
_context.prev = 15;
|
|
1329
|
+
_context.next = 18;
|
|
1281
1330
|
return getProfileData(access_token);
|
|
1282
1331
|
|
|
1283
|
-
case
|
|
1284
|
-
|
|
1285
|
-
|
|
1332
|
+
case 18:
|
|
1333
|
+
profileResponse = _context.sent;
|
|
1334
|
+
onGetProfileDataSuccess(profileResponse.data);
|
|
1335
|
+
_context.next = 26;
|
|
1336
|
+
break;
|
|
1337
|
+
|
|
1338
|
+
case 22:
|
|
1339
|
+
_context.prev = 22;
|
|
1340
|
+
_context.t0 = _context["catch"](15);
|
|
1341
|
+
onGetProfileDataError(_context.t0.response);
|
|
1342
|
+
return _context.abrupt("return");
|
|
1343
|
+
|
|
1344
|
+
case 26:
|
|
1345
|
+
profileSpecifiedData = _get(profileResponse, 'data.data');
|
|
1286
1346
|
profileDataObj = {
|
|
1287
1347
|
id: profileSpecifiedData.id,
|
|
1288
1348
|
first_name: profileSpecifiedData.firstName,
|
|
@@ -1297,12 +1357,12 @@ var RegisterModal = function RegisterModal(_ref) {
|
|
|
1297
1357
|
|
|
1298
1358
|
onClose();
|
|
1299
1359
|
|
|
1300
|
-
case
|
|
1360
|
+
case 30:
|
|
1301
1361
|
case "end":
|
|
1302
1362
|
return _context.stop();
|
|
1303
1363
|
}
|
|
1304
1364
|
}
|
|
1305
|
-
}, _callee);
|
|
1365
|
+
}, _callee, null, [[15, 22]]);
|
|
1306
1366
|
}));
|
|
1307
1367
|
|
|
1308
1368
|
function onSubmit(_x) {
|
|
@@ -1406,7 +1466,7 @@ var RegisterModal = function RegisterModal(_ref) {
|
|
|
1406
1466
|
}));
|
|
1407
1467
|
};
|
|
1408
1468
|
|
|
1409
|
-
var _excluded = ["
|
|
1469
|
+
var _excluded = ["firstName", "lastName", "holderAge", "confirmEmail", "confirmPassword"];
|
|
1410
1470
|
var getInitialValues = function getInitialValues(data, propsInitialValues) {
|
|
1411
1471
|
if (data === void 0) {
|
|
1412
1472
|
data = [];
|
|
@@ -1464,7 +1524,7 @@ var setLoggedUserData = function setLoggedUserData(data) {
|
|
|
1464
1524
|
zip: (data == null ? void 0 : data.zip) || (data == null ? void 0 : data.zipCode) || ''
|
|
1465
1525
|
};
|
|
1466
1526
|
};
|
|
1467
|
-
var createCheckoutDataBody = function createCheckoutDataBody(values, logedInValues, includeDob) {
|
|
1527
|
+
var createCheckoutDataBody = function createCheckoutDataBody(ticketsQuantity, values, logedInValues, includeDob) {
|
|
1468
1528
|
if (values === void 0) {
|
|
1469
1529
|
values = {};
|
|
1470
1530
|
}
|
|
@@ -1478,23 +1538,52 @@ var createCheckoutDataBody = function createCheckoutDataBody(values, logedInValu
|
|
|
1478
1538
|
}
|
|
1479
1539
|
|
|
1480
1540
|
var _values = values,
|
|
1481
|
-
holderAge = _values.holderAge,
|
|
1482
1541
|
firstName = _values.firstName,
|
|
1483
1542
|
lastName = _values.lastName,
|
|
1484
|
-
|
|
1485
|
-
holderLastName = _values.holderLastName,
|
|
1543
|
+
holderAge = _values.holderAge,
|
|
1486
1544
|
restValues = _objectWithoutPropertiesLoose(_values, _excluded);
|
|
1487
1545
|
|
|
1546
|
+
var holders = [];
|
|
1547
|
+
var ticket_holders = [];
|
|
1548
|
+
|
|
1549
|
+
var _loop = function _loop(i) {
|
|
1550
|
+
var individualHolder = Object.fromEntries(Object.entries(values).filter(function (_ref4) {
|
|
1551
|
+
var key = _ref4[0];
|
|
1552
|
+
return key.includes(String(i));
|
|
1553
|
+
}));
|
|
1554
|
+
holders.push(individualHolder);
|
|
1555
|
+
};
|
|
1556
|
+
|
|
1557
|
+
for (var i = 0; i <= ticketsQuantity; i++) {
|
|
1558
|
+
_loop(i);
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1561
|
+
var filteredHolders = holders.filter(function (holder) {
|
|
1562
|
+
return Object.entries(holder).length > 0;
|
|
1563
|
+
});
|
|
1564
|
+
ticket_holders = filteredHolders.map(function (item, index) {
|
|
1565
|
+
return {
|
|
1566
|
+
first_name: item["holderFirstName-" + index] || '',
|
|
1567
|
+
last_name: item["holderLastName-" + index] || '',
|
|
1568
|
+
phone: item["holderPhone-" + index] || '',
|
|
1569
|
+
email: item["holderEmail-" + index] || ''
|
|
1570
|
+
};
|
|
1571
|
+
});
|
|
1572
|
+
var filteredRestValue = {};
|
|
1573
|
+
|
|
1574
|
+
_forEach(restValues, function (value, key) {
|
|
1575
|
+
if (!key.includes('holder')) {
|
|
1576
|
+
filteredRestValue[key] = value;
|
|
1577
|
+
}
|
|
1578
|
+
});
|
|
1579
|
+
|
|
1488
1580
|
var body = {
|
|
1489
|
-
attributes: _extends({},
|
|
1581
|
+
attributes: _extends({}, filteredRestValue, {
|
|
1490
1582
|
email: restValues.email || logedInValues.emailLogged,
|
|
1491
1583
|
confirm_email: restValues.email || logedInValues.emailLogged,
|
|
1492
1584
|
first_name: firstName || logedInValues.firstNameLogged,
|
|
1493
1585
|
last_name: lastName || logedInValues.lastNameLogged,
|
|
1494
|
-
ticket_holders:
|
|
1495
|
-
first_name: holderFirstName,
|
|
1496
|
-
last_name: holderLastName
|
|
1497
|
-
}]
|
|
1586
|
+
ticket_holders: ticket_holders
|
|
1498
1587
|
})
|
|
1499
1588
|
};
|
|
1500
1589
|
|
|
@@ -1508,6 +1597,13 @@ var createCheckoutDataBody = function createCheckoutDataBody(values, logedInValu
|
|
|
1508
1597
|
return body;
|
|
1509
1598
|
};
|
|
1510
1599
|
|
|
1600
|
+
var useStyles = /*#__PURE__*/styles.makeStyles({
|
|
1601
|
+
input: {
|
|
1602
|
+
"&::placeholder": {
|
|
1603
|
+
color: "gray"
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
});
|
|
1511
1607
|
var CustomField = function CustomField(_ref) {
|
|
1512
1608
|
var label = _ref.label,
|
|
1513
1609
|
_ref$type = _ref.type,
|
|
@@ -1524,6 +1620,7 @@ var CustomField = function CustomField(_ref) {
|
|
|
1524
1620
|
|
|
1525
1621
|
var error = _get(errors, field.name);
|
|
1526
1622
|
|
|
1623
|
+
var classes = useStyles();
|
|
1527
1624
|
return React__default.createElement(TextField, Object.assign({
|
|
1528
1625
|
id: field.name,
|
|
1529
1626
|
label: label,
|
|
@@ -1535,6 +1632,11 @@ var CustomField = function CustomField(_ref) {
|
|
|
1535
1632
|
InputLabelProps: {
|
|
1536
1633
|
shrink: isShrink
|
|
1537
1634
|
},
|
|
1635
|
+
InputProps: {
|
|
1636
|
+
classes: {
|
|
1637
|
+
input: classes.input
|
|
1638
|
+
}
|
|
1639
|
+
},
|
|
1538
1640
|
SelectProps: {
|
|
1539
1641
|
"native": true
|
|
1540
1642
|
}
|
|
@@ -1577,7 +1679,9 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
1577
1679
|
setStates = _ref.setStates,
|
|
1578
1680
|
setFieldValue = _ref.setFieldValue,
|
|
1579
1681
|
setValues = _ref.setValues,
|
|
1580
|
-
setUserValues = _ref.setUserValues
|
|
1682
|
+
setUserValues = _ref.setUserValues,
|
|
1683
|
+
onGetStatesSuccess = _ref.onGetStatesSuccess,
|
|
1684
|
+
onGetStatesError = _ref.onGetStatesError;
|
|
1581
1685
|
React.useEffect(function () {
|
|
1582
1686
|
var fetchStates = /*#__PURE__*/function () {
|
|
1583
1687
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
@@ -1601,19 +1705,24 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
1601
1705
|
});
|
|
1602
1706
|
setStates(mappedStates);
|
|
1603
1707
|
setFieldValue('state', (_mappedStates$0$label = (_mappedStates$ = mappedStates[0]) == null ? void 0 : _mappedStates$.label) != null ? _mappedStates$0$label : '');
|
|
1604
|
-
|
|
1708
|
+
onGetStatesSuccess(res.data);
|
|
1709
|
+
_context.next = 13;
|
|
1605
1710
|
break;
|
|
1606
1711
|
|
|
1607
|
-
case
|
|
1608
|
-
_context.prev =
|
|
1712
|
+
case 10:
|
|
1713
|
+
_context.prev = 10;
|
|
1609
1714
|
_context.t0 = _context["catch"](0);
|
|
1610
1715
|
|
|
1611
|
-
|
|
1716
|
+
if (axios.isAxiosError(_context.t0)) {
|
|
1717
|
+
onGetStatesError(_context.t0);
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1720
|
+
case 13:
|
|
1612
1721
|
case "end":
|
|
1613
1722
|
return _context.stop();
|
|
1614
1723
|
}
|
|
1615
1724
|
}
|
|
1616
|
-
}, _callee, null, [[0,
|
|
1725
|
+
}, _callee, null, [[0, 10]]);
|
|
1617
1726
|
}));
|
|
1618
1727
|
|
|
1619
1728
|
return function fetchStates() {
|
|
@@ -1637,9 +1746,6 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
1637
1746
|
email: (parsedData == null ? void 0 : parsedData.email) || '',
|
|
1638
1747
|
phone: (parsedData == null ? void 0 : parsedData.phone) || '',
|
|
1639
1748
|
confirmEmail: '',
|
|
1640
|
-
holderFirstName: '',
|
|
1641
|
-
holderLastName: '',
|
|
1642
|
-
holderAge: '',
|
|
1643
1749
|
state: (parsedData == null ? void 0 : parsedData.state) || '',
|
|
1644
1750
|
street_address: (parsedData == null ? void 0 : parsedData.street_address) || '',
|
|
1645
1751
|
country: (parsedData == null ? void 0 : parsedData.country) || 1,
|
|
@@ -1651,9 +1757,7 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
1651
1757
|
};
|
|
1652
1758
|
setValues(mappedValues);
|
|
1653
1759
|
setUserValues(mappedValues);
|
|
1654
|
-
} catch (e) {
|
|
1655
|
-
console.log(e);
|
|
1656
|
-
}
|
|
1760
|
+
} catch (e) {}
|
|
1657
1761
|
}
|
|
1658
1762
|
}
|
|
1659
1763
|
};
|
|
@@ -1671,6 +1775,11 @@ var SectionContainer = function SectionContainer(_ref3) {
|
|
|
1671
1775
|
var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
1672
1776
|
var _ref4$data = _ref4.data,
|
|
1673
1777
|
data = _ref4$data === void 0 ? [] : _ref4$data,
|
|
1778
|
+
_ref4$ticketHoldersFi = _ref4.ticketHoldersFields,
|
|
1779
|
+
ticketHoldersFields = _ref4$ticketHoldersFi === void 0 ? {
|
|
1780
|
+
id: 1,
|
|
1781
|
+
fields: []
|
|
1782
|
+
} : _ref4$ticketHoldersFi,
|
|
1674
1783
|
_ref4$initialValues = _ref4.initialValues,
|
|
1675
1784
|
initialValues = _ref4$initialValues === void 0 ? {} : _ref4$initialValues,
|
|
1676
1785
|
_ref4$buttonName = _ref4.buttonName,
|
|
@@ -1678,7 +1787,35 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1678
1787
|
_ref4$handleSubmit = _ref4.handleSubmit,
|
|
1679
1788
|
handleSubmit = _ref4$handleSubmit === void 0 ? _identity : _ref4$handleSubmit,
|
|
1680
1789
|
_ref4$theme = _ref4.theme,
|
|
1681
|
-
theme = _ref4$theme === void 0 ? 'light' : _ref4$theme
|
|
1790
|
+
theme = _ref4$theme === void 0 ? 'light' : _ref4$theme,
|
|
1791
|
+
_ref4$onRegisterSucce = _ref4.onRegisterSuccess,
|
|
1792
|
+
onRegisterSuccess = _ref4$onRegisterSucce === void 0 ? function () {} : _ref4$onRegisterSucce,
|
|
1793
|
+
_ref4$onRegisterError = _ref4.onRegisterError,
|
|
1794
|
+
onRegisterError = _ref4$onRegisterError === void 0 ? function () {} : _ref4$onRegisterError,
|
|
1795
|
+
_ref4$onSubmitError = _ref4.onSubmitError,
|
|
1796
|
+
onSubmitError = _ref4$onSubmitError === void 0 ? function () {} : _ref4$onSubmitError,
|
|
1797
|
+
_ref4$onGetCartSucces = _ref4.onGetCartSuccess,
|
|
1798
|
+
onGetCartSuccess = _ref4$onGetCartSucces === void 0 ? function () {} : _ref4$onGetCartSucces,
|
|
1799
|
+
_ref4$onGetCartError = _ref4.onGetCartError,
|
|
1800
|
+
onGetCartError = _ref4$onGetCartError === void 0 ? function () {} : _ref4$onGetCartError,
|
|
1801
|
+
_ref4$onGetCountriesS = _ref4.onGetCountriesSuccess,
|
|
1802
|
+
onGetCountriesSuccess = _ref4$onGetCountriesS === void 0 ? function () {} : _ref4$onGetCountriesS,
|
|
1803
|
+
_ref4$onGetCountriesE = _ref4.onGetCountriesError,
|
|
1804
|
+
onGetCountriesError = _ref4$onGetCountriesE === void 0 ? function () {} : _ref4$onGetCountriesE,
|
|
1805
|
+
_ref4$onGetStatesSucc = _ref4.onGetStatesSuccess,
|
|
1806
|
+
onGetStatesSuccess = _ref4$onGetStatesSucc === void 0 ? function () {} : _ref4$onGetStatesSucc,
|
|
1807
|
+
_ref4$onGetStatesErro = _ref4.onGetStatesError,
|
|
1808
|
+
onGetStatesError = _ref4$onGetStatesErro === void 0 ? function () {} : _ref4$onGetStatesErro,
|
|
1809
|
+
_ref4$onGetProfileDat = _ref4.onGetProfileDataSuccess,
|
|
1810
|
+
onGetProfileDataSuccess = _ref4$onGetProfileDat === void 0 ? function () {} : _ref4$onGetProfileDat,
|
|
1811
|
+
_ref4$onGetProfileDat2 = _ref4.onGetProfileDataError,
|
|
1812
|
+
onGetProfileDataError = _ref4$onGetProfileDat2 === void 0 ? function () {} : _ref4$onGetProfileDat2,
|
|
1813
|
+
_ref4$onAuthorizeSucc = _ref4.onAuthorizeSuccess,
|
|
1814
|
+
onAuthorizeSuccess = _ref4$onAuthorizeSucc === void 0 ? function () {} : _ref4$onAuthorizeSucc,
|
|
1815
|
+
_ref4$onAuthorizeErro = _ref4.onAuthorizeError,
|
|
1816
|
+
onAuthorizeError = _ref4$onAuthorizeErro === void 0 ? function () {} : _ref4$onAuthorizeErro,
|
|
1817
|
+
_ref4$onLogin = _ref4.onLogin,
|
|
1818
|
+
onLogin = _ref4$onLogin === void 0 ? function () {} : _ref4$onLogin;
|
|
1682
1819
|
var userData = typeof window !== 'undefined' && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
1683
1820
|
var access_token = typeof window !== 'undefined' && window.localStorage.getItem('access_token') ? window.localStorage.getItem('access_token') || '' : '';
|
|
1684
1821
|
|
|
@@ -1710,7 +1847,11 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1710
1847
|
showModalRegister = _useState7[0],
|
|
1711
1848
|
setShowModalRegister = _useState7[1];
|
|
1712
1849
|
|
|
1713
|
-
var _useState8 = React.useState(
|
|
1850
|
+
var _useState8 = React.useState(1),
|
|
1851
|
+
ticketsQuantity = _useState8[0],
|
|
1852
|
+
setTicketsQuantity = _useState8[1];
|
|
1853
|
+
|
|
1854
|
+
var _useState9 = React.useState({
|
|
1714
1855
|
firstName: '',
|
|
1715
1856
|
lastName: '',
|
|
1716
1857
|
email: '',
|
|
@@ -1725,8 +1866,8 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1725
1866
|
state: '',
|
|
1726
1867
|
zip: ''
|
|
1727
1868
|
}),
|
|
1728
|
-
userValues =
|
|
1729
|
-
setUserValues =
|
|
1869
|
+
userValues = _useState9[0],
|
|
1870
|
+
setUserValues = _useState9[1];
|
|
1730
1871
|
|
|
1731
1872
|
var isLoggedIn = !!access_token;
|
|
1732
1873
|
|
|
@@ -1739,12 +1880,25 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1739
1880
|
var showDOB = getQueryVariable('age_required') === 'true';
|
|
1740
1881
|
var showTicketHolderName = getQueryVariable('names_required') === 'true';
|
|
1741
1882
|
|
|
1742
|
-
var optedInFieldValue = _get(cartInfoData, 'optedIn', false);
|
|
1883
|
+
var optedInFieldValue = _get(cartInfoData, 'optedIn', false);
|
|
1884
|
+
|
|
1885
|
+
var getQuantity = function getQuantity(cart) {
|
|
1886
|
+
if (cart === void 0) {
|
|
1887
|
+
cart = [];
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
var qty = 0;
|
|
1891
|
+
cart.forEach(function (item) {
|
|
1892
|
+
qty += +item.quantity;
|
|
1893
|
+
});
|
|
1894
|
+
return qty;
|
|
1895
|
+
}; // fetch cart data
|
|
1743
1896
|
|
|
1744
1897
|
|
|
1745
1898
|
var fetchCart = /*#__PURE__*/function () {
|
|
1746
1899
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
|
|
1747
|
-
var res;
|
|
1900
|
+
var res, cartInfo, _cartInfo$cart, cart;
|
|
1901
|
+
|
|
1748
1902
|
return runtime_1.wrap(function _callee2$(_context2) {
|
|
1749
1903
|
while (1) {
|
|
1750
1904
|
switch (_context2.prev = _context2.next) {
|
|
@@ -1756,20 +1910,28 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1756
1910
|
case 3:
|
|
1757
1911
|
res = _context2.sent;
|
|
1758
1912
|
setCustomHeader(res);
|
|
1759
|
-
|
|
1760
|
-
|
|
1913
|
+
cartInfo = _get(res, 'data.data.attributes');
|
|
1914
|
+
setCartInfo(cartInfo);
|
|
1915
|
+
_cartInfo$cart = cartInfo.cart, cart = _cartInfo$cart === void 0 ? [] : _cartInfo$cart;
|
|
1916
|
+
setTicketsQuantity(getQuantity(cart));
|
|
1917
|
+
onGetCartSuccess(res.data);
|
|
1918
|
+
_context2.next = 15;
|
|
1761
1919
|
break;
|
|
1762
1920
|
|
|
1763
|
-
case
|
|
1764
|
-
_context2.prev =
|
|
1921
|
+
case 12:
|
|
1922
|
+
_context2.prev = 12;
|
|
1765
1923
|
_context2.t0 = _context2["catch"](0);
|
|
1766
1924
|
|
|
1767
|
-
|
|
1925
|
+
if (axios.isAxiosError(_context2.t0)) {
|
|
1926
|
+
onGetCartError(_context2.t0);
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1929
|
+
case 15:
|
|
1768
1930
|
case "end":
|
|
1769
1931
|
return _context2.stop();
|
|
1770
1932
|
}
|
|
1771
1933
|
}
|
|
1772
|
-
}, _callee2, null, [[0,
|
|
1934
|
+
}, _callee2, null, [[0, 12]]);
|
|
1773
1935
|
}));
|
|
1774
1936
|
|
|
1775
1937
|
return function fetchCart() {
|
|
@@ -1788,7 +1950,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1788
1950
|
_context3.prev = 0;
|
|
1789
1951
|
|
|
1790
1952
|
if (!(typeof window !== 'undefined' && token)) {
|
|
1791
|
-
_context3.next =
|
|
1953
|
+
_context3.next = 10;
|
|
1792
1954
|
break;
|
|
1793
1955
|
}
|
|
1794
1956
|
|
|
@@ -1801,21 +1963,26 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1801
1963
|
profileDataObj = setLoggedUserData(profileSpecifiedData);
|
|
1802
1964
|
setUserValues(profileDataObj);
|
|
1803
1965
|
window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
|
|
1966
|
+
onGetProfileDataSuccess(userDataResponse.data);
|
|
1804
1967
|
|
|
1805
|
-
case
|
|
1806
|
-
_context3.next =
|
|
1968
|
+
case 10:
|
|
1969
|
+
_context3.next = 15;
|
|
1807
1970
|
break;
|
|
1808
1971
|
|
|
1809
|
-
case
|
|
1810
|
-
_context3.prev =
|
|
1972
|
+
case 12:
|
|
1973
|
+
_context3.prev = 12;
|
|
1811
1974
|
_context3.t0 = _context3["catch"](0);
|
|
1812
1975
|
|
|
1813
|
-
|
|
1976
|
+
if (axios.isAxiosError(_context3.t0)) {
|
|
1977
|
+
onGetProfileDataError(_context3.t0);
|
|
1978
|
+
}
|
|
1979
|
+
|
|
1980
|
+
case 15:
|
|
1814
1981
|
case "end":
|
|
1815
1982
|
return _context3.stop();
|
|
1816
1983
|
}
|
|
1817
1984
|
}
|
|
1818
|
-
}, _callee3, null, [[0,
|
|
1985
|
+
}, _callee3, null, [[0, 12]]);
|
|
1819
1986
|
}));
|
|
1820
1987
|
|
|
1821
1988
|
return function fetchUserData(_x) {
|
|
@@ -1834,10 +2001,11 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1834
2001
|
while (1) {
|
|
1835
2002
|
switch (_context4.prev = _context4.next) {
|
|
1836
2003
|
case 0:
|
|
1837
|
-
_context4.
|
|
2004
|
+
_context4.prev = 0;
|
|
2005
|
+
_context4.next = 3;
|
|
1838
2006
|
return getCountries();
|
|
1839
2007
|
|
|
1840
|
-
case
|
|
2008
|
+
case 3:
|
|
1841
2009
|
res = _context4.sent;
|
|
1842
2010
|
setCustomHeader(res);
|
|
1843
2011
|
setCountries(_map(_get(res, 'data.data'), function (item, key) {
|
|
@@ -1846,13 +2014,24 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1846
2014
|
value: Number(key)
|
|
1847
2015
|
};
|
|
1848
2016
|
}));
|
|
2017
|
+
onGetCountriesSuccess(res.data);
|
|
2018
|
+
_context4.next = 12;
|
|
2019
|
+
break;
|
|
1849
2020
|
|
|
1850
|
-
case
|
|
2021
|
+
case 9:
|
|
2022
|
+
_context4.prev = 9;
|
|
2023
|
+
_context4.t0 = _context4["catch"](0);
|
|
2024
|
+
|
|
2025
|
+
if (axios.isAxiosError(_context4.t0)) {
|
|
2026
|
+
onGetCountriesError(_context4.t0);
|
|
2027
|
+
}
|
|
2028
|
+
|
|
2029
|
+
case 12:
|
|
1851
2030
|
case "end":
|
|
1852
2031
|
return _context4.stop();
|
|
1853
2032
|
}
|
|
1854
2033
|
}
|
|
1855
|
-
}, _callee4);
|
|
2034
|
+
}, _callee4, null, [[0, 9]]);
|
|
1856
2035
|
}));
|
|
1857
2036
|
|
|
1858
2037
|
return function fetchCountries() {
|
|
@@ -1875,7 +2054,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1875
2054
|
enableReinitialize: true,
|
|
1876
2055
|
onSubmit: function () {
|
|
1877
2056
|
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(values, formikHelpers) {
|
|
1878
|
-
var updatedUserData, _profileSpecifiedData, _profileDataObj, _checkoutBody, _res, bodyFormData,
|
|
2057
|
+
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;
|
|
1879
2058
|
|
|
1880
2059
|
return runtime_1.wrap(function _callee5$(_context5) {
|
|
1881
2060
|
while (1) {
|
|
@@ -1906,7 +2085,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1906
2085
|
}
|
|
1907
2086
|
|
|
1908
2087
|
case 9:
|
|
1909
|
-
_checkoutBody = createCheckoutDataBody(values, {
|
|
2088
|
+
_checkoutBody = createCheckoutDataBody(ticketsQuantity, values, {
|
|
1910
2089
|
emailLogged: emailLogged,
|
|
1911
2090
|
firstNameLogged: firstNameLogged,
|
|
1912
2091
|
lastNameLogged: lastNameLogged
|
|
@@ -1921,17 +2100,55 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1921
2100
|
|
|
1922
2101
|
case 15:
|
|
1923
2102
|
bodyFormData = createRegisterFormData(values);
|
|
1924
|
-
|
|
2103
|
+
access_token_register = null;
|
|
2104
|
+
_context5.prev = 17;
|
|
2105
|
+
_context5.next = 20;
|
|
1925
2106
|
return register(bodyFormData);
|
|
1926
2107
|
|
|
1927
|
-
case
|
|
2108
|
+
case 20:
|
|
1928
2109
|
resRegister = _context5.sent;
|
|
1929
2110
|
access_token_register = _get(resRegister, 'data.data.attributes.access_token');
|
|
2111
|
+
refreshToken = _get(resRegister, 'data.data.attributes.refresh_token');
|
|
1930
2112
|
handleSetAccessToken(access_token_register);
|
|
1931
|
-
|
|
2113
|
+
tokens = {
|
|
2114
|
+
accessToken: access_token_register,
|
|
2115
|
+
refreshToken: refreshToken
|
|
2116
|
+
};
|
|
2117
|
+
onRegisterSuccess(tokens);
|
|
2118
|
+
_context5.next = 32;
|
|
2119
|
+
break;
|
|
2120
|
+
|
|
2121
|
+
case 28:
|
|
2122
|
+
_context5.prev = 28;
|
|
2123
|
+
_context5.t0 = _context5["catch"](17);
|
|
2124
|
+
|
|
2125
|
+
if (axios.isAxiosError(_context5.t0)) {
|
|
2126
|
+
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;
|
|
2127
|
+
|
|
2128
|
+
if (_includes(error, 'You must be aged')) {
|
|
2129
|
+
formikHelpers.setFieldError('holderAge', error);
|
|
2130
|
+
}
|
|
2131
|
+
|
|
2132
|
+
if (error != null && error.password) {
|
|
2133
|
+
formikHelpers.setFieldError('password', error.password);
|
|
2134
|
+
formikHelpers.setFieldError('confirmPassword', error.password);
|
|
2135
|
+
}
|
|
2136
|
+
|
|
2137
|
+
if (error != null && error.email) {
|
|
2138
|
+
setAlreadyHasUser(true);
|
|
2139
|
+
setShowModalLogin(true);
|
|
2140
|
+
}
|
|
2141
|
+
|
|
2142
|
+
onRegisterError(_context5.t0);
|
|
2143
|
+
}
|
|
2144
|
+
|
|
2145
|
+
return _context5.abrupt("return");
|
|
2146
|
+
|
|
2147
|
+
case 32:
|
|
2148
|
+
_context5.next = 34;
|
|
1932
2149
|
return getProfileData(access_token_register);
|
|
1933
2150
|
|
|
1934
|
-
case
|
|
2151
|
+
case 34:
|
|
1935
2152
|
profileData = _context5.sent;
|
|
1936
2153
|
profileSpecifiedData = _get(profileData, 'data.data');
|
|
1937
2154
|
profileDataObj = setLoggedUserData(profileSpecifiedData);
|
|
@@ -1940,42 +2157,26 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1940
2157
|
window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
|
|
1941
2158
|
}
|
|
1942
2159
|
|
|
1943
|
-
checkoutBody = createCheckoutDataBody(values, {
|
|
2160
|
+
checkoutBody = createCheckoutDataBody(ticketsQuantity, values, {
|
|
1944
2161
|
emailLogged: emailLogged,
|
|
1945
2162
|
firstNameLogged: firstNameLogged,
|
|
1946
2163
|
lastNameLogged: lastNameLogged
|
|
1947
2164
|
}, showDOB);
|
|
1948
|
-
_context5.next =
|
|
2165
|
+
_context5.next = 41;
|
|
1949
2166
|
return postOnCheckout(checkoutBody, access_token_register);
|
|
1950
2167
|
|
|
1951
|
-
case
|
|
2168
|
+
case 41:
|
|
1952
2169
|
res = _context5.sent;
|
|
1953
2170
|
handleSubmit(values, formikHelpers, res);
|
|
1954
|
-
_context5.next =
|
|
2171
|
+
_context5.next = 48;
|
|
1955
2172
|
break;
|
|
1956
2173
|
|
|
1957
|
-
case
|
|
1958
|
-
_context5.prev =
|
|
1959
|
-
_context5.
|
|
1960
|
-
|
|
1961
|
-
if (axios.isAxiosError(_context5.t0)) {
|
|
1962
|
-
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;
|
|
1963
|
-
|
|
1964
|
-
if (_includes(error, 'You must be aged')) {
|
|
1965
|
-
formikHelpers.setFieldError('holderAge', error);
|
|
1966
|
-
}
|
|
1967
|
-
|
|
1968
|
-
if (error != null && error.password) {
|
|
1969
|
-
formikHelpers.setFieldError('password', error.password);
|
|
1970
|
-
formikHelpers.setFieldError('confirmPassword', error.password);
|
|
1971
|
-
}
|
|
1972
|
-
|
|
1973
|
-
if (error != null && error.email) {
|
|
1974
|
-
setAlreadyHasUser(true);
|
|
1975
|
-
setShowModalLogin(true);
|
|
1976
|
-
}
|
|
2174
|
+
case 45:
|
|
2175
|
+
_context5.prev = 45;
|
|
2176
|
+
_context5.t1 = _context5["catch"](0);
|
|
1977
2177
|
|
|
1978
|
-
|
|
2178
|
+
if (axios.isAxiosError(_context5.t1)) {
|
|
2179
|
+
if (((_e$response2 = _context5.t1.response) == null ? void 0 : _e$response2.data.error) === 'invalid_token') {
|
|
1979
2180
|
if (typeof window !== 'undefined') {
|
|
1980
2181
|
window.localStorage.removeItem('user_data');
|
|
1981
2182
|
window.localStorage.removeItem('access_token');
|
|
@@ -1983,14 +2184,16 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
1983
2184
|
setShowModalLogin(true);
|
|
1984
2185
|
}
|
|
1985
2186
|
}
|
|
2187
|
+
|
|
2188
|
+
onSubmitError(_context5.t1);
|
|
1986
2189
|
}
|
|
1987
2190
|
|
|
1988
|
-
case
|
|
2191
|
+
case 48:
|
|
1989
2192
|
case "end":
|
|
1990
2193
|
return _context5.stop();
|
|
1991
2194
|
}
|
|
1992
2195
|
}
|
|
1993
|
-
}, _callee5, null, [[0,
|
|
2196
|
+
}, _callee5, null, [[0, 45], [17, 28]]);
|
|
1994
2197
|
}));
|
|
1995
2198
|
|
|
1996
2199
|
function onSubmit(_x2, _x3) {
|
|
@@ -2007,7 +2210,9 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
2007
2210
|
setStates: setStates,
|
|
2008
2211
|
setFieldValue: props.setFieldValue,
|
|
2009
2212
|
setValues: props.setValues,
|
|
2010
|
-
setUserValues: setUserValues
|
|
2213
|
+
setUserValues: setUserValues,
|
|
2214
|
+
onGetStatesSuccess: onGetStatesSuccess,
|
|
2215
|
+
onGetStatesError: onGetStatesError
|
|
2011
2216
|
}), React__default.createElement("div", {
|
|
2012
2217
|
className: "billing-info-container " + theme
|
|
2013
2218
|
}, !isLoggedIn && React__default.createElement("div", {
|
|
@@ -2018,6 +2223,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
2018
2223
|
className: "login-register-button",
|
|
2019
2224
|
type: "button",
|
|
2020
2225
|
onClick: function onClick() {
|
|
2226
|
+
onLogin();
|
|
2021
2227
|
setShowModalLogin(true);
|
|
2022
2228
|
}
|
|
2023
2229
|
}, "Login"))), _map(data, function (item) {
|
|
@@ -2034,13 +2240,13 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
2034
2240
|
key: id
|
|
2035
2241
|
}, React__default.createElement("p", {
|
|
2036
2242
|
className: labelClassName
|
|
2037
|
-
}, label), _map(fields, function (group
|
|
2243
|
+
}, label), _map(fields, function (group) {
|
|
2038
2244
|
var groupClassname = group.groupClassname,
|
|
2039
2245
|
groupItems = group.groupItems,
|
|
2040
2246
|
groupLabel = group.groupLabel,
|
|
2041
2247
|
groupLabelClassName = group.groupLabelClassName;
|
|
2042
|
-
return React__default.createElement(
|
|
2043
|
-
key:
|
|
2248
|
+
return React__default.createElement(SectionContainer, {
|
|
2249
|
+
key: group.id
|
|
2044
2250
|
}, !isLoggedIn && React__default.createElement("div", {
|
|
2045
2251
|
className: groupLabelClassName
|
|
2046
2252
|
}, groupLabel), React__default.createElement("div", {
|
|
@@ -2073,16 +2279,43 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
2073
2279
|
}));
|
|
2074
2280
|
})));
|
|
2075
2281
|
}));
|
|
2076
|
-
}), React__default.createElement("div", {
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2282
|
+
}), showTicketHolderName && React__default.createElement("div", null, React__default.createElement("p", null, ticketHoldersFields.label), _map(new Array(ticketsQuantity), function (_item, index) {
|
|
2283
|
+
return React__default.createElement("div", {
|
|
2284
|
+
key: index
|
|
2285
|
+
}, React__default.createElement("h5", null, "Ticket ", index + 1), _map(ticketHoldersFields.fields, function (group) {
|
|
2286
|
+
var groupClassname = group.groupClassname,
|
|
2287
|
+
groupItems = group.groupItems;
|
|
2288
|
+
return React__default.createElement("div", {
|
|
2289
|
+
key: group.id
|
|
2290
|
+
}, React__default.createElement("div", {
|
|
2291
|
+
className: groupClassname
|
|
2292
|
+
}, _map(groupItems, function (element) {
|
|
2293
|
+
return React__default.createElement("div", {
|
|
2294
|
+
className: element.className,
|
|
2295
|
+
key: element.name + "-" + index
|
|
2296
|
+
}, React__default.createElement(formik.Field, {
|
|
2297
|
+
name: element.name + "-" + index,
|
|
2298
|
+
key: element.name + "-" + index,
|
|
2299
|
+
label: element.label,
|
|
2300
|
+
type: element.type,
|
|
2301
|
+
required: true,
|
|
2302
|
+
component: element.type === 'checkbox' ? CheckboxField : CustomField,
|
|
2303
|
+
validate: combineValidators(element.required ? requiredValidator : function () {}, element.onValidate ? element.onValidate : function () {})
|
|
2304
|
+
}));
|
|
2305
|
+
})));
|
|
2306
|
+
}));
|
|
2307
|
+
})), React__default.createElement("div", {
|
|
2308
|
+
className: "button-container"
|
|
2309
|
+
}, React__default.createElement(LoadingButton, {
|
|
2083
2310
|
type: "submit",
|
|
2084
2311
|
variant: "contained",
|
|
2085
|
-
className: "login-register-button"
|
|
2312
|
+
className: "login-register-button",
|
|
2313
|
+
loadingIndicator: React__default.createElement(material.CircularProgress, {
|
|
2314
|
+
color: "inherit",
|
|
2315
|
+
size: 26
|
|
2316
|
+
}),
|
|
2317
|
+
loading: props.isSubmitting,
|
|
2318
|
+
disabled: props.isSubmitting
|
|
2086
2319
|
}, buttonName))));
|
|
2087
2320
|
}), showModalLogin && React__default.createElement(LoginModal, {
|
|
2088
2321
|
onClose: function onClose() {
|
|
@@ -2090,17 +2323,23 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
2090
2323
|
},
|
|
2091
2324
|
onLogin: function onLogin() {
|
|
2092
2325
|
setShowModalLogin(false);
|
|
2326
|
+
setUserExpired(false);
|
|
2093
2327
|
},
|
|
2094
2328
|
alreadyHasUser: alreadyHasUser,
|
|
2095
2329
|
userExpired: userExpired,
|
|
2096
|
-
|
|
2330
|
+
onAuthorizeSuccess: onAuthorizeSuccess,
|
|
2331
|
+
onAuthorizeError: onAuthorizeError,
|
|
2332
|
+
onGetProfileDataSuccess: onGetProfileDataSuccess,
|
|
2333
|
+
onGetProfileDataError: onGetProfileDataError
|
|
2097
2334
|
}), showModalRegister && React__default.createElement(RegisterModal, {
|
|
2098
2335
|
onClose: function onClose() {
|
|
2099
2336
|
setShowModalRegister(false);
|
|
2100
2337
|
},
|
|
2101
2338
|
onRegister: function onRegister() {
|
|
2102
2339
|
setShowModalRegister(false);
|
|
2103
|
-
}
|
|
2340
|
+
},
|
|
2341
|
+
onGetProfileDataSuccess: onGetProfileDataSuccess,
|
|
2342
|
+
onGetProfileDataError: onGetProfileDataError
|
|
2104
2343
|
}));
|
|
2105
2344
|
};
|
|
2106
2345
|
|
|
@@ -2407,7 +2646,13 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
2407
2646
|
errorText = _ref.errorText,
|
|
2408
2647
|
checkoutData = _ref.checkoutData,
|
|
2409
2648
|
_ref$onErrorClose = _ref.onErrorClose,
|
|
2410
|
-
onErrorClose = _ref$onErrorClose === void 0 ? _identity : _ref$onErrorClose
|
|
2649
|
+
onErrorClose = _ref$onErrorClose === void 0 ? _identity : _ref$onErrorClose,
|
|
2650
|
+
_ref$onGetPaymentData = _ref.onGetPaymentDataSuccess,
|
|
2651
|
+
onGetPaymentDataSuccess = _ref$onGetPaymentData === void 0 ? function () {} : _ref$onGetPaymentData,
|
|
2652
|
+
_ref$onGetPaymentData2 = _ref.onGetPaymentDataError,
|
|
2653
|
+
onGetPaymentDataError = _ref$onGetPaymentData2 === void 0 ? function () {} : _ref$onGetPaymentData2,
|
|
2654
|
+
_ref$onPaymentError = _ref.onPaymentError,
|
|
2655
|
+
onPaymentError = _ref$onPaymentError === void 0 ? function () {} : _ref$onPaymentError;
|
|
2411
2656
|
|
|
2412
2657
|
var _useState = React.useState(initialReviewValues),
|
|
2413
2658
|
reviewData = _useState[0],
|
|
@@ -2458,17 +2703,19 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
2458
2703
|
currency: order_details == null ? void 0 : order_details.currency
|
|
2459
2704
|
};
|
|
2460
2705
|
setOrderData(_orderData);
|
|
2706
|
+
onGetPaymentDataSuccess(response.data);
|
|
2461
2707
|
}
|
|
2462
2708
|
|
|
2463
|
-
_context.next =
|
|
2709
|
+
_context.next = 11;
|
|
2464
2710
|
break;
|
|
2465
2711
|
|
|
2466
2712
|
case 7:
|
|
2467
2713
|
_context.prev = 7;
|
|
2468
2714
|
_context.t0 = _context["catch"](0);
|
|
2469
2715
|
setError(_get(_context.t0, 'response.data.message'));
|
|
2716
|
+
onGetPaymentDataError(_context.t0.response);
|
|
2470
2717
|
|
|
2471
|
-
case
|
|
2718
|
+
case 11:
|
|
2472
2719
|
case "end":
|
|
2473
2720
|
return _context.stop();
|
|
2474
2721
|
}
|
|
@@ -2509,15 +2756,16 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
2509
2756
|
setPaymentIsLoading(false);
|
|
2510
2757
|
}
|
|
2511
2758
|
|
|
2512
|
-
_context2.next =
|
|
2759
|
+
_context2.next = 15;
|
|
2513
2760
|
break;
|
|
2514
2761
|
|
|
2515
2762
|
case 11:
|
|
2516
2763
|
_context2.prev = 11;
|
|
2517
2764
|
_context2.t0 = _context2["catch"](0);
|
|
2518
2765
|
setError(_get(_context2.t0, 'response.data.message'));
|
|
2766
|
+
onPaymentError(_context2.t0.response);
|
|
2519
2767
|
|
|
2520
|
-
case
|
|
2768
|
+
case 15:
|
|
2521
2769
|
case "end":
|
|
2522
2770
|
return _context2.stop();
|
|
2523
2771
|
}
|
|
@@ -2586,7 +2834,11 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
2586
2834
|
_ref$shareButtons = _ref.shareButtons,
|
|
2587
2835
|
shareButtons = _ref$shareButtons === void 0 ? [] : _ref$shareButtons,
|
|
2588
2836
|
_ref$shareLink = _ref.shareLink,
|
|
2589
|
-
shareLink = _ref$shareLink === void 0 ? '' : _ref$shareLink
|
|
2837
|
+
shareLink = _ref$shareLink === void 0 ? '' : _ref$shareLink,
|
|
2838
|
+
_ref$onGetConfirmatio = _ref.onGetConfirmationDataSuccess,
|
|
2839
|
+
onGetConfirmationDataSuccess = _ref$onGetConfirmatio === void 0 ? function () {} : _ref$onGetConfirmatio,
|
|
2840
|
+
_ref$onGetConfirmatio2 = _ref.onGetConfirmationDataError,
|
|
2841
|
+
onGetConfirmationDataError = _ref$onGetConfirmatio2 === void 0 ? function () {} : _ref$onGetConfirmatio2;
|
|
2590
2842
|
var inputRef = React.useRef(null);
|
|
2591
2843
|
|
|
2592
2844
|
var _useState = React.useState({}),
|
|
@@ -2607,7 +2859,7 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
2607
2859
|
dataEncoded = typeof window !== 'undefined' && window.localStorage.getItem('checkoutData');
|
|
2608
2860
|
|
|
2609
2861
|
if (!dataEncoded) {
|
|
2610
|
-
_context.next =
|
|
2862
|
+
_context.next = 16;
|
|
2611
2863
|
break;
|
|
2612
2864
|
}
|
|
2613
2865
|
|
|
@@ -2621,21 +2873,23 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
2621
2873
|
response = _context.sent;
|
|
2622
2874
|
_data = _get(response, 'data.data.attributes');
|
|
2623
2875
|
setData(_data);
|
|
2624
|
-
|
|
2876
|
+
onGetConfirmationDataSuccess(response.data);
|
|
2877
|
+
_context.next = 16;
|
|
2625
2878
|
break;
|
|
2626
2879
|
|
|
2627
|
-
case
|
|
2628
|
-
_context.prev =
|
|
2880
|
+
case 13:
|
|
2881
|
+
_context.prev = 13;
|
|
2629
2882
|
_context.t0 = _context["catch"](4);
|
|
2883
|
+
onGetConfirmationDataError(_context.t0.response);
|
|
2630
2884
|
|
|
2631
|
-
case
|
|
2885
|
+
case 16:
|
|
2632
2886
|
case "end":
|
|
2633
2887
|
return _context.stop();
|
|
2634
2888
|
}
|
|
2635
2889
|
}
|
|
2636
|
-
}, _callee, null, [[4,
|
|
2890
|
+
}, _callee, null, [[4, 13]]);
|
|
2637
2891
|
}))();
|
|
2638
|
-
}, []);
|
|
2892
|
+
}, [onGetConfirmationDataSuccess, onGetConfirmationDataError]);
|
|
2639
2893
|
return React__default.createElement("div", {
|
|
2640
2894
|
className: "confirmation-page"
|
|
2641
2895
|
}, React__default.createElement("p", {
|
|
@@ -2854,7 +3108,13 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
2854
3108
|
eventId = _ref.eventId,
|
|
2855
3109
|
onAddToCartSuccess = _ref.onAddToCartSuccess,
|
|
2856
3110
|
_ref$contentStyle = _ref.contentStyle,
|
|
2857
|
-
contentStyle = _ref$contentStyle === void 0 ? {} : _ref$contentStyle
|
|
3111
|
+
contentStyle = _ref$contentStyle === void 0 ? {} : _ref$contentStyle,
|
|
3112
|
+
_ref$onAddToCartError = _ref.onAddToCartError,
|
|
3113
|
+
onAddToCartError = _ref$onAddToCartError === void 0 ? function () {} : _ref$onAddToCartError,
|
|
3114
|
+
_ref$onGetTicketsSucc = _ref.onGetTicketsSuccess,
|
|
3115
|
+
onGetTicketsSuccess = _ref$onGetTicketsSucc === void 0 ? function () {} : _ref$onGetTicketsSucc,
|
|
3116
|
+
_ref$onGetTicketsErro = _ref.onGetTicketsError,
|
|
3117
|
+
onGetTicketsError = _ref$onGetTicketsErro === void 0 ? function () {} : _ref$onGetTicketsErro;
|
|
2858
3118
|
|
|
2859
3119
|
var _useState = React.useState({}),
|
|
2860
3120
|
selectedTickets = _useState[0],
|
|
@@ -2931,6 +3191,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
2931
3191
|
return _isObject(item);
|
|
2932
3192
|
});
|
|
2933
3193
|
setTickets(_tickets);
|
|
3194
|
+
onGetTicketsSuccess(response.data);
|
|
2934
3195
|
}
|
|
2935
3196
|
|
|
2936
3197
|
_context.next = 11;
|
|
@@ -2939,7 +3200,10 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
2939
3200
|
case 8:
|
|
2940
3201
|
_context.prev = 8;
|
|
2941
3202
|
_context.t0 = _context["catch"](0);
|
|
2942
|
-
|
|
3203
|
+
|
|
3204
|
+
if (axios.isAxiosError(_context.t0)) {
|
|
3205
|
+
onGetTicketsError(_context.t0);
|
|
3206
|
+
}
|
|
2943
3207
|
|
|
2944
3208
|
case 11:
|
|
2945
3209
|
_context.prev = 11;
|
|
@@ -3022,7 +3286,10 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
3022
3286
|
case 13:
|
|
3023
3287
|
_context2.prev = 13;
|
|
3024
3288
|
_context2.t0 = _context2["catch"](6);
|
|
3025
|
-
|
|
3289
|
+
|
|
3290
|
+
if (axios.isAxiosError(_context2.t0)) {
|
|
3291
|
+
onAddToCartError(_context2.t0);
|
|
3292
|
+
}
|
|
3026
3293
|
|
|
3027
3294
|
case 16:
|
|
3028
3295
|
_context2.prev = 16;
|
|
@@ -3062,13 +3329,13 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
3062
3329
|
setPromoCodeUpdated(promoCode);
|
|
3063
3330
|
}
|
|
3064
3331
|
}
|
|
3065
|
-
}), React__default.createElement(Button
|
|
3332
|
+
}), React__default.createElement(Button, {
|
|
3066
3333
|
className: "promo-apply-button",
|
|
3067
3334
|
placeholder: "Promo Code",
|
|
3068
3335
|
onClick: function onClick() {
|
|
3069
3336
|
setPromoCodeUpdated(promoCode);
|
|
3070
3337
|
}
|
|
3071
|
-
}, "Apply")), !showPromoInput && !isAllTicketsSoldOut ? React__default.createElement(Button
|
|
3338
|
+
}, "Apply")), !showPromoInput && !isAllTicketsSoldOut ? React__default.createElement(Button, {
|
|
3072
3339
|
className: "promo-code-button",
|
|
3073
3340
|
placeholder: "Promo Codes",
|
|
3074
3341
|
onClick: function onClick() {
|
|
@@ -3079,7 +3346,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
3079
3346
|
style: {
|
|
3080
3347
|
display: 'none'
|
|
3081
3348
|
}
|
|
3082
|
-
}), !isAllTicketsSoldOut && React__default.createElement(Button
|
|
3349
|
+
}), !isAllTicketsSoldOut && React__default.createElement(Button, {
|
|
3083
3350
|
"aria-hidden": true,
|
|
3084
3351
|
className: "book-button " + (handleBookIsLoading || _isEmpty(selectedTickets) || Object.values(selectedTickets)[0] === 0 ? 'disabled' : ''),
|
|
3085
3352
|
onClick: !handleBookIsLoading && !_isEmpty(selectedTickets) && Object.values(selectedTickets)[0] > 0 ? handleBook : function () {}
|
|
@@ -3088,6 +3355,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
3088
3355
|
|
|
3089
3356
|
exports.BillingInfoContainer = BillingInfoContainer;
|
|
3090
3357
|
exports.ConfirmationContainer = ConfirmationContainer;
|
|
3358
|
+
exports.LoginModal = LoginModal;
|
|
3091
3359
|
exports.PaymentContainer = PaymentContainer;
|
|
3092
3360
|
exports.TicketsContainer = TicketsContainer;
|
|
3093
3361
|
exports.createFixedFloatNormalizer = createFixedFloatNormalizer;
|