@qite/tide-booking-component 1.4.112 → 1.4.114

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 (43) hide show
  1. package/build/build-cjs/index.js +425 -263
  2. package/build/build-cjs/src/search-results/components/book-packaging-entry/index.d.ts +1 -0
  3. package/build/build-cjs/src/search-results/components/book-packaging-entry/wl-sidebar.d.ts +2 -0
  4. package/build/build-cjs/src/search-results/components/search-results-container/search-results-container.d.ts +4 -1
  5. package/build/build-cjs/src/search-results/index.d.ts +1 -0
  6. package/build/build-cjs/src/shared/booking/summary.d.ts +1 -0
  7. package/build/build-cjs/src/shared/utils/booking-summary.d.ts +1 -0
  8. package/build/build-esm/index.js +424 -263
  9. package/build/build-esm/src/search-results/components/book-packaging-entry/index.d.ts +1 -0
  10. package/build/build-esm/src/search-results/components/book-packaging-entry/wl-sidebar.d.ts +2 -0
  11. package/build/build-esm/src/search-results/components/search-results-container/search-results-container.d.ts +4 -1
  12. package/build/build-esm/src/search-results/index.d.ts +1 -0
  13. package/build/build-esm/src/shared/booking/summary.d.ts +1 -0
  14. package/build/build-esm/src/shared/utils/booking-summary.d.ts +1 -0
  15. package/package.json +2 -2
  16. package/src/search-results/components/book-packaging-entry/index.tsx +60 -22
  17. package/src/search-results/components/book-packaging-entry/wl-sidebar.tsx +27 -16
  18. package/src/search-results/components/flight/flight-selection/independent-flight-selection.tsx +5 -2
  19. package/src/search-results/components/hotel/hotel-accommodation-results.tsx +11 -2
  20. package/src/search-results/components/search-results-container/search-results-container.tsx +22 -8
  21. package/src/search-results/index.tsx +3 -2
  22. package/src/shared/booking/summary.tsx +4 -2
  23. package/src/shared/booking/travelers-form.tsx +12 -6
  24. package/src/shared/components/flyin/flyin.tsx +10 -1
  25. package/src/shared/translations/ar-SA.json +3 -1
  26. package/src/shared/translations/da-DK.json +3 -1
  27. package/src/shared/translations/de-DE.json +3 -1
  28. package/src/shared/translations/en-GB.json +3 -1
  29. package/src/shared/translations/es-ES.json +3 -1
  30. package/src/shared/translations/fr-BE.json +3 -1
  31. package/src/shared/translations/fr-FR.json +3 -1
  32. package/src/shared/translations/is-IS.json +3 -1
  33. package/src/shared/translations/it-IT.json +3 -1
  34. package/src/shared/translations/ja-JP.json +3 -1
  35. package/src/shared/translations/nl-BE.json +3 -1
  36. package/src/shared/translations/nl-NL.json +3 -1
  37. package/src/shared/translations/no-NO.json +3 -1
  38. package/src/shared/translations/pl-PL.json +3 -1
  39. package/src/shared/translations/pt-PT.json +3 -1
  40. package/src/shared/translations/sv-SE.json +3 -1
  41. package/src/shared/utils/booking-summary.tsx +11 -0
  42. package/styles/components/_booking.scss +10 -0
  43. package/styles/components/_select-wrapper.scss +5 -0
@@ -505,7 +505,9 @@ var SUMMARY$f = {
505
505
  VOUCHER_VALIDATE: 'تحقق من القسيمة',
506
506
  ADD_VOUCHER: 'إضافة قسيمة',
507
507
  VOUCHER_VALID: 'القسيمة صالحة',
508
- VOUCHER_INVALID: 'القسيمة غير صالحة'
508
+ VOUCHER_INVALID: 'القسيمة غير صالحة',
509
+ REDIRECT: 'إعادة التوجيه إلى مزود الدفع...',
510
+ PROCESS_BOOKING: 'يرجى الانتظار، جاري معالجة حجزك'
509
511
  };
