@qite/tide-booking-component 1.0.0 → 1.0.2

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 (23) hide show
  1. package/build/build-cjs/booking-wizard/features/booking/booking-slice.d.ts +3 -13
  2. package/build/build-cjs/booking-wizard/features/booking/selectors.d.ts +13 -19
  3. package/build/build-cjs/booking-wizard/features/product-options/option-pax-card.d.ts +5 -1
  4. package/build/build-cjs/booking-wizard/features/product-options/option-room.d.ts +2 -0
  5. package/build/build-cjs/booking-wizard/types.d.ts +8 -7
  6. package/build/build-cjs/index.js +134 -289
  7. package/build/build-esm/booking-wizard/features/booking/booking-slice.d.ts +3 -13
  8. package/build/build-esm/booking-wizard/features/booking/selectors.d.ts +13 -19
  9. package/build/build-esm/booking-wizard/features/product-options/option-pax-card.d.ts +5 -1
  10. package/build/build-esm/booking-wizard/features/product-options/option-room.d.ts +2 -0
  11. package/build/build-esm/booking-wizard/types.d.ts +8 -7
  12. package/build/build-esm/index.js +134 -289
  13. package/package.json +71 -71
  14. package/src/booking-wizard/components/step-indicator.tsx +1 -1
  15. package/src/booking-wizard/features/booking/booking.tsx +7 -6
  16. package/src/booking-wizard/features/booking/selectors.ts +9 -3
  17. package/src/booking-wizard/features/product-options/option-pax-card.tsx +18 -3
  18. package/src/booking-wizard/features/product-options/option-room.tsx +13 -1
  19. package/src/booking-wizard/features/product-options/options-form.tsx +10 -6
  20. package/src/booking-wizard/features/travelers-form/travelers-form.tsx +3 -3
  21. package/src/booking-wizard/features/travelers-form/validate-form.ts +1 -1
  22. package/src/booking-wizard/settings-context.ts +7 -4
  23. package/src/booking-wizard/types.ts +3 -0
