@sabstravtech/obtservices 0.0.22051001 → 0.0.26051001

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.
Files changed (142) hide show
  1. package/angular/components/basket-panel.d.ts +1 -0
  2. package/angular/fetchers.d.ts +3 -0
  3. package/angular/lib/vendor/fetchers/get-companies.fetcher.d.ts +7 -0
  4. package/angular/lib/vendor/fetchers/get-company.fetcher.d.ts +7 -0
  5. package/angular/lib/vendor/fetchers/get-user-guests.fetcher.d.ts +7 -0
  6. package/angular/lib/vendor/services/enterprise-basket.service.d.ts +2 -1
  7. package/angular/lib/vendor/services/logon.service.d.ts +2 -1
  8. package/angular/lib/vendor/services/user.service.d.ts +7 -3
  9. package/angular/lib/vendor/types/graphql.angular.types.d.ts +268 -85
  10. package/angular/lib/vendor/updaters/create-guest-updater.d.ts +6 -0
  11. package/angular/sabstravtech-obtservices-angular.metadata.json +1 -1
  12. package/angular/updaters.d.ts +1 -0
  13. package/base/fetchers.d.ts +3 -0
  14. package/base/lib/vendor/classes/base-enterprise.d.ts +5 -1
  15. package/base/lib/vendor/classes/basket-info-mi-details.impl.d.ts +2 -0
  16. package/base/lib/vendor/classes/bookable-basket.d.ts +2 -0
  17. package/base/lib/vendor/classes/cabhire-enterprise-search.d.ts +4 -3
  18. package/base/lib/vendor/classes/carhire-enterprise-search.d.ts +4 -3
  19. package/base/lib/vendor/classes/eurostar-enterprise-search.d.ts +4 -4
  20. package/base/lib/vendor/classes/fast-track-enterprise-search.d.ts +3 -3
  21. package/base/lib/vendor/classes/flight-enterprise-search.d.ts +5 -5
  22. package/base/lib/vendor/classes/helpers.d.ts +6 -1
  23. package/base/lib/vendor/classes/hotel-enterprise-search.d.ts +6 -3
  24. package/base/lib/vendor/classes/irl-enterprise-search.d.ts +4 -4
  25. package/base/lib/vendor/classes/lounges-enterprise-search.d.ts +3 -3
  26. package/base/lib/vendor/classes/management-info-and-valid.d.ts +1 -1
  27. package/base/lib/vendor/classes/modal-types.enum.d.ts +1 -0
  28. package/base/lib/vendor/classes/parking-enterprise-search.d.ts +3 -3
  29. package/base/lib/vendor/classes/rail-enterprise-search.d.ts +9 -7
  30. package/base/lib/vendor/classes/supplementary-booking-info-impl.d.ts +5 -3
  31. package/base/lib/vendor/fetchers/get-companies.fetcher.d.ts +21 -0
  32. package/base/lib/vendor/fetchers/get-company.fetcher.d.ts +20 -0
  33. package/base/lib/vendor/fetchers/get-user-guests.fetcher.d.ts +20 -0
  34. package/base/lib/vendor/interfaces/Icabhire-enterprise-search.d.ts +1 -0
  35. package/base/lib/vendor/interfaces/Icarhire-enterprise-search.d.ts +3 -2
  36. package/base/lib/vendor/interfaces/Ienterprise-basket.service.d.ts +6 -5
  37. package/base/lib/vendor/interfaces/Ieurostar-enterprise-search.d.ts +1 -0
  38. package/base/lib/vendor/interfaces/Ifast-track-enterprise-search.d.ts +7 -5
  39. package/base/lib/vendor/interfaces/Iflight-enterprise-search.d.ts +2 -1
  40. package/base/lib/vendor/interfaces/Ihotel-enterprise-search.d.ts +5 -2
  41. package/base/lib/vendor/interfaces/Iirl-enterprise-search.d.ts +4 -3
  42. package/base/lib/vendor/interfaces/Ilounges-enterprise-search.d.ts +1 -0
  43. package/base/lib/vendor/interfaces/Iparking-enterprise-search.d.ts +1 -0
  44. package/base/lib/vendor/interfaces/Irail-enterprise-search.d.ts +5 -2
  45. package/base/lib/vendor/interfaces/Isearch.service.d.ts +4 -2
  46. package/base/lib/vendor/interfaces/Isupplementary-booking-info-impl.d.ts +3 -2
  47. package/base/lib/vendor/interfaces/Iuser.service.d.ts +1 -0
  48. package/base/lib/vendor/interfaces/car-hire-search-arg.interface.d.ts +2 -3
  49. package/base/lib/vendor/interfaces/summary-interface.d.ts +2 -0
  50. package/base/lib/vendor/interfaces/user.data.d.ts +1 -0
  51. package/base/lib/vendor/models/traveller.object.d.ts +1 -1
  52. package/base/lib/vendor/services/enterprise-basket.service.d.ts +18 -7
  53. package/base/lib/vendor/services/logon.service.d.ts +5 -1
  54. package/base/lib/vendor/services/search.service.d.ts +25 -22
  55. package/base/lib/vendor/services/url.service.d.ts +2 -0
  56. package/base/lib/vendor/services/user.service.d.ts +21 -5
  57. package/base/lib/vendor/services/webtoken.service.d.ts +4 -0
  58. package/base/lib/vendor/types/graphql.types.d.ts +245 -84
  59. package/base/lib/vendor/types/types.d.ts +16 -2
  60. package/base/lib/vendor/updaters/create-guest-updater.d.ts +19 -0
  61. package/base/sabstravtech-obtservices-base.d.ts +1 -1
  62. package/base/sabstravtech-obtservices-base.metadata.json +1 -1
  63. package/base/updaters.d.ts +1 -0
  64. package/bundles/sabstravtech-obtservices-angular.umd.js +366 -176
  65. package/bundles/sabstravtech-obtservices-angular.umd.js.map +1 -1
  66. package/bundles/sabstravtech-obtservices-angular.umd.min.js +1 -1
  67. package/bundles/sabstravtech-obtservices-angular.umd.min.js.map +1 -1
  68. package/bundles/sabstravtech-obtservices-base.umd.js +2019 -956
  69. package/bundles/sabstravtech-obtservices-base.umd.js.map +1 -1
  70. package/bundles/sabstravtech-obtservices-base.umd.min.js +2 -2
  71. package/bundles/sabstravtech-obtservices-base.umd.min.js.map +1 -1
  72. package/esm2015/angular/components/basket-panel.js +16 -7
  73. package/esm2015/angular/fetchers.js +4 -1
  74. package/esm2015/angular/lib/vendor/fetchers/get-companies.fetcher.js +25 -0
  75. package/esm2015/angular/lib/vendor/fetchers/get-company.fetcher.js +25 -0
  76. package/esm2015/angular/lib/vendor/fetchers/get-user-guests.fetcher.js +25 -0
  77. package/esm2015/angular/lib/vendor/services/enterprise-basket.service.js +8 -5
  78. package/esm2015/angular/lib/vendor/services/http-call.service.js +1 -1
  79. package/esm2015/angular/lib/vendor/services/logon.service.js +8 -5
  80. package/esm2015/angular/lib/vendor/services/search.service.js +1 -1
  81. package/esm2015/angular/lib/vendor/services/user.service.js +21 -9
  82. package/esm2015/angular/lib/vendor/services/webtoken.service.js +6 -2
  83. package/esm2015/angular/lib/vendor/types/graphql.angular.types.js +296 -70
  84. package/esm2015/angular/lib/vendor/updaters/create-guest-updater.js +22 -0
  85. package/esm2015/angular/updaters.js +2 -1
  86. package/esm2015/base/fetchers.js +4 -1
  87. package/esm2015/base/lib/vendor/classes/base-enterprise.js +8 -2
  88. package/esm2015/base/lib/vendor/classes/basket-info-mi-details.impl.js +14 -1
  89. package/esm2015/base/lib/vendor/classes/bookable-basket.js +27 -6
  90. package/esm2015/base/lib/vendor/classes/cabhire-enterprise-search.js +66 -11
  91. package/esm2015/base/lib/vendor/classes/carhire-enterprise-search.js +108 -61
  92. package/esm2015/base/lib/vendor/classes/eurostar-enterprise-search.js +115 -33
  93. package/esm2015/base/lib/vendor/classes/fast-track-enterprise-search.js +31 -10
  94. package/esm2015/base/lib/vendor/classes/flight-enterprise-search.js +196 -57
  95. package/esm2015/base/lib/vendor/classes/helpers.js +19 -3
  96. package/esm2015/base/lib/vendor/classes/hotel-enterprise-search.js +145 -36
  97. package/esm2015/base/lib/vendor/classes/irl-enterprise-search.js +100 -30
  98. package/esm2015/base/lib/vendor/classes/lounges-enterprise-search.js +40 -8
  99. package/esm2015/base/lib/vendor/classes/management-info-and-valid.js +13 -9
  100. package/esm2015/base/lib/vendor/classes/modal-types.enum.js +2 -1
  101. package/esm2015/base/lib/vendor/classes/parking-enterprise-search.js +39 -7
  102. package/esm2015/base/lib/vendor/classes/rail-enterprise-search.js +131 -20
  103. package/esm2015/base/lib/vendor/classes/supplementary-booking-info-impl.js +42 -4
  104. package/esm2015/base/lib/vendor/fetchers/get-companies.fetcher.js +11 -0
  105. package/esm2015/base/lib/vendor/fetchers/get-company.fetcher.js +11 -0
  106. package/esm2015/base/lib/vendor/fetchers/get-user-guests.fetcher.js +11 -0
  107. package/esm2015/base/lib/vendor/interfaces/Icabhire-enterprise-search.js +1 -1
  108. package/esm2015/base/lib/vendor/interfaces/Icarhire-enterprise-search.js +1 -1
  109. package/esm2015/base/lib/vendor/interfaces/Ienterprise-basket.service.js +1 -1
  110. package/esm2015/base/lib/vendor/interfaces/Ieurostar-enterprise-search.js +1 -1
  111. package/esm2015/base/lib/vendor/interfaces/Ifast-track-enterprise-search.js +1 -1
  112. package/esm2015/base/lib/vendor/interfaces/Iflight-enterprise-search.js +1 -1
  113. package/esm2015/base/lib/vendor/interfaces/Ihotel-enterprise-search.js +2 -1
  114. package/esm2015/base/lib/vendor/interfaces/Iirl-enterprise-search.js +1 -1
  115. package/esm2015/base/lib/vendor/interfaces/Ilounges-enterprise-search.js +1 -1
  116. package/esm2015/base/lib/vendor/interfaces/Iparking-enterprise-search.js +1 -1
  117. package/esm2015/base/lib/vendor/interfaces/Irail-enterprise-search.js +1 -1
  118. package/esm2015/base/lib/vendor/interfaces/Isearch.service.js +1 -1
  119. package/esm2015/base/lib/vendor/interfaces/Isupplementary-booking-info-impl.js +1 -1
  120. package/esm2015/base/lib/vendor/interfaces/Iuser.service.js +1 -1
  121. package/esm2015/base/lib/vendor/interfaces/car-hire-search-arg.interface.js +1 -1
  122. package/esm2015/base/lib/vendor/interfaces/summary-interface.js +1 -1
  123. package/esm2015/base/lib/vendor/interfaces/user.data.js +1 -1
  124. package/esm2015/base/lib/vendor/models/traveller.object.js +1 -1
  125. package/esm2015/base/lib/vendor/services/enterprise-basket.service.js +93 -30
  126. package/esm2015/base/lib/vendor/services/http-call.service.js +1 -1
  127. package/esm2015/base/lib/vendor/services/logon.service.js +37 -3
  128. package/esm2015/base/lib/vendor/services/requires-reason.service.js +14 -10
  129. package/esm2015/base/lib/vendor/services/search.service.js +77 -102
  130. package/esm2015/base/lib/vendor/services/url.service.js +3 -1
  131. package/esm2015/base/lib/vendor/services/user.service.js +45 -11
  132. package/esm2015/base/lib/vendor/services/webtoken.service.js +8 -1
  133. package/esm2015/base/lib/vendor/types/graphql.types.js +7 -2
  134. package/esm2015/base/lib/vendor/types/types.js +31 -14
  135. package/esm2015/base/lib/vendor/updaters/create-guest-updater.js +11 -0
  136. package/esm2015/base/sabstravtech-obtservices-base.js +1 -1
  137. package/esm2015/base/updaters.js +2 -1
  138. package/fesm2015/sabstravtech-obtservices-angular.js +449 -141
  139. package/fesm2015/sabstravtech-obtservices-angular.js.map +1 -1
  140. package/fesm2015/sabstravtech-obtservices-base.js +1383 -410
  141. package/fesm2015/sabstravtech-obtservices-base.js.map +1 -1
  142. package/package.json +1 -1
@@ -6,9 +6,10 @@ import moment from 'moment';
6
6
  import Ajv from 'ajv';
7
7
 
