tf-checkout-react 1.0.106 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +278 -1
- package/dist/api/index.d.ts +40 -28
- package/dist/components/account-settings/index.d.ts +3 -0
- package/dist/components/billing-info-container/index.d.ts +8 -5
- package/dist/components/common/PhoneNumberField.d.ts +9 -0
- package/dist/components/common/index.d.ts +1 -0
- package/dist/components/confirmationContainer/index.d.ts +2 -1
- package/dist/components/countdown/index.d.ts +2 -1
- package/dist/components/forgotPasswordModal/index.d.ts +11 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/loginModal/index.d.ts +35 -2
- package/dist/components/myTicketsContainer/index.d.ts +2 -1
- package/dist/components/myTicketsContainer/tableConfig.d.ts +1 -1
- package/dist/components/orderDetailsContainer/index.d.ts +6 -1
- package/dist/components/orderDetailsContainer/ticketsTable.d.ts +2 -1
- package/dist/components/paymentContainer/index.d.ts +2 -1
- package/dist/components/resetPasswordContainer/index.d.ts +10 -0
- package/dist/components/signupModal/index.d.ts +14 -0
- package/dist/components/ticketsContainer/PromoCodeSection.d.ts +3 -2
- package/dist/components/ticketsContainer/TicketsSection.d.ts +1 -2
- package/dist/components/ticketsContainer/index.d.ts +4 -1
- package/dist/index.d.ts +2 -0
- package/dist/tf-checkout-react.cjs.development.js +1274 -629
- 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 +1272 -629
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/tf-checkout-styles.css +1 -1
- package/dist/utils/cookies.d.ts +3 -0
- package/dist/utils/createCheckoutDataBodyWithDefaultHolder.d.ts +6 -1
- package/dist/utils/downloadPDF.d.ts +1 -1
- package/dist/utils/getDomain.d.ts +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/package.json +12 -1
- package/src/api/index.ts +61 -24
- package/src/components/account-settings/index.tsx +161 -0
- package/src/components/account-settings/style.css +200 -0
- package/src/components/billing-info-container/index.tsx +121 -77
- package/src/components/billing-info-container/style.css +1 -1
- package/src/components/billing-info-container/utils.ts +11 -3
- package/src/components/common/PhoneNumberField.tsx +68 -0
- package/src/components/common/SnackbarAlert.tsx +1 -1
- package/src/components/common/dist/PhoneNumberField.js +96 -0
- package/src/components/common/index.tsx +1 -0
- package/src/components/confirmationContainer/index.tsx +19 -9
- package/src/components/countdown/index.tsx +3 -1
- package/src/components/forgotPasswordModal/index.tsx +107 -0
- package/src/components/forgotPasswordModal/style.css +47 -0
- package/src/components/index.ts +1 -0
- package/src/components/loginModal/index.tsx +72 -71
- package/src/components/myTicketsContainer/index.tsx +99 -95
- package/src/components/myTicketsContainer/style.css +2 -2
- package/src/components/myTicketsContainer/tableConfig.tsx +3 -6
- package/src/components/orderDetailsContainer/index.tsx +75 -21
- package/src/components/orderDetailsContainer/style.css +3 -3
- package/src/components/orderDetailsContainer/ticketsTable.tsx +130 -83
- package/src/components/paymentContainer/index.tsx +114 -49
- package/src/components/registerModal/index.tsx +3 -10
- package/src/components/resetPasswordContainer/index.tsx +96 -0
- package/src/components/resetPasswordContainer/style.css +36 -0
- package/src/components/signupModal/index.tsx +195 -0
- package/src/components/signupModal/style.css +58 -0
- package/src/components/stripePayment/index.tsx +14 -12
- package/src/components/stripePayment/style.css +3 -3
- package/src/components/ticketResaleModal/index.tsx +12 -14
- package/src/components/ticketsContainer/PromoCodeSection.tsx +8 -7
- package/src/components/ticketsContainer/TicketRow.tsx +12 -6
- package/src/components/ticketsContainer/TicketsSection.tsx +0 -3
- package/src/components/ticketsContainer/index.tsx +92 -50
- package/src/env.ts +3 -3
- package/src/index.ts +3 -1
- package/src/utils/cookies.ts +42 -0
- package/src/utils/createCheckoutDataBodyWithDefaultHolder.ts +16 -4
- package/src/utils/downloadPDF.tsx +28 -6
- package/src/utils/getDomain.ts +15 -0
- package/src/utils/index.ts +2 -0
|
@@ -17,17 +17,19 @@ var _isEmpty = _interopDefault(require('lodash/isEmpty'));
|
|
|
17
17
|
var axios = _interopDefault(require('axios'));
|
|
18
18
|
var _forEach = _interopDefault(require('lodash/forEach'));
|
|
19
19
|
var material = require('@mui/material');
|
|
20
|
-
var Modal = _interopDefault(require('@mui/material/Modal'));
|
|
21
20
|
var Box = _interopDefault(require('@mui/material/Box'));
|
|
21
|
+
var Modal = _interopDefault(require('@mui/material/Modal'));
|
|
22
|
+
var TextField = _interopDefault(require('@mui/material/TextField'));
|
|
23
|
+
var styles = require('@mui/styles');
|
|
24
|
+
var Yup = require('yup');
|
|
22
25
|
var _flatMapDeep = _interopDefault(require('lodash/flatMapDeep'));
|
|
23
26
|
var _isArray = _interopDefault(require('lodash/isArray'));
|
|
24
27
|
var nanoid = require('nanoid');
|
|
25
28
|
var FormGroup = _interopDefault(require('@mui/material/FormGroup'));
|
|
26
29
|
var FormControlLabel = _interopDefault(require('@mui/material/FormControlLabel'));
|
|
27
30
|
var Checkbox = _interopDefault(require('@mui/material/Checkbox'));
|
|
28
|
-
|
|
29
|
-
var
|
|
30
|
-
var MuiPhoneNumber = _interopDefault(require('material-ui-phone-number'));
|
|
31
|
+
require('material-ui-phone-number');
|
|
32
|
+
var _debounce = _interopDefault(require('lodash/debounce'));
|
|
31
33
|
var CircularProgress = _interopDefault(require('@mui/material/CircularProgress'));
|
|
32
34
|
var Select = _interopDefault(require('@mui/material/Select'));
|
|
33
35
|
var styles$1 = require('@mui/material/styles');
|
|
@@ -52,17 +54,16 @@ var FormControl = _interopDefault(require('@mui/material/FormControl'));
|
|
|
52
54
|
var MenuItem = _interopDefault(require('@mui/material/MenuItem'));
|
|
53
55
|
var moment = _interopDefault(require('moment-timezone'));
|
|
54
56
|
var privateTheming = require('@mui/private-theming');
|
|
57
|
+
var Autocomplete = _interopDefault(require('@mui/material/Autocomplete'));
|
|
58
|
+
var Paper = _interopDefault(require('@mui/material/Paper'));
|
|
55
59
|
var Table = _interopDefault(require('@mui/material/Table'));
|
|
56
60
|
var TableBody = _interopDefault(require('@mui/material/TableBody'));
|
|
57
61
|
var TableCell = _interopDefault(require('@mui/material/TableCell'));
|
|
58
62
|
var TableContainer = _interopDefault(require('@mui/material/TableContainer'));
|
|
59
63
|
var TableHead = _interopDefault(require('@mui/material/TableHead'));
|
|
60
|
-
var TableRow = _interopDefault(require('@mui/material/TableRow'));
|
|
61
|
-
var Paper = _interopDefault(require('@mui/material/Paper'));
|
|
62
64
|
var TablePagination = _interopDefault(require('@mui/material/TablePagination'));
|
|
63
|
-
var
|
|
65
|
+
var TableRow = _interopDefault(require('@mui/material/TableRow'));
|
|
64
66
|
var _has = _interopDefault(require('lodash/has'));
|
|
65
|
-
var yup = require('yup');
|
|
66
67
|
var Radio = _interopDefault(require('@mui/material/Radio'));
|
|
67
68
|
|
|
68
69
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -1005,14 +1006,87 @@ var ErrorFocusInternal = /*#__PURE__*/function (_Component) {
|
|
|
1005
1006
|
|
|
1006
1007
|
var ErrorFocus = /*#__PURE__*/formik.connect(ErrorFocusInternal);
|
|
1007
1008
|
|
|
1009
|
+
function getDomain(url, subdomain) {
|
|
1010
|
+
var updatedUrl = url.replace(/(https?:\/\/)?(www.)?/i, '');
|
|
1011
|
+
|
|
1012
|
+
if (!subdomain) {
|
|
1013
|
+
updatedUrl = updatedUrl.split('.');
|
|
1014
|
+
updatedUrl = updatedUrl.slice(updatedUrl.length - 2).join('.');
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
if (updatedUrl.indexOf('/') !== -1) {
|
|
1018
|
+
return updatedUrl.split('/')[0];
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
return updatedUrl;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
function setCustomCookie(name, value, days) {
|
|
1025
|
+
if (days === void 0) {
|
|
1026
|
+
days = 5;
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
var expires = '';
|
|
1030
|
+
|
|
1031
|
+
if (days) {
|
|
1032
|
+
var date = new Date();
|
|
1033
|
+
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
|
|
1034
|
+
expires = '; expires=' + date.toUTCString();
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
if (typeof window !== 'undefined') {
|
|
1038
|
+
var domain = getDomain(window.location.hostname);
|
|
1039
|
+
document.cookie = name + '=' + (value || '') + expires + '; path=/' + ("; domain=" + domain);
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
function getCookieByName(cname) {
|
|
1043
|
+
if (typeof window === 'undefined') return '';
|
|
1044
|
+
var name = cname + '=';
|
|
1045
|
+
var ca = document.cookie.split(';');
|
|
1046
|
+
|
|
1047
|
+
for (var i = 0; i < ca.length; i++) {
|
|
1048
|
+
var c = ca[i];
|
|
1049
|
+
|
|
1050
|
+
while (c.charAt(0) == ' ') {
|
|
1051
|
+
c = c.substring(1);
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
if (c.indexOf(name) == 0) {
|
|
1055
|
+
return c.substring(name.length, c.length);
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
return '';
|
|
1060
|
+
}
|
|
1061
|
+
function deleteCookieByName(name) {
|
|
1062
|
+
if (typeof window !== 'undefined') {
|
|
1063
|
+
var domain = getDomain(window.location.hostname);
|
|
1064
|
+
document.cookie = name + '=; Path=/' + ("; domain=" + domain) + '; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1008
1068
|
var downloadPDF = function downloadPDF(pdfUrl) {
|
|
1009
1069
|
if (typeof window === 'undefined') return;
|
|
1070
|
+
var xtfCookie = getCookieByName('X-TF-ECOMMERCE');
|
|
1010
1071
|
var accessToken = localStorage.getItem('access_token');
|
|
1011
|
-
if (!accessToken) return;
|
|
1012
|
-
|
|
1013
|
-
|
|
1072
|
+
if (!accessToken && !xtfCookie) return;
|
|
1073
|
+
var headers = {};
|
|
1074
|
+
|
|
1075
|
+
if (accessToken) {
|
|
1076
|
+
headers = {
|
|
1014
1077
|
Authorization: "Bearer " + accessToken
|
|
1015
|
-
}
|
|
1078
|
+
};
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
if (xtfCookie) {
|
|
1082
|
+
headers = {
|
|
1083
|
+
'X-TF-ECOMMERCE': xtfCookie
|
|
1084
|
+
};
|
|
1085
|
+
}
|
|
1086
|
+
|
|
1087
|
+
return fetch(pdfUrl, {
|
|
1088
|
+
headers: headers,
|
|
1089
|
+
credentials: 'include'
|
|
1016
1090
|
}).then( /*#__PURE__*/function () {
|
|
1017
1091
|
var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(response) {
|
|
1018
1092
|
var blobValue, fileNameHeader, fileName;
|
|
@@ -1025,7 +1099,7 @@ var downloadPDF = function downloadPDF(pdfUrl) {
|
|
|
1025
1099
|
|
|
1026
1100
|
case 2:
|
|
1027
1101
|
blobValue = _context.sent;
|
|
1028
|
-
fileNameHeader = response.headers.get(
|
|
1102
|
+
fileNameHeader = response.headers.get('content-disposition') || '';
|
|
1029
1103
|
fileName = fileNameHeader.split('"')[1];
|
|
1030
1104
|
return _context.abrupt("return", {
|
|
1031
1105
|
blobValue: blobValue,
|
|
@@ -1046,7 +1120,11 @@ var downloadPDF = function downloadPDF(pdfUrl) {
|
|
|
1046
1120
|
}()).then(function (_ref2) {
|
|
1047
1121
|
var blobValue = _ref2.blobValue,
|
|
1048
1122
|
fileName = _ref2.fileName;
|
|
1049
|
-
|
|
1123
|
+
|
|
1124
|
+
if (!fileName) {
|
|
1125
|
+
throw Error('Something went wrong.');
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1050
1128
|
var file = new Blob([blobValue], {
|
|
1051
1129
|
type: 'application/pdf'
|
|
1052
1130
|
});
|
|
@@ -1057,21 +1135,27 @@ var downloadPDF = function downloadPDF(pdfUrl) {
|
|
|
1057
1135
|
document.body.appendChild(link);
|
|
1058
1136
|
link.click();
|
|
1059
1137
|
document.body.removeChild(link);
|
|
1138
|
+
})["catch"](function (error) {
|
|
1139
|
+
return error;
|
|
1060
1140
|
});
|
|
1061
1141
|
};
|
|
1062
1142
|
|
|
1063
|
-
var createCheckoutDataBodyWithDefaultHolder = function createCheckoutDataBodyWithDefaultHolder(ticketsQuantity, logedInValues, includeDob) {
|
|
1143
|
+
var createCheckoutDataBodyWithDefaultHolder = function createCheckoutDataBodyWithDefaultHolder(ticketsQuantity, logedInValues, includeDob, userCredentials) {
|
|
1064
1144
|
if (includeDob === void 0) {
|
|
1065
1145
|
includeDob = false;
|
|
1066
1146
|
}
|
|
1067
1147
|
|
|
1148
|
+
if (userCredentials === void 0) {
|
|
1149
|
+
userCredentials = {};
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1068
1152
|
var ticket_holders = [];
|
|
1069
|
-
var first_name = _get(logedInValues, 'firstName') || _get(logedInValues, 'first_name') || '';
|
|
1070
|
-
var last_name = _get(logedInValues, 'lastName', '') || _get(
|
|
1153
|
+
var first_name = _get(logedInValues, 'firstName') || _get(logedInValues, 'first_name') || _get(userCredentials, 'firstNameLogged') || '';
|
|
1154
|
+
var last_name = _get(logedInValues, 'lastName') || _get(logedInValues, 'last_name') || _get(userCredentials, 'lastNameLogged') || '';
|
|
1071
1155
|
|
|
1072
1156
|
var phone = _get(logedInValues, 'phone', '');
|
|
1073
1157
|
|
|
1074
|
-
var email = _get(logedInValues, 'email', '');
|
|
1158
|
+
var email = _get(logedInValues, 'email') || _get(userCredentials, 'emailLogged') || '';
|
|
1075
1159
|
|
|
1076
1160
|
for (var i = 0; i <= ticketsQuantity - 1; i++) {
|
|
1077
1161
|
var individualHolder = i ? {
|
|
@@ -1180,20 +1264,41 @@ publicRequest.interceptors.request.use(function (config) {
|
|
|
1180
1264
|
config.headers = _updatedHeaders;
|
|
1181
1265
|
}
|
|
1182
1266
|
|
|
1183
|
-
if (
|
|
1267
|
+
if (getCookieByName('X-TF-ECOMMERCE')) {
|
|
1184
1268
|
var _updatedHeaders2 = _extends({}, config.headers, {
|
|
1185
|
-
'X-
|
|
1269
|
+
'X-TF-ECOMMERCE': getCookieByName('X-TF-ECOMMERCE')
|
|
1186
1270
|
});
|
|
1187
1271
|
|
|
1188
1272
|
config.headers = _updatedHeaders2;
|
|
1189
1273
|
}
|
|
1190
1274
|
|
|
1275
|
+
if (CONFIGS.X_SOURCE_ORIGIN) {
|
|
1276
|
+
var _updatedHeaders3 = _extends({}, config.headers, {
|
|
1277
|
+
'X-Source-Origin': CONFIGS.X_SOURCE_ORIGIN
|
|
1278
|
+
});
|
|
1279
|
+
|
|
1280
|
+
config.headers = _updatedHeaders3;
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1191
1283
|
if (CONFIGS.BASE_URL) {
|
|
1192
1284
|
config.baseURL = CONFIGS.BASE_URL + '/api';
|
|
1193
1285
|
}
|
|
1194
1286
|
|
|
1195
1287
|
return config;
|
|
1196
1288
|
});
|
|
1289
|
+
publicRequest.interceptors.response.use(function (response) {
|
|
1290
|
+
var xtfCookie = _get(response, 'headers.x-tf-ecommerce');
|
|
1291
|
+
|
|
1292
|
+
var url = _get(response, 'config.url');
|
|
1293
|
+
|
|
1294
|
+
var method = _get(response, 'config.method');
|
|
1295
|
+
|
|
1296
|
+
if (xtfCookie && !(url === '/auth' && method === 'delete')) {
|
|
1297
|
+
setCustomCookie('X-TF-ECOMMERCE', xtfCookie);
|
|
1298
|
+
}
|
|
1299
|
+
|
|
1300
|
+
return response;
|
|
1301
|
+
});
|
|
1197
1302
|
|
|
1198
1303
|
publicRequest.setGuestToken = function (token) {
|
|
1199
1304
|
return publicRequest.defaults.headers.common['Authorization-Guest'] = token;
|
|
@@ -1272,14 +1377,11 @@ var postOnCheckout = function postOnCheckout(data, accessToken) {
|
|
|
1272
1377
|
return res;
|
|
1273
1378
|
};
|
|
1274
1379
|
var authorize = function authorize(data) {
|
|
1275
|
-
return publicRequest.post("
|
|
1380
|
+
return publicRequest.post("/auth?clientId=" + (CONFIGS.CLIENT_ID || 'e9d8f8922797b4621e562255afe90dbf'), data);
|
|
1276
1381
|
};
|
|
1277
1382
|
var register = function register(data) {
|
|
1278
1383
|
return publicRequest.post('v1/oauth/register-rn', data);
|
|
1279
1384
|
};
|
|
1280
|
-
var getAccessToken = function getAccessToken(data) {
|
|
1281
|
-
return publicRequest.post('v1/oauth/access_token', data);
|
|
1282
|
-
};
|
|
1283
1385
|
var getPaymentData = function getPaymentData(hash) {
|
|
1284
1386
|
var response = publicRequest.get("v1/order/" + hash + "/review/")["catch"](function (error) {
|
|
1285
1387
|
throw error;
|
|
@@ -1340,6 +1442,18 @@ var postReferralVisits = function postReferralVisits(eventId, referralId) {
|
|
|
1340
1442
|
referrer: "" + referralId
|
|
1341
1443
|
});
|
|
1342
1444
|
};
|
|
1445
|
+
var logout = function logout() {
|
|
1446
|
+
return publicRequest["delete"]('/auth');
|
|
1447
|
+
}; // forgot password
|
|
1448
|
+
|
|
1449
|
+
var forgotPassword = function forgotPassword(email) {
|
|
1450
|
+
return publicRequest.post("/auth/restore-password", {
|
|
1451
|
+
email: email
|
|
1452
|
+
});
|
|
1453
|
+
};
|
|
1454
|
+
var resetPassword = function resetPassword(data) {
|
|
1455
|
+
return publicRequest.post("/auth/reset-password", data);
|
|
1456
|
+
};
|
|
1343
1457
|
var processTicket = function processTicket(hash) {
|
|
1344
1458
|
return publicRequest.post("v1/ticket/" + hash + "/process/");
|
|
1345
1459
|
};
|
|
@@ -1349,6 +1463,32 @@ var declineInvitation = function declineInvitation(hash) {
|
|
|
1349
1463
|
var sendRSVPInfo = function sendRSVPInfo(eventId, data) {
|
|
1350
1464
|
return publicRequest.post("v1/event/" + eventId + "/send-rsvp-info", data);
|
|
1351
1465
|
};
|
|
1466
|
+
var validatePhoneNumber = /*#__PURE__*/function () {
|
|
1467
|
+
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(phone) {
|
|
1468
|
+
var response;
|
|
1469
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
1470
|
+
while (1) {
|
|
1471
|
+
switch (_context.prev = _context.next) {
|
|
1472
|
+
case 0:
|
|
1473
|
+
_context.next = 2;
|
|
1474
|
+
return publicRequest.get("/v1/account/validate_phone?phone=" + phone);
|
|
1475
|
+
|
|
1476
|
+
case 2:
|
|
1477
|
+
response = _context.sent;
|
|
1478
|
+
return _context.abrupt("return", response.data);
|
|
1479
|
+
|
|
1480
|
+
case 4:
|
|
1481
|
+
case "end":
|
|
1482
|
+
return _context.stop();
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
}, _callee);
|
|
1486
|
+
}));
|
|
1487
|
+
|
|
1488
|
+
return function validatePhoneNumber(_x) {
|
|
1489
|
+
return _ref.apply(this, arguments);
|
|
1490
|
+
};
|
|
1491
|
+
}();
|
|
1352
1492
|
|
|
1353
1493
|
var style = {
|
|
1354
1494
|
position: 'absolute',
|
|
@@ -1360,6 +1500,21 @@ var style = {
|
|
|
1360
1500
|
border: '1px solid white',
|
|
1361
1501
|
outline: 'none'
|
|
1362
1502
|
};
|
|
1503
|
+
var setLoggedUserData = function setLoggedUserData(data) {
|
|
1504
|
+
return {
|
|
1505
|
+
id: data.id,
|
|
1506
|
+
first_name: data.firstName,
|
|
1507
|
+
last_name: data.lastName,
|
|
1508
|
+
email: data.email,
|
|
1509
|
+
confirmEmail: data.email,
|
|
1510
|
+
city: (data == null ? void 0 : data.city) || '',
|
|
1511
|
+
country: (data == null ? void 0 : data.countryId) || (data == null ? void 0 : data.country) || '',
|
|
1512
|
+
phone: (data == null ? void 0 : data.phone) || '',
|
|
1513
|
+
street_address: (data == null ? void 0 : data.streetAddress) || '',
|
|
1514
|
+
state: (data == null ? void 0 : data.stateId) || '',
|
|
1515
|
+
zip: (data == null ? void 0 : data.zip) || (data == null ? void 0 : data.zipCode) || ''
|
|
1516
|
+
};
|
|
1517
|
+
};
|
|
1363
1518
|
var LoginModal = function LoginModal(_ref) {
|
|
1364
1519
|
var onClose = _ref.onClose,
|
|
1365
1520
|
onLogin = _ref.onLogin,
|
|
@@ -1367,27 +1522,26 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1367
1522
|
alreadyHasUser = _ref$alreadyHasUser === void 0 ? false : _ref$alreadyHasUser,
|
|
1368
1523
|
_ref$userExpired = _ref.userExpired,
|
|
1369
1524
|
userExpired = _ref$userExpired === void 0 ? false : _ref$userExpired,
|
|
1370
|
-
_ref$onAuthorizeSucce = _ref.onAuthorizeSuccess,
|
|
1371
|
-
onAuthorizeSuccess = _ref$onAuthorizeSucce === void 0 ? function () {} : _ref$onAuthorizeSucce,
|
|
1372
|
-
_ref$onAuthorizeError = _ref.onAuthorizeError,
|
|
1373
|
-
onAuthorizeError = _ref$onAuthorizeError === void 0 ? function () {} : _ref$onAuthorizeError,
|
|
1374
1525
|
_ref$onGetProfileData = _ref.onGetProfileDataSuccess,
|
|
1375
|
-
onGetProfileDataSuccess = _ref$onGetProfileData === void 0 ?
|
|
1526
|
+
onGetProfileDataSuccess = _ref$onGetProfileData === void 0 ? _identity : _ref$onGetProfileData,
|
|
1376
1527
|
_ref$onGetProfileData2 = _ref.onGetProfileDataError,
|
|
1377
|
-
onGetProfileDataError = _ref$onGetProfileData2 === void 0 ?
|
|
1528
|
+
onGetProfileDataError = _ref$onGetProfileData2 === void 0 ? _identity : _ref$onGetProfileData2,
|
|
1529
|
+
_ref$onForgotPassword = _ref.onForgotPassword,
|
|
1530
|
+
onForgotPassword = _ref$onForgotPassword === void 0 ? _identity : _ref$onForgotPassword,
|
|
1531
|
+
_ref$onSignup = _ref.onSignup,
|
|
1532
|
+
onSignup = _ref$onSignup === void 0 ? _identity : _ref$onSignup,
|
|
1378
1533
|
_ref$modalClassname = _ref.modalClassname,
|
|
1379
|
-
modalClassname = _ref$modalClassname === void 0 ? '' : _ref$modalClassname
|
|
1534
|
+
modalClassname = _ref$modalClassname === void 0 ? '' : _ref$modalClassname,
|
|
1535
|
+
logo = _ref.logo,
|
|
1536
|
+
_ref$showForgotPasswo = _ref.showForgotPasswordButton,
|
|
1537
|
+
showForgotPasswordButton = _ref$showForgotPasswo === void 0 ? false : _ref$showForgotPasswo,
|
|
1538
|
+
_ref$showSignUpButton = _ref.showSignUpButton,
|
|
1539
|
+
showSignUpButton = _ref$showSignUpButton === void 0 ? false : _ref$showSignUpButton;
|
|
1380
1540
|
|
|
1381
1541
|
var _useState = React.useState(''),
|
|
1382
1542
|
error = _useState[0],
|
|
1383
1543
|
setError = _useState[1];
|
|
1384
1544
|
|
|
1385
|
-
var handleForgotPassword = function handleForgotPassword() {
|
|
1386
|
-
if (typeof window !== 'undefined') {
|
|
1387
|
-
window.open(CONFIGS.BASE_URL + "/password-restore/");
|
|
1388
|
-
}
|
|
1389
|
-
};
|
|
1390
|
-
|
|
1391
1545
|
return React__default.createElement(Modal, {
|
|
1392
1546
|
open: true,
|
|
1393
1547
|
onClose: onClose,
|
|
@@ -1403,7 +1557,7 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1403
1557
|
},
|
|
1404
1558
|
onSubmit: function () {
|
|
1405
1559
|
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref2) {
|
|
1406
|
-
var email, password,
|
|
1560
|
+
var email, password, body, profileResponse, profileSpecifiedData, profileDataObj, event, _e$response, _e$response$data, _error;
|
|
1407
1561
|
|
|
1408
1562
|
return runtime_1.wrap(function _callee$(_context) {
|
|
1409
1563
|
while (1) {
|
|
@@ -1411,102 +1565,66 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1411
1565
|
case 0:
|
|
1412
1566
|
email = _ref2.email, password = _ref2.password;
|
|
1413
1567
|
_context.prev = 1;
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
case 7:
|
|
1421
|
-
resAutorize = _context.sent;
|
|
1422
|
-
bodyFormDataToken = new FormData();
|
|
1423
|
-
bodyFormDataToken.append('code', resAutorize.data.data.code);
|
|
1424
|
-
bodyFormDataToken.append('scope', 'profile');
|
|
1425
|
-
bodyFormDataToken.append('grant_type', 'authorization_code');
|
|
1426
|
-
bodyFormDataToken.append('client_id', CONFIGS.CLIENT_ID || 'e9d8f8922797b4621e562255afe90dbf');
|
|
1427
|
-
bodyFormDataToken.append('client_secret', CONFIGS.CLIENT_SECRET || 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9');
|
|
1428
|
-
resAccessToken = null;
|
|
1429
|
-
_context.prev = 15;
|
|
1430
|
-
_context.next = 18;
|
|
1431
|
-
return getAccessToken(bodyFormDataToken);
|
|
1432
|
-
|
|
1433
|
-
case 18:
|
|
1434
|
-
resAccessToken = _context.sent;
|
|
1435
|
-
onAuthorizeSuccess(resAccessToken.data);
|
|
1436
|
-
_context.next = 26;
|
|
1437
|
-
break;
|
|
1438
|
-
|
|
1439
|
-
case 22:
|
|
1440
|
-
_context.prev = 22;
|
|
1441
|
-
_context.t0 = _context["catch"](15);
|
|
1442
|
-
|
|
1443
|
-
if (axios.isAxiosError(_context.t0)) {
|
|
1444
|
-
onAuthorizeError(_context.t0);
|
|
1445
|
-
}
|
|
1446
|
-
|
|
1447
|
-
return _context.abrupt("return");
|
|
1568
|
+
body = {
|
|
1569
|
+
email: email,
|
|
1570
|
+
password: password
|
|
1571
|
+
};
|
|
1572
|
+
_context.next = 5;
|
|
1573
|
+
return authorize(body);
|
|
1448
1574
|
|
|
1449
|
-
case
|
|
1450
|
-
accessToken = _get(resAccessToken, 'data.access_token');
|
|
1451
|
-
handleSetAccessToken(accessToken);
|
|
1575
|
+
case 5:
|
|
1452
1576
|
profileResponse = null;
|
|
1453
|
-
_context.prev =
|
|
1454
|
-
_context.next =
|
|
1455
|
-
return getProfileData(
|
|
1577
|
+
_context.prev = 6;
|
|
1578
|
+
_context.next = 9;
|
|
1579
|
+
return getProfileData();
|
|
1456
1580
|
|
|
1457
|
-
case
|
|
1581
|
+
case 9:
|
|
1458
1582
|
profileResponse = _context.sent;
|
|
1459
1583
|
onGetProfileDataSuccess(profileResponse.data);
|
|
1460
|
-
_context.next =
|
|
1584
|
+
_context.next = 17;
|
|
1461
1585
|
break;
|
|
1462
1586
|
|
|
1463
|
-
case
|
|
1464
|
-
_context.prev =
|
|
1465
|
-
_context.
|
|
1587
|
+
case 13:
|
|
1588
|
+
_context.prev = 13;
|
|
1589
|
+
_context.t0 = _context["catch"](6);
|
|
1466
1590
|
|
|
1467
|
-
if (axios.isAxiosError(_context.
|
|
1468
|
-
onGetProfileDataError(_context.
|
|
1591
|
+
if (axios.isAxiosError(_context.t0)) {
|
|
1592
|
+
onGetProfileDataError(_context.t0);
|
|
1469
1593
|
}
|
|
1470
1594
|
|
|
1471
1595
|
return _context.abrupt("return");
|
|
1472
1596
|
|
|
1473
|
-
case
|
|
1597
|
+
case 17:
|
|
1474
1598
|
profileSpecifiedData = _get(profileResponse, 'data.data');
|
|
1475
|
-
profileDataObj =
|
|
1476
|
-
id: profileSpecifiedData.id,
|
|
1477
|
-
first_name: profileSpecifiedData.firstName,
|
|
1478
|
-
last_name: profileSpecifiedData.lastName,
|
|
1479
|
-
email: profileSpecifiedData.email
|
|
1480
|
-
};
|
|
1599
|
+
profileDataObj = setLoggedUserData(profileSpecifiedData);
|
|
1481
1600
|
|
|
1482
1601
|
if (typeof window !== 'undefined') {
|
|
1483
1602
|
window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
|
|
1484
|
-
window.localStorage.setItem('access_token', accessToken);
|
|
1485
1603
|
event = new window.CustomEvent('tf-login');
|
|
1486
1604
|
window.document.dispatchEvent(event);
|
|
1487
1605
|
}
|
|
1488
1606
|
|
|
1489
1607
|
onLogin();
|
|
1490
|
-
_context.next =
|
|
1608
|
+
_context.next = 26;
|
|
1491
1609
|
break;
|
|
1492
1610
|
|
|
1493
|
-
case
|
|
1494
|
-
_context.prev =
|
|
1495
|
-
_context.
|
|
1611
|
+
case 23:
|
|
1612
|
+
_context.prev = 23;
|
|
1613
|
+
_context.t1 = _context["catch"](1);
|
|
1496
1614
|
|
|
1497
|
-
if (axios.isAxiosError(_context.
|
|
1498
|
-
_error = (_context.
|
|
1615
|
+
if (axios.isAxiosError(_context.t1)) {
|
|
1616
|
+
_error = (_context.t1 == null ? void 0 : (_e$response = _context.t1.response) == null ? void 0 : (_e$response$data = _e$response.data) == null ? void 0 : _e$response$data.message) || 'Error';
|
|
1499
1617
|
setError(_error);
|
|
1500
|
-
} else if (_context.
|
|
1501
|
-
setError((_context.
|
|
1618
|
+
} else if (_context.t1 instanceof Error) {
|
|
1619
|
+
setError((_context.t1 == null ? void 0 : _context.t1.message) || 'Error');
|
|
1502
1620
|
}
|
|
1503
1621
|
|
|
1504
|
-
case
|
|
1622
|
+
case 26:
|
|
1505
1623
|
case "end":
|
|
1506
1624
|
return _context.stop();
|
|
1507
1625
|
}
|
|
1508
1626
|
}
|
|
1509
|
-
}, _callee, null, [[1,
|
|
1627
|
+
}, _callee, null, [[1, 23], [6, 13]]);
|
|
1510
1628
|
}));
|
|
1511
1629
|
|
|
1512
1630
|
function onSubmit(_x) {
|
|
@@ -1520,11 +1638,13 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1520
1638
|
onSubmit: props.handleSubmit
|
|
1521
1639
|
}, React__default.createElement("div", {
|
|
1522
1640
|
className: "modal-title"
|
|
1523
|
-
}, "Login"), React__default.createElement("
|
|
1641
|
+
}, "Login"), React__default.createElement("div", {
|
|
1642
|
+
className: 'login-logo-container'
|
|
1643
|
+
}, React__default.createElement("img", {
|
|
1524
1644
|
className: "login-logo-tff",
|
|
1525
|
-
src: "https://www.ticketfairy.com/resources/images/logo-ttf-black.svg",
|
|
1526
|
-
alt: ""
|
|
1527
|
-
}), React__default.createElement("div", {
|
|
1645
|
+
src: logo || "https://www.ticketfairy.com/resources/images/logo-ttf-black.svg",
|
|
1646
|
+
alt: "logo"
|
|
1647
|
+
})), React__default.createElement("div", {
|
|
1528
1648
|
className: "server_auth__error"
|
|
1529
1649
|
}, error), alreadyHasUser && React__default.createElement("p", {
|
|
1530
1650
|
className: "info-text-for-login"
|
|
@@ -1566,204 +1686,372 @@ var LoginModal = function LoginModal(_ref) {
|
|
|
1566
1686
|
className: "login-action-button"
|
|
1567
1687
|
}, React__default.createElement("button", {
|
|
1568
1688
|
type: "submit"
|
|
1569
|
-
}, "Login")), React__default.createElement("div", {
|
|
1570
|
-
className:
|
|
1689
|
+
}, "Login")), showForgotPasswordButton && React__default.createElement("div", {
|
|
1690
|
+
className: "forgot-password"
|
|
1571
1691
|
}, React__default.createElement("span", {
|
|
1572
|
-
|
|
1573
|
-
|
|
1692
|
+
"aria-hidden": "true",
|
|
1693
|
+
onClick: onForgotPassword
|
|
1694
|
+
}, "Forgot password?")), showSignUpButton && React__default.createElement("div", {
|
|
1695
|
+
className: "forgot-password"
|
|
1696
|
+
}, React__default.createElement("span", {
|
|
1697
|
+
"aria-hidden": "true",
|
|
1698
|
+
onClick: onSignup
|
|
1699
|
+
}, "Sign up"))));
|
|
1574
1700
|
}))));
|
|
1575
1701
|
};
|
|
1576
1702
|
|
|
1577
|
-
var
|
|
1578
|
-
var
|
|
1579
|
-
_ref$
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1703
|
+
var CustomField = function CustomField(_ref) {
|
|
1704
|
+
var label = _ref.label,
|
|
1705
|
+
_ref$type = _ref.type,
|
|
1706
|
+
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
1707
|
+
field = _ref.field,
|
|
1708
|
+
_ref$selectOptions = _ref.selectOptions,
|
|
1709
|
+
selectOptions = _ref$selectOptions === void 0 ? [] : _ref$selectOptions,
|
|
1710
|
+
_ref$form = _ref.form,
|
|
1711
|
+
touched = _ref$form.touched,
|
|
1712
|
+
errors = _ref$form.errors,
|
|
1713
|
+
submitCount = _ref$form.submitCount,
|
|
1714
|
+
theme = _ref.theme,
|
|
1715
|
+
_ref$inputProps = _ref.inputProps,
|
|
1716
|
+
pInputProps = _ref$inputProps === void 0 ? {} : _ref$inputProps,
|
|
1717
|
+
_ref$InputProps = _ref.InputProps,
|
|
1718
|
+
InputProps = _ref$InputProps === void 0 ? {} : _ref$InputProps,
|
|
1719
|
+
inputRef = _ref.inputRef;
|
|
1720
|
+
var isSelectField = type === 'select';
|
|
1721
|
+
|
|
1722
|
+
var error = _get(errors, field.name);
|
|
1723
|
+
|
|
1724
|
+
var isTouched = Boolean(_get(touched, field.name)) || _includes(field.name, 'holder') && !!error && !!submitCount;
|
|
1725
|
+
var customTheme = styles.useTheme();
|
|
1726
|
+
var inputProps = {
|
|
1727
|
+
sx: customTheme == null ? void 0 : customTheme.input
|
|
1728
|
+
};
|
|
1729
|
+
return React__default.createElement(TextField, Object.assign({
|
|
1730
|
+
id: field.name,
|
|
1731
|
+
label: label,
|
|
1732
|
+
type: type,
|
|
1733
|
+
select: isSelectField,
|
|
1734
|
+
fullWidth: true,
|
|
1735
|
+
error: !!error && isTouched,
|
|
1736
|
+
helperText: isTouched && error,
|
|
1737
|
+
SelectProps: {
|
|
1738
|
+
"native": true,
|
|
1739
|
+
className: theme,
|
|
1740
|
+
MenuProps: {
|
|
1741
|
+
className: theme
|
|
1742
|
+
}
|
|
1603
1743
|
},
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
bodyFormData.append('client_id', CONFIGS.CLIENT_ID || 'e9d8f8922797b4621e562255afe90dbf');
|
|
1619
|
-
bodyFormData.append('client_secret', CONFIGS.CLIENT_SECRET || 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9');
|
|
1620
|
-
_context.next = 11;
|
|
1621
|
-
return register(bodyFormData);
|
|
1744
|
+
InputLabelProps: {
|
|
1745
|
+
sx: customTheme == null ? void 0 : customTheme.input
|
|
1746
|
+
},
|
|
1747
|
+
InputProps: InputProps,
|
|
1748
|
+
inputProps: _extends({}, inputProps, pInputProps),
|
|
1749
|
+
inputRef: inputRef
|
|
1750
|
+
}, field), isSelectField ? _map(selectOptions, function (option) {
|
|
1751
|
+
return React__default.createElement("option", {
|
|
1752
|
+
key: option.value,
|
|
1753
|
+
value: option.value,
|
|
1754
|
+
disabled: option.disabled
|
|
1755
|
+
}, option.label);
|
|
1756
|
+
}) : null);
|
|
1757
|
+
};
|
|
1622
1758
|
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1759
|
+
var style$1 = {
|
|
1760
|
+
position: 'absolute',
|
|
1761
|
+
top: '50%',
|
|
1762
|
+
left: '50%',
|
|
1763
|
+
transform: 'translate(-50%, -50%)',
|
|
1764
|
+
minWidth: 480,
|
|
1765
|
+
backgroundColor: '#fff',
|
|
1766
|
+
border: '1px solid white',
|
|
1767
|
+
outline: 'none',
|
|
1768
|
+
padding: '14px'
|
|
1769
|
+
};
|
|
1770
|
+
var SignupSchema = /*#__PURE__*/Yup.object().shape({
|
|
1771
|
+
firstName: /*#__PURE__*/Yup.string().required('Required'),
|
|
1772
|
+
lastName: /*#__PURE__*/Yup.string().required('Required'),
|
|
1773
|
+
email: /*#__PURE__*/Yup.string().email('Invalid email').required('Required'),
|
|
1774
|
+
password: /*#__PURE__*/Yup.string().min(6, 'Password must have 5+ characters').required('Required'),
|
|
1775
|
+
confirmPassword: /*#__PURE__*/Yup.string().required('Required').oneOf([/*#__PURE__*/Yup.ref('password'), null], 'Passwords must match')
|
|
1776
|
+
});
|
|
1777
|
+
var SignupModal = function SignupModal(_ref) {
|
|
1778
|
+
var _ref$onClose = _ref.onClose,
|
|
1779
|
+
onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
|
|
1780
|
+
_ref$onLogin = _ref.onLogin,
|
|
1781
|
+
onLogin = _ref$onLogin === void 0 ? function () {} : _ref$onLogin,
|
|
1782
|
+
_ref$onRegisterSucces = _ref.onRegisterSuccess,
|
|
1783
|
+
onRegisterSuccess = _ref$onRegisterSucces === void 0 ? function () {} : _ref$onRegisterSucces,
|
|
1784
|
+
_ref$onRegisterError = _ref.onRegisterError,
|
|
1785
|
+
onRegisterError = _ref$onRegisterError === void 0 ? function () {} : _ref$onRegisterError;
|
|
1631
1786
|
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
_context.next = 26;
|
|
1636
|
-
break;
|
|
1787
|
+
var _useState = React.useState(false),
|
|
1788
|
+
loading = _useState[0],
|
|
1789
|
+
setLoading = _useState[1];
|
|
1637
1790
|
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1791
|
+
var onSignup = /*#__PURE__*/function () {
|
|
1792
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(values) {
|
|
1793
|
+
var formData, res, access_token_register, refreshToken, tokens;
|
|
1794
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
1795
|
+
while (1) {
|
|
1796
|
+
switch (_context.prev = _context.next) {
|
|
1797
|
+
case 0:
|
|
1798
|
+
_context.prev = 0;
|
|
1799
|
+
setLoading(true);
|
|
1800
|
+
formData = new FormData();
|
|
1801
|
+
formData.set('first_name', values.firstName);
|
|
1802
|
+
formData.set('last_name', values.lastName);
|
|
1803
|
+
formData.set('email', values.email);
|
|
1804
|
+
formData.set('password', values.password);
|
|
1805
|
+
formData.set('password_confirmation', values.confirmPassword);
|
|
1806
|
+
formData.append('client_id', CONFIGS.CLIENT_ID || 'e9d8f8922797b4621e562255afe90dbf');
|
|
1807
|
+
formData.append('client_secret', CONFIGS.CLIENT_SECRET || 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9');
|
|
1808
|
+
_context.next = 12;
|
|
1809
|
+
return register(formData);
|
|
1643
1810
|
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1811
|
+
case 12:
|
|
1812
|
+
res = _context.sent;
|
|
1813
|
+
access_token_register = _get(res, 'data.data.attributes.access_token');
|
|
1814
|
+
refreshToken = _get(res, 'data.data.attributes.refresh_token');
|
|
1815
|
+
handleSetAccessToken(access_token_register);
|
|
1816
|
+
tokens = {
|
|
1817
|
+
accessToken: access_token_register,
|
|
1818
|
+
refreshToken: refreshToken
|
|
1819
|
+
};
|
|
1820
|
+
onRegisterSuccess(tokens);
|
|
1821
|
+
onClose();
|
|
1822
|
+
_context.next = 24;
|
|
1823
|
+
break;
|
|
1652
1824
|
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
}
|
|
1825
|
+
case 21:
|
|
1826
|
+
_context.prev = 21;
|
|
1827
|
+
_context.t0 = _context["catch"](0);
|
|
1657
1828
|
|
|
1658
|
-
|
|
1829
|
+
if (axios.isAxiosError(_context.t0)) {
|
|
1830
|
+
onRegisterError(_context.t0, values.email);
|
|
1831
|
+
}
|
|
1659
1832
|
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
}
|
|
1665
|
-
}, _callee, null, [[15, 22]]);
|
|
1666
|
-
}));
|
|
1833
|
+
case 24:
|
|
1834
|
+
_context.prev = 24;
|
|
1835
|
+
setLoading(false);
|
|
1836
|
+
return _context.finish(24);
|
|
1667
1837
|
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1838
|
+
case 27:
|
|
1839
|
+
case "end":
|
|
1840
|
+
return _context.stop();
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
}, _callee, null, [[0, 21, 24, 27]]);
|
|
1844
|
+
}));
|
|
1671
1845
|
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1846
|
+
return function onSignup(_x) {
|
|
1847
|
+
return _ref2.apply(this, arguments);
|
|
1848
|
+
};
|
|
1849
|
+
}();
|
|
1850
|
+
|
|
1851
|
+
var _onClose = loading ? function () {} : onClose;
|
|
1852
|
+
|
|
1853
|
+
return React__default.createElement(material.Modal, {
|
|
1854
|
+
open: true,
|
|
1855
|
+
onClose: _onClose,
|
|
1856
|
+
"aria-labelledby": "modal-modal-title",
|
|
1857
|
+
"aria-describedby": "modal-modal-description",
|
|
1858
|
+
className: "signup-modal"
|
|
1859
|
+
}, React__default.createElement(material.Box, {
|
|
1860
|
+
style: style$1
|
|
1861
|
+
}, React__default.createElement("div", null, React__default.createElement(formik.Formik, {
|
|
1862
|
+
initialValues: {
|
|
1863
|
+
firstName: '',
|
|
1864
|
+
lastName: '',
|
|
1865
|
+
email: '',
|
|
1866
|
+
password: '',
|
|
1867
|
+
confirmPassword: ''
|
|
1868
|
+
},
|
|
1869
|
+
validationSchema: SignupSchema,
|
|
1870
|
+
onSubmit: onSignup
|
|
1871
|
+
}, function (_ref3) {
|
|
1872
|
+
var isValid = _ref3.isValid,
|
|
1873
|
+
dirty = _ref3.dirty,
|
|
1874
|
+
handleSubmit = _ref3.handleSubmit;
|
|
1675
1875
|
return React__default.createElement(formik.Form, {
|
|
1676
|
-
onSubmit:
|
|
1876
|
+
onSubmit: handleSubmit
|
|
1677
1877
|
}, React__default.createElement("div", {
|
|
1678
|
-
className: "
|
|
1679
|
-
}, React__default.createElement("div",
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
className: "register-container__twoFields"
|
|
1878
|
+
className: "signup-container"
|
|
1879
|
+
}, React__default.createElement("div", {
|
|
1880
|
+
className: "title"
|
|
1881
|
+
}, "Create an Account"), React__default.createElement("div", {
|
|
1882
|
+
className: "signup-container__twoFields"
|
|
1684
1883
|
}, React__default.createElement("div", {
|
|
1685
1884
|
className: "is-half"
|
|
1686
1885
|
}, React__default.createElement(formik.Field, {
|
|
1687
|
-
name:
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
var field = _ref3.field,
|
|
1691
|
-
meta = _ref3.meta;
|
|
1692
|
-
return React__default.createElement(material.TextField, Object.assign({
|
|
1693
|
-
label: 'First Name',
|
|
1694
|
-
type: 'text',
|
|
1695
|
-
fullWidth: true,
|
|
1696
|
-
error: !!meta.error && meta.touched,
|
|
1697
|
-
helperText: meta.touched && meta.error
|
|
1698
|
-
}, field));
|
|
1886
|
+
name: "firstName",
|
|
1887
|
+
label: "First Name",
|
|
1888
|
+
component: CustomField
|
|
1699
1889
|
})), React__default.createElement("div", {
|
|
1700
1890
|
className: "is-half"
|
|
1701
1891
|
}, React__default.createElement(formik.Field, {
|
|
1702
|
-
name:
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
var field = _ref4.field,
|
|
1706
|
-
meta = _ref4.meta;
|
|
1707
|
-
return React__default.createElement(material.TextField, Object.assign({
|
|
1708
|
-
label: 'Last Name',
|
|
1709
|
-
type: 'text',
|
|
1710
|
-
fullWidth: true,
|
|
1711
|
-
error: !!meta.error && meta.touched,
|
|
1712
|
-
helperText: meta.touched && meta.error
|
|
1713
|
-
}, field));
|
|
1892
|
+
name: "lastName",
|
|
1893
|
+
label: "Last Name",
|
|
1894
|
+
component: CustomField
|
|
1714
1895
|
}))), React__default.createElement("div", {
|
|
1715
|
-
className: "
|
|
1896
|
+
className: "signup-container__singleField"
|
|
1716
1897
|
}, React__default.createElement("div", {
|
|
1717
1898
|
className: ""
|
|
1718
1899
|
}, React__default.createElement(formik.Field, {
|
|
1719
|
-
name:
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
var field = _ref5.field,
|
|
1723
|
-
meta = _ref5.meta;
|
|
1724
|
-
return React__default.createElement(material.TextField, Object.assign({
|
|
1725
|
-
label: 'Email',
|
|
1726
|
-
type: 'email',
|
|
1727
|
-
fullWidth: true,
|
|
1728
|
-
error: !!meta.error && meta.touched,
|
|
1729
|
-
helperText: meta.touched && meta.error
|
|
1730
|
-
}, field));
|
|
1900
|
+
name: "email",
|
|
1901
|
+
label: "Email",
|
|
1902
|
+
component: CustomField
|
|
1731
1903
|
}))), React__default.createElement("div", {
|
|
1732
|
-
className: "
|
|
1904
|
+
className: "signup-container__twoFields"
|
|
1733
1905
|
}, React__default.createElement("div", {
|
|
1734
1906
|
className: "is-half"
|
|
1735
1907
|
}, React__default.createElement(formik.Field, {
|
|
1736
|
-
name:
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
meta = _ref6.meta;
|
|
1741
|
-
return React__default.createElement(material.TextField, Object.assign({
|
|
1742
|
-
label: 'Password',
|
|
1743
|
-
type: 'password',
|
|
1744
|
-
fullWidth: true,
|
|
1745
|
-
error: !!meta.error && meta.touched,
|
|
1746
|
-
helperText: meta.touched && meta.error
|
|
1747
|
-
}, field));
|
|
1908
|
+
name: "password",
|
|
1909
|
+
label: "Password",
|
|
1910
|
+
type: "password",
|
|
1911
|
+
component: CustomField
|
|
1748
1912
|
})), React__default.createElement("div", {
|
|
1749
1913
|
className: "is-half"
|
|
1750
1914
|
}, React__default.createElement(formik.Field, {
|
|
1751
|
-
name:
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1915
|
+
name: "confirmPassword",
|
|
1916
|
+
label: "Confirm Password",
|
|
1917
|
+
type: "password",
|
|
1918
|
+
component: CustomField
|
|
1919
|
+
})))), React__default.createElement("div", {
|
|
1920
|
+
className: "signup-action-button"
|
|
1921
|
+
}, React__default.createElement("button", {
|
|
1922
|
+
type: "submit",
|
|
1923
|
+
disabled: !(isValid && dirty)
|
|
1924
|
+
}, loading ? React__default.createElement(material.CircularProgress, {
|
|
1925
|
+
size: "22px"
|
|
1926
|
+
}) : 'Submit')), React__default.createElement("div", {
|
|
1927
|
+
className: "login"
|
|
1928
|
+
}, React__default.createElement("span", {
|
|
1929
|
+
onClick: onLogin
|
|
1930
|
+
}, "Login")));
|
|
1931
|
+
}))));
|
|
1932
|
+
};
|
|
1933
|
+
|
|
1934
|
+
var style$2 = {
|
|
1935
|
+
position: 'absolute',
|
|
1936
|
+
top: '50%',
|
|
1937
|
+
left: '50%',
|
|
1938
|
+
transform: 'translate(-50%, -50%)',
|
|
1939
|
+
minWidth: 480,
|
|
1940
|
+
backgroundColor: '#fff',
|
|
1941
|
+
border: '1px solid white',
|
|
1942
|
+
outline: 'none',
|
|
1943
|
+
padding: '14px'
|
|
1944
|
+
};
|
|
1945
|
+
var Schema = /*#__PURE__*/Yup.object().shape({
|
|
1946
|
+
email: /*#__PURE__*/Yup.string().email('Invalid email').required('Required')
|
|
1947
|
+
});
|
|
1948
|
+
var ForgotPasswordModal = function ForgotPasswordModal(_ref) {
|
|
1949
|
+
var _ref$onClose = _ref.onClose,
|
|
1950
|
+
onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
|
|
1951
|
+
_ref$onLogin = _ref.onLogin,
|
|
1952
|
+
onLogin = _ref$onLogin === void 0 ? function () {} : _ref$onLogin,
|
|
1953
|
+
_ref$onForgotPassword = _ref.onForgotPasswordSuccess,
|
|
1954
|
+
onForgotPasswordSuccess = _ref$onForgotPassword === void 0 ? function () {} : _ref$onForgotPassword,
|
|
1955
|
+
_ref$onForgotPassword2 = _ref.onForgotPasswordError,
|
|
1956
|
+
onForgotPasswordError = _ref$onForgotPassword2 === void 0 ? function () {} : _ref$onForgotPassword2;
|
|
1957
|
+
|
|
1958
|
+
var _useState = React.useState(false),
|
|
1959
|
+
loading = _useState[0],
|
|
1960
|
+
setLoading = _useState[1];
|
|
1961
|
+
|
|
1962
|
+
var onForgotPassword = /*#__PURE__*/function () {
|
|
1963
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref2) {
|
|
1964
|
+
var email, _yield$forgotPassword, data;
|
|
1965
|
+
|
|
1966
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
1967
|
+
while (1) {
|
|
1968
|
+
switch (_context.prev = _context.next) {
|
|
1969
|
+
case 0:
|
|
1970
|
+
email = _ref2.email;
|
|
1971
|
+
_context.prev = 1;
|
|
1972
|
+
setLoading(true);
|
|
1973
|
+
_context.next = 5;
|
|
1974
|
+
return forgotPassword(email);
|
|
1975
|
+
|
|
1976
|
+
case 5:
|
|
1977
|
+
_yield$forgotPassword = _context.sent;
|
|
1978
|
+
data = _yield$forgotPassword.data;
|
|
1979
|
+
onForgotPasswordSuccess(data);
|
|
1980
|
+
onClose();
|
|
1981
|
+
_context.next = 14;
|
|
1982
|
+
break;
|
|
1983
|
+
|
|
1984
|
+
case 11:
|
|
1985
|
+
_context.prev = 11;
|
|
1986
|
+
_context.t0 = _context["catch"](1);
|
|
1987
|
+
|
|
1988
|
+
if (axios.isAxiosError(_context.t0)) {
|
|
1989
|
+
onForgotPasswordError(_context.t0);
|
|
1990
|
+
}
|
|
1991
|
+
|
|
1992
|
+
case 14:
|
|
1993
|
+
_context.prev = 14;
|
|
1994
|
+
setLoading(false);
|
|
1995
|
+
return _context.finish(14);
|
|
1996
|
+
|
|
1997
|
+
case 17:
|
|
1998
|
+
case "end":
|
|
1999
|
+
return _context.stop();
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
}, _callee, null, [[1, 11, 14, 17]]);
|
|
2003
|
+
}));
|
|
2004
|
+
|
|
2005
|
+
return function onForgotPassword(_x) {
|
|
2006
|
+
return _ref3.apply(this, arguments);
|
|
2007
|
+
};
|
|
2008
|
+
}();
|
|
2009
|
+
|
|
2010
|
+
var _onClose = loading ? function () {} : onClose;
|
|
2011
|
+
|
|
2012
|
+
return React__default.createElement(material.Modal, {
|
|
2013
|
+
open: true,
|
|
2014
|
+
onClose: _onClose,
|
|
2015
|
+
"aria-labelledby": "modal-modal-title",
|
|
2016
|
+
"aria-describedby": "modal-modal-description",
|
|
2017
|
+
className: "forgot-password-modal"
|
|
2018
|
+
}, React__default.createElement(material.Box, {
|
|
2019
|
+
style: style$2
|
|
2020
|
+
}, React__default.createElement("div", null, React__default.createElement(formik.Formik, {
|
|
2021
|
+
initialValues: {
|
|
2022
|
+
email: ''
|
|
2023
|
+
},
|
|
2024
|
+
validationSchema: Schema,
|
|
2025
|
+
onSubmit: onForgotPassword
|
|
2026
|
+
}, function (_ref4) {
|
|
2027
|
+
var isValid = _ref4.isValid,
|
|
2028
|
+
dirty = _ref4.dirty,
|
|
2029
|
+
handleSubmit = _ref4.handleSubmit;
|
|
2030
|
+
return React__default.createElement(formik.Form, {
|
|
2031
|
+
onSubmit: handleSubmit
|
|
2032
|
+
}, React__default.createElement("div", {
|
|
2033
|
+
className: "forgot-password-container"
|
|
2034
|
+
}, React__default.createElement("div", {
|
|
2035
|
+
className: "title"
|
|
2036
|
+
}, "Password Reset"), React__default.createElement("div", {
|
|
2037
|
+
className: "forgot-password-container__singleField"
|
|
2038
|
+
}, React__default.createElement(formik.Field, {
|
|
2039
|
+
name: "email",
|
|
2040
|
+
label: "Email",
|
|
2041
|
+
component: CustomField
|
|
2042
|
+
}))), React__default.createElement("div", {
|
|
2043
|
+
className: "forgot-password-action-button"
|
|
2044
|
+
}, React__default.createElement("button", {
|
|
2045
|
+
type: "submit",
|
|
2046
|
+
disabled: !(isValid && dirty)
|
|
2047
|
+
}, loading ? React__default.createElement(material.CircularProgress, {
|
|
2048
|
+
size: "22px"
|
|
2049
|
+
}) : 'Submit')), React__default.createElement("div", {
|
|
2050
|
+
className: "login"
|
|
2051
|
+
}, React__default.createElement("span", {
|
|
2052
|
+
onClick: onLogin
|
|
2053
|
+
}, "Back to Log In")));
|
|
2054
|
+
}))));
|
|
1767
2055
|
};
|
|
1768
2056
|
|
|
1769
2057
|
var _excluded = ["firstName", "lastName", "holderAge", "confirmEmail", "confirmPassword"];
|
|
@@ -1824,7 +2112,7 @@ var createRegisterFormData = function createRegisterFormData(values, checkoutBod
|
|
|
1824
2112
|
|
|
1825
2113
|
return bodyFormData;
|
|
1826
2114
|
};
|
|
1827
|
-
var setLoggedUserData = function setLoggedUserData(data) {
|
|
2115
|
+
var setLoggedUserData$1 = function setLoggedUserData(data) {
|
|
1828
2116
|
return {
|
|
1829
2117
|
id: data.id,
|
|
1830
2118
|
first_name: data.firstName,
|
|
@@ -1878,10 +2166,10 @@ var createCheckoutDataBody = function createCheckoutDataBody(ticketsQuantity, va
|
|
|
1878
2166
|
});
|
|
1879
2167
|
ticket_holders = filteredHolders.map(function (item, index) {
|
|
1880
2168
|
return {
|
|
1881
|
-
first_name: item["holderFirstName-" + index] || '',
|
|
1882
|
-
last_name: item["holderLastName-" + index] || '',
|
|
2169
|
+
first_name: !index ? item["holderFirstName-" + index] || logedInValues.firstNameLogged || '' : item["holderFirstName-" + index] || '',
|
|
2170
|
+
last_name: !index ? item["holderLastName-" + index] || logedInValues.lastNameLogged || '' : item["holderLastName-" + index] || '',
|
|
1883
2171
|
phone: item["holderPhone-" + index] || '',
|
|
1884
|
-
email: item["holderEmail-" + index] || ''
|
|
2172
|
+
email: !index ? item["holderEmail-" + index] || logedInValues.emailLogged || '' : item["holderEmail-" + index] || ''
|
|
1885
2173
|
};
|
|
1886
2174
|
});
|
|
1887
2175
|
var filteredRestValue = {};
|
|
@@ -1932,6 +2220,14 @@ var getValidateFunctions = function getValidateFunctions(element, states, values
|
|
|
1932
2220
|
validationFunctions.push(isSameEmail);
|
|
1933
2221
|
}
|
|
1934
2222
|
|
|
2223
|
+
if (element.name === 'confirmPassword') {
|
|
2224
|
+
var isSame = function isSame(confirmPassword) {
|
|
2225
|
+
return values.password !== confirmPassword ? 'Password confirmation does not match' : null;
|
|
2226
|
+
};
|
|
2227
|
+
|
|
2228
|
+
validationFunctions.push(isSame);
|
|
2229
|
+
}
|
|
2230
|
+
|
|
1935
2231
|
return combineValidators.apply(void 0, validationFunctions);
|
|
1936
2232
|
};
|
|
1937
2233
|
var assingUniqueIds = function assingUniqueIds(data) {
|
|
@@ -1972,62 +2268,6 @@ var CheckboxField = function CheckboxField(_ref) {
|
|
|
1972
2268
|
})), !!(rest != null && (_rest$form2 = rest.form) != null && _rest$form2.errors && rest.form.errors[(_field$name2 = field == null ? void 0 : field.name) != null ? _field$name2 : ""]) ? React__default.createElement(material.FormHelperText, null, "Required") : null);
|
|
1973
2269
|
};
|
|
1974
2270
|
|
|
1975
|
-
var CustomField = function CustomField(_ref) {
|
|
1976
|
-
var label = _ref.label,
|
|
1977
|
-
_ref$type = _ref.type,
|
|
1978
|
-
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
1979
|
-
field = _ref.field,
|
|
1980
|
-
_ref$selectOptions = _ref.selectOptions,
|
|
1981
|
-
selectOptions = _ref$selectOptions === void 0 ? [] : _ref$selectOptions,
|
|
1982
|
-
_ref$form = _ref.form,
|
|
1983
|
-
touched = _ref$form.touched,
|
|
1984
|
-
errors = _ref$form.errors,
|
|
1985
|
-
submitCount = _ref$form.submitCount,
|
|
1986
|
-
theme = _ref.theme,
|
|
1987
|
-
_ref$inputProps = _ref.inputProps,
|
|
1988
|
-
pInputProps = _ref$inputProps === void 0 ? {} : _ref$inputProps,
|
|
1989
|
-
_ref$InputProps = _ref.InputProps,
|
|
1990
|
-
InputProps = _ref$InputProps === void 0 ? {} : _ref$InputProps,
|
|
1991
|
-
inputRef = _ref.inputRef;
|
|
1992
|
-
var isSelectField = type === 'select';
|
|
1993
|
-
|
|
1994
|
-
var error = _get(errors, field.name);
|
|
1995
|
-
|
|
1996
|
-
var isTouched = Boolean(_get(touched, field.name)) || _includes(field.name, 'holder') && !!error && !!submitCount;
|
|
1997
|
-
var customTheme = styles.useTheme();
|
|
1998
|
-
var inputProps = {
|
|
1999
|
-
sx: customTheme == null ? void 0 : customTheme.input
|
|
2000
|
-
};
|
|
2001
|
-
return React__default.createElement(TextField, Object.assign({
|
|
2002
|
-
id: field.name,
|
|
2003
|
-
label: label,
|
|
2004
|
-
type: type,
|
|
2005
|
-
select: isSelectField,
|
|
2006
|
-
fullWidth: true,
|
|
2007
|
-
error: !!error && isTouched,
|
|
2008
|
-
helperText: isTouched && error,
|
|
2009
|
-
SelectProps: {
|
|
2010
|
-
"native": true,
|
|
2011
|
-
className: theme,
|
|
2012
|
-
MenuProps: {
|
|
2013
|
-
className: theme
|
|
2014
|
-
}
|
|
2015
|
-
},
|
|
2016
|
-
InputLabelProps: {
|
|
2017
|
-
sx: customTheme == null ? void 0 : customTheme.input
|
|
2018
|
-
},
|
|
2019
|
-
InputProps: InputProps,
|
|
2020
|
-
inputProps: _extends({}, inputProps, pInputProps),
|
|
2021
|
-
inputRef: inputRef
|
|
2022
|
-
}, field), isSelectField ? _map(selectOptions, function (option) {
|
|
2023
|
-
return React__default.createElement("option", {
|
|
2024
|
-
key: option.value,
|
|
2025
|
-
value: option.value,
|
|
2026
|
-
disabled: option.disabled
|
|
2027
|
-
}, option.label);
|
|
2028
|
-
}) : null);
|
|
2029
|
-
};
|
|
2030
|
-
|
|
2031
2271
|
var currencyNormalizerCreator = function currencyNormalizerCreator(value, currency) {
|
|
2032
2272
|
return !value ? '' : "" + getCurrencySymbolByCurrency(currency) + value;
|
|
2033
2273
|
};
|
|
@@ -2094,50 +2334,80 @@ var getCurrencySymbolByCurrency = function getCurrencySymbolByCurrency(currency)
|
|
|
2094
2334
|
return 'US$';
|
|
2095
2335
|
}
|
|
2096
2336
|
};
|
|
2097
|
-
var removePlusSign = function removePlusSign(string) {
|
|
2098
|
-
if (string === void 0) {
|
|
2099
|
-
string = '';
|
|
2100
|
-
}
|
|
2101
|
-
|
|
2102
|
-
return string.replace('+', '');
|
|
2103
|
-
};
|
|
2104
2337
|
|
|
2105
|
-
var
|
|
2106
|
-
var FormikPhoneNumberField = function FormikPhoneNumberField(_ref) {
|
|
2338
|
+
var PhoneNumberField = function PhoneNumberField(_ref) {
|
|
2107
2339
|
var label = _ref.label,
|
|
2340
|
+
_ref$type = _ref.type,
|
|
2341
|
+
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
2108
2342
|
field = _ref.field,
|
|
2109
2343
|
_ref$form = _ref.form,
|
|
2110
|
-
touched = _ref$form.touched,
|
|
2111
2344
|
errors = _ref$form.errors,
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
2345
|
+
setFieldError = _ref$form.setFieldError,
|
|
2346
|
+
setStatus = _ref$form.setStatus;
|
|
2115
2347
|
|
|
2116
|
-
var error = _get(errors, field.name);
|
|
2348
|
+
var error = _get(errors, field.name); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2117
2349
|
|
|
2118
|
-
|
|
2119
|
-
var
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2350
|
+
|
|
2351
|
+
var debounceCb = React.useCallback(_debounce(function (cb) {
|
|
2352
|
+
return void cb();
|
|
2353
|
+
}, 1000), []);
|
|
2354
|
+
React.useEffect(function () {
|
|
2355
|
+
if (field.value) {
|
|
2356
|
+
var _setStatus;
|
|
2357
|
+
|
|
2358
|
+
setStatus((_setStatus = {}, _setStatus[field.name] = true, _setStatus));
|
|
2359
|
+
}
|
|
2360
|
+
|
|
2361
|
+
debounceCb( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
2362
|
+
var message, _setStatus2;
|
|
2363
|
+
|
|
2364
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
2365
|
+
while (1) {
|
|
2366
|
+
switch (_context.prev = _context.next) {
|
|
2367
|
+
case 0:
|
|
2368
|
+
_context.prev = 0;
|
|
2369
|
+
|
|
2370
|
+
if (!field.value) {
|
|
2371
|
+
_context.next = 4;
|
|
2372
|
+
break;
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
_context.next = 4;
|
|
2376
|
+
return validatePhoneNumber(field.value);
|
|
2377
|
+
|
|
2378
|
+
case 4:
|
|
2379
|
+
setFieldError(field.name, '');
|
|
2380
|
+
_context.next = 11;
|
|
2381
|
+
break;
|
|
2382
|
+
|
|
2383
|
+
case 7:
|
|
2384
|
+
_context.prev = 7;
|
|
2385
|
+
_context.t0 = _context["catch"](0);
|
|
2386
|
+
message = _get(_context.t0, 'response.data.message', 'Invalid phone number');
|
|
2387
|
+
setFieldError(field.name, message);
|
|
2388
|
+
|
|
2389
|
+
case 11:
|
|
2390
|
+
_context.prev = 11;
|
|
2391
|
+
setStatus((_setStatus2 = {}, _setStatus2[field.name] = false, _setStatus2));
|
|
2392
|
+
return _context.finish(11);
|
|
2393
|
+
|
|
2394
|
+
case 14:
|
|
2395
|
+
case "end":
|
|
2396
|
+
return _context.stop();
|
|
2397
|
+
}
|
|
2398
|
+
}
|
|
2399
|
+
}, _callee, null, [[0, 7, 11, 14]]);
|
|
2400
|
+
}))); // eslint-disable-next-line
|
|
2401
|
+
}, [field.value]);
|
|
2402
|
+
return React__default.createElement(TextField, Object.assign({}, field, {
|
|
2403
|
+
id: field.name,
|
|
2129
2404
|
label: label,
|
|
2130
|
-
|
|
2131
|
-
helperText: isTouched && error,
|
|
2405
|
+
type: type,
|
|
2132
2406
|
fullWidth: true,
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
sx: customTheme == null ? void 0 : customTheme.input
|
|
2138
|
-
},
|
|
2139
|
-
autoFormat: false
|
|
2140
|
-
}, rest));
|
|
2407
|
+
error: !!error,
|
|
2408
|
+
helperText: error,
|
|
2409
|
+
value: field.value || ''
|
|
2410
|
+
}));
|
|
2141
2411
|
};
|
|
2142
2412
|
|
|
2143
2413
|
function Loader() {
|
|
@@ -2401,7 +2671,8 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
2401
2671
|
setValues = _ref.setValues,
|
|
2402
2672
|
setUserValues = _ref.setUserValues,
|
|
2403
2673
|
onGetStatesSuccess = _ref.onGetStatesSuccess,
|
|
2404
|
-
onGetStatesError = _ref.onGetStatesError
|
|
2674
|
+
onGetStatesError = _ref.onGetStatesError,
|
|
2675
|
+
shouldFetchCountries = _ref.shouldFetchCountries;
|
|
2405
2676
|
var prevCountry = React.useRef(values.country);
|
|
2406
2677
|
React.useEffect(function () {
|
|
2407
2678
|
var fetchStates = /*#__PURE__*/function () {
|
|
@@ -2456,7 +2727,7 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
2456
2727
|
};
|
|
2457
2728
|
}();
|
|
2458
2729
|
|
|
2459
|
-
fetchStates();
|
|
2730
|
+
shouldFetchCountries && fetchStates();
|
|
2460
2731
|
}, [values.country, setStates, setFieldValue]);
|
|
2461
2732
|
var userDataEncoded = typeof window !== 'undefined' ? window.localStorage.getItem('user_data') : '';
|
|
2462
2733
|
React.useEffect(function () {
|
|
@@ -2467,8 +2738,8 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
2467
2738
|
try {
|
|
2468
2739
|
var parsedData = JSON.parse(userDataEncoded);
|
|
2469
2740
|
var mappedValues = {
|
|
2470
|
-
firstName: (parsedData == null ? void 0 : parsedData.first_name) || '',
|
|
2471
|
-
lastName: (parsedData == null ? void 0 : parsedData.last_name) || '',
|
|
2741
|
+
firstName: (parsedData == null ? void 0 : parsedData.first_name) || (parsedData == null ? void 0 : parsedData.firstName) || '',
|
|
2742
|
+
lastName: (parsedData == null ? void 0 : parsedData.last_name) || (parsedData == null ? void 0 : parsedData.lastName) || '',
|
|
2472
2743
|
email: (parsedData == null ? void 0 : parsedData.email) || '',
|
|
2473
2744
|
phone: (parsedData == null ? void 0 : parsedData.phone) || '',
|
|
2474
2745
|
confirmEmail: (parsedData == null ? void 0 : parsedData.email) || '',
|
|
@@ -2476,15 +2747,15 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
2476
2747
|
street_address: (parsedData == null ? void 0 : parsedData.street_address) || '',
|
|
2477
2748
|
country: (parsedData == null ? void 0 : parsedData.country) || '1',
|
|
2478
2749
|
zip: (parsedData == null ? void 0 : parsedData.zip) || '',
|
|
2479
|
-
brand_opt_in: (parsedData == null ? void 0 : parsedData.brand_opt_in) ||
|
|
2750
|
+
brand_opt_in: (parsedData == null ? void 0 : parsedData.brand_opt_in) || false,
|
|
2480
2751
|
city: (parsedData == null ? void 0 : parsedData.city) || '',
|
|
2481
2752
|
confirmPassword: '',
|
|
2482
2753
|
password: '',
|
|
2483
|
-
'holderFirstName-0': (parsedData == null ? void 0 : parsedData.first_name) || '',
|
|
2484
|
-
'holderLastName-0': (parsedData == null ? void 0 : parsedData.last_name) || '',
|
|
2754
|
+
'holderFirstName-0': (parsedData == null ? void 0 : parsedData.first_name) || (parsedData == null ? void 0 : parsedData.firstName) || '',
|
|
2755
|
+
'holderLastName-0': (parsedData == null ? void 0 : parsedData.last_name) || (parsedData == null ? void 0 : parsedData.lastName) || '',
|
|
2485
2756
|
'holderEmail-0': (parsedData == null ? void 0 : parsedData.email) || ''
|
|
2486
2757
|
};
|
|
2487
|
-
setValues(mappedValues);
|
|
2758
|
+
setValues(_extends({}, values, mappedValues));
|
|
2488
2759
|
setUserValues(mappedValues);
|
|
2489
2760
|
} catch (e) {}
|
|
2490
2761
|
}
|
|
@@ -2557,10 +2828,21 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2557
2828
|
skipPage = _ref3$skipPage === void 0 ? false : _ref3$skipPage,
|
|
2558
2829
|
_ref3$canSkipHolderNa = _ref3.canSkipHolderNames,
|
|
2559
2830
|
canSkipHolderNames = _ref3$canSkipHolderNa === void 0 ? false : _ref3$canSkipHolderNa,
|
|
2831
|
+
_ref3$onForgotPasswor = _ref3.onForgotPasswordSuccess,
|
|
2832
|
+
onForgotPasswordSuccess = _ref3$onForgotPasswor === void 0 ? function () {} : _ref3$onForgotPasswor,
|
|
2833
|
+
_ref3$onForgotPasswor2 = _ref3.onForgotPasswordError,
|
|
2834
|
+
onForgotPasswordError = _ref3$onForgotPasswor2 === void 0 ? function () {} : _ref3$onForgotPasswor2,
|
|
2835
|
+
_ref3$shouldFetchCoun = _ref3.shouldFetchCountries,
|
|
2836
|
+
shouldFetchCountries = _ref3$shouldFetchCoun === void 0 ? true : _ref3$shouldFetchCoun,
|
|
2560
2837
|
_ref3$onCountdownFini = _ref3.onCountdownFinish,
|
|
2561
2838
|
onCountdownFinish = _ref3$onCountdownFini === void 0 ? function () {} : _ref3$onCountdownFini,
|
|
2562
2839
|
_ref3$enableTimer = _ref3.enableTimer,
|
|
2563
|
-
enableTimer = _ref3$enableTimer === void 0 ? false : _ref3$enableTimer
|
|
2840
|
+
enableTimer = _ref3$enableTimer === void 0 ? false : _ref3$enableTimer,
|
|
2841
|
+
logo = _ref3.logo,
|
|
2842
|
+
_ref3$showForgotPassw = _ref3.showForgotPasswordButton,
|
|
2843
|
+
showForgotPasswordButton = _ref3$showForgotPassw === void 0 ? false : _ref3$showForgotPassw,
|
|
2844
|
+
_ref3$showSignUpButto = _ref3.showSignUpButton,
|
|
2845
|
+
showSignUpButton = _ref3$showSignUpButto === void 0 ? false : _ref3$showSignUpButto;
|
|
2564
2846
|
|
|
2565
2847
|
var themeMui = styles$1.createTheme(themeOptions);
|
|
2566
2848
|
var isWindowDefined = typeof window !== 'undefined';
|
|
@@ -2571,7 +2853,9 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2571
2853
|
dataWithUniqueIds = _useState[0],
|
|
2572
2854
|
setDataWithUniqueIds = _useState[1];
|
|
2573
2855
|
|
|
2574
|
-
var
|
|
2856
|
+
var xtfCookie = getCookieByName('X-TF-ECOMMERCE');
|
|
2857
|
+
|
|
2858
|
+
var _useState2 = React.useState(!!(pIsLoggedIn || xtfCookie)),
|
|
2575
2859
|
isLoggedIn = _useState2[0],
|
|
2576
2860
|
setIsLoggedIn = _useState2[1];
|
|
2577
2861
|
|
|
@@ -2600,14 +2884,18 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2600
2884
|
setUserExpired = _useState8[1];
|
|
2601
2885
|
|
|
2602
2886
|
var _useState9 = React.useState(false),
|
|
2603
|
-
|
|
2604
|
-
|
|
2887
|
+
showModalSignup = _useState9[0],
|
|
2888
|
+
setShowModalSignup = _useState9[1];
|
|
2605
2889
|
|
|
2606
|
-
var _useState10 = React.useState(
|
|
2607
|
-
|
|
2608
|
-
|
|
2890
|
+
var _useState10 = React.useState(false),
|
|
2891
|
+
showModalForgotPassword = _useState10[0],
|
|
2892
|
+
setShowModalForgotPassword = _useState10[1];
|
|
2609
2893
|
|
|
2610
|
-
var _useState11 = React.useState(
|
|
2894
|
+
var _useState11 = React.useState([]),
|
|
2895
|
+
ticketsQuantity = _useState11[0],
|
|
2896
|
+
setTicketsQuantity = _useState11[1];
|
|
2897
|
+
|
|
2898
|
+
var _useState12 = React.useState({
|
|
2611
2899
|
firstName: '',
|
|
2612
2900
|
lastName: '',
|
|
2613
2901
|
email: '',
|
|
@@ -2622,16 +2910,16 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2622
2910
|
state: '',
|
|
2623
2911
|
zip: ''
|
|
2624
2912
|
}),
|
|
2625
|
-
userValues =
|
|
2626
|
-
setUserValues =
|
|
2913
|
+
userValues = _useState12[0],
|
|
2914
|
+
setUserValues = _useState12[1];
|
|
2627
2915
|
|
|
2628
|
-
var
|
|
2629
|
-
loading =
|
|
2630
|
-
setLoading =
|
|
2916
|
+
var _useState13 = React.useState(true),
|
|
2917
|
+
loading = _useState13[0],
|
|
2918
|
+
setLoading = _useState13[1];
|
|
2631
2919
|
|
|
2632
|
-
var
|
|
2633
|
-
error =
|
|
2634
|
-
setError =
|
|
2920
|
+
var _useState14 = React.useState(null),
|
|
2921
|
+
error = _useState14[0],
|
|
2922
|
+
setError = _useState14[1];
|
|
2635
2923
|
|
|
2636
2924
|
var emailLogged = _get(userData, 'email', '') || _get(userValues, 'email', '');
|
|
2637
2925
|
|
|
@@ -2681,10 +2969,10 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2681
2969
|
};
|
|
2682
2970
|
|
|
2683
2971
|
React.useEffect(function () {
|
|
2684
|
-
if (
|
|
2685
|
-
setIsLoggedIn(
|
|
2972
|
+
if (pIsLoggedIn !== isLoggedIn || xtfCookie) {
|
|
2973
|
+
setIsLoggedIn(!!(pIsLoggedIn || xtfCookie));
|
|
2686
2974
|
}
|
|
2687
|
-
}, [pIsLoggedIn, isLoggedIn,
|
|
2975
|
+
}, [pIsLoggedIn, isLoggedIn, xtfCookie]); //just once
|
|
2688
2976
|
|
|
2689
2977
|
React.useEffect(function () {
|
|
2690
2978
|
// fetch countries data
|
|
@@ -2733,7 +3021,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2733
3021
|
};
|
|
2734
3022
|
}();
|
|
2735
3023
|
|
|
2736
|
-
fetchCountries();
|
|
3024
|
+
shouldFetchCountries && fetchCountries();
|
|
2737
3025
|
fetchCart();
|
|
2738
3026
|
}, []); // fetch cart data
|
|
2739
3027
|
|
|
@@ -2793,7 +3081,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2793
3081
|
case 0:
|
|
2794
3082
|
_context4.prev = 0;
|
|
2795
3083
|
|
|
2796
|
-
if (!(isWindowDefined && token)) {
|
|
3084
|
+
if (!(isWindowDefined && token || isLoggedIn)) {
|
|
2797
3085
|
_context4.next = 10;
|
|
2798
3086
|
break;
|
|
2799
3087
|
}
|
|
@@ -2804,7 +3092,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2804
3092
|
case 4:
|
|
2805
3093
|
userDataResponse = _context4.sent;
|
|
2806
3094
|
profileSpecifiedData = _get(userDataResponse, 'data.data');
|
|
2807
|
-
profileDataObj = setLoggedUserData(profileSpecifiedData);
|
|
3095
|
+
profileDataObj = setLoggedUserData$1(profileSpecifiedData);
|
|
2808
3096
|
setUserValues(_extends({}, profileDataObj, {
|
|
2809
3097
|
firstName: profileDataObj.first_name,
|
|
2810
3098
|
lastName: profileDataObj.last_name
|
|
@@ -2840,7 +3128,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2840
3128
|
|
|
2841
3129
|
React.useEffect(function () {
|
|
2842
3130
|
fetchUserData(access_token);
|
|
2843
|
-
}, [access_token]);
|
|
3131
|
+
}, [access_token, isLoggedIn]);
|
|
2844
3132
|
React.useEffect(function () {
|
|
2845
3133
|
var collectPaymentData = /*#__PURE__*/function () {
|
|
2846
3134
|
var _ref7 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5() {
|
|
@@ -2896,16 +3184,20 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2896
3184
|
collectPaymentData();
|
|
2897
3185
|
}, [skipPage, ticketsQuantity]);
|
|
2898
3186
|
|
|
2899
|
-
var collectCheckoutBody = function collectCheckoutBody(values) {
|
|
3187
|
+
var collectCheckoutBody = function collectCheckoutBody(values, profileData) {
|
|
2900
3188
|
var checkoutBody = {}; // Auto collect ticket holders name when it was skipped optionally
|
|
2901
3189
|
|
|
2902
3190
|
if (showDOB && !showTicketHolders && canSkipHolderNames) {
|
|
2903
|
-
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketsQuantity.length, values, true
|
|
2904
|
-
} else {
|
|
2905
|
-
checkoutBody = createCheckoutDataBody(ticketsQuantity.length, values, {
|
|
3191
|
+
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketsQuantity.length, values, true, {
|
|
2906
3192
|
emailLogged: emailLogged,
|
|
2907
3193
|
firstNameLogged: firstNameLogged,
|
|
2908
3194
|
lastNameLogged: lastNameLogged
|
|
3195
|
+
});
|
|
3196
|
+
} else {
|
|
3197
|
+
checkoutBody = createCheckoutDataBody(ticketsQuantity.length, values, {
|
|
3198
|
+
emailLogged: emailLogged || profileData.email,
|
|
3199
|
+
firstNameLogged: firstNameLogged || profileData.first_name || profileData.firstName,
|
|
3200
|
+
lastNameLogged: lastNameLogged || profileData.last_name || profileData.lastName
|
|
2909
3201
|
}, showDOB);
|
|
2910
3202
|
}
|
|
2911
3203
|
|
|
@@ -2914,28 +3206,27 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2914
3206
|
|
|
2915
3207
|
var removeReferralKey = function removeReferralKey() {
|
|
2916
3208
|
localStorage.removeItem('referral_key');
|
|
2917
|
-
};
|
|
2918
|
-
|
|
3209
|
+
};
|
|
2919
3210
|
|
|
2920
3211
|
if (loading || enableTimer && !expirationTime && typeof window !== 'undefined') {
|
|
2921
3212
|
if (expirationTime === 0) {
|
|
2922
3213
|
// Redirect to homepage (countdown finished and browser reloaded case)
|
|
2923
3214
|
window.location.href = '/';
|
|
2924
3215
|
}
|
|
2925
|
-
|
|
2926
|
-
return React__default.createElement(Backdrop, {
|
|
2927
|
-
sx: {
|
|
2928
|
-
color: '#fff'
|
|
2929
|
-
},
|
|
2930
|
-
open: true
|
|
2931
|
-
}, React__default.createElement(material.CircularProgress, {
|
|
2932
|
-
color: "inherit"
|
|
2933
|
-
}));
|
|
2934
3216
|
}
|
|
2935
3217
|
|
|
2936
3218
|
return React__default.createElement(styles$1.ThemeProvider, {
|
|
2937
3219
|
theme: themeMui
|
|
2938
|
-
},
|
|
3220
|
+
}, loading && React__default.createElement(Backdrop, {
|
|
3221
|
+
sx: {
|
|
3222
|
+
color: '#fff',
|
|
3223
|
+
backgroundColor: '#000000bd',
|
|
3224
|
+
zIndex: 1205
|
|
3225
|
+
},
|
|
3226
|
+
open: true
|
|
3227
|
+
}, React__default.createElement(material.CircularProgress, {
|
|
3228
|
+
color: "inherit"
|
|
3229
|
+
})), !!expirationTime && enableTimer && React__default.createElement(TimerWidget$1, {
|
|
2939
3230
|
expires_at: expirationTime,
|
|
2940
3231
|
onCountdownFinish: onCountdownFinish
|
|
2941
3232
|
}), React__default.createElement(formik.Formik, {
|
|
@@ -2945,10 +3236,10 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2945
3236
|
brand_opt_in: optedInFieldValue,
|
|
2946
3237
|
ttf_opt_in: ttfOptIn
|
|
2947
3238
|
}), userValues),
|
|
2948
|
-
enableReinitialize:
|
|
3239
|
+
enableReinitialize: false,
|
|
2949
3240
|
onSubmit: function () {
|
|
2950
3241
|
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(values, formikHelpers) {
|
|
2951
|
-
var updatedUserData, _profileSpecifiedData, _profileDataObj, _checkoutBody, _res, checkoutBodyForRegistration, bodyFormData,
|
|
3242
|
+
var updatedUserData, _profileSpecifiedData, _profileDataObj, _checkoutBody, _res, checkoutBodyForRegistration, bodyFormData, resRegister, _xtfCookie, accessToken, refreshToken, userProfile, _e$response, _e$response$data, _error, profileData, profileSpecifiedData, profileDataObj, checkoutBody, res, _e$response2, _e$response3;
|
|
2952
3243
|
|
|
2953
3244
|
return runtime_1.wrap(function _callee6$(_context6) {
|
|
2954
3245
|
while (1) {
|
|
@@ -2972,14 +3263,14 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2972
3263
|
case 5:
|
|
2973
3264
|
updatedUserData = _context6.sent;
|
|
2974
3265
|
_profileSpecifiedData = _get(updatedUserData, 'data.data');
|
|
2975
|
-
_profileDataObj = setLoggedUserData(_profileSpecifiedData);
|
|
3266
|
+
_profileDataObj = setLoggedUserData$1(_profileSpecifiedData);
|
|
2976
3267
|
|
|
2977
3268
|
if (isWindowDefined) {
|
|
2978
3269
|
window.localStorage.setItem('user_data', JSON.stringify(_profileDataObj));
|
|
2979
3270
|
}
|
|
2980
3271
|
|
|
2981
3272
|
case 9:
|
|
2982
|
-
_checkoutBody = collectCheckoutBody(values);
|
|
3273
|
+
_checkoutBody = collectCheckoutBody(values, userData);
|
|
2983
3274
|
_context6.next = 12;
|
|
2984
3275
|
return postOnCheckout(_checkoutBody, access_token);
|
|
2985
3276
|
|
|
@@ -2996,27 +3287,30 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2996
3287
|
lastNameLogged: lastNameLogged
|
|
2997
3288
|
}, showDOB);
|
|
2998
3289
|
bodyFormData = createRegisterFormData(values, checkoutBodyForRegistration);
|
|
2999
|
-
|
|
3000
|
-
|
|
3290
|
+
_context6.prev = 18;
|
|
3291
|
+
setLoading(true);
|
|
3001
3292
|
_context6.next = 22;
|
|
3002
3293
|
return register(bodyFormData);
|
|
3003
3294
|
|
|
3004
3295
|
case 22:
|
|
3005
3296
|
resRegister = _context6.sent;
|
|
3006
|
-
|
|
3297
|
+
_xtfCookie = _get(resRegister, 'headers.x-tf-ecommerce');
|
|
3298
|
+
accessToken = _get(resRegister, 'data.data.attributes.access_token');
|
|
3007
3299
|
refreshToken = _get(resRegister, 'data.data.attributes.refresh_token');
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3300
|
+
userProfile = _get(resRegister, 'data.data.attributes.user_profile');
|
|
3301
|
+
onRegisterSuccess({
|
|
3302
|
+
xtfCookie: _xtfCookie,
|
|
3303
|
+
accessToken: accessToken,
|
|
3304
|
+
refreshToken: refreshToken,
|
|
3305
|
+
userProfile: userProfile
|
|
3306
|
+
});
|
|
3307
|
+
_context6.next = 35;
|
|
3015
3308
|
break;
|
|
3016
3309
|
|
|
3017
3310
|
case 30:
|
|
3018
3311
|
_context6.prev = 30;
|
|
3019
|
-
_context6.t0 = _context6["catch"](
|
|
3312
|
+
_context6.t0 = _context6["catch"](18);
|
|
3313
|
+
setLoading(false);
|
|
3020
3314
|
|
|
3021
3315
|
if (axios.isAxiosError(_context6.t0)) {
|
|
3022
3316
|
_error = _context6.t0 == null ? void 0 : (_e$response = _context6.t0.response) == null ? void 0 : (_e$response$data = _e$response.data) == null ? void 0 : _e$response$data.message;
|
|
@@ -3045,33 +3339,34 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3045
3339
|
|
|
3046
3340
|
return _context6.abrupt("return");
|
|
3047
3341
|
|
|
3048
|
-
case
|
|
3049
|
-
_context6.next =
|
|
3050
|
-
return getProfileData(
|
|
3342
|
+
case 35:
|
|
3343
|
+
_context6.next = 37;
|
|
3344
|
+
return getProfileData();
|
|
3051
3345
|
|
|
3052
|
-
case
|
|
3346
|
+
case 37:
|
|
3053
3347
|
profileData = _context6.sent;
|
|
3054
3348
|
profileSpecifiedData = _get(profileData, 'data.data');
|
|
3055
|
-
profileDataObj = setLoggedUserData(profileSpecifiedData);
|
|
3349
|
+
profileDataObj = setLoggedUserData$1(profileSpecifiedData);
|
|
3056
3350
|
|
|
3057
3351
|
if (isWindowDefined) {
|
|
3058
3352
|
window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
|
|
3059
3353
|
}
|
|
3060
3354
|
|
|
3061
|
-
checkoutBody = collectCheckoutBody(values);
|
|
3062
|
-
_context6.next =
|
|
3063
|
-
return postOnCheckout(checkoutBody
|
|
3355
|
+
checkoutBody = collectCheckoutBody(values, profileDataObj);
|
|
3356
|
+
_context6.next = 44;
|
|
3357
|
+
return postOnCheckout(checkoutBody);
|
|
3064
3358
|
|
|
3065
|
-
case
|
|
3359
|
+
case 44:
|
|
3066
3360
|
res = _context6.sent;
|
|
3067
3361
|
removeReferralKey();
|
|
3068
3362
|
handleSubmit(values, formikHelpers, eventId, res);
|
|
3069
|
-
_context6.next =
|
|
3363
|
+
_context6.next = 53;
|
|
3070
3364
|
break;
|
|
3071
3365
|
|
|
3072
|
-
case
|
|
3073
|
-
_context6.prev =
|
|
3366
|
+
case 49:
|
|
3367
|
+
_context6.prev = 49;
|
|
3074
3368
|
_context6.t1 = _context6["catch"](0);
|
|
3369
|
+
setLoading(false);
|
|
3075
3370
|
|
|
3076
3371
|
if (axios.isAxiosError(_context6.t1)) {
|
|
3077
3372
|
if (((_e$response2 = _context6.t1.response) == null ? void 0 : _e$response2.data.error) === 'invalid_token') {
|
|
@@ -3090,12 +3385,17 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3090
3385
|
onSubmitError(_context6.t1);
|
|
3091
3386
|
}
|
|
3092
3387
|
|
|
3093
|
-
case
|
|
3388
|
+
case 53:
|
|
3389
|
+
_context6.prev = 53;
|
|
3390
|
+
setLoading(false);
|
|
3391
|
+
return _context6.finish(53);
|
|
3392
|
+
|
|
3393
|
+
case 56:
|
|
3094
3394
|
case "end":
|
|
3095
3395
|
return _context6.stop();
|
|
3096
3396
|
}
|
|
3097
3397
|
}
|
|
3098
|
-
}, _callee6, null, [[0,
|
|
3398
|
+
}, _callee6, null, [[0, 49, 53, 56], [18, 30]]);
|
|
3099
3399
|
}));
|
|
3100
3400
|
|
|
3101
3401
|
function onSubmit(_x2, _x3) {
|
|
@@ -3114,7 +3414,8 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3114
3414
|
setValues: props.setValues,
|
|
3115
3415
|
setUserValues: setUserValues,
|
|
3116
3416
|
onGetStatesSuccess: onGetStatesSuccess,
|
|
3117
|
-
onGetStatesError: onGetStatesError
|
|
3417
|
+
onGetStatesError: onGetStatesError,
|
|
3418
|
+
shouldFetchCountries: shouldFetchCountries
|
|
3118
3419
|
}), React__default.createElement("div", {
|
|
3119
3420
|
className: "billing-info-container " + theme
|
|
3120
3421
|
}, React__default.createElement(SnackbarAlert, {
|
|
@@ -3127,8 +3428,10 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3127
3428
|
}
|
|
3128
3429
|
}), !isLoggedIn && React__default.createElement("div", {
|
|
3129
3430
|
className: "account-actions-block"
|
|
3130
|
-
}, React__default.createElement("div",
|
|
3131
|
-
className: "
|
|
3431
|
+
}, React__default.createElement("div", {
|
|
3432
|
+
className: "action-item"
|
|
3433
|
+
}, React__default.createElement("div", null, accountInfoTitle), React__default.createElement("div", null, "Login & skip ahead:")), React__default.createElement("div", {
|
|
3434
|
+
className: "action-item login-block"
|
|
3132
3435
|
}, React__default.createElement("button", {
|
|
3133
3436
|
className: "login-register-button",
|
|
3134
3437
|
type: "button",
|
|
@@ -3186,7 +3489,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3186
3489
|
validate: getValidateFunctions(element, states, props.values),
|
|
3187
3490
|
setFieldValue: props.setFieldValue,
|
|
3188
3491
|
onBlur: props.handleBlur,
|
|
3189
|
-
component: element.type === 'checkbox' ? CheckboxField : element.type === 'select' ? SelectField : element.type === 'phone' ?
|
|
3492
|
+
component: element.type === 'checkbox' ? CheckboxField : element.type === 'select' ? SelectField : element.type === 'phone' ? PhoneNumberField : element.type === 'date' ? DatePickerField : CustomField,
|
|
3190
3493
|
selectOptions: element.name === 'country' ? countries : element.name === 'state' ? states : [],
|
|
3191
3494
|
theme: theme
|
|
3192
3495
|
})));
|
|
@@ -3194,7 +3497,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3194
3497
|
}));
|
|
3195
3498
|
}), !_isEmpty(ticketHoldersFields.fields) && React__default.createElement("div", {
|
|
3196
3499
|
className: "ticket-holders-fields"
|
|
3197
|
-
}, React__default.createElement("
|
|
3500
|
+
}, React__default.createElement("h2", null, ticketHoldersFields.label), _map(ticketsQuantity, function (_item, index) {
|
|
3198
3501
|
return React__default.createElement("div", {
|
|
3199
3502
|
key: _item
|
|
3200
3503
|
}, React__default.createElement("h5", null, "Ticket ", index + 1), _map(ticketHoldersFields.fields, function (group) {
|
|
@@ -3229,6 +3532,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3229
3532
|
size: 26
|
|
3230
3533
|
}) : buttonName))));
|
|
3231
3534
|
}), showModalLogin && React__default.createElement(LoginModal, {
|
|
3535
|
+
logo: logo,
|
|
3232
3536
|
onClose: function onClose() {
|
|
3233
3537
|
setShowModalLogin(false);
|
|
3234
3538
|
},
|
|
@@ -3246,20 +3550,37 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3246
3550
|
|
|
3247
3551
|
_onGetProfileDataSuccess(data);
|
|
3248
3552
|
},
|
|
3249
|
-
onGetProfileDataError: onGetProfileDataError
|
|
3250
|
-
|
|
3553
|
+
onGetProfileDataError: onGetProfileDataError,
|
|
3554
|
+
showSignUpButton: showSignUpButton,
|
|
3555
|
+
showForgotPasswordButton: showForgotPasswordButton,
|
|
3556
|
+
onForgotPassword: function onForgotPassword() {
|
|
3557
|
+
setShowModalLogin(false);
|
|
3558
|
+
setShowModalForgotPassword(true);
|
|
3559
|
+
},
|
|
3560
|
+
onSignup: function onSignup() {
|
|
3561
|
+
setShowModalLogin(false);
|
|
3562
|
+
setShowModalSignup(true);
|
|
3563
|
+
}
|
|
3564
|
+
}), showModalSignup && React__default.createElement(SignupModal, {
|
|
3251
3565
|
onClose: function onClose() {
|
|
3252
|
-
|
|
3566
|
+
setShowModalSignup(false);
|
|
3253
3567
|
},
|
|
3254
|
-
|
|
3255
|
-
|
|
3568
|
+
onLogin: function onLogin() {
|
|
3569
|
+
setShowModalSignup(false);
|
|
3570
|
+
setShowModalLogin(true);
|
|
3256
3571
|
},
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3572
|
+
onRegisterSuccess: onRegisterSuccess,
|
|
3573
|
+
onRegisterError: onRegisterError
|
|
3574
|
+
}), showModalForgotPassword && React__default.createElement(ForgotPasswordModal, {
|
|
3575
|
+
onClose: function onClose() {
|
|
3576
|
+
setShowModalForgotPassword(false);
|
|
3577
|
+
},
|
|
3578
|
+
onLogin: function onLogin() {
|
|
3579
|
+
setShowModalForgotPassword(false);
|
|
3580
|
+
setShowModalLogin(true);
|
|
3261
3581
|
},
|
|
3262
|
-
|
|
3582
|
+
onForgotPasswordSuccess: onForgotPasswordSuccess,
|
|
3583
|
+
onForgotPasswordError: onForgotPasswordError
|
|
3263
3584
|
}));
|
|
3264
3585
|
};
|
|
3265
3586
|
|
|
@@ -3478,7 +3799,7 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
3478
3799
|
onSubmit: handleSubmit
|
|
3479
3800
|
}, React__default.createElement("div", {
|
|
3480
3801
|
className: "card_form_inner"
|
|
3481
|
-
}, React__default.createElement("
|
|
3802
|
+
}, React__default.createElement("div", {
|
|
3482
3803
|
className: "card_number_element"
|
|
3483
3804
|
}, React__default.createElement("span", {
|
|
3484
3805
|
className: "card_label_text"
|
|
@@ -3488,19 +3809,21 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
3488
3809
|
onChange: _identity,
|
|
3489
3810
|
onBlur: _identity,
|
|
3490
3811
|
onFocus: _identity
|
|
3491
|
-
})), React__default.createElement("
|
|
3812
|
+
})), React__default.createElement("div", {
|
|
3813
|
+
className: "elements"
|
|
3814
|
+
}, React__default.createElement("div", {
|
|
3492
3815
|
className: "expiration_element"
|
|
3493
3816
|
}, React__default.createElement("span", {
|
|
3494
3817
|
className: "card_label_text"
|
|
3495
3818
|
}, "Expiration date"), React__default.createElement(reactStripeJs.CardExpiryElement, {
|
|
3496
3819
|
options: _extends({}, options, stripeCardOptions)
|
|
3497
|
-
})), React__default.createElement("
|
|
3820
|
+
})), React__default.createElement("div", {
|
|
3498
3821
|
className: "cvc_element"
|
|
3499
3822
|
}, React__default.createElement("span", {
|
|
3500
3823
|
className: "card_label_text"
|
|
3501
3824
|
}, "CVC"), React__default.createElement(reactStripeJs.CardCvcElement, {
|
|
3502
3825
|
options: _extends({}, options, stripeCardOptions)
|
|
3503
|
-
})), !disableZipSection && React__default.createElement("
|
|
3826
|
+
}))), !disableZipSection && React__default.createElement("div", {
|
|
3504
3827
|
className: "zip_element"
|
|
3505
3828
|
}, React__default.createElement("p", {
|
|
3506
3829
|
className: "card_label_text"
|
|
@@ -3590,7 +3913,9 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3590
3913
|
_ref$onCountdownFinis = _ref.onCountdownFinish,
|
|
3591
3914
|
onCountdownFinish = _ref$onCountdownFinis === void 0 ? function () {} : _ref$onCountdownFinis,
|
|
3592
3915
|
_ref$enableTimer = _ref.enableTimer,
|
|
3593
|
-
enableTimer = _ref$enableTimer === void 0 ? false : _ref$enableTimer
|
|
3916
|
+
enableTimer = _ref$enableTimer === void 0 ? false : _ref$enableTimer,
|
|
3917
|
+
_ref$enablePaymentPla = _ref.enablePaymentPlan,
|
|
3918
|
+
enablePaymentPlan = _ref$enablePaymentPla === void 0 ? false : _ref$enablePaymentPla;
|
|
3594
3919
|
|
|
3595
3920
|
var _useState = React.useState(initialReviewValues),
|
|
3596
3921
|
reviewData = _useState[0],
|
|
@@ -3605,16 +3930,20 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3605
3930
|
setError = _useState3[1];
|
|
3606
3931
|
|
|
3607
3932
|
var _useState4 = React.useState(false),
|
|
3608
|
-
|
|
3609
|
-
|
|
3933
|
+
showPaymentPlanSection = _useState4[0],
|
|
3934
|
+
setShowPaymentPlanSection = _useState4[1];
|
|
3935
|
+
|
|
3936
|
+
var _useState5 = React.useState(false),
|
|
3937
|
+
paymentIsLoading = _useState5[0],
|
|
3938
|
+
setPaymentIsLoading = _useState5[1];
|
|
3610
3939
|
|
|
3611
|
-
var
|
|
3612
|
-
paymentDataIsLoading =
|
|
3613
|
-
setPaymentDataIsLoading =
|
|
3940
|
+
var _useState6 = React.useState(true),
|
|
3941
|
+
paymentDataIsLoading = _useState6[0],
|
|
3942
|
+
setPaymentDataIsLoading = _useState6[1];
|
|
3614
3943
|
|
|
3615
|
-
var
|
|
3616
|
-
conditions =
|
|
3617
|
-
setConditions =
|
|
3944
|
+
var _useState7 = React.useState([]),
|
|
3945
|
+
conditions = _useState7[0],
|
|
3946
|
+
setConditions = _useState7[1];
|
|
3618
3947
|
|
|
3619
3948
|
var showFormTitle = Boolean(formTitle);
|
|
3620
3949
|
var showErrorText = Boolean(errorText);
|
|
@@ -3741,7 +4070,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3741
4070
|
case 3:
|
|
3742
4071
|
order_hash = reviewData.order_details.order_hash;
|
|
3743
4072
|
|
|
3744
|
-
if (!(total ===
|
|
4073
|
+
if (!(total === '0.00')) {
|
|
3745
4074
|
_context3.next = 10;
|
|
3746
4075
|
break;
|
|
3747
4076
|
}
|
|
@@ -3826,11 +4155,33 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3826
4155
|
}, label), React__default.createElement("div", {
|
|
3827
4156
|
className: className + " order_info_text"
|
|
3828
4157
|
}, normalizer(orderData[id], orderData.currency)));
|
|
3829
|
-
})),
|
|
4158
|
+
})), enablePaymentPlan && React__default.createElement("div", {
|
|
4159
|
+
className: "payment_toggle"
|
|
4160
|
+
}, React__default.createElement("label", {
|
|
4161
|
+
htmlFor: "togBtn",
|
|
4162
|
+
className: "switch"
|
|
4163
|
+
}, React__default.createElement("input", {
|
|
4164
|
+
type: "checkbox",
|
|
4165
|
+
id: "togBtn",
|
|
4166
|
+
disabled: true,
|
|
4167
|
+
onChange: function onChange() {
|
|
4168
|
+
return setShowPaymentPlanSection(!showPaymentPlanSection);
|
|
4169
|
+
}
|
|
4170
|
+
}), React__default.createElement("div", {
|
|
4171
|
+
className: "slider round"
|
|
4172
|
+
}), React__default.createElement("span", {
|
|
4173
|
+
className: "tog_text"
|
|
4174
|
+
}, "Click to checkout using Payment Plan"))), showPaymentPlanSection && React__default.createElement("div", {
|
|
4175
|
+
className: "payment_plan"
|
|
4176
|
+
}, React__default.createElement("h2", null, "PAYMENT PLAN"), React__default.createElement("div", {
|
|
4177
|
+
className: "plan_block"
|
|
4178
|
+
}, React__default.createElement("h3", null, "Mbrand Payment Plan Terms"), React__default.createElement("p", null, "By clicking on the \u201CConfirm Payment Plan\u201D button, you are starting your payment plan of 2 payments of $115.00, which will be drawn from your account every 2 weeks, with the first payment taken later today."), React__default.createElement("p", null, "This includes a non-refundable admin fee of $3.00 per payment."), React__default.createElement("p", {
|
|
4179
|
+
className: "payment_note"
|
|
4180
|
+
}, "NOTE: If today\u2019s payment fails, your payment plan will not activate, and your tickets will not be issued until you complete your final payment."), React__default.createElement("p", null, "If you do not complete your payements, your order will be canceled. Your first payment of $115.00, plus the non-refundable admin fee of $3.00 will not be refunded."), React__default.createElement("p", null, "Your payment will proceed with the card ending in **** 4242."))), total !== '0.00' ? React__default.createElement("div", {
|
|
3830
4181
|
className: "payment_info"
|
|
3831
4182
|
}, React__default.createElement("div", {
|
|
3832
4183
|
className: "payment_info_label"
|
|
3833
|
-
}, "
|
|
4184
|
+
}, "ORDER CONFIRMATION"), showErrorText && React__default.createElement("p", {
|
|
3834
4185
|
className: "payment_info__error"
|
|
3835
4186
|
}, errorText), React__default.createElement("div", null, React__default.createElement(reactStripeJs.Elements, {
|
|
3836
4187
|
stripe: getStripePromise(reviewData),
|
|
@@ -3860,7 +4211,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3860
4211
|
}
|
|
3861
4212
|
}, paymentIsLoading ? React__default.createElement(CircularProgress, {
|
|
3862
4213
|
size: 26
|
|
3863
|
-
}) :
|
|
4214
|
+
}) : 'Complete Registration')))));
|
|
3864
4215
|
};
|
|
3865
4216
|
|
|
3866
4217
|
var config = {
|
|
@@ -4024,7 +4375,9 @@ var SocialButtons = function SocialButtons(_ref2) {
|
|
|
4024
4375
|
};
|
|
4025
4376
|
|
|
4026
4377
|
var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
4027
|
-
var
|
|
4378
|
+
var _ref$hasCopyIcon = _ref.hasCopyIcon,
|
|
4379
|
+
hasCopyIcon = _ref$hasCopyIcon === void 0 ? true : _ref$hasCopyIcon,
|
|
4380
|
+
isReferralEnabled = _ref.isReferralEnabled,
|
|
4028
4381
|
showDefaultShareButtons = _ref.showDefaultShareButtons,
|
|
4029
4382
|
_ref$messengerAppId = _ref.messengerAppId,
|
|
4030
4383
|
messengerAppId = _ref$messengerAppId === void 0 ? '' : _ref$messengerAppId,
|
|
@@ -4123,7 +4476,16 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
4123
4476
|
|
|
4124
4477
|
return React__default.createElement("div", {
|
|
4125
4478
|
className: "confirmation-page"
|
|
4126
|
-
}, data && React__default.createElement(React__default.Fragment, null, React__default.createElement("
|
|
4479
|
+
}, data && React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
4480
|
+
className: 'header-container'
|
|
4481
|
+
}, React__default.createElement("div", {
|
|
4482
|
+
className: 'header-product-image'
|
|
4483
|
+
}, React__default.createElement("img", {
|
|
4484
|
+
className: 'product-image',
|
|
4485
|
+
src: data.product_image
|
|
4486
|
+
})), React__default.createElement("div", {
|
|
4487
|
+
className: "header-product-text"
|
|
4488
|
+
}, React__default.createElement("p", {
|
|
4127
4489
|
className: "title"
|
|
4128
4490
|
}, "Your Tickets are Confirmed!"), React__default.createElement("div", {
|
|
4129
4491
|
className: "share-message-section"
|
|
@@ -4131,7 +4493,7 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
4131
4493
|
className: "main"
|
|
4132
4494
|
}, "Your tickets have been emailed to you"), React__default.createElement("span", {
|
|
4133
4495
|
className: "helper"
|
|
4134
|
-
}, "Please bring them with you to the event")), data.disable_referral === false && isReferralEnabled && React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
4496
|
+
}, "Please bring them with you to the event")))), data.disable_referral === false && isReferralEnabled && React__default.createElement(React__default.Fragment, null, React__default.createElement("div", {
|
|
4135
4497
|
className: "referral_text_image_section"
|
|
4136
4498
|
}, React__default.createElement("div", {
|
|
4137
4499
|
className: "referral_text_section"
|
|
@@ -4148,6 +4510,7 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
4148
4510
|
}, " Invite friends "), "and we'll refund up to", React__default.createElement("span", {
|
|
4149
4511
|
className: "strong-text"
|
|
4150
4512
|
}, " 100% "), "of your ticket money, if they buy tickets as well!")), React__default.createElement("img", {
|
|
4513
|
+
className: 'body-product-image',
|
|
4151
4514
|
src: data.product_image,
|
|
4152
4515
|
alt: "No Data"
|
|
4153
4516
|
})), React__default.createElement("div", {
|
|
@@ -4177,10 +4540,12 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
4177
4540
|
navigator.clipboard.writeText(_get(inputRef, 'current.value'));
|
|
4178
4541
|
onLinkCopied();
|
|
4179
4542
|
}
|
|
4180
|
-
}, React__default.createElement("img", {
|
|
4543
|
+
}, hasCopyIcon ? React__default.createElement("img", {
|
|
4181
4544
|
src: "https://img.icons8.com/office/50/000000/copy.png",
|
|
4182
4545
|
alt: "copy"
|
|
4183
|
-
})
|
|
4546
|
+
}) : React__default.createElement("span", {
|
|
4547
|
+
className: 'copy-icon'
|
|
4548
|
+
}, "Copy")))), (showDefaultShareButtons || !!shareButtons.length) && React__default.createElement(SocialButtons, {
|
|
4184
4549
|
showDefaultShareButtons: showDefaultShareButtons,
|
|
4185
4550
|
name: data.product_name,
|
|
4186
4551
|
appId: messengerAppId,
|
|
@@ -4241,7 +4606,7 @@ var TicketRow = function TicketRow(_ref) {
|
|
|
4241
4606
|
var isSalesClosed = !ticketTier.salesStarted || ticketTier.salesEnded;
|
|
4242
4607
|
var options = getTicketSelectOptions(ticketTier.maxQuantity, ticketTier.minQuantity, ticketTier.multiplier);
|
|
4243
4608
|
var ticketsClosedMessage = !ticketTier.salesStarted ? 'Sales not started' : 'Sales Ended';
|
|
4244
|
-
var onSaleContent =
|
|
4609
|
+
var onSaleContent = React__default.createElement("div", {
|
|
4245
4610
|
className: "get-tickets"
|
|
4246
4611
|
}, React__default.createElement(Box, {
|
|
4247
4612
|
className: "get-tickets__selectbox"
|
|
@@ -4271,17 +4636,17 @@ var TicketRow = function TicketRow(_ref) {
|
|
|
4271
4636
|
value: option.value
|
|
4272
4637
|
}, option.value);
|
|
4273
4638
|
})))));
|
|
4274
|
-
var returnValue = '';
|
|
4639
|
+
var returnValue = ''; // ticketTier.soldOut === false --> means that ticket is in the stock
|
|
4275
4640
|
|
|
4276
|
-
|
|
4277
|
-
returnValue = soldOutMessage;
|
|
4278
|
-
}
|
|
4641
|
+
var isSoldOut = ticketTier.sold_out || !ticketTier.displayTicket || ticketTier.soldOut || ticketTier.soldOut === false;
|
|
4279
4642
|
|
|
4280
|
-
if (
|
|
4643
|
+
if (isSoldOut) {
|
|
4644
|
+
returnValue = soldOutMessage;
|
|
4645
|
+
} else if (isSalesClosed) {
|
|
4646
|
+
returnValue = ticketsClosedMessage;
|
|
4647
|
+
} else if (ticketTier.displayTicket && ticketTier.maxQuantity) {
|
|
4281
4648
|
returnValue = onSaleContent;
|
|
4282
|
-
}
|
|
4283
|
-
|
|
4284
|
-
if (_get(prevTicketTier, 'in_stock')) {
|
|
4649
|
+
} else if (_get(prevTicketTier, 'in_stock')) {
|
|
4285
4650
|
returnValue = 'SOON';
|
|
4286
4651
|
}
|
|
4287
4652
|
|
|
@@ -4292,7 +4657,6 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
4292
4657
|
var ticketsList = _ref.ticketsList,
|
|
4293
4658
|
selectedTickets = _ref.selectedTickets,
|
|
4294
4659
|
handleTicketSelect = _ref.handleTicketSelect,
|
|
4295
|
-
codeIsApplied = _ref.codeIsApplied,
|
|
4296
4660
|
sortBySoldOut = _ref.sortBySoldOut,
|
|
4297
4661
|
ticketsHeaderComponent = _ref.ticketsHeaderComponent,
|
|
4298
4662
|
hideTicketsHeader = _ref.hideTicketsHeader;
|
|
@@ -4307,7 +4671,7 @@ var TicketsSection = function TicketsSection(_ref) {
|
|
|
4307
4671
|
|
|
4308
4672
|
var ticketIsDiscounted = false;
|
|
4309
4673
|
|
|
4310
|
-
if (ticket.oldPrice &&
|
|
4674
|
+
if (ticket.oldPrice && !isSoldOut && ticket.oldPrice !== ticket.price) {
|
|
4311
4675
|
ticketIsDiscounted = true;
|
|
4312
4676
|
}
|
|
4313
4677
|
|
|
@@ -4510,7 +4874,8 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
4510
4874
|
showPromoInput = _ref.showPromoInput,
|
|
4511
4875
|
setCode = _ref.setCode,
|
|
4512
4876
|
setShowPromoInput = _ref.setShowPromoInput,
|
|
4513
|
-
updateTickets = _ref.updateTickets
|
|
4877
|
+
updateTickets = _ref.updateTickets,
|
|
4878
|
+
setCodeIsApplied = _ref.setCodeIsApplied;
|
|
4514
4879
|
var isPromoCodeHasValue = !!code.trim();
|
|
4515
4880
|
|
|
4516
4881
|
var renderInputField = function renderInputField() {
|
|
@@ -4529,7 +4894,7 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
4529
4894
|
onKeyPress: function onKeyPress(event) {
|
|
4530
4895
|
if (event.key === 'Enter' && isPromoCodeHasValue) {
|
|
4531
4896
|
setShowPromoInput(false);
|
|
4532
|
-
updateTickets(true);
|
|
4897
|
+
updateTickets(true, 'promo');
|
|
4533
4898
|
}
|
|
4534
4899
|
}
|
|
4535
4900
|
}), React__default.createElement(Button$1, {
|
|
@@ -4537,7 +4902,7 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
4537
4902
|
onClick: function onClick() {
|
|
4538
4903
|
if (isPromoCodeHasValue) {
|
|
4539
4904
|
setShowPromoInput(false);
|
|
4540
|
-
updateTickets(true);
|
|
4905
|
+
updateTickets(true, 'promo');
|
|
4541
4906
|
}
|
|
4542
4907
|
}
|
|
4543
4908
|
}, "APPLY"));
|
|
@@ -4556,6 +4921,7 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
4556
4921
|
className: "promo-code-button",
|
|
4557
4922
|
placeholder: "Promo Codes",
|
|
4558
4923
|
onClick: function onClick() {
|
|
4924
|
+
setCodeIsApplied(false);
|
|
4559
4925
|
setShowPromoInput(true);
|
|
4560
4926
|
}
|
|
4561
4927
|
}, "Got a promo code? Click here"), showPromoInput && renderInputField());
|
|
@@ -4605,6 +4971,8 @@ function Countdown(_ref) {
|
|
|
4605
4971
|
title = _ref$title === void 0 ? '' : _ref$title,
|
|
4606
4972
|
_ref$message = _ref.message,
|
|
4607
4973
|
message = _ref$message === void 0 ? '' : _ref$message,
|
|
4974
|
+
_ref$showMessage = _ref.showMessage,
|
|
4975
|
+
showMessage = _ref$showMessage === void 0 ? false : _ref$showMessage,
|
|
4608
4976
|
_ref$disableLeadingZe = _ref.disableLeadingZero,
|
|
4609
4977
|
disableLeadingZero = _ref$disableLeadingZe === void 0 ? false : _ref$disableLeadingZe,
|
|
4610
4978
|
_ref$callback = _ref.callback,
|
|
@@ -4674,7 +5042,7 @@ function Countdown(_ref) {
|
|
|
4674
5042
|
className: "countdown " + (!isLoggedIn ? 'countdown-on-bottom' : '')
|
|
4675
5043
|
}, React__default.createElement("div", null, React__default.createElement("p", {
|
|
4676
5044
|
className: 'title'
|
|
4677
|
-
}, title), React__default.createElement("p", null, duration)), React__default.createElement("p", {
|
|
5045
|
+
}, title), React__default.createElement("p", null, duration)), showMessage && React__default.createElement("p", {
|
|
4678
5046
|
className: 'message'
|
|
4679
5047
|
}, message)));
|
|
4680
5048
|
}
|
|
@@ -4734,6 +5102,10 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4734
5102
|
onGetTicketsSuccess = _ref$onGetTicketsSucc === void 0 ? function () {} : _ref$onGetTicketsSucc,
|
|
4735
5103
|
_ref$onGetTicketsErro = _ref.onGetTicketsError,
|
|
4736
5104
|
onGetTicketsError = _ref$onGetTicketsErro === void 0 ? function () {} : _ref$onGetTicketsErro,
|
|
5105
|
+
_ref$onLogoutSuccess = _ref.onLogoutSuccess,
|
|
5106
|
+
onLogoutSuccess = _ref$onLogoutSuccess === void 0 ? function () {} : _ref$onLogoutSuccess,
|
|
5107
|
+
_ref$onLogoutError = _ref.onLogoutError,
|
|
5108
|
+
onLogoutError = _ref$onLogoutError === void 0 ? function () {} : _ref$onLogoutError,
|
|
4737
5109
|
_ref$theme = _ref.theme,
|
|
4738
5110
|
theme = _ref$theme === void 0 ? 'light' : _ref$theme,
|
|
4739
5111
|
_ref$queryPromoCode = _ref.queryPromoCode,
|
|
@@ -4747,6 +5119,8 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4747
5119
|
hideSessionButtons = _ref$hideSessionButto === void 0 ? false : _ref$hideSessionButto,
|
|
4748
5120
|
_ref$hideWaitingList = _ref.hideWaitingList,
|
|
4749
5121
|
hideWaitingList = _ref$hideWaitingList === void 0 ? false : _ref$hideWaitingList,
|
|
5122
|
+
_ref$enableBillingInf = _ref.enableBillingInfoAutoCreate,
|
|
5123
|
+
enableBillingInfoAutoCreate = _ref$enableBillingInf === void 0 ? true : _ref$enableBillingInf,
|
|
4750
5124
|
_ref$isButtonScrollab = _ref.isButtonScrollable,
|
|
4751
5125
|
isButtonScrollable = _ref$isButtonScrollab === void 0 ? false : _ref$isButtonScrollab,
|
|
4752
5126
|
_ref$sortBySoldOut = _ref.sortBySoldOut,
|
|
@@ -4765,8 +5139,9 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4765
5139
|
setSelectedTickets = _useState[1];
|
|
4766
5140
|
|
|
4767
5141
|
var isWindowDefined = typeof window !== 'undefined';
|
|
5142
|
+
var xtfCookie = getCookieByName('X-TF-ECOMMERCE');
|
|
4768
5143
|
|
|
4769
|
-
var _useState2 = React.useState(isWindowDefined ? !!window.localStorage.getItem('access_token') : false),
|
|
5144
|
+
var _useState2 = React.useState((isWindowDefined ? !!window.localStorage.getItem('access_token') : false) || !!xtfCookie),
|
|
4770
5145
|
isLogged = _useState2[0],
|
|
4771
5146
|
setIsLogged = _useState2[1];
|
|
4772
5147
|
|
|
@@ -4837,17 +5212,50 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4837
5212
|
!!eventId && getTicketsApi();
|
|
4838
5213
|
}, [eventId]);
|
|
4839
5214
|
|
|
4840
|
-
var handleLogout = function
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
5215
|
+
var handleLogout = /*#__PURE__*/function () {
|
|
5216
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
5217
|
+
var _event;
|
|
5218
|
+
|
|
5219
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
5220
|
+
while (1) {
|
|
5221
|
+
switch (_context.prev = _context.next) {
|
|
5222
|
+
case 0:
|
|
5223
|
+
_context.prev = 0;
|
|
5224
|
+
_context.next = 3;
|
|
5225
|
+
return logout();
|
|
4845
5226
|
|
|
4846
|
-
|
|
5227
|
+
case 3:
|
|
5228
|
+
onLogoutSuccess();
|
|
5229
|
+
|
|
5230
|
+
if (isWindowDefined) {
|
|
5231
|
+
window.localStorage.removeItem('access_token');
|
|
5232
|
+
window.localStorage.removeItem('user_data');
|
|
5233
|
+
setIsLogged(false);
|
|
5234
|
+
_event = new window.CustomEvent('tf-logout');
|
|
5235
|
+
deleteCookieByName('X-TF-ECOMMERCE');
|
|
5236
|
+
window.document.dispatchEvent(_event);
|
|
5237
|
+
}
|
|
4847
5238
|
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
5239
|
+
_context.next = 10;
|
|
5240
|
+
break;
|
|
5241
|
+
|
|
5242
|
+
case 7:
|
|
5243
|
+
_context.prev = 7;
|
|
5244
|
+
_context.t0 = _context["catch"](0);
|
|
5245
|
+
onLogoutError(_context.t0);
|
|
5246
|
+
|
|
5247
|
+
case 10:
|
|
5248
|
+
case "end":
|
|
5249
|
+
return _context.stop();
|
|
5250
|
+
}
|
|
5251
|
+
}
|
|
5252
|
+
}, _callee, null, [[0, 7]]);
|
|
5253
|
+
}));
|
|
5254
|
+
|
|
5255
|
+
return function handleLogout() {
|
|
5256
|
+
return _ref2.apply(this, arguments);
|
|
5257
|
+
};
|
|
5258
|
+
}();
|
|
4851
5259
|
|
|
4852
5260
|
React.useEffect(function () {
|
|
4853
5261
|
try {
|
|
@@ -4856,7 +5264,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4856
5264
|
|
|
4857
5265
|
if (userData.country === '') {
|
|
4858
5266
|
handleLogout();
|
|
4859
|
-
window.open(
|
|
5267
|
+
window.open('https://www.ticketfairy.com/account/change_information?need_country=true');
|
|
4860
5268
|
}
|
|
4861
5269
|
}
|
|
4862
5270
|
} catch (e) {}
|
|
@@ -4879,34 +5287,34 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4879
5287
|
}
|
|
4880
5288
|
};
|
|
4881
5289
|
|
|
4882
|
-
function getTicketsApi(_x) {
|
|
5290
|
+
function getTicketsApi(_x, _x2) {
|
|
4883
5291
|
return _getTicketsApi.apply(this, arguments);
|
|
4884
5292
|
}
|
|
4885
5293
|
|
|
4886
5294
|
function _getTicketsApi() {
|
|
4887
|
-
_getTicketsApi = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
5295
|
+
_getTicketsApi = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(isUpdateingCode, type) {
|
|
4888
5296
|
var response, eventResponse, attributes, _event2;
|
|
4889
5297
|
|
|
4890
|
-
return runtime_1.wrap(function
|
|
5298
|
+
return runtime_1.wrap(function _callee3$(_context3) {
|
|
4891
5299
|
while (1) {
|
|
4892
|
-
switch (
|
|
5300
|
+
switch (_context3.prev = _context3.next) {
|
|
4893
5301
|
case 0:
|
|
4894
|
-
|
|
5302
|
+
_context3.prev = 0;
|
|
4895
5303
|
isUpdateingCode ? setCodeIsLoading(true) : setIsLoading(true);
|
|
4896
|
-
|
|
5304
|
+
_context3.next = 4;
|
|
4897
5305
|
return getTickets(eventId, code);
|
|
4898
5306
|
|
|
4899
5307
|
case 4:
|
|
4900
|
-
response =
|
|
4901
|
-
|
|
5308
|
+
response = _context3.sent;
|
|
5309
|
+
_context3.next = 7;
|
|
4902
5310
|
return getEvent(eventId);
|
|
4903
5311
|
|
|
4904
5312
|
case 7:
|
|
4905
|
-
eventResponse =
|
|
5313
|
+
eventResponse = _context3.sent;
|
|
4906
5314
|
|
|
4907
5315
|
if (response.data.success) {
|
|
4908
5316
|
attributes = _get(response, 'data.data.attributes');
|
|
4909
|
-
setCodeIsApplied(attributes.ValidPromoCode);
|
|
5317
|
+
type === 'promo' && setCodeIsApplied(attributes.ValidPromoCode);
|
|
4910
5318
|
setTickets(_get(attributes, 'tickets'));
|
|
4911
5319
|
setShowWaitingList(attributes.showWaitingList);
|
|
4912
5320
|
onGetTicketsSuccess(response.data);
|
|
@@ -4920,42 +5328,42 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4920
5328
|
setEvent(_event2);
|
|
4921
5329
|
}
|
|
4922
5330
|
|
|
4923
|
-
|
|
5331
|
+
_context3.next = 15;
|
|
4924
5332
|
break;
|
|
4925
5333
|
|
|
4926
5334
|
case 12:
|
|
4927
|
-
|
|
4928
|
-
|
|
5335
|
+
_context3.prev = 12;
|
|
5336
|
+
_context3.t0 = _context3["catch"](0);
|
|
4929
5337
|
|
|
4930
|
-
if (axios.isAxiosError(
|
|
4931
|
-
onGetTicketsError(
|
|
5338
|
+
if (axios.isAxiosError(_context3.t0)) {
|
|
5339
|
+
onGetTicketsError(_context3.t0);
|
|
4932
5340
|
}
|
|
4933
5341
|
|
|
4934
5342
|
case 15:
|
|
4935
|
-
|
|
5343
|
+
_context3.prev = 15;
|
|
4936
5344
|
setIsLoading(false);
|
|
4937
5345
|
setCodeIsLoading(false);
|
|
4938
|
-
return
|
|
5346
|
+
return _context3.finish(15);
|
|
4939
5347
|
|
|
4940
5348
|
case 19:
|
|
4941
5349
|
case "end":
|
|
4942
|
-
return
|
|
5350
|
+
return _context3.stop();
|
|
4943
5351
|
}
|
|
4944
5352
|
}
|
|
4945
|
-
},
|
|
5353
|
+
}, _callee3, null, [[0, 12, 15, 19]]);
|
|
4946
5354
|
}));
|
|
4947
5355
|
return _getTicketsApi.apply(this, arguments);
|
|
4948
5356
|
}
|
|
4949
5357
|
|
|
4950
5358
|
var handleTicketSelect = function handleTicketSelect(key, value) {
|
|
4951
5359
|
setSelectedTickets(function (prevState) {
|
|
4952
|
-
var
|
|
5360
|
+
var _ref3;
|
|
4953
5361
|
|
|
4954
5362
|
if (Object.keys(prevState)[0] !== key && !value) {
|
|
4955
5363
|
return prevState;
|
|
4956
5364
|
}
|
|
4957
5365
|
|
|
4958
|
-
return
|
|
5366
|
+
return _ref3 = {}, _ref3[key] = value, _ref3;
|
|
4959
5367
|
});
|
|
4960
5368
|
};
|
|
4961
5369
|
|
|
@@ -4966,14 +5374,14 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4966
5374
|
};
|
|
4967
5375
|
|
|
4968
5376
|
var handleBook = /*#__PURE__*/function () {
|
|
4969
|
-
var
|
|
5377
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
|
|
4970
5378
|
var _product_options, _product_options2, _ticket_types;
|
|
4971
5379
|
|
|
4972
5380
|
var ticket, optionName, ticketId, ticketQuantity, data, result, _result$data$data$att, _result$data, _result$data$data, _result$data$data$att2, _result$data$data$att3, _result$data2, _result$data2$data, _result$data2$data$at, _result$data$data$att4, _result$data3, _result$data3$data, _result$data3$data$at, _result$data$data$att5, _result$data4, _result$data4$data, _result$data4$data$at, skipBillingPage, nameIsRequired, ageIsRequired, phoneIsRequired, hash, total, _isWindowDefined, userData, access_token, checkoutBody, checkoutResult;
|
|
4973
5381
|
|
|
4974
|
-
return runtime_1.wrap(function
|
|
5382
|
+
return runtime_1.wrap(function _callee2$(_context2) {
|
|
4975
5383
|
while (1) {
|
|
4976
|
-
switch (
|
|
5384
|
+
switch (_context2.prev = _context2.next) {
|
|
4977
5385
|
case 0:
|
|
4978
5386
|
setHandleBookIsLoading(true);
|
|
4979
5387
|
ticket = _find(tickets, function (item) {
|
|
@@ -4994,15 +5402,15 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4994
5402
|
}, _ticket_types)
|
|
4995
5403
|
}
|
|
4996
5404
|
};
|
|
4997
|
-
|
|
4998
|
-
|
|
5405
|
+
_context2.prev = 6;
|
|
5406
|
+
_context2.next = 9;
|
|
4999
5407
|
return addToCart(eventId, data);
|
|
5000
5408
|
|
|
5001
5409
|
case 9:
|
|
5002
|
-
result =
|
|
5410
|
+
result = _context2.sent;
|
|
5003
5411
|
|
|
5004
5412
|
if (!(result.status === 200)) {
|
|
5005
|
-
|
|
5413
|
+
_context2.next = 33;
|
|
5006
5414
|
break;
|
|
5007
5415
|
}
|
|
5008
5416
|
|
|
@@ -5014,7 +5422,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5014
5422
|
total = '';
|
|
5015
5423
|
|
|
5016
5424
|
if (!skipBillingPage) {
|
|
5017
|
-
|
|
5425
|
+
_context2.next = 32;
|
|
5018
5426
|
break;
|
|
5019
5427
|
}
|
|
5020
5428
|
|
|
@@ -5023,15 +5431,29 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5023
5431
|
userData = _isWindowDefined && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
5024
5432
|
access_token = _isWindowDefined && window.localStorage.getItem('access_token') ? window.localStorage.getItem('access_token') || '' : '';
|
|
5025
5433
|
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketQuantity, userData);
|
|
5026
|
-
|
|
5434
|
+
|
|
5435
|
+
if (!enableBillingInfoAutoCreate) {
|
|
5436
|
+
_context2.next = 28;
|
|
5437
|
+
break;
|
|
5438
|
+
}
|
|
5439
|
+
|
|
5440
|
+
_context2.next = 25;
|
|
5027
5441
|
return postOnCheckout(checkoutBody, access_token);
|
|
5028
5442
|
|
|
5029
|
-
case
|
|
5030
|
-
|
|
5443
|
+
case 25:
|
|
5444
|
+
_context2.t0 = _context2.sent;
|
|
5445
|
+
_context2.next = 29;
|
|
5446
|
+
break;
|
|
5447
|
+
|
|
5448
|
+
case 28:
|
|
5449
|
+
_context2.t0 = null;
|
|
5450
|
+
|
|
5451
|
+
case 29:
|
|
5452
|
+
checkoutResult = _context2.t0;
|
|
5031
5453
|
hash = _get(checkoutResult, 'data.data.attributes.hash');
|
|
5032
5454
|
total = _get(checkoutResult, 'data.data.attributes.total');
|
|
5033
5455
|
|
|
5034
|
-
case
|
|
5456
|
+
case 32:
|
|
5035
5457
|
onAddToCartSuccess({
|
|
5036
5458
|
skip_billing_page: skipBillingPage,
|
|
5037
5459
|
names_required: nameIsRequired,
|
|
@@ -5042,44 +5464,46 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5042
5464
|
total: total
|
|
5043
5465
|
});
|
|
5044
5466
|
|
|
5045
|
-
case
|
|
5046
|
-
|
|
5467
|
+
case 33:
|
|
5468
|
+
_context2.next = 38;
|
|
5047
5469
|
break;
|
|
5048
5470
|
|
|
5049
|
-
case
|
|
5050
|
-
|
|
5051
|
-
|
|
5471
|
+
case 35:
|
|
5472
|
+
_context2.prev = 35;
|
|
5473
|
+
_context2.t1 = _context2["catch"](6);
|
|
5052
5474
|
|
|
5053
|
-
if (axios.isAxiosError(
|
|
5054
|
-
onAddToCartError(
|
|
5475
|
+
if (axios.isAxiosError(_context2.t1)) {
|
|
5476
|
+
onAddToCartError(_context2.t1);
|
|
5055
5477
|
}
|
|
5056
5478
|
|
|
5057
|
-
case
|
|
5058
|
-
|
|
5479
|
+
case 38:
|
|
5480
|
+
_context2.prev = 38;
|
|
5059
5481
|
setHandleBookIsLoading(false);
|
|
5060
|
-
return
|
|
5482
|
+
return _context2.finish(38);
|
|
5061
5483
|
|
|
5062
|
-
case
|
|
5484
|
+
case 41:
|
|
5063
5485
|
case "end":
|
|
5064
|
-
return
|
|
5486
|
+
return _context2.stop();
|
|
5065
5487
|
}
|
|
5066
5488
|
}
|
|
5067
|
-
},
|
|
5489
|
+
}, _callee2, null, [[6, 35, 38, 41]]);
|
|
5068
5490
|
}));
|
|
5069
5491
|
|
|
5070
5492
|
return function handleBook() {
|
|
5071
|
-
return
|
|
5493
|
+
return _ref4.apply(this, arguments);
|
|
5072
5494
|
};
|
|
5073
5495
|
}();
|
|
5074
5496
|
|
|
5075
|
-
var updateTickets = function updateTickets(isUpdateingCode) {
|
|
5076
|
-
getTicketsApi(isUpdateingCode);
|
|
5497
|
+
var updateTickets = function updateTickets(isUpdateingCode, type) {
|
|
5498
|
+
getTicketsApi(isUpdateingCode, type);
|
|
5077
5499
|
};
|
|
5078
5500
|
|
|
5079
5501
|
var isTicketOnSale = _some(tickets, function (item) {
|
|
5080
5502
|
return item.salesStarted && !item.salesEnded && !item.soldOut;
|
|
5081
5503
|
});
|
|
5082
5504
|
|
|
5505
|
+
var eventHasTickets = !_isEmpty(tickets);
|
|
5506
|
+
var isSalesClosed = event == null ? void 0 : event.salesEnded;
|
|
5083
5507
|
var themeMui = material.createTheme(themeOptions);
|
|
5084
5508
|
React.useEffect(function () {
|
|
5085
5509
|
isWindowDefined && window.document.addEventListener('custom-logout', handleLogout);
|
|
@@ -5124,34 +5548,35 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5124
5548
|
style: contentStyle
|
|
5125
5549
|
}, isLoading ? React__default.createElement(Loader, null) : React__default.createElement("div", {
|
|
5126
5550
|
ref: ticketsContainerRef
|
|
5127
|
-
}, React__default.createElement(TicketsSection, {
|
|
5551
|
+
}, !isSalesClosed && React__default.createElement(TicketsSection, {
|
|
5128
5552
|
ticketsList: tickets,
|
|
5129
5553
|
selectedTickets: selectedTickets,
|
|
5130
5554
|
handleTicketSelect: handleTicketSelect,
|
|
5131
|
-
codeIsApplied: codeIsApplied,
|
|
5132
5555
|
sortBySoldOut: sortBySoldOut,
|
|
5133
5556
|
ticketsHeaderComponent: ticketsHeaderComponent,
|
|
5134
5557
|
hideTicketsHeader: hideTicketsHeader || _isEmpty(tickets)
|
|
5135
|
-
}), externalUrl ? null :
|
|
5558
|
+
}), externalUrl ? null : isSalesClosed ? React__default.createElement("p", {
|
|
5136
5559
|
className: "event-closed-message " + (!isLoggedIn ? 'event-closed-on-bottom' : '')
|
|
5137
5560
|
}, "Sales for this event are closed.") : eventSaleIsNotStarted ? React__default.createElement(Countdown, {
|
|
5138
5561
|
startDate: event.salesStart,
|
|
5139
5562
|
timezone: event.timezone,
|
|
5140
5563
|
title: "Sales start in:",
|
|
5141
5564
|
message: "No tickets are currently available for this event.",
|
|
5565
|
+
showMessage: !eventHasTickets,
|
|
5142
5566
|
callback: updateTickets,
|
|
5143
5567
|
disableLeadingZero: disableCountdownLeadingZero,
|
|
5144
5568
|
isLoggedIn: isLoggedIn
|
|
5145
5569
|
}) : null, showWaitingList && event.salesStarted && !hideWaitingList && React__default.createElement(WaitingList, {
|
|
5146
5570
|
tickets: tickets,
|
|
5147
5571
|
eventId: eventId
|
|
5148
|
-
}), codeIsLoading ? React__default.createElement(Loader, null) : showAccessCodeSection ? React__default.createElement(AccessCodeSection, {
|
|
5572
|
+
}), codeIsLoading ? React__default.createElement(Loader, null) : isSalesClosed ? null : showAccessCodeSection ? React__default.createElement(AccessCodeSection, {
|
|
5149
5573
|
code: code,
|
|
5150
5574
|
setCode: setCode,
|
|
5151
5575
|
updateTickets: updateTickets
|
|
5152
5576
|
}) : showPromoCodeSection ? React__default.createElement(PromoCodeSection, {
|
|
5153
5577
|
code: code,
|
|
5154
5578
|
codeIsApplied: codeIsApplied,
|
|
5579
|
+
setCodeIsApplied: setCodeIsApplied,
|
|
5155
5580
|
showPromoInput: showPromoInput,
|
|
5156
5581
|
setShowPromoInput: setShowPromoInput,
|
|
5157
5582
|
setCode: setCode,
|
|
@@ -5197,10 +5622,8 @@ var tableConfig = function tableConfig(key) {
|
|
|
5197
5622
|
switch (key) {
|
|
5198
5623
|
default:
|
|
5199
5624
|
config = {
|
|
5200
|
-
header: [
|
|
5625
|
+
header: [],
|
|
5201
5626
|
body: [function (row) {
|
|
5202
|
-
return row.id;
|
|
5203
|
-
}, function (row) {
|
|
5204
5627
|
return row.date;
|
|
5205
5628
|
}, function (row) {
|
|
5206
5629
|
return React__default.createElement(EventInfoItem, {
|
|
@@ -5247,13 +5670,14 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
5247
5670
|
var _data$orders;
|
|
5248
5671
|
|
|
5249
5672
|
var _ref$handleDetailsInf = _ref.handleDetailsInfo,
|
|
5250
|
-
handleDetailsInfo = _ref$handleDetailsInf === void 0 ?
|
|
5673
|
+
handleDetailsInfo = _ref$handleDetailsInf === void 0 ? _identity : _ref$handleDetailsInf,
|
|
5251
5674
|
_ref$onGetOrdersSucce = _ref.onGetOrdersSuccess,
|
|
5252
|
-
onGetOrdersSuccess = _ref$onGetOrdersSucce === void 0 ?
|
|
5675
|
+
onGetOrdersSuccess = _ref$onGetOrdersSucce === void 0 ? _identity : _ref$onGetOrdersSucce,
|
|
5253
5676
|
_ref$onGetOrdersError = _ref.onGetOrdersError,
|
|
5254
|
-
onGetOrdersError = _ref$onGetOrdersError === void 0 ?
|
|
5677
|
+
onGetOrdersError = _ref$onGetOrdersError === void 0 ? _identity : _ref$onGetOrdersError,
|
|
5255
5678
|
_ref$theme = _ref.theme,
|
|
5256
|
-
theme = _ref$theme === void 0 ? 'dark' : _ref$theme
|
|
5679
|
+
theme = _ref$theme === void 0 ? 'dark' : _ref$theme,
|
|
5680
|
+
logo = _ref.logo;
|
|
5257
5681
|
|
|
5258
5682
|
var _useState = React.useState(null),
|
|
5259
5683
|
data = _useState[0],
|
|
@@ -5363,24 +5787,20 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
5363
5787
|
|
|
5364
5788
|
return React__default.createElement("div", {
|
|
5365
5789
|
className: "my-ticket " + theme
|
|
5366
|
-
},
|
|
5367
|
-
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
}, React__default.createElement("img", {
|
|
5381
|
-
src: theme === 'dark' ? 'https://www.ticketfairy.com/resources/images/logo-ttf.svg' : 'https://www.ticketfairy.com/resources/images/logo-ttf-black.svg',
|
|
5382
|
-
alt: "nodata"
|
|
5383
|
-
})))) : null, data && React__default.createElement(React__default.Fragment, null, React__default.createElement(Autocomplete, {
|
|
5790
|
+
}, React__default.createElement(React__default.Fragment, null, showModalLogin || !isLogged && React__default.createElement(LoginModal, {
|
|
5791
|
+
onClose: function onClose() {
|
|
5792
|
+
setShowModalLogin(false);
|
|
5793
|
+
},
|
|
5794
|
+
onLogin: function onLogin() {
|
|
5795
|
+
setShowModalLogin(false);
|
|
5796
|
+
setUserExpired(false);
|
|
5797
|
+
setIsLogged(true);
|
|
5798
|
+
},
|
|
5799
|
+
userExpired: userExpired,
|
|
5800
|
+
logo: logo
|
|
5801
|
+
})), data && React__default.createElement(React__default.Fragment, null, React__default.createElement("h2", null, "My Ticket Orders"), React__default.createElement("div", {
|
|
5802
|
+
className: "order_event"
|
|
5803
|
+
}, React__default.createElement(Autocomplete, {
|
|
5384
5804
|
disablePortal: true,
|
|
5385
5805
|
id: "combo-box-demo",
|
|
5386
5806
|
getOptionLabel: function getOptionLabel(option) {
|
|
@@ -5396,7 +5816,12 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
5396
5816
|
label: "Events"
|
|
5397
5817
|
}));
|
|
5398
5818
|
}
|
|
5399
|
-
}), React__default.createElement(
|
|
5819
|
+
}), React__default.createElement("button", {
|
|
5820
|
+
type: "button",
|
|
5821
|
+
className: "clear"
|
|
5822
|
+
}, "CLEAR")), loading ? React__default.createElement("div", {
|
|
5823
|
+
className: "loading"
|
|
5824
|
+
}, React__default.createElement(CircularProgress, null)) : React__default.createElement(React__default.Fragment, null, React__default.createElement(TableContainer, {
|
|
5400
5825
|
component: Paper,
|
|
5401
5826
|
className: "my-ticket-table"
|
|
5402
5827
|
}, React__default.createElement(Table, {
|
|
@@ -5419,7 +5844,7 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
5419
5844
|
page: data.page,
|
|
5420
5845
|
onPageChange: handleChangePage,
|
|
5421
5846
|
onRowsPerPageChange: handleChangeRowsPerPage
|
|
5422
|
-
})), React__default.createElement(React__default.Fragment, null, showModalLogin && React__default.createElement(LoginModal, {
|
|
5847
|
+
}))), React__default.createElement(React__default.Fragment, null, showModalLogin && React__default.createElement(LoginModal, {
|
|
5423
5848
|
onClose: function onClose() {
|
|
5424
5849
|
setShowModalLogin(false);
|
|
5425
5850
|
},
|
|
@@ -5436,29 +5861,94 @@ var TicketsTable = function TicketsTable(_ref) {
|
|
|
5436
5861
|
var _ref$tickets = _ref.tickets,
|
|
5437
5862
|
tickets = _ref$tickets === void 0 ? [] : _ref$tickets,
|
|
5438
5863
|
_ref$handleSellTicket = _ref.handleSellTicket,
|
|
5439
|
-
handleSellTicket = _ref$handleSellTicket === void 0 ?
|
|
5864
|
+
handleSellTicket = _ref$handleSellTicket === void 0 ? _identity : _ref$handleSellTicket,
|
|
5440
5865
|
_ref$handleRemoveFrom = _ref.handleRemoveFromResale,
|
|
5441
|
-
handleRemoveFromResale = _ref$handleRemoveFrom === void 0 ?
|
|
5866
|
+
handleRemoveFromResale = _ref$handleRemoveFrom === void 0 ? _identity : _ref$handleRemoveFrom,
|
|
5867
|
+
_ref$icon = _ref.icon,
|
|
5868
|
+
icon = _ref$icon === void 0 ? '' : _ref$icon;
|
|
5869
|
+
|
|
5870
|
+
var _useState = React.useState(null),
|
|
5871
|
+
pdfError = _useState[0],
|
|
5872
|
+
setPdfError = _useState[1];
|
|
5873
|
+
|
|
5442
5874
|
return React__default.createElement("div", {
|
|
5443
5875
|
className: "tickets-box"
|
|
5444
|
-
}, React__default.createElement(
|
|
5876
|
+
}, React__default.createElement(SnackbarAlert, {
|
|
5877
|
+
type: "error",
|
|
5878
|
+
isOpen: !!pdfError,
|
|
5879
|
+
message: pdfError || '',
|
|
5880
|
+
onClose: function onClose() {
|
|
5881
|
+
return setPdfError(null);
|
|
5882
|
+
}
|
|
5883
|
+
}), React__default.createElement("h4", {
|
|
5445
5884
|
className: "sub-title"
|
|
5446
5885
|
}, "Your Tickets"), React__default.createElement(TableContainer, {
|
|
5447
5886
|
component: Paper
|
|
5448
5887
|
}, React__default.createElement(Table, {
|
|
5449
5888
|
"aria-label": "collapsible table"
|
|
5450
|
-
}, React__default.createElement(TableHead, null, React__default.createElement(TableRow, null, React__default.createElement(TableCell, null
|
|
5889
|
+
}, React__default.createElement(TableHead, null, React__default.createElement(TableRow, null, React__default.createElement(TableCell, null), React__default.createElement(TableCell, null), React__default.createElement(TableCell, null), React__default.createElement(TableCell, null), React__default.createElement(TableCell, null), React__default.createElement(TableCell, null))), React__default.createElement(TableBody, null, tickets.map(function (ticket, index) {
|
|
5451
5890
|
var _ticket$add_ons;
|
|
5452
5891
|
|
|
5453
5892
|
return React__default.createElement(React.Fragment, {
|
|
5454
5893
|
key: index
|
|
5455
|
-
}, React__default.createElement(TableRow, null, React__default.createElement(TableCell, null,
|
|
5894
|
+
}, React__default.createElement(TableRow, null, React__default.createElement(TableCell, null, React__default.createElement("div", {
|
|
5895
|
+
className: "cell-block"
|
|
5896
|
+
}, React__default.createElement("span", null, "Ticket ID"), React__default.createElement("span", null, ticket.hash))), React__default.createElement(TableCell, null, React__default.createElement("div", {
|
|
5897
|
+
className: "cell-block"
|
|
5898
|
+
}, React__default.createElement("span", null, "Ticket Type"), React__default.createElement("span", null, ticket.ticket_type))), React__default.createElement(TableCell, null, React__default.createElement("div", {
|
|
5899
|
+
className: "cell-block"
|
|
5900
|
+
}, React__default.createElement("span", null, "Ticket Holder"), React__default.createElement("span", null, ticket.holder_name))), React__default.createElement(TableCell, null, React__default.createElement("div", {
|
|
5901
|
+
className: "cell-block"
|
|
5902
|
+
}, React__default.createElement("span", null, "Status"), React__default.createElement("span", null, ticket.status))), ticket.pdf_link && ticket.status !== "Sold" ? React__default.createElement(TableCell, null, Boolean(icon) && React__default.createElement("img", {
|
|
5903
|
+
src: icon,
|
|
5904
|
+
alt: "nodata"
|
|
5905
|
+
}), React__default.createElement("span", {
|
|
5456
5906
|
"aria-hidden": true,
|
|
5457
5907
|
className: "action-button",
|
|
5458
|
-
onClick: function
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
|
|
5908
|
+
onClick: function () {
|
|
5909
|
+
var _onClick = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
5910
|
+
var pdfDownloadError;
|
|
5911
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
5912
|
+
while (1) {
|
|
5913
|
+
switch (_context.prev = _context.next) {
|
|
5914
|
+
case 0:
|
|
5915
|
+
_context.prev = 0;
|
|
5916
|
+
_context.next = 3;
|
|
5917
|
+
return downloadPDF(ticket.pdf_link);
|
|
5918
|
+
|
|
5919
|
+
case 3:
|
|
5920
|
+
pdfDownloadError = _context.sent;
|
|
5921
|
+
|
|
5922
|
+
if (pdfDownloadError) {
|
|
5923
|
+
setPdfError(pdfDownloadError == null ? void 0 : pdfDownloadError.message);
|
|
5924
|
+
}
|
|
5925
|
+
|
|
5926
|
+
_context.next = 10;
|
|
5927
|
+
break;
|
|
5928
|
+
|
|
5929
|
+
case 7:
|
|
5930
|
+
_context.prev = 7;
|
|
5931
|
+
_context.t0 = _context["catch"](0);
|
|
5932
|
+
|
|
5933
|
+
if (_context.t0 && typeof _context.t0 === 'string') {
|
|
5934
|
+
setPdfError(_context.t0);
|
|
5935
|
+
}
|
|
5936
|
+
|
|
5937
|
+
case 10:
|
|
5938
|
+
case "end":
|
|
5939
|
+
return _context.stop();
|
|
5940
|
+
}
|
|
5941
|
+
}
|
|
5942
|
+
}, _callee, null, [[0, 7]]);
|
|
5943
|
+
}));
|
|
5944
|
+
|
|
5945
|
+
function onClick() {
|
|
5946
|
+
return _onClick.apply(this, arguments);
|
|
5947
|
+
}
|
|
5948
|
+
|
|
5949
|
+
return onClick;
|
|
5950
|
+
}()
|
|
5951
|
+
}, "Download")) : null, React__default.createElement(TableCell, null, ticket.is_sellable && React__default.createElement("span", {
|
|
5462
5952
|
"aria-hidden": true,
|
|
5463
5953
|
className: "action-button",
|
|
5464
5954
|
onClick: function onClick() {
|
|
@@ -5482,11 +5972,11 @@ var TicketsTable = function TicketsTable(_ref) {
|
|
|
5482
5972
|
})))));
|
|
5483
5973
|
};
|
|
5484
5974
|
|
|
5485
|
-
var _excluded$
|
|
5975
|
+
var _excluded$2 = ["label", "field", "theme"];
|
|
5486
5976
|
var RadioField = function RadioField(_ref) {
|
|
5487
5977
|
var label = _ref.label,
|
|
5488
5978
|
field = _ref.field,
|
|
5489
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
5979
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
5490
5980
|
|
|
5491
5981
|
var customTheme = styles.useTheme();
|
|
5492
5982
|
return React__default.createElement(FormGroup, null, React__default.createElement(FormControlLabel, {
|
|
@@ -5498,7 +5988,7 @@ var RadioField = function RadioField(_ref) {
|
|
|
5498
5988
|
}));
|
|
5499
5989
|
};
|
|
5500
5990
|
|
|
5501
|
-
var style$
|
|
5991
|
+
var style$3 = {
|
|
5502
5992
|
position: 'absolute',
|
|
5503
5993
|
top: '50%',
|
|
5504
5994
|
left: '50%',
|
|
@@ -5511,33 +6001,33 @@ var style$1 = {
|
|
|
5511
6001
|
maxHeight: '85vh',
|
|
5512
6002
|
overflow: 'auto'
|
|
5513
6003
|
};
|
|
5514
|
-
var schema = /*#__PURE__*/
|
|
5515
|
-
to: /*#__PURE__*/
|
|
5516
|
-
first_name: /*#__PURE__*/
|
|
6004
|
+
var schema = /*#__PURE__*/Yup.object().shape({
|
|
6005
|
+
to: /*#__PURE__*/Yup.string().required(),
|
|
6006
|
+
first_name: /*#__PURE__*/Yup.string().when('to', {
|
|
5517
6007
|
is: function is(to) {
|
|
5518
6008
|
return to === 'friend';
|
|
5519
6009
|
},
|
|
5520
|
-
then: /*#__PURE__*/
|
|
6010
|
+
then: /*#__PURE__*/Yup.string().required('First Name is required')
|
|
5521
6011
|
}),
|
|
5522
|
-
last_name: /*#__PURE__*/
|
|
6012
|
+
last_name: /*#__PURE__*/Yup.string().when('to', {
|
|
5523
6013
|
is: function is(to) {
|
|
5524
6014
|
return to === 'friend';
|
|
5525
6015
|
},
|
|
5526
|
-
then: /*#__PURE__*/
|
|
6016
|
+
then: /*#__PURE__*/Yup.string().required('Last Name is required')
|
|
5527
6017
|
}),
|
|
5528
|
-
email: /*#__PURE__*/
|
|
6018
|
+
email: /*#__PURE__*/Yup.string().when('to', {
|
|
5529
6019
|
is: function is(to) {
|
|
5530
6020
|
return to === 'friend';
|
|
5531
6021
|
},
|
|
5532
|
-
then: /*#__PURE__*/
|
|
6022
|
+
then: /*#__PURE__*/Yup.string().email('Invalid email').required('Email is required')
|
|
5533
6023
|
}),
|
|
5534
|
-
confirm_email: /*#__PURE__*/
|
|
6024
|
+
confirm_email: /*#__PURE__*/Yup.string().when('to', {
|
|
5535
6025
|
is: function is(to) {
|
|
5536
6026
|
return to === 'friend';
|
|
5537
6027
|
},
|
|
5538
|
-
then: /*#__PURE__*/
|
|
6028
|
+
then: /*#__PURE__*/Yup.string().email('Invalid email').oneOf([Yup.ref('email'), null], 'Emails must match').required('Confirm Email is required')
|
|
5539
6029
|
}),
|
|
5540
|
-
confirm: /*#__PURE__*/
|
|
6030
|
+
confirm: /*#__PURE__*/Yup.boolean().oneOf([true])
|
|
5541
6031
|
});
|
|
5542
6032
|
var initialValues = {
|
|
5543
6033
|
to: 'friend',
|
|
@@ -5567,7 +6057,7 @@ var TicketResaleModal = function TicketResaleModal(_ref) {
|
|
|
5567
6057
|
"aria-describedby": "modal-modal-description",
|
|
5568
6058
|
className: 'resale-modal'
|
|
5569
6059
|
}, React__default.createElement(Box, {
|
|
5570
|
-
style: style$
|
|
6060
|
+
style: style$3
|
|
5571
6061
|
}, React__default.createElement("h3", null, "Sell Ticket"), React__default.createElement("div", null, React__default.createElement("h3", null, "Ticket Details"), React__default.createElement("div", null, React__default.createElement("h4", null, "Event"), React__default.createElement("p", null, event_name)), React__default.createElement("div", null, React__default.createElement("h4", null, "Ticket Holder"), React__default.createElement("p", null, holder_name)), React__default.createElement("div", null, React__default.createElement("h4", null, "Ticket ID"), React__default.createElement("p", null, hash))), React__default.createElement("div", null, React__default.createElement("h3", null, "Sell to Whom"), React__default.createElement(formik.Formik, {
|
|
5572
6062
|
initialValues: initialValues,
|
|
5573
6063
|
validationSchema: schema,
|
|
@@ -5633,12 +6123,12 @@ var TicketResaleModal = function TicketResaleModal(_ref) {
|
|
|
5633
6123
|
type: 'text',
|
|
5634
6124
|
component: CustomField
|
|
5635
6125
|
}))))), ticket_type_is_active && React__default.createElement("div", null, React__default.createElement(formik.Field, {
|
|
5636
|
-
name:
|
|
5637
|
-
label:
|
|
5638
|
-
type:
|
|
5639
|
-
value:
|
|
6126
|
+
name: "to",
|
|
6127
|
+
label: "I will sell my ticket to anyone who wants to buy it",
|
|
6128
|
+
type: "radio",
|
|
6129
|
+
value: "anyone",
|
|
5640
6130
|
component: RadioField
|
|
5641
|
-
})), React__default.createElement("div", null, React__default.createElement("h4", null, "Terms of Resale"), React__default.createElement("p", null, "I confirm that I want to sell this ticket and that, if someone chooses to buy it, I will no longer own it or have the right to ask for it back."), React__default.createElement("p", null, "I also understand that, if no one chooses to buy it, it remains my property, is valid for entry to ", React__default.createElement("strong", null, event_name), " and I will not receive any refund."), React__default.createElement("p", null, "If my ticket is sold, the original card I used to buy my ticket will be refunded with the original amount paid, minus a small handling fee of ", React__default.createElement("strong", null, currency + resale_fee_amount), ", and that any existing refunds due to me for referring sales for this event are no longer valid."), React__default.createElement(formik.Field, {
|
|
6131
|
+
})), React__default.createElement("div", null, React__default.createElement("h4", null, "Terms of Resale"), React__default.createElement("p", null, "I confirm that I want to sell this ticket and that, if someone chooses to buy it, I will no longer own it or have the right to ask for it back."), React__default.createElement("p", null, "I also understand that, if no one chooses to buy it, it remains my property, is valid for entry to ", React__default.createElement("strong", null, event_name), " and I will not receive any refund."), React__default.createElement("p", null, "If my ticket is sold, the original card I used to buy my ticket will be refunded with the original amount paid, minus a small handling fee of ", React__default.createElement("strong", null, (currency || '') + " " + (resale_fee_amount || '')), ", and that any existing refunds due to me for referring sales for this event are no longer valid."), React__default.createElement(formik.Field, {
|
|
5642
6132
|
name: 'confirm',
|
|
5643
6133
|
label: 'I agree',
|
|
5644
6134
|
type: 'checkbox',
|
|
@@ -5652,7 +6142,7 @@ var TicketResaleModal = function TicketResaleModal(_ref) {
|
|
|
5652
6142
|
}))));
|
|
5653
6143
|
};
|
|
5654
6144
|
|
|
5655
|
-
var style$
|
|
6145
|
+
var style$4 = {
|
|
5656
6146
|
position: 'absolute',
|
|
5657
6147
|
top: '50%',
|
|
5658
6148
|
left: '50%',
|
|
@@ -5680,7 +6170,7 @@ var ConfirmModal = function ConfirmModal(_ref) {
|
|
|
5680
6170
|
"aria-describedby": "modal-modal-description",
|
|
5681
6171
|
className: 'confirm-modal'
|
|
5682
6172
|
}, React__default.createElement(Box, {
|
|
5683
|
-
style: style$
|
|
6173
|
+
style: style$4
|
|
5684
6174
|
}, React__default.createElement("p", null, message), React__default.createElement("div", {
|
|
5685
6175
|
className: 'footer'
|
|
5686
6176
|
}, React__default.createElement(Button, {
|
|
@@ -5698,10 +6188,15 @@ var getTotal = function getTotal(data) {
|
|
|
5698
6188
|
var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
5699
6189
|
var _data$items, _data$items$ticket_ty, _data$items2, _data$items2$add_ons;
|
|
5700
6190
|
|
|
5701
|
-
var _ref$
|
|
6191
|
+
var _ref$columns = _ref.columns,
|
|
6192
|
+
columns = _ref$columns === void 0 ? [] : _ref$columns,
|
|
6193
|
+
_ref$onGetOrdersSucce = _ref.onGetOrdersSuccess,
|
|
5702
6194
|
onGetOrdersSuccess = _ref$onGetOrdersSucce === void 0 ? function () {} : _ref$onGetOrdersSucce,
|
|
5703
6195
|
_ref$onGetOrdersError = _ref.onGetOrdersError,
|
|
5704
|
-
onGetOrdersError = _ref$onGetOrdersError === void 0 ? function () {} : _ref$onGetOrdersError
|
|
6196
|
+
onGetOrdersError = _ref$onGetOrdersError === void 0 ? function () {} : _ref$onGetOrdersError,
|
|
6197
|
+
onReturnButtonClick = _ref.onReturnButtonClick,
|
|
6198
|
+
_ref$personalLinkIcon = _ref.personalLinkIcon,
|
|
6199
|
+
personalLinkIcon = _ref$personalLinkIcon === void 0 ? '' : _ref$personalLinkIcon;
|
|
5705
6200
|
|
|
5706
6201
|
var _useState = React.useState({}),
|
|
5707
6202
|
data = _useState[0],
|
|
@@ -5902,6 +6397,12 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
5902
6397
|
};
|
|
5903
6398
|
}();
|
|
5904
6399
|
|
|
6400
|
+
var orderSummery = "ID " + data.id + ", placed";
|
|
6401
|
+
|
|
6402
|
+
if (data.date) {
|
|
6403
|
+
orderSummery += " " + data.date;
|
|
6404
|
+
}
|
|
6405
|
+
|
|
5905
6406
|
return React__default.createElement("div", {
|
|
5906
6407
|
className: "order-details"
|
|
5907
6408
|
}, loading ? React__default.createElement("div", {
|
|
@@ -5910,19 +6411,45 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
5910
6411
|
className: "layout-title"
|
|
5911
6412
|
}, "Order Details"), React__default.createElement("div", {
|
|
5912
6413
|
className: "order-summary-box"
|
|
5913
|
-
}, React__default.createElement("
|
|
6414
|
+
}, React__default.createElement("div", {
|
|
6415
|
+
className: "summary-block"
|
|
6416
|
+
}, React__default.createElement("div", {
|
|
6417
|
+
className: "summary-item"
|
|
6418
|
+
}, React__default.createElement("h6", {
|
|
5914
6419
|
className: "sub-title"
|
|
5915
|
-
}, "Order Summary"), React__default.createElement("div", {
|
|
6420
|
+
}, "Order Summary"), React__default.createElement("p", null, orderSummery)), React__default.createElement("div", {
|
|
6421
|
+
className: "summary-item"
|
|
6422
|
+
}, React__default.createElement("div", {
|
|
6423
|
+
className: "return-button-container"
|
|
6424
|
+
}, React__default.createElement("button", {
|
|
6425
|
+
type: "button",
|
|
6426
|
+
className: "return-button",
|
|
6427
|
+
onClick: function onClick() {
|
|
6428
|
+
if (typeof window !== 'undefined') {
|
|
6429
|
+
window.location.assign('/orders');
|
|
6430
|
+
}
|
|
6431
|
+
}
|
|
6432
|
+
}, "Back to Orders")))), React__default.createElement("div", {
|
|
5916
6433
|
className: "personal-link"
|
|
5917
|
-
}, React__default.createElement("
|
|
6434
|
+
}, React__default.createElement("div", {
|
|
6435
|
+
className: "link-item"
|
|
6436
|
+
}, React__default.createElement("span", null, "Personal Share Link: "), React__default.createElement("a", {
|
|
5918
6437
|
href: data == null ? void 0 : data.personal_share_link,
|
|
5919
6438
|
target: "_blank",
|
|
5920
6439
|
rel: "noreferrer"
|
|
5921
|
-
},
|
|
6440
|
+
}, Boolean(personalLinkIcon) && React__default.createElement("img", {
|
|
6441
|
+
src: personalLinkIcon,
|
|
6442
|
+
alt: "Icon"
|
|
6443
|
+
}), data == null ? void 0 : data.personal_share_link)), React__default.createElement("div", {
|
|
6444
|
+
className: "link-item"
|
|
6445
|
+
}, React__default.createElement("p", null, "So far, you\u2019ve referred " + data.sales_referred + " tickets"))), React__default.createElement(TableContainer, {
|
|
5922
6446
|
component: Paper
|
|
5923
6447
|
}, React__default.createElement(Table, {
|
|
6448
|
+
className: "tt-type",
|
|
5924
6449
|
"aria-label": "collapsible table"
|
|
5925
|
-
}, React__default.createElement(TableHead, null, React__default.createElement(TableRow, null,
|
|
6450
|
+
}, React__default.createElement(TableHead, null, React__default.createElement(TableRow, null, _map(columns, function (item) {
|
|
6451
|
+
return React__default.createElement(TableCell, null, item.label || '');
|
|
6452
|
+
}))), React__default.createElement(TableBody, null, data == null ? void 0 : (_data$items = data.items) == null ? void 0 : (_data$items$ticket_ty = _data$items.ticket_types) == null ? void 0 : _data$items$ticket_ty.map(function (ticket, index) {
|
|
5926
6453
|
return React__default.createElement(TableRow, {
|
|
5927
6454
|
key: index
|
|
5928
6455
|
}, React__default.createElement(TableCell, null, React__default.createElement("b", null, "Ticket Type: "), ticket.name), React__default.createElement(TableCell, null, ticket.currency + ticket.price), React__default.createElement(TableCell, null, ticket.quantity), React__default.createElement(TableCell, null, ticket.currency + ticket.total));
|
|
@@ -5942,7 +6469,9 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
5942
6469
|
type: "button",
|
|
5943
6470
|
className: "return-button",
|
|
5944
6471
|
onClick: function onClick() {
|
|
5945
|
-
if (
|
|
6472
|
+
if (onReturnButtonClick) {
|
|
6473
|
+
onReturnButtonClick(data);
|
|
6474
|
+
} else if (typeof window !== 'undefined') {
|
|
5946
6475
|
window.location.assign('/orders');
|
|
5947
6476
|
}
|
|
5948
6477
|
}
|
|
@@ -5957,6 +6486,120 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
5957
6486
|
}));
|
|
5958
6487
|
};
|
|
5959
6488
|
|
|
6489
|
+
var Schema$1 = /*#__PURE__*/Yup.object().shape({
|
|
6490
|
+
password: /*#__PURE__*/Yup.string().min(6, 'Password must have 5+ characters').required('Required'),
|
|
6491
|
+
password_confirmation: /*#__PURE__*/Yup.string().required('Required').oneOf([/*#__PURE__*/Yup.ref('password'), null], 'Passwords must match')
|
|
6492
|
+
});
|
|
6493
|
+
var ResetPasswordContainer = function ResetPasswordContainer(_ref) {
|
|
6494
|
+
var _ref$token = _ref.token,
|
|
6495
|
+
tokenProps = _ref$token === void 0 ? '' : _ref$token,
|
|
6496
|
+
_ref$onResetPasswordS = _ref.onResetPasswordSuccess,
|
|
6497
|
+
onResetPasswordSuccess = _ref$onResetPasswordS === void 0 ? function () {} : _ref$onResetPasswordS,
|
|
6498
|
+
_ref$onResetPasswordE = _ref.onResetPasswordError,
|
|
6499
|
+
onResetPasswordError = _ref$onResetPasswordE === void 0 ? function () {} : _ref$onResetPasswordE;
|
|
6500
|
+
|
|
6501
|
+
var _useState = React.useState(false),
|
|
6502
|
+
loading = _useState[0],
|
|
6503
|
+
setLoading = _useState[1];
|
|
6504
|
+
|
|
6505
|
+
return React__default.createElement("div", {
|
|
6506
|
+
className: "reset-password"
|
|
6507
|
+
}, React__default.createElement("div", {
|
|
6508
|
+
className: "title"
|
|
6509
|
+
}, "Change Password"), React__default.createElement(formik.Formik, {
|
|
6510
|
+
initialValues: {
|
|
6511
|
+
password: '',
|
|
6512
|
+
password_confirmation: ''
|
|
6513
|
+
},
|
|
6514
|
+
validationSchema: Schema$1,
|
|
6515
|
+
onSubmit: function () {
|
|
6516
|
+
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(values) {
|
|
6517
|
+
var token, params, payload, res;
|
|
6518
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
6519
|
+
while (1) {
|
|
6520
|
+
switch (_context.prev = _context.next) {
|
|
6521
|
+
case 0:
|
|
6522
|
+
_context.prev = 0;
|
|
6523
|
+
setLoading(true);
|
|
6524
|
+
|
|
6525
|
+
if (tokenProps) {
|
|
6526
|
+
token = tokenProps;
|
|
6527
|
+
} else {
|
|
6528
|
+
if (typeof window !== 'undefined') {
|
|
6529
|
+
params = new URL("" + window.location).searchParams;
|
|
6530
|
+
token = params.get('token');
|
|
6531
|
+
}
|
|
6532
|
+
}
|
|
6533
|
+
|
|
6534
|
+
payload = _extends({
|
|
6535
|
+
token: token
|
|
6536
|
+
}, values);
|
|
6537
|
+
_context.next = 6;
|
|
6538
|
+
return resetPassword(payload);
|
|
6539
|
+
|
|
6540
|
+
case 6:
|
|
6541
|
+
res = _context.sent;
|
|
6542
|
+
onResetPasswordSuccess(res);
|
|
6543
|
+
_context.next = 13;
|
|
6544
|
+
break;
|
|
6545
|
+
|
|
6546
|
+
case 10:
|
|
6547
|
+
_context.prev = 10;
|
|
6548
|
+
_context.t0 = _context["catch"](0);
|
|
6549
|
+
|
|
6550
|
+
if (axios.isAxiosError(_context.t0)) {
|
|
6551
|
+
onResetPasswordError(_context.t0);
|
|
6552
|
+
}
|
|
6553
|
+
|
|
6554
|
+
case 13:
|
|
6555
|
+
_context.prev = 13;
|
|
6556
|
+
setLoading(false);
|
|
6557
|
+
return _context.finish(13);
|
|
6558
|
+
|
|
6559
|
+
case 16:
|
|
6560
|
+
case "end":
|
|
6561
|
+
return _context.stop();
|
|
6562
|
+
}
|
|
6563
|
+
}
|
|
6564
|
+
}, _callee, null, [[0, 10, 13, 16]]);
|
|
6565
|
+
}));
|
|
6566
|
+
|
|
6567
|
+
function onSubmit(_x) {
|
|
6568
|
+
return _onSubmit.apply(this, arguments);
|
|
6569
|
+
}
|
|
6570
|
+
|
|
6571
|
+
return onSubmit;
|
|
6572
|
+
}()
|
|
6573
|
+
}, function (_ref2) {
|
|
6574
|
+
var isValid = _ref2.isValid,
|
|
6575
|
+
dirty = _ref2.dirty;
|
|
6576
|
+
return React__default.createElement(formik.Form, null, React__default.createElement("div", {
|
|
6577
|
+
className: "body"
|
|
6578
|
+
}, React__default.createElement("div", {
|
|
6579
|
+
className: "field-item"
|
|
6580
|
+
}, React__default.createElement(formik.Field, {
|
|
6581
|
+
name: "password",
|
|
6582
|
+
label: "New Password",
|
|
6583
|
+
type: "password",
|
|
6584
|
+
component: CustomField
|
|
6585
|
+
})), React__default.createElement("div", {
|
|
6586
|
+
className: "field-item"
|
|
6587
|
+
}, React__default.createElement(formik.Field, {
|
|
6588
|
+
name: "password_confirmation",
|
|
6589
|
+
label: "Confirm Password",
|
|
6590
|
+
type: "password",
|
|
6591
|
+
component: CustomField
|
|
6592
|
+
}))), React__default.createElement("div", {
|
|
6593
|
+
className: "action-button"
|
|
6594
|
+
}, React__default.createElement("button", {
|
|
6595
|
+
type: "submit",
|
|
6596
|
+
disabled: !(isValid && dirty)
|
|
6597
|
+
}, loading ? React__default.createElement(material.CircularProgress, {
|
|
6598
|
+
size: "22px"
|
|
6599
|
+
}) : 'Submit')));
|
|
6600
|
+
}));
|
|
6601
|
+
};
|
|
6602
|
+
|
|
5960
6603
|
var TicketResaleContainer = function TicketResaleContainer(_ref) {
|
|
5961
6604
|
var _ref$onProcessTicketS = _ref.onProcessTicketSuccess,
|
|
5962
6605
|
onProcessTicketSuccess = _ref$onProcessTicketS === void 0 ? function () {} : _ref$onProcessTicketS,
|
|
@@ -6068,7 +6711,7 @@ var TicketResaleContainer = function TicketResaleContainer(_ref) {
|
|
|
6068
6711
|
}, React__default.createElement("h3", null, successMessage ? successMessage : error)));
|
|
6069
6712
|
};
|
|
6070
6713
|
|
|
6071
|
-
var style$
|
|
6714
|
+
var style$5 = {
|
|
6072
6715
|
position: 'absolute',
|
|
6073
6716
|
top: '10%',
|
|
6074
6717
|
left: '50%',
|
|
@@ -6092,7 +6735,7 @@ var RedirectModal = function RedirectModal(_ref) {
|
|
|
6092
6735
|
"aria-describedby": "modal-modal-description",
|
|
6093
6736
|
className: "redirect-modal"
|
|
6094
6737
|
}, React__default.createElement(Box, {
|
|
6095
|
-
style: style$
|
|
6738
|
+
style: style$5
|
|
6096
6739
|
}, React__default.createElement("p", null, message), React__default.createElement("div", {
|
|
6097
6740
|
className: "footer"
|
|
6098
6741
|
}, React__default.createElement("button", {
|
|
@@ -6100,7 +6743,7 @@ var RedirectModal = function RedirectModal(_ref) {
|
|
|
6100
6743
|
}, "OK"))));
|
|
6101
6744
|
};
|
|
6102
6745
|
|
|
6103
|
-
var style$
|
|
6746
|
+
var style$6 = {
|
|
6104
6747
|
position: 'absolute',
|
|
6105
6748
|
top: '50%',
|
|
6106
6749
|
left: '50%',
|
|
@@ -6206,7 +6849,7 @@ var RsvpContainer = function RsvpContainer(_ref) {
|
|
|
6206
6849
|
"aria-describedby": "modal-modal-description",
|
|
6207
6850
|
className: "rsvp-modal"
|
|
6208
6851
|
}, React__default.createElement(Box, {
|
|
6209
|
-
style: style$
|
|
6852
|
+
style: style$6,
|
|
6210
6853
|
className: "rsvp-modal-box"
|
|
6211
6854
|
}, React__default.createElement("div", {
|
|
6212
6855
|
className: "rsvp-modal-container"
|
|
@@ -6249,11 +6892,13 @@ var RsvpContainer = function RsvpContainer(_ref) {
|
|
|
6249
6892
|
|
|
6250
6893
|
exports.BillingInfoContainer = BillingInfoContainer;
|
|
6251
6894
|
exports.ConfirmationContainer = ConfirmationContainer;
|
|
6895
|
+
exports.ForgotPasswordModal = ForgotPasswordModal;
|
|
6252
6896
|
exports.LoginModal = LoginModal;
|
|
6253
6897
|
exports.MyTicketsContainer = MyTicketsContainer;
|
|
6254
6898
|
exports.OrderDetailsContainer = OrderDetailsContainer;
|
|
6255
6899
|
exports.PaymentContainer = PaymentContainer;
|
|
6256
6900
|
exports.RedirectModal = RedirectModal;
|
|
6901
|
+
exports.ResetPasswordContainer = ResetPasswordContainer;
|
|
6257
6902
|
exports.RsvpContainer = RsvpContainer;
|
|
6258
6903
|
exports.TicketResaleContainer = TicketResaleContainer;
|
|
6259
6904
|
exports.TicketsContainer = TicketsContainer;
|