@@ -7238,22 +7238,12 @@ var selectRequestRooms = function (state) {
7238
7238
  var selectOfficeId = function (state) {
7239
7239
  return state.booking.officeId;
7240
7240
  };
7241
- var selectEntryStatus = function (state) {
7242
- return state.booking.entryStatus;
7243
- };
7244
- var selectCustomEntryStatusId = function (state) {
7245
- return state.booking.customEntryStatusId;
7246
- };
7247
7241
  var selectBookingOptions = function (state) {
7248
7242
  return state.booking.bookingOptions;
7249
7243
  };
7250
7244
  var selectBookingType = function (state) {
7251
7245
  return state.booking.bookingType;
7252
7246
  };
7253
- // export const selectB2BEntryStatus = (state: RootState) =>
7254
- // state.booking.b2bEntryStatus;
7255
- // export const selectB2BCustomEntryStatusId = (state: RootState) =>
7256
- // state.booking.b2bCustomEntryStatusId;
7257
7247
  var selectTagIds = function (state) {
7258
7248
  return state.booking.tagIds;
7259
7249
  };
@@ -7449,12 +7439,8 @@ var selectBookingPackageRequest = createSelector(
7449
7439
  );
7450
7440
  var selectBookingPackageBookRequest = createSelector(
7451
7441
  selectBookingPackageRequest,
7452
- selectEntryStatus,
7453
- selectCustomEntryStatusId,
7454
7442
  selectBookingOptions,
7455
7443
  selectBookingType,
7456
- // selectB2BEntryStatus,
7457
- // selectB2BCustomEntryStatusId,
7458
7444
  selectBookingPackagePax,
7459
7445
  selectBookingAddress,
7460
7446
  selectPackageDetails,
@@ -7468,12 +7454,8 @@ var selectBookingPackageBookRequest = createSelector(
7468
7454
  selectVoucherCodes,
7469
7455
  function (
7470
7456
  bookingPackageRequest,
7471
- entryStatus,
7472
- customEntryStatusId,
7473
7457
  bookingOptions,
7474
7458
  bookingType,
7475
- // b2bEntryStatus,
7476
- // b2bCustomEntryStatusId,
7477
7459
  pax,
7478
7460
  address,
7479
7461
  packageDetails,
@@ -7486,32 +7468,7 @@ var selectBookingPackageBookRequest = createSelector(
7486
7468
  remarks,
7487
7469
  voucherCodes
7488
7470
  ) {
7489
- var _a,
7490
- _b,
7491
- _c,
7492
- _d,
7493
- _e,
7494
- _f,
7495
- _g,
7496
- _h,
7497
- _j,
7498
- _k,
7499
- _l,
7500
- _m,
7501
- _o,
7502
- _p,
7503
- _q,
7504
- _r,
7505
- _s,
7506
- _t,
7507
- _u,
7508
- _v,
7509
- _w;
7510
- if (
7511
- !packageDetails ||
7512
- (pax === null || pax === void 0 ? void 0 : pax.length) == 0
7513
- )
7514
- return null;
7471
+ if (!packageDetails) return null;
7515
7472
  var returnPaymentUrl = false;
7516
7473
  if (
7517
7474
  generatePaymentUrl &&
@@ -7520,188 +7477,52 @@ var selectBookingPackageBookRequest = createSelector(
7520
7477
  ) {
7521
7478
  returnPaymentUrl = true;
7522
7479
  }
7523
- console.log("bookingType", bookingType);
7524
- console.log("bookingPackageRequest.agentId", bookingPackageRequest.agentId);
7525
- console.log("bookingOptions", bookingOptions);
7480
+ var entryStatus = 0;
7481
+ var customEntryStatusId = undefined;
7526
7482
  switch (bookingType) {
7527
- case "b2c":
7528
- if (
7529
- ((_a =
7530
- bookingOptions === null || bookingOptions === void 0
7531
- ? void 0
7532
- : bookingOptions.b2c) === null || _a === void 0
7533
- ? void 0
7534
- : _a.tagIds) &&
7535
- ((_b =
7536
- bookingOptions === null || bookingOptions === void 0
7537
- ? void 0
7538
- : bookingOptions.b2c) === null || _b === void 0
7539
- ? void 0
7540
- : _b.tagIds.length) > 0
7541
- ) {
7483
+ case "b2b":
7484
+ if (bookingOptions.b2b.tagIds && bookingOptions.b2b.tagIds.length > 0) {
7542
7485
  tagIds =
7543
7486
  tagIds === null || tagIds === void 0
7544
7487
  ? void 0
7545
- : tagIds.concat(
7546
- (_c =
7547
- bookingOptions === null || bookingOptions === void 0
7548
- ? void 0
7549
- : bookingOptions.b2c) === null || _c === void 0
7550
- ? void 0
7551
- : _c.tagIds
7552
- );
7488
+ : tagIds.concat(bookingOptions.b2b.tagIds);
7553
7489
  }
7554
- if (
7555
- (_d =
7556
- bookingOptions === null || bookingOptions === void 0
7557
- ? void 0
7558
- : bookingOptions.b2c) === null || _d === void 0
7559
- ? void 0
7560
- : _d.entryStatus
7561
- ) {
7562
- entryStatus =
7563
- (_e =
7564
- bookingOptions === null || bookingOptions === void 0
7565
- ? void 0
7566
- : bookingOptions.b2c) === null || _e === void 0
7567
- ? void 0
7568
- : _e.entryStatus;
7490
+ if (bookingOptions.b2b.entryStatus) {
7491
+ entryStatus = bookingOptions.b2b.entryStatus;
7569
7492
  }
7570
- if (
7571
- (_f =
7572
- bookingOptions === null || bookingOptions === void 0
7573
- ? void 0
7574
- : bookingOptions.b2c) === null || _f === void 0
7575
- ? void 0
7576
- : _f.customEntryStatusId
7577
- ) {
7578
- customEntryStatusId =
7579
- (_g =
7580
- bookingOptions === null || bookingOptions === void 0
7581
- ? void 0
7582
- : bookingOptions.b2c) === null || _g === void 0
7583
- ? void 0
7584
- : _g.customEntryStatusId;
7493
+ if (bookingOptions.b2b.customEntryStatusId) {
7494
+ customEntryStatusId = bookingOptions.b2b.customEntryStatusId;
7585
7495
  }
7586
7496
  break;
7587
- case "b2b":
7497
+ case "b2b2c":
7588
7498
  if (
7589
- ((_h =
7590
- bookingOptions === null || bookingOptions === void 0
7591
- ? void 0
7592
- : bookingOptions.b2b) === null || _h === void 0
7593
- ? void 0
7594
- : _h.tagIds) &&
7595
- ((_j =
7596
- bookingOptions === null || bookingOptions === void 0
7597
- ? void 0
7598
- : bookingOptions.b2b) === null || _j === void 0
7599
- ? void 0
7600
- : _j.tagIds.length) > 0
7499
+ bookingOptions.b2b2c.tagIds &&
7500
+ bookingOptions.b2b2c.tagIds.length > 0
7601
7501
  ) {
7602
7502
  tagIds =
7603
7503
  tagIds === null || tagIds === void 0
7604
7504
  ? void 0
7605
- : tagIds.concat(
7606
- (_k =
7607
- bookingOptions === null || bookingOptions === void 0
7608
- ? void 0
7609
- : bookingOptions.b2b) === null || _k === void 0
7610
- ? void 0
7611
- : _k.tagIds
7612
- );
7505
+ : tagIds.concat(bookingOptions.b2b2c.tagIds);
7613
7506
  }
7614
- if (
7615
- (_l =
7616
- bookingOptions === null || bookingOptions === void 0
7617
- ? void 0
7618
- : bookingOptions.b2b) === null || _l === void 0
7619
- ? void 0
7620
- : _l.entryStatus
7621
- ) {
7622
- entryStatus =
7623
- (_m =
7624
- bookingOptions === null || bookingOptions === void 0
7625
- ? void 0
7626
- : bookingOptions.b2b) === null || _m === void 0
7627
- ? void 0
7628
- : _m.entryStatus;
7507
+ if (bookingOptions.b2b2c.entryStatus) {
7508
+ entryStatus = bookingOptions.b2b2c.entryStatus;
7629
7509
  }
7630
- if (
7631
- (_o =
7632
- bookingOptions === null || bookingOptions === void 0
7633
- ? void 0
7634
- : bookingOptions.b2b) === null || _o === void 0
7635
- ? void 0
7636
- : _o.customEntryStatusId
7637
- ) {
7638
- customEntryStatusId =
7639
- (_p =
7640
- bookingOptions === null || bookingOptions === void 0
7641
- ? void 0
7642
- : bookingOptions.b2b) === null || _p === void 0
7643
- ? void 0
7644
- : _p.customEntryStatusId;
7510
+ if (bookingOptions.b2b2c.customEntryStatusId) {
7511
+ customEntryStatusId = bookingOptions.b2b2c.customEntryStatusId;
7645
7512
  }
7646
7513
  break;
7647
- case "b2b2c":
7648
- if (
7649
- ((_q =
7650
- bookingOptions === null || bookingOptions === void 0
7651
- ? void 0
7652
- : bookingOptions.b2b2c) === null || _q === void 0
7653
- ? void 0
7654
- : _q.tagIds) &&
7655
- ((_r =
7656
- bookingOptions === null || bookingOptions === void 0
7657
- ? void 0
7658
- : bookingOptions.b2b2c) === null || _r === void 0
7659
- ? void 0
7660
- : _r.tagIds.length) > 0
7661
- ) {
7514
+ default:
7515
+ if (bookingOptions.b2c.tagIds && bookingOptions.b2c.tagIds.length > 0) {
7662
7516
  tagIds =
7663
7517
  tagIds === null || tagIds === void 0
7664
7518
  ? void 0
7665
- : tagIds.concat(
7666
- (_s =
7667
- bookingOptions === null || bookingOptions === void 0
7668
- ? void 0
7669
- : bookingOptions.b2b2c) === null || _s === void 0
7670
- ? void 0
7671
- : _s.tagIds
7672
- );
7519
+ : tagIds.concat(bookingOptions.b2c.tagIds);
7673
7520
  }
7674
- if (
7675
- (_t =
7676
- bookingOptions === null || bookingOptions === void 0
7677
- ? void 0
7678
- : bookingOptions.b2b2c) === null || _t === void 0
7679
- ? void 0
7680
- : _t.entryStatus
7681
- ) {
7682
- entryStatus =
7683
- (_u =
7684
- bookingOptions === null || bookingOptions === void 0
7685
- ? void 0
7686
- : bookingOptions.b2b2c) === null || _u === void 0
7687
- ? void 0
7688
- : _u.entryStatus;
7521
+ if (bookingOptions.b2c.entryStatus) {
7522
+ entryStatus = bookingOptions.b2c.entryStatus;
7689
7523
  }
7690
- if (
7691
- (_v =
7692
- bookingOptions === null || bookingOptions === void 0
7693
- ? void 0
7694
- : bookingOptions.b2b2c) === null || _v === void 0
7695
- ? void 0
7696
- : _v.customEntryStatusId
7697
- ) {
7698
- customEntryStatusId =
7699
- (_w =
7700
- bookingOptions === null || bookingOptions === void 0
7701
- ? void 0
7702
- : bookingOptions.b2b2c) === null || _w === void 0
7703
- ? void 0
7704
- : _w.customEntryStatusId;
7524
+ if (bookingOptions.b2c.customEntryStatusId) {
7525
+ customEntryStatusId = bookingOptions.b2c.customEntryStatusId;
7705
7526
  }
7706
7527
  break;
7707
7528
  }
@@ -7710,7 +7531,12 @@ var selectBookingPackageBookRequest = createSelector(
7710
7531
  status: entryStatus,
7711
7532
  customStatusId: customEntryStatusId,
7712
7533
  address: address,
7713
- pax: pax,
7534
+ pax:
7535
+ (pax === null || pax === void 0 ? void 0 : pax.length) != 0
7536
+ ? pax
7537
+ : packageDetails.options[0].requestRooms.flatMap(function (x) {
7538
+ return x.pax;
7539
+ }),
7714
7540
  nonTravelPax: [],
7715
7541
  calculateDeposit: calculateDeposit,
7716
7542
  returnPaymentUrl: returnPaymentUrl,
@@ -7719,7 +7545,6 @@ var selectBookingPackageBookRequest = createSelector(
7719
7545
  remarks: remarks,
7720
7546
  voucherCodes: voucherCodes,
7721
7547
  };
7722
- console.log("bookingPackageRequest", bookingPackageRequest);
7723
7548
  return bookingPackageRequest;
7724
7549
  }
7725
7550
  );
@@ -7799,28 +7624,24 @@ var packageApi = {
7799
7624
  var _a;
7800
7625
  var initialState$1 = {
7801
7626
  officeId: 1,
7802
- entryStatus: 0,
7803
- customEntryStatusId: undefined,
7804
7627
  bookingOptions: {
7805
7628
  b2b: {
7806
- tagIds: [9],
7629
+ tagIds: [],
7807
7630
  entryStatus: 2,
7808
7631
  customEntryStatusId: undefined,
7809
7632
  },
7810
7633
  b2b2c: {
7811
- tagIds: [11],
7634
+ tagIds: [],
7812
7635
  entryStatus: 2,
7813
7636
  customEntryStatusId: undefined,
7814
7637
  },
7815
7638
  b2c: {
7816
- tagIds: [10],
7639
+ tagIds: [],
7817
7640
  entryStatus: 0,
7818
7641
  customEntryStatusId: undefined,
7819
7642
  },
7820
7643
  },
7821
7644
  bookingType: "b2c",
7822
- // b2bEntryStatus: 2,
7823
- // b2bCustomEntryStatusId: undefined,
7824
7645
  productAttributes: undefined,
7825
7646
  bookingAttributes: undefined,
7826
7647
  calculateDeposit: false,
@@ -7962,27 +7783,12 @@ var bookingSlice = createSlice({
7962
7783
  setOfficeId: function (state, action) {
7963
7784
  state.officeId = action.payload;
7964
7785
  },
7965
- setEntryStatus: function (state, action) {
7966
- state.entryStatus = action.payload;
7967
- },
7968
- setCustomEntryStatusId: function (state, action) {
7969
- state.customEntryStatusId = action.payload;
7970
- },
7971
7786
  setBookingOptions: function (state, action) {
7972
7787
  state.bookingOptions = action.payload;
7973
7788
  },
7974
7789
  setBookingType: function (state, action) {
7975
7790
  state.bookingType = action.payload;
7976
7791
  },
7977
- // setB2BEntryStatus(state, action: PayloadAction<number>) {
7978
- // state.b2bEntryStatus = action.payload;
7979
- // },
7980
- // setB2BCustomEntryStatusId(
7981
- // state,
7982
- // action: PayloadAction<number | undefined>
7983
- // ) {
7984
- // state.b2bCustomEntryStatusId = action.payload;
7985
- // },
7986
7792
  setProductAttributes: function (state, action) {
7987
7793
  state.productAttributes = action.payload;
7988
7794
  },
@@ -8097,12 +7903,8 @@ var bookingSlice = createSlice({
8097
7903
  },
8098
7904
  });
8099
7905
  var setOfficeId = ((_a = bookingSlice.actions), _a.setOfficeId),
8100
- setEntryStatus = _a.setEntryStatus,
8101
- setCustomEntryStatusId = _a.setCustomEntryStatusId,
8102
7906
  setBookingOptions = _a.setBookingOptions,
8103
7907
  setBookingType = _a.setBookingType,
8104
- // setB2BEntryStatus,
8105
- // setB2BCustomEntryStatusId,
8106
7908
  setProductAttributes = _a.setProductAttributes,
8107
7909
  setBookingAttributes = _a.setBookingAttributes,
8108
7910
  setCalculateDeposit = _a.setCalculateDeposit,
@@ -8157,10 +7959,6 @@ var SettingsContext = React.createContext({
8157
7959
  generatePaymentUrl: false,
8158
7960
  currency: "EUR",
8159
7961
  officeId: 1,
8160
- entryStatus: 0,
8161
- customEntryStatusId: null,
8162
- // b2bEntryStatus: 2,
8163
- // b2bCustomEntryStatusId: null,
8164
7962
  tagIds: [],
8165
7963
  hideAgentSelection: false,
8166
7964
  agentAdressId: undefined,
@@ -8168,7 +7966,10 @@ var SettingsContext = React.createContext({
8168
7966
  productPath: "/",
8169
7967
  basePath: "/boeken",
8170
7968
  options: {
8171
- pathSuffix: "/opties",
7969
+ pathSuffix: "/",
7970
+ },
7971
+ travellers: {
7972
+ pathSuffix: "/travellers",
8172
7973
  },
8173
7974
  summary: {
8174
7975
  pathSuffix: "/samenvatting",
@@ -8189,9 +7990,15 @@ var SettingsContext = React.createContext({
8189
7990
  loaderComponent: null,
8190
7991
  icons: null,
8191
7992
  bookingOptions: {
8192
- b2b: undefined,
8193
- b2b2c: undefined,
8194
- b2c: undefined,
7993
+ b2b: {
7994
+ entryStatus: 0,
7995
+ },
7996
+ b2b2c: {
7997
+ entryStatus: 0,
7998
+ },
7999
+ b2c: {
8000
+ entryStatus: 0,
8001
+ },
8195
8002
  },
8196
8003
  });
8197
8004
 
@@ -8754,6 +8561,7 @@ var OptionRoom = function (_a) {
8754
8561
  var _b, _c, _d, _e, _f;
8755
8562
  var packageRoom = _a.packageRoom,
8756
8563
  pax = _a.pax,
8564
+ optionPax = _a.optionPax,
8757
8565
  onRoomChange = _a.onRoomChange;
8758
8566
  var selectedOption =
8759
8567
  packageRoom === null || packageRoom === void 0
@@ -8942,6 +8750,28 @@ var OptionRoom = function (_a) {
8942
8750
  return "";
8943
8751
  }
8944
8752
  };
8753
+ var getPaxName = function (id) {
8754
+ var item = pax.find(function (x) {
8755
+ return x.id === id;
8756
+ });
8757
+ if (
8758
+ !(item === null || item === void 0 ? void 0 : item.firstName) &&
8759
+ !(item === null || item === void 0 ? void 0 : item.lastName)
8760
+ ) {
8761
+ var optionPaxItem =
8762
+ optionPax === null || optionPax === void 0
8763
+ ? void 0
8764
+ : optionPax.find(function (x) {
8765
+ return x.id === id;
8766
+ });
8767
+ return optionPaxItem === null || optionPaxItem === void 0
8768
+ ? void 0
8769
+ : optionPaxItem.paxName;
8770
+ }
8771
+ return ""
8772
+ .concat(item === null || item === void 0 ? void 0 : item.firstName, " ")
8773
+ .concat(item === null || item === void 0 ? void 0 : item.lastName[0]);
8774
+ };
8945
8775
  return React.createElement(
8946
8776
  "tr",
8947
8777
  null,
@@ -9043,10 +8873,7 @@ var OptionRoom = function (_a) {
9043
8873
  },
9044
8874
  i > 0 && ", ",
9045
8875
  " ",
9046
- p.firstName,
9047
- " ",
9048
- p.lastName[0],
9049
- "."
8876
+ getPaxName(p.id)
9050
8877
  );
9051
8878
  })
9052
8879
  )
@@ -9792,6 +9619,7 @@ var OptionPaxGroup = function (_a) {
9792
9619
 
9793
9620
  var OptionPaxCard = function (_a) {
9794
9621
  var pax = _a.pax,
9622
+ requestRoomsPax = _a.requestRoomsPax,
9795
9623
  parentIndex = _a.parentIndex,
9796
9624
  onPaxChange = _a.onPaxChange;
9797
9625
  var _b = useState(),
@@ -9810,10 +9638,18 @@ var OptionPaxCard = function (_a) {
9810
9638
  [pax, toggleStates, setToggleStates]
9811
9639
  );
9812
9640
  var bookingPax = useSelector(selectBookingPackagePax);
9813
- var getPaxName = function (id) {
9641
+ var getPaxName = function (bookingOptionPax) {
9814
9642
  var item = bookingPax.find(function (x) {
9815
- return x.id === id;
9643
+ return x.id === bookingOptionPax.id;
9816
9644
  });
9645
+ if (
9646
+ !(item === null || item === void 0 ? void 0 : item.firstName) &&
9647
+ !(item === null || item === void 0 ? void 0 : item.lastName)
9648
+ ) {
9649
+ return bookingOptionPax === null || bookingOptionPax === void 0
9650
+ ? void 0
9651
+ : bookingOptionPax.paxName;
9652
+ }
9817
9653
  return ""
9818
9654
  .concat(item === null || item === void 0 ? void 0 : item.firstName, " ")
9819
9655
  .concat(item === null || item === void 0 ? void 0 : item.lastName);
@@ -9834,6 +9670,7 @@ var OptionPaxCard = function (_a) {
9834
9670
  React.Fragment,
9835
9671
  null,
9836
9672
  pax.map(function (p, i) {
9673
+ var _a, _b;
9837
9674
  return React.createElement(
9838
9675
  "div",
9839
9676
  {
@@ -9849,8 +9686,27 @@ var OptionPaxCard = function (_a) {
9849
9686
  React.createElement(
9850
9687
  "h3",
9851
9688
  { className: "booking-card__body-heading" },
9852
- getPaxName(p.id)
9689
+ getPaxName(p)
9853
9690
  ),
9691
+ ((_a =
9692
+ requestRoomsPax === null || requestRoomsPax === void 0
9693
+ ? void 0
9694
+ : requestRoomsPax.find(function (x) {
9695
+ return x.id == p.id;
9696
+ })) === null || _a === void 0
9697
+ ? void 0
9698
+ : _a.age) &&
9699
+ React.createElement(
9700
+ "p",
9701
+ { className: "form__region-label" },
9702
+ ((_b = requestRoomsPax.find(function (x) {
9703
+ return x.id == p.id;
9704
+ })) === null || _b === void 0
9705
+ ? void 0
9706
+ : _b.age) > CHILD_MAX_AGE
9707
+ ? translations.TRAVELERS_FORM.ADULT
9708
+ : translations.TRAVELERS_FORM.CHILD
9709
+ ),
9854
9710
  React.createElement(
9855
9711
  "div",
9856
9712
  { className: "booking-card__actions" },
@@ -10349,11 +10205,16 @@ var OptionBookingGroup = function (_a) {
10349
10205
  var OptionsForm = function () {
10350
10206
  var _a = useContext(SettingsContext),
10351
10207
  basePath = _a.basePath,
10352
- summary = _a.summary,
10208
+ travellers = _a.travellers,
10353
10209
  loaderComponent = _a.loaderComponent;
10354
10210
  var dispatch = useAppDispatch();
10355
- var travelerFormValues = useSelector(selectTravelersFormValues);
10356
10211
  var requestRooms = useSelector(selectRequestRooms);
10212
+ var requestRoomsPax =
10213
+ requestRooms === null || requestRooms === void 0
10214
+ ? void 0
10215
+ : requestRooms.flatMap(function (x) {
10216
+ return x.pax;
10217
+ });
10357
10218
  var pax = useSelector(selectBookingPackagePax);
10358
10219
  var packageRooms = useSelector(selectPackageRooms);
10359
10220
  var bookingQueryString = useSelector(selectBookingQueryString);
@@ -10361,29 +10222,36 @@ var OptionsForm = function () {
10361
10222
  var groups = useSelector(selectPackageGroups);
10362
10223
  var optionUnits = useSelector(selectPackageOptionUnits);
10363
10224
  var optionPax = useSelector(selectPackageOptionPax);
10364
- if (!travelerFormValues || !packageRooms) {
10225
+ if (!packageRooms) {
10365
10226
  navigate("".concat(basePath, "?").concat(bookingQueryString));
10366
10227
  }
10367
10228
  var getRoomPax = function (index) {
10229
+ var _a;
10368
10230
  var room =
10369
10231
  requestRooms === null || requestRooms === void 0
10370
10232
  ? void 0
10371
10233
  : requestRooms.find(function (x) {
10372
10234
  return x.index == index;
10373
10235
  });
10374
- return pax.filter(function (x) {
10236
+ var bookingPackagePax = pax.filter(function (x) {
10375
10237
  return room === null || room === void 0
10376
10238
  ? void 0
10377
10239
  : room.pax.some(function (y) {
10378
10240
  return y.id == x.id;
10379
10241
  });
10380
10242
  });
10243
+ return bookingPackagePax.length > 0
10244
+ ? bookingPackagePax
10245
+ : (_a = room === null || room === void 0 ? void 0 : room.pax) !== null &&
10246
+ _a !== void 0
10247
+ ? _a
10248
+ : [];
10381
10249
  };
10382
10250
  var handleSubmit = function (e) {
10383
10251
  navigate(
10384
10252
  ""
10385
10253
  .concat(basePath)
10386
- .concat(summary.pathSuffix, "?")
10254
+ .concat(travellers.pathSuffix, "?")
10387
10255
  .concat(bookingQueryString)
10388
10256
  );
10389
10257
  e.preventDefault();
@@ -10479,6 +10347,7 @@ var OptionsForm = function () {
10479
10347
  key: room.index,
10480
10348
  packageRoom: room,
10481
10349
  pax: getRoomPax(room.index),
10350
+ optionPax: optionPax,
10482
10351
  onRoomChange: handleOnRoomChange,
10483
10352
  });
10484
10353
  })
@@ -10539,6 +10408,7 @@ var OptionsForm = function () {
10539
10408
  React.createElement(OptionPaxCard, {
10540
10409
  pax: optionPax,
10541
10410
  onPaxChange: handleOnPaxChange,
10411
+ requestRoomsPax: requestRoomsPax,
10542
10412
  })
10543
10413
  )
10544
10414
  )
@@ -11304,7 +11174,7 @@ var StepIndicators = function (_a) {
11304
11174
  React.createElement(
11305
11175
  "div",
11306
11176
  { className: "step-indicators__items" },
11307
- ["Persoonlijke gegevens", "Samenstellen", "Overzicht", "Bevestiging"].map(
11177
+ ["Samenstellen", "Persoonlijke gegevens", "Overzicht", "Bevestiging"].map(
11308
11178
  function (stepName, index) {
11309
11179
  return React.createElement(
11310
11180
  "div",
@@ -12698,7 +12568,7 @@ var validateForm = function (values, agentRequired) {
12698
12568
  set(
12699
12569
  errors,
12700
12570
  "children[".concat(index, "].birthDate"),
12701
- "Reiziger ".concat(index + 1, ": is geen kind")
12571
+ "Reiziger ".concat(values.adults.length + index + 1, ": is geen kind")
12702
12572
  );
12703
12573
  }
12704
12574
  }
@@ -12888,7 +12758,6 @@ var TravelersForm = function () {
12888
12758
  var childIds = useSelector(selectChildIds);
12889
12759
  var agents = useSelector(selectAgents);
12890
12760
  var agentAdressId = useSelector(selectAgentAdressId);
12891
- console.log("agentAdressId", agentAdressId);
12892
12761
  var initialValues =
12893
12762
  (_a = useSelector(selectTravelersFormValues)) !== null && _a !== void 0
12894
12763
  ? _a
@@ -12936,7 +12805,7 @@ var TravelersForm = function () {
12936
12805
  navigate(
12937
12806
  ""
12938
12807
  .concat(settings.basePath)
12939
- .concat(settings.options.pathSuffix, "?")
12808
+ .concat(settings.summary.pathSuffix, "?")
12940
12809
  .concat(bookingQueryString)
12941
12810
  );
12942
12811
  },
@@ -13037,6 +12906,7 @@ var TravelersForm = function () {
13037
12906
  var handleAgentClear = function () {
13038
12907
  formik.setFieldValue("travelAgentId", 0);
13039
12908
  formik.setFieldValue("travelAgentName", "");
12909
+ dispatch(setBookingType("b2c"));
13040
12910
  };
13041
12911
  var toggleAgent = function (value) {
13042
12912
  setShowAgents(value);
@@ -13654,13 +13524,10 @@ var Booking = function (_a) {
13654
13524
  thumbnailUrl = _a.thumbnailUrl;
13655
13525
  var _b = useContext(SettingsContext),
13656
13526
  officeId = _b.officeId,
13657
- entryStatus = _b.entryStatus,
13658
- customEntryStatusId = _b.customEntryStatusId,
13659
13527
  bookingOptions = _b.bookingOptions,
13660
- // b2bEntryStatus,
13661
- // b2bCustomEntryStatusId,
13662
13528
  basePath = _b.basePath,
13663
13529
  options = _b.options,
13530
+ travellers = _b.travellers,
13664
13531
  summary = _b.summary,
13665
13532
  confirmation = _b.confirmation,
13666
13533
  error = _b.error,
@@ -13795,23 +13662,7 @@ var Booking = function (_a) {
13795
13662
  useEffect(
13796
13663
  function () {
13797
13664
  dispatch(setOfficeId(officeId));
13798
- dispatch(setEntryStatus(entryStatus));
13799
- dispatch(
13800
- setCustomEntryStatusId(
13801
- customEntryStatusId !== null && customEntryStatusId !== void 0
13802
- ? customEntryStatusId
13803
- : undefined
13804
- )
13805
- );
13806
- dispatch(
13807
- setBookingOptions(
13808
- bookingOptions !== null && bookingOptions !== void 0
13809
- ? bookingOptions
13810
- : undefined
13811
- )
13812
- );
13813
- // dispatch(setB2BEntryStatus(b2bEntryStatus));
13814
- // dispatch(setB2BCustomEntryStatusId(b2bCustomEntryStatusId ?? undefined));
13665
+ dispatch(setBookingOptions(bookingOptions));
13815
13666
  dispatch(setCalculateDeposit(showSidebarDeposit));
13816
13667
  dispatch(
13817
13668
  setTagIds(tagIds !== null && tagIds !== void 0 ? tagIds : undefined)
@@ -13829,15 +13680,9 @@ var Booking = function (_a) {
13829
13680
  },
13830
13681
  [
13831
13682
  officeId,
13832
- entryStatus,
13833
- customEntryStatusId,
13834
13683
  bookingOptions,
13835
- // b2bEntryStatus,
13836
- // b2bCustomEntryStatusId,
13837
13684
  showSidebarDeposit,
13838
13685
  setOfficeId,
13839
- setEntryStatus,
13840
- setCustomEntryStatusId,
13841
13686
  setCalculateDeposit,
13842
13687
  tagIds,
13843
13688
  agentAdressId,
@@ -13880,16 +13725,16 @@ var Booking = function (_a) {
13880
13725
  Router,
13881
13726
  { basepath: basePath },
13882
13727
  React.createElement(StepRoute, {
13883
- path: "/",
13728
+ path: options.pathSuffix,
13884
13729
  number: 1,
13885
- title: translations.STEPS.PERSONAL_DETAILS,
13886
- component: React.createElement(TravelersForm, null),
13730
+ title: translations.STEPS.TRAVEL_OPTIONS,
13731
+ component: React.createElement(OptionsForm, null),
13887
13732
  }),
13888
13733
  React.createElement(StepRoute, {
13889
- path: options.pathSuffix,
13734
+ path: travellers.pathSuffix,
13890
13735
  number: 2,
13891
- title: translations.STEPS.TRAVEL_OPTIONS,
13892
- component: React.createElement(OptionsForm, null),
13736
+ title: translations.STEPS.PERSONAL_DETAILS,
13737
+ component: React.createElement(TravelersForm, null),
13893
13738
  }),
13894
13739
  React.createElement(StepRoute, {
13895
13740
  path: summary.pathSuffix,