@tap-payments/auth-jsconnect 1.0.86 → 1.0.89

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.
@@ -48,7 +48,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
48
48
  var _a;
49
49
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
50
50
  import API from '../../../api';
51
- import { removeRequestHeaders } from '../../../utils';
51
+ import { hasKey, removeRequestHeaders } from '../../../utils';
52
52
  import { handleNextScreenStep } from '../../../app/settings';
53
53
  import { defaultCountry, INDIVIDUAl_STEP_NAMES } from '../../../constants';
54
54
  export var getCountries = createAsyncThunk('getCountries', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
@@ -68,9 +68,10 @@ export var getCountries = createAsyncThunk('getCountries', function (_, thunkApi
68
68
  });
69
69
  }); });
70
70
  export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
71
- var payload, data, leadResponse;
72
- return __generator(this, function (_a) {
73
- switch (_a.label) {
71
+ var payload, data, leadResponse, _a, steps, entity, hasTaxCompleted;
72
+ var _b, _c;
73
+ return __generator(this, function (_d) {
74
+ switch (_d.label) {
74
75
  case 0:
75
76
  payload = {
76
77
  service_name: 'tap_email',
@@ -78,37 +79,45 @@ export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token
78
79
  };
79
80
  return [4, API.leadService.verifyLeadToken(payload)];
80
81
  case 1:
81
- data = (_a.sent()).data;
82
+ data = (_d.sent()).data;
82
83
  leadResponse = undefined;
83
- if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 3];
84
+ if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 6];
84
85
  return [4, API.leadService.retrieveLead(data === null || data === void 0 ? void 0 : data.id)];
85
86
  case 2:
86
- leadResponse = _a.sent();
87
- if (data.step_name === INDIVIDUAl_STEP_NAMES.IDENTITY_AUTH) {
88
- thunkApi.dispatch(handleNextScreenStep());
89
- }
90
- _a.label = 3;
91
- case 3: return [2, { data: data, leadData: leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data, token: token }];
87
+ leadResponse = _d.sent();
88
+ _a = leadResponse.data, steps = _a.steps, entity = _a.entity;
89
+ hasTaxCompleted = hasKey(steps, INDIVIDUAl_STEP_NAMES.INDIVIDUAl_SUCCESS);
90
+ if (!hasTaxCompleted) return [3, 4];
91
+ return [4, thunkApi.dispatch(retrieveEntityInfo(entity === null || entity === void 0 ? void 0 : entity.id))];
92
+ case 3:
93
+ _d.sent();
94
+ thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
95
+ return [3, 6];
96
+ case 4:
97
+ if (!(data.step_name === INDIVIDUAl_STEP_NAMES.INDIVIDUAl_INFO)) return [3, 6];
98
+ return [4, thunkApi.dispatch(retrieveDataList((_c = (_b = leadResponse.data) === null || _b === void 0 ? void 0 : _b.entity) === null || _c === void 0 ? void 0 : _c.country))];
99
+ case 5:
100
+ _d.sent();
101
+ thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_ADDITIONAL_INDIVIDUAL_INFO_STEP'));
102
+ _d.label = 6;
103
+ case 6: return [2, { data: data, leadData: leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data, token: token }];
92
104
  }
93
105
  });
94
106
  }); });
