tf-checkout-react 1.6.6-beta.24 → 1.6.6-beta.26
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/index.d.ts +2 -1
- package/dist/tf-checkout-react.cjs.development.js +169 -148
- 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 +169 -149
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/utils/auth.d.ts +8 -0
- package/dist/utils/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/api/auth.ts +2 -1
- package/src/api/publicRequest.ts +14 -0
- package/src/components/forgotPasswordModal/index.tsx +6 -2
- package/src/components/ticketsContainer/index.tsx +3 -16
- package/src/index.ts +4 -2
- package/src/utils/auth.ts +32 -0
- package/src/utils/index.ts +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ export { currencyNormalizerCreator, createFixedFloatNormalizer } from './normali
|
|
|
6
6
|
export { LoginModal } from './components/loginModal';
|
|
7
7
|
export { MyTicketsContainer } from './components/myTicketsContainer';
|
|
8
8
|
export { OrderDetailsContainer } from './components/orderDetailsContainer';
|
|
9
|
-
export { setConfigs } from './utils/setConfigs';
|
|
10
9
|
export { DEFAULT_FEES_STYLE } from './constants/index';
|
|
11
10
|
export { TicketResaleContainer } from './components';
|
|
12
11
|
export { RedirectModal } from './components/common/RedirectModal';
|
|
@@ -23,3 +22,5 @@ export { PoweredBy } from './components/common/PoweredBy';
|
|
|
23
22
|
export { SeatMapContainer } from './components/seatMapContainer';
|
|
24
23
|
export { IDVerification } from './components/idVerificationContainer';
|
|
25
24
|
export { VERIFICATION_STATUSES } from './components/idVerificationContainer/constants';
|
|
25
|
+
export { setConfigs } from './utils/setConfigs';
|
|
26
|
+
export { logoutUser } from './utils/auth';
|
|
@@ -501,6 +501,15 @@ var publicRequest = /*#__PURE__*/axios.create({
|
|
|
501
501
|
baseURL: 'https://www.ticketfairy.com/api',
|
|
502
502
|
headers: headers
|
|
503
503
|
});
|
|
504
|
+
publicRequest.interceptors.request.use(function (config) {
|
|
505
|
+
if (getCookieByName('X-TF-ECOMMERCE')) {
|
|
506
|
+
var updatedHeaders = _extends({}, config.headers, {
|
|
507
|
+
'X-TF-ECOMMERCE': getCookieByName('X-TF-ECOMMERCE')
|
|
508
|
+
});
|
|
509
|
+
config.headers = updatedHeaders;
|
|
510
|
+
}
|
|
511
|
+
return config;
|
|
512
|
+
});
|
|
504
513
|
publicRequest.setBaseUrl = function (baseUrl) {
|
|
505
514
|
return publicRequest.defaults.baseURL = baseUrl + '/api';
|
|
506
515
|
};
|
|
@@ -783,6 +792,41 @@ var setLoggedUserData = function setLoggedUserData(data) {
|
|
|
783
792
|
zip: (data == null ? void 0 : data.zipCode) || ''
|
|
784
793
|
};
|
|
785
794
|
};
|
|
795
|
+
var logoutUser = /*#__PURE__*/function () {
|
|
796
|
+
var _ref2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
|
797
|
+
var onLogoutSuccess, onLogoutError, setIsLogged, event;
|
|
798
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
799
|
+
while (1) switch (_context.prev = _context.next) {
|
|
800
|
+
case 0:
|
|
801
|
+
onLogoutSuccess = _ref.onLogoutSuccess, onLogoutError = _ref.onLogoutError, setIsLogged = _ref.setIsLogged;
|
|
802
|
+
_context.prev = 1;
|
|
803
|
+
_context.next = 4;
|
|
804
|
+
return logout();
|
|
805
|
+
case 4:
|
|
806
|
+
onLogoutSuccess && onLogoutSuccess();
|
|
807
|
+
if (isBrowser) {
|
|
808
|
+
window.localStorage.removeItem('user_data');
|
|
809
|
+
setIsLogged && setIsLogged(false);
|
|
810
|
+
event = new window.CustomEvent('tf-logout');
|
|
811
|
+
deleteCookieByName('X-TF-ECOMMERCE');
|
|
812
|
+
window.document.dispatchEvent(event);
|
|
813
|
+
}
|
|
814
|
+
_context.next = 11;
|
|
815
|
+
break;
|
|
816
|
+
case 8:
|
|
817
|
+
_context.prev = 8;
|
|
818
|
+
_context.t0 = _context["catch"](1);
|
|
819
|
+
onLogoutError && onLogoutError(_context.t0);
|
|
820
|
+
case 11:
|
|
821
|
+
case "end":
|
|
822
|
+
return _context.stop();
|
|
823
|
+
}
|
|
824
|
+
}, _callee, null, [[1, 8]]);
|
|
825
|
+
}));
|
|
826
|
+
return function logoutUser(_x) {
|
|
827
|
+
return _ref2.apply(this, arguments);
|
|
828
|
+
};
|
|
829
|
+
}();
|
|
786
830
|
|
|
787
831
|
var getDataWithCustomFields = function getDataWithCustomFields(initialData, ticketHoldersFields, customFields) {
|
|
788
832
|
// Custom Fields are not specified case
|
|
@@ -4173,41 +4217,44 @@ var ForgotPasswordModal = function ForgotPasswordModal(_ref) {
|
|
|
4173
4217
|
case 0:
|
|
4174
4218
|
email = _ref2.email;
|
|
4175
4219
|
if (!showSuccess) {
|
|
4176
|
-
_context.next =
|
|
4220
|
+
_context.next = 5;
|
|
4177
4221
|
break;
|
|
4178
4222
|
}
|
|
4223
|
+
setSuccessMessage(null);
|
|
4179
4224
|
onClose();
|
|
4180
4225
|
return _context.abrupt("return");
|
|
4181
|
-
case
|
|
4182
|
-
_context.prev =
|
|
4226
|
+
case 5:
|
|
4227
|
+
_context.prev = 5;
|
|
4183
4228
|
setLoading(true);
|
|
4184
|
-
_context.next =
|
|
4229
|
+
_context.next = 9;
|
|
4185
4230
|
return forgotPassword(email);
|
|
4186
|
-
case
|
|
4231
|
+
case 9:
|
|
4187
4232
|
_yield$forgotPassword = _context.sent;
|
|
4188
4233
|
data = _yield$forgotPassword.data;
|
|
4189
4234
|
onForgotPasswordSuccess(data);
|
|
4190
|
-
|
|
4191
|
-
if (data != null && data.success) {
|
|
4235
|
+
if (displaySuccessMessage && data != null && data.success) {
|
|
4192
4236
|
setSuccessMessage(data == null ? void 0 : data.message);
|
|
4193
4237
|
}
|
|
4194
|
-
|
|
4238
|
+
if (!displaySuccessMessage) {
|
|
4239
|
+
onClose();
|
|
4240
|
+
}
|
|
4241
|
+
_context.next = 19;
|
|
4195
4242
|
break;
|
|
4196
|
-
case
|
|
4197
|
-
_context.prev =
|
|
4198
|
-
_context.t0 = _context["catch"](
|
|
4243
|
+
case 16:
|
|
4244
|
+
_context.prev = 16;
|
|
4245
|
+
_context.t0 = _context["catch"](5);
|
|
4199
4246
|
if (axios.isAxiosError(_context.t0)) {
|
|
4200
4247
|
onForgotPasswordError(_context.t0);
|
|
4201
4248
|
}
|
|
4202
|
-
case
|
|
4203
|
-
_context.prev =
|
|
4249
|
+
case 19:
|
|
4250
|
+
_context.prev = 19;
|
|
4204
4251
|
setLoading(false);
|
|
4205
|
-
return _context.finish(
|
|
4206
|
-
case
|
|
4252
|
+
return _context.finish(19);
|
|
4253
|
+
case 22:
|
|
4207
4254
|
case "end":
|
|
4208
4255
|
return _context.stop();
|
|
4209
4256
|
}
|
|
4210
|
-
}, _callee, null, [[
|
|
4257
|
+
}, _callee, null, [[5, 16, 19, 22]]);
|
|
4211
4258
|
}));
|
|
4212
4259
|
return function onForgotPassword(_x) {
|
|
4213
4260
|
return _ref3.apply(this, arguments);
|
|
@@ -8190,40 +8237,13 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8190
8237
|
});
|
|
8191
8238
|
}
|
|
8192
8239
|
}, [isLogged]);
|
|
8193
|
-
var handleLogout =
|
|
8194
|
-
|
|
8195
|
-
|
|
8196
|
-
|
|
8197
|
-
|
|
8198
|
-
|
|
8199
|
-
|
|
8200
|
-
_context.next = 3;
|
|
8201
|
-
return logout();
|
|
8202
|
-
case 3:
|
|
8203
|
-
onLogoutSuccess();
|
|
8204
|
-
if (isBrowser) {
|
|
8205
|
-
window.localStorage.removeItem('user_data');
|
|
8206
|
-
setIsLogged(false);
|
|
8207
|
-
_event = new window.CustomEvent('tf-logout');
|
|
8208
|
-
deleteCookieByName('X-TF-ECOMMERCE');
|
|
8209
|
-
window.document.dispatchEvent(_event);
|
|
8210
|
-
}
|
|
8211
|
-
_context.next = 10;
|
|
8212
|
-
break;
|
|
8213
|
-
case 7:
|
|
8214
|
-
_context.prev = 7;
|
|
8215
|
-
_context.t0 = _context["catch"](0);
|
|
8216
|
-
onLogoutError(_context.t0);
|
|
8217
|
-
case 10:
|
|
8218
|
-
case "end":
|
|
8219
|
-
return _context.stop();
|
|
8220
|
-
}
|
|
8221
|
-
}, _callee, null, [[0, 7]]);
|
|
8222
|
-
}));
|
|
8223
|
-
return function handleLogout() {
|
|
8224
|
-
return _ref2.apply(this, arguments);
|
|
8225
|
-
};
|
|
8226
|
-
}();
|
|
8240
|
+
var handleLogout = function handleLogout() {
|
|
8241
|
+
logoutUser({
|
|
8242
|
+
onLogoutError: onLogoutError,
|
|
8243
|
+
onLogoutSuccess: onLogoutSuccess,
|
|
8244
|
+
setIsLogged: setIsLogged
|
|
8245
|
+
});
|
|
8246
|
+
};
|
|
8227
8247
|
var handleExternalLogin = function handleExternalLogin() {
|
|
8228
8248
|
setIsLogged(true);
|
|
8229
8249
|
};
|
|
@@ -8238,23 +8258,23 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8238
8258
|
}
|
|
8239
8259
|
};
|
|
8240
8260
|
var getTimeSlots = /*#__PURE__*/function () {
|
|
8241
|
-
var
|
|
8261
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(date, type) {
|
|
8242
8262
|
var _timeSlotsResponse$da, timeSlotsResponse, groupedTickets, attributes;
|
|
8243
|
-
return _regeneratorRuntime().wrap(function
|
|
8244
|
-
while (1) switch (
|
|
8263
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
8264
|
+
while (1) switch (_context.prev = _context.next) {
|
|
8245
8265
|
case 0:
|
|
8246
8266
|
if (date) {
|
|
8247
|
-
|
|
8267
|
+
_context.next = 3;
|
|
8248
8268
|
break;
|
|
8249
8269
|
}
|
|
8250
8270
|
setShowPromoCodeSection(false);
|
|
8251
|
-
return
|
|
8271
|
+
return _context.abrupt("return");
|
|
8252
8272
|
case 3:
|
|
8253
|
-
|
|
8254
|
-
|
|
8273
|
+
_context.prev = 3;
|
|
8274
|
+
_context.next = 6;
|
|
8255
8275
|
return getTimeSlotsByDate(eventId, moment(date).format('YYYY-MM-DD'), code);
|
|
8256
8276
|
case 6:
|
|
8257
|
-
timeSlotsResponse =
|
|
8277
|
+
timeSlotsResponse = _context.sent;
|
|
8258
8278
|
groupedTickets = {};
|
|
8259
8279
|
_map(timeSlotsResponse.data.attributes.timeslots, function (timeslots, date) {
|
|
8260
8280
|
var dateKeyChunks = date.split('-');
|
|
@@ -8277,63 +8297,63 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8277
8297
|
setShowAccessCodeSection(attributes.is_access_code);
|
|
8278
8298
|
setShowPromoCodeSection(attributes.isPromotionsEnabled);
|
|
8279
8299
|
}
|
|
8280
|
-
|
|
8300
|
+
_context.next = 17;
|
|
8281
8301
|
break;
|
|
8282
8302
|
case 15:
|
|
8283
|
-
|
|
8284
|
-
|
|
8303
|
+
_context.prev = 15;
|
|
8304
|
+
_context.t0 = _context["catch"](3);
|
|
8285
8305
|
case 17:
|
|
8286
8306
|
case "end":
|
|
8287
|
-
return
|
|
8307
|
+
return _context.stop();
|
|
8288
8308
|
}
|
|
8289
|
-
},
|
|
8309
|
+
}, _callee, null, [[3, 15]]);
|
|
8290
8310
|
}));
|
|
8291
8311
|
return function getTimeSlots(_x, _x2) {
|
|
8292
|
-
return
|
|
8312
|
+
return _ref2.apply(this, arguments);
|
|
8293
8313
|
};
|
|
8294
8314
|
}();
|
|
8295
8315
|
function getTicketsApi(_x3, _x4) {
|
|
8296
8316
|
return _getTicketsApi.apply(this, arguments);
|
|
8297
8317
|
}
|
|
8298
8318
|
function _getTicketsApi() {
|
|
8299
|
-
_getTicketsApi = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
8300
|
-
var previewKey, eventResponse,
|
|
8301
|
-
return _regeneratorRuntime().wrap(function
|
|
8302
|
-
while (1) switch (
|
|
8319
|
+
_getTicketsApi = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(isUpdatingCode, type) {
|
|
8320
|
+
var previewKey, eventResponse, _event, _event$timeslotSettin, _event$timeslotSettin2, response, _response$data, attributes;
|
|
8321
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
8322
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
8303
8323
|
case 0:
|
|
8304
|
-
|
|
8324
|
+
_context4.prev = 0;
|
|
8305
8325
|
if (isUpdatingCode) {
|
|
8306
8326
|
setCodeIsLoading(true);
|
|
8307
8327
|
} else {
|
|
8308
8328
|
setIsLoading(true);
|
|
8309
8329
|
}
|
|
8310
8330
|
previewKey = getQueryVariable('pk') || undefined;
|
|
8311
|
-
|
|
8331
|
+
_context4.next = 5;
|
|
8312
8332
|
return getEvent(eventId, previewKey);
|
|
8313
8333
|
case 5:
|
|
8314
|
-
eventResponse =
|
|
8334
|
+
eventResponse = _context4.sent;
|
|
8315
8335
|
if (!eventResponse.success) {
|
|
8316
|
-
|
|
8336
|
+
_context4.next = 14;
|
|
8317
8337
|
break;
|
|
8318
8338
|
}
|
|
8319
|
-
|
|
8320
|
-
setEvent(
|
|
8321
|
-
if (
|
|
8322
|
-
window.localStorage.setItem('eventCountry',
|
|
8339
|
+
_event = eventResponse.data.attributes;
|
|
8340
|
+
setEvent(_event);
|
|
8341
|
+
if (_event.country && isBrowser) {
|
|
8342
|
+
window.localStorage.setItem('eventCountry', _event.country);
|
|
8323
8343
|
}
|
|
8324
|
-
if (!
|
|
8325
|
-
|
|
8344
|
+
if (!_event.isTimeSlotEvent) {
|
|
8345
|
+
_context4.next = 14;
|
|
8326
8346
|
break;
|
|
8327
8347
|
}
|
|
8328
8348
|
getTimeSlots(selectedDate, code);
|
|
8329
8349
|
// For timeslots we shouldn't fetch all tickets at once
|
|
8330
|
-
setAvailableDates((
|
|
8331
|
-
return
|
|
8350
|
+
setAvailableDates((_event$timeslotSettin = _event == null ? void 0 : (_event$timeslotSettin2 = _event.timeslotSettings) == null ? void 0 : _event$timeslotSettin2.availableDates) != null ? _event$timeslotSettin : []);
|
|
8351
|
+
return _context4.abrupt("return");
|
|
8332
8352
|
case 14:
|
|
8333
|
-
|
|
8353
|
+
_context4.next = 16;
|
|
8334
8354
|
return getTickets(eventId, code, previewKey);
|
|
8335
8355
|
case 16:
|
|
8336
|
-
response =
|
|
8356
|
+
response = _context4.sent;
|
|
8337
8357
|
if (response.success) {
|
|
8338
8358
|
attributes = response == null ? void 0 : (_response$data = response.data) == null ? void 0 : _response$data.attributes;
|
|
8339
8359
|
type === 'promo' && setCodeIsApplied(attributes.ValidPromoCode);
|
|
@@ -8352,26 +8372,26 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8352
8372
|
setShowAccessCodeSection(attributes.is_access_code);
|
|
8353
8373
|
setShowPromoCodeSection(attributes.isPromotionsEnabled);
|
|
8354
8374
|
}
|
|
8355
|
-
|
|
8375
|
+
_context4.next = 23;
|
|
8356
8376
|
break;
|
|
8357
8377
|
case 20:
|
|
8358
|
-
|
|
8359
|
-
|
|
8360
|
-
if (axios.isAxiosError(
|
|
8361
|
-
onGetTicketsError(
|
|
8362
|
-
setError(_get(
|
|
8378
|
+
_context4.prev = 20;
|
|
8379
|
+
_context4.t0 = _context4["catch"](0);
|
|
8380
|
+
if (axios.isAxiosError(_context4.t0)) {
|
|
8381
|
+
onGetTicketsError(_context4.t0);
|
|
8382
|
+
setError(_get(_context4.t0, 'response.data.message', ''));
|
|
8363
8383
|
window.localStorage.removeItem('appliedPromoCode');
|
|
8364
8384
|
}
|
|
8365
8385
|
case 23:
|
|
8366
|
-
|
|
8386
|
+
_context4.prev = 23;
|
|
8367
8387
|
setIsLoading(false);
|
|
8368
8388
|
setCodeIsLoading(false);
|
|
8369
|
-
return
|
|
8389
|
+
return _context4.finish(23);
|
|
8370
8390
|
case 27:
|
|
8371
8391
|
case "end":
|
|
8372
|
-
return
|
|
8392
|
+
return _context4.stop();
|
|
8373
8393
|
}
|
|
8374
|
-
},
|
|
8394
|
+
}, _callee4, null, [[0, 20, 23, 27]]);
|
|
8375
8395
|
}));
|
|
8376
8396
|
return _getTicketsApi.apply(this, arguments);
|
|
8377
8397
|
}
|
|
@@ -8379,32 +8399,32 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8379
8399
|
return _fetchPreregisteredData.apply(this, arguments);
|
|
8380
8400
|
}
|
|
8381
8401
|
function _fetchPreregisteredData() {
|
|
8382
|
-
_fetchPreregisteredData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
8402
|
+
_fetchPreregisteredData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
8383
8403
|
var preregistrationData;
|
|
8384
|
-
return _regeneratorRuntime().wrap(function
|
|
8385
|
-
while (1) switch (
|
|
8404
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
8405
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
8386
8406
|
case 0:
|
|
8387
|
-
|
|
8388
|
-
|
|
8407
|
+
_context5.prev = 0;
|
|
8408
|
+
_context5.next = 3;
|
|
8389
8409
|
return getPreRegistrationInfluencers({
|
|
8390
8410
|
eventId: eventId
|
|
8391
8411
|
});
|
|
8392
8412
|
case 3:
|
|
8393
|
-
preregistrationData =
|
|
8413
|
+
preregistrationData = _context5.sent;
|
|
8394
8414
|
setPreregisteredUsers(preregistrationData.data.attributes.influencers);
|
|
8395
|
-
|
|
8415
|
+
_context5.next = 10;
|
|
8396
8416
|
break;
|
|
8397
8417
|
case 7:
|
|
8398
|
-
|
|
8399
|
-
|
|
8400
|
-
if (axios.isAxiosError(
|
|
8401
|
-
setError(_get(
|
|
8418
|
+
_context5.prev = 7;
|
|
8419
|
+
_context5.t0 = _context5["catch"](0);
|
|
8420
|
+
if (axios.isAxiosError(_context5.t0)) {
|
|
8421
|
+
setError(_get(_context5.t0, 'response.data.message', ''));
|
|
8402
8422
|
}
|
|
8403
8423
|
case 10:
|
|
8404
8424
|
case "end":
|
|
8405
|
-
return
|
|
8425
|
+
return _context5.stop();
|
|
8406
8426
|
}
|
|
8407
|
-
},
|
|
8427
|
+
}, _callee5, null, [[0, 7]]);
|
|
8408
8428
|
}));
|
|
8409
8429
|
return _fetchPreregisteredData.apply(this, arguments);
|
|
8410
8430
|
}
|
|
@@ -8414,11 +8434,11 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8414
8434
|
}
|
|
8415
8435
|
localStorage.setItem('selectedTicketsQuantity', value.toString());
|
|
8416
8436
|
setSelectedTickets(function (prevState) {
|
|
8417
|
-
var
|
|
8437
|
+
var _ref3;
|
|
8418
8438
|
if (Object.keys(prevState)[0] !== key && !value) {
|
|
8419
8439
|
return prevState;
|
|
8420
8440
|
}
|
|
8421
|
-
return
|
|
8441
|
+
return _ref3 = {}, _ref3[key] = value, _ref3.isTable = isTable, _ref3;
|
|
8422
8442
|
});
|
|
8423
8443
|
};
|
|
8424
8444
|
var handleOrdersClick = function handleOrdersClick() {
|
|
@@ -8430,11 +8450,11 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8430
8450
|
setError(null);
|
|
8431
8451
|
};
|
|
8432
8452
|
var handleBook = /*#__PURE__*/function () {
|
|
8433
|
-
var
|
|
8453
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
8434
8454
|
var _product_options, _product_options2, _ticket_types;
|
|
8435
8455
|
var timeSlotTickets, ticket, optionName, ticketId, isTableType, productCartQuantity, ticketQuantity, data, result, pageConfigsDataResponse, _pageConfigsData$skip, _pageConfigsData$has_, _pageConfigsData$free, pageConfigsData, skipBillingPage, hasAddOn, freeTicket, hash, total, _checkoutResponse$dat, _checkoutResponse$dat2, _checkoutResponse$dat3, _checkoutResponse$dat4, userData, checkoutBody, checkoutResponse, _errorResponse$data, _errorResponse$data$d, errorResponse, _errorResponse$data2, message, _isInvalidLinkError, _isNotInvitedError;
|
|
8436
|
-
return _regeneratorRuntime().wrap(function
|
|
8437
|
-
while (1) switch (
|
|
8456
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
8457
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
8438
8458
|
case 0:
|
|
8439
8459
|
timeSlotTickets = _flatten(_map(timeSlotGroups, function (slots) {
|
|
8440
8460
|
return slots;
|
|
@@ -8462,33 +8482,33 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8462
8482
|
}, _ticket_types)
|
|
8463
8483
|
}
|
|
8464
8484
|
};
|
|
8465
|
-
|
|
8485
|
+
_context2.prev = 9;
|
|
8466
8486
|
onGetTicketsPress();
|
|
8467
|
-
|
|
8487
|
+
_context2.next = 13;
|
|
8468
8488
|
return addToCart(eventId, data);
|
|
8469
8489
|
case 13:
|
|
8470
|
-
result =
|
|
8490
|
+
result = _context2.sent;
|
|
8471
8491
|
if (!enableAddOns) {
|
|
8472
|
-
|
|
8492
|
+
_context2.next = 20;
|
|
8473
8493
|
break;
|
|
8474
8494
|
}
|
|
8475
|
-
|
|
8495
|
+
_context2.next = 17;
|
|
8476
8496
|
return getCheckoutPageConfigs();
|
|
8477
8497
|
case 17:
|
|
8478
|
-
|
|
8479
|
-
|
|
8498
|
+
_context2.t0 = _context2.sent;
|
|
8499
|
+
_context2.next = 21;
|
|
8480
8500
|
break;
|
|
8481
8501
|
case 20:
|
|
8482
|
-
|
|
8502
|
+
_context2.t0 = {
|
|
8483
8503
|
status: 200,
|
|
8484
8504
|
data: {
|
|
8485
8505
|
attributes: _get(result, 'data.attributes')
|
|
8486
8506
|
}
|
|
8487
8507
|
};
|
|
8488
8508
|
case 21:
|
|
8489
|
-
pageConfigsDataResponse =
|
|
8509
|
+
pageConfigsDataResponse = _context2.t0;
|
|
8490
8510
|
if (!(result.status === 200 && pageConfigsDataResponse.status === 200)) {
|
|
8491
|
-
|
|
8511
|
+
_context2.next = 44;
|
|
8492
8512
|
break;
|
|
8493
8513
|
}
|
|
8494
8514
|
pageConfigsData = _get(pageConfigsDataResponse, 'data.attributes') || {};
|
|
@@ -8499,26 +8519,26 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8499
8519
|
total = '';
|
|
8500
8520
|
isBrowser && window.localStorage.removeItem('add_ons');
|
|
8501
8521
|
if (!(skipBillingPage && !hasAddOn)) {
|
|
8502
|
-
|
|
8522
|
+
_context2.next = 43;
|
|
8503
8523
|
break;
|
|
8504
8524
|
}
|
|
8505
8525
|
// Get user data for checkout data
|
|
8506
8526
|
userData = isBrowser && window.localStorage.getItem('user_data') ? JSON.parse(window.localStorage.getItem('user_data') || '') : {};
|
|
8507
8527
|
checkoutBody = createCheckoutDataBodyWithDefaultHolder(ticketQuantity, userData);
|
|
8508
8528
|
if (!enableBillingInfoAutoCreate) {
|
|
8509
|
-
|
|
8529
|
+
_context2.next = 39;
|
|
8510
8530
|
break;
|
|
8511
8531
|
}
|
|
8512
|
-
|
|
8532
|
+
_context2.next = 36;
|
|
8513
8533
|
return postOnCheckout(checkoutBody, freeTicket);
|
|
8514
8534
|
case 36:
|
|
8515
|
-
|
|
8516
|
-
|
|
8535
|
+
_context2.t1 = _context2.sent;
|
|
8536
|
+
_context2.next = 40;
|
|
8517
8537
|
break;
|
|
8518
8538
|
case 39:
|
|
8519
|
-
|
|
8539
|
+
_context2.t1 = null;
|
|
8520
8540
|
case 40:
|
|
8521
|
-
checkoutResponse =
|
|
8541
|
+
checkoutResponse = _context2.t1;
|
|
8522
8542
|
hash = (checkoutResponse == null ? void 0 : (_checkoutResponse$dat = checkoutResponse.data) == null ? void 0 : (_checkoutResponse$dat2 = _checkoutResponse$dat.attributes) == null ? void 0 : _checkoutResponse$dat2.hash) || '';
|
|
8523
8543
|
total = (checkoutResponse == null ? void 0 : (_checkoutResponse$dat3 = checkoutResponse.data) == null ? void 0 : (_checkoutResponse$dat4 = _checkoutResponse$dat3.attributes) == null ? void 0 : _checkoutResponse$dat4.total) || '';
|
|
8524
8544
|
case 43:
|
|
@@ -8530,17 +8550,17 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8530
8550
|
hasAddOn: hasAddOn
|
|
8531
8551
|
});
|
|
8532
8552
|
case 44:
|
|
8533
|
-
|
|
8553
|
+
_context2.next = 50;
|
|
8534
8554
|
break;
|
|
8535
8555
|
case 46:
|
|
8536
|
-
|
|
8537
|
-
|
|
8538
|
-
errorResponse = _get(
|
|
8556
|
+
_context2.prev = 46;
|
|
8557
|
+
_context2.t2 = _context2["catch"](9);
|
|
8558
|
+
errorResponse = _get(_context2.t2, 'response', {});
|
|
8539
8559
|
if (errorResponse != null && (_errorResponse$data = errorResponse.data) != null && (_errorResponse$data$d = _errorResponse$data.data) != null && _errorResponse$data$d.hasUnverifiedOrder) {
|
|
8540
8560
|
setPendingVerificationMessage(errorResponse == null ? void 0 : (_errorResponse$data2 = errorResponse.data) == null ? void 0 : _errorResponse$data2.message);
|
|
8541
|
-
} else if (axios.isAxiosError(
|
|
8542
|
-
onAddToCartError(
|
|
8543
|
-
message = _get(
|
|
8561
|
+
} else if (axios.isAxiosError(_context2.t2)) {
|
|
8562
|
+
onAddToCartError(_context2.t2);
|
|
8563
|
+
message = _get(_context2.t2, 'response.data.message', '');
|
|
8544
8564
|
_isInvalidLinkError = _includes(message, 'No more of this ticket type are available right now');
|
|
8545
8565
|
_isNotInvitedError = _includes(message, 'You must have been invited to this event to attend');
|
|
8546
8566
|
if (_isInvalidLinkError) {
|
|
@@ -8552,43 +8572,43 @@ var TicketsContainer = function TicketsContainer(_ref) {
|
|
|
8552
8572
|
}
|
|
8553
8573
|
}
|
|
8554
8574
|
case 50:
|
|
8555
|
-
|
|
8575
|
+
_context2.prev = 50;
|
|
8556
8576
|
setHandleBookIsLoading(false);
|
|
8557
|
-
return
|
|
8577
|
+
return _context2.finish(50);
|
|
8558
8578
|
case 53:
|
|
8559
8579
|
case "end":
|
|
8560
|
-
return
|
|
8580
|
+
return _context2.stop();
|
|
8561
8581
|
}
|
|
8562
|
-
},
|
|
8582
|
+
}, _callee2, null, [[9, 46, 50, 53]]);
|
|
8563
8583
|
}));
|
|
8564
8584
|
return function handleBook() {
|
|
8565
|
-
return
|
|
8585
|
+
return _ref4.apply(this, arguments);
|
|
8566
8586
|
};
|
|
8567
8587
|
}();
|
|
8568
8588
|
var updateTickets = function updateTickets(isUpdatingCode, type) {
|
|
8569
8589
|
getTicketsApi(isUpdatingCode, type);
|
|
8570
8590
|
};
|
|
8571
8591
|
var fetchUserData = /*#__PURE__*/function () {
|
|
8572
|
-
var
|
|
8592
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
8573
8593
|
var userDataResponse, profileData, profileDataObj;
|
|
8574
|
-
return _regeneratorRuntime().wrap(function
|
|
8575
|
-
while (1) switch (
|
|
8594
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
8595
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
8576
8596
|
case 0:
|
|
8577
|
-
|
|
8597
|
+
_context3.next = 2;
|
|
8578
8598
|
return getProfileData();
|
|
8579
8599
|
case 2:
|
|
8580
|
-
userDataResponse =
|
|
8600
|
+
userDataResponse = _context3.sent;
|
|
8581
8601
|
profileData = _get(userDataResponse, 'data');
|
|
8582
8602
|
profileDataObj = setLoggedUserData(profileData);
|
|
8583
|
-
return
|
|
8603
|
+
return _context3.abrupt("return", profileDataObj);
|
|
8584
8604
|
case 6:
|
|
8585
8605
|
case "end":
|
|
8586
|
-
return
|
|
8606
|
+
return _context3.stop();
|
|
8587
8607
|
}
|
|
8588
|
-
},
|
|
8608
|
+
}, _callee3);
|
|
8589
8609
|
}));
|
|
8590
8610
|
return function fetchUserData() {
|
|
8591
|
-
return
|
|
8611
|
+
return _ref5.apply(this, arguments);
|
|
8592
8612
|
};
|
|
8593
8613
|
}();
|
|
8594
8614
|
var isTicketOnSale = event != null && event.isTimeSlotEvent ? true : _some(tickets, function (item) {
|
|
@@ -13919,6 +13939,7 @@ exports.TicketsContainer = TicketsContainer;
|
|
|
13919
13939
|
exports.VERIFICATION_STATUSES = VERIFICATION_STATUSES;
|
|
13920
13940
|
exports.createFixedFloatNormalizer = createFixedFloatNormalizer;
|
|
13921
13941
|
exports.currencyNormalizerCreator = currencyNormalizerCreator;
|
|
13942
|
+
exports.logoutUser = logoutUser;
|
|
13922
13943
|
exports.setConfigs = setConfigs;
|
|
13923
13944
|
exports.useCookieListener = useCookieListener;
|
|
13924
13945
|
//# sourceMappingURL=tf-checkout-react.cjs.development.js.map
|