tf-checkout-react 1.0.45 → 1.0.46
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/api/index.d.ts +1 -0
- package/dist/components/billing-info-container/utils.d.ts +1 -1
- package/dist/components/common/CheckboxField.d.ts +2 -2
- package/dist/components/ticketsContainer/TicketRow.d.ts +10 -0
- package/dist/components/ticketsContainer/TicketsSection.d.ts +10 -0
- package/dist/components/ticketsContainer/index.d.ts +2 -1
- package/dist/components/ticketsContainer/utils.d.ts +4 -0
- package/dist/components/waitingList/index.d.ts +7 -0
- package/dist/tf-checkout-react.cjs.development.css +2 -1
- package/dist/tf-checkout-react.cjs.development.js +273 -62
- 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 +279 -65
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/validators/index.d.ts +2 -1
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/api/index.ts +3 -1
- package/src/components/.DS_Store +0 -0
- package/src/components/billing-info-container/index.tsx +18 -11
- package/src/components/billing-info-container/utils.ts +3 -2
- package/src/components/common/CheckboxField.tsx +3 -2
- package/src/components/common/CustomField.tsx +1 -1
- package/src/components/ticketsContainer/TicketRow.tsx +86 -0
- package/src/components/ticketsContainer/TicketsSection.tsx +82 -0
- package/src/components/ticketsContainer/index.tsx +82 -208
- package/src/components/ticketsContainer/utils.ts +11 -0
- package/src/components/waitingList/index.tsx +162 -0
- package/src/components/waitingList/style.css +18 -0
- package/src/validators/index.ts +9 -3
|
@@ -22,18 +22,17 @@ import { useStripe, useElements, CardNumberElement, CardExpiryElement, CardCvcEl
|
|
|
22
22
|
import { loadStripe } from '@stripe/stripe-js';
|
|
23
23
|
import CircularProgress$1 from '@mui/material/CircularProgress';
|
|
24
24
|
import SVG from 'react-inlinesvg';
|
|
25
|
-
import _sortBy from 'lodash-es/sortBy';
|
|
26
|
-
import _has from 'lodash-es/has';
|
|
27
25
|
import _some from 'lodash-es/some';
|
|
28
26
|
import _find from 'lodash-es/find';
|
|
29
27
|
import _isEmpty from 'lodash-es/isEmpty';
|
|
30
|
-
import
|
|
31
|
-
import
|
|
28
|
+
import Button$1 from 'react-bootstrap/Button';
|
|
29
|
+
import jwt_decode from 'jwt-decode';
|
|
30
|
+
import _sortBy from 'lodash-es/sortBy';
|
|
31
|
+
import _has from 'lodash-es/has';
|
|
32
32
|
import FormControl from '@mui/material/FormControl';
|
|
33
33
|
import MenuItem from '@mui/material/MenuItem';
|
|
34
34
|
import Select from '@mui/material/Select';
|
|
35
|
-
import Button from '
|
|
36
|
-
import jwt_decode from 'jwt-decode';
|
|
35
|
+
import Button from '@mui/material/Button';
|
|
37
36
|
|
|
38
37
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
39
38
|
try {
|
|
@@ -894,6 +893,7 @@ function styleInject(css, ref) {
|
|
|
894
893
|
var css_248z = ".style_button-container__2bhts{display:flex;justify-content:center;padding:20px}.style_billing-info-container__3ZE3J{margin:0 auto;max-width:800px}.style_billing-info-container__3ZE3J .style_is-half__1W_rP{width:49%}.style_billing-info-container__3ZE3J p{color:#000}.style_billing-info-container__3ZE3J .style_main-header__2OFWa{font-size:2rem;font-weight:600}.style_billing-info-container__twoFields__2tDqt{display:flex;justify-content:space-between;margin-top:15px}.style_billing-info-container__singleField__2bcsf{margin-top:15px}button{margin-top:10px}.style_account-actions-block__16OH-{color:#182026;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,Icons16,sans-serif;margin-top:10px}.style_login-register-button__fGgZf,.style_MuiButtonBase-root__1UBk9.style_MuiButton-root__3NzEO,.style_MuiButtonBase-root__1UBk9.style_MuiButton-root__3NzEO:hover{background-color:#212529;border:#f28051;border-radius:5px;color:#fff;cursor:pointer;display:block;font-family:Inter-Bold;font-size:26px;font-weight:700;line-height:1.15;margin-top:10px;min-height:46px;outline:none;overflow:hidden;padding:14px 12px 12px;position:relative;text-align:center;text-overflow:ellipsis;text-transform:uppercase;width:49%}.style_logo-image-container__2A2uH{margin-top:5px;text-align:center;width:49%}.style_logo-image-container__2A2uH img{height:30px}.style_login-block__22kcN{align-items:center;display:flex;flex-direction:column}.style_login-register-button__fGgZf:hover{background-color:#505050!important;border-color:#505050!important}.style_login-register-block__36tu5{display:flex;justify-content:space-between}@media only screen and (max-width:820px){.style_billing-info-container__3ZE3J{width:90%}.style_billing-info-container__3ZE3J .style_main-header__2OFWa{font-size:1.5rem}}";
|
|
895
894
|
styleInject(css_248z);
|
|
896
895
|
|
|
896
|
+
var emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
897
897
|
var combineValidators = function combineValidators() {
|
|
898
898
|
for (var _len = arguments.length, validators = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
899
899
|
validators[_key] = arguments[_key];
|
|
@@ -902,19 +902,22 @@ var combineValidators = function combineValidators() {
|
|
|
902
902
|
return function () {
|
|
903
903
|
for (var i = 0; i < validators.length; ++i) {
|
|
904
904
|
var error_message = validators[i].apply(validators, arguments);
|
|
905
|
-
if (error_message
|
|
905
|
+
if (error_message) return error_message;
|
|
906
906
|
}
|
|
907
907
|
};
|
|
908
908
|
};
|
|
909
|
-
var requiredValidator = function requiredValidator(value) {
|
|
909
|
+
var requiredValidator = function requiredValidator(value, message) {
|
|
910
910
|
var errorMessage = '';
|
|
911
911
|
|
|
912
912
|
if (!value) {
|
|
913
|
-
errorMessage = 'Required';
|
|
913
|
+
errorMessage = message || 'Required';
|
|
914
914
|
}
|
|
915
915
|
|
|
916
916
|
return errorMessage;
|
|
917
917
|
};
|
|
918
|
+
var emailValidator = function emailValidator(email) {
|
|
919
|
+
return !emailRegex.test(email) ? 'Please enter a valid email address' : '';
|
|
920
|
+
};
|
|
918
921
|
|
|
919
922
|
// preview1
|
|
920
923
|
|
|
@@ -1091,6 +1094,9 @@ var getConfirmationData = function getConfirmationData(orderHash) {
|
|
|
1091
1094
|
var getStates = function getStates(countryId) {
|
|
1092
1095
|
return publicRequest.get("/countries/" + countryId + "/states/");
|
|
1093
1096
|
};
|
|
1097
|
+
var addToWaitingList = function addToWaitingList(id, data) {
|
|
1098
|
+
return publicRequest.post("/v1/event/" + id + "/add_to_waiting_list", data);
|
|
1099
|
+
};
|
|
1094
1100
|
|
|
1095
1101
|
var css_248z$1 = ".style_modal-title__2sUq_{align-items:center;background-color:#fff;display:flex;font-family:Inter;font-size:18px;font-weight:700;height:49px;line-height:22px;padding-left:25px;position:relative}.style_login-modal-body__2sFg5{padding:15px 25px}.style_login-modal-body__2sFg5 input{background:#fff!important}.style_login-modal-body__email__2nnEH,.style_login-modal-body__password__qS3g7{margin-bottom:20px}.style_login-action-button__1g9qt button{background-color:#212529;border:none;border-radius:0;color:#fff;cursor:pointer;font-size:26px;font-weight:600;height:45px;line-height:18px;margin:10px 0;outline:none;padding:10px;width:100%}.style_login-action-button__1g9qt button:hover{background-color:#505050;border-color:#505050}.style_server_auth__error__1340S{color:red;font-family:Inter;font-size:12px;font-style:normal;padding-left:25px;padding-top:15px}.style_info-text-for-login__28JQf{font-size:14px;margin-bottom:4px;padding-left:10px}";
|
|
1096
1102
|
styleInject(css_248z$1);
|
|
@@ -1496,7 +1502,7 @@ var RegisterModal = function RegisterModal(_ref) {
|
|
|
1496
1502
|
};
|
|
1497
1503
|
|
|
1498
1504
|
var _excluded = ["firstName", "lastName", "holderAge", "confirmEmail", "confirmPassword"];
|
|
1499
|
-
var getInitialValues = function getInitialValues(data, propsInitialValues) {
|
|
1505
|
+
var getInitialValues = function getInitialValues(data, propsInitialValues, userValues) {
|
|
1500
1506
|
if (data === void 0) {
|
|
1501
1507
|
data = [];
|
|
1502
1508
|
}
|
|
@@ -1505,6 +1511,10 @@ var getInitialValues = function getInitialValues(data, propsInitialValues) {
|
|
|
1505
1511
|
propsInitialValues = {};
|
|
1506
1512
|
}
|
|
1507
1513
|
|
|
1514
|
+
if (userValues === void 0) {
|
|
1515
|
+
userValues = {};
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1508
1518
|
var results = _flatMapDeep(data, function (_ref) {
|
|
1509
1519
|
var fields = _ref.fields;
|
|
1510
1520
|
return _map(fields, function (_ref2) {
|
|
@@ -1519,7 +1529,7 @@ var getInitialValues = function getInitialValues(data, propsInitialValues) {
|
|
|
1519
1529
|
var initialValues = {};
|
|
1520
1530
|
|
|
1521
1531
|
_forEach(results, function (item) {
|
|
1522
|
-
initialValues[item] = propsInitialValues[item] || '';
|
|
1532
|
+
initialValues[item] = propsInitialValues[item] || userValues[item] || '';
|
|
1523
1533
|
});
|
|
1524
1534
|
|
|
1525
1535
|
return initialValues;
|
|
@@ -1672,16 +1682,20 @@ var CustomField = function CustomField(_ref) {
|
|
|
1672
1682
|
}, field), isSelectField ? _map(selectOptions, function (option) {
|
|
1673
1683
|
return React.createElement("option", {
|
|
1674
1684
|
key: option.value,
|
|
1675
|
-
value: option.value
|
|
1685
|
+
value: option.value,
|
|
1686
|
+
disabled: option.disabled
|
|
1676
1687
|
}, option.label);
|
|
1677
1688
|
}) : null);
|
|
1678
1689
|
};
|
|
1679
1690
|
|
|
1691
|
+
var _excluded$1 = ["label", "field"];
|
|
1680
1692
|
var CheckboxField = function CheckboxField(_ref) {
|
|
1681
1693
|
var label = _ref.label,
|
|
1682
|
-
field = _ref.field
|
|
1694
|
+
field = _ref.field,
|
|
1695
|
+
rest = _objectWithoutPropertiesLoose(_ref, _excluded$1);
|
|
1696
|
+
|
|
1683
1697
|
return React.createElement(FormGroup, null, React.createElement(FormControlLabel, {
|
|
1684
|
-
control: React.createElement(Checkbox, Object.assign({}, field)),
|
|
1698
|
+
control: React.createElement(Checkbox, Object.assign({}, field, rest)),
|
|
1685
1699
|
label: label
|
|
1686
1700
|
}));
|
|
1687
1701
|
};
|
|
@@ -2079,7 +2093,7 @@ var BillingInfoContainer = function BillingInfoContainer(_ref4) {
|
|
|
2079
2093
|
lastName: lastNameLogged,
|
|
2080
2094
|
country: 1,
|
|
2081
2095
|
brand_opt_in: optedInFieldValue
|
|
2082
|
-
})),
|
|
2096
|
+
}), userValues),
|
|
2083
2097
|
enableReinitialize: true,
|
|
2084
2098
|
onSubmit: function () {
|
|
2085
2099
|
var _onSubmit = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(values, formikHelpers) {
|
|
@@ -3060,10 +3074,14 @@ var getTicketSelectOptions = function getTicketSelectOptions(maxCount, minCount,
|
|
|
3060
3074
|
return options;
|
|
3061
3075
|
};
|
|
3062
3076
|
|
|
3063
|
-
var
|
|
3064
|
-
var
|
|
3065
|
-
|
|
3066
|
-
|
|
3077
|
+
var TicketRow = function TicketRow(_ref) {
|
|
3078
|
+
var ticketTier = _ref.ticketTier,
|
|
3079
|
+
prevTicketTier = _ref.prevTicketTier,
|
|
3080
|
+
selectedTickets = _ref.selectedTickets,
|
|
3081
|
+
handleTicketSelect = _ref.handleTicketSelect;
|
|
3082
|
+
var soldOutMessage = ticketTier.soldOutMessage ? ("" + ticketTier.soldOutMessage).toUpperCase() : 'SOLD OUT';
|
|
3083
|
+
var isSalesClosed = !ticketTier.salesStarted || ticketTier.salesEnded || !_has(ticketTier, 'maxQuantity') || ticketTier.maxQuantity === 0;
|
|
3084
|
+
var options = getTicketSelectOptions(ticketTier.maxQuantity, ticketTier.minQuantity, ticketTier.multiplier);
|
|
3067
3085
|
var onSaleContent = isSalesClosed ? null : React.createElement("div", {
|
|
3068
3086
|
className: "get-tickets"
|
|
3069
3087
|
}, React.createElement(Box, {
|
|
@@ -3071,7 +3089,7 @@ var computeTierStateLabel = function computeTierStateLabel(tier, prevTier, selec
|
|
|
3071
3089
|
}, React.createElement(FormControl, {
|
|
3072
3090
|
fullWidth: true
|
|
3073
3091
|
}, React.createElement(Select, {
|
|
3074
|
-
value: selectedTickets[
|
|
3092
|
+
value: selectedTickets[ticketTier.id] ? selectedTickets[ticketTier.id] : 0,
|
|
3075
3093
|
onChange: handleTicketSelect,
|
|
3076
3094
|
displayEmpty: true,
|
|
3077
3095
|
inputProps: {
|
|
@@ -3091,51 +3109,237 @@ var computeTierStateLabel = function computeTierStateLabel(tier, prevTier, selec
|
|
|
3091
3109
|
value: option.value
|
|
3092
3110
|
}, option.value);
|
|
3093
3111
|
})))));
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
if (
|
|
3097
|
-
|
|
3098
|
-
|
|
3112
|
+
var returnValue = '';
|
|
3113
|
+
|
|
3114
|
+
if (ticketTier.sold_out || !ticketTier.displayTicket || ticketTier.soldOut) {
|
|
3115
|
+
returnValue = soldOutMessage;
|
|
3116
|
+
}
|
|
3117
|
+
|
|
3118
|
+
if (!+ticketTier.cost && !+ticketTier.price) {
|
|
3119
|
+
returnValue = 'FREE';
|
|
3120
|
+
}
|
|
3121
|
+
|
|
3122
|
+
if (ticketTier.displayTicket) {
|
|
3123
|
+
returnValue = onSaleContent;
|
|
3124
|
+
}
|
|
3125
|
+
|
|
3126
|
+
if (_get(prevTicketTier, 'in_stock')) {
|
|
3127
|
+
returnValue = 'SOON';
|
|
3128
|
+
}
|
|
3129
|
+
|
|
3130
|
+
return React.createElement(React.Fragment, null, returnValue, " ");
|
|
3099
3131
|
};
|
|
3100
3132
|
|
|
3101
|
-
var
|
|
3102
|
-
var
|
|
3133
|
+
var TicketsSection = function TicketsSection(_ref) {
|
|
3134
|
+
var ticketsList = _ref.ticketsList,
|
|
3135
|
+
selectedTickets = _ref.selectedTickets,
|
|
3136
|
+
handleTicketSelect = _ref.handleTicketSelect,
|
|
3137
|
+
promoCodeIsApplied = _ref.promoCodeIsApplied;
|
|
3138
|
+
|
|
3139
|
+
var sortedTicketsList = _sortBy(ticketsList, 'sortOrder');
|
|
3103
3140
|
|
|
3104
|
-
|
|
3105
|
-
var isSoldOut =
|
|
3141
|
+
return React.createElement(React.Fragment, null, sortedTicketsList.map(function (ticket, i, arr) {
|
|
3142
|
+
var isSoldOut = ticket.sold_out || !ticket.displayTicket || ticket.soldOut;
|
|
3106
3143
|
|
|
3107
3144
|
var ticketSelect = function ticketSelect(event) {
|
|
3108
3145
|
var value = event.target.value;
|
|
3109
|
-
handleTicketSelect(
|
|
3146
|
+
handleTicketSelect(ticket.id, value);
|
|
3110
3147
|
};
|
|
3111
3148
|
|
|
3112
3149
|
var ticketIsDiscounted = false;
|
|
3113
3150
|
|
|
3114
|
-
if (
|
|
3151
|
+
if (ticket.oldPrice && promoCodeIsApplied && !isSoldOut && ticket.oldPrice !== ticket.price) {
|
|
3115
3152
|
ticketIsDiscounted = true;
|
|
3116
3153
|
}
|
|
3117
3154
|
|
|
3118
3155
|
return React.createElement("div", {
|
|
3119
|
-
key:
|
|
3156
|
+
key: ticket.id || ticket.name,
|
|
3120
3157
|
className: "event-detail__tier " + (isSoldOut ? 'disabled' : '')
|
|
3121
3158
|
}, React.createElement("div", {
|
|
3122
3159
|
className: "event-detail__tier-name"
|
|
3123
|
-
},
|
|
3160
|
+
}, ticket.displayName || ticket.name), React.createElement("div", {
|
|
3124
3161
|
className: "event-tickets-container"
|
|
3125
3162
|
}, React.createElement("div", {
|
|
3126
3163
|
className: "event-detail__tier-price"
|
|
3127
3164
|
}, ticketIsDiscounted && React.createElement("p", {
|
|
3128
3165
|
className: "old-price"
|
|
3129
|
-
}, "$ ", (+
|
|
3130
|
-
className:
|
|
3131
|
-
},
|
|
3166
|
+
}, "$ ", (+ticket.oldPrice).toFixed(2)), React.createElement("p", null, isSoldOut ? 'SOLD OUT' : "$ " + (+ticket.cost || +ticket.price).toFixed(2)), !isSoldOut && React.createElement("p", {
|
|
3167
|
+
className: "fees"
|
|
3168
|
+
}, ticket.taxesIncluded ? '(incl. Fees)' : '(excl. Fees)')), React.createElement("div", {
|
|
3132
3169
|
className: "event-detail__tier-state",
|
|
3133
3170
|
style: {
|
|
3134
3171
|
minWidth: 55
|
|
3135
3172
|
}
|
|
3136
|
-
},
|
|
3173
|
+
}, React.createElement(TicketRow, {
|
|
3174
|
+
ticketTier: ticket,
|
|
3175
|
+
prevTicketTier: arr[i - 1],
|
|
3176
|
+
selectedTickets: selectedTickets,
|
|
3177
|
+
handleTicketSelect: ticketSelect
|
|
3178
|
+
}))));
|
|
3179
|
+
}));
|
|
3180
|
+
};
|
|
3181
|
+
|
|
3182
|
+
var css_248z$7 = ".style_waiting-list__2sJxM{padding:17px 35px 20px}.style_waiting-list__2sJxM .style_field-item__34MYc{margin-bottom:30px}.style_waiting-list__2sJxM .style_waiting-list-button__tO7D2{width:100%!important}.style_waiting-list__2sJxM .style_waiting-list-button__tO7D2:hover{background-color:#505050}.style_waiting-list__2sJxM .style_success-message__BvF3R h3{margin:10px 0}.style_waiting-list__2sJxM .style_success-message__BvF3R p{margin:0}";
|
|
3183
|
+
styleInject(css_248z$7);
|
|
3184
|
+
|
|
3185
|
+
var generateQuantity = function generateQuantity(n) {
|
|
3186
|
+
var quantityList = [];
|
|
3187
|
+
|
|
3188
|
+
for (var i = 1; i <= n; i++) {
|
|
3189
|
+
quantityList.push({
|
|
3190
|
+
label: i,
|
|
3191
|
+
value: i
|
|
3192
|
+
});
|
|
3193
|
+
}
|
|
3194
|
+
|
|
3195
|
+
return quantityList;
|
|
3196
|
+
};
|
|
3197
|
+
|
|
3198
|
+
var WaitingList = function WaitingList(_ref) {
|
|
3199
|
+
var _ref$tickets = _ref.tickets,
|
|
3200
|
+
tickets = _ref$tickets === void 0 ? {} : _ref$tickets;
|
|
3201
|
+
|
|
3202
|
+
var _useState = useState(false),
|
|
3203
|
+
showSuccessMessage = _useState[0],
|
|
3204
|
+
setShowSuccessMessage = _useState[1];
|
|
3205
|
+
|
|
3206
|
+
var _useState2 = useState(false),
|
|
3207
|
+
loading = _useState2[0],
|
|
3208
|
+
setLoading = _useState2[1];
|
|
3209
|
+
|
|
3210
|
+
var ticketTypesList = Object.values(tickets).map(function (d) {
|
|
3211
|
+
return {
|
|
3212
|
+
label: d.displayName,
|
|
3213
|
+
value: d.id
|
|
3214
|
+
};
|
|
3137
3215
|
});
|
|
3138
|
-
|
|
3216
|
+
|
|
3217
|
+
var handleSubmit = /*#__PURE__*/function () {
|
|
3218
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(values) {
|
|
3219
|
+
var id, requestData, _yield$addToWaitingLi, data;
|
|
3220
|
+
|
|
3221
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
3222
|
+
while (1) {
|
|
3223
|
+
switch (_context.prev = _context.next) {
|
|
3224
|
+
case 0:
|
|
3225
|
+
_context.prev = 0;
|
|
3226
|
+
setLoading(true);
|
|
3227
|
+
id = ENV.EVENT_ID;
|
|
3228
|
+
requestData = {
|
|
3229
|
+
data: {
|
|
3230
|
+
attributes: values
|
|
3231
|
+
}
|
|
3232
|
+
};
|
|
3233
|
+
_context.next = 6;
|
|
3234
|
+
return addToWaitingList(id, requestData);
|
|
3235
|
+
|
|
3236
|
+
case 6:
|
|
3237
|
+
_yield$addToWaitingLi = _context.sent;
|
|
3238
|
+
data = _yield$addToWaitingLi.data;
|
|
3239
|
+
|
|
3240
|
+
if (data.success) {
|
|
3241
|
+
setShowSuccessMessage(true);
|
|
3242
|
+
}
|
|
3243
|
+
|
|
3244
|
+
_context.next = 14;
|
|
3245
|
+
break;
|
|
3246
|
+
|
|
3247
|
+
case 11:
|
|
3248
|
+
_context.prev = 11;
|
|
3249
|
+
_context.t0 = _context["catch"](0);
|
|
3250
|
+
console.log(_context.t0);
|
|
3251
|
+
|
|
3252
|
+
case 14:
|
|
3253
|
+
_context.prev = 14;
|
|
3254
|
+
setLoading(false);
|
|
3255
|
+
return _context.finish(14);
|
|
3256
|
+
|
|
3257
|
+
case 17:
|
|
3258
|
+
case "end":
|
|
3259
|
+
return _context.stop();
|
|
3260
|
+
}
|
|
3261
|
+
}
|
|
3262
|
+
}, _callee, null, [[0, 11, 14, 17]]);
|
|
3263
|
+
}));
|
|
3264
|
+
|
|
3265
|
+
return function handleSubmit(_x) {
|
|
3266
|
+
return _ref2.apply(this, arguments);
|
|
3267
|
+
};
|
|
3268
|
+
}();
|
|
3269
|
+
|
|
3270
|
+
return React.createElement("div", {
|
|
3271
|
+
className: "waiting-list"
|
|
3272
|
+
}, showSuccessMessage ? React.createElement("div", {
|
|
3273
|
+
className: "success-message"
|
|
3274
|
+
}, React.createElement("h3", null, "You've been added to the waiting list!"), React.createElement("p", null, "You'll be notified if tickets become available.")) : React.createElement(React.Fragment, null, React.createElement("h2", null, "WAITING LIST"), React.createElement(Formik, {
|
|
3275
|
+
initialValues: {
|
|
3276
|
+
ticketTypeId: '',
|
|
3277
|
+
quantity: '',
|
|
3278
|
+
firstName: '',
|
|
3279
|
+
lastName: '',
|
|
3280
|
+
email: ''
|
|
3281
|
+
},
|
|
3282
|
+
onSubmit: handleSubmit
|
|
3283
|
+
}, React.createElement(Form, null, React.createElement("div", {
|
|
3284
|
+
className: "field-item"
|
|
3285
|
+
}, React.createElement(Field, {
|
|
3286
|
+
name: "ticketTypeId",
|
|
3287
|
+
label: "Ticket types",
|
|
3288
|
+
type: "select",
|
|
3289
|
+
component: CustomField,
|
|
3290
|
+
selectOptions: [{
|
|
3291
|
+
label: 'Type of Ticket',
|
|
3292
|
+
value: '',
|
|
3293
|
+
disabled: true
|
|
3294
|
+
}].concat(ticketTypesList)
|
|
3295
|
+
})), React.createElement("div", {
|
|
3296
|
+
className: "field-item"
|
|
3297
|
+
}, React.createElement(Field, {
|
|
3298
|
+
name: "quantity",
|
|
3299
|
+
label: "Quantity",
|
|
3300
|
+
type: "select",
|
|
3301
|
+
component: CustomField,
|
|
3302
|
+
selectOptions: [{
|
|
3303
|
+
label: 'Quantity Requested',
|
|
3304
|
+
value: '',
|
|
3305
|
+
disabled: true
|
|
3306
|
+
}].concat(generateQuantity(10))
|
|
3307
|
+
})), React.createElement("div", {
|
|
3308
|
+
className: "field-item"
|
|
3309
|
+
}, React.createElement(Field, {
|
|
3310
|
+
name: "firstName",
|
|
3311
|
+
label: "First name",
|
|
3312
|
+
validate: function validate(value) {
|
|
3313
|
+
return requiredValidator(value, 'Please enter your First name');
|
|
3314
|
+
},
|
|
3315
|
+
component: CustomField
|
|
3316
|
+
})), React.createElement("div", {
|
|
3317
|
+
className: "field-item"
|
|
3318
|
+
}, React.createElement(Field, {
|
|
3319
|
+
name: "lastName",
|
|
3320
|
+
label: "Last name",
|
|
3321
|
+
validate: function validate(value) {
|
|
3322
|
+
return requiredValidator(value, 'Please enter your Last name');
|
|
3323
|
+
},
|
|
3324
|
+
component: CustomField
|
|
3325
|
+
})), React.createElement("div", {
|
|
3326
|
+
className: "field-item"
|
|
3327
|
+
}, React.createElement(Field, {
|
|
3328
|
+
name: "email",
|
|
3329
|
+
label: "Email",
|
|
3330
|
+
validate: combineValidators(function (value) {
|
|
3331
|
+
return requiredValidator(value, 'Please enter your Email');
|
|
3332
|
+
}, function (value) {
|
|
3333
|
+
return emailValidator(value);
|
|
3334
|
+
}),
|
|
3335
|
+
component: CustomField
|
|
3336
|
+
})), React.createElement(Button, {
|
|
3337
|
+
type: "submit",
|
|
3338
|
+
variant: "contained",
|
|
3339
|
+
className: "waiting-list-button"
|
|
3340
|
+
}, loading ? React.createElement(CircularProgress$1, {
|
|
3341
|
+
size: "22px"
|
|
3342
|
+
}) : 'ADD TO WAITING LIST')))));
|
|
3139
3343
|
};
|
|
3140
3344
|
|
|
3141
3345
|
function Loader() {
|
|
@@ -3155,7 +3359,9 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
3155
3359
|
_ref$onGetTicketsSucc = _ref.onGetTicketsSuccess,
|
|
3156
3360
|
onGetTicketsSuccess = _ref$onGetTicketsSucc === void 0 ? function () {} : _ref$onGetTicketsSucc,
|
|
3157
3361
|
_ref$onGetTicketsErro = _ref.onGetTicketsError,
|
|
3158
|
-
onGetTicketsError = _ref$onGetTicketsErro === void 0 ? function () {} : _ref$onGetTicketsErro
|
|
3362
|
+
onGetTicketsError = _ref$onGetTicketsErro === void 0 ? function () {} : _ref$onGetTicketsErro,
|
|
3363
|
+
_ref$theme = _ref.theme,
|
|
3364
|
+
theme = _ref$theme === void 0 ? 'light' : _ref$theme;
|
|
3159
3365
|
|
|
3160
3366
|
var _useState = useState({}),
|
|
3161
3367
|
selectedTickets = _useState[0],
|
|
@@ -3166,28 +3372,32 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
3166
3372
|
setTickets = _useState2[1];
|
|
3167
3373
|
|
|
3168
3374
|
var _useState3 = useState(false),
|
|
3169
|
-
|
|
3170
|
-
|
|
3375
|
+
showWaitingList = _useState3[0],
|
|
3376
|
+
setShowWaitingList = _useState3[1];
|
|
3171
3377
|
|
|
3172
3378
|
var _useState4 = useState(false),
|
|
3173
|
-
|
|
3174
|
-
|
|
3379
|
+
isLoading = _useState4[0],
|
|
3380
|
+
setIsLoading = _useState4[1];
|
|
3175
3381
|
|
|
3176
|
-
var _useState5 = useState(
|
|
3177
|
-
|
|
3178
|
-
|
|
3382
|
+
var _useState5 = useState(false),
|
|
3383
|
+
handleBookIsLoading = _useState5[0],
|
|
3384
|
+
setHandleBookIsLoading = _useState5[1];
|
|
3179
3385
|
|
|
3180
3386
|
var _useState6 = useState(''),
|
|
3181
|
-
|
|
3182
|
-
|
|
3387
|
+
promoCode = _useState6[0],
|
|
3388
|
+
setPromoCode = _useState6[1];
|
|
3183
3389
|
|
|
3184
|
-
var _useState7 = useState(
|
|
3185
|
-
|
|
3186
|
-
|
|
3390
|
+
var _useState7 = useState(''),
|
|
3391
|
+
promoCodeUpdated = _useState7[0],
|
|
3392
|
+
setPromoCodeUpdated = _useState7[1];
|
|
3187
3393
|
|
|
3188
3394
|
var _useState8 = useState(false),
|
|
3189
|
-
|
|
3190
|
-
|
|
3395
|
+
showPromoInput = _useState8[0],
|
|
3396
|
+
setShowPromoInput = _useState8[1];
|
|
3397
|
+
|
|
3398
|
+
var _useState9 = useState(false),
|
|
3399
|
+
promoCodeIsApplied = _useState9[0],
|
|
3400
|
+
setPromoCodeIsApplied = _useState9[1];
|
|
3191
3401
|
|
|
3192
3402
|
useEffect(function () {
|
|
3193
3403
|
if (typeof window !== 'undefined') {
|
|
@@ -3210,8 +3420,7 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
3210
3420
|
|
|
3211
3421
|
function _getTicketsApi() {
|
|
3212
3422
|
_getTicketsApi = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee() {
|
|
3213
|
-
var response, attributes
|
|
3214
|
-
|
|
3423
|
+
var response, attributes;
|
|
3215
3424
|
return runtime_1.wrap(function _callee$(_context) {
|
|
3216
3425
|
while (1) {
|
|
3217
3426
|
switch (_context.prev = _context.next) {
|
|
@@ -3228,10 +3437,8 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
3228
3437
|
setCustomHeader(response);
|
|
3229
3438
|
attributes = _get(response, 'data.data.attributes');
|
|
3230
3439
|
setPromoCodeIsApplied(attributes.ValidPromoCode);
|
|
3231
|
-
|
|
3232
|
-
|
|
3233
|
-
});
|
|
3234
|
-
setTickets(_tickets);
|
|
3440
|
+
setTickets(_get(attributes, 'tickets'));
|
|
3441
|
+
setShowWaitingList(attributes.showWaitingList);
|
|
3235
3442
|
onGetTicketsSuccess(response.data);
|
|
3236
3443
|
}
|
|
3237
3444
|
|
|
@@ -3354,9 +3561,16 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
3354
3561
|
return !(item.sold_out || item.soldOut);
|
|
3355
3562
|
});
|
|
3356
3563
|
return React.createElement("div", {
|
|
3357
|
-
className: "get-tickets-page",
|
|
3564
|
+
className: "get-tickets-page " + theme,
|
|
3358
3565
|
style: contentStyle
|
|
3359
|
-
}, isLoading ? React.createElement(Loader, null) : React.createElement(
|
|
3566
|
+
}, isLoading ? React.createElement(Loader, null) : React.createElement(React.Fragment, null, showWaitingList ? React.createElement(WaitingList, {
|
|
3567
|
+
tickets: tickets
|
|
3568
|
+
}) : React.createElement("div", null, React.createElement(TicketsSection, {
|
|
3569
|
+
ticketsList: tickets,
|
|
3570
|
+
selectedTickets: selectedTickets,
|
|
3571
|
+
handleTicketSelect: handleTicketSelect,
|
|
3572
|
+
promoCodeIsApplied: promoCodeIsApplied
|
|
3573
|
+
}), promoCodeIsApplied ? React.createElement("div", {
|
|
3360
3574
|
className: "alert-info"
|
|
3361
3575
|
}, "Your promo code was applied successfully.") : null, showPromoInput && React.createElement("div", {
|
|
3362
3576
|
className: "promo-code-block"
|
|
@@ -3370,13 +3584,13 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
3370
3584
|
setPromoCodeUpdated(promoCode);
|
|
3371
3585
|
}
|
|
3372
3586
|
}
|
|
3373
|
-
}), React.createElement(Button, {
|
|
3587
|
+
}), React.createElement(Button$1, {
|
|
3374
3588
|
className: "promo-apply-button",
|
|
3375
3589
|
placeholder: "Promo Code",
|
|
3376
3590
|
onClick: function onClick() {
|
|
3377
3591
|
setPromoCodeUpdated(promoCode);
|
|
3378
3592
|
}
|
|
3379
|
-
}, "Apply")), !showPromoInput && !isAllTicketsSoldOut ? React.createElement(Button, {
|
|
3593
|
+
}, "Apply")), !showPromoInput && !isAllTicketsSoldOut ? React.createElement(Button$1, {
|
|
3380
3594
|
className: "promo-code-button",
|
|
3381
3595
|
placeholder: "Promo Codes",
|
|
3382
3596
|
onClick: function onClick() {
|
|
@@ -3387,11 +3601,11 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
3387
3601
|
style: {
|
|
3388
3602
|
display: 'none'
|
|
3389
3603
|
}
|
|
3390
|
-
}), !isAllTicketsSoldOut && React.createElement(Button, {
|
|
3604
|
+
}), !isAllTicketsSoldOut && React.createElement(Button$1, {
|
|
3391
3605
|
"aria-hidden": true,
|
|
3392
3606
|
className: "book-button " + (handleBookIsLoading || _isEmpty(selectedTickets) || Object.values(selectedTickets)[0] === 0 ? 'disabled' : ''),
|
|
3393
3607
|
onClick: !handleBookIsLoading && !_isEmpty(selectedTickets) && Object.values(selectedTickets)[0] > 0 ? handleBook : function () {}
|
|
3394
|
-
}, getTicketsLabel || 'GET TICKETS')));
|
|
3608
|
+
}, getTicketsLabel || 'GET TICKETS'))));
|
|
3395
3609
|
};
|
|
3396
3610
|
|
|
3397
3611
|
export { BillingInfoContainer, ConfirmationContainer, LoginModal, PaymentContainer, TicketsContainer, createFixedFloatNormalizer, currencyNormalizerCreator };
|