tf-checkout-react 1.0.99 → 1.0.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/billing-info-container/index.d.ts +3 -1
- package/dist/components/billing-info-container/utils.d.ts +1 -0
- package/dist/components/common/SnackbarAlert.d.ts +13 -0
- package/dist/components/confirmationContainer/index.d.ts +2 -1
- package/dist/components/ticketsContainer/index.d.ts +2 -1
- package/dist/env.d.ts +1 -0
- package/dist/tf-checkout-react.cjs.development.js +259 -118
- 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 +260 -119
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/tf-checkout-styles.css +1 -1
- package/package.json +1 -1
- package/src/components/billing-info-container/index.tsx +33 -11
- package/src/components/billing-info-container/utils.ts +2 -1
- package/src/components/common/SnackbarAlert.tsx +54 -0
- package/src/components/confirmationContainer/index.tsx +5 -2
- package/src/components/myTicketsContainer/index.tsx +60 -1
- package/src/components/ticketsContainer/index.tsx +39 -18
- package/src/env.ts +1 -0
|
@@ -42,5 +42,7 @@ export interface IBillingInfoPage {
|
|
|
42
42
|
onSkipBillingPage: (data: any) => void;
|
|
43
43
|
skipPage?: boolean;
|
|
44
44
|
canSkipHolderNames?: boolean;
|
|
45
|
+
onCountdownFinish?: () => void;
|
|
46
|
+
enableTimer?: boolean;
|
|
45
47
|
}
|
|
46
|
-
export declare const BillingInfoContainer: ({ data, ticketHoldersFields, initialValues, buttonName, handleSubmit, theme, onRegisterSuccess, onRegisterError, onSubmitError, onGetCartSuccess, onGetCartError, onGetCountriesSuccess, onGetCountriesError, onGetStatesSuccess, onGetStatesError, onGetProfileDataSuccess, onGetProfileDataError, onAuthorizeSuccess, onAuthorizeError, onLogin, onLoginSuccess, isLoggedIn: pIsLoggedIn, accountInfoTitle, hideLogo, themeOptions, onErrorClose, hideErrorsAlertSection, onSkipBillingPage, skipPage, canSkipHolderNames }: IBillingInfoPage) => JSX.Element;
|
|
48
|
+
export declare const BillingInfoContainer: ({ data, ticketHoldersFields, initialValues, buttonName, handleSubmit, theme, onRegisterSuccess, onRegisterError, onSubmitError, onGetCartSuccess, onGetCartError, onGetCountriesSuccess, onGetCountriesError, onGetStatesSuccess, onGetStatesError, onGetProfileDataSuccess, onGetProfileDataError, onAuthorizeSuccess, onAuthorizeError, onLogin, onLoginSuccess, isLoggedIn: pIsLoggedIn, accountInfoTitle, hideLogo, themeOptions, onErrorClose, hideErrorsAlertSection, onSkipBillingPage, skipPage, canSkipHolderNames, onCountdownFinish, enableTimer }: IBillingInfoPage) => JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AlertColor, SnackbarOrigin } from '@mui/material';
|
|
3
|
+
interface ISnackbarAlertProps {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
message: string;
|
|
6
|
+
type: AlertColor;
|
|
7
|
+
position?: SnackbarOrigin;
|
|
8
|
+
autoHideDuration?: number;
|
|
9
|
+
variant?: 'filled' | 'standard' | 'outlined';
|
|
10
|
+
onClose: () => void;
|
|
11
|
+
}
|
|
12
|
+
declare const SnackbarAlert: ({ isOpen, message, type, position, autoHideDuration, variant, onClose, }: ISnackbarAlertProps) => JSX.Element;
|
|
13
|
+
export default SnackbarAlert;
|
|
@@ -14,6 +14,7 @@ export interface IConfirmationPage {
|
|
|
14
14
|
shareButtons: IShareButton[];
|
|
15
15
|
onGetConfirmationDataSuccess: (res: any) => void;
|
|
16
16
|
onGetConfirmationDataError: (e: AxiosError) => void;
|
|
17
|
+
onLinkCopied: () => void;
|
|
17
18
|
orderHash?: string;
|
|
18
19
|
}
|
|
19
|
-
export declare const ConfirmationContainer: ({ isReferralEnabled, showDefaultShareButtons, messengerAppId, shareButtons, onGetConfirmationDataSuccess, onGetConfirmationDataError, orderHash, }: IConfirmationPage) => JSX.Element;
|
|
20
|
+
export declare const ConfirmationContainer: ({ isReferralEnabled, showDefaultShareButtons, messengerAppId, shareButtons, onGetConfirmationDataSuccess, onGetConfirmationDataError, orderHash, onLinkCopied }: IConfirmationPage) => JSX.Element;
|
|
@@ -30,6 +30,7 @@ export interface IGetTickets {
|
|
|
30
30
|
isAccessCodeEnabled?: boolean;
|
|
31
31
|
hideSessionButtons?: boolean;
|
|
32
32
|
hideWaitingList?: boolean;
|
|
33
|
+
isButtonScrollable?: boolean;
|
|
33
34
|
}
|
|
34
35
|
export interface ITicket {
|
|
35
36
|
id: string | number;
|
|
@@ -38,5 +39,5 @@ export interface ITicket {
|
|
|
38
39
|
export interface ISelectedTickets {
|
|
39
40
|
[key: string]: string | number;
|
|
40
41
|
}
|
|
41
|
-
export declare const TicketsContainer: ({ onLoginSuccess, getTicketsLabel, eventId, onAddToCartSuccess, contentStyle, onAddToCartError, onGetTicketsSuccess, onGetTicketsError, theme, queryPromoCode, isPromotionsEnabled, themeOptions, isAccessCodeEnabled, hideSessionButtons, hideWaitingList }: IGetTickets) => JSX.Element;
|
|
42
|
+
export declare const TicketsContainer: ({ onLoginSuccess, getTicketsLabel, eventId, onAddToCartSuccess, contentStyle, onAddToCartError, onGetTicketsSuccess, onGetTicketsError, theme, queryPromoCode, isPromotionsEnabled, themeOptions, isAccessCodeEnabled, hideSessionButtons, hideWaitingList, isButtonScrollable }: IGetTickets) => JSX.Element;
|
|
42
43
|
export {};
|
package/dist/env.d.ts
CHANGED
|
@@ -32,12 +32,12 @@ var CircularProgress = _interopDefault(require('@mui/material/CircularProgress')
|
|
|
32
32
|
var Select = _interopDefault(require('@mui/material/Select'));
|
|
33
33
|
var styles$1 = require('@mui/material/styles');
|
|
34
34
|
var Backdrop = _interopDefault(require('@mui/material/Backdrop'));
|
|
35
|
+
var Countdown$1 = _interopDefault(require('react-countdown'));
|
|
36
|
+
var _isNumber = _interopDefault(require('lodash/isNumber'));
|
|
35
37
|
var Container = _interopDefault(require('@mui/material/Container'));
|
|
36
38
|
var Alert = _interopDefault(require('@mui/material/Alert'));
|
|
37
39
|
var reactStripeJs = require('@stripe/react-stripe-js');
|
|
38
40
|
var stripeJs = require('@stripe/stripe-js');
|
|
39
|
-
var Countdown$1 = _interopDefault(require('react-countdown'));
|
|
40
|
-
var _isNumber = _interopDefault(require('lodash/isNumber'));
|
|
41
41
|
var reactShare = require('react-share');
|
|
42
42
|
var _some = _interopDefault(require('lodash/some'));
|
|
43
43
|
var _every = _interopDefault(require('lodash/every'));
|
|
@@ -1810,7 +1810,7 @@ var setLoggedUserData = function setLoggedUserData(data) {
|
|
|
1810
1810
|
email: data.email,
|
|
1811
1811
|
confirmEmail: data.email,
|
|
1812
1812
|
city: (data == null ? void 0 : data.city) || '',
|
|
1813
|
-
country: (data == null ? void 0 : data.country) || '',
|
|
1813
|
+
country: (data == null ? void 0 : data.countryId) || (data == null ? void 0 : data.country) || '',
|
|
1814
1814
|
phone: (data == null ? void 0 : data.phone) || '',
|
|
1815
1815
|
street_address: (data == null ? void 0 : data.streetAddress) || '',
|
|
1816
1816
|
state: (data == null ? void 0 : data.stateId) || '',
|
|
@@ -2167,6 +2167,99 @@ var SelectField = function SelectField(_ref) {
|
|
|
2167
2167
|
}, error) : null);
|
|
2168
2168
|
};
|
|
2169
2169
|
|
|
2170
|
+
var showZero = function showZero(value) {
|
|
2171
|
+
if (value === void 0) {
|
|
2172
|
+
value = 0;
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
var intNumber = Number(value);
|
|
2176
|
+
return _isNumber(intNumber) ? intNumber >= 0 && intNumber < 10 ? '0' + intNumber : intNumber : null;
|
|
2177
|
+
};
|
|
2178
|
+
|
|
2179
|
+
var TimerWidget = function TimerWidget(_ref) {
|
|
2180
|
+
var expires_at = _ref.expires_at,
|
|
2181
|
+
buyLoading = _ref.buyLoading,
|
|
2182
|
+
_ref$onCountdownFinis = _ref.onCountdownFinish,
|
|
2183
|
+
onCountdownFinish = _ref$onCountdownFinis === void 0 ? function () {} : _ref$onCountdownFinis;
|
|
2184
|
+
|
|
2185
|
+
var _useState = React.useState(true),
|
|
2186
|
+
showTimer = _useState[0],
|
|
2187
|
+
setShowTimer = _useState[1];
|
|
2188
|
+
|
|
2189
|
+
var handleCountdownFinish = function handleCountdownFinish() {
|
|
2190
|
+
setShowTimer(false);
|
|
2191
|
+
|
|
2192
|
+
if (!buyLoading) {
|
|
2193
|
+
onCountdownFinish();
|
|
2194
|
+
}
|
|
2195
|
+
};
|
|
2196
|
+
|
|
2197
|
+
var _renderer = function renderer(_ref2) {
|
|
2198
|
+
var minutes = _ref2.minutes,
|
|
2199
|
+
seconds = _ref2.seconds,
|
|
2200
|
+
completed = _ref2.completed,
|
|
2201
|
+
handleCountdownFinish = _ref2.handleCountdownFinish;
|
|
2202
|
+
|
|
2203
|
+
if (completed) {
|
|
2204
|
+
handleCountdownFinish();
|
|
2205
|
+
return null;
|
|
2206
|
+
}
|
|
2207
|
+
|
|
2208
|
+
return React__default.createElement("span", null, showZero(minutes), ":", showZero(seconds));
|
|
2209
|
+
};
|
|
2210
|
+
|
|
2211
|
+
return showTimer && !!expires_at ? React__default.createElement("div", {
|
|
2212
|
+
className: "timer"
|
|
2213
|
+
}, React__default.createElement("div", {
|
|
2214
|
+
className: "toast-message"
|
|
2215
|
+
}, React__default.createElement("p", null, "Please complete your purchase before the timer reaches zero."), React__default.createElement("p", {
|
|
2216
|
+
className: "countdown"
|
|
2217
|
+
}, React__default.createElement(Countdown$1, {
|
|
2218
|
+
date: Date.now() + expires_at * 1000,
|
|
2219
|
+
renderer: function renderer(props) {
|
|
2220
|
+
return _renderer(_extends({}, props, {
|
|
2221
|
+
handleCountdownFinish: handleCountdownFinish
|
|
2222
|
+
}));
|
|
2223
|
+
}
|
|
2224
|
+
})))) : null;
|
|
2225
|
+
};
|
|
2226
|
+
|
|
2227
|
+
var SnackbarAlert = function SnackbarAlert(_ref) {
|
|
2228
|
+
var isOpen = _ref.isOpen,
|
|
2229
|
+
message = _ref.message,
|
|
2230
|
+
type = _ref.type,
|
|
2231
|
+
position = _ref.position,
|
|
2232
|
+
_ref$autoHideDuration = _ref.autoHideDuration,
|
|
2233
|
+
autoHideDuration = _ref$autoHideDuration === void 0 ? 3000 : _ref$autoHideDuration,
|
|
2234
|
+
variant = _ref.variant,
|
|
2235
|
+
onClose = _ref.onClose;
|
|
2236
|
+
return React__default.createElement("div", {
|
|
2237
|
+
className: "snackbar-alert-container"
|
|
2238
|
+
}, React__default.createElement(material.Snackbar, {
|
|
2239
|
+
autoHideDuration: autoHideDuration,
|
|
2240
|
+
open: isOpen,
|
|
2241
|
+
anchorOrigin: position || {
|
|
2242
|
+
vertical: 'top',
|
|
2243
|
+
horizontal: 'center'
|
|
2244
|
+
},
|
|
2245
|
+
onClose: onClose,
|
|
2246
|
+
classes: {
|
|
2247
|
+
root: 'snackbar-alert-snackbar-root'
|
|
2248
|
+
}
|
|
2249
|
+
}, React__default.createElement(material.Alert, {
|
|
2250
|
+
severity: type,
|
|
2251
|
+
onClose: onClose,
|
|
2252
|
+
variant: variant || 'filled',
|
|
2253
|
+
classes: {
|
|
2254
|
+
icon: 'snackbar-alert-icon',
|
|
2255
|
+
root: 'snackbar-alert-alert-root',
|
|
2256
|
+
action: 'snackbar-alert-action',
|
|
2257
|
+
message: 'snackbar-alert-message',
|
|
2258
|
+
filled: 'snackbar-alert-filled'
|
|
2259
|
+
}
|
|
2260
|
+
}, message)));
|
|
2261
|
+
};
|
|
2262
|
+
|
|
2170
2263
|
var LogicRunner = function LogicRunner(_ref) {
|
|
2171
2264
|
var values = _ref.values,
|
|
2172
2265
|
setStates = _ref.setStates,
|
|
@@ -2329,7 +2422,11 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2329
2422
|
_ref3$skipPage = _ref3.skipPage,
|
|
2330
2423
|
skipPage = _ref3$skipPage === void 0 ? false : _ref3$skipPage,
|
|
2331
2424
|
_ref3$canSkipHolderNa = _ref3.canSkipHolderNames,
|
|
2332
|
-
canSkipHolderNames = _ref3$canSkipHolderNa === void 0 ? false : _ref3$canSkipHolderNa
|
|
2425
|
+
canSkipHolderNames = _ref3$canSkipHolderNa === void 0 ? false : _ref3$canSkipHolderNa,
|
|
2426
|
+
_ref3$onCountdownFini = _ref3.onCountdownFinish,
|
|
2427
|
+
onCountdownFinish = _ref3$onCountdownFini === void 0 ? function () {} : _ref3$onCountdownFini,
|
|
2428
|
+
_ref3$enableTimer = _ref3.enableTimer,
|
|
2429
|
+
enableTimer = _ref3$enableTimer === void 0 ? false : _ref3$enableTimer;
|
|
2333
2430
|
|
|
2334
2431
|
var themeMui = styles$1.createTheme(themeOptions);
|
|
2335
2432
|
var isWindowDefined = typeof window !== 'undefined';
|
|
@@ -2418,6 +2515,8 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2418
2515
|
|
|
2419
2516
|
var hideTtfOptIn = _get(cartInfoData, 'hide_ttf_opt_in', true);
|
|
2420
2517
|
|
|
2518
|
+
var expirationTime = _get(cartInfoData, 'expires_at');
|
|
2519
|
+
|
|
2421
2520
|
var flagRequirePhone = getQueryVariable('phone_required') === 'true'; // Get prevProps
|
|
2422
2521
|
|
|
2423
2522
|
var prevData = React.useRef(data);
|
|
@@ -2692,7 +2791,10 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2692
2791
|
|
|
2693
2792
|
return React__default.createElement(styles$1.ThemeProvider, {
|
|
2694
2793
|
theme: themeMui
|
|
2695
|
-
}, React__default.createElement(
|
|
2794
|
+
}, expirationTime && enableTimer && React__default.createElement(TimerWidget, {
|
|
2795
|
+
expires_at: expirationTime,
|
|
2796
|
+
onCountdownFinish: onCountdownFinish
|
|
2797
|
+
}), React__default.createElement(formik.Formik, {
|
|
2696
2798
|
initialValues: getInitialValues(dataWithUniqueIds, _extends({}, initialValues, {
|
|
2697
2799
|
country: _get(userData, 'country', '') || '1',
|
|
2698
2800
|
state: _get(userData, 'state', '') || '1',
|
|
@@ -2789,6 +2891,10 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2789
2891
|
setShowModalLogin(true);
|
|
2790
2892
|
}
|
|
2791
2893
|
|
|
2894
|
+
if (_includes(_error, 'The cart is expired') && !hideErrorsAlertSection) {
|
|
2895
|
+
setError(_error);
|
|
2896
|
+
}
|
|
2897
|
+
|
|
2792
2898
|
onRegisterError(_context6.t0, values.email);
|
|
2793
2899
|
}
|
|
2794
2900
|
|
|
@@ -2831,11 +2937,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2831
2937
|
}
|
|
2832
2938
|
}
|
|
2833
2939
|
|
|
2834
|
-
if ((_e$response3 = _context6.t1.response) != null && _e$response3.data.message) {
|
|
2835
|
-
if (typeof document !== undefined) {
|
|
2836
|
-
document.body.scrollTop = document.documentElement.scrollTop = 0;
|
|
2837
|
-
}
|
|
2838
|
-
|
|
2940
|
+
if ((_e$response3 = _context6.t1.response) != null && _e$response3.data.message && !hideErrorsAlertSection) {
|
|
2839
2941
|
setError(_get(_context6.t1, 'response.data.message'));
|
|
2840
2942
|
}
|
|
2841
2943
|
|
|
@@ -2869,11 +2971,15 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2869
2971
|
onGetStatesError: onGetStatesError
|
|
2870
2972
|
}), React__default.createElement("div", {
|
|
2871
2973
|
className: "billing-info-container " + theme
|
|
2872
|
-
},
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2974
|
+
}, React__default.createElement(SnackbarAlert, {
|
|
2975
|
+
type: "error",
|
|
2976
|
+
isOpen: !!error,
|
|
2977
|
+
message: error || '',
|
|
2978
|
+
onClose: function onClose() {
|
|
2979
|
+
setError(null);
|
|
2980
|
+
onErrorClose();
|
|
2981
|
+
}
|
|
2982
|
+
}), !isLoggedIn && React__default.createElement("div", {
|
|
2877
2983
|
className: "account-actions-block"
|
|
2878
2984
|
}, React__default.createElement("div", null, accountInfoTitle), React__default.createElement("div", null, "Login & skip ahead:"), React__default.createElement("div", {
|
|
2879
2985
|
className: "login-block"
|
|
@@ -2921,6 +3027,10 @@ var BillingInfoContainer = function BillingInfoContainer(_ref3) {
|
|
|
2921
3027
|
el.required = flagRequirePhone;
|
|
2922
3028
|
}
|
|
2923
3029
|
|
|
3030
|
+
if (el.name === 'street_address') {
|
|
3031
|
+
el.required = true;
|
|
3032
|
+
}
|
|
3033
|
+
|
|
2924
3034
|
return true;
|
|
2925
3035
|
}), function (element) {
|
|
2926
3036
|
return ['password', 'confirmPassword', 'password-info'].includes(element.name) && isLoggedIn ? null : React__default.createElement(React__default.Fragment, {
|
|
@@ -3279,63 +3389,6 @@ var CheckoutForm = function CheckoutForm(_ref) {
|
|
|
3279
3389
|
}) : "Pay " + getCurrencySymbolByCurrency(currency) + total))));
|
|
3280
3390
|
};
|
|
3281
3391
|
|
|
3282
|
-
var showZero = function showZero(value) {
|
|
3283
|
-
if (value === void 0) {
|
|
3284
|
-
value = 0;
|
|
3285
|
-
}
|
|
3286
|
-
|
|
3287
|
-
var intNumber = Number(value);
|
|
3288
|
-
return _isNumber(intNumber) ? intNumber >= 0 && intNumber < 10 ? '0' + intNumber : intNumber : null;
|
|
3289
|
-
};
|
|
3290
|
-
|
|
3291
|
-
var TimerWidget = function TimerWidget(_ref) {
|
|
3292
|
-
var expires_at = _ref.expires_at,
|
|
3293
|
-
buyLoading = _ref.buyLoading,
|
|
3294
|
-
_ref$onCountdownFinis = _ref.onCountdownFinish,
|
|
3295
|
-
onCountdownFinish = _ref$onCountdownFinis === void 0 ? function () {} : _ref$onCountdownFinis;
|
|
3296
|
-
|
|
3297
|
-
var _useState = React.useState(true),
|
|
3298
|
-
showTimer = _useState[0],
|
|
3299
|
-
setShowTimer = _useState[1];
|
|
3300
|
-
|
|
3301
|
-
var handleCountdownFinish = function handleCountdownFinish() {
|
|
3302
|
-
setShowTimer(false);
|
|
3303
|
-
|
|
3304
|
-
if (!buyLoading) {
|
|
3305
|
-
onCountdownFinish();
|
|
3306
|
-
}
|
|
3307
|
-
};
|
|
3308
|
-
|
|
3309
|
-
var _renderer = function renderer(_ref2) {
|
|
3310
|
-
var minutes = _ref2.minutes,
|
|
3311
|
-
seconds = _ref2.seconds,
|
|
3312
|
-
completed = _ref2.completed,
|
|
3313
|
-
handleCountdownFinish = _ref2.handleCountdownFinish;
|
|
3314
|
-
|
|
3315
|
-
if (completed) {
|
|
3316
|
-
handleCountdownFinish();
|
|
3317
|
-
return null;
|
|
3318
|
-
}
|
|
3319
|
-
|
|
3320
|
-
return React__default.createElement("span", null, showZero(minutes), ":", showZero(seconds));
|
|
3321
|
-
};
|
|
3322
|
-
|
|
3323
|
-
return showTimer && !!expires_at ? React__default.createElement("div", {
|
|
3324
|
-
className: "timer"
|
|
3325
|
-
}, React__default.createElement("div", {
|
|
3326
|
-
className: "toast-message"
|
|
3327
|
-
}, React__default.createElement("p", null, "Please complete your purchase before the timer reaches zero."), React__default.createElement("p", {
|
|
3328
|
-
className: "countdown"
|
|
3329
|
-
}, React__default.createElement(Countdown$1, {
|
|
3330
|
-
date: Date.now() + expires_at * 1000,
|
|
3331
|
-
renderer: function renderer(props) {
|
|
3332
|
-
return _renderer(_extends({}, props, {
|
|
3333
|
-
handleCountdownFinish: handleCountdownFinish
|
|
3334
|
-
}));
|
|
3335
|
-
}
|
|
3336
|
-
})))) : null;
|
|
3337
|
-
};
|
|
3338
|
-
|
|
3339
3392
|
var publishableKey = CONFIGS.STRIPE_PUBLISHABLE_KEY || '';
|
|
3340
3393
|
|
|
3341
3394
|
var getStripePromise = function getStripePromise(reviewData) {
|
|
@@ -3837,7 +3890,9 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
3837
3890
|
onGetConfirmationDataSuccess = _ref$onGetConfirmatio === void 0 ? function () {} : _ref$onGetConfirmatio,
|
|
3838
3891
|
_ref$onGetConfirmatio2 = _ref.onGetConfirmationDataError,
|
|
3839
3892
|
onGetConfirmationDataError = _ref$onGetConfirmatio2 === void 0 ? function () {} : _ref$onGetConfirmatio2,
|
|
3840
|
-
orderHash = _ref.orderHash
|
|
3893
|
+
orderHash = _ref.orderHash,
|
|
3894
|
+
_ref$onLinkCopied = _ref.onLinkCopied,
|
|
3895
|
+
onLinkCopied = _ref$onLinkCopied === void 0 ? function () {} : _ref$onLinkCopied;
|
|
3841
3896
|
var inputRef = React.useRef(null);
|
|
3842
3897
|
|
|
3843
3898
|
var _useState = React.useState(null),
|
|
@@ -3975,7 +4030,8 @@ var ConfirmationContainer = function ConfirmationContainer(_ref) {
|
|
|
3975
4030
|
}), React__default.createElement("div", {
|
|
3976
4031
|
className: "share-by-link-copy-icon",
|
|
3977
4032
|
onClick: function onClick() {
|
|
3978
|
-
|
|
4033
|
+
navigator.clipboard.writeText(_get(inputRef, 'current.value'));
|
|
4034
|
+
onLinkCopied();
|
|
3979
4035
|
}
|
|
3980
4036
|
}, React__default.createElement("img", {
|
|
3981
4037
|
src: "https://img.icons8.com/office/50/000000/copy.png",
|
|
@@ -4521,7 +4577,9 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4521
4577
|
_ref$hideSessionButto = _ref.hideSessionButtons,
|
|
4522
4578
|
hideSessionButtons = _ref$hideSessionButto === void 0 ? false : _ref$hideSessionButto,
|
|
4523
4579
|
_ref$hideWaitingList = _ref.hideWaitingList,
|
|
4524
|
-
hideWaitingList = _ref$hideWaitingList === void 0 ? false : _ref$hideWaitingList
|
|
4580
|
+
hideWaitingList = _ref$hideWaitingList === void 0 ? false : _ref$hideWaitingList,
|
|
4581
|
+
_ref$isButtonScrollab = _ref.isButtonScrollable,
|
|
4582
|
+
isButtonScrollable = _ref$isButtonScrollab === void 0 ? false : _ref$isButtonScrollab;
|
|
4525
4583
|
|
|
4526
4584
|
var _useState = React.useState({}),
|
|
4527
4585
|
selectedTickets = _useState[0],
|
|
@@ -4533,50 +4591,51 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4533
4591
|
isLogged = _useState2[0],
|
|
4534
4592
|
setIsLogged = _useState2[1];
|
|
4535
4593
|
|
|
4536
|
-
var
|
|
4537
|
-
showLoginModal =
|
|
4538
|
-
setShowLoginModal =
|
|
4539
|
-
|
|
4540
|
-
var _useState3 = React.useState([]),
|
|
4541
|
-
tickets = _useState3[0],
|
|
4542
|
-
setTickets = _useState3[1];
|
|
4594
|
+
var _useState3 = React.useState(false),
|
|
4595
|
+
showLoginModal = _useState3[0],
|
|
4596
|
+
setShowLoginModal = _useState3[1];
|
|
4543
4597
|
|
|
4544
|
-
var _useState4 = React.useState(
|
|
4545
|
-
|
|
4546
|
-
|
|
4598
|
+
var _useState4 = React.useState([]),
|
|
4599
|
+
tickets = _useState4[0],
|
|
4600
|
+
setTickets = _useState4[1];
|
|
4547
4601
|
|
|
4548
|
-
var _useState5 = React.useState(
|
|
4549
|
-
|
|
4550
|
-
|
|
4602
|
+
var _useState5 = React.useState(null),
|
|
4603
|
+
event = _useState5[0],
|
|
4604
|
+
setEvent = _useState5[1];
|
|
4551
4605
|
|
|
4552
4606
|
var _useState6 = React.useState(false),
|
|
4553
|
-
|
|
4554
|
-
|
|
4607
|
+
showWaitingList = _useState6[0],
|
|
4608
|
+
setShowWaitingList = _useState6[1];
|
|
4555
4609
|
|
|
4556
4610
|
var _useState7 = React.useState(false),
|
|
4557
|
-
|
|
4558
|
-
|
|
4611
|
+
isLoading = _useState7[0],
|
|
4612
|
+
setIsLoading = _useState7[1];
|
|
4559
4613
|
|
|
4560
4614
|
var _useState8 = React.useState(false),
|
|
4561
|
-
|
|
4562
|
-
|
|
4615
|
+
isPromoLoading = _useState8[0],
|
|
4616
|
+
setIsPromoLoading = _useState8[1];
|
|
4563
4617
|
|
|
4564
|
-
var _useState9 = React.useState(
|
|
4565
|
-
|
|
4566
|
-
|
|
4618
|
+
var _useState9 = React.useState(false),
|
|
4619
|
+
handleBookIsLoading = _useState9[0],
|
|
4620
|
+
setHandleBookIsLoading = _useState9[1];
|
|
4567
4621
|
|
|
4568
|
-
var _useState10 = React.useState(
|
|
4569
|
-
|
|
4570
|
-
|
|
4622
|
+
var _useState10 = React.useState(''),
|
|
4623
|
+
promoCode = _useState10[0],
|
|
4624
|
+
setPromoCode = _useState10[1];
|
|
4571
4625
|
|
|
4572
|
-
var _useState11 = React.useState(
|
|
4573
|
-
|
|
4574
|
-
|
|
4626
|
+
var _useState11 = React.useState(getQueryVariable('r') || queryPromoCode),
|
|
4627
|
+
promoCodeUpdated = _useState11[0],
|
|
4628
|
+
setPromoCodeUpdated = _useState11[1];
|
|
4575
4629
|
|
|
4576
4630
|
var _useState12 = React.useState(false),
|
|
4577
|
-
|
|
4578
|
-
|
|
4631
|
+
showPromoInput = _useState12[0],
|
|
4632
|
+
setShowPromoInput = _useState12[1];
|
|
4633
|
+
|
|
4634
|
+
var _useState13 = React.useState(false),
|
|
4635
|
+
promoCodeIsApplied = _useState13[0],
|
|
4636
|
+
setPromoCodeIsApplied = _useState13[1];
|
|
4579
4637
|
|
|
4638
|
+
var ticketsContainerRef = React.useRef(null);
|
|
4580
4639
|
React.useEffect(function () {
|
|
4581
4640
|
if (typeof window !== 'undefined') {
|
|
4582
4641
|
var access_token = window.localStorage.getItem('access_token');
|
|
@@ -4607,6 +4666,19 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4607
4666
|
}
|
|
4608
4667
|
};
|
|
4609
4668
|
|
|
4669
|
+
React.useEffect(function () {
|
|
4670
|
+
try {
|
|
4671
|
+
if (typeof window !== 'undefined') {
|
|
4672
|
+
var userData = window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '{}') : {};
|
|
4673
|
+
|
|
4674
|
+
if (userData.country === '') {
|
|
4675
|
+
handleLogout();
|
|
4676
|
+
window.open("https://www.ticketfairy.com/account/change_information?need_country=true");
|
|
4677
|
+
}
|
|
4678
|
+
}
|
|
4679
|
+
} catch (e) {}
|
|
4680
|
+
}, []);
|
|
4681
|
+
|
|
4610
4682
|
var handleExternalLogin = function handleExternalLogin() {
|
|
4611
4683
|
setIsLogged(true);
|
|
4612
4684
|
};
|
|
@@ -4840,6 +4912,22 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4840
4912
|
isWindowDefined && window.document.removeEventListener('custom-login', handleExternalLogin);
|
|
4841
4913
|
};
|
|
4842
4914
|
}, []);
|
|
4915
|
+
|
|
4916
|
+
var handleGetTicketClick = function handleGetTicketClick() {
|
|
4917
|
+
if (!handleBookIsLoading && !_isEmpty(selectedTickets) && Object.values(selectedTickets)[0] > 0) {
|
|
4918
|
+
handleBook();
|
|
4919
|
+
} else {
|
|
4920
|
+
if (isButtonScrollable && ticketsContainerRef && ticketsContainerRef.current) {
|
|
4921
|
+
ticketsContainerRef.current.scrollIntoView({
|
|
4922
|
+
behavior: 'smooth',
|
|
4923
|
+
block: 'center',
|
|
4924
|
+
inline: 'nearest'
|
|
4925
|
+
});
|
|
4926
|
+
}
|
|
4927
|
+
}
|
|
4928
|
+
};
|
|
4929
|
+
|
|
4930
|
+
var bookButtonIsDisabled = handleBookIsLoading || _isEmpty(selectedTickets) || Object.values(selectedTickets)[0] === 0;
|
|
4843
4931
|
return React__default.createElement(privateTheming.ThemeProvider, {
|
|
4844
4932
|
theme: themeMui
|
|
4845
4933
|
}, React__default.createElement(ReferralLogic, {
|
|
@@ -4847,7 +4935,9 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4847
4935
|
}), React__default.createElement("div", {
|
|
4848
4936
|
className: "get-tickets-page " + theme,
|
|
4849
4937
|
style: contentStyle
|
|
4850
|
-
}, isLoading ? React__default.createElement(Loader, null) : React__default.createElement("div",
|
|
4938
|
+
}, isLoading ? React__default.createElement(Loader, null) : React__default.createElement("div", {
|
|
4939
|
+
ref: ticketsContainerRef
|
|
4940
|
+
}, React__default.createElement(TicketsSection, {
|
|
4851
4941
|
ticketsList: tickets,
|
|
4852
4942
|
selectedTickets: selectedTickets,
|
|
4853
4943
|
handleTicketSelect: handleTicketSelect,
|
|
@@ -4876,8 +4966,8 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
4876
4966
|
isPromoLoading: isPromoLoading
|
|
4877
4967
|
}), (isTicketOnSale || !(event != null && event.salesEnded)) && React__default.createElement(Button$1, {
|
|
4878
4968
|
"aria-hidden": true,
|
|
4879
|
-
className: "book-button " + (
|
|
4880
|
-
onClick:
|
|
4969
|
+
className: "book-button \n " + (bookButtonIsDisabled ? 'disabled' : '') + " \n " + (isButtonScrollable ? 'is-scrollable' : '') + "\n ",
|
|
4970
|
+
onClick: handleGetTicketClick
|
|
4881
4971
|
}, getTicketsLabel || 'GET TICKETS'), isLogged && !hideSessionButtons ? React__default.createElement("div", {
|
|
4882
4972
|
className: "session-wrapper"
|
|
4883
4973
|
}, React__default.createElement("span", {
|
|
@@ -4987,16 +5077,30 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
4987
5077
|
|
|
4988
5078
|
var _useState4 = React.useState(''),
|
|
4989
5079
|
filter = _useState4[0],
|
|
4990
|
-
setFilter = _useState4[1];
|
|
5080
|
+
setFilter = _useState4[1];
|
|
5081
|
+
|
|
5082
|
+
var isWindowDefined = typeof window !== 'undefined';
|
|
5083
|
+
|
|
5084
|
+
var _useState5 = React.useState(isWindowDefined ? !!window.localStorage.getItem('access_token') : false),
|
|
5085
|
+
isLogged = _useState5[0],
|
|
5086
|
+
setIsLogged = _useState5[1];
|
|
5087
|
+
|
|
5088
|
+
var _useState6 = React.useState(false),
|
|
5089
|
+
showModalLogin = _useState6[0],
|
|
5090
|
+
setShowModalLogin = _useState6[1];
|
|
5091
|
+
|
|
5092
|
+
var _useState7 = React.useState(false),
|
|
5093
|
+
userExpired = _useState7[0],
|
|
5094
|
+
setUserExpired = _useState7[1]; //just once
|
|
4991
5095
|
|
|
4992
5096
|
|
|
4993
5097
|
React.useEffect(function () {
|
|
4994
5098
|
fetchData(1, limit, filter);
|
|
4995
|
-
}, []);
|
|
5099
|
+
}, [isLogged]);
|
|
4996
5100
|
|
|
4997
5101
|
var fetchData = /*#__PURE__*/function () {
|
|
4998
5102
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(page, limit, filter) {
|
|
4999
|
-
var response, _data;
|
|
5103
|
+
var response, _data, _error$response;
|
|
5000
5104
|
|
|
5001
5105
|
return runtime_1.wrap(function _callee$(_context) {
|
|
5002
5106
|
while (1) {
|
|
@@ -5013,25 +5117,37 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
5013
5117
|
_data = _get(response, 'data.data.attributes');
|
|
5014
5118
|
_data.page -= 1;
|
|
5015
5119
|
setData(_data);
|
|
5016
|
-
_context.next =
|
|
5120
|
+
_context.next = 15;
|
|
5017
5121
|
break;
|
|
5018
5122
|
|
|
5019
5123
|
case 11:
|
|
5020
5124
|
_context.prev = 11;
|
|
5021
5125
|
_context.t0 = _context["catch"](0);
|
|
5126
|
+
|
|
5127
|
+
if (axios.isAxiosError(_context.t0)) {
|
|
5128
|
+
if (((_error$response = _context.t0.response) == null ? void 0 : _error$response.data.error) === 'invalid_token') {
|
|
5129
|
+
if (isWindowDefined) {
|
|
5130
|
+
window.localStorage.removeItem('user_data');
|
|
5131
|
+
window.localStorage.removeItem('access_token');
|
|
5132
|
+
setUserExpired(true);
|
|
5133
|
+
setShowModalLogin(true);
|
|
5134
|
+
}
|
|
5135
|
+
}
|
|
5136
|
+
}
|
|
5137
|
+
|
|
5022
5138
|
onGetOrdersError(_context.t0);
|
|
5023
5139
|
|
|
5024
|
-
case
|
|
5025
|
-
_context.prev =
|
|
5140
|
+
case 15:
|
|
5141
|
+
_context.prev = 15;
|
|
5026
5142
|
setLoading(false);
|
|
5027
|
-
return _context.finish(
|
|
5143
|
+
return _context.finish(15);
|
|
5028
5144
|
|
|
5029
|
-
case
|
|
5145
|
+
case 18:
|
|
5030
5146
|
case "end":
|
|
5031
5147
|
return _context.stop();
|
|
5032
5148
|
}
|
|
5033
5149
|
}
|
|
5034
|
-
}, _callee, null, [[0, 11,
|
|
5150
|
+
}, _callee, null, [[0, 11, 15, 18]]);
|
|
5035
5151
|
}));
|
|
5036
5152
|
|
|
5037
5153
|
return function fetchData(_x, _x2, _x3) {
|
|
@@ -5057,7 +5173,22 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
5057
5173
|
className: "my-ticket " + theme
|
|
5058
5174
|
}, loading && React__default.createElement("div", {
|
|
5059
5175
|
className: "loading"
|
|
5060
|
-
}, React__default.createElement(CircularProgress, null)),
|
|
5176
|
+
}, React__default.createElement(CircularProgress, null)), !isLogged ? React__default.createElement("div", {
|
|
5177
|
+
className: "account-actions-block"
|
|
5178
|
+
}, React__default.createElement("div", {
|
|
5179
|
+
className: "login-block"
|
|
5180
|
+
}, React__default.createElement("button", {
|
|
5181
|
+
className: "login-register-button",
|
|
5182
|
+
type: "button",
|
|
5183
|
+
onClick: function onClick() {
|
|
5184
|
+
setShowModalLogin(true);
|
|
5185
|
+
}
|
|
5186
|
+
}, "Login"), React__default.createElement("div", {
|
|
5187
|
+
className: "logo-image-container"
|
|
5188
|
+
}, React__default.createElement("img", {
|
|
5189
|
+
src: theme === 'dark' ? 'https://www.ticketfairy.com/resources/images/logo-ttf.svg' : 'https://www.ticketfairy.com/resources/images/logo-ttf-black.svg',
|
|
5190
|
+
alt: "nodata"
|
|
5191
|
+
})))) : null, data && React__default.createElement(React__default.Fragment, null, React__default.createElement(Autocomplete, {
|
|
5061
5192
|
disablePortal: true,
|
|
5062
5193
|
id: "combo-box-demo",
|
|
5063
5194
|
getOptionLabel: function getOptionLabel(option) {
|
|
@@ -5096,6 +5227,16 @@ var MyTicketsContainer = function MyTicketsContainer(_ref) {
|
|
|
5096
5227
|
page: data.page,
|
|
5097
5228
|
onPageChange: handleChangePage,
|
|
5098
5229
|
onRowsPerPageChange: handleChangeRowsPerPage
|
|
5230
|
+
})), React__default.createElement(React__default.Fragment, null, showModalLogin && React__default.createElement(LoginModal, {
|
|
5231
|
+
onClose: function onClose() {
|
|
5232
|
+
setShowModalLogin(false);
|
|
5233
|
+
},
|
|
5234
|
+
onLogin: function onLogin() {
|
|
5235
|
+
setShowModalLogin(false);
|
|
5236
|
+
setUserExpired(false);
|
|
5237
|
+
setIsLogged(true);
|
|
5238
|
+
},
|
|
5239
|
+
userExpired: userExpired
|
|
5099
5240
|
})));
|
|
5100
5241
|
};
|
|
5101
5242
|
|