95
- export var retrieveDataList = createAsyncThunk('retrieveDataList', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
96
- var individual, code, _a, sourceIncome, monthlyIncome;
97
- var _b, _c;
98
- return __generator(this, function (_d) {
99
- switch (_d.label) {
100
- case 0:
101
- individual = thunkApi.getState().individual;
102
- code = (_c = (_b = individual.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.entity) === null || _c === void 0 ? void 0 : _c.country;
103
- return [4, Promise.all([
104
- API.dataService.getSourceOfIncome(),
105
- API.dataService.getMonthlyIncome(code)
106
- ])];
107
+ export var retrieveDataList = createAsyncThunk('retrieveDataList', function (countryCode, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
108
+ var _a, sourceIncome, monthlyIncome;
109
+ return __generator(this, function (_b) {
110
+ switch (_b.label) {
111
+ case 0: return [4, Promise.all([
112
+ API.dataService.getSourceOfIncome(),
113
+ API.dataService.getMonthlyIncome(countryCode)
114
+ ])];
107
115
  case 1:
108
- _a = _d.sent(), sourceIncome = _a[0].data, monthlyIncome = _a[1].data;
116
+ _a = _b.sent(), sourceIncome = _a[0].data, monthlyIncome = _a[1].data;
109
117
  return [2, {
110
118
  sourceIncome: sourceIncome,
111
- monthlyIncome: monthlyIncome
119
+ monthlyIncome: monthlyIncome,
120
+ countryCode: countryCode
112
121
  }];
113
122
  }
114
123
  });
@@ -126,9 +135,9 @@ export var retrieveEntityInfo = createAsyncThunk('retrieveIndividualEntityInfo',
126
135
  }); });
127
136
  export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
128
137
  var _a, individual, settings, responseBody, payload, data, steps, hasIndividualCompleted;
129
- var _b, _c, _d, _e;
130
- return __generator(this, function (_f) {
131
- switch (_f.label) {
138
+ var _b, _c, _d, _e, _f;
139
+ return __generator(this, function (_g) {
140
+ switch (_g.label) {
132
141
  case 0:
133
142
  _a = thunkApi.getState(), individual = _a.individual, settings = _a.settings;
134
143
  responseBody = individual.data.verify.responseBody;
@@ -141,22 +150,22 @@ export var verifyLeadOTP = createAsyncThunk('verifyIndividualLeadOTP', function
141
150
  };
142
151
  return [4, API.leadService.verifyLeadOTP(payload)];
143
152
  case 1:
144
- data = (_f.sent()).data;
153
+ data = (_g.sent()).data;
145
154
  if (!!data.errors) return [3, 5];
146
155
  (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
147
156
  steps = responseBody === null || responseBody === void 0 ? void 0 : responseBody.steps;
148
- hasIndividualCompleted = Object.keys(steps).find(function (key) { return key === INDIVIDUAl_STEP_NAMES.INDIVIDUAl_SUCCESS; });
157
+ hasIndividualCompleted = hasKey(steps, INDIVIDUAl_STEP_NAMES.INDIVIDUAl_SUCCESS);
149
158
  if (!hasIndividualCompleted) return [3, 3];
150
159
  return [4, thunkApi.dispatch(retrieveEntityInfo((_e = responseBody === null || responseBody === void 0 ? void 0 : responseBody.entity) === null || _e === void 0 ? void 0 : _e.id))];
151
160
  case 2:
152
- _f.sent();
161
+ _g.sent();
153
162
  thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
154
163
  return [3, 5];
155
- case 3: return [4, thunkApi.dispatch(retrieveDataList())];
164
+ case 3: return [4, thunkApi.dispatch(retrieveDataList((_f = responseBody === null || responseBody === void 0 ? void 0 : responseBody.entity) === null || _f === void 0 ? void 0 : _f.country))];
156
165
  case 4:
157
- _f.sent();
166
+ _g.sent();
158
167
  thunkApi.dispatch(handleNextScreenStep('INDIVIDUAL_ADDITIONAL_INDIVIDUAL_INFO_STEP'));
159
- _f.label = 5;
168
+ _g.label = 5;
160
169
  case 5: return [2, { data: data, formData: __assign({}, params) }];
161
170
  }
162
171
  });
@@ -176,7 +185,7 @@ export var updateIndividualInfo = createAsyncThunk('updateIndividualInfo', funct
176
185
  actual_income: (_f = params.monthlyIncome) === null || _f === void 0 ? void 0 : _f.id,
177
186
  is_relative_PEP: params.isPEP,
178
187
  is_influencer: params.isInfluencer,
179
- encryption_contract: ['employer_name', 'employer_city', 'actual_income'],
188
+ encryption_contract: ['employer_name', 'employer_city', 'actual_income', 'source_income[0]'],
180
189
  step_name: INDIVIDUAl_STEP_NAMES.INDIVIDUAl_INFO
181
190
  };
182
191
  return [4, API.entityService.updateEntityInfo(requestBody)];
@@ -287,7 +296,7 @@ export var individualSlice = createSlice({
287
296
  state.error = description;
288
297
  return;
289
298
  }
290
- state.data.verify.responseBody = __assign(__assign({}, data), leadData);
299
+ state.data.verify.responseBody = __assign(__assign(__assign({}, data), leadData), state.data.verify.responseBody);
291
300
  state.data.verify.token = token;
292
301
  })
293
302
  .addCase(verifyLeadToken.rejected, function (state, action) {
@@ -320,10 +329,9 @@ export var individualSlice = createSlice({
320
329
  state.error = null;
321
330
  })
322
331
  .addCase(retrieveDataList.fulfilled, function (state, action) {
323
- var _a, _b;
324
332
  state.loading = false;
325
333
  state.error = null;
326
- var _c = action.payload, sourceIncome = _c.sourceIncome, monthlyIncome = _c.monthlyIncome;
334
+ var _a = action.payload, sourceIncome = _a.sourceIncome, monthlyIncome = _a.monthlyIncome, countryCode = _a.countryCode;
327
335
  var data = state.data.individualData.responseBody;
328
336
  state.data.individualData.responseBody = __assign(__assign({}, data), { sourceIncomeList: sourceIncome || [], monthlyIncomeList: monthlyIncome || [] });
329
337
  var selectedSourceIncome = sourceIncome === null || sourceIncome === void 0 ? void 0 : sourceIncome[0];
@@ -332,9 +340,9 @@ export var individualSlice = createSlice({
332
340
  var selectedMonthlyIncome = monthlyIncome === null || monthlyIncome === void 0 ? void 0 : monthlyIncome[2];
333
341
  if (!!selectedMonthlyIncome)
334
342
  state.data.individualData.monthlyIncome = selectedMonthlyIncome;
335
- var location = (_b = (_a = state.data.verify.responseBody) === null || _a === void 0 ? void 0 : _a.entity) === null || _b === void 0 ? void 0 : _b.country;
336
- if (!!location) {
337
- state.data.individualData.employerLocation = state.data.countries.find(function (country) { return country.iso2 === location; });
343
+ if (!!countryCode) {
344
+ var employerLocation = state.data.countries.find(function (country) { return country.iso2 === countryCode; });
345
+ state.data.individualData.employerLocation = employerLocation;
338
346
  }
339
347
  })
340
348
  .addCase(retrieveDataList.rejected, function (state, action) {
@@ -392,7 +400,8 @@ export var individualSlice = createSlice({
392
400
  state.error = description;
393
401
  return;
394
402
  }
395
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), response);
403
+ var flows = response.flows, steps = response.steps;
404
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, steps: steps });
396
405
  removeRequestHeaders();
397
406
  })
398
407
  .addCase(updateLeadSuccess.pending, function (state) {
@@ -48,13 +48,13 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
48
48
  var _a;
49
49
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
50
50
  import API from '../../../api';
51
- import { removeRequestHeaders } from '../../../utils';
51
+ import { hasKey, removeRequestHeaders } from '../../../utils';
52
52
  import { handleNextScreenStep } from '../../../app/settings';
53
53
  import { PASSWORD_STEP_NAMES } from '../../../constants';
54
54
  export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
55
- var payload, data, leadResponse;
56
- return __generator(this, function (_a) {
57
- switch (_a.label) {
55
+ var payload, data, leadResponse, _a, steps, entity, hasCompleted;
56
+ return __generator(this, function (_b) {
57
+ switch (_b.label) {
58
58
  case 0:
59
59
  payload = {
60
60
  service_name: 'tap_email',
@@ -62,17 +62,26 @@ export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token
62
62
  };
63
63
  return [4, API.leadService.verifyLeadToken(payload)];
64
64
  case 1:
65
- data = (_a.sent()).data;
65
+ data = (_b.sent()).data;
66
66
  leadResponse = undefined;
67
- if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 3];
67
+ if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 5];
68
68
  return [4, API.leadService.retrieveLead(data === null || data === void 0 ? void 0 : data.id)];
69
69
  case 2:
70
- leadResponse = _a.sent();
71
- if (data.step_name === PASSWORD_STEP_NAMES.IDENTITY_AUTH) {
72
- thunkApi.dispatch(handleNextScreenStep());
70
+ leadResponse = _b.sent();
71
+ _a = leadResponse.data, steps = _a.steps, entity = _a.entity;
72
+ hasCompleted = hasKey(steps, PASSWORD_STEP_NAMES.PASSWORD_SUCCESS);
73
+ if (!hasCompleted) return [3, 4];
74
+ return [4, thunkApi.dispatch(retrieveEntityInfo(entity === null || entity === void 0 ? void 0 : entity.id))];
75
+ case 3:
76
+ _b.sent();
77
+ thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
78
+ return [3, 5];
79
+ case 4:
80
+ if (data.step_name === PASSWORD_STEP_NAMES.PASSWORD_INFO) {
81
+ thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
73
82
  }
74
- _a.label = 3;
75
- case 3: return [2, { data: data, leadData: leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data, token: token }];
83
+ _b.label = 5;
84
+ case 5: return [2, { data: data, leadData: leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data, token: token }];
76
85
  }
77
86
  });
78
87
  }); });
@@ -88,7 +97,7 @@ export var retrieveEntityInfo = createAsyncThunk('retrievePasswordEntityInfo', f
88
97
  });
89
98
  }); });
90
99
  export var verifyPasswordLeadOTP = createAsyncThunk('verifyPasswordLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
91
- var _a, password, settings, responseBody, payload, data, steps, hasPasswordCompleted;
100
+ var _a, password, settings, responseBody, payload, data, steps, hasCompleted;
92
101
  var _b, _c, _d, _e;
93
102
  return __generator(this, function (_f) {
94
103
  switch (_f.label) {
@@ -108,8 +117,8 @@ export var verifyPasswordLeadOTP = createAsyncThunk('verifyPasswordLeadOTP', fun
108
117
  if (!!data.errors) return [3, 4];
109
118
  (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
110
119
  steps = responseBody === null || responseBody === void 0 ? void 0 : responseBody.steps;
111
- hasPasswordCompleted = Object.keys(steps).find(function (key) { return key === PASSWORD_STEP_NAMES.PASSWORD_SUCCESS; });
112
- if (!hasPasswordCompleted) return [3, 3];
120
+ hasCompleted = hasKey(steps, PASSWORD_STEP_NAMES.PASSWORD_SUCCESS);
121
+ if (!hasCompleted) return [3, 3];
113
122
  return [4, thunkApi.dispatch(retrieveEntityInfo((_e = responseBody === null || responseBody === void 0 ? void 0 : responseBody.entity) === null || _e === void 0 ? void 0 : _e.id))];
114
123
  case 2:
115
124
  _f.sent();
@@ -124,23 +133,23 @@ export var verifyPasswordLeadOTP = createAsyncThunk('verifyPasswordLeadOTP', fun
124
133
  }); });
125
134
  export var createPassword = createAsyncThunk('createPassword', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
126
135
  var _a, settings, password, requestBody, data;
127
- var _b, _c, _d;
128
- return __generator(this, function (_e) {
129
- switch (_e.label) {
136
+ var _b, _c, _d, _e;
137
+ return __generator(this, function (_f) {
138
+ switch (_f.label) {
130
139
  case 0:
131
140
  _a = thunkApi.getState(), settings = _a.settings, password = _a.password;
132
141
  requestBody = {
133
142
  step_name: PASSWORD_STEP_NAMES.PASSWORD_CREATE,
134
- signup_token: (_b = password.data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.signup_token,
143
+ signup_token: ((_b = password.data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.signup_token) || ((_c = password.data.otpData.responseBody) === null || _c === void 0 ? void 0 : _c.signup_token),
135
144
  password: params.password,
136
145
  encryption_contract: ['password']
137
146
  };
138
147
  return [4, API.authService.createPassword(requestBody)];
139
148
  case 1:
140
- data = (_e.sent()).data;
149
+ data = (_f.sent()).data;
141
150
  if (!data.errors) {
142
151
  thunkApi.dispatch(handleNextScreenStep());
143
- (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, requestBody);
152
+ (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, requestBody);
144
153
  }
145
154
  return [2, { data: data, formData: params }];
146
155
  }
@@ -216,7 +225,7 @@ export var passwordSlice = createSlice({
216
225
  state.error = description;
217
226
  return;
218
227
  }
219
- state.data.verify.responseBody = __assign(__assign({}, data), leadData);
228
+ state.data.verify.responseBody = __assign(__assign(__assign({}, data), leadData), state.data.verify.responseBody);
220
229
  state.data.verify.token = token;
221
230
  })
222
231
  .addCase(verifyLeadToken.pending, function (state, action) {
@@ -299,7 +308,8 @@ export var passwordSlice = createSlice({
299
308
  state.error = description;
300
309
  return;
301
310
  }
302
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), response);
311
+ var flows = response.flows, steps = response.steps;
312
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, steps: steps });
303
313
  removeRequestHeaders();
304
314
  })
305
315
  .addCase(updateLeadSuccess.pending, function (state) {
@@ -48,13 +48,13 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
48
48
  var _a;
49
49
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
50
50
  import API from '../../../api';
51
- import { removeRequestHeaders } from '../../../utils';
51
+ import { hasKey, removeRequestHeaders } from '../../../utils';
52
52
  import { handleNextScreenStep } from '../../../app/settings';
53
53
  import { TAX_STEP_NAMES } from '../../../constants';
54
54
  export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
55
- var payload, data, leadResponse;
56
- return __generator(this, function (_a) {
57
- switch (_a.label) {
55
+ var payload, data, leadResponse, _a, steps, entity, hasTaxCompleted;
56
+ return __generator(this, function (_b) {
57
+ switch (_b.label) {
58
58
  case 0:
59
59
  payload = {
60
60
  service_name: 'tap_email',
@@ -62,17 +62,26 @@ export var verifyLeadToken = createAsyncThunk('verifyLeadToken', function (token
62
62
  };
63
63
  return [4, API.leadService.verifyLeadToken(payload)];
64
64
  case 1:
65
- data = (_a.sent()).data;
65
+ data = (_b.sent()).data;
66
66
  leadResponse = undefined;
67
- if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 3];
67
+ if (!(!(data === null || data === void 0 ? void 0 : data.errors) && !(data === null || data === void 0 ? void 0 : data.mw_error))) return [3, 5];
68
68
  return [4, API.leadService.retrieveLead(data === null || data === void 0 ? void 0 : data.id)];
69
69
  case 2:
70
- leadResponse = _a.sent();
71
- if (data.step_name === TAX_STEP_NAMES.IDENTITY_AUTH) {
72
- thunkApi.dispatch(handleNextScreenStep());
70
+ leadResponse = _b.sent();
71
+ _a = leadResponse.data, steps = _a.steps, entity = _a.entity;
72
+ hasTaxCompleted = hasKey(steps, TAX_STEP_NAMES.TAX_SUCCESS);
73
+ if (!hasTaxCompleted) return [3, 4];
74
+ return [4, thunkApi.dispatch(retrieveEntityInfo(entity === null || entity === void 0 ? void 0 : entity.id))];
75
+ case 3:
76
+ _b.sent();
77
+ thunkApi.dispatch(handleNextScreenStep('TAX_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
78
+ return [3, 5];
79
+ case 4:
80
+ if (data.step_name === TAX_STEP_NAMES.TAX_INFO) {
81
+ thunkApi.dispatch(handleNextScreenStep('TAX_TAX_DETAILS_STEP'));
73
82
  }
74
- _a.label = 3;
75
- case 3: return [2, { data: data, leadData: leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data, token: token }];
83
+ _b.label = 5;
84
+ case 5: return [2, { data: data, leadData: leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data, token: token }];
76
85
  }
77
86
  });
78
87
  }); });
@@ -108,7 +117,7 @@ export var verifyTaxLeadOTP = createAsyncThunk('verifyTaxLeadOTP', function (par
108
117
  if (!!data.errors) return [3, 4];
109
118
  (_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, { otp: params.otp });
110
119
  steps = responseBody === null || responseBody === void 0 ? void 0 : responseBody.steps;
111
- hasTaxCompleted = Object.keys(steps).find(function (key) { return key === TAX_STEP_NAMES.TAX_SUCCESS; });
120
+ hasTaxCompleted = hasKey(steps, TAX_STEP_NAMES.TAX_SUCCESS);
112
121
  if (!hasTaxCompleted) return [3, 3];
113
122
  return [4, thunkApi.dispatch(retrieveEntityInfo((_e = responseBody === null || responseBody === void 0 ? void 0 : responseBody.entity) === null || _e === void 0 ? void 0 : _e.id))];
114
123
  case 2:
@@ -214,7 +223,7 @@ export var taxSlice = createSlice({
214
223
  state.error = description;
215
224
  return;
216
225
  }
217
- state.data.verify.responseBody = __assign(__assign({}, data), leadData);
226
+ state.data.verify.responseBody = __assign(__assign(__assign({}, data), leadData), state.data.verify.responseBody);
218
227
  state.data.verify.token = token;
219
228
  })
220
229
  .addCase(verifyLeadToken.pending, function (state, action) {
@@ -297,7 +306,8 @@ export var taxSlice = createSlice({
297
306
  state.error = description;
298
307
  return;
299
308
  }
300
- state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), response);
309
+ var flows = response.flows, steps = response.steps;
310
+ state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, steps: steps });
301
311
  removeRequestHeaders();
302
312
  })
303
313
  .addCase(updateLeadSuccess.pending, function (state) {
@@ -34,7 +34,7 @@ var Connect = memo(function (props) {
34
34
  useEffect(function () {
35
35
  dispatch(getCountries());
36
36
  }, []);
37
- return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: connectFeatureScreens.map(function (_a, index) {
37
+ return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading, error: error, open: open, footer: _jsx(CustomFooter, {}) }, { children: _jsx(FeatureContainer, { children: connectFeatureScreens.map(function (_a, index) {
38
38
  var Element = _a.element, name = _a.name;
39
39
  var isActive = activeScreen.name === name;
40
40
  return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
@@ -14,7 +14,7 @@ import { memo } from 'react';
14
14
  import { styled } from '@mui/material/styles';
15
15
  import Box from '@mui/material/Box';
16
16
  import LogoBackground from './LogoBackground';
17
- var BackgroundStyled = styled(Box)(function (_a) {
17
+ var BackgroundStyled = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'isTapOrigin'; } })(function (_a) {
18
18
  var isTapOrigin = _a.isTapOrigin;
19
19
  return ({
20
20
  width: '100%',
@@ -24,6 +24,6 @@ var BackgroundStyled = styled(Box)(function (_a) {
24
24
  });
25
25
  var Background = function (_a) {
26
26
  var children = _a.children, isTapOrigin = _a.isTapOrigin, loading = _a.loading;
27
- return (_jsxs(BackgroundStyled, __assign({ isTapOrigin: isTapOrigin }, { children: [_jsx(LogoBackground, { isTapOrigin: !loading && isTapOrigin }), children] })));
27
+ return (_jsxs(BackgroundStyled, __assign({ isTapOrigin: isTapOrigin }, { children: [_jsx(LogoBackground, { hide: loading || !isTapOrigin }), children] })));
28
28
  };
29
29
  export default memo(Background);
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  declare type LogoBackgroundProps = {
3
- isTapOrigin: boolean;
3
+ hide?: boolean;
4
4
  };
5
- declare const _default: React.MemoExoticComponent<({ isTapOrigin }: LogoBackgroundProps) => JSX.Element>;
5
+ declare const _default: React.MemoExoticComponent<({ hide }: LogoBackgroundProps) => JSX.Element>;
6
6
  export default _default;
@@ -11,13 +11,12 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { memo } from 'react';
14
- import { styled } from '@mui/material/styles';
14
+ import { styled, useTheme } from '@mui/material/styles';
15
15
  import Collapse from '@mui/material/Collapse';
16
16
  import Box from '@mui/material/Box';
17
17
  import Icon from '../../../components/Icon';
18
18
  import { ICONS_NAMES } from '../../../constants';
19
19
  import { useLanguage } from '../../../hooks';
20
- import Fade from '@mui/material/Fade';
21
20
  var BoxStyled = styled(Box)(function (_a) {
22
21
  var _b;
23
22
  var theme = _a.theme;
@@ -26,10 +25,11 @@ var BoxStyled = styled(Box)(function (_a) {
26
25
  flexDirection: 'column',
27
26
  justifyContent: 'center',
28
27
  alignItems: 'center',
29
- paddingTop: theme.spacing(5)
28
+ paddingTop: theme.spacing(5),
29
+ paddingBottom: theme.spacing(2)
30
30
  },
31
31
  _b[theme.breakpoints.down('sm')] = {
32
- paddingTop: theme.spacing(11.5)
32
+ paddingTop: theme.spacing(11)
33
33
  },
34
34
  _b);
35
35
  });
@@ -44,7 +44,7 @@ var LogoIconBoxStyled = styled(Box)(function (_a) {
44
44
  var _b;
45
45
  var theme = _a.theme;
46
46
  return (_b = {
47
- paddingTop: theme.spacing(2.125),
47
+ paddingTop: theme.spacing(2.5),
48
48
  width: '100%',
49
49
  display: 'flex',
50
50
  justifyContent: 'center'
@@ -63,8 +63,11 @@ var LogoIconStyled = styled(Icon)(function (_a) {
63
63
  });
64
64
  });
65
65
  var LogoBackground = function (_a) {
66
- var isTapOrigin = _a.isTapOrigin;
66
+ var hide = _a.hide;
67
67
  var isAr = useLanguage().isAr;
68
- return (_jsx(Collapse, __assign({ in: isTapOrigin }, { children: _jsx(Fade, __assign({ in: isTapOrigin }, { children: _jsxs(BoxStyled, { children: [_jsx(LogoBadgeStyled, { src: ICONS_NAMES.TAP_LOGO_EN_ICON }), _jsx(LogoIconBoxStyled, { children: _jsx(LogoIconStyled, { src: isAr ? ICONS_NAMES.TAP_LOGO_TEXT_AR : ICONS_NAMES.TAP_LOGO_TEXT_EN, alt: 'tap logo' }) })] }) })) })));
68
+ var theme = useTheme();
69
+ var style = getComputedStyle(document.body);
70
+ console.log(style.getPropertyValue('--rsbs-overlay-h'));
71
+ return (_jsx(Collapse, __assign({ in: !hide }, { children: _jsxs(BoxStyled, { children: [_jsx(LogoBadgeStyled, { src: ICONS_NAMES.TAP_LOGO_EN_ICON }), _jsx(LogoIconBoxStyled, { children: _jsx(LogoIconStyled, { src: isAr ? ICONS_NAMES.TAP_LOGO_TEXT_AR : ICONS_NAMES.TAP_LOGO_TEXT_EN, alt: 'tap logo' }) })] }) })));
69
72
  };
70
73
  export default memo(LogoBackground);
@@ -25,6 +25,9 @@ var Container = styled(Box)(function (_a) {
25
25
  easing: theme.transitions.easing.easeInOut,
26
26
  property: 'all'
27
27
  },
28
+ _b[theme.breakpoints.down('sm')] = {
29
+ paddingTop: theme.spacing(5)
30
+ },
28
31
  _b);
29
32
  });
30
33
  var FeatureContainer = React.forwardRef(function (props, ref) {
@@ -1,2 +1,2 @@
1
1
  import { LocalProps } from '../@types';
2
- export declare const updateLocale: (locale: LocalProps) => void;
2
+ export declare const updateLocale: (locale: LocalProps, country: string) => void;
@@ -1,10 +1,11 @@
1
1
  import { initReactI18next } from 'react-i18next';
2
2
  import i18n from '../i18n';
3
- export var updateLocale = function (locale) {
3
+ export var updateLocale = function (locale, country) {
4
+ var data = locale[country] || locale['default'];
4
5
  if (i18n.isInitialized) {
5
6
  i18n.removeResourceBundle('*', 'translation');
6
- i18n.addResourceBundle('en', 'translation', locale.en.translation);
7
- i18n.addResourceBundle('ar', 'translation', locale.ar.translation);
7
+ i18n.addResourceBundle('en', 'translation', data.en.translation);
8
+ i18n.addResourceBundle('ar', 'translation', data.ar.translation);
8
9
  }
9
10
  else {
10
11
  i18n.use(initReactI18next).init({
@@ -1,3 +1,4 @@
1
1
  export declare const compareTwoObjects: (obj1: any, obj2: any) => boolean;
2
2
  export declare const encodeObjectBase64: (obj: any) => string;
3
3
  export declare const decodeObjectBase64: (str: string) => any;
4
+ export declare const hasKey: (obj: any, key: string) => boolean;
@@ -16,3 +16,8 @@ export var decodeObjectBase64 = function (str) {
16
16
  throw new Error('Invalid base64 string or invalid json format. try to check [decodeObjectBase64]');
17
17
  }
18
18
  };
19
+ export var hasKey = function (obj, key) {
20
+ if (!obj)
21
+ return false;
22
+ return Object.keys(obj).includes(key);
23
+ };