summit-registration-lite 6.0.9 → 7.0.0
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/.claude/rules/summit-registration-lite-component-props.md +95 -0
- package/.claude/rules/summit-registration-lite-payment-providers.md +69 -0
- package/.claude/rules/summit-registration-lite-project.md +80 -0
- package/.claude/rules/summit-registration-lite-redux-actions.md +65 -0
- package/.claude/rules/summit-registration-lite-testing.md +97 -0
- package/.claude/skills/summit-registration-lite-add-provider/SKILL.md +155 -0
- package/.claude/skills/summit-registration-lite-dev-setup/SKILL.md +67 -0
- package/.claude/skills/summit-registration-lite-publish/SKILL.md +64 -0
- package/.claude/skills/summit-registration-lite-scaffold-component/SKILL.md +152 -0
- package/dist/components/index.css +34 -0
- package/dist/components/index.css.map +1 -0
- package/dist/components/index.js +4907 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/registration-form.css +32 -0
- package/dist/components/registration-form.css.map +1 -0
- package/dist/components/registration-form.js +4726 -0
- package/dist/components/registration-form.js.map +1 -0
- package/dist/components/registration-modal.css +34 -0
- package/dist/components/registration-modal.css.map +1 -0
- package/dist/components/registration-modal.js +4870 -0
- package/dist/components/registration-modal.js.map +1 -0
- package/dist/index.css +2 -2
- package/dist/index.css.map +1 -1
- package/dist/index.js +4127 -3892
- package/dist/index.js.map +1 -1
- package/index.js +2 -0
- package/package.json +1 -1
- package/.cert/cert.pem +0 -26
- package/.cert/key.pem +0 -28
- package/ca.cer +0 -0
|
@@ -0,0 +1,4726 @@
|
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
+
module.exports = factory();
|
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
|
5
|
+
define("summit-registration-lite", [], factory);
|
|
6
|
+
else if(typeof exports === 'object')
|
|
7
|
+
exports["summit-registration-lite"] = factory();
|
|
8
|
+
else
|
|
9
|
+
root["summit-registration-lite"] = factory();
|
|
10
|
+
})(this, function() {
|
|
11
|
+
return /******/ (() => { // webpackBootstrap
|
|
12
|
+
/******/ var __webpack_modules__ = ({
|
|
13
|
+
|
|
14
|
+
/***/ 595:
|
|
15
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
16
|
+
|
|
17
|
+
"use strict";
|
|
18
|
+
|
|
19
|
+
// EXPORTS
|
|
20
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
21
|
+
"$i": () => (/* binding */ CHANGE_STEP),
|
|
22
|
+
"ZD": () => (/* binding */ CLEAR_CURRENT_PROMO_CODE),
|
|
23
|
+
"aZ": () => (/* binding */ CLEAR_MY_INVITATION),
|
|
24
|
+
"I9": () => (/* binding */ CLEAR_RESERVATION),
|
|
25
|
+
"t$": () => (/* binding */ CLEAR_WIDGET_STATE),
|
|
26
|
+
"rr": () => (/* binding */ CREATE_RESERVATION_SUCCESS),
|
|
27
|
+
"bz": () => (/* binding */ DELETE_RESERVATION_SUCCESS),
|
|
28
|
+
"Cw": () => (/* binding */ GET_MY_INVITATION),
|
|
29
|
+
"bx": () => (/* binding */ GET_TAX_TYPES),
|
|
30
|
+
"HC": () => (/* binding */ GET_TICKET_TYPES),
|
|
31
|
+
"qY": () => (/* binding */ GO_TO_LOGIN),
|
|
32
|
+
"VY": () => (/* binding */ LOAD_INITIAL_VARS),
|
|
33
|
+
"_y": () => (/* binding */ LOAD_PROFILE_DATA),
|
|
34
|
+
"bf": () => (/* binding */ PAY_RESERVATION),
|
|
35
|
+
"nZ": () => (/* binding */ REQUESTED_TICKET_TYPES),
|
|
36
|
+
"GA": () => (/* binding */ SET_CURRENT_PROMO_CODE),
|
|
37
|
+
"Ol": () => (/* binding */ SET_PASSWORDLESS_ERROR),
|
|
38
|
+
"qR": () => (/* binding */ SET_PASSWORDLESS_LOGIN),
|
|
39
|
+
"Nh": () => (/* binding */ SET_PASSWORDLESS_SETTINGS),
|
|
40
|
+
"Vx": () => (/* binding */ START_WIDGET_LOADING),
|
|
41
|
+
"sC": () => (/* binding */ STOP_WIDGET_LOADING),
|
|
42
|
+
"VH": () => (/* binding */ UPDATE_CLOCK),
|
|
43
|
+
"gs": () => (/* binding */ applyPromoCode),
|
|
44
|
+
"sz": () => (/* binding */ changeStep),
|
|
45
|
+
"YS": () => (/* binding */ clearWidgetState),
|
|
46
|
+
"aH": () => (/* binding */ getLoginCode),
|
|
47
|
+
"q1": () => (/* binding */ getMyInvitation),
|
|
48
|
+
"xu": () => (/* binding */ getTicketTypesAndTaxes),
|
|
49
|
+
"hh": () => (/* binding */ goToLogin),
|
|
50
|
+
"Qc": () => (/* binding */ isInPersonTicketType),
|
|
51
|
+
"Bi": () => (/* binding */ loadProfileData),
|
|
52
|
+
"dF": () => (/* binding */ loadSession),
|
|
53
|
+
"BT": () => (/* binding */ passwordlessLogin),
|
|
54
|
+
"qC": () => (/* binding */ payTicketWithProvider),
|
|
55
|
+
"$r": () => (/* binding */ removePromoCode),
|
|
56
|
+
"D2": () => (/* binding */ removeReservedTicket),
|
|
57
|
+
"cL": () => (/* binding */ reserveTicket),
|
|
58
|
+
"Bq": () => (/* binding */ startWidgetLoading),
|
|
59
|
+
"Rs": () => (/* binding */ stopWidgetLoading),
|
|
60
|
+
"ry": () => (/* binding */ updateClock),
|
|
61
|
+
"jn": () => (/* binding */ validatePromoCode)
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// UNUSED EXPORTS: CREATE_RESERVATION, CREATE_RESERVATION_ERROR, DELETE_RESERVATION, DELETE_RESERVATION_ERROR, VALIDATE_PROMO_CODE
|
|
65
|
+
|
|
66
|
+
;// CONCATENATED MODULE: external "openstack-uicore-foundation/lib/utils/actions"
|
|
67
|
+
const actions_namespaceObject = require("openstack-uicore-foundation/lib/utils/actions");
|
|
68
|
+
// EXTERNAL MODULE: external "sweetalert2"
|
|
69
|
+
var external_sweetalert2_ = __webpack_require__(271);
|
|
70
|
+
var external_sweetalert2_default = /*#__PURE__*/__webpack_require__.n(external_sweetalert2_);
|
|
71
|
+
// EXTERNAL MODULE: ./src/utils/constants.js
|
|
72
|
+
var constants = __webpack_require__(243);
|
|
73
|
+
;// CONCATENATED MODULE: ./src/utils/payment-providers/lawpay-provider.js
|
|
74
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
class LawPayProvider {
|
|
81
|
+
constructor({
|
|
82
|
+
reservation,
|
|
83
|
+
summitId,
|
|
84
|
+
userProfile,
|
|
85
|
+
access_token,
|
|
86
|
+
apiBaseUrl,
|
|
87
|
+
dispatch: _dispatch
|
|
88
|
+
}) {
|
|
89
|
+
_defineProperty(this, "payTicket", ({
|
|
90
|
+
token = null
|
|
91
|
+
}) => async dispatch => {
|
|
92
|
+
// Pay using affinity lawpay
|
|
93
|
+
const errorHandler = (err, res) => (dispatch, state) => {
|
|
94
|
+
let code = err.status;
|
|
95
|
+
|
|
96
|
+
switch (code) {
|
|
97
|
+
case 404:
|
|
98
|
+
{
|
|
99
|
+
let msg = res.body.message;
|
|
100
|
+
external_sweetalert2_default().fire("Validation Error", msg, "warning");
|
|
101
|
+
}
|
|
102
|
+
break;
|
|
103
|
+
|
|
104
|
+
case 500:
|
|
105
|
+
{
|
|
106
|
+
let msg = res.body.message;
|
|
107
|
+
external_sweetalert2_default().fire("Validation Error", msg, "warning");
|
|
108
|
+
}
|
|
109
|
+
break;
|
|
110
|
+
|
|
111
|
+
default:
|
|
112
|
+
(0,actions_namespaceObject.authErrorHandler)(err, res)(dispatch, state);
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
let params = {
|
|
118
|
+
access_token: this.access_token,
|
|
119
|
+
expand: 'tickets,' + 'tickets.owner,' + 'tickets.owner.extra_questions,' + 'tickets.badge,' + 'tickets.badge.type,' + 'tickets.badge.type.access_levels,' + 'tickets.badge.type.features,' + 'tickets.ticket_type,' + 'tickets.ticket_type.taxes'
|
|
120
|
+
};
|
|
121
|
+
let normalizedEntity = {
|
|
122
|
+
billing_address_1: token ? token.address1 : this.userProfile?.address1 || '',
|
|
123
|
+
billing_address_2: this.userProfile?.address2 || '',
|
|
124
|
+
billing_address_zip_code: token ? token.postal_code : this.userProfile?.postal_code || '',
|
|
125
|
+
billing_address_city: this.userProfile?.locality || '',
|
|
126
|
+
billing_address_state: this.userProfile?.region || '',
|
|
127
|
+
billing_address_country: this.userProfile?.country || ''
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
if (token) {
|
|
131
|
+
normalizedEntity['payment_method_id'] = token.id;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
this.dispatch(startWidgetLoading());
|
|
135
|
+
return (0,actions_namespaceObject.putRequest)(null, (0,actions_namespaceObject.createAction)(PAY_RESERVATION), `${this.apiBaseUrl}/api/v1/summits/${this.summitId}/orders/${this.reservation.hash}/checkout`, normalizedEntity, errorHandler // entity
|
|
136
|
+
)(params)(this.dispatch).then(payload => {
|
|
137
|
+
this.dispatch(stopWidgetLoading());
|
|
138
|
+
this.dispatch((0,actions_namespaceObject.createAction)(CLEAR_RESERVATION)({}));
|
|
139
|
+
this.dispatch(changeStep(constants.STEP_COMPLETE));
|
|
140
|
+
return payload;
|
|
141
|
+
}).catch(e => {
|
|
142
|
+
this.dispatch(removeReservedTicket());
|
|
143
|
+
this.dispatch(changeStep(constants.STEP_PERSONAL_INFO));
|
|
144
|
+
this.dispatch(stopWidgetLoading());
|
|
145
|
+
return e;
|
|
146
|
+
}); // The payment has succeeded. Display a success message.
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
this.reservation = reservation;
|
|
150
|
+
this.summitId = summitId;
|
|
151
|
+
this.userProfile = userProfile;
|
|
152
|
+
this.access_token = access_token;
|
|
153
|
+
this.apiBaseUrl = apiBaseUrl;
|
|
154
|
+
this.dispatch = _dispatch;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
}
|
|
158
|
+
// EXTERNAL MODULE: ./src/utils/utils.js + 1 modules
|
|
159
|
+
var utils = __webpack_require__(452);
|
|
160
|
+
;// CONCATENATED MODULE: ./src/utils/payment-providers/stripe-provider.js
|
|
161
|
+
function stripe_provider_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
class StripeProvider {
|
|
169
|
+
constructor({
|
|
170
|
+
reservation,
|
|
171
|
+
summitId,
|
|
172
|
+
userProfile,
|
|
173
|
+
access_token,
|
|
174
|
+
apiBaseUrl,
|
|
175
|
+
dispatch: _dispatch
|
|
176
|
+
}) {
|
|
177
|
+
stripe_provider_defineProperty(this, "payTicket", ({
|
|
178
|
+
elements = null,
|
|
179
|
+
paymentMethod = null,
|
|
180
|
+
stripe = null,
|
|
181
|
+
stripeReturnUrl = "",
|
|
182
|
+
onError = () => {}
|
|
183
|
+
}) => async dispatch => {
|
|
184
|
+
const errorHandler = (err, res) => (dispatch, state) => {
|
|
185
|
+
let code = err.status;
|
|
186
|
+
|
|
187
|
+
switch (code) {
|
|
188
|
+
case 404:
|
|
189
|
+
{
|
|
190
|
+
let msg = res.body.message;
|
|
191
|
+
onError({
|
|
192
|
+
type: constants.ERROR_TYPE_VALIDATION,
|
|
193
|
+
msg: msg,
|
|
194
|
+
exception: null
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
break;
|
|
198
|
+
|
|
199
|
+
case 500:
|
|
200
|
+
{
|
|
201
|
+
let msg = res.body.message;
|
|
202
|
+
onError({
|
|
203
|
+
type: constants.ERROR_TYPE_ERROR,
|
|
204
|
+
msg: msg,
|
|
205
|
+
exception: null
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
break;
|
|
209
|
+
|
|
210
|
+
default:
|
|
211
|
+
(0,actions_namespaceObject.authErrorHandler)(err, res)(dispatch, state);
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
|
|
216
|
+
let params = {
|
|
217
|
+
access_token: this.access_token,
|
|
218
|
+
expand: 'tickets,' + 'tickets.owner,' + 'tickets.owner.extra_questions,' + 'tickets.badge,' + 'tickets.badge.type,' + 'tickets.badge.type.access_levels,' + 'tickets.badge.type.features,' + 'tickets.ticket_type,' + 'tickets.ticket_type.taxes'
|
|
219
|
+
};
|
|
220
|
+
let normalizedEntity = {
|
|
221
|
+
billing_address_1: this.userProfile?.address1 || '',
|
|
222
|
+
billing_address_2: this.userProfile?.address2 || '',
|
|
223
|
+
billing_address_city: this.userProfile?.locality || '',
|
|
224
|
+
billing_address_state: this.userProfile?.region || '',
|
|
225
|
+
billing_address_country: this.userProfile?.country || ''
|
|
226
|
+
};
|
|
227
|
+
dispatch(startWidgetLoading());
|
|
228
|
+
|
|
229
|
+
if ((0,utils/* isFreeOrder */.yk)(this.reservation) || (0,utils/* isPrePaidOrder */.xm)(this.reservation)) {
|
|
230
|
+
return (0,actions_namespaceObject.putRequest)(null, (0,actions_namespaceObject.createAction)(PAY_RESERVATION), `${this.apiBaseUrl}/api/v1/summits/${this.summitId}/orders/${this.reservation.hash}/checkout`, normalizedEntity, errorHandler // entity
|
|
231
|
+
)(params)(this.dispatch).then(payload => {
|
|
232
|
+
this.dispatch(stopWidgetLoading());
|
|
233
|
+
this.dispatch((0,actions_namespaceObject.createAction)(CLEAR_RESERVATION)({}));
|
|
234
|
+
this.dispatch(changeStep(constants.STEP_COMPLETE));
|
|
235
|
+
return payload;
|
|
236
|
+
}).catch(e => {
|
|
237
|
+
console.log("StripeProvider::payTicket", e);
|
|
238
|
+
this.dispatch(removeReservedTicket());
|
|
239
|
+
this.dispatch(changeStep(constants.STEP_PERSONAL_INFO));
|
|
240
|
+
this.dispatch(stopWidgetLoading());
|
|
241
|
+
onError({
|
|
242
|
+
type: constants.ERROR_TYPE_ERROR,
|
|
243
|
+
msg: e?.message,
|
|
244
|
+
exception: e
|
|
245
|
+
});
|
|
246
|
+
return e;
|
|
247
|
+
}); // The payment has succeeded. Display a success message.
|
|
248
|
+
} // regular flow
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
stripe.confirmPayment({
|
|
252
|
+
elements,
|
|
253
|
+
clientSecret: this.reservation.payment_gateway_client_token,
|
|
254
|
+
confirmParams: {
|
|
255
|
+
return_url: stripeReturnUrl,
|
|
256
|
+
payment_method: paymentMethod.id
|
|
257
|
+
},
|
|
258
|
+
redirect: "if_required"
|
|
259
|
+
}).then(result => {
|
|
260
|
+
// error from card payment, paymentIntent from alternative payments
|
|
261
|
+
if (result.error || result.paymentIntent?.last_payment_error) {
|
|
262
|
+
// Reserve error.message in your UI.
|
|
263
|
+
const errorMsg = result.error?.message || result.paymentIntent?.last_payment_error?.message;
|
|
264
|
+
onError({
|
|
265
|
+
type: constants.ERROR_TYPE_PAYMENT,
|
|
266
|
+
msg: errorMsg,
|
|
267
|
+
exception: result
|
|
268
|
+
});
|
|
269
|
+
this.dispatch(changeStep(constants.STEP_PERSONAL_INFO));
|
|
270
|
+
this.dispatch(removeReservedTicket());
|
|
271
|
+
this.dispatch(stopWidgetLoading());
|
|
272
|
+
} else {
|
|
273
|
+
return (0,actions_namespaceObject.putRequest)(null, (0,actions_namespaceObject.createAction)(PAY_RESERVATION), `${this.apiBaseUrl}/api/v1/summits/${this.summitId}/orders/${this.reservation.hash}/checkout`, normalizedEntity, onError // entity
|
|
274
|
+
)(params)(this.dispatch).then(payload => {
|
|
275
|
+
this.dispatch(stopWidgetLoading());
|
|
276
|
+
this.dispatch((0,actions_namespaceObject.createAction)(CLEAR_RESERVATION)({}));
|
|
277
|
+
this.dispatch(changeStep(constants.STEP_COMPLETE));
|
|
278
|
+
return payload;
|
|
279
|
+
}).catch(e => {
|
|
280
|
+
this.dispatch(stopWidgetLoading());
|
|
281
|
+
console.log("StripeProvider::payTicket", e);
|
|
282
|
+
onError({
|
|
283
|
+
type: constants.ERROR_TYPE_ERROR,
|
|
284
|
+
msg: e?.message,
|
|
285
|
+
exception: e
|
|
286
|
+
});
|
|
287
|
+
return e;
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
}).catch(e => {
|
|
291
|
+
console.log("StripeProvider::payTicket", e);
|
|
292
|
+
this.dispatch(removeReservedTicket());
|
|
293
|
+
this.dispatch(changeStep(constants.STEP_PERSONAL_INFO));
|
|
294
|
+
this.dispatch(stopWidgetLoading());
|
|
295
|
+
onError({
|
|
296
|
+
type: constants.ERROR_TYPE_ERROR,
|
|
297
|
+
msg: e?.message,
|
|
298
|
+
exception: e
|
|
299
|
+
});
|
|
300
|
+
return e;
|
|
301
|
+
});
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
this.reservation = reservation;
|
|
305
|
+
this.summitId = summitId;
|
|
306
|
+
this.userProfile = userProfile;
|
|
307
|
+
this.access_token = access_token;
|
|
308
|
+
this.apiBaseUrl = apiBaseUrl;
|
|
309
|
+
this.dispatch = _dispatch;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
}
|
|
313
|
+
;// CONCATENATED MODULE: ./src/utils/payment-providers/payment-provider-factory.js
|
|
314
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
315
|
+
|
|
316
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { payment_provider_factory_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
317
|
+
|
|
318
|
+
function payment_provider_factory_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
319
|
+
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
class PaymentProviderFactory {}
|
|
324
|
+
|
|
325
|
+
payment_provider_factory_defineProperty(PaymentProviderFactory, "build", (provider, params = {}) => {
|
|
326
|
+
let currentProvider = null;
|
|
327
|
+
|
|
328
|
+
switch (provider) {
|
|
329
|
+
case constants.PAYMENT_PROVIDER_LAWPAY:
|
|
330
|
+
{
|
|
331
|
+
currentProvider = new LawPayProvider(_objectSpread({}, params));
|
|
332
|
+
break;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
case constants.PAYMENT_PROVIDER_STRIPE:
|
|
336
|
+
{
|
|
337
|
+
currentProvider = new StripeProvider(_objectSpread({}, params));
|
|
338
|
+
break;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
return currentProvider;
|
|
343
|
+
});
|
|
344
|
+
;// CONCATENATED MODULE: external "urijs"
|
|
345
|
+
const external_urijs_namespaceObject = require("urijs");
|
|
346
|
+
var external_urijs_default = /*#__PURE__*/__webpack_require__.n(external_urijs_namespaceObject);
|
|
347
|
+
;// CONCATENATED MODULE: ./src/actions.js
|
|
348
|
+
function actions_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
349
|
+
|
|
350
|
+
function actions_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? actions_ownKeys(Object(source), !0).forEach(function (key) { actions_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : actions_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
351
|
+
|
|
352
|
+
function actions_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Copyright 2020 OpenStack Foundation
|
|
356
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
357
|
+
* you may not use this file except in compliance with the License.
|
|
358
|
+
* You may obtain a copy of the License at
|
|
359
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
360
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
361
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
362
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
363
|
+
* See the License for the specific language governing permissions and
|
|
364
|
+
* limitations under the License.
|
|
365
|
+
**/
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
const START_WIDGET_LOADING = 'START_WIDGET_LOADING';
|
|
374
|
+
const STOP_WIDGET_LOADING = 'STOP_WIDGET_LOADING';
|
|
375
|
+
const LOAD_INITIAL_VARS = 'LOAD_INITIAL_VARS';
|
|
376
|
+
const CHANGE_STEP = 'CHANGE_STEP';
|
|
377
|
+
const REQUESTED_TICKET_TYPES = 'REQUESTED_TICKET_TYPES';
|
|
378
|
+
const GET_TICKET_TYPES = 'GET_TICKET_TYPES';
|
|
379
|
+
const GET_TAX_TYPES = 'GET_TAX_TYPES';
|
|
380
|
+
const CREATE_RESERVATION = 'CREATE_RESERVATION';
|
|
381
|
+
const CREATE_RESERVATION_SUCCESS = 'CREATE_RESERVATION_SUCCESS';
|
|
382
|
+
const CREATE_RESERVATION_ERROR = 'CREATE_RESERVATION_ERROR';
|
|
383
|
+
const DELETE_RESERVATION = 'DELETE_RESERVATION';
|
|
384
|
+
const DELETE_RESERVATION_SUCCESS = 'DELETE_RESERVATION_SUCCESS';
|
|
385
|
+
const DELETE_RESERVATION_ERROR = 'DELETE_RESERVATION_ERROR';
|
|
386
|
+
const PAY_RESERVATION = 'PAY_RESERVATION';
|
|
387
|
+
const CLEAR_RESERVATION = 'CLEAR_RESERVATION';
|
|
388
|
+
const SET_PASSWORDLESS_LOGIN = 'SET_PASSWORDLESS_LOGIN';
|
|
389
|
+
const SET_PASSWORDLESS_SETTINGS = 'SET_PASSWORDLESS_SETTINGS';
|
|
390
|
+
const SET_PASSWORDLESS_ERROR = 'SET_PASSWORDLESS_ERROR';
|
|
391
|
+
const GO_TO_LOGIN = 'GO_TO_LOGIN';
|
|
392
|
+
const GET_MY_INVITATION = 'GET_MY_INVITATION';
|
|
393
|
+
const CLEAR_MY_INVITATION = 'CLEAR_MY_INVITATION';
|
|
394
|
+
const CLEAR_WIDGET_STATE = 'CLEAR_WIDGET_STATE';
|
|
395
|
+
const UPDATE_CLOCK = 'UPDATE_CLOCK';
|
|
396
|
+
const LOAD_PROFILE_DATA = 'LOAD_PROFILE_DATA';
|
|
397
|
+
const SET_CURRENT_PROMO_CODE = 'SET_CURRENT_PROMO_CODE';
|
|
398
|
+
const CLEAR_CURRENT_PROMO_CODE = 'CLEAR_CURRENT_PROMO_CODE';
|
|
399
|
+
const VALIDATE_PROMO_CODE = 'VALIDATE_PROMO_CODE';
|
|
400
|
+
const startWidgetLoading = (0,actions_namespaceObject.createAction)(START_WIDGET_LOADING);
|
|
401
|
+
const stopWidgetLoading = (0,actions_namespaceObject.createAction)(STOP_WIDGET_LOADING);
|
|
402
|
+
const loadSession = settings => dispatch => {
|
|
403
|
+
dispatch((0,actions_namespaceObject.createAction)(LOAD_INITIAL_VARS)(settings));
|
|
404
|
+
};
|
|
405
|
+
const loadProfileData = profileData => dispatch => {
|
|
406
|
+
dispatch((0,actions_namespaceObject.createAction)(LOAD_PROFILE_DATA)(profileData));
|
|
407
|
+
};
|
|
408
|
+
const clearWidgetState = () => dispatch => {
|
|
409
|
+
dispatch((0,actions_namespaceObject.createAction)(CLEAR_WIDGET_STATE)({}));
|
|
410
|
+
};
|
|
411
|
+
|
|
412
|
+
const customErrorHandler = (err, res) => (dispatch, state) => {
|
|
413
|
+
if (err.timeout) {
|
|
414
|
+
return err;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
if (res && res.statusCode === 404) {
|
|
418
|
+
return err;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
if (res && res.statusCode === 500) {
|
|
422
|
+
return err;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
return (0,actions_namespaceObject.authErrorHandler)(err, res)(dispatch, state);
|
|
426
|
+
};
|
|
427
|
+
/*********************************************************************************/
|
|
428
|
+
|
|
429
|
+
/* TICKETS */
|
|
430
|
+
|
|
431
|
+
/*********************************************************************************/
|
|
432
|
+
// api/v1/summits/{id}/ticket-types/allowed
|
|
433
|
+
// api/v1/summits/{id}/tax-types
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
const getTicketTypesAndTaxes = summitId => async dispatch => {
|
|
437
|
+
return Promise.all([dispatch(getTicketTypes(summitId)), dispatch(getTaxesTypes(summitId))]).then(values => {
|
|
438
|
+
return values;
|
|
439
|
+
}).catch(err => {
|
|
440
|
+
console.log(err);
|
|
441
|
+
return Promise.reject(err);
|
|
442
|
+
});
|
|
443
|
+
};
|
|
444
|
+
/**
|
|
445
|
+
* @param summitId
|
|
446
|
+
* @returns {(function(*, *, {apiBaseUrl: *, getAccessToken: *}): Promise<*|undefined>)|*}
|
|
447
|
+
*/
|
|
448
|
+
|
|
449
|
+
const getTicketTypes = summitId => async (dispatch, getState, {
|
|
450
|
+
apiBaseUrl,
|
|
451
|
+
getAccessToken
|
|
452
|
+
}) => {
|
|
453
|
+
try {
|
|
454
|
+
const accessToken = await getAccessToken(); // try to get the current promo code
|
|
455
|
+
|
|
456
|
+
const {
|
|
457
|
+
registrationLiteState: {
|
|
458
|
+
promoCode: currentPromoCode
|
|
459
|
+
}
|
|
460
|
+
} = getState();
|
|
461
|
+
let params = {
|
|
462
|
+
expand: 'badge_type,badge_type.access_levels,badge_type.badge_features',
|
|
463
|
+
access_token: accessToken
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
if (currentPromoCode !== '') {
|
|
467
|
+
console.log(`getTicketTypes current promo code is ${currentPromoCode}`);
|
|
468
|
+
params['filter'] = `promo_code==${currentPromoCode}`;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
return (0,actions_namespaceObject.getRequest)((0,actions_namespaceObject.createAction)(REQUESTED_TICKET_TYPES), (0,actions_namespaceObject.createAction)(GET_TICKET_TYPES), `${apiBaseUrl}/api/v1/summits/${summitId}/ticket-types/allowed`, customErrorHandler)(params)(dispatch).then(res => {
|
|
472
|
+
return res;
|
|
473
|
+
}).catch(error => {
|
|
474
|
+
return Promise.reject(error);
|
|
475
|
+
});
|
|
476
|
+
} catch (e) {
|
|
477
|
+
console.log(e);
|
|
478
|
+
return Promise.reject(e);
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
/**
|
|
482
|
+
* @param summitId
|
|
483
|
+
* @returns {(function(*, *, {apiBaseUrl: *, getAccessToken: *}): Promise<*|undefined>)|*}
|
|
484
|
+
*/
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
const getTaxesTypes = summitId => async (dispatch, getState, {
|
|
488
|
+
apiBaseUrl,
|
|
489
|
+
getAccessToken
|
|
490
|
+
}) => {
|
|
491
|
+
try {
|
|
492
|
+
const accessToken = await getAccessToken();
|
|
493
|
+
let params = {
|
|
494
|
+
access_token: accessToken
|
|
495
|
+
};
|
|
496
|
+
return (0,actions_namespaceObject.getRequest)(null, (0,actions_namespaceObject.createAction)(GET_TAX_TYPES), `${apiBaseUrl}/api/v1/summits/${summitId}/tax-types`, customErrorHandler)(params)(dispatch).then(res => {
|
|
497
|
+
return res;
|
|
498
|
+
}).catch(error => {
|
|
499
|
+
return Promise.reject(error);
|
|
500
|
+
});
|
|
501
|
+
} catch (e) {
|
|
502
|
+
console.log(e);
|
|
503
|
+
return Promise.reject(e);
|
|
504
|
+
}
|
|
505
|
+
};
|
|
506
|
+
|
|
507
|
+
const applyPromoCode = currentPromoCode => (dispatch, getState) => {
|
|
508
|
+
try {
|
|
509
|
+
const {
|
|
510
|
+
registrationLiteState: {
|
|
511
|
+
settings: {
|
|
512
|
+
summitId
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
} = getState(); // set the current promo code and get ticket types again
|
|
516
|
+
|
|
517
|
+
dispatch((0,actions_namespaceObject.createAction)(SET_CURRENT_PROMO_CODE)({
|
|
518
|
+
currentPromoCode
|
|
519
|
+
}));
|
|
520
|
+
dispatch(getTicketTypes(summitId));
|
|
521
|
+
} catch (e) {
|
|
522
|
+
return Promise.reject(e);
|
|
523
|
+
}
|
|
524
|
+
};
|
|
525
|
+
const removePromoCode = () => (dispatch, getState) => {
|
|
526
|
+
try {
|
|
527
|
+
const {
|
|
528
|
+
registrationLiteState: {
|
|
529
|
+
settings: {
|
|
530
|
+
summitId
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
} = getState(); // clear the promo code and get the ticket types again
|
|
534
|
+
|
|
535
|
+
dispatch((0,actions_namespaceObject.createAction)(CLEAR_CURRENT_PROMO_CODE)({}));
|
|
536
|
+
dispatch(getTicketTypes(summitId));
|
|
537
|
+
} catch (e) {
|
|
538
|
+
dispatch((0,actions_namespaceObject.createAction)(CLEAR_CURRENT_PROMO_CODE)({}));
|
|
539
|
+
return Promise.reject(e);
|
|
540
|
+
}
|
|
541
|
+
};
|
|
542
|
+
const validatePromoCode = (ticketData, {
|
|
543
|
+
onError
|
|
544
|
+
}) => async (dispatch, getState, {
|
|
545
|
+
apiBaseUrl,
|
|
546
|
+
getAccessToken
|
|
547
|
+
}) => {
|
|
548
|
+
const {
|
|
549
|
+
registrationLiteState: {
|
|
550
|
+
settings: {
|
|
551
|
+
summitId
|
|
552
|
+
},
|
|
553
|
+
promoCode: currentPromoCode
|
|
554
|
+
}
|
|
555
|
+
} = getState();
|
|
556
|
+
const {
|
|
557
|
+
promoCode: formPromoCode
|
|
558
|
+
} = ticketData;
|
|
559
|
+
|
|
560
|
+
if (formPromoCode && !currentPromoCode) {
|
|
561
|
+
const defaultMessage = `You entered a promo code but it hasn't been applied. Make sure to click the 'Apply' button or remove it before continuing.`;
|
|
562
|
+
const notAppliedCodeError = {
|
|
563
|
+
body: {
|
|
564
|
+
errors: [defaultMessage]
|
|
565
|
+
}
|
|
566
|
+
};
|
|
567
|
+
return onError(null, notAppliedCodeError);
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
if (summitId && currentPromoCode) {
|
|
571
|
+
dispatch(startWidgetLoading());
|
|
572
|
+
const {
|
|
573
|
+
ticketQuantity,
|
|
574
|
+
id,
|
|
575
|
+
sub_type
|
|
576
|
+
} = ticketData;
|
|
577
|
+
const access_token = await getAccessToken();
|
|
578
|
+
let apiUrl = external_urijs_default()(`${apiBaseUrl}/api/v1/summits/${summitId}/promo-codes/${currentPromoCode}/apply`);
|
|
579
|
+
apiUrl.addQuery('access_token', access_token);
|
|
580
|
+
apiUrl.addQuery('filter[]', `ticket_type_id==${id}`);
|
|
581
|
+
apiUrl.addQuery('filter[]', `ticket_type_qty==${ticketQuantity}`);
|
|
582
|
+
apiUrl.addQuery('filter[]', `ticket_type_subtype==${sub_type}`);
|
|
583
|
+
|
|
584
|
+
const errorHandler = (err, res) => (dispatch, state) => {
|
|
585
|
+
if (res && res.statusCode === 404 && onError) return onError(err, res);
|
|
586
|
+
if (res && res.statusCode === 412 && onError) return onError(err, res);
|
|
587
|
+
if (res && res.statusCode === 429 && onError) return onError(err, res);
|
|
588
|
+
|
|
589
|
+
if (res && res.statusCode === 500) {
|
|
590
|
+
const defaultMessage = 'Server Error';
|
|
591
|
+
const msg = res?.body?.message || defaultMessage;
|
|
592
|
+
external_sweetalert2_default().fire("Server Error", msg, "error");
|
|
593
|
+
return;
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
return (0,actions_namespaceObject.authErrorHandler)(err, res)(dispatch, state);
|
|
597
|
+
};
|
|
598
|
+
|
|
599
|
+
return (0,actions_namespaceObject.getRequest)(null, (0,actions_namespaceObject.createAction)(VALIDATE_PROMO_CODE), `${apiUrl}`, errorHandler)({})(dispatch).then(res => {
|
|
600
|
+
dispatch(changeStep(constants.STEP_PERSONAL_INFO));
|
|
601
|
+
dispatch(stopWidgetLoading());
|
|
602
|
+
return res;
|
|
603
|
+
}).catch(error => {
|
|
604
|
+
dispatch(stopWidgetLoading());
|
|
605
|
+
return Promise.reject(error);
|
|
606
|
+
});
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
return dispatch(changeStep(constants.STEP_PERSONAL_INFO));
|
|
610
|
+
};
|
|
611
|
+
const reserveTicket = ({
|
|
612
|
+
provider,
|
|
613
|
+
personalInformation,
|
|
614
|
+
ticket,
|
|
615
|
+
ticketQuantity
|
|
616
|
+
}, {
|
|
617
|
+
onError
|
|
618
|
+
}) => async (dispatch, getState, {
|
|
619
|
+
apiBaseUrl,
|
|
620
|
+
getAccessToken
|
|
621
|
+
}) => {
|
|
622
|
+
try {
|
|
623
|
+
const {
|
|
624
|
+
registrationLiteState: {
|
|
625
|
+
settings: {
|
|
626
|
+
summitId
|
|
627
|
+
},
|
|
628
|
+
promoCode: currentPromoCode
|
|
629
|
+
}
|
|
630
|
+
} = getState();
|
|
631
|
+
let {
|
|
632
|
+
firstName,
|
|
633
|
+
lastName,
|
|
634
|
+
email,
|
|
635
|
+
company,
|
|
636
|
+
attendee
|
|
637
|
+
} = personalInformation;
|
|
638
|
+
dispatch(startWidgetLoading());
|
|
639
|
+
const access_token = await getAccessToken();
|
|
640
|
+
const tickets = [...Array(ticketQuantity)].map(() => ({
|
|
641
|
+
type_id: ticket.id,
|
|
642
|
+
promo_code: currentPromoCode || null
|
|
643
|
+
}));
|
|
644
|
+
|
|
645
|
+
if (tickets.length === 1 && attendee) {
|
|
646
|
+
tickets[0].attendee_first_name = attendee.firstName;
|
|
647
|
+
tickets[0].attendee_last_name = attendee.lastName;
|
|
648
|
+
tickets[0].attendee_email = attendee.email;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
let params = {
|
|
652
|
+
access_token,
|
|
653
|
+
fields: "owner_first_name,owner_last_name,owner_email,owner_company,summit_id,id,currency,amount_in_cents,amount,raw_amount_in_cents,discount_amount,discount_amount_in_cents,hash,payment_gateway_client_token,status,payment_method,promo_code,taxes_amount,applied_taxes.id,applied_taxes.name,applied_taxes.amount,tickets.id,tickets.ticket_type_id",
|
|
654
|
+
relations: "tickets,tickets.none,applied_taxes",
|
|
655
|
+
expand: 'tickets,applied_taxes'
|
|
656
|
+
};
|
|
657
|
+
const normalizedEntity = normalizeReservation({
|
|
658
|
+
owner_email: email,
|
|
659
|
+
owner_first_name: firstName,
|
|
660
|
+
owner_last_name: lastName,
|
|
661
|
+
owner_company: company,
|
|
662
|
+
tickets
|
|
663
|
+
});
|
|
664
|
+
|
|
665
|
+
const errorHandler = (err, res) => (dispatch, state) => {
|
|
666
|
+
if (res && res.statusCode === 412 && onError) return onError(err, res);
|
|
667
|
+
|
|
668
|
+
if (res && res.statusCode === 404) {
|
|
669
|
+
const defaultMessage = 'Validation Error';
|
|
670
|
+
const msg = res?.body?.message || defaultMessage;
|
|
671
|
+
external_sweetalert2_default().fire("Validation Error", msg, "warning");
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
if (res && res.statusCode === 500) {
|
|
676
|
+
const defaultMessage = 'Server Error';
|
|
677
|
+
const msg = res?.body?.message || defaultMessage;
|
|
678
|
+
external_sweetalert2_default().fire("Server Error", msg, "error");
|
|
679
|
+
return;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
return (0,actions_namespaceObject.authErrorHandler)(err, res)(dispatch, state);
|
|
683
|
+
};
|
|
684
|
+
|
|
685
|
+
return (0,actions_namespaceObject.postRequest)((0,actions_namespaceObject.createAction)(CREATE_RESERVATION), (0,actions_namespaceObject.createAction)(CREATE_RESERVATION_SUCCESS), `${apiBaseUrl}/api/v1/summits/${summitId}/orders/reserve`, normalizedEntity, errorHandler // entity
|
|
686
|
+
)(params)(dispatch).then(payload => {
|
|
687
|
+
let {
|
|
688
|
+
response: reservation
|
|
689
|
+
} = payload;
|
|
690
|
+
dispatch(stopWidgetLoading());
|
|
691
|
+
reservation.promo_code = currentPromoCode || null;
|
|
692
|
+
|
|
693
|
+
if ((0,utils/* isFreeOrder */.yk)(reservation) || (0,utils/* isPrePaidOrder */.xm)(reservation)) {
|
|
694
|
+
dispatch(payTicketWithProvider(provider));
|
|
695
|
+
return payload;
|
|
696
|
+
} // we need to pay the reservation ...
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
dispatch(changeStep(constants.STEP_PAYMENT));
|
|
700
|
+
return payload;
|
|
701
|
+
}).catch(e => {
|
|
702
|
+
dispatch((0,actions_namespaceObject.createAction)(CREATE_RESERVATION_ERROR)(e));
|
|
703
|
+
dispatch(stopWidgetLoading());
|
|
704
|
+
return Promise.reject(e);
|
|
705
|
+
});
|
|
706
|
+
} catch (e) {
|
|
707
|
+
dispatch((0,actions_namespaceObject.createAction)(CREATE_RESERVATION_ERROR)(e));
|
|
708
|
+
dispatch(stopWidgetLoading());
|
|
709
|
+
return Promise.reject(e);
|
|
710
|
+
}
|
|
711
|
+
};
|
|
712
|
+
const removeReservedTicket = () => async (dispatch, getState, {
|
|
713
|
+
apiBaseUrl,
|
|
714
|
+
getAccessToken
|
|
715
|
+
}) => {
|
|
716
|
+
try {
|
|
717
|
+
let {
|
|
718
|
+
registrationLiteState: {
|
|
719
|
+
settings: {
|
|
720
|
+
summitId
|
|
721
|
+
},
|
|
722
|
+
reservation: {
|
|
723
|
+
hash
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
} = getState();
|
|
727
|
+
const access_token = await getAccessToken();
|
|
728
|
+
let params = {
|
|
729
|
+
access_token,
|
|
730
|
+
expand: 'tickets,tickets.owner'
|
|
731
|
+
};
|
|
732
|
+
dispatch(startWidgetLoading());
|
|
733
|
+
return (0,actions_namespaceObject.deleteRequest)((0,actions_namespaceObject.createAction)(DELETE_RESERVATION), (0,actions_namespaceObject.createAction)(DELETE_RESERVATION_SUCCESS), `${apiBaseUrl}/api/v1/summits/${summitId}/orders/${hash}`, {}, actions_namespaceObject.authErrorHandler // entity
|
|
734
|
+
)(params)(dispatch).then(payload => {
|
|
735
|
+
dispatch(stopWidgetLoading());
|
|
736
|
+
dispatch(changeStep(constants.STEP_PERSONAL_INFO));
|
|
737
|
+
return payload;
|
|
738
|
+
}).catch(e => {
|
|
739
|
+
dispatch((0,actions_namespaceObject.createAction)(DELETE_RESERVATION_ERROR)(e));
|
|
740
|
+
dispatch(changeStep(constants.STEP_PERSONAL_INFO));
|
|
741
|
+
dispatch(stopWidgetLoading());
|
|
742
|
+
return Promise.reject(e);
|
|
743
|
+
});
|
|
744
|
+
} catch (e) {
|
|
745
|
+
dispatch((0,actions_namespaceObject.createAction)(DELETE_RESERVATION_ERROR)(e));
|
|
746
|
+
dispatch(changeStep(constants.STEP_PERSONAL_INFO));
|
|
747
|
+
dispatch(stopWidgetLoading());
|
|
748
|
+
return Promise.reject(e);
|
|
749
|
+
}
|
|
750
|
+
};
|
|
751
|
+
const payTicketWithProvider = (provider, params = {}) => async (dispatch, getState, {
|
|
752
|
+
apiBaseUrl,
|
|
753
|
+
getAccessToken
|
|
754
|
+
}) => {
|
|
755
|
+
try {
|
|
756
|
+
let {
|
|
757
|
+
registrationLiteState: {
|
|
758
|
+
settings: {
|
|
759
|
+
summitId,
|
|
760
|
+
userProfile
|
|
761
|
+
},
|
|
762
|
+
reservation
|
|
763
|
+
}
|
|
764
|
+
} = getState();
|
|
765
|
+
const access_token = await getAccessToken();
|
|
766
|
+
dispatch(startWidgetLoading());
|
|
767
|
+
const currentProvider = PaymentProviderFactory.build(provider, {
|
|
768
|
+
reservation,
|
|
769
|
+
summitId,
|
|
770
|
+
userProfile,
|
|
771
|
+
access_token,
|
|
772
|
+
apiBaseUrl,
|
|
773
|
+
dispatch
|
|
774
|
+
});
|
|
775
|
+
return dispatch(currentProvider.payTicket(actions_objectSpread({}, params)));
|
|
776
|
+
} catch (e) {
|
|
777
|
+
dispatch(stopWidgetLoading());
|
|
778
|
+
return Promise.reject(e);
|
|
779
|
+
}
|
|
780
|
+
};
|
|
781
|
+
const changeStep = step => (dispatch, getState) => {
|
|
782
|
+
dispatch(startWidgetLoading());
|
|
783
|
+
dispatch((0,actions_namespaceObject.createAction)(CHANGE_STEP)(step));
|
|
784
|
+
dispatch(stopWidgetLoading());
|
|
785
|
+
};
|
|
786
|
+
const goToLogin = () => (dispatch, getState) => {
|
|
787
|
+
dispatch((0,actions_namespaceObject.createAction)(GO_TO_LOGIN)());
|
|
788
|
+
};
|
|
789
|
+
const getLoginCode = (email, getPasswordlessCode) => async (dispatch, getState) => {
|
|
790
|
+
dispatch((0,actions_namespaceObject.createAction)(SET_PASSWORDLESS_LOGIN)(email));
|
|
791
|
+
return new Promise((resolve, reject) => {
|
|
792
|
+
getPasswordlessCode(email).then(res => {
|
|
793
|
+
dispatch((0,actions_namespaceObject.createAction)(SET_PASSWORDLESS_SETTINGS)(res.response));
|
|
794
|
+
resolve(res);
|
|
795
|
+
}, err => {
|
|
796
|
+
const errorMessage = err.response?.body?.error || err.message;
|
|
797
|
+
reject(new Error(errorMessage));
|
|
798
|
+
});
|
|
799
|
+
});
|
|
800
|
+
};
|
|
801
|
+
const passwordlessLogin = (code, loginWithCode) => async (dispatch, getState) => {
|
|
802
|
+
const {
|
|
803
|
+
registrationLiteState: {
|
|
804
|
+
passwordless: {
|
|
805
|
+
email
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
} = getState();
|
|
809
|
+
return loginWithCode(code, email).then(res => {
|
|
810
|
+
return res;
|
|
811
|
+
}).catch(e => {
|
|
812
|
+
console.log(e);
|
|
813
|
+
dispatch((0,actions_namespaceObject.createAction)(SET_PASSWORDLESS_ERROR)());
|
|
814
|
+
});
|
|
815
|
+
};
|
|
816
|
+
const isInPersonTicketType = ticketType => {
|
|
817
|
+
/** check is the current order has or not IN_PERSON tickets types **/
|
|
818
|
+
if (ticketType.hasOwnProperty("badge_type")) {
|
|
819
|
+
let badgeType = ticketType.badge_type;
|
|
820
|
+
return badgeType.access_levels.some(al => {
|
|
821
|
+
return al.name == 'IN_PERSON';
|
|
822
|
+
});
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
return false;
|
|
826
|
+
};
|
|
827
|
+
|
|
828
|
+
const normalizeReservation = entity => {
|
|
829
|
+
const normalizedEntity = actions_objectSpread({}, entity);
|
|
830
|
+
|
|
831
|
+
if (!entity.owner_company.id) {
|
|
832
|
+
normalizedEntity['owner_company'] = entity.owner_company.name;
|
|
833
|
+
} else {
|
|
834
|
+
delete normalizedEntity['owner_company'];
|
|
835
|
+
normalizedEntity['owner_company_id'] = entity.owner_company.id;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
return normalizedEntity;
|
|
839
|
+
};
|
|
840
|
+
/**
|
|
841
|
+
*
|
|
842
|
+
* @param summitId
|
|
843
|
+
* @returns {(function(*=, *, {apiBaseUrl: *, getAccessToken: *}): Promise<*|undefined>)|*}
|
|
844
|
+
*/
|
|
845
|
+
|
|
846
|
+
|
|
847
|
+
const getMyInvitation = summitId => async (dispatch, getState, {
|
|
848
|
+
apiBaseUrl,
|
|
849
|
+
getAccessToken
|
|
850
|
+
}) => {
|
|
851
|
+
const errorHandler = (err, res) => (dispatch, state) => {
|
|
852
|
+
if (res && res.statusCode === 404) {
|
|
853
|
+
// bypass in case that does not exists invitation , fail silently
|
|
854
|
+
return;
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
if (res && res.statusCode === 403) {
|
|
858
|
+
// bypass in case that we dont have the proper scope
|
|
859
|
+
return;
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
if (res && res.statusCode === 500) {
|
|
863
|
+
const msg = res.body.message;
|
|
864
|
+
external_sweetalert2_default().fire("Server Error", msg, "error");
|
|
865
|
+
return;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
return (0,actions_namespaceObject.authErrorHandler)(err, res)(dispatch, state);
|
|
869
|
+
};
|
|
870
|
+
|
|
871
|
+
try {
|
|
872
|
+
const accessToken = await getAccessToken();
|
|
873
|
+
let params = {
|
|
874
|
+
access_token: accessToken
|
|
875
|
+
};
|
|
876
|
+
return (0,actions_namespaceObject.getRequest)(null, (0,actions_namespaceObject.createAction)(GET_MY_INVITATION), `${apiBaseUrl}/api/v1/summits/${summitId}/registration-invitations/me`, errorHandler)(params)(dispatch).catch(e => {
|
|
877
|
+
(0,actions_namespaceObject.createAction)(CLEAR_MY_INVITATION);
|
|
878
|
+
console.log(e);
|
|
879
|
+
});
|
|
880
|
+
} catch (e) {
|
|
881
|
+
return Promise.reject(e);
|
|
882
|
+
}
|
|
883
|
+
};
|
|
884
|
+
const updateClock = timestamp => dispatch => {
|
|
885
|
+
dispatch((0,actions_namespaceObject.createAction)(UPDATE_CLOCK)({
|
|
886
|
+
timestamp
|
|
887
|
+
}));
|
|
888
|
+
};
|
|
889
|
+
|
|
890
|
+
/***/ }),
|
|
891
|
+
|
|
892
|
+
/***/ 590:
|
|
893
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
894
|
+
|
|
895
|
+
"use strict";
|
|
896
|
+
|
|
897
|
+
// EXPORTS
|
|
898
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
899
|
+
"default": () => (/* binding */ login_passwordless)
|
|
900
|
+
});
|
|
901
|
+
|
|
902
|
+
// EXTERNAL MODULE: external "react"
|
|
903
|
+
var external_react_ = __webpack_require__(689);
|
|
904
|
+
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
905
|
+
// EXTERNAL MODULE: external "prop-types"
|
|
906
|
+
var external_prop_types_ = __webpack_require__(580);
|
|
907
|
+
var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
|
|
908
|
+
;// CONCATENATED MODULE: external "react-otp-input"
|
|
909
|
+
const external_react_otp_input_namespaceObject = require("react-otp-input");
|
|
910
|
+
var external_react_otp_input_default = /*#__PURE__*/__webpack_require__.n(external_react_otp_input_namespaceObject);
|
|
911
|
+
;// CONCATENATED MODULE: external "moment-timezone"
|
|
912
|
+
const external_moment_timezone_namespaceObject = require("moment-timezone");
|
|
913
|
+
var external_moment_timezone_default = /*#__PURE__*/__webpack_require__.n(external_moment_timezone_namespaceObject);
|
|
914
|
+
;// CONCATENATED MODULE: ./src/components/login-passwordless/index.module.scss
|
|
915
|
+
// extracted by mini-css-extract-plugin
|
|
916
|
+
/* harmony default export */ const index_module = ({"passwordlessWrapper":"passwordlessWrapper___BRQ_s","codeSent":"codeSent___NzYb_","innerWrapper":"innerWrapper___nRLDi","logo":"logo___qNVrv","logoDark":"logoDark___VVYee","digits":"digits___Vu5iy","codeInput":"codeInput___LnTZe","error":"error___wZflZ","verify":"verify___IBgMl","button":"button___nBhtQ","link":"link___f6fDT","resend":"resend___Nma1U","disabled":"disabled___fMnzY","logoLight":"logoLight___vSbn_"});
|
|
917
|
+
// EXTERNAL MODULE: ./src/assets/FNid_WHT_logo_rgb.svg
|
|
918
|
+
var FNid_WHT_logo_rgb = __webpack_require__(802);
|
|
919
|
+
var FNid_WHT_logo_rgb_default = /*#__PURE__*/__webpack_require__.n(FNid_WHT_logo_rgb);
|
|
920
|
+
// EXTERNAL MODULE: ./src/assets/FNid_BLK_logo_rgb.svg
|
|
921
|
+
var FNid_BLK_logo_rgb = __webpack_require__(107);
|
|
922
|
+
var FNid_BLK_logo_rgb_default = /*#__PURE__*/__webpack_require__.n(FNid_BLK_logo_rgb);
|
|
923
|
+
// EXTERNAL MODULE: ./src/utils/utils.js + 1 modules
|
|
924
|
+
var utils = __webpack_require__(452);
|
|
925
|
+
// EXTERNAL MODULE: ./src/utils/constants.js
|
|
926
|
+
var constants = __webpack_require__(243);
|
|
927
|
+
;// CONCATENATED MODULE: ./src/utils/hooks/useCountdown.js
|
|
928
|
+
|
|
929
|
+
|
|
930
|
+
const useCountdown = initialTime => {
|
|
931
|
+
const [countdown, setCountdown] = (0,external_react_.useState)(initialTime);
|
|
932
|
+
const intervalRef = (0,external_react_.useRef)(null);
|
|
933
|
+
|
|
934
|
+
const resetCountdown = newTime => {
|
|
935
|
+
const time = newTime !== undefined ? newTime : initialTime;
|
|
936
|
+
if (intervalRef.current) clearInterval(intervalRef.current);
|
|
937
|
+
setCountdown(time);
|
|
938
|
+
|
|
939
|
+
if (time > 0) {
|
|
940
|
+
intervalRef.current = setInterval(() => {
|
|
941
|
+
setCountdown(prevCountdown => {
|
|
942
|
+
if (prevCountdown <= 1) {
|
|
943
|
+
clearInterval(intervalRef.current);
|
|
944
|
+
return 0;
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
return prevCountdown - 1;
|
|
948
|
+
});
|
|
949
|
+
}, 1000);
|
|
950
|
+
}
|
|
951
|
+
};
|
|
952
|
+
|
|
953
|
+
(0,external_react_.useEffect)(() => {
|
|
954
|
+
// Initialize the countdown when the hook is first used
|
|
955
|
+
resetCountdown(initialTime);
|
|
956
|
+
return () => clearInterval(intervalRef.current);
|
|
957
|
+
}, [initialTime]);
|
|
958
|
+
return [countdown, resetCountdown];
|
|
959
|
+
};
|
|
960
|
+
|
|
961
|
+
/* harmony default export */ const hooks_useCountdown = (useCountdown);
|
|
962
|
+
;// CONCATENATED MODULE: ./src/components/login-passwordless/index.js
|
|
963
|
+
/**
|
|
964
|
+
* Copyright 2020 OpenStack Foundation
|
|
965
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
966
|
+
* you may not use this file except in compliance with the License.
|
|
967
|
+
* You may obtain a copy of the License at
|
|
968
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
969
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
970
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
971
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
972
|
+
* See the License for the specific language governing permissions and
|
|
973
|
+
* limitations under the License.
|
|
974
|
+
**/
|
|
975
|
+
|
|
976
|
+
|
|
977
|
+
|
|
978
|
+
|
|
979
|
+
|
|
980
|
+
|
|
981
|
+
|
|
982
|
+
|
|
983
|
+
|
|
984
|
+
|
|
985
|
+
|
|
986
|
+
const PasswordlessLoginComponent = ({
|
|
987
|
+
email,
|
|
988
|
+
codeLength,
|
|
989
|
+
codeLifeTime,
|
|
990
|
+
passwordlessLogin,
|
|
991
|
+
loginWithCode,
|
|
992
|
+
codeError,
|
|
993
|
+
goToLogin,
|
|
994
|
+
getLoginCode,
|
|
995
|
+
getPasswordlessCode,
|
|
996
|
+
idpLogoLight,
|
|
997
|
+
idpLogoDark,
|
|
998
|
+
idpLogoAlt
|
|
999
|
+
}) => {
|
|
1000
|
+
const [otpCode, setOtpCode] = (0,external_react_.useState)('');
|
|
1001
|
+
const [otpError, setOtpError] = (0,external_react_.useState)(false);
|
|
1002
|
+
const [codeSent, setCodeSent] = (0,external_react_.useState)(false);
|
|
1003
|
+
const [isLoading, setIsLoading] = (0,external_react_.useState)(false);
|
|
1004
|
+
const [resendCountdown, resetResendCountdown] = hooks_useCountdown(0);
|
|
1005
|
+
const [lifetimeCountdown, resetLifetimeCountdown] = hooks_useCountdown(0);
|
|
1006
|
+
(0,external_react_.useEffect)(() => {
|
|
1007
|
+
if (codeLifeTime > 0) {
|
|
1008
|
+
resetLifetimeCountdown(codeLifeTime);
|
|
1009
|
+
}
|
|
1010
|
+
}, [codeLifeTime]);
|
|
1011
|
+
|
|
1012
|
+
const tryPasswordlessLogin = code => {
|
|
1013
|
+
if (code.length === codeLength) {
|
|
1014
|
+
setOtpError(false);
|
|
1015
|
+
setIsLoading(true);
|
|
1016
|
+
passwordlessLogin(otpCode, loginWithCode).finally(() => setIsLoading(false));
|
|
1017
|
+
} else {
|
|
1018
|
+
setOtpError(true);
|
|
1019
|
+
}
|
|
1020
|
+
};
|
|
1021
|
+
|
|
1022
|
+
const resendCode = () => {
|
|
1023
|
+
getLoginCode(email, getPasswordlessCode).then(() => {
|
|
1024
|
+
setCodeSent(true);
|
|
1025
|
+
setTimeout(() => setCodeSent(false), 3000);
|
|
1026
|
+
resetResendCountdown(constants.RESEND_TIME);
|
|
1027
|
+
}).catch(err => {
|
|
1028
|
+
(0,utils/* handleSentryException */.Gj)(err);
|
|
1029
|
+
});
|
|
1030
|
+
};
|
|
1031
|
+
|
|
1032
|
+
const handleSubmit = e => {
|
|
1033
|
+
e.preventDefault();
|
|
1034
|
+
tryPasswordlessLogin(otpCode);
|
|
1035
|
+
};
|
|
1036
|
+
|
|
1037
|
+
const formatDuration = seconds => {
|
|
1038
|
+
const duration = external_moment_timezone_default().duration(seconds, 'seconds');
|
|
1039
|
+
return external_moment_timezone_default().utc(duration.asMilliseconds()).format('mm:ss');
|
|
1040
|
+
};
|
|
1041
|
+
|
|
1042
|
+
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
1043
|
+
className: `${index_module.passwordlessWrapper} step-wrapper`
|
|
1044
|
+
}, /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1045
|
+
className: `${index_module.innerWrapper}`
|
|
1046
|
+
}, /*#__PURE__*/external_react_default().createElement("img", {
|
|
1047
|
+
src: idpLogoDark || (FNid_BLK_logo_rgb_default()),
|
|
1048
|
+
alt: idpLogoAlt || "FNid",
|
|
1049
|
+
className: `${index_module.logo} ${index_module.logoDark}`
|
|
1050
|
+
}), /*#__PURE__*/external_react_default().createElement("img", {
|
|
1051
|
+
src: idpLogoLight || (FNid_WHT_logo_rgb_default()),
|
|
1052
|
+
alt: idpLogoAlt || "FNid",
|
|
1053
|
+
className: `${index_module.logo} ${index_module.logoLight}`
|
|
1054
|
+
}), /*#__PURE__*/external_react_default().createElement("span", null, "We sent your single-use code to ", /*#__PURE__*/external_react_default().createElement("br", null), /*#__PURE__*/external_react_default().createElement("span", {
|
|
1055
|
+
"data-testid": "email"
|
|
1056
|
+
}, email), /*#__PURE__*/external_react_default().createElement("br", null), /*#__PURE__*/external_react_default().createElement("span", {
|
|
1057
|
+
className: index_module.digits,
|
|
1058
|
+
"data-testid": "code-digits"
|
|
1059
|
+
}, "Add the ", codeLength, " digit code below")), /*#__PURE__*/external_react_default().createElement("div", {
|
|
1060
|
+
className: index_module.codeInput
|
|
1061
|
+
}, /*#__PURE__*/external_react_default().createElement("form", {
|
|
1062
|
+
onSubmit: handleSubmit
|
|
1063
|
+
}, /*#__PURE__*/external_react_default().createElement((external_react_otp_input_default()), {
|
|
1064
|
+
value: otpCode,
|
|
1065
|
+
onChange: code => setOtpCode(code),
|
|
1066
|
+
numInputs: codeLength,
|
|
1067
|
+
shouldAutoFocus: true,
|
|
1068
|
+
hasErrored: otpError || codeError,
|
|
1069
|
+
errorStyle: {
|
|
1070
|
+
border: '1px solid #e5424d'
|
|
1071
|
+
},
|
|
1072
|
+
"data-testid": "otp-input"
|
|
1073
|
+
}), /*#__PURE__*/external_react_default().createElement("button", {
|
|
1074
|
+
style: {
|
|
1075
|
+
display: 'none'
|
|
1076
|
+
},
|
|
1077
|
+
type: "submit"
|
|
1078
|
+
}))), codeError && /*#__PURE__*/external_react_default().createElement("span", {
|
|
1079
|
+
className: index_module.error,
|
|
1080
|
+
"data-testid": "error"
|
|
1081
|
+
}, "The code you entered it's incorrect. ", /*#__PURE__*/external_react_default().createElement("br", null), " Please try again."), codeSent && /*#__PURE__*/external_react_default().createElement("p", {
|
|
1082
|
+
className: index_module.codeSent
|
|
1083
|
+
}, "Code has been resent."), lifetimeCountdown > 0 && /*#__PURE__*/external_react_default().createElement("p", {
|
|
1084
|
+
className: index_module.codeSent
|
|
1085
|
+
}, "Code expires in ", formatDuration(lifetimeCountdown), " minutes."), /*#__PURE__*/external_react_default().createElement("div", {
|
|
1086
|
+
className: index_module.verify
|
|
1087
|
+
}, /*#__PURE__*/external_react_default().createElement("button", {
|
|
1088
|
+
className: `${index_module.button} button`,
|
|
1089
|
+
disabled: isLoading,
|
|
1090
|
+
onClick: () => tryPasswordlessLogin(otpCode),
|
|
1091
|
+
"data-testid": "verify"
|
|
1092
|
+
}, "Verify Email"), /*#__PURE__*/external_react_default().createElement("b", null, "or go back and ", /*#__PURE__*/external_react_default().createElement("span", {
|
|
1093
|
+
className: index_module.link,
|
|
1094
|
+
onClick: () => goToLogin(),
|
|
1095
|
+
"data-testid": "go-back"
|
|
1096
|
+
}, "try another way")))), /*#__PURE__*/external_react_default().createElement("div", {
|
|
1097
|
+
className: index_module.resend
|
|
1098
|
+
}, "Didn\u2019t receive it? Check your spam/junk folder, or\xA0", /*#__PURE__*/external_react_default().createElement("button", {
|
|
1099
|
+
className: `${index_module.link} ${resendCountdown > 0 ? index_module.disabled : ''}`,
|
|
1100
|
+
disabled: resendCountdown > 0,
|
|
1101
|
+
onClick: () => resendCode(),
|
|
1102
|
+
"data-testid": "resend"
|
|
1103
|
+
}, "resend code ", ' ', " ", resendCountdown > 0 && /*#__PURE__*/external_react_default().createElement("span", null, "(", resendCountdown, ")")), "\xA0now.")));
|
|
1104
|
+
};
|
|
1105
|
+
|
|
1106
|
+
PasswordlessLoginComponent.propTypes = {
|
|
1107
|
+
email: (external_prop_types_default()).string.isRequired,
|
|
1108
|
+
codeLength: (external_prop_types_default()).number.isRequired,
|
|
1109
|
+
codeLifeTime: (external_prop_types_default()).number.isRequired,
|
|
1110
|
+
passwordlessLogin: (external_prop_types_default()).func.isRequired,
|
|
1111
|
+
loginWithCode: (external_prop_types_default()).func,
|
|
1112
|
+
codeError: (external_prop_types_default()).bool,
|
|
1113
|
+
goToLogin: (external_prop_types_default()).func.isRequired,
|
|
1114
|
+
getLoginCode: (external_prop_types_default()).func.isRequired,
|
|
1115
|
+
getPasswordlessCode: (external_prop_types_default()).func,
|
|
1116
|
+
idpLogoLight: (external_prop_types_default()).string,
|
|
1117
|
+
idpLogoDark: (external_prop_types_default()).string,
|
|
1118
|
+
idpLogoAlt: (external_prop_types_default()).string
|
|
1119
|
+
};
|
|
1120
|
+
/* harmony default export */ const login_passwordless = (PasswordlessLoginComponent);
|
|
1121
|
+
|
|
1122
|
+
/***/ }),
|
|
1123
|
+
|
|
1124
|
+
/***/ 462:
|
|
1125
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1126
|
+
|
|
1127
|
+
"use strict";
|
|
1128
|
+
|
|
1129
|
+
// EXPORTS
|
|
1130
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
1131
|
+
"default": () => (/* binding */ login)
|
|
1132
|
+
});
|
|
1133
|
+
|
|
1134
|
+
// EXTERNAL MODULE: external "react"
|
|
1135
|
+
var external_react_ = __webpack_require__(689);
|
|
1136
|
+
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
1137
|
+
// EXTERNAL MODULE: external "prop-types"
|
|
1138
|
+
var external_prop_types_ = __webpack_require__(580);
|
|
1139
|
+
var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
|
|
1140
|
+
;// CONCATENATED MODULE: external "@mui/icons-material/EmailRounded"
|
|
1141
|
+
const EmailRounded_namespaceObject = require("@mui/icons-material/EmailRounded");
|
|
1142
|
+
var EmailRounded_default = /*#__PURE__*/__webpack_require__.n(EmailRounded_namespaceObject);
|
|
1143
|
+
// EXTERNAL MODULE: ./src/utils/utils.js + 1 modules
|
|
1144
|
+
var utils = __webpack_require__(452);
|
|
1145
|
+
;// CONCATENATED MODULE: ./src/components/login/index.module.scss
|
|
1146
|
+
// extracted by mini-css-extract-plugin
|
|
1147
|
+
/* harmony default export */ const index_module = ({"loginWrapper":"loginWrapper___sxUEn","innerWrapper":"innerWrapper___GQRkq","button":"button___QMZPu","title":"title___NnwWR","loginCode":"loginCode___dDBup","error":"error___aCF7E","primaryEmailButton":"primaryEmailButton___gH1fC","buttonDisabled":"buttonDisabled___T9tkn","pointerDisabled":"pointerDisabled___qt_HK","email_login_button":"email_login_button___seiLi","h2Styled":"h2Styled___rfIKD","input":"input___QR9sA"});
|
|
1148
|
+
;// CONCATENATED MODULE: ./src/components/login/index.js
|
|
1149
|
+
/**
|
|
1150
|
+
* Copyright 2020 OpenStack Foundation
|
|
1151
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1152
|
+
* you may not use this file except in compliance with the License.
|
|
1153
|
+
* You may obtain a copy of the License at
|
|
1154
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1155
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1156
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1157
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1158
|
+
* See the License for the specific language governing permissions and
|
|
1159
|
+
* limitations under the License.
|
|
1160
|
+
**/
|
|
1161
|
+
|
|
1162
|
+
|
|
1163
|
+
|
|
1164
|
+
|
|
1165
|
+
|
|
1166
|
+
|
|
1167
|
+
|
|
1168
|
+
const LoginComponent = ({
|
|
1169
|
+
summitData,
|
|
1170
|
+
loginOptions,
|
|
1171
|
+
login,
|
|
1172
|
+
allowsNativeAuth,
|
|
1173
|
+
allowsOtpAuthlogin,
|
|
1174
|
+
getLoginCode,
|
|
1175
|
+
getPasswordlessCode,
|
|
1176
|
+
initialEmailValue,
|
|
1177
|
+
title
|
|
1178
|
+
}) => {
|
|
1179
|
+
const [email, setEmail] = (0,external_react_.useState)(initialEmailValue);
|
|
1180
|
+
const [emailError, setEmailError] = (0,external_react_.useState)(false);
|
|
1181
|
+
const [loginError, setLoginError] = (0,external_react_.useState)(false);
|
|
1182
|
+
|
|
1183
|
+
const isValidEmail = email => {
|
|
1184
|
+
const re = /^(([^<>()[\]\\.,;:\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,}))$/;
|
|
1185
|
+
return re.test(String(email).toLowerCase());
|
|
1186
|
+
};
|
|
1187
|
+
|
|
1188
|
+
const loginCode = () => {
|
|
1189
|
+
let isValid = isValidEmail(email);
|
|
1190
|
+
setEmailError(!isValid);
|
|
1191
|
+
setLoginError(false);
|
|
1192
|
+
|
|
1193
|
+
if (isValid) {
|
|
1194
|
+
getLoginCode(email, getPasswordlessCode).catch(err => {
|
|
1195
|
+
setLoginError(err.message);
|
|
1196
|
+
(0,utils/* handleSentryException */.Gj)(err);
|
|
1197
|
+
});
|
|
1198
|
+
}
|
|
1199
|
+
};
|
|
1200
|
+
|
|
1201
|
+
const emailButtonStyles = {
|
|
1202
|
+
color: (0,utils/* getContrastingTextColor */.YJ)(email === "" ? "var(--color_secondary_contrast)" : "var(--color_input_background_color)", "var(--color_text_light)", "var(--color_text_dark)")
|
|
1203
|
+
};
|
|
1204
|
+
|
|
1205
|
+
const handleEmailChange = ev => {
|
|
1206
|
+
const {
|
|
1207
|
+
target: {
|
|
1208
|
+
value
|
|
1209
|
+
}
|
|
1210
|
+
} = ev;
|
|
1211
|
+
|
|
1212
|
+
if (!value.length) {
|
|
1213
|
+
setEmailError(false);
|
|
1214
|
+
setLoginError(false);
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
setEmail((0,utils/* removeWhiteSpaces */.Jg)(value));
|
|
1218
|
+
};
|
|
1219
|
+
|
|
1220
|
+
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
1221
|
+
className: `${index_module.loginWrapper}`
|
|
1222
|
+
}, /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1223
|
+
className: `${index_module.innerWrapper}`
|
|
1224
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
1225
|
+
className: index_module.loginCode
|
|
1226
|
+
}, summitData?.secondary_logo && /*#__PURE__*/external_react_default().createElement("img", {
|
|
1227
|
+
className: "login-logo",
|
|
1228
|
+
src: `${summitData?.secondary_logo}`
|
|
1229
|
+
}), /*#__PURE__*/external_react_default().createElement("div", {
|
|
1230
|
+
className: index_module.title
|
|
1231
|
+
}, title), /*#__PURE__*/external_react_default().createElement("div", {
|
|
1232
|
+
className: index_module.input
|
|
1233
|
+
}, /*#__PURE__*/external_react_default().createElement("input", {
|
|
1234
|
+
placeholder: "youremail@example.com",
|
|
1235
|
+
value: email,
|
|
1236
|
+
onChange: handleEmailChange,
|
|
1237
|
+
onKeyPress: ev => ev.key === 'Enter' ? loginCode() : null,
|
|
1238
|
+
"data-testid": "email-input"
|
|
1239
|
+
})), /*#__PURE__*/external_react_default().createElement("div", {
|
|
1240
|
+
onClick: () => loginCode(),
|
|
1241
|
+
"data-testid": "email-button",
|
|
1242
|
+
id: "email-button",
|
|
1243
|
+
style: emailButtonStyles,
|
|
1244
|
+
className: `${index_module.button} ${index_module.email_login_button} ${email === '' ? `${index_module.pointerDisabled} ${index_module.buttonDisabled}` : `${index_module.primaryEmailButton}`}`
|
|
1245
|
+
}, /*#__PURE__*/external_react_default().createElement((EmailRounded_default()), {
|
|
1246
|
+
style: {
|
|
1247
|
+
fontSize: "20px"
|
|
1248
|
+
}
|
|
1249
|
+
}), /*#__PURE__*/external_react_default().createElement("span", null, "Email me a single-use code"), /*#__PURE__*/external_react_default().createElement("span", null)), emailError && /*#__PURE__*/external_react_default().createElement("span", {
|
|
1250
|
+
className: index_module.error,
|
|
1251
|
+
"data-testid": "email-error"
|
|
1252
|
+
}, "Please enter a valid email address"), loginError && /*#__PURE__*/external_react_default().createElement("span", {
|
|
1253
|
+
className: index_module.error,
|
|
1254
|
+
"data-testid": "login-error",
|
|
1255
|
+
dangerouslySetInnerHTML: {
|
|
1256
|
+
__html: loginError
|
|
1257
|
+
}
|
|
1258
|
+
}), /*#__PURE__*/external_react_default().createElement("h2", {
|
|
1259
|
+
className: index_module.h2Styled
|
|
1260
|
+
}, "or")), loginOptions.map((o, index) => {
|
|
1261
|
+
return o.provider_param ? /*#__PURE__*/external_react_default().createElement("div", {
|
|
1262
|
+
className: `${index_module.button}`,
|
|
1263
|
+
key: `provider-${o.provider_param}`,
|
|
1264
|
+
"data-testid": "login-button",
|
|
1265
|
+
style: {
|
|
1266
|
+
color: o.button_text_color ? o.button_text_color : '#ffffff',
|
|
1267
|
+
border: `thin solid ${o.button_border_color ? o.button_border_color : o.button_color}`,
|
|
1268
|
+
backgroundColor: o.button_color,
|
|
1269
|
+
backgroundImage: o.provider_logo ? `url(${o.provider_logo})` : 'none',
|
|
1270
|
+
backgroundSize: o.provider_logo_size ? o.provider_logo_size : ''
|
|
1271
|
+
},
|
|
1272
|
+
onClick: () => login(o.provider_param)
|
|
1273
|
+
}, o.provider_label) : allowsNativeAuth ? /*#__PURE__*/external_react_default().createElement("div", {
|
|
1274
|
+
className: `${index_module.button}`,
|
|
1275
|
+
key: `provider-fnid`,
|
|
1276
|
+
"data-testid": "login-button",
|
|
1277
|
+
style: {
|
|
1278
|
+
color: o.button_border_color ? o.button_border_color : '#ffffff',
|
|
1279
|
+
border: `thin solid ${o.button_border_color ? o.button_border_color : o.button_color}`,
|
|
1280
|
+
backgroundColor: o.button_color,
|
|
1281
|
+
backgroundImage: o.provider_logo ? `url(${o.provider_logo})` : 'none',
|
|
1282
|
+
backgroundSize: o.provider_logo_size ? o.provider_logo_size : ''
|
|
1283
|
+
},
|
|
1284
|
+
onClick: () => login(o.provider_param)
|
|
1285
|
+
}, o.provider_label) : null;
|
|
1286
|
+
}), allowsOtpAuthlogin && /*#__PURE__*/external_react_default().createElement("div", {
|
|
1287
|
+
className: index_module.loginCode
|
|
1288
|
+
}, "or get a login code emailed to you", /*#__PURE__*/external_react_default().createElement("div", {
|
|
1289
|
+
className: index_module.input
|
|
1290
|
+
}, /*#__PURE__*/external_react_default().createElement("input", {
|
|
1291
|
+
placeholder: "youremail@example.com",
|
|
1292
|
+
value: email,
|
|
1293
|
+
onChange: e => setEmail(e.target.value),
|
|
1294
|
+
onKeyPress: ev => ev.key === 'Enter' ? loginCode() : null,
|
|
1295
|
+
"data-testid": "email-input"
|
|
1296
|
+
}), /*#__PURE__*/external_react_default().createElement("br", null)), /*#__PURE__*/external_react_default().createElement("div", {
|
|
1297
|
+
onClick: () => loginCode(),
|
|
1298
|
+
"data-testid": "email-button",
|
|
1299
|
+
className: "button",
|
|
1300
|
+
style: {
|
|
1301
|
+
background: "#000",
|
|
1302
|
+
color: "#fff"
|
|
1303
|
+
}
|
|
1304
|
+
}, "Email me a login code"), emailError && /*#__PURE__*/external_react_default().createElement("span", {
|
|
1305
|
+
"data-testid": "email-error"
|
|
1306
|
+
}, "Please enter a valid email adress")))));
|
|
1307
|
+
};
|
|
1308
|
+
|
|
1309
|
+
LoginComponent.propTypes = {
|
|
1310
|
+
loginOptions: (external_prop_types_default()).array.isRequired,
|
|
1311
|
+
login: (external_prop_types_default()).func.isRequired,
|
|
1312
|
+
allowsNativeAuth: (external_prop_types_default()).bool,
|
|
1313
|
+
allowsOtpAuthlogin: (external_prop_types_default()).bool,
|
|
1314
|
+
getLoginCode: (external_prop_types_default()).func.isRequired,
|
|
1315
|
+
getPasswordlessCode: (external_prop_types_default()).func,
|
|
1316
|
+
initialEmailValue: (external_prop_types_default()).string,
|
|
1317
|
+
title: (external_prop_types_default()).string
|
|
1318
|
+
};
|
|
1319
|
+
LoginComponent.defaultProps = {
|
|
1320
|
+
allowsNativeAuth: true,
|
|
1321
|
+
allowsOtpAuthlogin: false,
|
|
1322
|
+
initialEmailValue: '',
|
|
1323
|
+
title: 'Enter your email to begin registration:'
|
|
1324
|
+
};
|
|
1325
|
+
/* harmony default export */ const login = (LoginComponent);
|
|
1326
|
+
|
|
1327
|
+
/***/ }),
|
|
1328
|
+
|
|
1329
|
+
/***/ 696:
|
|
1330
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1331
|
+
|
|
1332
|
+
"use strict";
|
|
1333
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1334
|
+
/* harmony export */ "x": () => (/* binding */ formatCurrency)
|
|
1335
|
+
/* harmony export */ });
|
|
1336
|
+
const _excluded = ["locale"];
|
|
1337
|
+
|
|
1338
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1339
|
+
|
|
1340
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1341
|
+
|
|
1342
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
1343
|
+
|
|
1344
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
1345
|
+
|
|
1346
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
1347
|
+
|
|
1348
|
+
const formatCurrency = (value, _ref) => {
|
|
1349
|
+
let {
|
|
1350
|
+
locale = 'en-US'
|
|
1351
|
+
} = _ref,
|
|
1352
|
+
options = _objectWithoutProperties(_ref, _excluded);
|
|
1353
|
+
|
|
1354
|
+
const defaultOptions = {
|
|
1355
|
+
currency: 'USD',
|
|
1356
|
+
minimumFractionDigits: 2,
|
|
1357
|
+
maximumFractionDigits: 2
|
|
1358
|
+
};
|
|
1359
|
+
const formatter = new Intl.NumberFormat(locale, _objectSpread(_objectSpread({
|
|
1360
|
+
style: 'currency'
|
|
1361
|
+
}, defaultOptions), options));
|
|
1362
|
+
return formatter.format(value);
|
|
1363
|
+
};
|
|
1364
|
+
|
|
1365
|
+
/***/ }),
|
|
1366
|
+
|
|
1367
|
+
/***/ 104:
|
|
1368
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1369
|
+
|
|
1370
|
+
"use strict";
|
|
1371
|
+
|
|
1372
|
+
// EXPORTS
|
|
1373
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
1374
|
+
"j": () => (/* binding */ formatErrorMessage)
|
|
1375
|
+
});
|
|
1376
|
+
|
|
1377
|
+
;// CONCATENATED MODULE: ./src/helpers/capitalizeFirstLetter.js
|
|
1378
|
+
const capitalizeFirstLetter = string => string.charAt(0).toUpperCase() + string.slice(1);
|
|
1379
|
+
;// CONCATENATED MODULE: ./src/helpers/formatErrorMessage.js
|
|
1380
|
+
|
|
1381
|
+
const formatErrorMessage = string => {
|
|
1382
|
+
const errorMessage = capitalizeFirstLetter(string);
|
|
1383
|
+
return `${errorMessage}${errorMessage.endsWith('.') ? '' : '.'}`;
|
|
1384
|
+
};
|
|
1385
|
+
|
|
1386
|
+
/***/ }),
|
|
1387
|
+
|
|
1388
|
+
/***/ 499:
|
|
1389
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1390
|
+
|
|
1391
|
+
"use strict";
|
|
1392
|
+
|
|
1393
|
+
// EXPORTS
|
|
1394
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
1395
|
+
"xG": () => (/* reexport */ formatCurrency/* formatCurrency */.x),
|
|
1396
|
+
"jN": () => (/* reexport */ formatErrorMessage/* formatErrorMessage */.j),
|
|
1397
|
+
"UE": () => (/* reexport */ getTicketMaxQuantity)
|
|
1398
|
+
});
|
|
1399
|
+
|
|
1400
|
+
// UNUSED EXPORTS: capitalizeFirstLetter
|
|
1401
|
+
|
|
1402
|
+
// EXTERNAL MODULE: ./src/helpers/formatCurrency.js
|
|
1403
|
+
var formatCurrency = __webpack_require__(696);
|
|
1404
|
+
// EXTERNAL MODULE: ./src/helpers/formatErrorMessage.js + 1 modules
|
|
1405
|
+
var formatErrorMessage = __webpack_require__(104);
|
|
1406
|
+
// EXTERNAL MODULE: ./src/utils/utils.js + 1 modules
|
|
1407
|
+
var utils = __webpack_require__(452);
|
|
1408
|
+
;// CONCATENATED MODULE: ./src/helpers/getTicketMaxQuantity.js
|
|
1409
|
+
|
|
1410
|
+
const getTicketMaxQuantity = ticket => {
|
|
1411
|
+
if (!ticket) return 0;
|
|
1412
|
+
if ((0,utils/* isPrePaidTicketType */.B6)(ticket)) return 1;
|
|
1413
|
+
return Math.min((ticket.quantity_2_sell || Number.MAX_SAFE_INTEGER) - ticket.quantity_sold, ticket.max_quantity_per_order || Number.MAX_SAFE_INTEGER);
|
|
1414
|
+
};
|
|
1415
|
+
;// CONCATENATED MODULE: ./src/helpers/index.js
|
|
1416
|
+
|
|
1417
|
+
|
|
1418
|
+
|
|
1419
|
+
|
|
1420
|
+
|
|
1421
|
+
/***/ }),
|
|
1422
|
+
|
|
1423
|
+
/***/ 243:
|
|
1424
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1425
|
+
|
|
1426
|
+
"use strict";
|
|
1427
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
1428
|
+
/* harmony export */ "ADD_TO_CART": () => (/* binding */ ADD_TO_CART),
|
|
1429
|
+
/* harmony export */ "BEGIN_CHECKOUT": () => (/* binding */ BEGIN_CHECKOUT),
|
|
1430
|
+
/* harmony export */ "DefaultBGColor": () => (/* binding */ DefaultBGColor),
|
|
1431
|
+
/* harmony export */ "DefaultHintColor": () => (/* binding */ DefaultHintColor),
|
|
1432
|
+
/* harmony export */ "DefaultTextColor": () => (/* binding */ DefaultTextColor),
|
|
1433
|
+
/* harmony export */ "EMAIL_REGEXP": () => (/* binding */ EMAIL_REGEXP),
|
|
1434
|
+
/* harmony export */ "ERROR_TYPE_ERROR": () => (/* binding */ ERROR_TYPE_ERROR),
|
|
1435
|
+
/* harmony export */ "ERROR_TYPE_PAYMENT": () => (/* binding */ ERROR_TYPE_PAYMENT),
|
|
1436
|
+
/* harmony export */ "ERROR_TYPE_VALIDATION": () => (/* binding */ ERROR_TYPE_VALIDATION),
|
|
1437
|
+
/* harmony export */ "ORDER_PAYMENT_METHOD_OFFLINE": () => (/* binding */ ORDER_PAYMENT_METHOD_OFFLINE),
|
|
1438
|
+
/* harmony export */ "ORDER_STATUS_PAID": () => (/* binding */ ORDER_STATUS_PAID),
|
|
1439
|
+
/* harmony export */ "PAYMENT_PROVIDER_LAWPAY": () => (/* binding */ PAYMENT_PROVIDER_LAWPAY),
|
|
1440
|
+
/* harmony export */ "PAYMENT_PROVIDER_STRIPE": () => (/* binding */ PAYMENT_PROVIDER_STRIPE),
|
|
1441
|
+
/* harmony export */ "PURCHASE_COMPLETE": () => (/* binding */ PURCHASE_COMPLETE),
|
|
1442
|
+
/* harmony export */ "RESEND_TIME": () => (/* binding */ RESEND_TIME),
|
|
1443
|
+
/* harmony export */ "STEP_COMPLETE": () => (/* binding */ STEP_COMPLETE),
|
|
1444
|
+
/* harmony export */ "STEP_PAYMENT": () => (/* binding */ STEP_PAYMENT),
|
|
1445
|
+
/* harmony export */ "STEP_PERSONAL_INFO": () => (/* binding */ STEP_PERSONAL_INFO),
|
|
1446
|
+
/* harmony export */ "STEP_SELECT_TICKET_TYPE": () => (/* binding */ STEP_SELECT_TICKET_TYPE),
|
|
1447
|
+
/* harmony export */ "TICKET_OWNER_MYSELF": () => (/* binding */ TICKET_OWNER_MYSELF),
|
|
1448
|
+
/* harmony export */ "TICKET_OWNER_SOMEONE": () => (/* binding */ TICKET_OWNER_SOMEONE),
|
|
1449
|
+
/* harmony export */ "TICKET_OWNER_UNASSIGNED": () => (/* binding */ TICKET_OWNER_UNASSIGNED),
|
|
1450
|
+
/* harmony export */ "TICKET_TYPE_SUBTYPE_PREPAID": () => (/* binding */ TICKET_TYPE_SUBTYPE_PREPAID),
|
|
1451
|
+
/* harmony export */ "VIEW_ITEM": () => (/* binding */ VIEW_ITEM),
|
|
1452
|
+
/* harmony export */ "VirtualAccessLevel": () => (/* binding */ VirtualAccessLevel)
|
|
1453
|
+
/* harmony export */ });
|
|
1454
|
+
/* unused harmony exports AUTH_ERROR_MESSAGE, AUTH_ERROR_MISSING_REFRESH_TOKEN, AUTH_ERROR_REQUEST_FAILED */
|
|
1455
|
+
/**
|
|
1456
|
+
* Copyright 2022 OpenStack Foundation
|
|
1457
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1458
|
+
* you may not use this file except in compliance with the License.
|
|
1459
|
+
* You may obtain a copy of the License at
|
|
1460
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1461
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1462
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1463
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1464
|
+
* See the License for the specific language governing permissions and
|
|
1465
|
+
* limitations under the License.
|
|
1466
|
+
**/
|
|
1467
|
+
const AUTH_ERROR_MESSAGE = 'Missing Auth info';
|
|
1468
|
+
const AUTH_ERROR_MISSING_REFRESH_TOKEN = "missing Refresh Token";
|
|
1469
|
+
const AUTH_ERROR_REQUEST_FAILED = 'Request failed';
|
|
1470
|
+
const VirtualAccessLevel = 'VIRTUAL';
|
|
1471
|
+
const DefaultBGColor = '#000000';
|
|
1472
|
+
const DefaultTextColor = '#FFFFFF';
|
|
1473
|
+
const DefaultHintColor = 'rgb(58, 63, 65)';
|
|
1474
|
+
const EMAIL_REGEXP = /(([^<>()\[\]\\.,;:\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,}))/;
|
|
1475
|
+
const TICKET_OWNER_MYSELF = 'myself';
|
|
1476
|
+
const TICKET_OWNER_SOMEONE = 'someoneElse';
|
|
1477
|
+
const TICKET_OWNER_UNASSIGNED = 'unassigned';
|
|
1478
|
+
const TICKET_TYPE_SUBTYPE_PREPAID = 'PrePaid';
|
|
1479
|
+
const ORDER_STATUS_PAID = 'Paid';
|
|
1480
|
+
const ORDER_PAYMENT_METHOD_OFFLINE = 'Offline';
|
|
1481
|
+
const STEP_SELECT_TICKET_TYPE = 0;
|
|
1482
|
+
const STEP_PERSONAL_INFO = 1;
|
|
1483
|
+
const STEP_PAYMENT = 2;
|
|
1484
|
+
const STEP_COMPLETE = 3;
|
|
1485
|
+
const RESEND_TIME = 60; // ANALYTICS
|
|
1486
|
+
|
|
1487
|
+
const VIEW_ITEM = 'view_item';
|
|
1488
|
+
const ADD_TO_CART = 'add_to_cart';
|
|
1489
|
+
const BEGIN_CHECKOUT = 'begin_checkout';
|
|
1490
|
+
const PURCHASE_COMPLETE = 'purchase_complete'; // ERRORS
|
|
1491
|
+
|
|
1492
|
+
const ERROR_TYPE_ERROR = 'error_type_error';
|
|
1493
|
+
const ERROR_TYPE_VALIDATION = 'error_type_validation';
|
|
1494
|
+
const ERROR_TYPE_PAYMENT = 'error_type_payment'; // PROVIDERS
|
|
1495
|
+
|
|
1496
|
+
const PAYMENT_PROVIDER_STRIPE = 'Stripe';
|
|
1497
|
+
const PAYMENT_PROVIDER_LAWPAY = 'LawPay';
|
|
1498
|
+
|
|
1499
|
+
/***/ }),
|
|
1500
|
+
|
|
1501
|
+
/***/ 452:
|
|
1502
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1503
|
+
|
|
1504
|
+
"use strict";
|
|
1505
|
+
|
|
1506
|
+
// EXPORTS
|
|
1507
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
1508
|
+
"kb": () => (/* binding */ avoidTooltipOverflow),
|
|
1509
|
+
"S2": () => (/* binding */ buildTrackEvent),
|
|
1510
|
+
"YJ": () => (/* binding */ getContrastingTextColor),
|
|
1511
|
+
"U5": () => (/* binding */ getCurrentProvider),
|
|
1512
|
+
"AS": () => (/* binding */ getCurrentUserLanguage),
|
|
1513
|
+
"fX": () => (/* binding */ getTicketCost),
|
|
1514
|
+
"h5": () => (/* binding */ getTicketTaxes),
|
|
1515
|
+
"Gj": () => (/* binding */ handleSentryException),
|
|
1516
|
+
"ke": () => (/* binding */ isEmptyString),
|
|
1517
|
+
"yk": () => (/* binding */ isFreeOrder),
|
|
1518
|
+
"xm": () => (/* binding */ isPrePaidOrder),
|
|
1519
|
+
"B6": () => (/* binding */ isPrePaidTicketType),
|
|
1520
|
+
"Jg": () => (/* binding */ removeWhiteSpaces),
|
|
1521
|
+
"ZL": () => (/* binding */ ticketHasAccessLevel)
|
|
1522
|
+
});
|
|
1523
|
+
|
|
1524
|
+
// UNUSED EXPORTS: hasDiscountApplied, parseColor
|
|
1525
|
+
|
|
1526
|
+
// EXTERNAL MODULE: ./src/helpers/index.js + 1 modules
|
|
1527
|
+
var helpers = __webpack_require__(499);
|
|
1528
|
+
// EXTERNAL MODULE: ./src/utils/constants.js
|
|
1529
|
+
var constants = __webpack_require__(243);
|
|
1530
|
+
// EXTERNAL MODULE: external "react"
|
|
1531
|
+
var external_react_ = __webpack_require__(689);
|
|
1532
|
+
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
1533
|
+
;// CONCATENATED MODULE: external "@sentry/react"
|
|
1534
|
+
const react_namespaceObject = require("@sentry/react");
|
|
1535
|
+
;// CONCATENATED MODULE: ./src/utils/utils.js
|
|
1536
|
+
|
|
1537
|
+
|
|
1538
|
+
|
|
1539
|
+
|
|
1540
|
+
/**
|
|
1541
|
+
* Copyright 2022 OpenStack Foundation
|
|
1542
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1543
|
+
* you may not use this file except in compliance with the License.
|
|
1544
|
+
* You may obtain a copy of the License at
|
|
1545
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1546
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1547
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1548
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1549
|
+
* See the License for the specific language governing permissions and
|
|
1550
|
+
* limitations under the License.
|
|
1551
|
+
**/
|
|
1552
|
+
|
|
1553
|
+
const getCurrentProvider = summit => {
|
|
1554
|
+
for (let profile of summit.payment_profiles) {
|
|
1555
|
+
if (profile.application_type === 'Registration') {
|
|
1556
|
+
return {
|
|
1557
|
+
publicKey: profile.test_mode_enabled ? profile.test_publishable_key : profile.live_publishable_key,
|
|
1558
|
+
provider: profile.provider
|
|
1559
|
+
};
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
return {
|
|
1564
|
+
publicKey: null,
|
|
1565
|
+
provider: ''
|
|
1566
|
+
};
|
|
1567
|
+
};
|
|
1568
|
+
const ticketHasAccessLevel = (ticket, accessLevel) => {
|
|
1569
|
+
if (!ticket) return false;
|
|
1570
|
+
return ticket.badge?.type?.access_levels.map(al => al.name).includes(accessLevel);
|
|
1571
|
+
};
|
|
1572
|
+
const getCurrentUserLanguage = () => {
|
|
1573
|
+
let language = 'en';
|
|
1574
|
+
|
|
1575
|
+
if (typeof navigator !== 'undefined') {
|
|
1576
|
+
language = navigator.languages && navigator.languages[0] || navigator.language || navigator.userLanguage;
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
return language;
|
|
1580
|
+
};
|
|
1581
|
+
const isEmptyString = val => {
|
|
1582
|
+
return typeof val === 'string' && val.trim().length == 0;
|
|
1583
|
+
};
|
|
1584
|
+
const getTicketTaxes = (ticket, taxes) => {
|
|
1585
|
+
if (isPrePaidTicketType(ticket)) return '';
|
|
1586
|
+
const ticketTaxes = taxes.filter(tax => tax.ticket_types.includes(ticket?.id));
|
|
1587
|
+
return `${ticketTaxes.length > 0 ? ` plus ${taxes.map(t => t.name).join(' & ')}` : ''}`;
|
|
1588
|
+
};
|
|
1589
|
+
const hasDiscountApplied = ticketType => ticketType.hasOwnProperty('cost_with_applied_discount') && ticketType.cost !== ticketType?.cost_with_applied_discount;
|
|
1590
|
+
const isFreeOrder = reservation => reservation.amount === 0;
|
|
1591
|
+
const isPrePaidOrder = reservation => reservation.status === constants.ORDER_STATUS_PAID && reservation.payment_method === constants.ORDER_PAYMENT_METHOD_OFFLINE;
|
|
1592
|
+
const getTicketCost = (ticket, quantity = 1) => {
|
|
1593
|
+
return hasDiscountApplied(ticket) ? /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("s", null, (0,helpers/* formatCurrency */.xG)(ticket.cost * quantity, {
|
|
1594
|
+
currency: ticket.currency
|
|
1595
|
+
}), " ", ticket.currency), "\xA0", /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, (0,helpers/* formatCurrency */.xG)(ticket.cost_with_applied_discount * quantity, {
|
|
1596
|
+
currency: ticket.currency
|
|
1597
|
+
}), " ", ticket.currency)) : /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, (0,helpers/* formatCurrency */.xG)(ticket.cost * quantity, {
|
|
1598
|
+
currency: ticket.currency
|
|
1599
|
+
}), " ", ticket.currency);
|
|
1600
|
+
};
|
|
1601
|
+
const isPrePaidTicketType = ticketType => ticketType?.sub_type === constants.TICKET_TYPE_SUBTYPE_PREPAID;
|
|
1602
|
+
const buildTrackEvent = (data, ticketQuantity = null, promoCode = null) => {
|
|
1603
|
+
const eventData = {
|
|
1604
|
+
currency: data.currency || 'USD',
|
|
1605
|
+
items_array: [{
|
|
1606
|
+
item_id: data.id,
|
|
1607
|
+
item_name: data.name,
|
|
1608
|
+
price: data.cost
|
|
1609
|
+
}]
|
|
1610
|
+
};
|
|
1611
|
+
|
|
1612
|
+
if (ticketQuantity) {
|
|
1613
|
+
eventData.value = data.cost * ticketQuantity;
|
|
1614
|
+
eventData.items_array[0].quantity = ticketQuantity;
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
if (promoCode) {
|
|
1618
|
+
eventData.coupon = promoCode;
|
|
1619
|
+
eventData.items_array[0].discount = data.cost - (data.cost_with_applied_discount || 0);
|
|
1620
|
+
}
|
|
1621
|
+
|
|
1622
|
+
return eventData;
|
|
1623
|
+
};
|
|
1624
|
+
const removeWhiteSpaces = value => value.replace(/\s+/g, ''); // Helper function to resolve CSS variables and parse colors
|
|
1625
|
+
|
|
1626
|
+
const parseColor = (input, element = document.documentElement) => {
|
|
1627
|
+
// Check if the input is a CSS variable
|
|
1628
|
+
if (input.startsWith("var(")) {
|
|
1629
|
+
const cssVarName = input.slice(4, -1).trim();
|
|
1630
|
+
input = getComputedStyle(element).getPropertyValue(cssVarName).trim();
|
|
1631
|
+
} // Convert the resolved color to RGB
|
|
1632
|
+
|
|
1633
|
+
|
|
1634
|
+
const div = document.createElement("div");
|
|
1635
|
+
div.style.color = input;
|
|
1636
|
+
document.body.appendChild(div);
|
|
1637
|
+
const m = getComputedStyle(div).color.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);
|
|
1638
|
+
document.body.removeChild(div);
|
|
1639
|
+
return m ? [parseInt(m[1]), parseInt(m[2]), parseInt(m[3])] : null;
|
|
1640
|
+
};
|
|
1641
|
+
const getContrastingTextColor = (bgColor, lightColor, darkColor) => {
|
|
1642
|
+
// Parse the background color to RGB
|
|
1643
|
+
const rgb = parseColor(bgColor); // Fallback to a default color if parsing fails
|
|
1644
|
+
|
|
1645
|
+
if (!rgb) return darkColor; // or lightColor
|
|
1646
|
+
|
|
1647
|
+
const [r, g, b] = rgb; // Calculate luminance
|
|
1648
|
+
|
|
1649
|
+
const luminance = [r, g, b].map(channel => {
|
|
1650
|
+
const normalized = channel / 255;
|
|
1651
|
+
return normalized <= 0.03928 ? normalized / 12.92 : Math.pow((normalized + 0.055) / 1.055, 2.4);
|
|
1652
|
+
}).reduce((acc, val, i) => acc + val * [0.2126, 0.7152, 0.0722][i], 0); // Return the contrasting color
|
|
1653
|
+
|
|
1654
|
+
return luminance > 0.179 ? darkColor : lightColor;
|
|
1655
|
+
};
|
|
1656
|
+
|
|
1657
|
+
const isSentryInitialized = () => !!window.SENTRY_DSN;
|
|
1658
|
+
|
|
1659
|
+
const handleSentryException = err => isSentryInitialized() ? react_namespaceObject.captureException(err) : console.log("Error on registration: ", err);
|
|
1660
|
+
const avoidTooltipOverflow = ({
|
|
1661
|
+
left,
|
|
1662
|
+
top
|
|
1663
|
+
}, _e, _t, node) => {
|
|
1664
|
+
return {
|
|
1665
|
+
top,
|
|
1666
|
+
left: typeof node === 'string' ? left : Math.max(left, 0)
|
|
1667
|
+
};
|
|
1668
|
+
};
|
|
1669
|
+
|
|
1670
|
+
/***/ }),
|
|
1671
|
+
|
|
1672
|
+
/***/ 974:
|
|
1673
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1674
|
+
|
|
1675
|
+
"use strict";
|
|
1676
|
+
|
|
1677
|
+
// EXPORTS
|
|
1678
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
1679
|
+
"y": () => (/* binding */ withReduxProvider)
|
|
1680
|
+
});
|
|
1681
|
+
|
|
1682
|
+
// UNUSED EXPORTS: default
|
|
1683
|
+
|
|
1684
|
+
// EXTERNAL MODULE: external "react"
|
|
1685
|
+
var external_react_ = __webpack_require__(689);
|
|
1686
|
+
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
1687
|
+
// EXTERNAL MODULE: external "react-redux"
|
|
1688
|
+
var external_react_redux_ = __webpack_require__(22);
|
|
1689
|
+
;// CONCATENATED MODULE: external "redux-persist/integration/react"
|
|
1690
|
+
const react_namespaceObject = require("redux-persist/integration/react");
|
|
1691
|
+
;// CONCATENATED MODULE: external "redux"
|
|
1692
|
+
const external_redux_namespaceObject = require("redux");
|
|
1693
|
+
;// CONCATENATED MODULE: external "redux-thunk"
|
|
1694
|
+
const external_redux_thunk_namespaceObject = require("redux-thunk");
|
|
1695
|
+
var external_redux_thunk_default = /*#__PURE__*/__webpack_require__.n(external_redux_thunk_namespaceObject);
|
|
1696
|
+
;// CONCATENATED MODULE: external "redux-persist"
|
|
1697
|
+
const external_redux_persist_namespaceObject = require("redux-persist");
|
|
1698
|
+
;// CONCATENATED MODULE: external "redux-persist/es/storage"
|
|
1699
|
+
const storage_namespaceObject = require("redux-persist/es/storage");
|
|
1700
|
+
var storage_default = /*#__PURE__*/__webpack_require__.n(storage_namespaceObject);
|
|
1701
|
+
// EXTERNAL MODULE: ./src/actions.js + 5 modules
|
|
1702
|
+
var actions = __webpack_require__(595);
|
|
1703
|
+
;// CONCATENATED MODULE: external "openstack-uicore-foundation/lib/security/actions"
|
|
1704
|
+
const actions_namespaceObject = require("openstack-uicore-foundation/lib/security/actions");
|
|
1705
|
+
;// CONCATENATED MODULE: external "moment"
|
|
1706
|
+
const external_moment_namespaceObject = require("moment");
|
|
1707
|
+
var external_moment_default = /*#__PURE__*/__webpack_require__.n(external_moment_namespaceObject);
|
|
1708
|
+
// EXTERNAL MODULE: ./src/utils/constants.js
|
|
1709
|
+
var constants = __webpack_require__(243);
|
|
1710
|
+
;// CONCATENATED MODULE: ./src/reducer.js
|
|
1711
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
1712
|
+
|
|
1713
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1714
|
+
|
|
1715
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
1716
|
+
|
|
1717
|
+
/**
|
|
1718
|
+
* Copyright 2020 OpenStack Foundation
|
|
1719
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1720
|
+
* you may not use this file except in compliance with the License.
|
|
1721
|
+
* You may obtain a copy of the License at
|
|
1722
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1723
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1724
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1725
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1726
|
+
* See the License for the specific language governing permissions and
|
|
1727
|
+
* limitations under the License.
|
|
1728
|
+
**/
|
|
1729
|
+
|
|
1730
|
+
|
|
1731
|
+
|
|
1732
|
+
|
|
1733
|
+
const localNowUtc = external_moment_default()().unix();
|
|
1734
|
+
const DEFAULT_STATE = {
|
|
1735
|
+
reservation: null,
|
|
1736
|
+
checkout: null,
|
|
1737
|
+
step: constants.STEP_SELECT_TICKET_TYPE,
|
|
1738
|
+
widgetLoading: false,
|
|
1739
|
+
passwordless: {
|
|
1740
|
+
email: null,
|
|
1741
|
+
otp_length: 0,
|
|
1742
|
+
otp_lifetime: 0,
|
|
1743
|
+
code_sent: false,
|
|
1744
|
+
error: false
|
|
1745
|
+
},
|
|
1746
|
+
ticketTypes: [],
|
|
1747
|
+
// added this flag to really know if we requested or not the ticket types collection
|
|
1748
|
+
// ( empty bc initial value or empty bc api empty response)
|
|
1749
|
+
requestedTicketTypes: false,
|
|
1750
|
+
taxTypes: [],
|
|
1751
|
+
invitation: null,
|
|
1752
|
+
settings: {
|
|
1753
|
+
apiBaseUrl: null,
|
|
1754
|
+
summitId: null,
|
|
1755
|
+
userProfile: null
|
|
1756
|
+
},
|
|
1757
|
+
nowUtc: localNowUtc,
|
|
1758
|
+
promoCode: ''
|
|
1759
|
+
};
|
|
1760
|
+
|
|
1761
|
+
const RegistrationLiteReducer = (state = DEFAULT_STATE, action) => {
|
|
1762
|
+
const {
|
|
1763
|
+
type,
|
|
1764
|
+
payload
|
|
1765
|
+
} = action;
|
|
1766
|
+
console.log(action);
|
|
1767
|
+
|
|
1768
|
+
switch (type) {
|
|
1769
|
+
case actions/* CLEAR_WIDGET_STATE */.t$:
|
|
1770
|
+
case actions_namespaceObject.LOGOUT_USER:
|
|
1771
|
+
{
|
|
1772
|
+
return DEFAULT_STATE;
|
|
1773
|
+
}
|
|
1774
|
+
|
|
1775
|
+
case actions/* REQUESTED_TICKET_TYPES */.nZ:
|
|
1776
|
+
{
|
|
1777
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
1778
|
+
requestedTicketTypes: false
|
|
1779
|
+
});
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1782
|
+
case actions/* START_WIDGET_LOADING */.Vx:
|
|
1783
|
+
{
|
|
1784
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
1785
|
+
widgetLoading: true
|
|
1786
|
+
});
|
|
1787
|
+
}
|
|
1788
|
+
|
|
1789
|
+
case actions/* STOP_WIDGET_LOADING */.sC:
|
|
1790
|
+
{
|
|
1791
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
1792
|
+
widgetLoading: false
|
|
1793
|
+
});
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
case actions/* LOAD_INITIAL_VARS */.VY:
|
|
1797
|
+
const {
|
|
1798
|
+
summitData,
|
|
1799
|
+
apiBaseUrl,
|
|
1800
|
+
profileData
|
|
1801
|
+
} = payload;
|
|
1802
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
1803
|
+
reservation: null,
|
|
1804
|
+
checkout: null,
|
|
1805
|
+
ticketTypes: [],
|
|
1806
|
+
requestedTicketTypes: false,
|
|
1807
|
+
taxTypes: [],
|
|
1808
|
+
invitation: null,
|
|
1809
|
+
passwordless: _objectSpread({}, DEFAULT_STATE.passwordless),
|
|
1810
|
+
settings: _objectSpread(_objectSpread({}, DEFAULT_STATE.settings), {}, {
|
|
1811
|
+
summitId: summitData.id,
|
|
1812
|
+
userProfile: profileData,
|
|
1813
|
+
apiBaseUrl: apiBaseUrl
|
|
1814
|
+
})
|
|
1815
|
+
});
|
|
1816
|
+
|
|
1817
|
+
case actions/* LOAD_PROFILE_DATA */._y:
|
|
1818
|
+
{
|
|
1819
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
1820
|
+
settings: _objectSpread(_objectSpread({}, state.settings), {}, {
|
|
1821
|
+
userProfile: payload
|
|
1822
|
+
})
|
|
1823
|
+
});
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
case actions/* CHANGE_STEP */.$i:
|
|
1827
|
+
{
|
|
1828
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
1829
|
+
step: payload
|
|
1830
|
+
});
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
case actions/* GET_TICKET_TYPES */.HC:
|
|
1834
|
+
{
|
|
1835
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
1836
|
+
ticketTypes: payload.response.data,
|
|
1837
|
+
requestedTicketTypes: true
|
|
1838
|
+
});
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
case actions/* GET_TAX_TYPES */.bx:
|
|
1842
|
+
{
|
|
1843
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
1844
|
+
taxTypes: payload.response.data
|
|
1845
|
+
});
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1848
|
+
case actions/* GO_TO_LOGIN */.qY:
|
|
1849
|
+
{
|
|
1850
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
1851
|
+
passwordless: _objectSpread(_objectSpread({}, state.passwordless), {}, {
|
|
1852
|
+
code_sent: false,
|
|
1853
|
+
error: false
|
|
1854
|
+
})
|
|
1855
|
+
});
|
|
1856
|
+
}
|
|
1857
|
+
|
|
1858
|
+
case actions/* SET_PASSWORDLESS_LOGIN */.qR:
|
|
1859
|
+
{
|
|
1860
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
1861
|
+
passwordless: _objectSpread(_objectSpread({}, state.passwordless), {}, {
|
|
1862
|
+
email: payload,
|
|
1863
|
+
error: false,
|
|
1864
|
+
otp_lifetime: 0
|
|
1865
|
+
})
|
|
1866
|
+
});
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
case actions/* SET_PASSWORDLESS_SETTINGS */.Nh:
|
|
1870
|
+
{
|
|
1871
|
+
const {
|
|
1872
|
+
otp_length,
|
|
1873
|
+
otp_lifetime
|
|
1874
|
+
} = payload;
|
|
1875
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
1876
|
+
passwordless: _objectSpread(_objectSpread({}, state.passwordless), {}, {
|
|
1877
|
+
otp_length,
|
|
1878
|
+
otp_lifetime,
|
|
1879
|
+
code_sent: true,
|
|
1880
|
+
error: false
|
|
1881
|
+
})
|
|
1882
|
+
});
|
|
1883
|
+
}
|
|
1884
|
+
|
|
1885
|
+
case actions/* SET_PASSWORDLESS_ERROR */.Ol:
|
|
1886
|
+
{
|
|
1887
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
1888
|
+
passwordless: _objectSpread(_objectSpread({}, state.passwordless), {}, {
|
|
1889
|
+
error: true
|
|
1890
|
+
})
|
|
1891
|
+
});
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
case actions/* CREATE_RESERVATION_SUCCESS */.rr:
|
|
1895
|
+
{
|
|
1896
|
+
const reservation = payload.response;
|
|
1897
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
1898
|
+
reservation
|
|
1899
|
+
});
|
|
1900
|
+
}
|
|
1901
|
+
|
|
1902
|
+
case actions/* DELETE_RESERVATION_SUCCESS */.bz:
|
|
1903
|
+
{
|
|
1904
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
1905
|
+
reservation: null
|
|
1906
|
+
});
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1909
|
+
case actions/* CLEAR_RESERVATION */.I9:
|
|
1910
|
+
{
|
|
1911
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
1912
|
+
reservation: null,
|
|
1913
|
+
promoCode: ''
|
|
1914
|
+
});
|
|
1915
|
+
}
|
|
1916
|
+
|
|
1917
|
+
case actions/* PAY_RESERVATION */.bf:
|
|
1918
|
+
{
|
|
1919
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
1920
|
+
checkout: payload.response,
|
|
1921
|
+
reservation: null,
|
|
1922
|
+
userProfile: null,
|
|
1923
|
+
invitation: null,
|
|
1924
|
+
promoCode: ''
|
|
1925
|
+
});
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
case actions/* GET_MY_INVITATION */.Cw:
|
|
1929
|
+
{
|
|
1930
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
1931
|
+
invitation: payload.response
|
|
1932
|
+
});
|
|
1933
|
+
}
|
|
1934
|
+
|
|
1935
|
+
case actions/* CLEAR_MY_INVITATION */.aZ:
|
|
1936
|
+
{
|
|
1937
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
1938
|
+
invitation: null
|
|
1939
|
+
});
|
|
1940
|
+
}
|
|
1941
|
+
|
|
1942
|
+
case actions/* UPDATE_CLOCK */.VH:
|
|
1943
|
+
{
|
|
1944
|
+
const {
|
|
1945
|
+
timestamp
|
|
1946
|
+
} = payload;
|
|
1947
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
1948
|
+
nowUtc: timestamp
|
|
1949
|
+
});
|
|
1950
|
+
}
|
|
1951
|
+
|
|
1952
|
+
case actions/* CLEAR_CURRENT_PROMO_CODE */.ZD:
|
|
1953
|
+
{
|
|
1954
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
1955
|
+
promoCode: ''
|
|
1956
|
+
});
|
|
1957
|
+
}
|
|
1958
|
+
|
|
1959
|
+
case actions/* SET_CURRENT_PROMO_CODE */.GA:
|
|
1960
|
+
{
|
|
1961
|
+
const {
|
|
1962
|
+
currentPromoCode
|
|
1963
|
+
} = payload;
|
|
1964
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
1965
|
+
promoCode: currentPromoCode
|
|
1966
|
+
});
|
|
1967
|
+
}
|
|
1968
|
+
|
|
1969
|
+
default:
|
|
1970
|
+
{
|
|
1971
|
+
return state;
|
|
1972
|
+
}
|
|
1973
|
+
}
|
|
1974
|
+
};
|
|
1975
|
+
|
|
1976
|
+
/* harmony default export */ const reducer = (RegistrationLiteReducer);
|
|
1977
|
+
;// CONCATENATED MODULE: ./src/store.js
|
|
1978
|
+
/**
|
|
1979
|
+
* Copyright 2019
|
|
1980
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1981
|
+
* you may not use this file except in compliance with the License.
|
|
1982
|
+
* You may obtain a copy of the License at
|
|
1983
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1984
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1985
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1986
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1987
|
+
* See the License for the specific language governing permissions and
|
|
1988
|
+
* limitations under the License.
|
|
1989
|
+
**/
|
|
1990
|
+
|
|
1991
|
+
|
|
1992
|
+
|
|
1993
|
+
// default: localStorage if web, AsyncStorage if react-native
|
|
1994
|
+
|
|
1995
|
+
|
|
1996
|
+
let store, persistor;
|
|
1997
|
+
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || external_redux_namespaceObject.compose;
|
|
1998
|
+
const getStore = (clientId, apiBaseUrl, getAccessToken) => {
|
|
1999
|
+
if (store) return store;
|
|
2000
|
+
const config = {
|
|
2001
|
+
key: `root_registration_lite_${clientId}`,
|
|
2002
|
+
storage: (storage_default()),
|
|
2003
|
+
blacklist: ['ticketTypes', 'taxTypes'] // do not persist these keys
|
|
2004
|
+
|
|
2005
|
+
};
|
|
2006
|
+
const reducers = (0,external_redux_persist_namespaceObject.persistCombineReducers)(config, {
|
|
2007
|
+
registrationLiteState: reducer
|
|
2008
|
+
});
|
|
2009
|
+
store = (0,external_redux_namespaceObject.createStore)(reducers, composeEnhancers((0,external_redux_namespaceObject.applyMiddleware)(external_redux_thunk_default().withExtraArgument({
|
|
2010
|
+
apiBaseUrl: apiBaseUrl,
|
|
2011
|
+
getAccessToken: getAccessToken
|
|
2012
|
+
}))));
|
|
2013
|
+
return store;
|
|
2014
|
+
};
|
|
2015
|
+
const getPersistor = () => {
|
|
2016
|
+
if (persistor) return persistor;
|
|
2017
|
+
|
|
2018
|
+
const onRehydrateComplete = () => {};
|
|
2019
|
+
|
|
2020
|
+
persistor = (0,external_redux_persist_namespaceObject.persistStore)(store, null, onRehydrateComplete);
|
|
2021
|
+
return persistor;
|
|
2022
|
+
};
|
|
2023
|
+
;// CONCATENATED MODULE: ./src/utils/withReduxProvider.js
|
|
2024
|
+
/**
|
|
2025
|
+
* Copyright 2026 OpenStack Foundation
|
|
2026
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2027
|
+
* you may not use this file except in compliance with the License.
|
|
2028
|
+
* You may obtain a copy of the License at
|
|
2029
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2030
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2031
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2032
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2033
|
+
* See the License for the specific language governing permissions and
|
|
2034
|
+
* limitations under the License.
|
|
2035
|
+
*
|
|
2036
|
+
* HOC to wrap a component with Redux Provider and PersistGate.
|
|
2037
|
+
**/
|
|
2038
|
+
|
|
2039
|
+
|
|
2040
|
+
|
|
2041
|
+
|
|
2042
|
+
const withReduxProvider = WrappedComponent => {
|
|
2043
|
+
class WithReduxProvider extends (external_react_default()).PureComponent {
|
|
2044
|
+
constructor(props) {
|
|
2045
|
+
super(props);
|
|
2046
|
+
this.store = getStore(props.clientId, props.apiBaseUrl, props.getAccessToken);
|
|
2047
|
+
}
|
|
2048
|
+
|
|
2049
|
+
render() {
|
|
2050
|
+
return /*#__PURE__*/external_react_default().createElement(external_react_redux_.Provider, {
|
|
2051
|
+
store: this.store
|
|
2052
|
+
}, /*#__PURE__*/external_react_default().createElement(react_namespaceObject.PersistGate, {
|
|
2053
|
+
persistor: getPersistor()
|
|
2054
|
+
}, /*#__PURE__*/external_react_default().createElement(WrappedComponent, this.props)));
|
|
2055
|
+
}
|
|
2056
|
+
|
|
2057
|
+
} // Copy propTypes and defaultProps from wrapped component
|
|
2058
|
+
|
|
2059
|
+
|
|
2060
|
+
WithReduxProvider.propTypes = WrappedComponent.propTypes;
|
|
2061
|
+
WithReduxProvider.defaultProps = WrappedComponent.defaultProps;
|
|
2062
|
+
WithReduxProvider.displayName = `WithReduxProvider(${WrappedComponent.displayName || WrappedComponent.name || 'Component'})`;
|
|
2063
|
+
return WithReduxProvider;
|
|
2064
|
+
};
|
|
2065
|
+
/* harmony default export */ const utils_withReduxProvider = ((/* unused pure expression or super */ null && (withReduxProvider)));
|
|
2066
|
+
|
|
2067
|
+
/***/ }),
|
|
2068
|
+
|
|
2069
|
+
/***/ 107:
|
|
2070
|
+
/***/ ((module) => {
|
|
2071
|
+
|
|
2072
|
+
module.exports = "data:image/svg+xml,%3c!-- Generator: Adobe Illustrator 25.4.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3e %3csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 812.24 471.64' style='enable-background:new 0 0 812.24 471.64;' xml:space='preserve'%3e %3cstyle type='text/css'%3e .st0%7bfill:%23FFFFFF;%7d .st1%7bfill:%230C64C8;%7d %3c/style%3e %3cg%3e %3cpath class='st0' d='M170.89,146.78l-64.77,178.08h535.23l64.77-178.08L170.89,146.78L170.89,146.78z M384.48,309.44H341.7 l-25.6-80.85l-29.41,80.85h-42.6l41.94-115.3h-65.52l-9.29,25.54h56.62l-10.8,29.7h-56.62l-21.84,60.06h-45.63l53.39-146.78h153.49 l25.72,81.24l29.56-81.24h42.75L384.48,309.44z'/%3e %3cg%3e %3cpath class='st1' d='M588.49,162.71v50.86c-4-4.27-8.59-7.47-13.76-9.61s-10.92-3.21-17.26-3.21c-13.01,0-23.73,4.67-32.17,14.02 c-8.44,9.34-12.66,22.83-12.66,40.45c0,15.75,3.82,29.13,11.46,40.15c7.64,11.01,18.69,16.52,33.17,16.52 c7.2,0,13.74-1.54,19.61-4.6c4.4-2.34,9.27-6.84,14.61-13.52v15.72h38.12V162.71H588.49z M583.59,275.94 c-3.47,4.07-7.8,6.11-13.01,6.11c-4.87,0-8.96-2.02-12.26-6.06s-4.95-10.4-4.95-19.07c0-9.28,1.6-15.88,4.8-19.82 s7.17-5.91,11.91-5.91c5.4,0,9.87,2.05,13.41,6.16c3.53,4.1,5.3,10.33,5.3,18.67C588.79,265.23,587.05,271.87,583.59,275.94z'/%3e %3cpath class='st1' d='M473.92,207.72c-14.37,0-26.03,7.27-26.03,16.25v2.96v45.48h9.09l3.47,37.09h26.95l3.47-37.09h9.09v-45.48 v-2.96C499.95,214.99,488.29,207.72,473.92,207.72z'/%3e %3cellipse transform='matrix(2.075247e-03 -1 1 2.075247e-03 290.6104 655.8611)' class='st1' cx='473.92' cy='182.32' rx='19.87' ry='19.86'/%3e %3c/g%3e %3c/g%3e %3c/svg%3e"
|
|
2073
|
+
|
|
2074
|
+
/***/ }),
|
|
2075
|
+
|
|
2076
|
+
/***/ 802:
|
|
2077
|
+
/***/ ((module) => {
|
|
2078
|
+
|
|
2079
|
+
module.exports = "data:image/svg+xml,%3c!-- Generator: Adobe Illustrator 25.4.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3e %3csvg version='1.1' id='Layer_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 812.24 471.64' style='enable-background:new 0 0 812.24 471.64;' xml:space='preserve'%3e %3cstyle type='text/css'%3e .st0%7bfill:%230C64C8;%7d %3c/style%3e %3cg%3e %3cpath d='M170.89,146.78l-64.77,178.08h535.23l64.77-178.08L170.89,146.78L170.89,146.78z M384.48,309.44H341.7l-25.6-80.85 l-29.41,80.85h-42.6l41.94-115.3h-65.52l-9.29,25.54h56.62l-10.8,29.7h-56.62l-21.84,60.06h-45.63l53.39-146.78h153.49l25.72,81.24 l29.56-81.24h42.75L384.48,309.44z'/%3e %3cg%3e %3cpath class='st0' d='M588.49,162.71v50.86c-4-4.27-8.59-7.47-13.76-9.61s-10.92-3.21-17.26-3.21c-13.01,0-23.73,4.67-32.17,14.02 c-8.44,9.34-12.66,22.83-12.66,40.45c0,15.75,3.82,29.13,11.46,40.15c7.64,11.01,18.69,16.52,33.17,16.52 c7.2,0,13.74-1.54,19.61-4.6c4.4-2.34,9.27-6.84,14.61-13.52v15.72h38.12V162.71H588.49z M583.59,275.94 c-3.47,4.07-7.8,6.11-13.01,6.11c-4.87,0-8.96-2.02-12.26-6.06s-4.95-10.4-4.95-19.07c0-9.28,1.6-15.88,4.8-19.82 s7.17-5.91,11.91-5.91c5.4,0,9.87,2.05,13.41,6.16c3.53,4.1,5.3,10.33,5.3,18.67C588.79,265.23,587.05,271.87,583.59,275.94z'/%3e %3cpath class='st0' d='M473.92,207.72c-14.37,0-26.03,7.27-26.03,16.25v2.96v45.48h9.09l3.47,37.09h26.95l3.47-37.09h9.09v-45.48 v-2.96C499.95,214.99,488.29,207.72,473.92,207.72z'/%3e %3cellipse transform='matrix(2.075247e-03 -1 1 2.075247e-03 290.6104 655.8611)' class='st0' cx='473.92' cy='182.32' rx='19.87' ry='19.86'/%3e %3c/g%3e %3c/g%3e %3c/svg%3e"
|
|
2080
|
+
|
|
2081
|
+
/***/ }),
|
|
2082
|
+
|
|
2083
|
+
/***/ 60:
|
|
2084
|
+
/***/ ((module) => {
|
|
2085
|
+
|
|
2086
|
+
module.exports = "data:image/svg+xml,%3csvg width='20' height='20' viewBox='0 0 20 20' fill='none' xmlns='http://www.w3.org/2000/svg'%3e %3cpath d='M8.11475 2.60519C9.64837 2.25868 11.2529 2.41721 12.6891 3.05713C13.0978 3.23923 13.5767 3.05555 13.7588 2.64686C13.9409 2.23817 13.7572 1.75925 13.3485 1.57714C11.5932 0.795024 9.6321 0.601267 7.75767 1.02477C5.88325 1.44827 4.19593 2.46634 2.94738 3.92714C1.69883 5.38795 0.955938 7.21321 0.829498 9.13072C0.703058 11.0482 1.19985 12.9552 2.24577 14.5673C3.2917 16.1794 4.83072 17.4103 6.6333 18.0762C8.43589 18.7422 10.4055 18.8076 12.2483 18.2627C14.0911 17.7179 15.7084 16.5919 16.859 15.0528C18.0096 13.5137 18.6319 11.6438 18.633 9.72216V8.97638C18.633 8.52896 18.2703 8.16625 17.8228 8.16625C17.3754 8.16625 17.0127 8.52896 17.0127 8.97638V9.72123C17.0118 11.2935 16.5027 12.8234 15.5613 14.0827C14.6199 15.342 13.2966 16.2632 11.7889 16.709C10.2811 17.1548 8.66965 17.1012 7.19481 16.5564C5.71996 16.0115 4.46077 15.0045 3.60501 13.6855C2.74925 12.3665 2.34279 10.8062 2.44624 9.23733C2.54969 7.66846 3.15751 6.17506 4.17905 4.97986C5.2006 3.78465 6.58112 2.95169 8.11475 2.60519Z' fill='%2392CD76'/%3e %3cpath d='M18.396 3.81325C18.7122 3.49672 18.7119 2.98378 18.3954 2.66756C18.0789 2.35134 17.5659 2.3516 17.2497 2.66813L9.72129 10.2041L7.86404 8.34683C7.54767 8.03046 7.03472 8.03046 6.71835 8.34683C6.40197 8.66321 6.40197 9.17615 6.71835 9.49253L9.14873 11.9229C9.30071 12.0749 9.50685 12.1602 9.72178 12.1602C9.93671 12.1601 10.1428 12.0747 10.2947 11.9226L18.396 3.81325Z' fill='%2392CD76'/%3e %3c/svg%3e"
|
|
2087
|
+
|
|
2088
|
+
/***/ }),
|
|
2089
|
+
|
|
2090
|
+
/***/ 267:
|
|
2091
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
2092
|
+
|
|
2093
|
+
var map = {
|
|
2094
|
+
"./en.json": 443
|
|
2095
|
+
};
|
|
2096
|
+
|
|
2097
|
+
|
|
2098
|
+
function webpackContext(req) {
|
|
2099
|
+
var id = webpackContextResolve(req);
|
|
2100
|
+
return __webpack_require__(id);
|
|
2101
|
+
}
|
|
2102
|
+
function webpackContextResolve(req) {
|
|
2103
|
+
if(!__webpack_require__.o(map, req)) {
|
|
2104
|
+
var e = new Error("Cannot find module '" + req + "'");
|
|
2105
|
+
e.code = 'MODULE_NOT_FOUND';
|
|
2106
|
+
throw e;
|
|
2107
|
+
}
|
|
2108
|
+
return map[req];
|
|
2109
|
+
}
|
|
2110
|
+
webpackContext.keys = function webpackContextKeys() {
|
|
2111
|
+
return Object.keys(map);
|
|
2112
|
+
};
|
|
2113
|
+
webpackContext.resolve = webpackContextResolve;
|
|
2114
|
+
module.exports = webpackContext;
|
|
2115
|
+
webpackContext.id = 267;
|
|
2116
|
+
|
|
2117
|
+
/***/ }),
|
|
2118
|
+
|
|
2119
|
+
/***/ 580:
|
|
2120
|
+
/***/ ((module) => {
|
|
2121
|
+
|
|
2122
|
+
"use strict";
|
|
2123
|
+
module.exports = require("prop-types");
|
|
2124
|
+
|
|
2125
|
+
/***/ }),
|
|
2126
|
+
|
|
2127
|
+
/***/ 689:
|
|
2128
|
+
/***/ ((module) => {
|
|
2129
|
+
|
|
2130
|
+
"use strict";
|
|
2131
|
+
module.exports = require("react");
|
|
2132
|
+
|
|
2133
|
+
/***/ }),
|
|
2134
|
+
|
|
2135
|
+
/***/ 22:
|
|
2136
|
+
/***/ ((module) => {
|
|
2137
|
+
|
|
2138
|
+
"use strict";
|
|
2139
|
+
module.exports = require("react-redux");
|
|
2140
|
+
|
|
2141
|
+
/***/ }),
|
|
2142
|
+
|
|
2143
|
+
/***/ 271:
|
|
2144
|
+
/***/ ((module) => {
|
|
2145
|
+
|
|
2146
|
+
"use strict";
|
|
2147
|
+
module.exports = require("sweetalert2");
|
|
2148
|
+
|
|
2149
|
+
/***/ }),
|
|
2150
|
+
|
|
2151
|
+
/***/ 443:
|
|
2152
|
+
/***/ ((module) => {
|
|
2153
|
+
|
|
2154
|
+
"use strict";
|
|
2155
|
+
module.exports = JSON.parse('{"purchase_complete_step":{"title":" Your order is complete","initial_order_complete_1st_paragraph_label":"A ticket has been assigned to {attendee}. To complete {adv} additional ticket details, please click the \\"{button}\\" button.","initial_order_complete_button":"Finish Now","order_complete_1st_paragraph_label":"You may visit the \\"My Orders/Tickets\\" tab in the top right-hand corner of the navigation bar to\\n assign/reassign tickets or to complete any required ticket details.","order_complete_button":"View My Orders/Tickets","access_event_button":"Access Event Now","initial_order_footer_label":"If you wish to transfer your assigned ticket, close this window and visit the \\"My Orders/Tickets\\" tab in the top navigation bar. ","footer_assistance_text":"For further assistance, please email <a href=\\"mailto:{supportEmail}\\">{supportEmail}</a>","event_will_start_text":"The event will start on {date} at {time} {time_zone_label}"},"ticket_type":{"ticket_quantity_tooltip":"Only one ticket type can be selected per order. To purchase multiple ticket types, please place a separate registration order for each ticket type."},"promo_code":{"promo_code_tooltip":"Only one promo code can be used per order; the code will be applied to all tickets in this order. If you\'d like to use multiple promo codes, please place a separate registration order for each promo code."}}');
|
|
2156
|
+
|
|
2157
|
+
/***/ })
|
|
2158
|
+
|
|
2159
|
+
/******/ });
|
|
2160
|
+
/************************************************************************/
|
|
2161
|
+
/******/ // The module cache
|
|
2162
|
+
/******/ var __webpack_module_cache__ = {};
|
|
2163
|
+
/******/
|
|
2164
|
+
/******/ // The require function
|
|
2165
|
+
/******/ function __webpack_require__(moduleId) {
|
|
2166
|
+
/******/ // Check if module is in cache
|
|
2167
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
2168
|
+
/******/ if (cachedModule !== undefined) {
|
|
2169
|
+
/******/ return cachedModule.exports;
|
|
2170
|
+
/******/ }
|
|
2171
|
+
/******/ // Create a new module (and put it into the cache)
|
|
2172
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
2173
|
+
/******/ // no module.id needed
|
|
2174
|
+
/******/ // no module.loaded needed
|
|
2175
|
+
/******/ exports: {}
|
|
2176
|
+
/******/ };
|
|
2177
|
+
/******/
|
|
2178
|
+
/******/ // Execute the module function
|
|
2179
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
2180
|
+
/******/
|
|
2181
|
+
/******/ // Return the exports of the module
|
|
2182
|
+
/******/ return module.exports;
|
|
2183
|
+
/******/ }
|
|
2184
|
+
/******/
|
|
2185
|
+
/************************************************************************/
|
|
2186
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
2187
|
+
/******/ (() => {
|
|
2188
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
2189
|
+
/******/ __webpack_require__.n = (module) => {
|
|
2190
|
+
/******/ var getter = module && module.__esModule ?
|
|
2191
|
+
/******/ () => (module['default']) :
|
|
2192
|
+
/******/ () => (module);
|
|
2193
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
2194
|
+
/******/ return getter;
|
|
2195
|
+
/******/ };
|
|
2196
|
+
/******/ })();
|
|
2197
|
+
/******/
|
|
2198
|
+
/******/ /* webpack/runtime/define property getters */
|
|
2199
|
+
/******/ (() => {
|
|
2200
|
+
/******/ // define getter functions for harmony exports
|
|
2201
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
|
2202
|
+
/******/ for(var key in definition) {
|
|
2203
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
2204
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
2205
|
+
/******/ }
|
|
2206
|
+
/******/ }
|
|
2207
|
+
/******/ };
|
|
2208
|
+
/******/ })();
|
|
2209
|
+
/******/
|
|
2210
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
2211
|
+
/******/ (() => {
|
|
2212
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
2213
|
+
/******/ })();
|
|
2214
|
+
/******/
|
|
2215
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
2216
|
+
/******/ (() => {
|
|
2217
|
+
/******/ // define __esModule on exports
|
|
2218
|
+
/******/ __webpack_require__.r = (exports) => {
|
|
2219
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
2220
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2221
|
+
/******/ }
|
|
2222
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
2223
|
+
/******/ };
|
|
2224
|
+
/******/ })();
|
|
2225
|
+
/******/
|
|
2226
|
+
/************************************************************************/
|
|
2227
|
+
var __webpack_exports__ = {};
|
|
2228
|
+
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
|
|
2229
|
+
(() => {
|
|
2230
|
+
"use strict";
|
|
2231
|
+
// ESM COMPAT FLAG
|
|
2232
|
+
__webpack_require__.r(__webpack_exports__);
|
|
2233
|
+
|
|
2234
|
+
// EXPORTS
|
|
2235
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
2236
|
+
"RegistrationForm": () => (/* binding */ RegistrationForm),
|
|
2237
|
+
"default": () => (/* binding */ registration_form)
|
|
2238
|
+
});
|
|
2239
|
+
|
|
2240
|
+
// EXTERNAL MODULE: external "react"
|
|
2241
|
+
var external_react_ = __webpack_require__(689);
|
|
2242
|
+
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
2243
|
+
// EXTERNAL MODULE: external "react-redux"
|
|
2244
|
+
var external_react_redux_ = __webpack_require__(22);
|
|
2245
|
+
// EXTERNAL MODULE: external "prop-types"
|
|
2246
|
+
var external_prop_types_ = __webpack_require__(580);
|
|
2247
|
+
var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
|
|
2248
|
+
// EXTERNAL MODULE: ./src/utils/withReduxProvider.js + 9 modules
|
|
2249
|
+
var withReduxProvider = __webpack_require__(974);
|
|
2250
|
+
;// CONCATENATED MODULE: external "react-spring"
|
|
2251
|
+
const external_react_spring_namespaceObject = require("react-spring");
|
|
2252
|
+
;// CONCATENATED MODULE: external "react-use"
|
|
2253
|
+
const external_react_use_namespaceObject = require("react-use");
|
|
2254
|
+
;// CONCATENATED MODULE: external "openstack-uicore-foundation/lib/security/constants"
|
|
2255
|
+
const constants_namespaceObject = require("openstack-uicore-foundation/lib/security/constants");
|
|
2256
|
+
// EXTERNAL MODULE: ./src/actions.js + 5 modules
|
|
2257
|
+
var actions = __webpack_require__(595);
|
|
2258
|
+
;// CONCATENATED MODULE: external "openstack-uicore-foundation/lib/components/ajaxloader"
|
|
2259
|
+
const ajaxloader_namespaceObject = require("openstack-uicore-foundation/lib/components/ajaxloader");
|
|
2260
|
+
var ajaxloader_default = /*#__PURE__*/__webpack_require__.n(ajaxloader_namespaceObject);
|
|
2261
|
+
;// CONCATENATED MODULE: external "openstack-uicore-foundation/lib/components/clock"
|
|
2262
|
+
const clock_namespaceObject = require("openstack-uicore-foundation/lib/components/clock");
|
|
2263
|
+
var clock_default = /*#__PURE__*/__webpack_require__.n(clock_namespaceObject);
|
|
2264
|
+
// EXTERNAL MODULE: ./src/components/login/index.js + 2 modules
|
|
2265
|
+
var login = __webpack_require__(462);
|
|
2266
|
+
;// CONCATENATED MODULE: ./src/components/payment/index.module.scss
|
|
2267
|
+
// extracted by mini-css-extract-plugin
|
|
2268
|
+
/* harmony default export */ const index_module = ({"title":"title___LksVm","form":"form___v5GIx","fieldWrapper":"fieldWrapper___Eoe61"});
|
|
2269
|
+
;// CONCATENATED MODULE: external "openstack-uicore-foundation/lib/components"
|
|
2270
|
+
const components_namespaceObject = require("openstack-uicore-foundation/lib/components");
|
|
2271
|
+
// EXTERNAL MODULE: external "sweetalert2"
|
|
2272
|
+
var external_sweetalert2_ = __webpack_require__(271);
|
|
2273
|
+
var external_sweetalert2_default = /*#__PURE__*/__webpack_require__.n(external_sweetalert2_);
|
|
2274
|
+
;// CONCATENATED MODULE: external "openstack-uicore-foundation/lib/utils/methods"
|
|
2275
|
+
const methods_namespaceObject = require("openstack-uicore-foundation/lib/utils/methods");
|
|
2276
|
+
;// CONCATENATED MODULE: ./src/components/lawpay-form/index.module.scss
|
|
2277
|
+
// extracted by mini-css-extract-plugin
|
|
2278
|
+
/* harmony default export */ const lawpay_form_index_module = ({"form":"form___zXb7s","fieldWrapper":"fieldWrapper___G4Wqw","inputWrapper":"inputWrapper___Yz5zB","fieldRow":"fieldRow___NfZdJ","addressField":"addressField___vmAQh","lawpayWrapper":"lawpayWrapper___hpUBf","dateWrapper":"dateWrapper___XDfqs","dropdown":"dropdown___l3_bk","fieldError":"fieldError___Igq3U"});
|
|
2279
|
+
// EXTERNAL MODULE: ./src/utils/constants.js
|
|
2280
|
+
var constants = __webpack_require__(243);
|
|
2281
|
+
;// CONCATENATED MODULE: ./src/components/lawpay-form/index.js
|
|
2282
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2283
|
+
|
|
2284
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2285
|
+
|
|
2286
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2287
|
+
|
|
2288
|
+
/**
|
|
2289
|
+
* Copyright 2022 OpenStack Foundation
|
|
2290
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2291
|
+
* you may not use this file except in compliance with the License.
|
|
2292
|
+
* You may obtain a copy of the License at
|
|
2293
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2294
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2295
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2296
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2297
|
+
* See the License for the specific language governing permissions and
|
|
2298
|
+
* limitations under the License.
|
|
2299
|
+
**/
|
|
2300
|
+
|
|
2301
|
+
|
|
2302
|
+
|
|
2303
|
+
|
|
2304
|
+
|
|
2305
|
+
|
|
2306
|
+
|
|
2307
|
+
const LawPayForm = ({
|
|
2308
|
+
reservation,
|
|
2309
|
+
payTicket,
|
|
2310
|
+
userProfile,
|
|
2311
|
+
providerKey,
|
|
2312
|
+
provider,
|
|
2313
|
+
timestamp
|
|
2314
|
+
}) => {
|
|
2315
|
+
const [hostedFields, setHostedFields] = (0,external_react_.useState)(null);
|
|
2316
|
+
const [lawPayFields, setLawPayFields] = (0,external_react_.useState)({
|
|
2317
|
+
exp_month: '',
|
|
2318
|
+
exp_year: '',
|
|
2319
|
+
postal_code: userProfile.postal_code || '',
|
|
2320
|
+
address1: userProfile.address1 || ''
|
|
2321
|
+
});
|
|
2322
|
+
const [lawPayErrors, setLawPayErrors] = (0,external_react_.useState)({
|
|
2323
|
+
exp_month: '',
|
|
2324
|
+
exp_year: '',
|
|
2325
|
+
postal_code: '',
|
|
2326
|
+
credit_card_number: '',
|
|
2327
|
+
cvv: '',
|
|
2328
|
+
address1: ''
|
|
2329
|
+
});
|
|
2330
|
+
let textColor = constants.DefaultTextColor;
|
|
2331
|
+
let hintColor = constants.DefaultHintColor;
|
|
2332
|
+
|
|
2333
|
+
if (document && document.documentElement) {
|
|
2334
|
+
const documentStyles = getComputedStyle(document.documentElement);
|
|
2335
|
+
textColor = documentStyles.getPropertyValue('--color_input_text_color');
|
|
2336
|
+
hintColor = documentStyles.getPropertyValue('--color_text_input_hints');
|
|
2337
|
+
}
|
|
2338
|
+
|
|
2339
|
+
const style = {
|
|
2340
|
+
color: textColor,
|
|
2341
|
+
"font-size": '16px',
|
|
2342
|
+
"font-weight": 'inherit',
|
|
2343
|
+
'::placeholder': {
|
|
2344
|
+
color: hintColor
|
|
2345
|
+
}
|
|
2346
|
+
};
|
|
2347
|
+
const hostedFieldsConfiguration = {
|
|
2348
|
+
publicKey: `${providerKey}`,
|
|
2349
|
+
fields: [{
|
|
2350
|
+
selector: "#my_credit_card_field_id",
|
|
2351
|
+
input: {
|
|
2352
|
+
type: "credit_card_number",
|
|
2353
|
+
placeholder: "Credit Card Number",
|
|
2354
|
+
css: style
|
|
2355
|
+
}
|
|
2356
|
+
}, {
|
|
2357
|
+
selector: "#my_cvv_field_id",
|
|
2358
|
+
input: {
|
|
2359
|
+
type: "cvv",
|
|
2360
|
+
placeholder: "CCV",
|
|
2361
|
+
css: style
|
|
2362
|
+
}
|
|
2363
|
+
}]
|
|
2364
|
+
};
|
|
2365
|
+
|
|
2366
|
+
const hostedFieldsCallBack = state => {
|
|
2367
|
+
let fieldErrors = {};
|
|
2368
|
+
state.fields.map(f => {
|
|
2369
|
+
if (f.focus && f.error !== 'Input field is empty') fieldErrors = _objectSpread(_objectSpread({}, fieldErrors), {}, {
|
|
2370
|
+
[f.type]: f.error
|
|
2371
|
+
});
|
|
2372
|
+
});
|
|
2373
|
+
setLawPayErrors(_objectSpread(_objectSpread({}, lawPayErrors), fieldErrors));
|
|
2374
|
+
};
|
|
2375
|
+
|
|
2376
|
+
(0,external_react_.useEffect)(() => {
|
|
2377
|
+
if (window.AffiniPay && !hostedFields) {
|
|
2378
|
+
setHostedFields(window.AffiniPay.HostedFields.initializeFields(hostedFieldsConfiguration, hostedFieldsCallBack));
|
|
2379
|
+
}
|
|
2380
|
+
}, [reservation]);
|
|
2381
|
+
|
|
2382
|
+
const onExpireChange = ev => {
|
|
2383
|
+
setLawPayFields(_objectSpread(_objectSpread({}, lawPayFields), {}, {
|
|
2384
|
+
[ev.target.id]: ev.target.value
|
|
2385
|
+
}));
|
|
2386
|
+
};
|
|
2387
|
+
|
|
2388
|
+
const formHasErrors = () => {
|
|
2389
|
+
let errors = {};
|
|
2390
|
+
Object.keys(lawPayFields).map(key => {
|
|
2391
|
+
if (!lawPayFields[key] || lawPayFields[key] === '') {
|
|
2392
|
+
errors = _objectSpread(_objectSpread({}, errors), {}, {
|
|
2393
|
+
[key]: 'This field is required.'
|
|
2394
|
+
});
|
|
2395
|
+
}
|
|
2396
|
+
});
|
|
2397
|
+
setLawPayErrors(_objectSpread(_objectSpread({}, lawPayErrors), errors));
|
|
2398
|
+
return Object.keys(errors).length > 0;
|
|
2399
|
+
};
|
|
2400
|
+
|
|
2401
|
+
const onSubmit = async event => {
|
|
2402
|
+
event.preventDefault();
|
|
2403
|
+
|
|
2404
|
+
if (!hostedFields) {
|
|
2405
|
+
// Affinity Pay has not loaded yet. Make sure to disable
|
|
2406
|
+
// form submission until Affinity Pay has loaded.
|
|
2407
|
+
return;
|
|
2408
|
+
}
|
|
2409
|
+
|
|
2410
|
+
if (!formHasErrors()) {
|
|
2411
|
+
try {
|
|
2412
|
+
const token = await hostedFields.getPaymentToken({
|
|
2413
|
+
"postal_code": lawPayFields.postal_code,
|
|
2414
|
+
"address1": lawPayFields.address1,
|
|
2415
|
+
"exp_year": lawPayFields.exp_year,
|
|
2416
|
+
"exp_month": lawPayFields.exp_month,
|
|
2417
|
+
"email": userProfile.email,
|
|
2418
|
+
"name": `${reservation.owner_first_name} ${reservation.owner_last_name}`,
|
|
2419
|
+
"reference": `summit_${reservation.summit_id}_order_${reservation.id}`
|
|
2420
|
+
});
|
|
2421
|
+
payTicket(provider, {
|
|
2422
|
+
token
|
|
2423
|
+
});
|
|
2424
|
+
} catch (error) {
|
|
2425
|
+
external_sweetalert2_default().fire("Payment error", error.message, "warning");
|
|
2426
|
+
}
|
|
2427
|
+
}
|
|
2428
|
+
};
|
|
2429
|
+
|
|
2430
|
+
const ddl_month = [{
|
|
2431
|
+
label: '1 - January',
|
|
2432
|
+
value: '01'
|
|
2433
|
+
}, {
|
|
2434
|
+
label: '2 - February',
|
|
2435
|
+
value: '02'
|
|
2436
|
+
}, {
|
|
2437
|
+
label: '3 - March',
|
|
2438
|
+
value: '03'
|
|
2439
|
+
}, {
|
|
2440
|
+
label: '4 - April',
|
|
2441
|
+
value: '04'
|
|
2442
|
+
}, {
|
|
2443
|
+
label: '5 - May',
|
|
2444
|
+
value: '05'
|
|
2445
|
+
}, {
|
|
2446
|
+
label: '6 - June',
|
|
2447
|
+
value: '06'
|
|
2448
|
+
}, {
|
|
2449
|
+
label: '7 - July',
|
|
2450
|
+
value: '07'
|
|
2451
|
+
}, {
|
|
2452
|
+
label: '8 - August',
|
|
2453
|
+
value: '08'
|
|
2454
|
+
}, {
|
|
2455
|
+
label: '9 - September',
|
|
2456
|
+
value: '09'
|
|
2457
|
+
}, {
|
|
2458
|
+
label: '10 - October',
|
|
2459
|
+
value: '10'
|
|
2460
|
+
}, {
|
|
2461
|
+
label: '11 - November',
|
|
2462
|
+
value: '11'
|
|
2463
|
+
}, {
|
|
2464
|
+
label: '12 - December',
|
|
2465
|
+
value: '12'
|
|
2466
|
+
}];
|
|
2467
|
+
const current_year = (0,methods_namespaceObject.epochToMomentTimeZone)(timestamp, 'utc').year();
|
|
2468
|
+
const year_ddl = Array.from({
|
|
2469
|
+
length: 15
|
|
2470
|
+
}, (_, i) => {
|
|
2471
|
+
return {
|
|
2472
|
+
label: `${current_year + i}`,
|
|
2473
|
+
value: `${current_year + i}`
|
|
2474
|
+
};
|
|
2475
|
+
});
|
|
2476
|
+
const customStyles = {
|
|
2477
|
+
option: (provided, {
|
|
2478
|
+
isFocused,
|
|
2479
|
+
isSelected
|
|
2480
|
+
}) => {
|
|
2481
|
+
return _objectSpread(_objectSpread({}, provided), {}, {
|
|
2482
|
+
backgroundColor: isFocused ? 'var(--color-primary)' : isSelected ? 'var(--color-primary)' : undefined,
|
|
2483
|
+
color: 'var(--color_text_dark)',
|
|
2484
|
+
':active': _objectSpread(_objectSpread({}, provided[':active']), {}, {
|
|
2485
|
+
backgroundColor: isSelected ? 'var(--color-primary)' : undefined
|
|
2486
|
+
})
|
|
2487
|
+
});
|
|
2488
|
+
},
|
|
2489
|
+
placeholder: (provided, state) => _objectSpread(_objectSpread({}, provided), {}, {
|
|
2490
|
+
color: 'var(--color_text_input_hints)'
|
|
2491
|
+
}),
|
|
2492
|
+
menu: (provided, state) => _objectSpread(_objectSpread({}, provided), {}, {
|
|
2493
|
+
color: 'var(--color_text_dark)',
|
|
2494
|
+
zIndex: '100'
|
|
2495
|
+
}),
|
|
2496
|
+
menuList: provided => _objectSpread(_objectSpread({}, provided), {}, {
|
|
2497
|
+
maxHeight: 160
|
|
2498
|
+
}),
|
|
2499
|
+
singleValue: (provided, state) => {
|
|
2500
|
+
const opacity = state.isDisabled ? 0.5 : 1;
|
|
2501
|
+
const transition = 'opacity 300ms';
|
|
2502
|
+
const color = 'var(--color_text_dark)';
|
|
2503
|
+
return _objectSpread(_objectSpread({}, provided), {}, {
|
|
2504
|
+
opacity,
|
|
2505
|
+
transition,
|
|
2506
|
+
color
|
|
2507
|
+
});
|
|
2508
|
+
}
|
|
2509
|
+
};
|
|
2510
|
+
return /*#__PURE__*/external_react_default().createElement("form", {
|
|
2511
|
+
className: lawpay_form_index_module.form,
|
|
2512
|
+
id: "payment-form",
|
|
2513
|
+
onSubmit: onSubmit
|
|
2514
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2515
|
+
className: lawpay_form_index_module.fieldWrapper
|
|
2516
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2517
|
+
className: lawpay_form_index_module.inputWrapper
|
|
2518
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2519
|
+
id: "my_credit_card_field_id",
|
|
2520
|
+
className: lawpay_form_index_module.lawpayWrapper
|
|
2521
|
+
}), /*#__PURE__*/external_react_default().createElement("i", {
|
|
2522
|
+
className: "fa fa-credit-card"
|
|
2523
|
+
})), lawPayErrors.credit_card_number && /*#__PURE__*/external_react_default().createElement("div", {
|
|
2524
|
+
className: lawpay_form_index_module.fieldError
|
|
2525
|
+
}, lawPayErrors.credit_card_number)), /*#__PURE__*/external_react_default().createElement("div", {
|
|
2526
|
+
className: lawpay_form_index_module.fieldWrapper
|
|
2527
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2528
|
+
className: lawpay_form_index_module.dateWrapper
|
|
2529
|
+
}, /*#__PURE__*/external_react_default().createElement("div", null, /*#__PURE__*/external_react_default().createElement(components_namespaceObject.Dropdown, {
|
|
2530
|
+
styles: customStyles,
|
|
2531
|
+
className: lawpay_form_index_module.dropdown,
|
|
2532
|
+
placeholder: "Month",
|
|
2533
|
+
onChange: onExpireChange,
|
|
2534
|
+
id: "exp_month",
|
|
2535
|
+
options: ddl_month
|
|
2536
|
+
}), lawPayErrors.exp_month && /*#__PURE__*/external_react_default().createElement("div", {
|
|
2537
|
+
className: lawpay_form_index_module.fieldError
|
|
2538
|
+
}, lawPayErrors.exp_month)), /*#__PURE__*/external_react_default().createElement("div", null, /*#__PURE__*/external_react_default().createElement(components_namespaceObject.Dropdown, {
|
|
2539
|
+
styles: customStyles,
|
|
2540
|
+
className: lawpay_form_index_module.dropdown,
|
|
2541
|
+
placeholder: "Year",
|
|
2542
|
+
onChange: onExpireChange,
|
|
2543
|
+
id: "exp_year",
|
|
2544
|
+
options: year_ddl
|
|
2545
|
+
}), lawPayErrors.exp_year && /*#__PURE__*/external_react_default().createElement("div", {
|
|
2546
|
+
className: lawpay_form_index_module.fieldError
|
|
2547
|
+
}, lawPayErrors.exp_year)))), /*#__PURE__*/external_react_default().createElement("div", {
|
|
2548
|
+
className: lawpay_form_index_module.fieldWrapper
|
|
2549
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2550
|
+
className: lawpay_form_index_module.fieldRow
|
|
2551
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2552
|
+
className: lawpay_form_index_module.inputWrapper
|
|
2553
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2554
|
+
id: "my_cvv_field_id",
|
|
2555
|
+
className: lawpay_form_index_module.lawpayWrapper
|
|
2556
|
+
})), /*#__PURE__*/external_react_default().createElement("div", {
|
|
2557
|
+
className: lawpay_form_index_module.inputWrapper
|
|
2558
|
+
}, /*#__PURE__*/external_react_default().createElement("input", {
|
|
2559
|
+
type: "text",
|
|
2560
|
+
name: "postal_code",
|
|
2561
|
+
placeholder: "ZIP Code *",
|
|
2562
|
+
value: lawPayFields.postal_code,
|
|
2563
|
+
onChange: e => setLawPayFields(_objectSpread(_objectSpread({}, lawPayFields), {}, {
|
|
2564
|
+
postal_code: e.target.value
|
|
2565
|
+
}))
|
|
2566
|
+
}))), /*#__PURE__*/external_react_default().createElement("div", {
|
|
2567
|
+
className: lawpay_form_index_module.fieldRow
|
|
2568
|
+
}, lawPayErrors.cvv && /*#__PURE__*/external_react_default().createElement("div", {
|
|
2569
|
+
className: lawpay_form_index_module.fieldError
|
|
2570
|
+
}, lawPayErrors.cvv), lawPayErrors.postal_code && /*#__PURE__*/external_react_default().createElement("div", {
|
|
2571
|
+
className: lawpay_form_index_module.fieldError
|
|
2572
|
+
}, lawPayErrors.postal_code))), /*#__PURE__*/external_react_default().createElement("div", {
|
|
2573
|
+
className: lawpay_form_index_module.fieldWrapper
|
|
2574
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2575
|
+
className: `${lawpay_form_index_module.inputWrapper} ${lawpay_form_index_module.addressField}`
|
|
2576
|
+
}, /*#__PURE__*/external_react_default().createElement("input", {
|
|
2577
|
+
type: "text",
|
|
2578
|
+
name: "address1",
|
|
2579
|
+
placeholder: "Address *",
|
|
2580
|
+
value: lawPayFields.address1,
|
|
2581
|
+
onChange: e => setLawPayFields(_objectSpread(_objectSpread({}, lawPayFields), {}, {
|
|
2582
|
+
address1: e.target.value
|
|
2583
|
+
}))
|
|
2584
|
+
})), lawPayErrors.address1 && /*#__PURE__*/external_react_default().createElement("div", {
|
|
2585
|
+
className: lawpay_form_index_module.fieldError
|
|
2586
|
+
}, lawPayErrors.address1)));
|
|
2587
|
+
};
|
|
2588
|
+
|
|
2589
|
+
/* harmony default export */ const lawpay_form = (LawPayForm);
|
|
2590
|
+
;// CONCATENATED MODULE: external "lodash/merge"
|
|
2591
|
+
const merge_namespaceObject = require("lodash/merge");
|
|
2592
|
+
var merge_default = /*#__PURE__*/__webpack_require__.n(merge_namespaceObject);
|
|
2593
|
+
;// CONCATENATED MODULE: external "@stripe/stripe-js"
|
|
2594
|
+
const stripe_js_namespaceObject = require("@stripe/stripe-js");
|
|
2595
|
+
;// CONCATENATED MODULE: external "@stripe/react-stripe-js"
|
|
2596
|
+
const react_stripe_js_namespaceObject = require("@stripe/react-stripe-js");
|
|
2597
|
+
;// CONCATENATED MODULE: external "react-hook-form"
|
|
2598
|
+
const external_react_hook_form_namespaceObject = require("react-hook-form");
|
|
2599
|
+
;// CONCATENATED MODULE: ./src/components/stripe-form/index.module.scss
|
|
2600
|
+
// extracted by mini-css-extract-plugin
|
|
2601
|
+
/* harmony default export */ const stripe_form_index_module = ({"form":"form___DoT3x","fieldWrapper":"fieldWrapper___wa1Ks","inputWrapper":"inputWrapper___CbXhF","fieldError":"fieldError___QrMYW"});
|
|
2602
|
+
;// CONCATENATED MODULE: ./src/components/stripe-form/index.js
|
|
2603
|
+
function stripe_form_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2604
|
+
|
|
2605
|
+
function stripe_form_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? stripe_form_ownKeys(Object(source), !0).forEach(function (key) { stripe_form_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : stripe_form_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2606
|
+
|
|
2607
|
+
function stripe_form_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2608
|
+
|
|
2609
|
+
/**
|
|
2610
|
+
* Copyright 2020 OpenStack Foundation
|
|
2611
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2612
|
+
* you may not use this file except in compliance with the License.
|
|
2613
|
+
* You may obtain a copy of the License at
|
|
2614
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2615
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2616
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2617
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2618
|
+
* See the License for the specific language governing permissions and
|
|
2619
|
+
* limitations under the License.
|
|
2620
|
+
**/
|
|
2621
|
+
|
|
2622
|
+
|
|
2623
|
+
|
|
2624
|
+
|
|
2625
|
+
|
|
2626
|
+
const stripeErrorCodeMap = {
|
|
2627
|
+
'incomplete_number': {
|
|
2628
|
+
field: 'cardNumber',
|
|
2629
|
+
message: 'This field is required.'
|
|
2630
|
+
},
|
|
2631
|
+
'incorrect_number': {
|
|
2632
|
+
field: 'cardNumber'
|
|
2633
|
+
},
|
|
2634
|
+
'invalid_number': {
|
|
2635
|
+
field: 'cardNumber'
|
|
2636
|
+
},
|
|
2637
|
+
'card_declined': {
|
|
2638
|
+
field: 'cardNumber'
|
|
2639
|
+
},
|
|
2640
|
+
'incomplete_cvc': {
|
|
2641
|
+
field: 'cardCvc',
|
|
2642
|
+
message: 'This field is required.'
|
|
2643
|
+
},
|
|
2644
|
+
'incorrect_cvc': {
|
|
2645
|
+
field: 'cardCvc'
|
|
2646
|
+
},
|
|
2647
|
+
'invalid_cvc': {
|
|
2648
|
+
field: 'cardCvc'
|
|
2649
|
+
},
|
|
2650
|
+
'incomplete_expiry': {
|
|
2651
|
+
field: 'cardExpiry',
|
|
2652
|
+
message: 'This field is required.'
|
|
2653
|
+
},
|
|
2654
|
+
'invalid_expiry_month': {
|
|
2655
|
+
field: 'cardExpiry'
|
|
2656
|
+
},
|
|
2657
|
+
'invalid_expiry_year': {
|
|
2658
|
+
field: 'cardExpiry'
|
|
2659
|
+
},
|
|
2660
|
+
'expired_card': {
|
|
2661
|
+
field: 'cardExpiry'
|
|
2662
|
+
}
|
|
2663
|
+
};
|
|
2664
|
+
|
|
2665
|
+
const StripeForm = ({
|
|
2666
|
+
reservation,
|
|
2667
|
+
payTicket,
|
|
2668
|
+
userProfile,
|
|
2669
|
+
provider,
|
|
2670
|
+
hidePostalCode,
|
|
2671
|
+
stripeReturnUrl,
|
|
2672
|
+
onError
|
|
2673
|
+
}) => {
|
|
2674
|
+
const stripe = (0,react_stripe_js_namespaceObject.useStripe)();
|
|
2675
|
+
const elements = (0,react_stripe_js_namespaceObject.useElements)();
|
|
2676
|
+
const [paymentElement, setPaymentElement] = (0,external_react_.useState)(null);
|
|
2677
|
+
(0,external_react_.useEffect)(() => {
|
|
2678
|
+
if (elements) {
|
|
2679
|
+
setPaymentElement(elements.getElement('payment'));
|
|
2680
|
+
}
|
|
2681
|
+
}, [elements]);
|
|
2682
|
+
const {
|
|
2683
|
+
register,
|
|
2684
|
+
handleSubmit,
|
|
2685
|
+
formState: {
|
|
2686
|
+
errors
|
|
2687
|
+
}
|
|
2688
|
+
} = (0,external_react_hook_form_namespaceObject.useForm)();
|
|
2689
|
+
|
|
2690
|
+
const onSubmit = async (data, ev) => {
|
|
2691
|
+
if (!stripe || !elements) {
|
|
2692
|
+
// Stripe.js has not loaded yet. Make sure to disable
|
|
2693
|
+
// form submission until Stripe.js has loaded.
|
|
2694
|
+
return;
|
|
2695
|
+
}
|
|
2696
|
+
|
|
2697
|
+
const btn = document.getElementById('payment-form-btn');
|
|
2698
|
+
if (btn) btn.disabled = true; // Trigger form validation and wallet collection
|
|
2699
|
+
|
|
2700
|
+
const {
|
|
2701
|
+
error: submitError
|
|
2702
|
+
} = await elements.submit();
|
|
2703
|
+
|
|
2704
|
+
if (submitError) {
|
|
2705
|
+
if (btn) btn.disabled = false;
|
|
2706
|
+
console.log(`StripeForm::onSubmit elements.submit error`, submitError);
|
|
2707
|
+
onError({
|
|
2708
|
+
type: constants.ERROR_TYPE_PAYMENT,
|
|
2709
|
+
msg: stripeErrorCodeMap[submitError?.code]?.message || submitError?.message,
|
|
2710
|
+
exception: submitError
|
|
2711
|
+
});
|
|
2712
|
+
return;
|
|
2713
|
+
}
|
|
2714
|
+
|
|
2715
|
+
try {
|
|
2716
|
+
// Create a payment method using PaymentElement
|
|
2717
|
+
let createPaymentMethodOptions = {
|
|
2718
|
+
elements
|
|
2719
|
+
};
|
|
2720
|
+
let address = {}; // stripe payment payload requires data that's not an empty string
|
|
2721
|
+
|
|
2722
|
+
if (userProfile.locality) address.city = userProfile.locality;
|
|
2723
|
+
if (userProfile.country) address.country = userProfile.country;
|
|
2724
|
+
if (userProfile.address1) address.line1 = userProfile.address1;
|
|
2725
|
+
if (userProfile.address2) address.line2 = userProfile.address2;
|
|
2726
|
+
if (!hidePostalCode && userProfile.postal_code) address.postal_code = userProfile.postal_code;
|
|
2727
|
+
if (userProfile.region) address.state = userProfile.region;
|
|
2728
|
+
createPaymentMethodOptions = stripe_form_objectSpread(stripe_form_objectSpread({}, createPaymentMethodOptions), {}, {
|
|
2729
|
+
params: {
|
|
2730
|
+
billing_details: stripe_form_objectSpread(stripe_form_objectSpread({}, Object.keys(address).length > 0 && {
|
|
2731
|
+
address
|
|
2732
|
+
}), {}, {
|
|
2733
|
+
email: userProfile.email,
|
|
2734
|
+
name: `${reservation.owner_first_name} ${reservation.owner_last_name}`
|
|
2735
|
+
})
|
|
2736
|
+
}
|
|
2737
|
+
});
|
|
2738
|
+
const {
|
|
2739
|
+
paymentMethod,
|
|
2740
|
+
error
|
|
2741
|
+
} = await stripe.createPaymentMethod(createPaymentMethodOptions);
|
|
2742
|
+
|
|
2743
|
+
if (error) {
|
|
2744
|
+
if (btn) btn.disabled = false;
|
|
2745
|
+
console.log(`StripeForm::onSubmit stripe.createPaymentMethod error`, error);
|
|
2746
|
+
onError({
|
|
2747
|
+
type: constants.ERROR_TYPE_PAYMENT,
|
|
2748
|
+
msg: stripeErrorCodeMap[error?.code]?.message || error.message,
|
|
2749
|
+
exception: error
|
|
2750
|
+
});
|
|
2751
|
+
if (paymentElement) paymentElement.clear();
|
|
2752
|
+
return;
|
|
2753
|
+
} // Send the paymentMethod ID to your server
|
|
2754
|
+
|
|
2755
|
+
|
|
2756
|
+
if (paymentMethod) payTicket(provider, {
|
|
2757
|
+
elements,
|
|
2758
|
+
paymentMethod,
|
|
2759
|
+
stripe,
|
|
2760
|
+
stripeReturnUrl,
|
|
2761
|
+
onError
|
|
2762
|
+
});
|
|
2763
|
+
} catch (e) {
|
|
2764
|
+
console.log(`StripeForm::onSubmit general error`, e);
|
|
2765
|
+
onError({
|
|
2766
|
+
type: constants.ERROR_TYPE_PAYMENT,
|
|
2767
|
+
msg: stripeErrorCodeMap[e?.code]?.message || e.message,
|
|
2768
|
+
exception: e
|
|
2769
|
+
});
|
|
2770
|
+
}
|
|
2771
|
+
};
|
|
2772
|
+
|
|
2773
|
+
const paymentOptions = {
|
|
2774
|
+
layout: {
|
|
2775
|
+
type: 'tabs',
|
|
2776
|
+
defaultCollapsed: false
|
|
2777
|
+
},
|
|
2778
|
+
fields: {
|
|
2779
|
+
billingDetails: {
|
|
2780
|
+
address: {
|
|
2781
|
+
postalCode: hidePostalCode ? "never" : "auto"
|
|
2782
|
+
}
|
|
2783
|
+
}
|
|
2784
|
+
}
|
|
2785
|
+
};
|
|
2786
|
+
return /*#__PURE__*/external_react_default().createElement("form", {
|
|
2787
|
+
className: stripe_form_index_module.form,
|
|
2788
|
+
id: "payment-form",
|
|
2789
|
+
onSubmit: handleSubmit(onSubmit)
|
|
2790
|
+
}, /*#__PURE__*/external_react_default().createElement(react_stripe_js_namespaceObject.PaymentElement, {
|
|
2791
|
+
options: paymentOptions
|
|
2792
|
+
}));
|
|
2793
|
+
};
|
|
2794
|
+
|
|
2795
|
+
/* harmony default export */ const stripe_form = (StripeForm);
|
|
2796
|
+
// EXTERNAL MODULE: ./src/utils/utils.js + 1 modules
|
|
2797
|
+
var utils = __webpack_require__(452);
|
|
2798
|
+
;// CONCATENATED MODULE: ./src/components/stripe-component/index.js
|
|
2799
|
+
/**
|
|
2800
|
+
* Copyright 2020 OpenStack Foundation
|
|
2801
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2802
|
+
* you may not use this file except in compliance with the License.
|
|
2803
|
+
* You may obtain a copy of the License at
|
|
2804
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2805
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2806
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2807
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2808
|
+
* See the License for the specific language governing permissions and
|
|
2809
|
+
* limitations under the License.
|
|
2810
|
+
**/
|
|
2811
|
+
|
|
2812
|
+
|
|
2813
|
+
|
|
2814
|
+
|
|
2815
|
+
|
|
2816
|
+
|
|
2817
|
+
|
|
2818
|
+
|
|
2819
|
+
const StripeProvider = ({
|
|
2820
|
+
userProfile,
|
|
2821
|
+
reservation,
|
|
2822
|
+
payTicket,
|
|
2823
|
+
providerKey,
|
|
2824
|
+
provider,
|
|
2825
|
+
stripeOptions,
|
|
2826
|
+
stripeReturnUrl,
|
|
2827
|
+
hidePostalCode,
|
|
2828
|
+
onError
|
|
2829
|
+
}) => {
|
|
2830
|
+
const stripePromise = (0,external_react_.useMemo)(() => (0,stripe_js_namespaceObject.loadStripe)(providerKey), [providerKey]);
|
|
2831
|
+
let bgColor = constants.DefaultBGColor;
|
|
2832
|
+
let bgColorDark = constants.DefaultBGColor;
|
|
2833
|
+
let textColor = constants.DefaultTextColor;
|
|
2834
|
+
let textColorDark = constants.DefaultTextColor;
|
|
2835
|
+
let hintColor = constants.DefaultHintColor;
|
|
2836
|
+
let borderColor = constants.DefaultHintColor;
|
|
2837
|
+
|
|
2838
|
+
if (document && document.documentElement) {
|
|
2839
|
+
const documentStyles = getComputedStyle(document.documentElement);
|
|
2840
|
+
bgColor = documentStyles.getPropertyValue('--color_input_background_color');
|
|
2841
|
+
textColor = documentStyles.getPropertyValue('--color_input_text_color');
|
|
2842
|
+
textColorDark = documentStyles.getPropertyValue('--color_text_light');
|
|
2843
|
+
bgColorDark = documentStyles.getPropertyValue('--color_background_dark');
|
|
2844
|
+
hintColor = documentStyles.getPropertyValue('--color_text_input_hints');
|
|
2845
|
+
borderColor = documentStyles.getPropertyValue('--color_input_border_color');
|
|
2846
|
+
}
|
|
2847
|
+
|
|
2848
|
+
const stripeStyle = merge_default()({}, {
|
|
2849
|
+
variables: {
|
|
2850
|
+
borderRadius: '5px',
|
|
2851
|
+
colorBackground: bgColor,
|
|
2852
|
+
colorTextPlaceholder: hintColor,
|
|
2853
|
+
colorText: textColor,
|
|
2854
|
+
colorDanger: '#e5424d',
|
|
2855
|
+
textColorDark: textColorDark,
|
|
2856
|
+
bgColorDark: bgColorDark
|
|
2857
|
+
},
|
|
2858
|
+
rules: {
|
|
2859
|
+
'.Block': {
|
|
2860
|
+
backgroundColor: 'var(--colorBackground)',
|
|
2861
|
+
boxShadow: 'none',
|
|
2862
|
+
padding: '12px'
|
|
2863
|
+
},
|
|
2864
|
+
'.Input': {
|
|
2865
|
+
color: 'var(--textColor)',
|
|
2866
|
+
backgroundColor: 'var(--colorBackground)',
|
|
2867
|
+
borderColor: 'var(--hintColor)',
|
|
2868
|
+
padding: '12px'
|
|
2869
|
+
},
|
|
2870
|
+
'.Input:disabled, .Input--invalid:disabled': {
|
|
2871
|
+
color: 'lightgray'
|
|
2872
|
+
},
|
|
2873
|
+
'.Tab': {
|
|
2874
|
+
padding: '10px 12px 8px 12px',
|
|
2875
|
+
border: 'none'
|
|
2876
|
+
},
|
|
2877
|
+
'.Tab:hover': {
|
|
2878
|
+
border: 'none',
|
|
2879
|
+
boxShadow: '0px 1px 1px rgba(0, 0, 0, 0.03), 0px 3px 7px rgba(18, 42, 66, 0.04)'
|
|
2880
|
+
},
|
|
2881
|
+
'.Tab--selected, .Tab--selected:focus, .Tab--selected:hover': {
|
|
2882
|
+
border: 'none',
|
|
2883
|
+
backgroundColor: 'var(--bgColorDark)',
|
|
2884
|
+
color: 'var(--textColorDark)',
|
|
2885
|
+
boxShadow: '0 0 0 1.5px var(--colorPrimaryText), 0px 1px 1px rgba(0, 0, 0, 0.03), 0px 3px 7px rgba(18, 42, 66, 0.04)'
|
|
2886
|
+
},
|
|
2887
|
+
'.Label': {
|
|
2888
|
+
fontWeight: '500',
|
|
2889
|
+
color: 'var(--textColor)'
|
|
2890
|
+
}
|
|
2891
|
+
},
|
|
2892
|
+
invalid: {
|
|
2893
|
+
color: '#e5424d',
|
|
2894
|
+
':focus': {
|
|
2895
|
+
color: '#3486cd'
|
|
2896
|
+
}
|
|
2897
|
+
}
|
|
2898
|
+
}, stripeOptions?.style);
|
|
2899
|
+
const options = {
|
|
2900
|
+
fonts: stripeOptions?.fonts,
|
|
2901
|
+
mode: 'payment',
|
|
2902
|
+
paymentMethodCreation: 'manual',
|
|
2903
|
+
currency: reservation?.currency.toLowerCase(),
|
|
2904
|
+
amount: reservation?.amount_in_cents,
|
|
2905
|
+
appearance: stripeStyle
|
|
2906
|
+
};
|
|
2907
|
+
return reservation && !(0,utils/* isFreeOrder */.yk)(reservation) && !(0,utils/* isPrePaidOrder */.xm)(reservation) ? /*#__PURE__*/external_react_default().createElement(react_stripe_js_namespaceObject.Elements, {
|
|
2908
|
+
stripe: stripePromise,
|
|
2909
|
+
options: options
|
|
2910
|
+
}, /*#__PURE__*/external_react_default().createElement(stripe_form, {
|
|
2911
|
+
reservation: reservation,
|
|
2912
|
+
payTicket: payTicket,
|
|
2913
|
+
userProfile: userProfile,
|
|
2914
|
+
provider: provider,
|
|
2915
|
+
hidePostalCode: hidePostalCode,
|
|
2916
|
+
stripeReturnUrl: stripeReturnUrl,
|
|
2917
|
+
onError: onError
|
|
2918
|
+
})) : /*#__PURE__*/external_react_default().createElement("div", null, "Loading...");
|
|
2919
|
+
};
|
|
2920
|
+
|
|
2921
|
+
/* harmony default export */ const stripe_component = (StripeProvider);
|
|
2922
|
+
;// CONCATENATED MODULE: external "react-helmet"
|
|
2923
|
+
const external_react_helmet_namespaceObject = require("react-helmet");
|
|
2924
|
+
;// CONCATENATED MODULE: ./src/components/payment/index.js
|
|
2925
|
+
function payment_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2926
|
+
|
|
2927
|
+
function payment_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? payment_ownKeys(Object(source), !0).forEach(function (key) { payment_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : payment_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2928
|
+
|
|
2929
|
+
function payment_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2930
|
+
|
|
2931
|
+
/**
|
|
2932
|
+
* Copyright 2020 OpenStack Foundation
|
|
2933
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
2934
|
+
* you may not use this file except in compliance with the License.
|
|
2935
|
+
* You may obtain a copy of the License at
|
|
2936
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
2937
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
2938
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
2939
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2940
|
+
* See the License for the specific language governing permissions and
|
|
2941
|
+
* limitations under the License.
|
|
2942
|
+
**/
|
|
2943
|
+
|
|
2944
|
+
|
|
2945
|
+
|
|
2946
|
+
|
|
2947
|
+
|
|
2948
|
+
|
|
2949
|
+
|
|
2950
|
+
|
|
2951
|
+
|
|
2952
|
+
const PaymentComponent = ({
|
|
2953
|
+
isActive,
|
|
2954
|
+
userProfile,
|
|
2955
|
+
reservation,
|
|
2956
|
+
payTicket,
|
|
2957
|
+
providerKey,
|
|
2958
|
+
provider,
|
|
2959
|
+
providerOptions,
|
|
2960
|
+
successfulPaymentReturnUrl,
|
|
2961
|
+
timestamp,
|
|
2962
|
+
hidePostalCode,
|
|
2963
|
+
onError
|
|
2964
|
+
}) => {
|
|
2965
|
+
const [ref, {
|
|
2966
|
+
height
|
|
2967
|
+
}] = (0,external_react_use_namespaceObject.useMeasure)();
|
|
2968
|
+
const toggleAnimation = (0,external_react_spring_namespaceObject.useSpring)({
|
|
2969
|
+
config: payment_objectSpread({
|
|
2970
|
+
bounce: 0
|
|
2971
|
+
}, external_react_spring_namespaceObject.config.stiff),
|
|
2972
|
+
from: {
|
|
2973
|
+
opacity: 0,
|
|
2974
|
+
height: 0
|
|
2975
|
+
},
|
|
2976
|
+
to: {
|
|
2977
|
+
opacity: 1,
|
|
2978
|
+
height: isActive ? height + 10 : 0,
|
|
2979
|
+
marginBottom: isActive ? 5 : 0
|
|
2980
|
+
}
|
|
2981
|
+
});
|
|
2982
|
+
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
2983
|
+
className: `${index_module.outerWrapper} step-wrapper`
|
|
2984
|
+
}, /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2985
|
+
className: `${index_module.innerWrapper}`
|
|
2986
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2987
|
+
className: index_module.title
|
|
2988
|
+
}, /*#__PURE__*/external_react_default().createElement("span", null, "Payment")), /*#__PURE__*/external_react_default().createElement(external_react_spring_namespaceObject.animated.div, {
|
|
2989
|
+
style: payment_objectSpread({
|
|
2990
|
+
overflow: `${isActive ? '' : 'hidden'}`
|
|
2991
|
+
}, toggleAnimation)
|
|
2992
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
2993
|
+
ref: ref
|
|
2994
|
+
}, provider === constants.PAYMENT_PROVIDER_STRIPE && /*#__PURE__*/external_react_default().createElement(stripe_component, {
|
|
2995
|
+
provider: provider,
|
|
2996
|
+
providerKey: providerKey,
|
|
2997
|
+
reservation: reservation,
|
|
2998
|
+
payTicket: payTicket,
|
|
2999
|
+
userProfile: userProfile,
|
|
3000
|
+
stripeOptions: providerOptions,
|
|
3001
|
+
stripeReturnUrl: successfulPaymentReturnUrl,
|
|
3002
|
+
hidePostalCode: hidePostalCode,
|
|
3003
|
+
onError: onError
|
|
3004
|
+
}), provider === constants.PAYMENT_PROVIDER_LAWPAY && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement(external_react_helmet_namespaceObject.Helmet, null, /*#__PURE__*/external_react_default().createElement("script", {
|
|
3005
|
+
src: "https://cdn.affinipay.com/hostedfields/1.1.1/fieldGen_1.1.1.js"
|
|
3006
|
+
})), /*#__PURE__*/external_react_default().createElement(lawpay_form, {
|
|
3007
|
+
provider: provider,
|
|
3008
|
+
reservation: reservation,
|
|
3009
|
+
payTicket: payTicket,
|
|
3010
|
+
userProfile: userProfile,
|
|
3011
|
+
providerKey: providerKey,
|
|
3012
|
+
timestamp: timestamp,
|
|
3013
|
+
onError: onError
|
|
3014
|
+
})))))));
|
|
3015
|
+
};
|
|
3016
|
+
|
|
3017
|
+
/* harmony default export */ const payment = (PaymentComponent);
|
|
3018
|
+
;// CONCATENATED MODULE: external "openstack-uicore-foundation/lib/components/inputs/company-input-v2"
|
|
3019
|
+
const company_input_v2_namespaceObject = require("openstack-uicore-foundation/lib/components/inputs/company-input-v2");
|
|
3020
|
+
var company_input_v2_default = /*#__PURE__*/__webpack_require__.n(company_input_v2_namespaceObject);
|
|
3021
|
+
// EXTERNAL MODULE: ./src/helpers/index.js + 1 modules
|
|
3022
|
+
var helpers = __webpack_require__(499);
|
|
3023
|
+
;// CONCATENATED MODULE: ./src/components/personal-information/index.module.scss
|
|
3024
|
+
// extracted by mini-css-extract-plugin
|
|
3025
|
+
/* harmony default export */ const personal_information_index_module = ({"title":"title___ECoNz","form":"form___lDFka","fieldWrapper":"fieldWrapper___Mi_nL","fieldWrapperRadio":"fieldWrapperRadio___x18VG","inputWrapper":"inputWrapper___PEQFR","readOnly":"readOnly___WRazF","fieldError":"fieldError___ksJVe","moreInfo":"moreInfo___cQYdZ","moreInfoTooltip":"moreInfoTooltip___lslgT","ticketQuantityNotice":"ticketQuantityNotice___L6gis","formErrors":"formErrors___dQQMe"});
|
|
3026
|
+
;// CONCATENATED MODULE: ./src/components/personal-information/index.js
|
|
3027
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3028
|
+
|
|
3029
|
+
function personal_information_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3030
|
+
|
|
3031
|
+
function personal_information_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? personal_information_ownKeys(Object(source), !0).forEach(function (key) { personal_information_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : personal_information_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3032
|
+
|
|
3033
|
+
function personal_information_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3034
|
+
|
|
3035
|
+
/**
|
|
3036
|
+
* Copyright 2020 OpenStack Foundation
|
|
3037
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3038
|
+
* you may not use this file except in compliance with the License.
|
|
3039
|
+
* You may obtain a copy of the License at
|
|
3040
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3041
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3042
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3043
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3044
|
+
* See the License for the specific language governing permissions and
|
|
3045
|
+
* limitations under the License.
|
|
3046
|
+
**/
|
|
3047
|
+
|
|
3048
|
+
|
|
3049
|
+
|
|
3050
|
+
|
|
3051
|
+
|
|
3052
|
+
|
|
3053
|
+
|
|
3054
|
+
|
|
3055
|
+
|
|
3056
|
+
|
|
3057
|
+
|
|
3058
|
+
const PersonalInfoComponent = ({
|
|
3059
|
+
isActive,
|
|
3060
|
+
changeForm,
|
|
3061
|
+
reservation,
|
|
3062
|
+
userProfile,
|
|
3063
|
+
summitId,
|
|
3064
|
+
handleCompanyError,
|
|
3065
|
+
formValues,
|
|
3066
|
+
formErrors = {},
|
|
3067
|
+
invitation,
|
|
3068
|
+
showCompanyInput = true,
|
|
3069
|
+
companyDDLPlaceholder,
|
|
3070
|
+
showCompanyInputDefaultOptions,
|
|
3071
|
+
companyDDLOptions2Show
|
|
3072
|
+
}) => {
|
|
3073
|
+
const initialFirstName = userProfile.given_name || (invitation ? invitation.first_name : '');
|
|
3074
|
+
const initialLastName = userProfile.family_name || (invitation ? invitation.last_name : '');
|
|
3075
|
+
const [ticketOwnerOption, setTicketOwnerOption] = (0,external_react_.useState)('');
|
|
3076
|
+
const [ticketOwnerError, setTicketOwnerError] = (0,external_react_.useState)(false); // if there's only one ticket on the order and there is no invitation available, display the radio button to assign the ticket
|
|
3077
|
+
|
|
3078
|
+
const shouldDisplayTicketAssignment = () => formValues.ticketQuantity === 1 && !invitation && !(0,utils/* isPrePaidTicketType */.B6)(formValues.ticketType);
|
|
3079
|
+
|
|
3080
|
+
const radioListOptions = [{
|
|
3081
|
+
label: "Myself",
|
|
3082
|
+
value: constants.TICKET_OWNER_MYSELF
|
|
3083
|
+
}, {
|
|
3084
|
+
label: "Someone Else",
|
|
3085
|
+
value: constants.TICKET_OWNER_SOMEONE
|
|
3086
|
+
}, {
|
|
3087
|
+
label: "Leave Unassigned",
|
|
3088
|
+
value: constants.TICKET_OWNER_UNASSIGNED
|
|
3089
|
+
}];
|
|
3090
|
+
const [personalInfo, setPersonalInfo] = (0,external_react_.useState)({
|
|
3091
|
+
firstName: initialFirstName,
|
|
3092
|
+
lastName: initialLastName,
|
|
3093
|
+
email: userProfile.email || '',
|
|
3094
|
+
company: {
|
|
3095
|
+
id: null,
|
|
3096
|
+
name: ''
|
|
3097
|
+
},
|
|
3098
|
+
attendee: {
|
|
3099
|
+
firstName: '',
|
|
3100
|
+
lastName: '',
|
|
3101
|
+
email: ''
|
|
3102
|
+
}
|
|
3103
|
+
});
|
|
3104
|
+
const [companyError, setCompanyError] = (0,external_react_.useState)(false);
|
|
3105
|
+
const {
|
|
3106
|
+
register,
|
|
3107
|
+
reset,
|
|
3108
|
+
handleSubmit,
|
|
3109
|
+
getValues,
|
|
3110
|
+
formState: {
|
|
3111
|
+
errors
|
|
3112
|
+
}
|
|
3113
|
+
} = (0,external_react_hook_form_namespaceObject.useForm)();
|
|
3114
|
+
(0,external_react_.useEffect)(() => {
|
|
3115
|
+
if (reservation) {
|
|
3116
|
+
setPersonalInfo({
|
|
3117
|
+
firstName: reservation.owner_first_name ? reservation.owner_first_name : personalInfo.firstName,
|
|
3118
|
+
lastName: reservation.owner_last_name ? reservation.owner_last_name : personalInfo.lastName,
|
|
3119
|
+
email: reservation.owner_email ? reservation.owner_email : personalInfo.email,
|
|
3120
|
+
company: {
|
|
3121
|
+
id: null,
|
|
3122
|
+
name: reservation.owner_company ? reservation.owner_company : personalInfo.company
|
|
3123
|
+
}
|
|
3124
|
+
});
|
|
3125
|
+
}
|
|
3126
|
+
}, []);
|
|
3127
|
+
|
|
3128
|
+
const onCompanyChange = ev => {
|
|
3129
|
+
const newCompany = ev.target.value;
|
|
3130
|
+
console.log("RegistrationLite::onCompanyChange", newCompany);
|
|
3131
|
+
setCompanyError(false);
|
|
3132
|
+
setPersonalInfo(personal_information_objectSpread(personal_information_objectSpread({}, personalInfo), {}, {
|
|
3133
|
+
company: newCompany
|
|
3134
|
+
}));
|
|
3135
|
+
};
|
|
3136
|
+
|
|
3137
|
+
const onSubmit = data => {
|
|
3138
|
+
if (!personalInfo.company.name && showCompanyInput) {
|
|
3139
|
+
setCompanyError(true);
|
|
3140
|
+
return;
|
|
3141
|
+
}
|
|
3142
|
+
|
|
3143
|
+
if (shouldDisplayTicketAssignment()) {
|
|
3144
|
+
if (!ticketOwnerOption) {
|
|
3145
|
+
setTicketOwnerError(true);
|
|
3146
|
+
return;
|
|
3147
|
+
} // if the ticket is for someone else, set the attende with the data from form
|
|
3148
|
+
|
|
3149
|
+
|
|
3150
|
+
const attendeeData = ticketOwnerOption === constants.TICKET_OWNER_SOMEONE ? data.attendee : personalInfo.attendee;
|
|
3151
|
+
data = personal_information_objectSpread(personal_information_objectSpread({}, data), {}, {
|
|
3152
|
+
attendee: attendeeData
|
|
3153
|
+
});
|
|
3154
|
+
}
|
|
3155
|
+
|
|
3156
|
+
setPersonalInfo(personal_information_objectSpread(personal_information_objectSpread({}, personalInfo), data));
|
|
3157
|
+
changeForm(personal_information_objectSpread(personal_information_objectSpread({}, personalInfo), data));
|
|
3158
|
+
};
|
|
3159
|
+
|
|
3160
|
+
const handleRadioButtonChange = ev => {
|
|
3161
|
+
const {
|
|
3162
|
+
value
|
|
3163
|
+
} = ev.target;
|
|
3164
|
+
setTicketOwnerOption(value);
|
|
3165
|
+
setTicketOwnerError(false);
|
|
3166
|
+
setPersonalInfo(personal_information_objectSpread(personal_information_objectSpread({}, personalInfo), {}, {
|
|
3167
|
+
attendee: value === constants.TICKET_OWNER_UNASSIGNED ? null : value === constants.TICKET_OWNER_MYSELF ? {
|
|
3168
|
+
firstName: personalInfo.firstName,
|
|
3169
|
+
lastName: personalInfo.lastName,
|
|
3170
|
+
email: personalInfo.email
|
|
3171
|
+
} : {
|
|
3172
|
+
firstName: '',
|
|
3173
|
+
lastName: '',
|
|
3174
|
+
email: ''
|
|
3175
|
+
}
|
|
3176
|
+
}));
|
|
3177
|
+
reset({
|
|
3178
|
+
attendee: {
|
|
3179
|
+
email: '',
|
|
3180
|
+
firstName: '',
|
|
3181
|
+
lastName: ''
|
|
3182
|
+
}
|
|
3183
|
+
});
|
|
3184
|
+
};
|
|
3185
|
+
|
|
3186
|
+
const [ref, {
|
|
3187
|
+
height
|
|
3188
|
+
}] = (0,external_react_use_namespaceObject.useMeasure)();
|
|
3189
|
+
const toggleAnimation = (0,external_react_spring_namespaceObject.useSpring)({
|
|
3190
|
+
config: personal_information_objectSpread({
|
|
3191
|
+
bounce: 0
|
|
3192
|
+
}, external_react_spring_namespaceObject.config.stiff),
|
|
3193
|
+
from: {
|
|
3194
|
+
opacity: 0,
|
|
3195
|
+
height: 0
|
|
3196
|
+
},
|
|
3197
|
+
to: {
|
|
3198
|
+
opacity: 1,
|
|
3199
|
+
height: isActive ? height + 10 : 0
|
|
3200
|
+
}
|
|
3201
|
+
});
|
|
3202
|
+
const customStyles = {
|
|
3203
|
+
height: 36,
|
|
3204
|
+
"& .MuiFormControl-root": {
|
|
3205
|
+
marginTop: 0,
|
|
3206
|
+
marginBottom: 0
|
|
3207
|
+
},
|
|
3208
|
+
"& .MuiOutlinedInput-root": {
|
|
3209
|
+
height: 36,
|
|
3210
|
+
boxSizing: "border-box"
|
|
3211
|
+
},
|
|
3212
|
+
"& .MuiOutlinedInput-input": {
|
|
3213
|
+
height: "100%",
|
|
3214
|
+
lineHeight: 36,
|
|
3215
|
+
boxSizing: "border-box",
|
|
3216
|
+
fontSize: 16
|
|
3217
|
+
},
|
|
3218
|
+
"& .MuiOutlinedInput-input::placeholder": {
|
|
3219
|
+
fontSize: 14
|
|
3220
|
+
},
|
|
3221
|
+
"& .MuiAutocomplete-option": {
|
|
3222
|
+
fontSize: 16
|
|
3223
|
+
},
|
|
3224
|
+
"& .MuiAutocomplete-listbox": {
|
|
3225
|
+
maxHeight: 120
|
|
3226
|
+
},
|
|
3227
|
+
"& .MuiInputLabel-root:not(.MuiInputLabel-shrink)": {
|
|
3228
|
+
transform: "translate(12px, 10px)",
|
|
3229
|
+
fontSize: 14
|
|
3230
|
+
}
|
|
3231
|
+
};
|
|
3232
|
+
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
3233
|
+
className: `${personal_information_index_module.outerWrapper} step-wrapper`
|
|
3234
|
+
}, /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("div", {
|
|
3235
|
+
className: `${personal_information_index_module.innerWrapper}`
|
|
3236
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
3237
|
+
className: personal_information_index_module.title
|
|
3238
|
+
}, /*#__PURE__*/external_react_default().createElement("span", null, "Purchaser Information"), !isActive && /*#__PURE__*/external_react_default().createElement("div", {
|
|
3239
|
+
"data-testid": "personal-info"
|
|
3240
|
+
}, /*#__PURE__*/external_react_default().createElement("span", null, `${personalInfo.firstName} ${personalInfo.lastName}${personalInfo.company.name ? ` - ${personalInfo.company.name}` : ''}`), /*#__PURE__*/external_react_default().createElement("br", null), /*#__PURE__*/external_react_default().createElement("span", null, personalInfo.email))), /*#__PURE__*/external_react_default().createElement(external_react_spring_namespaceObject.animated.div, {
|
|
3241
|
+
style: personal_information_objectSpread({
|
|
3242
|
+
overflow: `${isActive ? '' : 'hidden'}`
|
|
3243
|
+
}, toggleAnimation)
|
|
3244
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
3245
|
+
ref: ref
|
|
3246
|
+
}, formValues.ticketQuantity > 1 && /*#__PURE__*/external_react_default().createElement("div", {
|
|
3247
|
+
className: `${personal_information_index_module.ticketQuantityNotice} alert alert-info`
|
|
3248
|
+
}, "If this is your first order please note that 1 ticket from this order will be automatically assigned to you; the rest will remain unassigned, with the option to re-assign all tickets after purchase."), /*#__PURE__*/external_react_default().createElement("form", {
|
|
3249
|
+
id: "personal-info-form",
|
|
3250
|
+
onSubmit: handleSubmit(onSubmit),
|
|
3251
|
+
className: personal_information_index_module.form,
|
|
3252
|
+
"data-testid": "personal-form"
|
|
3253
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
3254
|
+
className: personal_information_index_module.fieldWrapper
|
|
3255
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
3256
|
+
className: personal_information_index_module.inputWrapper
|
|
3257
|
+
}, /*#__PURE__*/external_react_default().createElement("input", _extends({
|
|
3258
|
+
type: "text",
|
|
3259
|
+
placeholder: "First name *",
|
|
3260
|
+
defaultValue: personalInfo.firstName || '',
|
|
3261
|
+
readOnly: initialFirstName !== '',
|
|
3262
|
+
className: initialFirstName !== '' ? personal_information_index_module.readOnly : ''
|
|
3263
|
+
}, register("firstName", {
|
|
3264
|
+
required: true,
|
|
3265
|
+
maxLength: 80
|
|
3266
|
+
}), {
|
|
3267
|
+
"data-testid": "first-name"
|
|
3268
|
+
}))), errors.firstName && /*#__PURE__*/external_react_default().createElement("div", {
|
|
3269
|
+
className: personal_information_index_module.fieldError,
|
|
3270
|
+
"data-testid": "first-name-error"
|
|
3271
|
+
}, "This field is required.")), /*#__PURE__*/external_react_default().createElement("div", {
|
|
3272
|
+
className: personal_information_index_module.fieldWrapper
|
|
3273
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
3274
|
+
className: personal_information_index_module.inputWrapper
|
|
3275
|
+
}, /*#__PURE__*/external_react_default().createElement("input", _extends({
|
|
3276
|
+
type: "text",
|
|
3277
|
+
placeholder: "Last name *",
|
|
3278
|
+
defaultValue: personalInfo.lastName || '',
|
|
3279
|
+
readOnly: initialLastName !== '',
|
|
3280
|
+
className: initialLastName !== '' ? personal_information_index_module.readOnly : ''
|
|
3281
|
+
}, register("lastName", {
|
|
3282
|
+
required: true,
|
|
3283
|
+
maxLength: 100
|
|
3284
|
+
}), {
|
|
3285
|
+
"data-testid": "last-name"
|
|
3286
|
+
}))), errors.lastName && /*#__PURE__*/external_react_default().createElement("div", {
|
|
3287
|
+
className: personal_information_index_module.fieldError,
|
|
3288
|
+
"data-testid": "last-name-error"
|
|
3289
|
+
}, "This field is required.")), /*#__PURE__*/external_react_default().createElement("div", {
|
|
3290
|
+
className: personal_information_index_module.fieldWrapper
|
|
3291
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
3292
|
+
className: personal_information_index_module.inputWrapper
|
|
3293
|
+
}, /*#__PURE__*/external_react_default().createElement("input", _extends({
|
|
3294
|
+
type: "text",
|
|
3295
|
+
placeholder: "Email *",
|
|
3296
|
+
className: personal_information_index_module.readOnly,
|
|
3297
|
+
readOnly: true,
|
|
3298
|
+
defaultValue: personalInfo.email || ''
|
|
3299
|
+
}, register("email", {
|
|
3300
|
+
required: true,
|
|
3301
|
+
pattern: /^\S+@\S+$/i
|
|
3302
|
+
}), {
|
|
3303
|
+
"data-testid": "email"
|
|
3304
|
+
}))), errors.email?.type === 'required' && /*#__PURE__*/external_react_default().createElement("div", {
|
|
3305
|
+
className: personal_information_index_module.fieldError,
|
|
3306
|
+
"data-testid": "email-error-required"
|
|
3307
|
+
}, "This field is required."), errors.email?.type === 'pattern' && /*#__PURE__*/external_react_default().createElement("div", {
|
|
3308
|
+
className: personal_information_index_module.fieldError,
|
|
3309
|
+
"data-testid": "email-error-invalid"
|
|
3310
|
+
}, "The email is invalid.")), showCompanyInput && /*#__PURE__*/external_react_default().createElement("div", {
|
|
3311
|
+
className: personal_information_index_module.fieldWrapper
|
|
3312
|
+
}, /*#__PURE__*/external_react_default().createElement("div", null, /*#__PURE__*/external_react_default().createElement((company_input_v2_default()), {
|
|
3313
|
+
id: "reg-comp-input",
|
|
3314
|
+
name: "reg-comp-input",
|
|
3315
|
+
"data-testid": "company",
|
|
3316
|
+
sx: customStyles,
|
|
3317
|
+
summitId: summitId,
|
|
3318
|
+
onChange: onCompanyChange,
|
|
3319
|
+
onError: handleCompanyError,
|
|
3320
|
+
value: personalInfo.company,
|
|
3321
|
+
placeholder: companyDDLPlaceholder,
|
|
3322
|
+
options2Show: companyDDLOptions2Show,
|
|
3323
|
+
disableShrink: true,
|
|
3324
|
+
label: null,
|
|
3325
|
+
ListboxProps: {
|
|
3326
|
+
sx: {
|
|
3327
|
+
'& li.MuiAutocomplete-option': {
|
|
3328
|
+
fontSize: '16px'
|
|
3329
|
+
}
|
|
3330
|
+
}
|
|
3331
|
+
}
|
|
3332
|
+
}), companyError && /*#__PURE__*/external_react_default().createElement("div", {
|
|
3333
|
+
className: personal_information_index_module.fieldError,
|
|
3334
|
+
"data-testid": "company-error"
|
|
3335
|
+
}, "This field is required."))), shouldDisplayTicketAssignment() && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("div", {
|
|
3336
|
+
className: personal_information_index_module.fieldWrapperRadio
|
|
3337
|
+
}, /*#__PURE__*/external_react_default().createElement("label", null, "Ticket is for:"), /*#__PURE__*/external_react_default().createElement(components_namespaceObject.RadioList, {
|
|
3338
|
+
id: `ticket-self-radio`,
|
|
3339
|
+
value: ticketOwnerOption,
|
|
3340
|
+
options: radioListOptions,
|
|
3341
|
+
onChange: handleRadioButtonChange,
|
|
3342
|
+
inline: true,
|
|
3343
|
+
html: true
|
|
3344
|
+
}), ticketOwnerError && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("br", null), /*#__PURE__*/external_react_default().createElement("div", {
|
|
3345
|
+
className: personal_information_index_module.fieldError,
|
|
3346
|
+
"data-testid": "company-error"
|
|
3347
|
+
}, "This field is required."))), ticketOwnerOption === constants.TICKET_OWNER_SOMEONE && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("div", {
|
|
3348
|
+
className: personal_information_index_module.fieldWrapper
|
|
3349
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
3350
|
+
className: personal_information_index_module.inputWrapper
|
|
3351
|
+
}, /*#__PURE__*/external_react_default().createElement("input", _extends({
|
|
3352
|
+
type: "text",
|
|
3353
|
+
placeholder: "First name",
|
|
3354
|
+
defaultValue: personalInfo?.attendee?.firstName ?? ''
|
|
3355
|
+
}, register("attendee.firstName", {
|
|
3356
|
+
required: false,
|
|
3357
|
+
maxLength: 80
|
|
3358
|
+
}), {
|
|
3359
|
+
"data-testid": "attendee-first-name"
|
|
3360
|
+
})))), /*#__PURE__*/external_react_default().createElement("div", {
|
|
3361
|
+
className: personal_information_index_module.fieldWrapper
|
|
3362
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
3363
|
+
className: personal_information_index_module.inputWrapper
|
|
3364
|
+
}, /*#__PURE__*/external_react_default().createElement("input", _extends({
|
|
3365
|
+
type: "text",
|
|
3366
|
+
placeholder: "Last name",
|
|
3367
|
+
defaultValue: personalInfo?.attendee?.lastName ?? ''
|
|
3368
|
+
}, register("attendee.lastName", {
|
|
3369
|
+
required: false,
|
|
3370
|
+
maxLength: 100
|
|
3371
|
+
}), {
|
|
3372
|
+
"data-testid": "attendee-last-name"
|
|
3373
|
+
})))), /*#__PURE__*/external_react_default().createElement("div", {
|
|
3374
|
+
className: personal_information_index_module.fieldWrapper
|
|
3375
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
3376
|
+
className: personal_information_index_module.inputWrapper
|
|
3377
|
+
}, /*#__PURE__*/external_react_default().createElement("input", _extends({
|
|
3378
|
+
type: "text",
|
|
3379
|
+
placeholder: "Email *",
|
|
3380
|
+
defaultValue: personalInfo?.attendee?.email ?? ''
|
|
3381
|
+
}, register("attendee.email", {
|
|
3382
|
+
required: true,
|
|
3383
|
+
pattern: constants.EMAIL_REGEXP
|
|
3384
|
+
}), {
|
|
3385
|
+
"data-testid": "attendee-email"
|
|
3386
|
+
}))), errors.attendee?.email?.type === 'required' && /*#__PURE__*/external_react_default().createElement("div", {
|
|
3387
|
+
className: personal_information_index_module.fieldError,
|
|
3388
|
+
"data-testid": "attendee-email-error-required"
|
|
3389
|
+
}, "This field is required."), errors.attendee?.email?.type === 'pattern' && /*#__PURE__*/external_react_default().createElement("div", {
|
|
3390
|
+
className: personal_information_index_module.fieldError,
|
|
3391
|
+
"data-testid": "attendee-email-error-invalid"
|
|
3392
|
+
}, "The email is invalid."))))), formErrors.length > 0 && /*#__PURE__*/external_react_default().createElement("div", {
|
|
3393
|
+
className: `${personal_information_index_module.formErrors} alert alert-danger`
|
|
3394
|
+
}, formErrors.map((error, index) => /*#__PURE__*/external_react_default().createElement("div", {
|
|
3395
|
+
key: index
|
|
3396
|
+
}, (0,helpers/* formatErrorMessage */.jN)(error)))))))));
|
|
3397
|
+
};
|
|
3398
|
+
|
|
3399
|
+
/* harmony default export */ const personal_information = (PersonalInfoComponent);
|
|
3400
|
+
;// CONCATENATED MODULE: external "openstack-uicore-foundation/lib/components/raw-html"
|
|
3401
|
+
const raw_html_namespaceObject = require("openstack-uicore-foundation/lib/components/raw-html");
|
|
3402
|
+
var raw_html_default = /*#__PURE__*/__webpack_require__.n(raw_html_namespaceObject);
|
|
3403
|
+
;// CONCATENATED MODULE: external "i18n-react"
|
|
3404
|
+
const external_i18n_react_namespaceObject = require("i18n-react");
|
|
3405
|
+
var external_i18n_react_default = /*#__PURE__*/__webpack_require__.n(external_i18n_react_namespaceObject);
|
|
3406
|
+
;// CONCATENATED MODULE: ./src/components/ticket-type/index.module.scss
|
|
3407
|
+
// extracted by mini-css-extract-plugin
|
|
3408
|
+
/* harmony default export */ const ticket_type_index_module = ({"title":"title___DNZyl","summary":"summary___quWdZ","promoCode":"promoCode___bqTCw","crossOut":"crossOut___QZ7dy","discount":"discount___sEK_Q","promocodeError":"promocodeError___oxk4p","taxes":"taxes___fe8oJ","promo":"promo___F8lPO","form":"form___aoo7w","dropdown":"dropdown____HWg0","quantity":"quantity___SIEQZ","soldOut":"soldOut___Hatfr","moreInfo":"moreInfo___LmwOe","moreInfoTooltip":"moreInfoTooltip___nOBf1","inPersonDisclaimer":"inPersonDisclaimer___PXGTz"});
|
|
3409
|
+
;// CONCATENATED MODULE: external "lodash/isEqual"
|
|
3410
|
+
const isEqual_namespaceObject = require("lodash/isEqual");
|
|
3411
|
+
var isEqual_default = /*#__PURE__*/__webpack_require__.n(isEqual_namespaceObject);
|
|
3412
|
+
;// CONCATENATED MODULE: ./src/components/ticket-dropdown/index.module.scss
|
|
3413
|
+
// extracted by mini-css-extract-plugin
|
|
3414
|
+
/* harmony default export */ const ticket_dropdown_index_module = ({"placeholder":"placeholder___pcdCn","selectedTicket":"selectedTicket___qkbpH","inPersonDisclaimer":"inPersonDisclaimer___z_DzO","dropdown":"dropdown___mfbPG","soldOut":"soldOut___rBLC0"});
|
|
3415
|
+
;// CONCATENATED MODULE: ./src/components/ticket-dropdown/index.js
|
|
3416
|
+
/**
|
|
3417
|
+
* Copyright 2020 OpenStack Foundation
|
|
3418
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3419
|
+
* you may not use this file except in compliance with the License.
|
|
3420
|
+
* You may obtain a copy of the License at
|
|
3421
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3422
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3423
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3424
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3425
|
+
* See the License for the specific language governing permissions and
|
|
3426
|
+
* limitations under the License.
|
|
3427
|
+
**/
|
|
3428
|
+
|
|
3429
|
+
|
|
3430
|
+
|
|
3431
|
+
|
|
3432
|
+
|
|
3433
|
+
|
|
3434
|
+
const TicketDropdownComponent = ({
|
|
3435
|
+
selectedTicket,
|
|
3436
|
+
ticketTypes,
|
|
3437
|
+
taxTypes,
|
|
3438
|
+
onTicketSelect
|
|
3439
|
+
}) => {
|
|
3440
|
+
const [active, setActive] = (0,external_react_.useState)(false);
|
|
3441
|
+
const [currentTicketTypes, setCurrentTicketTypes] = (0,external_react_.useState)([]); // ref is used because it doesn't affect the rendering cicle and is only used to check prev values
|
|
3442
|
+
|
|
3443
|
+
const prevTicketTypesRef = (0,external_react_.useRef)([]);
|
|
3444
|
+
|
|
3445
|
+
const ticketSelect = ticket => {
|
|
3446
|
+
onTicketSelect(ticket);
|
|
3447
|
+
setActive(!active);
|
|
3448
|
+
};
|
|
3449
|
+
|
|
3450
|
+
(0,external_react_.useEffect)(() => {
|
|
3451
|
+
const prevTicketTypes = prevTicketTypesRef.current;
|
|
3452
|
+
|
|
3453
|
+
if (!isEqual_default()(ticketTypes, []) && !isEqual_default()(prevTicketTypes, ticketTypes)) {
|
|
3454
|
+
setCurrentTicketTypes(ticketTypes);
|
|
3455
|
+
}
|
|
3456
|
+
|
|
3457
|
+
prevTicketTypesRef.current = ticketTypes;
|
|
3458
|
+
}, [ticketTypes]);
|
|
3459
|
+
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
3460
|
+
className: `${ticket_dropdown_index_module.outerWrapper}`
|
|
3461
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
3462
|
+
className: ticket_dropdown_index_module.placeholder,
|
|
3463
|
+
onClick: () => setActive(!active),
|
|
3464
|
+
"data-testid": "ticket-dropdown"
|
|
3465
|
+
}, selectedTicket ? /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("span", {
|
|
3466
|
+
className: ticket_dropdown_index_module.selectedTicket,
|
|
3467
|
+
"data-testid": "selected-ticket"
|
|
3468
|
+
}, `${selectedTicket.name} - `, (0,utils/* getTicketCost */.fX)(selectedTicket), (0,utils/* getTicketTaxes */.h5)(selectedTicket, taxTypes)), /*#__PURE__*/external_react_default().createElement("i", {
|
|
3469
|
+
className: "fa fa-chevron-down"
|
|
3470
|
+
})) : /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("span", {
|
|
3471
|
+
"data-testid": "no-ticket"
|
|
3472
|
+
}, "Select a ticket"), /*#__PURE__*/external_react_default().createElement("i", {
|
|
3473
|
+
className: "fa fa-chevron-down"
|
|
3474
|
+
}))), active && /*#__PURE__*/external_react_default().createElement("div", {
|
|
3475
|
+
className: ticket_dropdown_index_module.dropdown,
|
|
3476
|
+
"data-testid": "ticket-list"
|
|
3477
|
+
}, currentTicketTypes.map(t => {
|
|
3478
|
+
console.log('TicketDropdownComponent::render');
|
|
3479
|
+
const maxQuantity = (0,helpers/* getTicketMaxQuantity */.UE)(t);
|
|
3480
|
+
const isTicketSoldOut = maxQuantity < 1;
|
|
3481
|
+
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
3482
|
+
key: t.id,
|
|
3483
|
+
className: isTicketSoldOut ? ticket_dropdown_index_module.soldOut : '',
|
|
3484
|
+
onClick: () => {
|
|
3485
|
+
if (isTicketSoldOut) return;
|
|
3486
|
+
ticketSelect(t);
|
|
3487
|
+
}
|
|
3488
|
+
}, t.name, " -", ` `, !isTicketSoldOut && (0,utils/* getTicketCost */.fX)(t), (0,utils/* getTicketTaxes */.h5)(t, taxTypes), isTicketSoldOut && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, " Sold Out"));
|
|
3489
|
+
})));
|
|
3490
|
+
};
|
|
3491
|
+
|
|
3492
|
+
/* harmony default export */ const ticket_dropdown = (TicketDropdownComponent);
|
|
3493
|
+
;// CONCATENATED MODULE: external "react-tooltip"
|
|
3494
|
+
const external_react_tooltip_namespaceObject = require("react-tooltip");
|
|
3495
|
+
var external_react_tooltip_default = /*#__PURE__*/__webpack_require__.n(external_react_tooltip_namespaceObject);
|
|
3496
|
+
// EXTERNAL MODULE: ./src/assets/icon-check-circle.svg
|
|
3497
|
+
var icon_check_circle = __webpack_require__(60);
|
|
3498
|
+
var icon_check_circle_default = /*#__PURE__*/__webpack_require__.n(icon_check_circle);
|
|
3499
|
+
;// CONCATENATED MODULE: ./src/components/promocode-input/index.module.scss
|
|
3500
|
+
// extracted by mini-css-extract-plugin
|
|
3501
|
+
/* harmony default export */ const promocode_input_index_module = ({"promoCodeWrapper":"promoCodeWrapper___aw3Zx","promoCodeInput":"promoCodeInput___rDiET","promoCodeActive":"promoCodeActive___j7xnn","codeButtonWrapper":"codeButtonWrapper___jVZh5","noCode":"noCode___YUmVy","appliedCodeIcon":"appliedCodeIcon___pa3B4","moreInfo":"moreInfo___Ru3Rv","moreInfoTooltip":"moreInfoTooltip___eaYWm"});
|
|
3502
|
+
;// CONCATENATED MODULE: ./src/components/promocode-input/index.js
|
|
3503
|
+
/**
|
|
3504
|
+
* Copyright 2020 OpenStack Foundation
|
|
3505
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3506
|
+
* you may not use this file except in compliance with the License.
|
|
3507
|
+
* You may obtain a copy of the License at
|
|
3508
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3509
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3510
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3511
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3512
|
+
* See the License for the specific language governing permissions and
|
|
3513
|
+
* limitations under the License.
|
|
3514
|
+
**/
|
|
3515
|
+
|
|
3516
|
+
|
|
3517
|
+
|
|
3518
|
+
|
|
3519
|
+
|
|
3520
|
+
|
|
3521
|
+
|
|
3522
|
+
const PromoCodeInput = ({
|
|
3523
|
+
applyPromoCode,
|
|
3524
|
+
promoCode,
|
|
3525
|
+
removePromoCode,
|
|
3526
|
+
showMultipleTicketTexts,
|
|
3527
|
+
onPromoCodeChange
|
|
3528
|
+
}) => {
|
|
3529
|
+
const [statePromoCode, setStatePromoCode] = (0,external_react_.useState)(promoCode);
|
|
3530
|
+
|
|
3531
|
+
const handlePromoCodeChange = value => {
|
|
3532
|
+
onPromoCodeChange(value);
|
|
3533
|
+
setStatePromoCode(value);
|
|
3534
|
+
};
|
|
3535
|
+
|
|
3536
|
+
(0,external_react_.useEffect)(() => {
|
|
3537
|
+
if ((0,utils/* isEmptyString */.ke)(promoCode)) handlePromoCodeChange(promoCode);
|
|
3538
|
+
}, [promoCode]);
|
|
3539
|
+
return /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("div", {
|
|
3540
|
+
className: promocode_input_index_module.promoCodeWrapper
|
|
3541
|
+
}, /*#__PURE__*/external_react_default().createElement("span", null, "Do you have a promo code?"), /*#__PURE__*/external_react_default().createElement("div", {
|
|
3542
|
+
className: promocode_input_index_module.promoCodeInput
|
|
3543
|
+
}, /*#__PURE__*/external_react_default().createElement("input", {
|
|
3544
|
+
className: `${promoCode ? promocode_input_index_module.promoCodeActive : ''}`,
|
|
3545
|
+
type: "text",
|
|
3546
|
+
value: statePromoCode,
|
|
3547
|
+
onChange: ev => handlePromoCodeChange(ev.target.value),
|
|
3548
|
+
placeholder: "Enter your promo code",
|
|
3549
|
+
onKeyDown: e => {
|
|
3550
|
+
if (e.key === "Enter") applyPromoCode(statePromoCode);
|
|
3551
|
+
},
|
|
3552
|
+
readOnly: !(0,utils/* isEmptyString */.ke)(promoCode)
|
|
3553
|
+
}), promoCode && /*#__PURE__*/external_react_default().createElement("img", {
|
|
3554
|
+
src: (icon_check_circle_default()),
|
|
3555
|
+
className: promocode_input_index_module.appliedCodeIcon
|
|
3556
|
+
}), /*#__PURE__*/external_react_default().createElement("div", {
|
|
3557
|
+
className: `${promocode_input_index_module.codeButtonWrapper} ${statePromoCode ? '' : promocode_input_index_module.noCode}`
|
|
3558
|
+
}, promoCode !== '' ? /*#__PURE__*/external_react_default().createElement("button", {
|
|
3559
|
+
onClick: () => removePromoCode()
|
|
3560
|
+
}, "Remove") : /*#__PURE__*/external_react_default().createElement("button", {
|
|
3561
|
+
disabled: !statePromoCode,
|
|
3562
|
+
onClick: () => applyPromoCode(statePromoCode)
|
|
3563
|
+
}, "Apply"))), showMultipleTicketTexts && /*#__PURE__*/external_react_default().createElement("div", {
|
|
3564
|
+
className: promocode_input_index_module.moreInfo
|
|
3565
|
+
}, /*#__PURE__*/external_react_default().createElement("a", {
|
|
3566
|
+
"data-tip": true,
|
|
3567
|
+
"data-for": "promo-code-info"
|
|
3568
|
+
}, /*#__PURE__*/external_react_default().createElement("i", {
|
|
3569
|
+
className: "glyphicon glyphicon-info-sign",
|
|
3570
|
+
"aria-hidden": "true"
|
|
3571
|
+
}), ` `, "Have multiple promo codes?"))), /*#__PURE__*/external_react_default().createElement((external_react_tooltip_default()), {
|
|
3572
|
+
id: "promo-code-info",
|
|
3573
|
+
overridePosition: utils/* avoidTooltipOverflow */.kb
|
|
3574
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
3575
|
+
className: promocode_input_index_module.moreInfoTooltip
|
|
3576
|
+
}, external_i18n_react_default().translate("promo_code.promo_code_tooltip"))));
|
|
3577
|
+
};
|
|
3578
|
+
|
|
3579
|
+
/* harmony default export */ const promocode_input = (PromoCodeInput);
|
|
3580
|
+
;// CONCATENATED MODULE: ./src/components/ticket-type/index.js
|
|
3581
|
+
function ticket_type_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3582
|
+
|
|
3583
|
+
function ticket_type_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ticket_type_ownKeys(Object(source), !0).forEach(function (key) { ticket_type_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ticket_type_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3584
|
+
|
|
3585
|
+
function ticket_type_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3586
|
+
|
|
3587
|
+
/**
|
|
3588
|
+
* Copyright 2020 OpenStack Foundation
|
|
3589
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3590
|
+
* you may not use this file except in compliance with the License.
|
|
3591
|
+
* You may obtain a copy of the License at
|
|
3592
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3593
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3594
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3595
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3596
|
+
* See the License for the specific language governing permissions and
|
|
3597
|
+
* limitations under the License.
|
|
3598
|
+
**/
|
|
3599
|
+
|
|
3600
|
+
|
|
3601
|
+
|
|
3602
|
+
|
|
3603
|
+
|
|
3604
|
+
|
|
3605
|
+
|
|
3606
|
+
|
|
3607
|
+
|
|
3608
|
+
|
|
3609
|
+
|
|
3610
|
+
|
|
3611
|
+
|
|
3612
|
+
|
|
3613
|
+
|
|
3614
|
+
const TicketTypeComponent = ({
|
|
3615
|
+
allowedTicketTypes,
|
|
3616
|
+
originalTicketTypes,
|
|
3617
|
+
// these are the original ones
|
|
3618
|
+
taxTypes,
|
|
3619
|
+
isActive,
|
|
3620
|
+
changeForm,
|
|
3621
|
+
formErrors,
|
|
3622
|
+
reservation,
|
|
3623
|
+
inPersonDisclaimer,
|
|
3624
|
+
showMultipleTicketTexts,
|
|
3625
|
+
allowPromoCodes,
|
|
3626
|
+
applyPromoCode,
|
|
3627
|
+
removePromoCode,
|
|
3628
|
+
promoCode,
|
|
3629
|
+
trackViewItem
|
|
3630
|
+
}) => {
|
|
3631
|
+
const [ticket, setTicket] = (0,external_react_.useState)(null);
|
|
3632
|
+
const [quantity, setQuantity] = (0,external_react_.useState)(1);
|
|
3633
|
+
const minQuantity = 1;
|
|
3634
|
+
const maxQuantity = (0,helpers/* getTicketMaxQuantity */.UE)(ticket);
|
|
3635
|
+
const [ref, {
|
|
3636
|
+
height
|
|
3637
|
+
}] = (0,external_react_use_namespaceObject.useMeasure)();
|
|
3638
|
+
const toggleAnimation = (0,external_react_spring_namespaceObject.useSpring)({
|
|
3639
|
+
config: ticket_type_objectSpread({
|
|
3640
|
+
bounce: 0
|
|
3641
|
+
}, external_react_spring_namespaceObject.config.stiff),
|
|
3642
|
+
from: {
|
|
3643
|
+
opacity: 0,
|
|
3644
|
+
height: 0
|
|
3645
|
+
},
|
|
3646
|
+
to: {
|
|
3647
|
+
opacity: 1,
|
|
3648
|
+
height: isActive ? height + 10 : 0
|
|
3649
|
+
}
|
|
3650
|
+
});
|
|
3651
|
+
(0,external_react_.useEffect)(() => {
|
|
3652
|
+
if (reservation && reservation.tickets?.length > 0) {
|
|
3653
|
+
setTicket(allowedTicketTypes.find(t => t.id === reservation.tickets[0].ticket_type_id));
|
|
3654
|
+
setQuantity(reservation.tickets.length);
|
|
3655
|
+
}
|
|
3656
|
+
}, []);
|
|
3657
|
+
(0,external_react_.useEffect)(() => {
|
|
3658
|
+
changeForm({
|
|
3659
|
+
ticketType: ticket,
|
|
3660
|
+
ticketQuantity: quantity
|
|
3661
|
+
});
|
|
3662
|
+
}, [ticket, quantity]);
|
|
3663
|
+
(0,external_react_.useEffect)(() => {
|
|
3664
|
+
// if the promo code had changed ( set or not set)
|
|
3665
|
+
// try to find the updated ticket from the original ticket types collection from api
|
|
3666
|
+
// and update the current ticket that exist on component state
|
|
3667
|
+
// bc a discount could be applied to the current selected ticket type
|
|
3668
|
+
if (!ticket) return;
|
|
3669
|
+
const updatedCurrentTicket = originalTicketTypes.find(t => t?.id === ticket.id);
|
|
3670
|
+
|
|
3671
|
+
if (updatedCurrentTicket) {
|
|
3672
|
+
changeForm({
|
|
3673
|
+
ticketType: updatedCurrentTicket
|
|
3674
|
+
});
|
|
3675
|
+
setTicket(updatedCurrentTicket);
|
|
3676
|
+
}
|
|
3677
|
+
|
|
3678
|
+
if (!promoCode) changeForm({
|
|
3679
|
+
promoCode: ''
|
|
3680
|
+
});
|
|
3681
|
+
}, [promoCode, originalTicketTypes]);
|
|
3682
|
+
const isPrePaidReservation = (0,external_react_.useMemo)(() => reservation ? (0,utils/* isPrePaidOrder */.xm)(reservation) : false, [reservation]);
|
|
3683
|
+
|
|
3684
|
+
const handleTicketChange = t => {
|
|
3685
|
+
setTicket(t);
|
|
3686
|
+
setQuantity(minQuantity);
|
|
3687
|
+
trackViewItem(t);
|
|
3688
|
+
};
|
|
3689
|
+
|
|
3690
|
+
const handlePromoCodeChange = code => {
|
|
3691
|
+
changeForm({
|
|
3692
|
+
promoCode: code
|
|
3693
|
+
});
|
|
3694
|
+
};
|
|
3695
|
+
|
|
3696
|
+
const incrementQuantity = () => setQuantity(quantity + 1);
|
|
3697
|
+
|
|
3698
|
+
const decrementQuantity = () => setQuantity(quantity - 1);
|
|
3699
|
+
|
|
3700
|
+
const promoCodeError = Object.keys(formErrors).length > 0 ? formErrors : null;
|
|
3701
|
+
|
|
3702
|
+
const handleRemovePromoCode = () => {
|
|
3703
|
+
setTicket(null);
|
|
3704
|
+
removePromoCode();
|
|
3705
|
+
};
|
|
3706
|
+
|
|
3707
|
+
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
3708
|
+
className: `${ticket_type_index_module.outerWrapper} step-wrapper`
|
|
3709
|
+
}, /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("div", {
|
|
3710
|
+
className: ticket_type_index_module.innerWrapper
|
|
3711
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
3712
|
+
className: ticket_type_index_module.title
|
|
3713
|
+
}, /*#__PURE__*/external_react_default().createElement("span", null, "Ticket"), /*#__PURE__*/external_react_default().createElement("div", {
|
|
3714
|
+
className: ticket_type_index_module.summary
|
|
3715
|
+
}, /*#__PURE__*/external_react_default().createElement("span", null, ticket && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, `${ticket.name} (${quantity}): `, /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, (0,utils/* getTicketCost */.fX)(ticket, quantity)), `${(0,utils/* getTicketTaxes */.h5)(ticket, taxTypes)}`, !isActive && reservation?.discount_amount > 0 && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("br", null), /*#__PURE__*/external_react_default().createElement("span", {
|
|
3716
|
+
className: ticket_type_index_module.promoCode
|
|
3717
|
+
}, "Promo code\xA0", /*#__PURE__*/external_react_default().createElement("abbr", {
|
|
3718
|
+
title: reservation.promo_code
|
|
3719
|
+
}, reservation.promo_code), "\xA0applied:"), !isPrePaidReservation && /*#__PURE__*/external_react_default().createElement("span", {
|
|
3720
|
+
className: ticket_type_index_module.discount
|
|
3721
|
+
}, ` - ${(0,helpers/* formatCurrency */.xG)(reservation.discount_amount, {
|
|
3722
|
+
currency: ticket.currency
|
|
3723
|
+
})} ${ticket.currency}`)), !isActive && reservation && !isPrePaidReservation && /*#__PURE__*/external_react_default().createElement("span", {
|
|
3724
|
+
className: ticket_type_index_module.promo
|
|
3725
|
+
}, "Subtotal: ", `${ticket?.currency_symbol} ${((reservation?.raw_amount_in_cents - reservation?.discount_amount_in_cents) / 100).toFixed(2)} ${ticket?.currency}`), !isActive && reservation?.taxes_amount > 0 && !isPrePaidReservation && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, reservation?.applied_taxes.map(tax => {
|
|
3726
|
+
return /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, {
|
|
3727
|
+
key: tax.id
|
|
3728
|
+
}, /*#__PURE__*/external_react_default().createElement("span", {
|
|
3729
|
+
className: ticket_type_index_module.taxes
|
|
3730
|
+
}, /*#__PURE__*/external_react_default().createElement("abbr", {
|
|
3731
|
+
title: tax.name
|
|
3732
|
+
}, tax.name), ` : ${(0,helpers/* formatCurrency */.xG)(tax.amount, {
|
|
3733
|
+
currency: ticket.currency
|
|
3734
|
+
})} ${ticket.currency}`), /*#__PURE__*/external_react_default().createElement("br", null));
|
|
3735
|
+
})), !isActive && reservation && !isPrePaidReservation && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("br", null), "Total: ", `${(0,helpers/* formatCurrency */.xG)(reservation.amount, {
|
|
3736
|
+
currency: ticket.currency
|
|
3737
|
+
})} ${ticket.currency}`)), !ticket && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, "No ticket selected")))), /*#__PURE__*/external_react_default().createElement(external_react_spring_namespaceObject.animated.div, {
|
|
3738
|
+
style: ticket_type_objectSpread({
|
|
3739
|
+
overflow: 'hidden'
|
|
3740
|
+
}, toggleAnimation)
|
|
3741
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
3742
|
+
ref: ref
|
|
3743
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
3744
|
+
className: ticket_type_index_module.form
|
|
3745
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
3746
|
+
className: ticket_type_index_module.dropdown
|
|
3747
|
+
}, /*#__PURE__*/external_react_default().createElement(ticket_dropdown, {
|
|
3748
|
+
selectedTicket: ticket,
|
|
3749
|
+
ticketTypes: allowedTicketTypes,
|
|
3750
|
+
taxTypes: taxTypes,
|
|
3751
|
+
onTicketSelect: handleTicketChange
|
|
3752
|
+
})), ticket && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("div", {
|
|
3753
|
+
className: ticket_type_index_module.quantity
|
|
3754
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
3755
|
+
className: "input-group"
|
|
3756
|
+
}, /*#__PURE__*/external_react_default().createElement("span", {
|
|
3757
|
+
className: "input-group-btn"
|
|
3758
|
+
}, /*#__PURE__*/external_react_default().createElement("button", {
|
|
3759
|
+
"aria-label": "remove a ticket",
|
|
3760
|
+
className: "btn btn-default",
|
|
3761
|
+
onClick: decrementQuantity,
|
|
3762
|
+
disabled: maxQuantity === 0 || quantity === minQuantity
|
|
3763
|
+
}, /*#__PURE__*/external_react_default().createElement("i", {
|
|
3764
|
+
className: "fa fa-minus"
|
|
3765
|
+
}))), /*#__PURE__*/external_react_default().createElement("input", {
|
|
3766
|
+
className: "form-control",
|
|
3767
|
+
"aria-label": "ticket quanity",
|
|
3768
|
+
name: "ticket_quantity",
|
|
3769
|
+
type: "text",
|
|
3770
|
+
value: quantity,
|
|
3771
|
+
readOnly: true,
|
|
3772
|
+
disabled: maxQuantity === 0
|
|
3773
|
+
}), /*#__PURE__*/external_react_default().createElement("span", {
|
|
3774
|
+
className: "input-group-btn"
|
|
3775
|
+
}, /*#__PURE__*/external_react_default().createElement("button", {
|
|
3776
|
+
"aria-label": "add a ticket",
|
|
3777
|
+
className: "btn btn-default",
|
|
3778
|
+
onClick: incrementQuantity,
|
|
3779
|
+
disabled: maxQuantity === 0 || quantity >= maxQuantity
|
|
3780
|
+
}, /*#__PURE__*/external_react_default().createElement("i", {
|
|
3781
|
+
className: "fa fa-plus"
|
|
3782
|
+
}))))))), allowPromoCodes && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement(promocode_input, {
|
|
3783
|
+
promoCode: promoCode,
|
|
3784
|
+
applyPromoCode: applyPromoCode,
|
|
3785
|
+
showMultipleTicketTexts: showMultipleTicketTexts,
|
|
3786
|
+
removePromoCode: handleRemovePromoCode,
|
|
3787
|
+
onPromoCodeChange: handlePromoCodeChange
|
|
3788
|
+
}), promoCodeError && Object.values(promoCodeError).map((er, index) => /*#__PURE__*/external_react_default().createElement("div", {
|
|
3789
|
+
key: `error-${index}`,
|
|
3790
|
+
className: `${ticket_type_index_module.promocodeError} alert alert-danger`
|
|
3791
|
+
}, er))), showMultipleTicketTexts && /*#__PURE__*/external_react_default().createElement("a", {
|
|
3792
|
+
className: ticket_type_index_module.moreInfo,
|
|
3793
|
+
"data-tip": true,
|
|
3794
|
+
"data-for": "ticket-quantity-info"
|
|
3795
|
+
}, /*#__PURE__*/external_react_default().createElement("i", {
|
|
3796
|
+
className: "glyphicon glyphicon-info-sign",
|
|
3797
|
+
"aria-hidden": "true"
|
|
3798
|
+
}), ` `, "Need multiple ticket types?"), /*#__PURE__*/external_react_default().createElement((external_react_tooltip_default()), {
|
|
3799
|
+
id: "ticket-quantity-info",
|
|
3800
|
+
overridePosition: utils/* avoidTooltipOverflow */.kb
|
|
3801
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
3802
|
+
className: ticket_type_index_module.moreInfoTooltip
|
|
3803
|
+
}, external_i18n_react_default().translate("ticket_type.ticket_quantity_tooltip"))))), inPersonDisclaimer && ticket && (0,actions/* isInPersonTicketType */.Qc)(ticket) && /*#__PURE__*/external_react_default().createElement("div", {
|
|
3804
|
+
className: ticket_type_index_module.inPersonDisclaimer
|
|
3805
|
+
}, /*#__PURE__*/external_react_default().createElement((raw_html_default()), null, inPersonDisclaimer)))));
|
|
3806
|
+
};
|
|
3807
|
+
|
|
3808
|
+
/* harmony default export */ const ticket_type = (TicketTypeComponent);
|
|
3809
|
+
;// CONCATENATED MODULE: ./src/components/button-bar/index.module.scss
|
|
3810
|
+
// extracted by mini-css-extract-plugin
|
|
3811
|
+
/* harmony default export */ const button_bar_index_module = ({"button":"button___MZBIY","outerWrapper":"outerWrapper___XRnaq","innerWrapper":"innerWrapper___LFsOH","registration":"registration___jdf6T","actions":"actions___Gsf0y"});
|
|
3812
|
+
;// CONCATENATED MODULE: ./src/components/button-bar/index.js
|
|
3813
|
+
function button_bar_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3814
|
+
|
|
3815
|
+
function button_bar_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? button_bar_ownKeys(Object(source), !0).forEach(function (key) { button_bar_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : button_bar_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3816
|
+
|
|
3817
|
+
function button_bar_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3818
|
+
|
|
3819
|
+
/**
|
|
3820
|
+
* Copyright 2020 OpenStack Foundation
|
|
3821
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3822
|
+
* you may not use this file except in compliance with the License.
|
|
3823
|
+
* You may obtain a copy of the License at
|
|
3824
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3825
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3826
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3827
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3828
|
+
* See the License for the specific language governing permissions and
|
|
3829
|
+
* limitations under the License.
|
|
3830
|
+
**/
|
|
3831
|
+
|
|
3832
|
+
|
|
3833
|
+
|
|
3834
|
+
|
|
3835
|
+
|
|
3836
|
+
const ButtonBarComponent = ({
|
|
3837
|
+
step,
|
|
3838
|
+
changeStep,
|
|
3839
|
+
validatePromoCode,
|
|
3840
|
+
onValidateError,
|
|
3841
|
+
formValues,
|
|
3842
|
+
removeReservedTicket,
|
|
3843
|
+
inPersonDisclaimer
|
|
3844
|
+
}) => {
|
|
3845
|
+
const {
|
|
3846
|
+
ticketType,
|
|
3847
|
+
ticketQuantity,
|
|
3848
|
+
promoCode
|
|
3849
|
+
} = formValues || {};
|
|
3850
|
+
const nextButtonText = inPersonDisclaimer && ticketType && (0,actions/* isInPersonTicketType */.Qc)(ticketType) ? 'Accept' : 'Next';
|
|
3851
|
+
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
3852
|
+
className: `${button_bar_index_module.outerWrapper}`
|
|
3853
|
+
}, step !== constants.STEP_COMPLETE && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("div", {
|
|
3854
|
+
className: `${button_bar_index_module.innerWrapper}`
|
|
3855
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
3856
|
+
className: button_bar_index_module.required
|
|
3857
|
+
}, step !== constants.STEP_SELECT_TICKET_TYPE && /*#__PURE__*/external_react_default().createElement("span", null, "* Required fields ", /*#__PURE__*/external_react_default().createElement("br", null), " ")), /*#__PURE__*/external_react_default().createElement("div", {
|
|
3858
|
+
className: button_bar_index_module.actions
|
|
3859
|
+
}, step !== constants.STEP_SELECT_TICKET_TYPE && step !== constants.STEP_PAYMENT && /*#__PURE__*/external_react_default().createElement("button", {
|
|
3860
|
+
className: `${button_bar_index_module.button} button`,
|
|
3861
|
+
onClick: () => changeStep(step - 1)
|
|
3862
|
+
}, "< Back"), step !== constants.STEP_SELECT_TICKET_TYPE && step === constants.STEP_PAYMENT && /*#__PURE__*/external_react_default().createElement("button", {
|
|
3863
|
+
className: `${button_bar_index_module.button} button`,
|
|
3864
|
+
onClick: () => removeReservedTicket()
|
|
3865
|
+
}, "< Back"), step === constants.STEP_SELECT_TICKET_TYPE && /*#__PURE__*/external_react_default().createElement("button", {
|
|
3866
|
+
disabled: !ticketType,
|
|
3867
|
+
className: `${button_bar_index_module.button} button`,
|
|
3868
|
+
onClick: () => validatePromoCode(button_bar_objectSpread(button_bar_objectSpread({}, ticketType), {}, {
|
|
3869
|
+
ticketQuantity,
|
|
3870
|
+
promoCode
|
|
3871
|
+
}), onValidateError)
|
|
3872
|
+
}, nextButtonText), step === constants.STEP_PERSONAL_INFO && ticketType?.cost === 0 && /*#__PURE__*/external_react_default().createElement("button", {
|
|
3873
|
+
className: `${button_bar_index_module.button} button`,
|
|
3874
|
+
type: "submit",
|
|
3875
|
+
form: "personal-info-form"
|
|
3876
|
+
}, "Get Ticket"), step === constants.STEP_PERSONAL_INFO && ticketType?.cost > 0 && /*#__PURE__*/external_react_default().createElement("button", {
|
|
3877
|
+
className: `${button_bar_index_module.button} button`,
|
|
3878
|
+
type: "submit",
|
|
3879
|
+
form: "personal-info-form"
|
|
3880
|
+
}, "Next"), step === constants.STEP_PAYMENT && /*#__PURE__*/external_react_default().createElement("button", {
|
|
3881
|
+
className: `${button_bar_index_module.button} button`,
|
|
3882
|
+
id: "payment-form-btn",
|
|
3883
|
+
type: "submit",
|
|
3884
|
+
form: "payment-form"
|
|
3885
|
+
}, "Pay Now")))));
|
|
3886
|
+
};
|
|
3887
|
+
|
|
3888
|
+
/* harmony default export */ const button_bar = (ButtonBarComponent);
|
|
3889
|
+
;// CONCATENATED MODULE: ./src/components/purchase-complete/index.module.scss
|
|
3890
|
+
// extracted by mini-css-extract-plugin
|
|
3891
|
+
/* harmony default export */ const purchase_complete_index_module = ({"button":"button___XMN8a","wrapper":"wrapper___Jd5Xg","circle":"circle___lcN86","complete":"complete___HAHzl","actions":"actions___jJdPX","footer":"footer___FL9TW"});
|
|
3892
|
+
;// CONCATENATED MODULE: external "react-content-loader"
|
|
3893
|
+
const external_react_content_loader_namespaceObject = require("react-content-loader");
|
|
3894
|
+
var external_react_content_loader_default = /*#__PURE__*/__webpack_require__.n(external_react_content_loader_namespaceObject);
|
|
3895
|
+
;// CONCATENATED MODULE: ./src/components/purchase-complete/index.js
|
|
3896
|
+
const _excluded = ["cta", "clear", "close"],
|
|
3897
|
+
_excluded2 = ["checkout", "user", "onPurchaseComplete", "goToExtraQuestions", "goToEvent", "goToMyOrders", "completedExtraQuestions", "summit", "nowUtc", "clearWidgetState", "closeWidget", "supportEmail", "hasVirtualAccessLevel"];
|
|
3898
|
+
|
|
3899
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
3900
|
+
|
|
3901
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
3902
|
+
|
|
3903
|
+
/**
|
|
3904
|
+
* Copyright 2020 OpenStack Foundation
|
|
3905
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
3906
|
+
* you may not use this file except in compliance with the License.
|
|
3907
|
+
* You may obtain a copy of the License at
|
|
3908
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
3909
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
3910
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
3911
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
3912
|
+
* See the License for the specific language governing permissions and
|
|
3913
|
+
* limitations under the License.
|
|
3914
|
+
**/
|
|
3915
|
+
|
|
3916
|
+
|
|
3917
|
+
|
|
3918
|
+
|
|
3919
|
+
|
|
3920
|
+
|
|
3921
|
+
|
|
3922
|
+
|
|
3923
|
+
|
|
3924
|
+
const CTAButton = _ref => {
|
|
3925
|
+
let {
|
|
3926
|
+
cta,
|
|
3927
|
+
clear,
|
|
3928
|
+
close
|
|
3929
|
+
} = _ref,
|
|
3930
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
3931
|
+
|
|
3932
|
+
return /*#__PURE__*/external_react_default().createElement("button", {
|
|
3933
|
+
className: `${purchase_complete_index_module.button} button`,
|
|
3934
|
+
onClick: () => {
|
|
3935
|
+
clear();
|
|
3936
|
+
if (close) close();
|
|
3937
|
+
cta();
|
|
3938
|
+
}
|
|
3939
|
+
}, rest.children);
|
|
3940
|
+
};
|
|
3941
|
+
|
|
3942
|
+
const PurchaseComplete = _ref2 => {
|
|
3943
|
+
let {
|
|
3944
|
+
checkout,
|
|
3945
|
+
user,
|
|
3946
|
+
onPurchaseComplete,
|
|
3947
|
+
goToExtraQuestions,
|
|
3948
|
+
goToEvent,
|
|
3949
|
+
goToMyOrders,
|
|
3950
|
+
completedExtraQuestions,
|
|
3951
|
+
summit,
|
|
3952
|
+
nowUtc,
|
|
3953
|
+
clearWidgetState,
|
|
3954
|
+
closeWidget,
|
|
3955
|
+
supportEmail,
|
|
3956
|
+
hasVirtualAccessLevel
|
|
3957
|
+
} = _ref2,
|
|
3958
|
+
rest = _objectWithoutProperties(_ref2, _excluded2);
|
|
3959
|
+
|
|
3960
|
+
(0,external_react_.useEffect)(() => {
|
|
3961
|
+
onPurchaseComplete(checkout);
|
|
3962
|
+
}, []);
|
|
3963
|
+
const [requireExtraQuestions, setRequireExtraQuestions] = (0,external_react_.useState)(null);
|
|
3964
|
+
const [extraQuestionsLoaded, setExtraQuestonsLoaded] = (0,external_react_.useState)(false);
|
|
3965
|
+
const isMultiOrder = (0,external_react_.useMemo)(() => checkout?.tickets.length > 1, [checkout]);
|
|
3966
|
+
const isActive = (0,external_react_.useMemo)(() => summit.start_date <= nowUtc && summit.end_date >= nowUtc, [summit, nowUtc]);
|
|
3967
|
+
const currentTicket = (0,external_react_.useMemo)(() => isMultiOrder ? checkout?.tickets.find(t => t?.owner?.email === user?.email) : checkout?.tickets.find(t => t?.owner), [user]);
|
|
3968
|
+
(0,external_react_.useEffect)(() => {
|
|
3969
|
+
completedExtraQuestions(currentTicket?.owner || null).then(res => {
|
|
3970
|
+
setRequireExtraQuestions(res);
|
|
3971
|
+
setExtraQuestonsLoaded(true);
|
|
3972
|
+
});
|
|
3973
|
+
}, [currentTicket]);
|
|
3974
|
+
|
|
3975
|
+
const _hasVirtualAccessLevel = hasVirtualAccessLevel || currentTicket && (0,utils/* ticketHasAccessLevel */.ZL)(currentTicket, constants.VirtualAccessLevel);
|
|
3976
|
+
|
|
3977
|
+
const attendeeIsSomeoneElse = !isMultiOrder && currentTicket && currentTicket.hasOwnProperty('owner') && currentTicket.owner?.email !== user?.email; // attendeeId is only passed to event-site only if the ticket is for someone else.
|
|
3978
|
+
// If not pass it as null to use the default flow
|
|
3979
|
+
|
|
3980
|
+
const attendeeId = attendeeIsSomeoneElse ? currentTicket?.owner?.id : null;
|
|
3981
|
+
const startDateFormatted = {
|
|
3982
|
+
date: (0,methods_namespaceObject.epochToMomentTimeZone)(summit.start_date, summit.time_zone_id).format('MMMM D'),
|
|
3983
|
+
time: (0,methods_namespaceObject.epochToMomentTimeZone)(summit.start_date, summit.time_zone_id).format('hh:mm A')
|
|
3984
|
+
};
|
|
3985
|
+
if (!extraQuestionsLoaded) return /*#__PURE__*/external_react_default().createElement((external_react_content_loader_default()), {
|
|
3986
|
+
speed: 2,
|
|
3987
|
+
width: "100%",
|
|
3988
|
+
height: 370,
|
|
3989
|
+
viewBox: "0 0 800 370",
|
|
3990
|
+
preserveAspectRatio: "xMidYMin meet"
|
|
3991
|
+
}, /*#__PURE__*/external_react_default().createElement("circle", {
|
|
3992
|
+
cx: "400",
|
|
3993
|
+
cy: "120",
|
|
3994
|
+
r: "40"
|
|
3995
|
+
}), /*#__PURE__*/external_react_default().createElement("rect", {
|
|
3996
|
+
x: "280",
|
|
3997
|
+
y: "180",
|
|
3998
|
+
rx: "4",
|
|
3999
|
+
ry: "4",
|
|
4000
|
+
width: "240",
|
|
4001
|
+
height: "24"
|
|
4002
|
+
}), /*#__PURE__*/external_react_default().createElement("rect", {
|
|
4003
|
+
x: "200",
|
|
4004
|
+
y: "220",
|
|
4005
|
+
rx: "3",
|
|
4006
|
+
ry: "3",
|
|
4007
|
+
width: "400",
|
|
4008
|
+
height: "16"
|
|
4009
|
+
}), /*#__PURE__*/external_react_default().createElement("rect", {
|
|
4010
|
+
x: "250",
|
|
4011
|
+
y: "245",
|
|
4012
|
+
rx: "3",
|
|
4013
|
+
ry: "3",
|
|
4014
|
+
width: "300",
|
|
4015
|
+
height: "16"
|
|
4016
|
+
}), /*#__PURE__*/external_react_default().createElement("rect", {
|
|
4017
|
+
x: "320",
|
|
4018
|
+
y: "290",
|
|
4019
|
+
rx: "4",
|
|
4020
|
+
ry: "4",
|
|
4021
|
+
width: "160",
|
|
4022
|
+
height: "36"
|
|
4023
|
+
}), /*#__PURE__*/external_react_default().createElement("rect", {
|
|
4024
|
+
x: "100",
|
|
4025
|
+
y: "340",
|
|
4026
|
+
rx: "3",
|
|
4027
|
+
ry: "3",
|
|
4028
|
+
width: "600",
|
|
4029
|
+
height: "14"
|
|
4030
|
+
}));
|
|
4031
|
+
if (!checkout) return null;
|
|
4032
|
+
if (requireExtraQuestions == null) return null;
|
|
4033
|
+
let orderCompleteButtonText = currentTicket && requireExtraQuestions ? rest.hasOwnProperty('initialOrderCompleteButton') && !(0,utils/* isEmptyString */.ke)(rest.initialOrderCompleteButton) && typeof rest.initialOrderCompleteButton !== 'undefined' ? rest.initialOrderCompleteButton : external_i18n_react_default().translate('purchase_complete_step.initial_order_complete_button') : rest.hasOwnProperty('orderCompleteButton') && !(0,utils/* isEmptyString */.ke)(rest.orderCompleteButton) ? rest.orderCompleteButton : external_i18n_react_default().translate('purchase_complete_step.order_complete_button');
|
|
4034
|
+
let orderCompleteTitle = rest.hasOwnProperty('orderCompleteTitle') && !(0,utils/* isEmptyString */.ke)(rest.orderCompleteTitle) && typeof rest.orderCompleteTitle !== 'undefined' ? rest.orderCompleteTitle : external_i18n_react_default().translate('purchase_complete_step.title');
|
|
4035
|
+
let orderComplete1stParagraph = currentTicket ? !attendeeIsSomeoneElse && rest.hasOwnProperty('initialOrderComplete1stParagraph') && typeof rest.initialOrderComplete1stParagraph !== 'undefined' ? rest.initialOrderComplete1stParagraph : external_i18n_react_default().translate('purchase_complete_step.initial_order_complete_1st_paragraph_label', {
|
|
4036
|
+
attendee: `${attendeeIsSomeoneElse ? ` ${currentTicket.owner.email}` : 'you'}`,
|
|
4037
|
+
adv: `${attendeeIsSomeoneElse ? `${currentTicket.owner.email}` : 'your'}`,
|
|
4038
|
+
button: orderCompleteButtonText
|
|
4039
|
+
}) : rest.hasOwnProperty('orderComplete1stParagraph') && typeof rest.orderComplete1stParagraph !== 'undefined' ? rest.orderComplete1stParagraph : external_i18n_react_default().translate('purchase_complete_step.order_complete_1st_paragraph_label');
|
|
4040
|
+
let orderComplete2ndParagraph = currentTicket ? rest.hasOwnProperty('initialOrderComplete2ndParagraph') && typeof rest.initialOrderComplete2ndParagraph !== 'undefined' ? rest.initialOrderComplete2ndParagraph : external_i18n_react_default().translate('purchase_complete_step.initial_order_footer_label') : rest.hasOwnProperty('orderComplete2ndParagraph') && typeof rest.orderComplete2ndParagraph !== 'undefined' ? rest.orderComplete2ndParagraph : '';
|
|
4041
|
+
let footerHasTicketText = `${orderComplete2ndParagraph} ${external_i18n_react_default().translate('purchase_complete_step.footer_assistance_text', {
|
|
4042
|
+
supportEmail: `${supportEmail}`
|
|
4043
|
+
})}`;
|
|
4044
|
+
|
|
4045
|
+
const getCTAButton = () => {
|
|
4046
|
+
return /*#__PURE__*/external_react_default().createElement(CTAButton, {
|
|
4047
|
+
cta: currentTicket && requireExtraQuestions ? () => goToExtraQuestions(attendeeId) : goToMyOrders,
|
|
4048
|
+
clear: clearWidgetState,
|
|
4049
|
+
close: closeWidget
|
|
4050
|
+
}, orderCompleteButtonText);
|
|
4051
|
+
};
|
|
4052
|
+
|
|
4053
|
+
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
4054
|
+
className: purchase_complete_index_module.wrapper
|
|
4055
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
4056
|
+
className: purchase_complete_index_module.circle
|
|
4057
|
+
}, /*#__PURE__*/external_react_default().createElement("i", {
|
|
4058
|
+
className: "fa fa-ticket"
|
|
4059
|
+
})), /*#__PURE__*/external_react_default().createElement("span", {
|
|
4060
|
+
className: purchase_complete_index_module.complete
|
|
4061
|
+
}, orderCompleteTitle), isActive ? currentTicket && requireExtraQuestions ? /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("span", null, orderComplete1stParagraph), getCTAButton()) : _hasVirtualAccessLevel ? /*#__PURE__*/external_react_default().createElement(CTAButton, {
|
|
4062
|
+
cta: goToEvent,
|
|
4063
|
+
clear: clearWidgetState,
|
|
4064
|
+
close: closeWidget
|
|
4065
|
+
}, external_i18n_react_default().translate('purchase_complete_step.access_event_button')) : /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("span", null, orderComplete1stParagraph), getCTAButton()) : /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, /*#__PURE__*/external_react_default().createElement("span", null, external_i18n_react_default().translate('purchase_complete_step.event_will_start_text', {
|
|
4066
|
+
date: `${startDateFormatted.date}`,
|
|
4067
|
+
time: `${startDateFormatted.time}`,
|
|
4068
|
+
time_zone_label: `${summit.time_zone_label}`
|
|
4069
|
+
}), /*#__PURE__*/external_react_default().createElement("br", null), /*#__PURE__*/external_react_default().createElement("br", null), orderComplete1stParagraph), /*#__PURE__*/external_react_default().createElement("div", {
|
|
4070
|
+
className: purchase_complete_index_module.actions
|
|
4071
|
+
}, getCTAButton())), /*#__PURE__*/external_react_default().createElement("span", {
|
|
4072
|
+
className: purchase_complete_index_module.footer
|
|
4073
|
+
}, /*#__PURE__*/external_react_default().createElement((raw_html_default()), null, footerHasTicketText)));
|
|
4074
|
+
};
|
|
4075
|
+
|
|
4076
|
+
/* harmony default export */ const purchase_complete = (PurchaseComplete);
|
|
4077
|
+
// EXTERNAL MODULE: ./src/components/login-passwordless/index.js + 4 modules
|
|
4078
|
+
var login_passwordless = __webpack_require__(590);
|
|
4079
|
+
;// CONCATENATED MODULE: ./src/components/ticket-owned/index.module.scss
|
|
4080
|
+
// extracted by mini-css-extract-plugin
|
|
4081
|
+
/* harmony default export */ const ticket_owned_index_module = ({"ticketOwnedWrapper":"ticketOwnedWrapper___nhkDY","alert":"alert___c49oP"});
|
|
4082
|
+
;// CONCATENATED MODULE: ./src/components/ticket-owned/index.js
|
|
4083
|
+
/**
|
|
4084
|
+
* Copyright 2020 OpenStack Foundation
|
|
4085
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4086
|
+
* you may not use this file except in compliance with the License.
|
|
4087
|
+
* You may obtain a copy of the License at
|
|
4088
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
4089
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
4090
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
4091
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4092
|
+
* See the License for the specific language governing permissions and
|
|
4093
|
+
* limitations under the License.
|
|
4094
|
+
**/
|
|
4095
|
+
|
|
4096
|
+
|
|
4097
|
+
|
|
4098
|
+
const TicketOwnedComponent = ({
|
|
4099
|
+
ownedTickets
|
|
4100
|
+
}) => {
|
|
4101
|
+
const ownedTicketsString = (0,external_react_.useMemo)(() => ownedTickets.reduce((acc, ownedTicket, index) => {
|
|
4102
|
+
return `
|
|
4103
|
+
${acc}${acc ? `${index + 1 === ownedTickets.length ? ' and ' : ', '}` : ''}
|
|
4104
|
+
${ownedTicket.qty} ${ownedTicket.type_name}${index === 0 ? !ownedTicket.type_name.toLowerCase().endsWith('ticket') ? ' ticket' : '' : ownedTicket.type_name.toLowerCase().endsWith('ticket') ? '' : ''}${ownedTicket.qty > 1 ? 's' : ''}`;
|
|
4105
|
+
}, ''), [ownedTickets]);
|
|
4106
|
+
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
4107
|
+
className: ticket_owned_index_module.ticketOwnedWrapper
|
|
4108
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
4109
|
+
className: `${ticket_owned_index_module.alert} alert alert-warning`,
|
|
4110
|
+
role: "alert"
|
|
4111
|
+
}, "You have already ordered ", ownedTicketsString, ". If you would like to order more, please do so below."));
|
|
4112
|
+
};
|
|
4113
|
+
|
|
4114
|
+
/* harmony default export */ const ticket_owned = (TicketOwnedComponent);
|
|
4115
|
+
;// CONCATENATED MODULE: ./src/components/no-allowed-tickets/index.module.scss
|
|
4116
|
+
// extracted by mini-css-extract-plugin
|
|
4117
|
+
/* harmony default export */ const no_allowed_tickets_index_module = ({"noAllowedWrapper":"noAllowedWrapper___k52of","alert":"alert___McKm0"});
|
|
4118
|
+
;// CONCATENATED MODULE: ./src/components/no-allowed-tickets/index.js
|
|
4119
|
+
/**
|
|
4120
|
+
* Copyright 2020 OpenStack Foundation
|
|
4121
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4122
|
+
* you may not use this file except in compliance with the License.
|
|
4123
|
+
* You may obtain a copy of the License at
|
|
4124
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
4125
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
4126
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
4127
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4128
|
+
* See the License for the specific language governing permissions and
|
|
4129
|
+
* limitations under the License.
|
|
4130
|
+
**/
|
|
4131
|
+
|
|
4132
|
+
|
|
4133
|
+
|
|
4134
|
+
const NoAllowedTickets = ({
|
|
4135
|
+
noAllowedTicketsMessage
|
|
4136
|
+
}) => {
|
|
4137
|
+
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
4138
|
+
className: no_allowed_tickets_index_module.noAllowedWrapper
|
|
4139
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
4140
|
+
className: `${no_allowed_tickets_index_module.alert} alert alert-warning`,
|
|
4141
|
+
role: "alert",
|
|
4142
|
+
dangerouslySetInnerHTML: {
|
|
4143
|
+
__html: noAllowedTicketsMessage
|
|
4144
|
+
}
|
|
4145
|
+
}));
|
|
4146
|
+
};
|
|
4147
|
+
|
|
4148
|
+
/* harmony default export */ const no_allowed_tickets = (NoAllowedTickets);
|
|
4149
|
+
;// CONCATENATED MODULE: ./src/components/ticket-taxes-error/index.module.scss
|
|
4150
|
+
// extracted by mini-css-extract-plugin
|
|
4151
|
+
/* harmony default export */ const ticket_taxes_error_index_module = ({"ticketTaxesErrorWrapper":"ticketTaxesErrorWrapper___ldztd","alert":"alert___AM17V"});
|
|
4152
|
+
;// CONCATENATED MODULE: ./src/components/ticket-taxes-error/index.js
|
|
4153
|
+
/**
|
|
4154
|
+
* Copyright 2020 OpenStack Foundation
|
|
4155
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4156
|
+
* you may not use this file except in compliance with the License.
|
|
4157
|
+
* You may obtain a copy of the License at
|
|
4158
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
4159
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
4160
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
4161
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4162
|
+
* See the License for the specific language governing permissions and
|
|
4163
|
+
* limitations under the License.
|
|
4164
|
+
**/
|
|
4165
|
+
|
|
4166
|
+
|
|
4167
|
+
|
|
4168
|
+
const TicketTaxesError = ({
|
|
4169
|
+
ticketTaxesErrorMessage,
|
|
4170
|
+
retryTicketTaxes
|
|
4171
|
+
}) => {
|
|
4172
|
+
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
4173
|
+
className: ticket_taxes_error_index_module.ticketTaxesErrorWrapper
|
|
4174
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
4175
|
+
className: `${ticket_taxes_error_index_module.alert} alert alert-warning`,
|
|
4176
|
+
role: "alert",
|
|
4177
|
+
dangerouslySetInnerHTML: {
|
|
4178
|
+
__html: ticketTaxesErrorMessage
|
|
4179
|
+
}
|
|
4180
|
+
}), /*#__PURE__*/external_react_default().createElement("button", {
|
|
4181
|
+
className: `${ticket_taxes_error_index_module.button} button`,
|
|
4182
|
+
onClick: () => retryTicketTaxes()
|
|
4183
|
+
}, "Retry"));
|
|
4184
|
+
};
|
|
4185
|
+
|
|
4186
|
+
/* harmony default export */ const ticket_taxes_error = (TicketTaxesError);
|
|
4187
|
+
;// CONCATENATED MODULE: ./src/components/registration-form/index.js
|
|
4188
|
+
const registration_form_excluded = ["loadSession", "setMarketingSettings", "changeStep", "removeReservedTicket", "reserveTicket", "payTicketWithProvider", "trackEvent", "onPurchaseComplete", "getTicketTypesAndTaxes", "getLoginCode", "passwordlessLogin", "goToLogin", "loginOptions", "allowsNativeAuth", "allowsOtpAuth", "reservation", "checkout", "ticketTypes", "taxTypes", "step", "passwordlessCodeSent", "passwordlessEmail", "passwordlessCode", "passwordlessCodeLifeTime", "getPasswordlessCode", "passwordlessCodeError", "loginWithCode", "goToExtraQuestions", "goToMyOrders", "goToEvent", "profileData", "summitData", "supportEmail", "ticketOwned", "ownedTickets", "widgetLoading", "loading", "inPersonDisclaimer", "userProfile", "handleCompanyError", "providerOptions", "invitation", "loginInitialEmailInputValue", "getMyInvitation", "showMultipleTicketTexts", "noAllowedTicketsMessage", "ticketTaxesErrorMessage", "authErrorCallback", "clearWidgetState", "allowPromoCodes", "showCompanyInput", "companyDDLPlaceholder", "nowUtc", "updateClock", "completedExtraQuestions", "loadProfileData", "closeWidget", "hasVirtualAccessLevel", "hidePostalCode", "onError", "successfulPaymentReturnUrl", "idpLogoLight", "idpLogoDark", "idpLogoAlt", "showCompanyInputDefaultOptions", "companyDDLOptions2Show", "promoCode", "hasDiscount", "getTicketDiscount", "removePromoCode", "applyPromoCode", "validatePromoCode", "closeHandlerRef"];
|
|
4189
|
+
|
|
4190
|
+
function registration_form_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4191
|
+
|
|
4192
|
+
function registration_form_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? registration_form_ownKeys(Object(source), !0).forEach(function (key) { registration_form_defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : registration_form_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4193
|
+
|
|
4194
|
+
function registration_form_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
4195
|
+
|
|
4196
|
+
function registration_form_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = registration_form_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4197
|
+
|
|
4198
|
+
function registration_form_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
4199
|
+
|
|
4200
|
+
/**
|
|
4201
|
+
* Copyright 2026 OpenStack Foundation
|
|
4202
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
4203
|
+
* you may not use this file except in compliance with the License.
|
|
4204
|
+
* You may obtain a copy of the License at
|
|
4205
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
4206
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
4207
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
4208
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
4209
|
+
* See the License for the specific language governing permissions and
|
|
4210
|
+
* limitations under the License.
|
|
4211
|
+
*
|
|
4212
|
+
* RegistrationForm - Core registration form component
|
|
4213
|
+
**/
|
|
4214
|
+
|
|
4215
|
+
|
|
4216
|
+
|
|
4217
|
+
|
|
4218
|
+
|
|
4219
|
+
|
|
4220
|
+
|
|
4221
|
+
|
|
4222
|
+
|
|
4223
|
+
|
|
4224
|
+
|
|
4225
|
+
|
|
4226
|
+
|
|
4227
|
+
|
|
4228
|
+
|
|
4229
|
+
|
|
4230
|
+
|
|
4231
|
+
|
|
4232
|
+
|
|
4233
|
+
|
|
4234
|
+
|
|
4235
|
+
|
|
4236
|
+
|
|
4237
|
+
|
|
4238
|
+
|
|
4239
|
+
let language = (0,utils/* getCurrentUserLanguage */.AS)();
|
|
4240
|
+
|
|
4241
|
+
if (language.length > 2) {
|
|
4242
|
+
language = language.split("-")[0];
|
|
4243
|
+
language = language.split("_")[0];
|
|
4244
|
+
}
|
|
4245
|
+
|
|
4246
|
+
try {
|
|
4247
|
+
external_i18n_react_default().setTexts(__webpack_require__(267)(`./${language}.json`));
|
|
4248
|
+
} catch (e) {
|
|
4249
|
+
external_i18n_react_default().setTexts(__webpack_require__(443));
|
|
4250
|
+
}
|
|
4251
|
+
|
|
4252
|
+
const RegistrationFormContent = _ref => {
|
|
4253
|
+
let {
|
|
4254
|
+
loadSession,
|
|
4255
|
+
setMarketingSettings,
|
|
4256
|
+
changeStep,
|
|
4257
|
+
removeReservedTicket,
|
|
4258
|
+
reserveTicket,
|
|
4259
|
+
payTicketWithProvider,
|
|
4260
|
+
trackEvent,
|
|
4261
|
+
onPurchaseComplete,
|
|
4262
|
+
getTicketTypesAndTaxes,
|
|
4263
|
+
getLoginCode,
|
|
4264
|
+
passwordlessLogin,
|
|
4265
|
+
goToLogin,
|
|
4266
|
+
loginOptions,
|
|
4267
|
+
allowsNativeAuth,
|
|
4268
|
+
allowsOtpAuth,
|
|
4269
|
+
reservation,
|
|
4270
|
+
checkout,
|
|
4271
|
+
ticketTypes,
|
|
4272
|
+
taxTypes,
|
|
4273
|
+
step,
|
|
4274
|
+
passwordlessCodeSent,
|
|
4275
|
+
passwordlessEmail,
|
|
4276
|
+
passwordlessCode,
|
|
4277
|
+
passwordlessCodeLifeTime,
|
|
4278
|
+
getPasswordlessCode,
|
|
4279
|
+
passwordlessCodeError,
|
|
4280
|
+
loginWithCode,
|
|
4281
|
+
goToExtraQuestions,
|
|
4282
|
+
goToMyOrders,
|
|
4283
|
+
goToEvent,
|
|
4284
|
+
profileData,
|
|
4285
|
+
summitData,
|
|
4286
|
+
supportEmail,
|
|
4287
|
+
ticketOwned,
|
|
4288
|
+
ownedTickets,
|
|
4289
|
+
widgetLoading,
|
|
4290
|
+
loading,
|
|
4291
|
+
inPersonDisclaimer,
|
|
4292
|
+
userProfile,
|
|
4293
|
+
handleCompanyError,
|
|
4294
|
+
providerOptions,
|
|
4295
|
+
invitation,
|
|
4296
|
+
loginInitialEmailInputValue,
|
|
4297
|
+
getMyInvitation,
|
|
4298
|
+
showMultipleTicketTexts,
|
|
4299
|
+
noAllowedTicketsMessage,
|
|
4300
|
+
ticketTaxesErrorMessage,
|
|
4301
|
+
authErrorCallback,
|
|
4302
|
+
clearWidgetState,
|
|
4303
|
+
allowPromoCodes,
|
|
4304
|
+
showCompanyInput,
|
|
4305
|
+
companyDDLPlaceholder,
|
|
4306
|
+
nowUtc,
|
|
4307
|
+
updateClock,
|
|
4308
|
+
completedExtraQuestions,
|
|
4309
|
+
loadProfileData,
|
|
4310
|
+
closeWidget,
|
|
4311
|
+
hasVirtualAccessLevel,
|
|
4312
|
+
hidePostalCode,
|
|
4313
|
+
onError,
|
|
4314
|
+
successfulPaymentReturnUrl,
|
|
4315
|
+
idpLogoLight,
|
|
4316
|
+
idpLogoDark,
|
|
4317
|
+
idpLogoAlt,
|
|
4318
|
+
showCompanyInputDefaultOptions,
|
|
4319
|
+
companyDDLOptions2Show,
|
|
4320
|
+
promoCode,
|
|
4321
|
+
hasDiscount,
|
|
4322
|
+
getTicketDiscount,
|
|
4323
|
+
removePromoCode,
|
|
4324
|
+
applyPromoCode,
|
|
4325
|
+
validatePromoCode,
|
|
4326
|
+
closeHandlerRef
|
|
4327
|
+
} = _ref,
|
|
4328
|
+
rest = registration_form_objectWithoutProperties(_ref, registration_form_excluded);
|
|
4329
|
+
|
|
4330
|
+
const [registrationForm, setRegistrationForm] = (0,external_react_.useState)({
|
|
4331
|
+
values: {
|
|
4332
|
+
ticketType: null,
|
|
4333
|
+
ticketQuantity: 1,
|
|
4334
|
+
personalInformation: null,
|
|
4335
|
+
paymentInformation: null,
|
|
4336
|
+
promoCode: ''
|
|
4337
|
+
},
|
|
4338
|
+
errors: []
|
|
4339
|
+
});
|
|
4340
|
+
const [ticketDataError, setTicketDataError] = (0,external_react_.useState)(false);
|
|
4341
|
+
const [ticketDataLoaded, setTicketDataLoaded] = (0,external_react_.useState)(false);
|
|
4342
|
+
const {
|
|
4343
|
+
values: formValues,
|
|
4344
|
+
errors: formErrors
|
|
4345
|
+
} = registrationForm;
|
|
4346
|
+
|
|
4347
|
+
const setFormValues = values => setRegistrationForm(registration_form_objectSpread(registration_form_objectSpread({}, registrationForm), {}, {
|
|
4348
|
+
values
|
|
4349
|
+
}));
|
|
4350
|
+
|
|
4351
|
+
const setFormErrors = errors => setRegistrationForm(registration_form_objectSpread(registration_form_objectSpread({}, registrationForm), {}, {
|
|
4352
|
+
errors
|
|
4353
|
+
}));
|
|
4354
|
+
|
|
4355
|
+
const {
|
|
4356
|
+
publicKey,
|
|
4357
|
+
provider
|
|
4358
|
+
} = (0,utils/* getCurrentProvider */.U5)(summitData);
|
|
4359
|
+
const allowedTicketTypes = ticketDataLoaded ? ticketTypes.filter(tt => tt.sub_type === constants.TICKET_TYPE_SUBTYPE_PREPAID || tt.sales_start_date === null && tt.sales_end_date === null || nowUtc >= tt.sales_start_date && nowUtc <= tt.sales_end_date) : [];
|
|
4360
|
+
const noAvailableTickets = (0,external_react_.useMemo)(() => profileData && ticketDataLoaded && !ticketDataError && allowedTicketTypes.length === 0 && step !== constants.STEP_COMPLETE, [profileData, ticketDataLoaded, ticketDataError, allowedTicketTypes, step]);
|
|
4361
|
+
const alreadyOwnedTickets = (0,external_react_.useMemo)(() => profileData && ticketDataLoaded && !ticketDataError && allowedTicketTypes.length > 0 && ownedTickets.length > 0, [profileData, ticketDataLoaded, ticketDataError, allowedTicketTypes, ownedTickets]);
|
|
4362
|
+
(0,external_react_.useEffect)(() => {
|
|
4363
|
+
if (profileData) loadProfileData(profileData);
|
|
4364
|
+
}, [profileData]);
|
|
4365
|
+
(0,external_react_.useEffect)(() => {
|
|
4366
|
+
loadSession(registration_form_objectSpread(registration_form_objectSpread({}, rest), {}, {
|
|
4367
|
+
summitData,
|
|
4368
|
+
profileData
|
|
4369
|
+
}));
|
|
4370
|
+
|
|
4371
|
+
if (!profileData) {
|
|
4372
|
+
changeStep(constants.STEP_SELECT_TICKET_TYPE);
|
|
4373
|
+
}
|
|
4374
|
+
}, []);
|
|
4375
|
+
(0,external_react_.useEffect)(() => {
|
|
4376
|
+
if (summitData && profileData) {
|
|
4377
|
+
const ensureInvitation = () => summitData.invite_only_registration ? getMyInvitation(summitData.id) : Promise.resolve();
|
|
4378
|
+
|
|
4379
|
+
ensureInvitation().catch(e => console.log(e)).finally(() => handleGetTicketTypesAndTaxes(summitData.id));
|
|
4380
|
+
}
|
|
4381
|
+
}, [summitData?.id, profileData]);
|
|
4382
|
+
(0,external_react_.useEffect)(() => {
|
|
4383
|
+
if (step > constants.STEP_SELECT_TICKET_TYPE && !registrationForm.values?.ticketType && !reservation) {
|
|
4384
|
+
changeStep(constants.STEP_SELECT_TICKET_TYPE);
|
|
4385
|
+
}
|
|
4386
|
+
}, [registrationForm.values, step]);
|
|
4387
|
+
(0,external_react_.useEffect)(() => {
|
|
4388
|
+
setFormErrors([]);
|
|
4389
|
+
}, [step]);
|
|
4390
|
+
const [ref, {
|
|
4391
|
+
height
|
|
4392
|
+
}] = (0,external_react_use_namespaceObject.useMeasure)();
|
|
4393
|
+
const toggleAnimation = (0,external_react_spring_namespaceObject.useSpring)({
|
|
4394
|
+
config: registration_form_objectSpread({
|
|
4395
|
+
bounce: 0
|
|
4396
|
+
}, external_react_spring_namespaceObject.config.stiff),
|
|
4397
|
+
to: {
|
|
4398
|
+
opacity: formValues?.ticketType?.cost === 0 ? 0 : 1,
|
|
4399
|
+
height: formValues?.ticketType?.cost === 0 ? 0 : height
|
|
4400
|
+
}
|
|
4401
|
+
});
|
|
4402
|
+
|
|
4403
|
+
const handleCloseClick = () => {
|
|
4404
|
+
const closeAndClearState = () => {
|
|
4405
|
+
changeStep(constants.STEP_SELECT_TICKET_TYPE);
|
|
4406
|
+
clearWidgetState();
|
|
4407
|
+
|
|
4408
|
+
if (closeWidget) {
|
|
4409
|
+
closeWidget();
|
|
4410
|
+
}
|
|
4411
|
+
};
|
|
4412
|
+
|
|
4413
|
+
if (reservation) {
|
|
4414
|
+
removeReservedTicket().finally(() => {
|
|
4415
|
+
closeAndClearState();
|
|
4416
|
+
});
|
|
4417
|
+
} else {
|
|
4418
|
+
closeAndClearState();
|
|
4419
|
+
}
|
|
4420
|
+
}; // Expose close handler to parent via ref so it can trigger cleanup on close
|
|
4421
|
+
|
|
4422
|
+
|
|
4423
|
+
(0,external_react_.useEffect)(() => {
|
|
4424
|
+
if (closeHandlerRef) {
|
|
4425
|
+
closeHandlerRef.current = handleCloseClick;
|
|
4426
|
+
}
|
|
4427
|
+
});
|
|
4428
|
+
|
|
4429
|
+
const handleGetTicketTypesAndTaxes = summitId => {
|
|
4430
|
+
setTicketDataError(false);
|
|
4431
|
+
setTicketDataLoaded(false);
|
|
4432
|
+
getTicketTypesAndTaxes(summitId).catch(error => {
|
|
4433
|
+
let {
|
|
4434
|
+
message
|
|
4435
|
+
} = error;
|
|
4436
|
+
|
|
4437
|
+
if (message && (message.includes(constants_namespaceObject.AUTH_ERROR_MISSING_AUTH_INFO) || message.includes(constants_namespaceObject.AUTH_ERROR_MISSING_REFRESH_TOKEN) || message.includes(constants_namespaceObject.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR))) {
|
|
4438
|
+
clearWidgetState();
|
|
4439
|
+
return authErrorCallback(error);
|
|
4440
|
+
}
|
|
4441
|
+
|
|
4442
|
+
setTicketDataError(true);
|
|
4443
|
+
}).finally(() => {
|
|
4444
|
+
setTicketDataLoaded(true);
|
|
4445
|
+
});
|
|
4446
|
+
};
|
|
4447
|
+
|
|
4448
|
+
const handleValidatePromocode = (data, onError) => {
|
|
4449
|
+
validatePromoCode(data, onError).then(() => {
|
|
4450
|
+
trackAddToCart(data);
|
|
4451
|
+
}).catch(e => {
|
|
4452
|
+
(0,utils/* handleSentryException */.Gj)(e);
|
|
4453
|
+
});
|
|
4454
|
+
};
|
|
4455
|
+
|
|
4456
|
+
const trackViewItem = data => {
|
|
4457
|
+
const eventData = (0,utils/* buildTrackEvent */.S2)(data);
|
|
4458
|
+
trackEvent(constants.VIEW_ITEM, eventData);
|
|
4459
|
+
};
|
|
4460
|
+
|
|
4461
|
+
const trackAddToCart = data => {
|
|
4462
|
+
const eventData = (0,utils/* buildTrackEvent */.S2)(data, data.ticketQuantity, promoCode);
|
|
4463
|
+
trackEvent(constants.ADD_TO_CART, eventData);
|
|
4464
|
+
};
|
|
4465
|
+
|
|
4466
|
+
const trackBeginCheckout = data => {
|
|
4467
|
+
const eventData = (0,utils/* buildTrackEvent */.S2)(data.ticketType, data.ticketQuantity, promoCode);
|
|
4468
|
+
trackEvent(constants.BEGIN_CHECKOUT, eventData);
|
|
4469
|
+
};
|
|
4470
|
+
|
|
4471
|
+
const handlePurchaseComplete = order => {
|
|
4472
|
+
onPurchaseComplete(order);
|
|
4473
|
+
trackEvent(constants.PURCHASE_COMPLETE, {
|
|
4474
|
+
order
|
|
4475
|
+
});
|
|
4476
|
+
}; // If user is logged in but ticket data hasn't loaded yet (and no error occurred),
|
|
4477
|
+
// don't render to avoid flash. Uses local state instead of Redux to prevent
|
|
4478
|
+
// race conditions with redux-persist rehydration.
|
|
4479
|
+
|
|
4480
|
+
|
|
4481
|
+
if (profileData && !ticketDataLoaded && !ticketDataError) return null;
|
|
4482
|
+
return /*#__PURE__*/external_react_default().createElement("div", {
|
|
4483
|
+
className: "summit-registration-lite"
|
|
4484
|
+
}, /*#__PURE__*/external_react_default().createElement((ajaxloader_default()), {
|
|
4485
|
+
relative: true,
|
|
4486
|
+
color: '#ffffff',
|
|
4487
|
+
show: widgetLoading || loading,
|
|
4488
|
+
size: 80
|
|
4489
|
+
}), /*#__PURE__*/external_react_default().createElement((clock_default()), {
|
|
4490
|
+
onTick: timestamp => updateClock(timestamp),
|
|
4491
|
+
timezone: summitData.time_zone_id
|
|
4492
|
+
}), profileData && ticketDataError && /*#__PURE__*/external_react_default().createElement(ticket_taxes_error, {
|
|
4493
|
+
ticketTaxesErrorMessage: ticketTaxesErrorMessage,
|
|
4494
|
+
retryTicketTaxes: () => handleGetTicketTypesAndTaxes(summitData?.id)
|
|
4495
|
+
}), noAvailableTickets && /*#__PURE__*/external_react_default().createElement(no_allowed_tickets, {
|
|
4496
|
+
noAllowedTicketsMessage: noAllowedTicketsMessage
|
|
4497
|
+
}), !ticketDataError && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, !profileData && !passwordlessCodeSent && /*#__PURE__*/external_react_default().createElement(login["default"], {
|
|
4498
|
+
summitData: summitData,
|
|
4499
|
+
loginOptions: loginOptions,
|
|
4500
|
+
allowsNativeAuth: allowsNativeAuth,
|
|
4501
|
+
allowsOtpAuth: allowsOtpAuth,
|
|
4502
|
+
login: provider => rest.authUser(provider),
|
|
4503
|
+
getLoginCode: getLoginCode,
|
|
4504
|
+
getPasswordlessCode: getPasswordlessCode,
|
|
4505
|
+
initialEmailValue: loginInitialEmailInputValue
|
|
4506
|
+
}), !profileData && passwordlessCodeSent && /*#__PURE__*/external_react_default().createElement(login_passwordless["default"], {
|
|
4507
|
+
codeLength: passwordlessCode,
|
|
4508
|
+
codeLifeTime: passwordlessCodeLifeTime,
|
|
4509
|
+
email: passwordlessEmail,
|
|
4510
|
+
passwordlessLogin: passwordlessLogin,
|
|
4511
|
+
loginWithCode: loginWithCode,
|
|
4512
|
+
codeError: passwordlessCodeError,
|
|
4513
|
+
goToLogin: goToLogin,
|
|
4514
|
+
getLoginCode: getLoginCode,
|
|
4515
|
+
getPasswordlessCode: getPasswordlessCode,
|
|
4516
|
+
idpLogoLight: idpLogoLight,
|
|
4517
|
+
idpLogoDark: idpLogoDark,
|
|
4518
|
+
idpLogoAlt: idpLogoAlt
|
|
4519
|
+
}), profileData && step !== constants.STEP_COMPLETE && /*#__PURE__*/external_react_default().createElement((external_react_default()).Fragment, null, alreadyOwnedTickets && /*#__PURE__*/external_react_default().createElement(ticket_owned, {
|
|
4520
|
+
ownedTickets: ownedTickets
|
|
4521
|
+
}), /*#__PURE__*/external_react_default().createElement(ticket_type, {
|
|
4522
|
+
allowedTicketTypes: allowedTicketTypes,
|
|
4523
|
+
originalTicketTypes: ticketTypes,
|
|
4524
|
+
inPersonDisclaimer: inPersonDisclaimer,
|
|
4525
|
+
taxTypes: taxTypes,
|
|
4526
|
+
reservation: reservation,
|
|
4527
|
+
isActive: step === constants.STEP_SELECT_TICKET_TYPE,
|
|
4528
|
+
allowPromoCodes: allowPromoCodes,
|
|
4529
|
+
applyPromoCode: applyPromoCode,
|
|
4530
|
+
removePromoCode: () => {
|
|
4531
|
+
setFormErrors({});
|
|
4532
|
+
setFormValues(registration_form_objectSpread(registration_form_objectSpread({}, formValues), {}, {
|
|
4533
|
+
promoCode: ""
|
|
4534
|
+
}));
|
|
4535
|
+
removePromoCode();
|
|
4536
|
+
},
|
|
4537
|
+
promoCode: promoCode,
|
|
4538
|
+
formErrors: formErrors,
|
|
4539
|
+
changeForm: ticketForm => setFormValues(registration_form_objectSpread(registration_form_objectSpread({}, formValues), ticketForm)),
|
|
4540
|
+
trackViewItem: trackViewItem,
|
|
4541
|
+
showMultipleTicketTexts: showMultipleTicketTexts
|
|
4542
|
+
}), /*#__PURE__*/external_react_default().createElement(personal_information, {
|
|
4543
|
+
isActive: step === constants.STEP_PERSONAL_INFO,
|
|
4544
|
+
reservation: reservation,
|
|
4545
|
+
userProfile: profileData,
|
|
4546
|
+
invitation: invitation,
|
|
4547
|
+
summitId: summitData.id,
|
|
4548
|
+
changeForm: personalInformation => {
|
|
4549
|
+
setFormValues(registration_form_objectSpread(registration_form_objectSpread({}, registrationForm.values), {}, {
|
|
4550
|
+
personalInformation
|
|
4551
|
+
}));
|
|
4552
|
+
reserveTicket({
|
|
4553
|
+
provider,
|
|
4554
|
+
personalInformation: personalInformation,
|
|
4555
|
+
ticket: registrationForm.values?.ticketType,
|
|
4556
|
+
ticketQuantity: registrationForm.values?.ticketQuantity
|
|
4557
|
+
}, {
|
|
4558
|
+
onError: (err, res) => setFormErrors(res.body.errors)
|
|
4559
|
+
}).then(() => {
|
|
4560
|
+
trackBeginCheckout(registrationForm.values);
|
|
4561
|
+
}).catch(error => {
|
|
4562
|
+
let {
|
|
4563
|
+
message
|
|
4564
|
+
} = error;
|
|
4565
|
+
|
|
4566
|
+
if (message && (message.includes(constants_namespaceObject.AUTH_ERROR_MISSING_AUTH_INFO) || message.includes(constants_namespaceObject.AUTH_ERROR_MISSING_REFRESH_TOKEN) || message.includes(constants_namespaceObject.AUTH_ERROR_REFRESH_TOKEN_REQUEST_ERROR))) {
|
|
4567
|
+
clearWidgetState();
|
|
4568
|
+
return authErrorCallback(error);
|
|
4569
|
+
}
|
|
4570
|
+
});
|
|
4571
|
+
},
|
|
4572
|
+
handleCompanyError: handleCompanyError,
|
|
4573
|
+
formValues: formValues,
|
|
4574
|
+
formErrors: formErrors,
|
|
4575
|
+
showMultipleTicketTexts: showMultipleTicketTexts,
|
|
4576
|
+
showCompanyInput: showCompanyInput,
|
|
4577
|
+
companyDDLPlaceholder: companyDDLPlaceholder,
|
|
4578
|
+
showCompanyInputDefaultOptions: showCompanyInputDefaultOptions,
|
|
4579
|
+
companyDDLOptions2Show: companyDDLOptions2Show
|
|
4580
|
+
}), /*#__PURE__*/external_react_default().createElement(external_react_spring_namespaceObject.animated.div, {
|
|
4581
|
+
style: registration_form_objectSpread({}, toggleAnimation)
|
|
4582
|
+
}, /*#__PURE__*/external_react_default().createElement("div", {
|
|
4583
|
+
ref: ref
|
|
4584
|
+
}, /*#__PURE__*/external_react_default().createElement(payment, {
|
|
4585
|
+
isActive: step === constants.STEP_PAYMENT,
|
|
4586
|
+
reservation: reservation,
|
|
4587
|
+
payTicket: payTicketWithProvider,
|
|
4588
|
+
userProfile: profileData,
|
|
4589
|
+
timestamp: summitData.timestamp,
|
|
4590
|
+
provider: provider,
|
|
4591
|
+
providerKey: publicKey,
|
|
4592
|
+
providerOptions: providerOptions,
|
|
4593
|
+
hidePostalCode: hidePostalCode,
|
|
4594
|
+
onError: onError,
|
|
4595
|
+
successfulPaymentReturnUrl: successfulPaymentReturnUrl
|
|
4596
|
+
}))), /*#__PURE__*/external_react_default().createElement(button_bar, {
|
|
4597
|
+
step: step,
|
|
4598
|
+
inPersonDisclaimer: inPersonDisclaimer,
|
|
4599
|
+
formValues: formValues,
|
|
4600
|
+
removeReservedTicket: removeReservedTicket,
|
|
4601
|
+
validatePromoCode: handleValidatePromocode,
|
|
4602
|
+
onValidateError: {
|
|
4603
|
+
onError: (err, res) => setFormErrors(res.body.errors)
|
|
4604
|
+
},
|
|
4605
|
+
changeStep: changeStep
|
|
4606
|
+
})), profileData && step === constants.STEP_COMPLETE && /*#__PURE__*/external_react_default().createElement(purchase_complete, {
|
|
4607
|
+
checkout: checkout,
|
|
4608
|
+
user: profileData,
|
|
4609
|
+
summit: summitData,
|
|
4610
|
+
onPurchaseComplete: handlePurchaseComplete,
|
|
4611
|
+
goToEvent: goToEvent,
|
|
4612
|
+
goToMyOrders: goToMyOrders,
|
|
4613
|
+
goToExtraQuestions: goToExtraQuestions,
|
|
4614
|
+
completedExtraQuestions: completedExtraQuestions,
|
|
4615
|
+
nowUtc: nowUtc,
|
|
4616
|
+
clearWidgetState: clearWidgetState,
|
|
4617
|
+
closeWidget: closeWidget,
|
|
4618
|
+
hasVirtualAccessLevel: hasVirtualAccessLevel,
|
|
4619
|
+
supportEmail: supportEmail,
|
|
4620
|
+
initialOrderComplete1stParagraph: rest.initialOrderComplete1stParagraph,
|
|
4621
|
+
initialOrderComplete2ndParagraph: rest.initialOrderComplete2ndParagraph,
|
|
4622
|
+
initialOrderCompleteButton: rest.initialOrderCompleteButton,
|
|
4623
|
+
orderCompleteTitle: rest.orderCompleteTitle,
|
|
4624
|
+
orderComplete1stParagraph: rest.orderComplete1stParagraph,
|
|
4625
|
+
orderComplete2ndParagraph: rest.orderComplete2ndParagraph,
|
|
4626
|
+
orderCompleteButton: rest.orderCompleteButton
|
|
4627
|
+
})));
|
|
4628
|
+
};
|
|
4629
|
+
|
|
4630
|
+
const mapStateToProps = ({
|
|
4631
|
+
registrationLiteState
|
|
4632
|
+
}) => ({
|
|
4633
|
+
widgetLoading: registrationLiteState.widgetLoading,
|
|
4634
|
+
reservation: registrationLiteState.reservation,
|
|
4635
|
+
invitation: registrationLiteState.invitation,
|
|
4636
|
+
userProfile: registrationLiteState.settings.userProfile,
|
|
4637
|
+
checkout: registrationLiteState.checkout,
|
|
4638
|
+
ticketTypes: registrationLiteState.ticketTypes,
|
|
4639
|
+
taxTypes: registrationLiteState.taxTypes,
|
|
4640
|
+
step: registrationLiteState.step,
|
|
4641
|
+
passwordlessEmail: registrationLiteState.passwordless.email,
|
|
4642
|
+
passwordlessCode: registrationLiteState.passwordless.otp_length,
|
|
4643
|
+
passwordlessCodeLifeTime: registrationLiteState.passwordless.otp_lifetime,
|
|
4644
|
+
passwordlessCodeSent: registrationLiteState.passwordless.code_sent,
|
|
4645
|
+
passwordlessCodeError: registrationLiteState.passwordless.error,
|
|
4646
|
+
nowUtc: registrationLiteState.nowUtc,
|
|
4647
|
+
promoCode: registrationLiteState.promoCode
|
|
4648
|
+
});
|
|
4649
|
+
|
|
4650
|
+
const RegistrationForm = (0,external_react_redux_.connect)(mapStateToProps, {
|
|
4651
|
+
loadSession: actions/* loadSession */.dF,
|
|
4652
|
+
changeStep: actions/* changeStep */.sz,
|
|
4653
|
+
reserveTicket: actions/* reserveTicket */.cL,
|
|
4654
|
+
removeReservedTicket: actions/* removeReservedTicket */.D2,
|
|
4655
|
+
payTicketWithProvider: actions/* payTicketWithProvider */.qC,
|
|
4656
|
+
getTicketTypesAndTaxes: actions/* getTicketTypesAndTaxes */.xu,
|
|
4657
|
+
getLoginCode: actions/* getLoginCode */.aH,
|
|
4658
|
+
passwordlessLogin: actions/* passwordlessLogin */.BT,
|
|
4659
|
+
goToLogin: actions/* goToLogin */.hh,
|
|
4660
|
+
getMyInvitation: actions/* getMyInvitation */.q1,
|
|
4661
|
+
clearWidgetState: actions/* clearWidgetState */.YS,
|
|
4662
|
+
updateClock: actions/* updateClock */.ry,
|
|
4663
|
+
loadProfileData: actions/* loadProfileData */.Bi,
|
|
4664
|
+
applyPromoCode: actions/* applyPromoCode */.gs,
|
|
4665
|
+
removePromoCode: actions/* removePromoCode */.$r,
|
|
4666
|
+
validatePromoCode: actions/* validatePromoCode */.jn
|
|
4667
|
+
})(RegistrationFormContent);
|
|
4668
|
+
RegistrationForm.defaultProps = {
|
|
4669
|
+
loginInitialEmailInputValue: '',
|
|
4670
|
+
showMultipleTicketTexts: true,
|
|
4671
|
+
showCompanyInput: true,
|
|
4672
|
+
noAllowedTicketsMessage: '<span>You already have purchased all available tickets for this event and/or there are no tickets available for you to purchase.</span><br/><span><a href="/a/my-tickets">Visit the my orders / my tickets page</a> to review your existing tickets.</span>',
|
|
4673
|
+
ticketTaxesErrorMessage: '<span>There was an error getting the information for the tickets. Please try it again.</span>',
|
|
4674
|
+
allowPromoCodes: true,
|
|
4675
|
+
companyDDLPlaceholder: 'Company',
|
|
4676
|
+
authErrorCallback: error => {
|
|
4677
|
+
console.log(error);
|
|
4678
|
+
},
|
|
4679
|
+
onError: error => {
|
|
4680
|
+
console.log("payment error : ", error);
|
|
4681
|
+
},
|
|
4682
|
+
hasVirtualAccessLevel: false,
|
|
4683
|
+
supportEmail: 'support@fntech.com',
|
|
4684
|
+
showCompanyInputDefaultOptions: false,
|
|
4685
|
+
companyDDLOptions2Show: 25,
|
|
4686
|
+
idpLogoLight: null,
|
|
4687
|
+
idpLogoDark: null,
|
|
4688
|
+
hidePostalCode: false,
|
|
4689
|
+
successfulPaymentReturnUrl: ''
|
|
4690
|
+
};
|
|
4691
|
+
RegistrationForm.propTypes = {
|
|
4692
|
+
apiBaseUrl: (external_prop_types_default()).string.isRequired,
|
|
4693
|
+
clientId: (external_prop_types_default()).string.isRequired,
|
|
4694
|
+
getAccessToken: (external_prop_types_default()).func.isRequired,
|
|
4695
|
+
loginInitialEmailInputValue: (external_prop_types_default()).string,
|
|
4696
|
+
showMultipleTicketTexts: (external_prop_types_default()).bool,
|
|
4697
|
+
showCompanyInput: (external_prop_types_default()).bool,
|
|
4698
|
+
authErrorCallback: (external_prop_types_default()).func,
|
|
4699
|
+
onError: (external_prop_types_default()).func,
|
|
4700
|
+
successfulPaymentReturnUrl: (external_prop_types_default()).string,
|
|
4701
|
+
goToMyOrders: (external_prop_types_default()).func.isRequired,
|
|
4702
|
+
goToExtraQuestions: (external_prop_types_default()).func.isRequired,
|
|
4703
|
+
completedExtraQuestions: (external_prop_types_default()).func.isRequired,
|
|
4704
|
+
closeWidget: (external_prop_types_default()).func,
|
|
4705
|
+
hasVirtualAccessLevel: (external_prop_types_default()).bool,
|
|
4706
|
+
hidePostalCode: (external_prop_types_default()).bool,
|
|
4707
|
+
supportEmail: (external_prop_types_default()).string,
|
|
4708
|
+
initialOrderComplete1stParagraph: (external_prop_types_default()).string,
|
|
4709
|
+
initialOrderComplete2ndParagraph: (external_prop_types_default()).string,
|
|
4710
|
+
initialOrderCompleteButton: (external_prop_types_default()).string,
|
|
4711
|
+
orderCompleteTitle: (external_prop_types_default()).string,
|
|
4712
|
+
orderComplete1stParagraph: (external_prop_types_default()).string,
|
|
4713
|
+
orderComplete2ndParagraph: (external_prop_types_default()).string,
|
|
4714
|
+
orderCompleteButton: (external_prop_types_default()).string,
|
|
4715
|
+
showCompanyInputDefaultOptions: (external_prop_types_default()).bool,
|
|
4716
|
+
companyDDLOptions2Show: (external_prop_types_default()).number
|
|
4717
|
+
};
|
|
4718
|
+
|
|
4719
|
+
/* harmony default export */ const registration_form = ((0,withReduxProvider/* withReduxProvider */.y)(RegistrationForm));
|
|
4720
|
+
})();
|
|
4721
|
+
|
|
4722
|
+
/******/ return __webpack_exports__;
|
|
4723
|
+
/******/ })()
|
|
4724
|
+
;
|
|
4725
|
+
});
|
|
4726
|
+
//# sourceMappingURL=registration-form.js.map
|