@qite/tide-booking-component 1.4.113 → 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.
@@ -41445,11 +41445,20 @@ var HotelAccommodationResults = function (_a) {
41445
41445
  function () {
41446
41446
  var shouldShowAll =
41447
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
+ }
41448
41454
  if (shouldShowAll) {
41449
- return mappedResults;
41455
+ if (isFlyIn) {
41456
+ return mappedResults;
41457
+ }
41458
+ return filteredMapperResults;
41450
41459
  }
41451
41460
  if (selectedPackagingAccoResult) {
41452
- return mappedResults
41461
+ return filteredMapperResults
41453
41462
  .filter(function (result) {
41454
41463
  return result.code !== selectedPackagingAccoResult.code;
41455
41464
  })
@@ -43029,6 +43038,13 @@ var FlyIn = function (_a) {
43029
43038
  dispatch(setSortType(newSortByType));
43030
43039
  }
43031
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
+ };
43032
43048
  return React__default.createElement(
43033
43049
  'div',
43034
43050
  {
@@ -43166,7 +43182,7 @@ var FlyIn = function (_a) {
43166
43182
  ),
43167
43183
  (srpType === build.PortalQsmType.Accommodation || srpType === build.PortalQsmType.AccommodationAndFlight) &&
43168
43184
  flyInType === 'acco-details' &&
43169
- React__default.createElement(AccommodationFlyIn, { isLoading: detailsLoading, handleConfirm: handleConfirm }),
43185
+ React__default.createElement(AccommodationFlyIn, { isLoading: detailsLoading, handleConfirm: onHandleConfirm }),
43170
43186
  srpType === build.PortalQsmType.AccommodationAndFlight &&
43171
43187
  (flyInType === 'flight-outward-results' || flyInType === 'flight-return-results') &&
43172
43188
  React__default.createElement(PackageingFlightsFlyIn, { isOpen: isOpen, setIsOpen: setIsOpen, toggleFilters: toggleFilters, filtersOpen: filtersOpen }),
@@ -44004,8 +44020,11 @@ var IndependentFlightSelection = function (_a) {
44004
44020
  [searchResults, selectedReturnKey]
44005
44021
  );
44006
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;
44007
44024
  var firstResultDay = firstResultDate ? format$2(firstResultDate, 'd') : null;
44008
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;
44009
44028
  return React__default.createElement(
44010
44029
  React__default.Fragment,
44011
44030
  null,
@@ -44054,7 +44073,12 @@ var IndependentFlightSelection = function (_a) {
44054
44073
  React__default.createElement(
44055
44074
  'div',
44056
44075
  { className: 'search__results__label search__results__label--secondary' },
44057
- 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
+ ),
44058
44082
  React__default.createElement(
44059
44083
  'div',
44060
44084
  { className: 'search__results__label__text' },
@@ -46510,6 +46534,83 @@ var DayByDayExcursions = function () {
46510
46534
  );
46511
46535
  };
46512
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
+
46513
46614
  var mapToSidebarFlightMetaData = function (entryLine) {
46514
46615
  var _a, _b;
46515
46616
  return {
@@ -46569,22 +46670,16 @@ var selectSeparatePackagePriceDetails = function (priceDetails) {
46569
46670
  return result;
46570
46671
  };
46571
46672
  var WLSidebar = function (_a) {
46572
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
46573
- 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;
46574
46676
  var context = useContext(SearchResultsConfigurationContext);
46575
- if (!context) {
46576
- return null;
46577
- }
46578
- var translations = getTranslations((_b = context.languageCode) !== null && _b !== void 0 ? _b : 'en-GB');
46579
- var _u = useSelector(function (state) {
46677
+ var _4 = useSelector(function (state) {
46580
46678
  return state.searchResults;
46581
46679
  }),
46582
- editablePackagingEntry = _u.editablePackagingEntry,
46583
- priceDetails = _u.priceDetails;
46584
- // Map editablePackagingEntry to sidebar props (example, adjust as needed)
46585
- if (!editablePackagingEntry) {
46586
- return null;
46587
- }
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');
46588
46683
  var sortedLines = useMemo(
46589
46684
  function () {
46590
46685
  var _a;
@@ -46604,35 +46699,70 @@ var WLSidebar = function (_a) {
46604
46699
  },
46605
46700
  [editablePackagingEntry]
46606
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
+ }
46607
46711
  var firstEntryLine = first(sortedLines);
46608
46712
  var accommodationLines = editablePackagingEntry.lines.filter(function (line) {
46609
46713
  return line.serviceType === ACCOMMODATION_SERVICE_TYPE;
46610
46714
  });
46611
46715
  var accommodationLine = (_c = first(accommodationLines)) !== null && _c !== void 0 ? _c : firstEntryLine;
46612
46716
  var location =
46613
- (_l =
46614
- (_j =
46615
- (_g =
46616
- (_e =
46617
- (_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
46618
46733
  ? void 0
46619
- : _d.name) !== null && _e !== void 0
46620
- ? _e
46621
- : (_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
46622
46737
  ? void 0
46623
- : _f.name) !== null && _g !== void 0
46624
- ? _g
46625
- : (_h = accommodationLine === null || accommodationLine === void 0 ? void 0 : accommodationLine.region) === null || _h === void 0
46626
- ? void 0
46627
- : _h.name) !== null && _j !== void 0
46628
- ? _j
46629
- : (_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
46630
46741
  ? void 0
46631
- : _k.name) !== null && _l !== void 0
46632
- ? _l
46633
- : (_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
46634
46764
  ? void 0
46635
- : _m.name;
46765
+ : _x.name;
46636
46766
  var rooms =
46637
46767
  (activeSearchSeed === null || activeSearchSeed === void 0
46638
46768
  ? void 0
@@ -46662,7 +46792,7 @@ var WLSidebar = function (_a) {
46662
46792
  var outboundFlightMetaData = outboundFlight ? mapToSidebarFlightMetaData(outboundFlight) : undefined;
46663
46793
  var returnFlightMetaData = returnFlight ? mapToSidebarFlightMetaData(returnFlight) : undefined;
46664
46794
  var basePrice = sum(
46665
- (_o =
46795
+ (_y =
46666
46796
  priceDetails === null || priceDetails === void 0
46667
46797
  ? void 0
46668
46798
  : priceDetails.details
@@ -46671,18 +46801,18 @@ var WLSidebar = function (_a) {
46671
46801
  })
46672
46802
  .map(function (pd) {
46673
46803
  return pd.price * pd.amount;
46674
- })) !== null && _o !== void 0
46675
- ? _o
46804
+ })) !== null && _y !== void 0
46805
+ ? _y
46676
46806
  : []
46677
46807
  );
46678
46808
  var separateExtraPriceDetails =
46679
- (_p =
46809
+ (_z =
46680
46810
  priceDetails === null || priceDetails === void 0
46681
46811
  ? void 0
46682
46812
  : priceDetails.details.filter(function (pd) {
46683
46813
  return !pd.isInPackage && pd.isSeparate;
46684
- })) !== null && _p !== void 0
46685
- ? _p
46814
+ })) !== null && _z !== void 0
46815
+ ? _z
46686
46816
  : [];
46687
46817
  var totalPrice = sum(
46688
46818
  __spreadArray(
@@ -46694,22 +46824,22 @@ var WLSidebar = function (_a) {
46694
46824
  )
46695
46825
  );
46696
46826
  var includedCosts = selectSeparatePackagePriceDetails(
46697
- (_q =
46827
+ (_0 =
46698
46828
  priceDetails === null || priceDetails === void 0
46699
46829
  ? void 0
46700
46830
  : priceDetails.details.filter(function (pd) {
46701
46831
  return pd.isInPackage;
46702
- })) !== null && _q !== void 0
46703
- ? _q
46832
+ })) !== null && _0 !== void 0
46833
+ ? _0
46704
46834
  : []
46705
46835
  );
46706
46836
  return React__default.createElement(SharedSidebar, {
46707
46837
  productName: location !== null && location !== void 0 ? location : '',
46708
- 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,
46709
46839
  translations: translations,
46710
46840
  travelerRooms: travelerRooms,
46711
- startDateText: ((_s = first(sortedLines)) === null || _s === void 0 ? void 0 : _s.from) && formatDate(new Date(first(sortedLines).from)),
46712
- 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)),
46713
46843
  isLoading: !editablePackagingEntry || !priceDetails,
46714
46844
  loaderComponent: React__default.createElement(Spinner, null),
46715
46845
  departureFlightMetaData: outboundFlightMetaData,
@@ -47225,74 +47355,6 @@ var SharedSummary = function (_a) {
47225
47355
  );
47226
47356
  };
47227
47357
 
47228
- var renderEditablePackagingEntrySummaryOptions = function (editablePackagingEntry, priceDetails, translations) {
47229
- var _a, _b;
47230
- var priceDetailsByProduct = groupBy(
47231
- (_a = priceDetails === null || priceDetails === void 0 ? void 0 : priceDetails.details) !== null && _a !== void 0 ? _a : [],
47232
- function (detail) {
47233
- return ''.concat(detail.productCode, '|').concat(detail.accommodationCode);
47234
- }
47235
- );
47236
- return (
47237
- (_b = editablePackagingEntry === null || editablePackagingEntry === void 0 ? void 0 : editablePackagingEntry.lines) !== null && _b !== void 0 ? _b : []
47238
- ).map(function (line) {
47239
- var _a, _b, _c;
47240
- var groupedPriceDetails = (_a = priceDetailsByProduct[''.concat(line.productCode, '|').concat(line.accommodationCode)]) !== null && _a !== void 0 ? _a : [];
47241
- var visiblePriceDetails = groupedPriceDetails.filter(function (detail) {
47242
- return detail.showPrice || detail.isSeparate;
47243
- });
47244
- return React__default.createElement(
47245
- 'li',
47246
- { key: line.guid },
47247
- React__default.createElement('h6', null, line.productName),
47248
- React__default.createElement(
47249
- 'ul',
47250
- null,
47251
- React__default.createElement('li', { className: 'list__item' }, compact([line.accommodationName, line.regimeName]).join(', ')),
47252
- (_c = (_b = line.flightInformation) === null || _b === void 0 ? void 0 : _b.flightLines) === null || _c === void 0
47253
- ? void 0
47254
- : _c.map(function (flightLine, index) {
47255
- var _a, _b;
47256
- return React__default.createElement(
47257
- 'li',
47258
- { className: 'list__item', key: ''.concat(line.guid, '-').concat(index) },
47259
- flightLine.departureAirportCode,
47260
- ' ',
47261
- (_a = flightLine.departureTime) === null || _a === void 0 ? void 0 : _a.slice(0, 5),
47262
- ' > ',
47263
- flightLine.arrivalAirportCode,
47264
- ' ',
47265
- (_b = flightLine.arrivalTime) === null || _b === void 0 ? void 0 : _b.slice(0, 5),
47266
- ' (',
47267
- flightLine.operatingFlightNumber || ''.concat(flightLine.airlineCode).concat(flightLine.flightNumber),
47268
- ')'
47269
- );
47270
- }),
47271
- !isEmpty(visiblePriceDetails) &&
47272
- visiblePriceDetails.map(function (detail, index) {
47273
- var _a;
47274
- return React__default.createElement(
47275
- 'li',
47276
- { className: 'list__item', key: ''.concat(line.guid, '-price-').concat(index) },
47277
- detail.priceDescription,
47278
- ': ',
47279
- (_a = detail.total) === null || _a === void 0 ? void 0 : _a.toLocaleString(undefined, { style: 'currency', currency: 'EUR' })
47280
- );
47281
- })
47282
- ),
47283
- React__default.createElement(
47284
- 'p',
47285
- null,
47286
- '(',
47287
- line.from === line.to
47288
- ? getDateText(line.from)
47289
- : React__default.createElement(React__default.Fragment, null, getDateText(line.from), ' > ', getDateText(line.to)),
47290
- ')'
47291
- )
47292
- );
47293
- });
47294
- };
47295
-
47296
47358
  var travelerFormFields = [{ type: 'gender' }, { type: 'firstName' }, { type: 'lastName' }, { type: 'birthDate' }];
47297
47359
  var mainBookerFormFields = [
47298
47360
  { type: 'street' },
@@ -47316,6 +47378,7 @@ var travellersSettings = {
47316
47378
  var BookPackagingEntry = function (_a) {
47317
47379
  var _b;
47318
47380
  var activeSearchSeed = _a.activeSearchSeed,
47381
+ isLoading = _a.isLoading,
47319
47382
  isConfirmationPage = _a.isConfirmationPage;
47320
47383
  var context = useContext(SearchResultsConfigurationContext);
47321
47384
  var dispatch = useDispatch();
@@ -47325,7 +47388,9 @@ var BookPackagingEntry = function (_a) {
47325
47388
  editablePackagingEntry = _c.editablePackagingEntry,
47326
47389
  priceDetails = _c.priceDetails,
47327
47390
  currentStep = _c.currentStep,
47328
- bookingNumber = _c.bookingNumber;
47391
+ bookingNumber = _c.bookingNumber,
47392
+ selectedPackagingAccoResultCode = _c.selectedPackagingAccoResultCode,
47393
+ packagingAccoResults = _c.packagingAccoResults;
47329
47394
  var _d = useState([]),
47330
47395
  countries = _d[0],
47331
47396
  setCountries = _d[1];
@@ -47338,6 +47403,9 @@ var BookPackagingEntry = function (_a) {
47338
47403
  var _g = useState(false),
47339
47404
  isSubmitting = _g[0],
47340
47405
  setIsSubmitting = _g[1];
47406
+ var _h = useState(null),
47407
+ selectedPackagingAccoResult = _h[0],
47408
+ setSelectedPackagingAccoResult = _h[1];
47341
47409
  var translations = useMemo(
47342
47410
  function () {
47343
47411
  var _a;
@@ -47416,7 +47484,22 @@ var BookPackagingEntry = function (_a) {
47416
47484
  },
47417
47485
  [isConfirmationPage, dispatch]
47418
47486
  );
47419
- if (!context || !editablePackagingEntry || !priceDetails || !config) return null;
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 });
47420
47503
  var handleSummarySubmit = function (e) {
47421
47504
  return __awaiter(void 0, void 0, void 0, function () {
47422
47505
  var updatedEditablePackagingEntry, redirectUrl, request, bookingResponse;
@@ -47442,7 +47525,7 @@ var BookPackagingEntry = function (_a) {
47442
47525
  dispatch(setEditablePackagingEntry(updatedEditablePackagingEntry));
47443
47526
  _c.label = 1;
47444
47527
  case 1:
47445
- _c.trys.push([1, 3, 4, 5]);
47528
+ _c.trys.push([1, 3, , 4]);
47446
47529
  request = {
47447
47530
  language: (_a = context.languageCode) !== null && _a !== void 0 ? _a : 'en-GB',
47448
47531
  officeId: context.tideConnection.officeId,
@@ -47458,16 +47541,14 @@ var BookPackagingEntry = function (_a) {
47458
47541
  window.location.href = bookingResponse.paymentUrl;
47459
47542
  } else {
47460
47543
  dispatch(setCurrentStep(2));
47544
+ setIsSubmitting(false);
47461
47545
  }
47462
- return [3 /*break*/, 5];
47546
+ return [3 /*break*/, 4];
47463
47547
  case 3:
47464
47548
  _c.sent();
47465
47549
  dispatch(setCurrentStep(3));
47466
- return [3 /*break*/, 5];
47550
+ return [3 /*break*/, 4];
47467
47551
  case 4:
47468
- setIsSubmitting(false);
47469
- return [7 /*endfinally*/];
47470
- case 5:
47471
47552
  return [2 /*return*/];
47472
47553
  }
47473
47554
  });
@@ -47492,6 +47573,7 @@ var BookPackagingEntry = function (_a) {
47492
47573
  return React__default.createElement(React__default.Fragment, null, step + 1, '.\u00A0', stepLabels[step]);
47493
47574
  }
47494
47575
  },
47576
+ isConfirmationPage && isLoading && React__default.createElement(Spinner, { label: translations.SUMMARY.PROCESS_BOOKING }),
47495
47577
  currentStep === 0 &&
47496
47578
  React__default.createElement(SharedTravelersForm, {
47497
47579
  formik: formik,
@@ -47554,7 +47636,7 @@ var BookPackagingEntry = function (_a) {
47554
47636
  )
47555
47637
  ),
47556
47638
  React__default.createElement('div', { className: 'backdrop', id: 'backdrop' }),
47557
- React__default.createElement(WLSidebar, { activeSearchSeed: activeSearchSeed })
47639
+ React__default.createElement(WLSidebar, { activeSearchSeed: activeSearchSeed, packagingAccoResult: selectedPackagingAccoResult })
47558
47640
  )
47559
47641
  );
47560
47642
  };
@@ -49134,7 +49216,11 @@ var SearchResultsContainer = function (_a) {
49134
49216
  'div',
49135
49217
  { className: 'search' },
49136
49218
  bookPackagingEntry
49137
- ? React__default.createElement(BookPackagingEntry, { activeSearchSeed: activeSearchSeed, isConfirmationPage: isBookingConfirmation })
49219
+ ? React__default.createElement(BookPackagingEntry, {
49220
+ activeSearchSeed: activeSearchSeed,
49221
+ isLoading: itineraryIsLoading || pricesAreLoading,
49222
+ isConfirmationPage: isBookingConfirmation
49223
+ })
49138
49224
  : React__default.createElement(
49139
49225
  'div',
49140
49226
  { className: 'search__container' },
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { SearchSeed } from '../../types';
3
3
  interface BookPackagingEntryProps {
4
4
  activeSearchSeed: SearchSeed | null;
5
+ isLoading: boolean;
5
6
  isConfirmationPage?: boolean;
6
7
  }
7
8
  declare const BookPackagingEntry: React.FC<BookPackagingEntryProps>;
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
2
  import { SearchSeed } from '../../types';
3
+ import { PackagingAccommodationResponse } from '@qite/tide-client';
3
4
  interface WLSidebarProps {
4
5
  activeSearchSeed: SearchSeed | null;
6
+ packagingAccoResult: PackagingAccommodationResponse | null;
5
7
  }
6
8
  declare const WLSidebar: React.FC<WLSidebarProps>;
7
9
  export default WLSidebar;
@@ -1 +1,2 @@
1
1
  export declare const renderEditablePackagingEntrySummaryOptions: (editablePackagingEntry: any, priceDetails: any, translations: any) => any;
2
+ export declare const getImageSrcFromHtml: (html?: string | null) => string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qite/tide-booking-component",
3
- "version": "1.4.113",
3
+ "version": "1.4.114",
4
4
  "description": "React Booking wizard & Booking product component for Tide",
5
5
  "main": "build/build-cjs/index.js",
6
6
  "types": "build/build-cjs/src/index.d.ts",
@@ -16,13 +16,23 @@ import { useFormik } from 'formik';
16
16
  import { TravelersFormValues } from '../../../booking-wizard/types';
17
17
  import { setBookingNumber, setCurrentStep, setEditablePackagingEntry } from '../../store/search-results-slice';
18
18
  import validateForm from '../../../booking-wizard/features/travelers-form/validate-form';
19
- import { bookPackagingEntry, CountryItem, getCountries, PackagingEntry, PackagingRequestBase, TideClientConfig } from '@qite/tide-client';
19
+ import {
20
+ bookPackagingEntry,
21
+ CountryItem,
22
+ getCountries,
23
+ PackagingAccommodationResponse,
24
+ PackagingEntry,
25
+ PackagingRequestBase,
26
+ TideClientConfig
27
+ } from '@qite/tide-client';
20
28
  import SharedSummary from '../../../shared/booking/summary';
21
29
  import { renderEditablePackagingEntrySummaryOptions } from '../../../shared/utils/booking-summary';
22
30
  import SharedConfirmation from '../../../shared/booking/shared-confirmation';
31
+ import Spinner from '../spinner/spinner';
23
32
 
24
33
  interface BookPackagingEntryProps {
25
34
  activeSearchSeed: SearchSeed | null;
35
+ isLoading: boolean;
26
36
  isConfirmationPage?: boolean;
27
37
  }
28
38
 
@@ -49,16 +59,19 @@ const travellersSettings: SharedTravelersSettings = {
49
59
  mainBookerFormFields
50
60
  };
51
61
 
52
- const BookPackagingEntry: React.FC<BookPackagingEntryProps> = ({ activeSearchSeed, isConfirmationPage }) => {
62
+ const BookPackagingEntry: React.FC<BookPackagingEntryProps> = ({ activeSearchSeed, isLoading, isConfirmationPage }) => {
53
63
  const context = useContext(SearchResultsConfigurationContext);
54
64
  const dispatch = useDispatch();
55
65
 
56
- const { editablePackagingEntry, priceDetails, currentStep, bookingNumber } = useSelector((state: SearchResultsRootState) => state.searchResults);
66
+ const { editablePackagingEntry, priceDetails, currentStep, bookingNumber, selectedPackagingAccoResultCode, packagingAccoResults } = useSelector(
67
+ (state: SearchResultsRootState) => state.searchResults
68
+ );
57
69
 
58
70
  const [countries, setCountries] = useState<CountryItem[]>([]);
59
71
  const [userValidated, setUserValidated] = useState(true);
60
72
  const [remarks, setRemarks] = useState('');
61
73
  const [isSubmitting, setIsSubmitting] = useState(false);
74
+ const [selectedPackagingAccoResult, setSelectedPackagingAccoResult] = useState<PackagingAccommodationResponse | null>(null);
62
75
 
63
76
  const translations = useMemo(() => getTranslations(context?.languageCode ?? 'en-GB'), [context?.languageCode]);
64
77
 
@@ -117,7 +130,14 @@ const BookPackagingEntry: React.FC<BookPackagingEntryProps> = ({ activeSearchSee
117
130
  }
118
131
  }, [isConfirmationPage, dispatch]);
119
132
 
120
- if (!context || !editablePackagingEntry || !priceDetails || !config) return null;
133
+ useEffect(() => {
134
+ const selectedPackagingAccoResult = packagingAccoResults?.find((result) => result.code === selectedPackagingAccoResultCode);
135
+ if (selectedPackagingAccoResult) {
136
+ setSelectedPackagingAccoResult(selectedPackagingAccoResult);
137
+ }
138
+ }, [selectedPackagingAccoResultCode, packagingAccoResults]);
139
+
140
+ if (!context || !editablePackagingEntry || !priceDetails || !config) return <Spinner label={translations.SUMMARY.PROCESS_BOOKING} />;
121
141
 
122
142
  const handleSummarySubmit: React.FormEventHandler<HTMLFormElement> = async (e) => {
123
143
  e.preventDefault();
@@ -165,11 +185,10 @@ const BookPackagingEntry: React.FC<BookPackagingEntryProps> = ({ activeSearchSee
165
185
  window.location.href = bookingResponse.paymentUrl;
166
186
  } else {
167
187
  dispatch(setCurrentStep(2));
188
+ setIsSubmitting(false);
168
189
  }
169
190
  } catch (error) {
170
191
  dispatch(setCurrentStep(3));
171
- } finally {
172
- setIsSubmitting(false);
173
192
  }
174
193
  };
175
194
 
@@ -186,6 +205,7 @@ const BookPackagingEntry: React.FC<BookPackagingEntryProps> = ({ activeSearchSee
186
205
  {step + 1}.&nbsp;{stepLabels[step]}
187
206
  </>
188
207
  )}>
208
+ {isConfirmationPage && isLoading && <Spinner label={translations.SUMMARY.PROCESS_BOOKING} />}
189
209
  {currentStep === 0 && (
190
210
  <SharedTravelersForm
191
211
  formik={formik}
@@ -237,7 +257,7 @@ const BookPackagingEntry: React.FC<BookPackagingEntryProps> = ({ activeSearchSee
237
257
 
238
258
  <div className="backdrop" id="backdrop"></div>
239
259
 
240
- <WLSidebar activeSearchSeed={activeSearchSeed} />
260
+ <WLSidebar activeSearchSeed={activeSearchSeed} packagingAccoResult={selectedPackagingAccoResult} />
241
261
  </div>
242
262
  </div>
243
263
  );