8
8
  class BaseEnterpriseSearch {
9
- constructor(storageService, helpers) {
9
+ constructor(storageService, helpers, searchService) {
10
10
  this.storageService = storageService;
11
11
  this.helpers = helpers;
12
+ this.searchService = searchService;
12
13
  this._cheapestResultPrice = {
13
14
  amount: null,
14
15
  currencyCode: null
@@ -32,6 +33,11 @@ class BaseEnterpriseSearch {
32
33
  get originalUserSearch() {
33
34
  return this._originalUserSearch;
34
35
  }
36
+ performSearch() {
37
+ this.searchService.search_objects[this.type].chosen = true;
38
+ this.searchService.determineHighestSearchPriority();
39
+ this.searchService.startSearches();
40
+ }
35
41
  processResults(results) {
36
42
  return results;
37
43
  }
@@ -154,7 +160,8 @@ ModalTypes.RailTicketsDialogComponent = new ModalTypes('RailTicketsDialogCompone
154
160
  ModalTypes.ModalFlightFareComponent = new ModalTypes('ModalFlightFareComponent');
155
161
  ModalTypes.FlightExtrasDialogComponent = new ModalTypes('FlightExtrasDialogComponent');
156
162
  ModalTypes.OfflineRequestDialogComponent = new ModalTypes('OfflineRequestDialogComponent');
157
- ModalTypes.RequiresReasonDialogComponent = new ModalTypes('RequiresReasonDialogComponent');
163
+ ModalTypes.RequiresReasonDialogComponent = new ModalTypes('RequiresReasonDialogComponent');
164
+ ModalTypes.DifferentInvokdedUserComponent = new ModalTypes('DifferentInvokdedUserComponent');
158
165
 
159
166
  class BaseNetworkCall {
160
167
  constructor(modelService) {
@@ -560,6 +567,11 @@ var IrlTravellerStatus;
560
567
  IrlTravellerStatus["Placeholder"] = "placeholder";
561
568
  IrlTravellerStatus["Complete"] = "complete";
562
569
  })(IrlTravellerStatus || (IrlTravellerStatus = {}));
570
+ var LeadPassengerType;
571
+ (function (LeadPassengerType) {
572
+ LeadPassengerType["User"] = "USER";
573
+ LeadPassengerType["Guest"] = "GUEST";
574
+ })(LeadPassengerType || (LeadPassengerType = {}));
563
575
  var LogLevelType;
564
576
  (function (LogLevelType) {
565
577
  LogLevelType["Error"] = "ERROR";
@@ -596,7 +608,7 @@ var PreferenceKey;
596
608
  (function (PreferenceKey) {
597
609
  PreferenceKey["MealRequest"] = "MEAL_REQUEST";
598
610
  PreferenceKey["SeatingPreference"] = "SEATING_PREFERENCE";
599
- PreferenceKey["SpeacialNeed"] = "SPEACIAL_NEED";
611
+ PreferenceKey["SpecialNeed"] = "SPECIAL_NEED";
600
612
  PreferenceKey["SeatLocation"] = "SEAT_LOCATION";
601
613
  PreferenceKey["SeatPosition"] = "SEAT_POSITION";
602
614
  PreferenceKey["SeatDirection"] = "SEAT_DIRECTION";
@@ -733,8 +745,8 @@ class FreeTextManagementInfo extends ManagementInfoAndIsValid {
733
745
  }
734
746
  ];
735
747
  }
736
- save(basketid, userId) {
737
- this.basketService.setMiFreeValue(basketid, this, this.selectedValues[0] ? this.selectedValues[0].freeValue : '', userId);
748
+ save(basketid, userId, guest) {
749
+ this.basketService.setMiFreeValue(basketid, this, this.selectedValues[0] ? this.selectedValues[0].freeValue : '', userId, guest);
738
750
  }
739
751
  hasErrors(value) {
740
752
  return new Promise((resolve, reject) => {
@@ -779,15 +791,18 @@ class AutoSugestManagementInfo extends ManagementInfoAndIsValid {
779
791
  if (((_a = this.values) === null || _a === void 0 ? void 0 : _a.length) > 0) {
780
792
  this.avaliableItems = this.values;
781
793
  }
794
+ else {
795
+ console.error('No values for AutoSugest field');
796
+ }
782
797
  }
783
798
  getValue() {
784
799
  return this.selectedValues[0] ? this.selectedValues[0].value.id : '__NONE';
785
800
  }
786
- hasErrors(id) {
801
+ hasErrors(value) {
787
802
  return __awaiter(this, void 0, void 0, function* () {
788
803
  try {
789
804
  return !this.avaliableItems.find((value1) => {
790
- return value1.id === id;
805
+ return value1.id === value.id;
791
806
  })
792
807
  ? { hasErrors: true }
793
808
  : null;
@@ -826,8 +841,9 @@ class AutoSugestManagementInfo extends ManagementInfoAndIsValid {
826
841
  this.selectedValues = [];
827
842
  }
828
843
  }
829
- save(basketid, userid) {
830
- this.basketService.setMiSelectedValue(basketid, this, this.selectedValues[0].value.id, userid);
844
+ save(basketid, userid, guest) {
845
+ var _a, _b;
846
+ this.basketService.setMiSelectedValue(basketid, this, this.selectedValues[0] ? (_b = (_a = this.selectedValues[0]) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.id : '', userid, guest);
831
847
  }
832
848
  }
833
849
  class HiddenManagementInfo extends ManagementInfoAndIsValid {
@@ -897,8 +913,8 @@ class DropdownManagementInfo extends ManagementInfoAndIsValid {
897
913
  this.selectedValues = [];
898
914
  }
899
915
  }
900
- save(basketid, userid) {
901
- this.basketService.setMiSelectedValue(basketid, this, this.selectedValues[0].value.id, userid);
916
+ save(basketid, userid, guest) {
917
+ this.basketService.setMiSelectedValue(basketid, this, this.selectedValues[0].value.id || '', userid, guest);
902
918
  }
903
919
  }
904
920
  const makeManagamentInfo = (managementInfo, basketService) => {
@@ -951,7 +967,20 @@ class BasketInfoMiDetailsImpl {
951
967
  };
952
968
  return userAccum;
953
969
  }, {});
970
+ this.miPerGuest = item.guests.reduce((userAccum, user) => {
971
+ userAccum[user.id] = {
972
+ managementInfo: this.helpers
973
+ .clone(perUser)
974
+ .map((miItem) => {
975
+ const miItemObj = makeManagamentInfo(miItem, this.basketService);
976
+ this.isValidObservers.push(miItemObj);
977
+ return miItemObj;
978
+ })
979
+ };
980
+ return userAccum;
981
+ }, {});
954
982
  this.users = Object.keys(this.miPerUser);
983
+ this.guests = Object.keys(this.miPerGuest);
955
984
  }
956
985
  }
957
986
 
@@ -1001,6 +1030,7 @@ var BookingStatus;
1001
1030
  BookingStatus[BookingStatus["ApprovedBook"] = 13] = "ApprovedBook";
1002
1031
  BookingStatus[BookingStatus["PartiallyBooked"] = 14] = "PartiallyBooked";
1003
1032
  BookingStatus[BookingStatus["Complete"] = 15] = "Complete";
1033
+ BookingStatus[BookingStatus["Expired"] = 16] = "Expired";
1004
1034
  })(BookingStatus || (BookingStatus = {}));
1005
1035
  var SchemaFormat;
1006
1036
  (function (SchemaFormat) {
@@ -1093,10 +1123,18 @@ const BreakBastExcluded = [
1093
1123
  'Breakfast Costs',
1094
1124
  'no breakfast'
1095
1125
  ];
1126
+ const AccessibleIncluded = [
1127
+ 'Accessibility',
1128
+ 'Accessible and Disabled',
1129
+ 'Accessible',
1130
+ 'Disabled'
1131
+ ];
1096
1132
  const excludedPattern = '(' + BreakBastExcluded.join(')|(') + ')';
1097
1133
  const includedPattern = '(' + BreakFastIncluded.join(')|(') + ')';
1134
+ const includedAccessibilityPattern = '(' + AccessibleIncluded.join(')|(') + ')';
1098
1135
  const includedExpression = new RegExp(includedPattern, 'i');
1099
1136
  const excludedExpression = new RegExp(excludedPattern, 'i');
1137
+ const includedAccessibilityExpression = new RegExp(includedAccessibilityPattern, 'i');
1100
1138
  var SearchHandler;
1101
1139
  (function (SearchHandler) {
1102
1140
  SearchHandler["AVAILABILITY"] = "Availability";
@@ -1133,7 +1171,8 @@ const filtersKeys = {
1133
1171
  extra: 'extra',
1134
1172
  hotelName: 'hotelName',
1135
1173
  priceRange: 'priceRange',
1136
- breakfastType: 'breakfastType'
1174
+ breakfastType: 'breakfastType',
1175
+ accessibleRoomType: 'accessibleRoomType'
1137
1176
  };
1138
1177
  var ServiceProvider;
1139
1178
  (function (ServiceProvider) {
@@ -1177,20 +1216,20 @@ const PREFERENCE_VALUES = [
1177
1216
  { label: 'Raw Vegeterian', type: PreferenceKey.MealRequest },
1178
1217
  { label: 'Seafood', type: PreferenceKey.MealRequest },
1179
1218
  { label: 'Vegan Vegeterian', type: PreferenceKey.MealRequest },
1180
- { label: 'Vegeterain Lacto-Ovo', type: PreferenceKey.MealRequest },
1219
+ { label: 'Vegeterian Lacto-Ovo', type: PreferenceKey.MealRequest },
1181
1220
  { label: 'Aisle', type: PreferenceKey.SeatingPreference },
1182
1221
  { label: 'Window', type: PreferenceKey.SeatingPreference },
1183
- { label: 'Bassinet', type: PreferenceKey.SpeacialNeed },
1184
- { label: 'Bicycle', type: PreferenceKey.SpeacialNeed },
1185
- { label: 'Blind passenger', type: PreferenceKey.SpeacialNeed },
1186
- { label: 'Deaf passenger', type: PreferenceKey.SpeacialNeed },
1187
- { label: 'Meet and assist', type: PreferenceKey.SpeacialNeed },
1188
- { label: 'Wheelchair, can ascend steps', type: PreferenceKey.SpeacialNeed },
1189
- { label: 'Wheelchair, can walk to seat', type: PreferenceKey.SpeacialNeed },
1190
- { label: 'Wheelchair, manual', type: PreferenceKey.SpeacialNeed },
1191
- { label: 'Wheelchair, must be carried', type: PreferenceKey.SpeacialNeed },
1192
- { label: 'Wheelchair, with dry battery', type: PreferenceKey.SpeacialNeed },
1193
- { label: 'Wheelchair, with wet battery', type: PreferenceKey.SpeacialNeed },
1222
+ { label: 'Bassinet', type: PreferenceKey.SpecialNeed },
1223
+ { label: 'Bicycle', type: PreferenceKey.SpecialNeed },
1224
+ { label: 'Blind passenger', type: PreferenceKey.SpecialNeed },
1225
+ { label: 'Deaf passenger', type: PreferenceKey.SpecialNeed },
1226
+ { label: 'Meet and assist', type: PreferenceKey.SpecialNeed },
1227
+ { label: 'Wheelchair, can ascend steps', type: PreferenceKey.SpecialNeed },
1228
+ { label: 'Wheelchair, can walk to seat', type: PreferenceKey.SpecialNeed },
1229
+ { label: 'Wheelchair, manual', type: PreferenceKey.SpecialNeed },
1230
+ { label: 'Wheelchair, must be carried', type: PreferenceKey.SpecialNeed },
1231
+ { label: 'Wheelchair, with dry battery', type: PreferenceKey.SpecialNeed },
1232
+ { label: 'Wheelchair, with wet battery', type: PreferenceKey.SpecialNeed },
1194
1233
  { label: 'Quiet', type: PreferenceKey.SeatLocation },
1195
1234
  { label: 'Business', type: PreferenceKey.SeatLocation },
1196
1235
  { label: 'Family', type: PreferenceKey.SeatLocation },
@@ -2849,7 +2888,14 @@ const Airlines = [
2849
2888
  { label: 'Zimex Aviation', value: 'C4' },
2850
2889
  { label: 'Zoom Airlines', value: 'Z4' },
2851
2890
  { label: 'Zuliana De Aviacion', value: 'OD' }
2852
- ];
2891
+ ];
2892
+ var DifferentInvokdedUserReasons;
2893
+ (function (DifferentInvokdedUserReasons) {
2894
+ DifferentInvokdedUserReasons[DifferentInvokdedUserReasons["continue"] = 0] = "continue";
2895
+ DifferentInvokdedUserReasons[DifferentInvokdedUserReasons["newBasket"] = 1] = "newBasket";
2896
+ DifferentInvokdedUserReasons[DifferentInvokdedUserReasons["cancel"] = 2] = "cancel";
2897
+ DifferentInvokdedUserReasons[DifferentInvokdedUserReasons["research"] = 3] = "research";
2898
+ })(DifferentInvokdedUserReasons || (DifferentInvokdedUserReasons = {}));
2853
2899
 
2854
2900
  class BookableBasket {
2855
2901
  constructor(basketService, helpers) {
@@ -2890,7 +2936,13 @@ class BookableBasket {
2890
2936
  this.basketService.subsribeToBasket(id, {
2891
2937
  next: (basket) => {
2892
2938
  this.basket.next(basket);
2893
- this.updateBasket(basket);
2939
+ // before updating the basket check if there is an expired basket item/s
2940
+ if (this.expiredItemInTheBasket()) {
2941
+ this.status.next(BookingStatus.Expired);
2942
+ }
2943
+ else {
2944
+ this.updateBasket(basket);
2945
+ }
2894
2946
  },
2895
2947
  error: (error) => {
2896
2948
  this.basket.error(error);
@@ -2902,6 +2954,14 @@ class BookableBasket {
2902
2954
  }
2903
2955
  });
2904
2956
  }
2957
+ expiredItemInTheBasket() {
2958
+ this.isUpdating.next(false);
2959
+ let expiredItemInTheBasket;
2960
+ this.basket.subscribe((basket) => {
2961
+ expiredItemInTheBasket = basket.basketItems.some((item) => item.expired);
2962
+ });
2963
+ return expiredItemInTheBasket;
2964
+ }
2905
2965
  updateBasket(basket) {
2906
2966
  this.isUpdating.next(false);
2907
2967
  switch (basket.status) {
@@ -3065,16 +3125,18 @@ class BookableBasket {
3065
3125
  });
3066
3126
  }
3067
3127
  _splitTravellers(basketItem) {
3068
- return (basketItem.userPassengerTypes || []).reduce((accum, user, index) => {
3128
+ return (basketItem.userPassengerTypes.concat(basketItem.guestPassengerTypes) || []).reduce((accum, user, index) => {
3129
+ const userPassenger = this._findUser(basketItem.users, Number(user.id));
3130
+ const guestPassenger = this._findGuest(basketItem.guests, Number(user.id));
3069
3131
  switch (user.passengerType) {
3070
3132
  case PassengerType.Adult:
3071
- accum.adults.push(this._findUser(basketItem.users, Number(user.id)));
3133
+ accum.adults.push(userPassenger || guestPassenger);
3072
3134
  break;
3073
3135
  case PassengerType.Child:
3074
- accum.children.push(this._findUser(basketItem.users, Number(user.id)));
3136
+ accum.children.push(userPassenger || guestPassenger);
3075
3137
  break;
3076
3138
  case PassengerType.Infant:
3077
- accum.infants.push(this._findUser(basketItem.users, Number(user.id)));
3139
+ accum.infants.push(userPassenger || guestPassenger);
3078
3140
  break;
3079
3141
  }
3080
3142
  return accum;
@@ -3085,6 +3147,11 @@ class BookableBasket {
3085
3147
  return Number(user.id) === id;
3086
3148
  });
3087
3149
  }
3150
+ _findGuest(users, id) {
3151
+ return users.find((user) => {
3152
+ return Number(user.id) === id;
3153
+ });
3154
+ }
3088
3155
  getId() {
3089
3156
  return this.id;
3090
3157
  }
@@ -3165,7 +3232,11 @@ const COACH_MAX_INFANT_AGE_YEARS = 0;
3165
3232
  const LOUNGES_MAX_INFANT_AGE_YEARS = 0;
3166
3233
  const METRES_TO_MILES_CONVERSION = 1609;
3167
3234
  const TIME_BASE = 60;
3235
+ const GROUP_TICKET_CODES = ['GS', 'AIG', 'GRP', 'GU3', 'GU4', 'GUC', 'MPG', '2TR', 'SGU'];
3168
3236
  class BaseHelperRoutines {
3237
+ isGroupTicket(code) {
3238
+ return GROUP_TICKET_CODES.includes(code.toUpperCase().trim());
3239
+ }
3169
3240
  minToHour(dur) {
3170
3241
  return `${Math.floor(dur / 60)}h ${dur % 60}m`;
3171
3242
  }
@@ -3858,7 +3929,14 @@ class BaseHelperRoutines {
3858
3929
  return value ? this.toStrings(value, schema) : isRequired ? {} : null;
3859
3930
  case 'array':
3860
3931
  return value; // TODO write array translation
3932
+ case 'date-time':
3933
+ if (value.year) {
3934
+ value = this.formatIsoDate(this.ngDateToMoment(value));
3935
+ }
3936
+ return value;
3937
+ break;
3861
3938
  default:
3939
+ console.warn(`+++ unknown schema type ${schema.type} | returning value as is +++`);
3862
3940
  return value;
3863
3941
  }
3864
3942
  }
@@ -3913,19 +3991,24 @@ class BaseHelperRoutines {
3913
3991
  return miItem.isValid();
3914
3992
  }));
3915
3993
  }
3916
- isMiValid(miPerItem, miPerUser) {
3994
+ isMiValid(miPerItem, miPerUser, miPerGuest) {
3917
3995
  const userMis = Object.values(miPerUser || {});
3996
+ const guestMis = Object.values(miPerGuest || {});
3918
3997
  return (this.miIsValid(miPerItem) &&
3919
3998
  (userMis.length === 0 ||
3920
3999
  !!userMis.find((userMis1) => {
3921
4000
  return this.miIsValid(userMis1.managementInfo);
4001
+ })) &&
4002
+ (guestMis.length === 0 ||
4003
+ !!guestMis.find((userMis1) => {
4004
+ return this.miIsValid(userMis1.managementInfo);
3922
4005
  })));
3923
4006
  }
3924
4007
  needsMi(basket, needsToViewMi) {
3925
4008
  return (basket.basketInfoMiDetails.length > 0 &&
3926
4009
  (needsToViewMi ||
3927
4010
  !basket.basketInfoMiDetails.find((miDetail) => {
3928
- return this.isMiValid(miDetail.miPerItem, miDetail.miPerUser);
4011
+ return this.isMiValid(miDetail.miPerItem, miDetail.miPerUser, miDetail.miPerGuest);
3929
4012
  })));
3930
4013
  }
3931
4014
  findService(services, id) {
@@ -4554,9 +4637,8 @@ var ActionType;
4554
4637
 
4555
4638
  class CabHireEnterpriseSearch extends BaseEnterpriseSearch {
4556
4639
  constructor(cabfetcher, helpers, storageService, searchService, basketService) {
4557
- super(storageService, helpers);
4640
+ super(storageService, helpers, searchService);
4558
4641
  this.cabfetcher = cabfetcher;
4559
- this.searchService = searchService;
4560
4642
  this.basketService = basketService;
4561
4643
  this.type = ServiceType.Cab;
4562
4644
  this.airportChange = new Subject();
@@ -5035,8 +5117,12 @@ class CabHireEnterpriseSearch extends BaseEnterpriseSearch {
5035
5117
  adults: this.tempParams.adults,
5036
5118
  children: this.tempParams.children,
5037
5119
  departs: this.tempParams.departs,
5038
- fromLocation: simplifiedLocation ? this.createCabHireLocation(this.tempParams.fromAddress) : this.tempParams.fromAddress,
5039
- toLocation: simplifiedLocation ? this.createCabHireLocation(this.tempParams.toAddress) : this.tempParams.toAddress,
5120
+ fromLocation: simplifiedLocation
5121
+ ? this.createCabHireLocation(this.tempParams.fromAddress)
5122
+ : this.tempParams.fromAddress,
5123
+ toLocation: simplifiedLocation
5124
+ ? this.createCabHireLocation(this.tempParams.toAddress)
5125
+ : this.tempParams.toAddress,
5040
5126
  infants: 0,
5041
5127
  vehicleType: this.vehicleType,
5042
5128
  vias: this._vias
@@ -5123,7 +5209,7 @@ class CabHireEnterpriseSearch extends BaseEnterpriseSearch {
5123
5209
  'administrative_area_level_2',
5124
5210
  'locality'
5125
5211
  ]),
5126
- PostCode: this.getAddressFromPlaceDetails(location, ['postal_code']),
5212
+ PostCode: this.getAddressFromPlaceDetails(location, ['postcode']),
5127
5213
  Country: this.getAddressFromPlaceDetails(location, ['country']),
5128
5214
  placeDescription
5129
5215
  };
@@ -5191,6 +5277,47 @@ class CabHireEnterpriseSearch extends BaseEnterpriseSearch {
5191
5277
  // TODO flights haven't been done yet.
5192
5278
  }
5193
5279
  }
5280
+ updateSearchFromExpiredBasketItem(basketItem) {
5281
+ var _a, _b, _c, _d;
5282
+ const searchCabHireQuery = basketItem.searchQuery;
5283
+ if (searchCabHireQuery) {
5284
+ this.departs = moment(searchCabHireQuery.departs);
5285
+ this.vehicleType = searchCabHireQuery.vehicleType;
5286
+ this.fromAddress = this.convertAddressLocation(searchCabHireQuery.fromLocation.address, searchCabHireQuery.fromLocation.postcode);
5287
+ this.toAddress = this.convertAddressLocation(searchCabHireQuery.toLocation.address, searchCabHireQuery.toLocation.postcode);
5288
+ if (searchCabHireQuery.vias) {
5289
+ let viasFrom = searchCabHireQuery.vias;
5290
+ if (viasFrom[0]) {
5291
+ this.viasFrom = this.convertAddressLocation((_a = viasFrom[0]) === null || _a === void 0 ? void 0 : _a.address, (_b = viasFrom[0]) === null || _b === void 0 ? void 0 : _b.postcode);
5292
+ }
5293
+ let viasTo = searchCabHireQuery.vias;
5294
+ if (viasTo[1]) {
5295
+ this.viasTo = this.convertAddressLocation((_c = viasTo[1]) === null || _c === void 0 ? void 0 : _c.address, (_d = viasTo[1]) === null || _d === void 0 ? void 0 : _d.postcode);
5296
+ }
5297
+ }
5298
+ }
5299
+ // add Travellers
5300
+ if (basketItem.users) {
5301
+ basketItem.users.forEach((user) => {
5302
+ this.searchService.addTraveller(user);
5303
+ });
5304
+ }
5305
+ }
5306
+ convertAddressLocation(address, postcode) {
5307
+ let locationArray = address.split(',');
5308
+ let street = '';
5309
+ let town = locationArray[locationArray.length - 2];
5310
+ for (let index = 1; index < locationArray.length - 2; index++) {
5311
+ street += locationArray[index] + ' ';
5312
+ }
5313
+ return {
5314
+ Country: address.slice(-2),
5315
+ House: locationArray[0],
5316
+ PostCode: postcode,
5317
+ Street: street,
5318
+ Town: town
5319
+ };
5320
+ }
5194
5321
  getTransType() {
5195
5322
  var _a;
5196
5323
  const transTypeIndex = this.tempParams.vehicleType;
@@ -5199,13 +5326,13 @@ class CabHireEnterpriseSearch extends BaseEnterpriseSearch {
5199
5326
  addCabHireToBasket(cabHireQuote, cabHireQuery) {
5200
5327
  return __awaiter(this, void 0, void 0, function* () {
5201
5328
  if (cabHireQuote.unavailable) {
5202
- return Promise.resolve(false);
5329
+ return Promise.resolve(DifferentInvokdedUserReasons.cancel);
5203
5330
  }
5204
5331
  const intBasket = yield this.basketService.getDefaultBasket();
5205
5332
  const basket = intBasket === null || intBasket === void 0 ? void 0 : intBasket.subject.value;
5206
5333
  const termsAndConditions = this.getTermsAndCond(cabHireQuote);
5207
5334
  if (basket) {
5208
- return this.basketService.addToBasket({
5335
+ const whatHappened = yield this.basketService.addToBasket({
5209
5336
  adults: cabHireQuery.adults,
5210
5337
  basket: basket.id,
5211
5338
  service: cabHireQuote.sourceId.toString(),
@@ -5238,8 +5365,12 @@ class CabHireEnterpriseSearch extends BaseEnterpriseSearch {
5238
5365
  co2PerPassenger: cabHireQuote.co2PerPassenger,
5239
5366
  outboundDate: cabHireQuery.departs.format()
5240
5367
  }, intBasket, this.searchService, this.travellers, cabHireQuote.requiresReason);
5368
+ if (whatHappened === DifferentInvokdedUserReasons.research) {
5369
+ this.performSearch();
5370
+ }
5371
+ return whatHappened;
5241
5372
  }
5242
- return Promise.resolve(false); // TODO should this throw an error?
5373
+ return DifferentInvokdedUserReasons.cancel;
5243
5374
  });
5244
5375
  }
5245
5376
  switchFromAndToLocation() {
@@ -5295,8 +5426,14 @@ class CabHireEnterpriseSearch extends BaseEnterpriseSearch {
5295
5426
  }
5296
5427
  else {
5297
5428
  this.mode = TaxiFormMode.STATION;
5298
- this.airportSearchType = fav.fromLocation.Street ? AirportSearchMode.DROPOFF : AirportSearchMode.PICKUP;
5299
- this.searchService.getAirportsList(!fav.fromLocation.Street ? fav.fromLocation.House : fav.toLocation.House).subscribe(airport => {
5429
+ this.airportSearchType = fav.fromLocation.Street
5430
+ ? AirportSearchMode.DROPOFF
5431
+ : AirportSearchMode.PICKUP;
5432
+ this.searchService
5433
+ .getAirportsList(!fav.fromLocation.Street
5434
+ ? fav.fromLocation.House
5435
+ : fav.toLocation.House)
5436
+ .subscribe((airport) => {
5300
5437
  this.airport = airport[0];
5301
5438
  });
5302
5439
  }
@@ -5337,11 +5474,10 @@ var SortTypesCar;
5337
5474
  class CarhireEnterpriseSearch extends BaseEnterpriseSearch {
5338
5475
  // ! - End of getters and setters
5339
5476
  constructor(carhirefetcher, carHireAvailabilityDetailFetcher, helpers, basketService, storageService, searchService) {
5340
- super(storageService, helpers);
5477
+ super(storageService, helpers, searchService);
5341
5478
  this.carhirefetcher = carhirefetcher;
5342
5479
  this.carHireAvailabilityDetailFetcher = carHireAvailabilityDetailFetcher;
5343
5480
  this.basketService = basketService;
5344
- this.searchService = searchService;
5345
5481
  // ! - Hardcoded Data
5346
5482
  this._carTypeCodes = [
5347
5483
  ['B', '2-3 Door', CarHireType.TwoToThreeDoor],
@@ -6030,20 +6166,20 @@ class CarhireEnterpriseSearch extends BaseEnterpriseSearch {
6030
6166
  this.dropoff_datetime = moment(recentSearch.searchArgs.dropoffDateTime);
6031
6167
  this.pickup_datetime = moment(recentSearch.searchArgs.pickupDateTime);
6032
6168
  if (recentSearch.searchArgs.city) {
6033
- this.getParamsForCarbyCity(recentSearch);
6169
+ this.getParamsForCarbyCity(recentSearch.searchArgs.city);
6034
6170
  }
6035
6171
  else if (recentSearch.searchArgs.airport) {
6036
- this.getParamsForCarbyAirport(recentSearch);
6172
+ this.getParamsForCarbyAirport(recentSearch.searchArgs.airport);
6037
6173
  }
6038
6174
  else if (recentSearch.searchArgs.depot) {
6039
- this.getParamsForCarbyPostCode(recentSearch);
6175
+ this.getParamsForCarbyPostCode(recentSearch.searchArgs.depot);
6040
6176
  }
6041
6177
  }
6042
- getParamsForCarbyAirport(recentSearch) {
6178
+ getParamsForCarbyAirport(airport) {
6043
6179
  this.locationType = LocationTypes.Airport;
6044
6180
  combineLatest([
6045
- this.searchService.getAirportByCode(recentSearch.searchArgs.airport.pickupCode),
6046
- this.searchService.getAirportByCode(recentSearch.searchArgs.airport.dropoffCode)
6181
+ this.searchService.getAirportByCode(airport.pickupCode),
6182
+ this.searchService.getAirportByCode(airport.dropoffCode)
6047
6183
  ]).subscribe(([departLocation, arriveLocation]) => {
6048
6184
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
6049
6185
  if (departLocation && arriveLocation) {
@@ -6069,73 +6205,73 @@ class CarhireEnterpriseSearch extends BaseEnterpriseSearch {
6069
6205
  }
6070
6206
  });
6071
6207
  }
6072
- getParamsForCarbyCity(recentSearch) {
6208
+ getParamsForCarbyCity(city) {
6073
6209
  this.locationType = LocationTypes.City;
6074
- this.chosenDistance = recentSearch.searchArgs.city.chosenDistance;
6210
+ this.chosenDistance = city.chosenDistance;
6075
6211
  this.cityPickup = {
6076
- countryCode: recentSearch.searchArgs.city.pickupCountryCode,
6077
- id: recentSearch.searchArgs.city.pickupCity,
6078
- name: recentSearch.searchArgs.city.pickupName,
6212
+ countryCode: city.pickupCountryCode,
6213
+ id: city.pickupCity,
6214
+ name: city.pickupName,
6079
6215
  type: LocationTypes.City,
6080
- latitude: recentSearch.searchArgs.city.pickupLatitude,
6081
- longitude: recentSearch.searchArgs.city.pickupLongitude
6216
+ latitude: city.pickupLatitude,
6217
+ longitude: city.pickupLongitude
6082
6218
  };
6083
6219
  this.cityDropoff = {
6084
- countryCode: recentSearch.searchArgs.city.dropoffCountryCode,
6085
- id: recentSearch.searchArgs.city.dropoffCity,
6086
- name: recentSearch.searchArgs.city.dropOffName,
6220
+ countryCode: city.dropoffCountryCode,
6221
+ id: city.dropoffCity,
6222
+ name: city.dropOffName,
6087
6223
  type: LocationTypes.City,
6088
- latitude: recentSearch.searchArgs.city.dropOffLatitude,
6089
- longitude: recentSearch.searchArgs.city.dropOffLongitude
6224
+ latitude: city.dropOffLatitude,
6225
+ longitude: city.dropOffLongitude
6090
6226
  };
6091
6227
  this.cityDropoffDepot = {
6092
- addressLines: [recentSearch.searchArgs.city.dropOffAddressLines],
6093
- cityName: recentSearch.searchArgs.city.dropOffCityName,
6094
- extendedLocationCode: recentSearch.searchArgs.city.dropOffExtendedLocationCode,
6095
- locationCode: recentSearch.searchArgs.city.dropOffLocationCode,
6096
- vendor: recentSearch.searchArgs.city.dropOffVendor,
6097
- vendorCode: recentSearch.searchArgs.city.dropOffVendorCode
6228
+ addressLines: [city.dropOffAddressLines],
6229
+ cityName: city.dropOffCityName,
6230
+ extendedLocationCode: city.dropOffExtendedLocationCode,
6231
+ locationCode: city.dropOffLocationCode,
6232
+ vendor: city.dropOffVendor,
6233
+ vendorCode: city.dropOffVendorCode
6098
6234
  };
6099
6235
  this.cityPickupDepot = {
6100
- addressLines: [recentSearch.searchArgs.city.pickupAddressLines],
6101
- cityName: recentSearch.searchArgs.city.pickupCityName,
6102
- extendedLocationCode: recentSearch.searchArgs.city.pickupExtendedLocationCode,
6103
- locationCode: recentSearch.searchArgs.city.pickupLocationCode,
6104
- vendor: recentSearch.searchArgs.city.pickupVendor,
6105
- vendorCode: recentSearch.searchArgs.city.pickupVendorCode
6236
+ addressLines: [city.pickupAddressLines],
6237
+ cityName: city.pickupCityName,
6238
+ extendedLocationCode: city.pickupExtendedLocationCode,
6239
+ locationCode: city.pickupLocationCode,
6240
+ vendor: city.pickupVendor,
6241
+ vendorCode: city.pickupVendorCode
6106
6242
  };
6107
6243
  this.searchService.startSearches();
6108
6244
  }
6109
- getParamsForCarbyPostCode(recentSearch) {
6245
+ getParamsForCarbyPostCode(depot) {
6110
6246
  this.locationType = LocationTypes.Postcode;
6111
- this.chosenDistance = recentSearch.searchArgs.depot.chosenDistance;
6247
+ this.chosenDistance = depot.chosenDistance;
6112
6248
  this.postcodeDropoff = {
6113
- addressLines: [recentSearch.searchArgs.depot.dropoffAddressLines],
6114
- vendorCode: recentSearch.searchArgs.depot.vendorCode,
6115
- locationCode: recentSearch.searchArgs.depot.dropOffLocationCode,
6116
- extendedLocationCode: recentSearch.searchArgs.depot.dropOffExtendedLocationCode,
6117
- cityName: recentSearch.searchArgs.depot.dropoffCityName,
6118
- vendor: recentSearch.searchArgs.depot.dropoffVendor
6249
+ addressLines: [depot.dropoffAddressLines],
6250
+ vendorCode: depot.vendorCode,
6251
+ locationCode: depot.dropOffLocationCode,
6252
+ extendedLocationCode: depot.dropOffExtendedLocationCode,
6253
+ cityName: depot.dropoffCityName,
6254
+ vendor: depot.dropoffVendor
6119
6255
  };
6120
6256
  this.postcodeDropoffRaw = {
6121
- name: recentSearch.searchArgs.depot.dropoffPostCode,
6257
+ name: depot.dropoffPostCode,
6122
6258
  type: LocationTypes.Postcode,
6123
- latitude: recentSearch.searchArgs.depot.dropoffLatitude,
6124
- longitude: recentSearch.searchArgs.depot.dropoffLongitude
6259
+ latitude: depot.dropoffLatitude,
6260
+ longitude: depot.dropoffLongitude
6125
6261
  };
6126
6262
  this.postcodePickup = {
6127
- addressLines: [recentSearch.searchArgs.depot.pickupAddressLines],
6128
- vendorCode: recentSearch.searchArgs.depot.vendorCode,
6129
- locationCode: recentSearch.searchArgs.depot.pickupLocationCode,
6130
- extendedLocationCode: recentSearch.searchArgs.depot.pickupExtendedLocationCode,
6131
- cityName: recentSearch.searchArgs.depot.pickupCityName,
6132
- vendor: recentSearch.searchArgs.depot.pickupVendor
6263
+ addressLines: [depot.pickupAddressLines],
6264
+ vendorCode: depot.vendorCode,
6265
+ locationCode: depot.pickupLocationCode,
6266
+ extendedLocationCode: depot.pickupExtendedLocationCode,
6267
+ cityName: depot.pickupCityName,
6268
+ vendor: depot.pickupVendor
6133
6269
  };
6134
6270
  this.postcodePickupRaw = {
6135
- name: recentSearch.searchArgs.depot.pickupPostCode,
6271
+ name: depot.pickupPostCode,
6136
6272
  type: LocationTypes.Postcode,
6137
- latitude: recentSearch.searchArgs.depot.pickupLatitude,
6138
- longitude: recentSearch.searchArgs.depot.pickupLongitude
6273
+ latitude: depot.pickupLatitude,
6274
+ longitude: depot.pickupLongitude
6139
6275
  };
6140
6276
  this.searchService.startSearches();
6141
6277
  }
@@ -6421,6 +6557,46 @@ class CarhireEnterpriseSearch extends BaseEnterpriseSearch {
6421
6557
  return max;
6422
6558
  }, Number.MIN_SAFE_INTEGER);
6423
6559
  }
6560
+ updateSearchFromExpiredBasketItem(basketItem) {
6561
+ const searchCarHireQuery = basketItem.searchQuery;
6562
+ if (searchCarHireQuery) {
6563
+ this.chosenVendor = searchCarHireQuery.vendor;
6564
+ this.carClass = searchCarHireQuery.class;
6565
+ this.carType = searchCarHireQuery.type;
6566
+ this.transmission = searchCarHireQuery.transmission;
6567
+ this.airCon = searchCarHireQuery.aircon;
6568
+ this.estimatedMileage = searchCarHireQuery.estimatedDailyDistance;
6569
+ this.dropoff_datetime = moment(searchCarHireQuery.dropoffDateTime);
6570
+ this.pickup_datetime = moment(searchCarHireQuery.pickupDateTime);
6571
+ if (searchCarHireQuery.city) {
6572
+ this.getParamsForCarbyCity(searchCarHireQuery.city);
6573
+ }
6574
+ else if (searchCarHireQuery.airport) {
6575
+ this.getParamsForCarbyAirport(searchCarHireQuery.airport);
6576
+ }
6577
+ else if (searchCarHireQuery.depot) {
6578
+ this.updateSearchForCarbyPostCode(searchCarHireQuery, basketItem.detail);
6579
+ }
6580
+ }
6581
+ // add Travellers
6582
+ if (basketItem.users) {
6583
+ basketItem.users.forEach((user) => {
6584
+ this.searchService.addTraveller(user);
6585
+ });
6586
+ }
6587
+ }
6588
+ updateSearchForCarbyPostCode(depot, detail) {
6589
+ this.locationType = LocationTypes.Postcode;
6590
+ this.chosenDistance = depot.chosenDistance;
6591
+ this.postcodeDropoffRaw = {
6592
+ name: detail.dropOffLocation.postcode,
6593
+ type: LocationTypes.Postcode
6594
+ };
6595
+ this.postcodePickupRaw = {
6596
+ name: detail.pickUpLocation.postcode,
6597
+ type: LocationTypes.Postcode
6598
+ };
6599
+ }
6424
6600
  updateFromPreviousSearches(previousItems) {
6425
6601
  var _a;
6426
6602
  console.log('PREPOPULATING CARHIRE FORM');
@@ -6529,7 +6705,7 @@ class CarhireEnterpriseSearch extends BaseEnterpriseSearch {
6529
6705
  var _a, _b;
6530
6706
  return __awaiter(this, void 0, void 0, function* () {
6531
6707
  if (carHireVehicleAvailibility.unavailable) {
6532
- return Promise.resolve(false);
6708
+ return Promise.resolve(DifferentInvokdedUserReasons.cancel);
6533
6709
  }
6534
6710
  const intBasket = yield this.basketService.getDefaultBasket();
6535
6711
  const basket = intBasket === null || intBasket === void 0 ? void 0 : intBasket.subject.value;
@@ -6537,7 +6713,7 @@ class CarhireEnterpriseSearch extends BaseEnterpriseSearch {
6537
6713
  const { co2PerItem, co2PerPassenger, displayRecord, identifiers, sourceId } = carHireVehicleAvailibility;
6538
6714
  const price = parseFloat((_b = (_a = displayRecord === null || displayRecord === void 0 ? void 0 : displayRecord.charges[0]) === null || _a === void 0 ? void 0 : _a.amount) !== null && _b !== void 0 ? _b : '0');
6539
6715
  const termsAndConditions = this.getTermsAndCond(carHireVehicleAvailibility, carHireQuery);
6540
- return this.basketService.addToBasket({
6716
+ const whatHappened = yield this.basketService.addToBasket({
6541
6717
  adults: this.adults,
6542
6718
  basket: basket.id,
6543
6719
  service: sourceId.toString(),
@@ -6581,8 +6757,12 @@ class CarhireEnterpriseSearch extends BaseEnterpriseSearch {
6581
6757
  co2PerPassenger,
6582
6758
  outboundDate: new Date(displayRecord.pickup).toISOString()
6583
6759
  }, intBasket, this.searchService, this.travellers, carHireVehicleAvailibility.requiresReason);
6760
+ if (whatHappened === DifferentInvokdedUserReasons.research) {
6761
+ this.performSearch();
6762
+ }
6763
+ return whatHappened;
6584
6764
  }
6585
- return Promise.resolve(false);
6765
+ return Promise.resolve(DifferentInvokdedUserReasons.cancel);
6586
6766
  });
6587
6767
  }
6588
6768
  // TODO waiting for data
@@ -6670,12 +6850,16 @@ class CarhireEnterpriseSearch extends BaseEnterpriseSearch {
6670
6850
  this.chosenVendor = fav.vendor;
6671
6851
  this.carType = fav.type;
6672
6852
  this.return_to_pickup = fav.airport.pickupCode == fav.airport.dropoffCode;
6673
- this.searchService.getAirportsList(fav.airport.pickupCode).subscribe(results => {
6674
- this.pickup_location = results.find(a => a.gateway == fav.airport.pickupCode);
6853
+ this.searchService
6854
+ .getAirportsList(fav.airport.pickupCode)
6855
+ .subscribe((results) => {
6856
+ this.pickup_location = results.find((a) => a.gateway == fav.airport.pickupCode);
6675
6857
  });
6676
6858
  if (!this.return_to_pickup)
6677
- this.searchService.getAirportsList(fav.airport.dropoffCode).subscribe(results => {
6678
- this.dropoff_location = results.find(a => a.gateway == fav.airport.dropoffCode);
6859
+ this.searchService
6860
+ .getAirportsList(fav.airport.dropoffCode)
6861
+ .subscribe((results) => {
6862
+ this.dropoff_location = results.find((a) => a.gateway == fav.airport.dropoffCode);
6679
6863
  });
6680
6864
  });
6681
6865
  }
@@ -6808,11 +6992,10 @@ var FlightSortTypes;
6808
6992
  })(FlightSortTypes || (FlightSortTypes = {}));
6809
6993
  class FlightEnterpriseSearch extends BaseEnterpriseSearch {
6810
6994
  constructor(flightfetcher, helpers, userService, basketService, storageService, searchService, applyFlightRules, modalService) {
6811
- super(storageService, helpers);
6995
+ super(storageService, helpers, searchService);
6812
6996
  this.flightfetcher = flightfetcher;
6813
6997
  this.userService = userService;
6814
6998
  this.basketService = basketService;
6815
- this.searchService = searchService;
6816
6999
  this.applyFlightRules = applyFlightRules;
6817
7000
  this.modalService = modalService;
6818
7001
  this.type = ServiceType.Flight;
@@ -7378,6 +7561,7 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
7378
7561
  inlegsCount: 0,
7379
7562
  dataSource: '',
7380
7563
  preferred: false,
7564
+ preferredMessage: '',
7381
7565
  outboundFlightNumber: '',
7382
7566
  operator: '',
7383
7567
  operatorFull: '',
@@ -7398,7 +7582,7 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
7398
7582
  }
7399
7583
  // ! using a reduce because not all flights actually exist and we were seeing undefined in the flight list
7400
7584
  brands[brand].forEach((flightNum) => {
7401
- var _a, _b;
7585
+ var _a, _b, _c, _d, _e, _f;
7402
7586
  const flight = groupedObject[flightNum];
7403
7587
  if (flight) {
7404
7588
  if (isOutBound || treatOutboundsAsOutbounds) {
@@ -7418,7 +7602,13 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
7418
7602
  returnObject.maxPrice > maxprice
7419
7603
  ? returnObject.maxPrice
7420
7604
  : maxprice;
7421
- if ((_b = (_a = returnObject.classes[correctBrand]) === null || _a === void 0 ? void 0 : _a.flights) === null || _b === void 0 ? void 0 : _b.length) {
7605
+ returnObject.preferred =
7606
+ ((_a = this._ruleActionSummary.journeyWhenSelected[flight.journeyHash]) === null || _a === void 0 ? void 0 : _a.companyPreferred) || ((_b = this._ruleActionSummary.whenSelectedAlone[flight.journeyHash]) === null || _b === void 0 ? void 0 : _b.companyPreferred) ||
7607
+ false;
7608
+ returnObject.preferredMessage =
7609
+ ((_c = this._ruleActionSummary.journeyWhenSelected[flight.journeyHash]) === null || _c === void 0 ? void 0 : _c.companyPreferredMessage) || ((_d = this._ruleActionSummary.whenSelectedAlone[flight.journeyHash]) === null || _d === void 0 ? void 0 : _d.companyPreferredMessage) ||
7610
+ '';
7611
+ if ((_f = (_e = returnObject.classes[correctBrand]) === null || _e === void 0 ? void 0 : _e.flights) === null || _f === void 0 ? void 0 : _f.length) {
7422
7612
  returnObject.classes[correctBrand].flights.push(flight);
7423
7613
  returnObject.classes[correctBrand].minprice = Math.min(returnObject.classes[correctBrand].minprice, minprice);
7424
7614
  returnObject.classes[correctBrand].maxprice = Math.max(returnObject.classes[correctBrand].maxprice, maxprice);
@@ -7817,6 +8007,101 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
7817
8007
  updateFromPreviousSearches(_previousItems) {
7818
8008
  // Flights can not be search after other products so no defaults can be set.
7819
8009
  }
8010
+ updateSearchFromExpiredBasketItem(basketItem) {
8011
+ const searchFlightsQuery = basketItem.searchQuery;
8012
+ if (searchFlightsQuery.outboundDate) {
8013
+ let outboundTimeWindow = searchFlightsQuery.outboundDepartureTimeWindow
8014
+ ? searchFlightsQuery.outboundDepartureTimeWindow
8015
+ : searchFlightsQuery.outboundArrivalTimeWindow;
8016
+ this.outBoundDate = this.convertRecentSearchDateTime(searchFlightsQuery.outboundDate, outboundTimeWindow);
8017
+ }
8018
+ if (searchFlightsQuery.returnDate) {
8019
+ let returnTimeWindow = searchFlightsQuery.returnDepartureTimeWindow
8020
+ ? searchFlightsQuery.returnDepartureTimeWindow
8021
+ : searchFlightsQuery.returnArrivalTimeWindow;
8022
+ this.inboundDate = this.convertRecentSearchDateTime(searchFlightsQuery.returnDate, returnTimeWindow);
8023
+ }
8024
+ this.fareType = searchFlightsQuery.fareType;
8025
+ this.maxConnections = searchFlightsQuery.maxConnections;
8026
+ if (searchFlightsQuery.outboundCabinClass) {
8027
+ this.cabinClass =
8028
+ searchFlightsQuery.outboundCabinClass;
8029
+ }
8030
+ if (searchFlightsQuery.returnCabinClass) {
8031
+ this.returnCabinClass =
8032
+ searchFlightsQuery.returnCabinClass;
8033
+ }
8034
+ this.includeNearbyAirports = searchFlightsQuery.includeNearbyAirports
8035
+ ? true
8036
+ : false;
8037
+ this.chosenSearchType = searchFlightsQuery.returnTrip
8038
+ ? FlightSearchType.return
8039
+ : FlightSearchType.oneWay;
8040
+ if (searchFlightsQuery.outboundDepartureTimeWindow) {
8041
+ this.outTimeCriteria = TimeWindow.Depart;
8042
+ }
8043
+ else if (searchFlightsQuery.outboundArrivalTimeWindow) {
8044
+ this.outTimeCriteria = TimeWindow.Arrive;
8045
+ }
8046
+ else {
8047
+ this.outTimeCriteria = TimeWindow.Anytime;
8048
+ }
8049
+ if (searchFlightsQuery.returnDepartureTimeWindow) {
8050
+ this.inTimeCriteria = TimeWindow.Depart;
8051
+ }
8052
+ else if (searchFlightsQuery.returnArrivalTimeWindow) {
8053
+ this.inTimeCriteria = TimeWindow.Arrive;
8054
+ }
8055
+ else {
8056
+ this.inTimeCriteria = TimeWindow.Anytime;
8057
+ }
8058
+ combineLatest([
8059
+ this.searchService.getAirportByCode(searchFlightsQuery.originAirport),
8060
+ this.searchService.getAirportByCode(searchFlightsQuery.destinationAirport)
8061
+ ]).subscribe(([departLocation, arriveLocation]) => {
8062
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
8063
+ if (departLocation && arriveLocation) {
8064
+ this.departLocation = {
8065
+ destination: departLocation.iataMatch.name,
8066
+ gateway: departLocation.iataMatch.iata,
8067
+ terminals: this.searchService.processTerminals(departLocation.iataMatch.terminals),
8068
+ country: (_b = (_a = departLocation.iataMatch) === null || _a === void 0 ? void 0 : _a.locationDetails) === null || _b === void 0 ? void 0 : _b.country,
8069
+ postcode: (_d = (_c = departLocation.iataMatch) === null || _c === void 0 ? void 0 : _c.locationDetails) === null || _d === void 0 ? void 0 : _d.postcode,
8070
+ countryCode: (_f = (_e = departLocation.iataMatch) === null || _e === void 0 ? void 0 : _e.locationDetails) === null || _f === void 0 ? void 0 : _f.countryCode
8071
+ };
8072
+ this.arriveLocation = {
8073
+ destination: arriveLocation.iataMatch.name,
8074
+ gateway: arriveLocation.iataMatch.iata,
8075
+ terminals: this.searchService.processTerminals(arriveLocation.iataMatch.terminals),
8076
+ country: (_h = (_g = arriveLocation.iataMatch) === null || _g === void 0 ? void 0 : _g.locationDetails) === null || _h === void 0 ? void 0 : _h.country,
8077
+ postcode: (_k = (_j = arriveLocation.iataMatch) === null || _j === void 0 ? void 0 : _j.locationDetails) === null || _k === void 0 ? void 0 : _k.postcode,
8078
+ countryCode: (_m = (_l = arriveLocation.iataMatch) === null || _l === void 0 ? void 0 : _l.locationDetails) === null || _m === void 0 ? void 0 : _m.countryCode
8079
+ };
8080
+ if (searchFlightsQuery.preferredCarriers) {
8081
+ let carriers = searchFlightsQuery.preferredCarriers;
8082
+ const preferredCarriers = [];
8083
+ carriers.map((preferredCarry) => {
8084
+ this.searchService
8085
+ .getAirlinesList(preferredCarry)
8086
+ .subscribe((items) => {
8087
+ items.map((item) => {
8088
+ if (item.code === preferredCarry) {
8089
+ preferredCarriers.push(item);
8090
+ }
8091
+ });
8092
+ this.preferredCarriers = preferredCarriers;
8093
+ });
8094
+ });
8095
+ }
8096
+ }
8097
+ });
8098
+ // add Travellers
8099
+ if (basketItem.users) {
8100
+ basketItem.users.forEach((user) => {
8101
+ this.searchService.addTraveller(user);
8102
+ });
8103
+ }
8104
+ }
7820
8105
  getTotalBaggage(result) {
7821
8106
  let total = 0;
7822
8107
  const parsedAdditional = JSON.parse(result.additional);
@@ -8054,21 +8339,30 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
8054
8339
  })));
8055
8340
  };
8056
8341
  const selectedRuleSummary = this._ruleActionSummary.dualSingleWhenSelected[(_b = this.selectedGroupFlight) === null || _b === void 0 ? void 0 : _b.journeyHash] || {};
8342
+ const hasField = (flight, field, def) => {
8343
+ return (this.helpers.fieldFromObject(this._ruleActionSummary, [
8344
+ 'journeyWhenSelected',
8345
+ flight.journeyHash,
8346
+ field
8347
+ ]) ||
8348
+ this.helpers.fieldFromObject(this._ruleActionSummary, [
8349
+ 'whenSelectedAlone',
8350
+ flight.journeyHash,
8351
+ field
8352
+ ]) ||
8353
+ this.helpers.fieldFromObject(selectedRuleSummary, [
8354
+ flight.journeyHash,
8355
+ field
8356
+ ]) ||
8357
+ def);
8358
+ };
8057
8359
  const setSelected = (flight) => {
8058
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
8360
+ var _a;
8059
8361
  flight.selected = flight.uid === ((_a = this.selectedGroupFlight) === null || _a === void 0 ? void 0 : _a.uid);
8060
- flight.unavailable =
8061
- ((_b = this._ruleActionSummary.journeyWhenSelected[flight.journeyHash]) === null || _b === void 0 ? void 0 : _b.unavailable) || ((_c = this._ruleActionSummary.whenSelectedAlone[flight.journeyHash]) === null || _c === void 0 ? void 0 : _c.unavailable) || ((_d = selectedRuleSummary[flight.journeyHash]) === null || _d === void 0 ? void 0 : _d.unavailable) ||
8062
- false;
8063
- flight.unavailableMessage =
8064
- ((_e = this._ruleActionSummary.journeyWhenSelected[flight.journeyHash]) === null || _e === void 0 ? void 0 : _e.unavailableMessage) || ((_f = this._ruleActionSummary.whenSelectedAlone[flight.journeyHash]) === null || _f === void 0 ? void 0 : _f.unavailableMessage) ||
8065
- '';
8066
- flight.requiresReason =
8067
- ((_g = this._ruleActionSummary.journeyWhenSelected[flight.journeyHash]) === null || _g === void 0 ? void 0 : _g.requiresReason) || ((_h = this._ruleActionSummary.whenSelectedAlone[flight.journeyHash]) === null || _h === void 0 ? void 0 : _h.requiresReason) || ((_j = selectedRuleSummary[flight.journeyHash]) === null || _j === void 0 ? void 0 : _j.requiresReason) ||
8068
- false;
8069
- flight.requiresReasonMessage =
8070
- ((_k = this._ruleActionSummary.journeyWhenSelected[flight.journeyHash]) === null || _k === void 0 ? void 0 : _k.requiresReasonMessage) || ((_l = this._ruleActionSummary.whenSelectedAlone[flight.journeyHash]) === null || _l === void 0 ? void 0 : _l.requiresReasonMessage) ||
8071
- '';
8362
+ flight.unavailable = hasField(flight, 'unavailable', false);
8363
+ flight.unavailableMessage = hasField(flight, 'unavailableMessage', '');
8364
+ flight.requiresReason = hasField(flight, 'requiresReason', false);
8365
+ flight.requiresReasonMessage = hasField(flight, 'requiresReasonMessage', '');
8072
8366
  return flight;
8073
8367
  };
8074
8368
  if (this.isGroupedFlights(this.fullResults)) {
@@ -8261,24 +8555,30 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
8261
8555
  }, selectedFlight.outboundFlights[0].dateTimeDeparting);
8262
8556
  }
8263
8557
  doBooking(intBasket, selectedFlight, schemaDetails, outboundDate, inboundDate) {
8264
- const { sourceId, co2PerItem, co2PerPassenger, total } = selectedFlight;
8265
- const booking = {
8266
- adults: this.adults,
8267
- basket: intBasket.id,
8268
- children: this.children,
8269
- co2PerItem,
8270
- co2PerPassenger,
8271
- currency: total.currency,
8272
- detail: schemaDetails,
8273
- price: total.price,
8274
- searchQuery: this.resultQuery,
8275
- service: sourceId.toString(),
8276
- outboundDate
8277
- };
8278
- if (inboundDate) {
8279
- booking.inboundDate = inboundDate;
8280
- }
8281
- this.basketService.addToBasket(booking, intBasket, this.searchService, this.travellers, selectedFlight.requiresReason);
8558
+ return __awaiter(this, void 0, void 0, function* () {
8559
+ const { sourceId, co2PerItem, co2PerPassenger, total } = selectedFlight;
8560
+ const booking = {
8561
+ adults: this.adults,
8562
+ basket: intBasket.id,
8563
+ children: this.children,
8564
+ co2PerItem,
8565
+ co2PerPassenger,
8566
+ currency: total.currency,
8567
+ detail: schemaDetails,
8568
+ price: total.price,
8569
+ searchQuery: this.resultQuery,
8570
+ service: sourceId.toString(),
8571
+ outboundDate
8572
+ };
8573
+ if (inboundDate) {
8574
+ booking.inboundDate = inboundDate;
8575
+ }
8576
+ const whatHappened = yield this.basketService.addToBasket(booking, intBasket, this.searchService, this.travellers, selectedFlight.requiresReason);
8577
+ if (whatHappened === DifferentInvokdedUserReasons.research) {
8578
+ this.performSearch();
8579
+ }
8580
+ return whatHappened;
8581
+ });
8282
8582
  }
8283
8583
  makeSchemaFlights(selectedFlight, flightGroup, groupIndex, segmentIndex) {
8284
8584
  return Object.assign(Object.assign({}, selectedFlight), { journeyInfo: {
@@ -8290,7 +8590,7 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
8290
8590
  addFlightJourneysToBasket(flightQuote) {
8291
8591
  return __awaiter(this, void 0, void 0, function* () {
8292
8592
  if (flightQuote.unavailable) {
8293
- return Promise.resolve(false);
8593
+ return Promise.resolve(DifferentInvokdedUserReasons.cancel);
8294
8594
  }
8295
8595
  const intBasket = yield this.basketService.getDefaultBasket();
8296
8596
  const basket = intBasket === null || intBasket === void 0 ? void 0 : intBasket.subject.value;
@@ -8334,7 +8634,7 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
8334
8634
  }
8335
8635
  return this.basketService.addToBasket(booking, intBasket, this.searchService, this.travellers, flightQuote.requiresReason);
8336
8636
  }
8337
- return Promise.resolve(false); // TODO should this throw an error?
8637
+ return Promise.resolve(DifferentInvokdedUserReasons.cancel); // TODO should this throw an error?
8338
8638
  });
8339
8639
  }
8340
8640
  setFlightDisplayType(displayType) {
@@ -8344,26 +8644,28 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
8344
8644
  _applyFilter() {
8345
8645
  this.applyFilters(this.currentFilters, this.currentSort);
8346
8646
  }
8347
- openFlightFareRules(rules, flights) {
8647
+ openFlightFareRules(rules, flights, options = null, flightDetail = null) {
8348
8648
  // first check if there are rules
8349
8649
  const doCall = !Object.values(rules).find((rule) => rule.length);
8350
8650
  if (doCall) {
8351
8651
  const rulesFromCall = this.searchService.getFlightFareRules(flights[0]);
8352
8652
  rulesFromCall.subscribe((data) => {
8353
- this.modalService.open(ModalTypes.ModalFlightFareComponent, null, {
8653
+ this.modalService.open(ModalTypes.ModalFlightFareComponent, options, {
8354
8654
  rules: data.results[0],
8355
8655
  from: flights[0].originAirport,
8356
- to: flights[flights.length - 1].destinationAirport
8656
+ to: flights[flights.length - 1].destinationAirport,
8657
+ flight: flightDetail
8357
8658
  });
8358
8659
  }, (err) => {
8359
8660
  console.log(err);
8360
8661
  });
8361
8662
  }
8362
8663
  else {
8363
- this.modalService.open(ModalTypes.ModalFlightFareComponent, null, {
8664
+ this.modalService.open(ModalTypes.ModalFlightFareComponent, options, {
8364
8665
  rules,
8365
8666
  from: flights[0].originAirport,
8366
- to: flights[flights.length - 1].destinationAirport
8667
+ to: flights[flights.length - 1].destinationAirport,
8668
+ flight: flightDetail
8367
8669
  });
8368
8670
  }
8369
8671
  }
@@ -8515,33 +8817,54 @@ class FlightEnterpriseSearch extends BaseEnterpriseSearch {
8515
8817
  }
8516
8818
  applyFavourite(fav) {
8517
8819
  return __awaiter(this, void 0, void 0, function* () {
8518
- this.chosenSearchType = fav.multiDestination ? FlightSearchType.multiCity : fav.returnTrip ? FlightSearchType.return : FlightSearchType.oneWay;
8820
+ this.chosenSearchType = fav.multiDestination
8821
+ ? FlightSearchType.multiCity
8822
+ : fav.returnTrip
8823
+ ? FlightSearchType.return
8824
+ : FlightSearchType.oneWay;
8519
8825
  if (this.chosenSearchType == FlightSearchType.multiCity) {
8520
8826
  const multi = yield Promise.all(fav.multiDestination.map((a) => __awaiter(this, void 0, void 0, function* () {
8521
- let destination = { date: undefined, dest: undefined, orig: undefined };
8522
- destination.orig = yield this.searchService.getAirportsList(a.orig).toPromise().then(origResults => {
8523
- return origResults.find(b => b.gateway == a.orig);
8827
+ let destination = {
8828
+ date: undefined,
8829
+ dest: undefined,
8830
+ orig: undefined
8831
+ };
8832
+ destination.orig = yield this.searchService
8833
+ .getAirportsList(a.orig)
8834
+ .toPromise()
8835
+ .then((origResults) => {
8836
+ return origResults.find((b) => b.gateway == a.orig);
8524
8837
  });
8525
- destination.dest = yield this.searchService.getAirportsList(a.dest).toPromise().then(destResults => {
8526
- return destResults.find(b => b.gateway == a.dest);
8838
+ destination.dest = yield this.searchService
8839
+ .getAirportsList(a.dest)
8840
+ .toPromise()
8841
+ .then((destResults) => {
8842
+ return destResults.find((b) => b.gateway == a.dest);
8527
8843
  });
8528
8844
  return destination;
8529
8845
  })));
8530
8846
  this.multiDestination = multi;
8531
8847
  }
8532
8848
  else {
8533
- this.searchService.getAirportsList(fav.originAirport).subscribe(results => {
8534
- this.departLocation = results.find(a => a.gateway == fav.originAirport);
8849
+ this.searchService
8850
+ .getAirportsList(fav.originAirport)
8851
+ .subscribe((results) => {
8852
+ this.departLocation = results.find((a) => a.gateway == fav.originAirport);
8535
8853
  });
8536
- this.searchService.getAirportsList(fav.destinationAirport).subscribe(results => {
8537
- this.arriveLocation = results.find(a => a.gateway == fav.destinationAirport);
8854
+ this.searchService
8855
+ .getAirportsList(fav.destinationAirport)
8856
+ .subscribe((results) => {
8857
+ this.arriveLocation = results.find((a) => a.gateway == fav.destinationAirport);
8538
8858
  });
8539
8859
  }
8540
8860
  this.cabinClass = fav.outboundCabinClass[0];
8541
- this.returnCabinClass = this.chosenSearchType != FlightSearchType.return ? null : fav.returnCabinClass[0];
8861
+ this.returnCabinClass =
8862
+ this.chosenSearchType != FlightSearchType.return
8863
+ ? null
8864
+ : fav.returnCabinClass[0];
8542
8865
  this.includeNearbyAirports = fav.includeNearbyAirports;
8543
- this.adults = fav.passengers.filter((a) => a.type == "ADULT").length;
8544
- this.children = fav.passengers.filter((a) => a.type == "CHILD").length;
8866
+ this.adults = fav.passengers.filter((a) => a.type == 'ADULT').length;
8867
+ this.children = fav.passengers.filter((a) => a.type == 'CHILD').length;
8545
8868
  // this.preferredCarriers = fav.preferredCarriers.map((a: any) => {
8546
8869
  // })
8547
8870
  });
@@ -8574,6 +8897,8 @@ var URLS;
8574
8897
  URLS["CONFIRMA_INFO_URL"] = "/confermainfo/Info.aspx?mode=hotel&key=MICROSSABS&id=";
8575
8898
  URLS["RECOVER_PASSWORD_URL"] = "password/getResetToken";
8576
8899
  URLS["RESET_PASSWORD"] = "password/resetByToken";
8900
+ URLS["BECOME_USER"] = "startUserSupport";
8901
+ URLS["END_BECOME_USER"] = "endUserSupport";
8577
8902
  URLS["ADMIN_USER_PANEL"] = "https://admin-staging.ctmlightning.co.uk/user";
8578
8903
  })(URLS || (URLS = {}));
8579
8904
 
@@ -8587,6 +8912,7 @@ class HotelFilters {
8587
8912
  this.extra = [];
8588
8913
  this.hotelName = '';
8589
8914
  this.breakfastType = [];
8915
+ this.accessibleRoomType = [];
8590
8916
  }
8591
8917
  }
8592
8918
  var HotelView;
@@ -8605,13 +8931,12 @@ const CLIENT_PREFERRED_VALUE = 1;
8605
8931
  const AGENT_PREFERRED_VALUE = 2;
8606
8932
  class HotelEnterpriseSearch extends BaseEnterpriseSearch {
8607
8933
  constructor(hotelFetcher, helpers, userService, environment, avaliabilityService, basketService, storageService, searchService, httpCallService, quickListFetcher, getRailStationFetcher, applyHotelRulesFetcher) {
8608
- super(storageService, helpers);
8934
+ super(storageService, helpers, searchService);
8609
8935
  this.hotelFetcher = hotelFetcher;
8610
8936
  this.userService = userService;
8611
8937
  this.environment = environment;
8612
8938
  this.avaliabilityService = avaliabilityService;
8613
8939
  this.basketService = basketService;
8614
- this.searchService = searchService;
8615
8940
  this.httpCallService = httpCallService;
8616
8941
  this.quickListFetcher = quickListFetcher;
8617
8942
  this.getRailStationFetcher = getRailStationFetcher;
@@ -8620,6 +8945,7 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
8620
8945
  this.location_types = new BehaviorSubject([]);
8621
8946
  this.offices = new BehaviorSubject([]);
8622
8947
  this.lastActivePage = new BehaviorSubject(null);
8948
+ this.jitRulesReceived = new BehaviorSubject(false);
8623
8949
  this.galleries = {};
8624
8950
  this.occupied = 0;
8625
8951
  this.results_details = {
@@ -8682,7 +9008,8 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
8682
9008
  this.hasPreferred(hotel) &&
8683
9009
  this.breakfastTypeFilter(hotel) &&
8684
9010
  this.getExtraFilter(hotel) &&
8685
- this.getAmenitiesFilter(hotel));
9011
+ this.getAmenitiesFilter(hotel) &&
9012
+ this.accessibleRoomTypeFilter(hotel));
8686
9013
  });
8687
9014
  this.results.next(this.resultsFilterMethod(this.fullResults));
8688
9015
  };
@@ -8716,6 +9043,7 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
8716
9043
  this.results_details.chains.add(hotelResult.group);
8717
9044
  });
8718
9045
  this.fullResults = results;
9046
+ this.jitRulesReceived.next(false);
8719
9047
  this.results.next(results);
8720
9048
  this._isValid();
8721
9049
  this.userService.changeUser.subscribe((user) => {
@@ -8975,6 +9303,15 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
8975
9303
  }
8976
9304
  return hotel;
8977
9305
  });
9306
+ travleResults.forEach((hotel) => {
9307
+ if (hotel.availableRates) {
9308
+ hotel.jitRemoveResultRule = false;
9309
+ this.jitRulesReceived.next(true);
9310
+ }
9311
+ else {
9312
+ hotel.jitRemoveResultRule = true;
9313
+ }
9314
+ });
8978
9315
  this.results.next(travleResults);
8979
9316
  });
8980
9317
  }
@@ -9079,7 +9416,7 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
9079
9416
  // Calculating Occupancy
9080
9417
  const occupancy = this.no_of_occupants / this.no_of_rooms;
9081
9418
  if (!(occupancy === 1 || occupancy === 2)) {
9082
- this.validationMessages.push('Occupants per room must be 1 or 2, if you have an odd number of travellers (greater than one), the no of rooms must be equal');
9419
+ this.validationMessages.push('Occupants per room must be 1 or 2; if you have an odd number of travellers (greater than one); the no of rooms must be equal');
9083
9420
  }
9084
9421
  console.log(this.validationMessages);
9085
9422
  this.isValid.next(this.validationMessages.length === 0);
@@ -9087,6 +9424,7 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
9087
9424
  }
9088
9425
  startSearch() {
9089
9426
  this.results.next([]);
9427
+ this.jitRulesReceived.next(false);
9090
9428
  this.avaliabilityService.reset();
9091
9429
  if (this.isValid.value) {
9092
9430
  this._originalUserSearch = Object.freeze(this.helpers.clone(this.tempParams));
@@ -9366,31 +9704,40 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
9366
9704
  breakfastTypeFilter(hotel) {
9367
9705
  if (!this.filters.breakfastType.length)
9368
9706
  return true;
9369
- const hotelObject = this.avaliabilityService.getAvailabilityForId(this.makeHotelAvalilityObject(hotel), hotel);
9370
- if (!hotelObject && !hotelObject.value)
9707
+ const hotelObjectValue = this.getHotelObjectValue(hotel);
9708
+ if (!hotelObjectValue || !(hotelObjectValue === null || hotelObjectValue === void 0 ? void 0 : hotelObjectValue.rooms))
9371
9709
  return false;
9372
- const hotelObjectValue = hotelObject.value;
9373
9710
  const isBreakfastIncluded = this.filters.breakfastType.includes(SearchHandler.BREAKFAST_INCLUDED);
9374
9711
  const isBreakfastExcluded = this.filters.breakfastType.includes(SearchHandler.BREAKFAST_NOT_INCLUDED);
9375
- if (hotelObjectValue === null || hotelObjectValue === void 0 ? void 0 : hotelObjectValue.rooms) {
9376
- const breakfastMatches = hotelObjectValue.rooms.filter((rooms) => {
9377
- if (isBreakfastIncluded && isBreakfastExcluded) {
9378
- return rooms;
9379
- }
9380
- else if (isBreakfastIncluded) {
9381
- return (rooms.rateDescription.match(includedExpression) &&
9382
- !rooms.rateDescription.match(excludedExpression));
9383
- }
9384
- else if (isBreakfastExcluded) {
9385
- return (!rooms.rateDescription.match(includedExpression) ||
9386
- rooms.rateDescription.match(excludedExpression));
9387
- }
9388
- });
9389
- return !!breakfastMatches.length;
9390
- }
9391
- else {
9712
+ const breakfastMatches = hotelObjectValue.rooms.filter((rooms) => {
9713
+ if (isBreakfastIncluded && isBreakfastExcluded) {
9714
+ return rooms;
9715
+ }
9716
+ else if (isBreakfastIncluded) {
9717
+ return (rooms.rateDescription.match(includedExpression) &&
9718
+ !rooms.rateDescription.match(excludedExpression));
9719
+ }
9720
+ else if (isBreakfastExcluded) {
9721
+ return (!rooms.rateDescription.match(includedExpression) ||
9722
+ rooms.rateDescription.match(excludedExpression));
9723
+ }
9724
+ });
9725
+ return !!breakfastMatches.length;
9726
+ }
9727
+ accessibleRoomTypeFilter(hotel) {
9728
+ if (!this.filters.accessibleRoomType.length)
9729
+ return true;
9730
+ const hotelObjectValue = this.getHotelObjectValue(hotel);
9731
+ if (!hotelObjectValue || !(hotelObjectValue === null || hotelObjectValue === void 0 ? void 0 : hotelObjectValue.rooms))
9392
9732
  return false;
9393
- }
9733
+ const matches = hotelObjectValue.rooms.filter((rooms) => rooms.rateDescription.match(includedAccessibilityExpression) ||
9734
+ rooms.roomDescription.match(includedAccessibilityExpression) ||
9735
+ rooms.roomType.match(includedAccessibilityExpression));
9736
+ return !!matches.length;
9737
+ }
9738
+ getHotelObjectValue(hotel) {
9739
+ const hotelObject = this.avaliabilityService.getAvailabilityForId(this.makeHotelAvalilityObject(hotel), hotel);
9740
+ return !hotelObject && !hotelObject.value ? null : hotelObject.value;
9394
9741
  }
9395
9742
  byMostExpensive() {
9396
9743
  this.sortByPrice(false);
@@ -9499,6 +9846,80 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
9499
9846
  this.localFilters.hotelName = '';
9500
9847
  this.localFilters.breakfastType = [];
9501
9848
  }
9849
+ updateSearchFromExpiredBasketItem(basketItem) {
9850
+ var _a, _b, _c, _d;
9851
+ const searchHotelQuery = basketItem.searchQuery;
9852
+ this.currency = searchHotelQuery.currency;
9853
+ this.distance = searchHotelQuery.distance;
9854
+ this.no_of_rooms = searchHotelQuery.rooms;
9855
+ this.checkin_date = moment(searchHotelQuery.startDate);
9856
+ this.checkout_date = moment(searchHotelQuery.endDate);
9857
+ this.hotel_name = searchHotelQuery.hotelName;
9858
+ if (searchHotelQuery.groupName) {
9859
+ this.hotel_chain = {
9860
+ name: searchHotelQuery.groupName
9861
+ };
9862
+ }
9863
+ if (searchHotelQuery.iata) {
9864
+ this.location_type_select = LocationTypes.Airport;
9865
+ this.searchService
9866
+ .getAirportByCode(searchHotelQuery.iata)
9867
+ .subscribe((iata) => {
9868
+ const airport = {
9869
+ airport: {
9870
+ gateway: iata.iataMatch.iata
9871
+ }
9872
+ };
9873
+ this.location = Object.assign(Object.assign({}, airport), iata.iataMatch);
9874
+ });
9875
+ }
9876
+ else if (searchHotelQuery.latitude && searchHotelQuery.longitude) {
9877
+ this.location_type_select = LocationTypes.City;
9878
+ this.location = {
9879
+ name: ((_b = (_a = basketItem.detail) === null || _a === void 0 ? void 0 : _a.hotelAaddress) === null || _b === void 0 ? void 0 : _b.town) ? (_d = (_c = basketItem.detail) === null || _c === void 0 ? void 0 : _c.hotelAaddress) === null || _d === void 0 ? void 0 : _d.town : '',
9880
+ latitude: searchHotelQuery.latitude,
9881
+ longitude: searchHotelQuery.longitude
9882
+ };
9883
+ }
9884
+ else if (searchHotelQuery.postOrZipCode) {
9885
+ this.location_type_select = LocationTypes.Postcode;
9886
+ this.postcode = {
9887
+ name: searchHotelQuery.postOrZipCode,
9888
+ type: LocationTypes.Postcode
9889
+ };
9890
+ }
9891
+ else if (searchHotelQuery.officeId) {
9892
+ this.location_type_select = LocationTypes.Office;
9893
+ this.searchService
9894
+ .getOffice(searchHotelQuery.officeId)
9895
+ .pipe(take(1))
9896
+ .subscribe((office) => {
9897
+ this.office = {
9898
+ id: office.id,
9899
+ name: office.name
9900
+ };
9901
+ });
9902
+ }
9903
+ else if (searchHotelQuery.trainStationCode) {
9904
+ this.location_type_select = LocationTypes.TrainStation;
9905
+ this.getRailStationByCode(searchHotelQuery.trainStationCode).subscribe((trainsStation) => {
9906
+ this.trainsStation = Object.assign(Object.assign({}, trainsStation), { type: LocationTypes.TrainStation });
9907
+ });
9908
+ }
9909
+ else if (searchHotelQuery.countryCode) {
9910
+ this.location_type_select = LocationTypes.Shortlist;
9911
+ this.country = {
9912
+ cCode: searchHotelQuery.countryCode,
9913
+ cName: ''
9914
+ };
9915
+ }
9916
+ // add Travellers
9917
+ if (basketItem.users) {
9918
+ basketItem.users.forEach((user) => {
9919
+ this.searchService.addTraveller(user);
9920
+ });
9921
+ }
9922
+ }
9502
9923
  updateFromPreviousSearches(previousItems) {
9503
9924
  var _a, _b;
9504
9925
  console.log('PREPOPULATING HOTEL FORM');
@@ -9707,7 +10128,7 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
9707
10128
  console.log(hotelRoom);
9708
10129
  console.log(hotelQuery);
9709
10130
  if (hotel.unavailable) {
9710
- return Promise.resolve(false);
10131
+ return DifferentInvokdedUserReasons.cancel;
9711
10132
  }
9712
10133
  // modify the 'startDate' and 'endDate' properties to have ISO format
9713
10134
  hotelQuery.startDate = new Date(hotelQuery.startDate).toISOString();
@@ -9737,8 +10158,17 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
9737
10158
  const { address: hotelAaddress } = hotel;
9738
10159
  const termsAndConditions = this.getTermsAndCond(hotelRoom, hotelQuery);
9739
10160
  // bookedTravellersChunks.forEach((chunk: Traveller[], index: number) => {
9740
- roomArray.forEach((chunk, index) => {
9741
- this.basketService.addToBasket({
10161
+ return roomArray.reduce((current, chunk, index) => __awaiter(this, void 0, void 0, function* () {
10162
+ switch (yield current) {
10163
+ case DifferentInvokdedUserReasons.cancel:
10164
+ return DifferentInvokdedUserReasons.cancel;
10165
+ case DifferentInvokdedUserReasons.research:
10166
+ return DifferentInvokdedUserReasons.research;
10167
+ case DifferentInvokdedUserReasons.continue:
10168
+ case DifferentInvokdedUserReasons.newBasket:
10169
+ break;
10170
+ }
10171
+ const wh = yield this.basketService.addToBasket({
9742
10172
  adults: numberToSplit,
9743
10173
  basket: basket.id,
9744
10174
  service: hotel.sourceId.toString(),
@@ -9767,13 +10197,13 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
9767
10197
  // this is an array of 1 or 2 travellers which go in 1 room
9768
10198
  // chunk
9769
10199
  bookedTravellersChunks[index] || [], hotelRoom.requiresReason);
9770
- // if (index === bookedTravellersChunks.length - 1) {
9771
- if (index === roomArray.length - 1) {
9772
- return Promise.resolve(true);
10200
+ if (wh === DifferentInvokdedUserReasons.research) {
10201
+ this.performSearch();
9773
10202
  }
9774
- });
10203
+ return wh;
10204
+ }), DifferentInvokdedUserReasons.continue);
9775
10205
  }
9776
- return Promise.resolve(false);
10206
+ return DifferentInvokdedUserReasons.cancel;
9777
10207
  });
9778
10208
  }
9779
10209
  getTermsAndCond(hotelRoom, hotelQuery) {
@@ -9820,7 +10250,12 @@ class HotelEnterpriseSearch extends BaseEnterpriseSearch {
9820
10250
  this.no_of_rooms = fav.rooms;
9821
10251
  this.distance = fav.distance;
9822
10252
  this.currency = fav.currency;
9823
- let location = { latitude: fav.latitude, longitude: fav.longitude, countryCode: fav.countryCode, name: fav.cityName };
10253
+ let location = {
10254
+ latitude: fav.latitude,
10255
+ longitude: fav.longitude,
10256
+ countryCode: fav.countryCode,
10257
+ name: fav.cityName
10258
+ };
9824
10259
  if (fav.trainStationCode)
9825
10260
  location.type = LocationTypes.TrainStation;
9826
10261
  else if (fav.officeId)
@@ -9845,10 +10280,9 @@ HotelEnterpriseSearch.STORAGE_SESSION_RESULTS = 'results_hotel';
9845
10280
 
9846
10281
  class LoungesEnterpriseSearch extends BaseEnterpriseSearch {
9847
10282
  constructor(loungefetcher, helpers, basketService, storageService, searchService) {
9848
- super(storageService, helpers);
10283
+ super(storageService, helpers, searchService);
9849
10284
  this.loungefetcher = loungefetcher;
9850
10285
  this.basketService = basketService;
9851
- this.searchService = searchService;
9852
10286
  this.type = ServiceType.Lounge;
9853
10287
  this.terminals = new BehaviorSubject([]);
9854
10288
  this._flightNumber = null;
@@ -10133,17 +10567,45 @@ class LoungesEnterpriseSearch extends BaseEnterpriseSearch {
10133
10567
  }
10134
10568
  }
10135
10569
  }
10570
+ updateSearchFromExpiredBasketItem(basketItem) {
10571
+ const searchLoungesQuery = basketItem.searchQuery;
10572
+ if (searchLoungesQuery) {
10573
+ this.arrivalDatetime = moment(searchLoungesQuery.arrivalDatetime);
10574
+ this.terminal = searchLoungesQuery.terminal;
10575
+ this.searchService
10576
+ .getAirportByCode(searchLoungesQuery.locationCode)
10577
+ .subscribe((airport) => {
10578
+ var _a, _b, _c, _d, _e, _f;
10579
+ if (airport) {
10580
+ this.locationCode = {
10581
+ country: (_b = (_a = airport.iataMatch) === null || _a === void 0 ? void 0 : _a.locationDetails) === null || _b === void 0 ? void 0 : _b.country,
10582
+ countryCode: (_d = (_c = airport.iataMatch) === null || _c === void 0 ? void 0 : _c.locationDetails) === null || _d === void 0 ? void 0 : _d.countryCode,
10583
+ destination: airport.iataMatch.name,
10584
+ gateway: airport.iataMatch.iata,
10585
+ postcode: (_f = (_e = airport.iataMatch) === null || _e === void 0 ? void 0 : _e.locationDetails) === null || _f === void 0 ? void 0 : _f.postcode,
10586
+ terminals: this.searchService.processTerminals(airport.iataMatch.terminals)
10587
+ };
10588
+ }
10589
+ });
10590
+ }
10591
+ // add Travellers
10592
+ if (basketItem.users) {
10593
+ basketItem.users.forEach((user) => {
10594
+ this.searchService.addTraveller(user);
10595
+ });
10596
+ }
10597
+ }
10136
10598
  addLoungeToBasket(loungeQuote, loungeQuery) {
10137
10599
  var _a;
10138
10600
  return __awaiter(this, void 0, void 0, function* () {
10139
10601
  if (loungeQuote.unavailable) {
10140
- return Promise.resolve(false);
10602
+ return Promise.resolve(DifferentInvokdedUserReasons.cancel);
10141
10603
  }
10142
10604
  const intBasket = yield this.basketService.getDefaultBasket();
10143
10605
  const basket = intBasket === null || intBasket === void 0 ? void 0 : intBasket.subject.value;
10144
10606
  const termsAndConditions = this.getTermsAndCond(loungeQuote);
10145
10607
  if (basket) {
10146
- return this.basketService.addToBasket({
10608
+ const whatHappened = yield this.basketService.addToBasket({
10147
10609
  adults: loungeQuery.adults,
10148
10610
  children: loungeQuery.children,
10149
10611
  infants: loungeQuery.infants,
@@ -10174,8 +10636,12 @@ class LoungesEnterpriseSearch extends BaseEnterpriseSearch {
10174
10636
  searchQuery: loungeQuery,
10175
10637
  outboundDate: loungeQuery.arrivalDatetime.format()
10176
10638
  }, intBasket, this.searchService, this.travellers, loungeQuote.requiresReason);
10639
+ if (whatHappened === DifferentInvokdedUserReasons.research) {
10640
+ this.performSearch();
10641
+ }
10642
+ return whatHappened;
10177
10643
  }
10178
- return Promise.resolve(false); // TODO should this throw an error?
10644
+ return DifferentInvokdedUserReasons.cancel; // TODO should this throw an error?
10179
10645
  });
10180
10646
  }
10181
10647
  getTermsAndCond(loungeQuote) {
@@ -10266,8 +10732,8 @@ class LoungesEnterpriseSearch extends BaseEnterpriseSearch {
10266
10732
  }
10267
10733
  applyFavourite(fav) {
10268
10734
  return __awaiter(this, void 0, void 0, function* () {
10269
- this.searchService.getAirportsList(fav.locationCode).subscribe(a => {
10270
- this.locationCode = a.find(a => a.gateway == fav.locationCode);
10735
+ this.searchService.getAirportsList(fav.locationCode).subscribe((a) => {
10736
+ this.locationCode = a.find((a) => a.gateway == fav.locationCode);
10271
10737
  this.terminal = fav.terminal;
10272
10738
  });
10273
10739
  this.adults = fav.adults;
@@ -10287,10 +10753,9 @@ const defaultValidations = {
10287
10753
  };
10288
10754
  class ParkingEnterpriseSearch extends BaseEnterpriseSearch {
10289
10755
  constructor(parkingfetcher, helpers, basketService, storageService, searchService) {
10290
- super(storageService, helpers);
10756
+ super(storageService, helpers, searchService);
10291
10757
  this.parkingfetcher = parkingfetcher;
10292
10758
  this.basketService = basketService;
10293
- this.searchService = searchService;
10294
10759
  this.type = ServiceType.Parking;
10295
10760
  this.terminals = new BehaviorSubject([]);
10296
10761
  this.listViewToggle = new BehaviorSubject(null);
@@ -10624,6 +11089,34 @@ class ParkingEnterpriseSearch extends BaseEnterpriseSearch {
10624
11089
  }
10625
11090
  this.results.next(results);
10626
11091
  }
11092
+ updateSearchFromExpiredBasketItem(basketItem) {
11093
+ const searchParkingQuery = basketItem.searchQuery;
11094
+ this.arrivalDatetime = moment(searchParkingQuery.arrivalDatetime);
11095
+ this.departDatetime = moment(searchParkingQuery.departDatetime);
11096
+ this.outFlightNumber = searchParkingQuery.outFlightNumber;
11097
+ this.terminal = searchParkingQuery.terminal;
11098
+ this.searchService
11099
+ .getAirportByCode(searchParkingQuery.locationCode)
11100
+ .subscribe((airport) => {
11101
+ var _a, _b, _c, _d, _e, _f;
11102
+ if (airport) {
11103
+ this.locationCode = {
11104
+ country: (_b = (_a = airport.iataMatch) === null || _a === void 0 ? void 0 : _a.locationDetails) === null || _b === void 0 ? void 0 : _b.country,
11105
+ countryCode: (_d = (_c = airport.iataMatch) === null || _c === void 0 ? void 0 : _c.locationDetails) === null || _d === void 0 ? void 0 : _d.countryCode,
11106
+ destination: airport.iataMatch.name,
11107
+ gateway: airport.iataMatch.iata,
11108
+ postcode: (_f = (_e = airport.iataMatch) === null || _e === void 0 ? void 0 : _e.locationDetails) === null || _f === void 0 ? void 0 : _f.postcode,
11109
+ terminals: this.searchService.processTerminals(airport.iataMatch.terminals)
11110
+ };
11111
+ }
11112
+ });
11113
+ // add Travellers
11114
+ if (basketItem.users) {
11115
+ basketItem.users.forEach((user) => {
11116
+ this.searchService.addTraveller(user);
11117
+ });
11118
+ }
11119
+ }
10627
11120
  updateFromPreviousSearches(previousItems) {
10628
11121
  var _a;
10629
11122
  console.log('PREPOPULATING PARKING FORM');
@@ -10656,7 +11149,7 @@ class ParkingEnterpriseSearch extends BaseEnterpriseSearch {
10656
11149
  const basket = intBasket === null || intBasket === void 0 ? void 0 : intBasket.subject.value;
10657
11150
  const termsAndConditions = this.getTermsAndCond(parkingQuote);
10658
11151
  if (basket) {
10659
- return this.basketService.addToBasket({
11152
+ const whatHappened = yield this.basketService.addToBasket({
10660
11153
  adults: 1,
10661
11154
  basket: basket.id,
10662
11155
  service: parkingQuote.sourceId.toString(),
@@ -10675,8 +11168,12 @@ class ParkingEnterpriseSearch extends BaseEnterpriseSearch {
10675
11168
  outboundDate: parkingQuery.arrivalDatetime.format(),
10676
11169
  inboundDate: parkingQuery.departDatetime.format()
10677
11170
  }, intBasket, this.searchService, this.travellers, parkingQuote.requiresReason);
11171
+ if (whatHappened === DifferentInvokdedUserReasons.research) {
11172
+ this.performSearch();
11173
+ }
11174
+ return whatHappened;
10678
11175
  }
10679
- return Promise.resolve(false);
11176
+ return DifferentInvokdedUserReasons.cancel;
10680
11177
  });
10681
11178
  }
10682
11179
  getTermsAndCond(parkingQuote) {
@@ -10747,8 +11244,8 @@ class ParkingEnterpriseSearch extends BaseEnterpriseSearch {
10747
11244
  }
10748
11245
  applyFavourite(fav) {
10749
11246
  return __awaiter(this, void 0, void 0, function* () {
10750
- this.searchService.getAirportsList(fav.locationCode).subscribe(a => {
10751
- this.locationCode = a.find(a => a.gateway == fav.locationCode);
11247
+ this.searchService.getAirportsList(fav.locationCode).subscribe((a) => {
11248
+ this.locationCode = a.find((a) => a.gateway == fav.locationCode);
10752
11249
  this.terminal = fav.terminal;
10753
11250
  });
10754
11251
  // this.arrivalDatetime = moment((fav.arrivalDatetime as string).split("T")[0], "YYYY-MM-DD")
@@ -10828,10 +11325,9 @@ var SortMethod;
10828
11325
  })(SortMethod || (SortMethod = {}));
10829
11326
  class EurostarEnterpriseSearch extends BaseEnterpriseSearch {
10830
11327
  constructor(eurostarFetcher, helpers, userService, basketService, storageService, searchService, modalService) {
10831
- super(storageService, helpers);
11328
+ super(storageService, helpers, searchService);
10832
11329
  this.eurostarFetcher = eurostarFetcher;
10833
11330
  this.basketService = basketService;
10834
- this.searchService = searchService;
10835
11331
  this.modalService = modalService;
10836
11332
  this.type = ServiceType.Eurostar;
10837
11333
  this.avaliableClasses = new BehaviorSubject([]);
@@ -11434,7 +11930,7 @@ class EurostarEnterpriseSearch extends BaseEnterpriseSearch {
11434
11930
  }
11435
11931
  // this is stuff for matching cabin classes
11436
11932
  if (!this.checkCabinMatchisValid()) {
11437
- this.validationMessages.push('The types of cabin classes selected are not compatible. Examples of compatible cabin classes; Any - Any, Standard - Standard, Business - Business');
11933
+ this.validationMessages.push('The types of cabin classes selected are not compatible. Examples of compatible cabin classes; Any - Any; Standard - Standard; Business - Business');
11438
11934
  }
11439
11935
  }
11440
11936
  this.isValid.next(this.validationMessages.length === 0);
@@ -11752,6 +12248,73 @@ class EurostarEnterpriseSearch extends BaseEnterpriseSearch {
11752
12248
  };
11753
12249
  return [sortedResults];
11754
12250
  }
12251
+ updateSearchFromExpiredBasketItem(basketItem) {
12252
+ const searchEuroStarQuery = basketItem.searchQuery;
12253
+ if (searchEuroStarQuery.outboundDate) {
12254
+ let outboundTimeWindow = searchEuroStarQuery.outboundDepartureTimeWindow
12255
+ ? searchEuroStarQuery.outboundDepartureTimeWindow
12256
+ : searchEuroStarQuery.outboundArrivalTimeWindow;
12257
+ this.outBoundDate = this.convertRecentSearchDateTime(searchEuroStarQuery.outboundDate, outboundTimeWindow);
12258
+ }
12259
+ if (searchEuroStarQuery.returnDate) {
12260
+ let returnTimeWindow = searchEuroStarQuery.returnDepartureTimeWindow
12261
+ ? searchEuroStarQuery.returnDepartureTimeWindow
12262
+ : searchEuroStarQuery.returnArrivalTimeWindow;
12263
+ this.inboundDate = this.convertRecentSearchDateTime(searchEuroStarQuery.returnDate, returnTimeWindow);
12264
+ }
12265
+ this.fareType = searchEuroStarQuery.fareType;
12266
+ this.maxConnections = searchEuroStarQuery.maxConnections;
12267
+ if (searchEuroStarQuery.outboundCabinClass) {
12268
+ this.cabinClass = searchEuroStarQuery
12269
+ .outboundCabinClass[0];
12270
+ }
12271
+ if (searchEuroStarQuery.returnCabinClass) {
12272
+ this.returnCabinClass = searchEuroStarQuery
12273
+ .returnCabinClass[0];
12274
+ }
12275
+ this.includeNearbyAirports = searchEuroStarQuery.includeNearbyAirports;
12276
+ this.chosenSearchType = searchEuroStarQuery.returnTrip
12277
+ ? EurostarSearchType.return
12278
+ : EurostarSearchType.oneWay;
12279
+ if (searchEuroStarQuery.outboundDepartureTimeWindow) {
12280
+ this.outTimeCriteria = TimeWindow.Depart;
12281
+ }
12282
+ else if (searchEuroStarQuery.outboundArrivalTimeWindow) {
12283
+ this.outTimeCriteria = TimeWindow.Arrive;
12284
+ }
12285
+ else {
12286
+ this.outTimeCriteria = TimeWindow.Anytime;
12287
+ }
12288
+ if (searchEuroStarQuery.returnDepartureTimeWindow) {
12289
+ this.inTimeCriteria = TimeWindow.Depart;
12290
+ }
12291
+ else if (searchEuroStarQuery.returnArrivalTimeWindow) {
12292
+ this.inTimeCriteria = TimeWindow.Arrive;
12293
+ }
12294
+ else {
12295
+ this.inTimeCriteria = TimeWindow.Anytime;
12296
+ }
12297
+ if (searchEuroStarQuery.originAirport) {
12298
+ this.searchService
12299
+ .lookupEurostarStations(searchEuroStarQuery.originAirport)
12300
+ .subscribe((stations) => {
12301
+ this.departLocation = stations[0];
12302
+ });
12303
+ }
12304
+ if (searchEuroStarQuery.destinationAirport) {
12305
+ this.searchService
12306
+ .lookupEurostarStations(searchEuroStarQuery.destinationAirport)
12307
+ .subscribe((stations) => {
12308
+ this.arriveLocation = stations[0];
12309
+ });
12310
+ }
12311
+ // add Travellers
12312
+ if (basketItem.users) {
12313
+ basketItem.users.forEach((user) => {
12314
+ this.searchService.addTraveller(user);
12315
+ });
12316
+ }
12317
+ }
11755
12318
  updateFromPreviousSearches(previousItems) {
11756
12319
  var _a;
11757
12320
  const flightItem = (_a = previousItems[ServiceType.Flight]) === null || _a === void 0 ? void 0 : _a.searchQuery;
@@ -12050,24 +12613,30 @@ class EurostarEnterpriseSearch extends BaseEnterpriseSearch {
12050
12613
  }, { amount: Number.MAX_SAFE_INTEGER, currencyCode: currency });
12051
12614
  }
12052
12615
  doBooking(intBasket, selectedFlight, schemaDetails, outboundDate, inboundDate, price, requiresReason) {
12053
- const { sourceId, co2PerItem, co2PerPassenger, total } = selectedFlight;
12054
- const booking = {
12055
- adults: this.adults,
12056
- basket: intBasket.id,
12057
- children: this.children,
12058
- co2PerItem,
12059
- co2PerPassenger,
12060
- currency: total.currency,
12061
- detail: schemaDetails,
12062
- price,
12063
- searchQuery: this.resultQuery,
12064
- service: sourceId.toString(),
12065
- outboundDate
12066
- };
12067
- if (inboundDate) {
12068
- booking.inboundDate = inboundDate;
12069
- }
12070
- this.basketService.addToBasket(booking, intBasket, this.searchService, this.travellers, requiresReason);
12616
+ return __awaiter(this, void 0, void 0, function* () {
12617
+ const { sourceId, co2PerItem, co2PerPassenger, total } = selectedFlight;
12618
+ const booking = {
12619
+ adults: this.adults,
12620
+ basket: intBasket.id,
12621
+ children: this.children,
12622
+ co2PerItem,
12623
+ co2PerPassenger,
12624
+ currency: total.currency,
12625
+ detail: schemaDetails,
12626
+ price,
12627
+ searchQuery: this.resultQuery,
12628
+ service: sourceId.toString(),
12629
+ outboundDate
12630
+ };
12631
+ if (inboundDate) {
12632
+ booking.inboundDate = inboundDate;
12633
+ }
12634
+ const whatHappened = yield this.basketService.addToBasket(booking, intBasket, this.searchService, this.travellers, requiresReason);
12635
+ if (whatHappened === DifferentInvokdedUserReasons.research) {
12636
+ this.performSearch();
12637
+ }
12638
+ return whatHappened;
12639
+ });
12071
12640
  }
12072
12641
  makeSchemaFlights(selectedFlight, flightGroup, groupIndex, segmentIndex) {
12073
12642
  return Object.assign(Object.assign({}, selectedFlight), { journeyInfo: {
@@ -12144,7 +12713,7 @@ class EurostarEnterpriseSearch extends BaseEnterpriseSearch {
12144
12713
  addEurostarJourneysToBasket(eurostarQuote) {
12145
12714
  return __awaiter(this, void 0, void 0, function* () {
12146
12715
  if (eurostarQuote.unavailable) {
12147
- return Promise.resolve(false);
12716
+ return Promise.resolve(DifferentInvokdedUserReasons.cancel);
12148
12717
  }
12149
12718
  const intBasket = yield this.basketService.getDefaultBasket();
12150
12719
  const basket = intBasket === null || intBasket === void 0 ? void 0 : intBasket.subject.value;
@@ -12182,9 +12751,13 @@ class EurostarEnterpriseSearch extends BaseEnterpriseSearch {
12182
12751
  booking.inboundDate = inboundDate.format();
12183
12752
  schemaDetails.journeyType = 'roundtrip';
12184
12753
  }
12185
- return this.basketService.addToBasket(booking, intBasket, this.searchService, this.travellers, eurostarQuote.requiresReason);
12754
+ const whatHappened = yield this.basketService.addToBasket(booking, intBasket, this.searchService, this.travellers, eurostarQuote.requiresReason);
12755
+ if (whatHappened === DifferentInvokdedUserReasons.research) {
12756
+ this.performSearch();
12757
+ }
12758
+ return whatHappened;
12186
12759
  }
12187
- return Promise.resolve(false); // TODO should this throw an error?
12760
+ return Promise.resolve(DifferentInvokdedUserReasons.cancel);
12188
12761
  });
12189
12762
  }
12190
12763
  // TODO waiting for data
@@ -12337,16 +12910,22 @@ class EurostarEnterpriseSearch extends BaseEnterpriseSearch {
12337
12910
  return __awaiter(this, void 0, void 0, function* () {
12338
12911
  this.fareType = fav.fareType;
12339
12912
  this.includeNearbyAirports = fav.includeNearbyAirports;
12340
- this.chosenSearchType = fav.returnTrip ? EurostarSearchType.return : EurostarSearchType.oneWay;
12341
- this.searchService.getAirportsList(fav.originAirport).subscribe(results => {
12342
- this.departLocation = results.find(a => a.gateway == fav.originAirport);
12913
+ this.chosenSearchType = fav.returnTrip
12914
+ ? EurostarSearchType.return
12915
+ : EurostarSearchType.oneWay;
12916
+ this.searchService
12917
+ .getAirportsList(fav.originAirport)
12918
+ .subscribe((results) => {
12919
+ this.departLocation = results.find((a) => a.gateway == fav.originAirport);
12343
12920
  });
12344
- this.searchService.getAirportsList(fav.destinationAirport).subscribe(results => {
12345
- this.arriveLocation = results.find(a => a.gateway == fav.destinationAirport);
12921
+ this.searchService
12922
+ .getAirportsList(fav.destinationAirport)
12923
+ .subscribe((results) => {
12924
+ this.arriveLocation = results.find((a) => a.gateway == fav.destinationAirport);
12346
12925
  });
12347
12926
  this._passengers = fav.passengers;
12348
- this.adults = fav.passengers.filter((a) => a.type == "ADULT").length;
12349
- this.children = fav.passengers.filter((a) => a.type == "CHILD").length;
12927
+ this.adults = fav.passengers.filter((a) => a.type == 'ADULT').length;
12928
+ this.children = fav.passengers.filter((a) => a.type == 'CHILD').length;
12350
12929
  });
12351
12930
  }
12352
12931
  openEurostarFareRules(basketItem) {
@@ -12428,11 +13007,10 @@ var RailJourneyFareType;
12428
13007
  })(RailJourneyFareType || (RailJourneyFareType = {}));
12429
13008
  class RailEnterpriseSearch extends BaseEnterpriseSearch {
12430
13009
  constructor(Railfetcher, getRailStationFetcher, helpers, basketService, storageService, searchService, userService, modalService) {
12431
- super(storageService, helpers);
13010
+ super(storageService, helpers, searchService);
12432
13011
  this.Railfetcher = Railfetcher;
12433
13012
  this.getRailStationFetcher = getRailStationFetcher;
12434
13013
  this.basketService = basketService;
12435
- this.searchService = searchService;
12436
13014
  this.userService = userService;
12437
13015
  this.modalService = modalService;
12438
13016
  this.resultsSessionName = RailEnterpriseSearch.STORAGE_SESSION_RESULTS;
@@ -12548,6 +13126,7 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
12548
13126
  originalUserSearch: {}
12549
13127
  };
12550
13128
  this.updateTempParams(this.searchService.makeRailQuery(data.tempParams));
13129
+ data.originalUserSearch.transactionIdentifier = null;
12551
13130
  this._originalUserSearch = data.originalUserSearch;
12552
13131
  if (searchService.shouldAddTravellerSubscription()) {
12553
13132
  searchService.travellerInformation.subscribe((travellers) => {
@@ -12592,6 +13171,12 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
12592
13171
  });
12593
13172
  }
12594
13173
  }
13174
+ set transactionIdentifier(id) {
13175
+ this.tempParams.transactionIdentifier = id;
13176
+ }
13177
+ get transactionIdentifier() {
13178
+ return this.tempParams.transactionIdentifier;
13179
+ }
12595
13180
  get bookRailFromLive() {
12596
13181
  return this._bookRailFromLive;
12597
13182
  }
@@ -12809,6 +13394,9 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
12809
13394
  return this.tempParams.applyRailcards;
12810
13395
  }
12811
13396
  set applyRailcards(apCards) {
13397
+ if (!apCards) {
13398
+ this.railCards = [];
13399
+ }
12812
13400
  this.tempParams.applyRailcards = apCards;
12813
13401
  }
12814
13402
  get railCards() {
@@ -12872,6 +13460,7 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
12872
13460
  return null;
12873
13461
  }
12874
13462
  processResults(rawResults) {
13463
+ this.transactionIdentifier = null;
12875
13464
  const setFares = (fare) => {
12876
13465
  var _a;
12877
13466
  return Object.assign(Object.assign({}, fare), { type: (_a = fare === null || fare === void 0 ? void 0 : fare.type) === null || _a === void 0 ? void 0 : _a.toLowerCase(), selected: false, selectable: true });
@@ -13365,7 +13954,7 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
13365
13954
  yield this.addDualSingleToBasket(sourceId, searchQuery, journey, inboundJourney, railFare, inboundRailFare);
13366
13955
  }
13367
13956
  }
13368
- return false;
13957
+ return DifferentInvokdedUserReasons.cancel;
13369
13958
  });
13370
13959
  }
13371
13960
  addOpenReturnToBasket(sourceId, searchQuery, journey, railFare) {
@@ -13470,9 +14059,13 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
13470
14059
  if (outTicketExtras) {
13471
14060
  basketItem.detail.outbound.ticketExtras = outTicketExtras;
13472
14061
  }
13473
- return this.basketService.addToBasket(basketItem, intBasket, this.searchService, this.travellers, outboundFare.requiresReason || inboundFare.requiresReason);
14062
+ const whatHappened = yield this.basketService.addToBasket(basketItem, intBasket, this.searchService, this.travellers, outboundFare.requiresReason || inboundFare.requiresReason);
14063
+ if (whatHappened === DifferentInvokdedUserReasons.research) {
14064
+ this.performSearch();
14065
+ }
14066
+ return whatHappened;
13474
14067
  }
13475
- return Promise.resolve();
14068
+ return DifferentInvokdedUserReasons.continue;
13476
14069
  });
13477
14070
  }
13478
14071
  findCheapestTicket() {
@@ -13531,6 +14124,7 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
13531
14124
  this.results.next([]);
13532
14125
  if (this.isValid.value) {
13533
14126
  const query = this.getSearchQuery(this.tempParams);
14127
+ this.tempParams.transactionIdentifier = null;
13534
14128
  this._originalUserSearch = Object.freeze(this.helpers.clone(this.tempParams));
13535
14129
  this.storageService.setSessionItem(RailEnterpriseSearch.STORAGE_SESSION_PARAMS, {
13536
14130
  tempParams: this.tempParams,
@@ -13651,8 +14245,9 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
13651
14245
  returnDepartureDateTime: this.helpers.formatGraphQLDateTime(tempParams.inBoundDateTime),
13652
14246
  viaLocationId: (_f = (_e = tempParams.viaLocation) === null || _e === void 0 ? void 0 : _e.railstation) === null || _f === void 0 ? void 0 : _f.id,
13653
14247
  railCardQualifiers: (_g = tempParams.railCards) === null || _g === void 0 ? void 0 : _g.map((railCard) => {
13654
- return railCard.code;
13655
- })
14248
+ return railCard === null || railCard === void 0 ? void 0 : railCard.code;
14249
+ }),
14250
+ transactionIdentifier: tempParams.transactionIdentifier
13656
14251
  };
13657
14252
  if (tempParams.noOfChildren === 0) {
13658
14253
  query.children = null;
@@ -13705,6 +14300,87 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
13705
14300
  }
13706
14301
  }
13707
14302
  updateFromPreviousSearches(previousItems) { }
14303
+ updateSearchFromExpiredBasketItem(basketItem) {
14304
+ const searchRailQuery = basketItem.searchQuery;
14305
+ this.chosenSearchType = searchRailQuery.journeyType;
14306
+ this.chosenSearchClass = searchRailQuery.class;
14307
+ this.extraTime = searchRailQuery.extraTimeToChange;
14308
+ // get outBoundDateTime, inBoundDateTime and outboundCriteria ,returnCriteria
14309
+ this.outBoundDateTime = searchRailQuery.outboundDepartureDateTime
14310
+ ? moment(searchRailQuery.outboundDepartureDateTime)
14311
+ : moment(searchRailQuery.outboundArrivalDateTime);
14312
+ this.outboundCriteria = this.getCriteria(searchRailQuery.outboundDepartureDateTime, searchRailQuery.outboundArrivalDateTime);
14313
+ if (searchRailQuery.journeyType === RailSearchJourneyType.ReturnJourney) {
14314
+ this.inBoundDateTime = searchRailQuery.returnDepartureDateTime
14315
+ ? moment(searchRailQuery.returnDepartureDateTime)
14316
+ : moment(searchRailQuery.returnArrivalDateTime);
14317
+ this.returnCriteria = this.getCriteria(searchRailQuery.returnDepartureDateTime, searchRailQuery.returnArrivalDateTime);
14318
+ }
14319
+ if (searchRailQuery.journeyType === RailSearchJourneyType.OpenReturnJourney) {
14320
+ this.openReturn = true;
14321
+ }
14322
+ if (searchRailQuery.departureLocationId) {
14323
+ this.searchService
14324
+ .getRailStationById(searchRailQuery.departureLocationId)
14325
+ .subscribe((departureStation) => {
14326
+ this.travellingFrom = {
14327
+ name: departureStation.name,
14328
+ railstation: {
14329
+ id: departureStation.id,
14330
+ name: departureStation.name,
14331
+ nlcCode: departureStation.nlcCode,
14332
+ stationCode: departureStation.stationCode,
14333
+ trainlineCode: departureStation.trainlineCode,
14334
+ trainlineUniqueCode: departureStation.trainlineUniqueCode
14335
+ }
14336
+ };
14337
+ });
14338
+ }
14339
+ if (searchRailQuery.arrivalLocationId) {
14340
+ this.searchService
14341
+ .getRailStationById(searchRailQuery.arrivalLocationId)
14342
+ .subscribe((arrivalStation) => {
14343
+ this.travellingTo = {
14344
+ name: arrivalStation.name,
14345
+ railstation: {
14346
+ id: arrivalStation.id,
14347
+ name: arrivalStation.name,
14348
+ nlcCode: arrivalStation.nlcCode,
14349
+ stationCode: arrivalStation.stationCode,
14350
+ trainlineCode: arrivalStation.trainlineCode,
14351
+ trainlineUniqueCode: arrivalStation.trainlineUniqueCode
14352
+ }
14353
+ };
14354
+ });
14355
+ }
14356
+ if (searchRailQuery.viaLocationId) {
14357
+ this.via = true;
14358
+ this.searchService
14359
+ .getRailStationById(searchRailQuery.viaLocationId)
14360
+ .subscribe((viaLocation) => {
14361
+ this.viaLocation = {
14362
+ name: viaLocation.name,
14363
+ railstation: {
14364
+ id: viaLocation.id,
14365
+ name: viaLocation.name,
14366
+ nlcCode: viaLocation.nlcCode,
14367
+ stationCode: viaLocation.stationCode,
14368
+ trainlineCode: viaLocation.trainlineCode,
14369
+ trainlineUniqueCode: viaLocation.trainlineUniqueCode
14370
+ }
14371
+ };
14372
+ });
14373
+ }
14374
+ else {
14375
+ this.viaLocation = null;
14376
+ }
14377
+ // add Travellers
14378
+ if (basketItem.users) {
14379
+ basketItem.users.forEach((user) => {
14380
+ this.searchService.addTraveller(user);
14381
+ });
14382
+ }
14383
+ }
13708
14384
  getRailStation(code, isLoading) {
13709
14385
  if (code.length === 3) {
13710
14386
  isLoading === null || isLoading === void 0 ? void 0 : isLoading.next(true);
@@ -13811,9 +14487,13 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
13811
14487
  if (outTicketExtras) {
13812
14488
  basketItem.detail.outbound.ticketExtras = outTicketExtras;
13813
14489
  }
13814
- return this.basketService.addToBasket(basketItem, intBasket, this.searchService, this.travellers, railFare.requiresReason);
14490
+ const whatHappened = yield this.basketService.addToBasket(basketItem, intBasket, this.searchService, this.travellers, railFare.requiresReason);
14491
+ if (whatHappened === DifferentInvokdedUserReasons.research) {
14492
+ this.performSearch();
14493
+ }
14494
+ return whatHappened;
13815
14495
  }
13816
- return Promise.resolve();
14496
+ return DifferentInvokdedUserReasons.cancel;
13817
14497
  });
13818
14498
  }
13819
14499
  addReturnJourneyToBasket(serviceId, tempParams, outbound, inbound, outboundFare, inboundFare) {
@@ -13907,9 +14587,13 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
13907
14587
  if (ticketExtras) {
13908
14588
  basketItem.detail.outbound.ticketExtras = ticketExtras;
13909
14589
  }
13910
- return this.basketService.addToBasket(basketItem, intBasket, this.searchService, this.travellers, outboundFare.requiresReason || inboundFare.requiresReason);
14590
+ const whatHappened = yield this.basketService.addToBasket(basketItem, intBasket, this.searchService, this.travellers, outboundFare.requiresReason || inboundFare.requiresReason);
14591
+ if (whatHappened === DifferentInvokdedUserReasons.research) {
14592
+ this.performSearch();
14593
+ }
14594
+ return whatHappened;
13911
14595
  }
13912
- return Promise.resolve(false);
14596
+ return DifferentInvokdedUserReasons.cancel;
13913
14597
  });
13914
14598
  }
13915
14599
  removedScheduledPlatformFromCallingPoints(railLegs) {
@@ -14000,7 +14684,7 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
14000
14684
  .clone(this.fullResults)
14001
14685
  .reduce((accum, next) => {
14002
14686
  const temp = Object.assign(Object.assign({}, next), { outbound: (next.outbound || []).map((journey) => {
14003
- return Object.assign(Object.assign({}, journey), { dualSingleJourneyFares: this.helpers.map(journey.dualSingleJourneyFares || {}, setRules('dualSingleJourneyFares', journey, RailDirection.Outbound)), returnJourneyFares: this.helpers.map(journey.returnJourneyFares || {}, setRules('returnJourneyFares', journey, RailDirection.Outbound)), openReturnJourneyFares: this.helpers.map(journey.openReturnJourneyFares || {}, setRules('openReturnJourneyFares', journey, RailDirection.Outbound)) });
14687
+ return Object.assign(Object.assign({}, journey), { dualSingleJourneyFares: this.helpers.map(journey.dualSingleJourneyFares || {}, setRules('dualSingleJourneyFares', journey, RailDirection.Outbound)), singleJourneyFares: this.helpers.map(journey.singleJourneyFares || {}, setRules('singleJourneyFares', journey, RailDirection.Outbound)), returnJourneyFares: this.helpers.map(journey.returnJourneyFares || {}, setRules('returnJourneyFares', journey, RailDirection.Outbound)), openReturnJourneyFares: this.helpers.map(journey.openReturnJourneyFares || {}, setRules('openReturnJourneyFares', journey, RailDirection.Outbound)) });
14004
14688
  }), return: (next.return || []).map((journey) => {
14005
14689
  return Object.assign(Object.assign({}, journey), { returnJourneyFares: this.helpers.map(journey.returnJourneyFares || {}, setSelected('returnJourneyFares', journey)), dualSingleJourneyFares: this.helpers.map(journey.dualSingleJourneyFares || {}, setSelected('dualSingleJourneyFares', journey)), singleJourneyFares: this.helpers.map(journey.singleJourneyFares || {}, setRules('singleJourneyFares', journey, 'return')), openReturnJourneyFares: this.helpers.map(journey.openReturnJourneyFares || {}, setRules('openReturnJourneyFares', journey, 'return')) });
14006
14690
  }) });
@@ -14102,24 +14786,30 @@ class RailEnterpriseSearch extends BaseEnterpriseSearch {
14102
14786
  this.noOfChildren = fav.children;
14103
14787
  this.chosenSearchType = fav.journeyType;
14104
14788
  switch (fav.class) {
14105
- case "First":
14789
+ case 'First':
14106
14790
  this.chosenRailClass = RailClass.First;
14107
14791
  break;
14108
- case "Any":
14792
+ case 'Any':
14109
14793
  this.chosenRailClass = RailClass.All;
14110
14794
  break;
14111
- case "Standard":
14795
+ case 'Standard':
14112
14796
  this.chosenRailClass = RailClass.Standard;
14113
14797
  break;
14114
14798
  }
14115
- this.getRailStationFetcher.fetchList({ id: fav.departureLocationId }).subscribe(a => {
14799
+ this.getRailStationFetcher
14800
+ .fetchList({ id: fav.departureLocationId })
14801
+ .subscribe((a) => {
14116
14802
  this.travellingFrom = a;
14117
14803
  });
14118
- this.getRailStationFetcher.fetchList({ id: fav.arrivalLocationId }).subscribe(a => {
14804
+ this.getRailStationFetcher
14805
+ .fetchList({ id: fav.arrivalLocationId })
14806
+ .subscribe((a) => {
14119
14807
  this.travellingTo = a;
14120
14808
  });
14121
14809
  if (fav.viaLocationId) {
14122
- this.getRailStationFetcher.fetchList({ id: fav.viaLocationId }).subscribe(a => {
14810
+ this.getRailStationFetcher
14811
+ .fetchList({ id: fav.viaLocationId })
14812
+ .subscribe((a) => {
14123
14813
  this.viaLocation = a;
14124
14814
  });
14125
14815
  this.via = true;
@@ -14198,11 +14888,10 @@ var ClassType;
14198
14888
  })(ClassType || (ClassType = {}));
14199
14889
  class IRLEnterpriseSearch extends BaseEnterpriseSearch {
14200
14890
  constructor(Irlfetcher, irlDiscountCardsFetcher, helpers, basketService, storageService, searchService, getIrlSupplierStationFetcher) {
14201
- super(storageService, helpers);
14891
+ super(storageService, helpers, searchService);
14202
14892
  this.Irlfetcher = Irlfetcher;
14203
14893
  this.irlDiscountCardsFetcher = irlDiscountCardsFetcher;
14204
14894
  this.basketService = basketService;
14205
- this.searchService = searchService;
14206
14895
  this.getIrlSupplierStationFetcher = getIrlSupplierStationFetcher;
14207
14896
  this.resultsSessionName = IRLEnterpriseSearch.STORAGE_SESSION_RESULTS;
14208
14897
  this.multiResultsSessionName = IRLEnterpriseSearch.STORAGE_SESSION_RESULTS;
@@ -14749,6 +15438,56 @@ class IRLEnterpriseSearch extends BaseEnterpriseSearch {
14749
15438
  }
14750
15439
  return this.helpers.removeNulls(query);
14751
15440
  }
15441
+ updateSearchFromExpiredBasketItem(basketItem) {
15442
+ const searchIrlQuery = basketItem.searchQuery;
15443
+ this.journeyType = searchIrlQuery.journeyType;
15444
+ this.irlClass = searchIrlQuery.class;
15445
+ // get outBoundDateTime, inBoundDateTime
15446
+ this.outBoundDateTime = moment(searchIrlQuery.outboundDepartureDateTime);
15447
+ if (searchIrlQuery.journeyType === IrlJourneyType.ReturnJourney) {
15448
+ this.inBoundDateTime = moment(searchIrlQuery.returnDepartureDateTime);
15449
+ }
15450
+ if (searchIrlQuery.departureLocationId) {
15451
+ this.searchService
15452
+ .getRailStationById(searchIrlQuery.departureLocationId)
15453
+ .subscribe((departureStation) => {
15454
+ this.travellingFrom = {
15455
+ name: departureStation.name,
15456
+ railstation: {
15457
+ id: departureStation.id,
15458
+ name: departureStation.name,
15459
+ nlcCode: departureStation.nlcCode,
15460
+ stationCode: departureStation.stationCode,
15461
+ trainlineCode: departureStation.trainlineCode,
15462
+ trainlineUniqueCode: departureStation.trainlineUniqueCode
15463
+ }
15464
+ };
15465
+ });
15466
+ }
15467
+ if (searchIrlQuery.arrivalLocationId) {
15468
+ this.searchService
15469
+ .getRailStationById(searchIrlQuery.arrivalLocationId)
15470
+ .subscribe((arrivalStation) => {
15471
+ this.travellingTo = {
15472
+ name: arrivalStation.name,
15473
+ railstation: {
15474
+ id: arrivalStation.id,
15475
+ name: arrivalStation.name,
15476
+ nlcCode: arrivalStation.nlcCode,
15477
+ stationCode: arrivalStation.stationCode,
15478
+ trainlineCode: arrivalStation.trainlineCode,
15479
+ trainlineUniqueCode: arrivalStation.trainlineUniqueCode
15480
+ }
15481
+ };
15482
+ });
15483
+ }
15484
+ // add Travellers
15485
+ if (basketItem.users) {
15486
+ basketItem.users.forEach((user) => {
15487
+ this.searchService.addTraveller(user);
15488
+ });
15489
+ }
15490
+ }
14752
15491
  updateFromPreviousSearches(previousItems) { }
14753
15492
  updateCanCombine(tkt) {
14754
15493
  (tkt.identifiers.allowedWith || []).forEach((allowed) => {
@@ -14834,16 +15573,22 @@ class IRLEnterpriseSearch extends BaseEnterpriseSearch {
14834
15573
  // co2PerPassenger: irlJourneyOption.co2PerPassenger,
14835
15574
  outboundDate: irlJourneyOption.departDateTime
14836
15575
  };
14837
- return this.basketService.addToBasket(basketItem, intBasket, this.searchService, this.travellers, false // TODO
15576
+ const whatHappened = yield this.basketService.addToBasket(basketItem, intBasket, this.searchService, this.travellers, false // TODO
14838
15577
  );
15578
+ if (whatHappened === DifferentInvokdedUserReasons.research) {
15579
+ this.performSearch();
15580
+ }
15581
+ return whatHappened;
14839
15582
  }
14840
- return Promise.resolve(false);
15583
+ return DifferentInvokdedUserReasons.cancel;
14841
15584
  });
14842
15585
  }
14843
15586
  addReturnJourneyToBasket(serviceId, irlQuery, inbound, inJourneyOption, outboundTicket, outboundJourney) {
14844
15587
  return __awaiter(this, void 0, void 0, function* () {
14845
15588
  const outbound = outboundTicket ? outboundTicket : this.outboundTicket;
14846
- const outJourneyOption = outboundJourney ? outboundJourney : this.outboundJourneyOptions;
15589
+ const outJourneyOption = outboundJourney
15590
+ ? outboundJourney
15591
+ : this.outboundJourneyOptions;
14847
15592
  const intBasket = yield this.basketService.getDefaultBasket();
14848
15593
  const basket = intBasket === null || intBasket === void 0 ? void 0 : intBasket.subject.value;
14849
15594
  if (basket) {
@@ -14905,11 +15650,14 @@ class IRLEnterpriseSearch extends BaseEnterpriseSearch {
14905
15650
  // co2PerPassenger: outbound.co2PerPassenger
14906
15651
  };
14907
15652
  this.filterSelected();
14908
- console.log(basketItem);
14909
- return this.basketService.addToBasket(basketItem, intBasket, this.searchService, this.travellers, false // TODO
15653
+ const whatHappened = yield this.basketService.addToBasket(basketItem, intBasket, this.searchService, this.travellers, false // TODO
14910
15654
  );
15655
+ if (whatHappened === DifferentInvokdedUserReasons.research) {
15656
+ this.performSearch();
15657
+ }
15658
+ return whatHappened;
14911
15659
  }
14912
- return Promise.resolve(false);
15660
+ return DifferentInvokdedUserReasons.cancel;
14913
15661
  });
14914
15662
  }
14915
15663
  updateLowestPrice(results) {
@@ -15082,8 +15830,8 @@ class IRLEnterpriseSearch extends BaseEnterpriseSearch {
15082
15830
  let dateArrMax = null;
15083
15831
  let classObject = {};
15084
15832
  let changesObject = {};
15085
- results.forEach(result => {
15086
- result.providers[0].ticketOptions.forEach(ticket => {
15833
+ results.forEach((result) => {
15834
+ result.providers[0].ticketOptions.forEach((ticket) => {
15087
15835
  if (!priceMax || priceMax < ticket.price) {
15088
15836
  priceMax = Math.ceil(ticket.price);
15089
15837
  }
@@ -15091,16 +15839,20 @@ class IRLEnterpriseSearch extends BaseEnterpriseSearch {
15091
15839
  if (!priceMin || priceMin > result.providers[0].cheapestTicket.price) {
15092
15840
  priceMin = Math.floor(result.providers[0].cheapestTicket.price);
15093
15841
  }
15094
- if (!dateDepMin || moment(result.departDateTime).isBefore(moment(dateDepMin))) {
15842
+ if (!dateDepMin ||
15843
+ moment(result.departDateTime).isBefore(moment(dateDepMin))) {
15095
15844
  dateDepMin = Number(moment(result.departDateTime).format('HHmm'));
15096
15845
  }
15097
- if (!dateDepMax || moment(result.departDateTime).isAfter(moment(dateDepMax))) {
15846
+ if (!dateDepMax ||
15847
+ moment(result.departDateTime).isAfter(moment(dateDepMax))) {
15098
15848
  dateDepMax = Number(moment(result.departDateTime).format('HHmm'));
15099
15849
  }
15100
- if (!dateArrMin || moment(result.arriveDateTime).isBefore(moment(dateArrMin))) {
15850
+ if (!dateArrMin ||
15851
+ moment(result.arriveDateTime).isBefore(moment(dateArrMin))) {
15101
15852
  dateArrMin = Number(moment(result.arriveDateTime).format('HHmm'));
15102
15853
  }
15103
- if (!dateArrMax || moment(result.arriveDateTime).isAfter(moment(dateArrMax))) {
15854
+ if (!dateArrMax ||
15855
+ moment(result.arriveDateTime).isAfter(moment(dateArrMax))) {
15104
15856
  dateArrMax = Number(moment(result.arriveDateTime).format('HHmm'));
15105
15857
  }
15106
15858
  changesObject[result.segments.length - 1] = {
@@ -15108,7 +15860,7 @@ class IRLEnterpriseSearch extends BaseEnterpriseSearch {
15108
15860
  title: `${result.segments.length - 1} changes`,
15109
15861
  selected: false
15110
15862
  };
15111
- result.providers[0].ticketOptions.forEach(ticket => {
15863
+ result.providers[0].ticketOptions.forEach((ticket) => {
15112
15864
  if (ticket.class === '1') {
15113
15865
  classObject['First'] = {
15114
15866
  key: ClassType.Class_1,
@@ -15150,35 +15902,35 @@ class IRLEnterpriseSearch extends BaseEnterpriseSearch {
15150
15902
  break;
15151
15903
  }
15152
15904
  // now first of all - apply the price filters
15153
- dirResults = dirResults.filter(result => {
15154
- const tickets = result.providers[0].ticketOptions.filter(ticket => {
15155
- return ticket.price >= filters.priceMin && ticket.price <= filters.priceMax;
15905
+ dirResults = dirResults.filter((result) => {
15906
+ const tickets = result.providers[0].ticketOptions.filter((ticket) => {
15907
+ return (ticket.price >= filters.priceMin && ticket.price <= filters.priceMax);
15156
15908
  });
15157
15909
  result.providers[0].ticketOptions = tickets;
15158
15910
  return tickets.length;
15159
15911
  });
15160
15912
  // times
15161
15913
  // dep
15162
- dirResults = dirResults.filter(result => {
15914
+ dirResults = dirResults.filter((result) => {
15163
15915
  const depTime = Number(moment(result.departDateTime).format('HHmm'));
15164
15916
  return depTime >= filters.dateDepMin && depTime <= filters.dateDepMax;
15165
15917
  });
15166
15918
  // arr
15167
- dirResults = dirResults.filter(result => {
15919
+ dirResults = dirResults.filter((result) => {
15168
15920
  const arrTime = Number(moment(result.arriveDateTime).format('HHmm'));
15169
15921
  return arrTime >= filters.dateArrMin && arrTime <= filters.dateArrMax;
15170
15922
  });
15171
15923
  // classes
15172
15924
  // first of all determine if any are selected
15173
- const selectedClasses = filters.classes.filter(classF => {
15925
+ const selectedClasses = filters.classes.filter((classF) => {
15174
15926
  return classF.selected;
15175
15927
  });
15176
15928
  if (selectedClasses === null || selectedClasses === void 0 ? void 0 : selectedClasses.length) {
15177
- dirResults = dirResults.filter(result => {
15929
+ dirResults = dirResults.filter((result) => {
15178
15930
  const newTickets = [];
15179
15931
  console.log('og tickets:', result.providers[0].ticketOptions);
15180
- result.providers[0].ticketOptions.forEach(ticket => {
15181
- selectedClasses.forEach(classS => {
15932
+ result.providers[0].ticketOptions.forEach((ticket) => {
15933
+ selectedClasses.forEach((classS) => {
15182
15934
  if (ticket.class === classS.key) {
15183
15935
  newTickets.push(ticket);
15184
15936
  }
@@ -15191,11 +15943,11 @@ class IRLEnterpriseSearch extends BaseEnterpriseSearch {
15191
15943
  }
15192
15944
  console.log(dirResults);
15193
15945
  // finally stops
15194
- const selectedStops = filters.changes.filter(change => {
15946
+ const selectedStops = filters.changes.filter((change) => {
15195
15947
  return change.selected;
15196
15948
  });
15197
15949
  if (selectedStops.length) {
15198
- dirResults = dirResults.filter(result => {
15950
+ dirResults = dirResults.filter((result) => {
15199
15951
  for (let i = 0; i < selectedStops.length; i++) {
15200
15952
  if (result.segments.length - 1 === selectedStops[i].key) {
15201
15953
  return result;
@@ -15215,17 +15967,24 @@ class IRLEnterpriseSearch extends BaseEnterpriseSearch {
15215
15967
  }
15216
15968
  applyFavourite(fav) {
15217
15969
  return __awaiter(this, void 0, void 0, function* () {
15218
- this.getIrlSupplierStationFetcher.fetchList({ id: fav.departureLocationId }).subscribe(a => {
15970
+ this.getIrlSupplierStationFetcher
15971
+ .fetchList({ id: fav.departureLocationId })
15972
+ .subscribe((a) => {
15219
15973
  this.travellingFrom = a;
15220
15974
  });
15221
- this.getIrlSupplierStationFetcher.fetchList({ id: fav.arrivalLocationId }).subscribe(a => {
15975
+ this.getIrlSupplierStationFetcher
15976
+ .fetchList({ id: fav.arrivalLocationId })
15977
+ .subscribe((a) => {
15222
15978
  this.travellingTo = a;
15223
15979
  });
15224
15980
  this.adults = fav.adults;
15225
15981
  this.children = fav.children;
15226
15982
  this.class = fav.class;
15227
15983
  this.countryCode = fav.countryCode;
15228
- this.journeyType = fav.journeyType === "ReturnJourney" ? IrlJourneyType.ReturnJourney : IrlJourneyType.SingleJourney;
15984
+ this.journeyType =
15985
+ fav.journeyType === 'ReturnJourney'
15986
+ ? IrlJourneyType.ReturnJourney
15987
+ : IrlJourneyType.SingleJourney;
15229
15988
  this.supplier = fav.supplier;
15230
15989
  });
15231
15990
  }
@@ -15345,7 +16104,7 @@ class UserInfoImpl {
15345
16104
  this.userInfo.phoneNumber = new PhoneNumberImpl(this.helpers);
15346
16105
  this.userInfo.supplementaryInfo =
15347
16106
  this.perPassengerSupplementaryBookingInfoSchema;
15348
- if (this.user.id) {
16107
+ if (this.user.id && this.user.__typename === 'User') {
15349
16108
  this.getUserFetcher
15350
16109
  .fetchOne({ id: this.user.id })
15351
16110
  .pipe(take(1))
@@ -15364,6 +16123,7 @@ class SupplementaryBookingInfoImpl {
15364
16123
  this.basketItem = basketItem;
15365
16124
  this.helpers = helpers;
15366
16125
  this.hasDetails = false;
16126
+ this.noCovertSelectSchemas = [SchemaFormat.railSeating, SchemaFormat.passport, SchemaFormat.selectQueue];
15367
16127
  this.basketItem.perPassengerSupplementaryBookingInfoSchema =
15368
16128
  basketItem.perPassengerSupplementaryBookingInfoSchema
15369
16129
  ? this.processSchema(this.basketItem.perPassengerSupplementaryBookingInfoSchema)
@@ -15371,6 +16131,9 @@ class SupplementaryBookingInfoImpl {
15371
16131
  this.userInfo = this.basketItem.users.map((user) => {
15372
16132
  return new UserInfoImpl(user, getUserFetcher, helpers, this.basketItem.perPassengerPhoneNumber, this.basketItem.perPassengerAddress, this.basketItem.perPassengerSupplementaryBookingInfoSchema);
15373
16133
  });
16134
+ this.guestInfo = this.basketItem.guests.map((guest) => {
16135
+ return new UserInfoImpl(guest, getUserFetcher, helpers, this.basketItem.perPassengerPhoneNumber, this.basketItem.perPassengerAddress, this.basketItem.perPassengerSupplementaryBookingInfoSchema);
16136
+ });
15374
16137
  this.address = new AddressImpl(this.helpers);
15375
16138
  this.phoneNumber = new PhoneNumberImpl(this.helpers);
15376
16139
  this.basketItem.perItemSupplementaryBookingInfoSchema = this.basketItem
@@ -15417,7 +16180,7 @@ class SupplementaryBookingInfoImpl {
15417
16180
  item.format ||
15418
16181
  this.schemaWidgetToFormat(item.widget) ||
15419
16182
  this.schemaTypeToFormat(item.type);
15420
- if (item.oneOf && item.oneOf.length > 0 && item.format !== 'railSeating' && item.format !== SchemaFormat.selectQueue) {
16183
+ if (item.oneOf && item.oneOf.length > 0 && !this.noCovertSelectSchemas.includes(item.format)) {
15421
16184
  item.format = SchemaFormat.select;
15422
16185
  }
15423
16186
  });
@@ -15463,7 +16226,8 @@ class SupplementaryBookingInfoImpl {
15463
16226
  basketItem: this.basketItem.id,
15464
16227
  userInfo: [],
15465
16228
  supplementaryInfo: {},
15466
- paymentMethodDetails: {}
16229
+ paymentMethodDetails: {},
16230
+ guestInfo: []
15467
16231
  };
15468
16232
  if (values.perItemAddress !== undefined) {
15469
16233
  newValue.address = this.helpers.toStrings(values.perItemAddress, AddressSchema);
@@ -15475,6 +16239,7 @@ class SupplementaryBookingInfoImpl {
15475
16239
  newValue.supplementaryInfo = this.helpers.toStrings(values.perItemSupplementarySchema, this.perItemSupplementarySchema);
15476
16240
  }
15477
16241
  newValue.userInfo = this.userInfo.map((userInfo, index) => {
16242
+ var _a, _b;
15478
16243
  const userValue = { id: userInfo.id, supplementaryInfo: {} };
15479
16244
  const thisUserSupplemental = values['user_' + index] || {};
15480
16245
  if (thisUserSupplemental.perPassengerAddress !== undefined) {
@@ -15487,6 +16252,38 @@ class SupplementaryBookingInfoImpl {
15487
16252
  undefined) {
15488
16253
  userValue.supplementaryInfo = this.helpers.toStrings(thisUserSupplemental.perPassengerSupplementaryBookingInfoSchema, this.perPassengerSupplementaryBookingInfoSchema);
15489
16254
  }
16255
+ if (userValue.supplementaryInfo.passport) {
16256
+ if ((_a = userValue.supplementaryInfo.passport.dateOfExpiry) === null || _a === void 0 ? void 0 : _a.year) {
16257
+ userValue.supplementaryInfo.passport.dateOfExpiry = this.helpers.formatIsoDate(this.helpers.ngDateToMoment(userValue.supplementaryInfo.passport.dateOfExpiry));
16258
+ }
16259
+ if ((_b = userValue.supplementaryInfo.passport.dateOfIssue) === null || _b === void 0 ? void 0 : _b.year) {
16260
+ userValue.supplementaryInfo.passport.dateOfIssue = this.helpers.formatIsoDate(this.helpers.ngDateToMoment(userValue.supplementaryInfo.passport.dateOfIssue));
16261
+ }
16262
+ }
16263
+ return userValue;
16264
+ });
16265
+ newValue.guestInfo = this.guestInfo.map((guestInfo, index) => {
16266
+ var _a, _b;
16267
+ const userValue = { id: guestInfo.id, supplementaryInfo: {} };
16268
+ const thisUserSupplemental = values['guest_' + index] || {};
16269
+ if (thisUserSupplemental.perPassengerAddress !== undefined) {
16270
+ userValue.address = this.helpers.toStrings(thisUserSupplemental.perPassengerAddress, AddressSchema);
16271
+ }
16272
+ if (thisUserSupplemental.perPassengerPhoneNumber !== undefined) {
16273
+ userValue.phoneNumber = this.helpers.toStrings(thisUserSupplemental.perPassengerPhoneNumber, PhoneNumberSchema);
16274
+ }
16275
+ if (thisUserSupplemental.perPassengerSupplementaryBookingInfoSchema !==
16276
+ undefined) {
16277
+ userValue.supplementaryInfo = this.helpers.toStrings(thisUserSupplemental.perPassengerSupplementaryBookingInfoSchema, this.perPassengerSupplementaryBookingInfoSchema);
16278
+ }
16279
+ if (userValue.supplementaryInfo.passport) {
16280
+ if ((_a = userValue.supplementaryInfo.passport.dateOfExpiry) === null || _a === void 0 ? void 0 : _a.year) {
16281
+ userValue.supplementaryInfo.passport.dateOfExpiry = this.helpers.formatIsoDate(this.helpers.ngDateToMoment(userValue.supplementaryInfo.passport.dateOfExpiry));
16282
+ }
16283
+ if ((_b = userValue.supplementaryInfo.passport.dateOfIssue) === null || _b === void 0 ? void 0 : _b.year) {
16284
+ userValue.supplementaryInfo.passport.dateOfIssue = this.helpers.formatIsoDate(this.helpers.ngDateToMoment(userValue.supplementaryInfo.passport.dateOfIssue));
16285
+ }
16286
+ }
15490
16287
  return userValue;
15491
16288
  });
15492
16289
  return newValue;
@@ -16041,6 +16838,26 @@ class BaseGetConfermaRoomImagesFetcher extends FetchableList {
16041
16838
  }
16042
16839
  }
16043
16840
 
16841
+ class BaseGetCompaniesFetcher extends FetchableList {
16842
+ constructor(getCompaniesGQL, helpers, modalService) {
16843
+ super(getCompaniesGQL, helpers, modalService);
16844
+ }
16845
+ getDataFromResult(results) {
16846
+ var _a;
16847
+ return (_a = results === null || results === void 0 ? void 0 : results.data) === null || _a === void 0 ? void 0 : _a.getCompanies;
16848
+ }
16849
+ }
16850
+
16851
+ class BaseGetCompanyFetcher extends FetchableObject {
16852
+ constructor(getCompanyGQL, helpers, modalService) {
16853
+ super(getCompanyGQL, modalService, helpers);
16854
+ }
16855
+ getDataFromResult(results) {
16856
+ var _a;
16857
+ return (_a = results === null || results === void 0 ? void 0 : results.data) === null || _a === void 0 ? void 0 : _a.getCompany;
16858
+ }
16859
+ }
16860
+
16044
16861
  class BaseEmailBasketFetcher extends FetchableList {
16045
16862
  constructor(gql, helpers, modalService) {
16046
16863
  super(gql, helpers, modalService);
@@ -16120,6 +16937,16 @@ class BaseGetCancellationInfoFetcher extends FetchableObject {
16120
16937
  }
16121
16938
  }
16122
16939
 
16940
+ class BaseGetUserGuestsFetcher extends FetchableList {
16941
+ constructor(queryGQL, helpers, modalService) {
16942
+ super(queryGQL, helpers, modalService);
16943
+ }
16944
+ getDataFromResult(results) {
16945
+ var _a;
16946
+ return (_a = results.data) === null || _a === void 0 ? void 0 : _a.getUserGuests;
16947
+ }
16948
+ }
16949
+
16123
16950
  // | 'fareTypes';
16124
16951
 
16125
16952
  ;
@@ -16235,20 +17062,24 @@ class BaseRequiresReasonService {
16235
17062
  };
16236
17063
  const results = yield this.modalService.open(ModalTypes.RequiresReasonDialogComponent, { backdrop: 'static' }, this.workingOn);
16237
17064
  if (results) {
16238
- this.workingOn.basket.basketItems.forEach((bi) => {
16239
- (bi.managementInfo || []).forEach((mi) => {
17065
+ yield Promise.all(this.workingOn.basket.basketItems.map((bi) => {
17066
+ return Promise.all((bi.managementInfo || []).map((mi) => {
16240
17067
  if (results[mi.id]) {
16241
- this.basketService.setMiSelectedValue(this.workingOn.basket.id, mi, results[mi.id], null);
17068
+ return this.basketService.setMiSelectedValue(this.workingOn.basket.id, mi, results[mi.id], null);
16242
17069
  }
16243
- });
16244
- });
17070
+ else {
17071
+ return Promise.resolve();
17072
+ }
17073
+ }));
17074
+ }));
17075
+ this.workingOn = null;
16245
17076
  }
16246
17077
  else {
16247
- Object.entries(this.workingOn.required).forEach(([biId, mis]) => {
16248
- this.basketService.removeBasketItem(this.workingOn.basket.id, this.workingOn.basket.basketItems.find((bi) => bi.id === biId));
16249
- });
17078
+ yield Promise.all(Object.entries(this.workingOn.required).map(([biId, mis]) => {
17079
+ return this.basketService.removeBasketItem(this.workingOn.basket.id, this.workingOn.basket.basketItems.find((bi) => bi.id === biId));
17080
+ }));
17081
+ this.workingOn = null;
16250
17082
  }
16251
- this.workingOn = null;
16252
17083
  }
16253
17084
  });
16254
17085
  }
@@ -16298,7 +17129,7 @@ class InternalBasket {
16298
17129
  this.id = basket.id;
16299
17130
  this.title = basket.title;
16300
17131
  const toSend = Object.assign(Object.assign({}, basket), (basket.basketItems || []).reduce((accum, item, index) => {
16301
- var _a, _b;
17132
+ var _a, _b, _c;
16302
17133
  if (!accum.prices[item.currency]) {
16303
17134
  accum.prices[item.currency] = 0;
16304
17135
  }
@@ -16312,7 +17143,8 @@ class InternalBasket {
16312
17143
  value: item.miGroupSelected || ''
16313
17144
  });
16314
17145
  }
16315
- if (((_a = item.managementInfo) === null || _a === void 0 ? void 0 : _a.length) > 0 && ((_b = item.users) === null || _b === void 0 ? void 0 : _b.length) > 0) {
17146
+ if (((_a = item.managementInfo) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
17147
+ (((_b = item.users) === null || _b === void 0 ? void 0 : _b.length) > 0 || ((_c = item.guests) === null || _c === void 0 ? void 0 : _c.length))) {
16316
17148
  accum.basketInfoMiDetails.push(new BasketInfoMiDetailsImpl(item, this.basketService, this.helpers));
16317
17149
  }
16318
17150
  return accum;
@@ -16330,7 +17162,7 @@ class InternalBasket {
16330
17162
  }
16331
17163
  }
16332
17164
  class BaseEnterpriseBasketService {
16333
- constructor(acceptNewPriceUpdater, addItemToBasketUpdater, addUserToBasketItem, basketCreator, basketFetcher, bookBasketUpdater, deleteBasketUpdater, getMiAutoSugestionFetcher, helpers, removeItemFromBasketUpdater, revalidateBasketUpdater, setBasketItemMiGroupUpdater, setBasketItemMiValueUpdater, validateMiFreeValue, sendBasketForApprovalUpdater, getUserFetcher, getUserBasketsFetcher, SetBasketItemLeadPassenger, moveItemToADifferentBasket, updateBasketNotesUpdater, updateBasketTitleUpdater, setPaymentMethodUpdater, getCancellationInfoFetcher, userService, modalService) {
17165
+ constructor(acceptNewPriceUpdater, addItemToBasketUpdater, addUserToBasketItem, basketCreator, basketFetcher, bookBasketUpdater, deleteBasketUpdater, getMiAutoSugestionFetcher, helpers, removeItemFromBasketUpdater, revalidateBasketUpdater, setBasketItemMiGroupUpdater, setBasketItemMiValueUpdater, validateMiFreeValue, sendBasketForApprovalUpdater, getUserFetcher, getUserBasketsFetcher, SetBasketItemLeadPassenger, moveItemToADifferentBasket, updateBasketNotesUpdater, updateBasketTitleUpdater, setPaymentMethodUpdater, getCancellationInfoFetcher, userService, modalService, webTokenService) {
16334
17166
  this.acceptNewPriceUpdater = acceptNewPriceUpdater;
16335
17167
  this.addItemToBasketUpdater = addItemToBasketUpdater;
16336
17168
  this.addUserToBasketItem = addUserToBasketItem;
@@ -16356,6 +17188,7 @@ class BaseEnterpriseBasketService {
16356
17188
  this.getCancellationInfoFetcher = getCancellationInfoFetcher;
16357
17189
  this.userService = userService;
16358
17190
  this.modalService = modalService;
17191
+ this.webTokenService = webTokenService;
16359
17192
  this.currentBaskets = [];
16360
17193
  this.highlightBasketItemsEmitter = new Subject();
16361
17194
  this.basketChangeEmitter = new BehaviorSubject('');
@@ -16417,7 +17250,10 @@ class BaseEnterpriseBasketService {
16417
17250
  price: 0
16418
17251
  }
16419
17252
  ];
16420
- this.basketPrices = new BehaviorSubject({ total: null, list: this.basketList });
17253
+ this.basketPrices = new BehaviorSubject({
17254
+ total: null,
17255
+ list: this.basketList
17256
+ });
16421
17257
  this.menuState = MenuSlideEnum.OUT;
16422
17258
  this.requiresService = new BaseRequiresReasonService(modalService, this);
16423
17259
  this.userService.changeUser.subscribe({
@@ -16466,7 +17302,6 @@ class BaseEnterpriseBasketService {
16466
17302
  else {
16467
17303
  this.currentBasketID = null;
16468
17304
  }
16469
- this.basketChangeEmitter.next(this.currentBasketID);
16470
17305
  }, (error) => {
16471
17306
  console.error(error);
16472
17307
  });
@@ -16476,7 +17311,6 @@ class BaseEnterpriseBasketService {
16476
17311
  this.currentBaskets = [];
16477
17312
  this.currentBasketID = null;
16478
17313
  this.baskets.next(this.currentBaskets);
16479
- this.basketChangeEmitter.next(this.currentBasketID);
16480
17314
  }
16481
17315
  }
16482
17316
  getAllOpenBaskets(user_id) {
@@ -16499,10 +17333,28 @@ class BaseEnterpriseBasketService {
16499
17333
  }
16500
17334
  addToBasket(item, intBasket, searchService, travellers = [], requiresReason) {
16501
17335
  return __awaiter(this, void 0, void 0, function* () {
17336
+ switch (yield this.checkBasketForInvoked(intBasket, this.webTokenService.bobo)) {
17337
+ case DifferentInvokdedUserReasons.continue:
17338
+ break;
17339
+ case DifferentInvokdedUserReasons.cancel:
17340
+ return DifferentInvokdedUserReasons.cancel;
17341
+ case DifferentInvokdedUserReasons.newBasket:
17342
+ intBasket = yield this.createBasket();
17343
+ this.currentBasketID = intBasket.id;
17344
+ break;
17345
+ case DifferentInvokdedUserReasons.research:
17346
+ this.webTokenService.bobo = intBasket.subject.value.invokedUser;
17347
+ return DifferentInvokdedUserReasons.research;
17348
+ }
17349
+ item.basket = intBasket.id;
16502
17350
  item.convertCurrencyTo = 'GBP';
16503
17351
  if ((travellers === null || travellers === void 0 ? void 0 : travellers.length) > 0) {
16504
- item.users = this.helpers.makeUsers(travellers);
16505
- item.leadPassenger = item.users[0].id;
17352
+ item.users = this.helpers.makeUsers(travellers.filter((trav) => !trav.guest));
17353
+ item.guests = this.helpers.makeUsers(travellers.filter((trav) => trav.guest));
17354
+ item.leadPassenger = travellers[0].id;
17355
+ item.leadPassengerType = travellers[0].guest
17356
+ ? LeadPassengerType.Guest
17357
+ : LeadPassengerType.User;
16506
17358
  }
16507
17359
  item.outboundDate = item.outboundDate
16508
17360
  ? new Date(this.helpers.formatIsoDateTime(item.outboundDate))
@@ -16512,6 +17364,7 @@ class BaseEnterpriseBasketService {
16512
17364
  : item.inboundDate;
16513
17365
  item.requiresReason = requiresReason;
16514
17366
  item = this.checkDetails(item);
17367
+ this.removeBookedBasket();
16515
17368
  if (item && intBasket) {
16516
17369
  this.addItemToBasketUpdater
16517
17370
  .updateOne(item)
@@ -16523,15 +17376,24 @@ class BaseEnterpriseBasketService {
16523
17376
  searchService.search_objects[service].chosen = false;
16524
17377
  const bi = newBasket.basketItems;
16525
17378
  this.highlightBasketItemsEmitter.next(bi);
16526
- this.basketChangeEmitter.next(this.currentBasketID);
16527
17379
  }, (error) => {
16528
17380
  console.error(error);
16529
17381
  intBasket.subject.next(intBasket.subject.value);
16530
17382
  });
16531
17383
  }
16532
- return false;
17384
+ return DifferentInvokdedUserReasons.continue;
16533
17385
  });
16534
17386
  }
17387
+ checkBasketForInvoked(intBasket, bobo) {
17388
+ var _a;
17389
+ if (((_a = intBasket.subject.value.invokedUser) === null || _a === void 0 ? void 0 : _a.id) !== (bobo === null || bobo === void 0 ? void 0 : bobo.id)) {
17390
+ return this.modalService.open(ModalTypes.DifferentInvokdedUserComponent, {}, {
17391
+ basketBobo: intBasket.subject.value.invokedUser,
17392
+ currentBobo: bobo
17393
+ });
17394
+ }
17395
+ return Promise.resolve(DifferentInvokdedUserReasons.continue);
17396
+ }
16535
17397
  loadBasket(id) {
16536
17398
  let intBasket = this.findBasket(id);
16537
17399
  if (!intBasket) {
@@ -16676,9 +17538,12 @@ class BaseEnterpriseBasketService {
16676
17538
  });
16677
17539
  }
16678
17540
  createBasketOnDB(intBasket) {
17541
+ var _a, _b;
17542
+ const mutation = ((_a = this.webTokenService.bobo) === null || _a === void 0 ? void 0 : _a.id) ? { invokedUser: (_b = this.webTokenService.bobo) === null || _b === void 0 ? void 0 : _b.id }
17543
+ : {};
16679
17544
  return new Promise((resolve, reject) => {
16680
17545
  this.basketCreator
16681
- .updateOne({})
17546
+ .updateOne(mutation)
16682
17547
  .pipe(take(1))
16683
17548
  .subscribe((basket) => {
16684
17549
  intBasket.id = basket.id;
@@ -16768,7 +17633,6 @@ class BaseEnterpriseBasketService {
16768
17633
  this.baskets.next(this.currentBaskets);
16769
17634
  if (basketid === this.currentBasketID) {
16770
17635
  this.currentBasketID = ((_b = this.currentBaskets[0]) === null || _b === void 0 ? void 0 : _b.id) || null;
16771
- this.basketChangeEmitter.next(this.currentBasketID);
16772
17636
  }
16773
17637
  return of(data);
16774
17638
  }));
@@ -16820,14 +17684,15 @@ class BaseEnterpriseBasketService {
16820
17684
  });
16821
17685
  }
16822
17686
  }
16823
- setLeadPassenger(basketid, basketItem, travellers, index = 0) {
17687
+ setLeadPassenger(basketid, basketItem, travellers, index = 0, leadPassengerType = LeadPassengerType.User) {
16824
17688
  const basket = this.findBasket(basketid);
16825
17689
  if (index < 1) {
16826
17690
  this.SetBasketItemLeadPassenger.updateOne({
16827
17691
  convertCurrencyTo: 'GBP',
16828
17692
  id: basketItem.id,
16829
- user: travellers.id,
16830
- withSupplemental: false
17693
+ userOrGuest: travellers.id,
17694
+ withSupplemental: false,
17695
+ leadPassengerType: leadPassengerType
16831
17696
  }).subscribe(() => { }, () => { }, () => {
16832
17697
  this.setLeadPassenger(basket.id, basketItem, travellers, index + 1);
16833
17698
  });
@@ -16882,7 +17747,7 @@ class BaseEnterpriseBasketService {
16882
17747
  .subscribe(resolve, reject);
16883
17748
  });
16884
17749
  }
16885
- setMiFreeValue(basketid, miItem, freeValue, userId = null) {
17750
+ setMiFreeValue(basketid, miItem, freeValue, userId = null, guest) {
16886
17751
  const intBasket = this.findBasket(basketid);
16887
17752
  const args = {
16888
17753
  convertCurrencyTo: 'GBP',
@@ -16890,27 +17755,42 @@ class BaseEnterpriseBasketService {
16890
17755
  miFreeValue: freeValue
16891
17756
  };
16892
17757
  if (!!userId) {
16893
- args.user = userId;
17758
+ if (guest) {
17759
+ args.guest = userId;
17760
+ }
17761
+ else {
17762
+ args.user = userId;
17763
+ }
16894
17764
  }
16895
- this.setBasketItemMiValueUpdater
16896
- .updateOne(args)
16897
- .pipe(take(1))
16898
- .subscribe((basket) => {
16899
- intBasket.next(basket);
16900
- }, (_) => { }, () => {
16901
- intBasket.next(intBasket.subject.value);
17765
+ return new Promise((resolve, reject) => {
17766
+ this.setBasketItemMiValueUpdater
17767
+ .updateOne(args)
17768
+ .pipe(take(1))
17769
+ .subscribe((basket) => {
17770
+ intBasket.next(basket);
17771
+ }, (error) => {
17772
+ reject(error);
17773
+ }, () => {
17774
+ intBasket.next(intBasket.subject.value);
17775
+ resolve();
17776
+ });
16902
17777
  });
16903
17778
  }
16904
- setMiSelectedValue(basketid, miItem, selectedValue, userId = null) {
17779
+ setMiSelectedValue(basketid, miItem, selectedValue, userId = null, guest) {
16905
17780
  const args = {
16906
17781
  convertCurrencyTo: 'GBP',
16907
17782
  mi: miItem.id,
16908
17783
  miValue: selectedValue
16909
17784
  };
16910
17785
  if (!!userId) {
16911
- args.user = userId;
17786
+ if (guest) {
17787
+ args.guest = userId;
17788
+ }
17789
+ else {
17790
+ args.user = userId;
17791
+ }
16912
17792
  }
16913
- this.updateBasket(basketid, this.setBasketItemMiValueUpdater.updateOne(args));
17793
+ return this.updateBasket(basketid, this.setBasketItemMiValueUpdater.updateOne(args));
16914
17794
  }
16915
17795
  getMiAutoSugestions(miId, partialLabel, isLoading) {
16916
17796
  isLoading === null || isLoading === void 0 ? void 0 : isLoading.next(true);
@@ -16930,6 +17810,11 @@ class BaseEnterpriseBasketService {
16930
17810
  item.save(basketId, user);
16931
17811
  });
16932
17812
  });
17813
+ bmi.guests.forEach((user) => {
17814
+ bmi.miPerGuest[user].managementInfo.forEach((item) => {
17815
+ item.save(basketId, user, true);
17816
+ });
17817
+ });
16933
17818
  });
16934
17819
  }
16935
17820
  sendBasketForApproval(basketid) {
@@ -17007,6 +17892,15 @@ class BaseEnterpriseBasketService {
17007
17892
  basketItem: basketItem.id
17008
17893
  });
17009
17894
  }
17895
+ removeBookedBasket() {
17896
+ this.currentBaskets = this.currentBaskets.reduce((acc, basket) => {
17897
+ if (basket.subject.value.status !== BasketStatus.Booked) {
17898
+ acc.push(basket);
17899
+ }
17900
+ return acc;
17901
+ }, []);
17902
+ this.baskets.next(this.currentBaskets);
17903
+ }
17010
17904
  }
17011
17905
 
17012
17906
  const SESSION_NAME = 'results_hotel_avallibility';
@@ -17234,14 +18128,18 @@ class AbstractHttpCallService {
17234
18128
  const USER_SIGNEDOUT = 'USER_SIGNEDOUT';
17235
18129
  const USER_SIGNEDIN = 'USER_SIGNEDIN';
17236
18130
  class BaseUserService {
17237
- constructor(getUserFetcher, userUiConfigsFetcher, userProductsFetcher, userMessagesFetcher, baseConfirmMessagesUpdater, setUserLanguageUpdater, editUserUpdater, storageService, helpers) {
18131
+ constructor(getUserFetcher, userUiConfigsFetcher, userProductsFetcher, userMessagesFetcher, baseConfirmMessagesUpdater, getCompaniesFetcher, getCompanyFetcher, setUserLanguageUpdater, editUserUpdater, createGuestUpdater, getUserGuestsFetcher, storageService, helpers) {
17238
18132
  this.getUserFetcher = getUserFetcher;
17239
18133
  this.userUiConfigsFetcher = userUiConfigsFetcher;
17240
18134
  this.userProductsFetcher = userProductsFetcher;
17241
18135
  this.userMessagesFetcher = userMessagesFetcher;
17242
18136
  this.baseConfirmMessagesUpdater = baseConfirmMessagesUpdater;
18137
+ this.getCompaniesFetcher = getCompaniesFetcher;
18138
+ this.getCompanyFetcher = getCompanyFetcher;
17243
18139
  this.setUserLanguageUpdater = setUserLanguageUpdater;
17244
18140
  this.editUserUpdater = editUserUpdater;
18141
+ this.createGuestUpdater = createGuestUpdater;
18142
+ this.getUserGuestsFetcher = getUserGuestsFetcher;
17245
18143
  this.storageService = storageService;
17246
18144
  this.helpers = helpers;
17247
18145
  this.fullUserDetails = {
@@ -17258,9 +18156,10 @@ class BaseUserService {
17258
18156
  setUser(user_data) {
17259
18157
  const userdata = this.fullUserDetails.userData.value;
17260
18158
  if (!userdata || userdata.username !== user_data.username) {
17261
- if (userdata === null || userdata === void 0 ? void 0 : userdata.user_id) {
17262
- this.getUserFetcher.fetchOne({
17263
- id: userdata.user_id.toString()
18159
+ if (user_data === null || user_data === void 0 ? void 0 : user_data.user_id) {
18160
+ this.getUserFetcher
18161
+ .fetchOne({
18162
+ id: user_data.user_id.toString()
17264
18163
  })
17265
18164
  .pipe(take(1))
17266
18165
  .subscribe((user) => {
@@ -17289,7 +18188,8 @@ class BaseUserService {
17289
18188
  this.fullUserDetails.travllerObject.next(TravellerObject.makeTravellerObjectFromUser(user_data));
17290
18189
  }
17291
18190
  if (user_data === null || user_data === void 0 ? void 0 : user_data.user_id) {
17292
- this.getUserFetcher.fetchOne({
18191
+ this.getUserFetcher
18192
+ .fetchOne({
17293
18193
  id: user_data === null || user_data === void 0 ? void 0 : user_data.user_id.toString()
17294
18194
  })
17295
18195
  .pipe(take(1))
@@ -17301,6 +18201,9 @@ class BaseUserService {
17301
18201
  this.fullUserDetails.userData.next(user_data);
17302
18202
  this.storageService.setSessionItem('lightning_user_data', user_data);
17303
18203
  }
18204
+ canBookGuest() {
18205
+ return this.fullUserDetails.allDetails.value.canBookGuest;
18206
+ }
17304
18207
  checkEmitUser() {
17305
18208
  if (!!this.fullUserDetails.userConfigs.value &&
17306
18209
  !!this.fullUserDetails.userData.value &&
@@ -17494,29 +18397,54 @@ class BaseUserService {
17494
18397
  confirmMessages(id) {
17495
18398
  return this.baseConfirmMessagesUpdater.updateOne({ messages: id });
17496
18399
  }
17497
- getUser() {
18400
+ userIsRoot() {
18401
+ return this.fullUserDetails.userData.value.booker_type === BookerType.Root;
18402
+ }
18403
+ userIsSupportAgent() {
18404
+ return !!this.fullUserDetails.userData.value.support_agent;
18405
+ }
18406
+ getUserCompanies(query = null) {
18407
+ return query
18408
+ ? this.getCompaniesFetcher.fetchList({ query }).pipe(take(1))
18409
+ : this.getCompaniesFetcher.fetchList().pipe(take(1));
18410
+ }
18411
+ getCompanyById(id, withUsers = false) {
18412
+ return this.getCompanyFetcher.fetchOne({ id }).pipe(take(1));
18413
+ }
18414
+ getUser(userId) {
17498
18415
  const user = this.getfullUserDetails();
17499
18416
  return this.getUserFetcher.fetchOne({
17500
- id: user.userData.value.user_id.toString()
18417
+ id: userId ? userId : user.userData.value.user_id.toString()
17501
18418
  });
17502
18419
  }
17503
18420
  setUserLanguage(id) {
17504
18421
  return this.setUserLanguageUpdater.updateOne({ language: id });
17505
18422
  }
17506
- getDocuments(type) {
17507
- return this.getUser().pipe(map((user) => user.documents || []), map((docs) => {
18423
+ getDocuments(type, userId) {
18424
+ return this.getUser(userId).pipe(map((user) => user.documents || []), map((docs) => {
17508
18425
  return type
17509
18426
  ? docs.filter((doc) => doc.docType === type)
17510
18427
  : docs;
17511
18428
  }));
17512
18429
  }
17513
18430
  editUser(user) {
17514
- return this.editUserUpdater.updateOne(user).pipe(tap((user) => this.fullUserDetails.allDetails.next(user)));
18431
+ return this.editUserUpdater
18432
+ .updateOne(user)
18433
+ .pipe(tap((user) => this.fullUserDetails.allDetails.next(user)));
18434
+ }
18435
+ createGuest(newGuest) {
18436
+ return this.createGuestUpdater.updateOne(newGuest).pipe(take(1));
18437
+ }
18438
+ getUserGuests() {
18439
+ return this.getUserGuestsFetcher.fetchList();
18440
+ }
18441
+ canInvokeUser() {
18442
+ return this.fullUserDetails.allDetails.value.canInvokeUser;
17515
18443
  }
17516
18444
  }
17517
18445
 
17518
18446
  class BaseLogonService {
17519
- constructor(userService, modalService, http, router, eventMessenager, storageService, environment) {
18447
+ constructor(userService, modalService, http, router, eventMessenager, storageService, environment, webTokenService) {
17520
18448
  this.userService = userService;
17521
18449
  this.modalService = modalService;
17522
18450
  this.http = http;
@@ -17524,6 +18452,7 @@ class BaseLogonService {
17524
18452
  this.eventMessenager = eventMessenager;
17525
18453
  this.storageService = storageService;
17526
18454
  this.environment = environment;
18455
+ this.webTokenService = webTokenService;
17527
18456
  this.loading = false;
17528
18457
  this.isLoggedIn = false;
17529
18458
  this.redirectUrl = '';
@@ -17590,6 +18519,37 @@ class BaseLogonService {
17590
18519
  setRefresh() {
17591
18520
  this.timeoutSubscription = window.setTimeout(this.refreshToken.bind(this), this.environment.authRefreshTimeout * 1000);
17592
18521
  }
18522
+ becomeUser(username) {
18523
+ return new Promise((resolve, reject) => {
18524
+ this.clearRefresh();
18525
+ this.http
18526
+ .post(URLS.BECOME_USER, { username })
18527
+ .pipe(take(1))
18528
+ .subscribe((data) => {
18529
+ console.log(data);
18530
+ this.userService.setUser(data.jwtObject);
18531
+ this.router.navigate(['main']);
18532
+ resolve(true);
18533
+ }, (error) => {
18534
+ reject(error);
18535
+ });
18536
+ });
18537
+ }
18538
+ endBecomeUserSession() {
18539
+ return new Promise((resolve, reject) => {
18540
+ this.clearRefresh();
18541
+ this.http
18542
+ .post(URLS.END_BECOME_USER, {})
18543
+ .pipe(take(1))
18544
+ .subscribe((data) => {
18545
+ console.log(data);
18546
+ this.userService.setUser(data.jwtObject);
18547
+ resolve(true);
18548
+ }, (error) => {
18549
+ reject(error);
18550
+ });
18551
+ });
18552
+ }
17593
18553
  login(username, password, again) {
17594
18554
  this.userService.emptyUserData();
17595
18555
  this.storageService.clearSessionData();
@@ -17600,6 +18560,7 @@ class BaseLogonService {
17600
18560
  password
17601
18561
  })
17602
18562
  .pipe(take(1), map((value, index) => {
18563
+ this.webTokenService.bobo = null;
17603
18564
  this.setRefresh();
17604
18565
  return this.handleResponse(value);
17605
18566
  }));
@@ -17629,6 +18590,7 @@ class BaseLogonService {
17629
18590
  const isSSO = this.userService.isUserFavoriteSet(UserFavorurite.SSO_no_password);
17630
18591
  this.clearRefresh();
17631
18592
  this.isLoggedIn = false;
18593
+ this.webTokenService.bobo = null;
17632
18594
  this.userService.emptyUserData();
17633
18595
  this.storageService.clearSessionData();
17634
18596
  this.http.post(URLS.LOGOUT_URL).subscribe((data) => {
@@ -17671,7 +18633,7 @@ class BaseLogonService {
17671
18633
  **/
17672
18634
  recoverPassword(username) {
17673
18635
  return this.http.formEncodedPost(URLS.RECOVER_PASSWORD_URL, {
17674
- username: `${username}`,
18636
+ username: `${username}`
17675
18637
  }, 'text');
17676
18638
  }
17677
18639
  /*
@@ -19084,10 +20046,9 @@ var EuroStations = [
19084
20046
 
19085
20047
  class FastTrackEnterpriseSearch extends BaseEnterpriseSearch {
19086
20048
  constructor(fasttrackFetcher, helpers, basketService, storageService, searchService) {
19087
- super(storageService, helpers);
20049
+ super(storageService, helpers, searchService);
19088
20050
  this.fasttrackFetcher = fasttrackFetcher;
19089
20051
  this.basketService = basketService;
19090
- this.searchService = searchService;
19091
20052
  this.type = ServiceType.FastTrack;
19092
20053
  this._date = null;
19093
20054
  this._time = null;
@@ -19221,7 +20182,7 @@ class FastTrackEnterpriseSearch extends BaseEnterpriseSearch {
19221
20182
  getSearchQuery() {
19222
20183
  const query = {
19223
20184
  adults: this.tempParams.adults,
19224
- children: this.tempParams.children,
20185
+ children: this.tempParams.children ? this.tempParams.children : null,
19225
20186
  locationCode: this._locationCode,
19226
20187
  arrivalDatetime: this.tempParams.arrivalDatetime
19227
20188
  };
@@ -19255,6 +20216,25 @@ class FastTrackEnterpriseSearch extends BaseEnterpriseSearch {
19255
20216
  });
19256
20217
  this.searchService.startSearches();
19257
20218
  }
20219
+ updateSearchFromExpiredBasketItem(basketItem) {
20220
+ const searchFastTrackQuery = basketItem.searchQuery;
20221
+ this.arrivalDatetime = moment(searchFastTrackQuery.arrivalDatetime);
20222
+ this.searchService
20223
+ .getAirportByCode(searchFastTrackQuery.locationCode)
20224
+ .subscribe((airport) => {
20225
+ var _a, _b, _c, _d, _e, _f;
20226
+ if (airport) {
20227
+ this.locationCode = {
20228
+ country: (_b = (_a = airport.iataMatch) === null || _a === void 0 ? void 0 : _a.locationDetails) === null || _b === void 0 ? void 0 : _b.country,
20229
+ countryCode: (_d = (_c = airport.iataMatch) === null || _c === void 0 ? void 0 : _c.locationDetails) === null || _d === void 0 ? void 0 : _d.countryCode,
20230
+ destination: airport.iataMatch.name,
20231
+ gateway: airport.iataMatch.iata,
20232
+ postcode: (_f = (_e = airport.iataMatch) === null || _e === void 0 ? void 0 : _e.locationDetails) === null || _f === void 0 ? void 0 : _f.postcode,
20233
+ terminals: this.searchService.processTerminals(airport.iataMatch.terminals)
20234
+ };
20235
+ }
20236
+ });
20237
+ }
19258
20238
  updateFromPreviousSearches(previousItems) {
19259
20239
  var _a;
19260
20240
  console.log('PREPOPULATING LOUNGE FORM');
@@ -19290,13 +20270,13 @@ class FastTrackEnterpriseSearch extends BaseEnterpriseSearch {
19290
20270
  var _a;
19291
20271
  return __awaiter(this, void 0, void 0, function* () {
19292
20272
  if (fasttrackQuote.unavailable) {
19293
- return Promise.resolve(false);
20273
+ return Promise.resolve(DifferentInvokdedUserReasons.cancel);
19294
20274
  }
19295
20275
  const intBasket = yield this.basketService.getDefaultBasket();
19296
20276
  const basket = intBasket === null || intBasket === void 0 ? void 0 : intBasket.subject.value;
19297
20277
  const termsAndConditions = this.getTermsAndCond(fasttrackQuote);
19298
20278
  if (basket) {
19299
- return this.basketService.addToBasket({
20279
+ const whatHappened = yield this.basketService.addToBasket({
19300
20280
  adults: fasttrackQuery.adults,
19301
20281
  children: fasttrackQuery.children,
19302
20282
  basket: basket.id,
@@ -19306,17 +20286,19 @@ class FastTrackEnterpriseSearch extends BaseEnterpriseSearch {
19306
20286
  locationCode: fasttrackQuote.code,
19307
20287
  name: fasttrackQuote.name,
19308
20288
  airportIata: fasttrackQuery === null || fasttrackQuery === void 0 ? void 0 : fasttrackQuery.locationCode,
19309
- logo: fasttrackQuote.logo,
19310
- terminal: (_a = fasttrackQuote.terminal) === null || _a === void 0 ? void 0 : _a.toString(),
19311
- termsAndCond: termsAndConditions
20289
+ terminal: (_a = fasttrackQuote.terminal) === null || _a === void 0 ? void 0 : _a.toString()
19312
20290
  },
19313
20291
  price: fasttrackQuote.price,
19314
20292
  currency: fasttrackQuote.currency,
19315
20293
  searchQuery: fasttrackQuery,
19316
20294
  outboundDate: fasttrackQuery.arrivalDatetime.format()
19317
20295
  }, intBasket, this.searchService, this.travellers, fasttrackQuote.requiresReason);
20296
+ if (whatHappened === DifferentInvokdedUserReasons.research) {
20297
+ this.performSearch();
20298
+ }
20299
+ return whatHappened;
19318
20300
  }
19319
- return Promise.resolve(false); // TODO should this throw an error?
20301
+ return DifferentInvokdedUserReasons.cancel;
19320
20302
  });
19321
20303
  }
19322
20304
  getTermsAndCond(fasttrackQuote) {
@@ -19412,6 +20394,7 @@ class BaseEnterpriseSearchService {
19412
20394
  this.baseSaveFavouriteSearchUpdater = baseSaveFavouriteSearchUpdater;
19413
20395
  this.getRailStationFetcher = getRailStationFetcher;
19414
20396
  this.getIrlSupplierStationFetcher = getIrlSupplierStationFetcher;
20397
+ this.baseWebTokenService = baseWebTokenService;
19415
20398
  this.riskAlertsFetcher = riskAlertsFetcher;
19416
20399
  this.getUserRecentSearchesFetcher = getUserRecentSearchesFetcher;
19417
20400
  this.getRailCardsFetcher = getRailCardsFetcher;
@@ -19790,6 +20773,14 @@ class BaseEnterpriseSearchService {
19790
20773
  return of([]);
19791
20774
  }
19792
20775
  }
20776
+ getRailStationById(id) {
20777
+ if (id) {
20778
+ return this.getRailStationFetcher.fetchList({ id }).pipe(take(1));
20779
+ }
20780
+ else {
20781
+ return of();
20782
+ }
20783
+ }
19793
20784
  /**
19794
20785
  * @description - get irl station locations
19795
20786
  * @param term - the term to search
@@ -19947,6 +20938,9 @@ class BaseEnterpriseSearchService {
19947
20938
  updateTravellerInformation() {
19948
20939
  this.storageService.setSessionItem(BaseEnterpriseSearchService.SESSION_TRAVELLER, this.selectedTravellers);
19949
20940
  this.travellerInformation.next([...this.selectedTravellers]);
20941
+ if (this.searches[ServiceType.Rail]) {
20942
+ this.searches[ServiceType.Rail].railCards = new Array(this.selectedTravellers.length).fill({ name: '', code: '' }, 0, this.selectedTravellers.length);
20943
+ }
19950
20944
  }
19951
20945
  /*
19952
20946
  * @desc - determine and return the highest priority value,
@@ -19975,7 +20969,8 @@ class BaseEnterpriseSearchService {
19975
20969
  }
19976
20970
  getSelectedOptions() {
19977
20971
  return Object.keys(this.search_objects).reduce((cv, itemIndex) => {
19978
- if (this.search_objects[itemIndex].chosen) {
20972
+ var _a;
20973
+ if ((_a = this.search_objects[itemIndex]) === null || _a === void 0 ? void 0 : _a.chosen) {
19979
20974
  cv.push(itemIndex);
19980
20975
  }
19981
20976
  return cv;
@@ -20007,13 +21002,14 @@ class BaseEnterpriseSearchService {
20007
21002
  }
20008
21003
  canSearch(type) {
20009
21004
  // check that the selected type is chosen, has highest priority and has not already had a booking chosen
21005
+ var _a, _b;
20010
21006
  this.determineHighestSearchPriority();
20011
21007
  // firstly check that the type of search exists
20012
21008
  if (this.search_objects[type]) {
20013
21009
  console.log('can search here');
20014
21010
  // now check that the type is chosen has highest priority
20015
- if (this.search_objects[type].chosen &&
20016
- this.hasHighestSearchPriority(this.search_objects[type].priority)) {
21011
+ if (((_a = this.search_objects[type]) === null || _a === void 0 ? void 0 : _a.chosen) &&
21012
+ this.hasHighestSearchPriority((_b = this.search_objects[type]) === null || _b === void 0 ? void 0 : _b.priority)) {
20017
21013
  console.log(type + ' can be searched');
20018
21014
  return true;
20019
21015
  }
@@ -20029,61 +21025,13 @@ class BaseEnterpriseSearchService {
20029
21025
  * travellers (or will do when it's complete) TODO - add Flight, Rail Car
20030
21026
  **/
20031
21027
  getAllErrorMessages() {
20032
- const concattedErrors = this.travellerValidationMessages;
20033
- if (this.search_objects[ServiceType.Lounge].chosen &&
20034
- this.canSearch(ServiceType.Lounge)) {
20035
- concattedErrors.push(...this.searches[ServiceType.Lounge].validationMessages);
20036
- }
20037
- if (this.search_objects[ServiceType.Car].chosen &&
20038
- this.canSearch(ServiceType.Car)) {
20039
- concattedErrors.push(...this.searches[ServiceType.Car].validationMessages);
20040
- }
20041
- if (this.search_objects[ServiceType.Rail].chosen &&
20042
- this.canSearch(ServiceType.Rail)) {
20043
- concattedErrors.push(...this.searches[ServiceType.Rail].validationMessages);
20044
- }
20045
- if (this.search_objects[ServiceType.Parking].chosen &&
20046
- this.canSearch(ServiceType.Parking)) {
20047
- concattedErrors.push(...this.searches[ServiceType.Parking].validationMessages);
20048
- }
20049
- if (this.search_objects[ServiceType.Cab].chosen &&
20050
- this.canSearch(ServiceType.Cab)) {
20051
- concattedErrors.push(...this.searches[ServiceType.Cab].validationMessages);
20052
- }
20053
- if (this.search_objects[ServiceType.Hotel].chosen &&
20054
- this.canSearch(ServiceType.Hotel)) {
20055
- concattedErrors.push(...this.searches[ServiceType.Hotel].validationMessages);
20056
- }
20057
- if (this.search_objects[ServiceType.FastTrack].chosen &&
20058
- this.canSearch(ServiceType.FastTrack)) {
20059
- concattedErrors.push(...this.searches[ServiceType.FastTrack].validationMessages);
20060
- }
20061
- /*
20062
- if (this.search_objects.hotel.chosen && this.canSearch(TravelTypeEnum.HOTEL)) {
20063
- concattedErrors = concattedErrors.concat(this.hotel.validationMessages);
20064
- }
20065
-
20066
-
20067
-
20068
- if (this.search_objects.flight.chosen && this.canSearch(TravelTypeEnum.FLIGHT)) {
20069
- concattedErrors = concattedErrors.concat(this.flight.validationMessages);
20070
- }
20071
-
20072
- if (this.search_objects.parking.chosen && this.canSearch(TravelTypeEnum.AIR_PARKING)) {
20073
- concattedErrors.push(...this.parking.validationMessages);
20074
- }
20075
-
20076
- if (this.search_objects.taxi.chosen && this.canSearch(TravelTypeEnum.TAXI)) {
20077
- concattedErrors.push(...this.taxi.validationMessages);
20078
- }
20079
-
20080
- if (this.search_objects.eurostar.chosen && this.canSearch(TravelTypeEnum.EUROSTAR)) {
20081
- concattedErrors.push(...this.eurostar.validationMessages);
20082
- }
20083
-
20084
- if (this.search_objects.coach.chosen && this.canSearch(TravelTypeEnum.COACH)) {
20085
- concattedErrors.push(...this.coach.validationMessages);
20086
- }*/
21028
+ const concattedErrors = Object.entries(this.search_objects).reduce((accum, [type, searchObject]) => {
21029
+ if ((searchObject === null || searchObject === void 0 ? void 0 : searchObject.chosen) && this.canSearch(type)) {
21030
+ accum.push(...this.searches[type]
21031
+ .validationMessages);
21032
+ }
21033
+ return accum;
21034
+ }, this.travellerValidationMessages);
20087
21035
  this.errors.next(concattedErrors);
20088
21036
  return concattedErrors;
20089
21037
  }
@@ -20177,9 +21125,9 @@ class BaseEnterpriseSearchService {
20177
21125
  // }, this.environment.searchTimeout);
20178
21126
  try {
20179
21127
  Promise.all(Object.values(this.searches).map((search) => {
21128
+ var _a;
20180
21129
  return !!search &&
20181
- this.search_objects[search.type] &&
20182
- this.search_objects[search.type].chosen
21130
+ this.search_objects[search.type] && ((_a = this.search_objects[search.type]) === null || _a === void 0 ? void 0 : _a.chosen)
20183
21131
  ? search.startSearch()
20184
21132
  : Promise.resolve(false);
20185
21133
  })).finally(() => {
@@ -20620,7 +21568,8 @@ class BaseEnterpriseSearchService {
20620
21568
  travellingTo: null,
20621
21569
  via: false,
20622
21570
  viaLocation: null,
20623
- railCards: null
21571
+ railCards: [],
21572
+ transactionIdentifier: null
20624
21573
  };
20625
21574
  return this.helpers.sanatizeReturns(defaultVal, Object.assign({}, ...args), ['inBoundDateTime', 'outBoundDateTime']);
20626
21575
  }
@@ -20754,7 +21703,9 @@ class BaseEnterpriseSearchService {
20754
21703
  return this.deleteFavouriteSearchUpdater.updateOne({ id: id });
20755
21704
  }
20756
21705
  saveRecentSearch(query) {
20757
- if (query) {
21706
+ if (query &&
21707
+ !this.selectedTravellers.find((traveller) => traveller.guest)) {
21708
+ // prevent it saving recent searches with guests - atm it's erroring
20758
21709
  this.baseSaveRecentSearchUpdater
20759
21710
  .updateOne(query)
20760
21711
  .pipe(take(1))
@@ -20843,7 +21794,7 @@ class BaseEnterpriseSearchService {
20843
21794
  }
20844
21795
  submitIrlForm() {
20845
21796
  const currentUserEmail = this.userService.getUserEmail();
20846
- let searchParams = this.searches[ServiceType.InternationalRail];
21797
+ const searchParams = this.searches[ServiceType.InternationalRail];
20847
21798
  let onBehalfOf;
20848
21799
  let passengers;
20849
21800
  // get passengers
@@ -20851,8 +21802,8 @@ class BaseEnterpriseSearchService {
20851
21802
  passengers = travellers.map((traveller, index) => {
20852
21803
  let age;
20853
21804
  if (traveller.dob) {
20854
- let timeDiff = Math.abs(new Date().getTime() - new Date(traveller.dob).getTime());
20855
- age = Math.floor((timeDiff / (1000 * 3600 * 24)) / 365);
21805
+ const timeDiff = Math.abs(new Date().getTime() - new Date(traveller.dob).getTime());
21806
+ age = Math.floor(timeDiff / (1000 * 3600 * 24) / 365);
20856
21807
  }
20857
21808
  return {
20858
21809
  name: traveller.name,
@@ -20861,7 +21812,9 @@ class BaseEnterpriseSearchService {
20861
21812
  loyaltyCard: `Loyalty Card ${index + 1}`
20862
21813
  };
20863
21814
  });
20864
- onBehalfOf = travellers[0].email ? travellers[0].email : currentUserEmail;
21815
+ onBehalfOf = travellers[0].email
21816
+ ? travellers[0].email
21817
+ : currentUserEmail;
20865
21818
  }));
20866
21819
  // get jrfreference
20867
21820
  this.allSubscription.add(searchParams.results.subscribe((irlJourney) => {
@@ -20881,8 +21834,8 @@ class BaseEnterpriseSearchService {
20881
21834
  serviceClass: searchParams.irlClass || 'Any',
20882
21835
  offlineReference: this.jrfReference,
20883
21836
  notifyEmail: currentUserEmail,
20884
- onBehalfOf: onBehalfOf,
20885
- passengers: passengers
21837
+ onBehalfOf,
21838
+ passengers
20886
21839
  };
20887
21840
  console.log(payload);
20888
21841
  this.sendOfflineNotification(payload).subscribe((result) => {
@@ -20898,6 +21851,9 @@ class BaseEnterpriseSearchService {
20898
21851
  sendOfflineNotification(jrfReference) {
20899
21852
  return this.sendOfflineNotificationFetcher.fetchOne(jrfReference);
20900
21853
  }
21854
+ getCountries() {
21855
+ return this.countries;
21856
+ }
20901
21857
  }
20902
21858
  BaseEnterpriseSearchService.SESSION_TRAVELLER = 'search_travellers';
20903
21859
 
@@ -20912,6 +21868,7 @@ class BaseWebTokenService {
20912
21868
  this.timer = null;
20913
21869
  this.timeoutDuration = 60 * 60;
20914
21870
  this.autoLogoutConfig = {};
21871
+ this._bobo = null;
20915
21872
  this.timeOutDuration = environment.autoLogoutTime;
20916
21873
  }
20917
21874
  /**
@@ -20928,6 +21885,12 @@ class BaseWebTokenService {
20928
21885
  get jwtToken() {
20929
21886
  return this._jwtToken || null;
20930
21887
  }
21888
+ set bobo(value) {
21889
+ this._bobo = value || null;
21890
+ }
21891
+ get bobo() {
21892
+ return this._bobo;
21893
+ }
20931
21894
  _updateTimer() {
20932
21895
  window.clearTimeout(this.timer);
20933
21896
  this.timer = null;
@@ -21438,9 +22401,19 @@ class BaseEditUserUpdater extends UpdateableObject {
21438
22401
  }
21439
22402
  }
21440
22403
 
22404
+ class BaseCreateGuestUpdater extends UpdateableObject {
22405
+ constructor(createBasketGQL, modalService) {
22406
+ super(createBasketGQL, modalService);
22407
+ }
22408
+ getDataFromResult(results) {
22409
+ var _a;
22410
+ return (_a = results === null || results === void 0 ? void 0 : results.data) === null || _a === void 0 ? void 0 : _a.createGuest;
22411
+ }
22412
+ }
22413
+
21441
22414
  /**
21442
22415
  * Generated bundle index. Do not edit.
21443
22416
  */
21444
22417
 
21445
- export { AbstractHttpCallService, ActionType, AddressImpl, Airlines, AirportSearchMode, AuthInfo, BaseAcceptNewPriceUpdater, BaseAddItemToBasketUpdater, BaseAddUserToBasketItemUpdater, BaseApplyJitFlightRulesFetcher, BaseBookBasketUpdater, BaseCabhireQuoteFetcher, BaseCancelBookingUpdater, BaseCarHireAvailabilityDetailFetcher, BaseCarhireQuoteFetcher, BaseConfermaOfficeFetcher, BaseConfermaOfficeNamesFetcher, BaseConfirmMessagesUpdater, BaseCreateBasketUpdater, BaseDeleteBasketUpdater, BaseDeleteFavouriteSearchUpdater, BaseDeleteRecentSearchUpdater, BaseDeleteUserAddressUpdater, BaseEditUserUpdater, BaseEmailBasketFetcher, BaseEnterpriseBasketService, BaseEnterpriseMyBookingsService, BaseEnterpriseSearch, BaseEnterpriseSearchService, BaseEnvironment, BaseEurostarQuoteFetcher, BaseEventMessenager, BaseFastTrackQuoteFetcher, BaseFlightQuoteFetcher, BaseGetAllAirlinesFetcher, BaseGetBasketFetcher, BaseGetCancellationInfoFetcher, BaseGetCarHireProvidersFetcher, BaseGetConfermaRoomImagesFetcher, BaseGetCovidMicrositeTokenFetcher, BaseGetFlightFareRulesFetcher, BaseGetFlightSeatMapFetcher, BaseGetHotelChainsFetcher, BaseGetIrlSupplierStationFetcher, BaseGetMiAutoSugestionFetcher, BaseGetRailLiveDeparturesFetcher, BaseGetRailProvidersFetcher, BaseGetRailStationFetcher, BaseGetRailcardsFetcher, BaseGetRiskAlertsFetcher, BaseGetUserBasketsFetcher, BaseGetUserCompanyOfficesFetcher, BaseGetUserCurrentCarbonAllowanceFetcher, BaseGetUserFavouriteSearchesFetcher, BaseGetUserFetcher, BaseGetUserRecentSearchesFetcher, BaseHelperRoutines, BaseHotelAvalibilityQuoteFetcher, BaseHotelAvalibilityService, BaseHotelQuoteFetcher, BaseHotelRulesFetcher, BaseIrlDiscountCardFetcher, BaseIrlQuoteFetcher, BaseLogonService, BaseLoungeQuoteFetcher, BaseModalOpenerService, BaseNetworkCall, BaseParkingQuoteFetcher, BaseRailQuoteFetcher, BaseRemoveItemFromBasketUpdater, BaseRequiresReasonService, BaseRevalidateBasketUpdater, BaseRouteHappyService, BaseSaveFavouriteSearchUpdater, BaseSaveRecentSearchUpdater, BaseSaveUserAddressUpdater, BaseSearchAirlinesFetcher, BaseSearchAirportsFetcher, BaseSearchCityFetcher, BaseSearchConfermaCityFetcher, BaseSearchConfermaQuicklistFetcher, BaseSearchDepotFetcher, BaseSearchHotelChainsFetcher, BaseSearchIrlStationsFetcher, BaseSearchPostcodeFetcher, BaseSearchRailStationsFetcher, BaseSearchUsersCanBookForFetcher, BaseSendBasketForApprovalUpdater, BaseSendOfflineNotificationFetcher, BaseSetBasketItemLeadPassengerUpdater, BaseSetBasketItemMiGroupUpdater, BaseSetBasketItemMiValueUpdater, BaseSetPaymentOptionUpdater, BaseSetUserLanguageUpdater, BaseStorageService, BaseUpdateBasketNoteUpdater, BaseUpdateBasketTitleUpdater, BaseUserAddressesFetcher, BaseUserMessagesFetcher, BaseUserProductsFetcher, BaseUserService, BaseUserUiConfigsFetcher, BaseValidateIsPostcodeValidTester, BaseValidateMiFreeValueTester, BaseWebTokenService, BasemoveBasketItemToBasket, BasketInfoMiDetailsImpl, BookableBasket, BookingStatus, BreatfastTypes, CabHireEnterpriseSearch, CarCompanies, CarhireEnterpriseSearch, ClassType, DEFAULT_FLIGHT_FILTERS, DistanceType, DocTypes, EurostarClassEnum, EurostarEnterpriseSearch, EurostarSearchType, FlightDirectionEnum, FlightDisplayTypes, FlightEnterpriseSearch, FlightSearchType, FlightSortTypes, Genders, HotelChains, HotelEnterpriseSearch, HotelFilters, HotelPolicyEnum, HotelView, IRLEnterpriseSearch, IncludedType, InternalBasket, IrlDirection, LimitedCache, LocationTypes, LoginError, LoginErrorReason, LogoutEnum, LoungesEnterpriseSearch, MAX_TRAVELLERS, ManagementInfoAndIsValid, Memorise, MenuSlideEnum, ModalTypes, OBTFlightCabinClass, PREFERENCE_VALUES, ParkingEnterpriseSearch, PersonTitles, PhoneNumberImpl, PreferredFlags, RailCompanies, RailDirection, RailEnterpriseSearch, RailJourneyFareType, RailSearchCriteria, RegExps, RiskLevelRanking, SchemaFormat, SearchHandler, ServiceProvider, SortMethod, SortTypesCar, SortTypesEurostar, SortTypesHotel, SortTypesIrl, SupplementaryBookingInfoImpl, Suppliers, TaxiFormMode, TimeWindow, TravellerObject, TravellerSearchTypes, URLS, USER_SIGNEDIN, USER_SIGNEDOUT, UserFavorurite, UserInfoImpl, ValidatorChecker, WellbeingEnum, Widgets, ages, defaultValidations, excludedExpression, filtersKeys, includedExpression, makeManagamentInfo, maxTravellerWellbeing, ɵ0, DistanceTypes as ɵb, DocGender as ɵc, DocType as ɵd, PreferenceKey as ɵf, FetchableList as ɵh, FetchableObject as ɵi, UpdateableObject as ɵj, BaseTester as ɵk };
22418
+ export { AbstractHttpCallService, ActionType, AddressImpl, Airlines, AirportSearchMode, AuthInfo, BaseAcceptNewPriceUpdater, BaseAddItemToBasketUpdater, BaseAddUserToBasketItemUpdater, BaseApplyJitFlightRulesFetcher, BaseBookBasketUpdater, BaseCabhireQuoteFetcher, BaseCancelBookingUpdater, BaseCarHireAvailabilityDetailFetcher, BaseCarhireQuoteFetcher, BaseConfermaOfficeFetcher, BaseConfermaOfficeNamesFetcher, BaseConfirmMessagesUpdater, BaseCreateBasketUpdater, BaseCreateGuestUpdater, BaseDeleteBasketUpdater, BaseDeleteFavouriteSearchUpdater, BaseDeleteRecentSearchUpdater, BaseDeleteUserAddressUpdater, BaseEditUserUpdater, BaseEmailBasketFetcher, BaseEnterpriseBasketService, BaseEnterpriseMyBookingsService, BaseEnterpriseSearch, BaseEnterpriseSearchService, BaseEnvironment, BaseEurostarQuoteFetcher, BaseEventMessenager, BaseFastTrackQuoteFetcher, BaseFlightQuoteFetcher, BaseGetAllAirlinesFetcher, BaseGetBasketFetcher, BaseGetCancellationInfoFetcher, BaseGetCarHireProvidersFetcher, BaseGetCompaniesFetcher, BaseGetCompanyFetcher, BaseGetConfermaRoomImagesFetcher, BaseGetCovidMicrositeTokenFetcher, BaseGetFlightFareRulesFetcher, BaseGetFlightSeatMapFetcher, BaseGetHotelChainsFetcher, BaseGetIrlSupplierStationFetcher, BaseGetMiAutoSugestionFetcher, BaseGetRailLiveDeparturesFetcher, BaseGetRailProvidersFetcher, BaseGetRailStationFetcher, BaseGetRailcardsFetcher, BaseGetRiskAlertsFetcher, BaseGetUserBasketsFetcher, BaseGetUserCompanyOfficesFetcher, BaseGetUserCurrentCarbonAllowanceFetcher, BaseGetUserFavouriteSearchesFetcher, BaseGetUserFetcher, BaseGetUserGuestsFetcher, BaseGetUserRecentSearchesFetcher, BaseHelperRoutines, BaseHotelAvalibilityQuoteFetcher, BaseHotelAvalibilityService, BaseHotelQuoteFetcher, BaseHotelRulesFetcher, BaseIrlDiscountCardFetcher, BaseIrlQuoteFetcher, BaseLogonService, BaseLoungeQuoteFetcher, BaseModalOpenerService, BaseNetworkCall, BaseParkingQuoteFetcher, BaseRailQuoteFetcher, BaseRemoveItemFromBasketUpdater, BaseRequiresReasonService, BaseRevalidateBasketUpdater, BaseRouteHappyService, BaseSaveFavouriteSearchUpdater, BaseSaveRecentSearchUpdater, BaseSaveUserAddressUpdater, BaseSearchAirlinesFetcher, BaseSearchAirportsFetcher, BaseSearchCityFetcher, BaseSearchConfermaCityFetcher, BaseSearchConfermaQuicklistFetcher, BaseSearchDepotFetcher, BaseSearchHotelChainsFetcher, BaseSearchIrlStationsFetcher, BaseSearchPostcodeFetcher, BaseSearchRailStationsFetcher, BaseSearchUsersCanBookForFetcher, BaseSendBasketForApprovalUpdater, BaseSendOfflineNotificationFetcher, BaseSetBasketItemLeadPassengerUpdater, BaseSetBasketItemMiGroupUpdater, BaseSetBasketItemMiValueUpdater, BaseSetPaymentOptionUpdater, BaseSetUserLanguageUpdater, BaseStorageService, BaseUpdateBasketNoteUpdater, BaseUpdateBasketTitleUpdater, BaseUserAddressesFetcher, BaseUserMessagesFetcher, BaseUserProductsFetcher, BaseUserService, BaseUserUiConfigsFetcher, BaseValidateIsPostcodeValidTester, BaseValidateMiFreeValueTester, BaseWebTokenService, BasemoveBasketItemToBasket, BasketInfoMiDetailsImpl, BookableBasket, BookingStatus, BreatfastTypes, CabHireEnterpriseSearch, CarCompanies, CarhireEnterpriseSearch, ClassType, DEFAULT_FLIGHT_FILTERS, DifferentInvokdedUserReasons, DistanceType, DocTypes, EurostarClassEnum, EurostarEnterpriseSearch, EurostarSearchType, FlightDirectionEnum, FlightDisplayTypes, FlightEnterpriseSearch, FlightSearchType, FlightSortTypes, Genders, HotelChains, HotelEnterpriseSearch, HotelFilters, HotelPolicyEnum, HotelView, IRLEnterpriseSearch, IncludedType, InternalBasket, IrlDirection, LimitedCache, LocationTypes, LoginError, LoginErrorReason, LogoutEnum, LoungesEnterpriseSearch, MAX_TRAVELLERS, ManagementInfoAndIsValid, Memorise, MenuSlideEnum, ModalTypes, OBTFlightCabinClass, PREFERENCE_VALUES, ParkingEnterpriseSearch, PersonTitles, PhoneNumberImpl, PreferredFlags, RailCompanies, RailDirection, RailEnterpriseSearch, RailJourneyFareType, RailSearchCriteria, RegExps, RiskLevelRanking, SchemaFormat, SearchHandler, ServiceProvider, SortMethod, SortTypesCar, SortTypesEurostar, SortTypesHotel, SortTypesIrl, SupplementaryBookingInfoImpl, Suppliers, TaxiFormMode, TimeWindow, TravellerObject, TravellerSearchTypes, URLS, USER_SIGNEDIN, USER_SIGNEDOUT, UserFavorurite, UserInfoImpl, ValidatorChecker, WellbeingEnum, Widgets, ages, defaultValidations, excludedExpression, filtersKeys, includedAccessibilityExpression, includedExpression, makeManagamentInfo, maxTravellerWellbeing, ɵ0, DistanceTypes as ɵb, DocGender as ɵc, DocType as ɵd, PreferenceKey as ɵf, FetchableList as ɵh, FetchableObject as ɵi, UpdateableObject as ɵj, BaseTester as ɵk };
21446
22419
  //# sourceMappingURL=sabstravtech-obtservices-base.js.map