510
512
  var CONFIRMATION$f = {
511
513
  TITLE_TEXT_OFFER: 'تم طلب عرضك رقم {0}',
@@ -924,7 +926,9 @@ var SUMMARY$e = {
924
926
  VOUCHER_VALIDATE: 'Valider voucher',
925
927
  ADD_VOUCHER: 'Tilføj voucher',
926
928
  VOUCHER_VALID: 'Voucher er gyldig',
927
- VOUCHER_INVALID: 'Voucher er ikke gyldig'
929
+ VOUCHER_INVALID: 'Voucher er ikke gyldig',
930
+ REDIRECT: 'Omdirigerer til betalingsudbyder...',
931
+ PROCESS_BOOKING: 'Vent venligst, din booking behandles'
928
932
  };
929
933
  var CONFIRMATION$e = {
930
934
  TITLE_TEXT_OFFER: 'Dit tilbud med nummer {0} er blevet anmodet',
@@ -1343,7 +1347,9 @@ var SUMMARY$d = {
1343
1347
  VOUCHER_VALIDATE: 'Gutschein prüfen',
1344
1348
  ADD_VOUCHER: 'Gutschein hinzufügen',
1345
1349
  VOUCHER_VALID: 'Gutschein ist gültig',
1346
- VOUCHER_INVALID: 'Gutschein ist ungültig'
1350
+ VOUCHER_INVALID: 'Gutschein ist ungültig',
1351
+ REDIRECT: 'Weiterleitung zum Zahlungsanbieter...',
1352
+ PROCESS_BOOKING: 'Bitte warten Sie, Ihre Buchung wird bearbeitet'
1347
1353
  };
1348
1354
  var CONFIRMATION$d = {
1349
1355
  TITLE_TEXT_OFFER: 'Ihr Angebot mit der Nummer {0} wurde angefordert',
@@ -1767,7 +1773,9 @@ var SUMMARY$c = {
1767
1773
  VOUCHER_VALIDATE: 'Validate voucher',
1768
1774
  ADD_VOUCHER: 'Add voucher',
1769
1775
  VOUCHER_VALID: 'Voucher is valid',
1770
- VOUCHER_INVALID: 'Voucher is not valid'
1776
+ VOUCHER_INVALID: 'Voucher is not valid',
1777
+ REDIRECT: 'Redirecting to payment provider...',
1778
+ PROCESS_BOOKING: 'Please wait, your booking is being processed'
1771
1779
  };
1772
1780
  var CONFIRMATION$c = {
1773
1781
  TITLE_TEXT_OFFER: 'Your quote with number {0} has been requested',
@@ -2186,7 +2194,9 @@ var SUMMARY$b = {
2186
2194
  VOUCHER_VALIDATE: 'Validar vale',
2187
2195
  ADD_VOUCHER: 'Agregar vale',
2188
2196
  VOUCHER_VALID: 'Vale válido',
2189
- VOUCHER_INVALID: 'Vale no válido'
2197
+ VOUCHER_INVALID: 'Vale no válido',
2198
+ REDIRECT: 'Redirigiendo al proveedor de pagos...',
2199
+ PROCESS_BOOKING: 'Por favor, espere, su reserva se está procesando'
2190
2200
  };
2191
2201
  var CONFIRMATION$b = {
2192
2202
  TITLE_TEXT_OFFER: 'Su presupuesto con número {0} ha sido solicitado',
@@ -2610,7 +2620,9 @@ var SUMMARY$a = {
2610
2620
  VOUCHER_VALIDATE: 'Valider le bon',
2611
2621
  ADD_VOUCHER: 'Ajouter un bon',
2612
2622
  VOUCHER_VALID: 'Bon valide',
2613
- VOUCHER_INVALID: 'Bon invalide'
2623
+ VOUCHER_INVALID: 'Bon invalide',
2624
+ REDIRECT: 'Redirection vers le fournisseur de paiement...',
2625
+ PROCESS_BOOKING: 'Veuillez patienter, votre réservation est en cours de traitement'
2614
2626
  };
2615
2627
  var CONFIRMATION$a = {
2616
2628
  TITLE_TEXT_OFFER: 'Votre devis numéro {0} a été demandé',
@@ -3030,7 +3042,9 @@ var SUMMARY$9 = {
3030
3042
  VOUCHER_VALIDATE: 'Valider le bon',
3031
3043
  ADD_VOUCHER: 'Ajouter un bon',
3032
3044
  VOUCHER_VALID: 'Bon valide',
3033
- VOUCHER_INVALID: 'Bon invalide'
3045
+ VOUCHER_INVALID: 'Bon invalide',
3046
+ REDIRECT: 'Redirection vers le fournisseur de paiement...',
3047
+ PROCESS_BOOKING: 'Veuillez patienter, votre réservation est en cours de traitement'
3034
3048
  };
3035
3049
  var CONFIRMATION$9 = {
3036
3050
  TITLE_TEXT_OFFER: 'Votre devis numéro {0} a été demandé',
@@ -3449,7 +3463,9 @@ var SUMMARY$8 = {
3449
3463
  VOUCHER_VALIDATE: 'Staðfesta miða',
3450
3464
  ADD_VOUCHER: 'Bæta við miða',
3451
3465
  VOUCHER_VALID: 'Miðinn er gildur',
3452
- VOUCHER_INVALID: 'Miðinn er ógildur'
3466
+ VOUCHER_INVALID: 'Miðinn er ógildur',
3467
+ REDIRECT: 'Beinir á greiðsluaðila...',
3468
+ PROCESS_BOOKING: 'Vinsamlegast bíðið, pöntunin þín er í vinnslu'
3453
3469
  };
3454
3470
  var CONFIRMATION$8 = {
3455
3471
  TITLE_TEXT_OFFER: 'Tilboð þitt nr. {0} hefur verið beðið um',
@@ -3868,7 +3884,9 @@ var SUMMARY$7 = {
3868
3884
  VOUCHER_VALIDATE: 'Valida voucher',
3869
3885
  ADD_VOUCHER: 'Aggiungi voucher',
3870
3886
  VOUCHER_VALID: 'Voucher valido',
3871
- VOUCHER_INVALID: 'Voucher non valido'
3887
+ VOUCHER_INVALID: 'Voucher non valido',
3888
+ REDIRECT: 'Reindirizzamento al fornitore di pagamento...',
3889
+ PROCESS_BOOKING: 'Attendere prego, la tua prenotazione è in fase di elaborazione'
3872
3890
  };
3873
3891
  var CONFIRMATION$7 = {
3874
3892
  TITLE_TEXT_OFFER: 'Il tuo preventivo numero {0} è stato richiesto',
@@ -4292,7 +4310,9 @@ var SUMMARY$6 = {
4292
4310
  VOUCHER_VALIDATE: 'Valideer voucher',
4293
4311
  ADD_VOUCHER: 'Voucher toevoegen',
4294
4312
  VOUCHER_VALID: 'Voucher is geldig',
4295
- VOUCHER_INVALID: 'Voucher is niet geldig'
4313
+ VOUCHER_INVALID: 'Voucher is niet geldig',
4314
+ REDIRECT: 'Redirecten naar betalingsprovider...',
4315
+ PROCESS_BOOKING: 'Even geduld, we verwerken je boeking'
4296
4316
  };
4297
4317
  var CONFIRMATION$6 = {
4298
4318
  TITLE_TEXT_OFFER: 'Je offerte met nummer {0} is aangevraagd',
@@ -4712,7 +4732,9 @@ var SUMMARY$5 = {
4712
4732
  VOUCHER_VALIDATE: 'Voucher valideren',
4713
4733
  ADD_VOUCHER: 'Voucher toevoegen',
4714
4734
  VOUCHER_VALID: 'Voucher is geldig',
4715
- VOUCHER_INVALID: 'Voucher is ongeldig'
4735
+ VOUCHER_INVALID: 'Voucher is ongeldig',
4736
+ REDIRECT: 'Redirecten naar betalingsprovider...',
4737
+ PROCESS_BOOKING: 'Even geduld, we verwerken je boeking'
4716
4738
  };
4717
4739
  var CONFIRMATION$5 = {
4718
4740
  TITLE_TEXT_OFFER: 'Uw offerte met nummer {0} is aangevraagd',
@@ -5132,7 +5154,9 @@ var SUMMARY$4 = {
5132
5154
  VOUCHER_VALIDATE: 'Valider verdikupong',
5133
5155
  ADD_VOUCHER: 'Legg til verdikupong',
5134
5156
  VOUCHER_VALID: 'Verdikupongen er gyldig',
5135
- VOUCHER_INVALID: 'Verdikupongen er ugyldig'
5157
+ VOUCHER_INVALID: 'Verdikupongen er ugyldig',
5158
+ REDIRECT: 'Omdirigerer til betalingsleverandør...',
5159
+ PROCESS_BOOKING: 'Vennligst vent, bestillingen din behandles'
5136
5160
  };
5137
5161
  var CONFIRMATION$4 = {
5138
5162
  TITLE_TEXT_OFFER: 'Tilbudet ditt med nummer {0} er forespurt',
@@ -5552,7 +5576,9 @@ var SUMMARY$3 = {
5552
5576
  VOUCHER_VALIDATE: 'Zweryfikuj voucher',
5553
5577
  ADD_VOUCHER: 'Dodaj voucher',
5554
5578
  VOUCHER_VALID: 'Voucher jest ważny',
5555
- VOUCHER_INVALID: 'Voucher jest nieważny'
5579
+ VOUCHER_INVALID: 'Voucher jest nieważny',
5580
+ REDIRECT: 'Przekierowanie do dostawcy płatności...',
5581
+ PROCESS_BOOKING: 'Proszę czekać, Twoja rezerwacja jest przetwarzana'
5556
5582
  };
5557
5583
  var CONFIRMATION$3 = {
5558
5584
  TITLE_TEXT_OFFER: 'Twoja wycena o numerze {0} została wysłana',
@@ -5972,7 +5998,9 @@ var SUMMARY$2 = {
5972
5998
  VOUCHER_VALIDATE: 'Validar voucher',
5973
5999
  ADD_VOUCHER: 'Adicionar voucher',
5974
6000
  VOUCHER_VALID: 'O voucher é válido',
5975
- VOUCHER_INVALID: 'O voucher não é válido'
6001
+ VOUCHER_INVALID: 'O voucher não é válido',
6002
+ REDIRECT: 'Redirecionando para o provedor de pagamento...',
6003
+ PROCESS_BOOKING: 'Por favor, aguarde, sua reserva está sendo processada'
5976
6004
  };
5977
6005
  var CONFIRMATION$2 = {
5978
6006
  TITLE_TEXT_OFFER: 'O seu orçamento com o número {0} foi solicitado',
@@ -6392,7 +6420,9 @@ var SUMMARY$1 = {
6392
6420
  VOUCHER_VALIDATE: 'Validera voucher',
6393
6421
  ADD_VOUCHER: 'Lägg till voucher',
6394
6422
  VOUCHER_VALID: 'Vouchern är giltig',
6395
- VOUCHER_INVALID: 'Vouchern är ogiltig'
6423
+ VOUCHER_INVALID: 'Vouchern är ogiltig',
6424
+ REDIRECT: 'Omdirigerar till betalningsleverantör...',
6425
+ PROCESS_BOOKING: 'Vänligen vänta, din bokning behandlas'
6396
6426
  };
6397
6427
  var CONFIRMATION$1 = {
6398
6428
  TITLE_TEXT_OFFER: 'Din offert med nummer {0} har begärts',
@@ -6811,7 +6841,9 @@ var SUMMARY = {
6811
6841
  VOUCHER_VALIDATE: 'バウチャーを確認',
6812
6842
  ADD_VOUCHER: 'バウチャーを追加',
6813
6843
  VOUCHER_VALID: 'バウチャーは有効です',
6814
- VOUCHER_INVALID: 'バウチャーは無効です'
6844
+ VOUCHER_INVALID: 'バウチャーは無効です',
6845
+ REDIRECT: '支払いプロバイダーにリダイレクト中...',
6846
+ PROCESS_BOOKING: 'お待ちください、予約を処理中です'
6815
6847
  };
6816
6848
  var CONFIRMATION = {
6817
6849
  TITLE_TEXT_OFFER: '見積もり番号 {0} の依頼を受け付けました',
@@ -28016,15 +28048,20 @@ function createInitialValuesFromRooms(formRooms, startDate, agentAdressId, perso
28016
28048
  }
28017
28049
  function createInitialValuesFromEditablePackagingEntry(editablePackagingEntry, agentAdressId) {
28018
28050
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
28019
- console.log('editablePackagingEntry?.pax:', editablePackagingEntry === null || editablePackagingEntry === void 0 ? void 0 : editablePackagingEntry.pax);
28020
28051
  var pax =
28021
28052
  (_a = editablePackagingEntry === null || editablePackagingEntry === void 0 ? void 0 : editablePackagingEntry.pax) !== null && _a !== void 0 ? _a : [];
28022
28053
  var rooms = editablePackagingEntry.rooms.map(function (room) {
28023
28054
  var roomPax = pax.filter(function (x) {
28024
28055
  return room.paxIds.includes(x.id);
28025
28056
  });
28057
+ var adults = roomPax.filter(function (x) {
28058
+ return x.age >= 18;
28059
+ });
28060
+ var children = roomPax.filter(function (x) {
28061
+ return x.age < 18;
28062
+ });
28026
28063
  return {
28027
- adults: roomPax.map(function (roomTraveler) {
28064
+ adults: adults.map(function (roomTraveler) {
28028
28065
  var _a, _b;
28029
28066
  return {
28030
28067
  id: roomTraveler.id,
@@ -28034,7 +28071,16 @@ function createInitialValuesFromEditablePackagingEntry(editablePackagingEntry, a
28034
28071
  gender: ''
28035
28072
  };
28036
28073
  }),
28037
- children: []
28074
+ children: children.map(function (roomTraveler) {
28075
+ var _a, _b;
28076
+ return {
28077
+ id: roomTraveler.id,
28078
+ firstName: (_a = roomTraveler.firstName) !== null && _a !== void 0 ? _a : '',
28079
+ lastName: (_b = roomTraveler.lastName) !== null && _b !== void 0 ? _b : '',
28080
+ birthDate: roomTraveler.dateOfBirth ? format$2(new Date(roomTraveler.dateOfBirth), 'yyyy-MM-dd') : '',
28081
+ gender: ''
28082
+ };
28083
+ })
28038
28084
  };
28039
28085
  });
28040
28086
  var values = createInitialValuesFromRooms(
@@ -28086,8 +28132,6 @@ function applyTravelersFormValuesToEditablePackagingEntry(editablePackagingEntry
28086
28132
  var travelers = values.rooms.flatMap(function (room) {
28087
28133
  return __spreadArray(__spreadArray([], room.adults, true), room.children, true);
28088
28134
  });
28089
- console.log('Applying form values:', values);
28090
- console.log('editablePackagingEntry:', editablePackagingEntry);
28091
28135
  return __assign(__assign({}, editablePackagingEntry), {
28092
28136
  pax: ((_a = editablePackagingEntry.pax) !== null && _a !== void 0 ? _a : []).map(function (pax) {
28093
28137
  var _a, _b;
@@ -41401,11 +41445,20 @@ var HotelAccommodationResults = function (_a) {
41401
41445
  function () {
41402
41446
  var shouldShowAll =
41403
41447
  (context === null || context === void 0 ? void 0 : context.searchConfiguration.qsmType) !== build.PortalQsmType.AccommodationAndFlight || isFlyIn;
41448
+ var filteredMapperResults = mappedResults;
41449
+ if (selectedPackagingAccoResult) {
41450
+ filteredMapperResults = mappedResults.filter(function (result) {
41451
+ return result.code !== selectedPackagingAccoResult.code;
41452
+ });
41453
+ }
41404
41454
  if (shouldShowAll) {
41405
- return mappedResults;
41455
+ if (isFlyIn) {
41456
+ return mappedResults;
41457
+ }
41458
+ return filteredMapperResults;
41406
41459
  }
41407
41460
  if (selectedPackagingAccoResult) {
41408
- return mappedResults
41461
+ return filteredMapperResults
41409
41462
  .filter(function (result) {
41410
41463
  return result.code !== selectedPackagingAccoResult.code;
41411
41464
  })
@@ -42985,6 +43038,13 @@ var FlyIn = function (_a) {
42985
43038
  dispatch(setSortType(newSortByType));
42986
43039
  }
42987
43040
  };
43041
+ var onHandleConfirm = function () {
43042
+ if (context === null || context === void 0 ? void 0 : context.packagingEntry) {
43043
+ handleConfirm === null || handleConfirm === void 0 ? void 0 : handleConfirm();
43044
+ } else {
43045
+ dispatch(setBookPackagingEntry(true));
43046
+ }
43047
+ };
42988
43048
  return React__default.createElement(
42989
43049
  'div',
42990
43050
  {
@@ -43122,7 +43182,7 @@ var FlyIn = function (_a) {
43122
43182
  ),
43123
43183
  (srpType === build.PortalQsmType.Accommodation || srpType === build.PortalQsmType.AccommodationAndFlight) &&
43124
43184
  flyInType === 'acco-details' &&
43125
- React__default.createElement(AccommodationFlyIn, { isLoading: detailsLoading, handleConfirm: handleConfirm }),
43185
+ React__default.createElement(AccommodationFlyIn, { isLoading: detailsLoading, handleConfirm: onHandleConfirm }),
43126
43186
  srpType === build.PortalQsmType.AccommodationAndFlight &&
43127
43187
  (flyInType === 'flight-outward-results' || flyInType === 'flight-return-results') &&
43128
43188
  React__default.createElement(PackageingFlightsFlyIn, { isOpen: isOpen, setIsOpen: setIsOpen, toggleFilters: toggleFilters, filtersOpen: filtersOpen }),
@@ -43960,8 +44020,11 @@ var IndependentFlightSelection = function (_a) {
43960
44020
  [searchResults, selectedReturnKey]
43961
44021
  );
43962
44022
  var firstResultDate = uniqueOutwardFlights.length > 0 ? uniqueOutwardFlights[0].outward.segments[0].departureDateTime : null;
44023
+ var firstResultReturnDate = uniqueReturnFlights.length > 0 ? uniqueReturnFlights[0].return.segments[0].departureDateTime : null;
43963
44024
  var firstResultDay = firstResultDate ? format$2(firstResultDate, 'd') : null;
43964
44025
  var firstResultMonth = firstResultDate ? format$2(firstResultDate, 'MMM') : null;
44026
+ var firstResultReturnDay = firstResultReturnDate ? format$2(firstResultReturnDate, 'd') : null;
44027
+ var firstResultReturnMonth = firstResultReturnDate ? format$2(firstResultReturnDate, 'MMM') : null;
43965
44028
  return React__default.createElement(
43966
44029
  React__default.Fragment,
43967
44030
  null,
@@ -44010,7 +44073,12 @@ var IndependentFlightSelection = function (_a) {
44010
44073
  React__default.createElement(
44011
44074
  'div',
44012
44075
  { className: 'search__results__label search__results__label--secondary' },
44013
- React__default.createElement('div', { className: 'search__results__label__date' }),
44076
+ React__default.createElement(
44077
+ 'div',
44078
+ { className: 'search__results__label__date' },
44079
+ React__default.createElement('p', { className: 'search__results__label__date-date' }, firstResultReturnDay),
44080
+ React__default.createElement('p', null, firstResultReturnMonth)
44081
+ ),
44014
44082
  React__default.createElement(
44015
44083
  'div',
44016
44084
  { className: 'search__results__label__text' },
@@ -46466,6 +46534,83 @@ var DayByDayExcursions = function () {
46466
46534
  );
46467
46535
  };
46468
46536
 
46537
+ var renderEditablePackagingEntrySummaryOptions = function (editablePackagingEntry, priceDetails, translations) {
46538
+ var _a, _b;
46539
+ var priceDetailsByProduct = groupBy(
46540
+ (_a = priceDetails === null || priceDetails === void 0 ? void 0 : priceDetails.details) !== null && _a !== void 0 ? _a : [],
46541
+ function (detail) {
46542
+ return ''.concat(detail.productCode, '|').concat(detail.accommodationCode);
46543
+ }
46544
+ );
46545
+ return (
46546
+ (_b = editablePackagingEntry === null || editablePackagingEntry === void 0 ? void 0 : editablePackagingEntry.lines) !== null && _b !== void 0 ? _b : []
46547
+ ).map(function (line) {
46548
+ var _a, _b, _c;
46549
+ var groupedPriceDetails = (_a = priceDetailsByProduct[''.concat(line.productCode, '|').concat(line.accommodationCode)]) !== null && _a !== void 0 ? _a : [];
46550
+ var visiblePriceDetails = groupedPriceDetails.filter(function (detail) {
46551
+ return detail.showPrice || detail.isSeparate;
46552
+ });
46553
+ return React__default.createElement(
46554
+ 'li',
46555
+ { key: line.guid },
46556
+ React__default.createElement('h6', null, line.productName),
46557
+ React__default.createElement(
46558
+ 'ul',
46559
+ null,
46560
+ React__default.createElement('li', { className: 'list__item' }, compact([line.accommodationName, line.regimeName]).join(', ')),
46561
+ (_c = (_b = line.flightInformation) === null || _b === void 0 ? void 0 : _b.flightLines) === null || _c === void 0
46562
+ ? void 0
46563
+ : _c.map(function (flightLine, index) {
46564
+ var _a, _b;
46565
+ return React__default.createElement(
46566
+ 'li',
46567
+ { className: 'list__item', key: ''.concat(line.guid, '-').concat(index) },
46568
+ flightLine.departureAirportCode,
46569
+ ' ',
46570
+ (_a = flightLine.departureTime) === null || _a === void 0 ? void 0 : _a.slice(0, 5),
46571
+ ' > ',
46572
+ flightLine.arrivalAirportCode,
46573
+ ' ',
46574
+ (_b = flightLine.arrivalTime) === null || _b === void 0 ? void 0 : _b.slice(0, 5),
46575
+ ' (',
46576
+ flightLine.operatingFlightNumber || ''.concat(flightLine.airlineCode).concat(flightLine.flightNumber),
46577
+ ')'
46578
+ );
46579
+ }),
46580
+ !isEmpty(visiblePriceDetails) &&
46581
+ visiblePriceDetails.map(function (detail, index) {
46582
+ var _a;
46583
+ return React__default.createElement(
46584
+ 'li',
46585
+ { className: 'list__item', key: ''.concat(line.guid, '-price-').concat(index) },
46586
+ detail.priceDescription,
46587
+ ': ',
46588
+ (_a = detail.total) === null || _a === void 0 ? void 0 : _a.toLocaleString(undefined, { style: 'currency', currency: 'EUR' })
46589
+ );
46590
+ })
46591
+ ),
46592
+ React__default.createElement(
46593
+ 'p',
46594
+ null,
46595
+ '(',
46596
+ line.from === line.to
46597
+ ? getDateText(line.from)
46598
+ : React__default.createElement(React__default.Fragment, null, getDateText(line.from), ' > ', getDateText(line.to)),
46599
+ ')'
46600
+ )
46601
+ );
46602
+ });
46603
+ };
46604
+ var getImageSrcFromHtml = function (html) {
46605
+ var _a;
46606
+ if (!html || typeof window === 'undefined') {
46607
+ return undefined;
46608
+ }
46609
+ var doc = new DOMParser().parseFromString(html, 'text/html');
46610
+ var img = doc.querySelector('img');
46611
+ return (_a = img === null || img === void 0 ? void 0 : img.getAttribute('src')) !== null && _a !== void 0 ? _a : undefined;
46612
+ };
46613
+
46469
46614
  var mapToSidebarFlightMetaData = function (entryLine) {
46470
46615
  var _a, _b;
46471
46616
  return {
@@ -46525,22 +46670,16 @@ var selectSeparatePackagePriceDetails = function (priceDetails) {
46525
46670
  return result;
46526
46671
  };
46527
46672
  var WLSidebar = function (_a) {
46528
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
46529
- var activeSearchSeed = _a.activeSearchSeed;
46673
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3;
46674
+ var activeSearchSeed = _a.activeSearchSeed,
46675
+ packagingAccoResult = _a.packagingAccoResult;
46530
46676
  var context = useContext(SearchResultsConfigurationContext);
46531
- if (!context) {
46532
- return null;
46533
- }
46534
- var translations = getTranslations((_b = context.languageCode) !== null && _b !== void 0 ? _b : 'en-GB');
46535
- var _u = useSelector(function (state) {
46677
+ var _4 = useSelector(function (state) {
46536
46678
  return state.searchResults;
46537
46679
  }),
46538
- editablePackagingEntry = _u.editablePackagingEntry,
46539
- priceDetails = _u.priceDetails;
46540
- // Map editablePackagingEntry to sidebar props (example, adjust as needed)
46541
- if (!editablePackagingEntry) {
46542
- return null;
46543
- }
46680
+ editablePackagingEntry = _4.editablePackagingEntry,
46681
+ priceDetails = _4.priceDetails;
46682
+ var translations = getTranslations((_b = context === null || context === void 0 ? void 0 : context.languageCode) !== null && _b !== void 0 ? _b : 'en-GB');
46544
46683
  var sortedLines = useMemo(
46545
46684
  function () {
46546
46685
  var _a;
@@ -46560,35 +46699,70 @@ var WLSidebar = function (_a) {
46560
46699
  },
46561
46700
  [editablePackagingEntry]
46562
46701
  );
46702
+ var accoImage = useMemo(
46703
+ function () {
46704
+ return getImageSrcFromHtml(packagingAccoResult === null || packagingAccoResult === void 0 ? void 0 : packagingAccoResult.contents);
46705
+ },
46706
+ [packagingAccoResult === null || packagingAccoResult === void 0 ? void 0 : packagingAccoResult.contents]
46707
+ );
46708
+ if (!context || !editablePackagingEntry) {
46709
+ return null;
46710
+ }
46563
46711
  var firstEntryLine = first(sortedLines);
46564
46712
  var accommodationLines = editablePackagingEntry.lines.filter(function (line) {
46565
46713
  return line.serviceType === ACCOMMODATION_SERVICE_TYPE;
46566
46714
  });
46567
46715
  var accommodationLine = (_c = first(accommodationLines)) !== null && _c !== void 0 ? _c : firstEntryLine;
46568
46716
  var location =
46569
- (_l =
46570
- (_j =
46571
- (_g =
46572
- (_e =
46573
- (_d = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.location) === null || _d === void 0
46717
+ context.searchConfiguration.qsmType === build.PortalQsmType.Accommodation
46718
+ ? (_m =
46719
+ (_k =
46720
+ (_h =
46721
+ (_f =
46722
+ (_d = packagingAccoResult === null || packagingAccoResult === void 0 ? void 0 : packagingAccoResult.name) !== null && _d !== void 0
46723
+ ? _d
46724
+ : (_e = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.location) === null || _e === void 0
46725
+ ? void 0
46726
+ : _e.name) !== null && _f !== void 0
46727
+ ? _f
46728
+ : (_g = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.oord) === null || _g === void 0
46729
+ ? void 0
46730
+ : _g.name) !== null && _h !== void 0
46731
+ ? _h
46732
+ : (_j = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.region) === null || _j === void 0
46574
46733
  ? void 0
46575
- : _d.name) !== null && _e !== void 0
46576
- ? _e
46577
- : (_f = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.oord) === null || _f === void 0
46734
+ : _j.name) !== null && _k !== void 0
46735
+ ? _k
46736
+ : (_l = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.country) === null || _l === void 0
46578
46737
  ? void 0
46579
- : _f.name) !== null && _g !== void 0
46580
- ? _g
46581
- : (_h = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.region) === null || _h === void 0
46582
- ? void 0
46583
- : _h.name) !== null && _j !== void 0
46584
- ? _j
46585
- : (_k = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.country) === null || _k === void 0
46738
+ : _l.name) !== null && _m !== void 0
46739
+ ? _m
46740
+ : (_o = firstEntryLine === null || firstEntryLine === void 0 ? void 0 : firstEntryLine.location) === null || _o === void 0
46586
46741
  ? void 0
46587
- : _k.name) !== null && _l !== void 0
46588
- ? _l
46589
- : (_m = firstEntryLine === null || firstEntryLine === void 0 ? void 0 : firstEntryLine.location) === null || _m === void 0
46742
+ : _o.name
46743
+ : (_w =
46744
+ (_u =
46745
+ (_s =
46746
+ (_q =
46747
+ (_p = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.location) === null || _p === void 0
46748
+ ? void 0
46749
+ : _p.name) !== null && _q !== void 0
46750
+ ? _q
46751
+ : (_r = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.oord) === null || _r === void 0
46752
+ ? void 0
46753
+ : _r.name) !== null && _s !== void 0
46754
+ ? _s
46755
+ : (_t = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.region) === null || _t === void 0
46756
+ ? void 0
46757
+ : _t.name) !== null && _u !== void 0
46758
+ ? _u
46759
+ : (_v = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.country) === null || _v === void 0
46760
+ ? void 0
46761
+ : _v.name) !== null && _w !== void 0
46762
+ ? _w
46763
+ : (_x = firstEntryLine === null || firstEntryLine === void 0 ? void 0 : firstEntryLine.location) === null || _x === void 0
46590
46764
  ? void 0
46591
- : _m.name;
46765
+ : _x.name;
46592
46766
  var rooms =
46593
46767
  (activeSearchSeed === null || activeSearchSeed === void 0
46594
46768
  ? void 0
@@ -46618,7 +46792,7 @@ var WLSidebar = function (_a) {
46618
46792
  var outboundFlightMetaData = outboundFlight ? mapToSidebarFlightMetaData(outboundFlight) : undefined;
46619
46793
  var returnFlightMetaData = returnFlight ? mapToSidebarFlightMetaData(returnFlight) : undefined;
46620
46794
  var basePrice = sum(
46621
- (_o =
46795
+ (_y =
46622
46796
  priceDetails === null || priceDetails === void 0
46623
46797
  ? void 0
46624
46798
  : priceDetails.details
@@ -46627,18 +46801,18 @@ var WLSidebar = function (_a) {
46627
46801
  })
46628
46802
  .map(function (pd) {
46629
46803
  return pd.price * pd.amount;
46630
- })) !== null && _o !== void 0
46631
- ? _o
46804
+ })) !== null && _y !== void 0
46805
+ ? _y
46632
46806
  : []
46633
46807
  );
46634
46808
  var separateExtraPriceDetails =
46635
- (_p =
46809
+ (_z =
46636
46810
  priceDetails === null || priceDetails === void 0
46637
46811
  ? void 0
46638
46812
  : priceDetails.details.filter(function (pd) {
46639
46813
  return !pd.isInPackage && pd.isSeparate;
46640
- })) !== null && _p !== void 0
46641
- ? _p
46814
+ })) !== null && _z !== void 0
46815
+ ? _z
46642
46816
  : [];
46643
46817
  var totalPrice = sum(
46644
46818
  __spreadArray(
@@ -46650,22 +46824,22 @@ var WLSidebar = function (_a) {
46650
46824
  )
46651
46825
  );
46652
46826
  var includedCosts = selectSeparatePackagePriceDetails(
46653
- (_q =
46827
+ (_0 =
46654
46828
  priceDetails === null || priceDetails === void 0
46655
46829
  ? void 0
46656
46830
  : priceDetails.details.filter(function (pd) {
46657
46831
  return pd.isInPackage;
46658
- })) !== null && _q !== void 0
46659
- ? _q
46832
+ })) !== null && _0 !== void 0
46833
+ ? _0
46660
46834
  : []
46661
46835
  );
46662
46836
  return React__default.createElement(SharedSidebar, {
46663
46837
  productName: location !== null && location !== void 0 ? location : '',
46664
- thumbnailUrl: (_r = context.destinationImage) === null || _r === void 0 ? void 0 : _r.url,
46838
+ thumbnailUrl: accoImage !== null && accoImage !== void 0 ? accoImage : (_1 = context.destinationImage) === null || _1 === void 0 ? void 0 : _1.url,
46665
46839
  translations: translations,
46666
46840
  travelerRooms: travelerRooms,
46667
- startDateText: ((_s = first(sortedLines)) === null || _s === void 0 ? void 0 : _s.from) && formatDate(new Date(first(sortedLines).from)),
46668
- endDateText: ((_t = last(sortedLines)) === null || _t === void 0 ? void 0 : _t.to) && formatDate(new Date(last(sortedLines).to)),
46841
+ startDateText: ((_2 = first(sortedLines)) === null || _2 === void 0 ? void 0 : _2.from) && formatDate(new Date(first(sortedLines).from)),
46842
+ endDateText: ((_3 = last(sortedLines)) === null || _3 === void 0 ? void 0 : _3.to) && formatDate(new Date(last(sortedLines).to)),
46669
46843
  isLoading: !editablePackagingEntry || !priceDetails,
46670
46844
  loaderComponent: React__default.createElement(Spinner, null),
46671
46845
  departureFlightMetaData: outboundFlightMetaData,
@@ -46710,12 +46884,14 @@ var SharedSummary = function (_a) {
46710
46884
  customValidateText = _a.customValidateText,
46711
46885
  _j = _a.isSubmitting,
46712
46886
  isSubmitting = _j === void 0 ? false : _j,
46713
- _k = _a.userValidated,
46714
- userValidated = _k === void 0 ? true : _k,
46887
+ _k = _a.skipPayment,
46888
+ skipPayment = _k === void 0 ? false : _k,
46889
+ _l = _a.userValidated,
46890
+ userValidated = _l === void 0 ? true : _l,
46715
46891
  renderOptions = _a.renderOptions,
46716
- renderPreviousButton = _a.renderPreviousButton,
46717
- renderLoader = _a.renderLoader,
46718
- onSubmit = _a.onSubmit,
46892
+ renderPreviousButton = _a.renderPreviousButton;
46893
+ _a.renderLoader;
46894
+ var onSubmit = _a.onSubmit,
46719
46895
  onRemarksChange = _a.onRemarksChange,
46720
46896
  onCheckboxesChange = _a.onCheckboxesChange,
46721
46897
  onNotificationsChange = _a.onNotificationsChange,
@@ -46724,9 +46900,9 @@ var SharedSummary = function (_a) {
46724
46900
  onAddVoucher = _a.onAddVoucher,
46725
46901
  onRemoveVoucher = _a.onRemoveVoucher,
46726
46902
  onUserValidatedChange = _a.onUserValidatedChange;
46727
- var _l = useState(checkboxes),
46728
- localCheckboxes = _l[0],
46729
- setLocalCheckboxes = _l[1];
46903
+ var _m = useState(checkboxes),
46904
+ localCheckboxes = _m[0],
46905
+ setLocalCheckboxes = _m[1];
46730
46906
  useEffect(
46731
46907
  function () {
46732
46908
  setLocalCheckboxes(checkboxes);
@@ -46773,7 +46949,7 @@ var SharedSummary = function (_a) {
46773
46949
  return React__default.createElement(
46774
46950
  React__default.Fragment,
46775
46951
  null,
46776
- isSubmitting && ((renderLoader === null || renderLoader === void 0 ? void 0 : renderLoader()) || React__default.createElement(Loader, null)),
46952
+ isSubmitting && React__default.createElement(Spinner, { label: skipPayment ? translations.SUMMARY.PROCESS_BOOKING : translations.SUMMARY.REDIRECT }),
46777
46953
  !isSubmitting &&
46778
46954
  React__default.createElement(
46779
46955
  'form',
@@ -47179,74 +47355,6 @@ var SharedSummary = function (_a) {
47179
47355
  );
47180
47356
  };
47181
47357
 
47182
- var renderEditablePackagingEntrySummaryOptions = function (editablePackagingEntry, priceDetails, translations) {
47183
- var _a, _b;
47184
- var priceDetailsByProduct = groupBy(
47185
- (_a = priceDetails === null || priceDetails === void 0 ? void 0 : priceDetails.details) !== null && _a !== void 0 ? _a : [],
47186
- function (detail) {
47187
- return ''.concat(detail.productCode, '|').concat(detail.accommodationCode);
47188
- }
47189
- );
47190
- return (
47191
- (_b = editablePackagingEntry === null || editablePackagingEntry === void 0 ? void 0 : editablePackagingEntry.lines) !== null && _b !== void 0 ? _b : []
47192
- ).map(function (line) {
47193
- var _a, _b, _c;
47194
- var groupedPriceDetails = (_a = priceDetailsByProduct[''.concat(line.productCode, '|').concat(line.accommodationCode)]) !== null && _a !== void 0 ? _a : [];
47195
- var visiblePriceDetails = groupedPriceDetails.filter(function (detail) {
47196
- return detail.showPrice || detail.isSeparate;
47197
- });
47198
- return React__default.createElement(
47199
- 'li',
47200
- { key: line.guid },
47201
- React__default.createElement('h6', null, line.productName),
47202
- React__default.createElement(
47203
- 'ul',
47204
- null,
47205
- React__default.createElement('li', { className: 'list__item' }, compact([line.accommodationName, line.regimeName]).join(', ')),
47206
- (_c = (_b = line.flightInformation) === null || _b === void 0 ? void 0 : _b.flightLines) === null || _c === void 0
47207
- ? void 0
47208
- : _c.map(function (flightLine, index) {
47209
- var _a, _b;
47210
- return React__default.createElement(
47211
- 'li',
47212
- { className: 'list__item', key: ''.concat(line.guid, '-').concat(index) },
47213
- flightLine.departureAirportCode,
47214
- ' ',
47215
- (_a = flightLine.departureTime) === null || _a === void 0 ? void 0 : _a.slice(0, 5),
47216
- ' > ',
47217
- flightLine.arrivalAirportCode,
47218
- ' ',
47219
- (_b = flightLine.arrivalTime) === null || _b === void 0 ? void 0 : _b.slice(0, 5),
47220
- ' (',
47221
- flightLine.operatingFlightNumber || ''.concat(flightLine.airlineCode).concat(flightLine.flightNumber),
47222
- ')'
47223
- );
47224
- }),
47225
- !isEmpty(visiblePriceDetails) &&
47226
- visiblePriceDetails.map(function (detail, index) {
47227
- var _a;
47228
- return React__default.createElement(
47229
- 'li',
47230
- { className: 'list__item', key: ''.concat(line.guid, '-price-').concat(index) },
47231
- detail.priceDescription,
47232
- ': ',
47233
- (_a = detail.total) === null || _a === void 0 ? void 0 : _a.toLocaleString(undefined, { style: 'currency', currency: 'EUR' })
47234
- );
47235
- })
47236
- ),
47237
- React__default.createElement(
47238
- 'p',
47239
- null,
47240
- '(',
47241
- line.from === line.to
47242
- ? getDateText(line.from)
47243
- : React__default.createElement(React__default.Fragment, null, getDateText(line.from), ' > ', getDateText(line.to)),
47244
- ')'
47245
- )
47246
- );
47247
- });
47248
- };
47249
-
47250
47358
  var travelerFormFields = [{ type: 'gender' }, { type: 'firstName' }, { type: 'lastName' }, { type: 'birthDate' }];
47251
47359
  var mainBookerFormFields = [
47252
47360
  { type: 'street' },
@@ -47268,41 +47376,59 @@ var travellersSettings = {
47268
47376
  mainBookerFormFields: mainBookerFormFields
47269
47377
  };
47270
47378
  var BookPackagingEntry = function (_a) {
47271
- var _b, _c;
47379
+ var _b;
47272
47380
  var activeSearchSeed = _a.activeSearchSeed,
47381
+ isLoading = _a.isLoading,
47273
47382
  isConfirmationPage = _a.isConfirmationPage;
47274
47383
  var context = useContext(SearchResultsConfigurationContext);
47275
47384
  var dispatch = useDispatch();
47276
- var _d = useSelector(function (state) {
47385
+ var _c = useSelector(function (state) {
47277
47386
  return state.searchResults;
47278
47387
  }),
47279
- editablePackagingEntry = _d.editablePackagingEntry,
47280
- priceDetails = _d.priceDetails,
47281
- currentStep = _d.currentStep,
47282
- bookingNumber = _d.bookingNumber;
47283
- var _e = useState([]),
47284
- countries = _e[0],
47285
- setCountries = _e[1];
47286
- var _f = useState(true),
47287
- userValidated = _f[0],
47288
- setUserValidated = _f[1];
47289
- var _g = useState(''),
47290
- remarks = _g[0],
47291
- setRemarks = _g[1];
47292
- var _h = useState(false),
47293
- isSubmitting = _h[0],
47294
- setIsSubmitting = _h[1];
47295
- if (!context || !editablePackagingEntry || !priceDetails) return null;
47296
- var config = {
47297
- host: context.tideConnection.host,
47298
- apiKey: context.tideConnection.apiKey
47299
- };
47300
- var translations = getTranslations((_b = context === null || context === void 0 ? void 0 : context.languageCode) !== null && _b !== void 0 ? _b : 'en-GB');
47388
+ editablePackagingEntry = _c.editablePackagingEntry,
47389
+ priceDetails = _c.priceDetails,
47390
+ currentStep = _c.currentStep,
47391
+ bookingNumber = _c.bookingNumber,
47392
+ selectedPackagingAccoResultCode = _c.selectedPackagingAccoResultCode,
47393
+ packagingAccoResults = _c.packagingAccoResults;
47394
+ var _d = useState([]),
47395
+ countries = _d[0],
47396
+ setCountries = _d[1];
47397
+ var _e = useState(true),
47398
+ userValidated = _e[0],
47399
+ setUserValidated = _e[1];
47400
+ var _f = useState(''),
47401
+ remarks = _f[0],
47402
+ setRemarks = _f[1];
47403
+ var _g = useState(false),
47404
+ isSubmitting = _g[0],
47405
+ setIsSubmitting = _g[1];
47406
+ var _h = useState(null),
47407
+ selectedPackagingAccoResult = _h[0],
47408
+ setSelectedPackagingAccoResult = _h[1];
47409
+ var translations = useMemo(
47410
+ function () {
47411
+ var _a;
47412
+ return getTranslations((_a = context === null || context === void 0 ? void 0 : context.languageCode) !== null && _a !== void 0 ? _a : 'en-GB');
47413
+ },
47414
+ [context === null || context === void 0 ? void 0 : context.languageCode]
47415
+ );
47301
47416
  var stepLabels = [translations.STEPS.PERSONAL_DETAILS, translations.STEPS.SUMMARY, translations.STEPS.CONFIRMATION];
47302
- console.log('editablePackagingEntry in WLSidebar:', editablePackagingEntry);
47303
- console.log('priceDetails in WLSidebar:', priceDetails);
47417
+ var config = useMemo(
47418
+ function () {
47419
+ if (!context) return null;
47420
+ return {
47421
+ host: context.tideConnection.host,
47422
+ apiKey: context.tideConnection.apiKey
47423
+ };
47424
+ },
47425
+ [context]
47426
+ );
47304
47427
  var initialValues = useMemo(
47305
47428
  function () {
47429
+ if (!editablePackagingEntry) {
47430
+ return {};
47431
+ }
47306
47432
  return createInitialValuesFromEditablePackagingEntry(editablePackagingEntry);
47307
47433
  },
47308
47434
  [editablePackagingEntry === null || editablePackagingEntry === void 0 ? void 0 : editablePackagingEntry.transactionId]
@@ -47314,38 +47440,42 @@ var BookPackagingEntry = function (_a) {
47314
47440
  return validateForm(values, false, 'b2c', translations, travellersSettings.formFields, travellersSettings.mainBookerFormFields);
47315
47441
  },
47316
47442
  onSubmit: function (values) {
47443
+ if (!editablePackagingEntry) return;
47317
47444
  dispatch(setEditablePackagingEntry(applyTravelersFormValuesToEditablePackagingEntry(editablePackagingEntry, values)));
47318
47445
  dispatch(setCurrentStep(1));
47319
47446
  }
47320
47447
  });
47321
- useEffect(function () {
47322
- if (!context) return;
47323
- var controller = new AbortController();
47324
- (function () {
47325
- return __awaiter(void 0, void 0, void 0, function () {
47326
- var result;
47327
- return __generator(this, function (_b) {
47328
- switch (_b.label) {
47329
- case 0:
47330
- _b.trys.push([0, 2, , 3]);
47331
- return [4 /*yield*/, build.getCountries(config, controller.signal)];
47332
- case 1:
47333
- result = _b.sent();
47334
- setCountries(result.items);
47335
- return [3 /*break*/, 3];
47336
- case 2:
47337
- _b.sent();
47338
- return [3 /*break*/, 3];
47339
- case 3:
47340
- return [2 /*return*/];
47341
- }
47448
+ useEffect(
47449
+ function () {
47450
+ if (!context || !config) return;
47451
+ var controller = new AbortController();
47452
+ (function () {
47453
+ return __awaiter(void 0, void 0, void 0, function () {
47454
+ var result;
47455
+ return __generator(this, function (_b) {
47456
+ switch (_b.label) {
47457
+ case 0:
47458
+ _b.trys.push([0, 2, , 3]);
47459
+ return [4 /*yield*/, build.getCountries(config, controller.signal)];
47460
+ case 1:
47461
+ result = _b.sent();
47462
+ setCountries(result.items);
47463
+ return [3 /*break*/, 3];
47464
+ case 2:
47465
+ _b.sent();
47466
+ return [3 /*break*/, 3];
47467
+ case 3:
47468
+ return [2 /*return*/];
47469
+ }
47470
+ });
47342
47471
  });
47343
- });
47344
- })();
47345
- return function () {
47346
- return controller.abort();
47347
- };
47348
- }, []);
47472
+ })();
47473
+ return function () {
47474
+ return controller.abort();
47475
+ };
47476
+ },
47477
+ [context, config]
47478
+ );
47349
47479
  useEffect(
47350
47480
  function () {
47351
47481
  if (isConfirmationPage) {
@@ -47354,6 +47484,22 @@ var BookPackagingEntry = function (_a) {
47354
47484
  },
47355
47485
  [isConfirmationPage, dispatch]
47356
47486
  );
47487
+ useEffect(
47488
+ function () {
47489
+ var selectedPackagingAccoResult =
47490
+ packagingAccoResults === null || packagingAccoResults === void 0
47491
+ ? void 0
47492
+ : packagingAccoResults.find(function (result) {
47493
+ return result.code === selectedPackagingAccoResultCode;
47494
+ });
47495
+ if (selectedPackagingAccoResult) {
47496
+ setSelectedPackagingAccoResult(selectedPackagingAccoResult);
47497
+ }
47498
+ },
47499
+ [selectedPackagingAccoResultCode, packagingAccoResults]
47500
+ );
47501
+ if (!context || !editablePackagingEntry || !priceDetails || !config)
47502
+ return React__default.createElement(Spinner, { label: translations.SUMMARY.PROCESS_BOOKING });
47357
47503
  var handleSummarySubmit = function (e) {
47358
47504
  return __awaiter(void 0, void 0, void 0, function () {
47359
47505
  var updatedEditablePackagingEntry, redirectUrl, request, bookingResponse;
@@ -47379,7 +47525,7 @@ var BookPackagingEntry = function (_a) {
47379
47525
  dispatch(setEditablePackagingEntry(updatedEditablePackagingEntry));
47380
47526
  _c.label = 1;
47381
47527
  case 1:
47382
- _c.trys.push([1, 3, 4, 5]);
47528
+ _c.trys.push([1, 3, , 4]);
47383
47529
  request = {
47384
47530
  language: (_a = context.languageCode) !== null && _a !== void 0 ? _a : 'en-GB',
47385
47531
  officeId: context.tideConnection.officeId,
@@ -47395,16 +47541,14 @@ var BookPackagingEntry = function (_a) {
47395
47541
  window.location.href = bookingResponse.paymentUrl;
47396
47542
  } else {
47397
47543
  dispatch(setCurrentStep(2));
47544
+ setIsSubmitting(false);
47398
47545
  }
47399
- return [3 /*break*/, 5];
47546
+ return [3 /*break*/, 4];
47400
47547
  case 3:
47401
47548
  _c.sent();
47402
47549
  dispatch(setCurrentStep(3));
47403
- return [3 /*break*/, 5];
47550
+ return [3 /*break*/, 4];
47404
47551
  case 4:
47405
- setIsSubmitting(false);
47406
- return [7 /*endfinally*/];
47407
- case 5:
47408
47552
  return [2 /*return*/];
47409
47553
  }
47410
47554
  });
@@ -47429,6 +47573,7 @@ var BookPackagingEntry = function (_a) {
47429
47573
  return React__default.createElement(React__default.Fragment, null, step + 1, '.\u00A0', stepLabels[step]);
47430
47574
  }
47431
47575
  },
47576
+ isConfirmationPage && isLoading && React__default.createElement(Spinner, { label: translations.SUMMARY.PROCESS_BOOKING }),
47432
47577
  currentStep === 0 &&
47433
47578
  React__default.createElement(SharedTravelersForm, {
47434
47579
  formik: formik,
@@ -47445,6 +47590,7 @@ var BookPackagingEntry = function (_a) {
47445
47590
  translations: translations,
47446
47591
  travelerFormValues: formik.values,
47447
47592
  isSubmitting: isSubmitting,
47593
+ skipPayment: !context.generatePaymentUrl,
47448
47594
  userValidated: userValidated,
47449
47595
  remarks: remarks,
47450
47596
  enableVoucher: false,
@@ -47474,13 +47620,13 @@ var BookPackagingEntry = function (_a) {
47474
47620
  currentStep === 2 &&
47475
47621
  React__default.createElement(SharedConfirmation, {
47476
47622
  bookingNumber:
47477
- (_c =
47623
+ (_b =
47478
47624
  bookingNumber !== null && bookingNumber !== void 0
47479
47625
  ? bookingNumber
47480
47626
  : editablePackagingEntry === null || editablePackagingEntry === void 0
47481
47627
  ? void 0
47482
- : editablePackagingEntry.dossierNumber) !== null && _c !== void 0
47483
- ? _c
47628
+ : editablePackagingEntry.dossierNumber) !== null && _b !== void 0
47629
+ ? _b
47484
47630
  : '',
47485
47631
  isOption: false,
47486
47632
  isOffer: false,
@@ -47490,69 +47636,70 @@ var BookPackagingEntry = function (_a) {
47490
47636
  )
47491
47637
  ),
47492
47638
  React__default.createElement('div', { className: 'backdrop', id: 'backdrop' }),
47493
- React__default.createElement(WLSidebar, { activeSearchSeed: activeSearchSeed })
47639
+ React__default.createElement(WLSidebar, { activeSearchSeed: activeSearchSeed, packagingAccoResult: selectedPackagingAccoResult })
47494
47640
  )
47495
47641
  );
47496
47642
  };
47497
47643
 
47498
- var SearchResultsContainer = function () {
47499
- var _a, _b;
47644
+ var SearchResultsContainer = function (_a) {
47645
+ var _b, _c;
47646
+ var onBookingStarted = _a.onBookingStarted;
47500
47647
  var currentSearch = typeof window !== 'undefined' ? window.location.search : '';
47501
47648
  var dispatch = useDispatch();
47502
47649
  var context = useContext(SearchResultsConfigurationContext);
47503
- var translations = getTranslations((_a = context === null || context === void 0 ? void 0 : context.languageCode) !== null && _a !== void 0 ? _a : 'en-GB');
47504
- var _c = useSelector(function (state) {
47650
+ var translations = getTranslations((_b = context === null || context === void 0 ? void 0 : context.languageCode) !== null && _b !== void 0 ? _b : 'en-GB');
47651
+ var _d = useSelector(function (state) {
47505
47652
  return state.searchResults;
47506
47653
  }),
47507
- results = _c.results,
47508
- filteredResults = _c.filteredResults,
47509
- packagingAccoResults = _c.packagingAccoResults,
47510
- filteredPackagingAccoResults = _c.filteredPackagingAccoResults,
47511
- isLoading = _c.isLoading,
47512
- flightsLoading = _c.flightsLoading,
47513
- initialFilters = _c.initialFilters,
47514
- filters = _c.filters,
47515
- flightFilters = _c.flightFilters,
47516
- selectedSortType = _c.selectedSortType,
47517
- selectedFlightSortType = _c.selectedFlightSortType,
47518
- selectedSearchResult = _c.selectedSearchResult,
47519
- selectedPackagingAccoResultCode = _c.selectedPackagingAccoResultCode,
47520
- flyInIsOpen = _c.flyInIsOpen,
47521
- packagingAccoSearchDetails = _c.packagingAccoSearchDetails,
47522
- editablePackagingEntry = _c.editablePackagingEntry,
47523
- transactionId = _c.transactionId,
47524
- flyInType = _c.flyInType,
47525
- packagingFlightResults = _c.packagingFlightResults,
47526
- confirmedExcursionsByDay = _c.confirmedExcursionsByDay,
47527
- bookPackagingEntry = _c.bookPackagingEntry;
47654
+ results = _d.results,
47655
+ filteredResults = _d.filteredResults,
47656
+ packagingAccoResults = _d.packagingAccoResults,
47657
+ filteredPackagingAccoResults = _d.filteredPackagingAccoResults,
47658
+ isLoading = _d.isLoading,
47659
+ flightsLoading = _d.flightsLoading,
47660
+ initialFilters = _d.initialFilters,
47661
+ filters = _d.filters,
47662
+ flightFilters = _d.flightFilters,
47663
+ selectedSortType = _d.selectedSortType,
47664
+ selectedFlightSortType = _d.selectedFlightSortType,
47665
+ selectedSearchResult = _d.selectedSearchResult,
47666
+ selectedPackagingAccoResultCode = _d.selectedPackagingAccoResultCode,
47667
+ flyInIsOpen = _d.flyInIsOpen,
47668
+ packagingAccoSearchDetails = _d.packagingAccoSearchDetails,
47669
+ editablePackagingEntry = _d.editablePackagingEntry,
47670
+ transactionId = _d.transactionId,
47671
+ flyInType = _d.flyInType,
47672
+ packagingFlightResults = _d.packagingFlightResults,
47673
+ confirmedExcursionsByDay = _d.confirmedExcursionsByDay,
47674
+ bookPackagingEntry = _d.bookPackagingEntry;
47528
47675
  var isMobile = useMediaQuery('(max-width: 1200px)');
47529
- var _d = useState(false),
47530
- initialFiltersSet = _d[0],
47531
- setInitialFiltersSet = _d[1];
47532
47676
  var _e = useState(false),
47533
- initialFlightFiltersSet = _e[0],
47534
- setInitialFlightFiltersSet = _e[1];
47677
+ initialFiltersSet = _e[0],
47678
+ setInitialFiltersSet = _e[1];
47535
47679
  var _f = useState(false),
47536
- filtersOpen = _f[0],
47537
- setFiltersOpen = _f[1];
47680
+ initialFlightFiltersSet = _f[0],
47681
+ setInitialFlightFiltersSet = _f[1];
47538
47682
  var _g = useState(false),
47539
- detailsIsLoading = _g[0],
47540
- setDetailsIsLoading = _g[1];
47683
+ filtersOpen = _g[0],
47684
+ setFiltersOpen = _g[1];
47541
47685
  var _h = useState(false),
47542
- pricesAreLoading = _h[0],
47543
- setPricesAreLoading = _h[1];
47686
+ detailsIsLoading = _h[0],
47687
+ setDetailsIsLoading = _h[1];
47544
47688
  var _j = useState(false),
47545
- itineraryIsLoading = _j[0],
47546
- setItineraryIsLoading = _j[1];
47689
+ pricesAreLoading = _j[0],
47690
+ setPricesAreLoading = _j[1];
47547
47691
  var _k = useState(false),
47548
- itineraryOpen = _k[0],
47549
- setItineraryOpen = _k[1];
47692
+ itineraryIsLoading = _k[0],
47693
+ setItineraryIsLoading = _k[1];
47550
47694
  var _l = useState(false),
47551
- isBookingConfirmation = _l[0],
47552
- setIsBookingConfirmation = _l[1];
47553
- var _m = useState(null),
47554
- selectedAccommodationSeed = _m[0],
47555
- setSelectedAccommodationSeed = _m[1];
47695
+ itineraryOpen = _l[0],
47696
+ setItineraryOpen = _l[1];
47697
+ var _m = useState(false),
47698
+ isBookingConfirmation = _m[0],
47699
+ setIsBookingConfirmation = _m[1];
47700
+ var _o = useState(null),
47701
+ selectedAccommodationSeed = _o[0],
47702
+ setSelectedAccommodationSeed = _o[1];
47556
47703
  var skipInitialPackagingAccoDetailsRef = useRef(false);
47557
47704
  var panelRef = useRef(null);
47558
47705
  var sortByTypes = [
@@ -47737,14 +47884,14 @@ var SearchResultsContainer = function () {
47737
47884
  return x.pax;
47738
47885
  })
47739
47886
  .filter(function (x) {
47740
- return x.age >= 18;
47887
+ return x.age >= 12;
47741
47888
  }).length;
47742
47889
  var kids = seed.rooms
47743
47890
  .flatMap(function (x) {
47744
47891
  return x.pax;
47745
47892
  })
47746
47893
  .filter(function (x) {
47747
- return x.age >= 2 && x.age < 18;
47894
+ return x.age >= 2 && x.age < 12;
47748
47895
  }).length;
47749
47896
  var babies = seed.rooms
47750
47897
  .flatMap(function (x) {
@@ -48287,7 +48434,7 @@ var SearchResultsContainer = function () {
48287
48434
  context === null || context === void 0 ? void 0 : context.searchConfiguration.qsmType,
48288
48435
  context === null || context === void 0 ? void 0 : context.searchConfiguration.enableManualPackaging,
48289
48436
  context === null || context === void 0 ? void 0 : context.searchConfiguration.allowAccommodations,
48290
- (_b = context === null || context === void 0 ? void 0 : context.packagingEntry) === null || _b === void 0 ? void 0 : _b.transactionId,
48437
+ (_c = context === null || context === void 0 ? void 0 : context.packagingEntry) === null || _c === void 0 ? void 0 : _c.transactionId,
48291
48438
  activeSearchSeed
48292
48439
  ]
48293
48440
  );
@@ -48307,6 +48454,14 @@ var SearchResultsContainer = function () {
48307
48454
  },
48308
48455
  [context === null || context === void 0 ? void 0 : context.packagingEntry]
48309
48456
  );
48457
+ useEffect(
48458
+ function () {
48459
+ if (bookPackagingEntry && onBookingStarted) {
48460
+ onBookingStarted();
48461
+ }
48462
+ },
48463
+ [bookPackagingEntry, onBookingStarted]
48464
+ );
48310
48465
  // separate detailsCall
48311
48466
  useEffect(
48312
48467
  function () {
@@ -49021,9 +49176,10 @@ var SearchResultsContainer = function () {
49021
49176
  var id = paxId++;
49022
49177
  pax.push({
49023
49178
  id: id,
49024
- firstName: '',
49025
- lastName: '',
49026
- dateOfBirth: null,
49179
+ firstName: _.firstName || '',
49180
+ lastName: _.lastName || '',
49181
+ dateOfBirth: _.dateOfBirth || null,
49182
+ age: _.age || null,
49027
49183
  isMainBooker: roomIndex === 0 && paxIndex === 0
49028
49184
  });
49029
49185
  return id;
@@ -49060,7 +49216,11 @@ var SearchResultsContainer = function () {
49060
49216
  'div',
49061
49217
  { className: 'search' },
49062
49218
  bookPackagingEntry
49063
- ? React__default.createElement(BookPackagingEntry, { activeSearchSeed: activeSearchSeed, isConfirmationPage: isBookingConfirmation })
49219
+ ? React__default.createElement(BookPackagingEntry, {
49220
+ activeSearchSeed: activeSearchSeed,
49221
+ isLoading: itineraryIsLoading || pricesAreLoading,
49222
+ isConfirmationPage: isBookingConfirmation
49223
+ })
49064
49224
  : React__default.createElement(
49065
49225
  'div',
49066
49226
  { className: 'search__container' },
@@ -49434,7 +49594,8 @@ var createSearchResultsStore = function () {
49434
49594
  };
49435
49595
 
49436
49596
  var SearchResults = function (_a) {
49437
- var configuration = _a.configuration;
49597
+ var configuration = _a.configuration,
49598
+ onBookingStarted = _a.onBookingStarted;
49438
49599
  var store = React__default.useMemo(function () {
49439
49600
  return createSearchResultsStore();
49440
49601
  }, []);
@@ -49444,7 +49605,7 @@ var SearchResults = function (_a) {
49444
49605
  React__default.createElement(
49445
49606
  SearchResultsConfigurationContext.Provider,
49446
49607
  { value: configuration },
49447
- React__default.createElement(SearchResultsContainer, null)
49608
+ React__default.createElement(SearchResultsContainer, { onBookingStarted: onBookingStarted })
49448
49609
  )
49449
49610
  );
49450
49611
  };