tf-checkout-react 1.3.42 → 1.3.43
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/utils.d.ts +4 -0
- package/dist/components/common/CheckboxField.d.ts +1 -1
- package/dist/components/common/CustomField.d.ts +5 -3
- package/dist/components/common/DatePickerField.d.ts +1 -1
- package/dist/components/common/RadioGroupField/index.d.ts +5 -5
- package/dist/components/common/SelectField/index.d.ts +3 -2
- package/dist/components/common/index.d.ts +1 -0
- package/dist/components/ticketsContainer/PromoCodeSection.d.ts +2 -1
- package/dist/components/ticketsContainer/index.d.ts +2 -1
- package/dist/tf-checkout-react.cjs.development.js +979 -898
- 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 +1004 -923
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/{dist → src/components}/.DS_Store +0 -0
- package/src/components/billing-info-container/index.tsx +21 -68
- package/src/components/billing-info-container/utils.ts +81 -12
- package/src/components/common/CheckboxField.tsx +2 -0
- package/src/components/common/CustomField.tsx +10 -1
- package/src/components/common/DatePickerField.tsx +40 -37
- package/src/components/common/RadioGroupField/index.tsx +13 -8
- package/src/components/common/SelectField/index.tsx +33 -9
- package/src/components/common/dist/PhoneNumberField.js +96 -0
- package/src/components/common/index.tsx +1 -0
- package/src/components/ticketsContainer/PromoCodeSection.tsx +4 -2
- package/src/components/ticketsContainer/index.tsx +6 -1
- package/src/assets/.DS_Store +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Snackbar, Alert, Modal, Box, CircularProgress, TextField as TextField$1, FormControl, FormHelperText, InputLabel, createTheme as createTheme$1 } from '@mui/material';
|
|
2
2
|
import Backdrop from '@mui/material/Backdrop';
|
|
3
3
|
import Button from '@mui/material/Button';
|
|
4
4
|
import { ThemeProvider, createTheme } from '@mui/material/styles';
|
|
@@ -12,21 +12,26 @@ import _isEmpty from 'lodash-es/isEmpty';
|
|
|
12
12
|
import _isEqual from 'lodash-es/isEqual';
|
|
13
13
|
import _map from 'lodash-es/map';
|
|
14
14
|
import { nanoid } from 'nanoid';
|
|
15
|
-
import React, { Component, useEffect, useState, useRef,
|
|
15
|
+
import React, { Component, useEffect, useState, useRef, memo, useCallback, Fragment } from 'react';
|
|
16
16
|
import _forEach from 'lodash-es/forEach';
|
|
17
|
-
import {
|
|
18
|
-
import { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment';
|
|
19
|
-
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
|
|
17
|
+
import { object, string, ref, boolean } from 'yup';
|
|
20
18
|
import TextField from '@mui/material/TextField';
|
|
21
19
|
import { useTheme } from '@mui/styles';
|
|
22
20
|
import _isFunction from 'lodash-es/isFunction';
|
|
23
21
|
import _isObject from 'lodash-es/isObject';
|
|
22
|
+
import Box$1 from '@mui/material/Box';
|
|
23
|
+
import Modal$1 from '@mui/material/Modal';
|
|
24
|
+
import Countdown$1 from 'react-countdown';
|
|
25
|
+
import _isNumber from 'lodash-es/isNumber';
|
|
26
|
+
import SVG from 'react-inlinesvg';
|
|
27
|
+
import _flatMapDeep from 'lodash-es/flatMapDeep';
|
|
28
|
+
import _isArray from 'lodash-es/isArray';
|
|
24
29
|
import Checkbox from '@mui/material/Checkbox';
|
|
25
30
|
import FormControlLabel from '@mui/material/FormControlLabel';
|
|
26
31
|
import FormGroup from '@mui/material/FormGroup';
|
|
27
32
|
import MuiPhoneNumber from 'material-ui-phone-number';
|
|
28
33
|
import _debounce from 'lodash-es/debounce';
|
|
29
|
-
import CircularProgress from '@mui/material/CircularProgress';
|
|
34
|
+
import CircularProgress$1 from '@mui/material/CircularProgress';
|
|
30
35
|
import Select from '@mui/material/Select';
|
|
31
36
|
import FormControl$1 from '@mui/material/FormControl';
|
|
32
37
|
import FormHelperText$1 from '@mui/material/FormHelperText';
|
|
@@ -36,14 +41,9 @@ import RadioGroup from '@mui/material/RadioGroup';
|
|
|
36
41
|
import ListItemText from '@mui/material/ListItemText';
|
|
37
42
|
import MenuItem from '@mui/material/MenuItem';
|
|
38
43
|
import OutlinedInput from '@mui/material/OutlinedInput';
|
|
39
|
-
import {
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import Countdown$1 from 'react-countdown';
|
|
43
|
-
import _isNumber from 'lodash-es/isNumber';
|
|
44
|
-
import SVG from 'react-inlinesvg';
|
|
45
|
-
import _flatMapDeep from 'lodash-es/flatMapDeep';
|
|
46
|
-
import _isArray from 'lodash-es/isArray';
|
|
44
|
+
import { DatePicker } from '@mui/x-date-pickers';
|
|
45
|
+
import { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment';
|
|
46
|
+
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
|
|
47
47
|
import Alert$1 from '@mui/material/Alert';
|
|
48
48
|
import Container from '@mui/material/Container';
|
|
49
49
|
import { useStripe, useElements, CardNumberElement, CardExpiryElement, CardCvcElement, Elements } from '@stripe/react-stripe-js';
|
|
@@ -1748,6 +1748,42 @@ var emailValidator = function emailValidator(email) {
|
|
|
1748
1748
|
return !emailRegex.test(email) ? 'Please enter a valid email address' : '';
|
|
1749
1749
|
};
|
|
1750
1750
|
|
|
1751
|
+
var SnackbarAlert = function SnackbarAlert(_ref) {
|
|
1752
|
+
var isOpen = _ref.isOpen,
|
|
1753
|
+
message = _ref.message,
|
|
1754
|
+
type = _ref.type,
|
|
1755
|
+
position = _ref.position,
|
|
1756
|
+
_ref$autoHideDuration = _ref.autoHideDuration,
|
|
1757
|
+
autoHideDuration = _ref$autoHideDuration === void 0 ? 3000 : _ref$autoHideDuration,
|
|
1758
|
+
variant = _ref.variant,
|
|
1759
|
+
onClose = _ref.onClose;
|
|
1760
|
+
return React.createElement("div", {
|
|
1761
|
+
className: "snackbar-alert-container"
|
|
1762
|
+
}, React.createElement(Snackbar, {
|
|
1763
|
+
autoHideDuration: autoHideDuration,
|
|
1764
|
+
open: isOpen,
|
|
1765
|
+
anchorOrigin: position || {
|
|
1766
|
+
vertical: 'top',
|
|
1767
|
+
horizontal: 'center'
|
|
1768
|
+
},
|
|
1769
|
+
onClose: onClose,
|
|
1770
|
+
classes: {
|
|
1771
|
+
root: 'snackbar-alert-snackbar-root'
|
|
1772
|
+
}
|
|
1773
|
+
}, React.createElement(Alert, {
|
|
1774
|
+
severity: type,
|
|
1775
|
+
onClose: onClose,
|
|
1776
|
+
variant: variant || 'filled',
|
|
1777
|
+
classes: {
|
|
1778
|
+
icon: 'snackbar-alert-icon',
|
|
1779
|
+
root: 'snackbar-alert-alert-root',
|
|
1780
|
+
action: 'snackbar-alert-action',
|
|
1781
|
+
message: 'snackbar-alert-message',
|
|
1782
|
+
filled: 'snackbar-alert-filled'
|
|
1783
|
+
}
|
|
1784
|
+
}, message)));
|
|
1785
|
+
};
|
|
1786
|
+
|
|
1751
1787
|
var CustomField = function CustomField(_ref2) {
|
|
1752
1788
|
var _ref$current;
|
|
1753
1789
|
|
|
@@ -1766,7 +1802,11 @@ var CustomField = function CustomField(_ref2) {
|
|
|
1766
1802
|
pInputProps = _ref2$inputProps === void 0 ? {} : _ref2$inputProps,
|
|
1767
1803
|
_ref2$InputProps = _ref2.InputProps,
|
|
1768
1804
|
InputProps = _ref2$InputProps === void 0 ? {} : _ref2$InputProps,
|
|
1769
|
-
inputRef = _ref2.inputRef
|
|
1805
|
+
inputRef = _ref2.inputRef,
|
|
1806
|
+
_ref2$multiline = _ref2.multiline,
|
|
1807
|
+
multiline = _ref2$multiline === void 0 ? false : _ref2$multiline,
|
|
1808
|
+
minRows = _ref2.minRows,
|
|
1809
|
+
maxRows = _ref2.maxRows;
|
|
1770
1810
|
|
|
1771
1811
|
var _useState = useState(Boolean(field.value)),
|
|
1772
1812
|
isShrinked = _useState[0],
|
|
@@ -1816,7 +1856,10 @@ var CustomField = function CustomField(_ref2) {
|
|
|
1816
1856
|
},
|
|
1817
1857
|
InputProps: InputProps,
|
|
1818
1858
|
inputProps: _extends({}, inputProps, pInputProps),
|
|
1819
|
-
inputRef: _ref
|
|
1859
|
+
inputRef: _ref,
|
|
1860
|
+
multiline: multiline,
|
|
1861
|
+
minRows: minRows,
|
|
1862
|
+
maxRows: maxRows
|
|
1820
1863
|
}, field, {
|
|
1821
1864
|
onBlur: function onBlur(e) {
|
|
1822
1865
|
setIsShrinked(Boolean(field.value));
|
|
@@ -1834,446 +1877,358 @@ var CustomField = function CustomField(_ref2) {
|
|
|
1834
1877
|
}) : null);
|
|
1835
1878
|
};
|
|
1836
1879
|
|
|
1837
|
-
var
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
},
|
|
1849
|
-
'& .PrivatePickersSlideTransition-root': {
|
|
1850
|
-
minHeight: DATE_SIZE * 6
|
|
1851
|
-
},
|
|
1852
|
-
'& .PrivatePickersSlideTransition-root [role="row"]': {
|
|
1853
|
-
margin: 0
|
|
1854
|
-
},
|
|
1855
|
-
'& .MuiPickersDay-dayWithMargin': {
|
|
1856
|
-
margin: 0
|
|
1857
|
-
},
|
|
1858
|
-
'& .MuiPickersDay-root': {
|
|
1859
|
-
width: DATE_SIZE,
|
|
1860
|
-
height: DATE_SIZE
|
|
1861
|
-
},
|
|
1862
|
-
'& .MuiPickersArrowSwitcher-spacer': {
|
|
1863
|
-
width: 0
|
|
1864
|
-
},
|
|
1865
|
-
'& [role="presentation"] .PrivatePickersFadeTransitionGroup-root': {
|
|
1866
|
-
marginRight: -1
|
|
1867
|
-
}
|
|
1868
|
-
};
|
|
1869
|
-
var compactStyleTheme = /*#__PURE__*/createTheme({
|
|
1870
|
-
components: {
|
|
1871
|
-
MuiPaper: {
|
|
1872
|
-
defaultProps: {
|
|
1873
|
-
sx: compactStyles
|
|
1874
|
-
}
|
|
1875
|
-
}
|
|
1876
|
-
}
|
|
1877
|
-
});
|
|
1878
|
-
var DatePickerField = function DatePickerField(_ref) {
|
|
1879
|
-
var label = _ref.label,
|
|
1880
|
-
field = _ref.field,
|
|
1881
|
-
form = _ref.form,
|
|
1882
|
-
theme = _ref.theme,
|
|
1883
|
-
_ref$useCompact = _ref.useCompact,
|
|
1884
|
-
useCompact = _ref$useCompact === void 0 ? true : _ref$useCompact,
|
|
1885
|
-
_ref$dateFormat = _ref.dateFormat,
|
|
1886
|
-
dateFormat = _ref$dateFormat === void 0 ? 'DD/MM/YYYY' : _ref$dateFormat,
|
|
1887
|
-
_ref$datePlaceholder = _ref.datePlaceholder,
|
|
1888
|
-
datePlaceholder = _ref$datePlaceholder === void 0 ? 'dd/mm/yyyy' : _ref$datePlaceholder;
|
|
1889
|
-
return React.createElement(ThemeProvider, {
|
|
1890
|
-
theme: useCompact ? compactStyleTheme : {}
|
|
1891
|
-
}, React.createElement(LocalizationProvider, {
|
|
1892
|
-
dateAdapter: AdapterMoment
|
|
1893
|
-
}, React.createElement(DatePicker, {
|
|
1894
|
-
value: field.value || '',
|
|
1895
|
-
onChange: function onChange(value) {
|
|
1896
|
-
return form.setFieldValue(field.name, value);
|
|
1897
|
-
},
|
|
1898
|
-
PopperProps: {
|
|
1899
|
-
placement: 'bottom-start'
|
|
1900
|
-
},
|
|
1901
|
-
showDaysOutsideCurrentMonth: true,
|
|
1902
|
-
disableFuture: true,
|
|
1903
|
-
inputFormat: dateFormat,
|
|
1904
|
-
mask: "__/__/____",
|
|
1905
|
-
renderInput: function renderInput(params) {
|
|
1906
|
-
return React.createElement(CustomField, Object.assign({}, params, {
|
|
1907
|
-
inputProps: _extends({}, params.inputProps, {
|
|
1908
|
-
placeholder: datePlaceholder
|
|
1909
|
-
}),
|
|
1910
|
-
theme: theme,
|
|
1911
|
-
field: _extends({}, field, {
|
|
1912
|
-
onChange: function onChange(evt) {
|
|
1913
|
-
if (params.inputProps && params.inputProps.onChange) {
|
|
1914
|
-
params.inputProps.onChange(evt);
|
|
1915
|
-
}
|
|
1916
|
-
}
|
|
1917
|
-
}),
|
|
1918
|
-
form: form,
|
|
1919
|
-
label: label,
|
|
1920
|
-
type: "tel"
|
|
1921
|
-
}));
|
|
1922
|
-
}
|
|
1923
|
-
})));
|
|
1880
|
+
var PoweredBy = function PoweredBy() {
|
|
1881
|
+
return React.createElement("div", {
|
|
1882
|
+
className: "powered-container"
|
|
1883
|
+
}, React.createElement("div", {
|
|
1884
|
+
className: 'powered-text'
|
|
1885
|
+
}, "Powered By"), React.createElement("img", {
|
|
1886
|
+
className: 'powered-img',
|
|
1887
|
+
alt: "The Ticket Fairy",
|
|
1888
|
+
src: "https://cdn-checkout.s3.us-east-2.amazonaws.com/IconTicketFairy.svg"
|
|
1889
|
+
}), React.createElement("div", {
|
|
1890
|
+
className: 'powered-ttf'
|
|
1891
|
+
}, "The", React.createElement("strong", null, "Ticket"), "Fairy"));
|
|
1924
1892
|
};
|
|
1925
1893
|
|
|
1926
|
-
var
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
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 : ''])
|
|
1937
|
-
}, React.createElement(FormGroup, null, React.createElement(FormControlLabel, {
|
|
1938
|
-
control: React.createElement(Checkbox, Object.assign({}, field, rest)),
|
|
1939
|
-
label: label,
|
|
1940
|
-
componentsProps: {
|
|
1941
|
-
typography: customTheme == null ? void 0 : customTheme.checkbox
|
|
1942
|
-
}
|
|
1943
|
-
})), !!(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);
|
|
1894
|
+
var style = {
|
|
1895
|
+
position: 'absolute',
|
|
1896
|
+
top: '50%',
|
|
1897
|
+
left: '50%',
|
|
1898
|
+
transform: 'translate(-50%, -50%)',
|
|
1899
|
+
minWidth: 480,
|
|
1900
|
+
backgroundColor: '#fff',
|
|
1901
|
+
border: '1px solid white',
|
|
1902
|
+
outline: 'none',
|
|
1903
|
+
padding: '14px'
|
|
1944
1904
|
};
|
|
1905
|
+
var Schema = /*#__PURE__*/object().shape({
|
|
1906
|
+
email: /*#__PURE__*/string().email('Invalid email').required('Required')
|
|
1907
|
+
});
|
|
1908
|
+
var ForgotPasswordModal = function ForgotPasswordModal(_ref) {
|
|
1909
|
+
var _ref$onClose = _ref.onClose,
|
|
1910
|
+
onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
|
|
1911
|
+
_ref$onLogin = _ref.onLogin,
|
|
1912
|
+
onLogin = _ref$onLogin === void 0 ? function () {} : _ref$onLogin,
|
|
1913
|
+
_ref$onForgotPassword = _ref.onForgotPasswordSuccess,
|
|
1914
|
+
onForgotPasswordSuccess = _ref$onForgotPassword === void 0 ? function () {} : _ref$onForgotPassword,
|
|
1915
|
+
_ref$onForgotPassword2 = _ref.onForgotPasswordError,
|
|
1916
|
+
onForgotPasswordError = _ref$onForgotPassword2 === void 0 ? function () {} : _ref$onForgotPassword2,
|
|
1917
|
+
_ref$showPoweredByIma = _ref.showPoweredByImage,
|
|
1918
|
+
showPoweredByImage = _ref$showPoweredByIma === void 0 ? false : _ref$showPoweredByIma;
|
|
1945
1919
|
|
|
1946
|
-
var
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
_ref$form = _ref.form,
|
|
1950
|
-
errors = _ref$form.errors,
|
|
1951
|
-
touched = _ref$form.touched,
|
|
1952
|
-
setFieldError = _ref$form.setFieldError,
|
|
1953
|
-
values = _ref$form.values,
|
|
1954
|
-
initialValues = _ref$form.initialValues,
|
|
1955
|
-
setFieldValue = _ref$form.setFieldValue,
|
|
1956
|
-
setFieldTouched = _ref$form.setFieldTouched,
|
|
1957
|
-
setErrors = _ref$form.setErrors,
|
|
1958
|
-
_ref$disableDropdown = _ref.disableDropdown,
|
|
1959
|
-
disableDropdown = _ref$disableDropdown === void 0 ? true : _ref$disableDropdown,
|
|
1960
|
-
_ref$defaultCountry = _ref.defaultCountry,
|
|
1961
|
-
defaultCountry = _ref$defaultCountry === void 0 ? 'us' : _ref$defaultCountry,
|
|
1962
|
-
_ref$fill = _ref.fill,
|
|
1963
|
-
fill = _ref$fill === void 0 ? false : _ref$fill,
|
|
1964
|
-
setPhoneValidationIsLoading = _ref.setPhoneValidationIsLoading;
|
|
1965
|
-
|
|
1966
|
-
var error = _get(errors, field.name);
|
|
1967
|
-
|
|
1968
|
-
var isTouched = Boolean(_get(touched, field.name)); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1969
|
-
|
|
1970
|
-
var debounceCb = useCallback(_debounce(function (cb) {
|
|
1971
|
-
return void cb();
|
|
1972
|
-
}, 1000), []);
|
|
1973
|
-
useEffect(function () {
|
|
1974
|
-
if (field.value) {
|
|
1975
|
-
setPhoneValidationIsLoading(true);
|
|
1976
|
-
}
|
|
1920
|
+
var _useState = useState(false),
|
|
1921
|
+
loading = _useState[0],
|
|
1922
|
+
setLoading = _useState[1];
|
|
1977
1923
|
|
|
1978
|
-
|
|
1979
|
-
|
|
1924
|
+
var onForgotPassword = /*#__PURE__*/function () {
|
|
1925
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref2) {
|
|
1926
|
+
var email, _yield$forgotPassword, data;
|
|
1980
1927
|
|
|
1981
1928
|
return runtime_1.wrap(function _callee$(_context) {
|
|
1982
1929
|
while (1) {
|
|
1983
1930
|
switch (_context.prev = _context.next) {
|
|
1984
1931
|
case 0:
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
}
|
|
1932
|
+
email = _ref2.email;
|
|
1933
|
+
_context.prev = 1;
|
|
1934
|
+
setLoading(true);
|
|
1935
|
+
_context.next = 5;
|
|
1936
|
+
return forgotPassword(email);
|
|
1991
1937
|
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1938
|
+
case 5:
|
|
1939
|
+
_yield$forgotPassword = _context.sent;
|
|
1940
|
+
data = _yield$forgotPassword.data;
|
|
1941
|
+
onForgotPasswordSuccess(data);
|
|
1942
|
+
onClose();
|
|
1943
|
+
_context.next = 14;
|
|
1944
|
+
break;
|
|
1996
1945
|
|
|
1997
|
-
case
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
break;
|
|
2001
|
-
}
|
|
2002
|
-
|
|
2003
|
-
_context.next = 9;
|
|
2004
|
-
return validatePhoneNumber(values[field.name]);
|
|
2005
|
-
|
|
2006
|
-
case 9:
|
|
2007
|
-
if (errors[field.name]) {
|
|
2008
|
-
_newErrors = _extends({}, errors);
|
|
2009
|
-
delete _newErrors[field.name];
|
|
2010
|
-
setErrors(_newErrors);
|
|
2011
|
-
}
|
|
2012
|
-
|
|
2013
|
-
_context.next = 16;
|
|
2014
|
-
break;
|
|
2015
|
-
|
|
2016
|
-
case 12:
|
|
2017
|
-
_context.prev = 12;
|
|
2018
|
-
_context.t0 = _context["catch"](0);
|
|
2019
|
-
message = _get(_context.t0, 'response.data.message', 'Invalid phone number');
|
|
1946
|
+
case 11:
|
|
1947
|
+
_context.prev = 11;
|
|
1948
|
+
_context.t0 = _context["catch"](1);
|
|
2020
1949
|
|
|
2021
|
-
if (
|
|
2022
|
-
|
|
1950
|
+
if (axios.isAxiosError(_context.t0)) {
|
|
1951
|
+
onForgotPasswordError(_context.t0);
|
|
2023
1952
|
}
|
|
2024
1953
|
|
|
2025
|
-
case
|
|
2026
|
-
_context.prev =
|
|
2027
|
-
|
|
2028
|
-
return _context.finish(
|
|
1954
|
+
case 14:
|
|
1955
|
+
_context.prev = 14;
|
|
1956
|
+
setLoading(false);
|
|
1957
|
+
return _context.finish(14);
|
|
2029
1958
|
|
|
2030
|
-
case
|
|
1959
|
+
case 17:
|
|
2031
1960
|
case "end":
|
|
2032
1961
|
return _context.stop();
|
|
2033
1962
|
}
|
|
2034
1963
|
}
|
|
2035
|
-
}, _callee, null, [[
|
|
2036
|
-
}))
|
|
2037
|
-
}, [field.value]);
|
|
2038
|
-
return React.createElement(React.Fragment, null, React.createElement(MuiPhoneNumber, {
|
|
2039
|
-
name: field.name,
|
|
2040
|
-
value: fill ? values[field.name] : initialValues[field.name],
|
|
2041
|
-
onChange: function onChange(value, country) {
|
|
2042
|
-
if ("+" + (country == null ? void 0 : country.dialCode) === value || value === '+') {
|
|
2043
|
-
setFieldValue(field.name, '');
|
|
2044
|
-
setFieldError(field.name, '');
|
|
2045
|
-
} else {
|
|
2046
|
-
setFieldTouched(field.name, true);
|
|
2047
|
-
setFieldValue(field.name, value);
|
|
2048
|
-
}
|
|
2049
|
-
},
|
|
2050
|
-
variant: "outlined",
|
|
2051
|
-
defaultCountry: defaultCountry,
|
|
2052
|
-
disableDropdown: disableDropdown,
|
|
2053
|
-
label: label,
|
|
2054
|
-
error: !!error && (isTouched || fill),
|
|
2055
|
-
helperText: (isTouched || fill) && error,
|
|
2056
|
-
fullWidth: true,
|
|
2057
|
-
autoFormat: false,
|
|
2058
|
-
disableAreaCodes: true,
|
|
2059
|
-
countryCodeEditable: false
|
|
2060
|
-
}));
|
|
2061
|
-
};
|
|
2062
|
-
|
|
2063
|
-
function Loader() {
|
|
2064
|
-
return React.createElement("div", {
|
|
2065
|
-
className: "loader-container"
|
|
2066
|
-
}, React.createElement(CircularProgress, null));
|
|
2067
|
-
}
|
|
2068
|
-
|
|
2069
|
-
var NativeSelectField = function NativeSelectField(_ref) {
|
|
2070
|
-
var label = _ref.label,
|
|
2071
|
-
_ref$type = _ref.type,
|
|
2072
|
-
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
2073
|
-
field = _ref.field,
|
|
2074
|
-
_ref$selectOptions = _ref.selectOptions,
|
|
2075
|
-
selectOptions = _ref$selectOptions === void 0 ? [] : _ref$selectOptions,
|
|
2076
|
-
_ref$form = _ref.form,
|
|
2077
|
-
touched = _ref$form.touched,
|
|
2078
|
-
errors = _ref$form.errors,
|
|
2079
|
-
setFieldValue = _ref$form.setFieldValue,
|
|
2080
|
-
theme = _ref.theme,
|
|
2081
|
-
_ref$onChange = _ref.onChange,
|
|
2082
|
-
_onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange;
|
|
1964
|
+
}, _callee, null, [[1, 11, 14, 17]]);
|
|
1965
|
+
}));
|
|
2083
1966
|
|
|
2084
|
-
|
|
1967
|
+
return function onForgotPassword(_x) {
|
|
1968
|
+
return _ref3.apply(this, arguments);
|
|
1969
|
+
};
|
|
1970
|
+
}();
|
|
2085
1971
|
|
|
2086
|
-
var
|
|
1972
|
+
var _onClose = loading ? function () {} : onClose;
|
|
2087
1973
|
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
},
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
type: type,
|
|
2100
|
-
fullWidth: true,
|
|
2101
|
-
error: !!error && isTouched,
|
|
2102
|
-
inputProps: {
|
|
2103
|
-
id: field.name
|
|
1974
|
+
return React.createElement(Modal, {
|
|
1975
|
+
open: true,
|
|
1976
|
+
onClose: _onClose,
|
|
1977
|
+
"aria-labelledby": "modal-modal-title",
|
|
1978
|
+
"aria-describedby": "modal-modal-description",
|
|
1979
|
+
className: "forgot-password-modal"
|
|
1980
|
+
}, React.createElement(Box, {
|
|
1981
|
+
style: style
|
|
1982
|
+
}, React.createElement("div", null, React.createElement(Formik, {
|
|
1983
|
+
initialValues: {
|
|
1984
|
+
email: ''
|
|
2104
1985
|
},
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
1986
|
+
validationSchema: Schema,
|
|
1987
|
+
onSubmit: onForgotPassword
|
|
1988
|
+
}, function (_ref4) {
|
|
1989
|
+
var isValid = _ref4.isValid,
|
|
1990
|
+
dirty = _ref4.dirty,
|
|
1991
|
+
handleSubmit = _ref4.handleSubmit;
|
|
1992
|
+
return React.createElement(Form, {
|
|
1993
|
+
onSubmit: handleSubmit
|
|
1994
|
+
}, React.createElement("div", {
|
|
1995
|
+
className: "forgot-password-container"
|
|
1996
|
+
}, React.createElement("div", {
|
|
1997
|
+
className: "title"
|
|
1998
|
+
}, "Password Reset"), React.createElement("div", {
|
|
1999
|
+
className: "forgot-password-container__singleField"
|
|
2000
|
+
}, React.createElement(Field, {
|
|
2001
|
+
name: "email",
|
|
2002
|
+
label: "Email",
|
|
2003
|
+
component: CustomField
|
|
2004
|
+
}))), React.createElement("div", {
|
|
2005
|
+
className: "forgot-password-action-button"
|
|
2006
|
+
}, React.createElement("button", {
|
|
2007
|
+
type: "submit",
|
|
2008
|
+
disabled: !(isValid && dirty)
|
|
2009
|
+
}, loading ? React.createElement(CircularProgress, {
|
|
2010
|
+
size: "22px"
|
|
2011
|
+
}) : 'Submit')), React.createElement("div", {
|
|
2012
|
+
className: "login"
|
|
2013
|
+
}, React.createElement("span", {
|
|
2014
|
+
onClick: onLogin
|
|
2015
|
+
}, "Back to Log In")), showPoweredByImage ? React.createElement(PoweredBy, null) : null);
|
|
2016
|
+
}))));
|
|
2017
|
+
};
|
|
2114
2018
|
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2019
|
+
var style$1 = {
|
|
2020
|
+
position: 'absolute',
|
|
2021
|
+
top: '50%',
|
|
2022
|
+
left: '50%',
|
|
2023
|
+
transform: 'translate(-50%, -50%)',
|
|
2024
|
+
minWidth: 480,
|
|
2025
|
+
backgroundColor: '#e3e3e3',
|
|
2026
|
+
border: '1px solid white',
|
|
2027
|
+
outline: 'none'
|
|
2028
|
+
};
|
|
2029
|
+
var setLoggedUserData$1 = function setLoggedUserData(data) {
|
|
2030
|
+
return {
|
|
2031
|
+
id: data.id,
|
|
2032
|
+
first_name: data.firstName,
|
|
2033
|
+
last_name: data.lastName,
|
|
2034
|
+
email: data.email,
|
|
2035
|
+
confirmEmail: data.email,
|
|
2036
|
+
city: (data == null ? void 0 : data.city) || '',
|
|
2037
|
+
country: (data == null ? void 0 : data.countryId) || (data == null ? void 0 : data.country) || '',
|
|
2038
|
+
phone: (data == null ? void 0 : data.phone) || '',
|
|
2039
|
+
street_address: (data == null ? void 0 : data.streetAddress) || '',
|
|
2040
|
+
state: (data == null ? void 0 : data.stateId) || '',
|
|
2041
|
+
zip: (data == null ? void 0 : data.zip) || (data == null ? void 0 : data.zipCode) || ''
|
|
2042
|
+
};
|
|
2126
2043
|
};
|
|
2044
|
+
var LoginModal = function LoginModal(_ref) {
|
|
2045
|
+
var onClose = _ref.onClose,
|
|
2046
|
+
onLogin = _ref.onLogin,
|
|
2047
|
+
_ref$alreadyHasUser = _ref.alreadyHasUser,
|
|
2048
|
+
alreadyHasUser = _ref$alreadyHasUser === void 0 ? false : _ref$alreadyHasUser,
|
|
2049
|
+
_ref$userExpired = _ref.userExpired,
|
|
2050
|
+
userExpired = _ref$userExpired === void 0 ? false : _ref$userExpired,
|
|
2051
|
+
_ref$onGetProfileData = _ref.onGetProfileDataSuccess,
|
|
2052
|
+
onGetProfileDataSuccess = _ref$onGetProfileData === void 0 ? _identity : _ref$onGetProfileData,
|
|
2053
|
+
_ref$onGetProfileData2 = _ref.onGetProfileDataError,
|
|
2054
|
+
onGetProfileDataError = _ref$onGetProfileData2 === void 0 ? _identity : _ref$onGetProfileData2,
|
|
2055
|
+
_ref$onForgotPassword = _ref.onForgotPassword,
|
|
2056
|
+
onForgotPassword = _ref$onForgotPassword === void 0 ? _identity : _ref$onForgotPassword,
|
|
2057
|
+
_ref$onSignup = _ref.onSignup,
|
|
2058
|
+
onSignup = _ref$onSignup === void 0 ? _identity : _ref$onSignup,
|
|
2059
|
+
_ref$modalClassname = _ref.modalClassname,
|
|
2060
|
+
modalClassname = _ref$modalClassname === void 0 ? '' : _ref$modalClassname,
|
|
2061
|
+
logo = _ref.logo,
|
|
2062
|
+
_ref$showForgotPasswo = _ref.showForgotPasswordButton,
|
|
2063
|
+
showForgotPasswordButton = _ref$showForgotPasswo === void 0 ? false : _ref$showForgotPasswo,
|
|
2064
|
+
_ref$showSignUpButton = _ref.showSignUpButton,
|
|
2065
|
+
showSignUpButton = _ref$showSignUpButton === void 0 ? false : _ref$showSignUpButton,
|
|
2066
|
+
_ref$showPoweredByIma = _ref.showPoweredByImage,
|
|
2067
|
+
showPoweredByImage = _ref$showPoweredByIma === void 0 ? false : _ref$showPoweredByIma;
|
|
2127
2068
|
|
|
2128
|
-
var
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
radios = _ref.radios,
|
|
2132
|
-
_ref$form = _ref.form,
|
|
2133
|
-
errors = _ref$form.errors,
|
|
2134
|
-
setFieldValue = _ref$form.setFieldValue,
|
|
2135
|
-
_ref$onChange = _ref.onChange,
|
|
2136
|
-
onChange = _ref$onChange === void 0 ? _identity : _ref$onChange;
|
|
2137
|
-
var radioId = "radio-" + field.name;
|
|
2069
|
+
var _useState = useState(''),
|
|
2070
|
+
error = _useState[0],
|
|
2071
|
+
setError = _useState[1];
|
|
2138
2072
|
|
|
2139
|
-
|
|
2073
|
+
return React.createElement(Modal$1, {
|
|
2074
|
+
open: true,
|
|
2075
|
+
onClose: onClose,
|
|
2076
|
+
"aria-labelledby": "modal-modal-title",
|
|
2077
|
+
"aria-describedby": "modal-modal-description",
|
|
2078
|
+
className: "login-modal " + modalClassname
|
|
2079
|
+
}, React.createElement(Box$1, {
|
|
2080
|
+
style: style$1
|
|
2081
|
+
}, React.createElement("div", null, React.createElement(Formik, {
|
|
2082
|
+
initialValues: {
|
|
2083
|
+
email: '',
|
|
2084
|
+
password: ''
|
|
2085
|
+
},
|
|
2086
|
+
onSubmit: function () {
|
|
2087
|
+
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref2) {
|
|
2088
|
+
var email, password, body, profileResponse, profileSpecifiedData, profileDataObj, event, _e$response, _e$response$data, _error;
|
|
2140
2089
|
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2090
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
2091
|
+
while (1) {
|
|
2092
|
+
switch (_context.prev = _context.next) {
|
|
2093
|
+
case 0:
|
|
2094
|
+
email = _ref2.email, password = _ref2.password;
|
|
2095
|
+
_context.prev = 1;
|
|
2096
|
+
body = {
|
|
2097
|
+
email: email,
|
|
2098
|
+
password: password
|
|
2099
|
+
};
|
|
2100
|
+
_context.next = 5;
|
|
2101
|
+
return authorize(body);
|
|
2146
2102
|
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
}, label), React.createElement(RadioGroup, {
|
|
2153
|
-
"aria-labelledby": radioId,
|
|
2154
|
-
name: field.name,
|
|
2155
|
-
value: field.value,
|
|
2156
|
-
onChange: handleChange
|
|
2157
|
-
}, radios.map(function (radio) {
|
|
2158
|
-
var id = radio.id,
|
|
2159
|
-
name = radio.name,
|
|
2160
|
-
value = radio.value;
|
|
2161
|
-
return React.createElement(FormControlLabel, {
|
|
2162
|
-
key: id,
|
|
2163
|
-
label: name,
|
|
2164
|
-
value: value,
|
|
2165
|
-
control: React.createElement(Radio, null)
|
|
2166
|
-
});
|
|
2167
|
-
})));
|
|
2168
|
-
};
|
|
2103
|
+
case 5:
|
|
2104
|
+
profileResponse = null;
|
|
2105
|
+
_context.prev = 6;
|
|
2106
|
+
_context.next = 9;
|
|
2107
|
+
return getProfileData();
|
|
2169
2108
|
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
errors = _ref$form.errors,
|
|
2176
|
-
setFieldValue = _ref$form.setFieldValue,
|
|
2177
|
-
options = _ref.options,
|
|
2178
|
-
_ref$onChange = _ref.onChange,
|
|
2179
|
-
onChange = _ref$onChange === void 0 ? _identity : _ref$onChange;
|
|
2180
|
-
var name = field.name,
|
|
2181
|
-
value = field.value;
|
|
2182
|
-
var selectId = "select-field-" + name;
|
|
2109
|
+
case 9:
|
|
2110
|
+
profileResponse = _context.sent;
|
|
2111
|
+
onGetProfileDataSuccess(profileResponse.data);
|
|
2112
|
+
_context.next = 17;
|
|
2113
|
+
break;
|
|
2183
2114
|
|
|
2184
|
-
|
|
2115
|
+
case 13:
|
|
2116
|
+
_context.prev = 13;
|
|
2117
|
+
_context.t0 = _context["catch"](6);
|
|
2185
2118
|
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
onChange(event);
|
|
2190
|
-
};
|
|
2119
|
+
if (axios.isAxiosError(_context.t0)) {
|
|
2120
|
+
onGetProfileDataError(_context.t0);
|
|
2121
|
+
}
|
|
2191
2122
|
|
|
2192
|
-
|
|
2193
|
-
fullWidth: true,
|
|
2194
|
-
error: Boolean(error)
|
|
2195
|
-
}, label && React.createElement(InputLabel, {
|
|
2196
|
-
id: selectId
|
|
2197
|
-
}, label), React.createElement(Select, {
|
|
2198
|
-
id: name,
|
|
2199
|
-
labelId: selectId,
|
|
2200
|
-
multiple: isMultiple,
|
|
2201
|
-
value: value,
|
|
2202
|
-
onChange: handleChange,
|
|
2203
|
-
input: React.createElement(OutlinedInput, {
|
|
2204
|
-
label: label
|
|
2205
|
-
}),
|
|
2206
|
-
renderValue: function renderValue(selected) {
|
|
2207
|
-
return isMultiple ? selected.join(', ') : selected;
|
|
2208
|
-
},
|
|
2209
|
-
sx: {
|
|
2210
|
-
textAlign: 'start'
|
|
2211
|
-
}
|
|
2212
|
-
}, options.map(function (option) {
|
|
2213
|
-
return React.createElement(MenuItem, {
|
|
2214
|
-
key: option.name,
|
|
2215
|
-
value: option.value
|
|
2216
|
-
}, isMultiple && React.createElement(Checkbox, {
|
|
2217
|
-
checked: value.indexOf(option.value) > -1
|
|
2218
|
-
}), React.createElement(ListItemText, {
|
|
2219
|
-
primary: option.name
|
|
2220
|
-
}));
|
|
2221
|
-
})), error ? React.createElement(FormHelperText$1, {
|
|
2222
|
-
error: true
|
|
2223
|
-
}, error) : null));
|
|
2224
|
-
}
|
|
2123
|
+
return _context.abrupt("return");
|
|
2225
2124
|
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
type = _ref.type,
|
|
2230
|
-
position = _ref.position,
|
|
2231
|
-
_ref$autoHideDuration = _ref.autoHideDuration,
|
|
2232
|
-
autoHideDuration = _ref$autoHideDuration === void 0 ? 3000 : _ref$autoHideDuration,
|
|
2233
|
-
variant = _ref.variant,
|
|
2234
|
-
onClose = _ref.onClose;
|
|
2235
|
-
return React.createElement("div", {
|
|
2236
|
-
className: "snackbar-alert-container"
|
|
2237
|
-
}, React.createElement(Snackbar, {
|
|
2238
|
-
autoHideDuration: autoHideDuration,
|
|
2239
|
-
open: isOpen,
|
|
2240
|
-
anchorOrigin: position || {
|
|
2241
|
-
vertical: 'top',
|
|
2242
|
-
horizontal: 'center'
|
|
2243
|
-
},
|
|
2244
|
-
onClose: onClose,
|
|
2245
|
-
classes: {
|
|
2246
|
-
root: 'snackbar-alert-snackbar-root'
|
|
2247
|
-
}
|
|
2248
|
-
}, React.createElement(Alert, {
|
|
2249
|
-
severity: type,
|
|
2250
|
-
onClose: onClose,
|
|
2251
|
-
variant: variant || 'filled',
|
|
2252
|
-
classes: {
|
|
2253
|
-
icon: 'snackbar-alert-icon',
|
|
2254
|
-
root: 'snackbar-alert-alert-root',
|
|
2255
|
-
action: 'snackbar-alert-action',
|
|
2256
|
-
message: 'snackbar-alert-message',
|
|
2257
|
-
filled: 'snackbar-alert-filled'
|
|
2258
|
-
}
|
|
2259
|
-
}, message)));
|
|
2260
|
-
};
|
|
2125
|
+
case 17:
|
|
2126
|
+
profileSpecifiedData = _get(profileResponse, 'data.data');
|
|
2127
|
+
profileDataObj = setLoggedUserData$1(profileSpecifiedData);
|
|
2261
2128
|
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2129
|
+
if (typeof window !== 'undefined') {
|
|
2130
|
+
window.localStorage.setItem('user_data', JSON.stringify(profileDataObj));
|
|
2131
|
+
event = new window.CustomEvent('tf-login');
|
|
2132
|
+
window.document.dispatchEvent(event);
|
|
2133
|
+
}
|
|
2134
|
+
|
|
2135
|
+
onLogin();
|
|
2136
|
+
_context.next = 26;
|
|
2137
|
+
break;
|
|
2138
|
+
|
|
2139
|
+
case 23:
|
|
2140
|
+
_context.prev = 23;
|
|
2141
|
+
_context.t1 = _context["catch"](1);
|
|
2142
|
+
|
|
2143
|
+
if (axios.isAxiosError(_context.t1)) {
|
|
2144
|
+
_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';
|
|
2145
|
+
setError(_error);
|
|
2146
|
+
} else if (_context.t1 instanceof Error) {
|
|
2147
|
+
setError((_context.t1 == null ? void 0 : _context.t1.message) || 'Error');
|
|
2148
|
+
}
|
|
2149
|
+
|
|
2150
|
+
case 26:
|
|
2151
|
+
case "end":
|
|
2152
|
+
return _context.stop();
|
|
2153
|
+
}
|
|
2154
|
+
}
|
|
2155
|
+
}, _callee, null, [[1, 23], [6, 13]]);
|
|
2156
|
+
}));
|
|
2157
|
+
|
|
2158
|
+
function onSubmit(_x) {
|
|
2159
|
+
return _onSubmit.apply(this, arguments);
|
|
2160
|
+
}
|
|
2161
|
+
|
|
2162
|
+
return onSubmit;
|
|
2163
|
+
}()
|
|
2164
|
+
}, function (props) {
|
|
2165
|
+
return React.createElement(Form, {
|
|
2166
|
+
onSubmit: props.handleSubmit
|
|
2167
|
+
}, React.createElement("div", {
|
|
2168
|
+
className: "modal-title"
|
|
2169
|
+
}, "Login"), React.createElement("div", {
|
|
2170
|
+
className: 'login-logo-container'
|
|
2171
|
+
}, React.createElement("img", {
|
|
2172
|
+
className: "login-logo-tff",
|
|
2173
|
+
src: logo || "https://www.ticketfairy.com/resources/images/logo-ttf-black.svg",
|
|
2174
|
+
alt: "logo"
|
|
2175
|
+
})), React.createElement("div", {
|
|
2176
|
+
className: "server_auth__error"
|
|
2177
|
+
}, error), alreadyHasUser && React.createElement("p", {
|
|
2178
|
+
className: "info-text-for-login"
|
|
2179
|
+
}, "It appears this email is already attached to an account. Please log in here to complete your registration."), userExpired && React.createElement("p", {
|
|
2180
|
+
className: "info-text-for-login"
|
|
2181
|
+
}, "Your session has expired, please log in again."), React.createElement("div", {
|
|
2182
|
+
className: "login-modal-body"
|
|
2183
|
+
}, React.createElement("div", {
|
|
2184
|
+
className: "login-modal-body__email"
|
|
2185
|
+
}, React.createElement(Field, {
|
|
2186
|
+
name: 'email',
|
|
2187
|
+
validate: requiredValidator
|
|
2188
|
+
}, function (_ref3) {
|
|
2189
|
+
var field = _ref3.field,
|
|
2190
|
+
meta = _ref3.meta;
|
|
2191
|
+
return React.createElement(TextField$1, Object.assign({
|
|
2192
|
+
label: 'Email',
|
|
2193
|
+
type: 'email',
|
|
2194
|
+
fullWidth: true,
|
|
2195
|
+
error: !!meta.error && meta.touched,
|
|
2196
|
+
helperText: meta.touched && meta.error
|
|
2197
|
+
}, field));
|
|
2198
|
+
})), React.createElement("div", {
|
|
2199
|
+
className: "login-modal-body__password"
|
|
2200
|
+
}, React.createElement(Field, {
|
|
2201
|
+
name: 'password',
|
|
2202
|
+
validate: requiredValidator
|
|
2203
|
+
}, function (_ref4) {
|
|
2204
|
+
var field = _ref4.field,
|
|
2205
|
+
meta = _ref4.meta;
|
|
2206
|
+
return React.createElement(TextField$1, Object.assign({
|
|
2207
|
+
label: "Password",
|
|
2208
|
+
type: "password",
|
|
2209
|
+
fullWidth: true,
|
|
2210
|
+
error: !!meta.error && meta.touched,
|
|
2211
|
+
helperText: meta.touched && meta.error
|
|
2212
|
+
}, field));
|
|
2213
|
+
})), React.createElement("div", {
|
|
2214
|
+
className: "login-action-button"
|
|
2215
|
+
}, React.createElement("button", {
|
|
2216
|
+
type: "submit"
|
|
2217
|
+
}, "Login")), showForgotPasswordButton && React.createElement("div", {
|
|
2218
|
+
className: "forgot-password"
|
|
2219
|
+
}, React.createElement("span", {
|
|
2220
|
+
"aria-hidden": "true",
|
|
2221
|
+
onClick: onForgotPassword
|
|
2222
|
+
}, "Forgot password?")), showSignUpButton && React.createElement("div", {
|
|
2223
|
+
className: "forgot-password"
|
|
2224
|
+
}, React.createElement("span", {
|
|
2225
|
+
"aria-hidden": "true",
|
|
2226
|
+
onClick: onSignup
|
|
2227
|
+
}, "Sign up")), showPoweredByImage ? React.createElement(PoweredBy, null) : null));
|
|
2228
|
+
}))));
|
|
2274
2229
|
};
|
|
2275
2230
|
|
|
2276
|
-
var style = {
|
|
2231
|
+
var style$2 = {
|
|
2277
2232
|
position: 'absolute',
|
|
2278
2233
|
top: '50%',
|
|
2279
2234
|
left: '50%',
|
|
@@ -2284,18 +2239,22 @@ var style = {
|
|
|
2284
2239
|
outline: 'none',
|
|
2285
2240
|
padding: '14px'
|
|
2286
2241
|
};
|
|
2287
|
-
var
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2242
|
+
var SignupSchema = /*#__PURE__*/object().shape({
|
|
2243
|
+
firstName: /*#__PURE__*/string().required('Required'),
|
|
2244
|
+
lastName: /*#__PURE__*/string().required('Required'),
|
|
2245
|
+
email: /*#__PURE__*/string().email('Invalid email').required('Required'),
|
|
2246
|
+
password: /*#__PURE__*/string().min(6, 'Password must have 5+ characters').required('Required'),
|
|
2247
|
+
confirmPassword: /*#__PURE__*/string().required('Required').oneOf([/*#__PURE__*/ref('password'), null], 'Passwords must match')
|
|
2248
|
+
});
|
|
2249
|
+
var SignupModal = function SignupModal(_ref) {
|
|
2250
|
+
var _ref$onClose = _ref.onClose,
|
|
2251
|
+
onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
|
|
2252
|
+
_ref$onLogin = _ref.onLogin,
|
|
2294
2253
|
onLogin = _ref$onLogin === void 0 ? function () {} : _ref$onLogin,
|
|
2295
|
-
_ref$
|
|
2296
|
-
|
|
2297
|
-
_ref$
|
|
2298
|
-
|
|
2254
|
+
_ref$onRegisterSucces = _ref.onRegisterSuccess,
|
|
2255
|
+
onRegisterSuccess = _ref$onRegisterSucces === void 0 ? function () {} : _ref$onRegisterSucces,
|
|
2256
|
+
_ref$onRegisterError = _ref.onRegisterError,
|
|
2257
|
+
onRegisterError = _ref$onRegisterError === void 0 ? function () {} : _ref$onRegisterError,
|
|
2299
2258
|
_ref$showPoweredByIma = _ref.showPoweredByImage,
|
|
2300
2259
|
showPoweredByImage = _ref$showPoweredByIma === void 0 ? false : _ref$showPoweredByIma;
|
|
2301
2260
|
|
|
@@ -2303,51 +2262,63 @@ var ForgotPasswordModal = function ForgotPasswordModal(_ref) {
|
|
|
2303
2262
|
loading = _useState[0],
|
|
2304
2263
|
setLoading = _useState[1];
|
|
2305
2264
|
|
|
2306
|
-
var
|
|
2307
|
-
var
|
|
2308
|
-
var
|
|
2309
|
-
|
|
2265
|
+
var onSignup = /*#__PURE__*/function () {
|
|
2266
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(values) {
|
|
2267
|
+
var formData, res, access_token_register, refreshToken, tokens;
|
|
2310
2268
|
return runtime_1.wrap(function _callee$(_context) {
|
|
2311
2269
|
while (1) {
|
|
2312
2270
|
switch (_context.prev = _context.next) {
|
|
2313
2271
|
case 0:
|
|
2314
|
-
|
|
2315
|
-
_context.prev = 1;
|
|
2272
|
+
_context.prev = 0;
|
|
2316
2273
|
setLoading(true);
|
|
2317
|
-
|
|
2318
|
-
|
|
2274
|
+
formData = new FormData();
|
|
2275
|
+
formData.set('first_name', values.firstName);
|
|
2276
|
+
formData.set('last_name', values.lastName);
|
|
2277
|
+
formData.set('email', values.email);
|
|
2278
|
+
formData.set('password', values.password);
|
|
2279
|
+
formData.set('password_confirmation', values.confirmPassword);
|
|
2280
|
+
formData.append('client_id', CONFIGS.CLIENT_ID || 'e9d8f8922797b4621e562255afe90dbf');
|
|
2281
|
+
formData.append('client_secret', CONFIGS.CLIENT_SECRET || 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9');
|
|
2282
|
+
_context.next = 12;
|
|
2283
|
+
return register(formData);
|
|
2319
2284
|
|
|
2320
|
-
case
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2285
|
+
case 12:
|
|
2286
|
+
res = _context.sent;
|
|
2287
|
+
access_token_register = _get(res, 'data.data.attributes.access_token');
|
|
2288
|
+
refreshToken = _get(res, 'data.data.attributes.refresh_token');
|
|
2289
|
+
handleSetAccessToken(access_token_register);
|
|
2290
|
+
tokens = {
|
|
2291
|
+
accessToken: access_token_register,
|
|
2292
|
+
refreshToken: refreshToken
|
|
2293
|
+
};
|
|
2294
|
+
onRegisterSuccess(tokens);
|
|
2324
2295
|
onClose();
|
|
2325
|
-
_context.next =
|
|
2296
|
+
_context.next = 24;
|
|
2326
2297
|
break;
|
|
2327
2298
|
|
|
2328
|
-
case
|
|
2329
|
-
_context.prev =
|
|
2330
|
-
_context.t0 = _context["catch"](
|
|
2299
|
+
case 21:
|
|
2300
|
+
_context.prev = 21;
|
|
2301
|
+
_context.t0 = _context["catch"](0);
|
|
2331
2302
|
|
|
2332
2303
|
if (axios.isAxiosError(_context.t0)) {
|
|
2333
|
-
|
|
2304
|
+
onRegisterError(_context.t0, values.email);
|
|
2334
2305
|
}
|
|
2335
2306
|
|
|
2336
|
-
case
|
|
2337
|
-
_context.prev =
|
|
2307
|
+
case 24:
|
|
2308
|
+
_context.prev = 24;
|
|
2338
2309
|
setLoading(false);
|
|
2339
|
-
return _context.finish(
|
|
2310
|
+
return _context.finish(24);
|
|
2340
2311
|
|
|
2341
|
-
case
|
|
2312
|
+
case 27:
|
|
2342
2313
|
case "end":
|
|
2343
2314
|
return _context.stop();
|
|
2344
2315
|
}
|
|
2345
2316
|
}
|
|
2346
|
-
}, _callee, null, [[
|
|
2317
|
+
}, _callee, null, [[0, 21, 24, 27]]);
|
|
2347
2318
|
}));
|
|
2348
2319
|
|
|
2349
|
-
return function
|
|
2350
|
-
return
|
|
2320
|
+
return function onSignup(_x) {
|
|
2321
|
+
return _ref2.apply(this, arguments);
|
|
2351
2322
|
};
|
|
2352
2323
|
}();
|
|
2353
2324
|
|
|
@@ -2358,529 +2329,597 @@ var ForgotPasswordModal = function ForgotPasswordModal(_ref) {
|
|
|
2358
2329
|
onClose: _onClose,
|
|
2359
2330
|
"aria-labelledby": "modal-modal-title",
|
|
2360
2331
|
"aria-describedby": "modal-modal-description",
|
|
2361
|
-
className: "
|
|
2332
|
+
className: "signup-modal"
|
|
2362
2333
|
}, React.createElement(Box, {
|
|
2363
|
-
style: style
|
|
2334
|
+
style: style$2
|
|
2364
2335
|
}, React.createElement("div", null, React.createElement(Formik, {
|
|
2365
2336
|
initialValues: {
|
|
2366
|
-
|
|
2337
|
+
firstName: '',
|
|
2338
|
+
lastName: '',
|
|
2339
|
+
email: '',
|
|
2340
|
+
password: '',
|
|
2341
|
+
confirmPassword: ''
|
|
2367
2342
|
},
|
|
2368
|
-
validationSchema:
|
|
2369
|
-
onSubmit:
|
|
2370
|
-
}, function (
|
|
2371
|
-
var isValid =
|
|
2372
|
-
dirty =
|
|
2373
|
-
handleSubmit =
|
|
2343
|
+
validationSchema: SignupSchema,
|
|
2344
|
+
onSubmit: onSignup
|
|
2345
|
+
}, function (_ref3) {
|
|
2346
|
+
var isValid = _ref3.isValid,
|
|
2347
|
+
dirty = _ref3.dirty,
|
|
2348
|
+
handleSubmit = _ref3.handleSubmit;
|
|
2374
2349
|
return React.createElement(Form, {
|
|
2375
2350
|
onSubmit: handleSubmit
|
|
2376
2351
|
}, React.createElement("div", {
|
|
2377
|
-
className: "
|
|
2352
|
+
className: "signup-container"
|
|
2378
2353
|
}, React.createElement("div", {
|
|
2379
2354
|
className: "title"
|
|
2380
|
-
}, "
|
|
2381
|
-
className: "
|
|
2355
|
+
}, "Create an Account"), React.createElement("div", {
|
|
2356
|
+
className: "signup-container__twoFields"
|
|
2357
|
+
}, React.createElement("div", {
|
|
2358
|
+
className: "is-half"
|
|
2359
|
+
}, React.createElement(Field, {
|
|
2360
|
+
name: "firstName",
|
|
2361
|
+
label: "First Name",
|
|
2362
|
+
component: CustomField
|
|
2363
|
+
})), React.createElement("div", {
|
|
2364
|
+
className: "is-half"
|
|
2365
|
+
}, React.createElement(Field, {
|
|
2366
|
+
name: "lastName",
|
|
2367
|
+
label: "Last Name",
|
|
2368
|
+
component: CustomField
|
|
2369
|
+
}))), React.createElement("div", {
|
|
2370
|
+
className: "signup-container__singleField"
|
|
2371
|
+
}, React.createElement("div", {
|
|
2372
|
+
className: ""
|
|
2382
2373
|
}, React.createElement(Field, {
|
|
2383
2374
|
name: "email",
|
|
2384
2375
|
label: "Email",
|
|
2385
2376
|
component: CustomField
|
|
2386
2377
|
}))), React.createElement("div", {
|
|
2387
|
-
className: "
|
|
2378
|
+
className: "signup-container__twoFields"
|
|
2379
|
+
}, React.createElement("div", {
|
|
2380
|
+
className: "is-half"
|
|
2381
|
+
}, React.createElement(Field, {
|
|
2382
|
+
name: "password",
|
|
2383
|
+
label: "Password",
|
|
2384
|
+
type: "password",
|
|
2385
|
+
component: CustomField
|
|
2386
|
+
})), React.createElement("div", {
|
|
2387
|
+
className: "is-half"
|
|
2388
|
+
}, React.createElement(Field, {
|
|
2389
|
+
name: "confirmPassword",
|
|
2390
|
+
label: "Confirm Password",
|
|
2391
|
+
type: "password",
|
|
2392
|
+
component: CustomField
|
|
2393
|
+
})))), React.createElement("div", {
|
|
2394
|
+
className: "signup-action-button"
|
|
2388
2395
|
}, React.createElement("button", {
|
|
2389
2396
|
type: "submit",
|
|
2390
2397
|
disabled: !(isValid && dirty)
|
|
2391
|
-
}, loading ? React.createElement(CircularProgress
|
|
2398
|
+
}, loading ? React.createElement(CircularProgress, {
|
|
2392
2399
|
size: "22px"
|
|
2393
2400
|
}) : 'Submit')), React.createElement("div", {
|
|
2394
2401
|
className: "login"
|
|
2395
2402
|
}, React.createElement("span", {
|
|
2396
2403
|
onClick: onLogin
|
|
2397
|
-
}, "
|
|
2404
|
+
}, "Login")), showPoweredByImage ? React.createElement(PoweredBy, null) : null);
|
|
2398
2405
|
}))));
|
|
2399
2406
|
};
|
|
2400
2407
|
|
|
2401
|
-
var
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
border: '1px solid white',
|
|
2409
|
-
outline: 'none'
|
|
2410
|
-
};
|
|
2411
|
-
var setLoggedUserData$1 = function setLoggedUserData(data) {
|
|
2412
|
-
return {
|
|
2413
|
-
id: data.id,
|
|
2414
|
-
first_name: data.firstName,
|
|
2415
|
-
last_name: data.lastName,
|
|
2416
|
-
email: data.email,
|
|
2417
|
-
confirmEmail: data.email,
|
|
2418
|
-
city: (data == null ? void 0 : data.city) || '',
|
|
2419
|
-
country: (data == null ? void 0 : data.countryId) || (data == null ? void 0 : data.country) || '',
|
|
2420
|
-
phone: (data == null ? void 0 : data.phone) || '',
|
|
2421
|
-
street_address: (data == null ? void 0 : data.streetAddress) || '',
|
|
2422
|
-
state: (data == null ? void 0 : data.stateId) || '',
|
|
2423
|
-
zip: (data == null ? void 0 : data.zip) || (data == null ? void 0 : data.zipCode) || ''
|
|
2424
|
-
};
|
|
2408
|
+
var showZero = function showZero(value) {
|
|
2409
|
+
if (value === void 0) {
|
|
2410
|
+
value = 0;
|
|
2411
|
+
}
|
|
2412
|
+
|
|
2413
|
+
var intNumber = Number(value);
|
|
2414
|
+
return _isNumber(intNumber) ? intNumber >= 0 && intNumber < 10 ? '0' + intNumber : intNumber : null;
|
|
2425
2415
|
};
|
|
2426
|
-
var LoginModal = function LoginModal(_ref) {
|
|
2427
|
-
var onClose = _ref.onClose,
|
|
2428
|
-
onLogin = _ref.onLogin,
|
|
2429
|
-
_ref$alreadyHasUser = _ref.alreadyHasUser,
|
|
2430
|
-
alreadyHasUser = _ref$alreadyHasUser === void 0 ? false : _ref$alreadyHasUser,
|
|
2431
|
-
_ref$userExpired = _ref.userExpired,
|
|
2432
|
-
userExpired = _ref$userExpired === void 0 ? false : _ref$userExpired,
|
|
2433
|
-
_ref$onGetProfileData = _ref.onGetProfileDataSuccess,
|
|
2434
|
-
onGetProfileDataSuccess = _ref$onGetProfileData === void 0 ? _identity : _ref$onGetProfileData,
|
|
2435
|
-
_ref$onGetProfileData2 = _ref.onGetProfileDataError,
|
|
2436
|
-
onGetProfileDataError = _ref$onGetProfileData2 === void 0 ? _identity : _ref$onGetProfileData2,
|
|
2437
|
-
_ref$onForgotPassword = _ref.onForgotPassword,
|
|
2438
|
-
onForgotPassword = _ref$onForgotPassword === void 0 ? _identity : _ref$onForgotPassword,
|
|
2439
|
-
_ref$onSignup = _ref.onSignup,
|
|
2440
|
-
onSignup = _ref$onSignup === void 0 ? _identity : _ref$onSignup,
|
|
2441
|
-
_ref$modalClassname = _ref.modalClassname,
|
|
2442
|
-
modalClassname = _ref$modalClassname === void 0 ? '' : _ref$modalClassname,
|
|
2443
|
-
logo = _ref.logo,
|
|
2444
|
-
_ref$showForgotPasswo = _ref.showForgotPasswordButton,
|
|
2445
|
-
showForgotPasswordButton = _ref$showForgotPasswo === void 0 ? false : _ref$showForgotPasswo,
|
|
2446
|
-
_ref$showSignUpButton = _ref.showSignUpButton,
|
|
2447
|
-
showSignUpButton = _ref$showSignUpButton === void 0 ? false : _ref$showSignUpButton,
|
|
2448
|
-
_ref$showPoweredByIma = _ref.showPoweredByImage,
|
|
2449
|
-
showPoweredByImage = _ref$showPoweredByIma === void 0 ? false : _ref$showPoweredByIma;
|
|
2450
2416
|
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2417
|
+
var getImage = function getImage(name) {
|
|
2418
|
+
if (name === void 0) {
|
|
2419
|
+
name = '';
|
|
2420
|
+
}
|
|
2454
2421
|
|
|
2455
|
-
|
|
2456
|
-
open: true,
|
|
2457
|
-
onClose: onClose,
|
|
2458
|
-
"aria-labelledby": "modal-modal-title",
|
|
2459
|
-
"aria-describedby": "modal-modal-description",
|
|
2460
|
-
className: "login-modal " + modalClassname
|
|
2461
|
-
}, React.createElement(Box$1, {
|
|
2462
|
-
style: style$1
|
|
2463
|
-
}, React.createElement("div", null, React.createElement(Formik, {
|
|
2464
|
-
initialValues: {
|
|
2465
|
-
email: '',
|
|
2466
|
-
password: ''
|
|
2467
|
-
},
|
|
2468
|
-
onSubmit: function () {
|
|
2469
|
-
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(_ref2) {
|
|
2470
|
-
var email, password, body, profileResponse, profileSpecifiedData, profileDataObj, event, _e$response, _e$response$data, _error;
|
|
2422
|
+
var image = '';
|
|
2471
2423
|
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
case 0:
|
|
2476
|
-
email = _ref2.email, password = _ref2.password;
|
|
2477
|
-
_context.prev = 1;
|
|
2478
|
-
body = {
|
|
2479
|
-
email: email,
|
|
2480
|
-
password: password
|
|
2481
|
-
};
|
|
2482
|
-
_context.next = 5;
|
|
2483
|
-
return authorize(body);
|
|
2424
|
+
if (!name.trim().length) {
|
|
2425
|
+
return image;
|
|
2426
|
+
}
|
|
2484
2427
|
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
return getProfileData();
|
|
2428
|
+
if (process.env.NODE_ENV === 'production') {
|
|
2429
|
+
image = require("./images/" + name);
|
|
2430
|
+
return image["default"];
|
|
2431
|
+
}
|
|
2490
2432
|
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
onGetProfileDataSuccess(profileResponse.data);
|
|
2494
|
-
_context.next = 17;
|
|
2495
|
-
break;
|
|
2433
|
+
return image;
|
|
2434
|
+
};
|
|
2496
2435
|
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2436
|
+
var TimerWidget = function TimerWidget(_ref) {
|
|
2437
|
+
var expires_at = _ref.expires_at,
|
|
2438
|
+
buyLoading = _ref.buyLoading,
|
|
2439
|
+
_ref$onCountdownFinis = _ref.onCountdownFinish,
|
|
2440
|
+
onCountdownFinish = _ref$onCountdownFinis === void 0 ? function () {} : _ref$onCountdownFinis;
|
|
2500
2441
|
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2442
|
+
var _useState = useState(true),
|
|
2443
|
+
showTimer = _useState[0],
|
|
2444
|
+
setShowTimer = _useState[1];
|
|
2504
2445
|
|
|
2505
|
-
|
|
2446
|
+
var handleCountdownFinish = function handleCountdownFinish() {
|
|
2447
|
+
setShowTimer(false);
|
|
2506
2448
|
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2449
|
+
if (!buyLoading) {
|
|
2450
|
+
onCountdownFinish();
|
|
2451
|
+
}
|
|
2452
|
+
};
|
|
2510
2453
|
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2454
|
+
var _renderer = function renderer(_ref2) {
|
|
2455
|
+
var minutes = _ref2.minutes,
|
|
2456
|
+
seconds = _ref2.seconds,
|
|
2457
|
+
completed = _ref2.completed,
|
|
2458
|
+
handleCountdownFinish = _ref2.handleCountdownFinish;
|
|
2516
2459
|
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2460
|
+
if (completed) {
|
|
2461
|
+
handleCountdownFinish();
|
|
2462
|
+
return null;
|
|
2463
|
+
}
|
|
2520
2464
|
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
_context.t1 = _context["catch"](1);
|
|
2465
|
+
return React.createElement("span", null, showZero(minutes), ":", showZero(seconds));
|
|
2466
|
+
};
|
|
2524
2467
|
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
setError(_error);
|
|
2528
|
-
} else if (_context.t1 instanceof Error) {
|
|
2529
|
-
setError((_context.t1 == null ? void 0 : _context.t1.message) || 'Error');
|
|
2530
|
-
}
|
|
2468
|
+
var hideTimer = function hideTimer() {
|
|
2469
|
+
var timerRl = document.querySelector('.timer');
|
|
2531
2470
|
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2471
|
+
if (timerRl) {
|
|
2472
|
+
timerRl.style.visibility = "hidden";
|
|
2473
|
+
}
|
|
2474
|
+
};
|
|
2475
|
+
|
|
2476
|
+
return showTimer && !!expires_at ? React.createElement("div", {
|
|
2477
|
+
className: "timer"
|
|
2478
|
+
}, React.createElement("div", {
|
|
2479
|
+
className: 'close-icon',
|
|
2480
|
+
onClick: hideTimer
|
|
2481
|
+
}, React.createElement(SVG, {
|
|
2482
|
+
src: getImage('cross.svg'),
|
|
2483
|
+
width: '10',
|
|
2484
|
+
height: '10',
|
|
2485
|
+
fill: '#fff'
|
|
2486
|
+
})), React.createElement("div", {
|
|
2487
|
+
className: "toast-message"
|
|
2488
|
+
}, React.createElement("p", null, "Please complete your purchase before the timer reaches zero."), React.createElement("p", {
|
|
2489
|
+
className: "countdown"
|
|
2490
|
+
}, React.createElement(Countdown$1, {
|
|
2491
|
+
date: Date.now() + expires_at * 1000,
|
|
2492
|
+
renderer: function renderer(props) {
|
|
2493
|
+
return _renderer(_extends({}, props, {
|
|
2494
|
+
handleCountdownFinish: handleCountdownFinish
|
|
2538
2495
|
}));
|
|
2496
|
+
}
|
|
2497
|
+
})))) : null;
|
|
2498
|
+
};
|
|
2539
2499
|
|
|
2540
|
-
|
|
2541
|
-
return _onSubmit.apply(this, arguments);
|
|
2542
|
-
}
|
|
2500
|
+
var TimerWidget$1 = /*#__PURE__*/memo(TimerWidget);
|
|
2543
2501
|
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
return React.createElement(Form, {
|
|
2548
|
-
onSubmit: props.handleSubmit
|
|
2549
|
-
}, React.createElement("div", {
|
|
2550
|
-
className: "modal-title"
|
|
2551
|
-
}, "Login"), React.createElement("div", {
|
|
2552
|
-
className: 'login-logo-container'
|
|
2553
|
-
}, React.createElement("img", {
|
|
2554
|
-
className: "login-logo-tff",
|
|
2555
|
-
src: logo || "https://www.ticketfairy.com/resources/images/logo-ttf-black.svg",
|
|
2556
|
-
alt: "logo"
|
|
2557
|
-
})), React.createElement("div", {
|
|
2558
|
-
className: "server_auth__error"
|
|
2559
|
-
}, error), alreadyHasUser && React.createElement("p", {
|
|
2560
|
-
className: "info-text-for-login"
|
|
2561
|
-
}, "It appears this email is already attached to an account. Please log in here to complete your registration."), userExpired && React.createElement("p", {
|
|
2562
|
-
className: "info-text-for-login"
|
|
2563
|
-
}, "Your session has expired, please log in again."), React.createElement("div", {
|
|
2564
|
-
className: "login-modal-body"
|
|
2565
|
-
}, React.createElement("div", {
|
|
2566
|
-
className: "login-modal-body__email"
|
|
2567
|
-
}, React.createElement(Field, {
|
|
2568
|
-
name: 'email',
|
|
2569
|
-
validate: requiredValidator
|
|
2570
|
-
}, function (_ref3) {
|
|
2571
|
-
var field = _ref3.field,
|
|
2572
|
-
meta = _ref3.meta;
|
|
2573
|
-
return React.createElement(TextField$1, Object.assign({
|
|
2574
|
-
label: 'Email',
|
|
2575
|
-
type: 'email',
|
|
2576
|
-
fullWidth: true,
|
|
2577
|
-
error: !!meta.error && meta.touched,
|
|
2578
|
-
helperText: meta.touched && meta.error
|
|
2579
|
-
}, field));
|
|
2580
|
-
})), React.createElement("div", {
|
|
2581
|
-
className: "login-modal-body__password"
|
|
2582
|
-
}, React.createElement(Field, {
|
|
2583
|
-
name: 'password',
|
|
2584
|
-
validate: requiredValidator
|
|
2585
|
-
}, function (_ref4) {
|
|
2586
|
-
var field = _ref4.field,
|
|
2587
|
-
meta = _ref4.meta;
|
|
2588
|
-
return React.createElement(TextField$1, Object.assign({
|
|
2589
|
-
label: "Password",
|
|
2590
|
-
type: "password",
|
|
2591
|
-
fullWidth: true,
|
|
2592
|
-
error: !!meta.error && meta.touched,
|
|
2593
|
-
helperText: meta.touched && meta.error
|
|
2594
|
-
}, field));
|
|
2595
|
-
})), React.createElement("div", {
|
|
2596
|
-
className: "login-action-button"
|
|
2597
|
-
}, React.createElement("button", {
|
|
2598
|
-
type: "submit"
|
|
2599
|
-
}, "Login")), showForgotPasswordButton && React.createElement("div", {
|
|
2600
|
-
className: "forgot-password"
|
|
2601
|
-
}, React.createElement("span", {
|
|
2602
|
-
"aria-hidden": "true",
|
|
2603
|
-
onClick: onForgotPassword
|
|
2604
|
-
}, "Forgot password?")), showSignUpButton && React.createElement("div", {
|
|
2605
|
-
className: "forgot-password"
|
|
2606
|
-
}, React.createElement("span", {
|
|
2607
|
-
"aria-hidden": "true",
|
|
2608
|
-
onClick: onSignup
|
|
2609
|
-
}, "Sign up")), showPoweredByImage ? React.createElement(PoweredBy, null) : null));
|
|
2610
|
-
}))));
|
|
2611
|
-
};
|
|
2502
|
+
var _excluded = ["label", "field", "selectOptions", "theme", "setFieldValue", "disableDropdown", "setPhoneValidationIsLoading", "defaultCountry", "required", "uniqueId", "dateFormat", "datePlaceholder"];
|
|
2503
|
+
var CheckboxField = function CheckboxField(_ref) {
|
|
2504
|
+
var _rest$form, _field$name, _rest$form2, _field$name2;
|
|
2612
2505
|
|
|
2613
|
-
var
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2506
|
+
var label = _ref.label,
|
|
2507
|
+
field = _ref.field,
|
|
2508
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
2509
|
+
|
|
2510
|
+
var customTheme = useTheme();
|
|
2511
|
+
return React.createElement(FormControl, {
|
|
2512
|
+
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 : ''])
|
|
2513
|
+
}, React.createElement(FormGroup, null, React.createElement(FormControlLabel, {
|
|
2514
|
+
control: React.createElement(Checkbox, Object.assign({}, field, rest)),
|
|
2515
|
+
label: label,
|
|
2516
|
+
componentsProps: {
|
|
2517
|
+
typography: customTheme == null ? void 0 : customTheme.checkbox
|
|
2518
|
+
}
|
|
2519
|
+
})), !!(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);
|
|
2623
2520
|
};
|
|
2624
|
-
var SignupSchema = /*#__PURE__*/object().shape({
|
|
2625
|
-
firstName: /*#__PURE__*/string().required('Required'),
|
|
2626
|
-
lastName: /*#__PURE__*/string().required('Required'),
|
|
2627
|
-
email: /*#__PURE__*/string().email('Invalid email').required('Required'),
|
|
2628
|
-
password: /*#__PURE__*/string().min(6, 'Password must have 5+ characters').required('Required'),
|
|
2629
|
-
confirmPassword: /*#__PURE__*/string().required('Required').oneOf([/*#__PURE__*/ref('password'), null], 'Passwords must match')
|
|
2630
|
-
});
|
|
2631
|
-
var SignupModal = function SignupModal(_ref) {
|
|
2632
|
-
var _ref$onClose = _ref.onClose,
|
|
2633
|
-
onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
|
|
2634
|
-
_ref$onLogin = _ref.onLogin,
|
|
2635
|
-
onLogin = _ref$onLogin === void 0 ? function () {} : _ref$onLogin,
|
|
2636
|
-
_ref$onRegisterSucces = _ref.onRegisterSuccess,
|
|
2637
|
-
onRegisterSuccess = _ref$onRegisterSucces === void 0 ? function () {} : _ref$onRegisterSucces,
|
|
2638
|
-
_ref$onRegisterError = _ref.onRegisterError,
|
|
2639
|
-
onRegisterError = _ref$onRegisterError === void 0 ? function () {} : _ref$onRegisterError,
|
|
2640
|
-
_ref$showPoweredByIma = _ref.showPoweredByImage,
|
|
2641
|
-
showPoweredByImage = _ref$showPoweredByIma === void 0 ? false : _ref$showPoweredByIma;
|
|
2642
2521
|
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2522
|
+
var PhoneNumberField = function PhoneNumberField(_ref) {
|
|
2523
|
+
var label = _ref.label,
|
|
2524
|
+
field = _ref.field,
|
|
2525
|
+
_ref$form = _ref.form,
|
|
2526
|
+
errors = _ref$form.errors,
|
|
2527
|
+
touched = _ref$form.touched,
|
|
2528
|
+
setFieldError = _ref$form.setFieldError,
|
|
2529
|
+
values = _ref$form.values,
|
|
2530
|
+
initialValues = _ref$form.initialValues,
|
|
2531
|
+
setFieldValue = _ref$form.setFieldValue,
|
|
2532
|
+
setFieldTouched = _ref$form.setFieldTouched,
|
|
2533
|
+
setErrors = _ref$form.setErrors,
|
|
2534
|
+
_ref$disableDropdown = _ref.disableDropdown,
|
|
2535
|
+
disableDropdown = _ref$disableDropdown === void 0 ? true : _ref$disableDropdown,
|
|
2536
|
+
_ref$defaultCountry = _ref.defaultCountry,
|
|
2537
|
+
defaultCountry = _ref$defaultCountry === void 0 ? 'us' : _ref$defaultCountry,
|
|
2538
|
+
_ref$fill = _ref.fill,
|
|
2539
|
+
fill = _ref$fill === void 0 ? false : _ref$fill,
|
|
2540
|
+
setPhoneValidationIsLoading = _ref.setPhoneValidationIsLoading;
|
|
2541
|
+
|
|
2542
|
+
var error = _get(errors, field.name);
|
|
2543
|
+
|
|
2544
|
+
var isTouched = Boolean(_get(touched, field.name)); // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2545
|
+
|
|
2546
|
+
var debounceCb = useCallback(_debounce(function (cb) {
|
|
2547
|
+
return void cb();
|
|
2548
|
+
}, 1000), []);
|
|
2549
|
+
useEffect(function () {
|
|
2550
|
+
if (field.value) {
|
|
2551
|
+
setPhoneValidationIsLoading(true);
|
|
2552
|
+
}
|
|
2553
|
+
|
|
2554
|
+
debounceCb( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
2555
|
+
var newErrors, _newErrors, message;
|
|
2646
2556
|
|
|
2647
|
-
var onSignup = /*#__PURE__*/function () {
|
|
2648
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(values) {
|
|
2649
|
-
var formData, res, access_token_register, refreshToken, tokens;
|
|
2650
2557
|
return runtime_1.wrap(function _callee$(_context) {
|
|
2651
2558
|
while (1) {
|
|
2652
2559
|
switch (_context.prev = _context.next) {
|
|
2653
2560
|
case 0:
|
|
2654
2561
|
_context.prev = 0;
|
|
2655
|
-
setLoading(true);
|
|
2656
|
-
formData = new FormData();
|
|
2657
|
-
formData.set('first_name', values.firstName);
|
|
2658
|
-
formData.set('last_name', values.lastName);
|
|
2659
|
-
formData.set('email', values.email);
|
|
2660
|
-
formData.set('password', values.password);
|
|
2661
|
-
formData.set('password_confirmation', values.confirmPassword);
|
|
2662
|
-
formData.append('client_id', CONFIGS.CLIENT_ID || 'e9d8f8922797b4621e562255afe90dbf');
|
|
2663
|
-
formData.append('client_secret', CONFIGS.CLIENT_SECRET || 'b89c191eff22fdcf84ac9bfd88d005355a151ec2c83b26b9');
|
|
2664
|
-
_context.next = 12;
|
|
2665
|
-
return register(formData);
|
|
2666
2562
|
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2563
|
+
if (values[field.name]) {
|
|
2564
|
+
_context.next = 6;
|
|
2565
|
+
break;
|
|
2566
|
+
}
|
|
2567
|
+
|
|
2568
|
+
newErrors = _extends({}, errors);
|
|
2569
|
+
delete newErrors[field.name];
|
|
2570
|
+
setErrors(newErrors);
|
|
2571
|
+
return _context.abrupt("return");
|
|
2572
|
+
|
|
2573
|
+
case 6:
|
|
2574
|
+
if (!values[field.name]) {
|
|
2575
|
+
_context.next = 9;
|
|
2576
|
+
break;
|
|
2577
|
+
}
|
|
2578
|
+
|
|
2579
|
+
_context.next = 9;
|
|
2580
|
+
return validatePhoneNumber(values[field.name]);
|
|
2581
|
+
|
|
2582
|
+
case 9:
|
|
2583
|
+
if (errors[field.name]) {
|
|
2584
|
+
_newErrors = _extends({}, errors);
|
|
2585
|
+
delete _newErrors[field.name];
|
|
2586
|
+
setErrors(_newErrors);
|
|
2587
|
+
}
|
|
2588
|
+
|
|
2589
|
+
_context.next = 16;
|
|
2679
2590
|
break;
|
|
2680
2591
|
|
|
2681
|
-
case
|
|
2682
|
-
_context.prev =
|
|
2592
|
+
case 12:
|
|
2593
|
+
_context.prev = 12;
|
|
2683
2594
|
_context.t0 = _context["catch"](0);
|
|
2595
|
+
message = _get(_context.t0, 'response.data.message', 'Invalid phone number');
|
|
2684
2596
|
|
|
2685
|
-
if (
|
|
2686
|
-
|
|
2597
|
+
if (values[field.name] && errors[field.name] !== message) {
|
|
2598
|
+
setFieldError(field.name, message);
|
|
2687
2599
|
}
|
|
2688
2600
|
|
|
2689
|
-
case
|
|
2690
|
-
_context.prev =
|
|
2691
|
-
|
|
2692
|
-
return _context.finish(
|
|
2601
|
+
case 16:
|
|
2602
|
+
_context.prev = 16;
|
|
2603
|
+
setPhoneValidationIsLoading(false);
|
|
2604
|
+
return _context.finish(16);
|
|
2693
2605
|
|
|
2694
|
-
case
|
|
2606
|
+
case 19:
|
|
2695
2607
|
case "end":
|
|
2696
2608
|
return _context.stop();
|
|
2697
2609
|
}
|
|
2698
2610
|
}
|
|
2699
|
-
}, _callee, null, [[0,
|
|
2700
|
-
}));
|
|
2611
|
+
}, _callee, null, [[0, 12, 16, 19]]);
|
|
2612
|
+
}))); // eslint-disable-next-line
|
|
2613
|
+
}, [field.value]);
|
|
2614
|
+
return React.createElement(React.Fragment, null, React.createElement(MuiPhoneNumber, {
|
|
2615
|
+
name: field.name,
|
|
2616
|
+
value: fill ? values[field.name] : initialValues[field.name],
|
|
2617
|
+
onChange: function onChange(value, country) {
|
|
2618
|
+
if ("+" + (country == null ? void 0 : country.dialCode) === value || value === '+') {
|
|
2619
|
+
setFieldValue(field.name, '');
|
|
2620
|
+
setFieldError(field.name, '');
|
|
2621
|
+
} else {
|
|
2622
|
+
setFieldTouched(field.name, true);
|
|
2623
|
+
setFieldValue(field.name, value);
|
|
2624
|
+
}
|
|
2625
|
+
},
|
|
2626
|
+
variant: "outlined",
|
|
2627
|
+
defaultCountry: defaultCountry,
|
|
2628
|
+
disableDropdown: disableDropdown,
|
|
2629
|
+
label: label,
|
|
2630
|
+
error: !!error && (isTouched || fill),
|
|
2631
|
+
helperText: (isTouched || fill) && error,
|
|
2632
|
+
fullWidth: true,
|
|
2633
|
+
autoFormat: false,
|
|
2634
|
+
disableAreaCodes: true,
|
|
2635
|
+
countryCodeEditable: false
|
|
2636
|
+
}));
|
|
2637
|
+
};
|
|
2701
2638
|
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
}();
|
|
2639
|
+
function Loader() {
|
|
2640
|
+
return React.createElement("div", {
|
|
2641
|
+
className: "loader-container"
|
|
2642
|
+
}, React.createElement(CircularProgress$1, null));
|
|
2643
|
+
}
|
|
2706
2644
|
|
|
2707
|
-
|
|
2645
|
+
var NativeSelectField = function NativeSelectField(_ref) {
|
|
2646
|
+
var label = _ref.label,
|
|
2647
|
+
_ref$type = _ref.type,
|
|
2648
|
+
type = _ref$type === void 0 ? 'text' : _ref$type,
|
|
2649
|
+
field = _ref.field,
|
|
2650
|
+
_ref$selectOptions = _ref.selectOptions,
|
|
2651
|
+
selectOptions = _ref$selectOptions === void 0 ? [] : _ref$selectOptions,
|
|
2652
|
+
_ref$form = _ref.form,
|
|
2653
|
+
touched = _ref$form.touched,
|
|
2654
|
+
errors = _ref$form.errors,
|
|
2655
|
+
setFieldValue = _ref$form.setFieldValue,
|
|
2656
|
+
theme = _ref.theme,
|
|
2657
|
+
_ref$onChange = _ref.onChange,
|
|
2658
|
+
_onChange = _ref$onChange === void 0 ? function () {} : _ref$onChange;
|
|
2708
2659
|
|
|
2709
|
-
|
|
2710
|
-
open: true,
|
|
2711
|
-
onClose: _onClose,
|
|
2712
|
-
"aria-labelledby": "modal-modal-title",
|
|
2713
|
-
"aria-describedby": "modal-modal-description",
|
|
2714
|
-
className: "signup-modal"
|
|
2715
|
-
}, React.createElement(Box, {
|
|
2716
|
-
style: style$2
|
|
2717
|
-
}, React.createElement("div", null, React.createElement(Formik, {
|
|
2718
|
-
initialValues: {
|
|
2719
|
-
firstName: '',
|
|
2720
|
-
lastName: '',
|
|
2721
|
-
email: '',
|
|
2722
|
-
password: '',
|
|
2723
|
-
confirmPassword: ''
|
|
2724
|
-
},
|
|
2725
|
-
validationSchema: SignupSchema,
|
|
2726
|
-
onSubmit: onSignup
|
|
2727
|
-
}, function (_ref3) {
|
|
2728
|
-
var isValid = _ref3.isValid,
|
|
2729
|
-
dirty = _ref3.dirty,
|
|
2730
|
-
handleSubmit = _ref3.handleSubmit;
|
|
2731
|
-
return React.createElement(Form, {
|
|
2732
|
-
onSubmit: handleSubmit
|
|
2733
|
-
}, React.createElement("div", {
|
|
2734
|
-
className: "signup-container"
|
|
2735
|
-
}, React.createElement("div", {
|
|
2736
|
-
className: "title"
|
|
2737
|
-
}, "Create an Account"), React.createElement("div", {
|
|
2738
|
-
className: "signup-container__twoFields"
|
|
2739
|
-
}, React.createElement("div", {
|
|
2740
|
-
className: "is-half"
|
|
2741
|
-
}, React.createElement(Field, {
|
|
2742
|
-
name: "firstName",
|
|
2743
|
-
label: "First Name",
|
|
2744
|
-
component: CustomField
|
|
2745
|
-
})), React.createElement("div", {
|
|
2746
|
-
className: "is-half"
|
|
2747
|
-
}, React.createElement(Field, {
|
|
2748
|
-
name: "lastName",
|
|
2749
|
-
label: "Last Name",
|
|
2750
|
-
component: CustomField
|
|
2751
|
-
}))), React.createElement("div", {
|
|
2752
|
-
className: "signup-container__singleField"
|
|
2753
|
-
}, React.createElement("div", {
|
|
2754
|
-
className: ""
|
|
2755
|
-
}, React.createElement(Field, {
|
|
2756
|
-
name: "email",
|
|
2757
|
-
label: "Email",
|
|
2758
|
-
component: CustomField
|
|
2759
|
-
}))), React.createElement("div", {
|
|
2760
|
-
className: "signup-container__twoFields"
|
|
2761
|
-
}, React.createElement("div", {
|
|
2762
|
-
className: "is-half"
|
|
2763
|
-
}, React.createElement(Field, {
|
|
2764
|
-
name: "password",
|
|
2765
|
-
label: "Password",
|
|
2766
|
-
type: "password",
|
|
2767
|
-
component: CustomField
|
|
2768
|
-
})), React.createElement("div", {
|
|
2769
|
-
className: "is-half"
|
|
2770
|
-
}, React.createElement(Field, {
|
|
2771
|
-
name: "confirmPassword",
|
|
2772
|
-
label: "Confirm Password",
|
|
2773
|
-
type: "password",
|
|
2774
|
-
component: CustomField
|
|
2775
|
-
})))), React.createElement("div", {
|
|
2776
|
-
className: "signup-action-button"
|
|
2777
|
-
}, React.createElement("button", {
|
|
2778
|
-
type: "submit",
|
|
2779
|
-
disabled: !(isValid && dirty)
|
|
2780
|
-
}, loading ? React.createElement(CircularProgress$1, {
|
|
2781
|
-
size: "22px"
|
|
2782
|
-
}) : 'Submit')), React.createElement("div", {
|
|
2783
|
-
className: "login"
|
|
2784
|
-
}, React.createElement("span", {
|
|
2785
|
-
onClick: onLogin
|
|
2786
|
-
}, "Login")), showPoweredByImage ? React.createElement(PoweredBy, null) : null);
|
|
2787
|
-
}))));
|
|
2788
|
-
};
|
|
2660
|
+
var isTouched = Boolean(_get(touched, field.name));
|
|
2789
2661
|
|
|
2790
|
-
var
|
|
2791
|
-
if (value === void 0) {
|
|
2792
|
-
value = 0;
|
|
2793
|
-
}
|
|
2662
|
+
var error = _get(errors, field.name);
|
|
2794
2663
|
|
|
2795
|
-
var
|
|
2796
|
-
return
|
|
2664
|
+
var customTheme = useTheme();
|
|
2665
|
+
return React.createElement(FormControl, {
|
|
2666
|
+
fullWidth: true
|
|
2667
|
+
}, React.createElement(InputLabel, {
|
|
2668
|
+
style: customTheme == null ? void 0 : customTheme.input,
|
|
2669
|
+
htmlFor: field.name,
|
|
2670
|
+
error: !!error && isTouched,
|
|
2671
|
+
shrink: true
|
|
2672
|
+
}, label), React.createElement(Select, Object.assign({
|
|
2673
|
+
id: field.name,
|
|
2674
|
+
label: label,
|
|
2675
|
+
type: type,
|
|
2676
|
+
fullWidth: true,
|
|
2677
|
+
error: !!error && isTouched,
|
|
2678
|
+
inputProps: {
|
|
2679
|
+
id: field.name
|
|
2680
|
+
},
|
|
2681
|
+
"native": true,
|
|
2682
|
+
className: theme,
|
|
2683
|
+
MenuProps: {
|
|
2684
|
+
className: theme
|
|
2685
|
+
}
|
|
2686
|
+
}, field, {
|
|
2687
|
+
style: customTheme == null ? void 0 : customTheme.input,
|
|
2688
|
+
onChange: function onChange(e) {
|
|
2689
|
+
_onChange(e);
|
|
2690
|
+
|
|
2691
|
+
setFieldValue(field.name, e.target.value);
|
|
2692
|
+
}
|
|
2693
|
+
}), _map(selectOptions, function (option) {
|
|
2694
|
+
return React.createElement("option", {
|
|
2695
|
+
key: option.value,
|
|
2696
|
+
value: option.value,
|
|
2697
|
+
disabled: option.disabled
|
|
2698
|
+
}, option.label);
|
|
2699
|
+
})), isTouched && error ? React.createElement(FormHelperText, {
|
|
2700
|
+
error: !!error && isTouched
|
|
2701
|
+
}, error) : null);
|
|
2797
2702
|
};
|
|
2798
2703
|
|
|
2799
|
-
var
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2704
|
+
var RadioGroupField = function RadioGroupField(_ref) {
|
|
2705
|
+
var label = _ref.label,
|
|
2706
|
+
field = _ref.field,
|
|
2707
|
+
radios = _ref.radios,
|
|
2708
|
+
disabled = _ref.disabled,
|
|
2709
|
+
_ref$form = _ref.form,
|
|
2710
|
+
touched = _ref$form.touched,
|
|
2711
|
+
errors = _ref$form.errors,
|
|
2712
|
+
setFieldValue = _ref$form.setFieldValue,
|
|
2713
|
+
_ref$onChange = _ref.onChange,
|
|
2714
|
+
onChange = _ref$onChange === void 0 ? _identity : _ref$onChange;
|
|
2715
|
+
var radioId = "radio-" + field.name;
|
|
2803
2716
|
|
|
2804
|
-
var
|
|
2717
|
+
var error = _get(errors, field.name);
|
|
2805
2718
|
|
|
2806
|
-
|
|
2807
|
-
return image;
|
|
2808
|
-
}
|
|
2719
|
+
var isTouched = Boolean(_get(touched, field.name));
|
|
2809
2720
|
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2721
|
+
var handleChange = function handleChange(e) {
|
|
2722
|
+
var value = e.target.value;
|
|
2723
|
+
setFieldValue(field.name, value);
|
|
2724
|
+
onChange(e);
|
|
2725
|
+
};
|
|
2814
2726
|
|
|
2815
|
-
return
|
|
2727
|
+
if (!radios) return null;
|
|
2728
|
+
return React.createElement(FormControl$1, {
|
|
2729
|
+
disabled: disabled,
|
|
2730
|
+
error: isTouched && Boolean(error)
|
|
2731
|
+
}, isTouched && Boolean(error) ? React.createElement(FormHelperText$1, {
|
|
2732
|
+
className: "radio-error",
|
|
2733
|
+
error: true
|
|
2734
|
+
}, error) : null, label && React.createElement(FormLabel, {
|
|
2735
|
+
id: radioId
|
|
2736
|
+
}, label), React.createElement(RadioGroup, {
|
|
2737
|
+
"aria-labelledby": radioId,
|
|
2738
|
+
name: field.name,
|
|
2739
|
+
value: field.value,
|
|
2740
|
+
onChange: handleChange
|
|
2741
|
+
}, radios.map(function (radio) {
|
|
2742
|
+
var id = radio.id,
|
|
2743
|
+
label = radio.label,
|
|
2744
|
+
value = radio.value;
|
|
2745
|
+
return React.createElement(FormControlLabel, {
|
|
2746
|
+
key: id,
|
|
2747
|
+
label: label,
|
|
2748
|
+
value: value,
|
|
2749
|
+
control: React.createElement(Radio, null)
|
|
2750
|
+
});
|
|
2751
|
+
})));
|
|
2816
2752
|
};
|
|
2817
2753
|
|
|
2818
|
-
|
|
2819
|
-
var
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2754
|
+
function SelectField(_ref) {
|
|
2755
|
+
var label = _ref.label,
|
|
2756
|
+
isMultiple = _ref.isMultiple,
|
|
2757
|
+
field = _ref.field,
|
|
2758
|
+
_ref$form = _ref.form,
|
|
2759
|
+
touched = _ref$form.touched,
|
|
2760
|
+
errors = _ref$form.errors,
|
|
2761
|
+
setFieldValue = _ref$form.setFieldValue,
|
|
2762
|
+
options = _ref.options,
|
|
2763
|
+
disabled = _ref.disabled,
|
|
2764
|
+
_ref$onChange = _ref.onChange,
|
|
2765
|
+
onChange = _ref$onChange === void 0 ? _identity : _ref$onChange;
|
|
2766
|
+
var name = field.name,
|
|
2767
|
+
value = field.value;
|
|
2768
|
+
var selectId = "select-field-" + name;
|
|
2823
2769
|
|
|
2824
|
-
var
|
|
2825
|
-
showTimer = _useState[0],
|
|
2826
|
-
setShowTimer = _useState[1];
|
|
2770
|
+
var error = _get(errors, name);
|
|
2827
2771
|
|
|
2828
|
-
var
|
|
2829
|
-
setShowTimer(false);
|
|
2772
|
+
var isTouched = Boolean(_get(touched, field.name));
|
|
2830
2773
|
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2774
|
+
var handleChange = function handleChange(event) {
|
|
2775
|
+
var value = event.target.value;
|
|
2776
|
+
setFieldValue(name, value);
|
|
2777
|
+
onChange(event);
|
|
2834
2778
|
};
|
|
2835
2779
|
|
|
2836
|
-
var
|
|
2837
|
-
var
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
handleCountdownFinish = _ref2.handleCountdownFinish;
|
|
2780
|
+
var getSelectedItemLabel = function getSelectedItemLabel(selectedValue) {
|
|
2781
|
+
var selectedItem = options.find(function (option) {
|
|
2782
|
+
return option.value === selectedValue;
|
|
2783
|
+
});
|
|
2841
2784
|
|
|
2842
|
-
|
|
2843
|
-
handleCountdownFinish();
|
|
2844
|
-
return null;
|
|
2845
|
-
}
|
|
2785
|
+
var label = _get(selectedItem, 'label', '');
|
|
2846
2786
|
|
|
2847
|
-
return
|
|
2787
|
+
return label;
|
|
2848
2788
|
};
|
|
2849
2789
|
|
|
2850
|
-
|
|
2851
|
-
|
|
2790
|
+
return React.createElement(React.Fragment, null, React.createElement(FormControl, {
|
|
2791
|
+
fullWidth: true,
|
|
2792
|
+
disabled: disabled,
|
|
2793
|
+
error: isTouched && Boolean(error)
|
|
2794
|
+
}, label && React.createElement(InputLabel, {
|
|
2795
|
+
id: selectId
|
|
2796
|
+
}, label), React.createElement(Select, {
|
|
2797
|
+
id: name,
|
|
2798
|
+
labelId: selectId,
|
|
2799
|
+
multiple: isMultiple,
|
|
2800
|
+
value: value,
|
|
2801
|
+
onChange: handleChange,
|
|
2802
|
+
input: React.createElement(OutlinedInput, {
|
|
2803
|
+
label: label
|
|
2804
|
+
}),
|
|
2805
|
+
renderValue: function renderValue(selected) {
|
|
2806
|
+
if (isMultiple) {
|
|
2807
|
+
var selectedLabels = _map(selected, function (selectedValue) {
|
|
2808
|
+
return getSelectedItemLabel(selectedValue);
|
|
2809
|
+
});
|
|
2852
2810
|
|
|
2853
|
-
|
|
2854
|
-
|
|
2811
|
+
return selectedLabels.join(', ');
|
|
2812
|
+
}
|
|
2813
|
+
|
|
2814
|
+
var selectedLabel = getSelectedItemLabel(selected);
|
|
2815
|
+
return selectedLabel;
|
|
2816
|
+
},
|
|
2817
|
+
sx: {
|
|
2818
|
+
textAlign: 'start'
|
|
2855
2819
|
}
|
|
2856
|
-
}
|
|
2820
|
+
}, options.map(function (option) {
|
|
2821
|
+
return React.createElement(MenuItem, {
|
|
2822
|
+
key: option.label,
|
|
2823
|
+
value: option.value
|
|
2824
|
+
}, isMultiple && React.createElement(Checkbox, {
|
|
2825
|
+
checked: value.indexOf(option.value) > -1
|
|
2826
|
+
}), React.createElement(ListItemText, {
|
|
2827
|
+
primary: option.label
|
|
2828
|
+
}));
|
|
2829
|
+
})), isTouched && Boolean(error) ? React.createElement(FormHelperText$1, {
|
|
2830
|
+
error: true
|
|
2831
|
+
}, error) : null));
|
|
2832
|
+
}
|
|
2857
2833
|
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
},
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2834
|
+
var DATE_SIZE = 32;
|
|
2835
|
+
var compactStyles = {
|
|
2836
|
+
'& > div': {
|
|
2837
|
+
minWidth: 256
|
|
2838
|
+
},
|
|
2839
|
+
'& > div > div, & > div > div > div, & .MuiCalendarPicker-root': {
|
|
2840
|
+
width: 256
|
|
2841
|
+
},
|
|
2842
|
+
'& .MuiTypography-caption': {
|
|
2843
|
+
width: DATE_SIZE,
|
|
2844
|
+
margin: 0
|
|
2845
|
+
},
|
|
2846
|
+
'& .PrivatePickersSlideTransition-root': {
|
|
2847
|
+
minHeight: DATE_SIZE * 6
|
|
2848
|
+
},
|
|
2849
|
+
'& .PrivatePickersSlideTransition-root [role="row"]': {
|
|
2850
|
+
margin: 0
|
|
2851
|
+
},
|
|
2852
|
+
'& .MuiPickersDay-dayWithMargin': {
|
|
2853
|
+
margin: 0
|
|
2854
|
+
},
|
|
2855
|
+
'& .MuiPickersDay-root': {
|
|
2856
|
+
width: DATE_SIZE,
|
|
2857
|
+
height: DATE_SIZE
|
|
2858
|
+
},
|
|
2859
|
+
'& .MuiPickersArrowSwitcher-spacer': {
|
|
2860
|
+
width: 0
|
|
2861
|
+
},
|
|
2862
|
+
'& [role="presentation"] .PrivatePickersFadeTransitionGroup-root': {
|
|
2863
|
+
marginRight: -1
|
|
2864
|
+
}
|
|
2865
|
+
};
|
|
2866
|
+
var compactStyleTheme = /*#__PURE__*/createTheme({
|
|
2867
|
+
components: {
|
|
2868
|
+
MuiPaper: {
|
|
2869
|
+
defaultProps: {
|
|
2870
|
+
sx: compactStyles
|
|
2871
|
+
}
|
|
2872
|
+
}
|
|
2873
|
+
}
|
|
2874
|
+
});
|
|
2875
|
+
var DatePickerField = function DatePickerField(_ref) {
|
|
2876
|
+
var label = _ref.label,
|
|
2877
|
+
field = _ref.field,
|
|
2878
|
+
form = _ref.form,
|
|
2879
|
+
theme = _ref.theme,
|
|
2880
|
+
_ref$useCompact = _ref.useCompact,
|
|
2881
|
+
useCompact = _ref$useCompact === void 0 ? true : _ref$useCompact,
|
|
2882
|
+
_ref$dateFormat = _ref.dateFormat,
|
|
2883
|
+
dateFormat = _ref$dateFormat === void 0 ? 'DD/MM/YYYY' : _ref$dateFormat,
|
|
2884
|
+
_ref$placeholder = _ref.placeholder,
|
|
2885
|
+
placeholder = _ref$placeholder === void 0 ? 'dd/mm/yyyy' : _ref$placeholder;
|
|
2886
|
+
return React.createElement(ThemeProvider, {
|
|
2887
|
+
theme: useCompact ? compactStyleTheme : {}
|
|
2888
|
+
}, React.createElement(LocalizationProvider, {
|
|
2889
|
+
dateAdapter: AdapterMoment
|
|
2890
|
+
}, React.createElement(DatePicker, {
|
|
2891
|
+
value: field.value || '',
|
|
2892
|
+
onChange: function onChange(value) {
|
|
2893
|
+
return form.setFieldValue(field.name, value);
|
|
2894
|
+
},
|
|
2895
|
+
PopperProps: {
|
|
2896
|
+
placement: 'bottom-start'
|
|
2897
|
+
},
|
|
2898
|
+
showDaysOutsideCurrentMonth: true,
|
|
2899
|
+
disableFuture: true,
|
|
2900
|
+
inputFormat: dateFormat,
|
|
2901
|
+
mask: "__/__/____",
|
|
2902
|
+
renderInput: function renderInput(params) {
|
|
2903
|
+
return React.createElement(CustomField, Object.assign({}, params, {
|
|
2904
|
+
inputProps: _extends({}, params.inputProps, {
|
|
2905
|
+
placeholder: placeholder
|
|
2906
|
+
}),
|
|
2907
|
+
theme: theme,
|
|
2908
|
+
field: _extends({}, field, {
|
|
2909
|
+
onChange: function onChange(evt) {
|
|
2910
|
+
if (params.inputProps && params.inputProps.onChange) {
|
|
2911
|
+
params.inputProps.onChange(evt);
|
|
2912
|
+
}
|
|
2913
|
+
}
|
|
2914
|
+
}),
|
|
2915
|
+
form: form,
|
|
2916
|
+
label: label,
|
|
2917
|
+
type: "tel"
|
|
2877
2918
|
}));
|
|
2878
2919
|
}
|
|
2879
|
-
})))
|
|
2920
|
+
})));
|
|
2880
2921
|
};
|
|
2881
2922
|
|
|
2882
|
-
var TimerWidget$1 = /*#__PURE__*/memo(TimerWidget);
|
|
2883
|
-
|
|
2884
2923
|
var _excluded$1 = ["firstName", "lastName", "holderAge", "confirmEmail", "confirmPassword"];
|
|
2885
2924
|
var getInitialValues = function getInitialValues(data, propsInitialValues, userValues) {
|
|
2886
2925
|
if (data === void 0) {
|
|
@@ -2900,16 +2939,22 @@ var getInitialValues = function getInitialValues(data, propsInitialValues, userV
|
|
|
2900
2939
|
return _map(fields, function (_ref2) {
|
|
2901
2940
|
var groupItems = _ref2.groupItems;
|
|
2902
2941
|
return _map(groupItems, function (_ref3) {
|
|
2903
|
-
var name = _ref3.name
|
|
2904
|
-
|
|
2942
|
+
var name = _ref3.name,
|
|
2943
|
+
value = _ref3.value;
|
|
2944
|
+
return {
|
|
2945
|
+
name: name,
|
|
2946
|
+
value: value
|
|
2947
|
+
};
|
|
2905
2948
|
});
|
|
2906
2949
|
});
|
|
2907
2950
|
});
|
|
2908
2951
|
|
|
2909
2952
|
var initialValues = {};
|
|
2910
2953
|
|
|
2911
|
-
_forEach(results, function (
|
|
2912
|
-
|
|
2954
|
+
_forEach(results, function (groupItem) {
|
|
2955
|
+
var name = groupItem.name,
|
|
2956
|
+
value = groupItem.value;
|
|
2957
|
+
initialValues[name] = value || propsInitialValues[name] || userValues[name] || '';
|
|
2913
2958
|
}); // set logged in user as first ticket holder
|
|
2914
2959
|
|
|
2915
2960
|
|
|
@@ -3078,7 +3123,9 @@ var assingUniqueIds = function assingUniqueIds(data) {
|
|
|
3078
3123
|
|
|
3079
3124
|
return _map(data, function (item) {
|
|
3080
3125
|
_forEach(item, function (itemValue, key) {
|
|
3081
|
-
if (_isArray(itemValue)) {
|
|
3126
|
+
if (_isArray(itemValue) && !itemValue.some(function (item) {
|
|
3127
|
+
return typeof item === 'string';
|
|
3128
|
+
})) {
|
|
3082
3129
|
item[key] = assingUniqueIds(itemValue);
|
|
3083
3130
|
}
|
|
3084
3131
|
});
|
|
@@ -3088,6 +3135,42 @@ var assingUniqueIds = function assingUniqueIds(data) {
|
|
|
3088
3135
|
});
|
|
3089
3136
|
});
|
|
3090
3137
|
};
|
|
3138
|
+
var isRequiredField = function isRequiredField(element) {
|
|
3139
|
+
var flagRequirePhone = getQueryVariable('phone_required') === 'true';
|
|
3140
|
+
var collectMandatoryWalletAddress = getQueryVariable('collect_mandatory_wallet_address') === 'true';
|
|
3141
|
+
var name = element.name,
|
|
3142
|
+
required = element.required;
|
|
3143
|
+
|
|
3144
|
+
if (required || name === 'phone' && flagRequirePhone || name === 'data_capture[wallet_address]' && !collectMandatoryWalletAddress) {
|
|
3145
|
+
return true;
|
|
3146
|
+
}
|
|
3147
|
+
|
|
3148
|
+
return false;
|
|
3149
|
+
};
|
|
3150
|
+
var getFieldLabel = function getFieldLabel(element) {
|
|
3151
|
+
if (isRequiredField(element) || React.isValidElement(element.label)) {
|
|
3152
|
+
return element.label;
|
|
3153
|
+
}
|
|
3154
|
+
|
|
3155
|
+
return element.label + " (optional)";
|
|
3156
|
+
};
|
|
3157
|
+
var getFieldComponent = function getFieldComponent(element) {
|
|
3158
|
+
var type = _get(element, 'type', 'text');
|
|
3159
|
+
|
|
3160
|
+
var fieldComponentConfigs = {
|
|
3161
|
+
checkbox: CheckboxField,
|
|
3162
|
+
select: NativeSelectField,
|
|
3163
|
+
select_multi: SelectField,
|
|
3164
|
+
phone: PhoneNumberField,
|
|
3165
|
+
date: DatePickerField,
|
|
3166
|
+
radio: RadioGroupField,
|
|
3167
|
+
text: CustomField
|
|
3168
|
+
};
|
|
3169
|
+
|
|
3170
|
+
var fieldComponent = _get(fieldComponentConfigs, type, CustomField);
|
|
3171
|
+
|
|
3172
|
+
return fieldComponent;
|
|
3173
|
+
};
|
|
3091
3174
|
|
|
3092
3175
|
var LogicRunner = function LogicRunner(_ref) {
|
|
3093
3176
|
var values = _ref.values,
|
|
@@ -3688,7 +3771,7 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
3688
3771
|
zIndex: 1205
|
|
3689
3772
|
},
|
|
3690
3773
|
open: true
|
|
3691
|
-
}, React.createElement(CircularProgress
|
|
3774
|
+
}, React.createElement(CircularProgress, {
|
|
3692
3775
|
color: "inherit"
|
|
3693
3776
|
})), !!expirationTime && enableTimer && React.createElement(TimerWidget$1, {
|
|
3694
3777
|
expires_at: expirationTime,
|
|
@@ -3983,29 +4066,24 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
3983
4066
|
key: element.uniqueId
|
|
3984
4067
|
}, React.createElement("div", {
|
|
3985
4068
|
className: element.className + " " + ((props == null ? void 0 : props.errors[element.name]) || '')
|
|
3986
|
-
}, element.component ? element.component : React.createElement(Field, {
|
|
4069
|
+
}, element.component ? element.component : React.createElement(Field, Object.assign({}, element, {
|
|
4070
|
+
type: element.type === 'radio' ? undefined : element.type,
|
|
3987
4071
|
setPhoneValidationIsLoading: element.type === 'phone' ? setPhoneValidationIsLoading : undefined,
|
|
3988
|
-
|
|
3989
|
-
label: element.name === 'phone' ? "" + element.label + (flagRequirePhone ? '' : ' (optional)') + " " : element.name === 'data_capture[wallet_address]' ? "" + element.label + (!collectMandatoryWalletAddress ? ' (optional)' : '') + " " : element.label,
|
|
3990
|
-
type: element.type,
|
|
3991
|
-
fill: element.fill,
|
|
4072
|
+
label: getFieldLabel(element),
|
|
3992
4073
|
validate: getValidateFunctions(element, states, props.values, props.errors),
|
|
3993
4074
|
setFieldValue: props.setFieldValue,
|
|
3994
4075
|
onBlur: props.handleBlur,
|
|
3995
|
-
component: element
|
|
4076
|
+
component: getFieldComponent(element),
|
|
3996
4077
|
selectOptions: element.name === 'country' ? _map(countries, function (item) {
|
|
3997
4078
|
return {
|
|
3998
4079
|
value: item.id,
|
|
3999
4080
|
label: item.name
|
|
4000
4081
|
};
|
|
4001
|
-
}) : element.name === 'state' ? states : [],
|
|
4002
|
-
radios: element.radios,
|
|
4082
|
+
}) : element.name === 'state' ? states : element.selectOptions || [],
|
|
4003
4083
|
theme: theme,
|
|
4004
|
-
disableDropdown: element.disableDropdown,
|
|
4005
4084
|
defaultCountry: defaultCountry || element.defaultCountry,
|
|
4006
|
-
dateFormat: element.format
|
|
4007
|
-
|
|
4008
|
-
})));
|
|
4085
|
+
dateFormat: element.format
|
|
4086
|
+
}))));
|
|
4009
4087
|
})));
|
|
4010
4088
|
}));
|
|
4011
4089
|
}), !_isEmpty(ticketHoldersFields.fields) && React.createElement("div", {
|
|
@@ -4028,20 +4106,19 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
4028
4106
|
return React.createElement("div", {
|
|
4029
4107
|
className: element.className,
|
|
4030
4108
|
key: element.name
|
|
4031
|
-
}, React.createElement(Field, {
|
|
4109
|
+
}, React.createElement(Field, Object.assign({}, element, {
|
|
4110
|
+
type: element.type === 'radio' ? undefined : element.type,
|
|
4032
4111
|
name: element.name + "-" + index,
|
|
4033
|
-
label:
|
|
4034
|
-
|
|
4035
|
-
component: element.type === 'checkbox' ? CheckboxField : element.type === 'phone' ? PhoneNumberField : CustomField,
|
|
4112
|
+
label: getFieldLabel(element),
|
|
4113
|
+
component: getFieldComponent(element),
|
|
4036
4114
|
validate: combineValidators(element.required ? requiredValidator : function () {
|
|
4037
4115
|
return props.errors[element.name + "-" + index];
|
|
4038
4116
|
}, element.onValidate ? element.onValidate : function () {
|
|
4039
4117
|
return props.errors[element.name + "-" + index];
|
|
4040
4118
|
}),
|
|
4041
|
-
disableDropdown: element.disableDropdown,
|
|
4042
4119
|
setPhoneValidationIsLoading: setPhoneValidationIsLoading,
|
|
4043
4120
|
defaultCountry: defaultCountry || element.defaultCountry
|
|
4044
|
-
}));
|
|
4121
|
+
})));
|
|
4045
4122
|
})));
|
|
4046
4123
|
}));
|
|
4047
4124
|
})), React.createElement("div", {
|
|
@@ -4051,7 +4128,7 @@ var BillingInfoContainer = /*#__PURE__*/React.memo(function (_ref4) {
|
|
|
4051
4128
|
variant: "contained",
|
|
4052
4129
|
className: "login-register-button",
|
|
4053
4130
|
disabled: props.isSubmitting || phoneValidationIsLoading
|
|
4054
|
-
}, props.isSubmitting ? React.createElement(CircularProgress
|
|
4131
|
+
}, props.isSubmitting ? React.createElement(CircularProgress, {
|
|
4055
4132
|
size: 26
|
|
4056
4133
|
}) : buttonName))));
|
|
4057
4134
|
}), showModalLogin && React.createElement(LoginModal, {
|
|
@@ -4444,7 +4521,7 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
4444
4521
|
}, React.createElement("button", {
|
|
4445
4522
|
disabled: buttonIsDiabled,
|
|
4446
4523
|
type: "submit"
|
|
4447
|
-
}, isLoading ? React.createElement(CircularProgress, {
|
|
4524
|
+
}, isLoading ? React.createElement(CircularProgress$1, {
|
|
4448
4525
|
size: 26
|
|
4449
4526
|
}) : (paymentButtonText ? paymentButtonText : 'Pay') + " " + getCurrencySymbolByCurrency(currency) + total))));
|
|
4450
4527
|
};
|
|
@@ -4824,7 +4901,7 @@ var PaymentContainer = function PaymentContainer(_ref) {
|
|
|
4824
4901
|
setPaymentIsLoading(true);
|
|
4825
4902
|
handlePaymentMiddleWare(null);
|
|
4826
4903
|
}
|
|
4827
|
-
}, paymentIsLoading ? React.createElement(CircularProgress, {
|
|
4904
|
+
}, paymentIsLoading ? React.createElement(CircularProgress$1, {
|
|
4828
4905
|
size: 26
|
|
4829
4906
|
}) : 'Complete Registration')))));
|
|
4830
4907
|
};
|
|
@@ -5303,7 +5380,7 @@ var ConfirmModal = function ConfirmModal(_ref) {
|
|
|
5303
5380
|
disabled: loading
|
|
5304
5381
|
}, "Cancel"), React.createElement(Button, {
|
|
5305
5382
|
onClick: onConfirm
|
|
5306
|
-
}, loading ? React.createElement(CircularProgress, {
|
|
5383
|
+
}, loading ? React.createElement(CircularProgress$1, {
|
|
5307
5384
|
size: "22px"
|
|
5308
5385
|
}) : 'OK'))));
|
|
5309
5386
|
};
|
|
@@ -5557,7 +5634,7 @@ var WaitingList = function WaitingList(_ref) {
|
|
|
5557
5634
|
type: "submit",
|
|
5558
5635
|
variant: "contained",
|
|
5559
5636
|
className: "waiting-list-button"
|
|
5560
|
-
}, loading ? React.createElement(CircularProgress, {
|
|
5637
|
+
}, loading ? React.createElement(CircularProgress$1, {
|
|
5561
5638
|
size: "22px"
|
|
5562
5639
|
}) : 'ADD TO WAITING LIST')))));
|
|
5563
5640
|
};
|
|
@@ -5603,7 +5680,8 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
5603
5680
|
updateTickets = _ref.updateTickets,
|
|
5604
5681
|
setCodeIsApplied = _ref.setCodeIsApplied,
|
|
5605
5682
|
codeIsInvalid = _ref.codeIsInvalid,
|
|
5606
|
-
setCodeIsInvalid = _ref.setCodeIsInvalid
|
|
5683
|
+
setCodeIsInvalid = _ref.setCodeIsInvalid,
|
|
5684
|
+
promoText = _ref.promoText;
|
|
5607
5685
|
var isPromoCodeHasValue = !!code.trim();
|
|
5608
5686
|
|
|
5609
5687
|
var renderInputField = function renderInputField() {
|
|
@@ -5659,7 +5737,7 @@ var PromoCodeSection = function PromoCodeSection(_ref) {
|
|
|
5659
5737
|
setShowPromoInput(true);
|
|
5660
5738
|
setCodeIsInvalid(false);
|
|
5661
5739
|
}
|
|
5662
|
-
},
|
|
5740
|
+
}, promoText != null ? promoText : 'Got a promo code? Click here'), showPromoInput && renderInputField());
|
|
5663
5741
|
};
|
|
5664
5742
|
|
|
5665
5743
|
var ReferralLogic = function ReferralLogic(props) {
|
|
@@ -5913,7 +5991,8 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
5913
5991
|
handleNotInvitedModalClose = _ref$handleNotInvited === void 0 ? _identity : _ref$handleNotInvited,
|
|
5914
5992
|
_ref$handleInvalidLin = _ref.handleInvalidLinkModalClose,
|
|
5915
5993
|
handleInvalidLinkModalClose = _ref$handleInvalidLin === void 0 ? _identity : _ref$handleInvalidLin,
|
|
5916
|
-
ordersPath = _ref.ordersPath
|
|
5994
|
+
ordersPath = _ref.ordersPath,
|
|
5995
|
+
promoText = _ref.promoText;
|
|
5917
5996
|
|
|
5918
5997
|
var _useState = useState({}),
|
|
5919
5998
|
selectedTickets = _useState[0],
|
|
@@ -6455,6 +6534,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
6455
6534
|
setIsInvalidLinkError('');
|
|
6456
6535
|
};
|
|
6457
6536
|
|
|
6537
|
+
var hideTopInfluencers = event == null ? void 0 : event.hideTopInfluencers;
|
|
6458
6538
|
return React.createElement(ThemeProvider$1, {
|
|
6459
6539
|
theme: themeMui
|
|
6460
6540
|
}, !isLoading && React.createElement(ReferralLogic, {
|
|
@@ -6525,7 +6605,8 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
6525
6605
|
setCode: setCode,
|
|
6526
6606
|
updateTickets: updateTickets,
|
|
6527
6607
|
codeIsInvalid: codeIsInvalid,
|
|
6528
|
-
setCodeIsInvalid: setCodeIsInvalid
|
|
6608
|
+
setCodeIsInvalid: setCodeIsInvalid,
|
|
6609
|
+
promoText: promoText
|
|
6529
6610
|
}) : null, wrappedActionsSectionComponent, canShowGetTicketBtn() && React.createElement(Button$1, {
|
|
6530
6611
|
"aria-hidden": true,
|
|
6531
6612
|
className: "book-button \n " + (bookButtonIsDisabled ? 'disabled' : '') + " \n " + (isButtonScrollable ? 'is-scrollable' : '') + "\n " + (!isLoggedIn ? 'on-bottom' : '') + "\n ",
|
|
@@ -6547,7 +6628,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
6547
6628
|
}, "Log out"))) : ''), showLoginModal ? React.createElement(LoginModal, {
|
|
6548
6629
|
onClose: handleOnClose,
|
|
6549
6630
|
onLogin: handleOnLogin
|
|
6550
|
-
}) : null), enableInfluencersSection && influencers.length ? React.createElement("div", {
|
|
6631
|
+
}) : null), enableInfluencersSection && !hideTopInfluencers && influencers.length ? React.createElement("div", {
|
|
6551
6632
|
className: "event-influencers"
|
|
6552
6633
|
}, React.createElement("h3", null, React.createElement("span", null, "TOP"), " INFLUENCERS"), React.createElement("ol", {
|
|
6553
6634
|
className: "influencer-list"
|
|
@@ -6774,7 +6855,7 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
6774
6855
|
}
|
|
6775
6856
|
}), loading ? React.createElement("div", {
|
|
6776
6857
|
className: "loading"
|
|
6777
|
-
}, React.createElement(CircularProgress, null)) : React.createElement(React.Fragment, null, React.createElement(TableContainer, {
|
|
6858
|
+
}, React.createElement(CircularProgress$1, null)) : React.createElement(React.Fragment, null, React.createElement(TableContainer, {
|
|
6778
6859
|
component: Paper,
|
|
6779
6860
|
className: "my-ticket-table"
|
|
6780
6861
|
}, React.createElement(Table, {
|
|
@@ -6978,7 +7059,7 @@ var TicketResaleModal = function TicketResaleModal(_ref) {
|
|
|
6978
7059
|
}, React.createElement(Button, {
|
|
6979
7060
|
type: "submit",
|
|
6980
7061
|
disabled: !(isValid && dirty)
|
|
6981
|
-
}, loading ? React.createElement(CircularProgress, {
|
|
7062
|
+
}, loading ? React.createElement(CircularProgress$1, {
|
|
6982
7063
|
size: "22px"
|
|
6983
7064
|
}) : 'Sell Ticket')));
|
|
6984
7065
|
}))));
|
|
@@ -7087,7 +7168,7 @@ var TicketsTable = function TicketsTable(_ref) {
|
|
|
7087
7168
|
|
|
7088
7169
|
return onClick;
|
|
7089
7170
|
}()
|
|
7090
|
-
}, ticketIsDownloading ? React.createElement(CircularProgress, {
|
|
7171
|
+
}, ticketIsDownloading ? React.createElement(CircularProgress$1, {
|
|
7091
7172
|
size: "22px"
|
|
7092
7173
|
}) : 'Download'));
|
|
7093
7174
|
}
|
|
@@ -7429,7 +7510,7 @@ var OrderDetailsContainer = function OrderDetailsContainer(_ref) {
|
|
|
7429
7510
|
className: "order-details"
|
|
7430
7511
|
}, loading ? React.createElement("div", {
|
|
7431
7512
|
className: "loading"
|
|
7432
|
-
}, React.createElement(CircularProgress, null)) : React.createElement(React.Fragment, null, React.createElement("h1", {
|
|
7513
|
+
}, React.createElement(CircularProgress$1, null)) : React.createElement(React.Fragment, null, React.createElement("h1", {
|
|
7433
7514
|
className: "layout-title"
|
|
7434
7515
|
}, "Order Details"), React.createElement("div", {
|
|
7435
7516
|
className: "order-summary-box"
|
|
@@ -7640,7 +7721,7 @@ var ResetPasswordContainer = function ResetPasswordContainer(_ref) {
|
|
|
7640
7721
|
}, React.createElement("button", {
|
|
7641
7722
|
type: "submit",
|
|
7642
7723
|
disabled: !(isValid && dirty)
|
|
7643
|
-
}, loading ? React.createElement(CircularProgress
|
|
7724
|
+
}, loading ? React.createElement(CircularProgress, {
|
|
7644
7725
|
size: "22px"
|
|
7645
7726
|
}) : 'Submit')));
|
|
7646
7727
|
}));
|
|
@@ -8354,7 +8435,7 @@ var AddonsContainter = function AddonsContainter(_ref) {
|
|
|
8354
8435
|
if (loading) {
|
|
8355
8436
|
return React.createElement("div", {
|
|
8356
8437
|
className: classNamePrefix + "_loader"
|
|
8357
|
-
}, React.createElement(CircularProgress
|
|
8438
|
+
}, React.createElement(CircularProgress, {
|
|
8358
8439
|
size: 50
|
|
8359
8440
|
}));
|
|
8360
8441
|
}
|