@pisell/private-materials 6.11.654 → 6.11.656
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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/bigSale/components/BookingFloatingPanel/useBookingPanelController.js +1 -0
- package/es/components/bigSale/components/TimeBar/index.js +1 -0
- package/es/components/bigSale/dialog.js +1 -0
- package/es/components/bigSale/hooks/useBigSaleContext.js +1 -0
- package/es/components/bigSale/hooks/useSelectFloorMapResourceForBigSale.js +1 -0
- package/es/components/bigSale/index.js +1 -0
- package/es/components/bigSale/templates/Kiosk/index.js +1 -0
- package/es/components/sharedSecondaryBigSale/SharedSecondaryBigSaleReceiver.js +1 -0
- package/es/index.js +2 -0
- package/es/plus/pisellReservation/data/bookingToReservationTables.js +1 -1
- package/es/plus/pisellReservation/floorMap/floorPlanApi.js +1 -1
- package/es/plus/pisellReservation/floorMap/reservationMock.js +1 -1
- package/es/plus/pisellReservation/index.js +17 -0
- package/es/plus/saleDetail/Base.js +1 -0
- package/es/plus/saleDetail/components/Client/hooks/useClientSelectorProps.js +1 -0
- package/es/plus/saleDetail/components/DetailActions/index.js +1 -0
- package/es/plus/saleDetail/components/SummaryFinancialSections/index.js +1 -0
- package/es/plus/saleDetail/index.js +1 -0
- package/es/plus/saleDetail/tmpl/B/components/Dish/index.js +1 -0
- package/es/plus/saleDetail/tmpl/B/index.js +1 -0
- package/es/plus/salesSdk/index.js +51 -0
- package/es/plus/salesSdk/utils/addProductWithFlowDebounced.js +1 -1
- package/es/plus/salesSdk/utils/bookingDate.js +1 -1
- package/es/plus/salesSdk/utils/customerAuthGate.js +1 -1
- package/es/plus/salesSdk/utils/enrichCartLineHolderDisplay.js +1 -1
- package/es/pro/Login2.0/AuthModal.d.ts +1 -1
- package/es/pro/Login2.0/index.d.ts +2 -1
- package/es/pro/Login2.0/shared/types.d.ts +1 -1
- package/es/pro/skuDetailModal/flow/modules/time/index.js +9 -7
- package/es/pro/skuDetailModal/flow/modules/time/posCustomTime.js +26 -8
- package/es/pro/skuDetailModal/flow/types.d.ts +1 -0
- package/lib/pro/skuDetailModal/flow/modules/time/index.js +8 -6
- package/lib/pro/skuDetailModal/flow/modules/time/posCustomTime.js +27 -7
- package/lib/pro/skuDetailModal/flow/types.d.ts +1 -0
- package/package.json +5 -5
- package/es/private-materials/lowcode/authmodal/meta.d.ts +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import useEngineContext from "../../../../hooks/useEngineContext.js";
|
|
2
2
|
import { subscribeBookingDateChange } from "../../../../plus/salesSdk/utils/bookingDate.js";
|
|
3
|
+
import "../../../../plus/salesSdk/index.js";
|
|
3
4
|
import dayjs from "dayjs";
|
|
4
5
|
import { useCallback, useEffect, useState } from "react";
|
|
5
6
|
//#region src/components/bigSale/components/BookingFloatingPanel/useBookingPanelController.ts
|
|
@@ -4,6 +4,7 @@ import withResponsive from "../../../../responsive/withResponsive.js";
|
|
|
4
4
|
import useInitLocalesOnce from "../../../../hooks/useInitLocalesOnce.js";
|
|
5
5
|
import { subscribeBookingDateChange } from "../../../../plus/salesSdk/utils/bookingDate.js";
|
|
6
6
|
import { useSalesSdkBookingContext } from "../../../../plus/salesSdk/context/SalesSdkBookingContext.js";
|
|
7
|
+
import "../../../../plus/salesSdk/index.js";
|
|
7
8
|
import locales_default from "../../locales/index.js";
|
|
8
9
|
import dayjs from "dayjs";
|
|
9
10
|
import React, { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
@@ -5,6 +5,7 @@ import { buildInitBookingContextParams, collectBookingIdsFromTempOrder } from ".
|
|
|
5
5
|
import { useSalesSdk } from "../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
6
6
|
import { useSalesSdkCart } from "../../plus/salesSdk/hooks/useSalesSdkCart.js";
|
|
7
7
|
import { SalesSdkPrepareOrderSwitchContext, SalesSdkRootRefreshContext } from "../../plus/salesSdk/context/SalesSdkProvider.js";
|
|
8
|
+
import "../../plus/salesSdk/index.js";
|
|
8
9
|
import { seedDineInReservationToCart } from "../../plus/pisellReservation/utils/seedDineInReservationToCart.js";
|
|
9
10
|
import { isPersistedBigSaleOrderId } from "./utils/orderIdentity.js";
|
|
10
11
|
import BigSale from "./index.js";
|
|
@@ -4,6 +4,7 @@ import { useSalesSdkCustomer } from "../../../plus/salesSdk/hooks/useSalesSdkCus
|
|
|
4
4
|
import { useSalesSdkBookingContext } from "../../../plus/salesSdk/context/SalesSdkBookingContext.js";
|
|
5
5
|
import { useSalesSdkSummary } from "../../../plus/salesSdk/hooks/useSalesSdkSummary.js";
|
|
6
6
|
import { useSalesSdkProducts } from "../../../plus/salesSdk/hooks/useSalesSdkProducts.js";
|
|
7
|
+
import "../../../plus/salesSdk/index.js";
|
|
7
8
|
import { useMemo } from "react";
|
|
8
9
|
//#region src/components/bigSale/hooks/useBigSaleContext.ts
|
|
9
10
|
/**
|
|
@@ -3,6 +3,7 @@ import useEngineContext from "../../../hooks/useEngineContext.js";
|
|
|
3
3
|
import { buildInitBookingContextParams, collectBookingIdsFromTempOrder } from "../../../plus/salesSdk/utils/buildDefaultLoadProductsParams.js";
|
|
4
4
|
import { useSalesSdkUIHosts } from "../../../plus/salesSdk/context/SalesSdkUIHostsContext.js";
|
|
5
5
|
import { SalesSdkRootRefreshContext } from "../../../plus/salesSdk/context/SalesSdkProvider.js";
|
|
6
|
+
import "../../../plus/salesSdk/index.js";
|
|
6
7
|
import { resolveOrderIdForHostActions } from "../../../plus/pisellReservation/components/bookingDetailModal/bookingDetailHostActions.js";
|
|
7
8
|
import { usePicoCodingOpenData } from "../../../plus/pisellReservation/hooks/usePicoCodingOpenData.js";
|
|
8
9
|
import { buildReplacementBookingResourcesFromReservationRow } from "../../../plus/pisellReservation/utils/reservationTicketBookingHostParams.js";
|
|
@@ -8,6 +8,7 @@ import { useSalesSdk } from "../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
|
8
8
|
import { useSalesSdkCustomer } from "../../plus/salesSdk/hooks/useSalesSdkCustomer.js";
|
|
9
9
|
import { SalesSdkProvider } from "../../plus/salesSdk/context/SalesSdkProvider.js";
|
|
10
10
|
import { SalesSdkBookingContextProvider } from "../../plus/salesSdk/context/SalesSdkBookingContext.js";
|
|
11
|
+
import "../../plus/salesSdk/index.js";
|
|
11
12
|
import { ResponsiveBigSaleBase } from "./Base.js";
|
|
12
13
|
import { isBigSaleProductSelectionFlowScene, resolveBigSaleSelectionFlowConfig } from "./selectionFlowConfig.js";
|
|
13
14
|
import dayjs from "dayjs";
|
|
@@ -6,6 +6,7 @@ import useSalesUserLogin, { isRequireLoginChannel } from "../../../../hooks/useS
|
|
|
6
6
|
import { resolvePaymentResultToastV2ViewModel } from "../../../checkout/components/PaymentResultToastV2/resolve.js";
|
|
7
7
|
import PaymentResultToastV2_default from "../../../checkout/components/PaymentResultToastV2/index.js";
|
|
8
8
|
import { useSalesSdk } from "../../../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
9
|
+
import "../../../../plus/salesSdk/index.js";
|
|
9
10
|
import { usePickSaleDetailContext } from "../../hooks/usePickSaleDetailContext.js";
|
|
10
11
|
import { resolveBigSaleAutoProductListPreferences } from "../../utils/productListPreferences.js";
|
|
11
12
|
import { resolveBigSaleProductDisplayConfig } from "../../hooks/useBigSaleProductListConfig.js";
|
|
@@ -2,6 +2,7 @@ import { _asyncToGenerator } from "../../_virtual/_@oxc-project_runtime@0.122.0/
|
|
|
2
2
|
import useEngineContext from "../../hooks/useEngineContext.js";
|
|
3
3
|
import { useSalesSdk } from "../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
4
4
|
import { getTempOrderSyncPayload, shouldApplySharedTempOrderPayload } from "../../plus/salesSdk/tempOrderSync.js";
|
|
5
|
+
import "../../plus/salesSdk/index.js";
|
|
5
6
|
import { useEffect, useRef } from "react";
|
|
6
7
|
import { useMemoizedFn } from "ahooks";
|
|
7
8
|
//#region src/components/sharedSecondaryBigSale/SharedSecondaryBigSaleReceiver.tsx
|
package/es/index.js
CHANGED
|
@@ -85,6 +85,7 @@ import { useSalesSdkProducts } from "./plus/salesSdk/hooks/useSalesSdkProducts.j
|
|
|
85
85
|
import SalesSdkDemo from "./plus/salesSdk/demo/index.js";
|
|
86
86
|
import { useSalesSdkDish } from "./plus/salesSdk/hooks/useSalesSdkDish.js";
|
|
87
87
|
import { useSyncOsModule } from "./plus/salesSdk/hooks/useSyncOsModule.js";
|
|
88
|
+
import "./plus/salesSdk/index.js";
|
|
88
89
|
import BigSaleRightActionPanel from "./components/BigSaleRightActionPanel/index.js";
|
|
89
90
|
import { resolveBigSaleSelectionFlowConfig } from "./components/bigSale/selectionFlowConfig.js";
|
|
90
91
|
import BigSale from "./components/bigSale/index.js";
|
|
@@ -137,6 +138,7 @@ import PisellVenueControlPage from "./plus/pisellReservation/PisellVenueControlP
|
|
|
137
138
|
import PisellVenueWallPage from "./plus/pisellReservation/PisellVenueWallPage.js";
|
|
138
139
|
import PisellReservationTablePage from "./plus/pisellReservation/PisellReservationTablePage.js";
|
|
139
140
|
import SelectFloorMapResourceDialog from "./plus/pisellReservation/components/SelectFloorMapResourceDialog.js";
|
|
141
|
+
import "./plus/pisellReservation/index.js";
|
|
140
142
|
import { PisellTopology, PisellTopologyCore } from "./plus/pisellTopology/PisellTopology.js";
|
|
141
143
|
import cupProject_default from "./components/ecocup/cupProject/index.js";
|
|
142
144
|
import CupList from "./components/ecocup/cupList/index.js";
|
|
@@ -259,4 +259,4 @@ function bookingListToReservationTableRows(bookings) {
|
|
|
259
259
|
return rows;
|
|
260
260
|
}
|
|
261
261
|
//#endregion
|
|
262
|
-
export { applyHostResourceShellToBaseRow, bookingListToReservationTableRows, customerBrief, extractResourceRecordIds, filterBookingsByResourceIds, hostBookingUiPatchFromRecord, mergeBookingsForResourceRecord };
|
|
262
|
+
export { applyHostResourceShellToBaseRow, bookingListToReservationTableRows, customerBrief, extractResourceRecordIds, filterBookingsByResourceIds, hostBookingStatusToCardStatus, hostBookingUiPatchFromRecord, mergeBookingsForResourceRecord };
|
|
@@ -78,4 +78,4 @@ function toastFloorPlanLoadError(err) {
|
|
|
78
78
|
PisellToast({ content: err instanceof Error ? err.message : String(err) });
|
|
79
79
|
}
|
|
80
80
|
//#endregion
|
|
81
|
-
export { PISELL_RESERVATION_FLOOR_PLAN_CODE, ensureShopFloorPlanByCode, saveViewConfigToShopFloorPlan, shopLayoutToSceneElements$1 as shopLayoutToSceneElements, toastFloorPlanLoadError, toastFloorPlanSaveError, unsubscribeShopFloorPlanCodeQuery };
|
|
81
|
+
export { PISELL_RESERVATION_FLOOR_PLAN_CODE, buildDefaultReservationFloorPlanPostBody, ensureShopFloorPlanByCode, putShopFloorPlan, saveViewConfigToShopFloorPlan, shopLayoutToSceneElements$1 as shopLayoutToSceneElements, toastFloorPlanLoadError, toastFloorPlanSaveError, unsubscribeShopFloorPlanCodeQuery };
|
|
@@ -927,4 +927,4 @@ function getReservationDataSourceFormColumns() {
|
|
|
927
927
|
];
|
|
928
928
|
}
|
|
929
929
|
//#endregion
|
|
930
|
-
export { RESERVATION_BOUND_ROUND_TABLE_ELEMENT_KIND, RESERVATION_BOUND_TABLE_ELEMENT_KIND, applyReservationFloorMapLiveLabels, defaultReservationTableRows, getDefaultReservationFloorMapConfig, getReservationDataSourceFormColumns, getReservationFloorMapShellConfig, mergeFloorMapElementKindCategoriesWithDefaults, mergeFloorMapElementKindsWithDefaults };
|
|
930
|
+
export { RESERVATION_BOUND_ROUND_TABLE_ELEMENT_KIND, RESERVATION_BOUND_TABLE_ELEMENT_KIND, applyReservationFloorMapLiveLabels, defaultReservationSceneElements, defaultReservationTableRows, getDefaultReservationFloorMapConfig, getReservationDataSourceFormColumns, getReservationFloorMapShellConfig, mergeFloorMapElementKindCategoriesWithDefaults, mergeFloorMapElementKindsWithDefaults };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "./serve/formResourcePage.js";
|
|
2
|
+
import "./floorRoomCard/mapRowToFloorRoomCardData.js";
|
|
3
|
+
import "./floorRoomCard/ReservationFloorRoomCard.js";
|
|
4
|
+
import "./floorMap/reservationMock.js";
|
|
5
|
+
import "./floorMap/floorPlanApi.js";
|
|
6
|
+
import "./reservationConstants.js";
|
|
7
|
+
import "./data/bookingToReservationTables.js";
|
|
8
|
+
import "./data/formResourceToReservationTables.js";
|
|
9
|
+
import "./data/salesEmbeddedResourceToTableRows.js";
|
|
10
|
+
import "./floorMap/reservationCards.js";
|
|
11
|
+
import "./PisellReservation.js";
|
|
12
|
+
import "./PisellReservationBookingPage.js";
|
|
13
|
+
import "./PisellVenueControlPage.js";
|
|
14
|
+
import "./PisellVenueWallPage.js";
|
|
15
|
+
import "./PisellReservationTablePage.js";
|
|
16
|
+
import "./components/SelectFloorMapResourceDialog.js";
|
|
17
|
+
export {};
|
|
@@ -11,6 +11,7 @@ import { useSalesSdkCart } from "../salesSdk/hooks/useSalesSdkCart.js";
|
|
|
11
11
|
import { useSalesSdkCustomer } from "../salesSdk/hooks/useSalesSdkCustomer.js";
|
|
12
12
|
import { useSalesSdkBookingContext } from "../salesSdk/context/SalesSdkBookingContext.js";
|
|
13
13
|
import { useSalesSdkSummary } from "../salesSdk/hooks/useSalesSdkSummary.js";
|
|
14
|
+
import "../salesSdk/index.js";
|
|
14
15
|
import locales_default from "./locales.js";
|
|
15
16
|
import locales_default$1 from "./components/LineItem/locales.js";
|
|
16
17
|
import { SaleOrderActionBoundary } from "./actions/index.js";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
2
2
|
import useEngineContext from "../../../../../hooks/useEngineContext.js";
|
|
3
3
|
import { useSalesSdkBookingContext } from "../../../../salesSdk/context/SalesSdkBookingContext.js";
|
|
4
|
+
import "../../../../salesSdk/index.js";
|
|
4
5
|
import { useMemo } from "react";
|
|
5
6
|
import { useMemoizedFn } from "ahooks";
|
|
6
7
|
//#region src/plus/saleDetail/components/Client/hooks/useClientSelectorProps.ts
|
|
@@ -9,6 +9,7 @@ import { useSalesSdk } from "../../../salesSdk/hooks/useSalesSdk.js";
|
|
|
9
9
|
import { useSalesSdkCart } from "../../../salesSdk/hooks/useSalesSdkCart.js";
|
|
10
10
|
import { useSalesSdkGlobalScanActivity } from "../../../salesSdk/context/SalesSdkGlobalScanActivityContext.js";
|
|
11
11
|
import { useSalesSdkSummary } from "../../../salesSdk/hooks/useSalesSdkSummary.js";
|
|
12
|
+
import "../../../salesSdk/index.js";
|
|
12
13
|
import { getNumericAmount, getSalesHostModule, resolveSaleDetailOrderIdFromSales, resolveSaleDetailOrderIdFromSalesResult, shouldCloseDialogAfterCheckout, updateLocalOrder } from "./utils.js";
|
|
13
14
|
import { getRemotePrintActions, getWristbandList } from "../../serve.js";
|
|
14
15
|
import { deriveSaleOrderSubmitState } from "../../actions/state.js";
|
|
@@ -3,6 +3,7 @@ import { resolvePaymentMethodName, usePaymentMethodNameMap } from "../../../pise
|
|
|
3
3
|
import { useSalesSdk } from "../../../salesSdk/hooks/useSalesSdk.js";
|
|
4
4
|
import { useSalesSdkCart } from "../../../salesSdk/hooks/useSalesSdkCart.js";
|
|
5
5
|
import { useSalesSdkSummary } from "../../../salesSdk/hooks/useSalesSdkSummary.js";
|
|
6
|
+
import "../../../salesSdk/index.js";
|
|
6
7
|
import React, { memo, useMemo } from "react";
|
|
7
8
|
import { formatAmount, locales } from "@pisell/utils";
|
|
8
9
|
import Decimal from "decimal.js";
|
|
@@ -4,6 +4,7 @@ import { useSalesSdk } from "../salesSdk/hooks/useSalesSdk.js";
|
|
|
4
4
|
import { SalesSdkProvider } from "../salesSdk/context/SalesSdkProvider.js";
|
|
5
5
|
import { SalesSdkDishProvider } from "../salesSdk/context/SalesSdkDishContext.js";
|
|
6
6
|
import { SalesSdkBookingContextProvider } from "../salesSdk/context/SalesSdkBookingContext.js";
|
|
7
|
+
import "../salesSdk/index.js";
|
|
7
8
|
import Base_default from "./Base.js";
|
|
8
9
|
import React, { forwardRef, useImperativeHandle } from "react";
|
|
9
10
|
//#region src/plus/saleDetail/index.tsx
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import useStableInstanceId from "../../../../../../hooks/useStableInstanceId.js";
|
|
2
2
|
import { useSalesSdkDish } from "../../../../../salesSdk/hooks/useSalesSdkDish.js";
|
|
3
3
|
import { useCurrentSalesSdkDish } from "../../../../../salesSdk/hooks/useCurrentSalesSdkDish.js";
|
|
4
|
+
import "../../../../../salesSdk/index.js";
|
|
4
5
|
import { SaleDetailStatusOverview } from "../shared/StatusOverview.js";
|
|
5
6
|
import { DishGroupView } from "./DishGroupView.js";
|
|
6
7
|
import dayjs from "dayjs";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
2
2
|
import useEngineContext from "../../../../hooks/useEngineContext.js";
|
|
3
3
|
import { useCurrentSalesSdkDish } from "../../../salesSdk/hooks/useCurrentSalesSdkDish.js";
|
|
4
|
+
import "../../../salesSdk/index.js";
|
|
4
5
|
import { getInternalNotesByScheduleEvent } from "../../serve.js";
|
|
5
6
|
import { TEMPLATE_B_PAY_ACTIONS, TEMPLATE_B_SUMMARY_ACTIONS } from "../../components/DetailActions/configs/index.js";
|
|
6
7
|
import { DetailActions } from "../../components/DetailActions/index.js";
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import "./hosts/createInstanceHostBridge.js";
|
|
2
|
+
import "./holderConfirm/createHolderConfirmBridge.js";
|
|
3
|
+
import "./giftSelect/createGiftSelectBridge.js";
|
|
4
|
+
import "./context/SalesSdkHostBridgesContext.js";
|
|
5
|
+
import "./utils/formatHolderOptions.js";
|
|
6
|
+
import "./utils/enrichCartLineHolderDisplay.js";
|
|
7
|
+
import "./context/SalesSdkHolderContext.js";
|
|
8
|
+
import "./utils/appendPromotionTags.js";
|
|
9
|
+
import "./context/SalesSdkUIHostsContext.js";
|
|
10
|
+
import "./utils/runAddProductFlow.js";
|
|
11
|
+
import "./components/showAddToCartToast.js";
|
|
12
|
+
import "./utils/resolveAddProductDebounceKey.js";
|
|
13
|
+
import "./utils/productSkuOptions.js";
|
|
14
|
+
import "./utils/identity.js";
|
|
15
|
+
import "./utils/resolveInCartQuantityForAddToast.js";
|
|
16
|
+
import "./utils/addProductWithFlowDebounced.js";
|
|
17
|
+
import "./utils/customerAuthGate.js";
|
|
18
|
+
import "./utils/bookingDate.js";
|
|
19
|
+
import "./utils/holderSubmitValidation.js";
|
|
20
|
+
import "./utils/removeOrderProducts.js";
|
|
21
|
+
import "./selectors.js";
|
|
22
|
+
import "./utils/enrich.js";
|
|
23
|
+
import "./giftSelect/createOpenGiftSelectHost.js";
|
|
24
|
+
import "./utils/ensureHoldersBeforeSubmit.js";
|
|
25
|
+
import "./hooks/useSalesSdk.js";
|
|
26
|
+
import "./bookingEditService/BookingEditServiceDrawer.js";
|
|
27
|
+
import "./hosts/BookingEditHostRenderer.js";
|
|
28
|
+
import "./hosts/CustomerAuthHostRenderer.js";
|
|
29
|
+
import "./hooks/useSalesSdkCart.js";
|
|
30
|
+
import "./hooks/useSalesSdkCustomer.js";
|
|
31
|
+
import "./normalProductDetail/NormalProductDetailHostRenderer.js";
|
|
32
|
+
import "./hosts/createOpenBookingEditHost.js";
|
|
33
|
+
import "./hosts/createOpenMultiDaySelectHost.js";
|
|
34
|
+
import "./hosts/createOpenHolderSelectHost.js";
|
|
35
|
+
import "./hosts/createOpenCustomerAuthHost.js";
|
|
36
|
+
import "./demo/hosts/legacyOpenProductDetail.js";
|
|
37
|
+
import "./hosts/createCompositeOpenProductDetailHost.js";
|
|
38
|
+
import "./normalProductDetail/createOpenNormalProductDetailHost.js";
|
|
39
|
+
import "./normalProductDetail/createOpenBookingSelectionFlowHost.js";
|
|
40
|
+
import "./giftSelect/GiftSelectModal.js";
|
|
41
|
+
import "./giftSelect/GiftSelectHostRenderer.js";
|
|
42
|
+
import "./context/SalesSdkProvider.js";
|
|
43
|
+
import "./context/SalesSdkDishContext.js";
|
|
44
|
+
import "./context/SalesSdkBookingContext.js";
|
|
45
|
+
import "./hooks/useSalesSdkSummary.js";
|
|
46
|
+
import "./hooks/useSalesSdkProducts.js";
|
|
47
|
+
import "./demo/index.js";
|
|
48
|
+
import "./hooks/useSalesSdkDish.js";
|
|
49
|
+
import "./hooks/useCurrentSalesSdkDish.js";
|
|
50
|
+
import "./hooks/useSyncOsModule.js";
|
|
51
|
+
export {};
|
|
@@ -31,4 +31,4 @@ function subscribeBookingDateChange(bookingTicket, callback) {
|
|
|
31
31
|
return typeof off === "function" ? off : () => {};
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
|
-
export { formatBookingDateTime, subscribeBookingDateChange };
|
|
34
|
+
export { BOOKING_CONTEXT_DATE_EVENT, formatBookingDateTime, subscribeBookingDateChange };
|
|
@@ -62,4 +62,4 @@ function normalizeCustomerAuthCustomer(value) {
|
|
|
62
62
|
return null;
|
|
63
63
|
}
|
|
64
64
|
//#endregion
|
|
65
|
-
export { isValidOrderCustomerId, normalizeCustomerAuthCustomer, resolveCustomerAuthCurrentCustomerId, shouldPromptCustomerAuthForProduct };
|
|
65
|
+
export { isHolderRequiredProduct, isKioskRuntime, isValidOrderCustomerId, normalizeCustomerAuthCustomer, resolveCustomerAuthCurrentCustomerId, shouldPromptCustomerAuthForProduct };
|
|
@@ -71,4 +71,4 @@ function buildHolderListRequestKey(params) {
|
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
//#endregion
|
|
74
|
-
export { buildHolderListRequestKey, buildHolderListRequestParams, enrichCartBookingHolderDisplay, resolveHolderDisplayConfig };
|
|
74
|
+
export { buildHolderListRequestKey, buildHolderListRequestParams, enrichCartBookingHolderDisplay, pickHolderIdFromBooking, resolveHolderDisplayConfig };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AuthMethodType, EmailAuthConfig, EmailRegistrationVerification, LoginFormData, OAuthConfig, PhoneAuthConfig, RegisterFormData, UIConfig, VerificationMethod } from "./shared/types.js";
|
|
1
2
|
import { Login2, Login2Config, Login2Events, Login2Props } from "./Login2.js";
|
|
2
3
|
import { Register2, Register2Config, Register2Events, Register2Props } from "./Register2.js";
|
|
3
|
-
import { AuthModal
|
|
4
|
+
import { AuthModal } from "./AuthModal.js";
|
|
@@ -226,4 +226,4 @@ interface RegisterFormData {
|
|
|
226
226
|
verification_token?: string;
|
|
227
227
|
}
|
|
228
228
|
//#endregion
|
|
229
|
-
export { AuthMethodType, EmailAuthConfig, LegalTermsConfig, LoginFormData, LoginMethodItem, OAuthConfig, PhoneAuthConfig, RegisterFormData, RegistrationMethodItem, UIConfig };
|
|
229
|
+
export { AuthMethodType, EmailAuthConfig, EmailRegistrationVerification, LegalTermsConfig, LoginFormData, LoginMethodItem, OAuthConfig, PhoneAuthConfig, RegisterFormData, RegistrationMethodItem, UIConfig, VerificationMethod };
|
|
@@ -10,7 +10,7 @@ import { buildDraftCacheItem, getModuleOptions, getUnsupportedBookingFlowReason,
|
|
|
10
10
|
import TimeResourceSelector from "../../../../../components/eventBooking/components/timeResourceSelector/index.js";
|
|
11
11
|
import { resolveAvailabilityStatus } from "../../../../../components/eventBooking/components/bookingAvailabilityCalendar/utils.js";
|
|
12
12
|
import { validateAvailabilityTimeAutoResolution } from "../autoResolution.js";
|
|
13
|
-
import { getAvailabilityCandidateDurationMinutes, getPosFlexibleDurationPresetCandidates, getSessionPresetCandidates, isFlexibleDurationValue, isSameAvailabilityCandidateRange, resolvePosCustomTimeBaseMinutes, resolvePosCustomTimeCandidate, resolvePosCustomTimeDefaultDurationMinutes, resolvePosCustomTimeDefaultStartTime, resolvePosFlexibleDurationInitialCandidate, shouldShowPosCustomTimeCandidateCards } from "./posCustomTime.js";
|
|
13
|
+
import { getAvailabilityCandidateDurationMinutes, getPosFlexibleDurationPresetCandidates, getSessionPresetCandidates, isFlexibleDurationValue, isSameAvailabilityCandidateRange, resolvePosCustomTimeBaseMinutes, resolvePosCustomTimeCandidate, resolvePosCustomTimeDefaultDurationMinutes, resolvePosCustomTimeDefaultStartTime, resolvePosFlexibleBusinessDurationMinutes, resolvePosFlexibleDurationInitialCandidate, shouldResetPosFlexibleTimeForDate, shouldShowPosCustomTimeCandidateCards } from "./posCustomTime.js";
|
|
14
14
|
import dayjs from "dayjs";
|
|
15
15
|
import React, { useEffect, useMemo } from "react";
|
|
16
16
|
import { Alert, Space } from "antd";
|
|
@@ -174,6 +174,7 @@ const refreshAvailabilityTimes = function() {
|
|
|
174
174
|
const requestedStartTime = getAvailabilityStartTimeOverride(context, startTimeOverride);
|
|
175
175
|
const selectedDate = context.draft.booking.startDate.format("YYYY-MM-DD");
|
|
176
176
|
const requestId = Date.now() + Math.random();
|
|
177
|
+
const previousTimeData = context.getModuleData(module.key);
|
|
177
178
|
const posCustomTimeHydrationKey = posCustomTimeAvailability && requestedDuration && requestedStartTime ? `${selectedDate}|${requestedStartTime}|${requestedDuration}` : void 0;
|
|
178
179
|
context.setModuleData(module.key, {
|
|
179
180
|
requestId,
|
|
@@ -191,13 +192,14 @@ const refreshAvailabilityTimes = function() {
|
|
|
191
192
|
const candidates = (group === null || group === void 0 ? void 0 : group.ranges) || [];
|
|
192
193
|
const product = context.draft.productData;
|
|
193
194
|
if (posDurationAvailability && selectionIntent === "restore" && isFlexibleDurationValue(product === null || product === void 0 ? void 0 : product.duration)) {
|
|
194
|
-
var _context$hostContext, _moduleOptions$slice, _normalizeDurationMin3;
|
|
195
|
+
var _context$hostContext, _moduleOptions$slice, _context$draft$bookin2, _normalizeDurationMin3;
|
|
195
196
|
const moduleOptions = getModuleOptions(module);
|
|
196
197
|
const configuredSlice = (_context$hostContext = context.hostContext) === null || _context$hostContext === void 0 || (_context$hostContext = _context$hostContext.bookingConfig) === null || _context$hostContext === void 0 || (_context$hostContext = _context$hostContext.config) === null || _context$hostContext === void 0 || (_context$hostContext = _context$hostContext.basic) === null || _context$hostContext === void 0 ? void 0 : _context$hostContext.service_time;
|
|
197
198
|
const fallbackSlice = (_moduleOptions$slice = moduleOptions.slice) !== null && _moduleOptions$slice !== void 0 ? _moduleOptions$slice : typeof configuredSlice === "object" ? configuredSlice === null || configuredSlice === void 0 ? void 0 : configuredSlice.value : configuredSlice;
|
|
198
199
|
const baseDurationMinutes = resolvePosCustomTimeBaseMinutes(group === null || group === void 0 ? void 0 : group.slotStepMinutes, fallbackSlice);
|
|
199
|
-
const
|
|
200
|
-
const
|
|
200
|
+
const resetForSelectedDate = shouldResetPosFlexibleTimeForDate((_context$draft$bookin2 = context.draft.booking.selectedCandidate) !== null && _context$draft$bookin2 !== void 0 ? _context$draft$bookin2 : previousTimeData === null || previousTimeData === void 0 ? void 0 : previousTimeData.selectedCandidate, selectedDate);
|
|
201
|
+
const nextStartTime = resolvePosCustomTimeDefaultStartTime(resetForSelectedDate ? null : context.draft.booking.startTime, baseDurationMinutes);
|
|
202
|
+
const nextDuration = resolvePosCustomTimeDefaultDurationMinutes(resetForSelectedDate ? product === null || product === void 0 ? void 0 : product.duration : (_normalizeDurationMin3 = normalizeDurationMinutesValue(context.draft.booking.duration)) !== null && _normalizeDurationMin3 !== void 0 ? _normalizeDurationMin3 : context.draft.booking.duration, baseDurationMinutes, context.services.selectionFlowMode === "edit" ? void 0 : resolvePosFlexibleBusinessDurationMinutes(nextStartTime, (group === null || group === void 0 ? void 0 : group.operatingEndAt) ? dayjs(group.operatingEndAt).format("HH:mm") : void 0));
|
|
201
203
|
const changedFields = [];
|
|
202
204
|
if (nextStartTime !== context.draft.booking.startTime) changedFields.push("booking.startTime");
|
|
203
205
|
if (nextDuration !== context.draft.booking.duration) changedFields.push("booking.duration");
|
|
@@ -280,7 +282,7 @@ const refreshAvailabilityTimes = function() {
|
|
|
280
282
|
const normallySelectableCandidates = times.filter((candidate) => isAvailabilityCandidateSelectable(candidate));
|
|
281
283
|
const selectableCandidates = normallySelectableCandidates.length > 0 || !allowUnavailable ? normallySelectableCandidates : times;
|
|
282
284
|
const shouldPreserveRequestedPosStart = posCustomTimeAvailability && Boolean(requestedPosStartTime && requestedPosDuration);
|
|
283
|
-
const displayCandidates = posSessionAvailability ? getSessionPresetCandidates(times) : posDurationAvailability && isFlexibleDurationValue(product === null || product === void 0 ? void 0 : product.duration) ? getPosFlexibleDurationPresetCandidates(times, requestedCustomRange, customSelectionIntent) : times;
|
|
285
|
+
const displayCandidates = posSessionAvailability ? getSessionPresetCandidates(times) : posDurationAvailability && isFlexibleDurationValue(product === null || product === void 0 ? void 0 : product.duration) ? getPosFlexibleDurationPresetCandidates(times, requestedCustomRange, customSelectionIntent, Boolean(!customSelectionIntent && existingCandidate && existingCandidate.date === selectedDate && (previousTimeData === null || previousTimeData === void 0 ? void 0 : previousTimeData.timeSlots.some((slot) => String(slot.id) === String(existingCandidate.key))))) : times;
|
|
284
286
|
const fallbackCandidate = shouldPreserveRequestedPosStart ? void 0 : selectableCandidates[0];
|
|
285
287
|
const preferPosFlexiblePreset = posDurationAvailability && isFlexibleDurationValue(product === null || product === void 0 ? void 0 : product.duration) && !customSelectionIntent && context.services.selectionFlowMode !== "edit" && (selectionIntent === "fallback" || !existingCandidate || existingCandidate.date !== selectedDate);
|
|
286
288
|
const initialCandidate = posDurationAvailability && isFlexibleDurationValue(product === null || product === void 0 ? void 0 : product.duration) ? resolvePosFlexibleDurationInitialCandidate({
|
|
@@ -594,12 +596,12 @@ const TimeFlowModuleComponent = ({ context, module, registerHandle }) => {
|
|
|
594
596
|
return () => registerHandle === null || registerHandle === void 0 ? void 0 : registerHandle(null);
|
|
595
597
|
}, [handle, registerHandle]);
|
|
596
598
|
useEffect(() => {
|
|
597
|
-
var _context$draft$
|
|
599
|
+
var _context$draft$bookin3;
|
|
598
600
|
if (!usePosCustomTimeAvailability || !availability) return;
|
|
599
601
|
if (!startTime || !hasDurationValue(duration)) return;
|
|
600
602
|
if (availabilityData === null || availabilityData === void 0 ? void 0 : availabilityData.selectedCandidate) return;
|
|
601
603
|
if (moduleStatus === "loading") return;
|
|
602
|
-
const selectedDate = (_context$draft$
|
|
604
|
+
const selectedDate = (_context$draft$bookin3 = context.draft.booking.startDate) === null || _context$draft$bookin3 === void 0 ? void 0 : _context$draft$bookin3.format("YYYY-MM-DD");
|
|
603
605
|
const requestedDuration = getAvailabilityDurationOverride(context);
|
|
604
606
|
const requestedStartTime = getAvailabilityStartTimeOverride(context);
|
|
605
607
|
if (!selectedDate || !requestedDuration || !requestedStartTime) return;
|
|
@@ -28,10 +28,28 @@ const resolvePosCustomTimeDefaultStartTime = (currentValue, sliceMinutes, now) =
|
|
|
28
28
|
const minutes = alignedMinute % 60;
|
|
29
29
|
return `${String(hours).padStart(2, "0")}:${String(minutes).padStart(2, "0")}`;
|
|
30
30
|
};
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
const resolvePosFlexibleBusinessDurationMinutes = (startTime, closingTime) => {
|
|
32
|
+
const toMinuteOfDay = (value) => {
|
|
33
|
+
if (typeof value !== "string") return null;
|
|
34
|
+
const matched = value.trim().match(/^([01]\d|2[0-3]):([0-5]\d)(?::[0-5]\d)?$/);
|
|
35
|
+
if (!matched) return null;
|
|
36
|
+
return Number(matched[1]) * 60 + Number(matched[2]);
|
|
37
|
+
};
|
|
38
|
+
const startMinute = toMinuteOfDay(startTime);
|
|
39
|
+
const closingMinute = toMinuteOfDay(closingTime);
|
|
40
|
+
if (startMinute === null || closingMinute === null) return null;
|
|
41
|
+
const duration = closingMinute > startMinute ? closingMinute - startMinute : closingMinute < startMinute ? closingMinute + 1440 - startMinute : 0;
|
|
42
|
+
return duration > 0 ? duration : null;
|
|
43
|
+
};
|
|
44
|
+
const shouldResetPosFlexibleTimeForDate = (candidate, selectedDate) => Boolean(candidate && candidate.date !== selectedDate);
|
|
45
|
+
const resolvePosCustomTimeDefaultDurationMinutes = (currentValue, baseDurationMinutes, flexibleDefaultMinutes) => {
|
|
46
|
+
if (isFlexibleDurationValue(currentValue)) {
|
|
47
|
+
const flexibleMinutes = Number(flexibleDefaultMinutes);
|
|
48
|
+
if (Number.isFinite(flexibleMinutes) && flexibleMinutes > 0) return Math.max(1, Math.floor(flexibleMinutes));
|
|
49
|
+
if (typeof currentValue === "string") {
|
|
50
|
+
const flexibleMatch = currentValue.trim().toLowerCase().match(/^flexible_(\d+(?:\.\d+)?)$/);
|
|
51
|
+
if (flexibleMatch) return Math.max(1, Math.floor(Number(flexibleMatch[1])));
|
|
52
|
+
}
|
|
35
53
|
}
|
|
36
54
|
const currentMinutes = Number(currentValue);
|
|
37
55
|
if (Number.isFinite(currentMinutes) && currentMinutes > 0) return Math.max(1, Math.floor(currentMinutes));
|
|
@@ -55,10 +73,10 @@ const resolvePosCustomTimeCandidate = (params) => {
|
|
|
55
73
|
return params.restoredDraftCandidate || params.restoredExistingCandidate || params.fallbackCandidate;
|
|
56
74
|
};
|
|
57
75
|
const getSessionPresetCandidates = (candidates) => candidates.filter((candidate) => candidate.source === "session_schedule");
|
|
58
|
-
const getPosFlexibleDurationPresetCandidates = (candidates, requestedCustomRange, customSelectionIntent = false) => {
|
|
76
|
+
const getPosFlexibleDurationPresetCandidates = (candidates, requestedCustomRange, customSelectionIntent = false, preserveRequestedRange = false) => {
|
|
59
77
|
if (!requestedCustomRange) return [...candidates];
|
|
60
|
-
|
|
61
|
-
return
|
|
78
|
+
if (preserveRequestedRange && !customSelectionIntent) return [...candidates];
|
|
79
|
+
return candidates.filter((candidate) => !isSameAvailabilityCandidateRange(candidate, requestedCustomRange));
|
|
62
80
|
};
|
|
63
81
|
const resolvePosFlexibleDurationInitialCandidate = (params) => {
|
|
64
82
|
const firstAvailablePreset = params.presetCandidates.find((candidate) => (!candidate.status || candidate.status === "available" || candidate.status === "limited") && !(typeof candidate.maxPartySize === "number" && candidate.maxPartySize <= 0));
|
|
@@ -66,4 +84,4 @@ const resolvePosFlexibleDurationInitialCandidate = (params) => {
|
|
|
66
84
|
return params.restoredCandidate || params.fallbackCandidate;
|
|
67
85
|
};
|
|
68
86
|
//#endregion
|
|
69
|
-
export { getAvailabilityCandidateDurationMinutes, getPosFlexibleDurationPresetCandidates, getSessionPresetCandidates, isFlexibleDurationValue, isSameAvailabilityCandidateRange, resolvePosCustomTimeBaseMinutes, resolvePosCustomTimeCandidate, resolvePosCustomTimeDefaultDurationMinutes, resolvePosCustomTimeDefaultStartTime, resolvePosFlexibleDurationInitialCandidate, shouldShowPosCustomTimeCandidateCards };
|
|
87
|
+
export { getAvailabilityCandidateDurationMinutes, getPosFlexibleDurationPresetCandidates, getSessionPresetCandidates, isFlexibleDurationValue, isSameAvailabilityCandidateRange, resolvePosCustomTimeBaseMinutes, resolvePosCustomTimeCandidate, resolvePosCustomTimeDefaultDurationMinutes, resolvePosCustomTimeDefaultStartTime, resolvePosFlexibleBusinessDurationMinutes, resolvePosFlexibleDurationInitialCandidate, shouldResetPosFlexibleTimeForDate, shouldShowPosCustomTimeCandidateCards };
|
|
@@ -168,6 +168,7 @@ interface SelectionFlowAvailabilityService {
|
|
|
168
168
|
title?: string;
|
|
169
169
|
kind: 'normal' | 'duration' | 'session' | 'venue_slot';
|
|
170
170
|
slotStepMinutes?: number;
|
|
171
|
+
operatingEndAt?: string;
|
|
171
172
|
ranges: SelectionFlowAvailabilityCandidate[];
|
|
172
173
|
}>>;
|
|
173
174
|
queryBookingAvailability: (contextId: string, request: Record<string, unknown>) => Promise<{
|
|
@@ -178,6 +178,7 @@ const refreshAvailabilityTimes = function() {
|
|
|
178
178
|
const requestedStartTime = getAvailabilityStartTimeOverride(context, startTimeOverride);
|
|
179
179
|
const selectedDate = context.draft.booking.startDate.format("YYYY-MM-DD");
|
|
180
180
|
const requestId = Date.now() + Math.random();
|
|
181
|
+
const previousTimeData = context.getModuleData(module.key);
|
|
181
182
|
const posCustomTimeHydrationKey = posCustomTimeAvailability && requestedDuration && requestedStartTime ? `${selectedDate}|${requestedStartTime}|${requestedDuration}` : void 0;
|
|
182
183
|
context.setModuleData(module.key, {
|
|
183
184
|
requestId,
|
|
@@ -195,13 +196,14 @@ const refreshAvailabilityTimes = function() {
|
|
|
195
196
|
const candidates = (group === null || group === void 0 ? void 0 : group.ranges) || [];
|
|
196
197
|
const product = context.draft.productData;
|
|
197
198
|
if (posDurationAvailability && selectionIntent === "restore" && require_posCustomTime.isFlexibleDurationValue(product === null || product === void 0 ? void 0 : product.duration)) {
|
|
198
|
-
var _context$hostContext, _moduleOptions$slice, _normalizeDurationMin3;
|
|
199
|
+
var _context$hostContext, _moduleOptions$slice, _context$draft$bookin2, _normalizeDurationMin3;
|
|
199
200
|
const moduleOptions = require_index$1.getModuleOptions(module);
|
|
200
201
|
const configuredSlice = (_context$hostContext = context.hostContext) === null || _context$hostContext === void 0 || (_context$hostContext = _context$hostContext.bookingConfig) === null || _context$hostContext === void 0 || (_context$hostContext = _context$hostContext.config) === null || _context$hostContext === void 0 || (_context$hostContext = _context$hostContext.basic) === null || _context$hostContext === void 0 ? void 0 : _context$hostContext.service_time;
|
|
201
202
|
const fallbackSlice = (_moduleOptions$slice = moduleOptions.slice) !== null && _moduleOptions$slice !== void 0 ? _moduleOptions$slice : typeof configuredSlice === "object" ? configuredSlice === null || configuredSlice === void 0 ? void 0 : configuredSlice.value : configuredSlice;
|
|
202
203
|
const baseDurationMinutes = require_posCustomTime.resolvePosCustomTimeBaseMinutes(group === null || group === void 0 ? void 0 : group.slotStepMinutes, fallbackSlice);
|
|
203
|
-
const
|
|
204
|
-
const
|
|
204
|
+
const resetForSelectedDate = require_posCustomTime.shouldResetPosFlexibleTimeForDate((_context$draft$bookin2 = context.draft.booking.selectedCandidate) !== null && _context$draft$bookin2 !== void 0 ? _context$draft$bookin2 : previousTimeData === null || previousTimeData === void 0 ? void 0 : previousTimeData.selectedCandidate, selectedDate);
|
|
205
|
+
const nextStartTime = require_posCustomTime.resolvePosCustomTimeDefaultStartTime(resetForSelectedDate ? null : context.draft.booking.startTime, baseDurationMinutes);
|
|
206
|
+
const nextDuration = require_posCustomTime.resolvePosCustomTimeDefaultDurationMinutes(resetForSelectedDate ? product === null || product === void 0 ? void 0 : product.duration : (_normalizeDurationMin3 = normalizeDurationMinutesValue(context.draft.booking.duration)) !== null && _normalizeDurationMin3 !== void 0 ? _normalizeDurationMin3 : context.draft.booking.duration, baseDurationMinutes, context.services.selectionFlowMode === "edit" ? void 0 : require_posCustomTime.resolvePosFlexibleBusinessDurationMinutes(nextStartTime, (group === null || group === void 0 ? void 0 : group.operatingEndAt) ? (0, dayjs.default)(group.operatingEndAt).format("HH:mm") : void 0));
|
|
205
207
|
const changedFields = [];
|
|
206
208
|
if (nextStartTime !== context.draft.booking.startTime) changedFields.push("booking.startTime");
|
|
207
209
|
if (nextDuration !== context.draft.booking.duration) changedFields.push("booking.duration");
|
|
@@ -284,7 +286,7 @@ const refreshAvailabilityTimes = function() {
|
|
|
284
286
|
const normallySelectableCandidates = times.filter((candidate) => isAvailabilityCandidateSelectable(candidate));
|
|
285
287
|
const selectableCandidates = normallySelectableCandidates.length > 0 || !allowUnavailable ? normallySelectableCandidates : times;
|
|
286
288
|
const shouldPreserveRequestedPosStart = posCustomTimeAvailability && Boolean(requestedPosStartTime && requestedPosDuration);
|
|
287
|
-
const displayCandidates = posSessionAvailability ? require_posCustomTime.getSessionPresetCandidates(times) : posDurationAvailability && require_posCustomTime.isFlexibleDurationValue(product === null || product === void 0 ? void 0 : product.duration) ? require_posCustomTime.getPosFlexibleDurationPresetCandidates(times, requestedCustomRange, customSelectionIntent) : times;
|
|
289
|
+
const displayCandidates = posSessionAvailability ? require_posCustomTime.getSessionPresetCandidates(times) : posDurationAvailability && require_posCustomTime.isFlexibleDurationValue(product === null || product === void 0 ? void 0 : product.duration) ? require_posCustomTime.getPosFlexibleDurationPresetCandidates(times, requestedCustomRange, customSelectionIntent, Boolean(!customSelectionIntent && existingCandidate && existingCandidate.date === selectedDate && (previousTimeData === null || previousTimeData === void 0 ? void 0 : previousTimeData.timeSlots.some((slot) => String(slot.id) === String(existingCandidate.key))))) : times;
|
|
288
290
|
const fallbackCandidate = shouldPreserveRequestedPosStart ? void 0 : selectableCandidates[0];
|
|
289
291
|
const preferPosFlexiblePreset = posDurationAvailability && require_posCustomTime.isFlexibleDurationValue(product === null || product === void 0 ? void 0 : product.duration) && !customSelectionIntent && context.services.selectionFlowMode !== "edit" && (selectionIntent === "fallback" || !existingCandidate || existingCandidate.date !== selectedDate);
|
|
290
292
|
const initialCandidate = posDurationAvailability && require_posCustomTime.isFlexibleDurationValue(product === null || product === void 0 ? void 0 : product.duration) ? require_posCustomTime.resolvePosFlexibleDurationInitialCandidate({
|
|
@@ -598,12 +600,12 @@ const TimeFlowModuleComponent = ({ context, module, registerHandle }) => {
|
|
|
598
600
|
return () => registerHandle === null || registerHandle === void 0 ? void 0 : registerHandle(null);
|
|
599
601
|
}, [handle, registerHandle]);
|
|
600
602
|
(0, react.useEffect)(() => {
|
|
601
|
-
var _context$draft$
|
|
603
|
+
var _context$draft$bookin3;
|
|
602
604
|
if (!usePosCustomTimeAvailability || !availability) return;
|
|
603
605
|
if (!startTime || !hasDurationValue(duration)) return;
|
|
604
606
|
if (availabilityData === null || availabilityData === void 0 ? void 0 : availabilityData.selectedCandidate) return;
|
|
605
607
|
if (moduleStatus === "loading") return;
|
|
606
|
-
const selectedDate = (_context$draft$
|
|
608
|
+
const selectedDate = (_context$draft$bookin3 = context.draft.booking.startDate) === null || _context$draft$bookin3 === void 0 ? void 0 : _context$draft$bookin3.format("YYYY-MM-DD");
|
|
607
609
|
const requestedDuration = getAvailabilityDurationOverride(context);
|
|
608
610
|
const requestedStartTime = getAvailabilityStartTimeOverride(context);
|
|
609
611
|
if (!selectedDate || !requestedDuration || !requestedStartTime) return;
|
|
@@ -30,10 +30,28 @@ const resolvePosCustomTimeDefaultStartTime = (currentValue, sliceMinutes, now) =
|
|
|
30
30
|
const minutes = alignedMinute % 60;
|
|
31
31
|
return `${String(hours).padStart(2, "0")}:${String(minutes).padStart(2, "0")}`;
|
|
32
32
|
};
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
const resolvePosFlexibleBusinessDurationMinutes = (startTime, closingTime) => {
|
|
34
|
+
const toMinuteOfDay = (value) => {
|
|
35
|
+
if (typeof value !== "string") return null;
|
|
36
|
+
const matched = value.trim().match(/^([01]\d|2[0-3]):([0-5]\d)(?::[0-5]\d)?$/);
|
|
37
|
+
if (!matched) return null;
|
|
38
|
+
return Number(matched[1]) * 60 + Number(matched[2]);
|
|
39
|
+
};
|
|
40
|
+
const startMinute = toMinuteOfDay(startTime);
|
|
41
|
+
const closingMinute = toMinuteOfDay(closingTime);
|
|
42
|
+
if (startMinute === null || closingMinute === null) return null;
|
|
43
|
+
const duration = closingMinute > startMinute ? closingMinute - startMinute : closingMinute < startMinute ? closingMinute + 1440 - startMinute : 0;
|
|
44
|
+
return duration > 0 ? duration : null;
|
|
45
|
+
};
|
|
46
|
+
const shouldResetPosFlexibleTimeForDate = (candidate, selectedDate) => Boolean(candidate && candidate.date !== selectedDate);
|
|
47
|
+
const resolvePosCustomTimeDefaultDurationMinutes = (currentValue, baseDurationMinutes, flexibleDefaultMinutes) => {
|
|
48
|
+
if (isFlexibleDurationValue(currentValue)) {
|
|
49
|
+
const flexibleMinutes = Number(flexibleDefaultMinutes);
|
|
50
|
+
if (Number.isFinite(flexibleMinutes) && flexibleMinutes > 0) return Math.max(1, Math.floor(flexibleMinutes));
|
|
51
|
+
if (typeof currentValue === "string") {
|
|
52
|
+
const flexibleMatch = currentValue.trim().toLowerCase().match(/^flexible_(\d+(?:\.\d+)?)$/);
|
|
53
|
+
if (flexibleMatch) return Math.max(1, Math.floor(Number(flexibleMatch[1])));
|
|
54
|
+
}
|
|
37
55
|
}
|
|
38
56
|
const currentMinutes = Number(currentValue);
|
|
39
57
|
if (Number.isFinite(currentMinutes) && currentMinutes > 0) return Math.max(1, Math.floor(currentMinutes));
|
|
@@ -57,10 +75,10 @@ const resolvePosCustomTimeCandidate = (params) => {
|
|
|
57
75
|
return params.restoredDraftCandidate || params.restoredExistingCandidate || params.fallbackCandidate;
|
|
58
76
|
};
|
|
59
77
|
const getSessionPresetCandidates = (candidates) => candidates.filter((candidate) => candidate.source === "session_schedule");
|
|
60
|
-
const getPosFlexibleDurationPresetCandidates = (candidates, requestedCustomRange, customSelectionIntent = false) => {
|
|
78
|
+
const getPosFlexibleDurationPresetCandidates = (candidates, requestedCustomRange, customSelectionIntent = false, preserveRequestedRange = false) => {
|
|
61
79
|
if (!requestedCustomRange) return [...candidates];
|
|
62
|
-
|
|
63
|
-
return
|
|
80
|
+
if (preserveRequestedRange && !customSelectionIntent) return [...candidates];
|
|
81
|
+
return candidates.filter((candidate) => !isSameAvailabilityCandidateRange(candidate, requestedCustomRange));
|
|
64
82
|
};
|
|
65
83
|
const resolvePosFlexibleDurationInitialCandidate = (params) => {
|
|
66
84
|
const firstAvailablePreset = params.presetCandidates.find((candidate) => (!candidate.status || candidate.status === "available" || candidate.status === "limited") && !(typeof candidate.maxPartySize === "number" && candidate.maxPartySize <= 0));
|
|
@@ -77,5 +95,7 @@ exports.resolvePosCustomTimeBaseMinutes = resolvePosCustomTimeBaseMinutes;
|
|
|
77
95
|
exports.resolvePosCustomTimeCandidate = resolvePosCustomTimeCandidate;
|
|
78
96
|
exports.resolvePosCustomTimeDefaultDurationMinutes = resolvePosCustomTimeDefaultDurationMinutes;
|
|
79
97
|
exports.resolvePosCustomTimeDefaultStartTime = resolvePosCustomTimeDefaultStartTime;
|
|
98
|
+
exports.resolvePosFlexibleBusinessDurationMinutes = resolvePosFlexibleBusinessDurationMinutes;
|
|
80
99
|
exports.resolvePosFlexibleDurationInitialCandidate = resolvePosFlexibleDurationInitialCandidate;
|
|
100
|
+
exports.shouldResetPosFlexibleTimeForDate = shouldResetPosFlexibleTimeForDate;
|
|
81
101
|
exports.shouldShowPosCustomTimeCandidateCards = shouldShowPosCustomTimeCandidateCards;
|
|
@@ -168,6 +168,7 @@ interface SelectionFlowAvailabilityService {
|
|
|
168
168
|
title?: string;
|
|
169
169
|
kind: 'normal' | 'duration' | 'session' | 'venue_slot';
|
|
170
170
|
slotStepMinutes?: number;
|
|
171
|
+
operatingEndAt?: string;
|
|
171
172
|
ranges: SelectionFlowAvailabilityCandidate[];
|
|
172
173
|
}>>;
|
|
173
174
|
queryBookingAvailability: (contextId: string, request: Record<string, unknown>) => Promise<{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "6.11.
|
|
3
|
+
"version": "6.11.656",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -69,11 +69,11 @@
|
|
|
69
69
|
"react-zoom-pan-pinch": "^3.7.0",
|
|
70
70
|
"styled-components": "^6.0.0-rc.3",
|
|
71
71
|
"use-sync-external-store": "^1.6.0",
|
|
72
|
-
"@pisell/
|
|
73
|
-
"@pisell/materials": "6.11.256",
|
|
72
|
+
"@pisell/utils": "3.0.4",
|
|
74
73
|
"@pisell/icon": "0.0.11",
|
|
75
|
-
"@pisell/
|
|
76
|
-
"@pisell/
|
|
74
|
+
"@pisell/materials": "6.11.256",
|
|
75
|
+
"@pisell/pi-payment-sdk": "0.0.3",
|
|
76
|
+
"@pisell/date-picker": "3.0.10"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
79
|
"react": "^18.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|