tf-checkout-react 1.2.0 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/billing-info-container/index.d.ts +4 -4
- package/dist/components/common/CheckboxField.d.ts +1 -1
- package/dist/components/common/PhoneNumberField.d.ts +2 -1
- package/dist/components/common/RadioField.d.ts +1 -1
- package/dist/components/paymentContainer/index.d.ts +2 -1
- package/dist/components/stripePayment/index.d.ts +2 -1
- package/dist/components/ticketsContainer/index.d.ts +4 -3
- package/dist/tf-checkout-react.cjs.development.js +1260 -1216
- 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 +1401 -1357
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/tf-checkout-styles.css +1 -1
- package/package.json +1 -1
- package/src/api/index.ts +25 -19
- package/src/components/billing-info-container/index.tsx +97 -57
- package/src/components/common/CheckboxField.tsx +1 -0
- package/src/components/common/PhoneNumberField.tsx +17 -11
- package/src/components/common/RadioField.tsx +1 -0
- package/src/components/orderDetailsContainer/index.tsx +5 -0
- package/src/components/orderDetailsContainer/style.css +4 -0
- package/src/components/paymentContainer/index.tsx +13 -11
- package/src/components/stripePayment/index.tsx +5 -3
- package/src/components/ticketsContainer/index.tsx +73 -46
|
@@ -1,52 +1,52 @@
|
|
|
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 _isEqual from 'lodash-es/isEqual';
|
|
12
|
+
import _map from 'lodash-es/map';
|
|
13
|
+
import { nanoid } from 'nanoid';
|
|
14
|
+
import React, { Component, useCallback, useEffect, useState, memo, useRef, Fragment } from 'react';
|
|
11
15
|
import _forEach from 'lodash-es/forEach';
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import TextField
|
|
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';
|
|
16
20
|
import { useTheme } from '@mui/styles';
|
|
17
|
-
import { object, string, ref, boolean } from 'yup';
|
|
18
|
-
import _flatMapDeep from 'lodash-es/flatMapDeep';
|
|
19
|
-
import _isArray from 'lodash-es/isArray';
|
|
20
|
-
import { nanoid } from 'nanoid';
|
|
21
21
|
import FormGroup from '@mui/material/FormGroup';
|
|
22
22
|
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
23
23
|
import Checkbox from '@mui/material/Checkbox';
|
|
24
|
-
import 'material-ui-phone-number';
|
|
24
|
+
import MuiPhoneNumber from 'material-ui-phone-number';
|
|
25
25
|
import _debounce from 'lodash-es/debounce';
|
|
26
|
-
import CircularProgress
|
|
26
|
+
import CircularProgress from '@mui/material/CircularProgress';
|
|
27
27
|
import Select from '@mui/material/Select';
|
|
28
|
-
import {
|
|
29
|
-
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';
|
|
30
31
|
import Countdown$1 from 'react-countdown';
|
|
31
32
|
import _isNumber from 'lodash-es/isNumber';
|
|
32
33
|
import SVG from 'react-inlinesvg';
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import LocalizationProvider from '@mui/lab/LocalizationProvider';
|
|
34
|
+
import _flatMapDeep from 'lodash-es/flatMapDeep';
|
|
35
|
+
import _isArray from 'lodash-es/isArray';
|
|
36
36
|
import Container from '@mui/material/Container';
|
|
37
37
|
import Alert$1 from '@mui/material/Alert';
|
|
38
38
|
import { useStripe, useElements, CardNumberElement, CardExpiryElement, CardCvcElement, Elements } from '@stripe/react-stripe-js';
|
|
39
39
|
import { loadStripe } from '@stripe/stripe-js';
|
|
40
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';
|
|
41
|
-
import
|
|
41
|
+
import { ThemeProvider as ThemeProvider$1 } from '@mui/private-theming';
|
|
42
|
+
import jwt_decode from 'jwt-decode';
|
|
42
43
|
import _find from 'lodash-es/find';
|
|
44
|
+
import _some from 'lodash-es/some';
|
|
43
45
|
import Button$1 from 'react-bootstrap/Button';
|
|
44
|
-
import
|
|
46
|
+
import moment from 'moment-timezone';
|
|
45
47
|
import _sortBy from 'lodash-es/sortBy';
|
|
46
48
|
import FormControl$1 from '@mui/material/FormControl';
|
|
47
49
|
import MenuItem from '@mui/material/MenuItem';
|
|
48
|
-
import moment from 'moment-timezone';
|
|
49
|
-
import { ThemeProvider as ThemeProvider$1 } from '@mui/private-theming';
|
|
50
50
|
import Autocomplete from '@mui/material/Autocomplete';
|
|
51
51
|
import Paper from '@mui/material/Paper';
|
|
52
52
|
import Table from '@mui/material/Table';
|
|
@@ -904,32 +904,6 @@ try {
|
|
|
904
904
|
}
|
|
905
905
|
});
|
|
906
906
|
|
|
907
|
-
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,}))$/;
|
|
908
|
-
var combineValidators = function combineValidators() {
|
|
909
|
-
for (var _len = arguments.length, validators = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
910
|
-
validators[_key] = arguments[_key];
|
|
911
|
-
}
|
|
912
|
-
|
|
913
|
-
return function () {
|
|
914
|
-
for (var i = 0; i < validators.length; ++i) {
|
|
915
|
-
var error_message = validators[i].apply(validators, arguments);
|
|
916
|
-
if (error_message) return error_message;
|
|
917
|
-
}
|
|
918
|
-
};
|
|
919
|
-
};
|
|
920
|
-
var requiredValidator = function requiredValidator(value, message) {
|
|
921
|
-
var errorMessage = '';
|
|
922
|
-
|
|
923
|
-
if (!value) {
|
|
924
|
-
errorMessage = message || 'Required';
|
|
925
|
-
}
|
|
926
|
-
|
|
927
|
-
return errorMessage;
|
|
928
|
-
};
|
|
929
|
-
var emailValidator = function emailValidator(email) {
|
|
930
|
-
return !emailRegex.test(email) ? 'Please enter a valid email address' : '';
|
|
931
|
-
};
|
|
932
|
-
|
|
933
907
|
var CONFIGS = {};
|
|
934
908
|
var setConfigs = function setConfigs(configs) {
|
|
935
909
|
_forEach(configs, function (value, key) {
|
|
@@ -1332,15 +1306,16 @@ var handleSetAccessToken = function handleSetAccessToken(token) {
|
|
|
1332
1306
|
}
|
|
1333
1307
|
};
|
|
1334
1308
|
function getEvent(id) {
|
|
1335
|
-
var referralValue =
|
|
1309
|
+
var referralValue = '';
|
|
1336
1310
|
|
|
1337
1311
|
if (isWindowDefined) {
|
|
1338
1312
|
var params = new URL("" + window.location);
|
|
1339
1313
|
var referralId = params.searchParams.get('ttf_r') || '';
|
|
1340
1314
|
var referral_key = window.localStorage.getItem('referral_key');
|
|
1341
|
-
var referralIdlocal =
|
|
1315
|
+
var referralIdlocal = '';
|
|
1342
1316
|
|
|
1343
1317
|
if (referral_key) {
|
|
1318
|
+
// eslint-disable-next-line prefer-destructuring
|
|
1344
1319
|
referralIdlocal = referral_key.split('.')[1];
|
|
1345
1320
|
}
|
|
1346
1321
|
|
|
@@ -1349,8 +1324,8 @@ function getEvent(id) {
|
|
|
1349
1324
|
|
|
1350
1325
|
var response = publicRequest.get("v1/event/" + id, {
|
|
1351
1326
|
headers: _extends({}, ttfHeaders, {
|
|
1352
|
-
|
|
1353
|
-
|
|
1327
|
+
'Referer-Url': isDocumentDefined ? document.referrer : '',
|
|
1328
|
+
'Referrer-Id': isWindowDefined ? referralValue : ''
|
|
1354
1329
|
})
|
|
1355
1330
|
})["catch"](function (error) {
|
|
1356
1331
|
throw error;
|
|
@@ -1370,9 +1345,10 @@ function getTickets(id, promoCode) {
|
|
|
1370
1345
|
}
|
|
1371
1346
|
var addToCart = function addToCart(id, data) {
|
|
1372
1347
|
var res = publicRequest.post("v1/event/" + id + "/add-to-cart/", {
|
|
1373
|
-
data: data
|
|
1348
|
+
data: data
|
|
1349
|
+
}, {
|
|
1374
1350
|
headers: {
|
|
1375
|
-
|
|
1351
|
+
'Referer-Url': isDocumentDefined ? document.referrer : ''
|
|
1376
1352
|
}
|
|
1377
1353
|
});
|
|
1378
1354
|
return res;
|
|
@@ -1400,7 +1376,7 @@ var register = function register(data) {
|
|
|
1400
1376
|
var getPaymentData = function getPaymentData(hash) {
|
|
1401
1377
|
var response = publicRequest.get("v1/order/" + hash + "/review/", {
|
|
1402
1378
|
headers: {
|
|
1403
|
-
|
|
1379
|
+
'Referer-Url': isDocumentDefined ? document.referrer : ''
|
|
1404
1380
|
}
|
|
1405
1381
|
})["catch"](function (error) {
|
|
1406
1382
|
throw error;
|
|
@@ -1408,9 +1384,9 @@ var getPaymentData = function getPaymentData(hash) {
|
|
|
1408
1384
|
return response;
|
|
1409
1385
|
};
|
|
1410
1386
|
var handlePaymentSuccess = function handlePaymentSuccess(orderHash) {
|
|
1411
|
-
var res = publicRequest.post("v1/order/" + orderHash + "/success", {
|
|
1387
|
+
var res = publicRequest.post("v1/order/" + orderHash + "/success", undefined, {
|
|
1412
1388
|
headers: {
|
|
1413
|
-
|
|
1389
|
+
'Referer-Url': isDocumentDefined ? document.referrer : ''
|
|
1414
1390
|
}
|
|
1415
1391
|
})["catch"](function (error) {
|
|
1416
1392
|
throw error;
|
|
@@ -1418,9 +1394,9 @@ var handlePaymentSuccess = function handlePaymentSuccess(orderHash) {
|
|
|
1418
1394
|
return res;
|
|
1419
1395
|
};
|
|
1420
1396
|
var handleFreeSuccess = function handleFreeSuccess(orderHash) {
|
|
1421
|
-
var res = publicRequest.post("v1/order/" + orderHash + "/complete_free_registration", {
|
|
1397
|
+
var res = publicRequest.post("v1/order/" + orderHash + "/complete_free_registration", undefined, {
|
|
1422
1398
|
headers: {
|
|
1423
|
-
|
|
1399
|
+
'Referer-Url': isDocumentDefined ? document.referrer : ''
|
|
1424
1400
|
}
|
|
1425
1401
|
})["catch"](function (error) {
|
|
1426
1402
|
throw error;
|
|
@@ -1517,217 +1493,347 @@ var validatePhoneNumber = /*#__PURE__*/function () {
|
|
|
1517
1493
|
};
|
|
1518
1494
|
}();
|
|
1519
1495
|
|
|
1520
|
-
var
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
return {
|
|
1532
|
-
id: data.id,
|
|
1533
|
-
first_name: data.firstName,
|
|
1534
|
-
last_name: data.lastName,
|
|
1535
|
-
email: data.email,
|
|
1536
|
-
confirmEmail: data.email,
|
|
1537
|
-
city: (data == null ? void 0 : data.city) || '',
|
|
1538
|
-
country: (data == null ? void 0 : data.countryId) || (data == null ? void 0 : data.country) || '',
|
|
1539
|
-
phone: (data == null ? void 0 : data.phone) || '',
|
|
1540
|
-
street_address: (data == null ? void 0 : data.streetAddress) || '',
|
|
1541
|
-
state: (data == null ? void 0 : data.stateId) || '',
|
|
1542
|
-
zip: (data == null ? void 0 : data.zip) || (data == null ? void 0 : data.zipCode) || ''
|
|
1496
|
+
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,}))$/;
|
|
1497
|
+
var combineValidators = function combineValidators() {
|
|
1498
|
+
for (var _len = arguments.length, validators = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1499
|
+
validators[_key] = arguments[_key];
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
return function () {
|
|
1503
|
+
for (var i = 0; i < validators.length; ++i) {
|
|
1504
|
+
var error_message = validators[i].apply(validators, arguments);
|
|
1505
|
+
if (error_message) return error_message;
|
|
1506
|
+
}
|
|
1543
1507
|
};
|
|
1544
1508
|
};
|
|
1545
|
-
var
|
|
1546
|
-
var
|
|
1547
|
-
onLogin = _ref.onLogin,
|
|
1548
|
-
_ref$alreadyHasUser = _ref.alreadyHasUser,
|
|
1549
|
-
alreadyHasUser = _ref$alreadyHasUser === void 0 ? false : _ref$alreadyHasUser,
|
|
1550
|
-
_ref$userExpired = _ref.userExpired,
|
|
1551
|
-
userExpired = _ref$userExpired === void 0 ? false : _ref$userExpired,
|
|
1552
|
-
_ref$onGetProfileData = _ref.onGetProfileDataSuccess,
|
|
1553
|
-
onGetProfileDataSuccess = _ref$onGetProfileData === void 0 ? _identity : _ref$onGetProfileData,
|
|
1554
|
-
_ref$onGetProfileData2 = _ref.onGetProfileDataError,
|
|
1555
|
-
onGetProfileDataError = _ref$onGetProfileData2 === void 0 ? _identity : _ref$onGetProfileData2,
|
|
1556
|
-
_ref$onForgotPassword = _ref.onForgotPassword,
|
|
1557
|
-
onForgotPassword = _ref$onForgotPassword === void 0 ? _identity : _ref$onForgotPassword,
|
|
1558
|
-
_ref$onSignup = _ref.onSignup,
|
|
1559
|
-
onSignup = _ref$onSignup === void 0 ? _identity : _ref$onSignup,
|
|
1560
|
-
_ref$modalClassname = _ref.modalClassname,
|
|
1561
|
-
modalClassname = _ref$modalClassname === void 0 ? '' : _ref$modalClassname,
|
|
1562
|
-
logo = _ref.logo,
|
|
1563
|
-
_ref$showForgotPasswo = _ref.showForgotPasswordButton,
|
|
1564
|
-
showForgotPasswordButton = _ref$showForgotPasswo === void 0 ? false : _ref$showForgotPasswo,
|
|
1565
|
-
_ref$showSignUpButton = _ref.showSignUpButton,
|
|
1566
|
-
showSignUpButton = _ref$showSignUpButton === void 0 ? false : _ref$showSignUpButton;
|
|
1567
|
-
|
|
1568
|
-
var _useState = useState(''),
|
|
1569
|
-
error = _useState[0],
|
|
1570
|
-
setError = _useState[1];
|
|
1571
|
-
|
|
1572
|
-
return React.createElement(Modal, {
|
|
1573
|
-
open: true,
|
|
1574
|
-
onClose: onClose,
|
|
1575
|
-
"aria-labelledby": "modal-modal-title",
|
|
1576
|
-
"aria-describedby": "modal-modal-description",
|
|
1577
|
-
className: "login-modal " + modalClassname
|
|
1578
|
-
}, React.createElement(Box, {
|
|
1579
|
-
style: style
|
|
1580
|
-
}, React.createElement("div", null, React.createElement(Formik, {
|
|
1581
|
-
initialValues: {
|
|
1582
|
-
email: '',
|
|
1583
|
-
password: ''
|
|
1584
|
-
},
|
|
1585
|
-
onSubmit: function () {
|
|
1586
|
-
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref2) {
|
|
1587
|
-
var email, password, body, profileResponse, profileSpecifiedData, profileDataObj, event, _e$response, _e$response$data, _error;
|
|
1588
|
-
|
|
1589
|
-
return runtime_1.wrap(function _callee$(_context) {
|
|
1590
|
-
while (1) {
|
|
1591
|
-
switch (_context.prev = _context.next) {
|
|
1592
|
-
case 0:
|
|
1593
|
-
email = _ref2.email, password = _ref2.password;
|
|
1594
|
-
_context.prev = 1;
|
|
1595
|
-
body = {
|
|
1596
|
-
email: email,
|
|
1597
|
-
password: password
|
|
1598
|
-
};
|
|
1599
|
-
_context.next = 5;
|
|
1600
|
-
return authorize(body);
|
|
1601
|
-
|
|
1602
|
-
case 5:
|
|
1603
|
-
profileResponse = null;
|
|
1604
|
-
_context.prev = 6;
|
|
1605
|
-
_context.next = 9;
|
|
1606
|
-
return getProfileData();
|
|
1607
|
-
|
|
1608
|
-
case 9:
|
|
1609
|
-
profileResponse = _context.sent;
|
|
1610
|
-
onGetProfileDataSuccess(profileResponse.data);
|
|
1611
|
-
_context.next = 17;
|
|
1612
|
-
break;
|
|
1613
|
-
|
|
1614
|
-
case 13:
|
|
1615
|
-
_context.prev = 13;
|
|
1616
|
-
_context.t0 = _context["catch"](6);
|
|
1617
|
-
|
|
1618
|
-
if (axios.isAxiosError(_context.t0)) {
|
|
1619
|
-
onGetProfileDataError(_context.t0);
|
|
1620
|
-
}
|
|
1621
|
-
|
|
1622
|
-
return _context.abrupt("return");
|
|
1623
|
-
|
|
1624
|
-
case 17:
|
|
1625
|
-
profileSpecifiedData = _get(profileResponse, 'data.data');
|
|
1626
|
-
profileDataObj = setLoggedUserData(profileSpecifiedData);
|
|
1627
|
-
|
|
1628
|
-
if (typeof window !== 'undefined') {
|
|
1629
|
-
window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
|
|
1630
|
-
event = new window.CustomEvent('tf-login');
|
|
1631
|
-
window.document.dispatchEvent(event);
|
|
1632
|
-
}
|
|
1509
|
+
var requiredValidator = function requiredValidator(value, message) {
|
|
1510
|
+
var errorMessage = '';
|
|
1633
1511
|
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1512
|
+
if (!value) {
|
|
1513
|
+
errorMessage = message || 'Required';
|
|
1514
|
+
}
|
|
1637
1515
|
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1516
|
+
return errorMessage;
|
|
1517
|
+
};
|
|
1518
|
+
var emailValidator = function emailValidator(email) {
|
|
1519
|
+
return !emailRegex.test(email) ? 'Please enter a valid email address' : '';
|
|
1520
|
+
};
|
|
1641
1521
|
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1522
|
+
var CustomField = function CustomField(_ref) {
|
|
1523
|
+
var label = _ref.label,
|
|
1524
|
+
_ref$type = _ref.type,
|
|
1525
|
+
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
1526
|
+
field = _ref.field,
|
|
1527
|
+
_ref$selectOptions = _ref.selectOptions,
|
|
1528
|
+
selectOptions = _ref$selectOptions === void 0 ? [] : _ref$selectOptions,
|
|
1529
|
+
_ref$form = _ref.form,
|
|
1530
|
+
touched = _ref$form.touched,
|
|
1531
|
+
errors = _ref$form.errors,
|
|
1532
|
+
submitCount = _ref$form.submitCount,
|
|
1533
|
+
theme = _ref.theme,
|
|
1534
|
+
_ref$inputProps = _ref.inputProps,
|
|
1535
|
+
pInputProps = _ref$inputProps === void 0 ? {} : _ref$inputProps,
|
|
1536
|
+
_ref$InputProps = _ref.InputProps,
|
|
1537
|
+
InputProps = _ref$InputProps === void 0 ? {} : _ref$InputProps,
|
|
1538
|
+
inputRef = _ref.inputRef;
|
|
1539
|
+
var isSelectField = type === 'select';
|
|
1648
1540
|
|
|
1649
|
-
|
|
1650
|
-
case "end":
|
|
1651
|
-
return _context.stop();
|
|
1652
|
-
}
|
|
1653
|
-
}
|
|
1654
|
-
}, _callee, null, [[1, 23], [6, 13]]);
|
|
1655
|
-
}));
|
|
1541
|
+
var error = _get(errors, field.name);
|
|
1656
1542
|
|
|
1657
|
-
|
|
1658
|
-
|
|
1543
|
+
var isTouched = Boolean(_get(touched, field.name)) || _includes(field.name, 'holder') && !!error && !!submitCount;
|
|
1544
|
+
var customTheme = useTheme();
|
|
1545
|
+
var inputProps = {
|
|
1546
|
+
sx: customTheme == null ? void 0 : customTheme.input
|
|
1547
|
+
};
|
|
1548
|
+
return React.createElement(TextField, Object.assign({
|
|
1549
|
+
id: field.name,
|
|
1550
|
+
label: label,
|
|
1551
|
+
type: type,
|
|
1552
|
+
select: isSelectField,
|
|
1553
|
+
fullWidth: true,
|
|
1554
|
+
error: !!error && isTouched,
|
|
1555
|
+
helperText: isTouched && error,
|
|
1556
|
+
SelectProps: {
|
|
1557
|
+
"native": true,
|
|
1558
|
+
className: theme,
|
|
1559
|
+
MenuProps: {
|
|
1560
|
+
className: theme
|
|
1659
1561
|
}
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
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
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
},
|
|
1727
|
-
|
|
1562
|
+
},
|
|
1563
|
+
InputLabelProps: {
|
|
1564
|
+
sx: customTheme == null ? void 0 : customTheme.input
|
|
1565
|
+
},
|
|
1566
|
+
InputProps: InputProps,
|
|
1567
|
+
inputProps: _extends({}, inputProps, pInputProps),
|
|
1568
|
+
inputRef: inputRef
|
|
1569
|
+
}, field), isSelectField ? _map(selectOptions, function (option) {
|
|
1570
|
+
return React.createElement("option", {
|
|
1571
|
+
key: option.value,
|
|
1572
|
+
value: option.value,
|
|
1573
|
+
disabled: option.disabled
|
|
1574
|
+
}, option.label);
|
|
1575
|
+
}) : null);
|
|
1576
|
+
};
|
|
1577
|
+
|
|
1578
|
+
var DATE_SIZE = 32;
|
|
1579
|
+
var compactStyles = {
|
|
1580
|
+
'& > div': {
|
|
1581
|
+
minWidth: 256
|
|
1582
|
+
},
|
|
1583
|
+
'& > div > div, & > div > div > div, & .MuiCalendarPicker-root': {
|
|
1584
|
+
width: 256
|
|
1585
|
+
},
|
|
1586
|
+
'& .MuiTypography-caption': {
|
|
1587
|
+
width: DATE_SIZE,
|
|
1588
|
+
margin: 0
|
|
1589
|
+
},
|
|
1590
|
+
'& .PrivatePickersSlideTransition-root': {
|
|
1591
|
+
minHeight: DATE_SIZE * 6
|
|
1592
|
+
},
|
|
1593
|
+
'& .PrivatePickersSlideTransition-root [role="row"]': {
|
|
1594
|
+
margin: 0
|
|
1595
|
+
},
|
|
1596
|
+
'& .MuiPickersDay-dayWithMargin': {
|
|
1597
|
+
margin: 0
|
|
1598
|
+
},
|
|
1599
|
+
'& .MuiPickersDay-root': {
|
|
1600
|
+
width: DATE_SIZE,
|
|
1601
|
+
height: DATE_SIZE
|
|
1602
|
+
}
|
|
1603
|
+
};
|
|
1604
|
+
var compactStyleTheme = /*#__PURE__*/createTheme({
|
|
1605
|
+
components: {
|
|
1606
|
+
MuiPaper: {
|
|
1607
|
+
defaultProps: {
|
|
1608
|
+
sx: compactStyles
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1612
|
+
});
|
|
1613
|
+
var DatePickerField = function DatePickerField(_ref) {
|
|
1614
|
+
var label = _ref.label,
|
|
1615
|
+
field = _ref.field,
|
|
1616
|
+
form = _ref.form,
|
|
1617
|
+
theme = _ref.theme,
|
|
1618
|
+
_ref$useCompact = _ref.useCompact,
|
|
1619
|
+
useCompact = _ref$useCompact === void 0 ? true : _ref$useCompact;
|
|
1620
|
+
return React.createElement(ThemeProvider, {
|
|
1621
|
+
theme: useCompact ? compactStyleTheme : {}
|
|
1622
|
+
}, React.createElement(LocalizationProvider, {
|
|
1623
|
+
dateAdapter: AdapterMoment
|
|
1624
|
+
}, React.createElement(DatePicker, {
|
|
1625
|
+
value: field.value || '',
|
|
1626
|
+
onChange: function onChange(value) {
|
|
1627
|
+
return form.setFieldValue(field.name, value);
|
|
1628
|
+
},
|
|
1629
|
+
PopperProps: {
|
|
1630
|
+
placement: 'bottom-start'
|
|
1631
|
+
},
|
|
1632
|
+
showDaysOutsideCurrentMonth: true,
|
|
1633
|
+
disableFuture: true,
|
|
1634
|
+
inputFormat: "DD/MM/YYYY",
|
|
1635
|
+
mask: "__/__/____",
|
|
1636
|
+
renderInput: function renderInput(params) {
|
|
1637
|
+
return React.createElement(CustomField, Object.assign({}, params, {
|
|
1638
|
+
inputProps: _extends({}, params.inputProps, {
|
|
1639
|
+
placeholder: 'dd/mm/yyyy'
|
|
1640
|
+
}),
|
|
1641
|
+
theme: theme,
|
|
1642
|
+
field: field,
|
|
1643
|
+
form: form,
|
|
1644
|
+
label: label,
|
|
1645
|
+
type: "tel"
|
|
1646
|
+
}));
|
|
1647
|
+
}
|
|
1648
|
+
})));
|
|
1649
|
+
};
|
|
1650
|
+
|
|
1651
|
+
var _excluded = ["label", "field", "selectOptions", "theme", "setFieldValue", "disableDropdown"];
|
|
1652
|
+
var CheckboxField = function CheckboxField(_ref) {
|
|
1653
|
+
var _rest$form, _field$name, _rest$form2, _field$name2;
|
|
1654
|
+
|
|
1655
|
+
var label = _ref.label,
|
|
1656
|
+
field = _ref.field,
|
|
1657
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
1658
|
+
|
|
1659
|
+
var customTheme = useTheme();
|
|
1660
|
+
return React.createElement(FormControl, {
|
|
1661
|
+
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 : ""])
|
|
1662
|
+
}, React.createElement(FormGroup, null, React.createElement(FormControlLabel, {
|
|
1663
|
+
control: React.createElement(Checkbox, Object.assign({}, field, rest)),
|
|
1664
|
+
label: label,
|
|
1665
|
+
componentsProps: {
|
|
1666
|
+
typography: customTheme == null ? void 0 : customTheme.checkbox
|
|
1667
|
+
}
|
|
1668
|
+
})), !!(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);
|
|
1669
|
+
};
|
|
1670
|
+
|
|
1671
|
+
var currencyNormalizerCreator = function currencyNormalizerCreator(value, currency) {
|
|
1672
|
+
return !value ? '' : "" + getCurrencySymbolByCurrency(currency) + value;
|
|
1673
|
+
};
|
|
1674
|
+
var createFixedFloatNormalizer = function createFixedFloatNormalizer(fixedValue) {
|
|
1675
|
+
return function (value) {
|
|
1676
|
+
return value || "" + value === '0' ? (+value).toFixed(fixedValue) : '';
|
|
1677
|
+
};
|
|
1678
|
+
};
|
|
1679
|
+
var getCurrencySymbolByCurrency = function getCurrencySymbolByCurrency(currency) {
|
|
1680
|
+
if (currency === void 0) {
|
|
1681
|
+
currency = '';
|
|
1682
|
+
}
|
|
1683
|
+
|
|
1684
|
+
switch (currency) {
|
|
1685
|
+
case 'GBP':
|
|
1686
|
+
return '£';
|
|
1687
|
+
|
|
1688
|
+
case 'EUR':
|
|
1689
|
+
return '€';
|
|
1690
|
+
|
|
1691
|
+
case 'INR':
|
|
1692
|
+
return '₹';
|
|
1693
|
+
|
|
1694
|
+
case 'JMD':
|
|
1695
|
+
return 'J$';
|
|
1696
|
+
|
|
1697
|
+
case 'NZD':
|
|
1698
|
+
return 'NZ$';
|
|
1699
|
+
|
|
1700
|
+
case 'MYR':
|
|
1701
|
+
return 'RM';
|
|
1702
|
+
|
|
1703
|
+
case 'MXN':
|
|
1704
|
+
return 'Mex$';
|
|
1705
|
+
|
|
1706
|
+
case 'SGD':
|
|
1707
|
+
return 'S$';
|
|
1708
|
+
|
|
1709
|
+
case 'AUD':
|
|
1710
|
+
return 'A$';
|
|
1711
|
+
|
|
1712
|
+
case 'ZAR':
|
|
1713
|
+
return 'R';
|
|
1714
|
+
|
|
1715
|
+
case 'ke':
|
|
1716
|
+
return 'Ksh';
|
|
1717
|
+
|
|
1718
|
+
case 'TRY':
|
|
1719
|
+
return '₺';
|
|
1720
|
+
|
|
1721
|
+
case 'CAD':
|
|
1722
|
+
return 'CA$';
|
|
1723
|
+
|
|
1724
|
+
case 'THB':
|
|
1725
|
+
return '฿';
|
|
1726
|
+
|
|
1727
|
+
case 'ISK':
|
|
1728
|
+
return 'Kr';
|
|
1729
|
+
|
|
1730
|
+
case 'SEK':
|
|
1731
|
+
return 'kr';
|
|
1732
|
+
|
|
1733
|
+
default:
|
|
1734
|
+
return 'US$';
|
|
1735
|
+
}
|
|
1736
|
+
};
|
|
1737
|
+
var removePlusSign = function removePlusSign(string) {
|
|
1738
|
+
if (string === void 0) {
|
|
1739
|
+
string = '';
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
return string.replace('+', '');
|
|
1743
|
+
};
|
|
1744
|
+
|
|
1745
|
+
var PhoneNumberField = function PhoneNumberField(_ref) {
|
|
1746
|
+
var label = _ref.label,
|
|
1747
|
+
field = _ref.field,
|
|
1748
|
+
_ref$form = _ref.form,
|
|
1749
|
+
errors = _ref$form.errors,
|
|
1750
|
+
touched = _ref$form.touched,
|
|
1751
|
+
setFieldError = _ref$form.setFieldError,
|
|
1752
|
+
setStatus = _ref$form.setStatus,
|
|
1753
|
+
initialValues = _ref$form.initialValues,
|
|
1754
|
+
setFieldValue = _ref$form.setFieldValue,
|
|
1755
|
+
_ref$disableDropdown = _ref.disableDropdown,
|
|
1756
|
+
disableDropdown = _ref$disableDropdown === void 0 ? true : _ref$disableDropdown;
|
|
1757
|
+
|
|
1758
|
+
var error = _get(errors, field.name);
|
|
1759
|
+
|
|
1760
|
+
var isTouched = Boolean(_get(touched, field.name)); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1761
|
+
|
|
1762
|
+
var debounceCb = useCallback(_debounce(function (cb) {
|
|
1763
|
+
return void cb();
|
|
1764
|
+
}, 1000), []);
|
|
1765
|
+
useEffect(function () {
|
|
1766
|
+
if (field.value) {
|
|
1767
|
+
var _setStatus;
|
|
1768
|
+
|
|
1769
|
+
setStatus((_setStatus = {}, _setStatus[field.name] = true, _setStatus));
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1772
|
+
debounceCb( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
1773
|
+
var message, _setStatus2;
|
|
1774
|
+
|
|
1775
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
1776
|
+
while (1) {
|
|
1777
|
+
switch (_context.prev = _context.next) {
|
|
1778
|
+
case 0:
|
|
1779
|
+
_context.prev = 0;
|
|
1780
|
+
|
|
1781
|
+
if (!field.value) {
|
|
1782
|
+
_context.next = 4;
|
|
1783
|
+
break;
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
_context.next = 4;
|
|
1787
|
+
return validatePhoneNumber(field.value);
|
|
1788
|
+
|
|
1789
|
+
case 4:
|
|
1790
|
+
setFieldError(field.name, '');
|
|
1791
|
+
_context.next = 11;
|
|
1792
|
+
break;
|
|
1793
|
+
|
|
1794
|
+
case 7:
|
|
1795
|
+
_context.prev = 7;
|
|
1796
|
+
_context.t0 = _context["catch"](0);
|
|
1797
|
+
message = _get(_context.t0, 'response.data.message', 'Invalid phone number');
|
|
1798
|
+
setFieldError(field.name, message);
|
|
1799
|
+
|
|
1800
|
+
case 11:
|
|
1801
|
+
_context.prev = 11;
|
|
1802
|
+
setStatus((_setStatus2 = {}, _setStatus2[field.name] = false, _setStatus2));
|
|
1803
|
+
return _context.finish(11);
|
|
1804
|
+
|
|
1805
|
+
case 14:
|
|
1806
|
+
case "end":
|
|
1807
|
+
return _context.stop();
|
|
1808
|
+
}
|
|
1809
|
+
}
|
|
1810
|
+
}, _callee, null, [[0, 7, 11, 14]]);
|
|
1811
|
+
}))); // eslint-disable-next-line
|
|
1812
|
+
}, [field.value]);
|
|
1813
|
+
return React.createElement(MuiPhoneNumber, {
|
|
1814
|
+
name: field.name,
|
|
1815
|
+
value: initialValues.phone,
|
|
1816
|
+
onChange: function onChange(e) {
|
|
1817
|
+
return setFieldValue(field.name, removePlusSign(e));
|
|
1818
|
+
},
|
|
1819
|
+
variant: "outlined",
|
|
1820
|
+
defaultCountry: 'us',
|
|
1821
|
+
disableDropdown: disableDropdown,
|
|
1822
|
+
label: label,
|
|
1823
|
+
error: !!error && isTouched,
|
|
1824
|
+
helperText: isTouched && error,
|
|
1825
|
+
fullWidth: true,
|
|
1826
|
+
autoFormat: false
|
|
1827
|
+
});
|
|
1728
1828
|
};
|
|
1729
1829
|
|
|
1730
|
-
|
|
1830
|
+
function Loader() {
|
|
1831
|
+
return React.createElement("div", {
|
|
1832
|
+
className: "loader-container"
|
|
1833
|
+
}, React.createElement(CircularProgress, null));
|
|
1834
|
+
}
|
|
1835
|
+
|
|
1836
|
+
var SelectField = function SelectField(_ref) {
|
|
1731
1837
|
var label = _ref.label,
|
|
1732
1838
|
_ref$type = _ref.type,
|
|
1733
1839
|
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
@@ -1737,228 +1843,83 @@ var CustomField = function CustomField(_ref) {
|
|
|
1737
1843
|
_ref$form = _ref.form,
|
|
1738
1844
|
touched = _ref$form.touched,
|
|
1739
1845
|
errors = _ref$form.errors,
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
_ref$inputProps = _ref.inputProps,
|
|
1743
|
-
pInputProps = _ref$inputProps === void 0 ? {} : _ref$inputProps,
|
|
1744
|
-
_ref$InputProps = _ref.InputProps,
|
|
1745
|
-
InputProps = _ref$InputProps === void 0 ? {} : _ref$InputProps,
|
|
1746
|
-
inputRef = _ref.inputRef;
|
|
1747
|
-
var isSelectField = type === 'select';
|
|
1846
|
+
theme = _ref.theme;
|
|
1847
|
+
var isTouched = Boolean(_get(touched, field.name));
|
|
1748
1848
|
|
|
1749
1849
|
var error = _get(errors, field.name);
|
|
1750
1850
|
|
|
1751
|
-
var isTouched = Boolean(_get(touched, field.name)) || _includes(field.name, 'holder') && !!error && !!submitCount;
|
|
1752
1851
|
var customTheme = useTheme();
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
}
|
|
1756
|
-
|
|
1852
|
+
return React.createElement(FormControl, {
|
|
1853
|
+
fullWidth: true
|
|
1854
|
+
}, React.createElement(InputLabel, {
|
|
1855
|
+
style: customTheme == null ? void 0 : customTheme.input,
|
|
1856
|
+
htmlFor: field.name,
|
|
1857
|
+
error: !!error && isTouched,
|
|
1858
|
+
shrink: true
|
|
1859
|
+
}, label), React.createElement(Select, Object.assign({
|
|
1757
1860
|
id: field.name,
|
|
1758
1861
|
label: label,
|
|
1759
1862
|
type: type,
|
|
1760
|
-
select: isSelectField,
|
|
1761
1863
|
fullWidth: true,
|
|
1762
1864
|
error: !!error && isTouched,
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
"native": true,
|
|
1766
|
-
className: theme,
|
|
1767
|
-
MenuProps: {
|
|
1768
|
-
className: theme
|
|
1769
|
-
}
|
|
1770
|
-
},
|
|
1771
|
-
InputLabelProps: {
|
|
1772
|
-
sx: customTheme == null ? void 0 : customTheme.input
|
|
1865
|
+
inputProps: {
|
|
1866
|
+
id: field.name
|
|
1773
1867
|
},
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1868
|
+
"native": true,
|
|
1869
|
+
className: theme,
|
|
1870
|
+
MenuProps: {
|
|
1871
|
+
className: theme
|
|
1872
|
+
}
|
|
1873
|
+
}, field, {
|
|
1874
|
+
style: customTheme == null ? void 0 : customTheme.input
|
|
1875
|
+
}), _map(selectOptions, function (option) {
|
|
1778
1876
|
return React.createElement("option", {
|
|
1779
1877
|
key: option.value,
|
|
1780
1878
|
value: option.value,
|
|
1781
1879
|
disabled: option.disabled
|
|
1782
1880
|
}, option.label);
|
|
1783
|
-
})
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
var style$1 = {
|
|
1787
|
-
position: 'absolute',
|
|
1788
|
-
top: '50%',
|
|
1789
|
-
left: '50%',
|
|
1790
|
-
transform: 'translate(-50%, -50%)',
|
|
1791
|
-
minWidth: 480,
|
|
1792
|
-
backgroundColor: '#fff',
|
|
1793
|
-
border: '1px solid white',
|
|
1794
|
-
outline: 'none',
|
|
1795
|
-
padding: '14px'
|
|
1881
|
+
})), isTouched && error ? React.createElement(FormHelperText, {
|
|
1882
|
+
error: !!error && isTouched
|
|
1883
|
+
}, error) : null);
|
|
1796
1884
|
};
|
|
1797
|
-
var SignupSchema = /*#__PURE__*/object().shape({
|
|
1798
|
-
firstName: /*#__PURE__*/string().required('Required'),
|
|
1799
|
-
lastName: /*#__PURE__*/string().required('Required'),
|
|
1800
|
-
email: /*#__PURE__*/string().email('Invalid email').required('Required'),
|
|
1801
|
-
password: /*#__PURE__*/string().min(6, 'Password must have 5+ characters').required('Required'),
|
|
1802
|
-
confirmPassword: /*#__PURE__*/string().required('Required').oneOf([/*#__PURE__*/ref('password'), null], 'Passwords must match')
|
|
1803
|
-
});
|
|
1804
|
-
var SignupModal = function SignupModal(_ref) {
|
|
1805
|
-
var _ref$onClose = _ref.onClose,
|
|
1806
|
-
onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
|
|
1807
|
-
_ref$onLogin = _ref.onLogin,
|
|
1808
|
-
onLogin = _ref$onLogin === void 0 ? function () {} : _ref$onLogin,
|
|
1809
|
-
_ref$onRegisterSucces = _ref.onRegisterSuccess,
|
|
1810
|
-
onRegisterSuccess = _ref$onRegisterSucces === void 0 ? function () {} : _ref$onRegisterSucces,
|
|
1811
|
-
_ref$onRegisterError = _ref.onRegisterError,
|
|
1812
|
-
onRegisterError = _ref$onRegisterError === void 0 ? function () {} : _ref$onRegisterError;
|
|
1813
|
-
|
|
1814
|
-
var _useState = useState(false),
|
|
1815
|
-
loading = _useState[0],
|
|
1816
|
-
setLoading = _useState[1];
|
|
1817
|
-
|
|
1818
|
-
var onSignup = /*#__PURE__*/function () {
|
|
1819
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(values) {
|
|
1820
|
-
var formData, res, access_token_register, refreshToken, tokens;
|
|
1821
|
-
return runtime_1.wrap(function _callee$(_context) {
|
|
1822
|
-
while (1) {
|
|
1823
|
-
switch (_context.prev = _context.next) {
|
|
1824
|
-
case 0:
|
|
1825
|
-
_context.prev = 0;
|
|
1826
|
-
setLoading(true);
|
|
1827
|
-
formData = new FormData();
|
|
1828
|
-
formData.set('first_name', values.firstName);
|
|
1829
|
-
formData.set('last_name', values.lastName);
|
|
1830
|
-
formData.set('email', values.email);
|
|
1831
|
-
formData.set('password', values.password);
|
|
1832
|
-
formData.set('password_confirmation', values.confirmPassword);
|
|
1833
|
-
formData.append('client_id', CONFIGS.CLIENT_ID || 'e9d8f8922797b4621e562255afe90dbf');
|
|
1834
|
-
formData.append('client_secret', CONFIGS.CLIENT_SECRET || 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9');
|
|
1835
|
-
_context.next = 12;
|
|
1836
|
-
return register(formData);
|
|
1837
|
-
|
|
1838
|
-
case 12:
|
|
1839
|
-
res = _context.sent;
|
|
1840
|
-
access_token_register = _get(res, 'data.data.attributes.access_token');
|
|
1841
|
-
refreshToken = _get(res, 'data.data.attributes.refresh_token');
|
|
1842
|
-
handleSetAccessToken(access_token_register);
|
|
1843
|
-
tokens = {
|
|
1844
|
-
accessToken: access_token_register,
|
|
1845
|
-
refreshToken: refreshToken
|
|
1846
|
-
};
|
|
1847
|
-
onRegisterSuccess(tokens);
|
|
1848
|
-
onClose();
|
|
1849
|
-
_context.next = 24;
|
|
1850
|
-
break;
|
|
1851
|
-
|
|
1852
|
-
case 21:
|
|
1853
|
-
_context.prev = 21;
|
|
1854
|
-
_context.t0 = _context["catch"](0);
|
|
1855
|
-
|
|
1856
|
-
if (axios.isAxiosError(_context.t0)) {
|
|
1857
|
-
onRegisterError(_context.t0, values.email);
|
|
1858
|
-
}
|
|
1859
|
-
|
|
1860
|
-
case 24:
|
|
1861
|
-
_context.prev = 24;
|
|
1862
|
-
setLoading(false);
|
|
1863
|
-
return _context.finish(24);
|
|
1864
|
-
|
|
1865
|
-
case 27:
|
|
1866
|
-
case "end":
|
|
1867
|
-
return _context.stop();
|
|
1868
|
-
}
|
|
1869
|
-
}
|
|
1870
|
-
}, _callee, null, [[0, 21, 24, 27]]);
|
|
1871
|
-
}));
|
|
1872
|
-
|
|
1873
|
-
return function onSignup(_x) {
|
|
1874
|
-
return _ref2.apply(this, arguments);
|
|
1875
|
-
};
|
|
1876
|
-
}();
|
|
1877
1885
|
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1886
|
+
var SnackbarAlert = function SnackbarAlert(_ref) {
|
|
1887
|
+
var isOpen = _ref.isOpen,
|
|
1888
|
+
message = _ref.message,
|
|
1889
|
+
type = _ref.type,
|
|
1890
|
+
position = _ref.position,
|
|
1891
|
+
_ref$autoHideDuration = _ref.autoHideDuration,
|
|
1892
|
+
autoHideDuration = _ref$autoHideDuration === void 0 ? 3000 : _ref$autoHideDuration,
|
|
1893
|
+
variant = _ref.variant,
|
|
1894
|
+
onClose = _ref.onClose;
|
|
1895
|
+
return React.createElement("div", {
|
|
1896
|
+
className: "snackbar-alert-container"
|
|
1897
|
+
}, React.createElement(Snackbar, {
|
|
1898
|
+
autoHideDuration: autoHideDuration,
|
|
1899
|
+
open: isOpen,
|
|
1900
|
+
anchorOrigin: position || {
|
|
1901
|
+
vertical: 'top',
|
|
1902
|
+
horizontal: 'center'
|
|
1895
1903
|
},
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
}
|
|
1911
|
-
|
|
1912
|
-
}, React.createElement(Field, {
|
|
1913
|
-
name: "firstName",
|
|
1914
|
-
label: "First Name",
|
|
1915
|
-
component: CustomField
|
|
1916
|
-
})), React.createElement("div", {
|
|
1917
|
-
className: "is-half"
|
|
1918
|
-
}, React.createElement(Field, {
|
|
1919
|
-
name: "lastName",
|
|
1920
|
-
label: "Last Name",
|
|
1921
|
-
component: CustomField
|
|
1922
|
-
}))), React.createElement("div", {
|
|
1923
|
-
className: "signup-container__singleField"
|
|
1924
|
-
}, React.createElement("div", {
|
|
1925
|
-
className: ""
|
|
1926
|
-
}, React.createElement(Field, {
|
|
1927
|
-
name: "email",
|
|
1928
|
-
label: "Email",
|
|
1929
|
-
component: CustomField
|
|
1930
|
-
}))), React.createElement("div", {
|
|
1931
|
-
className: "signup-container__twoFields"
|
|
1932
|
-
}, React.createElement("div", {
|
|
1933
|
-
className: "is-half"
|
|
1934
|
-
}, React.createElement(Field, {
|
|
1935
|
-
name: "password",
|
|
1936
|
-
label: "Password",
|
|
1937
|
-
type: "password",
|
|
1938
|
-
component: CustomField
|
|
1939
|
-
})), React.createElement("div", {
|
|
1940
|
-
className: "is-half"
|
|
1941
|
-
}, React.createElement(Field, {
|
|
1942
|
-
name: "confirmPassword",
|
|
1943
|
-
label: "Confirm Password",
|
|
1944
|
-
type: "password",
|
|
1945
|
-
component: CustomField
|
|
1946
|
-
})))), React.createElement("div", {
|
|
1947
|
-
className: "signup-action-button"
|
|
1948
|
-
}, React.createElement("button", {
|
|
1949
|
-
type: "submit",
|
|
1950
|
-
disabled: !(isValid && dirty)
|
|
1951
|
-
}, loading ? React.createElement(CircularProgress, {
|
|
1952
|
-
size: "22px"
|
|
1953
|
-
}) : 'Submit')), React.createElement("div", {
|
|
1954
|
-
className: "login"
|
|
1955
|
-
}, React.createElement("span", {
|
|
1956
|
-
onClick: onLogin
|
|
1957
|
-
}, "Login")));
|
|
1958
|
-
}))));
|
|
1904
|
+
onClose: onClose,
|
|
1905
|
+
classes: {
|
|
1906
|
+
root: 'snackbar-alert-snackbar-root'
|
|
1907
|
+
}
|
|
1908
|
+
}, React.createElement(Alert, {
|
|
1909
|
+
severity: type,
|
|
1910
|
+
onClose: onClose,
|
|
1911
|
+
variant: variant || 'filled',
|
|
1912
|
+
classes: {
|
|
1913
|
+
icon: 'snackbar-alert-icon',
|
|
1914
|
+
root: 'snackbar-alert-alert-root',
|
|
1915
|
+
action: 'snackbar-alert-action',
|
|
1916
|
+
message: 'snackbar-alert-message',
|
|
1917
|
+
filled: 'snackbar-alert-filled'
|
|
1918
|
+
}
|
|
1919
|
+
}, message)));
|
|
1959
1920
|
};
|
|
1960
1921
|
|
|
1961
|
-
var style
|
|
1922
|
+
var style = {
|
|
1962
1923
|
position: 'absolute',
|
|
1963
1924
|
top: '50%',
|
|
1964
1925
|
left: '50%',
|
|
@@ -2002,495 +1963,468 @@ var ForgotPasswordModal = function ForgotPasswordModal(_ref) {
|
|
|
2002
1963
|
|
|
2003
1964
|
case 5:
|
|
2004
1965
|
_yield$forgotPassword = _context.sent;
|
|
2005
|
-
data = _yield$forgotPassword.data;
|
|
2006
|
-
onForgotPasswordSuccess(data);
|
|
2007
|
-
onClose();
|
|
2008
|
-
_context.next = 14;
|
|
2009
|
-
break;
|
|
2010
|
-
|
|
2011
|
-
case 11:
|
|
2012
|
-
_context.prev = 11;
|
|
2013
|
-
_context.t0 = _context["catch"](1);
|
|
2014
|
-
|
|
2015
|
-
if (axios.isAxiosError(_context.t0)) {
|
|
2016
|
-
onForgotPasswordError(_context.t0);
|
|
2017
|
-
}
|
|
2018
|
-
|
|
2019
|
-
case 14:
|
|
2020
|
-
_context.prev = 14;
|
|
2021
|
-
setLoading(false);
|
|
2022
|
-
return _context.finish(14);
|
|
2023
|
-
|
|
2024
|
-
case 17:
|
|
2025
|
-
case "end":
|
|
2026
|
-
return _context.stop();
|
|
2027
|
-
}
|
|
2028
|
-
}
|
|
2029
|
-
}, _callee, null, [[1, 11, 14, 17]]);
|
|
2030
|
-
}));
|
|
2031
|
-
|
|
2032
|
-
return function onForgotPassword(_x) {
|
|
2033
|
-
return _ref3.apply(this, arguments);
|
|
2034
|
-
};
|
|
2035
|
-
}();
|
|
2036
|
-
|
|
2037
|
-
var _onClose = loading ? function () {} : onClose;
|
|
2038
|
-
|
|
2039
|
-
return React.createElement(Modal$1, {
|
|
2040
|
-
open: true,
|
|
2041
|
-
onClose: _onClose,
|
|
2042
|
-
"aria-labelledby": "modal-modal-title",
|
|
2043
|
-
"aria-describedby": "modal-modal-description",
|
|
2044
|
-
className: "forgot-password-modal"
|
|
2045
|
-
}, React.createElement(Box$1, {
|
|
2046
|
-
style: style$2
|
|
2047
|
-
}, React.createElement("div", null, React.createElement(Formik, {
|
|
2048
|
-
initialValues: {
|
|
2049
|
-
email: ''
|
|
2050
|
-
},
|
|
2051
|
-
validationSchema: Schema,
|
|
2052
|
-
onSubmit: onForgotPassword
|
|
2053
|
-
}, function (_ref4) {
|
|
2054
|
-
var isValid = _ref4.isValid,
|
|
2055
|
-
dirty = _ref4.dirty,
|
|
2056
|
-
handleSubmit = _ref4.handleSubmit;
|
|
2057
|
-
return React.createElement(Form, {
|
|
2058
|
-
onSubmit: handleSubmit
|
|
2059
|
-
}, React.createElement("div", {
|
|
2060
|
-
className: "forgot-password-container"
|
|
2061
|
-
}, React.createElement("div", {
|
|
2062
|
-
className: "title"
|
|
2063
|
-
}, "Password Reset"), React.createElement("div", {
|
|
2064
|
-
className: "forgot-password-container__singleField"
|
|
2065
|
-
}, React.createElement(Field, {
|
|
2066
|
-
name: "email",
|
|
2067
|
-
label: "Email",
|
|
2068
|
-
component: CustomField
|
|
2069
|
-
}))), React.createElement("div", {
|
|
2070
|
-
className: "forgot-password-action-button"
|
|
2071
|
-
}, React.createElement("button", {
|
|
2072
|
-
type: "submit",
|
|
2073
|
-
disabled: !(isValid && dirty)
|
|
2074
|
-
}, loading ? React.createElement(CircularProgress, {
|
|
2075
|
-
size: "22px"
|
|
2076
|
-
}) : 'Submit')), React.createElement("div", {
|
|
2077
|
-
className: "login"
|
|
2078
|
-
}, React.createElement("span", {
|
|
2079
|
-
onClick: onLogin
|
|
2080
|
-
}, "Back to Log In")));
|
|
2081
|
-
}))));
|
|
2082
|
-
};
|
|
2083
|
-
|
|
2084
|
-
var _excluded = ["firstName", "lastName", "holderAge", "confirmEmail", "confirmPassword"];
|
|
2085
|
-
var getInitialValues = function getInitialValues(data, propsInitialValues, userValues) {
|
|
2086
|
-
if (data === void 0) {
|
|
2087
|
-
data = [];
|
|
2088
|
-
}
|
|
2089
|
-
|
|
2090
|
-
if (propsInitialValues === void 0) {
|
|
2091
|
-
propsInitialValues = {};
|
|
2092
|
-
}
|
|
2093
|
-
|
|
2094
|
-
if (userValues === void 0) {
|
|
2095
|
-
userValues = {};
|
|
2096
|
-
}
|
|
2097
|
-
|
|
2098
|
-
var results = _flatMapDeep(data, function (_ref) {
|
|
2099
|
-
var fields = _ref.fields;
|
|
2100
|
-
return _map(fields, function (_ref2) {
|
|
2101
|
-
var groupItems = _ref2.groupItems;
|
|
2102
|
-
return _map(groupItems, function (_ref3) {
|
|
2103
|
-
var name = _ref3.name;
|
|
2104
|
-
return name;
|
|
2105
|
-
});
|
|
2106
|
-
});
|
|
2107
|
-
});
|
|
2108
|
-
|
|
2109
|
-
var initialValues = {};
|
|
2110
|
-
|
|
2111
|
-
_forEach(results, function (item) {
|
|
2112
|
-
initialValues[item] = propsInitialValues[item] || userValues[item] || '';
|
|
2113
|
-
}); // set logged in user as first ticket holder
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
initialValues['holderFirstName-0'] = propsInitialValues.firstName || userValues.firstName || '';
|
|
2117
|
-
initialValues['holderLastName-0'] = propsInitialValues.lastName || userValues.lastName || '';
|
|
2118
|
-
initialValues['holderEmail-0'] = propsInitialValues.email || userValues.email || '';
|
|
2119
|
-
return initialValues;
|
|
2120
|
-
};
|
|
2121
|
-
var createRegisterFormData = function createRegisterFormData(values, checkoutBody) {
|
|
2122
|
-
if (values === void 0) {
|
|
2123
|
-
values = {};
|
|
2124
|
-
}
|
|
2125
|
-
|
|
2126
|
-
var bodyFormData = new FormData();
|
|
2127
|
-
bodyFormData.append('first_name', values.firstName);
|
|
2128
|
-
bodyFormData.append('last_name', values.lastName);
|
|
2129
|
-
bodyFormData.append('email', values.email);
|
|
2130
|
-
bodyFormData.append('password', values.password);
|
|
2131
|
-
bodyFormData.append('password_confirmation', values.confirmPassword);
|
|
2132
|
-
bodyFormData.append('client_id', CONFIGS.CLIENT_ID || 'e9d8f8922797b4621e562255afe90dbf');
|
|
2133
|
-
bodyFormData.append('client_secret', CONFIGS.CLIENT_SECRET || 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9');
|
|
2134
|
-
bodyFormData.append('check_cart_expiration', 'true');
|
|
2135
|
-
|
|
2136
|
-
_forEach(checkoutBody.attributes, function (item, key) {
|
|
2137
|
-
bodyFormData.append(key, item);
|
|
2138
|
-
});
|
|
2139
|
-
|
|
2140
|
-
return bodyFormData;
|
|
2141
|
-
};
|
|
2142
|
-
var setLoggedUserData$1 = function setLoggedUserData(data) {
|
|
2143
|
-
return {
|
|
2144
|
-
id: data.id,
|
|
2145
|
-
first_name: data.firstName,
|
|
2146
|
-
last_name: data.lastName,
|
|
2147
|
-
email: data.email,
|
|
2148
|
-
confirmEmail: data.email,
|
|
2149
|
-
city: (data == null ? void 0 : data.city) || '',
|
|
2150
|
-
country: (data == null ? void 0 : data.countryId) || (data == null ? void 0 : data.country) || '',
|
|
2151
|
-
phone: (data == null ? void 0 : data.phone) || '',
|
|
2152
|
-
street_address: (data == null ? void 0 : data.streetAddress) || '',
|
|
2153
|
-
state: (data == null ? void 0 : data.stateId) || '',
|
|
2154
|
-
zip: (data == null ? void 0 : data.zip) || (data == null ? void 0 : data.zipCode) || ''
|
|
2155
|
-
};
|
|
2156
|
-
};
|
|
2157
|
-
var createCheckoutDataBody = function createCheckoutDataBody(ticketsQuantity, values, logedInValues, includeDob) {
|
|
2158
|
-
if (values === void 0) {
|
|
2159
|
-
values = {};
|
|
2160
|
-
}
|
|
2161
|
-
|
|
2162
|
-
if (logedInValues === void 0) {
|
|
2163
|
-
logedInValues = {};
|
|
2164
|
-
}
|
|
2165
|
-
|
|
2166
|
-
if (includeDob === void 0) {
|
|
2167
|
-
includeDob = false;
|
|
2168
|
-
}
|
|
2169
|
-
|
|
2170
|
-
var _values = values,
|
|
2171
|
-
firstName = _values.firstName,
|
|
2172
|
-
lastName = _values.lastName,
|
|
2173
|
-
holderAge = _values.holderAge,
|
|
2174
|
-
restValues = _objectWithoutPropertiesLoose(_values, _excluded);
|
|
2175
|
-
|
|
2176
|
-
var holders = [];
|
|
2177
|
-
var ticket_holders = [];
|
|
2178
|
-
|
|
2179
|
-
var _loop = function _loop(i) {
|
|
2180
|
-
var individualHolder = Object.fromEntries(Object.entries(values).filter(function (_ref4) {
|
|
2181
|
-
var key = _ref4[0];
|
|
2182
|
-
return key.includes(String(i));
|
|
2183
|
-
}));
|
|
2184
|
-
holders.push(individualHolder);
|
|
2185
|
-
};
|
|
2186
|
-
|
|
2187
|
-
for (var i = 0; i <= ticketsQuantity; i++) {
|
|
2188
|
-
_loop(i);
|
|
2189
|
-
}
|
|
2190
|
-
|
|
2191
|
-
var filteredHolders = holders.filter(function (holder) {
|
|
2192
|
-
return Object.entries(holder).length > 0;
|
|
2193
|
-
});
|
|
2194
|
-
ticket_holders = filteredHolders.map(function (item, index) {
|
|
2195
|
-
return {
|
|
2196
|
-
first_name: !index ? item["holderFirstName-" + index] || logedInValues.firstNameLogged || '' : item["holderFirstName-" + index] || '',
|
|
2197
|
-
last_name: !index ? item["holderLastName-" + index] || logedInValues.lastNameLogged || '' : item["holderLastName-" + index] || '',
|
|
2198
|
-
phone: item["holderPhone-" + index] || '',
|
|
2199
|
-
email: !index ? item["holderEmail-" + index] || logedInValues.emailLogged || '' : item["holderEmail-" + index] || ''
|
|
2200
|
-
};
|
|
2201
|
-
});
|
|
2202
|
-
var filteredRestValue = {};
|
|
2203
|
-
|
|
2204
|
-
_forEach(restValues, function (value, key) {
|
|
2205
|
-
if (!key.includes('holder')) {
|
|
2206
|
-
filteredRestValue[key] = value;
|
|
2207
|
-
}
|
|
2208
|
-
});
|
|
2209
|
-
|
|
2210
|
-
var body = {
|
|
2211
|
-
attributes: _extends({}, filteredRestValue, {
|
|
2212
|
-
email: restValues.email || logedInValues.emailLogged,
|
|
2213
|
-
confirm_email: restValues.email || logedInValues.emailLogged,
|
|
2214
|
-
first_name: firstName || logedInValues.firstNameLogged,
|
|
2215
|
-
last_name: lastName || logedInValues.lastNameLogged,
|
|
2216
|
-
ticket_holders: ticket_holders
|
|
2217
|
-
})
|
|
2218
|
-
};
|
|
2219
|
-
|
|
2220
|
-
if (includeDob) {
|
|
2221
|
-
var holderAgeDate = new Date(holderAge);
|
|
2222
|
-
body.attributes.dob_day = holderAgeDate.getDate();
|
|
2223
|
-
body.attributes.dob_month = holderAgeDate.getMonth() + 1;
|
|
2224
|
-
body.attributes.dob_year = holderAgeDate.getFullYear();
|
|
2225
|
-
}
|
|
2226
|
-
|
|
2227
|
-
return body;
|
|
2228
|
-
};
|
|
2229
|
-
var getValidateFunctions = function getValidateFunctions(element, states, values) {
|
|
2230
|
-
var validationFunctions = [];
|
|
2231
|
-
|
|
2232
|
-
if (element.required) {
|
|
2233
|
-
if (element.name !== 'state' || element.name === 'state' && states.length) {
|
|
2234
|
-
validationFunctions.push(requiredValidator);
|
|
2235
|
-
}
|
|
2236
|
-
}
|
|
2237
|
-
|
|
2238
|
-
if (element.onValidate) {
|
|
2239
|
-
validationFunctions.push(element.onValidate);
|
|
2240
|
-
}
|
|
2241
|
-
|
|
2242
|
-
if (element.name === 'confirmEmail') {
|
|
2243
|
-
var isSameEmail = function isSameEmail(confirmEmail) {
|
|
2244
|
-
return values.email !== confirmEmail ? 'Please confirm your email address correctly' : null;
|
|
2245
|
-
};
|
|
2246
|
-
|
|
2247
|
-
validationFunctions.push(isSameEmail);
|
|
2248
|
-
}
|
|
2249
|
-
|
|
2250
|
-
if (element.name === 'confirmPassword') {
|
|
2251
|
-
var isSame = function isSame(confirmPassword) {
|
|
2252
|
-
return values.password !== confirmPassword ? 'Password confirmation does not match' : null;
|
|
2253
|
-
};
|
|
1966
|
+
data = _yield$forgotPassword.data;
|
|
1967
|
+
onForgotPasswordSuccess(data);
|
|
1968
|
+
onClose();
|
|
1969
|
+
_context.next = 14;
|
|
1970
|
+
break;
|
|
2254
1971
|
|
|
2255
|
-
|
|
2256
|
-
|
|
1972
|
+
case 11:
|
|
1973
|
+
_context.prev = 11;
|
|
1974
|
+
_context.t0 = _context["catch"](1);
|
|
2257
1975
|
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
if (_get(data[0], 'uniqueId')) {
|
|
2262
|
-
return data;
|
|
2263
|
-
}
|
|
1976
|
+
if (axios.isAxiosError(_context.t0)) {
|
|
1977
|
+
onForgotPasswordError(_context.t0);
|
|
1978
|
+
}
|
|
2264
1979
|
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
}
|
|
2270
|
-
});
|
|
1980
|
+
case 14:
|
|
1981
|
+
_context.prev = 14;
|
|
1982
|
+
setLoading(false);
|
|
1983
|
+
return _context.finish(14);
|
|
2271
1984
|
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
}
|
|
1985
|
+
case 17:
|
|
1986
|
+
case "end":
|
|
1987
|
+
return _context.stop();
|
|
1988
|
+
}
|
|
1989
|
+
}
|
|
1990
|
+
}, _callee, null, [[1, 11, 14, 17]]);
|
|
1991
|
+
}));
|
|
2277
1992
|
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
1993
|
+
return function onForgotPassword(_x) {
|
|
1994
|
+
return _ref3.apply(this, arguments);
|
|
1995
|
+
};
|
|
1996
|
+
}();
|
|
2281
1997
|
|
|
2282
|
-
var
|
|
2283
|
-
field = _ref.field,
|
|
2284
|
-
rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
1998
|
+
var _onClose = loading ? function () {} : onClose;
|
|
2285
1999
|
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2000
|
+
return React.createElement(Modal, {
|
|
2001
|
+
open: true,
|
|
2002
|
+
onClose: _onClose,
|
|
2003
|
+
"aria-labelledby": "modal-modal-title",
|
|
2004
|
+
"aria-describedby": "modal-modal-description",
|
|
2005
|
+
className: "forgot-password-modal"
|
|
2006
|
+
}, React.createElement(Box, {
|
|
2007
|
+
style: style
|
|
2008
|
+
}, React.createElement("div", null, React.createElement(Formik, {
|
|
2009
|
+
initialValues: {
|
|
2010
|
+
email: ''
|
|
2011
|
+
},
|
|
2012
|
+
validationSchema: Schema,
|
|
2013
|
+
onSubmit: onForgotPassword
|
|
2014
|
+
}, function (_ref4) {
|
|
2015
|
+
var isValid = _ref4.isValid,
|
|
2016
|
+
dirty = _ref4.dirty,
|
|
2017
|
+
handleSubmit = _ref4.handleSubmit;
|
|
2018
|
+
return React.createElement(Form, {
|
|
2019
|
+
onSubmit: handleSubmit
|
|
2020
|
+
}, React.createElement("div", {
|
|
2021
|
+
className: "forgot-password-container"
|
|
2022
|
+
}, React.createElement("div", {
|
|
2023
|
+
className: "title"
|
|
2024
|
+
}, "Password Reset"), React.createElement("div", {
|
|
2025
|
+
className: "forgot-password-container__singleField"
|
|
2026
|
+
}, React.createElement(Field, {
|
|
2027
|
+
name: "email",
|
|
2028
|
+
label: "Email",
|
|
2029
|
+
component: CustomField
|
|
2030
|
+
}))), React.createElement("div", {
|
|
2031
|
+
className: "forgot-password-action-button"
|
|
2032
|
+
}, React.createElement("button", {
|
|
2033
|
+
type: "submit",
|
|
2034
|
+
disabled: !(isValid && dirty)
|
|
2035
|
+
}, loading ? React.createElement(CircularProgress$1, {
|
|
2036
|
+
size: "22px"
|
|
2037
|
+
}) : 'Submit')), React.createElement("div", {
|
|
2038
|
+
className: "login"
|
|
2039
|
+
}, React.createElement("span", {
|
|
2040
|
+
onClick: onLogin
|
|
2041
|
+
}, "Back to Log In")));
|
|
2042
|
+
}))));
|
|
2296
2043
|
};
|
|
2297
2044
|
|
|
2298
|
-
var
|
|
2299
|
-
|
|
2045
|
+
var style$1 = {
|
|
2046
|
+
position: 'absolute',
|
|
2047
|
+
top: '50%',
|
|
2048
|
+
left: '50%',
|
|
2049
|
+
transform: 'translate(-50%, -50%)',
|
|
2050
|
+
minWidth: 480,
|
|
2051
|
+
backgroundColor: '#e3e3e3',
|
|
2052
|
+
border: '1px solid white',
|
|
2053
|
+
outline: 'none'
|
|
2300
2054
|
};
|
|
2301
|
-
var
|
|
2302
|
-
return
|
|
2303
|
-
|
|
2055
|
+
var setLoggedUserData = function setLoggedUserData(data) {
|
|
2056
|
+
return {
|
|
2057
|
+
id: data.id,
|
|
2058
|
+
first_name: data.firstName,
|
|
2059
|
+
last_name: data.lastName,
|
|
2060
|
+
email: data.email,
|
|
2061
|
+
confirmEmail: data.email,
|
|
2062
|
+
city: (data == null ? void 0 : data.city) || '',
|
|
2063
|
+
country: (data == null ? void 0 : data.countryId) || (data == null ? void 0 : data.country) || '',
|
|
2064
|
+
phone: (data == null ? void 0 : data.phone) || '',
|
|
2065
|
+
street_address: (data == null ? void 0 : data.streetAddress) || '',
|
|
2066
|
+
state: (data == null ? void 0 : data.stateId) || '',
|
|
2067
|
+
zip: (data == null ? void 0 : data.zip) || (data == null ? void 0 : data.zipCode) || ''
|
|
2304
2068
|
};
|
|
2305
2069
|
};
|
|
2306
|
-
var
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
return 'RM';
|
|
2070
|
+
var LoginModal = function LoginModal(_ref) {
|
|
2071
|
+
var onClose = _ref.onClose,
|
|
2072
|
+
onLogin = _ref.onLogin,
|
|
2073
|
+
_ref$alreadyHasUser = _ref.alreadyHasUser,
|
|
2074
|
+
alreadyHasUser = _ref$alreadyHasUser === void 0 ? false : _ref$alreadyHasUser,
|
|
2075
|
+
_ref$userExpired = _ref.userExpired,
|
|
2076
|
+
userExpired = _ref$userExpired === void 0 ? false : _ref$userExpired,
|
|
2077
|
+
_ref$onGetProfileData = _ref.onGetProfileDataSuccess,
|
|
2078
|
+
onGetProfileDataSuccess = _ref$onGetProfileData === void 0 ? _identity : _ref$onGetProfileData,
|
|
2079
|
+
_ref$onGetProfileData2 = _ref.onGetProfileDataError,
|
|
2080
|
+
onGetProfileDataError = _ref$onGetProfileData2 === void 0 ? _identity : _ref$onGetProfileData2,
|
|
2081
|
+
_ref$onForgotPassword = _ref.onForgotPassword,
|
|
2082
|
+
onForgotPassword = _ref$onForgotPassword === void 0 ? _identity : _ref$onForgotPassword,
|
|
2083
|
+
_ref$onSignup = _ref.onSignup,
|
|
2084
|
+
onSignup = _ref$onSignup === void 0 ? _identity : _ref$onSignup,
|
|
2085
|
+
_ref$modalClassname = _ref.modalClassname,
|
|
2086
|
+
modalClassname = _ref$modalClassname === void 0 ? '' : _ref$modalClassname,
|
|
2087
|
+
logo = _ref.logo,
|
|
2088
|
+
_ref$showForgotPasswo = _ref.showForgotPasswordButton,
|
|
2089
|
+
showForgotPasswordButton = _ref$showForgotPasswo === void 0 ? false : _ref$showForgotPasswo,
|
|
2090
|
+
_ref$showSignUpButton = _ref.showSignUpButton,
|
|
2091
|
+
showSignUpButton = _ref$showSignUpButton === void 0 ? false : _ref$showSignUpButton;
|
|
2329
2092
|
|
|
2330
|
-
|
|
2331
|
-
|
|
2093
|
+
var _useState = useState(''),
|
|
2094
|
+
error = _useState[0],
|
|
2095
|
+
setError = _useState[1];
|
|
2332
2096
|
|
|
2333
|
-
|
|
2334
|
-
|
|
2097
|
+
return React.createElement(Modal$1, {
|
|
2098
|
+
open: true,
|
|
2099
|
+
onClose: onClose,
|
|
2100
|
+
"aria-labelledby": "modal-modal-title",
|
|
2101
|
+
"aria-describedby": "modal-modal-description",
|
|
2102
|
+
className: "login-modal " + modalClassname
|
|
2103
|
+
}, React.createElement(Box$1, {
|
|
2104
|
+
style: style$1
|
|
2105
|
+
}, React.createElement("div", null, React.createElement(Formik, {
|
|
2106
|
+
initialValues: {
|
|
2107
|
+
email: '',
|
|
2108
|
+
password: ''
|
|
2109
|
+
},
|
|
2110
|
+
onSubmit: function () {
|
|
2111
|
+
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref2) {
|
|
2112
|
+
var email, password, body, profileResponse, profileSpecifiedData, profileDataObj, event, _e$response, _e$response$data, _error;
|
|
2335
2113
|
|
|
2336
|
-
|
|
2337
|
-
|
|
2114
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
2115
|
+
while (1) {
|
|
2116
|
+
switch (_context.prev = _context.next) {
|
|
2117
|
+
case 0:
|
|
2118
|
+
email = _ref2.email, password = _ref2.password;
|
|
2119
|
+
_context.prev = 1;
|
|
2120
|
+
body = {
|
|
2121
|
+
email: email,
|
|
2122
|
+
password: password
|
|
2123
|
+
};
|
|
2124
|
+
_context.next = 5;
|
|
2125
|
+
return authorize(body);
|
|
2338
2126
|
|
|
2339
|
-
|
|
2340
|
-
|
|
2127
|
+
case 5:
|
|
2128
|
+
profileResponse = null;
|
|
2129
|
+
_context.prev = 6;
|
|
2130
|
+
_context.next = 9;
|
|
2131
|
+
return getProfileData();
|
|
2341
2132
|
|
|
2342
|
-
|
|
2343
|
-
|
|
2133
|
+
case 9:
|
|
2134
|
+
profileResponse = _context.sent;
|
|
2135
|
+
onGetProfileDataSuccess(profileResponse.data);
|
|
2136
|
+
_context.next = 17;
|
|
2137
|
+
break;
|
|
2344
2138
|
|
|
2345
|
-
|
|
2346
|
-
|
|
2139
|
+
case 13:
|
|
2140
|
+
_context.prev = 13;
|
|
2141
|
+
_context.t0 = _context["catch"](6);
|
|
2347
2142
|
|
|
2348
|
-
|
|
2349
|
-
|
|
2143
|
+
if (axios.isAxiosError(_context.t0)) {
|
|
2144
|
+
onGetProfileDataError(_context.t0);
|
|
2145
|
+
}
|
|
2350
2146
|
|
|
2351
|
-
|
|
2352
|
-
return '฿';
|
|
2147
|
+
return _context.abrupt("return");
|
|
2353
2148
|
|
|
2354
|
-
|
|
2355
|
-
|
|
2149
|
+
case 17:
|
|
2150
|
+
profileSpecifiedData = _get(profileResponse, 'data.data');
|
|
2151
|
+
profileDataObj = setLoggedUserData(profileSpecifiedData);
|
|
2356
2152
|
|
|
2357
|
-
|
|
2358
|
-
|
|
2153
|
+
if (typeof window !== 'undefined') {
|
|
2154
|
+
window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
|
|
2155
|
+
event = new window.CustomEvent('tf-login');
|
|
2156
|
+
window.document.dispatchEvent(event);
|
|
2157
|
+
}
|
|
2359
2158
|
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
};
|
|
2159
|
+
onLogin();
|
|
2160
|
+
_context.next = 26;
|
|
2161
|
+
break;
|
|
2364
2162
|
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
2369
|
-
field = _ref.field,
|
|
2370
|
-
_ref$form = _ref.form,
|
|
2371
|
-
errors = _ref$form.errors,
|
|
2372
|
-
setFieldError = _ref$form.setFieldError,
|
|
2373
|
-
setStatus = _ref$form.setStatus;
|
|
2163
|
+
case 23:
|
|
2164
|
+
_context.prev = 23;
|
|
2165
|
+
_context.t1 = _context["catch"](1);
|
|
2374
2166
|
|
|
2375
|
-
|
|
2167
|
+
if (axios.isAxiosError(_context.t1)) {
|
|
2168
|
+
_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';
|
|
2169
|
+
setError(_error);
|
|
2170
|
+
} else if (_context.t1 instanceof Error) {
|
|
2171
|
+
setError((_context.t1 == null ? void 0 : _context.t1.message) || 'Error');
|
|
2172
|
+
}
|
|
2376
2173
|
|
|
2174
|
+
case 26:
|
|
2175
|
+
case "end":
|
|
2176
|
+
return _context.stop();
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2179
|
+
}, _callee, null, [[1, 23], [6, 13]]);
|
|
2180
|
+
}));
|
|
2377
2181
|
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
useEffect(function () {
|
|
2382
|
-
if (field.value) {
|
|
2383
|
-
var _setStatus;
|
|
2182
|
+
function onSubmit(_x) {
|
|
2183
|
+
return _onSubmit.apply(this, arguments);
|
|
2184
|
+
}
|
|
2384
2185
|
|
|
2385
|
-
|
|
2386
|
-
}
|
|
2186
|
+
return onSubmit;
|
|
2187
|
+
}()
|
|
2188
|
+
}, function (props) {
|
|
2189
|
+
return React.createElement(Form, {
|
|
2190
|
+
onSubmit: props.handleSubmit
|
|
2191
|
+
}, React.createElement("div", {
|
|
2192
|
+
className: "modal-title"
|
|
2193
|
+
}, "Login"), React.createElement("div", {
|
|
2194
|
+
className: 'login-logo-container'
|
|
2195
|
+
}, React.createElement("img", {
|
|
2196
|
+
className: "login-logo-tff",
|
|
2197
|
+
src: logo || "https://www.ticketfairy.com/resources/images/logo-ttf-black.svg",
|
|
2198
|
+
alt: "logo"
|
|
2199
|
+
})), React.createElement("div", {
|
|
2200
|
+
className: "server_auth__error"
|
|
2201
|
+
}, error), alreadyHasUser && React.createElement("p", {
|
|
2202
|
+
className: "info-text-for-login"
|
|
2203
|
+
}, "It appears this email is already attached to an account. Please log in here to complete your registration."), userExpired && React.createElement("p", {
|
|
2204
|
+
className: "info-text-for-login"
|
|
2205
|
+
}, "Your session has expired, please log in again."), React.createElement("div", {
|
|
2206
|
+
className: "login-modal-body"
|
|
2207
|
+
}, React.createElement("div", {
|
|
2208
|
+
className: "login-modal-body__email"
|
|
2209
|
+
}, React.createElement(Field, {
|
|
2210
|
+
name: 'email',
|
|
2211
|
+
validate: requiredValidator
|
|
2212
|
+
}, function (_ref3) {
|
|
2213
|
+
var field = _ref3.field,
|
|
2214
|
+
meta = _ref3.meta;
|
|
2215
|
+
return React.createElement(TextField$1, Object.assign({
|
|
2216
|
+
label: 'Email',
|
|
2217
|
+
type: 'email',
|
|
2218
|
+
fullWidth: true,
|
|
2219
|
+
error: !!meta.error && meta.touched,
|
|
2220
|
+
helperText: meta.touched && meta.error
|
|
2221
|
+
}, field));
|
|
2222
|
+
})), React.createElement("div", {
|
|
2223
|
+
className: "login-modal-body__password"
|
|
2224
|
+
}, React.createElement(Field, {
|
|
2225
|
+
name: 'password',
|
|
2226
|
+
validate: requiredValidator
|
|
2227
|
+
}, function (_ref4) {
|
|
2228
|
+
var field = _ref4.field,
|
|
2229
|
+
meta = _ref4.meta;
|
|
2230
|
+
return React.createElement(TextField$1, Object.assign({
|
|
2231
|
+
label: "Password",
|
|
2232
|
+
type: "password",
|
|
2233
|
+
fullWidth: true,
|
|
2234
|
+
error: !!meta.error && meta.touched,
|
|
2235
|
+
helperText: meta.touched && meta.error
|
|
2236
|
+
}, field));
|
|
2237
|
+
})), React.createElement("div", {
|
|
2238
|
+
className: "login-action-button"
|
|
2239
|
+
}, React.createElement("button", {
|
|
2240
|
+
type: "submit"
|
|
2241
|
+
}, "Login")), showForgotPasswordButton && React.createElement("div", {
|
|
2242
|
+
className: "forgot-password"
|
|
2243
|
+
}, React.createElement("span", {
|
|
2244
|
+
"aria-hidden": "true",
|
|
2245
|
+
onClick: onForgotPassword
|
|
2246
|
+
}, "Forgot password?")), showSignUpButton && React.createElement("div", {
|
|
2247
|
+
className: "forgot-password"
|
|
2248
|
+
}, React.createElement("span", {
|
|
2249
|
+
"aria-hidden": "true",
|
|
2250
|
+
onClick: onSignup
|
|
2251
|
+
}, "Sign up"))));
|
|
2252
|
+
}))));
|
|
2253
|
+
};
|
|
2387
2254
|
|
|
2388
|
-
|
|
2389
|
-
|
|
2255
|
+
var style$2 = {
|
|
2256
|
+
position: 'absolute',
|
|
2257
|
+
top: '50%',
|
|
2258
|
+
left: '50%',
|
|
2259
|
+
transform: 'translate(-50%, -50%)',
|
|
2260
|
+
minWidth: 480,
|
|
2261
|
+
backgroundColor: '#fff',
|
|
2262
|
+
border: '1px solid white',
|
|
2263
|
+
outline: 'none',
|
|
2264
|
+
padding: '14px'
|
|
2265
|
+
};
|
|
2266
|
+
var SignupSchema = /*#__PURE__*/object().shape({
|
|
2267
|
+
firstName: /*#__PURE__*/string().required('Required'),
|
|
2268
|
+
lastName: /*#__PURE__*/string().required('Required'),
|
|
2269
|
+
email: /*#__PURE__*/string().email('Invalid email').required('Required'),
|
|
2270
|
+
password: /*#__PURE__*/string().min(6, 'Password must have 5+ characters').required('Required'),
|
|
2271
|
+
confirmPassword: /*#__PURE__*/string().required('Required').oneOf([/*#__PURE__*/ref('password'), null], 'Passwords must match')
|
|
2272
|
+
});
|
|
2273
|
+
var SignupModal = function SignupModal(_ref) {
|
|
2274
|
+
var _ref$onClose = _ref.onClose,
|
|
2275
|
+
onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
|
|
2276
|
+
_ref$onLogin = _ref.onLogin,
|
|
2277
|
+
onLogin = _ref$onLogin === void 0 ? function () {} : _ref$onLogin,
|
|
2278
|
+
_ref$onRegisterSucces = _ref.onRegisterSuccess,
|
|
2279
|
+
onRegisterSuccess = _ref$onRegisterSucces === void 0 ? function () {} : _ref$onRegisterSucces,
|
|
2280
|
+
_ref$onRegisterError = _ref.onRegisterError,
|
|
2281
|
+
onRegisterError = _ref$onRegisterError === void 0 ? function () {} : _ref$onRegisterError;
|
|
2282
|
+
|
|
2283
|
+
var _useState = useState(false),
|
|
2284
|
+
loading = _useState[0],
|
|
2285
|
+
setLoading = _useState[1];
|
|
2390
2286
|
|
|
2287
|
+
var onSignup = /*#__PURE__*/function () {
|
|
2288
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(values) {
|
|
2289
|
+
var formData, res, access_token_register, refreshToken, tokens;
|
|
2391
2290
|
return runtime_1.wrap(function _callee$(_context) {
|
|
2392
2291
|
while (1) {
|
|
2393
2292
|
switch (_context.prev = _context.next) {
|
|
2394
2293
|
case 0:
|
|
2395
2294
|
_context.prev = 0;
|
|
2295
|
+
setLoading(true);
|
|
2296
|
+
formData = new FormData();
|
|
2297
|
+
formData.set('first_name', values.firstName);
|
|
2298
|
+
formData.set('last_name', values.lastName);
|
|
2299
|
+
formData.set('email', values.email);
|
|
2300
|
+
formData.set('password', values.password);
|
|
2301
|
+
formData.set('password_confirmation', values.confirmPassword);
|
|
2302
|
+
formData.append('client_id', CONFIGS.CLIENT_ID || 'e9d8f8922797b4621e562255afe90dbf');
|
|
2303
|
+
formData.append('client_secret', CONFIGS.CLIENT_SECRET || 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9');
|
|
2304
|
+
_context.next = 12;
|
|
2305
|
+
return register(formData);
|
|
2396
2306
|
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2307
|
+
case 12:
|
|
2308
|
+
res = _context.sent;
|
|
2309
|
+
access_token_register = _get(res, 'data.data.attributes.access_token');
|
|
2310
|
+
refreshToken = _get(res, 'data.data.attributes.refresh_token');
|
|
2311
|
+
handleSetAccessToken(access_token_register);
|
|
2312
|
+
tokens = {
|
|
2313
|
+
accessToken: access_token_register,
|
|
2314
|
+
refreshToken: refreshToken
|
|
2315
|
+
};
|
|
2316
|
+
onRegisterSuccess(tokens);
|
|
2317
|
+
onClose();
|
|
2318
|
+
_context.next = 24;
|
|
2408
2319
|
break;
|
|
2409
2320
|
|
|
2410
|
-
case
|
|
2411
|
-
_context.prev =
|
|
2321
|
+
case 21:
|
|
2322
|
+
_context.prev = 21;
|
|
2412
2323
|
_context.t0 = _context["catch"](0);
|
|
2413
|
-
message = _get(_context.t0, 'response.data.message', 'Invalid phone number');
|
|
2414
|
-
setFieldError(field.name, message);
|
|
2415
2324
|
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
return _context.finish(11);
|
|
2325
|
+
if (axios.isAxiosError(_context.t0)) {
|
|
2326
|
+
onRegisterError(_context.t0, values.email);
|
|
2327
|
+
}
|
|
2420
2328
|
|
|
2421
|
-
case
|
|
2329
|
+
case 24:
|
|
2330
|
+
_context.prev = 24;
|
|
2331
|
+
setLoading(false);
|
|
2332
|
+
return _context.finish(24);
|
|
2333
|
+
|
|
2334
|
+
case 27:
|
|
2422
2335
|
case "end":
|
|
2423
2336
|
return _context.stop();
|
|
2424
2337
|
}
|
|
2425
2338
|
}
|
|
2426
|
-
}, _callee, null, [[0,
|
|
2427
|
-
}))
|
|
2428
|
-
}, [field.value]);
|
|
2429
|
-
return React.createElement(TextField$1, Object.assign({}, field, {
|
|
2430
|
-
id: field.name,
|
|
2431
|
-
label: label,
|
|
2432
|
-
type: type,
|
|
2433
|
-
fullWidth: true,
|
|
2434
|
-
error: !!error,
|
|
2435
|
-
helperText: error,
|
|
2436
|
-
value: field.value || ''
|
|
2437
|
-
}));
|
|
2438
|
-
};
|
|
2439
|
-
|
|
2440
|
-
function Loader() {
|
|
2441
|
-
return React.createElement("div", {
|
|
2442
|
-
className: "loader-container"
|
|
2443
|
-
}, React.createElement(CircularProgress$1, null));
|
|
2444
|
-
}
|
|
2339
|
+
}, _callee, null, [[0, 21, 24, 27]]);
|
|
2340
|
+
}));
|
|
2445
2341
|
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
field = _ref.field,
|
|
2451
|
-
_ref$selectOptions = _ref.selectOptions,
|
|
2452
|
-
selectOptions = _ref$selectOptions === void 0 ? [] : _ref$selectOptions,
|
|
2453
|
-
_ref$form = _ref.form,
|
|
2454
|
-
touched = _ref$form.touched,
|
|
2455
|
-
errors = _ref$form.errors,
|
|
2456
|
-
theme = _ref.theme;
|
|
2457
|
-
var isTouched = Boolean(_get(touched, field.name));
|
|
2342
|
+
return function onSignup(_x) {
|
|
2343
|
+
return _ref2.apply(this, arguments);
|
|
2344
|
+
};
|
|
2345
|
+
}();
|
|
2458
2346
|
|
|
2459
|
-
var
|
|
2347
|
+
var _onClose = loading ? function () {} : onClose;
|
|
2460
2348
|
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
},
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
id: field.name
|
|
2349
|
+
return React.createElement(Modal, {
|
|
2350
|
+
open: true,
|
|
2351
|
+
onClose: _onClose,
|
|
2352
|
+
"aria-labelledby": "modal-modal-title",
|
|
2353
|
+
"aria-describedby": "modal-modal-description",
|
|
2354
|
+
className: "signup-modal"
|
|
2355
|
+
}, React.createElement(Box, {
|
|
2356
|
+
style: style$2
|
|
2357
|
+
}, React.createElement("div", null, React.createElement(Formik, {
|
|
2358
|
+
initialValues: {
|
|
2359
|
+
firstName: '',
|
|
2360
|
+
lastName: '',
|
|
2361
|
+
email: '',
|
|
2362
|
+
password: '',
|
|
2363
|
+
confirmPassword: ''
|
|
2477
2364
|
},
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
},
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2365
|
+
validationSchema: SignupSchema,
|
|
2366
|
+
onSubmit: onSignup
|
|
2367
|
+
}, function (_ref3) {
|
|
2368
|
+
var isValid = _ref3.isValid,
|
|
2369
|
+
dirty = _ref3.dirty,
|
|
2370
|
+
handleSubmit = _ref3.handleSubmit;
|
|
2371
|
+
return React.createElement(Form, {
|
|
2372
|
+
onSubmit: handleSubmit
|
|
2373
|
+
}, React.createElement("div", {
|
|
2374
|
+
className: "signup-container"
|
|
2375
|
+
}, React.createElement("div", {
|
|
2376
|
+
className: "title"
|
|
2377
|
+
}, "Create an Account"), React.createElement("div", {
|
|
2378
|
+
className: "signup-container__twoFields"
|
|
2379
|
+
}, React.createElement("div", {
|
|
2380
|
+
className: "is-half"
|
|
2381
|
+
}, React.createElement(Field, {
|
|
2382
|
+
name: "firstName",
|
|
2383
|
+
label: "First Name",
|
|
2384
|
+
component: CustomField
|
|
2385
|
+
})), React.createElement("div", {
|
|
2386
|
+
className: "is-half"
|
|
2387
|
+
}, React.createElement(Field, {
|
|
2388
|
+
name: "lastName",
|
|
2389
|
+
label: "Last Name",
|
|
2390
|
+
component: CustomField
|
|
2391
|
+
}))), React.createElement("div", {
|
|
2392
|
+
className: "signup-container__singleField"
|
|
2393
|
+
}, React.createElement("div", {
|
|
2394
|
+
className: ""
|
|
2395
|
+
}, React.createElement(Field, {
|
|
2396
|
+
name: "email",
|
|
2397
|
+
label: "Email",
|
|
2398
|
+
component: CustomField
|
|
2399
|
+
}))), React.createElement("div", {
|
|
2400
|
+
className: "signup-container__twoFields"
|
|
2401
|
+
}, React.createElement("div", {
|
|
2402
|
+
className: "is-half"
|
|
2403
|
+
}, React.createElement(Field, {
|
|
2404
|
+
name: "password",
|
|
2405
|
+
label: "Password",
|
|
2406
|
+
type: "password",
|
|
2407
|
+
component: CustomField
|
|
2408
|
+
})), React.createElement("div", {
|
|
2409
|
+
className: "is-half"
|
|
2410
|
+
}, React.createElement(Field, {
|
|
2411
|
+
name: "confirmPassword",
|
|
2412
|
+
label: "Confirm Password",
|
|
2413
|
+
type: "password",
|
|
2414
|
+
component: CustomField
|
|
2415
|
+
})))), React.createElement("div", {
|
|
2416
|
+
className: "signup-action-button"
|
|
2417
|
+
}, React.createElement("button", {
|
|
2418
|
+
type: "submit",
|
|
2419
|
+
disabled: !(isValid && dirty)
|
|
2420
|
+
}, loading ? React.createElement(CircularProgress$1, {
|
|
2421
|
+
size: "22px"
|
|
2422
|
+
}) : 'Submit')), React.createElement("div", {
|
|
2423
|
+
className: "login"
|
|
2424
|
+
}, React.createElement("span", {
|
|
2425
|
+
onClick: onLogin
|
|
2426
|
+
}, "Login")));
|
|
2427
|
+
}))));
|
|
2494
2428
|
};
|
|
2495
2429
|
|
|
2496
2430
|
var showZero = function showZero(value) {
|
|
@@ -2556,144 +2490,229 @@ var TimerWidget = function TimerWidget(_ref) {
|
|
|
2556
2490
|
var hideTimer = function hideTimer() {
|
|
2557
2491
|
var timerRl = document.querySelector('.timer');
|
|
2558
2492
|
|
|
2559
|
-
if (timerRl) {
|
|
2560
|
-
timerRl.style.visibility = "hidden";
|
|
2493
|
+
if (timerRl) {
|
|
2494
|
+
timerRl.style.visibility = "hidden";
|
|
2495
|
+
}
|
|
2496
|
+
};
|
|
2497
|
+
|
|
2498
|
+
return showTimer && !!expires_at ? React.createElement("div", {
|
|
2499
|
+
className: "timer"
|
|
2500
|
+
}, React.createElement("div", {
|
|
2501
|
+
className: 'close-icon',
|
|
2502
|
+
onClick: hideTimer
|
|
2503
|
+
}, React.createElement(SVG, {
|
|
2504
|
+
src: getImage('cross.svg'),
|
|
2505
|
+
width: '10',
|
|
2506
|
+
height: '10',
|
|
2507
|
+
fill: '#fff'
|
|
2508
|
+
})), React.createElement("div", {
|
|
2509
|
+
className: "toast-message"
|
|
2510
|
+
}, React.createElement("p", null, "Please complete your purchase before the timer reaches zero."), React.createElement("p", {
|
|
2511
|
+
className: "countdown"
|
|
2512
|
+
}, React.createElement(Countdown$1, {
|
|
2513
|
+
date: Date.now() + expires_at * 1000,
|
|
2514
|
+
renderer: function renderer(props) {
|
|
2515
|
+
return _renderer(_extends({}, props, {
|
|
2516
|
+
handleCountdownFinish: handleCountdownFinish
|
|
2517
|
+
}));
|
|
2518
|
+
}
|
|
2519
|
+
})))) : null;
|
|
2520
|
+
};
|
|
2521
|
+
|
|
2522
|
+
var TimerWidget$1 = /*#__PURE__*/memo(TimerWidget);
|
|
2523
|
+
|
|
2524
|
+
var _excluded$1 = ["firstName", "lastName", "holderAge", "confirmEmail", "confirmPassword"];
|
|
2525
|
+
var getInitialValues = function getInitialValues(data, propsInitialValues, userValues) {
|
|
2526
|
+
if (data === void 0) {
|
|
2527
|
+
data = [];
|
|
2528
|
+
}
|
|
2529
|
+
|
|
2530
|
+
if (propsInitialValues === void 0) {
|
|
2531
|
+
propsInitialValues = {};
|
|
2532
|
+
}
|
|
2533
|
+
|
|
2534
|
+
if (userValues === void 0) {
|
|
2535
|
+
userValues = {};
|
|
2536
|
+
}
|
|
2537
|
+
|
|
2538
|
+
var results = _flatMapDeep(data, function (_ref) {
|
|
2539
|
+
var fields = _ref.fields;
|
|
2540
|
+
return _map(fields, function (_ref2) {
|
|
2541
|
+
var groupItems = _ref2.groupItems;
|
|
2542
|
+
return _map(groupItems, function (_ref3) {
|
|
2543
|
+
var name = _ref3.name;
|
|
2544
|
+
return name;
|
|
2545
|
+
});
|
|
2546
|
+
});
|
|
2547
|
+
});
|
|
2548
|
+
|
|
2549
|
+
var initialValues = {};
|
|
2550
|
+
|
|
2551
|
+
_forEach(results, function (item) {
|
|
2552
|
+
initialValues[item] = propsInitialValues[item] || userValues[item] || '';
|
|
2553
|
+
}); // set logged in user as first ticket holder
|
|
2554
|
+
|
|
2555
|
+
|
|
2556
|
+
initialValues['holderFirstName-0'] = propsInitialValues.firstName || userValues.firstName || '';
|
|
2557
|
+
initialValues['holderLastName-0'] = propsInitialValues.lastName || userValues.lastName || '';
|
|
2558
|
+
initialValues['holderEmail-0'] = propsInitialValues.email || userValues.email || '';
|
|
2559
|
+
return initialValues;
|
|
2560
|
+
};
|
|
2561
|
+
var createRegisterFormData = function createRegisterFormData(values, checkoutBody) {
|
|
2562
|
+
if (values === void 0) {
|
|
2563
|
+
values = {};
|
|
2564
|
+
}
|
|
2565
|
+
|
|
2566
|
+
var bodyFormData = new FormData();
|
|
2567
|
+
bodyFormData.append('first_name', values.firstName);
|
|
2568
|
+
bodyFormData.append('last_name', values.lastName);
|
|
2569
|
+
bodyFormData.append('email', values.email);
|
|
2570
|
+
bodyFormData.append('password', values.password);
|
|
2571
|
+
bodyFormData.append('password_confirmation', values.confirmPassword);
|
|
2572
|
+
bodyFormData.append('client_id', CONFIGS.CLIENT_ID || 'e9d8f8922797b4621e562255afe90dbf');
|
|
2573
|
+
bodyFormData.append('client_secret', CONFIGS.CLIENT_SECRET || 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9');
|
|
2574
|
+
bodyFormData.append('check_cart_expiration', 'true');
|
|
2575
|
+
|
|
2576
|
+
_forEach(checkoutBody.attributes, function (item, key) {
|
|
2577
|
+
bodyFormData.append(key, item);
|
|
2578
|
+
});
|
|
2579
|
+
|
|
2580
|
+
return bodyFormData;
|
|
2581
|
+
};
|
|
2582
|
+
var setLoggedUserData$1 = function setLoggedUserData(data) {
|
|
2583
|
+
return {
|
|
2584
|
+
id: data.id,
|
|
2585
|
+
first_name: data.firstName,
|
|
2586
|
+
last_name: data.lastName,
|
|
2587
|
+
email: data.email,
|
|
2588
|
+
confirmEmail: data.email,
|
|
2589
|
+
city: (data == null ? void 0 : data.city) || '',
|
|
2590
|
+
country: (data == null ? void 0 : data.countryId) || (data == null ? void 0 : data.country) || '',
|
|
2591
|
+
phone: (data == null ? void 0 : data.phone) || '',
|
|
2592
|
+
street_address: (data == null ? void 0 : data.streetAddress) || '',
|
|
2593
|
+
state: (data == null ? void 0 : data.stateId) || '',
|
|
2594
|
+
zip: (data == null ? void 0 : data.zip) || (data == null ? void 0 : data.zipCode) || ''
|
|
2595
|
+
};
|
|
2596
|
+
};
|
|
2597
|
+
var createCheckoutDataBody = function createCheckoutDataBody(ticketsQuantity, values, logedInValues, includeDob) {
|
|
2598
|
+
if (values === void 0) {
|
|
2599
|
+
values = {};
|
|
2600
|
+
}
|
|
2601
|
+
|
|
2602
|
+
if (logedInValues === void 0) {
|
|
2603
|
+
logedInValues = {};
|
|
2604
|
+
}
|
|
2605
|
+
|
|
2606
|
+
if (includeDob === void 0) {
|
|
2607
|
+
includeDob = false;
|
|
2608
|
+
}
|
|
2609
|
+
|
|
2610
|
+
var _values = values,
|
|
2611
|
+
firstName = _values.firstName,
|
|
2612
|
+
lastName = _values.lastName,
|
|
2613
|
+
holderAge = _values.holderAge,
|
|
2614
|
+
restValues = _objectWithoutPropertiesLoose(_values, _excluded$1);
|
|
2615
|
+
|
|
2616
|
+
var holders = [];
|
|
2617
|
+
var ticket_holders = [];
|
|
2618
|
+
|
|
2619
|
+
var _loop = function _loop(i) {
|
|
2620
|
+
var individualHolder = Object.fromEntries(Object.entries(values).filter(function (_ref4) {
|
|
2621
|
+
var key = _ref4[0];
|
|
2622
|
+
return key.includes(String(i));
|
|
2623
|
+
}));
|
|
2624
|
+
holders.push(individualHolder);
|
|
2625
|
+
};
|
|
2626
|
+
|
|
2627
|
+
for (var i = 0; i <= ticketsQuantity; i++) {
|
|
2628
|
+
_loop(i);
|
|
2629
|
+
}
|
|
2630
|
+
|
|
2631
|
+
var filteredHolders = holders.filter(function (holder) {
|
|
2632
|
+
return Object.entries(holder).length > 0;
|
|
2633
|
+
});
|
|
2634
|
+
ticket_holders = filteredHolders.map(function (item, index) {
|
|
2635
|
+
return {
|
|
2636
|
+
first_name: !index ? item["holderFirstName-" + index] || logedInValues.firstNameLogged || '' : item["holderFirstName-" + index] || '',
|
|
2637
|
+
last_name: !index ? item["holderLastName-" + index] || logedInValues.lastNameLogged || '' : item["holderLastName-" + index] || '',
|
|
2638
|
+
phone: item["holderPhone-" + index] || '',
|
|
2639
|
+
email: !index ? item["holderEmail-" + index] || logedInValues.emailLogged || '' : item["holderEmail-" + index] || ''
|
|
2640
|
+
};
|
|
2641
|
+
});
|
|
2642
|
+
var filteredRestValue = {};
|
|
2643
|
+
|
|
2644
|
+
_forEach(restValues, function (value, key) {
|
|
2645
|
+
if (!key.includes('holder')) {
|
|
2646
|
+
filteredRestValue[key] = value;
|
|
2647
|
+
}
|
|
2648
|
+
});
|
|
2649
|
+
|
|
2650
|
+
var body = {
|
|
2651
|
+
attributes: _extends({}, filteredRestValue, {
|
|
2652
|
+
email: restValues.email || logedInValues.emailLogged,
|
|
2653
|
+
confirm_email: restValues.email || logedInValues.emailLogged,
|
|
2654
|
+
first_name: firstName || logedInValues.firstNameLogged,
|
|
2655
|
+
last_name: lastName || logedInValues.lastNameLogged,
|
|
2656
|
+
ticket_holders: ticket_holders
|
|
2657
|
+
})
|
|
2658
|
+
};
|
|
2659
|
+
|
|
2660
|
+
if (includeDob) {
|
|
2661
|
+
var holderAgeDate = new Date(holderAge);
|
|
2662
|
+
body.attributes.dob_day = holderAgeDate.getDate();
|
|
2663
|
+
body.attributes.dob_month = holderAgeDate.getMonth() + 1;
|
|
2664
|
+
body.attributes.dob_year = holderAgeDate.getFullYear();
|
|
2665
|
+
}
|
|
2666
|
+
|
|
2667
|
+
return body;
|
|
2668
|
+
};
|
|
2669
|
+
var getValidateFunctions = function getValidateFunctions(element, states, values) {
|
|
2670
|
+
var validationFunctions = [];
|
|
2671
|
+
|
|
2672
|
+
if (element.required) {
|
|
2673
|
+
if (element.name !== 'state' || element.name === 'state' && states.length) {
|
|
2674
|
+
validationFunctions.push(requiredValidator);
|
|
2561
2675
|
}
|
|
2562
|
-
}
|
|
2676
|
+
}
|
|
2563
2677
|
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
}
|
|
2567
|
-
className: 'close-icon',
|
|
2568
|
-
onClick: hideTimer
|
|
2569
|
-
}, React.createElement(SVG, {
|
|
2570
|
-
src: getImage('cross.svg'),
|
|
2571
|
-
width: '10',
|
|
2572
|
-
height: '10',
|
|
2573
|
-
fill: '#fff'
|
|
2574
|
-
})), React.createElement("div", {
|
|
2575
|
-
className: "toast-message"
|
|
2576
|
-
}, React.createElement("p", null, "Please complete your purchase before the timer reaches zero."), React.createElement("p", {
|
|
2577
|
-
className: "countdown"
|
|
2578
|
-
}, React.createElement(Countdown$1, {
|
|
2579
|
-
date: Date.now() + expires_at * 1000,
|
|
2580
|
-
renderer: function renderer(props) {
|
|
2581
|
-
return _renderer(_extends({}, props, {
|
|
2582
|
-
handleCountdownFinish: handleCountdownFinish
|
|
2583
|
-
}));
|
|
2584
|
-
}
|
|
2585
|
-
})))) : null;
|
|
2586
|
-
};
|
|
2678
|
+
if (element.onValidate) {
|
|
2679
|
+
validationFunctions.push(element.onValidate);
|
|
2680
|
+
}
|
|
2587
2681
|
|
|
2588
|
-
|
|
2682
|
+
if (element.name === 'confirmEmail') {
|
|
2683
|
+
var isSameEmail = function isSameEmail(confirmEmail) {
|
|
2684
|
+
return values.email !== confirmEmail ? 'Please confirm your email address correctly' : null;
|
|
2685
|
+
};
|
|
2589
2686
|
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
message = _ref.message,
|
|
2593
|
-
type = _ref.type,
|
|
2594
|
-
position = _ref.position,
|
|
2595
|
-
_ref$autoHideDuration = _ref.autoHideDuration,
|
|
2596
|
-
autoHideDuration = _ref$autoHideDuration === void 0 ? 3000 : _ref$autoHideDuration,
|
|
2597
|
-
variant = _ref.variant,
|
|
2598
|
-
onClose = _ref.onClose;
|
|
2599
|
-
return React.createElement("div", {
|
|
2600
|
-
className: "snackbar-alert-container"
|
|
2601
|
-
}, React.createElement(Snackbar, {
|
|
2602
|
-
autoHideDuration: autoHideDuration,
|
|
2603
|
-
open: isOpen,
|
|
2604
|
-
anchorOrigin: position || {
|
|
2605
|
-
vertical: 'top',
|
|
2606
|
-
horizontal: 'center'
|
|
2607
|
-
},
|
|
2608
|
-
onClose: onClose,
|
|
2609
|
-
classes: {
|
|
2610
|
-
root: 'snackbar-alert-snackbar-root'
|
|
2611
|
-
}
|
|
2612
|
-
}, React.createElement(Alert, {
|
|
2613
|
-
severity: type,
|
|
2614
|
-
onClose: onClose,
|
|
2615
|
-
variant: variant || 'filled',
|
|
2616
|
-
classes: {
|
|
2617
|
-
icon: 'snackbar-alert-icon',
|
|
2618
|
-
root: 'snackbar-alert-alert-root',
|
|
2619
|
-
action: 'snackbar-alert-action',
|
|
2620
|
-
message: 'snackbar-alert-message',
|
|
2621
|
-
filled: 'snackbar-alert-filled'
|
|
2622
|
-
}
|
|
2623
|
-
}, message)));
|
|
2624
|
-
};
|
|
2687
|
+
validationFunctions.push(isSameEmail);
|
|
2688
|
+
}
|
|
2625
2689
|
|
|
2626
|
-
|
|
2627
|
-
var
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
width: 256
|
|
2633
|
-
},
|
|
2634
|
-
'& .MuiTypography-caption': {
|
|
2635
|
-
width: DATE_SIZE,
|
|
2636
|
-
margin: 0
|
|
2637
|
-
},
|
|
2638
|
-
'& .PrivatePickersSlideTransition-root': {
|
|
2639
|
-
minHeight: DATE_SIZE * 6
|
|
2640
|
-
},
|
|
2641
|
-
'& .PrivatePickersSlideTransition-root [role="row"]': {
|
|
2642
|
-
margin: 0
|
|
2643
|
-
},
|
|
2644
|
-
'& .MuiPickersDay-dayWithMargin': {
|
|
2645
|
-
margin: 0
|
|
2646
|
-
},
|
|
2647
|
-
'& .MuiPickersDay-root': {
|
|
2648
|
-
width: DATE_SIZE,
|
|
2649
|
-
height: DATE_SIZE
|
|
2690
|
+
if (element.name === 'confirmPassword') {
|
|
2691
|
+
var isSame = function isSame(confirmPassword) {
|
|
2692
|
+
return values.password !== confirmPassword ? 'Password confirmation does not match' : null;
|
|
2693
|
+
};
|
|
2694
|
+
|
|
2695
|
+
validationFunctions.push(isSame);
|
|
2650
2696
|
}
|
|
2697
|
+
|
|
2698
|
+
return combineValidators.apply(void 0, validationFunctions);
|
|
2651
2699
|
};
|
|
2652
|
-
var
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
defaultProps: {
|
|
2656
|
-
sx: compactStyles
|
|
2657
|
-
}
|
|
2658
|
-
}
|
|
2700
|
+
var assingUniqueIds = function assingUniqueIds(data) {
|
|
2701
|
+
if (_get(data[0], 'uniqueId')) {
|
|
2702
|
+
return data;
|
|
2659
2703
|
}
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
}, React.createElement(DatePicker, {
|
|
2673
|
-
value: field.value || '',
|
|
2674
|
-
onChange: function onChange(value) {
|
|
2675
|
-
return form.setFieldValue(field.name, value);
|
|
2676
|
-
},
|
|
2677
|
-
PopperProps: {
|
|
2678
|
-
placement: 'bottom-start'
|
|
2679
|
-
},
|
|
2680
|
-
showDaysOutsideCurrentMonth: true,
|
|
2681
|
-
disableFuture: true,
|
|
2682
|
-
inputFormat: "DD/MM/YYYY",
|
|
2683
|
-
mask: "__/__/____",
|
|
2684
|
-
renderInput: function renderInput(params) {
|
|
2685
|
-
return React.createElement(CustomField, Object.assign({}, params, {
|
|
2686
|
-
inputProps: _extends({}, params.inputProps, {
|
|
2687
|
-
placeholder: 'dd/mm/yyyy'
|
|
2688
|
-
}),
|
|
2689
|
-
theme: theme,
|
|
2690
|
-
field: field,
|
|
2691
|
-
form: form,
|
|
2692
|
-
label: label,
|
|
2693
|
-
type: "tel"
|
|
2694
|
-
}));
|
|
2695
|
-
}
|
|
2696
|
-
})));
|
|
2704
|
+
|
|
2705
|
+
return _map(data, function (item) {
|
|
2706
|
+
_forEach(item, function (itemValue, key) {
|
|
2707
|
+
if (_isArray(itemValue)) {
|
|
2708
|
+
item[key] = assingUniqueIds(itemValue);
|
|
2709
|
+
}
|
|
2710
|
+
});
|
|
2711
|
+
|
|
2712
|
+
return _extends({}, item, {
|
|
2713
|
+
uniqueId: nanoid()
|
|
2714
|
+
});
|
|
2715
|
+
});
|
|
2697
2716
|
};
|
|
2698
2717
|
|
|
2699
2718
|
var LogicRunner = function LogicRunner(_ref) {
|
|
@@ -3256,7 +3275,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3256
3275
|
zIndex: 1205
|
|
3257
3276
|
},
|
|
3258
3277
|
open: true
|
|
3259
|
-
}, React.createElement(CircularProgress, {
|
|
3278
|
+
}, React.createElement(CircularProgress$1, {
|
|
3260
3279
|
color: "inherit"
|
|
3261
3280
|
})), !!expirationTime && enableTimer && React.createElement(TimerWidget$1, {
|
|
3262
3281
|
expires_at: expirationTime,
|
|
@@ -3523,7 +3542,8 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3523
3542
|
onBlur: props.handleBlur,
|
|
3524
3543
|
component: element.type === 'checkbox' ? CheckboxField : element.type === 'select' ? SelectField : element.type === 'phone' ? PhoneNumberField : element.type === 'date' ? DatePickerField : CustomField,
|
|
3525
3544
|
selectOptions: element.name === 'country' ? countries : element.name === 'state' ? states : [],
|
|
3526
|
-
theme: theme
|
|
3545
|
+
theme: theme,
|
|
3546
|
+
disableDropdown: element.disableDropdown
|
|
3527
3547
|
})));
|
|
3528
3548
|
})));
|
|
3529
3549
|
}));
|
|
@@ -3548,8 +3568,13 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3548
3568
|
label: element.label,
|
|
3549
3569
|
type: element.type,
|
|
3550
3570
|
required: true,
|
|
3551
|
-
component: element.type === 'checkbox' ? CheckboxField : CustomField,
|
|
3552
|
-
validate: combineValidators(element.required ? requiredValidator : function () {
|
|
3571
|
+
component: element.type === 'checkbox' ? CheckboxField : element.type === 'phone' ? PhoneNumberField : CustomField,
|
|
3572
|
+
validate: combineValidators(element.required ? requiredValidator : function () {
|
|
3573
|
+
return props.errors[element.name + "-" + index];
|
|
3574
|
+
}, element.onValidate ? element.onValidate : function () {
|
|
3575
|
+
return props.errors[element.name + "-" + index];
|
|
3576
|
+
}),
|
|
3577
|
+
disableDropdown: element.disableDropdown
|
|
3553
3578
|
}));
|
|
3554
3579
|
})));
|
|
3555
3580
|
}));
|
|
@@ -3560,7 +3585,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
3560
3585
|
variant: "contained",
|
|
3561
3586
|
className: "login-register-button",
|
|
3562
3587
|
disabled: props.isSubmitting
|
|
3563
|
-
}, props.isSubmitting ? React.createElement(CircularProgress, {
|
|
3588
|
+
}, props.isSubmitting ? React.createElement(CircularProgress$1, {
|
|
3564
3589
|
size: 26
|
|
3565
3590
|
}) : buttonName))));
|
|
3566
3591
|
}), showModalLogin && React.createElement(LoginModal, {
|
|
@@ -3653,7 +3678,8 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
3653
3678
|
handleSetLoading = _ref$handleSetLoading === void 0 ? function () {} : _ref$handleSetLoading,
|
|
3654
3679
|
_ref$conditions = _ref.conditions,
|
|
3655
3680
|
conditions = _ref$conditions === void 0 ? [] : _ref$conditions,
|
|
3656
|
-
disableZipSection = _ref.disableZipSection
|
|
3681
|
+
disableZipSection = _ref.disableZipSection,
|
|
3682
|
+
paymentButtonText = _ref.paymentButtonText;
|
|
3657
3683
|
var stripe = useStripe();
|
|
3658
3684
|
var elements = useElements();
|
|
3659
3685
|
|
|
@@ -3882,9 +3908,9 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
3882
3908
|
}, React.createElement("button", {
|
|
3883
3909
|
disabled: buttonIsDiabled,
|
|
3884
3910
|
type: "submit"
|
|
3885
|
-
}, isLoading ? React.createElement(CircularProgress
|
|
3911
|
+
}, isLoading ? React.createElement(CircularProgress, {
|
|
3886
3912
|
size: 26
|
|
3887
|
-
}) :
|
|
3913
|
+
}) : (paymentButtonText ? paymentButtonText : 'Pay') + " " + getCurrencySymbolByCurrency(currency) + total))));
|
|
3888
3914
|
};
|
|
3889
3915
|
|
|
3890
3916
|
var publishableKey = CONFIGS.STRIPE_PUBLISHABLE_KEY || '';
|
|
@@ -3947,7 +3973,8 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
3947
3973
|
_ref$enableTimer = _ref.enableTimer,
|
|
3948
3974
|
enableTimer = _ref$enableTimer === void 0 ? false : _ref$enableTimer,
|
|
3949
3975
|
_ref$enablePaymentPla = _ref.enablePaymentPlan,
|
|
3950
|
-
enablePaymentPlan = _ref$enablePaymentPla === void 0 ? false : _ref$enablePaymentPla
|
|
3976
|
+
enablePaymentPlan = _ref$enablePaymentPla === void 0 ? false : _ref$enablePaymentPla,
|
|
3977
|
+
paymentButtonText = _ref.paymentButtonText;
|
|
3951
3978
|
|
|
3952
3979
|
var _useState = useState(initialReviewValues),
|
|
3953
3980
|
reviewData = _useState[0],
|
|
@@ -4231,7 +4258,8 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
4231
4258
|
},
|
|
4232
4259
|
conditions: conditions,
|
|
4233
4260
|
stripeCardOptions: stripeCardOptions,
|
|
4234
|
-
disableZipSection: disableZipSection
|
|
4261
|
+
disableZipSection: disableZipSection,
|
|
4262
|
+
paymentButtonText: paymentButtonText
|
|
4235
4263
|
})))) : React.createElement("div", {
|
|
4236
4264
|
className: "payment_button " + (paymentIsLoading ? 'disabled-payment-button' : '')
|
|
4237
4265
|
}, React.createElement("button", {
|
|
@@ -4241,7 +4269,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
4241
4269
|
setPaymentIsLoading(true);
|
|
4242
4270
|
handlePaymentMiddleWare(null);
|
|
4243
4271
|
}
|
|
4244
|
-
}, paymentIsLoading ? React.createElement(CircularProgress
|
|
4272
|
+
}, paymentIsLoading ? React.createElement(CircularProgress, {
|
|
4245
4273
|
size: 26
|
|
4246
4274
|
}) : 'Complete Registration')))));
|
|
4247
4275
|
};
|
|
@@ -4572,169 +4600,122 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
4572
4600
|
navigator.clipboard.writeText(_get(inputRef, 'current.value'));
|
|
4573
4601
|
onLinkCopied();
|
|
4574
4602
|
}
|
|
4575
|
-
}, hasCopyIcon ? React.createElement("img", {
|
|
4576
|
-
src: "https://img.icons8.com/office/50/000000/copy.png",
|
|
4577
|
-
alt: "copy"
|
|
4578
|
-
}) : React.createElement("span", {
|
|
4579
|
-
className: 'copy-icon'
|
|
4580
|
-
}, "Copy")))), (showDefaultShareButtons || !!shareButtons.length) && React.createElement(SocialButtons, {
|
|
4581
|
-
showDefaultShareButtons: showDefaultShareButtons,
|
|
4582
|
-
name: data.product_name,
|
|
4583
|
-
appId: messengerAppId,
|
|
4584
|
-
shareLink: data.personal_share_link,
|
|
4585
|
-
shareButtons: shareButtons
|
|
4586
|
-
})))), React.createElement("div", {
|
|
4587
|
-
className: "pricing-section"
|
|
4588
|
-
}, React.createElement("div", {
|
|
4589
|
-
className: "invitation_title"
|
|
4590
|
-
}, "How much cheaper?"), _map(data.personal_share_sales, function (pricing, index) {
|
|
4591
|
-
return React.createElement("div", {
|
|
4592
|
-
key: index,
|
|
4593
|
-
className: "pricing-section_wrapper"
|
|
4594
|
-
}, React.createElement("div", {
|
|
4595
|
-
className: "pricing-section_label"
|
|
4596
|
-
}, pricing.label, pricing.subLabel && React.createElement("div", {
|
|
4597
|
-
className: "pricing-section_sublabel"
|
|
4598
|
-
}, pricing.subLabel)), React.createElement("div", {
|
|
4599
|
-
className: "pricing-section_price"
|
|
4600
|
-
}, ' ', pricing.price));
|
|
4601
|
-
}))))));
|
|
4602
|
-
};
|
|
4603
|
-
|
|
4604
|
-
var getTicketSelectOptions = function getTicketSelectOptions(maxCount, minCount, multiplier) {
|
|
4605
|
-
if (maxCount === void 0) {
|
|
4606
|
-
maxCount = 10;
|
|
4607
|
-
}
|
|
4608
|
-
|
|
4609
|
-
if (minCount === void 0) {
|
|
4610
|
-
minCount = 1;
|
|
4611
|
-
}
|
|
4612
|
-
|
|
4613
|
-
if (multiplier === void 0) {
|
|
4614
|
-
multiplier = 1;
|
|
4615
|
-
}
|
|
4616
|
-
|
|
4617
|
-
var options = [{
|
|
4618
|
-
label: 0,
|
|
4619
|
-
value: 0
|
|
4620
|
-
}];
|
|
4621
|
-
|
|
4622
|
-
for (var i = minCount; i <= Math.min(50, maxCount); i += multiplier) {
|
|
4623
|
-
options.push({
|
|
4624
|
-
label: i,
|
|
4625
|
-
value: i
|
|
4626
|
-
});
|
|
4627
|
-
}
|
|
4628
|
-
|
|
4629
|
-
return options;
|
|
4630
|
-
};
|
|
4631
|
-
|
|
4632
|
-
var TicketRow = function TicketRow(_ref) {
|
|
4633
|
-
var ticketTier = _ref.ticketTier,
|
|
4634
|
-
prevTicketTier = _ref.prevTicketTier,
|
|
4635
|
-
selectedTickets = _ref.selectedTickets,
|
|
4636
|
-
handleTicketSelect = _ref.handleTicketSelect;
|
|
4637
|
-
var soldOutMessage = ticketTier.soldOutMessage ? ("" + ticketTier.soldOutMessage).toUpperCase() : 'SOLD OUT';
|
|
4638
|
-
var isSalesClosed = !ticketTier.salesStarted || ticketTier.salesEnded;
|
|
4639
|
-
var options = getTicketSelectOptions(ticketTier.maxQuantity, ticketTier.minQuantity, ticketTier.multiplier);
|
|
4640
|
-
var ticketsClosedMessage = !ticketTier.salesStarted ? 'Sales not started' : 'Sales Ended';
|
|
4641
|
-
var onSaleContent = React.createElement("div", {
|
|
4642
|
-
className: "get-tickets"
|
|
4643
|
-
}, React.createElement(Box, {
|
|
4644
|
-
className: "get-tickets__selectbox"
|
|
4645
|
-
}, React.createElement(FormControl$1, {
|
|
4646
|
-
fullWidth: true
|
|
4647
|
-
}, React.createElement(Select, {
|
|
4648
|
-
sx: {
|
|
4649
|
-
borderRadius: 0
|
|
4650
|
-
},
|
|
4651
|
-
value: selectedTickets[ticketTier.id] ? selectedTickets[ticketTier.id] : 0,
|
|
4652
|
-
onChange: handleTicketSelect,
|
|
4653
|
-
displayEmpty: true,
|
|
4654
|
-
inputProps: {
|
|
4655
|
-
'aria-label': 'Without label'
|
|
4656
|
-
},
|
|
4657
|
-
MenuProps: {
|
|
4658
|
-
PaperProps: {
|
|
4659
|
-
sx: {
|
|
4660
|
-
maxHeight: 150
|
|
4661
|
-
},
|
|
4662
|
-
className: 'get-tickets-paper'
|
|
4663
|
-
}
|
|
4664
|
-
}
|
|
4665
|
-
}, options.map(function (option, index) {
|
|
4666
|
-
return React.createElement(MenuItem, {
|
|
4603
|
+
}, hasCopyIcon ? React.createElement("img", {
|
|
4604
|
+
src: "https://img.icons8.com/office/50/000000/copy.png",
|
|
4605
|
+
alt: "copy"
|
|
4606
|
+
}) : React.createElement("span", {
|
|
4607
|
+
className: 'copy-icon'
|
|
4608
|
+
}, "Copy")))), (showDefaultShareButtons || !!shareButtons.length) && React.createElement(SocialButtons, {
|
|
4609
|
+
showDefaultShareButtons: showDefaultShareButtons,
|
|
4610
|
+
name: data.product_name,
|
|
4611
|
+
appId: messengerAppId,
|
|
4612
|
+
shareLink: data.personal_share_link,
|
|
4613
|
+
shareButtons: shareButtons
|
|
4614
|
+
})))), React.createElement("div", {
|
|
4615
|
+
className: "pricing-section"
|
|
4616
|
+
}, React.createElement("div", {
|
|
4617
|
+
className: "invitation_title"
|
|
4618
|
+
}, "How much cheaper?"), _map(data.personal_share_sales, function (pricing, index) {
|
|
4619
|
+
return React.createElement("div", {
|
|
4667
4620
|
key: index,
|
|
4668
|
-
|
|
4669
|
-
},
|
|
4670
|
-
|
|
4671
|
-
|
|
4621
|
+
className: "pricing-section_wrapper"
|
|
4622
|
+
}, React.createElement("div", {
|
|
4623
|
+
className: "pricing-section_label"
|
|
4624
|
+
}, pricing.label, pricing.subLabel && React.createElement("div", {
|
|
4625
|
+
className: "pricing-section_sublabel"
|
|
4626
|
+
}, pricing.subLabel)), React.createElement("div", {
|
|
4627
|
+
className: "pricing-section_price"
|
|
4628
|
+
}, ' ', pricing.price));
|
|
4629
|
+
}))))));
|
|
4630
|
+
};
|
|
4672
4631
|
|
|
4673
|
-
|
|
4632
|
+
var isTimeExpired = function isTimeExpired(startDate, timezone) {
|
|
4633
|
+
return !moment(startDate).isAfter(moment.tz(moment(), timezone).format('YYYY-MM-DD HH:mm:ss'));
|
|
4634
|
+
};
|
|
4674
4635
|
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4678
|
-
|
|
4679
|
-
|
|
4680
|
-
|
|
4681
|
-
|
|
4682
|
-
|
|
4683
|
-
|
|
4636
|
+
function Countdown(_ref) {
|
|
4637
|
+
var startDate = _ref.startDate,
|
|
4638
|
+
_ref$timezone = _ref.timezone,
|
|
4639
|
+
timezone = _ref$timezone === void 0 ? moment.tz.guess() : _ref$timezone,
|
|
4640
|
+
_ref$title = _ref.title,
|
|
4641
|
+
title = _ref$title === void 0 ? '' : _ref$title,
|
|
4642
|
+
_ref$message = _ref.message,
|
|
4643
|
+
message = _ref$message === void 0 ? '' : _ref$message,
|
|
4644
|
+
_ref$showMessage = _ref.showMessage,
|
|
4645
|
+
showMessage = _ref$showMessage === void 0 ? false : _ref$showMessage,
|
|
4646
|
+
_ref$disableLeadingZe = _ref.disableLeadingZero,
|
|
4647
|
+
disableLeadingZero = _ref$disableLeadingZe === void 0 ? false : _ref$disableLeadingZe,
|
|
4648
|
+
_ref$callback = _ref.callback,
|
|
4649
|
+
callback = _ref$callback === void 0 ? function () {} : _ref$callback,
|
|
4650
|
+
isLoggedIn = _ref.isLoggedIn;
|
|
4684
4651
|
|
|
4685
|
-
|
|
4686
|
-
|
|
4652
|
+
var _useState = useState(''),
|
|
4653
|
+
duration = _useState[0],
|
|
4654
|
+
setDuration = _useState[1];
|
|
4687
4655
|
|
|
4688
|
-
var
|
|
4689
|
-
|
|
4690
|
-
|
|
4691
|
-
handleTicketSelect = _ref.handleTicketSelect,
|
|
4692
|
-
sortBySoldOut = _ref.sortBySoldOut,
|
|
4693
|
-
ticketsHeaderComponent = _ref.ticketsHeaderComponent,
|
|
4694
|
-
hideTicketsHeader = _ref.hideTicketsHeader;
|
|
4695
|
-
var sortedTicketsList = sortBySoldOut ? _sortBy(_sortBy(ticketsList, 'sortOrder'), 'soldOut') : _sortBy(ticketsList, 'sortOrder');
|
|
4696
|
-
return React.createElement(React.Fragment, null, !hideTicketsHeader && ticketsHeaderComponent, sortedTicketsList.map(function (ticket, i, arr) {
|
|
4697
|
-
var isSoldOut = ticket.sold_out || !ticket.displayTicket || ticket.soldOut;
|
|
4656
|
+
var _useState2 = useState(false),
|
|
4657
|
+
timeExpired = _useState2[0],
|
|
4658
|
+
setTimeExpired = _useState2[1];
|
|
4698
4659
|
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4660
|
+
useEffect(function () {
|
|
4661
|
+
setTimeExpired(isTimeExpired(startDate, timezone));
|
|
4662
|
+
}, []);
|
|
4663
|
+
useEffect(function () {
|
|
4664
|
+
var timer;
|
|
4703
4665
|
|
|
4704
|
-
|
|
4666
|
+
if (!timeExpired) {
|
|
4667
|
+
timer = setInterval(function () {
|
|
4668
|
+
if (isTimeExpired(startDate, timezone)) {
|
|
4669
|
+
clearInterval(timer);
|
|
4670
|
+
setTimeExpired(true);
|
|
4671
|
+
callback();
|
|
4672
|
+
return;
|
|
4673
|
+
}
|
|
4705
4674
|
|
|
4706
|
-
|
|
4707
|
-
|
|
4675
|
+
var currentDate = moment.tz(moment(), timezone).format('YYYY-MM-DD HH:mm:ss');
|
|
4676
|
+
var diffTime = moment(startDate).diff(currentDate);
|
|
4677
|
+
var duration = moment.duration(diffTime);
|
|
4678
|
+
var dateArr = {
|
|
4679
|
+
year: duration.years(),
|
|
4680
|
+
month: duration.months(),
|
|
4681
|
+
day: duration.days(),
|
|
4682
|
+
hour: duration.hours(),
|
|
4683
|
+
minute: duration.minutes(),
|
|
4684
|
+
second: duration.seconds()
|
|
4685
|
+
};
|
|
4686
|
+
var timeLeft = '';
|
|
4687
|
+
|
|
4688
|
+
for (var date in dateArr) {
|
|
4689
|
+
var unit = dateArr[date] === 1 ? date : date + 's';
|
|
4690
|
+
var val = dateArr[date];
|
|
4691
|
+
|
|
4692
|
+
if (!disableLeadingZero && String(dateArr[date]).length === 1) {
|
|
4693
|
+
val = '0' + dateArr[date];
|
|
4694
|
+
}
|
|
4695
|
+
|
|
4696
|
+
if (timeLeft) {
|
|
4697
|
+
timeLeft += ", " + val + " " + unit;
|
|
4698
|
+
} else if (dateArr[date]) {
|
|
4699
|
+
timeLeft += val + " " + unit;
|
|
4700
|
+
}
|
|
4701
|
+
}
|
|
4702
|
+
|
|
4703
|
+
setDuration(timeLeft);
|
|
4704
|
+
}, 1000);
|
|
4708
4705
|
}
|
|
4709
4706
|
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
|
|
4719
|
-
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
className: "old-price"
|
|
4723
|
-
}, "$ ", (+ticket.oldPrice).toFixed(2)), React.createElement("p", null, ticketPrice), !isSoldOut && !ticketIsFree && React.createElement("p", {
|
|
4724
|
-
className: "fees"
|
|
4725
|
-
}, ticket.feeIncluded ? '(incl. Fees)' : '(excl. Fees)')), React.createElement("div", {
|
|
4726
|
-
className: "event-detail__tier-state",
|
|
4727
|
-
style: {
|
|
4728
|
-
minWidth: 55
|
|
4729
|
-
}
|
|
4730
|
-
}, React.createElement(TicketRow, {
|
|
4731
|
-
ticketTier: ticket,
|
|
4732
|
-
prevTicketTier: arr[i - 1],
|
|
4733
|
-
selectedTickets: selectedTickets,
|
|
4734
|
-
handleTicketSelect: ticketSelect
|
|
4735
|
-
}))));
|
|
4736
|
-
}));
|
|
4737
|
-
};
|
|
4707
|
+
return function () {
|
|
4708
|
+
clearInterval(timer);
|
|
4709
|
+
};
|
|
4710
|
+
}, [timeExpired]);
|
|
4711
|
+
return React.createElement(React.Fragment, null, !timeExpired && duration && React.createElement("div", {
|
|
4712
|
+
className: "countdown " + (!isLoggedIn ? 'countdown-on-bottom' : '')
|
|
4713
|
+
}, React.createElement("div", null, React.createElement("p", {
|
|
4714
|
+
className: 'title'
|
|
4715
|
+
}, title), React.createElement("p", null, duration)), showMessage && React.createElement("p", {
|
|
4716
|
+
className: 'message'
|
|
4717
|
+
}, message)));
|
|
4718
|
+
}
|
|
4738
4719
|
|
|
4739
4720
|
var generateQuantity = function generateQuantity(n) {
|
|
4740
4721
|
var quantityList = [];
|
|
@@ -4895,70 +4876,11 @@ var WaitingList = function WaitingList(_ref) {
|
|
|
4895
4876
|
type: "submit",
|
|
4896
4877
|
variant: "contained",
|
|
4897
4878
|
className: "waiting-list-button"
|
|
4898
|
-
}, loading ? React.createElement(CircularProgress
|
|
4879
|
+
}, loading ? React.createElement(CircularProgress, {
|
|
4899
4880
|
size: "22px"
|
|
4900
4881
|
}) : 'ADD TO WAITING LIST')))));
|
|
4901
4882
|
};
|
|
4902
4883
|
|
|
4903
|
-
var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
4904
|
-
var code = _ref.code,
|
|
4905
|
-
codeIsApplied = _ref.codeIsApplied,
|
|
4906
|
-
showPromoInput = _ref.showPromoInput,
|
|
4907
|
-
setCode = _ref.setCode,
|
|
4908
|
-
setShowPromoInput = _ref.setShowPromoInput,
|
|
4909
|
-
updateTickets = _ref.updateTickets,
|
|
4910
|
-
setCodeIsApplied = _ref.setCodeIsApplied;
|
|
4911
|
-
var isPromoCodeHasValue = !!code.trim();
|
|
4912
|
-
|
|
4913
|
-
var renderInputField = function renderInputField() {
|
|
4914
|
-
return React.createElement("div", {
|
|
4915
|
-
className: "promo-code-block"
|
|
4916
|
-
}, React.createElement("div", {
|
|
4917
|
-
className: "promo-code-block"
|
|
4918
|
-
}, React.createElement("p", {
|
|
4919
|
-
className: "promo-code-text"
|
|
4920
|
-
}, "Promo code")), React.createElement("input", {
|
|
4921
|
-
className: "promo-code-input",
|
|
4922
|
-
placeholder: "",
|
|
4923
|
-
onChange: function onChange(e) {
|
|
4924
|
-
setCode(e.target.value);
|
|
4925
|
-
},
|
|
4926
|
-
onKeyPress: function onKeyPress(event) {
|
|
4927
|
-
if (event.key === 'Enter' && isPromoCodeHasValue) {
|
|
4928
|
-
setShowPromoInput(false);
|
|
4929
|
-
updateTickets(true, 'promo');
|
|
4930
|
-
}
|
|
4931
|
-
}
|
|
4932
|
-
}), React.createElement(Button$1, {
|
|
4933
|
-
className: "promo-submit-button",
|
|
4934
|
-
onClick: function onClick() {
|
|
4935
|
-
if (isPromoCodeHasValue) {
|
|
4936
|
-
setShowPromoInput(false);
|
|
4937
|
-
updateTickets(true, 'promo');
|
|
4938
|
-
}
|
|
4939
|
-
}
|
|
4940
|
-
}, "APPLY"));
|
|
4941
|
-
};
|
|
4942
|
-
|
|
4943
|
-
return React.createElement("div", null, codeIsApplied ? React.createElement("div", {
|
|
4944
|
-
className: "alert-info"
|
|
4945
|
-
}, React.createElement(SVG, {
|
|
4946
|
-
src: getImage('done.svg'),
|
|
4947
|
-
preProcessor: function preProcessor(code) {
|
|
4948
|
-
return code.replace(/fill=".*?"/g, 'fill="currentColor"');
|
|
4949
|
-
}
|
|
4950
|
-
}), React.createElement("p", {
|
|
4951
|
-
className: "promo-code-success"
|
|
4952
|
-
}, "PROMO CODE APPLIED SUCCESSFULLY")) : null, !showPromoInput && React.createElement(Button$1, {
|
|
4953
|
-
className: "promo-code-button",
|
|
4954
|
-
placeholder: "Promo Codes",
|
|
4955
|
-
onClick: function onClick() {
|
|
4956
|
-
setCodeIsApplied(false);
|
|
4957
|
-
setShowPromoInput(true);
|
|
4958
|
-
}
|
|
4959
|
-
}, "Got a promo code? Click here"), showPromoInput && renderInputField());
|
|
4960
|
-
};
|
|
4961
|
-
|
|
4962
4884
|
var AccessCodeSection = function AccessCodeSection(_ref) {
|
|
4963
4885
|
var code = _ref.code,
|
|
4964
4886
|
setCode = _ref.setCode,
|
|
@@ -4991,93 +4913,64 @@ var AccessCodeSection = function AccessCodeSection(_ref) {
|
|
|
4991
4913
|
}, "ENTER"));
|
|
4992
4914
|
};
|
|
4993
4915
|
|
|
4994
|
-
var
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
title = _ref$title === void 0 ? '' : _ref$title,
|
|
5004
|
-
_ref$message = _ref.message,
|
|
5005
|
-
message = _ref$message === void 0 ? '' : _ref$message,
|
|
5006
|
-
_ref$showMessage = _ref.showMessage,
|
|
5007
|
-
showMessage = _ref$showMessage === void 0 ? false : _ref$showMessage,
|
|
5008
|
-
_ref$disableLeadingZe = _ref.disableLeadingZero,
|
|
5009
|
-
disableLeadingZero = _ref$disableLeadingZe === void 0 ? false : _ref$disableLeadingZe,
|
|
5010
|
-
_ref$callback = _ref.callback,
|
|
5011
|
-
callback = _ref$callback === void 0 ? function () {} : _ref$callback,
|
|
5012
|
-
isLoggedIn = _ref.isLoggedIn;
|
|
5013
|
-
|
|
5014
|
-
var _useState = useState(''),
|
|
5015
|
-
duration = _useState[0],
|
|
5016
|
-
setDuration = _useState[1];
|
|
5017
|
-
|
|
5018
|
-
var _useState2 = useState(false),
|
|
5019
|
-
timeExpired = _useState2[0],
|
|
5020
|
-
setTimeExpired = _useState2[1];
|
|
5021
|
-
|
|
5022
|
-
useEffect(function () {
|
|
5023
|
-
setTimeExpired(isTimeExpired(startDate, timezone));
|
|
5024
|
-
}, []);
|
|
5025
|
-
useEffect(function () {
|
|
5026
|
-
var timer;
|
|
4916
|
+
var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
4917
|
+
var code = _ref.code,
|
|
4918
|
+
codeIsApplied = _ref.codeIsApplied,
|
|
4919
|
+
showPromoInput = _ref.showPromoInput,
|
|
4920
|
+
setCode = _ref.setCode,
|
|
4921
|
+
setShowPromoInput = _ref.setShowPromoInput,
|
|
4922
|
+
updateTickets = _ref.updateTickets,
|
|
4923
|
+
setCodeIsApplied = _ref.setCodeIsApplied;
|
|
4924
|
+
var isPromoCodeHasValue = !!code.trim();
|
|
5027
4925
|
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
4926
|
+
var renderInputField = function renderInputField() {
|
|
4927
|
+
return React.createElement("div", {
|
|
4928
|
+
className: "promo-code-block"
|
|
4929
|
+
}, React.createElement("div", {
|
|
4930
|
+
className: "promo-code-block"
|
|
4931
|
+
}, React.createElement("p", {
|
|
4932
|
+
className: "promo-code-text"
|
|
4933
|
+
}, "Promo code")), React.createElement("input", {
|
|
4934
|
+
className: "promo-code-input",
|
|
4935
|
+
placeholder: "",
|
|
4936
|
+
onChange: function onChange(e) {
|
|
4937
|
+
setCode(e.target.value);
|
|
4938
|
+
},
|
|
4939
|
+
onKeyPress: function onKeyPress(event) {
|
|
4940
|
+
if (event.key === 'Enter' && isPromoCodeHasValue) {
|
|
4941
|
+
setShowPromoInput(false);
|
|
4942
|
+
updateTickets(true, 'promo');
|
|
5035
4943
|
}
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
day: duration.days(),
|
|
5044
|
-
hour: duration.hours(),
|
|
5045
|
-
minute: duration.minutes(),
|
|
5046
|
-
second: duration.seconds()
|
|
5047
|
-
};
|
|
5048
|
-
var timeLeft = '';
|
|
5049
|
-
|
|
5050
|
-
for (var date in dateArr) {
|
|
5051
|
-
var unit = dateArr[date] === 1 ? date : date + 's';
|
|
5052
|
-
var val = dateArr[date];
|
|
5053
|
-
|
|
5054
|
-
if (!disableLeadingZero && String(dateArr[date]).length === 1) {
|
|
5055
|
-
val = '0' + dateArr[date];
|
|
5056
|
-
}
|
|
5057
|
-
|
|
5058
|
-
if (timeLeft) {
|
|
5059
|
-
timeLeft += ", " + val + " " + unit;
|
|
5060
|
-
} else if (dateArr[date]) {
|
|
5061
|
-
timeLeft += val + " " + unit;
|
|
5062
|
-
}
|
|
4944
|
+
}
|
|
4945
|
+
}), React.createElement(Button$1, {
|
|
4946
|
+
className: "promo-submit-button",
|
|
4947
|
+
onClick: function onClick() {
|
|
4948
|
+
if (isPromoCodeHasValue) {
|
|
4949
|
+
setShowPromoInput(false);
|
|
4950
|
+
updateTickets(true, 'promo');
|
|
5063
4951
|
}
|
|
4952
|
+
}
|
|
4953
|
+
}, "APPLY"));
|
|
4954
|
+
};
|
|
5064
4955
|
|
|
5065
|
-
|
|
5066
|
-
|
|
4956
|
+
return React.createElement("div", null, codeIsApplied ? React.createElement("div", {
|
|
4957
|
+
className: "alert-info"
|
|
4958
|
+
}, React.createElement(SVG, {
|
|
4959
|
+
src: getImage('done.svg'),
|
|
4960
|
+
preProcessor: function preProcessor(code) {
|
|
4961
|
+
return code.replace(/fill=".*?"/g, 'fill="currentColor"');
|
|
5067
4962
|
}
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
},
|
|
5078
|
-
|
|
5079
|
-
}, message)));
|
|
5080
|
-
}
|
|
4963
|
+
}), React.createElement("p", {
|
|
4964
|
+
className: "promo-code-success"
|
|
4965
|
+
}, "PROMO CODE APPLIED SUCCESSFULLY")) : null, !showPromoInput && React.createElement(Button$1, {
|
|
4966
|
+
className: "promo-code-button",
|
|
4967
|
+
placeholder: "Promo Codes",
|
|
4968
|
+
onClick: function onClick() {
|
|
4969
|
+
setCodeIsApplied(false);
|
|
4970
|
+
setShowPromoInput(true);
|
|
4971
|
+
}
|
|
4972
|
+
}, "Got a promo code? Click here"), showPromoInput && renderInputField());
|
|
4973
|
+
};
|
|
5081
4974
|
|
|
5082
4975
|
var ReferralLogic = function ReferralLogic(props) {
|
|
5083
4976
|
var eventId = props.eventId;
|
|
@@ -5121,6 +5014,141 @@ var ReferralLogic = function ReferralLogic(props) {
|
|
|
5121
5014
|
return null;
|
|
5122
5015
|
};
|
|
5123
5016
|
|
|
5017
|
+
var getTicketSelectOptions = function getTicketSelectOptions(maxCount, minCount, multiplier) {
|
|
5018
|
+
if (maxCount === void 0) {
|
|
5019
|
+
maxCount = 10;
|
|
5020
|
+
}
|
|
5021
|
+
|
|
5022
|
+
if (minCount === void 0) {
|
|
5023
|
+
minCount = 1;
|
|
5024
|
+
}
|
|
5025
|
+
|
|
5026
|
+
if (multiplier === void 0) {
|
|
5027
|
+
multiplier = 1;
|
|
5028
|
+
}
|
|
5029
|
+
|
|
5030
|
+
var options = [{
|
|
5031
|
+
label: 0,
|
|
5032
|
+
value: 0
|
|
5033
|
+
}];
|
|
5034
|
+
|
|
5035
|
+
for (var i = minCount; i <= Math.min(50, maxCount); i += multiplier) {
|
|
5036
|
+
options.push({
|
|
5037
|
+
label: i,
|
|
5038
|
+
value: i
|
|
5039
|
+
});
|
|
5040
|
+
}
|
|
5041
|
+
|
|
5042
|
+
return options;
|
|
5043
|
+
};
|
|
5044
|
+
|
|
5045
|
+
var TicketRow = function TicketRow(_ref) {
|
|
5046
|
+
var ticketTier = _ref.ticketTier,
|
|
5047
|
+
prevTicketTier = _ref.prevTicketTier,
|
|
5048
|
+
selectedTickets = _ref.selectedTickets,
|
|
5049
|
+
handleTicketSelect = _ref.handleTicketSelect;
|
|
5050
|
+
var soldOutMessage = ticketTier.soldOutMessage ? ("" + ticketTier.soldOutMessage).toUpperCase() : 'SOLD OUT';
|
|
5051
|
+
var isSalesClosed = !ticketTier.salesStarted || ticketTier.salesEnded;
|
|
5052
|
+
var options = getTicketSelectOptions(ticketTier.maxQuantity, ticketTier.minQuantity, ticketTier.multiplier);
|
|
5053
|
+
var ticketsClosedMessage = !ticketTier.salesStarted ? 'Sales not started' : 'Sales Ended';
|
|
5054
|
+
var onSaleContent = React.createElement("div", {
|
|
5055
|
+
className: "get-tickets"
|
|
5056
|
+
}, React.createElement(Box$1, {
|
|
5057
|
+
className: "get-tickets__selectbox"
|
|
5058
|
+
}, React.createElement(FormControl$1, {
|
|
5059
|
+
fullWidth: true
|
|
5060
|
+
}, React.createElement(Select, {
|
|
5061
|
+
sx: {
|
|
5062
|
+
borderRadius: 0
|
|
5063
|
+
},
|
|
5064
|
+
value: selectedTickets[ticketTier.id] ? selectedTickets[ticketTier.id] : 0,
|
|
5065
|
+
onChange: handleTicketSelect,
|
|
5066
|
+
displayEmpty: true,
|
|
5067
|
+
inputProps: {
|
|
5068
|
+
'aria-label': 'Without label'
|
|
5069
|
+
},
|
|
5070
|
+
MenuProps: {
|
|
5071
|
+
PaperProps: {
|
|
5072
|
+
sx: {
|
|
5073
|
+
maxHeight: 150
|
|
5074
|
+
},
|
|
5075
|
+
className: 'get-tickets-paper'
|
|
5076
|
+
}
|
|
5077
|
+
}
|
|
5078
|
+
}, options.map(function (option, index) {
|
|
5079
|
+
return React.createElement(MenuItem, {
|
|
5080
|
+
key: index,
|
|
5081
|
+
value: option.value
|
|
5082
|
+
}, option.value);
|
|
5083
|
+
})))));
|
|
5084
|
+
var returnValue = ''; // ticketTier.soldOut === false --> means that ticket is in the stock
|
|
5085
|
+
|
|
5086
|
+
var isSoldOut = ticketTier.sold_out || !ticketTier.displayTicket || ticketTier.soldOut || ticketTier.soldOut === false;
|
|
5087
|
+
|
|
5088
|
+
if (isSoldOut) {
|
|
5089
|
+
returnValue = soldOutMessage;
|
|
5090
|
+
} else if (isSalesClosed) {
|
|
5091
|
+
returnValue = ticketsClosedMessage;
|
|
5092
|
+
} else if (ticketTier.displayTicket && ticketTier.maxQuantity) {
|
|
5093
|
+
returnValue = onSaleContent;
|
|
5094
|
+
} else if (_get(prevTicketTier, 'in_stock')) {
|
|
5095
|
+
returnValue = 'SOON';
|
|
5096
|
+
}
|
|
5097
|
+
|
|
5098
|
+
return React.createElement(React.Fragment, null, returnValue, " ");
|
|
5099
|
+
};
|
|
5100
|
+
|
|
5101
|
+
var TicketsSection = function TicketsSection(_ref) {
|
|
5102
|
+
var ticketsList = _ref.ticketsList,
|
|
5103
|
+
selectedTickets = _ref.selectedTickets,
|
|
5104
|
+
handleTicketSelect = _ref.handleTicketSelect,
|
|
5105
|
+
sortBySoldOut = _ref.sortBySoldOut,
|
|
5106
|
+
ticketsHeaderComponent = _ref.ticketsHeaderComponent,
|
|
5107
|
+
hideTicketsHeader = _ref.hideTicketsHeader;
|
|
5108
|
+
var sortedTicketsList = sortBySoldOut ? _sortBy(_sortBy(ticketsList, 'sortOrder'), 'soldOut') : _sortBy(ticketsList, 'sortOrder');
|
|
5109
|
+
return React.createElement(React.Fragment, null, !hideTicketsHeader && ticketsHeaderComponent, sortedTicketsList.map(function (ticket, i, arr) {
|
|
5110
|
+
var isSoldOut = ticket.sold_out || !ticket.displayTicket || ticket.soldOut;
|
|
5111
|
+
|
|
5112
|
+
var ticketSelect = function ticketSelect(event) {
|
|
5113
|
+
var value = event.target.value;
|
|
5114
|
+
handleTicketSelect(ticket.id, value);
|
|
5115
|
+
};
|
|
5116
|
+
|
|
5117
|
+
var ticketIsDiscounted = false;
|
|
5118
|
+
|
|
5119
|
+
if (ticket.oldPrice && !isSoldOut && ticket.oldPrice !== ticket.price) {
|
|
5120
|
+
ticketIsDiscounted = true;
|
|
5121
|
+
}
|
|
5122
|
+
|
|
5123
|
+
var ticketIsFree = +ticket.price === 0;
|
|
5124
|
+
var ticketPrice = isSoldOut ? 'SOLD OUT' : ticketIsFree ? 'FREE' : "$ " + (+ticket.price).toFixed(2);
|
|
5125
|
+
return React.createElement("div", {
|
|
5126
|
+
key: ticket.id || ticket.name,
|
|
5127
|
+
className: "event-detail__tier " + (isSoldOut ? 'disabled' : '')
|
|
5128
|
+
}, React.createElement("div", {
|
|
5129
|
+
className: "event-detail__tier-name"
|
|
5130
|
+
}, ticket.displayName || ticket.name), React.createElement("div", {
|
|
5131
|
+
className: "event-tickets-container"
|
|
5132
|
+
}, React.createElement("div", {
|
|
5133
|
+
className: "event-detail__tier-price"
|
|
5134
|
+
}, ticketIsDiscounted && React.createElement("p", {
|
|
5135
|
+
className: "old-price"
|
|
5136
|
+
}, "$ ", (+ticket.oldPrice).toFixed(2)), React.createElement("p", null, ticketPrice), !isSoldOut && !ticketIsFree && React.createElement("p", {
|
|
5137
|
+
className: "fees"
|
|
5138
|
+
}, ticket.feeIncluded ? '(incl. Fees)' : '(excl. Fees)')), React.createElement("div", {
|
|
5139
|
+
className: "event-detail__tier-state",
|
|
5140
|
+
style: {
|
|
5141
|
+
minWidth: 55
|
|
5142
|
+
}
|
|
5143
|
+
}, React.createElement(TicketRow, {
|
|
5144
|
+
ticketTier: ticket,
|
|
5145
|
+
prevTicketTier: arr[i - 1],
|
|
5146
|
+
selectedTickets: selectedTickets,
|
|
5147
|
+
handleTicketSelect: ticketSelect
|
|
5148
|
+
}))));
|
|
5149
|
+
}));
|
|
5150
|
+
};
|
|
5151
|
+
|
|
5124
5152
|
var TicketsContainer = function TicketsContainer(_ref) {
|
|
5125
5153
|
var onLoginSuccess = _ref.onLoginSuccess,
|
|
5126
5154
|
getTicketsLabel = _ref.getTicketsLabel,
|
|
@@ -5164,7 +5192,9 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5164
5192
|
ActionsSectionComponent = _ref.actionsSectionComponent,
|
|
5165
5193
|
ticketsHeaderComponent = _ref.ticketsHeaderComponent,
|
|
5166
5194
|
_ref$hideTicketsHeade = _ref.hideTicketsHeader,
|
|
5167
|
-
hideTicketsHeader = _ref$hideTicketsHeade === void 0 ? false : _ref$hideTicketsHeade
|
|
5195
|
+
hideTicketsHeader = _ref$hideTicketsHeade === void 0 ? false : _ref$hideTicketsHeade,
|
|
5196
|
+
_ref$enableInfluencer = _ref.enableInfluencersSection,
|
|
5197
|
+
enableInfluencersSection = _ref$enableInfluencer === void 0 ? true : _ref$enableInfluencer;
|
|
5168
5198
|
|
|
5169
5199
|
var _useState = useState({}),
|
|
5170
5200
|
selectedTickets = _useState[0],
|
|
@@ -5571,6 +5601,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5571
5601
|
}) : null;
|
|
5572
5602
|
var externalUrl = event == null ? void 0 : event.redirectUrl;
|
|
5573
5603
|
var eventSaleIsNotStarted = !(event != null && event.salesStarted) && (event == null ? void 0 : event.salesStart);
|
|
5604
|
+
var influencers = event != null && event.referralsEnabled ? event == null ? void 0 : event.referrals : [];
|
|
5574
5605
|
return React.createElement(ThemeProvider$1, {
|
|
5575
5606
|
theme: themeMui
|
|
5576
5607
|
}, !isLoading && React.createElement(ReferralLogic, {
|
|
@@ -5634,7 +5665,18 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5634
5665
|
}, "Log out"))) : ''), showLoginModal ? React.createElement(LoginModal, {
|
|
5635
5666
|
onClose: handleOnClose,
|
|
5636
5667
|
onLogin: handleOnLogin
|
|
5637
|
-
}) : null)
|
|
5668
|
+
}) : null), enableInfluencersSection && influencers.length ? React.createElement("div", {
|
|
5669
|
+
className: "event-influencers"
|
|
5670
|
+
}, React.createElement("h3", null, React.createElement("span", null, "TOP"), " INFLUENCERS"), React.createElement("ol", {
|
|
5671
|
+
className: "influencer-list"
|
|
5672
|
+
}, influencers.map(function (influencer, i) {
|
|
5673
|
+
var _influencer$lastName;
|
|
5674
|
+
|
|
5675
|
+
return React.createElement("li", {
|
|
5676
|
+
className: "influencer-item",
|
|
5677
|
+
key: i
|
|
5678
|
+
}, influencer.firstName + " " + ((_influencer$lastName = influencer.lastName) == null ? void 0 : _influencer$lastName.charAt(0)), ' ');
|
|
5679
|
+
}))) : null);
|
|
5638
5680
|
};
|
|
5639
5681
|
|
|
5640
5682
|
var EventInfoItem = function EventInfoItem(_ref) {
|
|
@@ -5844,7 +5886,7 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
5844
5886
|
width: 300
|
|
5845
5887
|
},
|
|
5846
5888
|
renderInput: function renderInput(params) {
|
|
5847
|
-
return React.createElement(TextField
|
|
5889
|
+
return React.createElement(TextField, Object.assign({}, params, {
|
|
5848
5890
|
label: "Events"
|
|
5849
5891
|
}));
|
|
5850
5892
|
}
|
|
@@ -5853,7 +5895,7 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
5853
5895
|
className: "clear"
|
|
5854
5896
|
}, "CLEAR")), loading ? React.createElement("div", {
|
|
5855
5897
|
className: "loading"
|
|
5856
|
-
}, React.createElement(CircularProgress
|
|
5898
|
+
}, React.createElement(CircularProgress, null)) : React.createElement(React.Fragment, null, React.createElement(TableContainer, {
|
|
5857
5899
|
component: Paper,
|
|
5858
5900
|
className: "my-ticket-table"
|
|
5859
5901
|
}, React.createElement(Table, {
|
|
@@ -6004,7 +6046,7 @@ var TicketsTable = function TicketsTable(_ref) {
|
|
|
6004
6046
|
})))));
|
|
6005
6047
|
};
|
|
6006
6048
|
|
|
6007
|
-
var _excluded$2 = ["label", "field", "theme"];
|
|
6049
|
+
var _excluded$2 = ["label", "field", "theme", "disableDropdown"];
|
|
6008
6050
|
var RadioField = function RadioField(_ref) {
|
|
6009
6051
|
var label = _ref.label,
|
|
6010
6052
|
field = _ref.field,
|
|
@@ -6082,13 +6124,13 @@ var TicketResaleModal = function TicketResaleModal(_ref) {
|
|
|
6082
6124
|
currency = ticket.currency,
|
|
6083
6125
|
resale_fee_amount = ticket.resale_fee_amount,
|
|
6084
6126
|
ticket_type_is_active = ticket.ticket_type_is_active;
|
|
6085
|
-
return React.createElement(Modal, {
|
|
6127
|
+
return React.createElement(Modal$1, {
|
|
6086
6128
|
open: true,
|
|
6087
6129
|
onClose: onClose,
|
|
6088
6130
|
"aria-labelledby": "modal-modal-title",
|
|
6089
6131
|
"aria-describedby": "modal-modal-description",
|
|
6090
6132
|
className: 'resale-modal'
|
|
6091
|
-
}, React.createElement(Box, {
|
|
6133
|
+
}, React.createElement(Box$1, {
|
|
6092
6134
|
style: style$3
|
|
6093
6135
|
}, 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, {
|
|
6094
6136
|
initialValues: initialValues,
|
|
@@ -6195,13 +6237,13 @@ var ConfirmModal = function ConfirmModal(_ref) {
|
|
|
6195
6237
|
onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
|
|
6196
6238
|
_ref$onConfirm = _ref.onConfirm,
|
|
6197
6239
|
onConfirm = _ref$onConfirm === void 0 ? function () {} : _ref$onConfirm;
|
|
6198
|
-
return React.createElement(Modal, {
|
|
6240
|
+
return React.createElement(Modal$1, {
|
|
6199
6241
|
open: true,
|
|
6200
6242
|
onClose: onClose,
|
|
6201
6243
|
"aria-labelledby": "modal-modal-title",
|
|
6202
6244
|
"aria-describedby": "modal-modal-description",
|
|
6203
6245
|
className: 'confirm-modal'
|
|
6204
|
-
}, React.createElement(Box, {
|
|
6246
|
+
}, React.createElement(Box$1, {
|
|
6205
6247
|
style: style$4
|
|
6206
6248
|
}, React.createElement("p", null, message), React.createElement("div", {
|
|
6207
6249
|
className: 'footer'
|
|
@@ -6439,7 +6481,7 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
6439
6481
|
className: "order-details"
|
|
6440
6482
|
}, loading ? React.createElement("div", {
|
|
6441
6483
|
className: "loading"
|
|
6442
|
-
}, React.createElement(CircularProgress
|
|
6484
|
+
}, React.createElement(CircularProgress, null)) : React.createElement(React.Fragment, null, React.createElement("h1", {
|
|
6443
6485
|
className: "layout-title"
|
|
6444
6486
|
}, "Order Details"), React.createElement("div", {
|
|
6445
6487
|
className: "order-summary-box"
|
|
@@ -6474,7 +6516,9 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
6474
6516
|
alt: "Icon"
|
|
6475
6517
|
}), data == null ? void 0 : data.personal_share_link)), React.createElement("div", {
|
|
6476
6518
|
className: "link-item"
|
|
6477
|
-
}, React.createElement("p", null, "So far, you\u2019ve referred " + data.sales_referred + " tickets"))), React.createElement(
|
|
6519
|
+
}, React.createElement("p", null, "So far, you\u2019ve referred " + data.sales_referred + " tickets"))), data != null && data.sales_referred ? React.createElement("div", {
|
|
6520
|
+
className: "total-referrer"
|
|
6521
|
+
}, React.createElement("b", null, "So far, you've referred ", data.sales_referred, " tickets.")) : null, React.createElement(TableContainer, {
|
|
6478
6522
|
component: Paper
|
|
6479
6523
|
}, React.createElement(Table, {
|
|
6480
6524
|
className: "tt-type",
|
|
@@ -6626,7 +6670,7 @@ var ResetPasswordContainer = function ResetPasswordContainer(_ref) {
|
|
|
6626
6670
|
}, React.createElement("button", {
|
|
6627
6671
|
type: "submit",
|
|
6628
6672
|
disabled: !(isValid && dirty)
|
|
6629
|
-
}, loading ? React.createElement(CircularProgress, {
|
|
6673
|
+
}, loading ? React.createElement(CircularProgress$1, {
|
|
6630
6674
|
size: "22px"
|
|
6631
6675
|
}) : 'Submit')));
|
|
6632
6676
|
}));
|
|
@@ -6761,12 +6805,12 @@ var RedirectModal = function RedirectModal(_ref) {
|
|
|
6761
6805
|
message = _ref$message === void 0 ? 'Your cart has expired. Please click on "OK" to return to the ticket selection page.' : _ref$message,
|
|
6762
6806
|
_ref$onClickOk = _ref.onClickOk,
|
|
6763
6807
|
onClickOk = _ref$onClickOk === void 0 ? function () {} : _ref$onClickOk;
|
|
6764
|
-
return React.createElement(Modal, {
|
|
6808
|
+
return React.createElement(Modal$1, {
|
|
6765
6809
|
open: true,
|
|
6766
6810
|
"aria-labelledby": "modal-modal-title",
|
|
6767
6811
|
"aria-describedby": "modal-modal-description",
|
|
6768
6812
|
className: "redirect-modal"
|
|
6769
|
-
}, React.createElement(Box, {
|
|
6813
|
+
}, React.createElement(Box$1, {
|
|
6770
6814
|
style: style$5
|
|
6771
6815
|
}, React.createElement("p", null, message), React.createElement("div", {
|
|
6772
6816
|
className: "footer"
|
|
@@ -6874,13 +6918,13 @@ var RsvpContainer = function RsvpContainer(_ref) {
|
|
|
6874
6918
|
return null;
|
|
6875
6919
|
}
|
|
6876
6920
|
|
|
6877
|
-
return React.createElement(React.Fragment, null, React.createElement(Modal, {
|
|
6921
|
+
return React.createElement(React.Fragment, null, React.createElement(Modal$1, {
|
|
6878
6922
|
open: modal.isOpen,
|
|
6879
6923
|
onClose: handleModalClose,
|
|
6880
6924
|
"aria-labelledby": "modal-modal-title",
|
|
6881
6925
|
"aria-describedby": "modal-modal-description",
|
|
6882
6926
|
className: "rsvp-modal"
|
|
6883
|
-
}, React.createElement(Box, {
|
|
6927
|
+
}, React.createElement(Box$1, {
|
|
6884
6928
|
style: style$6,
|
|
6885
6929
|
className: "rsvp-modal-box"
|
|
6886
6930
|
}, React.createElement("div", {
|