tf-checkout-react 1.0.106 → 1.2.1
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 +11 -8
- 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 +7 -3
- package/dist/index.d.ts +2 -0
- package/dist/tf-checkout-react.cjs.development.js +2177 -1482
- 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 +2166 -1473
- 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 +100 -29
- 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 +145 -99
- 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 +80 -21
- package/src/components/orderDetailsContainer/style.css +7 -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 +155 -86
- 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
|
@@ -1,61 +1,62 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { FormControl, FormHelperText, InputLabel, Snackbar, Alert, Modal, Box, CircularProgress as CircularProgress$1, TextField as TextField$1, createTheme as createTheme$1 } from '@mui/material';
|
|
2
|
+
import Backdrop from '@mui/material/Backdrop';
|
|
3
3
|
import Button from '@mui/material/Button';
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import { ThemeProvider, createTheme } from '@mui/material/styles';
|
|
5
|
+
import axios from 'axios';
|
|
6
|
+
import { connect, Formik, Form, Field } from 'formik';
|
|
6
7
|
import _get from 'lodash-es/get';
|
|
8
|
+
import _identity from 'lodash-es/identity';
|
|
7
9
|
import _includes from 'lodash-es/includes';
|
|
8
|
-
import _isEqual from 'lodash-es/isEqual';
|
|
9
10
|
import _isEmpty from 'lodash-es/isEmpty';
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { TextField, FormControl, FormHelperText, InputLabel, Snackbar, Alert, CircularProgress as CircularProgress$1, createTheme as createTheme$1 } from '@mui/material';
|
|
13
|
-
import Modal from '@mui/material/Modal';
|
|
14
|
-
import Box from '@mui/material/Box';
|
|
15
|
-
import _flatMapDeep from 'lodash-es/flatMapDeep';
|
|
16
|
-
import _isArray from 'lodash-es/isArray';
|
|
11
|
+
import _isEqual from 'lodash-es/isEqual';
|
|
12
|
+
import _map from 'lodash-es/map';
|
|
17
13
|
import { nanoid } from 'nanoid';
|
|
14
|
+
import React, { Component, useCallback, useEffect, useState, memo, useRef, Fragment } from 'react';
|
|
15
|
+
import _forEach from 'lodash-es/forEach';
|
|
16
|
+
import DatePicker from '@mui/lab/DatePicker';
|
|
17
|
+
import AdapterMoment from '@mui/lab/AdapterMoment';
|
|
18
|
+
import LocalizationProvider from '@mui/lab/LocalizationProvider';
|
|
19
|
+
import TextField from '@mui/material/TextField';
|
|
20
|
+
import { useTheme } from '@mui/styles';
|
|
18
21
|
import FormGroup from '@mui/material/FormGroup';
|
|
19
22
|
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
20
23
|
import Checkbox from '@mui/material/Checkbox';
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import MuiPhoneNumber from 'material-ui-phone-number';
|
|
24
|
+
import 'material-ui-phone-number';
|
|
25
|
+
import _debounce from 'lodash-es/debounce';
|
|
24
26
|
import CircularProgress from '@mui/material/CircularProgress';
|
|
25
27
|
import Select from '@mui/material/Select';
|
|
26
|
-
import {
|
|
27
|
-
import
|
|
28
|
+
import { object, string, ref, boolean } from 'yup';
|
|
29
|
+
import Box$1 from '@mui/material/Box';
|
|
30
|
+
import Modal$1 from '@mui/material/Modal';
|
|
28
31
|
import Countdown$1 from 'react-countdown';
|
|
29
32
|
import _isNumber from 'lodash-es/isNumber';
|
|
30
33
|
import SVG from 'react-inlinesvg';
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import LocalizationProvider from '@mui/lab/LocalizationProvider';
|
|
34
|
+
import _flatMapDeep from 'lodash-es/flatMapDeep';
|
|
35
|
+
import _isArray from 'lodash-es/isArray';
|
|
34
36
|
import Container from '@mui/material/Container';
|
|
35
37
|
import Alert$1 from '@mui/material/Alert';
|
|
36
38
|
import { useStripe, useElements, CardNumberElement, CardExpiryElement, CardCvcElement, Elements } from '@stripe/react-stripe-js';
|
|
37
39
|
import { loadStripe } from '@stripe/stripe-js';
|
|
38
40
|
import { FacebookShareButton, FacebookIcon, FacebookMessengerShareButton, FacebookMessengerIcon, TwitterShareButton, TwitterIcon, LinkedinShareButton, LinkedinIcon, PinterestShareButton, PinterestIcon, VKShareButton, VKIcon, OKShareButton, OKIcon, TelegramShareButton, TelegramIcon, WhatsappShareButton, WhatsappIcon, RedditShareButton, RedditIcon, TumblrShareButton, TumblrIcon, MailruShareButton, MailruIcon, EmailShareButton, EmailIcon, LivejournalShareButton, LivejournalIcon, ViberShareButton, ViberIcon, WorkplaceShareButton, WorkplaceIcon, LineShareButton, LineIcon, PocketShareButton, PocketIcon, InstapaperShareButton, InstapaperIcon, WeiboShareButton, WeiboIcon, HatenaShareButton, HatenaIcon } from 'react-share';
|
|
39
|
-
import
|
|
41
|
+
import { ThemeProvider as ThemeProvider$1 } from '@mui/private-theming';
|
|
42
|
+
import jwt_decode from 'jwt-decode';
|
|
40
43
|
import _find from 'lodash-es/find';
|
|
44
|
+
import _some from 'lodash-es/some';
|
|
41
45
|
import Button$1 from 'react-bootstrap/Button';
|
|
42
|
-
import
|
|
46
|
+
import moment from 'moment-timezone';
|
|
43
47
|
import _sortBy from 'lodash-es/sortBy';
|
|
44
48
|
import FormControl$1 from '@mui/material/FormControl';
|
|
45
49
|
import MenuItem from '@mui/material/MenuItem';
|
|
46
|
-
import
|
|
47
|
-
import
|
|
50
|
+
import Autocomplete from '@mui/material/Autocomplete';
|
|
51
|
+
import Paper from '@mui/material/Paper';
|
|
48
52
|
import Table from '@mui/material/Table';
|
|
49
53
|
import TableBody from '@mui/material/TableBody';
|
|
50
54
|
import TableCell from '@mui/material/TableCell';
|
|
51
55
|
import TableContainer from '@mui/material/TableContainer';
|
|
52
56
|
import TableHead from '@mui/material/TableHead';
|
|
53
|
-
import TableRow from '@mui/material/TableRow';
|
|
54
|
-
import Paper from '@mui/material/Paper';
|
|
55
57
|
import TablePagination from '@mui/material/TablePagination';
|
|
56
|
-
import
|
|
58
|
+
import TableRow from '@mui/material/TableRow';
|
|
57
59
|
import _has from 'lodash-es/has';
|
|
58
|
-
import { object, string, ref, boolean } from 'yup';
|
|
59
60
|
import Radio from '@mui/material/Radio';
|
|
60
61
|
|
|
61
62
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -903,32 +904,6 @@ try {
|
|
|
903
904
|
}
|
|
904
905
|
});
|
|
905
906
|
|
|
906
|
-
var emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
907
|
-
var combineValidators = function combineValidators() {
|
|
908
|
-
for (var _len = arguments.length, validators = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
909
|
-
validators[_key] = arguments[_key];
|
|
910
|
-
}
|
|
911
|
-
|
|
912
|
-
return function () {
|
|
913
|
-
for (var i = 0; i < validators.length; ++i) {
|
|
914
|
-
var error_message = validators[i].apply(validators, arguments);
|
|
915
|
-
if (error_message) return error_message;
|
|
916
|
-
}
|
|
917
|
-
};
|
|
918
|
-
};
|
|
919
|
-
var requiredValidator = function requiredValidator(value, message) {
|
|
920
|
-
var errorMessage = '';
|
|
921
|
-
|
|
922
|
-
if (!value) {
|
|
923
|
-
errorMessage = message || 'Required';
|
|
924
|
-
}
|
|
925
|
-
|
|
926
|
-
return errorMessage;
|
|
927
|
-
};
|
|
928
|
-
var emailValidator = function emailValidator(email) {
|
|
929
|
-
return !emailRegex.test(email) ? 'Please enter a valid email address' : '';
|
|
930
|
-
};
|
|
931
|
-
|
|
932
907
|
var CONFIGS = {};
|
|
933
908
|
var setConfigs = function setConfigs(configs) {
|
|
934
909
|
_forEach(configs, function (value, key) {
|
|
@@ -998,14 +973,87 @@ var ErrorFocusInternal = /*#__PURE__*/function (_Component) {
|
|
|
998
973
|
|
|
999
974
|
var ErrorFocus = /*#__PURE__*/connect(ErrorFocusInternal);
|
|
1000
975
|
|
|
976
|
+
function getDomain(url, subdomain) {
|
|
977
|
+
var updatedUrl = url.replace(/(https?:\/\/)?(www.)?/i, '');
|
|
978
|
+
|
|
979
|
+
if (!subdomain) {
|
|
980
|
+
updatedUrl = updatedUrl.split('.');
|
|
981
|
+
updatedUrl = updatedUrl.slice(updatedUrl.length - 2).join('.');
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
if (updatedUrl.indexOf('/') !== -1) {
|
|
985
|
+
return updatedUrl.split('/')[0];
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
return updatedUrl;
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
function setCustomCookie(name, value, days) {
|
|
992
|
+
if (days === void 0) {
|
|
993
|
+
days = 5;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
var expires = '';
|
|
997
|
+
|
|
998
|
+
if (days) {
|
|
999
|
+
var date = new Date();
|
|
1000
|
+
date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000);
|
|
1001
|
+
expires = '; expires=' + date.toUTCString();
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
if (typeof window !== 'undefined') {
|
|
1005
|
+
var domain = getDomain(window.location.hostname);
|
|
1006
|
+
document.cookie = name + '=' + (value || '') + expires + '; path=/' + ("; domain=" + domain);
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
function getCookieByName(cname) {
|
|
1010
|
+
if (typeof window === 'undefined') return '';
|
|
1011
|
+
var name = cname + '=';
|
|
1012
|
+
var ca = document.cookie.split(';');
|
|
1013
|
+
|
|
1014
|
+
for (var i = 0; i < ca.length; i++) {
|
|
1015
|
+
var c = ca[i];
|
|
1016
|
+
|
|
1017
|
+
while (c.charAt(0) == ' ') {
|
|
1018
|
+
c = c.substring(1);
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
if (c.indexOf(name) == 0) {
|
|
1022
|
+
return c.substring(name.length, c.length);
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
return '';
|
|
1027
|
+
}
|
|
1028
|
+
function deleteCookieByName(name) {
|
|
1029
|
+
if (typeof window !== 'undefined') {
|
|
1030
|
+
var domain = getDomain(window.location.hostname);
|
|
1031
|
+
document.cookie = name + '=; Path=/' + ("; domain=" + domain) + '; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1001
1035
|
var downloadPDF = function downloadPDF(pdfUrl) {
|
|
1002
1036
|
if (typeof window === 'undefined') return;
|
|
1037
|
+
var xtfCookie = getCookieByName('X-TF-ECOMMERCE');
|
|
1003
1038
|
var accessToken = localStorage.getItem('access_token');
|
|
1004
|
-
if (!accessToken) return;
|
|
1005
|
-
|
|
1006
|
-
|
|
1039
|
+
if (!accessToken && !xtfCookie) return;
|
|
1040
|
+
var headers = {};
|
|
1041
|
+
|
|
1042
|
+
if (accessToken) {
|
|
1043
|
+
headers = {
|
|
1007
1044
|
Authorization: "Bearer " + accessToken
|
|
1008
|
-
}
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
if (xtfCookie) {
|
|
1049
|
+
headers = {
|
|
1050
|
+
'X-TF-ECOMMERCE': xtfCookie
|
|
1051
|
+
};
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
return fetch(pdfUrl, {
|
|
1055
|
+
headers: headers,
|
|
1056
|
+
credentials: 'include'
|
|
1009
1057
|
}).then( /*#__PURE__*/function () {
|
|
1010
1058
|
var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(response) {
|
|
1011
1059
|
var blobValue, fileNameHeader, fileName;
|
|
@@ -1018,7 +1066,7 @@ var downloadPDF = function downloadPDF(pdfUrl) {
|
|
|
1018
1066
|
|
|
1019
1067
|
case 2:
|
|
1020
1068
|
blobValue = _context.sent;
|
|
1021
|
-
fileNameHeader = response.headers.get(
|
|
1069
|
+
fileNameHeader = response.headers.get('content-disposition') || '';
|
|
1022
1070
|
fileName = fileNameHeader.split('"')[1];
|
|
1023
1071
|
return _context.abrupt("return", {
|
|
1024
1072
|
blobValue: blobValue,
|
|
@@ -1039,7 +1087,11 @@ var downloadPDF = function downloadPDF(pdfUrl) {
|
|
|
1039
1087
|
}()).then(function (_ref2) {
|
|
1040
1088
|
var blobValue = _ref2.blobValue,
|
|
1041
1089
|
fileName = _ref2.fileName;
|
|
1042
|
-
|
|
1090
|
+
|
|
1091
|
+
if (!fileName) {
|
|
1092
|
+
throw Error('Something went wrong.');
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1043
1095
|
var file = new Blob([blobValue], {
|
|
1044
1096
|
type: 'application/pdf'
|
|
1045
1097
|
});
|
|
@@ -1050,21 +1102,27 @@ var downloadPDF = function downloadPDF(pdfUrl) {
|
|
|
1050
1102
|
document.body.appendChild(link);
|
|
1051
1103
|
link.click();
|
|
1052
1104
|
document.body.removeChild(link);
|
|
1105
|
+
})["catch"](function (error) {
|
|
1106
|
+
return error;
|
|
1053
1107
|
});
|
|
1054
1108
|
};
|
|
1055
1109
|
|
|
1056
|
-
var createCheckoutDataBodyWithDefaultHolder = function createCheckoutDataBodyWithDefaultHolder(ticketsQuantity, logedInValues, includeDob) {
|
|
1110
|
+
var createCheckoutDataBodyWithDefaultHolder = function createCheckoutDataBodyWithDefaultHolder(ticketsQuantity, logedInValues, includeDob, userCredentials) {
|
|
1057
1111
|
if (includeDob === void 0) {
|
|
1058
1112
|
includeDob = false;
|
|
1059
1113
|
}
|
|
1060
1114
|
|
|
1115
|
+
if (userCredentials === void 0) {
|
|
1116
|
+
userCredentials = {};
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1061
1119
|
var ticket_holders = [];
|
|
1062
|
-
var first_name = _get(logedInValues, 'firstName') || _get(logedInValues, 'first_name') || '';
|
|
1063
|
-
var last_name = _get(logedInValues, 'lastName', '') || _get(
|
|
1120
|
+
var first_name = _get(logedInValues, 'firstName') || _get(logedInValues, 'first_name') || _get(userCredentials, 'firstNameLogged') || '';
|
|
1121
|
+
var last_name = _get(logedInValues, 'lastName') || _get(logedInValues, 'last_name') || _get(userCredentials, 'lastNameLogged') || '';
|
|
1064
1122
|
|
|
1065
1123
|
var phone = _get(logedInValues, 'phone', '');
|
|
1066
1124
|
|
|
1067
|
-
var email = _get(logedInValues, 'email', '');
|
|
1125
|
+
var email = _get(logedInValues, 'email') || _get(userCredentials, 'emailLogged') || '';
|
|
1068
1126
|
|
|
1069
1127
|
for (var i = 0; i <= ticketsQuantity - 1; i++) {
|
|
1070
1128
|
var individualHolder = i ? {
|
|
@@ -1102,6 +1160,7 @@ var createCheckoutDataBodyWithDefaultHolder = function createCheckoutDataBodyWit
|
|
|
1102
1160
|
};
|
|
1103
1161
|
|
|
1104
1162
|
var isWindowDefined = typeof window !== 'undefined';
|
|
1163
|
+
var isDocumentDefined = typeof document !== 'undefined';
|
|
1105
1164
|
var ttfHeaders = {
|
|
1106
1165
|
Accept: 'application/vnd.api+json',
|
|
1107
1166
|
'Content-Type': 'application/vnd.api+json'
|
|
@@ -1173,20 +1232,41 @@ publicRequest.interceptors.request.use(function (config) {
|
|
|
1173
1232
|
config.headers = _updatedHeaders;
|
|
1174
1233
|
}
|
|
1175
1234
|
|
|
1176
|
-
if (
|
|
1235
|
+
if (getCookieByName('X-TF-ECOMMERCE')) {
|
|
1177
1236
|
var _updatedHeaders2 = _extends({}, config.headers, {
|
|
1178
|
-
'X-
|
|
1237
|
+
'X-TF-ECOMMERCE': getCookieByName('X-TF-ECOMMERCE')
|
|
1179
1238
|
});
|
|
1180
1239
|
|
|
1181
1240
|
config.headers = _updatedHeaders2;
|
|
1182
1241
|
}
|
|
1183
1242
|
|
|
1243
|
+
if (CONFIGS.X_SOURCE_ORIGIN) {
|
|
1244
|
+
var _updatedHeaders3 = _extends({}, config.headers, {
|
|
1245
|
+
'X-Source-Origin': CONFIGS.X_SOURCE_ORIGIN
|
|
1246
|
+
});
|
|
1247
|
+
|
|
1248
|
+
config.headers = _updatedHeaders3;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1184
1251
|
if (CONFIGS.BASE_URL) {
|
|
1185
1252
|
config.baseURL = CONFIGS.BASE_URL + '/api';
|
|
1186
1253
|
}
|
|
1187
1254
|
|
|
1188
1255
|
return config;
|
|
1189
1256
|
});
|
|
1257
|
+
publicRequest.interceptors.response.use(function (response) {
|
|
1258
|
+
var xtfCookie = _get(response, 'headers.x-tf-ecommerce');
|
|
1259
|
+
|
|
1260
|
+
var url = _get(response, 'config.url');
|
|
1261
|
+
|
|
1262
|
+
var method = _get(response, 'config.method');
|
|
1263
|
+
|
|
1264
|
+
if (xtfCookie && !(url === '/auth' && method === 'delete')) {
|
|
1265
|
+
setCustomCookie('X-TF-ECOMMERCE', xtfCookie);
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
return response;
|
|
1269
|
+
});
|
|
1190
1270
|
|
|
1191
1271
|
publicRequest.setGuestToken = function (token) {
|
|
1192
1272
|
return publicRequest.defaults.headers.common['Authorization-Guest'] = token;
|
|
@@ -1226,8 +1306,26 @@ var handleSetAccessToken = function handleSetAccessToken(token) {
|
|
|
1226
1306
|
}
|
|
1227
1307
|
};
|
|
1228
1308
|
function getEvent(id) {
|
|
1309
|
+
var referralValue = "";
|
|
1310
|
+
|
|
1311
|
+
if (isWindowDefined) {
|
|
1312
|
+
var params = new URL("" + window.location);
|
|
1313
|
+
var referralId = params.searchParams.get('ttf_r') || '';
|
|
1314
|
+
var referral_key = window.localStorage.getItem('referral_key');
|
|
1315
|
+
var referralIdlocal = "";
|
|
1316
|
+
|
|
1317
|
+
if (referral_key) {
|
|
1318
|
+
referralIdlocal = referral_key.split('.')[1];
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
referralValue = referralId || referralIdlocal;
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1229
1324
|
var response = publicRequest.get("v1/event/" + id, {
|
|
1230
|
-
headers: ttfHeaders
|
|
1325
|
+
headers: _extends({}, ttfHeaders, {
|
|
1326
|
+
"Referer-Url": isDocumentDefined ? document.referrer : '',
|
|
1327
|
+
"Referrer-Id": isWindowDefined ? referralValue : ''
|
|
1328
|
+
})
|
|
1231
1329
|
})["catch"](function (error) {
|
|
1232
1330
|
throw error;
|
|
1233
1331
|
});
|
|
@@ -1246,7 +1344,10 @@ function getTickets(id, promoCode) {
|
|
|
1246
1344
|
}
|
|
1247
1345
|
var addToCart = function addToCart(id, data) {
|
|
1248
1346
|
var res = publicRequest.post("v1/event/" + id + "/add-to-cart/", {
|
|
1249
|
-
data: data
|
|
1347
|
+
data: data,
|
|
1348
|
+
headers: {
|
|
1349
|
+
"Referer-Url": isDocumentDefined ? document.referrer : ''
|
|
1350
|
+
}
|
|
1250
1351
|
});
|
|
1251
1352
|
return res;
|
|
1252
1353
|
};
|
|
@@ -1265,28 +1366,37 @@ var postOnCheckout = function postOnCheckout(data, accessToken) {
|
|
|
1265
1366
|
return res;
|
|
1266
1367
|
};
|
|
1267
1368
|
var authorize = function authorize(data) {
|
|
1268
|
-
return publicRequest.post("
|
|
1369
|
+
return publicRequest.post("/auth?clientId=" + (CONFIGS.CLIENT_ID || 'e9d8f8922797b4621e562255afe90dbf'), data);
|
|
1269
1370
|
};
|
|
1270
1371
|
var register = function register(data) {
|
|
1271
1372
|
return publicRequest.post('v1/oauth/register-rn', data);
|
|
1272
1373
|
};
|
|
1273
|
-
var getAccessToken = function getAccessToken(data) {
|
|
1274
|
-
return publicRequest.post('v1/oauth/access_token', data);
|
|
1275
|
-
};
|
|
1276
1374
|
var getPaymentData = function getPaymentData(hash) {
|
|
1277
|
-
var response = publicRequest.get("v1/order/" + hash + "/review/"
|
|
1375
|
+
var response = publicRequest.get("v1/order/" + hash + "/review/", {
|
|
1376
|
+
headers: {
|
|
1377
|
+
"Referer-Url": isDocumentDefined ? document.referrer : ''
|
|
1378
|
+
}
|
|
1379
|
+
})["catch"](function (error) {
|
|
1278
1380
|
throw error;
|
|
1279
1381
|
});
|
|
1280
1382
|
return response;
|
|
1281
1383
|
};
|
|
1282
1384
|
var handlePaymentSuccess = function handlePaymentSuccess(orderHash) {
|
|
1283
|
-
var res = publicRequest.post("v1/order/" + orderHash + "/success"
|
|
1385
|
+
var res = publicRequest.post("v1/order/" + orderHash + "/success", {
|
|
1386
|
+
headers: {
|
|
1387
|
+
"Referer-Url": isDocumentDefined ? document.referrer : ''
|
|
1388
|
+
}
|
|
1389
|
+
})["catch"](function (error) {
|
|
1284
1390
|
throw error;
|
|
1285
1391
|
});
|
|
1286
1392
|
return res;
|
|
1287
1393
|
};
|
|
1288
1394
|
var handleFreeSuccess = function handleFreeSuccess(orderHash) {
|
|
1289
|
-
var res = publicRequest.post("v1/order/" + orderHash + "/complete_free_registration"
|
|
1395
|
+
var res = publicRequest.post("v1/order/" + orderHash + "/complete_free_registration", {
|
|
1396
|
+
headers: {
|
|
1397
|
+
"Referer-Url": isDocumentDefined ? document.referrer : ''
|
|
1398
|
+
}
|
|
1399
|
+
})["catch"](function (error) {
|
|
1290
1400
|
throw error;
|
|
1291
1401
|
});
|
|
1292
1402
|
return res;
|
|
@@ -1333,6 +1443,18 @@ var postReferralVisits = function postReferralVisits(eventId, referralId) {
|
|
|
1333
1443
|
referrer: "" + referralId
|
|
1334
1444
|
});
|
|
1335
1445
|
};
|
|
1446
|
+
var logout = function logout() {
|
|
1447
|
+
return publicRequest["delete"]('/auth');
|
|
1448
|
+
}; // forgot password
|
|
1449
|
+
|
|
1450
|
+
var forgotPassword = function forgotPassword(email) {
|
|
1451
|
+
return publicRequest.post("/auth/restore-password", {
|
|
1452
|
+
email: email
|
|
1453
|
+
});
|
|
1454
|
+
};
|
|
1455
|
+
var resetPassword = function resetPassword(data) {
|
|
1456
|
+
return publicRequest.post("/auth/reset-password", data);
|
|
1457
|
+
};
|
|
1336
1458
|
var processTicket = function processTicket(hash) {
|
|
1337
1459
|
return publicRequest.post("v1/ticket/" + hash + "/process/");
|
|
1338
1460
|
};
|
|
@@ -1342,480 +1464,574 @@ var declineInvitation = function declineInvitation(hash) {
|
|
|
1342
1464
|
var sendRSVPInfo = function sendRSVPInfo(eventId, data) {
|
|
1343
1465
|
return publicRequest.post("v1/event/" + eventId + "/send-rsvp-info", data);
|
|
1344
1466
|
};
|
|
1467
|
+
var validatePhoneNumber = /*#__PURE__*/function () {
|
|
1468
|
+
var _ref = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(phone) {
|
|
1469
|
+
var response;
|
|
1470
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
1471
|
+
while (1) {
|
|
1472
|
+
switch (_context.prev = _context.next) {
|
|
1473
|
+
case 0:
|
|
1474
|
+
_context.next = 2;
|
|
1475
|
+
return publicRequest.get("/v1/account/validate_phone?phone=" + phone);
|
|
1476
|
+
|
|
1477
|
+
case 2:
|
|
1478
|
+
response = _context.sent;
|
|
1479
|
+
return _context.abrupt("return", response.data);
|
|
1480
|
+
|
|
1481
|
+
case 4:
|
|
1482
|
+
case "end":
|
|
1483
|
+
return _context.stop();
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
}, _callee);
|
|
1487
|
+
}));
|
|
1345
1488
|
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
transform: 'translate(-50%, -50%)',
|
|
1351
|
-
minWidth: 480,
|
|
1352
|
-
backgroundColor: '#e3e3e3',
|
|
1353
|
-
border: '1px solid white',
|
|
1354
|
-
outline: 'none'
|
|
1355
|
-
};
|
|
1356
|
-
var LoginModal = function LoginModal(_ref) {
|
|
1357
|
-
var onClose = _ref.onClose,
|
|
1358
|
-
onLogin = _ref.onLogin,
|
|
1359
|
-
_ref$alreadyHasUser = _ref.alreadyHasUser,
|
|
1360
|
-
alreadyHasUser = _ref$alreadyHasUser === void 0 ? false : _ref$alreadyHasUser,
|
|
1361
|
-
_ref$userExpired = _ref.userExpired,
|
|
1362
|
-
userExpired = _ref$userExpired === void 0 ? false : _ref$userExpired,
|
|
1363
|
-
_ref$onAuthorizeSucce = _ref.onAuthorizeSuccess,
|
|
1364
|
-
onAuthorizeSuccess = _ref$onAuthorizeSucce === void 0 ? function () {} : _ref$onAuthorizeSucce,
|
|
1365
|
-
_ref$onAuthorizeError = _ref.onAuthorizeError,
|
|
1366
|
-
onAuthorizeError = _ref$onAuthorizeError === void 0 ? function () {} : _ref$onAuthorizeError,
|
|
1367
|
-
_ref$onGetProfileData = _ref.onGetProfileDataSuccess,
|
|
1368
|
-
onGetProfileDataSuccess = _ref$onGetProfileData === void 0 ? function () {} : _ref$onGetProfileData,
|
|
1369
|
-
_ref$onGetProfileData2 = _ref.onGetProfileDataError,
|
|
1370
|
-
onGetProfileDataError = _ref$onGetProfileData2 === void 0 ? function () {} : _ref$onGetProfileData2,
|
|
1371
|
-
_ref$modalClassname = _ref.modalClassname,
|
|
1372
|
-
modalClassname = _ref$modalClassname === void 0 ? '' : _ref$modalClassname;
|
|
1489
|
+
return function validatePhoneNumber(_x) {
|
|
1490
|
+
return _ref.apply(this, arguments);
|
|
1491
|
+
};
|
|
1492
|
+
}();
|
|
1373
1493
|
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1494
|
+
var emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
1495
|
+
var combineValidators = function combineValidators() {
|
|
1496
|
+
for (var _len = arguments.length, validators = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1497
|
+
validators[_key] = arguments[_key];
|
|
1498
|
+
}
|
|
1377
1499
|
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1500
|
+
return function () {
|
|
1501
|
+
for (var i = 0; i < validators.length; ++i) {
|
|
1502
|
+
var error_message = validators[i].apply(validators, arguments);
|
|
1503
|
+
if (error_message) return error_message;
|
|
1381
1504
|
}
|
|
1382
1505
|
};
|
|
1506
|
+
};
|
|
1507
|
+
var requiredValidator = function requiredValidator(value, message) {
|
|
1508
|
+
var errorMessage = '';
|
|
1383
1509
|
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
"aria-labelledby": "modal-modal-title",
|
|
1388
|
-
"aria-describedby": "modal-modal-description",
|
|
1389
|
-
className: "login-modal " + modalClassname
|
|
1390
|
-
}, React.createElement(Box, {
|
|
1391
|
-
style: style
|
|
1392
|
-
}, React.createElement("div", null, React.createElement(Formik, {
|
|
1393
|
-
initialValues: {
|
|
1394
|
-
email: '',
|
|
1395
|
-
password: ''
|
|
1396
|
-
},
|
|
1397
|
-
onSubmit: function () {
|
|
1398
|
-
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref2) {
|
|
1399
|
-
var email, password, bodyFormData, resAutorize, bodyFormDataToken, resAccessToken, accessToken, profileResponse, profileSpecifiedData, profileDataObj, event, _e$response, _e$response$data, _error;
|
|
1400
|
-
|
|
1401
|
-
return runtime_1.wrap(function _callee$(_context) {
|
|
1402
|
-
while (1) {
|
|
1403
|
-
switch (_context.prev = _context.next) {
|
|
1404
|
-
case 0:
|
|
1405
|
-
email = _ref2.email, password = _ref2.password;
|
|
1406
|
-
_context.prev = 1;
|
|
1407
|
-
bodyFormData = new FormData();
|
|
1408
|
-
bodyFormData.append('email', email);
|
|
1409
|
-
bodyFormData.append('password', password);
|
|
1410
|
-
_context.next = 7;
|
|
1411
|
-
return authorize(bodyFormData);
|
|
1412
|
-
|
|
1413
|
-
case 7:
|
|
1414
|
-
resAutorize = _context.sent;
|
|
1415
|
-
bodyFormDataToken = new FormData();
|
|
1416
|
-
bodyFormDataToken.append('code', resAutorize.data.data.code);
|
|
1417
|
-
bodyFormDataToken.append('scope', 'profile');
|
|
1418
|
-
bodyFormDataToken.append('grant_type', 'authorization_code');
|
|
1419
|
-
bodyFormDataToken.append('client_id', CONFIGS.CLIENT_ID || 'e9d8f8922797b4621e562255afe90dbf');
|
|
1420
|
-
bodyFormDataToken.append('client_secret', CONFIGS.CLIENT_SECRET || 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9');
|
|
1421
|
-
resAccessToken = null;
|
|
1422
|
-
_context.prev = 15;
|
|
1423
|
-
_context.next = 18;
|
|
1424
|
-
return getAccessToken(bodyFormDataToken);
|
|
1425
|
-
|
|
1426
|
-
case 18:
|
|
1427
|
-
resAccessToken = _context.sent;
|
|
1428
|
-
onAuthorizeSuccess(resAccessToken.data);
|
|
1429
|
-
_context.next = 26;
|
|
1430
|
-
break;
|
|
1431
|
-
|
|
1432
|
-
case 22:
|
|
1433
|
-
_context.prev = 22;
|
|
1434
|
-
_context.t0 = _context["catch"](15);
|
|
1510
|
+
if (!value) {
|
|
1511
|
+
errorMessage = message || 'Required';
|
|
1512
|
+
}
|
|
1435
1513
|
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1514
|
+
return errorMessage;
|
|
1515
|
+
};
|
|
1516
|
+
var emailValidator = function emailValidator(email) {
|
|
1517
|
+
return !emailRegex.test(email) ? 'Please enter a valid email address' : '';
|
|
1518
|
+
};
|
|
1439
1519
|
|
|
1440
|
-
|
|
1520
|
+
var CustomField = function CustomField(_ref) {
|
|
1521
|
+
var label = _ref.label,
|
|
1522
|
+
_ref$type = _ref.type,
|
|
1523
|
+
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
1524
|
+
field = _ref.field,
|
|
1525
|
+
_ref$selectOptions = _ref.selectOptions,
|
|
1526
|
+
selectOptions = _ref$selectOptions === void 0 ? [] : _ref$selectOptions,
|
|
1527
|
+
_ref$form = _ref.form,
|
|
1528
|
+
touched = _ref$form.touched,
|
|
1529
|
+
errors = _ref$form.errors,
|
|
1530
|
+
submitCount = _ref$form.submitCount,
|
|
1531
|
+
theme = _ref.theme,
|
|
1532
|
+
_ref$inputProps = _ref.inputProps,
|
|
1533
|
+
pInputProps = _ref$inputProps === void 0 ? {} : _ref$inputProps,
|
|
1534
|
+
_ref$InputProps = _ref.InputProps,
|
|
1535
|
+
InputProps = _ref$InputProps === void 0 ? {} : _ref$InputProps,
|
|
1536
|
+
inputRef = _ref.inputRef;
|
|
1537
|
+
var isSelectField = type === 'select';
|
|
1441
1538
|
|
|
1442
|
-
|
|
1443
|
-
accessToken = _get(resAccessToken, 'data.access_token');
|
|
1444
|
-
handleSetAccessToken(accessToken);
|
|
1445
|
-
profileResponse = null;
|
|
1446
|
-
_context.prev = 29;
|
|
1447
|
-
_context.next = 32;
|
|
1448
|
-
return getProfileData(accessToken);
|
|
1539
|
+
var error = _get(errors, field.name);
|
|
1449
1540
|
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1541
|
+
var isTouched = Boolean(_get(touched, field.name)) || _includes(field.name, 'holder') && !!error && !!submitCount;
|
|
1542
|
+
var customTheme = useTheme();
|
|
1543
|
+
var inputProps = {
|
|
1544
|
+
sx: customTheme == null ? void 0 : customTheme.input
|
|
1545
|
+
};
|
|
1546
|
+
return React.createElement(TextField, Object.assign({
|
|
1547
|
+
id: field.name,
|
|
1548
|
+
label: label,
|
|
1549
|
+
type: type,
|
|
1550
|
+
select: isSelectField,
|
|
1551
|
+
fullWidth: true,
|
|
1552
|
+
error: !!error && isTouched,
|
|
1553
|
+
helperText: isTouched && error,
|
|
1554
|
+
SelectProps: {
|
|
1555
|
+
"native": true,
|
|
1556
|
+
className: theme,
|
|
1557
|
+
MenuProps: {
|
|
1558
|
+
className: theme
|
|
1559
|
+
}
|
|
1560
|
+
},
|
|
1561
|
+
InputLabelProps: {
|
|
1562
|
+
sx: customTheme == null ? void 0 : customTheme.input
|
|
1563
|
+
},
|
|
1564
|
+
InputProps: InputProps,
|
|
1565
|
+
inputProps: _extends({}, inputProps, pInputProps),
|
|
1566
|
+
inputRef: inputRef
|
|
1567
|
+
}, field), isSelectField ? _map(selectOptions, function (option) {
|
|
1568
|
+
return React.createElement("option", {
|
|
1569
|
+
key: option.value,
|
|
1570
|
+
value: option.value,
|
|
1571
|
+
disabled: option.disabled
|
|
1572
|
+
}, option.label);
|
|
1573
|
+
}) : null);
|
|
1574
|
+
};
|
|
1455
1575
|
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1576
|
+
var DATE_SIZE = 32;
|
|
1577
|
+
var compactStyles = {
|
|
1578
|
+
'& > div': {
|
|
1579
|
+
minWidth: 256
|
|
1580
|
+
},
|
|
1581
|
+
'& > div > div, & > div > div > div, & .MuiCalendarPicker-root': {
|
|
1582
|
+
width: 256
|
|
1583
|
+
},
|
|
1584
|
+
'& .MuiTypography-caption': {
|
|
1585
|
+
width: DATE_SIZE,
|
|
1586
|
+
margin: 0
|
|
1587
|
+
},
|
|
1588
|
+
'& .PrivatePickersSlideTransition-root': {
|
|
1589
|
+
minHeight: DATE_SIZE * 6
|
|
1590
|
+
},
|
|
1591
|
+
'& .PrivatePickersSlideTransition-root [role="row"]': {
|
|
1592
|
+
margin: 0
|
|
1593
|
+
},
|
|
1594
|
+
'& .MuiPickersDay-dayWithMargin': {
|
|
1595
|
+
margin: 0
|
|
1596
|
+
},
|
|
1597
|
+
'& .MuiPickersDay-root': {
|
|
1598
|
+
width: DATE_SIZE,
|
|
1599
|
+
height: DATE_SIZE
|
|
1600
|
+
}
|
|
1601
|
+
};
|
|
1602
|
+
var compactStyleTheme = /*#__PURE__*/createTheme({
|
|
1603
|
+
components: {
|
|
1604
|
+
MuiPaper: {
|
|
1605
|
+
defaultProps: {
|
|
1606
|
+
sx: compactStyles
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
}
|
|
1610
|
+
});
|
|
1611
|
+
var DatePickerField = function DatePickerField(_ref) {
|
|
1612
|
+
var label = _ref.label,
|
|
1613
|
+
field = _ref.field,
|
|
1614
|
+
form = _ref.form,
|
|
1615
|
+
theme = _ref.theme,
|
|
1616
|
+
_ref$useCompact = _ref.useCompact,
|
|
1617
|
+
useCompact = _ref$useCompact === void 0 ? true : _ref$useCompact;
|
|
1618
|
+
return React.createElement(ThemeProvider, {
|
|
1619
|
+
theme: useCompact ? compactStyleTheme : {}
|
|
1620
|
+
}, React.createElement(LocalizationProvider, {
|
|
1621
|
+
dateAdapter: AdapterMoment
|
|
1622
|
+
}, React.createElement(DatePicker, {
|
|
1623
|
+
value: field.value || '',
|
|
1624
|
+
onChange: function onChange(value) {
|
|
1625
|
+
return form.setFieldValue(field.name, value);
|
|
1626
|
+
},
|
|
1627
|
+
PopperProps: {
|
|
1628
|
+
placement: 'bottom-start'
|
|
1629
|
+
},
|
|
1630
|
+
showDaysOutsideCurrentMonth: true,
|
|
1631
|
+
disableFuture: true,
|
|
1632
|
+
inputFormat: "DD/MM/YYYY",
|
|
1633
|
+
mask: "__/__/____",
|
|
1634
|
+
renderInput: function renderInput(params) {
|
|
1635
|
+
return React.createElement(CustomField, Object.assign({}, params, {
|
|
1636
|
+
inputProps: _extends({}, params.inputProps, {
|
|
1637
|
+
placeholder: 'dd/mm/yyyy'
|
|
1638
|
+
}),
|
|
1639
|
+
theme: theme,
|
|
1640
|
+
field: field,
|
|
1641
|
+
form: form,
|
|
1642
|
+
label: label,
|
|
1643
|
+
type: "tel"
|
|
1644
|
+
}));
|
|
1645
|
+
}
|
|
1646
|
+
})));
|
|
1647
|
+
};
|
|
1459
1648
|
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1649
|
+
var _excluded = ["label", "field", "selectOptions", "theme", "setFieldValue"];
|
|
1650
|
+
var CheckboxField = function CheckboxField(_ref) {
|
|
1651
|
+
var _rest$form, _field$name, _rest$form2, _field$name2;
|
|
1463
1652
|
|
|
1464
|
-
|
|
1653
|
+
var label = _ref.label,
|
|
1654
|
+
field = _ref.field,
|
|
1655
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
1465
1656
|
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1657
|
+
var customTheme = useTheme();
|
|
1658
|
+
return React.createElement(FormControl, {
|
|
1659
|
+
error: !!(rest != null && (_rest$form = rest.form) != null && _rest$form.errors && rest.form.errors[(_field$name = field == null ? void 0 : field.name) != null ? _field$name : ""])
|
|
1660
|
+
}, React.createElement(FormGroup, null, React.createElement(FormControlLabel, {
|
|
1661
|
+
control: React.createElement(Checkbox, Object.assign({}, field, rest)),
|
|
1662
|
+
label: label,
|
|
1663
|
+
componentsProps: {
|
|
1664
|
+
typography: customTheme == null ? void 0 : customTheme.checkbox
|
|
1665
|
+
}
|
|
1666
|
+
})), !!(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.createElement(FormHelperText, null, "Required") : null);
|
|
1667
|
+
};
|
|
1474
1668
|
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1669
|
+
var currencyNormalizerCreator = function currencyNormalizerCreator(value, currency) {
|
|
1670
|
+
return !value ? '' : "" + getCurrencySymbolByCurrency(currency) + value;
|
|
1671
|
+
};
|
|
1672
|
+
var createFixedFloatNormalizer = function createFixedFloatNormalizer(fixedValue) {
|
|
1673
|
+
return function (value) {
|
|
1674
|
+
return value || "" + value === '0' ? (+value).toFixed(fixedValue) : '';
|
|
1675
|
+
};
|
|
1676
|
+
};
|
|
1677
|
+
var getCurrencySymbolByCurrency = function getCurrencySymbolByCurrency(currency) {
|
|
1678
|
+
if (currency === void 0) {
|
|
1679
|
+
currency = '';
|
|
1680
|
+
}
|
|
1481
1681
|
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1682
|
+
switch (currency) {
|
|
1683
|
+
case 'GBP':
|
|
1684
|
+
return '£';
|
|
1485
1685
|
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
_context.t2 = _context["catch"](1);
|
|
1686
|
+
case 'EUR':
|
|
1687
|
+
return '€';
|
|
1489
1688
|
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
setError(_error);
|
|
1493
|
-
} else if (_context.t2 instanceof Error) {
|
|
1494
|
-
setError((_context.t2 == null ? void 0 : _context.t2.message) || 'Error');
|
|
1495
|
-
}
|
|
1689
|
+
case 'INR':
|
|
1690
|
+
return '₹';
|
|
1496
1691
|
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
return _context.stop();
|
|
1500
|
-
}
|
|
1501
|
-
}
|
|
1502
|
-
}, _callee, null, [[1, 46], [15, 22], [29, 36]]);
|
|
1503
|
-
}));
|
|
1692
|
+
case 'JMD':
|
|
1693
|
+
return 'J$';
|
|
1504
1694
|
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
}
|
|
1695
|
+
case 'NZD':
|
|
1696
|
+
return 'NZ$';
|
|
1508
1697
|
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
}, React.createElement(Field, {
|
|
1546
|
-
name: 'password',
|
|
1547
|
-
validate: requiredValidator
|
|
1548
|
-
}, function (_ref4) {
|
|
1549
|
-
var field = _ref4.field,
|
|
1550
|
-
meta = _ref4.meta;
|
|
1551
|
-
return React.createElement(TextField, Object.assign({
|
|
1552
|
-
label: "Password",
|
|
1553
|
-
type: "password",
|
|
1554
|
-
fullWidth: true,
|
|
1555
|
-
error: !!meta.error && meta.touched,
|
|
1556
|
-
helperText: meta.touched && meta.error
|
|
1557
|
-
}, field));
|
|
1558
|
-
})), React.createElement("div", {
|
|
1559
|
-
className: "login-action-button"
|
|
1560
|
-
}, React.createElement("button", {
|
|
1561
|
-
type: "submit"
|
|
1562
|
-
}, "Login")), React.createElement("div", {
|
|
1563
|
-
className: 'forgot-password'
|
|
1564
|
-
}, React.createElement("span", {
|
|
1565
|
-
onClick: handleForgotPassword
|
|
1566
|
-
}, "Forgot password?"))));
|
|
1567
|
-
}))));
|
|
1698
|
+
case 'MYR':
|
|
1699
|
+
return 'RM';
|
|
1700
|
+
|
|
1701
|
+
case 'MXN':
|
|
1702
|
+
return 'Mex$';
|
|
1703
|
+
|
|
1704
|
+
case 'SGD':
|
|
1705
|
+
return 'S$';
|
|
1706
|
+
|
|
1707
|
+
case 'AUD':
|
|
1708
|
+
return 'A$';
|
|
1709
|
+
|
|
1710
|
+
case 'ZAR':
|
|
1711
|
+
return 'R';
|
|
1712
|
+
|
|
1713
|
+
case 'ke':
|
|
1714
|
+
return 'Ksh';
|
|
1715
|
+
|
|
1716
|
+
case 'TRY':
|
|
1717
|
+
return '₺';
|
|
1718
|
+
|
|
1719
|
+
case 'CAD':
|
|
1720
|
+
return 'CA$';
|
|
1721
|
+
|
|
1722
|
+
case 'THB':
|
|
1723
|
+
return '฿';
|
|
1724
|
+
|
|
1725
|
+
case 'ISK':
|
|
1726
|
+
return 'Kr';
|
|
1727
|
+
|
|
1728
|
+
case 'SEK':
|
|
1729
|
+
return 'kr';
|
|
1730
|
+
|
|
1731
|
+
default:
|
|
1732
|
+
return 'US$';
|
|
1733
|
+
}
|
|
1568
1734
|
};
|
|
1569
1735
|
|
|
1570
|
-
var
|
|
1571
|
-
var
|
|
1572
|
-
_ref$
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1736
|
+
var PhoneNumberField = function PhoneNumberField(_ref) {
|
|
1737
|
+
var label = _ref.label,
|
|
1738
|
+
_ref$type = _ref.type,
|
|
1739
|
+
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
1740
|
+
field = _ref.field,
|
|
1741
|
+
_ref$form = _ref.form,
|
|
1742
|
+
errors = _ref$form.errors,
|
|
1743
|
+
setFieldError = _ref$form.setFieldError,
|
|
1744
|
+
setStatus = _ref$form.setStatus;
|
|
1745
|
+
|
|
1746
|
+
var error = _get(errors, field.name); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1747
|
+
|
|
1748
|
+
|
|
1749
|
+
var debounceCb = useCallback(_debounce(function (cb) {
|
|
1750
|
+
return void cb();
|
|
1751
|
+
}, 1000), []);
|
|
1752
|
+
useEffect(function () {
|
|
1753
|
+
if (field.value) {
|
|
1754
|
+
var _setStatus;
|
|
1755
|
+
|
|
1756
|
+
setStatus((_setStatus = {}, _setStatus[field.name] = true, _setStatus));
|
|
1588
1757
|
}
|
|
1589
|
-
}, React.createElement(Formik, {
|
|
1590
|
-
initialValues: {
|
|
1591
|
-
firstName: '',
|
|
1592
|
-
lastName: '',
|
|
1593
|
-
email: '',
|
|
1594
|
-
password: '',
|
|
1595
|
-
confirmPassword: ''
|
|
1596
|
-
},
|
|
1597
|
-
onSubmit: function () {
|
|
1598
|
-
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref2) {
|
|
1599
|
-
var firstName, lastName, email, password, confirmPassword, bodyFormData, resRegister, access_token, profileResponse, profileSpecifiedData, profileDataObj;
|
|
1600
|
-
return runtime_1.wrap(function _callee$(_context) {
|
|
1601
|
-
while (1) {
|
|
1602
|
-
switch (_context.prev = _context.next) {
|
|
1603
|
-
case 0:
|
|
1604
|
-
firstName = _ref2.firstName, lastName = _ref2.lastName, email = _ref2.email, password = _ref2.password, confirmPassword = _ref2.confirmPassword;
|
|
1605
|
-
bodyFormData = new FormData();
|
|
1606
|
-
bodyFormData.append('first_name', firstName);
|
|
1607
|
-
bodyFormData.append('last_name', lastName);
|
|
1608
|
-
bodyFormData.append('email', email);
|
|
1609
|
-
bodyFormData.append('password', password);
|
|
1610
|
-
bodyFormData.append('password_confirmation', confirmPassword);
|
|
1611
|
-
bodyFormData.append('client_id', CONFIGS.CLIENT_ID || 'e9d8f8922797b4621e562255afe90dbf');
|
|
1612
|
-
bodyFormData.append('client_secret', CONFIGS.CLIENT_SECRET || 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9');
|
|
1613
|
-
_context.next = 11;
|
|
1614
|
-
return register(bodyFormData);
|
|
1615
1758
|
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
access_token = _get(resRegister, 'data.data.attributes.access_token');
|
|
1619
|
-
handleSetAccessToken(access_token);
|
|
1620
|
-
profileResponse = null;
|
|
1621
|
-
_context.prev = 15;
|
|
1622
|
-
_context.next = 18;
|
|
1623
|
-
return getProfileData(access_token);
|
|
1759
|
+
debounceCb( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
1760
|
+
var message, _setStatus2;
|
|
1624
1761
|
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1762
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
1763
|
+
while (1) {
|
|
1764
|
+
switch (_context.prev = _context.next) {
|
|
1765
|
+
case 0:
|
|
1766
|
+
_context.prev = 0;
|
|
1767
|
+
|
|
1768
|
+
if (!field.value) {
|
|
1769
|
+
_context.next = 4;
|
|
1629
1770
|
break;
|
|
1771
|
+
}
|
|
1630
1772
|
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
_context.t0 = _context["catch"](15);
|
|
1634
|
-
onGetProfileDataError(_context.t0.response);
|
|
1635
|
-
return _context.abrupt("return");
|
|
1773
|
+
_context.next = 4;
|
|
1774
|
+
return validatePhoneNumber(field.value);
|
|
1636
1775
|
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
first_name: profileSpecifiedData.firstName,
|
|
1642
|
-
last_name: profileSpecifiedData.lastName,
|
|
1643
|
-
email: profileSpecifiedData.email
|
|
1644
|
-
};
|
|
1776
|
+
case 4:
|
|
1777
|
+
setFieldError(field.name, '');
|
|
1778
|
+
_context.next = 11;
|
|
1779
|
+
break;
|
|
1645
1780
|
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1781
|
+
case 7:
|
|
1782
|
+
_context.prev = 7;
|
|
1783
|
+
_context.t0 = _context["catch"](0);
|
|
1784
|
+
message = _get(_context.t0, 'response.data.message', 'Invalid phone number');
|
|
1785
|
+
setFieldError(field.name, message);
|
|
1650
1786
|
|
|
1651
|
-
|
|
1787
|
+
case 11:
|
|
1788
|
+
_context.prev = 11;
|
|
1789
|
+
setStatus((_setStatus2 = {}, _setStatus2[field.name] = false, _setStatus2));
|
|
1790
|
+
return _context.finish(11);
|
|
1652
1791
|
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
}
|
|
1792
|
+
case 14:
|
|
1793
|
+
case "end":
|
|
1794
|
+
return _context.stop();
|
|
1657
1795
|
}
|
|
1658
|
-
}
|
|
1659
|
-
})
|
|
1796
|
+
}
|
|
1797
|
+
}, _callee, null, [[0, 7, 11, 14]]);
|
|
1798
|
+
}))); // eslint-disable-next-line
|
|
1799
|
+
}, [field.value]);
|
|
1800
|
+
return React.createElement(TextField, Object.assign({}, field, {
|
|
1801
|
+
id: field.name,
|
|
1802
|
+
label: label,
|
|
1803
|
+
type: type,
|
|
1804
|
+
fullWidth: true,
|
|
1805
|
+
error: !!error,
|
|
1806
|
+
helperText: error,
|
|
1807
|
+
value: field.value || ''
|
|
1808
|
+
}));
|
|
1809
|
+
};
|
|
1660
1810
|
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1811
|
+
function Loader() {
|
|
1812
|
+
return React.createElement("div", {
|
|
1813
|
+
className: "loader-container"
|
|
1814
|
+
}, React.createElement(CircularProgress, null));
|
|
1815
|
+
}
|
|
1664
1816
|
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
},
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
validate: requiredValidator()
|
|
1714
|
-
}, function (_ref5) {
|
|
1715
|
-
var field = _ref5.field,
|
|
1716
|
-
meta = _ref5.meta;
|
|
1717
|
-
return React.createElement(TextField, Object.assign({
|
|
1718
|
-
label: 'Email',
|
|
1719
|
-
type: 'email',
|
|
1720
|
-
fullWidth: true,
|
|
1721
|
-
error: !!meta.error && meta.touched,
|
|
1722
|
-
helperText: meta.touched && meta.error
|
|
1723
|
-
}, field));
|
|
1724
|
-
}))), React.createElement("div", {
|
|
1725
|
-
className: "register-container__twoFields"
|
|
1726
|
-
}, React.createElement("div", {
|
|
1727
|
-
className: "is-half"
|
|
1728
|
-
}, React.createElement(Field, {
|
|
1729
|
-
name: 'password',
|
|
1730
|
-
validate: requiredValidator()
|
|
1731
|
-
}, function (_ref6) {
|
|
1732
|
-
var field = _ref6.field,
|
|
1733
|
-
meta = _ref6.meta;
|
|
1734
|
-
return React.createElement(TextField, Object.assign({
|
|
1735
|
-
label: 'Password',
|
|
1736
|
-
type: 'password',
|
|
1737
|
-
fullWidth: true,
|
|
1738
|
-
error: !!meta.error && meta.touched,
|
|
1739
|
-
helperText: meta.touched && meta.error
|
|
1740
|
-
}, field));
|
|
1741
|
-
})), React.createElement("div", {
|
|
1742
|
-
className: "is-half"
|
|
1743
|
-
}, React.createElement(Field, {
|
|
1744
|
-
name: 'confirmPassword',
|
|
1745
|
-
validate: requiredValidator()
|
|
1746
|
-
}, function (_ref7) {
|
|
1747
|
-
var field = _ref7.field,
|
|
1748
|
-
meta = _ref7.meta;
|
|
1749
|
-
return React.createElement(TextField, Object.assign({
|
|
1750
|
-
label: 'Confirm Passwod',
|
|
1751
|
-
type: 'password',
|
|
1752
|
-
fullWidth: true,
|
|
1753
|
-
error: !!meta.error && meta.touched,
|
|
1754
|
-
helperText: meta.touched && meta.error
|
|
1755
|
-
}, field));
|
|
1756
|
-
})))), React.createElement("button", {
|
|
1757
|
-
type: "submit"
|
|
1758
|
-
}, "Submit"));
|
|
1759
|
-
}));
|
|
1817
|
+
var SelectField = function SelectField(_ref) {
|
|
1818
|
+
var label = _ref.label,
|
|
1819
|
+
_ref$type = _ref.type,
|
|
1820
|
+
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
1821
|
+
field = _ref.field,
|
|
1822
|
+
_ref$selectOptions = _ref.selectOptions,
|
|
1823
|
+
selectOptions = _ref$selectOptions === void 0 ? [] : _ref$selectOptions,
|
|
1824
|
+
_ref$form = _ref.form,
|
|
1825
|
+
touched = _ref$form.touched,
|
|
1826
|
+
errors = _ref$form.errors,
|
|
1827
|
+
theme = _ref.theme;
|
|
1828
|
+
var isTouched = Boolean(_get(touched, field.name));
|
|
1829
|
+
|
|
1830
|
+
var error = _get(errors, field.name);
|
|
1831
|
+
|
|
1832
|
+
var customTheme = useTheme();
|
|
1833
|
+
return React.createElement(FormControl, {
|
|
1834
|
+
fullWidth: true
|
|
1835
|
+
}, React.createElement(InputLabel, {
|
|
1836
|
+
style: customTheme == null ? void 0 : customTheme.input,
|
|
1837
|
+
htmlFor: field.name,
|
|
1838
|
+
error: !!error && isTouched,
|
|
1839
|
+
shrink: true
|
|
1840
|
+
}, label), React.createElement(Select, Object.assign({
|
|
1841
|
+
id: field.name,
|
|
1842
|
+
label: label,
|
|
1843
|
+
type: type,
|
|
1844
|
+
fullWidth: true,
|
|
1845
|
+
error: !!error && isTouched,
|
|
1846
|
+
inputProps: {
|
|
1847
|
+
id: field.name
|
|
1848
|
+
},
|
|
1849
|
+
"native": true,
|
|
1850
|
+
className: theme,
|
|
1851
|
+
MenuProps: {
|
|
1852
|
+
className: theme
|
|
1853
|
+
}
|
|
1854
|
+
}, field, {
|
|
1855
|
+
style: customTheme == null ? void 0 : customTheme.input
|
|
1856
|
+
}), _map(selectOptions, function (option) {
|
|
1857
|
+
return React.createElement("option", {
|
|
1858
|
+
key: option.value,
|
|
1859
|
+
value: option.value,
|
|
1860
|
+
disabled: option.disabled
|
|
1861
|
+
}, option.label);
|
|
1862
|
+
})), isTouched && error ? React.createElement(FormHelperText, {
|
|
1863
|
+
error: !!error && isTouched
|
|
1864
|
+
}, error) : null);
|
|
1760
1865
|
};
|
|
1761
1866
|
|
|
1762
|
-
var
|
|
1763
|
-
var
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1867
|
+
var SnackbarAlert = function SnackbarAlert(_ref) {
|
|
1868
|
+
var isOpen = _ref.isOpen,
|
|
1869
|
+
message = _ref.message,
|
|
1870
|
+
type = _ref.type,
|
|
1871
|
+
position = _ref.position,
|
|
1872
|
+
_ref$autoHideDuration = _ref.autoHideDuration,
|
|
1873
|
+
autoHideDuration = _ref$autoHideDuration === void 0 ? 3000 : _ref$autoHideDuration,
|
|
1874
|
+
variant = _ref.variant,
|
|
1875
|
+
onClose = _ref.onClose;
|
|
1876
|
+
return React.createElement("div", {
|
|
1877
|
+
className: "snackbar-alert-container"
|
|
1878
|
+
}, React.createElement(Snackbar, {
|
|
1879
|
+
autoHideDuration: autoHideDuration,
|
|
1880
|
+
open: isOpen,
|
|
1881
|
+
anchorOrigin: position || {
|
|
1882
|
+
vertical: 'top',
|
|
1883
|
+
horizontal: 'center'
|
|
1884
|
+
},
|
|
1885
|
+
onClose: onClose,
|
|
1886
|
+
classes: {
|
|
1887
|
+
root: 'snackbar-alert-snackbar-root'
|
|
1888
|
+
}
|
|
1889
|
+
}, React.createElement(Alert, {
|
|
1890
|
+
severity: type,
|
|
1891
|
+
onClose: onClose,
|
|
1892
|
+
variant: variant || 'filled',
|
|
1893
|
+
classes: {
|
|
1894
|
+
icon: 'snackbar-alert-icon',
|
|
1895
|
+
root: 'snackbar-alert-alert-root',
|
|
1896
|
+
action: 'snackbar-alert-action',
|
|
1897
|
+
message: 'snackbar-alert-message',
|
|
1898
|
+
filled: 'snackbar-alert-filled'
|
|
1899
|
+
}
|
|
1900
|
+
}, message)));
|
|
1901
|
+
};
|
|
1767
1902
|
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1903
|
+
var style = {
|
|
1904
|
+
position: 'absolute',
|
|
1905
|
+
top: '50%',
|
|
1906
|
+
left: '50%',
|
|
1907
|
+
transform: 'translate(-50%, -50%)',
|
|
1908
|
+
minWidth: 480,
|
|
1909
|
+
backgroundColor: '#fff',
|
|
1910
|
+
border: '1px solid white',
|
|
1911
|
+
outline: 'none',
|
|
1912
|
+
padding: '14px'
|
|
1913
|
+
};
|
|
1914
|
+
var Schema = /*#__PURE__*/object().shape({
|
|
1915
|
+
email: /*#__PURE__*/string().email('Invalid email').required('Required')
|
|
1916
|
+
});
|
|
1917
|
+
var ForgotPasswordModal = function ForgotPasswordModal(_ref) {
|
|
1918
|
+
var _ref$onClose = _ref.onClose,
|
|
1919
|
+
onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
|
|
1920
|
+
_ref$onLogin = _ref.onLogin,
|
|
1921
|
+
onLogin = _ref$onLogin === void 0 ? function () {} : _ref$onLogin,
|
|
1922
|
+
_ref$onForgotPassword = _ref.onForgotPasswordSuccess,
|
|
1923
|
+
onForgotPasswordSuccess = _ref$onForgotPassword === void 0 ? function () {} : _ref$onForgotPassword,
|
|
1924
|
+
_ref$onForgotPassword2 = _ref.onForgotPasswordError,
|
|
1925
|
+
onForgotPasswordError = _ref$onForgotPassword2 === void 0 ? function () {} : _ref$onForgotPassword2;
|
|
1771
1926
|
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1927
|
+
var _useState = useState(false),
|
|
1928
|
+
loading = _useState[0],
|
|
1929
|
+
setLoading = _useState[1];
|
|
1775
1930
|
|
|
1776
|
-
var
|
|
1777
|
-
var
|
|
1778
|
-
|
|
1779
|
-
var groupItems = _ref2.groupItems;
|
|
1780
|
-
return _map(groupItems, function (_ref3) {
|
|
1781
|
-
var name = _ref3.name;
|
|
1782
|
-
return name;
|
|
1783
|
-
});
|
|
1784
|
-
});
|
|
1785
|
-
});
|
|
1931
|
+
var onForgotPassword = /*#__PURE__*/function () {
|
|
1932
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref2) {
|
|
1933
|
+
var email, _yield$forgotPassword, data;
|
|
1786
1934
|
|
|
1787
|
-
|
|
1935
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
1936
|
+
while (1) {
|
|
1937
|
+
switch (_context.prev = _context.next) {
|
|
1938
|
+
case 0:
|
|
1939
|
+
email = _ref2.email;
|
|
1940
|
+
_context.prev = 1;
|
|
1941
|
+
setLoading(true);
|
|
1942
|
+
_context.next = 5;
|
|
1943
|
+
return forgotPassword(email);
|
|
1788
1944
|
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1945
|
+
case 5:
|
|
1946
|
+
_yield$forgotPassword = _context.sent;
|
|
1947
|
+
data = _yield$forgotPassword.data;
|
|
1948
|
+
onForgotPasswordSuccess(data);
|
|
1949
|
+
onClose();
|
|
1950
|
+
_context.next = 14;
|
|
1951
|
+
break;
|
|
1792
1952
|
|
|
1953
|
+
case 11:
|
|
1954
|
+
_context.prev = 11;
|
|
1955
|
+
_context.t0 = _context["catch"](1);
|
|
1793
1956
|
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
return initialValues;
|
|
1798
|
-
};
|
|
1799
|
-
var createRegisterFormData = function createRegisterFormData(values, checkoutBody) {
|
|
1800
|
-
if (values === void 0) {
|
|
1801
|
-
values = {};
|
|
1802
|
-
}
|
|
1957
|
+
if (axios.isAxiosError(_context.t0)) {
|
|
1958
|
+
onForgotPasswordError(_context.t0);
|
|
1959
|
+
}
|
|
1803
1960
|
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
bodyFormData.append('password', values.password);
|
|
1809
|
-
bodyFormData.append('password_confirmation', values.confirmPassword);
|
|
1810
|
-
bodyFormData.append('client_id', CONFIGS.CLIENT_ID || 'e9d8f8922797b4621e562255afe90dbf');
|
|
1811
|
-
bodyFormData.append('client_secret', CONFIGS.CLIENT_SECRET || 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9');
|
|
1812
|
-
bodyFormData.append('check_cart_expiration', 'true');
|
|
1961
|
+
case 14:
|
|
1962
|
+
_context.prev = 14;
|
|
1963
|
+
setLoading(false);
|
|
1964
|
+
return _context.finish(14);
|
|
1813
1965
|
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1966
|
+
case 17:
|
|
1967
|
+
case "end":
|
|
1968
|
+
return _context.stop();
|
|
1969
|
+
}
|
|
1970
|
+
}
|
|
1971
|
+
}, _callee, null, [[1, 11, 14, 17]]);
|
|
1972
|
+
}));
|
|
1817
1973
|
|
|
1818
|
-
|
|
1974
|
+
return function onForgotPassword(_x) {
|
|
1975
|
+
return _ref3.apply(this, arguments);
|
|
1976
|
+
};
|
|
1977
|
+
}();
|
|
1978
|
+
|
|
1979
|
+
var _onClose = loading ? function () {} : onClose;
|
|
1980
|
+
|
|
1981
|
+
return React.createElement(Modal, {
|
|
1982
|
+
open: true,
|
|
1983
|
+
onClose: _onClose,
|
|
1984
|
+
"aria-labelledby": "modal-modal-title",
|
|
1985
|
+
"aria-describedby": "modal-modal-description",
|
|
1986
|
+
className: "forgot-password-modal"
|
|
1987
|
+
}, React.createElement(Box, {
|
|
1988
|
+
style: style
|
|
1989
|
+
}, React.createElement("div", null, React.createElement(Formik, {
|
|
1990
|
+
initialValues: {
|
|
1991
|
+
email: ''
|
|
1992
|
+
},
|
|
1993
|
+
validationSchema: Schema,
|
|
1994
|
+
onSubmit: onForgotPassword
|
|
1995
|
+
}, function (_ref4) {
|
|
1996
|
+
var isValid = _ref4.isValid,
|
|
1997
|
+
dirty = _ref4.dirty,
|
|
1998
|
+
handleSubmit = _ref4.handleSubmit;
|
|
1999
|
+
return React.createElement(Form, {
|
|
2000
|
+
onSubmit: handleSubmit
|
|
2001
|
+
}, React.createElement("div", {
|
|
2002
|
+
className: "forgot-password-container"
|
|
2003
|
+
}, React.createElement("div", {
|
|
2004
|
+
className: "title"
|
|
2005
|
+
}, "Password Reset"), React.createElement("div", {
|
|
2006
|
+
className: "forgot-password-container__singleField"
|
|
2007
|
+
}, React.createElement(Field, {
|
|
2008
|
+
name: "email",
|
|
2009
|
+
label: "Email",
|
|
2010
|
+
component: CustomField
|
|
2011
|
+
}))), React.createElement("div", {
|
|
2012
|
+
className: "forgot-password-action-button"
|
|
2013
|
+
}, React.createElement("button", {
|
|
2014
|
+
type: "submit",
|
|
2015
|
+
disabled: !(isValid && dirty)
|
|
2016
|
+
}, loading ? React.createElement(CircularProgress$1, {
|
|
2017
|
+
size: "22px"
|
|
2018
|
+
}) : 'Submit')), React.createElement("div", {
|
|
2019
|
+
className: "login"
|
|
2020
|
+
}, React.createElement("span", {
|
|
2021
|
+
onClick: onLogin
|
|
2022
|
+
}, "Back to Log In")));
|
|
2023
|
+
}))));
|
|
2024
|
+
};
|
|
2025
|
+
|
|
2026
|
+
var style$1 = {
|
|
2027
|
+
position: 'absolute',
|
|
2028
|
+
top: '50%',
|
|
2029
|
+
left: '50%',
|
|
2030
|
+
transform: 'translate(-50%, -50%)',
|
|
2031
|
+
minWidth: 480,
|
|
2032
|
+
backgroundColor: '#e3e3e3',
|
|
2033
|
+
border: '1px solid white',
|
|
2034
|
+
outline: 'none'
|
|
1819
2035
|
};
|
|
1820
2036
|
var setLoggedUserData = function setLoggedUserData(data) {
|
|
1821
2037
|
return {
|
|
@@ -1832,564 +2048,652 @@ var setLoggedUserData = function setLoggedUserData(data) {
|
|
|
1832
2048
|
zip: (data == null ? void 0 : data.zip) || (data == null ? void 0 : data.zipCode) || ''
|
|
1833
2049
|
};
|
|
1834
2050
|
};
|
|
1835
|
-
var
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
2051
|
+
var LoginModal = function LoginModal(_ref) {
|
|
2052
|
+
var onClose = _ref.onClose,
|
|
2053
|
+
onLogin = _ref.onLogin,
|
|
2054
|
+
_ref$alreadyHasUser = _ref.alreadyHasUser,
|
|
2055
|
+
alreadyHasUser = _ref$alreadyHasUser === void 0 ? false : _ref$alreadyHasUser,
|
|
2056
|
+
_ref$userExpired = _ref.userExpired,
|
|
2057
|
+
userExpired = _ref$userExpired === void 0 ? false : _ref$userExpired,
|
|
2058
|
+
_ref$onGetProfileData = _ref.onGetProfileDataSuccess,
|
|
2059
|
+
onGetProfileDataSuccess = _ref$onGetProfileData === void 0 ? _identity : _ref$onGetProfileData,
|
|
2060
|
+
_ref$onGetProfileData2 = _ref.onGetProfileDataError,
|
|
2061
|
+
onGetProfileDataError = _ref$onGetProfileData2 === void 0 ? _identity : _ref$onGetProfileData2,
|
|
2062
|
+
_ref$onForgotPassword = _ref.onForgotPassword,
|
|
2063
|
+
onForgotPassword = _ref$onForgotPassword === void 0 ? _identity : _ref$onForgotPassword,
|
|
2064
|
+
_ref$onSignup = _ref.onSignup,
|
|
2065
|
+
onSignup = _ref$onSignup === void 0 ? _identity : _ref$onSignup,
|
|
2066
|
+
_ref$modalClassname = _ref.modalClassname,
|
|
2067
|
+
modalClassname = _ref$modalClassname === void 0 ? '' : _ref$modalClassname,
|
|
2068
|
+
logo = _ref.logo,
|
|
2069
|
+
_ref$showForgotPasswo = _ref.showForgotPasswordButton,
|
|
2070
|
+
showForgotPasswordButton = _ref$showForgotPasswo === void 0 ? false : _ref$showForgotPasswo,
|
|
2071
|
+
_ref$showSignUpButton = _ref.showSignUpButton,
|
|
2072
|
+
showSignUpButton = _ref$showSignUpButton === void 0 ? false : _ref$showSignUpButton;
|
|
1839
2073
|
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
2074
|
+
var _useState = useState(''),
|
|
2075
|
+
error = _useState[0],
|
|
2076
|
+
setError = _useState[1];
|
|
1843
2077
|
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
2078
|
+
return React.createElement(Modal$1, {
|
|
2079
|
+
open: true,
|
|
2080
|
+
onClose: onClose,
|
|
2081
|
+
"aria-labelledby": "modal-modal-title",
|
|
2082
|
+
"aria-describedby": "modal-modal-description",
|
|
2083
|
+
className: "login-modal " + modalClassname
|
|
2084
|
+
}, React.createElement(Box$1, {
|
|
2085
|
+
style: style$1
|
|
2086
|
+
}, React.createElement("div", null, React.createElement(Formik, {
|
|
2087
|
+
initialValues: {
|
|
2088
|
+
email: '',
|
|
2089
|
+
password: ''
|
|
2090
|
+
},
|
|
2091
|
+
onSubmit: function () {
|
|
2092
|
+
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref2) {
|
|
2093
|
+
var email, password, body, profileResponse, profileSpecifiedData, profileDataObj, event, _e$response, _e$response$data, _error;
|
|
1847
2094
|
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
2095
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
2096
|
+
while (1) {
|
|
2097
|
+
switch (_context.prev = _context.next) {
|
|
2098
|
+
case 0:
|
|
2099
|
+
email = _ref2.email, password = _ref2.password;
|
|
2100
|
+
_context.prev = 1;
|
|
2101
|
+
body = {
|
|
2102
|
+
email: email,
|
|
2103
|
+
password: password
|
|
2104
|
+
};
|
|
2105
|
+
_context.next = 5;
|
|
2106
|
+
return authorize(body);
|
|
1853
2107
|
|
|
1854
|
-
|
|
1855
|
-
|
|
2108
|
+
case 5:
|
|
2109
|
+
profileResponse = null;
|
|
2110
|
+
_context.prev = 6;
|
|
2111
|
+
_context.next = 9;
|
|
2112
|
+
return getProfileData();
|
|
1856
2113
|
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
holders.push(individualHolder);
|
|
1863
|
-
};
|
|
2114
|
+
case 9:
|
|
2115
|
+
profileResponse = _context.sent;
|
|
2116
|
+
onGetProfileDataSuccess(profileResponse.data);
|
|
2117
|
+
_context.next = 17;
|
|
2118
|
+
break;
|
|
1864
2119
|
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
2120
|
+
case 13:
|
|
2121
|
+
_context.prev = 13;
|
|
2122
|
+
_context.t0 = _context["catch"](6);
|
|
1868
2123
|
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
ticket_holders = filteredHolders.map(function (item, index) {
|
|
1873
|
-
return {
|
|
1874
|
-
first_name: item["holderFirstName-" + index] || '',
|
|
1875
|
-
last_name: item["holderLastName-" + index] || '',
|
|
1876
|
-
phone: item["holderPhone-" + index] || '',
|
|
1877
|
-
email: item["holderEmail-" + index] || ''
|
|
1878
|
-
};
|
|
1879
|
-
});
|
|
1880
|
-
var filteredRestValue = {};
|
|
2124
|
+
if (axios.isAxiosError(_context.t0)) {
|
|
2125
|
+
onGetProfileDataError(_context.t0);
|
|
2126
|
+
}
|
|
1881
2127
|
|
|
1882
|
-
|
|
1883
|
-
if (!key.includes('holder')) {
|
|
1884
|
-
filteredRestValue[key] = value;
|
|
1885
|
-
}
|
|
1886
|
-
});
|
|
2128
|
+
return _context.abrupt("return");
|
|
1887
2129
|
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
2130
|
+
case 17:
|
|
2131
|
+
profileSpecifiedData = _get(profileResponse, 'data.data');
|
|
2132
|
+
profileDataObj = setLoggedUserData(profileSpecifiedData);
|
|
2133
|
+
|
|
2134
|
+
if (typeof window !== 'undefined') {
|
|
2135
|
+
window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
|
|
2136
|
+
event = new window.CustomEvent('tf-login');
|
|
2137
|
+
window.document.dispatchEvent(event);
|
|
2138
|
+
}
|
|
1897
2139
|
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
body.attributes.dob_month = holderAgeDate.getMonth() + 1;
|
|
1902
|
-
body.attributes.dob_year = holderAgeDate.getFullYear();
|
|
1903
|
-
}
|
|
2140
|
+
onLogin();
|
|
2141
|
+
_context.next = 26;
|
|
2142
|
+
break;
|
|
1904
2143
|
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
var validationFunctions = [];
|
|
2144
|
+
case 23:
|
|
2145
|
+
_context.prev = 23;
|
|
2146
|
+
_context.t1 = _context["catch"](1);
|
|
1909
2147
|
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
2148
|
+
if (axios.isAxiosError(_context.t1)) {
|
|
2149
|
+
_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';
|
|
2150
|
+
setError(_error);
|
|
2151
|
+
} else if (_context.t1 instanceof Error) {
|
|
2152
|
+
setError((_context.t1 == null ? void 0 : _context.t1.message) || 'Error');
|
|
2153
|
+
}
|
|
1915
2154
|
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
2155
|
+
case 26:
|
|
2156
|
+
case "end":
|
|
2157
|
+
return _context.stop();
|
|
2158
|
+
}
|
|
2159
|
+
}
|
|
2160
|
+
}, _callee, null, [[1, 23], [6, 13]]);
|
|
2161
|
+
}));
|
|
1919
2162
|
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
};
|
|
2163
|
+
function onSubmit(_x) {
|
|
2164
|
+
return _onSubmit.apply(this, arguments);
|
|
2165
|
+
}
|
|
1924
2166
|
|
|
1925
|
-
|
|
1926
|
-
|
|
2167
|
+
return onSubmit;
|
|
2168
|
+
}()
|
|
2169
|
+
}, function (props) {
|
|
2170
|
+
return React.createElement(Form, {
|
|
2171
|
+
onSubmit: props.handleSubmit
|
|
2172
|
+
}, React.createElement("div", {
|
|
2173
|
+
className: "modal-title"
|
|
2174
|
+
}, "Login"), React.createElement("div", {
|
|
2175
|
+
className: 'login-logo-container'
|
|
2176
|
+
}, React.createElement("img", {
|
|
2177
|
+
className: "login-logo-tff",
|
|
2178
|
+
src: logo || "https://www.ticketfairy.com/resources/images/logo-ttf-black.svg",
|
|
2179
|
+
alt: "logo"
|
|
2180
|
+
})), React.createElement("div", {
|
|
2181
|
+
className: "server_auth__error"
|
|
2182
|
+
}, error), alreadyHasUser && React.createElement("p", {
|
|
2183
|
+
className: "info-text-for-login"
|
|
2184
|
+
}, "It appears this email is already attached to an account. Please log in here to complete your registration."), userExpired && React.createElement("p", {
|
|
2185
|
+
className: "info-text-for-login"
|
|
2186
|
+
}, "Your session has expired, please log in again."), React.createElement("div", {
|
|
2187
|
+
className: "login-modal-body"
|
|
2188
|
+
}, React.createElement("div", {
|
|
2189
|
+
className: "login-modal-body__email"
|
|
2190
|
+
}, React.createElement(Field, {
|
|
2191
|
+
name: 'email',
|
|
2192
|
+
validate: requiredValidator
|
|
2193
|
+
}, function (_ref3) {
|
|
2194
|
+
var field = _ref3.field,
|
|
2195
|
+
meta = _ref3.meta;
|
|
2196
|
+
return React.createElement(TextField$1, Object.assign({
|
|
2197
|
+
label: 'Email',
|
|
2198
|
+
type: 'email',
|
|
2199
|
+
fullWidth: true,
|
|
2200
|
+
error: !!meta.error && meta.touched,
|
|
2201
|
+
helperText: meta.touched && meta.error
|
|
2202
|
+
}, field));
|
|
2203
|
+
})), React.createElement("div", {
|
|
2204
|
+
className: "login-modal-body__password"
|
|
2205
|
+
}, React.createElement(Field, {
|
|
2206
|
+
name: 'password',
|
|
2207
|
+
validate: requiredValidator
|
|
2208
|
+
}, function (_ref4) {
|
|
2209
|
+
var field = _ref4.field,
|
|
2210
|
+
meta = _ref4.meta;
|
|
2211
|
+
return React.createElement(TextField$1, Object.assign({
|
|
2212
|
+
label: "Password",
|
|
2213
|
+
type: "password",
|
|
2214
|
+
fullWidth: true,
|
|
2215
|
+
error: !!meta.error && meta.touched,
|
|
2216
|
+
helperText: meta.touched && meta.error
|
|
2217
|
+
}, field));
|
|
2218
|
+
})), React.createElement("div", {
|
|
2219
|
+
className: "login-action-button"
|
|
2220
|
+
}, React.createElement("button", {
|
|
2221
|
+
type: "submit"
|
|
2222
|
+
}, "Login")), showForgotPasswordButton && React.createElement("div", {
|
|
2223
|
+
className: "forgot-password"
|
|
2224
|
+
}, React.createElement("span", {
|
|
2225
|
+
"aria-hidden": "true",
|
|
2226
|
+
onClick: onForgotPassword
|
|
2227
|
+
}, "Forgot password?")), showSignUpButton && React.createElement("div", {
|
|
2228
|
+
className: "forgot-password"
|
|
2229
|
+
}, React.createElement("span", {
|
|
2230
|
+
"aria-hidden": "true",
|
|
2231
|
+
onClick: onSignup
|
|
2232
|
+
}, "Sign up"))));
|
|
2233
|
+
}))));
|
|
2234
|
+
};
|
|
1927
2235
|
|
|
1928
|
-
|
|
2236
|
+
var style$2 = {
|
|
2237
|
+
position: 'absolute',
|
|
2238
|
+
top: '50%',
|
|
2239
|
+
left: '50%',
|
|
2240
|
+
transform: 'translate(-50%, -50%)',
|
|
2241
|
+
minWidth: 480,
|
|
2242
|
+
backgroundColor: '#fff',
|
|
2243
|
+
border: '1px solid white',
|
|
2244
|
+
outline: 'none',
|
|
2245
|
+
padding: '14px'
|
|
1929
2246
|
};
|
|
1930
|
-
var
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
2247
|
+
var SignupSchema = /*#__PURE__*/object().shape({
|
|
2248
|
+
firstName: /*#__PURE__*/string().required('Required'),
|
|
2249
|
+
lastName: /*#__PURE__*/string().required('Required'),
|
|
2250
|
+
email: /*#__PURE__*/string().email('Invalid email').required('Required'),
|
|
2251
|
+
password: /*#__PURE__*/string().min(6, 'Password must have 5+ characters').required('Required'),
|
|
2252
|
+
confirmPassword: /*#__PURE__*/string().required('Required').oneOf([/*#__PURE__*/ref('password'), null], 'Passwords must match')
|
|
2253
|
+
});
|
|
2254
|
+
var SignupModal = function SignupModal(_ref) {
|
|
2255
|
+
var _ref$onClose = _ref.onClose,
|
|
2256
|
+
onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
|
|
2257
|
+
_ref$onLogin = _ref.onLogin,
|
|
2258
|
+
onLogin = _ref$onLogin === void 0 ? function () {} : _ref$onLogin,
|
|
2259
|
+
_ref$onRegisterSucces = _ref.onRegisterSuccess,
|
|
2260
|
+
onRegisterSuccess = _ref$onRegisterSucces === void 0 ? function () {} : _ref$onRegisterSucces,
|
|
2261
|
+
_ref$onRegisterError = _ref.onRegisterError,
|
|
2262
|
+
onRegisterError = _ref$onRegisterError === void 0 ? function () {} : _ref$onRegisterError;
|
|
1934
2263
|
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
item[key] = assingUniqueIds(itemValue);
|
|
1939
|
-
}
|
|
1940
|
-
});
|
|
2264
|
+
var _useState = useState(false),
|
|
2265
|
+
loading = _useState[0],
|
|
2266
|
+
setLoading = _useState[1];
|
|
1941
2267
|
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
2268
|
+
var onSignup = /*#__PURE__*/function () {
|
|
2269
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(values) {
|
|
2270
|
+
var formData, res, access_token_register, refreshToken, tokens;
|
|
2271
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
2272
|
+
while (1) {
|
|
2273
|
+
switch (_context.prev = _context.next) {
|
|
2274
|
+
case 0:
|
|
2275
|
+
_context.prev = 0;
|
|
2276
|
+
setLoading(true);
|
|
2277
|
+
formData = new FormData();
|
|
2278
|
+
formData.set('first_name', values.firstName);
|
|
2279
|
+
formData.set('last_name', values.lastName);
|
|
2280
|
+
formData.set('email', values.email);
|
|
2281
|
+
formData.set('password', values.password);
|
|
2282
|
+
formData.set('password_confirmation', values.confirmPassword);
|
|
2283
|
+
formData.append('client_id', CONFIGS.CLIENT_ID || 'e9d8f8922797b4621e562255afe90dbf');
|
|
2284
|
+
formData.append('client_secret', CONFIGS.CLIENT_SECRET || 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9');
|
|
2285
|
+
_context.next = 12;
|
|
2286
|
+
return register(formData);
|
|
1947
2287
|
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
2288
|
+
case 12:
|
|
2289
|
+
res = _context.sent;
|
|
2290
|
+
access_token_register = _get(res, 'data.data.attributes.access_token');
|
|
2291
|
+
refreshToken = _get(res, 'data.data.attributes.refresh_token');
|
|
2292
|
+
handleSetAccessToken(access_token_register);
|
|
2293
|
+
tokens = {
|
|
2294
|
+
accessToken: access_token_register,
|
|
2295
|
+
refreshToken: refreshToken
|
|
2296
|
+
};
|
|
2297
|
+
onRegisterSuccess(tokens);
|
|
2298
|
+
onClose();
|
|
2299
|
+
_context.next = 24;
|
|
2300
|
+
break;
|
|
1951
2301
|
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
2302
|
+
case 21:
|
|
2303
|
+
_context.prev = 21;
|
|
2304
|
+
_context.t0 = _context["catch"](0);
|
|
1955
2305
|
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
}, React.createElement(FormGroup, null, React.createElement(FormControlLabel, {
|
|
1960
|
-
control: React.createElement(Checkbox, Object.assign({}, field, rest)),
|
|
1961
|
-
label: label,
|
|
1962
|
-
componentsProps: {
|
|
1963
|
-
typography: customTheme == null ? void 0 : customTheme.checkbox
|
|
1964
|
-
}
|
|
1965
|
-
})), !!(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.createElement(FormHelperText, null, "Required") : null);
|
|
1966
|
-
};
|
|
2306
|
+
if (axios.isAxiosError(_context.t0)) {
|
|
2307
|
+
onRegisterError(_context.t0, values.email);
|
|
2308
|
+
}
|
|
1967
2309
|
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
field = _ref.field,
|
|
1973
|
-
_ref$selectOptions = _ref.selectOptions,
|
|
1974
|
-
selectOptions = _ref$selectOptions === void 0 ? [] : _ref$selectOptions,
|
|
1975
|
-
_ref$form = _ref.form,
|
|
1976
|
-
touched = _ref$form.touched,
|
|
1977
|
-
errors = _ref$form.errors,
|
|
1978
|
-
submitCount = _ref$form.submitCount,
|
|
1979
|
-
theme = _ref.theme,
|
|
1980
|
-
_ref$inputProps = _ref.inputProps,
|
|
1981
|
-
pInputProps = _ref$inputProps === void 0 ? {} : _ref$inputProps,
|
|
1982
|
-
_ref$InputProps = _ref.InputProps,
|
|
1983
|
-
InputProps = _ref$InputProps === void 0 ? {} : _ref$InputProps,
|
|
1984
|
-
inputRef = _ref.inputRef;
|
|
1985
|
-
var isSelectField = type === 'select';
|
|
2310
|
+
case 24:
|
|
2311
|
+
_context.prev = 24;
|
|
2312
|
+
setLoading(false);
|
|
2313
|
+
return _context.finish(24);
|
|
1986
2314
|
|
|
1987
|
-
|
|
2315
|
+
case 27:
|
|
2316
|
+
case "end":
|
|
2317
|
+
return _context.stop();
|
|
2318
|
+
}
|
|
2319
|
+
}
|
|
2320
|
+
}, _callee, null, [[0, 21, 24, 27]]);
|
|
2321
|
+
}));
|
|
1988
2322
|
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2323
|
+
return function onSignup(_x) {
|
|
2324
|
+
return _ref2.apply(this, arguments);
|
|
2325
|
+
};
|
|
2326
|
+
}();
|
|
2327
|
+
|
|
2328
|
+
var _onClose = loading ? function () {} : onClose;
|
|
2329
|
+
|
|
2330
|
+
return React.createElement(Modal, {
|
|
2331
|
+
open: true,
|
|
2332
|
+
onClose: _onClose,
|
|
2333
|
+
"aria-labelledby": "modal-modal-title",
|
|
2334
|
+
"aria-describedby": "modal-modal-description",
|
|
2335
|
+
className: "signup-modal"
|
|
2336
|
+
}, React.createElement(Box, {
|
|
2337
|
+
style: style$2
|
|
2338
|
+
}, React.createElement("div", null, React.createElement(Formik, {
|
|
2339
|
+
initialValues: {
|
|
2340
|
+
firstName: '',
|
|
2341
|
+
lastName: '',
|
|
2342
|
+
email: '',
|
|
2343
|
+
password: '',
|
|
2344
|
+
confirmPassword: ''
|
|
2011
2345
|
},
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
},
|
|
2021
|
-
|
|
2346
|
+
validationSchema: SignupSchema,
|
|
2347
|
+
onSubmit: onSignup
|
|
2348
|
+
}, function (_ref3) {
|
|
2349
|
+
var isValid = _ref3.isValid,
|
|
2350
|
+
dirty = _ref3.dirty,
|
|
2351
|
+
handleSubmit = _ref3.handleSubmit;
|
|
2352
|
+
return React.createElement(Form, {
|
|
2353
|
+
onSubmit: handleSubmit
|
|
2354
|
+
}, React.createElement("div", {
|
|
2355
|
+
className: "signup-container"
|
|
2356
|
+
}, React.createElement("div", {
|
|
2357
|
+
className: "title"
|
|
2358
|
+
}, "Create an Account"), React.createElement("div", {
|
|
2359
|
+
className: "signup-container__twoFields"
|
|
2360
|
+
}, React.createElement("div", {
|
|
2361
|
+
className: "is-half"
|
|
2362
|
+
}, React.createElement(Field, {
|
|
2363
|
+
name: "firstName",
|
|
2364
|
+
label: "First Name",
|
|
2365
|
+
component: CustomField
|
|
2366
|
+
})), React.createElement("div", {
|
|
2367
|
+
className: "is-half"
|
|
2368
|
+
}, React.createElement(Field, {
|
|
2369
|
+
name: "lastName",
|
|
2370
|
+
label: "Last Name",
|
|
2371
|
+
component: CustomField
|
|
2372
|
+
}))), React.createElement("div", {
|
|
2373
|
+
className: "signup-container__singleField"
|
|
2374
|
+
}, React.createElement("div", {
|
|
2375
|
+
className: ""
|
|
2376
|
+
}, React.createElement(Field, {
|
|
2377
|
+
name: "email",
|
|
2378
|
+
label: "Email",
|
|
2379
|
+
component: CustomField
|
|
2380
|
+
}))), React.createElement("div", {
|
|
2381
|
+
className: "signup-container__twoFields"
|
|
2382
|
+
}, React.createElement("div", {
|
|
2383
|
+
className: "is-half"
|
|
2384
|
+
}, React.createElement(Field, {
|
|
2385
|
+
name: "password",
|
|
2386
|
+
label: "Password",
|
|
2387
|
+
type: "password",
|
|
2388
|
+
component: CustomField
|
|
2389
|
+
})), React.createElement("div", {
|
|
2390
|
+
className: "is-half"
|
|
2391
|
+
}, React.createElement(Field, {
|
|
2392
|
+
name: "confirmPassword",
|
|
2393
|
+
label: "Confirm Password",
|
|
2394
|
+
type: "password",
|
|
2395
|
+
component: CustomField
|
|
2396
|
+
})))), React.createElement("div", {
|
|
2397
|
+
className: "signup-action-button"
|
|
2398
|
+
}, React.createElement("button", {
|
|
2399
|
+
type: "submit",
|
|
2400
|
+
disabled: !(isValid && dirty)
|
|
2401
|
+
}, loading ? React.createElement(CircularProgress$1, {
|
|
2402
|
+
size: "22px"
|
|
2403
|
+
}) : 'Submit')), React.createElement("div", {
|
|
2404
|
+
className: "login"
|
|
2405
|
+
}, React.createElement("span", {
|
|
2406
|
+
onClick: onLogin
|
|
2407
|
+
}, "Login")));
|
|
2408
|
+
}))));
|
|
2022
2409
|
};
|
|
2023
2410
|
|
|
2024
|
-
var
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2411
|
+
var showZero = function showZero(value) {
|
|
2412
|
+
if (value === void 0) {
|
|
2413
|
+
value = 0;
|
|
2414
|
+
}
|
|
2415
|
+
|
|
2416
|
+
var intNumber = Number(value);
|
|
2417
|
+
return _isNumber(intNumber) ? intNumber >= 0 && intNumber < 10 ? '0' + intNumber : intNumber : null;
|
|
2031
2418
|
};
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2419
|
+
|
|
2420
|
+
var getImage = function getImage(name) {
|
|
2421
|
+
if (name === void 0) {
|
|
2422
|
+
name = '';
|
|
2035
2423
|
}
|
|
2036
2424
|
|
|
2037
|
-
|
|
2038
|
-
case 'GBP':
|
|
2039
|
-
return '£';
|
|
2425
|
+
var image = '';
|
|
2040
2426
|
|
|
2041
|
-
|
|
2042
|
-
|
|
2427
|
+
if (!name.trim().length) {
|
|
2428
|
+
return image;
|
|
2429
|
+
}
|
|
2043
2430
|
|
|
2044
|
-
|
|
2045
|
-
|
|
2431
|
+
if (process.env.NODE_ENV === 'production') {
|
|
2432
|
+
image = require("./images/" + name);
|
|
2433
|
+
return image["default"];
|
|
2434
|
+
}
|
|
2046
2435
|
|
|
2047
|
-
|
|
2048
|
-
|
|
2436
|
+
return image;
|
|
2437
|
+
};
|
|
2049
2438
|
|
|
2050
|
-
|
|
2051
|
-
|
|
2439
|
+
var TimerWidget = function TimerWidget(_ref) {
|
|
2440
|
+
var expires_at = _ref.expires_at,
|
|
2441
|
+
buyLoading = _ref.buyLoading,
|
|
2442
|
+
_ref$onCountdownFinis = _ref.onCountdownFinish,
|
|
2443
|
+
onCountdownFinish = _ref$onCountdownFinis === void 0 ? function () {} : _ref$onCountdownFinis;
|
|
2052
2444
|
|
|
2053
|
-
|
|
2054
|
-
|
|
2445
|
+
var _useState = useState(true),
|
|
2446
|
+
showTimer = _useState[0],
|
|
2447
|
+
setShowTimer = _useState[1];
|
|
2055
2448
|
|
|
2056
|
-
|
|
2057
|
-
|
|
2449
|
+
var handleCountdownFinish = function handleCountdownFinish() {
|
|
2450
|
+
setShowTimer(false);
|
|
2058
2451
|
|
|
2059
|
-
|
|
2060
|
-
|
|
2452
|
+
if (!buyLoading) {
|
|
2453
|
+
onCountdownFinish();
|
|
2454
|
+
}
|
|
2455
|
+
};
|
|
2061
2456
|
|
|
2062
|
-
|
|
2063
|
-
|
|
2457
|
+
var _renderer = function renderer(_ref2) {
|
|
2458
|
+
var minutes = _ref2.minutes,
|
|
2459
|
+
seconds = _ref2.seconds,
|
|
2460
|
+
completed = _ref2.completed,
|
|
2461
|
+
handleCountdownFinish = _ref2.handleCountdownFinish;
|
|
2064
2462
|
|
|
2065
|
-
|
|
2066
|
-
|
|
2463
|
+
if (completed) {
|
|
2464
|
+
handleCountdownFinish();
|
|
2465
|
+
return null;
|
|
2466
|
+
}
|
|
2067
2467
|
|
|
2068
|
-
|
|
2069
|
-
|
|
2468
|
+
return React.createElement("span", null, showZero(minutes), ":", showZero(seconds));
|
|
2469
|
+
};
|
|
2070
2470
|
|
|
2071
|
-
|
|
2072
|
-
|
|
2471
|
+
var hideTimer = function hideTimer() {
|
|
2472
|
+
var timerRl = document.querySelector('.timer');
|
|
2073
2473
|
|
|
2074
|
-
|
|
2075
|
-
|
|
2474
|
+
if (timerRl) {
|
|
2475
|
+
timerRl.style.visibility = "hidden";
|
|
2476
|
+
}
|
|
2477
|
+
};
|
|
2076
2478
|
|
|
2077
|
-
|
|
2078
|
-
|
|
2479
|
+
return showTimer && !!expires_at ? React.createElement("div", {
|
|
2480
|
+
className: "timer"
|
|
2481
|
+
}, React.createElement("div", {
|
|
2482
|
+
className: 'close-icon',
|
|
2483
|
+
onClick: hideTimer
|
|
2484
|
+
}, React.createElement(SVG, {
|
|
2485
|
+
src: getImage('cross.svg'),
|
|
2486
|
+
width: '10',
|
|
2487
|
+
height: '10',
|
|
2488
|
+
fill: '#fff'
|
|
2489
|
+
})), React.createElement("div", {
|
|
2490
|
+
className: "toast-message"
|
|
2491
|
+
}, React.createElement("p", null, "Please complete your purchase before the timer reaches zero."), React.createElement("p", {
|
|
2492
|
+
className: "countdown"
|
|
2493
|
+
}, React.createElement(Countdown$1, {
|
|
2494
|
+
date: Date.now() + expires_at * 1000,
|
|
2495
|
+
renderer: function renderer(props) {
|
|
2496
|
+
return _renderer(_extends({}, props, {
|
|
2497
|
+
handleCountdownFinish: handleCountdownFinish
|
|
2498
|
+
}));
|
|
2499
|
+
}
|
|
2500
|
+
})))) : null;
|
|
2501
|
+
};
|
|
2079
2502
|
|
|
2080
|
-
|
|
2081
|
-
return 'Kr';
|
|
2503
|
+
var TimerWidget$1 = /*#__PURE__*/memo(TimerWidget);
|
|
2082
2504
|
|
|
2083
|
-
|
|
2084
|
-
|
|
2505
|
+
var _excluded$1 = ["firstName", "lastName", "holderAge", "confirmEmail", "confirmPassword"];
|
|
2506
|
+
var getInitialValues = function getInitialValues(data, propsInitialValues, userValues) {
|
|
2507
|
+
if (data === void 0) {
|
|
2508
|
+
data = [];
|
|
2509
|
+
}
|
|
2085
2510
|
|
|
2086
|
-
|
|
2087
|
-
|
|
2511
|
+
if (propsInitialValues === void 0) {
|
|
2512
|
+
propsInitialValues = {};
|
|
2088
2513
|
}
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
string = '';
|
|
2514
|
+
|
|
2515
|
+
if (userValues === void 0) {
|
|
2516
|
+
userValues = {};
|
|
2093
2517
|
}
|
|
2094
2518
|
|
|
2095
|
-
|
|
2096
|
-
|
|
2519
|
+
var results = _flatMapDeep(data, function (_ref) {
|
|
2520
|
+
var fields = _ref.fields;
|
|
2521
|
+
return _map(fields, function (_ref2) {
|
|
2522
|
+
var groupItems = _ref2.groupItems;
|
|
2523
|
+
return _map(groupItems, function (_ref3) {
|
|
2524
|
+
var name = _ref3.name;
|
|
2525
|
+
return name;
|
|
2526
|
+
});
|
|
2527
|
+
});
|
|
2528
|
+
});
|
|
2097
2529
|
|
|
2098
|
-
var
|
|
2099
|
-
var FormikPhoneNumberField = function FormikPhoneNumberField(_ref) {
|
|
2100
|
-
var label = _ref.label,
|
|
2101
|
-
field = _ref.field,
|
|
2102
|
-
_ref$form = _ref.form,
|
|
2103
|
-
touched = _ref$form.touched,
|
|
2104
|
-
errors = _ref$form.errors,
|
|
2105
|
-
initialValues = _ref$form.initialValues,
|
|
2106
|
-
setFieldValue = _ref.setFieldValue,
|
|
2107
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
2530
|
+
var initialValues = {};
|
|
2108
2531
|
|
|
2109
|
-
|
|
2532
|
+
_forEach(results, function (item) {
|
|
2533
|
+
initialValues[item] = propsInitialValues[item] || userValues[item] || '';
|
|
2534
|
+
}); // set logged in user as first ticket holder
|
|
2110
2535
|
|
|
2111
|
-
var isTouched = Boolean(_get(touched, field.name));
|
|
2112
|
-
var customTheme = useTheme();
|
|
2113
|
-
return React.createElement(MuiPhoneNumber, Object.assign({
|
|
2114
|
-
name: 'phone',
|
|
2115
|
-
value: initialValues.phone,
|
|
2116
|
-
onChange: function onChange(e) {
|
|
2117
|
-
return setFieldValue("phone", removePlusSign(e));
|
|
2118
|
-
},
|
|
2119
|
-
variant: "outlined",
|
|
2120
|
-
defaultCountry: 'us',
|
|
2121
|
-
disableDropdown: true,
|
|
2122
|
-
label: label,
|
|
2123
|
-
error: !!error && isTouched,
|
|
2124
|
-
helperText: isTouched && error,
|
|
2125
|
-
fullWidth: true,
|
|
2126
|
-
InputLabelProps: {
|
|
2127
|
-
sx: customTheme == null ? void 0 : customTheme.input
|
|
2128
|
-
},
|
|
2129
|
-
InputProps: {
|
|
2130
|
-
sx: customTheme == null ? void 0 : customTheme.input
|
|
2131
|
-
},
|
|
2132
|
-
autoFormat: false
|
|
2133
|
-
}, rest));
|
|
2134
|
-
};
|
|
2135
2536
|
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
}
|
|
2537
|
+
initialValues['holderFirstName-0'] = propsInitialValues.firstName || userValues.firstName || '';
|
|
2538
|
+
initialValues['holderLastName-0'] = propsInitialValues.lastName || userValues.lastName || '';
|
|
2539
|
+
initialValues['holderEmail-0'] = propsInitialValues.email || userValues.email || '';
|
|
2540
|
+
return initialValues;
|
|
2541
|
+
};
|
|
2542
|
+
var createRegisterFormData = function createRegisterFormData(values, checkoutBody) {
|
|
2543
|
+
if (values === void 0) {
|
|
2544
|
+
values = {};
|
|
2545
|
+
}
|
|
2141
2546
|
|
|
2142
|
-
var
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
errors = _ref$form.errors,
|
|
2152
|
-
theme = _ref.theme;
|
|
2153
|
-
var isTouched = Boolean(_get(touched, field.name));
|
|
2547
|
+
var bodyFormData = new FormData();
|
|
2548
|
+
bodyFormData.append('first_name', values.firstName);
|
|
2549
|
+
bodyFormData.append('last_name', values.lastName);
|
|
2550
|
+
bodyFormData.append('email', values.email);
|
|
2551
|
+
bodyFormData.append('password', values.password);
|
|
2552
|
+
bodyFormData.append('password_confirmation', values.confirmPassword);
|
|
2553
|
+
bodyFormData.append('client_id', CONFIGS.CLIENT_ID || 'e9d8f8922797b4621e562255afe90dbf');
|
|
2554
|
+
bodyFormData.append('client_secret', CONFIGS.CLIENT_SECRET || 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9');
|
|
2555
|
+
bodyFormData.append('check_cart_expiration', 'true');
|
|
2154
2556
|
|
|
2155
|
-
|
|
2557
|
+
_forEach(checkoutBody.attributes, function (item, key) {
|
|
2558
|
+
bodyFormData.append(key, item);
|
|
2559
|
+
});
|
|
2156
2560
|
|
|
2157
|
-
|
|
2158
|
-
return React.createElement(FormControl, {
|
|
2159
|
-
fullWidth: true
|
|
2160
|
-
}, React.createElement(InputLabel, {
|
|
2161
|
-
style: customTheme == null ? void 0 : customTheme.input,
|
|
2162
|
-
htmlFor: field.name,
|
|
2163
|
-
error: !!error && isTouched,
|
|
2164
|
-
shrink: true
|
|
2165
|
-
}, label), React.createElement(Select, Object.assign({
|
|
2166
|
-
id: field.name,
|
|
2167
|
-
label: label,
|
|
2168
|
-
type: type,
|
|
2169
|
-
fullWidth: true,
|
|
2170
|
-
error: !!error && isTouched,
|
|
2171
|
-
inputProps: {
|
|
2172
|
-
id: field.name
|
|
2173
|
-
},
|
|
2174
|
-
"native": true,
|
|
2175
|
-
className: theme,
|
|
2176
|
-
MenuProps: {
|
|
2177
|
-
className: theme
|
|
2178
|
-
}
|
|
2179
|
-
}, field, {
|
|
2180
|
-
style: customTheme == null ? void 0 : customTheme.input
|
|
2181
|
-
}), _map(selectOptions, function (option) {
|
|
2182
|
-
return React.createElement("option", {
|
|
2183
|
-
key: option.value,
|
|
2184
|
-
value: option.value,
|
|
2185
|
-
disabled: option.disabled
|
|
2186
|
-
}, option.label);
|
|
2187
|
-
})), isTouched && error ? React.createElement(FormHelperText, {
|
|
2188
|
-
error: !!error && isTouched
|
|
2189
|
-
}, error) : null);
|
|
2561
|
+
return bodyFormData;
|
|
2190
2562
|
};
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2563
|
+
var setLoggedUserData$1 = function setLoggedUserData(data) {
|
|
2564
|
+
return {
|
|
2565
|
+
id: data.id,
|
|
2566
|
+
first_name: data.firstName,
|
|
2567
|
+
last_name: data.lastName,
|
|
2568
|
+
email: data.email,
|
|
2569
|
+
confirmEmail: data.email,
|
|
2570
|
+
city: (data == null ? void 0 : data.city) || '',
|
|
2571
|
+
country: (data == null ? void 0 : data.countryId) || (data == null ? void 0 : data.country) || '',
|
|
2572
|
+
phone: (data == null ? void 0 : data.phone) || '',
|
|
2573
|
+
street_address: (data == null ? void 0 : data.streetAddress) || '',
|
|
2574
|
+
state: (data == null ? void 0 : data.stateId) || '',
|
|
2575
|
+
zip: (data == null ? void 0 : data.zip) || (data == null ? void 0 : data.zipCode) || ''
|
|
2576
|
+
};
|
|
2199
2577
|
};
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
name = '';
|
|
2578
|
+
var createCheckoutDataBody = function createCheckoutDataBody(ticketsQuantity, values, logedInValues, includeDob) {
|
|
2579
|
+
if (values === void 0) {
|
|
2580
|
+
values = {};
|
|
2204
2581
|
}
|
|
2205
2582
|
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
if (!name.trim().length) {
|
|
2209
|
-
return image;
|
|
2583
|
+
if (logedInValues === void 0) {
|
|
2584
|
+
logedInValues = {};
|
|
2210
2585
|
}
|
|
2211
2586
|
|
|
2212
|
-
if (
|
|
2213
|
-
|
|
2214
|
-
return image["default"];
|
|
2587
|
+
if (includeDob === void 0) {
|
|
2588
|
+
includeDob = false;
|
|
2215
2589
|
}
|
|
2216
2590
|
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
buyLoading = _ref.buyLoading,
|
|
2223
|
-
_ref$onCountdownFinis = _ref.onCountdownFinish,
|
|
2224
|
-
onCountdownFinish = _ref$onCountdownFinis === void 0 ? function () {} : _ref$onCountdownFinis;
|
|
2225
|
-
|
|
2226
|
-
var _useState = useState(true),
|
|
2227
|
-
showTimer = _useState[0],
|
|
2228
|
-
setShowTimer = _useState[1];
|
|
2591
|
+
var _values = values,
|
|
2592
|
+
firstName = _values.firstName,
|
|
2593
|
+
lastName = _values.lastName,
|
|
2594
|
+
holderAge = _values.holderAge,
|
|
2595
|
+
restValues = _objectWithoutPropertiesLoose(_values, _excluded$1);
|
|
2229
2596
|
|
|
2230
|
-
var
|
|
2231
|
-
|
|
2597
|
+
var holders = [];
|
|
2598
|
+
var ticket_holders = [];
|
|
2232
2599
|
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2600
|
+
var _loop = function _loop(i) {
|
|
2601
|
+
var individualHolder = Object.fromEntries(Object.entries(values).filter(function (_ref4) {
|
|
2602
|
+
var key = _ref4[0];
|
|
2603
|
+
return key.includes(String(i));
|
|
2604
|
+
}));
|
|
2605
|
+
holders.push(individualHolder);
|
|
2236
2606
|
};
|
|
2237
2607
|
|
|
2238
|
-
var
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
completed = _ref2.completed,
|
|
2242
|
-
handleCountdownFinish = _ref2.handleCountdownFinish;
|
|
2608
|
+
for (var i = 0; i <= ticketsQuantity; i++) {
|
|
2609
|
+
_loop(i);
|
|
2610
|
+
}
|
|
2243
2611
|
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2612
|
+
var filteredHolders = holders.filter(function (holder) {
|
|
2613
|
+
return Object.entries(holder).length > 0;
|
|
2614
|
+
});
|
|
2615
|
+
ticket_holders = filteredHolders.map(function (item, index) {
|
|
2616
|
+
return {
|
|
2617
|
+
first_name: !index ? item["holderFirstName-" + index] || logedInValues.firstNameLogged || '' : item["holderFirstName-" + index] || '',
|
|
2618
|
+
last_name: !index ? item["holderLastName-" + index] || logedInValues.lastNameLogged || '' : item["holderLastName-" + index] || '',
|
|
2619
|
+
phone: item["holderPhone-" + index] || '',
|
|
2620
|
+
email: !index ? item["holderEmail-" + index] || logedInValues.emailLogged || '' : item["holderEmail-" + index] || ''
|
|
2621
|
+
};
|
|
2622
|
+
});
|
|
2623
|
+
var filteredRestValue = {};
|
|
2624
|
+
|
|
2625
|
+
_forEach(restValues, function (value, key) {
|
|
2626
|
+
if (!key.includes('holder')) {
|
|
2627
|
+
filteredRestValue[key] = value;
|
|
2247
2628
|
}
|
|
2629
|
+
});
|
|
2248
2630
|
|
|
2249
|
-
|
|
2631
|
+
var body = {
|
|
2632
|
+
attributes: _extends({}, filteredRestValue, {
|
|
2633
|
+
email: restValues.email || logedInValues.emailLogged,
|
|
2634
|
+
confirm_email: restValues.email || logedInValues.emailLogged,
|
|
2635
|
+
first_name: firstName || logedInValues.firstNameLogged,
|
|
2636
|
+
last_name: lastName || logedInValues.lastNameLogged,
|
|
2637
|
+
ticket_holders: ticket_holders
|
|
2638
|
+
})
|
|
2250
2639
|
};
|
|
2251
2640
|
|
|
2252
|
-
|
|
2253
|
-
var
|
|
2641
|
+
if (includeDob) {
|
|
2642
|
+
var holderAgeDate = new Date(holderAge);
|
|
2643
|
+
body.attributes.dob_day = holderAgeDate.getDate();
|
|
2644
|
+
body.attributes.dob_month = holderAgeDate.getMonth() + 1;
|
|
2645
|
+
body.attributes.dob_year = holderAgeDate.getFullYear();
|
|
2646
|
+
}
|
|
2254
2647
|
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2648
|
+
return body;
|
|
2649
|
+
};
|
|
2650
|
+
var getValidateFunctions = function getValidateFunctions(element, states, values) {
|
|
2651
|
+
var validationFunctions = [];
|
|
2259
2652
|
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
className: 'close-icon',
|
|
2264
|
-
onClick: hideTimer
|
|
2265
|
-
}, React.createElement(SVG, {
|
|
2266
|
-
src: getImage('cross.svg'),
|
|
2267
|
-
width: '10',
|
|
2268
|
-
height: '10',
|
|
2269
|
-
fill: '#fff'
|
|
2270
|
-
})), React.createElement("div", {
|
|
2271
|
-
className: "toast-message"
|
|
2272
|
-
}, React.createElement("p", null, "Please complete your purchase before the timer reaches zero."), React.createElement("p", {
|
|
2273
|
-
className: "countdown"
|
|
2274
|
-
}, React.createElement(Countdown$1, {
|
|
2275
|
-
date: Date.now() + expires_at * 1000,
|
|
2276
|
-
renderer: function renderer(props) {
|
|
2277
|
-
return _renderer(_extends({}, props, {
|
|
2278
|
-
handleCountdownFinish: handleCountdownFinish
|
|
2279
|
-
}));
|
|
2653
|
+
if (element.required) {
|
|
2654
|
+
if (element.name !== 'state' || element.name === 'state' && states.length) {
|
|
2655
|
+
validationFunctions.push(requiredValidator);
|
|
2280
2656
|
}
|
|
2281
|
-
}
|
|
2282
|
-
};
|
|
2657
|
+
}
|
|
2283
2658
|
|
|
2284
|
-
|
|
2659
|
+
if (element.onValidate) {
|
|
2660
|
+
validationFunctions.push(element.onValidate);
|
|
2661
|
+
}
|
|
2285
2662
|
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
position = _ref.position,
|
|
2291
|
-
_ref$autoHideDuration = _ref.autoHideDuration,
|
|
2292
|
-
autoHideDuration = _ref$autoHideDuration === void 0 ? 3000 : _ref$autoHideDuration,
|
|
2293
|
-
variant = _ref.variant,
|
|
2294
|
-
onClose = _ref.onClose;
|
|
2295
|
-
return React.createElement("div", {
|
|
2296
|
-
className: "snackbar-alert-container"
|
|
2297
|
-
}, React.createElement(Snackbar, {
|
|
2298
|
-
autoHideDuration: autoHideDuration,
|
|
2299
|
-
open: isOpen,
|
|
2300
|
-
anchorOrigin: position || {
|
|
2301
|
-
vertical: 'top',
|
|
2302
|
-
horizontal: 'center'
|
|
2303
|
-
},
|
|
2304
|
-
onClose: onClose,
|
|
2305
|
-
classes: {
|
|
2306
|
-
root: 'snackbar-alert-snackbar-root'
|
|
2307
|
-
}
|
|
2308
|
-
}, React.createElement(Alert, {
|
|
2309
|
-
severity: type,
|
|
2310
|
-
onClose: onClose,
|
|
2311
|
-
variant: variant || 'filled',
|
|
2312
|
-
classes: {
|
|
2313
|
-
icon: 'snackbar-alert-icon',
|
|
2314
|
-
root: 'snackbar-alert-alert-root',
|
|
2315
|
-
action: 'snackbar-alert-action',
|
|
2316
|
-
message: 'snackbar-alert-message',
|
|
2317
|
-
filled: 'snackbar-alert-filled'
|
|
2318
|
-
}
|
|
2319
|
-
}, message)));
|
|
2320
|
-
};
|
|
2663
|
+
if (element.name === 'confirmEmail') {
|
|
2664
|
+
var isSameEmail = function isSameEmail(confirmEmail) {
|
|
2665
|
+
return values.email !== confirmEmail ? 'Please confirm your email address correctly' : null;
|
|
2666
|
+
};
|
|
2321
2667
|
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
width: DATE_SIZE,
|
|
2332
|
-
margin: 0
|
|
2333
|
-
},
|
|
2334
|
-
'& .PrivatePickersSlideTransition-root': {
|
|
2335
|
-
minHeight: DATE_SIZE * 6
|
|
2336
|
-
},
|
|
2337
|
-
'& .PrivatePickersSlideTransition-root [role="row"]': {
|
|
2338
|
-
margin: 0
|
|
2339
|
-
},
|
|
2340
|
-
'& .MuiPickersDay-dayWithMargin': {
|
|
2341
|
-
margin: 0
|
|
2342
|
-
},
|
|
2343
|
-
'& .MuiPickersDay-root': {
|
|
2344
|
-
width: DATE_SIZE,
|
|
2345
|
-
height: DATE_SIZE
|
|
2668
|
+
validationFunctions.push(isSameEmail);
|
|
2669
|
+
}
|
|
2670
|
+
|
|
2671
|
+
if (element.name === 'confirmPassword') {
|
|
2672
|
+
var isSame = function isSame(confirmPassword) {
|
|
2673
|
+
return values.password !== confirmPassword ? 'Password confirmation does not match' : null;
|
|
2674
|
+
};
|
|
2675
|
+
|
|
2676
|
+
validationFunctions.push(isSame);
|
|
2346
2677
|
}
|
|
2678
|
+
|
|
2679
|
+
return combineValidators.apply(void 0, validationFunctions);
|
|
2347
2680
|
};
|
|
2348
|
-
var
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
defaultProps: {
|
|
2352
|
-
sx: compactStyles
|
|
2353
|
-
}
|
|
2354
|
-
}
|
|
2681
|
+
var assingUniqueIds = function assingUniqueIds(data) {
|
|
2682
|
+
if (_get(data[0], 'uniqueId')) {
|
|
2683
|
+
return data;
|
|
2355
2684
|
}
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
}, React.createElement(DatePicker, {
|
|
2369
|
-
value: field.value || '',
|
|
2370
|
-
onChange: function onChange(value) {
|
|
2371
|
-
return form.setFieldValue(field.name, value);
|
|
2372
|
-
},
|
|
2373
|
-
PopperProps: {
|
|
2374
|
-
placement: 'bottom-start'
|
|
2375
|
-
},
|
|
2376
|
-
showDaysOutsideCurrentMonth: true,
|
|
2377
|
-
disableFuture: true,
|
|
2378
|
-
inputFormat: "DD/MM/YYYY",
|
|
2379
|
-
mask: "__/__/____",
|
|
2380
|
-
renderInput: function renderInput(params) {
|
|
2381
|
-
return React.createElement(CustomField, Object.assign({}, params, {
|
|
2382
|
-
inputProps: _extends({}, params.inputProps, {
|
|
2383
|
-
placeholder: 'dd/mm/yyyy'
|
|
2384
|
-
}),
|
|
2385
|
-
theme: theme,
|
|
2386
|
-
field: field,
|
|
2387
|
-
form: form,
|
|
2388
|
-
label: label,
|
|
2389
|
-
type: "tel"
|
|
2390
|
-
}));
|
|
2391
|
-
}
|
|
2392
|
-
})));
|
|
2685
|
+
|
|
2686
|
+
return _map(data, function (item) {
|
|
2687
|
+
_forEach(item, function (itemValue, key) {
|
|
2688
|
+
if (_isArray(itemValue)) {
|
|
2689
|
+
item[key] = assingUniqueIds(itemValue);
|
|
2690
|
+
}
|
|
2691
|
+
});
|
|
2692
|
+
|
|
2693
|
+
return _extends({}, item, {
|
|
2694
|
+
uniqueId: nanoid()
|
|
2695
|
+
});
|
|
2696
|
+
});
|
|
2393
2697
|
};
|
|
2394
2698
|
|
|
2395
2699
|
var LogicRunner = function LogicRunner(_ref) {
|
|
@@ -2399,7 +2703,8 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
2399
2703
|
setValues = _ref.setValues,
|
|
2400
2704
|
setUserValues = _ref.setUserValues,
|
|
2401
2705
|
onGetStatesSuccess = _ref.onGetStatesSuccess,
|
|
2402
|
-
onGetStatesError = _ref.onGetStatesError
|
|
2706
|
+
onGetStatesError = _ref.onGetStatesError,
|
|
2707
|
+
shouldFetchCountries = _ref.shouldFetchCountries;
|
|
2403
2708
|
var prevCountry = useRef(values.country);
|
|
2404
2709
|
useEffect(function () {
|
|
2405
2710
|
var fetchStates = /*#__PURE__*/function () {
|
|
@@ -2454,7 +2759,7 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
2454
2759
|
};
|
|
2455
2760
|
}();
|
|
2456
2761
|
|
|
2457
|
-
fetchStates();
|
|
2762
|
+
shouldFetchCountries && fetchStates();
|
|
2458
2763
|
}, [values.country, setStates, setFieldValue]);
|
|
2459
2764
|
var userDataEncoded = typeof window !== 'undefined' ? window.localStorage.getItem('user_data') : '';
|
|
2460
2765
|
useEffect(function () {
|
|
@@ -2465,8 +2770,8 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
2465
2770
|
try {
|
|
2466
2771
|
var parsedData = JSON.parse(userDataEncoded);
|
|
2467
2772
|
var mappedValues = {
|
|
2468
|
-
firstName: (parsedData == null ? void 0 : parsedData.first_name) || '',
|
|
2469
|
-
lastName: (parsedData == null ? void 0 : parsedData.last_name) || '',
|
|
2773
|
+
firstName: (parsedData == null ? void 0 : parsedData.first_name) || (parsedData == null ? void 0 : parsedData.firstName) || '',
|
|
2774
|
+
lastName: (parsedData == null ? void 0 : parsedData.last_name) || (parsedData == null ? void 0 : parsedData.lastName) || '',
|
|
2470
2775
|
email: (parsedData == null ? void 0 : parsedData.email) || '',
|
|
2471
2776
|
phone: (parsedData == null ? void 0 : parsedData.phone) || '',
|
|
2472
2777
|
confirmEmail: (parsedData == null ? void 0 : parsedData.email) || '',
|
|
@@ -2474,15 +2779,15 @@ var LogicRunner = function LogicRunner(_ref) {
|
|
|
2474
2779
|
street_address: (parsedData == null ? void 0 : parsedData.street_address) || '',
|
|
2475
2780
|
country: (parsedData == null ? void 0 : parsedData.country) || '1',
|
|
2476
2781
|
zip: (parsedData == null ? void 0 : parsedData.zip) || '',
|
|
2477
|
-
brand_opt_in: (parsedData == null ? void 0 : parsedData.brand_opt_in) ||
|
|
2782
|
+
brand_opt_in: (parsedData == null ? void 0 : parsedData.brand_opt_in) || false,
|
|
2478
2783
|
city: (parsedData == null ? void 0 : parsedData.city) || '',
|
|
2479
2784
|
confirmPassword: '',
|
|
2480
2785
|
password: '',
|
|
2481
|
-
'holderFirstName-0': (parsedData == null ? void 0 : parsedData.first_name) || '',
|
|
2482
|
-
'holderLastName-0': (parsedData == null ? void 0 : parsedData.last_name) || '',
|
|
2786
|
+
'holderFirstName-0': (parsedData == null ? void 0 : parsedData.first_name) || (parsedData == null ? void 0 : parsedData.firstName) || '',
|
|
2787
|
+
'holderLastName-0': (parsedData == null ? void 0 : parsedData.last_name) || (parsedData == null ? void 0 : parsedData.lastName) || '',
|
|
2483
2788
|
'holderEmail-0': (parsedData == null ? void 0 : parsedData.email) || ''
|
|
2484
2789
|
};
|
|
2485
|
-
setValues(mappedValues);
|
|
2790
|
+
setValues(_extends({}, values, mappedValues));
|
|
2486
2791
|
setUserValues(mappedValues);
|
|
2487
2792
|
} catch (e) {}
|
|
2488
2793
|
}
|
|
@@ -2555,10 +2860,21 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2555
2860
|
skipPage = _ref3$skipPage === void 0 ? false : _ref3$skipPage,
|
|
2556
2861
|
_ref3$canSkipHolderNa = _ref3.canSkipHolderNames,
|
|
2557
2862
|
canSkipHolderNames = _ref3$canSkipHolderNa === void 0 ? false : _ref3$canSkipHolderNa,
|
|
2863
|
+
_ref3$onForgotPasswor = _ref3.onForgotPasswordSuccess,
|
|
2864
|
+
onForgotPasswordSuccess = _ref3$onForgotPasswor === void 0 ? function () {} : _ref3$onForgotPasswor,
|
|
2865
|
+
_ref3$onForgotPasswor2 = _ref3.onForgotPasswordError,
|
|
2866
|
+
onForgotPasswordError = _ref3$onForgotPasswor2 === void 0 ? function () {} : _ref3$onForgotPasswor2,
|
|
2867
|
+
_ref3$shouldFetchCoun = _ref3.shouldFetchCountries,
|
|
2868
|
+
shouldFetchCountries = _ref3$shouldFetchCoun === void 0 ? true : _ref3$shouldFetchCoun,
|
|
2558
2869
|
_ref3$onCountdownFini = _ref3.onCountdownFinish,
|
|
2559
2870
|
onCountdownFinish = _ref3$onCountdownFini === void 0 ? function () {} : _ref3$onCountdownFini,
|
|
2560
2871
|
_ref3$enableTimer = _ref3.enableTimer,
|
|
2561
|
-
enableTimer = _ref3$enableTimer === void 0 ? false : _ref3$enableTimer
|
|
2872
|
+
enableTimer = _ref3$enableTimer === void 0 ? false : _ref3$enableTimer,
|
|
2873
|
+
logo = _ref3.logo,
|
|
2874
|
+
_ref3$showForgotPassw = _ref3.showForgotPasswordButton,
|
|
2875
|
+
showForgotPasswordButton = _ref3$showForgotPassw === void 0 ? false : _ref3$showForgotPassw,
|
|
2876
|
+
_ref3$showSignUpButto = _ref3.showSignUpButton,
|
|
2877
|
+
showSignUpButton = _ref3$showSignUpButto === void 0 ? false : _ref3$showSignUpButto;
|
|
2562
2878
|
|
|
2563
2879
|
var themeMui = createTheme(themeOptions);
|
|
2564
2880
|
var isWindowDefined = typeof window !== 'undefined';
|
|
@@ -2569,7 +2885,9 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2569
2885
|
dataWithUniqueIds = _useState[0],
|
|
2570
2886
|
setDataWithUniqueIds = _useState[1];
|
|
2571
2887
|
|
|
2572
|
-
var
|
|
2888
|
+
var xtfCookie = getCookieByName('X-TF-ECOMMERCE');
|
|
2889
|
+
|
|
2890
|
+
var _useState2 = useState(!!(pIsLoggedIn || xtfCookie)),
|
|
2573
2891
|
isLoggedIn = _useState2[0],
|
|
2574
2892
|
setIsLoggedIn = _useState2[1];
|
|
2575
2893
|
|
|
@@ -2598,14 +2916,18 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2598
2916
|
setUserExpired = _useState8[1];
|
|
2599
2917
|
|
|
2600
2918
|
var _useState9 = useState(false),
|
|
2601
|
-
|
|
2602
|
-
|
|
2919
|
+
showModalSignup = _useState9[0],
|
|
2920
|
+
setShowModalSignup = _useState9[1];
|
|
2921
|
+
|
|
2922
|
+
var _useState10 = useState(false),
|
|
2923
|
+
showModalForgotPassword = _useState10[0],
|
|
2924
|
+
setShowModalForgotPassword = _useState10[1];
|
|
2603
2925
|
|
|
2604
|
-
var
|
|
2605
|
-
ticketsQuantity =
|
|
2606
|
-
setTicketsQuantity =
|
|
2926
|
+
var _useState11 = useState([]),
|
|
2927
|
+
ticketsQuantity = _useState11[0],
|
|
2928
|
+
setTicketsQuantity = _useState11[1];
|
|
2607
2929
|
|
|
2608
|
-
var
|
|
2930
|
+
var _useState12 = useState({
|
|
2609
2931
|
firstName: '',
|
|
2610
2932
|
lastName: '',
|
|
2611
2933
|
email: '',
|
|
@@ -2620,16 +2942,16 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2620
2942
|
state: '',
|
|
2621
2943
|
zip: ''
|
|
2622
2944
|
}),
|
|
2623
|
-
userValues =
|
|
2624
|
-
setUserValues =
|
|
2945
|
+
userValues = _useState12[0],
|
|
2946
|
+
setUserValues = _useState12[1];
|
|
2625
2947
|
|
|
2626
|
-
var
|
|
2627
|
-
loading =
|
|
2628
|
-
setLoading =
|
|
2948
|
+
var _useState13 = useState(true),
|
|
2949
|
+
loading = _useState13[0],
|
|
2950
|
+
setLoading = _useState13[1];
|
|
2629
2951
|
|
|
2630
|
-
var
|
|
2631
|
-
error =
|
|
2632
|
-
setError =
|
|
2952
|
+
var _useState14 = useState(null),
|
|
2953
|
+
error = _useState14[0],
|
|
2954
|
+
setError = _useState14[1];
|
|
2633
2955
|
|
|
2634
2956
|
var emailLogged = _get(userData, 'email', '') || _get(userValues, 'email', '');
|
|
2635
2957
|
|
|
@@ -2679,10 +3001,10 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2679
3001
|
};
|
|
2680
3002
|
|
|
2681
3003
|
useEffect(function () {
|
|
2682
|
-
if (
|
|
2683
|
-
setIsLoggedIn(
|
|
3004
|
+
if (pIsLoggedIn !== isLoggedIn || xtfCookie) {
|
|
3005
|
+
setIsLoggedIn(!!(pIsLoggedIn || xtfCookie));
|
|
2684
3006
|
}
|
|
2685
|
-
}, [pIsLoggedIn, isLoggedIn,
|
|
3007
|
+
}, [pIsLoggedIn, isLoggedIn, xtfCookie]); //just once
|
|
2686
3008
|
|
|
2687
3009
|
useEffect(function () {
|
|
2688
3010
|
// fetch countries data
|
|
@@ -2731,7 +3053,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2731
3053
|
};
|
|
2732
3054
|
}();
|
|
2733
3055
|
|
|
2734
|
-
fetchCountries();
|
|
3056
|
+
shouldFetchCountries && fetchCountries();
|
|
2735
3057
|
fetchCart();
|
|
2736
3058
|
}, []); // fetch cart data
|
|
2737
3059
|
|
|
@@ -2791,7 +3113,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2791
3113
|
case 0:
|
|
2792
3114
|
_context4.prev = 0;
|
|
2793
3115
|
|
|
2794
|
-
if (!(isWindowDefined && token)) {
|
|
3116
|
+
if (!(isWindowDefined && token || isLoggedIn)) {
|
|
2795
3117
|
_context4.next = 10;
|
|
2796
3118
|
break;
|
|
2797
3119
|
}
|
|
@@ -2802,7 +3124,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2802
3124
|
case 4:
|
|
2803
3125
|
userDataResponse = _context4.sent;
|
|
2804
3126
|
profileSpecifiedData = _get(userDataResponse, 'data.data');
|
|
2805
|
-
profileDataObj = setLoggedUserData(profileSpecifiedData);
|
|
3127
|
+
profileDataObj = setLoggedUserData$1(profileSpecifiedData);
|
|
2806
3128
|
setUserValues(_extends({}, profileDataObj, {
|
|
2807
3129
|
firstName: profileDataObj.first_name,
|
|
2808
3130
|
lastName: profileDataObj.last_name
|
|
@@ -2838,7 +3160,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2838
3160
|
|
|
2839
3161
|
useEffect(function () {
|
|
2840
3162
|
fetchUserData(access_token);
|
|
2841
|
-
}, [access_token]);
|
|
3163
|
+
}, [access_token, isLoggedIn]);
|
|
2842
3164
|
useEffect(function () {
|
|
2843
3165
|
var collectPaymentData = /*#__PURE__*/function () {
|
|
2844
3166
|
var _ref7 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5() {
|
|
@@ -2894,16 +3216,20 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2894
3216
|
collectPaymentData();
|
|
2895
3217
|
}, [skipPage, ticketsQuantity]);
|
|
2896
3218
|
|
|
2897
|
-
var collectCheckoutBody = function collectCheckoutBody(values) {
|
|
3219
|
+
var collectCheckoutBody = function collectCheckoutBody(values, profileData) {
|
|
2898
3220
|
var checkoutBody = {}; // Auto collect ticket holders name when it was skipped optionally
|
|
2899
3221
|
|
|
2900
3222
|
if (showDOB && !showTicketHolders && canSkipHolderNames) {
|
|
2901
|
-
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketsQuantity.length, values, true
|
|
2902
|
-
} else {
|
|
2903
|
-
checkoutBody = createCheckoutDataBody(ticketsQuantity.length, values, {
|
|
3223
|
+
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketsQuantity.length, values, true, {
|
|
2904
3224
|
emailLogged: emailLogged,
|
|
2905
3225
|
firstNameLogged: firstNameLogged,
|
|
2906
3226
|
lastNameLogged: lastNameLogged
|
|
3227
|
+
});
|
|
3228
|
+
} else {
|
|
3229
|
+
checkoutBody = createCheckoutDataBody(ticketsQuantity.length, values, {
|
|
3230
|
+
emailLogged: emailLogged || profileData.email,
|
|
3231
|
+
firstNameLogged: firstNameLogged || profileData.first_name || profileData.firstName,
|
|
3232
|
+
lastNameLogged: lastNameLogged || profileData.last_name || profileData.lastName
|
|
2907
3233
|
}, showDOB);
|
|
2908
3234
|
}
|
|
2909
3235
|
|
|
@@ -2912,28 +3238,27 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2912
3238
|
|
|
2913
3239
|
var removeReferralKey = function removeReferralKey() {
|
|
2914
3240
|
localStorage.removeItem('referral_key');
|
|
2915
|
-
};
|
|
2916
|
-
|
|
3241
|
+
};
|
|
2917
3242
|
|
|
2918
3243
|
if (loading || enableTimer && !expirationTime && typeof window !== 'undefined') {
|
|
2919
3244
|
if (expirationTime === 0) {
|
|
2920
3245
|
// Redirect to homepage (countdown finished and browser reloaded case)
|
|
2921
3246
|
window.location.href = '/';
|
|
2922
3247
|
}
|
|
2923
|
-
|
|
2924
|
-
return React.createElement(Backdrop, {
|
|
2925
|
-
sx: {
|
|
2926
|
-
color: '#fff'
|
|
2927
|
-
},
|
|
2928
|
-
open: true
|
|
2929
|
-
}, React.createElement(CircularProgress$1, {
|
|
2930
|
-
color: "inherit"
|
|
2931
|
-
}));
|
|
2932
3248
|
}
|
|
2933
3249
|
|
|
2934
3250
|
return React.createElement(ThemeProvider, {
|
|
2935
3251
|
theme: themeMui
|
|
2936
|
-
},
|
|
3252
|
+
}, loading && React.createElement(Backdrop, {
|
|
3253
|
+
sx: {
|
|
3254
|
+
color: '#fff',
|
|
3255
|
+
backgroundColor: '#000000bd',
|
|
3256
|
+
zIndex: 1205
|
|
3257
|
+
},
|
|
3258
|
+
open: true
|
|
3259
|
+
}, React.createElement(CircularProgress$1, {
|
|
3260
|
+
color: "inherit"
|
|
3261
|
+
})), !!expirationTime && enableTimer && React.createElement(TimerWidget$1, {
|
|
2937
3262
|
expires_at: expirationTime,
|
|
2938
3263
|
onCountdownFinish: onCountdownFinish
|
|
2939
3264
|
}), React.createElement(Formik, {
|
|
@@ -2943,10 +3268,10 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2943
3268
|
brand_opt_in: optedInFieldValue,
|
|
2944
3269
|
ttf_opt_in: ttfOptIn
|
|
2945
3270
|
}), userValues),
|
|
2946
|
-
enableReinitialize:
|
|
3271
|
+
enableReinitialize: false,
|
|
2947
3272
|
onSubmit: function () {
|
|
2948
3273
|
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(values, formikHelpers) {
|
|
2949
|
-
var updatedUserData, _profileSpecifiedData, _profileDataObj, _checkoutBody, _res, checkoutBodyForRegistration, bodyFormData,
|
|
3274
|
+
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;
|
|
2950
3275
|
|
|
2951
3276
|
return runtime_1.wrap(function _callee6$(_context6) {
|
|
2952
3277
|
while (1) {
|
|
@@ -2970,14 +3295,14 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2970
3295
|
case 5:
|
|
2971
3296
|
updatedUserData = _context6.sent;
|
|
2972
3297
|
_profileSpecifiedData = _get(updatedUserData, 'data.data');
|
|
2973
|
-
_profileDataObj = setLoggedUserData(_profileSpecifiedData);
|
|
3298
|
+
_profileDataObj = setLoggedUserData$1(_profileSpecifiedData);
|
|
2974
3299
|
|
|
2975
3300
|
if (isWindowDefined) {
|
|
2976
3301
|
window.localStorage.setItem('user_data', JSON.stringify(_profileDataObj));
|
|
2977
3302
|
}
|
|
2978
3303
|
|
|
2979
3304
|
case 9:
|
|
2980
|
-
_checkoutBody = collectCheckoutBody(values);
|
|
3305
|
+
_checkoutBody = collectCheckoutBody(values, userData);
|
|
2981
3306
|
_context6.next = 12;
|
|
2982
3307
|
return postOnCheckout(_checkoutBody, access_token);
|
|
2983
3308
|
|
|
@@ -2994,27 +3319,30 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2994
3319
|
lastNameLogged: lastNameLogged
|
|
2995
3320
|
}, showDOB);
|
|
2996
3321
|
bodyFormData = createRegisterFormData(values, checkoutBodyForRegistration);
|
|
2997
|
-
|
|
2998
|
-
|
|
3322
|
+
_context6.prev = 18;
|
|
3323
|
+
setLoading(true);
|
|
2999
3324
|
_context6.next = 22;
|
|
3000
3325
|
return register(bodyFormData);
|
|
3001
3326
|
|
|
3002
3327
|
case 22:
|
|
3003
3328
|
resRegister = _context6.sent;
|
|
3004
|
-
|
|
3329
|
+
_xtfCookie = _get(resRegister, 'headers.x-tf-ecommerce');
|
|
3330
|
+
accessToken = _get(resRegister, 'data.data.attributes.access_token');
|
|
3005
3331
|
refreshToken = _get(resRegister, 'data.data.attributes.refresh_token');
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3332
|
+
userProfile = _get(resRegister, 'data.data.attributes.user_profile');
|
|
3333
|
+
onRegisterSuccess({
|
|
3334
|
+
xtfCookie: _xtfCookie,
|
|
3335
|
+
accessToken: accessToken,
|
|
3336
|
+
refreshToken: refreshToken,
|
|
3337
|
+
userProfile: userProfile
|
|
3338
|
+
});
|
|
3339
|
+
_context6.next = 35;
|
|
3013
3340
|
break;
|
|
3014
3341
|
|
|
3015
3342
|
case 30:
|
|
3016
3343
|
_context6.prev = 30;
|
|
3017
|
-
_context6.t0 = _context6["catch"](
|
|
3344
|
+
_context6.t0 = _context6["catch"](18);
|
|
3345
|
+
setLoading(false);
|
|
3018
3346
|
|
|
3019
3347
|
if (axios.isAxiosError(_context6.t0)) {
|
|
3020
3348
|
_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;
|
|
@@ -3043,33 +3371,34 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3043
3371
|
|
|
3044
3372
|
return _context6.abrupt("return");
|
|
3045
3373
|
|
|
3046
|
-
case
|
|
3047
|
-
_context6.next =
|
|
3048
|
-
return getProfileData(
|
|
3374
|
+
case 35:
|
|
3375
|
+
_context6.next = 37;
|
|
3376
|
+
return getProfileData();
|
|
3049
3377
|
|
|
3050
|
-
case
|
|
3378
|
+
case 37:
|
|
3051
3379
|
profileData = _context6.sent;
|
|
3052
3380
|
profileSpecifiedData = _get(profileData, 'data.data');
|
|
3053
|
-
profileDataObj = setLoggedUserData(profileSpecifiedData);
|
|
3381
|
+
profileDataObj = setLoggedUserData$1(profileSpecifiedData);
|
|
3054
3382
|
|
|
3055
3383
|
if (isWindowDefined) {
|
|
3056
3384
|
window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
|
|
3057
3385
|
}
|
|
3058
3386
|
|
|
3059
|
-
checkoutBody = collectCheckoutBody(values);
|
|
3060
|
-
_context6.next =
|
|
3061
|
-
return postOnCheckout(checkoutBody
|
|
3387
|
+
checkoutBody = collectCheckoutBody(values, profileDataObj);
|
|
3388
|
+
_context6.next = 44;
|
|
3389
|
+
return postOnCheckout(checkoutBody);
|
|
3062
3390
|
|
|
3063
|
-
case
|
|
3391
|
+
case 44:
|
|
3064
3392
|
res = _context6.sent;
|
|
3065
3393
|
removeReferralKey();
|
|
3066
3394
|
handleSubmit(values, formikHelpers, eventId, res);
|
|
3067
|
-
_context6.next =
|
|
3395
|
+
_context6.next = 53;
|
|
3068
3396
|
break;
|
|
3069
3397
|
|
|
3070
|
-
case
|
|
3071
|
-
_context6.prev =
|
|
3398
|
+
case 49:
|
|
3399
|
+
_context6.prev = 49;
|
|
3072
3400
|
_context6.t1 = _context6["catch"](0);
|
|
3401
|
+
setLoading(false);
|
|
3073
3402
|
|
|
3074
3403
|
if (axios.isAxiosError(_context6.t1)) {
|
|
3075
3404
|
if (((_e$response2 = _context6.t1.response) == null ? void 0 : _e$response2.data.error) === 'invalid_token') {
|
|
@@ -3088,12 +3417,17 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3088
3417
|
onSubmitError(_context6.t1);
|
|
3089
3418
|
}
|
|
3090
3419
|
|
|
3091
|
-
case
|
|
3420
|
+
case 53:
|
|
3421
|
+
_context6.prev = 53;
|
|
3422
|
+
setLoading(false);
|
|
3423
|
+
return _context6.finish(53);
|
|
3424
|
+
|
|
3425
|
+
case 56:
|
|
3092
3426
|
case "end":
|
|
3093
3427
|
return _context6.stop();
|
|
3094
3428
|
}
|
|
3095
3429
|
}
|
|
3096
|
-
}, _callee6, null, [[0,
|
|
3430
|
+
}, _callee6, null, [[0, 49, 53, 56], [18, 30]]);
|
|
3097
3431
|
}));
|
|
3098
3432
|
|
|
3099
3433
|
function onSubmit(_x2, _x3) {
|
|
@@ -3112,7 +3446,8 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3112
3446
|
setValues: props.setValues,
|
|
3113
3447
|
setUserValues: setUserValues,
|
|
3114
3448
|
onGetStatesSuccess: onGetStatesSuccess,
|
|
3115
|
-
onGetStatesError: onGetStatesError
|
|
3449
|
+
onGetStatesError: onGetStatesError,
|
|
3450
|
+
shouldFetchCountries: shouldFetchCountries
|
|
3116
3451
|
}), React.createElement("div", {
|
|
3117
3452
|
className: "billing-info-container " + theme
|
|
3118
3453
|
}, React.createElement(SnackbarAlert, {
|
|
@@ -3125,8 +3460,10 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3125
3460
|
}
|
|
3126
3461
|
}), !isLoggedIn && React.createElement("div", {
|
|
3127
3462
|
className: "account-actions-block"
|
|
3128
|
-
}, React.createElement("div",
|
|
3129
|
-
className: "
|
|
3463
|
+
}, React.createElement("div", {
|
|
3464
|
+
className: "action-item"
|
|
3465
|
+
}, React.createElement("div", null, accountInfoTitle), React.createElement("div", null, "Login & skip ahead:")), React.createElement("div", {
|
|
3466
|
+
className: "action-item login-block"
|
|
3130
3467
|
}, React.createElement("button", {
|
|
3131
3468
|
className: "login-register-button",
|
|
3132
3469
|
type: "button",
|
|
@@ -3184,7 +3521,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3184
3521
|
validate: getValidateFunctions(element, states, props.values),
|
|
3185
3522
|
setFieldValue: props.setFieldValue,
|
|
3186
3523
|
onBlur: props.handleBlur,
|
|
3187
|
-
component: element.type === 'checkbox' ? CheckboxField : element.type === 'select' ? SelectField : element.type === 'phone' ?
|
|
3524
|
+
component: element.type === 'checkbox' ? CheckboxField : element.type === 'select' ? SelectField : element.type === 'phone' ? PhoneNumberField : element.type === 'date' ? DatePickerField : CustomField,
|
|
3188
3525
|
selectOptions: element.name === 'country' ? countries : element.name === 'state' ? states : [],
|
|
3189
3526
|
theme: theme
|
|
3190
3527
|
})));
|
|
@@ -3192,7 +3529,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3192
3529
|
}));
|
|
3193
3530
|
}), !_isEmpty(ticketHoldersFields.fields) && React.createElement("div", {
|
|
3194
3531
|
className: "ticket-holders-fields"
|
|
3195
|
-
}, React.createElement("
|
|
3532
|
+
}, React.createElement("h2", null, ticketHoldersFields.label), _map(ticketsQuantity, function (_item, index) {
|
|
3196
3533
|
return React.createElement("div", {
|
|
3197
3534
|
key: _item
|
|
3198
3535
|
}, React.createElement("h5", null, "Ticket ", index + 1), _map(ticketHoldersFields.fields, function (group) {
|
|
@@ -3211,7 +3548,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3211
3548
|
label: element.label,
|
|
3212
3549
|
type: element.type,
|
|
3213
3550
|
required: true,
|
|
3214
|
-
component: element.type === 'checkbox' ? CheckboxField : CustomField,
|
|
3551
|
+
component: element.type === 'checkbox' ? CheckboxField : element.type === 'phone' ? PhoneNumberField : CustomField,
|
|
3215
3552
|
validate: combineValidators(element.required ? requiredValidator : function () {}, element.onValidate ? element.onValidate : function () {})
|
|
3216
3553
|
}));
|
|
3217
3554
|
})));
|
|
@@ -3227,6 +3564,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3227
3564
|
size: 26
|
|
3228
3565
|
}) : buttonName))));
|
|
3229
3566
|
}), showModalLogin && React.createElement(LoginModal, {
|
|
3567
|
+
logo: logo,
|
|
3230
3568
|
onClose: function onClose() {
|
|
3231
3569
|
setShowModalLogin(false);
|
|
3232
3570
|
},
|
|
@@ -3244,20 +3582,37 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3244
3582
|
|
|
3245
3583
|
_onGetProfileDataSuccess(data);
|
|
3246
3584
|
},
|
|
3247
|
-
onGetProfileDataError: onGetProfileDataError
|
|
3248
|
-
|
|
3585
|
+
onGetProfileDataError: onGetProfileDataError,
|
|
3586
|
+
showSignUpButton: showSignUpButton,
|
|
3587
|
+
showForgotPasswordButton: showForgotPasswordButton,
|
|
3588
|
+
onForgotPassword: function onForgotPassword() {
|
|
3589
|
+
setShowModalLogin(false);
|
|
3590
|
+
setShowModalForgotPassword(true);
|
|
3591
|
+
},
|
|
3592
|
+
onSignup: function onSignup() {
|
|
3593
|
+
setShowModalLogin(false);
|
|
3594
|
+
setShowModalSignup(true);
|
|
3595
|
+
}
|
|
3596
|
+
}), showModalSignup && React.createElement(SignupModal, {
|
|
3249
3597
|
onClose: function onClose() {
|
|
3250
|
-
|
|
3598
|
+
setShowModalSignup(false);
|
|
3251
3599
|
},
|
|
3252
|
-
|
|
3253
|
-
|
|
3600
|
+
onLogin: function onLogin() {
|
|
3601
|
+
setShowModalSignup(false);
|
|
3602
|
+
setShowModalLogin(true);
|
|
3254
3603
|
},
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3604
|
+
onRegisterSuccess: onRegisterSuccess,
|
|
3605
|
+
onRegisterError: onRegisterError
|
|
3606
|
+
}), showModalForgotPassword && React.createElement(ForgotPasswordModal, {
|
|
3607
|
+
onClose: function onClose() {
|
|
3608
|
+
setShowModalForgotPassword(false);
|
|
3609
|
+
},
|
|
3610
|
+
onLogin: function onLogin() {
|
|
3611
|
+
setShowModalForgotPassword(false);
|
|
3612
|
+
setShowModalLogin(true);
|
|
3259
3613
|
},
|
|
3260
|
-
|
|
3614
|
+
onForgotPasswordSuccess: onForgotPasswordSuccess,
|
|
3615
|
+
onForgotPasswordError: onForgotPasswordError
|
|
3261
3616
|
}));
|
|
3262
3617
|
};
|
|
3263
3618
|
|
|
@@ -3476,7 +3831,7 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
3476
3831
|
onSubmit: handleSubmit
|
|
3477
3832
|
}, React.createElement("div", {
|
|
3478
3833
|
className: "card_form_inner"
|
|
3479
|
-
}, React.createElement("
|
|
3834
|
+
}, React.createElement("div", {
|
|
3480
3835
|
className: "card_number_element"
|
|
3481
3836
|
}, React.createElement("span", {
|
|
3482
3837
|
className: "card_label_text"
|
|
@@ -3486,19 +3841,21 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
3486
3841
|
onChange: _identity,
|
|
3487
3842
|
onBlur: _identity,
|
|
3488
3843
|
onFocus: _identity
|
|
3489
|
-
})), React.createElement("
|
|
3844
|
+
})), React.createElement("div", {
|
|
3845
|
+
className: "elements"
|
|
3846
|
+
}, React.createElement("div", {
|
|
3490
3847
|
className: "expiration_element"
|
|
3491
3848
|
}, React.createElement("span", {
|
|
3492
3849
|
className: "card_label_text"
|
|
3493
3850
|
}, "Expiration date"), React.createElement(CardExpiryElement, {
|
|
3494
3851
|
options: _extends({}, options, stripeCardOptions)
|
|
3495
|
-
})), React.createElement("
|
|
3852
|
+
})), React.createElement("div", {
|
|
3496
3853
|
className: "cvc_element"
|
|
3497
3854
|
}, React.createElement("span", {
|
|
3498
3855
|
className: "card_label_text"
|
|
3499
3856
|
}, "CVC"), React.createElement(CardCvcElement, {
|
|
3500
3857
|
options: _extends({}, options, stripeCardOptions)
|
|
3501
|
-
})), !disableZipSection && React.createElement("
|
|
3858
|
+
}))), !disableZipSection && React.createElement("div", {
|
|
3502
3859
|
className: "zip_element"
|
|
3503
3860
|
}, React.createElement("p", {
|
|
3504
3861
|
className: "card_label_text"
|
|
@@ -3588,7 +3945,9 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3588
3945
|
_ref$onCountdownFinis = _ref.onCountdownFinish,
|
|
3589
3946
|
onCountdownFinish = _ref$onCountdownFinis === void 0 ? function () {} : _ref$onCountdownFinis,
|
|
3590
3947
|
_ref$enableTimer = _ref.enableTimer,
|
|
3591
|
-
enableTimer = _ref$enableTimer === void 0 ? false : _ref$enableTimer
|
|
3948
|
+
enableTimer = _ref$enableTimer === void 0 ? false : _ref$enableTimer,
|
|
3949
|
+
_ref$enablePaymentPla = _ref.enablePaymentPlan,
|
|
3950
|
+
enablePaymentPlan = _ref$enablePaymentPla === void 0 ? false : _ref$enablePaymentPla;
|
|
3592
3951
|
|
|
3593
3952
|
var _useState = useState(initialReviewValues),
|
|
3594
3953
|
reviewData = _useState[0],
|
|
@@ -3603,16 +3962,20 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3603
3962
|
setError = _useState3[1];
|
|
3604
3963
|
|
|
3605
3964
|
var _useState4 = useState(false),
|
|
3606
|
-
|
|
3607
|
-
|
|
3965
|
+
showPaymentPlanSection = _useState4[0],
|
|
3966
|
+
setShowPaymentPlanSection = _useState4[1];
|
|
3967
|
+
|
|
3968
|
+
var _useState5 = useState(false),
|
|
3969
|
+
paymentIsLoading = _useState5[0],
|
|
3970
|
+
setPaymentIsLoading = _useState5[1];
|
|
3608
3971
|
|
|
3609
|
-
var
|
|
3610
|
-
paymentDataIsLoading =
|
|
3611
|
-
setPaymentDataIsLoading =
|
|
3972
|
+
var _useState6 = useState(true),
|
|
3973
|
+
paymentDataIsLoading = _useState6[0],
|
|
3974
|
+
setPaymentDataIsLoading = _useState6[1];
|
|
3612
3975
|
|
|
3613
|
-
var
|
|
3614
|
-
conditions =
|
|
3615
|
-
setConditions =
|
|
3976
|
+
var _useState7 = useState([]),
|
|
3977
|
+
conditions = _useState7[0],
|
|
3978
|
+
setConditions = _useState7[1];
|
|
3616
3979
|
|
|
3617
3980
|
var showFormTitle = Boolean(formTitle);
|
|
3618
3981
|
var showErrorText = Boolean(errorText);
|
|
@@ -3739,7 +4102,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3739
4102
|
case 3:
|
|
3740
4103
|
order_hash = reviewData.order_details.order_hash;
|
|
3741
4104
|
|
|
3742
|
-
if (!(total ===
|
|
4105
|
+
if (!(total === '0.00')) {
|
|
3743
4106
|
_context3.next = 10;
|
|
3744
4107
|
break;
|
|
3745
4108
|
}
|
|
@@ -3824,11 +4187,33 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3824
4187
|
}, label), React.createElement("div", {
|
|
3825
4188
|
className: className + " order_info_text"
|
|
3826
4189
|
}, normalizer(orderData[id], orderData.currency)));
|
|
3827
|
-
})),
|
|
4190
|
+
})), enablePaymentPlan && React.createElement("div", {
|
|
4191
|
+
className: "payment_toggle"
|
|
4192
|
+
}, React.createElement("label", {
|
|
4193
|
+
htmlFor: "togBtn",
|
|
4194
|
+
className: "switch"
|
|
4195
|
+
}, React.createElement("input", {
|
|
4196
|
+
type: "checkbox",
|
|
4197
|
+
id: "togBtn",
|
|
4198
|
+
disabled: true,
|
|
4199
|
+
onChange: function onChange() {
|
|
4200
|
+
return setShowPaymentPlanSection(!showPaymentPlanSection);
|
|
4201
|
+
}
|
|
4202
|
+
}), React.createElement("div", {
|
|
4203
|
+
className: "slider round"
|
|
4204
|
+
}), React.createElement("span", {
|
|
4205
|
+
className: "tog_text"
|
|
4206
|
+
}, "Click to checkout using Payment Plan"))), showPaymentPlanSection && React.createElement("div", {
|
|
4207
|
+
className: "payment_plan"
|
|
4208
|
+
}, React.createElement("h2", null, "PAYMENT PLAN"), React.createElement("div", {
|
|
4209
|
+
className: "plan_block"
|
|
4210
|
+
}, React.createElement("h3", null, "Mbrand Payment Plan Terms"), React.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.createElement("p", null, "This includes a non-refundable admin fee of $3.00 per payment."), React.createElement("p", {
|
|
4211
|
+
className: "payment_note"
|
|
4212
|
+
}, "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.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.createElement("p", null, "Your payment will proceed with the card ending in **** 4242."))), total !== '0.00' ? React.createElement("div", {
|
|
3828
4213
|
className: "payment_info"
|
|
3829
4214
|
}, React.createElement("div", {
|
|
3830
4215
|
className: "payment_info_label"
|
|
3831
|
-
}, "
|
|
4216
|
+
}, "ORDER CONFIRMATION"), showErrorText && React.createElement("p", {
|
|
3832
4217
|
className: "payment_info__error"
|
|
3833
4218
|
}, errorText), React.createElement("div", null, React.createElement(Elements, {
|
|
3834
4219
|
stripe: getStripePromise(reviewData),
|
|
@@ -3858,7 +4243,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3858
4243
|
}
|
|
3859
4244
|
}, paymentIsLoading ? React.createElement(CircularProgress, {
|
|
3860
4245
|
size: 26
|
|
3861
|
-
}) :
|
|
4246
|
+
}) : 'Complete Registration')))));
|
|
3862
4247
|
};
|
|
3863
4248
|
|
|
3864
4249
|
var config = {
|
|
@@ -4022,7 +4407,9 @@ var SocialButtons = function SocialButtons(_ref2) {
|
|
|
4022
4407
|
};
|
|
4023
4408
|
|
|
4024
4409
|
var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
4025
|
-
var
|
|
4410
|
+
var _ref$hasCopyIcon = _ref.hasCopyIcon,
|
|
4411
|
+
hasCopyIcon = _ref$hasCopyIcon === void 0 ? true : _ref$hasCopyIcon,
|
|
4412
|
+
isReferralEnabled = _ref.isReferralEnabled,
|
|
4026
4413
|
showDefaultShareButtons = _ref.showDefaultShareButtons,
|
|
4027
4414
|
_ref$messengerAppId = _ref.messengerAppId,
|
|
4028
4415
|
messengerAppId = _ref$messengerAppId === void 0 ? '' : _ref$messengerAppId,
|
|
@@ -4121,7 +4508,16 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
4121
4508
|
|
|
4122
4509
|
return React.createElement("div", {
|
|
4123
4510
|
className: "confirmation-page"
|
|
4124
|
-
}, data && React.createElement(React.Fragment, null, React.createElement("
|
|
4511
|
+
}, data && React.createElement(React.Fragment, null, React.createElement("div", {
|
|
4512
|
+
className: 'header-container'
|
|
4513
|
+
}, React.createElement("div", {
|
|
4514
|
+
className: 'header-product-image'
|
|
4515
|
+
}, React.createElement("img", {
|
|
4516
|
+
className: 'product-image',
|
|
4517
|
+
src: data.product_image
|
|
4518
|
+
})), React.createElement("div", {
|
|
4519
|
+
className: "header-product-text"
|
|
4520
|
+
}, React.createElement("p", {
|
|
4125
4521
|
className: "title"
|
|
4126
4522
|
}, "Your Tickets are Confirmed!"), React.createElement("div", {
|
|
4127
4523
|
className: "share-message-section"
|
|
@@ -4129,7 +4525,7 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
4129
4525
|
className: "main"
|
|
4130
4526
|
}, "Your tickets have been emailed to you"), React.createElement("span", {
|
|
4131
4527
|
className: "helper"
|
|
4132
|
-
}, "Please bring them with you to the event")), data.disable_referral === false && isReferralEnabled && React.createElement(React.Fragment, null, React.createElement("div", {
|
|
4528
|
+
}, "Please bring them with you to the event")))), data.disable_referral === false && isReferralEnabled && React.createElement(React.Fragment, null, React.createElement("div", {
|
|
4133
4529
|
className: "referral_text_image_section"
|
|
4134
4530
|
}, React.createElement("div", {
|
|
4135
4531
|
className: "referral_text_section"
|
|
@@ -4146,6 +4542,7 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
4146
4542
|
}, " Invite friends "), "and we'll refund up to", React.createElement("span", {
|
|
4147
4543
|
className: "strong-text"
|
|
4148
4544
|
}, " 100% "), "of your ticket money, if they buy tickets as well!")), React.createElement("img", {
|
|
4545
|
+
className: 'body-product-image',
|
|
4149
4546
|
src: data.product_image,
|
|
4150
4547
|
alt: "No Data"
|
|
4151
4548
|
})), React.createElement("div", {
|
|
@@ -4175,10 +4572,12 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
4175
4572
|
navigator.clipboard.writeText(_get(inputRef, 'current.value'));
|
|
4176
4573
|
onLinkCopied();
|
|
4177
4574
|
}
|
|
4178
|
-
}, React.createElement("img", {
|
|
4575
|
+
}, hasCopyIcon ? React.createElement("img", {
|
|
4179
4576
|
src: "https://img.icons8.com/office/50/000000/copy.png",
|
|
4180
4577
|
alt: "copy"
|
|
4181
|
-
})
|
|
4578
|
+
}) : React.createElement("span", {
|
|
4579
|
+
className: 'copy-icon'
|
|
4580
|
+
}, "Copy")))), (showDefaultShareButtons || !!shareButtons.length) && React.createElement(SocialButtons, {
|
|
4182
4581
|
showDefaultShareButtons: showDefaultShareButtons,
|
|
4183
4582
|
name: data.product_name,
|
|
4184
4583
|
appId: messengerAppId,
|
|
@@ -4202,141 +4601,93 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
4202
4601
|
}))))));
|
|
4203
4602
|
};
|
|
4204
4603
|
|
|
4205
|
-
var
|
|
4206
|
-
|
|
4207
|
-
maxCount = 10;
|
|
4208
|
-
}
|
|
4209
|
-
|
|
4210
|
-
if (minCount === void 0) {
|
|
4211
|
-
minCount = 1;
|
|
4212
|
-
}
|
|
4213
|
-
|
|
4214
|
-
if (multiplier === void 0) {
|
|
4215
|
-
multiplier = 1;
|
|
4216
|
-
}
|
|
4217
|
-
|
|
4218
|
-
var options = [{
|
|
4219
|
-
label: 0,
|
|
4220
|
-
value: 0
|
|
4221
|
-
}];
|
|
4222
|
-
|
|
4223
|
-
for (var i = minCount; i <= Math.min(50, maxCount); i += multiplier) {
|
|
4224
|
-
options.push({
|
|
4225
|
-
label: i,
|
|
4226
|
-
value: i
|
|
4227
|
-
});
|
|
4228
|
-
}
|
|
4229
|
-
|
|
4230
|
-
return options;
|
|
4604
|
+
var isTimeExpired = function isTimeExpired(startDate, timezone) {
|
|
4605
|
+
return !moment(startDate).isAfter(moment.tz(moment(), timezone).format('YYYY-MM-DD HH:mm:ss'));
|
|
4231
4606
|
};
|
|
4232
4607
|
|
|
4233
|
-
|
|
4234
|
-
var
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
}, React.createElement(Select, {
|
|
4249
|
-
sx: {
|
|
4250
|
-
borderRadius: 0
|
|
4251
|
-
},
|
|
4252
|
-
value: selectedTickets[ticketTier.id] ? selectedTickets[ticketTier.id] : 0,
|
|
4253
|
-
onChange: handleTicketSelect,
|
|
4254
|
-
displayEmpty: true,
|
|
4255
|
-
inputProps: {
|
|
4256
|
-
'aria-label': 'Without label'
|
|
4257
|
-
},
|
|
4258
|
-
MenuProps: {
|
|
4259
|
-
PaperProps: {
|
|
4260
|
-
sx: {
|
|
4261
|
-
maxHeight: 150
|
|
4262
|
-
},
|
|
4263
|
-
className: 'get-tickets-paper'
|
|
4264
|
-
}
|
|
4265
|
-
}
|
|
4266
|
-
}, options.map(function (option, index) {
|
|
4267
|
-
return React.createElement(MenuItem, {
|
|
4268
|
-
key: index,
|
|
4269
|
-
value: option.value
|
|
4270
|
-
}, option.value);
|
|
4271
|
-
})))));
|
|
4272
|
-
var returnValue = '';
|
|
4608
|
+
function Countdown(_ref) {
|
|
4609
|
+
var startDate = _ref.startDate,
|
|
4610
|
+
_ref$timezone = _ref.timezone,
|
|
4611
|
+
timezone = _ref$timezone === void 0 ? moment.tz.guess() : _ref$timezone,
|
|
4612
|
+
_ref$title = _ref.title,
|
|
4613
|
+
title = _ref$title === void 0 ? '' : _ref$title,
|
|
4614
|
+
_ref$message = _ref.message,
|
|
4615
|
+
message = _ref$message === void 0 ? '' : _ref$message,
|
|
4616
|
+
_ref$showMessage = _ref.showMessage,
|
|
4617
|
+
showMessage = _ref$showMessage === void 0 ? false : _ref$showMessage,
|
|
4618
|
+
_ref$disableLeadingZe = _ref.disableLeadingZero,
|
|
4619
|
+
disableLeadingZero = _ref$disableLeadingZe === void 0 ? false : _ref$disableLeadingZe,
|
|
4620
|
+
_ref$callback = _ref.callback,
|
|
4621
|
+
callback = _ref$callback === void 0 ? function () {} : _ref$callback,
|
|
4622
|
+
isLoggedIn = _ref.isLoggedIn;
|
|
4273
4623
|
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4624
|
+
var _useState = useState(''),
|
|
4625
|
+
duration = _useState[0],
|
|
4626
|
+
setDuration = _useState[1];
|
|
4277
4627
|
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4628
|
+
var _useState2 = useState(false),
|
|
4629
|
+
timeExpired = _useState2[0],
|
|
4630
|
+
setTimeExpired = _useState2[1];
|
|
4281
4631
|
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
}
|
|
4632
|
+
useEffect(function () {
|
|
4633
|
+
setTimeExpired(isTimeExpired(startDate, timezone));
|
|
4634
|
+
}, []);
|
|
4635
|
+
useEffect(function () {
|
|
4636
|
+
var timer;
|
|
4285
4637
|
|
|
4286
|
-
|
|
4287
|
-
|
|
4638
|
+
if (!timeExpired) {
|
|
4639
|
+
timer = setInterval(function () {
|
|
4640
|
+
if (isTimeExpired(startDate, timezone)) {
|
|
4641
|
+
clearInterval(timer);
|
|
4642
|
+
setTimeExpired(true);
|
|
4643
|
+
callback();
|
|
4644
|
+
return;
|
|
4645
|
+
}
|
|
4288
4646
|
|
|
4289
|
-
var
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4647
|
+
var currentDate = moment.tz(moment(), timezone).format('YYYY-MM-DD HH:mm:ss');
|
|
4648
|
+
var diffTime = moment(startDate).diff(currentDate);
|
|
4649
|
+
var duration = moment.duration(diffTime);
|
|
4650
|
+
var dateArr = {
|
|
4651
|
+
year: duration.years(),
|
|
4652
|
+
month: duration.months(),
|
|
4653
|
+
day: duration.days(),
|
|
4654
|
+
hour: duration.hours(),
|
|
4655
|
+
minute: duration.minutes(),
|
|
4656
|
+
second: duration.seconds()
|
|
4657
|
+
};
|
|
4658
|
+
var timeLeft = '';
|
|
4300
4659
|
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
|
|
4304
|
-
};
|
|
4660
|
+
for (var date in dateArr) {
|
|
4661
|
+
var unit = dateArr[date] === 1 ? date : date + 's';
|
|
4662
|
+
var val = dateArr[date];
|
|
4305
4663
|
|
|
4306
|
-
|
|
4664
|
+
if (!disableLeadingZero && String(dateArr[date]).length === 1) {
|
|
4665
|
+
val = '0' + dateArr[date];
|
|
4666
|
+
}
|
|
4307
4667
|
|
|
4308
|
-
|
|
4309
|
-
|
|
4668
|
+
if (timeLeft) {
|
|
4669
|
+
timeLeft += ", " + val + " " + unit;
|
|
4670
|
+
} else if (dateArr[date]) {
|
|
4671
|
+
timeLeft += val + " " + unit;
|
|
4672
|
+
}
|
|
4673
|
+
}
|
|
4674
|
+
|
|
4675
|
+
setDuration(timeLeft);
|
|
4676
|
+
}, 1000);
|
|
4310
4677
|
}
|
|
4311
4678
|
|
|
4312
|
-
|
|
4313
|
-
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4322
|
-
|
|
4323
|
-
|
|
4324
|
-
className: "old-price"
|
|
4325
|
-
}, "$ ", (+ticket.oldPrice).toFixed(2)), React.createElement("p", null, ticketPrice), !isSoldOut && !ticketIsFree && React.createElement("p", {
|
|
4326
|
-
className: "fees"
|
|
4327
|
-
}, ticket.feeIncluded ? '(incl. Fees)' : '(excl. Fees)')), React.createElement("div", {
|
|
4328
|
-
className: "event-detail__tier-state",
|
|
4329
|
-
style: {
|
|
4330
|
-
minWidth: 55
|
|
4331
|
-
}
|
|
4332
|
-
}, React.createElement(TicketRow, {
|
|
4333
|
-
ticketTier: ticket,
|
|
4334
|
-
prevTicketTier: arr[i - 1],
|
|
4335
|
-
selectedTickets: selectedTickets,
|
|
4336
|
-
handleTicketSelect: ticketSelect
|
|
4337
|
-
}))));
|
|
4338
|
-
}));
|
|
4339
|
-
};
|
|
4679
|
+
return function () {
|
|
4680
|
+
clearInterval(timer);
|
|
4681
|
+
};
|
|
4682
|
+
}, [timeExpired]);
|
|
4683
|
+
return React.createElement(React.Fragment, null, !timeExpired && duration && React.createElement("div", {
|
|
4684
|
+
className: "countdown " + (!isLoggedIn ? 'countdown-on-bottom' : '')
|
|
4685
|
+
}, React.createElement("div", null, React.createElement("p", {
|
|
4686
|
+
className: 'title'
|
|
4687
|
+
}, title), React.createElement("p", null, duration)), showMessage && React.createElement("p", {
|
|
4688
|
+
className: 'message'
|
|
4689
|
+
}, message)));
|
|
4690
|
+
}
|
|
4340
4691
|
|
|
4341
4692
|
var generateQuantity = function generateQuantity(n) {
|
|
4342
4693
|
var quantityList = [];
|
|
@@ -4502,13 +4853,46 @@ var WaitingList = function WaitingList(_ref) {
|
|
|
4502
4853
|
}) : 'ADD TO WAITING LIST')))));
|
|
4503
4854
|
};
|
|
4504
4855
|
|
|
4856
|
+
var AccessCodeSection = function AccessCodeSection(_ref) {
|
|
4857
|
+
var code = _ref.code,
|
|
4858
|
+
setCode = _ref.setCode,
|
|
4859
|
+
updateTickets = _ref.updateTickets;
|
|
4860
|
+
var isAccessCodeHasValue = !!code.trim();
|
|
4861
|
+
return React.createElement("div", {
|
|
4862
|
+
className: "access-code-block"
|
|
4863
|
+
}, React.createElement("div", {
|
|
4864
|
+
className: "access-code-block"
|
|
4865
|
+
}, React.createElement("p", {
|
|
4866
|
+
className: "access-code-text"
|
|
4867
|
+
}, "Access code required")), React.createElement("input", {
|
|
4868
|
+
className: "access-code-input",
|
|
4869
|
+
placeholder: "",
|
|
4870
|
+
onChange: function onChange(e) {
|
|
4871
|
+
setCode(e.target.value);
|
|
4872
|
+
},
|
|
4873
|
+
onKeyPress: function onKeyPress(event) {
|
|
4874
|
+
if (event.key === 'Enter' && isAccessCodeHasValue) {
|
|
4875
|
+
updateTickets(true);
|
|
4876
|
+
}
|
|
4877
|
+
}
|
|
4878
|
+
}), React.createElement(Button$1, {
|
|
4879
|
+
className: "access-submit-button",
|
|
4880
|
+
onClick: function onClick() {
|
|
4881
|
+
if (isAccessCodeHasValue) {
|
|
4882
|
+
updateTickets(true);
|
|
4883
|
+
}
|
|
4884
|
+
}
|
|
4885
|
+
}, "ENTER"));
|
|
4886
|
+
};
|
|
4887
|
+
|
|
4505
4888
|
var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
4506
4889
|
var code = _ref.code,
|
|
4507
4890
|
codeIsApplied = _ref.codeIsApplied,
|
|
4508
4891
|
showPromoInput = _ref.showPromoInput,
|
|
4509
4892
|
setCode = _ref.setCode,
|
|
4510
4893
|
setShowPromoInput = _ref.setShowPromoInput,
|
|
4511
|
-
updateTickets = _ref.updateTickets
|
|
4894
|
+
updateTickets = _ref.updateTickets,
|
|
4895
|
+
setCodeIsApplied = _ref.setCodeIsApplied;
|
|
4512
4896
|
var isPromoCodeHasValue = !!code.trim();
|
|
4513
4897
|
|
|
4514
4898
|
var renderInputField = function renderInputField() {
|
|
@@ -4527,7 +4911,7 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
4527
4911
|
onKeyPress: function onKeyPress(event) {
|
|
4528
4912
|
if (event.key === 'Enter' && isPromoCodeHasValue) {
|
|
4529
4913
|
setShowPromoInput(false);
|
|
4530
|
-
updateTickets(true);
|
|
4914
|
+
updateTickets(true, 'promo');
|
|
4531
4915
|
}
|
|
4532
4916
|
}
|
|
4533
4917
|
}), React.createElement(Button$1, {
|
|
@@ -4535,7 +4919,7 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
4535
4919
|
onClick: function onClick() {
|
|
4536
4920
|
if (isPromoCodeHasValue) {
|
|
4537
4921
|
setShowPromoInput(false);
|
|
4538
|
-
updateTickets(true);
|
|
4922
|
+
updateTickets(true, 'promo');
|
|
4539
4923
|
}
|
|
4540
4924
|
}
|
|
4541
4925
|
}, "APPLY"));
|
|
@@ -4554,129 +4938,12 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
4554
4938
|
className: "promo-code-button",
|
|
4555
4939
|
placeholder: "Promo Codes",
|
|
4556
4940
|
onClick: function onClick() {
|
|
4941
|
+
setCodeIsApplied(false);
|
|
4557
4942
|
setShowPromoInput(true);
|
|
4558
4943
|
}
|
|
4559
4944
|
}, "Got a promo code? Click here"), showPromoInput && renderInputField());
|
|
4560
4945
|
};
|
|
4561
4946
|
|
|
4562
|
-
var AccessCodeSection = function AccessCodeSection(_ref) {
|
|
4563
|
-
var code = _ref.code,
|
|
4564
|
-
setCode = _ref.setCode,
|
|
4565
|
-
updateTickets = _ref.updateTickets;
|
|
4566
|
-
var isAccessCodeHasValue = !!code.trim();
|
|
4567
|
-
return React.createElement("div", {
|
|
4568
|
-
className: "access-code-block"
|
|
4569
|
-
}, React.createElement("div", {
|
|
4570
|
-
className: "access-code-block"
|
|
4571
|
-
}, React.createElement("p", {
|
|
4572
|
-
className: "access-code-text"
|
|
4573
|
-
}, "Access code required")), React.createElement("input", {
|
|
4574
|
-
className: "access-code-input",
|
|
4575
|
-
placeholder: "",
|
|
4576
|
-
onChange: function onChange(e) {
|
|
4577
|
-
setCode(e.target.value);
|
|
4578
|
-
},
|
|
4579
|
-
onKeyPress: function onKeyPress(event) {
|
|
4580
|
-
if (event.key === 'Enter' && isAccessCodeHasValue) {
|
|
4581
|
-
updateTickets(true);
|
|
4582
|
-
}
|
|
4583
|
-
}
|
|
4584
|
-
}), React.createElement(Button$1, {
|
|
4585
|
-
className: "access-submit-button",
|
|
4586
|
-
onClick: function onClick() {
|
|
4587
|
-
if (isAccessCodeHasValue) {
|
|
4588
|
-
updateTickets(true);
|
|
4589
|
-
}
|
|
4590
|
-
}
|
|
4591
|
-
}, "ENTER"));
|
|
4592
|
-
};
|
|
4593
|
-
|
|
4594
|
-
var isTimeExpired = function isTimeExpired(startDate, timezone) {
|
|
4595
|
-
return !moment(startDate).isAfter(moment.tz(moment(), timezone).format('YYYY-MM-DD HH:mm:ss'));
|
|
4596
|
-
};
|
|
4597
|
-
|
|
4598
|
-
function Countdown(_ref) {
|
|
4599
|
-
var startDate = _ref.startDate,
|
|
4600
|
-
_ref$timezone = _ref.timezone,
|
|
4601
|
-
timezone = _ref$timezone === void 0 ? moment.tz.guess() : _ref$timezone,
|
|
4602
|
-
_ref$title = _ref.title,
|
|
4603
|
-
title = _ref$title === void 0 ? '' : _ref$title,
|
|
4604
|
-
_ref$message = _ref.message,
|
|
4605
|
-
message = _ref$message === void 0 ? '' : _ref$message,
|
|
4606
|
-
_ref$disableLeadingZe = _ref.disableLeadingZero,
|
|
4607
|
-
disableLeadingZero = _ref$disableLeadingZe === void 0 ? false : _ref$disableLeadingZe,
|
|
4608
|
-
_ref$callback = _ref.callback,
|
|
4609
|
-
callback = _ref$callback === void 0 ? function () {} : _ref$callback,
|
|
4610
|
-
isLoggedIn = _ref.isLoggedIn;
|
|
4611
|
-
|
|
4612
|
-
var _useState = useState(''),
|
|
4613
|
-
duration = _useState[0],
|
|
4614
|
-
setDuration = _useState[1];
|
|
4615
|
-
|
|
4616
|
-
var _useState2 = useState(false),
|
|
4617
|
-
timeExpired = _useState2[0],
|
|
4618
|
-
setTimeExpired = _useState2[1];
|
|
4619
|
-
|
|
4620
|
-
useEffect(function () {
|
|
4621
|
-
setTimeExpired(isTimeExpired(startDate, timezone));
|
|
4622
|
-
}, []);
|
|
4623
|
-
useEffect(function () {
|
|
4624
|
-
var timer;
|
|
4625
|
-
|
|
4626
|
-
if (!timeExpired) {
|
|
4627
|
-
timer = setInterval(function () {
|
|
4628
|
-
if (isTimeExpired(startDate, timezone)) {
|
|
4629
|
-
clearInterval(timer);
|
|
4630
|
-
setTimeExpired(true);
|
|
4631
|
-
callback();
|
|
4632
|
-
return;
|
|
4633
|
-
}
|
|
4634
|
-
|
|
4635
|
-
var currentDate = moment.tz(moment(), timezone).format('YYYY-MM-DD HH:mm:ss');
|
|
4636
|
-
var diffTime = moment(startDate).diff(currentDate);
|
|
4637
|
-
var duration = moment.duration(diffTime);
|
|
4638
|
-
var dateArr = {
|
|
4639
|
-
year: duration.years(),
|
|
4640
|
-
month: duration.months(),
|
|
4641
|
-
day: duration.days(),
|
|
4642
|
-
hour: duration.hours(),
|
|
4643
|
-
minute: duration.minutes(),
|
|
4644
|
-
second: duration.seconds()
|
|
4645
|
-
};
|
|
4646
|
-
var timeLeft = '';
|
|
4647
|
-
|
|
4648
|
-
for (var date in dateArr) {
|
|
4649
|
-
var unit = dateArr[date] === 1 ? date : date + 's';
|
|
4650
|
-
var val = dateArr[date];
|
|
4651
|
-
|
|
4652
|
-
if (!disableLeadingZero && String(dateArr[date]).length === 1) {
|
|
4653
|
-
val = '0' + dateArr[date];
|
|
4654
|
-
}
|
|
4655
|
-
|
|
4656
|
-
if (timeLeft) {
|
|
4657
|
-
timeLeft += ", " + val + " " + unit;
|
|
4658
|
-
} else if (dateArr[date]) {
|
|
4659
|
-
timeLeft += val + " " + unit;
|
|
4660
|
-
}
|
|
4661
|
-
}
|
|
4662
|
-
|
|
4663
|
-
setDuration(timeLeft);
|
|
4664
|
-
}, 1000);
|
|
4665
|
-
}
|
|
4666
|
-
|
|
4667
|
-
return function () {
|
|
4668
|
-
clearInterval(timer);
|
|
4669
|
-
};
|
|
4670
|
-
}, [timeExpired]);
|
|
4671
|
-
return React.createElement(React.Fragment, null, !timeExpired && duration && React.createElement("div", {
|
|
4672
|
-
className: "countdown " + (!isLoggedIn ? 'countdown-on-bottom' : '')
|
|
4673
|
-
}, React.createElement("div", null, React.createElement("p", {
|
|
4674
|
-
className: 'title'
|
|
4675
|
-
}, title), React.createElement("p", null, duration)), React.createElement("p", {
|
|
4676
|
-
className: 'message'
|
|
4677
|
-
}, message)));
|
|
4678
|
-
}
|
|
4679
|
-
|
|
4680
4947
|
var ReferralLogic = function ReferralLogic(props) {
|
|
4681
4948
|
var eventId = props.eventId;
|
|
4682
4949
|
var isWindowDefined = typeof window !== 'undefined';
|
|
@@ -4714,9 +4981,144 @@ var ReferralLogic = function ReferralLogic(props) {
|
|
|
4714
4981
|
}, _callee, null, [[0, 6]]);
|
|
4715
4982
|
}))();
|
|
4716
4983
|
}
|
|
4717
|
-
}
|
|
4718
|
-
}, []);
|
|
4719
|
-
return null;
|
|
4984
|
+
}
|
|
4985
|
+
}, []);
|
|
4986
|
+
return null;
|
|
4987
|
+
};
|
|
4988
|
+
|
|
4989
|
+
var getTicketSelectOptions = function getTicketSelectOptions(maxCount, minCount, multiplier) {
|
|
4990
|
+
if (maxCount === void 0) {
|
|
4991
|
+
maxCount = 10;
|
|
4992
|
+
}
|
|
4993
|
+
|
|
4994
|
+
if (minCount === void 0) {
|
|
4995
|
+
minCount = 1;
|
|
4996
|
+
}
|
|
4997
|
+
|
|
4998
|
+
if (multiplier === void 0) {
|
|
4999
|
+
multiplier = 1;
|
|
5000
|
+
}
|
|
5001
|
+
|
|
5002
|
+
var options = [{
|
|
5003
|
+
label: 0,
|
|
5004
|
+
value: 0
|
|
5005
|
+
}];
|
|
5006
|
+
|
|
5007
|
+
for (var i = minCount; i <= Math.min(50, maxCount); i += multiplier) {
|
|
5008
|
+
options.push({
|
|
5009
|
+
label: i,
|
|
5010
|
+
value: i
|
|
5011
|
+
});
|
|
5012
|
+
}
|
|
5013
|
+
|
|
5014
|
+
return options;
|
|
5015
|
+
};
|
|
5016
|
+
|
|
5017
|
+
var TicketRow = function TicketRow(_ref) {
|
|
5018
|
+
var ticketTier = _ref.ticketTier,
|
|
5019
|
+
prevTicketTier = _ref.prevTicketTier,
|
|
5020
|
+
selectedTickets = _ref.selectedTickets,
|
|
5021
|
+
handleTicketSelect = _ref.handleTicketSelect;
|
|
5022
|
+
var soldOutMessage = ticketTier.soldOutMessage ? ("" + ticketTier.soldOutMessage).toUpperCase() : 'SOLD OUT';
|
|
5023
|
+
var isSalesClosed = !ticketTier.salesStarted || ticketTier.salesEnded;
|
|
5024
|
+
var options = getTicketSelectOptions(ticketTier.maxQuantity, ticketTier.minQuantity, ticketTier.multiplier);
|
|
5025
|
+
var ticketsClosedMessage = !ticketTier.salesStarted ? 'Sales not started' : 'Sales Ended';
|
|
5026
|
+
var onSaleContent = React.createElement("div", {
|
|
5027
|
+
className: "get-tickets"
|
|
5028
|
+
}, React.createElement(Box$1, {
|
|
5029
|
+
className: "get-tickets__selectbox"
|
|
5030
|
+
}, React.createElement(FormControl$1, {
|
|
5031
|
+
fullWidth: true
|
|
5032
|
+
}, React.createElement(Select, {
|
|
5033
|
+
sx: {
|
|
5034
|
+
borderRadius: 0
|
|
5035
|
+
},
|
|
5036
|
+
value: selectedTickets[ticketTier.id] ? selectedTickets[ticketTier.id] : 0,
|
|
5037
|
+
onChange: handleTicketSelect,
|
|
5038
|
+
displayEmpty: true,
|
|
5039
|
+
inputProps: {
|
|
5040
|
+
'aria-label': 'Without label'
|
|
5041
|
+
},
|
|
5042
|
+
MenuProps: {
|
|
5043
|
+
PaperProps: {
|
|
5044
|
+
sx: {
|
|
5045
|
+
maxHeight: 150
|
|
5046
|
+
},
|
|
5047
|
+
className: 'get-tickets-paper'
|
|
5048
|
+
}
|
|
5049
|
+
}
|
|
5050
|
+
}, options.map(function (option, index) {
|
|
5051
|
+
return React.createElement(MenuItem, {
|
|
5052
|
+
key: index,
|
|
5053
|
+
value: option.value
|
|
5054
|
+
}, option.value);
|
|
5055
|
+
})))));
|
|
5056
|
+
var returnValue = ''; // ticketTier.soldOut === false --> means that ticket is in the stock
|
|
5057
|
+
|
|
5058
|
+
var isSoldOut = ticketTier.sold_out || !ticketTier.displayTicket || ticketTier.soldOut || ticketTier.soldOut === false;
|
|
5059
|
+
|
|
5060
|
+
if (isSoldOut) {
|
|
5061
|
+
returnValue = soldOutMessage;
|
|
5062
|
+
} else if (isSalesClosed) {
|
|
5063
|
+
returnValue = ticketsClosedMessage;
|
|
5064
|
+
} else if (ticketTier.displayTicket && ticketTier.maxQuantity) {
|
|
5065
|
+
returnValue = onSaleContent;
|
|
5066
|
+
} else if (_get(prevTicketTier, 'in_stock')) {
|
|
5067
|
+
returnValue = 'SOON';
|
|
5068
|
+
}
|
|
5069
|
+
|
|
5070
|
+
return React.createElement(React.Fragment, null, returnValue, " ");
|
|
5071
|
+
};
|
|
5072
|
+
|
|
5073
|
+
var TicketsSection = function TicketsSection(_ref) {
|
|
5074
|
+
var ticketsList = _ref.ticketsList,
|
|
5075
|
+
selectedTickets = _ref.selectedTickets,
|
|
5076
|
+
handleTicketSelect = _ref.handleTicketSelect,
|
|
5077
|
+
sortBySoldOut = _ref.sortBySoldOut,
|
|
5078
|
+
ticketsHeaderComponent = _ref.ticketsHeaderComponent,
|
|
5079
|
+
hideTicketsHeader = _ref.hideTicketsHeader;
|
|
5080
|
+
var sortedTicketsList = sortBySoldOut ? _sortBy(_sortBy(ticketsList, 'sortOrder'), 'soldOut') : _sortBy(ticketsList, 'sortOrder');
|
|
5081
|
+
return React.createElement(React.Fragment, null, !hideTicketsHeader && ticketsHeaderComponent, sortedTicketsList.map(function (ticket, i, arr) {
|
|
5082
|
+
var isSoldOut = ticket.sold_out || !ticket.displayTicket || ticket.soldOut;
|
|
5083
|
+
|
|
5084
|
+
var ticketSelect = function ticketSelect(event) {
|
|
5085
|
+
var value = event.target.value;
|
|
5086
|
+
handleTicketSelect(ticket.id, value);
|
|
5087
|
+
};
|
|
5088
|
+
|
|
5089
|
+
var ticketIsDiscounted = false;
|
|
5090
|
+
|
|
5091
|
+
if (ticket.oldPrice && !isSoldOut && ticket.oldPrice !== ticket.price) {
|
|
5092
|
+
ticketIsDiscounted = true;
|
|
5093
|
+
}
|
|
5094
|
+
|
|
5095
|
+
var ticketIsFree = +ticket.price === 0;
|
|
5096
|
+
var ticketPrice = isSoldOut ? 'SOLD OUT' : ticketIsFree ? 'FREE' : "$ " + (+ticket.price).toFixed(2);
|
|
5097
|
+
return React.createElement("div", {
|
|
5098
|
+
key: ticket.id || ticket.name,
|
|
5099
|
+
className: "event-detail__tier " + (isSoldOut ? 'disabled' : '')
|
|
5100
|
+
}, React.createElement("div", {
|
|
5101
|
+
className: "event-detail__tier-name"
|
|
5102
|
+
}, ticket.displayName || ticket.name), React.createElement("div", {
|
|
5103
|
+
className: "event-tickets-container"
|
|
5104
|
+
}, React.createElement("div", {
|
|
5105
|
+
className: "event-detail__tier-price"
|
|
5106
|
+
}, ticketIsDiscounted && React.createElement("p", {
|
|
5107
|
+
className: "old-price"
|
|
5108
|
+
}, "$ ", (+ticket.oldPrice).toFixed(2)), React.createElement("p", null, ticketPrice), !isSoldOut && !ticketIsFree && React.createElement("p", {
|
|
5109
|
+
className: "fees"
|
|
5110
|
+
}, ticket.feeIncluded ? '(incl. Fees)' : '(excl. Fees)')), React.createElement("div", {
|
|
5111
|
+
className: "event-detail__tier-state",
|
|
5112
|
+
style: {
|
|
5113
|
+
minWidth: 55
|
|
5114
|
+
}
|
|
5115
|
+
}, React.createElement(TicketRow, {
|
|
5116
|
+
ticketTier: ticket,
|
|
5117
|
+
prevTicketTier: arr[i - 1],
|
|
5118
|
+
selectedTickets: selectedTickets,
|
|
5119
|
+
handleTicketSelect: ticketSelect
|
|
5120
|
+
}))));
|
|
5121
|
+
}));
|
|
4720
5122
|
};
|
|
4721
5123
|
|
|
4722
5124
|
var TicketsContainer = function TicketsContainer(_ref) {
|
|
@@ -4732,6 +5134,10 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4732
5134
|
onGetTicketsSuccess = _ref$onGetTicketsSucc === void 0 ? function () {} : _ref$onGetTicketsSucc,
|
|
4733
5135
|
_ref$onGetTicketsErro = _ref.onGetTicketsError,
|
|
4734
5136
|
onGetTicketsError = _ref$onGetTicketsErro === void 0 ? function () {} : _ref$onGetTicketsErro,
|
|
5137
|
+
_ref$onLogoutSuccess = _ref.onLogoutSuccess,
|
|
5138
|
+
onLogoutSuccess = _ref$onLogoutSuccess === void 0 ? function () {} : _ref$onLogoutSuccess,
|
|
5139
|
+
_ref$onLogoutError = _ref.onLogoutError,
|
|
5140
|
+
onLogoutError = _ref$onLogoutError === void 0 ? function () {} : _ref$onLogoutError,
|
|
4735
5141
|
_ref$theme = _ref.theme,
|
|
4736
5142
|
theme = _ref$theme === void 0 ? 'light' : _ref$theme,
|
|
4737
5143
|
_ref$queryPromoCode = _ref.queryPromoCode,
|
|
@@ -4745,6 +5151,8 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4745
5151
|
hideSessionButtons = _ref$hideSessionButto === void 0 ? false : _ref$hideSessionButto,
|
|
4746
5152
|
_ref$hideWaitingList = _ref.hideWaitingList,
|
|
4747
5153
|
hideWaitingList = _ref$hideWaitingList === void 0 ? false : _ref$hideWaitingList,
|
|
5154
|
+
_ref$enableBillingInf = _ref.enableBillingInfoAutoCreate,
|
|
5155
|
+
enableBillingInfoAutoCreate = _ref$enableBillingInf === void 0 ? true : _ref$enableBillingInf,
|
|
4748
5156
|
_ref$isButtonScrollab = _ref.isButtonScrollable,
|
|
4749
5157
|
isButtonScrollable = _ref$isButtonScrollab === void 0 ? false : _ref$isButtonScrollab,
|
|
4750
5158
|
_ref$sortBySoldOut = _ref.sortBySoldOut,
|
|
@@ -4756,15 +5164,18 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4756
5164
|
ActionsSectionComponent = _ref.actionsSectionComponent,
|
|
4757
5165
|
ticketsHeaderComponent = _ref.ticketsHeaderComponent,
|
|
4758
5166
|
_ref$hideTicketsHeade = _ref.hideTicketsHeader,
|
|
4759
|
-
hideTicketsHeader = _ref$hideTicketsHeade === void 0 ? false : _ref$hideTicketsHeade
|
|
5167
|
+
hideTicketsHeader = _ref$hideTicketsHeade === void 0 ? false : _ref$hideTicketsHeade,
|
|
5168
|
+
_ref$enableInfluencer = _ref.enableInfluencersSection,
|
|
5169
|
+
enableInfluencersSection = _ref$enableInfluencer === void 0 ? true : _ref$enableInfluencer;
|
|
4760
5170
|
|
|
4761
5171
|
var _useState = useState({}),
|
|
4762
5172
|
selectedTickets = _useState[0],
|
|
4763
5173
|
setSelectedTickets = _useState[1];
|
|
4764
5174
|
|
|
4765
5175
|
var isWindowDefined = typeof window !== 'undefined';
|
|
5176
|
+
var xtfCookie = getCookieByName('X-TF-ECOMMERCE');
|
|
4766
5177
|
|
|
4767
|
-
var _useState2 = useState(isWindowDefined ? !!window.localStorage.getItem('access_token') : false),
|
|
5178
|
+
var _useState2 = useState((isWindowDefined ? !!window.localStorage.getItem('access_token') : false) || !!xtfCookie),
|
|
4768
5179
|
isLogged = _useState2[0],
|
|
4769
5180
|
setIsLogged = _useState2[1];
|
|
4770
5181
|
|
|
@@ -4835,17 +5246,50 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4835
5246
|
!!eventId && getTicketsApi();
|
|
4836
5247
|
}, [eventId]);
|
|
4837
5248
|
|
|
4838
|
-
var handleLogout = function
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
window.localStorage.removeItem('user_data');
|
|
4842
|
-
setIsLogged(false);
|
|
5249
|
+
var handleLogout = /*#__PURE__*/function () {
|
|
5250
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
5251
|
+
var _event;
|
|
4843
5252
|
|
|
4844
|
-
|
|
5253
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
5254
|
+
while (1) {
|
|
5255
|
+
switch (_context.prev = _context.next) {
|
|
5256
|
+
case 0:
|
|
5257
|
+
_context.prev = 0;
|
|
5258
|
+
_context.next = 3;
|
|
5259
|
+
return logout();
|
|
4845
5260
|
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
5261
|
+
case 3:
|
|
5262
|
+
onLogoutSuccess();
|
|
5263
|
+
|
|
5264
|
+
if (isWindowDefined) {
|
|
5265
|
+
window.localStorage.removeItem('access_token');
|
|
5266
|
+
window.localStorage.removeItem('user_data');
|
|
5267
|
+
setIsLogged(false);
|
|
5268
|
+
_event = new window.CustomEvent('tf-logout');
|
|
5269
|
+
deleteCookieByName('X-TF-ECOMMERCE');
|
|
5270
|
+
window.document.dispatchEvent(_event);
|
|
5271
|
+
}
|
|
5272
|
+
|
|
5273
|
+
_context.next = 10;
|
|
5274
|
+
break;
|
|
5275
|
+
|
|
5276
|
+
case 7:
|
|
5277
|
+
_context.prev = 7;
|
|
5278
|
+
_context.t0 = _context["catch"](0);
|
|
5279
|
+
onLogoutError(_context.t0);
|
|
5280
|
+
|
|
5281
|
+
case 10:
|
|
5282
|
+
case "end":
|
|
5283
|
+
return _context.stop();
|
|
5284
|
+
}
|
|
5285
|
+
}
|
|
5286
|
+
}, _callee, null, [[0, 7]]);
|
|
5287
|
+
}));
|
|
5288
|
+
|
|
5289
|
+
return function handleLogout() {
|
|
5290
|
+
return _ref2.apply(this, arguments);
|
|
5291
|
+
};
|
|
5292
|
+
}();
|
|
4849
5293
|
|
|
4850
5294
|
useEffect(function () {
|
|
4851
5295
|
try {
|
|
@@ -4854,7 +5298,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4854
5298
|
|
|
4855
5299
|
if (userData.country === '') {
|
|
4856
5300
|
handleLogout();
|
|
4857
|
-
window.open(
|
|
5301
|
+
window.open('https://www.ticketfairy.com/account/change_information?need_country=true');
|
|
4858
5302
|
}
|
|
4859
5303
|
}
|
|
4860
5304
|
} catch (e) {}
|
|
@@ -4877,34 +5321,34 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4877
5321
|
}
|
|
4878
5322
|
};
|
|
4879
5323
|
|
|
4880
|
-
function getTicketsApi(_x) {
|
|
5324
|
+
function getTicketsApi(_x, _x2) {
|
|
4881
5325
|
return _getTicketsApi.apply(this, arguments);
|
|
4882
5326
|
}
|
|
4883
5327
|
|
|
4884
5328
|
function _getTicketsApi() {
|
|
4885
|
-
_getTicketsApi = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
5329
|
+
_getTicketsApi = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(isUpdateingCode, type) {
|
|
4886
5330
|
var response, eventResponse, attributes, _event2;
|
|
4887
5331
|
|
|
4888
|
-
return runtime_1.wrap(function
|
|
5332
|
+
return runtime_1.wrap(function _callee3$(_context3) {
|
|
4889
5333
|
while (1) {
|
|
4890
|
-
switch (
|
|
5334
|
+
switch (_context3.prev = _context3.next) {
|
|
4891
5335
|
case 0:
|
|
4892
|
-
|
|
5336
|
+
_context3.prev = 0;
|
|
4893
5337
|
isUpdateingCode ? setCodeIsLoading(true) : setIsLoading(true);
|
|
4894
|
-
|
|
5338
|
+
_context3.next = 4;
|
|
4895
5339
|
return getTickets(eventId, code);
|
|
4896
5340
|
|
|
4897
5341
|
case 4:
|
|
4898
|
-
response =
|
|
4899
|
-
|
|
5342
|
+
response = _context3.sent;
|
|
5343
|
+
_context3.next = 7;
|
|
4900
5344
|
return getEvent(eventId);
|
|
4901
5345
|
|
|
4902
5346
|
case 7:
|
|
4903
|
-
eventResponse =
|
|
5347
|
+
eventResponse = _context3.sent;
|
|
4904
5348
|
|
|
4905
5349
|
if (response.data.success) {
|
|
4906
5350
|
attributes = _get(response, 'data.data.attributes');
|
|
4907
|
-
setCodeIsApplied(attributes.ValidPromoCode);
|
|
5351
|
+
type === 'promo' && setCodeIsApplied(attributes.ValidPromoCode);
|
|
4908
5352
|
setTickets(_get(attributes, 'tickets'));
|
|
4909
5353
|
setShowWaitingList(attributes.showWaitingList);
|
|
4910
5354
|
onGetTicketsSuccess(response.data);
|
|
@@ -4918,42 +5362,42 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4918
5362
|
setEvent(_event2);
|
|
4919
5363
|
}
|
|
4920
5364
|
|
|
4921
|
-
|
|
5365
|
+
_context3.next = 15;
|
|
4922
5366
|
break;
|
|
4923
5367
|
|
|
4924
5368
|
case 12:
|
|
4925
|
-
|
|
4926
|
-
|
|
5369
|
+
_context3.prev = 12;
|
|
5370
|
+
_context3.t0 = _context3["catch"](0);
|
|
4927
5371
|
|
|
4928
|
-
if (axios.isAxiosError(
|
|
4929
|
-
onGetTicketsError(
|
|
5372
|
+
if (axios.isAxiosError(_context3.t0)) {
|
|
5373
|
+
onGetTicketsError(_context3.t0);
|
|
4930
5374
|
}
|
|
4931
5375
|
|
|
4932
5376
|
case 15:
|
|
4933
|
-
|
|
5377
|
+
_context3.prev = 15;
|
|
4934
5378
|
setIsLoading(false);
|
|
4935
5379
|
setCodeIsLoading(false);
|
|
4936
|
-
return
|
|
5380
|
+
return _context3.finish(15);
|
|
4937
5381
|
|
|
4938
5382
|
case 19:
|
|
4939
5383
|
case "end":
|
|
4940
|
-
return
|
|
5384
|
+
return _context3.stop();
|
|
4941
5385
|
}
|
|
4942
5386
|
}
|
|
4943
|
-
},
|
|
5387
|
+
}, _callee3, null, [[0, 12, 15, 19]]);
|
|
4944
5388
|
}));
|
|
4945
5389
|
return _getTicketsApi.apply(this, arguments);
|
|
4946
5390
|
}
|
|
4947
5391
|
|
|
4948
5392
|
var handleTicketSelect = function handleTicketSelect(key, value) {
|
|
4949
5393
|
setSelectedTickets(function (prevState) {
|
|
4950
|
-
var
|
|
5394
|
+
var _ref3;
|
|
4951
5395
|
|
|
4952
5396
|
if (Object.keys(prevState)[0] !== key && !value) {
|
|
4953
5397
|
return prevState;
|
|
4954
5398
|
}
|
|
4955
5399
|
|
|
4956
|
-
return
|
|
5400
|
+
return _ref3 = {}, _ref3[key] = value, _ref3;
|
|
4957
5401
|
});
|
|
4958
5402
|
};
|
|
4959
5403
|
|
|
@@ -4964,14 +5408,14 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4964
5408
|
};
|
|
4965
5409
|
|
|
4966
5410
|
var handleBook = /*#__PURE__*/function () {
|
|
4967
|
-
var
|
|
5411
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2() {
|
|
4968
5412
|
var _product_options, _product_options2, _ticket_types;
|
|
4969
5413
|
|
|
4970
5414
|
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;
|
|
4971
5415
|
|
|
4972
|
-
return runtime_1.wrap(function
|
|
5416
|
+
return runtime_1.wrap(function _callee2$(_context2) {
|
|
4973
5417
|
while (1) {
|
|
4974
|
-
switch (
|
|
5418
|
+
switch (_context2.prev = _context2.next) {
|
|
4975
5419
|
case 0:
|
|
4976
5420
|
setHandleBookIsLoading(true);
|
|
4977
5421
|
ticket = _find(tickets, function (item) {
|
|
@@ -4992,15 +5436,15 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4992
5436
|
}, _ticket_types)
|
|
4993
5437
|
}
|
|
4994
5438
|
};
|
|
4995
|
-
|
|
4996
|
-
|
|
5439
|
+
_context2.prev = 6;
|
|
5440
|
+
_context2.next = 9;
|
|
4997
5441
|
return addToCart(eventId, data);
|
|
4998
5442
|
|
|
4999
5443
|
case 9:
|
|
5000
|
-
result =
|
|
5444
|
+
result = _context2.sent;
|
|
5001
5445
|
|
|
5002
5446
|
if (!(result.status === 200)) {
|
|
5003
|
-
|
|
5447
|
+
_context2.next = 33;
|
|
5004
5448
|
break;
|
|
5005
5449
|
}
|
|
5006
5450
|
|
|
@@ -5012,7 +5456,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5012
5456
|
total = '';
|
|
5013
5457
|
|
|
5014
5458
|
if (!skipBillingPage) {
|
|
5015
|
-
|
|
5459
|
+
_context2.next = 32;
|
|
5016
5460
|
break;
|
|
5017
5461
|
}
|
|
5018
5462
|
|
|
@@ -5021,15 +5465,29 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5021
5465
|
userData = _isWindowDefined && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
5022
5466
|
access_token = _isWindowDefined && window.localStorage.getItem('access_token') ? window.localStorage.getItem('access_token') || '' : '';
|
|
5023
5467
|
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketQuantity, userData);
|
|
5024
|
-
|
|
5468
|
+
|
|
5469
|
+
if (!enableBillingInfoAutoCreate) {
|
|
5470
|
+
_context2.next = 28;
|
|
5471
|
+
break;
|
|
5472
|
+
}
|
|
5473
|
+
|
|
5474
|
+
_context2.next = 25;
|
|
5025
5475
|
return postOnCheckout(checkoutBody, access_token);
|
|
5026
5476
|
|
|
5027
|
-
case
|
|
5028
|
-
|
|
5477
|
+
case 25:
|
|
5478
|
+
_context2.t0 = _context2.sent;
|
|
5479
|
+
_context2.next = 29;
|
|
5480
|
+
break;
|
|
5481
|
+
|
|
5482
|
+
case 28:
|
|
5483
|
+
_context2.t0 = null;
|
|
5484
|
+
|
|
5485
|
+
case 29:
|
|
5486
|
+
checkoutResult = _context2.t0;
|
|
5029
5487
|
hash = _get(checkoutResult, 'data.data.attributes.hash');
|
|
5030
5488
|
total = _get(checkoutResult, 'data.data.attributes.total');
|
|
5031
5489
|
|
|
5032
|
-
case
|
|
5490
|
+
case 32:
|
|
5033
5491
|
onAddToCartSuccess({
|
|
5034
5492
|
skip_billing_page: skipBillingPage,
|
|
5035
5493
|
names_required: nameIsRequired,
|
|
@@ -5040,44 +5498,46 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5040
5498
|
total: total
|
|
5041
5499
|
});
|
|
5042
5500
|
|
|
5043
|
-
case
|
|
5044
|
-
|
|
5501
|
+
case 33:
|
|
5502
|
+
_context2.next = 38;
|
|
5045
5503
|
break;
|
|
5046
5504
|
|
|
5047
|
-
case
|
|
5048
|
-
|
|
5049
|
-
|
|
5505
|
+
case 35:
|
|
5506
|
+
_context2.prev = 35;
|
|
5507
|
+
_context2.t1 = _context2["catch"](6);
|
|
5050
5508
|
|
|
5051
|
-
if (axios.isAxiosError(
|
|
5052
|
-
onAddToCartError(
|
|
5509
|
+
if (axios.isAxiosError(_context2.t1)) {
|
|
5510
|
+
onAddToCartError(_context2.t1);
|
|
5053
5511
|
}
|
|
5054
5512
|
|
|
5055
|
-
case
|
|
5056
|
-
|
|
5513
|
+
case 38:
|
|
5514
|
+
_context2.prev = 38;
|
|
5057
5515
|
setHandleBookIsLoading(false);
|
|
5058
|
-
return
|
|
5516
|
+
return _context2.finish(38);
|
|
5059
5517
|
|
|
5060
|
-
case
|
|
5518
|
+
case 41:
|
|
5061
5519
|
case "end":
|
|
5062
|
-
return
|
|
5520
|
+
return _context2.stop();
|
|
5063
5521
|
}
|
|
5064
5522
|
}
|
|
5065
|
-
},
|
|
5523
|
+
}, _callee2, null, [[6, 35, 38, 41]]);
|
|
5066
5524
|
}));
|
|
5067
5525
|
|
|
5068
5526
|
return function handleBook() {
|
|
5069
|
-
return
|
|
5527
|
+
return _ref4.apply(this, arguments);
|
|
5070
5528
|
};
|
|
5071
5529
|
}();
|
|
5072
5530
|
|
|
5073
|
-
var updateTickets = function updateTickets(isUpdateingCode) {
|
|
5074
|
-
getTicketsApi(isUpdateingCode);
|
|
5531
|
+
var updateTickets = function updateTickets(isUpdateingCode, type) {
|
|
5532
|
+
getTicketsApi(isUpdateingCode, type);
|
|
5075
5533
|
};
|
|
5076
5534
|
|
|
5077
5535
|
var isTicketOnSale = _some(tickets, function (item) {
|
|
5078
5536
|
return item.salesStarted && !item.salesEnded && !item.soldOut;
|
|
5079
5537
|
});
|
|
5080
5538
|
|
|
5539
|
+
var eventHasTickets = !_isEmpty(tickets);
|
|
5540
|
+
var isSalesClosed = event == null ? void 0 : event.salesEnded;
|
|
5081
5541
|
var themeMui = createTheme$1(themeOptions);
|
|
5082
5542
|
useEffect(function () {
|
|
5083
5543
|
isWindowDefined && window.document.addEventListener('custom-logout', handleLogout);
|
|
@@ -5113,6 +5573,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5113
5573
|
}) : null;
|
|
5114
5574
|
var externalUrl = event == null ? void 0 : event.redirectUrl;
|
|
5115
5575
|
var eventSaleIsNotStarted = !(event != null && event.salesStarted) && (event == null ? void 0 : event.salesStart);
|
|
5576
|
+
var influencers = event != null && event.referralsEnabled ? event == null ? void 0 : event.referrals : [];
|
|
5116
5577
|
return React.createElement(ThemeProvider$1, {
|
|
5117
5578
|
theme: themeMui
|
|
5118
5579
|
}, !isLoading && React.createElement(ReferralLogic, {
|
|
@@ -5122,34 +5583,35 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5122
5583
|
style: contentStyle
|
|
5123
5584
|
}, isLoading ? React.createElement(Loader, null) : React.createElement("div", {
|
|
5124
5585
|
ref: ticketsContainerRef
|
|
5125
|
-
}, React.createElement(TicketsSection, {
|
|
5586
|
+
}, !isSalesClosed && React.createElement(TicketsSection, {
|
|
5126
5587
|
ticketsList: tickets,
|
|
5127
5588
|
selectedTickets: selectedTickets,
|
|
5128
5589
|
handleTicketSelect: handleTicketSelect,
|
|
5129
|
-
codeIsApplied: codeIsApplied,
|
|
5130
5590
|
sortBySoldOut: sortBySoldOut,
|
|
5131
5591
|
ticketsHeaderComponent: ticketsHeaderComponent,
|
|
5132
5592
|
hideTicketsHeader: hideTicketsHeader || _isEmpty(tickets)
|
|
5133
|
-
}), externalUrl ? null :
|
|
5593
|
+
}), externalUrl ? null : isSalesClosed ? React.createElement("p", {
|
|
5134
5594
|
className: "event-closed-message " + (!isLoggedIn ? 'event-closed-on-bottom' : '')
|
|
5135
5595
|
}, "Sales for this event are closed.") : eventSaleIsNotStarted ? React.createElement(Countdown, {
|
|
5136
5596
|
startDate: event.salesStart,
|
|
5137
5597
|
timezone: event.timezone,
|
|
5138
5598
|
title: "Sales start in:",
|
|
5139
5599
|
message: "No tickets are currently available for this event.",
|
|
5600
|
+
showMessage: !eventHasTickets,
|
|
5140
5601
|
callback: updateTickets,
|
|
5141
5602
|
disableLeadingZero: disableCountdownLeadingZero,
|
|
5142
5603
|
isLoggedIn: isLoggedIn
|
|
5143
5604
|
}) : null, showWaitingList && event.salesStarted && !hideWaitingList && React.createElement(WaitingList, {
|
|
5144
5605
|
tickets: tickets,
|
|
5145
5606
|
eventId: eventId
|
|
5146
|
-
}), codeIsLoading ? React.createElement(Loader, null) : showAccessCodeSection ? React.createElement(AccessCodeSection, {
|
|
5607
|
+
}), codeIsLoading ? React.createElement(Loader, null) : isSalesClosed ? null : showAccessCodeSection ? React.createElement(AccessCodeSection, {
|
|
5147
5608
|
code: code,
|
|
5148
5609
|
setCode: setCode,
|
|
5149
5610
|
updateTickets: updateTickets
|
|
5150
5611
|
}) : showPromoCodeSection ? React.createElement(PromoCodeSection, {
|
|
5151
5612
|
code: code,
|
|
5152
5613
|
codeIsApplied: codeIsApplied,
|
|
5614
|
+
setCodeIsApplied: setCodeIsApplied,
|
|
5153
5615
|
showPromoInput: showPromoInput,
|
|
5154
5616
|
setShowPromoInput: setShowPromoInput,
|
|
5155
5617
|
setCode: setCode,
|
|
@@ -5175,7 +5637,18 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5175
5637
|
}, "Log out"))) : ''), showLoginModal ? React.createElement(LoginModal, {
|
|
5176
5638
|
onClose: handleOnClose,
|
|
5177
5639
|
onLogin: handleOnLogin
|
|
5178
|
-
}) : null)
|
|
5640
|
+
}) : null), enableInfluencersSection && influencers.length ? React.createElement("div", {
|
|
5641
|
+
className: "event-influencers"
|
|
5642
|
+
}, React.createElement("h3", null, React.createElement("span", null, "TOP"), " INFLUENCERS"), React.createElement("ol", {
|
|
5643
|
+
className: "influencer-list"
|
|
5644
|
+
}, influencers.map(function (influencer, i) {
|
|
5645
|
+
var _influencer$lastName;
|
|
5646
|
+
|
|
5647
|
+
return React.createElement("li", {
|
|
5648
|
+
className: "influencer-item",
|
|
5649
|
+
key: i
|
|
5650
|
+
}, influencer.firstName + " " + ((_influencer$lastName = influencer.lastName) == null ? void 0 : _influencer$lastName.charAt(0)), ' ');
|
|
5651
|
+
}))) : null);
|
|
5179
5652
|
};
|
|
5180
5653
|
|
|
5181
5654
|
var EventInfoItem = function EventInfoItem(_ref) {
|
|
@@ -5195,10 +5668,8 @@ var tableConfig = function tableConfig(key) {
|
|
|
5195
5668
|
switch (key) {
|
|
5196
5669
|
default:
|
|
5197
5670
|
config = {
|
|
5198
|
-
header: [
|
|
5671
|
+
header: [],
|
|
5199
5672
|
body: [function (row) {
|
|
5200
|
-
return row.id;
|
|
5201
|
-
}, function (row) {
|
|
5202
5673
|
return row.date;
|
|
5203
5674
|
}, function (row) {
|
|
5204
5675
|
return React.createElement(EventInfoItem, {
|
|
@@ -5245,13 +5716,14 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
5245
5716
|
var _data$orders;
|
|
5246
5717
|
|
|
5247
5718
|
var _ref$handleDetailsInf = _ref.handleDetailsInfo,
|
|
5248
|
-
handleDetailsInfo = _ref$handleDetailsInf === void 0 ?
|
|
5719
|
+
handleDetailsInfo = _ref$handleDetailsInf === void 0 ? _identity : _ref$handleDetailsInf,
|
|
5249
5720
|
_ref$onGetOrdersSucce = _ref.onGetOrdersSuccess,
|
|
5250
|
-
onGetOrdersSuccess = _ref$onGetOrdersSucce === void 0 ?
|
|
5721
|
+
onGetOrdersSuccess = _ref$onGetOrdersSucce === void 0 ? _identity : _ref$onGetOrdersSucce,
|
|
5251
5722
|
_ref$onGetOrdersError = _ref.onGetOrdersError,
|
|
5252
|
-
onGetOrdersError = _ref$onGetOrdersError === void 0 ?
|
|
5723
|
+
onGetOrdersError = _ref$onGetOrdersError === void 0 ? _identity : _ref$onGetOrdersError,
|
|
5253
5724
|
_ref$theme = _ref.theme,
|
|
5254
|
-
theme = _ref$theme === void 0 ? 'dark' : _ref$theme
|
|
5725
|
+
theme = _ref$theme === void 0 ? 'dark' : _ref$theme,
|
|
5726
|
+
logo = _ref.logo;
|
|
5255
5727
|
|
|
5256
5728
|
var _useState = useState(null),
|
|
5257
5729
|
data = _useState[0],
|
|
@@ -5361,24 +5833,20 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
5361
5833
|
|
|
5362
5834
|
return React.createElement("div", {
|
|
5363
5835
|
className: "my-ticket " + theme
|
|
5364
|
-
},
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
}, React.createElement("img", {
|
|
5379
|
-
src: theme === 'dark' ? 'https://www.ticketfairy.com/resources/images/logo-ttf.svg' : 'https://www.ticketfairy.com/resources/images/logo-ttf-black.svg',
|
|
5380
|
-
alt: "nodata"
|
|
5381
|
-
})))) : null, data && React.createElement(React.Fragment, null, React.createElement(Autocomplete, {
|
|
5836
|
+
}, React.createElement(React.Fragment, null, showModalLogin || !isLogged && React.createElement(LoginModal, {
|
|
5837
|
+
onClose: function onClose() {
|
|
5838
|
+
setShowModalLogin(false);
|
|
5839
|
+
},
|
|
5840
|
+
onLogin: function onLogin() {
|
|
5841
|
+
setShowModalLogin(false);
|
|
5842
|
+
setUserExpired(false);
|
|
5843
|
+
setIsLogged(true);
|
|
5844
|
+
},
|
|
5845
|
+
userExpired: userExpired,
|
|
5846
|
+
logo: logo
|
|
5847
|
+
})), data && React.createElement(React.Fragment, null, React.createElement("h2", null, "My Ticket Orders"), React.createElement("div", {
|
|
5848
|
+
className: "order_event"
|
|
5849
|
+
}, React.createElement(Autocomplete, {
|
|
5382
5850
|
disablePortal: true,
|
|
5383
5851
|
id: "combo-box-demo",
|
|
5384
5852
|
getOptionLabel: function getOptionLabel(option) {
|
|
@@ -5390,11 +5858,16 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
5390
5858
|
width: 300
|
|
5391
5859
|
},
|
|
5392
5860
|
renderInput: function renderInput(params) {
|
|
5393
|
-
return React.createElement(TextField
|
|
5861
|
+
return React.createElement(TextField, Object.assign({}, params, {
|
|
5394
5862
|
label: "Events"
|
|
5395
5863
|
}));
|
|
5396
5864
|
}
|
|
5397
|
-
}), React.createElement(
|
|
5865
|
+
}), React.createElement("button", {
|
|
5866
|
+
type: "button",
|
|
5867
|
+
className: "clear"
|
|
5868
|
+
}, "CLEAR")), loading ? React.createElement("div", {
|
|
5869
|
+
className: "loading"
|
|
5870
|
+
}, React.createElement(CircularProgress, null)) : React.createElement(React.Fragment, null, React.createElement(TableContainer, {
|
|
5398
5871
|
component: Paper,
|
|
5399
5872
|
className: "my-ticket-table"
|
|
5400
5873
|
}, React.createElement(Table, {
|
|
@@ -5417,7 +5890,7 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
5417
5890
|
page: data.page,
|
|
5418
5891
|
onPageChange: handleChangePage,
|
|
5419
5892
|
onRowsPerPageChange: handleChangeRowsPerPage
|
|
5420
|
-
})), React.createElement(React.Fragment, null, showModalLogin && React.createElement(LoginModal, {
|
|
5893
|
+
}))), React.createElement(React.Fragment, null, showModalLogin && React.createElement(LoginModal, {
|
|
5421
5894
|
onClose: function onClose() {
|
|
5422
5895
|
setShowModalLogin(false);
|
|
5423
5896
|
},
|
|
@@ -5434,29 +5907,94 @@ var TicketsTable = function TicketsTable(_ref) {
|
|
|
5434
5907
|
var _ref$tickets = _ref.tickets,
|
|
5435
5908
|
tickets = _ref$tickets === void 0 ? [] : _ref$tickets,
|
|
5436
5909
|
_ref$handleSellTicket = _ref.handleSellTicket,
|
|
5437
|
-
handleSellTicket = _ref$handleSellTicket === void 0 ?
|
|
5910
|
+
handleSellTicket = _ref$handleSellTicket === void 0 ? _identity : _ref$handleSellTicket,
|
|
5438
5911
|
_ref$handleRemoveFrom = _ref.handleRemoveFromResale,
|
|
5439
|
-
handleRemoveFromResale = _ref$handleRemoveFrom === void 0 ?
|
|
5912
|
+
handleRemoveFromResale = _ref$handleRemoveFrom === void 0 ? _identity : _ref$handleRemoveFrom,
|
|
5913
|
+
_ref$icon = _ref.icon,
|
|
5914
|
+
icon = _ref$icon === void 0 ? '' : _ref$icon;
|
|
5915
|
+
|
|
5916
|
+
var _useState = useState(null),
|
|
5917
|
+
pdfError = _useState[0],
|
|
5918
|
+
setPdfError = _useState[1];
|
|
5919
|
+
|
|
5440
5920
|
return React.createElement("div", {
|
|
5441
5921
|
className: "tickets-box"
|
|
5442
|
-
}, React.createElement(
|
|
5922
|
+
}, React.createElement(SnackbarAlert, {
|
|
5923
|
+
type: "error",
|
|
5924
|
+
isOpen: !!pdfError,
|
|
5925
|
+
message: pdfError || '',
|
|
5926
|
+
onClose: function onClose() {
|
|
5927
|
+
return setPdfError(null);
|
|
5928
|
+
}
|
|
5929
|
+
}), React.createElement("h4", {
|
|
5443
5930
|
className: "sub-title"
|
|
5444
5931
|
}, "Your Tickets"), React.createElement(TableContainer, {
|
|
5445
5932
|
component: Paper
|
|
5446
5933
|
}, React.createElement(Table, {
|
|
5447
5934
|
"aria-label": "collapsible table"
|
|
5448
|
-
}, React.createElement(TableHead, null, React.createElement(TableRow, null, React.createElement(TableCell, null
|
|
5935
|
+
}, React.createElement(TableHead, null, React.createElement(TableRow, null, React.createElement(TableCell, null), React.createElement(TableCell, null), React.createElement(TableCell, null), React.createElement(TableCell, null), React.createElement(TableCell, null), React.createElement(TableCell, null))), React.createElement(TableBody, null, tickets.map(function (ticket, index) {
|
|
5449
5936
|
var _ticket$add_ons;
|
|
5450
5937
|
|
|
5451
5938
|
return React.createElement(Fragment, {
|
|
5452
5939
|
key: index
|
|
5453
|
-
}, React.createElement(TableRow, null, React.createElement(TableCell, null,
|
|
5940
|
+
}, React.createElement(TableRow, null, React.createElement(TableCell, null, React.createElement("div", {
|
|
5941
|
+
className: "cell-block"
|
|
5942
|
+
}, React.createElement("span", null, "Ticket ID"), React.createElement("span", null, ticket.hash))), React.createElement(TableCell, null, React.createElement("div", {
|
|
5943
|
+
className: "cell-block"
|
|
5944
|
+
}, React.createElement("span", null, "Ticket Type"), React.createElement("span", null, ticket.ticket_type))), React.createElement(TableCell, null, React.createElement("div", {
|
|
5945
|
+
className: "cell-block"
|
|
5946
|
+
}, React.createElement("span", null, "Ticket Holder"), React.createElement("span", null, ticket.holder_name))), React.createElement(TableCell, null, React.createElement("div", {
|
|
5947
|
+
className: "cell-block"
|
|
5948
|
+
}, React.createElement("span", null, "Status"), React.createElement("span", null, ticket.status))), ticket.pdf_link && ticket.status !== "Sold" ? React.createElement(TableCell, null, Boolean(icon) && React.createElement("img", {
|
|
5949
|
+
src: icon,
|
|
5950
|
+
alt: "nodata"
|
|
5951
|
+
}), React.createElement("span", {
|
|
5454
5952
|
"aria-hidden": true,
|
|
5455
5953
|
className: "action-button",
|
|
5456
|
-
onClick: function
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5954
|
+
onClick: function () {
|
|
5955
|
+
var _onClick = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
5956
|
+
var pdfDownloadError;
|
|
5957
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
5958
|
+
while (1) {
|
|
5959
|
+
switch (_context.prev = _context.next) {
|
|
5960
|
+
case 0:
|
|
5961
|
+
_context.prev = 0;
|
|
5962
|
+
_context.next = 3;
|
|
5963
|
+
return downloadPDF(ticket.pdf_link);
|
|
5964
|
+
|
|
5965
|
+
case 3:
|
|
5966
|
+
pdfDownloadError = _context.sent;
|
|
5967
|
+
|
|
5968
|
+
if (pdfDownloadError) {
|
|
5969
|
+
setPdfError(pdfDownloadError == null ? void 0 : pdfDownloadError.message);
|
|
5970
|
+
}
|
|
5971
|
+
|
|
5972
|
+
_context.next = 10;
|
|
5973
|
+
break;
|
|
5974
|
+
|
|
5975
|
+
case 7:
|
|
5976
|
+
_context.prev = 7;
|
|
5977
|
+
_context.t0 = _context["catch"](0);
|
|
5978
|
+
|
|
5979
|
+
if (_context.t0 && typeof _context.t0 === 'string') {
|
|
5980
|
+
setPdfError(_context.t0);
|
|
5981
|
+
}
|
|
5982
|
+
|
|
5983
|
+
case 10:
|
|
5984
|
+
case "end":
|
|
5985
|
+
return _context.stop();
|
|
5986
|
+
}
|
|
5987
|
+
}
|
|
5988
|
+
}, _callee, null, [[0, 7]]);
|
|
5989
|
+
}));
|
|
5990
|
+
|
|
5991
|
+
function onClick() {
|
|
5992
|
+
return _onClick.apply(this, arguments);
|
|
5993
|
+
}
|
|
5994
|
+
|
|
5995
|
+
return onClick;
|
|
5996
|
+
}()
|
|
5997
|
+
}, "Download")) : null, React.createElement(TableCell, null, ticket.is_sellable && React.createElement("span", {
|
|
5460
5998
|
"aria-hidden": true,
|
|
5461
5999
|
className: "action-button",
|
|
5462
6000
|
onClick: function onClick() {
|
|
@@ -5480,11 +6018,11 @@ var TicketsTable = function TicketsTable(_ref) {
|
|
|
5480
6018
|
})))));
|
|
5481
6019
|
};
|
|
5482
6020
|
|
|
5483
|
-
var _excluded$
|
|
6021
|
+
var _excluded$2 = ["label", "field", "theme"];
|
|
5484
6022
|
var RadioField = function RadioField(_ref) {
|
|
5485
6023
|
var label = _ref.label,
|
|
5486
6024
|
field = _ref.field,
|
|
5487
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$
|
|
6025
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
|
|
5488
6026
|
|
|
5489
6027
|
var customTheme = useTheme();
|
|
5490
6028
|
return React.createElement(FormGroup, null, React.createElement(FormControlLabel, {
|
|
@@ -5496,7 +6034,7 @@ var RadioField = function RadioField(_ref) {
|
|
|
5496
6034
|
}));
|
|
5497
6035
|
};
|
|
5498
6036
|
|
|
5499
|
-
var style$
|
|
6037
|
+
var style$3 = {
|
|
5500
6038
|
position: 'absolute',
|
|
5501
6039
|
top: '50%',
|
|
5502
6040
|
left: '50%',
|
|
@@ -5558,14 +6096,14 @@ var TicketResaleModal = function TicketResaleModal(_ref) {
|
|
|
5558
6096
|
currency = ticket.currency,
|
|
5559
6097
|
resale_fee_amount = ticket.resale_fee_amount,
|
|
5560
6098
|
ticket_type_is_active = ticket.ticket_type_is_active;
|
|
5561
|
-
return React.createElement(Modal, {
|
|
6099
|
+
return React.createElement(Modal$1, {
|
|
5562
6100
|
open: true,
|
|
5563
6101
|
onClose: onClose,
|
|
5564
6102
|
"aria-labelledby": "modal-modal-title",
|
|
5565
6103
|
"aria-describedby": "modal-modal-description",
|
|
5566
6104
|
className: 'resale-modal'
|
|
5567
|
-
}, React.createElement(Box, {
|
|
5568
|
-
style: style$
|
|
6105
|
+
}, React.createElement(Box$1, {
|
|
6106
|
+
style: style$3
|
|
5569
6107
|
}, React.createElement("h3", null, "Sell Ticket"), React.createElement("div", null, React.createElement("h3", null, "Ticket Details"), React.createElement("div", null, React.createElement("h4", null, "Event"), React.createElement("p", null, event_name)), React.createElement("div", null, React.createElement("h4", null, "Ticket Holder"), React.createElement("p", null, holder_name)), React.createElement("div", null, React.createElement("h4", null, "Ticket ID"), React.createElement("p", null, hash))), React.createElement("div", null, React.createElement("h3", null, "Sell to Whom"), React.createElement(Formik, {
|
|
5570
6108
|
initialValues: initialValues,
|
|
5571
6109
|
validationSchema: schema,
|
|
@@ -5631,12 +6169,12 @@ var TicketResaleModal = function TicketResaleModal(_ref) {
|
|
|
5631
6169
|
type: 'text',
|
|
5632
6170
|
component: CustomField
|
|
5633
6171
|
}))))), ticket_type_is_active && React.createElement("div", null, React.createElement(Field, {
|
|
5634
|
-
name:
|
|
5635
|
-
label:
|
|
5636
|
-
type:
|
|
5637
|
-
value:
|
|
6172
|
+
name: "to",
|
|
6173
|
+
label: "I will sell my ticket to anyone who wants to buy it",
|
|
6174
|
+
type: "radio",
|
|
6175
|
+
value: "anyone",
|
|
5638
6176
|
component: RadioField
|
|
5639
|
-
})), React.createElement("div", null, React.createElement("h4", null, "Terms of Resale"), React.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.createElement("p", null, "I also understand that, if no one chooses to buy it, it remains my property, is valid for entry to ", React.createElement("strong", null, event_name), " and I will not receive any refund."), React.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.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.createElement(Field, {
|
|
6177
|
+
})), React.createElement("div", null, React.createElement("h4", null, "Terms of Resale"), React.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.createElement("p", null, "I also understand that, if no one chooses to buy it, it remains my property, is valid for entry to ", React.createElement("strong", null, event_name), " and I will not receive any refund."), React.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.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.createElement(Field, {
|
|
5640
6178
|
name: 'confirm',
|
|
5641
6179
|
label: 'I agree',
|
|
5642
6180
|
type: 'checkbox',
|
|
@@ -5650,7 +6188,7 @@ var TicketResaleModal = function TicketResaleModal(_ref) {
|
|
|
5650
6188
|
}))));
|
|
5651
6189
|
};
|
|
5652
6190
|
|
|
5653
|
-
var style$
|
|
6191
|
+
var style$4 = {
|
|
5654
6192
|
position: 'absolute',
|
|
5655
6193
|
top: '50%',
|
|
5656
6194
|
left: '50%',
|
|
@@ -5671,14 +6209,14 @@ var ConfirmModal = function ConfirmModal(_ref) {
|
|
|
5671
6209
|
onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
|
|
5672
6210
|
_ref$onConfirm = _ref.onConfirm,
|
|
5673
6211
|
onConfirm = _ref$onConfirm === void 0 ? function () {} : _ref$onConfirm;
|
|
5674
|
-
return React.createElement(Modal, {
|
|
6212
|
+
return React.createElement(Modal$1, {
|
|
5675
6213
|
open: true,
|
|
5676
6214
|
onClose: onClose,
|
|
5677
6215
|
"aria-labelledby": "modal-modal-title",
|
|
5678
6216
|
"aria-describedby": "modal-modal-description",
|
|
5679
6217
|
className: 'confirm-modal'
|
|
5680
|
-
}, React.createElement(Box, {
|
|
5681
|
-
style: style$
|
|
6218
|
+
}, React.createElement(Box$1, {
|
|
6219
|
+
style: style$4
|
|
5682
6220
|
}, React.createElement("p", null, message), React.createElement("div", {
|
|
5683
6221
|
className: 'footer'
|
|
5684
6222
|
}, React.createElement(Button, {
|
|
@@ -5696,10 +6234,15 @@ var getTotal = function getTotal(data) {
|
|
|
5696
6234
|
var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
5697
6235
|
var _data$items, _data$items$ticket_ty, _data$items2, _data$items2$add_ons;
|
|
5698
6236
|
|
|
5699
|
-
var _ref$
|
|
6237
|
+
var _ref$columns = _ref.columns,
|
|
6238
|
+
columns = _ref$columns === void 0 ? [] : _ref$columns,
|
|
6239
|
+
_ref$onGetOrdersSucce = _ref.onGetOrdersSuccess,
|
|
5700
6240
|
onGetOrdersSuccess = _ref$onGetOrdersSucce === void 0 ? function () {} : _ref$onGetOrdersSucce,
|
|
5701
6241
|
_ref$onGetOrdersError = _ref.onGetOrdersError,
|
|
5702
|
-
onGetOrdersError = _ref$onGetOrdersError === void 0 ? function () {} : _ref$onGetOrdersError
|
|
6242
|
+
onGetOrdersError = _ref$onGetOrdersError === void 0 ? function () {} : _ref$onGetOrdersError,
|
|
6243
|
+
onReturnButtonClick = _ref.onReturnButtonClick,
|
|
6244
|
+
_ref$personalLinkIcon = _ref.personalLinkIcon,
|
|
6245
|
+
personalLinkIcon = _ref$personalLinkIcon === void 0 ? '' : _ref$personalLinkIcon;
|
|
5703
6246
|
|
|
5704
6247
|
var _useState = useState({}),
|
|
5705
6248
|
data = _useState[0],
|
|
@@ -5900,6 +6443,12 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
5900
6443
|
};
|
|
5901
6444
|
}();
|
|
5902
6445
|
|
|
6446
|
+
var orderSummery = "ID " + data.id + ", placed";
|
|
6447
|
+
|
|
6448
|
+
if (data.date) {
|
|
6449
|
+
orderSummery += " " + data.date;
|
|
6450
|
+
}
|
|
6451
|
+
|
|
5903
6452
|
return React.createElement("div", {
|
|
5904
6453
|
className: "order-details"
|
|
5905
6454
|
}, loading ? React.createElement("div", {
|
|
@@ -5908,19 +6457,47 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
5908
6457
|
className: "layout-title"
|
|
5909
6458
|
}, "Order Details"), React.createElement("div", {
|
|
5910
6459
|
className: "order-summary-box"
|
|
5911
|
-
}, React.createElement("
|
|
6460
|
+
}, React.createElement("div", {
|
|
6461
|
+
className: "summary-block"
|
|
6462
|
+
}, React.createElement("div", {
|
|
6463
|
+
className: "summary-item"
|
|
6464
|
+
}, React.createElement("h6", {
|
|
5912
6465
|
className: "sub-title"
|
|
5913
|
-
}, "Order Summary"), React.createElement("div", {
|
|
6466
|
+
}, "Order Summary"), React.createElement("p", null, orderSummery)), React.createElement("div", {
|
|
6467
|
+
className: "summary-item"
|
|
6468
|
+
}, React.createElement("div", {
|
|
6469
|
+
className: "return-button-container"
|
|
6470
|
+
}, React.createElement("button", {
|
|
6471
|
+
type: "button",
|
|
6472
|
+
className: "return-button",
|
|
6473
|
+
onClick: function onClick() {
|
|
6474
|
+
if (typeof window !== 'undefined') {
|
|
6475
|
+
window.location.assign('/orders');
|
|
6476
|
+
}
|
|
6477
|
+
}
|
|
6478
|
+
}, "Back to Orders")))), React.createElement("div", {
|
|
5914
6479
|
className: "personal-link"
|
|
5915
|
-
}, React.createElement("
|
|
6480
|
+
}, React.createElement("div", {
|
|
6481
|
+
className: "link-item"
|
|
6482
|
+
}, React.createElement("span", null, "Personal Share Link: "), React.createElement("a", {
|
|
5916
6483
|
href: data == null ? void 0 : data.personal_share_link,
|
|
5917
6484
|
target: "_blank",
|
|
5918
6485
|
rel: "noreferrer"
|
|
5919
|
-
},
|
|
6486
|
+
}, Boolean(personalLinkIcon) && React.createElement("img", {
|
|
6487
|
+
src: personalLinkIcon,
|
|
6488
|
+
alt: "Icon"
|
|
6489
|
+
}), data == null ? void 0 : data.personal_share_link)), React.createElement("div", {
|
|
6490
|
+
className: "link-item"
|
|
6491
|
+
}, React.createElement("p", null, "So far, you\u2019ve referred " + data.sales_referred + " tickets"))), data != null && data.sales_referred ? React.createElement("div", {
|
|
6492
|
+
className: "total-referrer"
|
|
6493
|
+
}, React.createElement("b", null, "So far, you've referred ", data.sales_referred, " tickets.")) : null, React.createElement(TableContainer, {
|
|
5920
6494
|
component: Paper
|
|
5921
6495
|
}, React.createElement(Table, {
|
|
6496
|
+
className: "tt-type",
|
|
5922
6497
|
"aria-label": "collapsible table"
|
|
5923
|
-
}, React.createElement(TableHead, null, React.createElement(TableRow, null,
|
|
6498
|
+
}, React.createElement(TableHead, null, React.createElement(TableRow, null, _map(columns, function (item) {
|
|
6499
|
+
return React.createElement(TableCell, null, item.label || '');
|
|
6500
|
+
}))), React.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) {
|
|
5924
6501
|
return React.createElement(TableRow, {
|
|
5925
6502
|
key: index
|
|
5926
6503
|
}, React.createElement(TableCell, null, React.createElement("b", null, "Ticket Type: "), ticket.name), React.createElement(TableCell, null, ticket.currency + ticket.price), React.createElement(TableCell, null, ticket.quantity), React.createElement(TableCell, null, ticket.currency + ticket.total));
|
|
@@ -5940,7 +6517,9 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
5940
6517
|
type: "button",
|
|
5941
6518
|
className: "return-button",
|
|
5942
6519
|
onClick: function onClick() {
|
|
5943
|
-
if (
|
|
6520
|
+
if (onReturnButtonClick) {
|
|
6521
|
+
onReturnButtonClick(data);
|
|
6522
|
+
} else if (typeof window !== 'undefined') {
|
|
5944
6523
|
window.location.assign('/orders');
|
|
5945
6524
|
}
|
|
5946
6525
|
}
|
|
@@ -5955,6 +6534,120 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
5955
6534
|
}));
|
|
5956
6535
|
};
|
|
5957
6536
|
|
|
6537
|
+
var Schema$1 = /*#__PURE__*/object().shape({
|
|
6538
|
+
password: /*#__PURE__*/string().min(6, 'Password must have 5+ characters').required('Required'),
|
|
6539
|
+
password_confirmation: /*#__PURE__*/string().required('Required').oneOf([/*#__PURE__*/ref('password'), null], 'Passwords must match')
|
|
6540
|
+
});
|
|
6541
|
+
var ResetPasswordContainer = function ResetPasswordContainer(_ref) {
|
|
6542
|
+
var _ref$token = _ref.token,
|
|
6543
|
+
tokenProps = _ref$token === void 0 ? '' : _ref$token,
|
|
6544
|
+
_ref$onResetPasswordS = _ref.onResetPasswordSuccess,
|
|
6545
|
+
onResetPasswordSuccess = _ref$onResetPasswordS === void 0 ? function () {} : _ref$onResetPasswordS,
|
|
6546
|
+
_ref$onResetPasswordE = _ref.onResetPasswordError,
|
|
6547
|
+
onResetPasswordError = _ref$onResetPasswordE === void 0 ? function () {} : _ref$onResetPasswordE;
|
|
6548
|
+
|
|
6549
|
+
var _useState = useState(false),
|
|
6550
|
+
loading = _useState[0],
|
|
6551
|
+
setLoading = _useState[1];
|
|
6552
|
+
|
|
6553
|
+
return React.createElement("div", {
|
|
6554
|
+
className: "reset-password"
|
|
6555
|
+
}, React.createElement("div", {
|
|
6556
|
+
className: "title"
|
|
6557
|
+
}, "Change Password"), React.createElement(Formik, {
|
|
6558
|
+
initialValues: {
|
|
6559
|
+
password: '',
|
|
6560
|
+
password_confirmation: ''
|
|
6561
|
+
},
|
|
6562
|
+
validationSchema: Schema$1,
|
|
6563
|
+
onSubmit: function () {
|
|
6564
|
+
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(values) {
|
|
6565
|
+
var token, params, payload, res;
|
|
6566
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
6567
|
+
while (1) {
|
|
6568
|
+
switch (_context.prev = _context.next) {
|
|
6569
|
+
case 0:
|
|
6570
|
+
_context.prev = 0;
|
|
6571
|
+
setLoading(true);
|
|
6572
|
+
|
|
6573
|
+
if (tokenProps) {
|
|
6574
|
+
token = tokenProps;
|
|
6575
|
+
} else {
|
|
6576
|
+
if (typeof window !== 'undefined') {
|
|
6577
|
+
params = new URL("" + window.location).searchParams;
|
|
6578
|
+
token = params.get('token');
|
|
6579
|
+
}
|
|
6580
|
+
}
|
|
6581
|
+
|
|
6582
|
+
payload = _extends({
|
|
6583
|
+
token: token
|
|
6584
|
+
}, values);
|
|
6585
|
+
_context.next = 6;
|
|
6586
|
+
return resetPassword(payload);
|
|
6587
|
+
|
|
6588
|
+
case 6:
|
|
6589
|
+
res = _context.sent;
|
|
6590
|
+
onResetPasswordSuccess(res);
|
|
6591
|
+
_context.next = 13;
|
|
6592
|
+
break;
|
|
6593
|
+
|
|
6594
|
+
case 10:
|
|
6595
|
+
_context.prev = 10;
|
|
6596
|
+
_context.t0 = _context["catch"](0);
|
|
6597
|
+
|
|
6598
|
+
if (axios.isAxiosError(_context.t0)) {
|
|
6599
|
+
onResetPasswordError(_context.t0);
|
|
6600
|
+
}
|
|
6601
|
+
|
|
6602
|
+
case 13:
|
|
6603
|
+
_context.prev = 13;
|
|
6604
|
+
setLoading(false);
|
|
6605
|
+
return _context.finish(13);
|
|
6606
|
+
|
|
6607
|
+
case 16:
|
|
6608
|
+
case "end":
|
|
6609
|
+
return _context.stop();
|
|
6610
|
+
}
|
|
6611
|
+
}
|
|
6612
|
+
}, _callee, null, [[0, 10, 13, 16]]);
|
|
6613
|
+
}));
|
|
6614
|
+
|
|
6615
|
+
function onSubmit(_x) {
|
|
6616
|
+
return _onSubmit.apply(this, arguments);
|
|
6617
|
+
}
|
|
6618
|
+
|
|
6619
|
+
return onSubmit;
|
|
6620
|
+
}()
|
|
6621
|
+
}, function (_ref2) {
|
|
6622
|
+
var isValid = _ref2.isValid,
|
|
6623
|
+
dirty = _ref2.dirty;
|
|
6624
|
+
return React.createElement(Form, null, React.createElement("div", {
|
|
6625
|
+
className: "body"
|
|
6626
|
+
}, React.createElement("div", {
|
|
6627
|
+
className: "field-item"
|
|
6628
|
+
}, React.createElement(Field, {
|
|
6629
|
+
name: "password",
|
|
6630
|
+
label: "New Password",
|
|
6631
|
+
type: "password",
|
|
6632
|
+
component: CustomField
|
|
6633
|
+
})), React.createElement("div", {
|
|
6634
|
+
className: "field-item"
|
|
6635
|
+
}, React.createElement(Field, {
|
|
6636
|
+
name: "password_confirmation",
|
|
6637
|
+
label: "Confirm Password",
|
|
6638
|
+
type: "password",
|
|
6639
|
+
component: CustomField
|
|
6640
|
+
}))), React.createElement("div", {
|
|
6641
|
+
className: "action-button"
|
|
6642
|
+
}, React.createElement("button", {
|
|
6643
|
+
type: "submit",
|
|
6644
|
+
disabled: !(isValid && dirty)
|
|
6645
|
+
}, loading ? React.createElement(CircularProgress$1, {
|
|
6646
|
+
size: "22px"
|
|
6647
|
+
}) : 'Submit')));
|
|
6648
|
+
}));
|
|
6649
|
+
};
|
|
6650
|
+
|
|
5958
6651
|
var TicketResaleContainer = function TicketResaleContainer(_ref) {
|
|
5959
6652
|
var _ref$onProcessTicketS = _ref.onProcessTicketSuccess,
|
|
5960
6653
|
onProcessTicketSuccess = _ref$onProcessTicketS === void 0 ? function () {} : _ref$onProcessTicketS,
|
|
@@ -6066,7 +6759,7 @@ var TicketResaleContainer = function TicketResaleContainer(_ref) {
|
|
|
6066
6759
|
}, React.createElement("h3", null, successMessage ? successMessage : error)));
|
|
6067
6760
|
};
|
|
6068
6761
|
|
|
6069
|
-
var style$
|
|
6762
|
+
var style$5 = {
|
|
6070
6763
|
position: 'absolute',
|
|
6071
6764
|
top: '10%',
|
|
6072
6765
|
left: '50%',
|
|
@@ -6084,13 +6777,13 @@ var RedirectModal = function RedirectModal(_ref) {
|
|
|
6084
6777
|
message = _ref$message === void 0 ? 'Your cart has expired. Please click on "OK" to return to the ticket selection page.' : _ref$message,
|
|
6085
6778
|
_ref$onClickOk = _ref.onClickOk,
|
|
6086
6779
|
onClickOk = _ref$onClickOk === void 0 ? function () {} : _ref$onClickOk;
|
|
6087
|
-
return React.createElement(Modal, {
|
|
6780
|
+
return React.createElement(Modal$1, {
|
|
6088
6781
|
open: true,
|
|
6089
6782
|
"aria-labelledby": "modal-modal-title",
|
|
6090
6783
|
"aria-describedby": "modal-modal-description",
|
|
6091
6784
|
className: "redirect-modal"
|
|
6092
|
-
}, React.createElement(Box, {
|
|
6093
|
-
style: style$
|
|
6785
|
+
}, React.createElement(Box$1, {
|
|
6786
|
+
style: style$5
|
|
6094
6787
|
}, React.createElement("p", null, message), React.createElement("div", {
|
|
6095
6788
|
className: "footer"
|
|
6096
6789
|
}, React.createElement("button", {
|
|
@@ -6098,7 +6791,7 @@ var RedirectModal = function RedirectModal(_ref) {
|
|
|
6098
6791
|
}, "OK"))));
|
|
6099
6792
|
};
|
|
6100
6793
|
|
|
6101
|
-
var style$
|
|
6794
|
+
var style$6 = {
|
|
6102
6795
|
position: 'absolute',
|
|
6103
6796
|
top: '50%',
|
|
6104
6797
|
left: '50%',
|
|
@@ -6197,14 +6890,14 @@ var RsvpContainer = function RsvpContainer(_ref) {
|
|
|
6197
6890
|
return null;
|
|
6198
6891
|
}
|
|
6199
6892
|
|
|
6200
|
-
return React.createElement(React.Fragment, null, React.createElement(Modal, {
|
|
6893
|
+
return React.createElement(React.Fragment, null, React.createElement(Modal$1, {
|
|
6201
6894
|
open: modal.isOpen,
|
|
6202
6895
|
onClose: handleModalClose,
|
|
6203
6896
|
"aria-labelledby": "modal-modal-title",
|
|
6204
6897
|
"aria-describedby": "modal-modal-description",
|
|
6205
6898
|
className: "rsvp-modal"
|
|
6206
|
-
}, React.createElement(Box, {
|
|
6207
|
-
style: style$
|
|
6899
|
+
}, React.createElement(Box$1, {
|
|
6900
|
+
style: style$6,
|
|
6208
6901
|
className: "rsvp-modal-box"
|
|
6209
6902
|
}, React.createElement("div", {
|
|
6210
6903
|
className: "rsvp-modal-container"
|
|
@@ -6245,5 +6938,5 @@ var RsvpContainer = function RsvpContainer(_ref) {
|
|
|
6245
6938
|
}, "RSVP"))))))));
|
|
6246
6939
|
};
|
|
6247
6940
|
|
|
6248
|
-
export { BillingInfoContainer, ConfirmationContainer, LoginModal, MyTicketsContainer, OrderDetailsContainer, PaymentContainer, RedirectModal, RsvpContainer, TicketResaleContainer, TicketsContainer, createFixedFloatNormalizer, currencyNormalizerCreator, setConfigs };
|
|
6941
|
+
export { BillingInfoContainer, ConfirmationContainer, ForgotPasswordModal, LoginModal, MyTicketsContainer, OrderDetailsContainer, PaymentContainer, RedirectModal, ResetPasswordContainer, RsvpContainer, TicketResaleContainer, TicketsContainer, createFixedFloatNormalizer, currencyNormalizerCreator, setConfigs };
|
|
6249
6942
|
//# sourceMappingURL=tf-checkout-react.esm.js.map
|